isometrik-plugin-chat-sdk 2.0.12 → 2.0.14
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/{app-globals-c433d8a6.js → app-globals-95486d77.js} +2 -2
- package/dist/cjs/{app-globals-c433d8a6.js.map → app-globals-95486d77.js.map} +1 -1
- package/dist/cjs/attachment-preview_22.cjs.entry.js +65 -57
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/audio-bubble_4.cjs.entry.js +3 -2
- package/dist/cjs/audio-bubble_4.cjs.entry.js.map +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/isometrik-webchat.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/login-page_3.cjs.entry.js +88 -35
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-95f6cb3b.js → runtime-controls-959fe6ed.js} +4 -2
- package/dist/cjs/runtime-controls-959fe6ed.js.map +1 -0
- package/dist/cjs/{send-media-37e09e83.js → send-media-2dadbb03.js} +98 -19
- package/dist/cjs/send-media-2dadbb03.js.map +1 -0
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +53 -12
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +12 -32
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +11 -6
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +5 -5
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js +2 -2
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +21 -2
- package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.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/data-fetch.js +13 -3
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/lib/chat/index.js +1 -1
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/send-media.js +96 -18
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/mqtt/dispatch.js +56 -31
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/lib/mqtt/index.js +1 -1
- package/dist/collection/lib/mqtt/index.js.map +1 -1
- package/dist/collection/lib/mqtt/types.js +17 -0
- package/dist/collection/lib/mqtt/types.js.map +1 -1
- package/dist/collection/sdk/init.js +2 -0
- package/dist/collection/sdk/init.js.map +1 -1
- package/dist/components/ChatFooter.js +12 -32
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +36 -12
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/GroupCast2.js +2 -2
- package/dist/components/GroupCast2.js.map +1 -1
- package/dist/components/WebChat.js +88 -34
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +6 -6
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/WebChatHeader.js +11 -6
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/send-media.js +97 -19
- package/dist/components/send-media.js.map +1 -1
- package/dist/components/video-message2.js +4 -2
- package/dist/components/video-message2.js.map +1 -1
- package/dist/esm/{app-globals-dfce8a5b.js → app-globals-879c137f.js} +2 -2
- package/dist/esm/{app-globals-dfce8a5b.js.map → app-globals-879c137f.js.map} +1 -1
- package/dist/esm/attachment-preview_22.entry.js +65 -57
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +3 -2
- package/dist/esm/audio-bubble_4.entry.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/isometrik-webchat.js +4 -4
- package/dist/esm/loader.js +4 -4
- package/dist/esm/login-page_3.entry.js +88 -35
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-ec6d5c75.js → runtime-controls-6b7c852a.js} +4 -2
- package/dist/esm/runtime-controls-6b7c852a.js.map +1 -0
- package/dist/esm/{send-media-a946c6dd.js → send-media-ac360d8e.js} +98 -20
- package/dist/esm/send-media-ac360d8e.js.map +1 -0
- package/dist/isometrik-webchat/index.esm.js +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-46dcd38f.js → p-217b9dc2.js} +2 -2
- package/dist/isometrik-webchat/p-217b9dc2.js.map +1 -0
- package/dist/isometrik-webchat/p-2c87c3fd.entry.js +2 -0
- package/dist/isometrik-webchat/p-2c87c3fd.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-30855ba7.js +2 -0
- package/dist/isometrik-webchat/p-30855ba7.js.map +1 -0
- package/dist/isometrik-webchat/{p-cc5b86e6.entry.js → p-3120b9d3.entry.js} +2 -2
- package/dist/isometrik-webchat/p-3120b9d3.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-63ff4eea.entry.js.map → p-5672fae7.entry.js} +2 -1
- package/dist/isometrik-webchat/p-5672fae7.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-79d1a171.js +2 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +2 -0
- package/dist/types/components/ChatUIComponent/shared/video-message/video-message.d.ts +2 -0
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +322 -0
- package/dist/types/components/my-component/web-chat/data-fetch.d.ts +14 -0
- package/dist/types/components.d.ts +24 -0
- package/dist/types/lib/chat/index.d.ts +1 -1
- package/dist/types/lib/chat/send-media.d.ts +21 -0
- package/dist/types/lib/mqtt/index.d.ts +1 -1
- package/dist/types/lib/mqtt/types.d.ts +11 -0
- package/dist/types/sdk/init.d.ts +7 -0
- package/package.json +1 -1
- package/dist/cjs/runtime-controls-95f6cb3b.js.map +0 -1
- package/dist/cjs/send-media-37e09e83.js.map +0 -1
- package/dist/components/urls.js +0 -5
- package/dist/components/urls.js.map +0 -1
- package/dist/esm/runtime-controls-ec6d5c75.js.map +0 -1
- package/dist/esm/send-media-a946c6dd.js.map +0 -1
- package/dist/isometrik-webchat/p-2d69086d.entry.js +0 -2
- package/dist/isometrik-webchat/p-2d69086d.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3f355f9e.js +0 -2
- package/dist/isometrik-webchat/p-3f355f9e.js.map +0 -1
- package/dist/isometrik-webchat/p-46dcd38f.js.map +0 -1
- package/dist/isometrik-webchat/p-63ff4eea.entry.js +0 -2
- package/dist/isometrik-webchat/p-86be30fe.js +0 -2
- package/dist/isometrik-webchat/p-cc5b86e6.entry.js.map +0 -1
- /package/dist/isometrik-webchat/{p-86be30fe.js.map → p-79d1a171.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/sdk/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC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G,UAAU,CAAC,GAAG,EAAE;QACtC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC;YAAE,OAAO;QAC7B,uBAAuB,EAAE,CAAC;IAC5B,CAAC,EAAE,OAAO,CAAC,CAAC;AACd,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,0BAA0B,CAAC","sourcesContent":["import { destroyChatDom } from '../lib/destroy-chat';\nimport type { WebChatSlotName, WebChatCustomParts } from '../lib/custom-ui';\nimport type { ThemeTokenMap } from './theme-tokens';\nimport { normalizeThemeObject } from './theme-tokens';\nimport { resolveShowProfileRailProp } from './composition';\nimport { createWebChatApi, type WebChatApi } from './webchat-api';\nimport { setWebChatSlots } from './slots';\nimport { clearChatStore, getChatStore, setChatStore } from './instance';\n\nconst DEFAULT_THEME_URL =\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n\nexport type IsometrikWebchatInitProps = {\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 /** CSS file from CDN or same-origin path. */\n themeUrl?: string;\n /** Inline CSS variable overrides (wins over themeUrl for same keys). */\n theme?: ThemeTokenMap;\n /** @deprecated Use `theme`. Kept for applyCustomTheme / older hosts. */\n themeObject?: Record<string, 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. */\n customParts?: WebChatCustomParts;\n /** When false, hide the left profile icon rail. Default true. */\n showProfileRail?: boolean;\n /** Alias of showProfileRail for clearer host DX. Default true. */\n showProfileSidebar?: boolean;\n /** When false, no doodle wallpaper behind messages. Default true. */\n showChatWallpaper?: boolean;\n /** When false, hide groupcast entry points. Default true. */\n groupcastEnabled?: boolean;\n /** When false, hide conversation header. Default true. */\n showHeader?: boolean;\n /** When false, hide composer. Default true. */\n showComposer?: boolean;\n /** When false, hide empty state. Default true. */\n showEmptyState?: boolean;\n /** When false, hide conversation list. Default true. */\n showConversationList?: boolean;\n /** When false, never show right info panel. Default true. */\n showRightPanel?: boolean;\n};\n\n/** @deprecated Use IsometrikWebchatInitProps */\nexport type InitializeChatProps = IsometrikWebchatInitProps;\n\nexport type IsometrikWebchatInstance = {\n themeProvider: HTMLElement;\n chatComponent: HTMLElement;\n /** Bound actions/events for the live instance. */\n api: WebChatApi;\n /** Session key used by ensure/retain. */\n sessionKey: string;\n destroy: () => void;\n};\n\n/** Identity for reuse — same user + project + mount target → skip re-bootstrap. */\nexport function buildWebchatSessionKey(props: IsometrikWebchatInitProps): string {\n return [\n props.containerId || '__body__',\n props.isometrikUserId,\n props.userToken,\n props.projectId,\n props.accountId,\n props.keysetId,\n ].join('|');\n}\n\ntype RetainState = {\n count: number;\n sessionKey: string;\n instance: IsometrikWebchatInstance | null;\n pendingDestroy: ReturnType<typeof setTimeout> | null;\n};\n\nfunction getRetainState(): RetainState {\n if (typeof window === 'undefined') {\n return { count: 0, sessionKey: '', instance: null, pendingDestroy: null };\n }\n const w = window as any;\n if (!w.__isometrikChatRetain) {\n w.__isometrikChatRetain = {\n count: 0,\n sessionKey: '',\n instance: null,\n pendingDestroy: null,\n } as RetainState;\n }\n return w.__isometrikChatRetain;\n}\n\nfunction resolveThemeObject(props: IsometrikWebchatInitProps): Record<string, string> | undefined {\n const merged = { ...(props.themeObject || {}), ...(props.theme || {}) };\n const normalized = normalizeThemeObject(merged as Record<string, string>);\n return Object.keys(normalized).length ? normalized : undefined;\n}\n\nfunction applyOptionalBool(el: any, key: string, value: boolean | undefined) {\n if (value !== undefined) el[key] = value;\n}\n\nfunction isLiveInstance(instance: IsometrikWebchatInstance | null): boolean {\n if (!instance) return false;\n const { themeProvider, chatComponent } = instance;\n if (!themeProvider || !chatComponent) return false;\n // isConnected may be false in some test envs; also accept store match\n const store = getChatStore();\n return store.chatComponent === chatComponent && store.themeProvider === themeProvider;\n}\n\n/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */\nexport function destroyIsometrikWebchat(): void {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count = 0;\n retain.sessionKey = '';\n retain.instance = null;\n\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 clearChatStore();\n}\n\n/** @deprecated Use destroyIsometrikWebchat */\nexport const destroyChat = destroyIsometrikWebchat;\n\n/**\n * Force mount: always tears down previous instance then creates a new one.\n * Prefer `retainIsometrikWebchat` / `ensureIsometrikWebchat` in React/SPA hosts\n * to avoid double bootstrap (Strict Mode / remount).\n */\nexport function initializeIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\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 destroyIsometrikWebchat();\n\n const sessionKey = buildWebchatSessionKey(props);\n const themeProvider = document.createElement('theme-provider') as any;\n const themeUrl = props.themeUrl || DEFAULT_THEME_URL;\n const themeObject = resolveThemeObject(props);\n\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n themeProvider.setAttribute('theme-path', themeUrl);\n if (themeObject) {\n themeProvider.themeObject = themeObject;\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 = themeUrl;\n\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n\n if (props.customParts) {\n chatComponent.customParts = props.customParts;\n }\n\n applyOptionalBool(chatComponent, 'showProfileRail', resolveShowProfileRailProp(props));\n applyOptionalBool(chatComponent, 'showChatWallpaper', props.showChatWallpaper);\n applyOptionalBool(chatComponent, 'groupcastEnabled', props.groupcastEnabled);\n applyOptionalBool(chatComponent, 'showHeader', props.showHeader);\n applyOptionalBool(chatComponent, 'showComposer', props.showComposer);\n applyOptionalBool(chatComponent, 'showEmptyState', props.showEmptyState);\n applyOptionalBool(chatComponent, 'showConversationList', props.showConversationList);\n applyOptionalBool(chatComponent, 'showRightPanel', props.showRightPanel);\n\n setWebChatSlots(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 setChatStore({ themeProvider, chatComponent });\n\n const api = createWebChatApi(chatComponent)!;\n const instance: IsometrikWebchatInstance = {\n themeProvider,\n chatComponent,\n api,\n sessionKey,\n destroy: destroyIsometrikWebchat,\n };\n\n const retain = getRetainState();\n retain.instance = instance;\n retain.sessionKey = sessionKey;\n retain.count = Math.max(retain.count, 1);\n\n return instance;\n}\n\n/**\n * Reuse live instance when session key matches (same user/token/container).\n * Otherwise mounts fresh. Does not bump retain count — use `retainIsometrikWebchat` in React.\n */\nexport function ensureIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n\n const key = buildWebchatSessionKey(props);\n if (retain.sessionKey === key && isLiveInstance(retain.instance)) {\n return retain.instance;\n }\n return initializeIsometrikWebchat(props);\n}\n\n/**\n * React / SPA friendly: acquire a chat instance.\n * Pair with `releaseIsometrikWebchat` in effect cleanup.\n * Survives React 18 Strict Mode double-mount without a second bootstrap.\n */\nexport function retainIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count += 1;\n return ensureIsometrikWebchat(props);\n}\n\n/**\n * Release a retain from `retainIsometrikWebchat`.\n * Destroy is deferred so Strict Mode remount can cancel it.\n * @param delayMs default 0 (macrotask) — enough for React 18 Strict Mode\n */\nexport function releaseIsometrikWebchat(delayMs: number = 0): void {\n const retain = getRetainState();\n retain.count = Math.max(0, retain.count - 1);\n if (retain.count > 0) return;\n\n if (retain.pendingDestroy) clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = setTimeout(() => {\n retain.pendingDestroy = null;\n if (retain.count > 0) return;\n destroyIsometrikWebchat();\n }, delayMs);\n}\n\n/** @deprecated Use initializeIsometrikWebchat */\nexport const initializeChat = initializeIsometrikWebchat;\n"]}
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/sdk/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OA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MAAM,CAAC,KAAK,GAAG,CAAC;QAAE,OAAO;IAE7B,IAAI,MAAM,CAAC,cAAc;QAAE,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAC/D,MAAM,CAAC,cAAc,GAAG,UAAU,CAAC,GAAG,EAAE;QACtC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC;YAAE,OAAO;QAC7B,uBAAuB,EAAE,CAAC;IAC5B,CAAC,EAAE,OAAO,CAAC,CAAC;AACd,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,0BAA0B,CAAC","sourcesContent":["import { destroyChatDom } from '../lib/destroy-chat';\nimport type { WebChatSlotName, WebChatCustomParts } from '../lib/custom-ui';\nimport type { ThemeTokenMap } from './theme-tokens';\nimport { normalizeThemeObject } from './theme-tokens';\nimport { resolveShowProfileRailProp } from './composition';\nimport { createWebChatApi, type WebChatApi } from './webchat-api';\nimport { setWebChatSlots } from './slots';\nimport { clearChatStore, getChatStore, setChatStore } from './instance';\n\nconst DEFAULT_THEME_URL =\n 'https://isometrik-website-bucket.s3.ap-south-1.amazonaws.com/styles/chat-combined-theme.css';\n\nexport type IsometrikWebchatInitProps = {\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 /** CSS file from CDN or same-origin path. */\n themeUrl?: string;\n /** Inline CSS variable overrides (wins over themeUrl for same keys). */\n theme?: ThemeTokenMap;\n /** @deprecated Use `theme`. Kept for applyCustomTheme / older hosts. */\n themeObject?: Record<string, 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. */\n customParts?: WebChatCustomParts;\n /** When false, hide the left profile icon rail. Default true. */\n showProfileRail?: boolean;\n /** Alias of showProfileRail for clearer host DX. Default true. */\n showProfileSidebar?: boolean;\n /** When false, no doodle wallpaper behind messages. Default true. */\n showChatWallpaper?: boolean;\n /** When false, hide groupcast entry points. Default true. */\n groupcastEnabled?: boolean;\n /** When false, hide conversation header. Default true. */\n showHeader?: boolean;\n /** When false, hide composer. Default true. */\n showComposer?: boolean;\n /** When false, hide empty state. Default true. */\n showEmptyState?: boolean;\n /** When false, hide conversation list. Default true. */\n showConversationList?: boolean;\n /** When false, never show right info panel. Default true. */\n showRightPanel?: boolean;\n /** When false, hide conversation-list search. Default true. */\n isSidebarHeaderSearch?: boolean;\n /**\n * When false, hide the MQTT green/red status dot in the conversation list header.\n * Default true.\n */\n showMqttStatus?: boolean;\n};\n\n/** @deprecated Use IsometrikWebchatInitProps */\nexport type InitializeChatProps = IsometrikWebchatInitProps;\n\nexport type IsometrikWebchatInstance = {\n themeProvider: HTMLElement;\n chatComponent: HTMLElement;\n /** Bound actions/events for the live instance. */\n api: WebChatApi;\n /** Session key used by ensure/retain. */\n sessionKey: string;\n destroy: () => void;\n};\n\n/** Identity for reuse — same user + project + mount target → skip re-bootstrap. */\nexport function buildWebchatSessionKey(props: IsometrikWebchatInitProps): string {\n return [\n props.containerId || '__body__',\n props.isometrikUserId,\n props.userToken,\n props.projectId,\n props.accountId,\n props.keysetId,\n ].join('|');\n}\n\ntype RetainState = {\n count: number;\n sessionKey: string;\n instance: IsometrikWebchatInstance | null;\n pendingDestroy: ReturnType<typeof setTimeout> | null;\n};\n\nfunction getRetainState(): RetainState {\n if (typeof window === 'undefined') {\n return { count: 0, sessionKey: '', instance: null, pendingDestroy: null };\n }\n const w = window as any;\n if (!w.__isometrikChatRetain) {\n w.__isometrikChatRetain = {\n count: 0,\n sessionKey: '',\n instance: null,\n pendingDestroy: null,\n } as RetainState;\n }\n return w.__isometrikChatRetain;\n}\n\nfunction resolveThemeObject(props: IsometrikWebchatInitProps): Record<string, string> | undefined {\n const merged = { ...(props.themeObject || {}), ...(props.theme || {}) };\n const normalized = normalizeThemeObject(merged as Record<string, string>);\n return Object.keys(normalized).length ? normalized : undefined;\n}\n\nfunction applyOptionalBool(el: any, key: string, value: boolean | undefined) {\n if (value !== undefined) el[key] = value;\n}\n\nfunction isLiveInstance(instance: IsometrikWebchatInstance | null): boolean {\n if (!instance) return false;\n const { themeProvider, chatComponent } = instance;\n if (!themeProvider || !chatComponent) return false;\n // isConnected may be false in some test envs; also accept store match\n const store = getChatStore();\n return store.chatComponent === chatComponent && store.themeProvider === themeProvider;\n}\n\n/** Tear down existing chat instance (MQTT via disconnectedCallback, DOM). */\nexport function destroyIsometrikWebchat(): void {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count = 0;\n retain.sessionKey = '';\n retain.instance = null;\n\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 clearChatStore();\n}\n\n/** @deprecated Use destroyIsometrikWebchat */\nexport const destroyChat = destroyIsometrikWebchat;\n\n/**\n * Force mount: always tears down previous instance then creates a new one.\n * Prefer `retainIsometrikWebchat` / `ensureIsometrikWebchat` in React/SPA hosts\n * to avoid double bootstrap (Strict Mode / remount).\n */\nexport function initializeIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\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 destroyIsometrikWebchat();\n\n const sessionKey = buildWebchatSessionKey(props);\n const themeProvider = document.createElement('theme-provider') as any;\n const themeUrl = props.themeUrl || DEFAULT_THEME_URL;\n const themeObject = resolveThemeObject(props);\n\n if (props.defaultTheme) {\n themeProvider.setAttribute('mode', props.defaultTheme);\n }\n themeProvider.setAttribute('theme-path', themeUrl);\n if (themeObject) {\n themeProvider.themeObject = themeObject;\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 = themeUrl;\n\n chatComponent.style.width = '100%';\n chatComponent.style.height = '100%';\n\n if (props.customParts) {\n chatComponent.customParts = props.customParts;\n }\n\n applyOptionalBool(chatComponent, 'showProfileRail', resolveShowProfileRailProp(props));\n applyOptionalBool(chatComponent, 'showChatWallpaper', props.showChatWallpaper);\n applyOptionalBool(chatComponent, 'groupcastEnabled', props.groupcastEnabled);\n applyOptionalBool(chatComponent, 'showHeader', props.showHeader);\n applyOptionalBool(chatComponent, 'showComposer', props.showComposer);\n applyOptionalBool(chatComponent, 'showEmptyState', props.showEmptyState);\n applyOptionalBool(chatComponent, 'showConversationList', props.showConversationList);\n applyOptionalBool(chatComponent, 'showRightPanel', props.showRightPanel);\n applyOptionalBool(chatComponent, 'isSidebarHeaderSearch', props.isSidebarHeaderSearch);\n applyOptionalBool(chatComponent, 'showMqttStatus', props.showMqttStatus);\n\n setWebChatSlots(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 setChatStore({ themeProvider, chatComponent });\n\n const api = createWebChatApi(chatComponent)!;\n const instance: IsometrikWebchatInstance = {\n themeProvider,\n chatComponent,\n api,\n sessionKey,\n destroy: destroyIsometrikWebchat,\n };\n\n const retain = getRetainState();\n retain.instance = instance;\n retain.sessionKey = sessionKey;\n retain.count = Math.max(retain.count, 1);\n\n return instance;\n}\n\n/**\n * Reuse live instance when session key matches (same user/token/container).\n * Otherwise mounts fresh. Does not bump retain count — use `retainIsometrikWebchat` in React.\n */\nexport function ensureIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n\n const key = buildWebchatSessionKey(props);\n if (retain.sessionKey === key && isLiveInstance(retain.instance)) {\n return retain.instance;\n }\n return initializeIsometrikWebchat(props);\n}\n\n/**\n * React / SPA friendly: acquire a chat instance.\n * Pair with `releaseIsometrikWebchat` in effect cleanup.\n * Survives React 18 Strict Mode double-mount without a second bootstrap.\n */\nexport function retainIsometrikWebchat(\n props: IsometrikWebchatInitProps,\n): IsometrikWebchatInstance | null {\n const retain = getRetainState();\n if (retain.pendingDestroy) {\n clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = null;\n }\n retain.count += 1;\n return ensureIsometrikWebchat(props);\n}\n\n/**\n * Release a retain from `retainIsometrikWebchat`.\n * Destroy is deferred so Strict Mode remount can cancel it.\n * @param delayMs default 0 (macrotask) — enough for React 18 Strict Mode\n */\nexport function releaseIsometrikWebchat(delayMs: number = 0): void {\n const retain = getRetainState();\n retain.count = Math.max(0, retain.count - 1);\n if (retain.count > 0) return;\n\n if (retain.pendingDestroy) clearTimeout(retain.pendingDestroy);\n retain.pendingDestroy = setTimeout(() => {\n retain.pendingDestroy = null;\n if (retain.count > 0) return;\n destroyIsometrikWebchat();\n }, delayMs);\n}\n\n/** @deprecated Use initializeIsometrikWebchat */\nexport const initializeChat = initializeIsometrikWebchat;\n"]}
|
|
@@ -6,7 +6,7 @@ import { g as getDeviceID, a as getGroupcastUrlQuery } from './helpers.js';
|
|
|
6
6
|
import { d as defineCustomElement$1 } from './reply-block2.js';
|
|
7
7
|
import { s as showToast } from './toast.js';
|
|
8
8
|
import { t as takeMediaFiles, m as mediaLimitToastMessage, M as MAX_MEDIA_PER_MESSAGE } from './media-limits.js';
|
|
9
|
-
import { A as ATTACHMENT_BODY_PLACEHOLDER, a as attachmentBodyForApi, b as buildReplyMetaData } from './send-media.js';
|
|
9
|
+
import { A as ATTACHMENT_BODY_PLACEHOLDER, a as attachmentBodyForApi, b as buildReplyMetaData, e as uploadPresignedMediaAttachment } from './send-media.js';
|
|
10
10
|
import { c as getPresignedUrlForGroupcastMedia, p as postGroupCastMessage } from './groupcast.js';
|
|
11
11
|
import { D as Delete, d as Send, A as Attachment, S as Smile, M as Microphone } from './chat-assets.js';
|
|
12
12
|
import { P as PlayIcon, D as DocumentsIcon, a as PhotosIcon } from './play.js';
|
|
@@ -749,38 +749,18 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
749
749
|
var _a, _b, _c;
|
|
750
750
|
const allPayloads = [];
|
|
751
751
|
const uploadPromises = presignedUrls.map(async (urlDetails, index) => {
|
|
752
|
-
let mediaId, mediaUrl, thumbnailUrl, mediaPresignedUrl;
|
|
753
|
-
if (this.isGroupcast) {
|
|
754
|
-
mediaUrl = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl;
|
|
755
|
-
mediaPresignedUrl = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.presignedUrl;
|
|
756
|
-
mediaId = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl;
|
|
757
|
-
thumbnailUrl = urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl;
|
|
758
|
-
}
|
|
759
|
-
else {
|
|
760
|
-
({ mediaPresignedUrl, mediaId, mediaUrl, thumbnailUrl } = urlDetails);
|
|
761
|
-
}
|
|
762
752
|
const attachmentPayload = attachments[index];
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
thumbnailUrl,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
mimeType: attachmentPayload.mimeType,
|
|
772
|
-
extension: fileExtensionType,
|
|
773
|
-
size: attachmentPayload.size,
|
|
774
|
-
attachmentType: 0,
|
|
775
|
-
};
|
|
776
|
-
allPayloads.push(newPayload);
|
|
777
|
-
await fetch(mediaPresignedUrl, {
|
|
778
|
-
method: 'PUT',
|
|
779
|
-
body: attachmentPayload.file,
|
|
780
|
-
headers: {
|
|
781
|
-
'Content-Type': attachmentPayload.mimeType,
|
|
782
|
-
},
|
|
753
|
+
if (!attachmentPayload)
|
|
754
|
+
return;
|
|
755
|
+
// Groupcast presign shape differs — map onto the shared uploader contract.
|
|
756
|
+
const normalized = this.isGroupcast
|
|
757
|
+
? Object.assign(Object.assign({}, urlDetails), { mediaPresignedUrl: (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.presignedUrl) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaPresignedUrl), mediaId: (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaId) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl), thumbnailUrl: (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.thumbnailUrl) || (urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.mediaUrl), thumbnailPresignedUrl: urlDetails === null || urlDetails === void 0 ? void 0 : urlDetails.thumbnailPresignedUrl }) : urlDetails;
|
|
758
|
+
const payload = await uploadPresignedMediaAttachment({
|
|
759
|
+
urlDetails: normalized,
|
|
760
|
+
attachment: attachmentPayload,
|
|
783
761
|
});
|
|
762
|
+
if (payload)
|
|
763
|
+
allPayloads.push(payload);
|
|
784
764
|
});
|
|
785
765
|
await Promise.all(uploadPromises);
|
|
786
766
|
// One attachment → typed; 2–5 together → Multiple (same message)
|
|
@@ -879,7 +859,7 @@ const ChatFooter = /*@__PURE__*/ proxyCustomElement(class ChatFooter extends HTM
|
|
|
879
859
|
const webChat = findWebChatHost(this.el);
|
|
880
860
|
const hasCustomReply = (webChat ? hasNamedSlot(webChat, 'reply-preview') : false) || hasNamedSlot(this.el, 'reply-preview');
|
|
881
861
|
const showAttachment = this.attachmentDetails || this.showCamera;
|
|
882
|
-
return (h(Host, { key: '
|
|
862
|
+
return (h(Host, { key: '41aa3584baa28864ebbaa4177f9109ab89fc1afa', class: { 'attachment-open': !!showAttachment } }, h("div", { key: '7f5c23e432043756124aaf3af2956764eaa5481d', 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)
|
|
883
863
|
? 'You'
|
|
884
864
|
: (_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,.mp3,.wav,.m4a,.aac,.ogg", 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,.rtf,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: "" })))))))))))));
|
|
885
865
|
}
|