refactor: enhance image uploading feedback in message editors with new class handling
This commit is contained in:
@@ -40,9 +40,20 @@ export function markEditorImageUploadedByTitle(
|
||||
image.setAttribute("data-provider", uploaded.provider)
|
||||
image.setAttribute("data-storage-key", uploaded.storageKey)
|
||||
image.setAttribute("alt", uploaded.filename || image.getAttribute("alt") || "image")
|
||||
image.classList.remove("cs-agent-editor-image-uploading")
|
||||
image.removeAttribute("data-uploading")
|
||||
image.removeAttribute("title")
|
||||
}
|
||||
|
||||
export function setEditorImageUploadingByTitle(editor: Editor, title: string) {
|
||||
const image = findEditorImageElementByTitle(editor, title)
|
||||
if (!image) {
|
||||
return
|
||||
}
|
||||
image.classList.add("cs-agent-editor-image-uploading")
|
||||
image.setAttribute("data-uploading", "true")
|
||||
}
|
||||
|
||||
export function buildSendableEditorHTML(
|
||||
html: string,
|
||||
uploadedImages?: UploadedEditorImageMap
|
||||
|
||||
Reference in New Issue
Block a user