isometrik-plugin-chat-sdk 2.0.16 → 2.0.18
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-95486d77.js → app-globals-170f9e71.js} +3 -3
- package/dist/cjs/{app-globals-95486d77.js.map → app-globals-170f9e71.js.map} +1 -1
- package/dist/cjs/attachment-preview_22.cjs.entry.js +111 -47
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/contracts-dfc84075.js.map +1 -1
- package/dist/cjs/{drawer-960b3f5d.js → drawer-00a2323a.js} +2 -2
- package/dist/cjs/{drawer-960b3f5d.js.map → drawer-00a2323a.js.map} +1 -1
- package/dist/cjs/forward-memebers.cjs.entry.js +15 -9
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
- package/dist/cjs/{group-members-1205fc4c.js → group-members-b3bea06e.js} +5 -5
- package/dist/cjs/{group-members-1205fc4c.js.map → group-members-b3bea06e.js.map} +1 -1
- package/dist/cjs/{group-members-5a82ec8a.js → group-members-cef1198e.js} +29 -1
- package/dist/cjs/group-members-cef1198e.js.map +1 -0
- package/dist/cjs/{groupcast-c93d4a7d.js → groupcast-3cb44a25.js} +16 -16
- package/dist/cjs/{groupcast-c93d4a7d.js.map → groupcast-3cb44a25.js.map} +1 -1
- package/dist/cjs/{groupcast-5e3d49c4.js → groupcast-4239cbfc.js} +7 -7
- package/dist/cjs/{groupcast-5e3d49c4.js.map → groupcast-4239cbfc.js.map} +1 -1
- package/dist/cjs/{index-66f98408.js → index-3411923c.js} +2 -1
- package/dist/cjs/index-3411923c.js.map +1 -0
- package/dist/cjs/index.cjs.js +7 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/isometrik-webchat.cjs.js +9 -8
- package/dist/cjs/isometrik-webchat.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +9 -8
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/local-notification-bdd04d7a.js +259 -0
- package/dist/cjs/local-notification-bdd04d7a.js.map +1 -0
- package/dist/cjs/login-page_3.cjs.entry.js +78 -31
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/media-gallery.cjs.entry.js +1 -1
- package/dist/cjs/member-add.cjs.entry.js +5 -6
- package/dist/cjs/member-add.cjs.entry.js.map +1 -1
- package/dist/cjs/{message-reaction-8f93a048.js → message-reaction-82a4f93c.js} +5 -5
- package/dist/cjs/{message-reaction-8f93a048.js.map → message-reaction-82a4f93c.js.map} +1 -1
- package/dist/cjs/reaction-container.cjs.entry.js +3 -4
- package/dist/cjs/reaction-container.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-959fe6ed.js → runtime-controls-99f378d4.js} +9 -4
- package/dist/cjs/runtime-controls-99f378d4.js.map +1 -0
- package/dist/cjs/{send-media-2dadbb03.js → send-media-7c865c19.js} +13 -11
- package/dist/cjs/send-media-7c865c19.js.map +1 -0
- package/dist/cjs/signup-page.cjs.entry.js +2 -2
- package/dist/cjs/spinner-loader.cjs.entry.js +1 -1
- package/dist/cjs/{index.m-ff115b26.js → toast-91093c84.js} +156 -1
- package/dist/cjs/{index.m-ff115b26.js.map → toast-91093c84.js.map} +1 -1
- package/dist/cjs/toast-notification.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +22 -8
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +10 -4
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/chat-tile/chat-tile.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +64 -3
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/new chat/new-chat.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/spinner-loader/spinner-loader.js +1 -1
- package/dist/collection/components/ChatUIComponent/shared/toast-notification/toast-notification.js +3 -3
- package/dist/collection/components/Login.js +1 -1
- package/dist/collection/components/Signup.js +2 -2
- package/dist/collection/components/my-component/web-chat/WebChat.js +61 -2
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/event-handlers.js +16 -3
- package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/offline-host.js +11 -0
- package/dist/collection/components/my-component/web-chat/offline-host.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/public-send.js +10 -0
- package/dist/collection/components/my-component/web-chat/public-send.js.map +1 -1
- package/dist/collection/components/theme-provider.js +1 -1
- package/dist/collection/lib/chat/conversation-notifications.js +26 -0
- package/dist/collection/lib/chat/conversation-notifications.js.map +1 -0
- package/dist/collection/lib/chat/index.js +3 -0
- package/dist/collection/lib/chat/index.js.map +1 -1
- package/dist/collection/lib/chat/local-notification.js +118 -0
- package/dist/collection/lib/chat/local-notification.js.map +1 -0
- package/dist/collection/lib/chat/message-notification.js +134 -0
- package/dist/collection/lib/chat/message-notification.js.map +1 -0
- package/dist/collection/lib/chat/send-media.js +3 -1
- package/dist/collection/lib/chat/send-media.js.map +1 -1
- package/dist/collection/lib/custom-ui/contracts.js.map +1 -1
- package/dist/collection/lib/custom-ui/index.js.map +1 -1
- package/dist/collection/lib/mqtt/dispatch.js +17 -1
- package/dist/collection/lib/mqtt/dispatch.js.map +1 -1
- package/dist/collection/sdk/init.js +5 -0
- package/dist/collection/sdk/init.js.map +1 -1
- package/dist/components/ChatFooter.js +21 -8
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/GroupCast2.js +1 -1
- package/dist/components/Login.js +1 -1
- package/dist/components/WebChat.js +55 -4
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/contact-info2.js +88 -6
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/context-menu2.js +1 -1
- package/dist/components/contracts.js.map +1 -1
- package/dist/components/forward-memebers.js +10 -4
- package/dist/components/forward-memebers.js.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/local-notification.js +254 -0
- package/dist/components/local-notification.js.map +1 -0
- package/dist/components/media-gallery.js +1 -1
- package/dist/components/send-media.js +3 -1
- package/dist/components/send-media.js.map +1 -1
- package/dist/components/signup-page.js +2 -2
- package/dist/components/spinner-loader2.js +1 -1
- package/dist/components/theme-provider2.js +1 -1
- package/dist/components/toast-notification.js +3 -3
- package/dist/esm/{app-globals-879c137f.js → app-globals-15a6ef50.js} +3 -3
- package/dist/esm/{app-globals-879c137f.js.map → app-globals-15a6ef50.js.map} +1 -1
- package/dist/esm/attachment-preview_22.entry.js +83 -19
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/contracts-50f4ddae.js.map +1 -1
- package/dist/esm/{drawer-d54c2f10.js → drawer-7de04622.js} +2 -2
- package/dist/esm/{drawer-d54c2f10.js.map → drawer-7de04622.js.map} +1 -1
- package/dist/esm/forward-memebers.entry.js +13 -7
- package/dist/esm/forward-memebers.entry.js.map +1 -1
- package/dist/esm/{group-members-d603f29f.js → group-members-36cf9395.js} +2 -2
- package/dist/esm/{group-members-d603f29f.js.map → group-members-36cf9395.js.map} +1 -1
- package/dist/esm/{group-members-05414da2.js → group-members-7909941c.js} +28 -2
- package/dist/esm/group-members-7909941c.js.map +1 -0
- package/dist/esm/{groupcast-9c7d2a32.js → groupcast-cc10c6a4.js} +2 -2
- package/dist/esm/{groupcast-9c7d2a32.js.map → groupcast-cc10c6a4.js.map} +1 -1
- package/dist/esm/{groupcast-58a59d64.js → groupcast-ea2466c8.js} +3 -3
- package/dist/esm/{groupcast-58a59d64.js.map → groupcast-ea2466c8.js.map} +1 -1
- package/dist/esm/{index-4c865e34.js → index-142896ce.js} +2 -2
- package/dist/esm/index-142896ce.js.map +1 -0
- package/dist/esm/index.js +8 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isometrik-webchat.js +9 -8
- package/dist/esm/isometrik-webchat.js.map +1 -1
- package/dist/esm/loader.js +9 -8
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/local-notification-4c1e166d.js +254 -0
- package/dist/esm/local-notification-4c1e166d.js.map +1 -0
- package/dist/esm/login-page_3.entry.js +61 -14
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/media-gallery.entry.js +1 -1
- package/dist/esm/member-add.entry.js +5 -6
- package/dist/esm/member-add.entry.js.map +1 -1
- package/dist/esm/{message-reaction-0a2bb115.js → message-reaction-0d2ef75f.js} +2 -2
- package/dist/esm/{message-reaction-0a2bb115.js.map → message-reaction-0d2ef75f.js.map} +1 -1
- package/dist/esm/reaction-container.entry.js +3 -4
- package/dist/esm/reaction-container.entry.js.map +1 -1
- package/dist/esm/{runtime-controls-6b7c852a.js → runtime-controls-8a22625e.js} +9 -4
- package/dist/esm/runtime-controls-8a22625e.js.map +1 -0
- package/dist/esm/{send-media-ac360d8e.js → send-media-5527ee9f.js} +5 -3
- package/dist/esm/send-media-5527ee9f.js.map +1 -0
- package/dist/esm/signup-page.entry.js +2 -2
- package/dist/esm/spinner-loader.entry.js +1 -1
- package/dist/esm/{index.m-8c70037f.js → toast-a1531088.js} +156 -2
- package/dist/esm/{index.m-8c70037f.js.map → toast-a1531088.js.map} +1 -1
- package/dist/esm/toast-notification.entry.js +3 -3
- 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-586f6978.entry.js → p-08ba6153.entry.js} +2 -2
- package/dist/isometrik-webchat/p-1db79cfb.js +2 -0
- package/dist/isometrik-webchat/p-343f50b4.js +7 -0
- package/dist/isometrik-webchat/p-343f50b4.js.map +1 -0
- package/dist/isometrik-webchat/{p-5d98a8a0.js → p-4671fe73.js} +2 -2
- package/dist/isometrik-webchat/{p-ca47d693.entry.js → p-52a575c0.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-b1330793.js → p-54267fe0.js} +2 -2
- package/dist/isometrik-webchat/p-54267fe0.js.map +1 -0
- package/dist/isometrik-webchat/p-5b965e04.js +2 -0
- package/dist/isometrik-webchat/p-5b965e04.js.map +1 -0
- package/dist/isometrik-webchat/p-5cfb953d.js +2 -0
- package/dist/isometrik-webchat/p-5cfb953d.js.map +1 -0
- package/dist/isometrik-webchat/p-5d1877d1.entry.js +2 -0
- package/dist/isometrik-webchat/{p-ba6de4e2.entry.js.map → p-5d1877d1.entry.js.map} +1 -1
- package/dist/isometrik-webchat/p-643457b8.js +2 -0
- package/dist/isometrik-webchat/p-643457b8.js.map +1 -0
- package/dist/isometrik-webchat/p-6fc95e0e.js +2 -0
- package/dist/isometrik-webchat/p-6fc95e0e.js.map +1 -0
- package/dist/isometrik-webchat/{p-d6fd2dd7.entry.js → p-925da2c0.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-1dc52239.js → p-925decda.js} +2 -2
- package/dist/isometrik-webchat/p-a9380fb3.entry.js +2 -0
- package/dist/isometrik-webchat/p-a9380fb3.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-adc45831.js.map +1 -1
- package/dist/isometrik-webchat/{p-1953573d.js → p-c08055fe.js} +2 -2
- package/dist/isometrik-webchat/p-c49de274.entry.js +2 -0
- package/dist/isometrik-webchat/{p-6024bf2a.entry.js.map → p-c49de274.entry.js.map} +1 -1
- package/dist/isometrik-webchat/{p-04fdbd0a.js → p-c591fa45.js} +2 -2
- package/dist/isometrik-webchat/{p-9db196a4.entry.js → p-cbb1179b.entry.js} +2 -2
- package/dist/isometrik-webchat/p-ceb08a13.entry.js +2 -0
- package/dist/isometrik-webchat/p-ceb08a13.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-46e0048e.js → p-dab06d54.js} +2 -2
- package/dist/isometrik-webchat/p-ffbbe278.entry.js +2 -0
- package/dist/isometrik-webchat/p-ffbbe278.entry.js.map +1 -0
- package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +5 -0
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +21 -0
- package/dist/types/components.d.ts +36 -0
- package/dist/types/lib/chat/conversation-notifications.d.ts +12 -0
- package/dist/types/lib/chat/index.d.ts +3 -0
- package/dist/types/lib/chat/local-notification.d.ts +39 -0
- package/dist/types/lib/chat/message-notification.d.ts +37 -0
- package/dist/types/lib/chat/send-media.d.ts +3 -0
- package/dist/types/lib/custom-ui/contracts.d.ts +10 -0
- package/dist/types/lib/custom-ui/index.d.ts +6 -1
- package/dist/types/sdk/init.d.ts +21 -0
- package/docs/CUSTOMIZATION.md +30 -0
- package/docs/INTEGRATION.md +20 -4
- package/package.json +1 -1
- package/dist/cjs/group-members-5a82ec8a.js.map +0 -1
- package/dist/cjs/index-66f98408.js.map +0 -1
- package/dist/cjs/runtime-controls-959fe6ed.js.map +0 -1
- package/dist/cjs/send-media-2dadbb03.js.map +0 -1
- package/dist/cjs/toast-75ef0607.js +0 -159
- package/dist/cjs/toast-75ef0607.js.map +0 -1
- package/dist/esm/group-members-05414da2.js.map +0 -1
- package/dist/esm/index-4c865e34.js.map +0 -1
- package/dist/esm/runtime-controls-6b7c852a.js.map +0 -1
- package/dist/esm/send-media-ac360d8e.js.map +0 -1
- package/dist/esm/toast-45ac7913.js +0 -157
- package/dist/esm/toast-45ac7913.js.map +0 -1
- package/dist/isometrik-webchat/p-0c06a021.js +0 -2
- package/dist/isometrik-webchat/p-0c06a021.js.map +0 -1
- package/dist/isometrik-webchat/p-217b9dc2.js +0 -2
- package/dist/isometrik-webchat/p-217b9dc2.js.map +0 -1
- package/dist/isometrik-webchat/p-30855ba7.js +0 -2
- package/dist/isometrik-webchat/p-30855ba7.js.map +0 -1
- package/dist/isometrik-webchat/p-39b6adef.entry.js +0 -2
- package/dist/isometrik-webchat/p-39b6adef.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-57d958b8.entry.js +0 -2
- package/dist/isometrik-webchat/p-57d958b8.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-6024bf2a.entry.js +0 -2
- package/dist/isometrik-webchat/p-79d1a171.js +0 -2
- package/dist/isometrik-webchat/p-7af9a7f3.entry.js +0 -2
- package/dist/isometrik-webchat/p-7af9a7f3.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-8f17345f.js +0 -7
- package/dist/isometrik-webchat/p-8f17345f.js.map +0 -1
- package/dist/isometrik-webchat/p-b1330793.js.map +0 -1
- package/dist/isometrik-webchat/p-b667a9fc.js +0 -2
- package/dist/isometrik-webchat/p-b667a9fc.js.map +0 -1
- package/dist/isometrik-webchat/p-ba6de4e2.entry.js +0 -2
- /package/dist/isometrik-webchat/{p-586f6978.entry.js.map → p-08ba6153.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-79d1a171.js.map → p-1db79cfb.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-5d98a8a0.js.map → p-4671fe73.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ca47d693.entry.js.map → p-52a575c0.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-d6fd2dd7.entry.js.map → p-925da2c0.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-1dc52239.js.map → p-925decda.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-1953573d.js.map → p-c08055fe.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-04fdbd0a.js.map → p-c591fa45.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-9db196a4.entry.js.map → p-cbb1179b.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-46e0048e.js.map → p-dab06d54.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WEB_CHAT_SLOTS","hasNamedSlot","host","name","Array","from","children","some","node","nodeType","el","getAttribute","tagName","assignedNodes","flatten","length","findWebChatHost","root","_a","getRootNode","call","ShadowRoot","parentElement","getWebChatElement","document","querySelector","getCustomPartTag","part","webChat","customParts","applyCustomPartProps","props","Object","assign","anyEl","render","dispatchEvent","CustomEvent","detail","bubbles","createCustomPartElement","tag","createElement","resolveOverlayElement","slotName","partKey","fromPart","slotted","find","HTMLElement","clone","cloneNode","removeAttribute"],"sources":["src/lib/custom-ui/index.ts"],"sourcesContent":["/**\n * Custom UI contract for <web-chat>.\n *\n * PRIMARY: customParts — host CE tags; SDK passes props + callbacks.\n * SECONDARY: named slots — layout panels only (no per-row props).\n * ADVANCED: events/methods — headless / full custom chrome.\n */\n\nexport const WEB_CHAT_SLOTS = [\n // shell / panels\n 'sidebar',\n 'profile-rail',\n 'conversation-list',\n 'profile-page',\n 'group-cast',\n 'header',\n 'messages',\n 'composer',\n 'composer-input',\n 'reply-preview',\n 'attachment-preview',\n 'empty',\n 'right-panel',\n 'contact-info',\n 'profile-info',\n 'message-search',\n 'boot-loader',\n // overlays\n 'forward-dialog',\n 'message-info',\n 'media-gallery',\n 'add-member',\n 'context-menu',\n 'block-list',\n 'toast',\n] as const;\n\nexport type WebChatSlotName = (typeof WEB_CHAT_SLOTS)[number];\n\n/** Custom element tags for repeating rows / drawer dialogs. */\nexport type WebChatCustomParts = {\n messageBubble?: string;\n chatTile?: string;\n groupcastTile?: string;\n messageDatePill?: string;\n searchResult?: string;\n memberRow?: string;\n /** New Chat / contact picker row. */\n contactRow?: string;\n /** Drawer dialogs (render outside <web-chat> shadow) */\n forwardDialog?: string;\n addMember?: string;\n mediaGallery?: string;\n contextMenu?: string;\n blockList?: string;\n toast?: string;\n};\n\nexport function hasNamedSlot(host: HTMLElement, name: string): boolean {\n return Array.from(host.children).some(node => {\n // Avoid `instanceof HTMLElement` — fails across jsdom realms in Jest.\n if (!node || node.nodeType !== 1) return false;\n const el = node as HTMLElement;\n if (el.getAttribute('slot') !== name) return false;\n if (el.tagName === 'SLOT') {\n return (el as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n return true;\n });\n}\n\n/** Walk up (incl. shadow hosts) to the owning <web-chat>. */\nexport function findWebChatHost(from?: Element | null): HTMLElement | null {\n let node: Element | null = from || null;\n while (node) {\n if (node.tagName === 'WEB-CHAT') return node as HTMLElement;\n const root = node.getRootNode?.();\n if (root instanceof ShadowRoot) {\n node = root.host;\n continue;\n }\n node = node.parentElement;\n }\n return null;\n}\n\n/** Fallback only — prefer findWebChatHost(from) for multi-instance safety. */\nexport function getWebChatElement(): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n return document.querySelector('web-chat');\n}\n\nexport function getCustomPartTag(\n part: keyof WebChatCustomParts,\n host?: Element | null,\n): string | undefined {\n const webChat = (findWebChatHost(host) || (!host ? getWebChatElement() : null)) as any;\n return webChat?.customParts?.[part];\n}\n\n/** Assign props and nudge CE to re-paint (calls `.render()` if present). */\nexport function applyCustomPartProps(el: HTMLElement, props?: Record<string, unknown>): HTMLElement {\n if (props) Object.assign(el, props);\n const anyEl = el as any;\n if (typeof anyEl.render === 'function') {\n try {\n anyEl.render();\n } catch {\n /* host CE render is best-effort */\n }\n }\n el.dispatchEvent(new CustomEvent('custompart-props', { detail: props, bubbles: false }));\n return el;\n}\n\n/** Create a host-registered CE for a customPart, or null. */\nexport function createCustomPartElement(\n part: keyof WebChatCustomParts,\n props?: Record<string, unknown>,\n host?: Element | null,\n): HTMLElement | null {\n const tag = getCustomPartTag(part, host);\n if (!tag || typeof document === 'undefined') return null;\n return applyCustomPartProps(document.createElement(tag), props);\n}\n\n/**\n * Resolve overlay UI for drawers / deep trees:\n * 1) customParts tag\n * 2) clone of light-DOM [slot=\"…\"] on <web-chat>\n */\nexport function resolveOverlayElement(\n slotName: WebChatSlotName,\n partKey: keyof WebChatCustomParts,\n props?: Record<string, unknown>,\n host?: Element | null,\n): HTMLElement | null {\n const fromPart = createCustomPartElement(partKey, props, host);\n if (fromPart) return fromPart;\n\n const webChat = findWebChatHost(host) || (!host ? getWebChatElement() : null);\n if (!webChat) return null;\n const slotted = Array.from(webChat.children).find(\n node => node instanceof HTMLElement && node.getAttribute('slot') === slotName && node.tagName !== 'SLOT',\n ) as HTMLElement | undefined;\n if (!slotted) return null;\n\n const clone = slotted.cloneNode(true) as HTMLElement;\n clone.removeAttribute('slot');\n return applyCustomPartProps(clone, props);\n}\n\nexport type {\n ChatReadyDetail,\n ConversationsChangeDetail,\n MessagesChangeDetail,\n SelectionChangeDetail,\n ReplyChangeDetail,\n ChatErrorDetail,\n WebChatPublicEvent,\n WebChatPublicMethod,\n} from './public-api';\nexport { WEB_CHAT_PUBLIC_EVENTS, WEB_CHAT_PUBLIC_METHODS } from './public-api';\nexport type {\n MessageDeliveryStatus,\n MessageBubbleProps,\n ChatTileProps,\n GroupcastTileProps,\n MessageDatePillProps,\n SearchResultProps,\n MemberRowProps,\n ContactRowProps,\n OverlayDialogProps,\n MediaGalleryProps,\n ContextMenuProps,\n BlockListProps,\n ToastPartProps,\n} from './contracts';\nexport { deriveMessageStatus } from './contracts';\nexport { defineReactiveCustomPart } from './define-part';\n"],"mappings":"MAQaA,EAAiB,CAE5B,UACA,eACA,oBACA,eACA,aACA,SACA,WACA,WACA,iBACA,gBACA,qBACA,QACA,cACA,eACA,eACA,iBACA,cAEA,iBACA,eACA,gBACA,aACA,eACA,aACA,S,SAwBcC,EAAaC,EAAmBC,GAC9C,OAAOC,MAAMC,KAAKH,EAAKI,UAAUC,MAAKC,IAEpC,IAAKA,GAAQA,EAAKC,WAAa,EAAG,OAAO,MACzC,MAAMC,EAAKF,EACX,GAAIE,EAAGC,aAAa,UAAYR,EAAM,OAAO,MAC7C,GAAIO,EAAGE,UAAY,OAAQ,CACzB,OAAQF,EAAuBG,cAAc,CAAEC,QAAS,OAAQC,OAAS,C,CAE3E,OAAO,IAAI,GAEf,C,SAGgBC,EAAgBX,G,M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,GAAYpC,EAAKI,UAAY,SAEpG,IAAKmC,EAAS,OAAO,KAErB,MAAMG,EAAQH,EAAQI,UAAU,MAChCD,EAAME,gBAAgB,QACtB,OAAOtB,EAAqBoB,EAAOnB,EACrC,Q","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{S as t}from"./p-17a96a2a.js";const e=(t,e,n,s)=>{let o=e.get(s);if(!o){o=new WeakRef(s);e.set(s,o)}let r=t.get(n);if(!r){r=new Set;t.set(n,r)}r.add(o)};const n=(t,e)=>{let n;return(...s)=>{if(n){clearTimeout(n)}n=setTimeout((()=>{n=0;t(...s)}),e)}};const s=t=>!("isConnected"in t)||t.isConnected;const o=n((t=>{t.forEach(((e,n)=>{const o=new Set;e.forEach((t=>{const e=t.deref();if(e&&s(e))o.add(t)}));t.set(n,o)}))}),2e3);const r=t;const c=r.forceUpdate;const i=r.getRenderingRef;const u=()=>{if(typeof i!=="function"||typeof c!=="function"){return{}}const t=c;const n=i;const s=new WeakMap;const r=new Map;return{dispose:()=>r.clear(),get:t=>{const o=n();if(o){e(r,s,t,o)}},set:e=>{const n=r.get(e);if(n){const s=new Set;n.forEach((e=>{const n=e.deref();if(n&&t(n))s.add(e)}));r.set(e,s)}o(r)},reset:()=>{r.forEach((e=>{e.forEach((e=>{const n=e.deref();if(n)t(n)}))}));o(r)}}};const f=t=>typeof t==="function"?t():t;const a=(t,e=((t,e)=>t!==e))=>{const n=()=>f(t)??{};const s=n();let o=new Map(Object.entries(s));const r=typeof Proxy!=="undefined";const c=r?null:{};const i={dispose:[],get:[],set:[],reset:[]};const u=new Map;const a=()=>{o=new Map(Object.entries(n()));if(!r){S()}i.reset.forEach((t=>t()))};const l=()=>{i.dispose.forEach((t=>t()));a()};const d=t=>{i.get.forEach((e=>e(t)));return o.get(t)};const b=(t,n)=>{const s=o.get(t);if(e(n,s,t)){o.set(t,n);if(!r){M(t)}i.set.forEach((e=>e(t,n,s)))}};const m=r?new Proxy(s,{get(t,e){return d(e)},ownKeys(t){return Array.from(o.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(t,e){return o.has(e)},set(t,e,n){b(e,n);return true}}):(()=>{S();return c})();const g=(t,e)=>{i[t].push(e);return()=>{p(i[t],e)}};const w=(t,e)=>{const s=(n,s)=>{if(n===t){e(s)}};const o=()=>{const s=n();e(s[t])};const r=g("set",s);const c=g("reset",o);u.set(e,{setHandler:s,resetHandler:o,propName:t});return()=>{r();c();u.delete(e)}};const y=(...t)=>{const e=t.reduce(((t,e)=>{if(e.set){t.push(g("set",e.set))}if(e.get){t.push(g("get",e.get))}if(e.reset){t.push(g("reset",e.reset))}if(e.dispose){t.push(g("dispose",e.dispose))}return t}),[]);return()=>e.forEach((t=>t()))};const j=t=>{const e=o.get(t);i.set.forEach((n=>n(t,e,e)))};const O=(t,e)=>{const n=u.get(e);if(n&&n.propName===t){p(i.set,n.setHandler);p(i.reset,n.resetHandler);u.delete(e)}};function M(t){if(r||!c){return}if(Object.prototype.hasOwnProperty.call(c,t)){return}Object.defineProperty(c,t,{configurable:true,enumerable:true,get(){return d(t)},set(e){b(t,e)}})}function S(){if(r||!c){return}const t=new Set(o.keys());for(const e of Object.keys(c)){if(!t.has(e)){delete c[e]}}for(const e of t){M(e)}}return{state:m,get:d,set:b,on:g,onChange:w,use:y,dispose:l,reset:a,forceUpdate:j,removeListener:O}};const p=(t,e)=>{const n=t.indexOf(e);if(n>=0){t[n]=t[t.length-1];t.length--}};const l=(t,e)=>{const n=a(t,e);n.use(u());return n};const{state:d}=l({members:[],currentConversationId:null});const b={state:d,initializeMembers(t,e){d.members=t;d.currentConversationId=e},updateAdminStatus(t,e){d.members=d.members.map((n=>n.userId===t?Object.assign(Object.assign({},n),{isAdmin:e}):n))},getMembers(){return d.members},getCurrentConversationId(){return d.currentConversationId}};export{l as c,b as g};
|
|
2
|
-
//# sourceMappingURL=p-b667a9fc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["appendToMap","map","refsByValue","propName","value","ref","get","WeakRef","set","refs","Set","add","debounce","fn","ms","timeoutId","args","clearTimeout","setTimeout","isConnected","maybeElement","cleanupElements","forEach","key","nextRefs","elm","deref","core","StencilCore","forceUpdate","getRenderingRef","stencilSubscription","ensureForceUpdate","ensureGetRenderingRef","refsByElement","WeakMap","elmsToUpdate","Map","dispose","clear","reset","unwrap","val","createObservableMap","defaultState","shouldUpdate","a","b","resolveDefaultState","initialState","states","Object","entries","proxyAvailable","Proxy","plainState","handlers","changeListeners","syncPlainStateKeys","cb","oldValue","ensurePlainProperty","state","_","ownKeys","Array","from","keys","getOwnPropertyDescriptor","enumerable","configurable","has","on","eventName","callback","push","removeFromArray","onChange","setHandler","newValue","resetHandler","snapshot","unSet","unReset","delete","use","subscriptions","unsubs","reduce","subscription","unsub","removeListener","listener","listenerInfo","prototype","hasOwnProperty","call","defineProperty","knownKeys","array","item","index","indexOf","length","createStore","members","currentConversationId","groupMembersStore","initializeMembers","conversationId","updateAdminStatus","userId","isAdmin","member","assign","getMembers","getCurrentConversationId"],"sources":["node_modules/@stencil/store/dist/index.js","src/store/group-members.ts"],"sourcesContent":["import * as StencilCore from '@stencil/core';\n\nconst appendToMap = (map, refsByValue, propName, value) => {\n let ref = refsByValue.get(value);\n if (!ref) {\n ref = new WeakRef(value);\n refsByValue.set(value, ref);\n }\n let refs = map.get(propName);\n if (!refs) {\n refs = new Set();\n map.set(propName, refs);\n }\n refs.add(ref);\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n map.forEach((refs, key) => {\n const nextRefs = new Set();\n refs.forEach((ref) => {\n const elm = ref.deref();\n if (elm && isConnected(elm))\n nextRefs.add(ref);\n });\n map.set(key, nextRefs);\n });\n}, 2_000);\nconst core = StencilCore;\nconst forceUpdate = core.forceUpdate;\nconst getRenderingRef = core.getRenderingRef;\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function' || typeof forceUpdate !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const ensureForceUpdate = forceUpdate;\n const ensureGetRenderingRef = getRenderingRef;\n const refsByElement = new WeakMap();\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = ensureGetRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, refsByElement, propName, elm);\n }\n },\n set: (propName) => {\n const refs = elmsToUpdate.get(propName);\n if (refs) {\n const nextRefs = new Set();\n refs.forEach((ref) => {\n const elm = ref.deref();\n if (elm && ensureForceUpdate(elm))\n nextRefs.add(ref);\n });\n elmsToUpdate.set(propName, nextRefs);\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((refs) => {\n refs.forEach((ref) => {\n const elm = ref.deref();\n if (elm)\n ensureForceUpdate(elm);\n });\n });\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const resolveDefaultState = () => (unwrap(defaultState) ?? {});\n const initialState = resolveDefaultState();\n let states = new Map(Object.entries(initialState));\n const proxyAvailable = typeof Proxy !== 'undefined';\n const plainState = proxyAvailable ? null : {};\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n // Track onChange listeners to enable removeListener functionality\n const changeListeners = new Map();\n const reset = () => {\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries(resolveDefaultState()));\n if (!proxyAvailable) {\n syncPlainStateKeys();\n }\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n if (!proxyAvailable) {\n ensurePlainProperty(propName);\n }\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (proxyAvailable\n ? new Proxy(initialState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n })\n : (() => {\n syncPlainStateKeys();\n return plainState;\n })());\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const setHandler = (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n };\n const resetHandler = () => {\n const snapshot = resolveDefaultState();\n cb(snapshot[propName]);\n };\n // Register the handlers\n const unSet = on('set', setHandler);\n const unReset = on('reset', resetHandler);\n // Track the relationship between the user callback and internal handlers\n changeListeners.set(cb, { setHandler, resetHandler, propName });\n return () => {\n unSet();\n unReset();\n changeListeners.delete(cb);\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n const removeListener = (propName, listener) => {\n const listenerInfo = changeListeners.get(listener);\n if (listenerInfo && listenerInfo.propName === propName) {\n // Remove the specific handlers that were created for this listener\n removeFromArray(handlers.set, listenerInfo.setHandler);\n removeFromArray(handlers.reset, listenerInfo.resetHandler);\n changeListeners.delete(listener);\n }\n };\n function ensurePlainProperty(key) {\n if (proxyAvailable || !plainState) {\n return;\n }\n if (Object.prototype.hasOwnProperty.call(plainState, key)) {\n return;\n }\n Object.defineProperty(plainState, key, {\n configurable: true,\n enumerable: true,\n get() {\n return get(key);\n },\n set(value) {\n set(key, value);\n },\n });\n }\n function syncPlainStateKeys() {\n if (proxyAvailable || !plainState) {\n return;\n }\n const knownKeys = new Set(states.keys());\n for (const key of Object.keys(plainState)) {\n if (!knownKeys.has(key)) {\n delete plainState[key];\n }\n }\n for (const key of knownKeys) {\n ensurePlainProperty(key);\n }\n }\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n removeListener,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","import { createStore } from \"@stencil/store\";\n\ninterface GroupMember {\n userId: string;\n userName: string;\n userProfileImageUrl: string;\n isAdmin: boolean;\n}\n\ninterface GroupMembersState {\n members: GroupMember[];\n currentConversationId: string | null;\n}\n\nconst { state } = createStore<GroupMembersState>({\n members: [],\n currentConversationId: null\n});\n\nexport const groupMembersStore = {\n state,\n\n initializeMembers(members: GroupMember[], conversationId: string) {\n state.members = members;\n state.currentConversationId = conversationId;\n },\n\n updateAdminStatus(userId: string, isAdmin: boolean) {\n state.members = state.members.map(member => {\n return member.userId === userId ? { ...member, isAdmin } : member;\n });\n },\n\n getMembers() {\n return state.members;\n },\n\n getCurrentConversationId() {\n return state.currentConversationId;\n }\n};"],"mappings":"oCAEA,MAAMA,EAAc,CAACC,EAAKC,EAAaC,EAAUC,KAC7C,IAAIC,EAAMH,EAAYI,IAAIF,GAC1B,IAAKC,EAAK,CACNA,EAAM,IAAIE,QAAQH,GAClBF,EAAYM,IAAIJ,EAAOC,EAC/B,CACI,IAAII,EAAOR,EAAIK,IAAIH,GACnB,IAAKM,EAAM,CACPA,EAAO,IAAIC,IACXT,EAAIO,IAAIL,EAAUM,EAC1B,CACIA,EAAKE,IAAIN,EAAI,EAEjB,MAAMO,EAAW,CAACC,EAAIC,KAClB,IAAIC,EACJ,MAAO,IAAIC,KACP,GAAID,EAAW,CACXE,aAAaF,EACzB,CACQA,EAAYG,YAAW,KACnBH,EAAY,EACZF,KAAMG,EAAK,GACZF,EAAG,CACT,EAYL,MAAMK,EAAeC,KAAmB,gBAAiBA,IAAiBA,EAAaD,YACvF,MAAME,EAAkBT,GAAUX,IAC9BA,EAAIqB,SAAQ,CAACb,EAAMc,KACf,MAAMC,EAAW,IAAId,IACrBD,EAAKa,SAASjB,IACV,MAAMoB,EAAMpB,EAAIqB,QAChB,GAAID,GAAON,EAAYM,GACnBD,EAASb,IAAIN,EAAI,IAEzBJ,EAAIO,IAAIe,EAAKC,EAAS,GACxB,GACH,KACH,MAAMG,EAAOC,EACb,MAAMC,EAAcF,EAAKE,YACzB,MAAMC,EAAkBH,EAAKG,gBAC7B,MAAMC,EAAsB,KACxB,UAAWD,IAAoB,mBAAqBD,IAAgB,WAAY,CAG5E,MAAO,EACf,CACI,MAAMG,EAAoBH,EAC1B,MAAMI,EAAwBH,EAC9B,MAAMI,EAAgB,IAAIC,QAC1B,MAAMC,EAAe,IAAIC,IACzB,MAAO,CACHC,QAAS,IAAMF,EAAaG,QAC5BjC,IAAMH,IACF,MAAMsB,EAAMQ,IACZ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MA,KAAO2E,EAAW,CACzBrC,EAAoBtC,EAChC,CACA,CACI,MAAO,CACHuC,QACAxD,MACAE,MACAgE,KACAK,WACAQ,MACA/C,UACAE,QACAX,cACA8D,iBACH,EAEL,MAAMf,EAAkB,CAACuB,EAAOC,KAC5B,MAAMC,EAAQF,EAAMG,QAAQF,GAC5B,GAAIC,GAAS,EAAG,CACZF,EAAME,GAASF,EAAMA,EAAMI,OAAS,GACpCJ,EAAMI,QACd,GAGK,MAACC,EAAc,CAAC5D,EAAcC,KAC/B,MAAM5C,EAAM0C,EAAoBC,EAAcC,GAC9C5C,EAAIoF,IAAItD,KACR,OAAO9B,CAAG,EC1Qd,MAAM6D,MAAEA,GAAU0C,EAA+B,CAC/CC,QAAS,GACTC,sBAAuB,O,MAGZC,EAAoB,CAC/B7C,QAEA,iBAAA8C,CAAkBH,EAAwBI,GACxC/C,EAAM2C,QAAUA,EAChB3C,EAAM4C,sBAAwBG,C,EAGhC,iBAAAC,CAAkBC,EAAgBC,GAChClD,EAAM2C,QAAU3C,EAAM2C,QAAQxG,KAAIgH,GACzBA,EAAOF,SAAWA,EAAM5D,OAAA+D,OAAA/D,OAAA+D,OAAA,GAAQD,GAAM,CAAED,YAAYC,G,EAI/D,UAAAE,GACE,OAAOrD,EAAM2C,O,EAGf,wBAAAW,GACE,OAAOtD,EAAM4C,qB","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,a as i,h as a}from"./p-17a96a2a.js";import{g as o}from"./p-1dc52239.js";import{s as r}from"./p-0c06a021.js";import"./p-8f17345f.js";import"./p-b1330793.js";const e=class{constructor(a){t(this,a);this.reactionRemoved=i(this,"reaction-removed",7);this.messageId=undefined;this.reactionUsers=[];this.userMetaData=undefined;this.reactions=[];this.selectedEmojiId=undefined}async componentWillLoad(){var t;const i=new URLSearchParams(window.location.search);this.conversationId=i.get("conversation");if(this.reactions&&this.reactions.length>0){const i=(t=this.reactions[0])===null||t===void 0?void 0:t.emojiId;this.selectedEmojiId=i;await this.handleReactionTabClick(i)}}async handleReactionTabClick(t){this.selectedEmojiId=t;try{const i=await o(this.conversationId,this.messageId,t);this.reactionUsers=(i===null||i===void 0?void 0:i.reactions)||[]}catch(t){r({message:"Error while getting reaction",type:"error",duration:3e3,position:"bottom-left"})}}render(){var t;const i=(this.reactions||[]).map((t=>Object.assign(Object.assign({},t),{messageId:Array.isArray(t.messageId)?t.messageId[0]:t.messageId})));return a("div",{key:"2c70b85e5fb6fe181c075c901bc3c6f4f87e6b3f",class:"reactions-container",style:{backgroundColor:"var(--bg-secondary-color)",borderRadius:"10px",color:"var(--text-primary-color)",fontSize:"20px"}},a("div",{key:"6cf59f5e7f6776deeb4719c3211bd3557c906be9",class:"reactions-tab-container"},i.map((t=>a("button",{type:"button",class:`emoji-tab ${this.selectedEmojiId===t.emojiId?"selected":""}`,onClick:()=>this.handleReactionTabClick(t.emojiId)},t.src||t.emojiId)))),a("div",{key:"1ec124221879f1102d5df29d09e6a4013fd7b603",class:"reactions-list-container"},this.selectedEmojiId&&((t=this.reactionUsers)===null||t===void 0?void 0:t.length)>0?this.reactionUsers.map((t=>{var i;return a("div",{class:"user-row"},t.userProfileImageUrl?a("img",{class:"avatar",src:t.userProfileImageUrl,alt:""}):a("div",{class:"avatar"}),a("span",{style:{fontSize:"14px"}},t.userId===((i=this.userMetaData)===null||i===void 0?void 0:i.userId)?"You":t.userName))})):a("div",{class:"hint"},"Tap on any tab to see list")))}};e.style=":host { display: block; }\n .reactions-container {\n display: flex; flex-direction: column; padding: 10px;\n box-shadow: 2px 2px 2px var(--bg-senary-color), -2px -2px 2px var(--bg-senary-color);\n }\n .reactions-list-container { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }\n .reactions-tab-container { display: flex; gap: 8px; padding: 0; flex-wrap: wrap; }\n .emoji-tab {\n cursor: pointer; padding: 4px 8px; background: transparent;\n border: none; border-bottom: 1px solid var(--text-primary-color); color: inherit; font-size: inherit;\n }\n .emoji-tab:hover, .emoji-tab.selected { background: var(--bg-tertiary-color); }\n .user-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }\n .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-primary-light); }\n .hint { font-size: 14px; padding: 10px; opacity: 0.7; }";export{e as reaction_container};
|
|
2
|
-
//# sourceMappingURL=p-ba6de4e2.entry.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|