isometrik-plugin-chat-sdk 1.3.13 → 1.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/attachment-preview_22.cjs.entry.js +20 -3
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/isometrik-webchat.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/login-page_3.cjs.entry.js +5 -2
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +21 -3
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +19 -0
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +3 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/index.js +3 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/components/ChatFooter.js +21 -3
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/WebChat.js +6 -2
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -1
- package/dist/esm/attachment-preview_22.entry.js +20 -3
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isometrik-webchat.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/login-page_3.entry.js +5 -2
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/isometrik-webchat/index.esm.js +1 -1
- package/dist/isometrik-webchat/index.esm.js.map +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
- package/dist/isometrik-webchat/{p-6ffeb379.entry.js → p-1f9b855a.entry.js} +2 -2
- package/dist/isometrik-webchat/p-1f9b855a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-c544329c.entry.js +2 -0
- package/dist/isometrik-webchat/p-c544329c.entry.js.map +1 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +6 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +5 -2
- package/dist/isometrik-webchat/p-6d9f8cec.entry.js +0 -2
- package/dist/isometrik-webchat/p-6d9f8cec.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-6ffeb379.entry.js.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -135,6 +135,9 @@ const initializeChat = function (props) {
|
|
|
135
135
|
if (props.customParts) {
|
|
136
136
|
chatComponent.customParts = props.customParts;
|
|
137
137
|
}
|
|
138
|
+
if (props.showProfileRail !== undefined) {
|
|
139
|
+
chatComponent.showProfileRail = props.showProfileRail;
|
|
140
|
+
}
|
|
138
141
|
attachWebChatSlots(chatComponent, props.slots);
|
|
139
142
|
themeProvider.appendChild(chatComponent);
|
|
140
143
|
themeProvider.style.width = '100%';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":";;;;;;AAAA;;;;MAkCa,sBAAsB,GAAG;IACpC,WAAW;IACX,qBAAqB;IACrB,gBAAgB;IAChB,oBAAoB;IACpB,aAAa;IACb,WAAW;IACX,2BAA2B;IAC3B,sBAAsB;IACtB,0BAA0B;EACjB;AAIX;MACa,uBAAuB,GAAG;IACrC,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,UAAU;IACV,YAAY;IACZ,kBAAkB;IAClB,uBAAuB;IACvB,cAAc;;;ACzDhB;;;;SAIgB,wBAAwB,CACtC,GAAW,EACX,QAAkB,EAClB,MAAuD;IAEvD,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE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AE;YACjB,aAAa,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SAC3C;KACF;AACH,EAAE;MAEW,gBAAgB,GAAG,UAAU,WAGzC;IACC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAQ,CAAC;IACtE,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACnD,OAAO;KACR;IAED,IAAI,WAAW,CAAC,SAAS,EAAE;QACzB,aAAa,CAAC,YAAY,CAAC,YAAY,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;KACjE;IAED,IAAI,WAAW,CAAC,WAAW,EAAE;QAC3B,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;KACrD;AACH,EAAE;MAEW,WAAW,GAAG;IACzB,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAQ,CAAC;IACtE,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACnD,OAAO;KACR;IAED,aAAa,CAAC,WAAW,EAAE,CAAC;AAC9B,EAAE;AAEF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAChC,MAAc,CAAC,cAAc,GAAG,cAAc,CAAC;IAC/C,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;IACzC,MAAc,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;IACpD,MAAc,CAAC,eAAe,GAAG,eAAe,CAAC;IACjD,MAAc,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACnD,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;AAC5C;;;;","names":[],"sources":["src/lib/custom-ui/public-api.ts","src/lib/custom-ui/define-part.ts","src/index.ts"],"sourcesContent":["/**\n * Public host-facing events + method contract for <web-chat>.\n * Slots/customParts = UI. These = data + actions (fully functional custom UI).\n */\n\nexport type ChatReadyDetail = {\n userMetaData: any;\n conversations: any[];\n};\n\nexport type ConversationsChangeDetail = {\n conversations: any[];\n};\n\nexport type MessagesChangeDetail = {\n conversationId: string | null;\n messages: any[];\n};\n\nexport type SelectionChangeDetail = {\n conversationId: string | null;\n conversation: any | null;\n};\n\nexport type ReplyChangeDetail = {\n replyMessage: any | null;\n};\n\nexport type ChatErrorDetail = {\n code: string;\n message: string;\n cause?: unknown;\n};\n\nexport const WEB_CHAT_PUBLIC_EVENTS = [\n 'chatReady',\n 'conversationsChange',\n 'messagesChange',\n 'conversationSelect',\n 'replyChange',\n 'chatError',\n 'unreadMessageCountUpdated',\n 'conversationNotFound',\n 'messageReadStatusUpdated',\n] as const;\n\nexport type WebChatPublicEvent = (typeof WEB_CHAT_PUBLIC_EVENTS)[number];\n\n/** Documented public @Method names on <web-chat>. */\nexport const WEB_CHAT_PUBLIC_METHODS = [\n 'selectConversation',\n 'sendText',\n 'sendMedia',\n 'setReply',\n 'clearReply',\n 'loadMoreMessages',\n 'loadMoreConversations',\n 'getChatState',\n] as const;\n\nexport type WebChatPublicMethod = (typeof WEB_CHAT_PUBLIC_METHODS)[number];\n","/**\n * Tiny helper to define a reactive customPart CE.\n * Hosts get property setters that re-call `render` when SDK updates props.\n */\nexport function defineReactiveCustomPart(\n tag: string,\n propKeys: string[],\n render: (el: HTMLElement & Record<string, any>) => void,\n): void {\n if (typeof customElements === 'undefined' || customElements.get(tag)) return;\n\n class ReactivePart extends HTMLElement {\n connectedCallback() {\n render(this as any);\n }\n }\n\n propKeys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(ReactivePart.prototype, key, {\n get() {\n return (this as any)[store];\n },\n set(value) {\n if ((this as any)[store] === value) return;\n (this as any)[store] = value;\n if (this.isConnected) render(this as any);\n },\n configurable: true,\n });\n });\n\n // Optional: SDK applyCustomPartProps looks for .render()\n (ReactivePart.prototype as any).render = function renderMethod() {\n render(this);\n };\n\n customElements.define(tag, ReactivePart);\n}\n","import { destroyChatDom } from './lib/destroy-chat';\nimport type { WebChatSlotName, WebChatCustomParts } from './lib/custom-ui';\nexport type { WebChatSlotName, WebChatCustomParts } from './lib/custom-ui';\nexport type {\n ChatReadyDetail,\n ConversationsChangeDetail,\n MessagesChangeDetail,\n SelectionChangeDetail,\n ReplyChangeDetail,\n ChatErrorDetail,\n WebChatPublicEvent,\n WebChatPublicMethod,\n MessageDeliveryStatus,\n MessageBubbleProps,\n ChatTileProps,\n GroupcastTileProps,\n MessageDatePillProps,\n SearchResultProps,\n MemberRowProps,\n OverlayDialogProps,\n MediaGalleryProps,\n ContextMenuProps,\n BlockListProps,\n ToastPartProps,\n} from './lib/custom-ui';\nexport {\n WEB_CHAT_SLOTS,\n WEB_CHAT_PUBLIC_EVENTS,\n WEB_CHAT_PUBLIC_METHODS,\n deriveMessageStatus,\n findWebChatHost,\n applyCustomPartProps,\n defineReactiveCustomPart,\n} from './lib/custom-ui';\nexport { format } from './utils/utils';\n/**\n * Stencil-generated component types (full catalog).\n * Prefer the explicit custom-ui / InitializeChatProps exports above for host apps.\n * Lazy loader: `isometrik-webchat/loader`\n * Custom elements: `dist/components/` (dist-custom-elements output)\n */\nexport type * from './components.d.ts';\n\nexport type InitializeChatProps = {\n baseUrl?: string;\n hostUrl?: string;\n licenseKey: string;\n appSecret: string;\n userSecret: string;\n userToken: string;\n isometrikUserId: string;\n projectId: string;\n keysetId: string;\n accountId: string;\n defaultTheme?: 'dark' | 'light';\n themeUrl?: string;\n containerId?: string;\n /** Optional custom UI nodes — each gets `slot=\"<name>\"` and is appended to <web-chat>. */\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>;\n /** Custom element tags for list rows / dialogs. See WebChatCustomParts. */\n customParts?: WebChatCustomParts;\n};\n\nfunction attachWebChatSlots(\n chatComponent: HTMLElement,\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>,\n) {\n if (!slots) return;\n (Object.entries(slots) as [WebChatSlotName, HTMLElement | undefined][]).forEach(([name, el]) => {\n if (!el) return;\n el.slot = name;\n chatComponent.appendChild(el);\n });\n}\n\nfunction getStoredComponents(): { themeProvider?: HTMLElement; chatComponent?: any } {\n if (typeof window === 'undefined') return {};\n (window as any).__isometrikChatComponents = (window as any).__isometrikChatComponents || {};\n return (window as any).__isometrikChatComponents;\n}\n\n/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */\nexport const destroyChat = function () {\n destroyChatDom();\n document.querySelectorAll('theme-provider').forEach(el => {\n if (!el.querySelector('web-chat') && el.childNodes.length === 0) {\n el.remove();\n }\n });\n};\n\nexport const initializeChat = function (props: InitializeChatProps) {\n if (\n !props.licenseKey ||\n !props.appSecret ||\n !props.userSecret ||\n !props.userToken ||\n !props.isometrikUserId ||\n !props.projectId ||\n !props.keysetId ||\n !props.accountId\n ) {\n console.error('Missing required props to Initialize chat!');\n return null;\n }\n\n // Idempotent: destroy previous instance before creating a new one\n destroyChat();\n\n const themeProvider = document.createElement('theme-provider');\n\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n\n if (props.themeUrl) {\n themeProvider.setAttribute('theme-path', props.themeUrl);\n } else {\n themeProvider.setAttribute(\n 'theme-path',\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css',\n );\n }\n\n const chatComponent = document.createElement('web-chat') as any;\n\n chatComponent.baseUrl = props?.baseUrl || 'https://apis.isometrik.io';\n chatComponent.hostUrl = props?.hostUrl || 'wss://connections.isometrik.io:2053/mqtt';\n chatComponent.licenseKey = props.licenseKey;\n chatComponent.appSecret = props.appSecret;\n chatComponent.userSecret = props.userSecret;\n chatComponent.userToken = props.userToken;\n chatComponent.isometrikUserId = props.isometrikUserId;\n chatComponent.projectId = props.projectId;\n chatComponent.keysetId = props.keysetId;\n chatComponent.accountId = props.accountId;\n chatComponent.defaultTheme = props.defaultTheme || 'light';\n chatComponent.themeUrl =\n props.themeUrl ||\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n\n if (props.customParts) {\n chatComponent.customParts = props.customParts;\n }\n\n attachWebChatSlots(chatComponent, props.slots);\n\n themeProvider.appendChild(chatComponent);\n themeProvider.style.width = '100%';\n themeProvider.style.height = '100%';\n themeProvider.style.display = 'block';\n\n const container = props.containerId ? document.getElementById(props.containerId) : document.body;\n if (container) {\n container.appendChild(themeProvider);\n } else {\n console.error('Container with the specified ID not found. Appending to body instead.');\n document.body.appendChild(themeProvider);\n }\n\n const stored = getStoredComponents();\n stored.themeProvider = themeProvider;\n stored.chatComponent = chatComponent;\n\n return { themeProvider, chatComponent, destroy: destroyChat };\n};\n\nexport const customChatSidebar = function (props: { isChatFilter?: boolean }) {\n const chatComponent = document.querySelector('web-chat') as any;\n if (!chatComponent) {\n console.error('Isometrik chat is not initialized');\n return;\n }\n\n if (props.isChatFilter !== undefined) {\n chatComponent.isChatFilter = props.isChatFilter;\n }\n};\n\nexport const switchChatTheme = function (theme: 'dark' | 'light') {\n const chatElements = document.getElementsByTagName('web-chat');\n\n for (let i = 0; i < chatElements.length; i++) {\n const chatWeb = chatElements[i] as any;\n chatWeb.defaultTheme = theme;\n\n const themeProvider = getStoredComponents().themeProvider;\n if (themeProvider) {\n themeProvider.setAttribute('mode', theme);\n }\n }\n};\n\nexport const applyCustomTheme = function (customTheme: {\n themePath?: string;\n themeObject?: { [key: string]: string };\n}) {\n const themeProvider = document.querySelector('theme-provider') as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n\n if (customTheme.themePath) {\n themeProvider.setAttribute('theme-path', customTheme.themePath);\n }\n\n if (customTheme.themeObject) {\n themeProvider.themeObject = customTheme.themeObject;\n }\n};\n\nexport const toggleTheme = function () {\n const themeProvider = document.querySelector('theme-provider') as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n\n themeProvider.toggleTheme();\n};\n\nif (typeof window !== 'undefined') {\n (window as any).initializeChat = initializeChat;\n (window as any).destroyChat = destroyChat;\n (window as any).chatSidebarProps = customChatSidebar;\n (window as any).switchChatTheme = switchChatTheme;\n (window as any).applyCustomTheme = applyCustomTheme;\n (window as any).toggleTheme = toggleTheme;\n}\n"],"version":3}
|
|
1
|
+
{"file":"index.js","mappings":";;;;;;AAAA;;;;MAkCa,sBAAsB,GAAG;IACpC,WAAW;IACX,qBAAqB;IACrB,gBAAgB;IAChB,oBAAoB;IACpB,aAAa;IACb,WAAW;IACX,2BAA2B;IAC3B,sBAAsB;IACtB,0BAA0B;EACjB;AAIX;MACa,uBAAuB,GAAG;IACrC,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,UAAU;IACV,YAAY;IACZ,kBAAkB;IAClB,uBAAuB;IACvB,cAAc;;;ACzDhB;;;;SAIgB,wBAAwB,CACtC,GAAW,EACX,QAAkB,EAClB,MAAuD;IAEvD,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAE7E,MAAM,YAAa,SAAQ,WAAW;QACpC,iBAAiB;YACf,MAAM,CAAC,IAAW,CAAC,CAAC;SACrB;KACF;IAED,QAAQ,CAAC,OAAO,CAAC,GAAG;QAClB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;QACxB,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,SAAS,EAAE,GAAG,EAAE;YACjD,GAAG;gBACD,OAAQ,IAAY,CAAC,KAAK,CAAC,CAAC;aAC7B;YACD,GAAG,CAAC,KAAK;gBACP,IAAK,IAAY,CAAC,KAAK,CAAC,KAAK,KAAK;oBAAE,OAAO;gBAC1C,IAAY,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;gBAC7B,IAAI,IAAI,CAAC,WAAW;oBAAE,MAAM,CAAC,IAAW,CAAC,CAAC;aAC3C;YACD,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;KACJ,CAAC,CAAC;;IAGF,YAAY,CAAC,SAAiB,CAAC,MAAM,GAAG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GAAG;IACzB,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAQ,CAAC;IACtE,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACnD,OAAO;KACR;IAED,aAAa,CAAC,WAAW,EAAE,CAAC;AAC9B,EAAE;AAEF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IAChC,MAAc,CAAC,cAAc,GAAG,cAAc,CAAC;IAC/C,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;IACzC,MAAc,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;IACpD,MAAc,CAAC,eAAe,GAAG,eAAe,CAAC;IACjD,MAAc,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IACnD,MAAc,CAAC,WAAW,GAAG,WAAW,CAAC;AAC5C;;;;","names":[],"sources":["src/lib/custom-ui/public-api.ts","src/lib/custom-ui/define-part.ts","src/index.ts"],"sourcesContent":["/**\n * Public host-facing events + method contract for <web-chat>.\n * Slots/customParts = UI. These = data + actions (fully functional custom UI).\n */\n\nexport type ChatReadyDetail = {\n userMetaData: any;\n conversations: any[];\n};\n\nexport type ConversationsChangeDetail = {\n conversations: any[];\n};\n\nexport type MessagesChangeDetail = {\n conversationId: string | null;\n messages: any[];\n};\n\nexport type SelectionChangeDetail = {\n conversationId: string | null;\n conversation: any | null;\n};\n\nexport type ReplyChangeDetail = {\n replyMessage: any | null;\n};\n\nexport type ChatErrorDetail = {\n code: string;\n message: string;\n cause?: unknown;\n};\n\nexport const WEB_CHAT_PUBLIC_EVENTS = [\n 'chatReady',\n 'conversationsChange',\n 'messagesChange',\n 'conversationSelect',\n 'replyChange',\n 'chatError',\n 'unreadMessageCountUpdated',\n 'conversationNotFound',\n 'messageReadStatusUpdated',\n] as const;\n\nexport type WebChatPublicEvent = (typeof WEB_CHAT_PUBLIC_EVENTS)[number];\n\n/** Documented public @Method names on <web-chat>. */\nexport const WEB_CHAT_PUBLIC_METHODS = [\n 'selectConversation',\n 'sendText',\n 'sendMedia',\n 'setReply',\n 'clearReply',\n 'loadMoreMessages',\n 'loadMoreConversations',\n 'getChatState',\n] as const;\n\nexport type WebChatPublicMethod = (typeof WEB_CHAT_PUBLIC_METHODS)[number];\n","/**\n * Tiny helper to define a reactive customPart CE.\n * Hosts get property setters that re-call `render` when SDK updates props.\n */\nexport function defineReactiveCustomPart(\n tag: string,\n propKeys: string[],\n render: (el: HTMLElement & Record<string, any>) => void,\n): void {\n if (typeof customElements === 'undefined' || customElements.get(tag)) return;\n\n class ReactivePart extends HTMLElement {\n connectedCallback() {\n render(this as any);\n }\n }\n\n propKeys.forEach(key => {\n const store = `_${key}`;\n Object.defineProperty(ReactivePart.prototype, key, {\n get() {\n return (this as any)[store];\n },\n set(value) {\n if ((this as any)[store] === value) return;\n (this as any)[store] = value;\n if (this.isConnected) render(this as any);\n },\n configurable: true,\n });\n });\n\n // Optional: SDK applyCustomPartProps looks for .render()\n (ReactivePart.prototype as any).render = function renderMethod() {\n render(this);\n };\n\n customElements.define(tag, ReactivePart);\n}\n","import { destroyChatDom } from './lib/destroy-chat';\nimport type { WebChatSlotName, WebChatCustomParts } from './lib/custom-ui';\nexport type { WebChatSlotName, WebChatCustomParts } from './lib/custom-ui';\nexport type {\n ChatReadyDetail,\n ConversationsChangeDetail,\n MessagesChangeDetail,\n SelectionChangeDetail,\n ReplyChangeDetail,\n ChatErrorDetail,\n WebChatPublicEvent,\n WebChatPublicMethod,\n MessageDeliveryStatus,\n MessageBubbleProps,\n ChatTileProps,\n GroupcastTileProps,\n MessageDatePillProps,\n SearchResultProps,\n MemberRowProps,\n OverlayDialogProps,\n MediaGalleryProps,\n ContextMenuProps,\n BlockListProps,\n ToastPartProps,\n} from './lib/custom-ui';\nexport {\n WEB_CHAT_SLOTS,\n WEB_CHAT_PUBLIC_EVENTS,\n WEB_CHAT_PUBLIC_METHODS,\n deriveMessageStatus,\n findWebChatHost,\n applyCustomPartProps,\n defineReactiveCustomPart,\n} from './lib/custom-ui';\nexport { format } from './utils/utils';\n/**\n * Stencil-generated component types (full catalog).\n * Prefer the explicit custom-ui / InitializeChatProps exports above for host apps.\n * Lazy loader: `isometrik-webchat/loader`\n * Custom elements: `dist/components/` (dist-custom-elements output)\n */\nexport type * from './components.d.ts';\n\nexport type InitializeChatProps = {\n baseUrl?: string;\n hostUrl?: string;\n licenseKey: string;\n appSecret: string;\n userSecret: string;\n userToken: string;\n isometrikUserId: string;\n projectId: string;\n keysetId: string;\n accountId: string;\n defaultTheme?: 'dark' | 'light';\n themeUrl?: string;\n containerId?: string;\n /** Optional custom UI nodes — each gets `slot=\"<name>\"` and is appended to <web-chat>. */\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>;\n /** Custom element tags for list rows / dialogs. See WebChatCustomParts. */\n customParts?: WebChatCustomParts;\n /** When false, hide the left profile icon rail. Default true. */\n showProfileRail?: boolean;\n};\n\nfunction attachWebChatSlots(\n chatComponent: HTMLElement,\n slots?: Partial<Record<WebChatSlotName, HTMLElement>>,\n) {\n if (!slots) return;\n (Object.entries(slots) as [WebChatSlotName, HTMLElement | undefined][]).forEach(([name, el]) => {\n if (!el) return;\n el.slot = name;\n chatComponent.appendChild(el);\n });\n}\n\nfunction getStoredComponents(): { themeProvider?: HTMLElement; chatComponent?: any } {\n if (typeof window === 'undefined') return {};\n (window as any).__isometrikChatComponents = (window as any).__isometrikChatComponents || {};\n return (window as any).__isometrikChatComponents;\n}\n\n/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */\nexport const destroyChat = function () {\n destroyChatDom();\n document.querySelectorAll('theme-provider').forEach(el => {\n if (!el.querySelector('web-chat') && el.childNodes.length === 0) {\n el.remove();\n }\n });\n};\n\nexport const initializeChat = function (props: InitializeChatProps) {\n if (\n !props.licenseKey ||\n !props.appSecret ||\n !props.userSecret ||\n !props.userToken ||\n !props.isometrikUserId ||\n !props.projectId ||\n !props.keysetId ||\n !props.accountId\n ) {\n console.error('Missing required props to Initialize chat!');\n return null;\n }\n\n // Idempotent: destroy previous instance before creating a new one\n destroyChat();\n\n const themeProvider = document.createElement('theme-provider');\n\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n\n if (props.themeUrl) {\n themeProvider.setAttribute('theme-path', props.themeUrl);\n } else {\n themeProvider.setAttribute(\n 'theme-path',\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css',\n );\n }\n\n const chatComponent = document.createElement('web-chat') as any;\n\n chatComponent.baseUrl = props?.baseUrl || 'https://apis.isometrik.io';\n chatComponent.hostUrl = props?.hostUrl || 'wss://connections.isometrik.io:2053/mqtt';\n chatComponent.licenseKey = props.licenseKey;\n chatComponent.appSecret = props.appSecret;\n chatComponent.userSecret = props.userSecret;\n chatComponent.userToken = props.userToken;\n chatComponent.isometrikUserId = props.isometrikUserId;\n chatComponent.projectId = props.projectId;\n chatComponent.keysetId = props.keysetId;\n chatComponent.accountId = props.accountId;\n chatComponent.defaultTheme = props.defaultTheme || 'light';\n chatComponent.themeUrl =\n props.themeUrl ||\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n\n if (props.customParts) {\n chatComponent.customParts = props.customParts;\n }\n\n if (props.showProfileRail !== undefined) {\n chatComponent.showProfileRail = props.showProfileRail;\n }\n\n attachWebChatSlots(chatComponent, props.slots);\n\n themeProvider.appendChild(chatComponent);\n themeProvider.style.width = '100%';\n themeProvider.style.height = '100%';\n themeProvider.style.display = 'block';\n\n const container = props.containerId ? document.getElementById(props.containerId) : document.body;\n if (container) {\n container.appendChild(themeProvider);\n } else {\n console.error('Container with the specified ID not found. Appending to body instead.');\n document.body.appendChild(themeProvider);\n }\n\n const stored = getStoredComponents();\n stored.themeProvider = themeProvider;\n stored.chatComponent = chatComponent;\n\n return { themeProvider, chatComponent, destroy: destroyChat };\n};\n\nexport const customChatSidebar = function (props: { isChatFilter?: boolean }) {\n const chatComponent = document.querySelector('web-chat') as any;\n if (!chatComponent) {\n console.error('Isometrik chat is not initialized');\n return;\n }\n\n if (props.isChatFilter !== undefined) {\n chatComponent.isChatFilter = props.isChatFilter;\n }\n};\n\nexport const switchChatTheme = function (theme: 'dark' | 'light') {\n const chatElements = document.getElementsByTagName('web-chat');\n\n for (let i = 0; i < chatElements.length; i++) {\n const chatWeb = chatElements[i] as any;\n chatWeb.defaultTheme = theme;\n\n const themeProvider = getStoredComponents().themeProvider;\n if (themeProvider) {\n themeProvider.setAttribute('mode', theme);\n }\n }\n};\n\nexport const applyCustomTheme = function (customTheme: {\n themePath?: string;\n themeObject?: { [key: string]: string };\n}) {\n const themeProvider = document.querySelector('theme-provider') as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n\n if (customTheme.themePath) {\n themeProvider.setAttribute('theme-path', customTheme.themePath);\n }\n\n if (customTheme.themeObject) {\n themeProvider.themeObject = customTheme.themeObject;\n }\n};\n\nexport const toggleTheme = function () {\n const themeProvider = document.querySelector('theme-provider') as any;\n if (!themeProvider) {\n console.error('Theme provider is not initialized');\n return;\n }\n\n themeProvider.toggleTheme();\n};\n\nif (typeof window !== 'undefined') {\n (window as any).initializeChat = initializeChat;\n (window as any).destroyChat = destroyChat;\n (window as any).chatSidebarProps = customChatSidebar;\n (window as any).switchChatTheme = switchChatTheme;\n (window as any).applyCustomTheme = applyCustomTheme;\n (window as any).toggleTheme = toggleTheme;\n}\n"],"version":3}
|
|
@@ -4904,12 +4904,28 @@ const ChatFooter = class {
|
|
|
4904
4904
|
if (next) {
|
|
4905
4905
|
this.showEmojiPicker = false;
|
|
4906
4906
|
document.removeEventListener('pointerdown', this.closeEmojiOutside);
|
|
4907
|
+
requestAnimationFrame(() => this.positionAttachMenu());
|
|
4907
4908
|
setTimeout(() => document.addEventListener('pointerdown', this.closeAttachOutside), 0);
|
|
4908
4909
|
}
|
|
4909
4910
|
else {
|
|
4910
4911
|
document.removeEventListener('pointerdown', this.closeAttachOutside);
|
|
4911
4912
|
}
|
|
4912
4913
|
};
|
|
4914
|
+
/** Viewport-fixed menu anchored to the attach (+) button — safe in split layouts. */
|
|
4915
|
+
this.positionAttachMenu = () => {
|
|
4916
|
+
var _a;
|
|
4917
|
+
const root = (_a = this.el) === null || _a === void 0 ? void 0 : _a.shadowRoot;
|
|
4918
|
+
const btn = root === null || root === void 0 ? void 0 : root.querySelector('.attach-wrap .icon-btn');
|
|
4919
|
+
if (!btn)
|
|
4920
|
+
return;
|
|
4921
|
+
const r = btn.getBoundingClientRect();
|
|
4922
|
+
const menuW = 200;
|
|
4923
|
+
const left = Math.min(Math.max(8, r.left), window.innerWidth - menuW - 8);
|
|
4924
|
+
this.attachMenuStyle = {
|
|
4925
|
+
left: `${left}px`,
|
|
4926
|
+
bottom: `${Math.max(8, window.innerHeight - r.top + 8)}px`,
|
|
4927
|
+
};
|
|
4928
|
+
};
|
|
4913
4929
|
this.closeAttachOutside = (event) => {
|
|
4914
4930
|
if (!this.showAttachMenu)
|
|
4915
4931
|
return;
|
|
@@ -5171,6 +5187,7 @@ const ChatFooter = class {
|
|
|
5171
5187
|
this.groupcastId = '';
|
|
5172
5188
|
this.showEmojiPicker = false;
|
|
5173
5189
|
this.emojiPanelStyle = {};
|
|
5190
|
+
this.attachMenuStyle = {};
|
|
5174
5191
|
this.showAttachMenu = false;
|
|
5175
5192
|
this.isRecording = false;
|
|
5176
5193
|
this.isPaused = false;
|
|
@@ -5522,9 +5539,9 @@ const ChatFooter = class {
|
|
|
5522
5539
|
const webChat = findWebChatHost(this.el);
|
|
5523
5540
|
const hasCustomReply = (webChat ? hasNamedSlot(webChat, 'reply-preview') : false) || hasNamedSlot(this.el, 'reply-preview');
|
|
5524
5541
|
const showAttachment = this.attachmentDetails || this.showCamera;
|
|
5525
|
-
return (h(Host, { key: '
|
|
5542
|
+
return (h(Host, { key: '199eb4dac984653a45ea6d1d23aebc7c08b1edbd', class: { 'attachment-open': !!showAttachment } }, h("div", { key: '15868c212630f526aef704c7bbb7f39d835056c6', class: "chat-footer-container" }, showAttachment ? (h("slot", { name: "attachment-preview" }, h("attachment-preview", { showCamera: this.showCamera, onClose: this.handleClearAttachment, width: "150px", height: "150px", bgColor: "var(--bg-primary-light)", padding: "3px", margin: "10px 0 0 0", contentType: contentType, content: this.mediaPreviews, onSend: this.handleSendMessage, "onfile-uploaded": this.handleFileUpload, "onattachment-removed": this.handleRemoveAttachment, "oncamera-retake": this.handleCameraRetake, key: this.inputKey, inputValue: this.messageBody, "oninput-change": this.handleInputChange, backgroundColor: "var(--bg-primary-color)", containerBoxShadow: "none", inputFontColor: "var(--text-primary-color)", inputBorderRadius: "10px", conversationDetails: this.conversationDetails, userMetaData: this.userMetaData }))) : (h(Fragment, null, hasCustomReply ? h("slot", { name: "reply-preview" }) : null, h("slot", { name: "composer-input" }, !hasCustomReply && this.replyMessage ? (h("reply-block", { messageBody: (_a = this.replyMessage) === null || _a === void 0 ? void 0 : _a.body, messageInfo: this.replyMessage, senderName: ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) === ((_d = (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.senderInfo) === null || _d === void 0 ? void 0 : _d.userId)
|
|
5526
5543
|
? 'You'
|
|
5527
|
-
: (_f = (_e = this.replyMessage) === null || _e === void 0 ? void 0 : _e.senderInfo) === null || _f === void 0 ? void 0 : _f.userName, onIconClick: this.handleremoveReplyMessage })) : null, h("div", { class: "composer-wrap", key: this.inputKey, ref: el => (this.composerWrapRef = el) }, this.showEmojiPicker ? (h("div", { class: "emoji-panel", style: this.emojiPanelStyle }, h("div", { class: "emoji-panel-header" }, h("span", null, "Emoji"), h("button", { class: "emoji-panel-close", type: "button", "aria-label": "Close", onClick: this.handleEmojiToggle }, "\u00D7")), h("emoji-picker", { class: "emoji-picker light", ref: this.bindEmojiPicker }))) : null, h("div", { class: { composer: true, recording: this.isRecording } }, this.isRecording ? (h("div", { class: "rec-body" }, h("div", { class: "rec-left" }, h("button", { class: "rec-icon-btn danger", type: "button", title: "Delete recording", "aria-label": "Delete recording", onClick: this.handleRecDelete }, h("img", { class: "theme-icon", src: Delete, alt: "" })), h("div", { class: "rec-timer-wrap" }, h("span", { class: { 'rec-dot': true, live: !this.isPaused } }), h("span", { class: "rec-timer" }, this.formatRecTime(this.recordingSeconds)))), h("div", { class: "rec-wave" }, h("audio-bubble", { liveRecord: true, audioProgressColor: "#2563eb", audioWaveColor: "#2563eb", ref: el => (this.recBubble = el), onRecordingProgress: this.onRecordingProgress, onRecordingError: this.onRecordingError })), h("button", { class: { 'rec-icon-btn': true, 'rec-toggle': true, pause: !this.isPaused }, type: "button", title: this.isPaused ? 'Resume recording' : 'Pause recording', "aria-label": this.isPaused ? 'Resume recording' : 'Pause recording', onClick: this.handleRecPauseToggle }, h("img", { class: "theme-icon", src: this.isPaused ? PlayIcon : PauseIcon, alt: "" })), h("button", { class: "rec-send", type: "button", title: "Send voice note", "aria-label": "Send voice note", onClick: this.handleRecSend }, h("img", { src: Send, alt: "" })))) : (h(Fragment, null, h("div", { class: "attach-wrap" }, h("button", { class: "icon-btn", type: "button", title: "Attach file", "aria-label": "Attach", onClick: this.handleAttachClick }, h("img", { src: Attachment, alt: "" })), this.showAttachMenu ? (h("div", { class: "attach-menu" }, h("button", { class: "attach-opt", type: "button", onClick: this.pickDocument }, h("span", { class: "attach-opt-icon attach-opt-icon--doc" }, h("img", { src: DocumentsIcon, alt: "" })), h("span", null, "Document")), h("button", { class: "attach-opt", type: "button", onClick: this.pickPhotos }, h("span", { class: "attach-opt-icon attach-opt-icon--photos" }, h("img", { class: "theme-icon", src: PhotosIcon, alt: "" })), h("span", null, "Photos & videos")), h("button", { class: "attach-opt", type: "button", onClick: this.pickCamera }, h("span", { class: "attach-opt-icon attach-opt-icon--camera" }, h("img", { class: "theme-icon", src: CameraIcon, alt: "" })), h("span", null, "Camera")))) : null), h("button", { class: "icon-btn", type: "button", title: "Emojis", "aria-label": "Emojis", onClick: this.handleEmojiToggle }, h("img", { src: Smile, alt: "" })), h("input", { class: "file-input", type: "file", multiple: true, accept: ".jpg,.jpeg,.png,.gif,.webp,.bmp,.heic,.mp4,.mov,.webm,.mkv", ref: el => (this.mediaInputRef = el), onChange: this.handleNativeFileChange }), h("input", { class: "file-input", type: "file", multiple: true, accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,application/*", ref: el => (this.docInputRef = el), onChange: this.handleNativeFileChange }), h("textarea", { class: "composer-input", rows: 1, placeholder: "Type a message", value: this.messageBody, ref: el => (this.inputRef = el), onInput: this.handleComposerInput, onKeyDown: this.handleComposerKeyDown }), this.messageBody.trim() ? (h("button", { class: "icon-btn", type: "button", title: "Send", "aria-label": "Send", onClick: this.handleSendMessage }, h("img", { src: Send, alt: "" }))) : (h("button", { class: "icon-btn", type: "button", title: "Voice note", "aria-label": "Voice note", onClick: this.handleMicClick }, h("img", { src: Microphone, alt: "" })))))))))))));
|
|
5544
|
+
: (_f = (_e = this.replyMessage) === null || _e === void 0 ? void 0 : _e.senderInfo) === null || _f === void 0 ? void 0 : _f.userName, onIconClick: this.handleremoveReplyMessage })) : null, h("div", { class: "composer-wrap", key: this.inputKey, ref: el => (this.composerWrapRef = el) }, this.showEmojiPicker ? (h("div", { class: "emoji-panel", style: this.emojiPanelStyle }, h("div", { class: "emoji-panel-header" }, h("span", null, "Emoji"), h("button", { class: "emoji-panel-close", type: "button", "aria-label": "Close", onClick: this.handleEmojiToggle }, "\u00D7")), h("emoji-picker", { class: "emoji-picker light", ref: this.bindEmojiPicker }))) : null, h("div", { class: { composer: true, recording: this.isRecording } }, this.isRecording ? (h("div", { class: "rec-body" }, h("div", { class: "rec-left" }, h("button", { class: "rec-icon-btn danger", type: "button", title: "Delete recording", "aria-label": "Delete recording", onClick: this.handleRecDelete }, h("img", { class: "theme-icon", src: Delete, alt: "" })), h("div", { class: "rec-timer-wrap" }, h("span", { class: { 'rec-dot': true, live: !this.isPaused } }), h("span", { class: "rec-timer" }, this.formatRecTime(this.recordingSeconds)))), h("div", { class: "rec-wave" }, h("audio-bubble", { liveRecord: true, audioProgressColor: "#2563eb", audioWaveColor: "#2563eb", ref: el => (this.recBubble = el), onRecordingProgress: this.onRecordingProgress, onRecordingError: this.onRecordingError })), h("button", { class: { 'rec-icon-btn': true, 'rec-toggle': true, pause: !this.isPaused }, type: "button", title: this.isPaused ? 'Resume recording' : 'Pause recording', "aria-label": this.isPaused ? 'Resume recording' : 'Pause recording', onClick: this.handleRecPauseToggle }, h("img", { class: "theme-icon", src: this.isPaused ? PlayIcon : PauseIcon, alt: "" })), h("button", { class: "rec-send", type: "button", title: "Send voice note", "aria-label": "Send voice note", onClick: this.handleRecSend }, h("img", { src: Send, alt: "" })))) : (h(Fragment, null, h("div", { class: "attach-wrap" }, h("button", { class: "icon-btn", type: "button", title: "Attach file", "aria-label": "Attach", onClick: this.handleAttachClick }, h("img", { src: Attachment, alt: "" })), this.showAttachMenu ? (h("div", { class: "attach-menu", style: this.attachMenuStyle }, h("button", { class: "attach-opt", type: "button", onClick: this.pickDocument }, h("span", { class: "attach-opt-icon attach-opt-icon--doc" }, h("img", { src: DocumentsIcon, alt: "" })), h("span", null, "Document")), h("button", { class: "attach-opt", type: "button", onClick: this.pickPhotos }, h("span", { class: "attach-opt-icon attach-opt-icon--photos" }, h("img", { class: "theme-icon", src: PhotosIcon, alt: "" })), h("span", null, "Photos & videos")), h("button", { class: "attach-opt", type: "button", onClick: this.pickCamera }, h("span", { class: "attach-opt-icon attach-opt-icon--camera" }, h("img", { class: "theme-icon", src: CameraIcon, alt: "" })), h("span", null, "Camera")))) : null), h("button", { class: "icon-btn", type: "button", title: "Emojis", "aria-label": "Emojis", onClick: this.handleEmojiToggle }, h("img", { src: Smile, alt: "" })), h("input", { class: "file-input", type: "file", multiple: true, accept: ".jpg,.jpeg,.png,.gif,.webp,.bmp,.heic,.mp4,.mov,.webm,.mkv", ref: el => (this.mediaInputRef = el), onChange: this.handleNativeFileChange }), h("input", { class: "file-input", type: "file", multiple: true, accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,application/*", ref: el => (this.docInputRef = el), onChange: this.handleNativeFileChange }), h("textarea", { class: "composer-input", rows: 1, placeholder: "Type a message", value: this.messageBody, ref: el => (this.inputRef = el), onInput: this.handleComposerInput, onKeyDown: this.handleComposerKeyDown }), this.messageBody.trim() ? (h("button", { class: "icon-btn", type: "button", title: "Send", "aria-label": "Send", onClick: this.handleSendMessage }, h("img", { src: Send, alt: "" }))) : (h("button", { class: "icon-btn", type: "button", title: "Voice note", "aria-label": "Voice note", onClick: this.handleMicClick }, h("img", { src: Microphone, alt: "" })))))))))))));
|
|
5528
5545
|
}
|
|
5529
5546
|
get el() { return getElement(this); }
|
|
5530
5547
|
static get watchers() { return {
|
|
@@ -5533,7 +5550,7 @@ const ChatFooter = class {
|
|
|
5533
5550
|
"replyMessage": ["replyFocusHandler"]
|
|
5534
5551
|
}; }
|
|
5535
5552
|
};
|
|
5536
|
-
ChatFooter.style = ":host {\n display: block;\n width: var(--w-full);\n flex-shrink: 0;\n overflow: visible;\n position: relative;\n z-index: 40;\n font-family: var(--font-primary);\n }\n :host(.attachment-open) {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 4rem; /* keep web-chat-header visible */\n z-index: 60;\n flex-shrink: 0;\n overflow: hidden;\n }\n .chat-footer-container {\n position: relative;\n width: var(--w-full);\n padding: var(--space-12) var(--space-16);\n box-sizing: border-box;\n background: transparent;\n overflow: visible;\n }\n :host(.attachment-open) .chat-footer-container {\n height: var(--h-full);\n padding: 0;\n background: var(--bg-primary);\n overflow: hidden;\n }\n :host(.attachment-open) attachment-preview {\n display: block;\n height: var(--h-full);\n }\n .toaster {\n position: fixed;\n bottom: var(--space-16);\n right: var(--space-16);\n z-index: 1000;\n }\n .composer-wrap {\n position: relative;\n width: var(--w-full);\n overflow: visible;\n }\n .composer {\n display: flex;\n align-items: flex-end;\n gap: var(--gap-10);\n width: var(--w-full);\n box-sizing: border-box;\n padding: var(--space-8) var(--gap-14);\n background: var(--bg-primary);\n border: 1px solid var(--border);\n border-radius: 1.5rem;\n box-shadow: 0 1px 2px var(--overlay);\n }\n .composer-input {\n flex: 1;\n min-height: var(--icon-md);\n max-height: 10rem;\n resize: none;\n overflow-y: auto;\n border: none;\n outline: none;\n background: transparent;\n color: var(--text-primary);\n font-size: var(--text-14);\n font-family: inherit;\n line-height: 1.4;\n padding: var(--gap-4);\n box-sizing: border-box;\n }\n .composer-input::placeholder {\n color: var(--text-tertiary);\n }\n .icon-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 0 0 var(--gap-4);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--icon);\n opacity: 0.85;\n }\n .icon-btn:hover {\n opacity: 1;\n color: var(--brand);\n }\n .icon-btn img {\n width: var(--icon-md);\n height: var(--icon-md);\n display: block;\n object-fit: contain;\n }\n .emoji-panel {\n position: fixed;\n width: min(380px, calc(100vw - 24px));\n background: var(--bg-tertiary);\n border-radius: var(--rounded-12);\n box-shadow: 0 12px 40px var(--overlay);\n overflow: hidden;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n isolation: isolate;\n }\n .emoji-panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--gap-8);\n padding: var(--space-12) var(--space-12) var(--space-8) var(--space-16);\n background: var(--bg-tertiary);\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n flex-shrink: 0;\n }\n .emoji-panel-close {\n border: none;\n background: transparent;\n cursor: pointer;\n width: var(--control);\n height: var(--control);\n border-radius: var(--rounded-8);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--icon);\n font-size: var(--text-22);\n line-height: 1;\n padding: 0;\n flex-shrink: 0;\n }\n .emoji-panel-close:hover {\n background: var(--hover-overlay);\n color: var(--text-primary);\n }\n emoji-picker.emoji-picker {\n --background: var(--bg-tertiary);\n --border-color: transparent;\n --border-size: 0;\n --border-radius: 0;\n --indicator-color: var(--brand);\n --indicator-height: 3px;\n --input-border-radius: var(--rounded-8);\n --input-border-color: var(--border);\n --input-placeholder-color: var(--text-secondary);\n --input-font-color: var(--text-primary);\n --button-hover-background: var(--hover-overlay);\n --button-active-background: var(--bg-row-hover);\n --num-columns: 8;\n --emoji-size: 1.5rem;\n width: var(--w-full);\n height: 320px;\n }\n .file-input { display: none; }\n .attach-wrap {\n position: relative;\n flex-shrink: 0;\n }\n
|
|
5553
|
+
ChatFooter.style = ":host {\n display: block;\n width: var(--w-full);\n flex-shrink: 0;\n overflow: visible;\n position: relative;\n z-index: 40;\n font-family: var(--font-primary);\n }\n :host(.attachment-open) {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 4rem; /* keep web-chat-header visible */\n z-index: 60;\n flex-shrink: 0;\n overflow: hidden;\n }\n .chat-footer-container {\n position: relative;\n width: var(--w-full);\n padding: var(--space-12) var(--space-16);\n box-sizing: border-box;\n background: transparent;\n overflow: visible;\n }\n :host(.attachment-open) .chat-footer-container {\n height: var(--h-full);\n padding: 0;\n background: var(--bg-primary);\n overflow: hidden;\n }\n :host(.attachment-open) attachment-preview {\n display: block;\n height: var(--h-full);\n }\n .toaster {\n position: fixed;\n bottom: var(--space-16);\n right: var(--space-16);\n z-index: 1000;\n }\n .composer-wrap {\n position: relative;\n width: var(--w-full);\n overflow: visible;\n }\n .composer {\n display: flex;\n align-items: flex-end;\n gap: var(--gap-10);\n width: var(--w-full);\n box-sizing: border-box;\n padding: var(--space-8) var(--gap-14);\n background: var(--bg-primary);\n border: 1px solid var(--border);\n border-radius: 1.5rem;\n box-shadow: 0 1px 2px var(--overlay);\n }\n .composer-input {\n flex: 1;\n min-height: var(--icon-md);\n max-height: 10rem;\n resize: none;\n overflow-y: auto;\n border: none;\n outline: none;\n background: transparent;\n color: var(--text-primary);\n font-size: var(--text-14);\n font-family: inherit;\n line-height: 1.4;\n padding: var(--gap-4);\n box-sizing: border-box;\n }\n .composer-input::placeholder {\n color: var(--text-tertiary);\n }\n .icon-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 0 0 var(--gap-4);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--icon);\n opacity: 0.85;\n }\n .icon-btn:hover {\n opacity: 1;\n color: var(--brand);\n }\n .icon-btn img {\n width: var(--icon-md);\n height: var(--icon-md);\n display: block;\n object-fit: contain;\n }\n .emoji-panel {\n position: fixed;\n width: min(380px, calc(100vw - 24px));\n background: var(--bg-tertiary);\n border-radius: var(--rounded-12);\n box-shadow: 0 12px 40px var(--overlay);\n overflow: hidden;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n isolation: isolate;\n }\n .emoji-panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--gap-8);\n padding: var(--space-12) var(--space-12) var(--space-8) var(--space-16);\n background: var(--bg-tertiary);\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n flex-shrink: 0;\n }\n .emoji-panel-close {\n border: none;\n background: transparent;\n cursor: pointer;\n width: var(--control);\n height: var(--control);\n border-radius: var(--rounded-8);\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--icon);\n font-size: var(--text-22);\n line-height: 1;\n padding: 0;\n flex-shrink: 0;\n }\n .emoji-panel-close:hover {\n background: var(--hover-overlay);\n color: var(--text-primary);\n }\n emoji-picker.emoji-picker {\n --background: var(--bg-tertiary);\n --border-color: transparent;\n --border-size: 0;\n --border-radius: 0;\n --indicator-color: var(--brand);\n --indicator-height: 3px;\n --input-border-radius: var(--rounded-8);\n --input-border-color: var(--border);\n --input-placeholder-color: var(--text-secondary);\n --input-font-color: var(--text-primary);\n --button-hover-background: var(--hover-overlay);\n --button-active-background: var(--bg-row-hover);\n --num-columns: 8;\n --emoji-size: 1.5rem;\n width: var(--w-full);\n height: 320px;\n }\n .file-input { display: none; }\n .attach-wrap {\n position: relative;\n flex-shrink: 0;\n }\n /* Fixed + JS coords \u2014 absolute left:0 breaks in split hosts (sidebar+pane). */\n .attach-menu {\n position: fixed;\n min-width: 12.5rem;\n background: var(--bg-primary);\n border-radius: var(--rounded-12);\n box-shadow: 0 2px 16px var(--overlay);\n border: 1px solid var(--border-subtle);\n padding: var(--space-8) 0;\n display: flex;\n flex-direction: column;\n z-index: 10050;\n }\n .attach-opt {\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n width: var(--w-full);\n padding: var(--space-8) var(--space-16);\n border: none;\n background: transparent;\n cursor: pointer;\n text-align: left;\n font-family: inherit;\n font-size: var(--text-14);\n font-weight: var(--fw-400);\n color: var(--text-primary);\n white-space: nowrap;\n }\n .attach-opt:hover {\n background: var(--hover-overlay);\n }\n .attach-opt-icon {\n width: var(--text-16);\n height: var(--text-16);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n .attach-opt-icon img {\n width: var(--text-16);\n height: var(--text-16);\n object-fit: contain;\n display: block;\n }\n .attach-opt-icon--doc img {\n filter: none;\n }\n .attach-opt-icon--photos img {\n /* maps to --brand */\n filter: invert(32%) sepia(98%) saturate(1800%) hue-rotate(204deg) brightness(95%) contrast(95%);\n }\n .attach-opt-icon--camera img {\n /* maps to --danger */\n filter: invert(14%) sepia(98%) saturate(7400%) hue-rotate(0deg) brightness(100%) contrast(118%);\n }\n .composer.recording {\n align-items: center;\n justify-content: center;\n gap: var(--gap-16);\n padding: var(--space-8) var(--space-16);\n }\n .rec-body {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--gap-16);\n min-width: 0;\n width: auto;\n flex: 0 1 auto;\n max-width: 100%;\n }\n .rec-left, .rec-right {\n display: flex;\n align-items: center;\n gap: var(--gap-10);\n flex-shrink: 0;\n }\n .rec-timer-wrap {\n display: flex;\n align-items: center;\n gap: var(--gap-8);\n padding-left: var(--gap-4);\n }\n .rec-dot {\n width: 0.625rem;\n height: 0.625rem;\n border-radius: 9999px;\n background: var(--danger, #ef4444);\n flex-shrink: 0;\n }\n .rec-dot.live {\n animation: rec-pulse 1s ease-in-out infinite;\n }\n @keyframes rec-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.35; }\n }\n .rec-timer {\n font-size: var(--text-14);\n font-weight: var(--fw-600);\n font-variant-numeric: tabular-nums;\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n color: var(--text-primary);\n letter-spacing: -0.02em;\n }\n .rec-wave {\n flex: none;\n width: min(18rem, 42vw);\n min-width: 8rem;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 1.75rem;\n overflow: hidden;\n padding: 0 var(--space-8);\n }\n .rec-wave audio-bubble {\n display: block;\n width: 100%;\n height: 1.75rem;\n min-width: 0;\n }\n .rec-icon-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 0.375rem;\n border-radius: 9999px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--icon);\n flex-shrink: 0;\n }\n .rec-icon-btn:hover {\n background: var(--hover-overlay);\n }\n .rec-icon-btn.danger {\n color: var(--danger, #ef4444);\n }\n .rec-icon-btn.danger:hover {\n background: color-mix(in srgb, var(--danger, #ef4444) 10%, transparent);\n }\n .rec-icon-btn img {\n width: 1.25rem;\n height: 1.25rem;\n display: block;\n object-fit: contain;\n }\n .rec-icon-btn.danger img {\n filter: invert(27%) sepia(98%) saturate(2800%) hue-rotate(346deg) brightness(95%) contrast(95%);\n }\n .rec-icon-btn.pause img {\n filter: invert(27%) sepia(98%) saturate(2800%) hue-rotate(346deg) brightness(95%) contrast(95%);\n }\n .rec-toggle {\n padding: 0.25rem;\n }\n .rec-toggle img {\n width: 1rem;\n height: 1rem;\n }\n .rec-send {\n width: 2.5rem;\n height: 2.5rem;\n border: none;\n border-radius: 9999px;\n background: var(--brand, #2563eb);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n box-shadow: 0 1px 2px var(--overlay);\n padding: 0;\n margin-left: var(--gap-4);\n }\n .rec-send:hover {\n filter: brightness(0.92);\n }\n .rec-send:active {\n transform: scale(0.95);\n }\n .rec-send img {\n width: 1.25rem;\n height: 1.25rem;\n display: block;\n object-fit: contain;\n filter: brightness(0) invert(1);\n }\n .theme-icon { filter: var(--svg-icon-filter); }";
|
|
5537
5554
|
|
|
5538
5555
|
const BlockChatList = class {
|
|
5539
5556
|
constructor(hostRef) {
|