refactor: rename agent widget references to AI agent for consistency
- Updated runtime configuration to use __CS_AI_AGENT_WIDGET_CONFIG__ instead of __CS_AGENT_WIDGET_CONFIG__. - Changed message types in support host bridge from "cs-agent" to "cs-ai-agent". - Minified SDK script updated to reflect new AI agent naming conventions. - Adjusted scrollbar styles in main.scss to use .cs-ai-agent-scrollbar instead of .cs-agent-scrollbar.
This commit is contained in:
@@ -30,15 +30,15 @@ export const MessageImageExtension = Image.extend({
|
||||
return ({ node }) => {
|
||||
const wrapper = document.createElement("span")
|
||||
wrapper.className =
|
||||
"cs-agent-editor-image-wrap relative inline-block max-w-full align-middle"
|
||||
"cs-ai-agent-editor-image-wrap relative inline-block max-w-full align-middle"
|
||||
|
||||
const image = document.createElement("img")
|
||||
image.className = "cs-agent-editor-image"
|
||||
image.className = "cs-ai-agent-editor-image"
|
||||
image.draggable = true
|
||||
|
||||
const overlay = document.createElement("span")
|
||||
overlay.className =
|
||||
"cs-agent-editor-image-loading pointer-events-none absolute inset-0 hidden items-center justify-center rounded-lg bg-background/55 backdrop-blur-[1px]"
|
||||
"cs-ai-agent-editor-image-loading pointer-events-none absolute inset-0 hidden items-center justify-center rounded-lg bg-background/55 backdrop-blur-[1px]"
|
||||
|
||||
const spinner = document.createElement("span")
|
||||
spinner.className =
|
||||
@@ -115,10 +115,10 @@ 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.classList.remove("cs-ai-agent-editor-image-uploading")
|
||||
image.removeAttribute("data-uploading")
|
||||
image.removeAttribute("title")
|
||||
setImageUploading(image.closest(".cs-agent-editor-image-wrap"), false)
|
||||
setImageUploading(image.closest(".cs-ai-agent-editor-image-wrap"), false)
|
||||
}
|
||||
|
||||
export function setEditorImageUploadingByTitle(editor: Editor, title: string) {
|
||||
@@ -126,9 +126,9 @@ export function setEditorImageUploadingByTitle(editor: Editor, title: string) {
|
||||
if (!image) {
|
||||
return
|
||||
}
|
||||
image.classList.add("cs-agent-editor-image-uploading")
|
||||
image.classList.add("cs-ai-agent-editor-image-uploading")
|
||||
image.setAttribute("data-uploading", "true")
|
||||
setImageUploading(image.closest(".cs-agent-editor-image-wrap"), true)
|
||||
setImageUploading(image.closest(".cs-ai-agent-editor-image-wrap"), true)
|
||||
}
|
||||
|
||||
export function buildSendableEditorHTML(
|
||||
@@ -223,8 +223,8 @@ function setImageUploading(wrapper: Element | null, uploading: boolean) {
|
||||
if (!(wrapper instanceof HTMLElement)) {
|
||||
return
|
||||
}
|
||||
wrapper.classList.toggle("cs-agent-editor-image-wrap-uploading", uploading)
|
||||
const overlay = wrapper.querySelector<HTMLElement>(".cs-agent-editor-image-loading")
|
||||
wrapper.classList.toggle("cs-ai-agent-editor-image-wrap-uploading", uploading)
|
||||
const overlay = wrapper.querySelector<HTMLElement>(".cs-ai-agent-editor-image-loading")
|
||||
if (overlay) {
|
||||
overlay.classList.toggle("hidden", !uploading)
|
||||
overlay.classList.toggle("flex", uploading)
|
||||
|
||||
Reference in New Issue
Block a user