isometrik-plugin-chat-sdk 2.0.23 → 2.0.24
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-0e7848be.js → app-globals-f55c4dba.js} +4 -4
- package/dist/cjs/{app-globals-0e7848be.js.map → app-globals-f55c4dba.js.map} +1 -1
- package/dist/cjs/attachment-preview_23.cjs.entry.js +98 -97
- package/dist/cjs/attachment-preview_23.cjs.entry.js.map +1 -1
- package/dist/cjs/{chat-tile_3.cjs.entry.js → chat-tile_2.cjs.entry.js} +1 -66
- package/dist/cjs/chat-tile_2.cjs.entry.js.map +1 -0
- package/dist/cjs/forward-memebers.cjs.entry.js +24 -5
- package/dist/cjs/forward-memebers.cjs.entry.js.map +1 -1
- package/dist/cjs/groupcast-9456b0c7.js +356 -0
- package/dist/cjs/groupcast-9456b0c7.js.map +1 -0
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/iso-group-info.cjs.entry.js +74 -0
- package/dist/cjs/iso-group-info.cjs.entry.js.map +1 -0
- package/dist/cjs/isometrik-webchat.cjs.js +5 -5
- package/dist/cjs/loader.cjs.js +5 -5
- package/dist/cjs/login-page_3.cjs.entry.js +177 -69
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/member-add.cjs.entry.js +23 -5
- package/dist/cjs/member-add.cjs.entry.js.map +1 -1
- package/dist/cjs/{runtime-controls-a70872fe.js → runtime-controls-6d4fd7ed.js} +8 -7
- package/dist/cjs/runtime-controls-6d4fd7ed.js.map +1 -0
- package/dist/cjs/{groupcast-bb393c81.js → session-d44ca719.js} +1 -20
- package/dist/cjs/session-d44ca719.js.map +1 -0
- package/dist/collection/api/groupcast.js +42 -4
- package/dist/collection/components/ChatUIComponent/AddMember.js +24 -5
- package/dist/collection/components/ChatUIComponent/AddMember.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +25 -2
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +58 -3
- package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +15 -6
- package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +24 -5
- package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js +29 -110
- package/dist/collection/components/ChatUIComponent/shared/GroupCast/GroupCast.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +4 -2
- package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js +4 -4
- package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +49 -4
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/bootstrap.js +4 -0
- package/dist/collection/components/my-component/web-chat/bootstrap.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/data-fetch.js +2 -2
- package/dist/collection/components/my-component/web-chat/data-fetch.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/event-handlers.js +23 -6
- package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/groupcast-draft.js +67 -0
- package/dist/collection/components/my-component/web-chat/groupcast-draft.js.map +1 -0
- package/dist/collection/components/my-component/web-chat/shell-render.js +2 -6
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/lib/chat/groupcast.js +81 -1
- package/dist/collection/lib/chat/groupcast.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/components/ChatFooter.js +41 -5
- package/dist/components/ChatFooter.js.map +1 -1
- package/dist/components/ChatSidebar.js +26 -3
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/{GroupCast2.js → GroupCast3.js} +21 -98
- package/dist/components/GroupCast3.js.map +1 -0
- package/dist/components/WebChat.js +172 -62
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +2 -2
- package/dist/components/WebChatHeader.js +15 -6
- package/dist/components/WebChatHeader.js.map +1 -1
- package/dist/components/chat-app.js +1 -1
- package/dist/components/client.js +1 -17
- package/dist/components/client.js.map +1 -1
- package/dist/components/contact-info2.js +4 -2
- package/dist/components/contact-info2.js.map +1 -1
- package/dist/components/forward-memebers.js +24 -5
- package/dist/components/forward-memebers.js.map +1 -1
- package/dist/components/group-cast.js +1 -1
- package/dist/components/groupcast.js +94 -192
- package/dist/components/groupcast.js.map +1 -1
- package/dist/{esm/groupcast-c6da3918.js → components/groupcast2.js} +45 -7
- package/dist/components/groupcast2.js.map +1 -0
- package/dist/components/helpers.js +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/member-add.js +24 -5
- package/dist/components/member-add.js.map +1 -1
- package/dist/components/message-search2.js +4 -4
- package/dist/components/message-search2.js.map +1 -1
- package/dist/esm/{app-globals-eba1ca0c.js → app-globals-5dd18915.js} +3 -3
- package/dist/esm/{app-globals-eba1ca0c.js.map → app-globals-5dd18915.js.map} +1 -1
- package/dist/esm/attachment-preview_23.entry.js +99 -98
- package/dist/esm/attachment-preview_23.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +1 -1
- package/dist/esm/{chat-tile_3.entry.js → chat-tile_2.entry.js} +3 -67
- package/dist/esm/chat-tile_2.entry.js.map +1 -0
- package/dist/esm/forward-memebers.entry.js +24 -5
- package/dist/esm/forward-memebers.entry.js.map +1 -1
- package/dist/esm/group-chat-contacts.entry.js +1 -1
- package/dist/esm/groupcast-e32d3b10.js +331 -0
- package/dist/esm/groupcast-e32d3b10.js.map +1 -0
- package/dist/esm/{helpers-1632a4c7.js → helpers-d452bc0f.js} +2 -2
- package/dist/esm/{helpers-1632a4c7.js.map → helpers-d452bc0f.js.map} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/iso-group-info.entry.js +70 -0
- package/dist/esm/iso-group-info.entry.js.map +1 -0
- package/dist/esm/isometrik-webchat.js +5 -5
- package/dist/esm/loader.js +5 -5
- package/dist/esm/login-page_3.entry.js +168 -60
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/member-add.entry.js +25 -7
- package/dist/esm/member-add.entry.js.map +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +1 -1
- package/dist/esm/{runtime-controls-bdb84aeb.js → runtime-controls-6dafba73.js} +3 -2
- package/dist/esm/runtime-controls-6dafba73.js.map +1 -0
- package/dist/esm/{groupcast-4f15b050.js → session-ed7217a7.js} +2 -18
- package/dist/esm/session-ed7217a7.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-056f6809.entry.js +2 -0
- package/dist/isometrik-webchat/p-056f6809.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-05b33578.js +2 -0
- package/dist/isometrik-webchat/{p-57f97cef.entry.js → p-0649db69.entry.js} +2 -2
- package/dist/isometrik-webchat/p-068abd0a.entry.js +2 -0
- package/dist/isometrik-webchat/p-068abd0a.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-22404d0d.entry.js +2 -0
- package/dist/isometrik-webchat/p-22404d0d.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-7d01ccbb.js +2 -0
- package/dist/isometrik-webchat/p-7d01ccbb.js.map +1 -0
- package/dist/isometrik-webchat/p-90c38a4e.entry.js +2 -0
- package/dist/isometrik-webchat/p-90c38a4e.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-0bb42151.entry.js → p-94f0c983.entry.js} +2 -2
- package/dist/isometrik-webchat/p-ac671eb5.js +2 -0
- package/dist/isometrik-webchat/p-ac671eb5.js.map +1 -0
- package/dist/isometrik-webchat/p-b884d9ee.entry.js +2 -0
- package/dist/isometrik-webchat/p-b884d9ee.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-c4333279.entry.js +2 -0
- package/dist/isometrik-webchat/p-c4333279.entry.js.map +1 -0
- package/dist/isometrik-webchat/p-cce7d971.js +2 -0
- package/dist/isometrik-webchat/{p-a83932d4.js.map → p-cce7d971.js.map} +1 -1
- package/dist/isometrik-webchat/{p-02db2116.entry.js → p-ec03caec.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-3dca1e56.js → p-f97e3f6d.js} +2 -2
- package/dist/types/components/ChatUIComponent/AddMember.d.ts +1 -0
- package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +3 -1
- package/dist/types/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.d.ts +3 -0
- package/dist/types/components/ChatUIComponent/shared/GroupCast/GroupCast.d.ts +2 -11
- package/dist/types/components/my-component/web-chat/WebChat.d.ts +23 -0
- package/dist/types/components/my-component/web-chat/groupcast-draft.d.ts +23 -0
- package/dist/types/components.d.ts +13 -2
- package/dist/types/lib/chat/groupcast.d.ts +66 -0
- package/dist/types/lib/chat/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/chat-tile_3.cjs.entry.js.map +0 -1
- package/dist/cjs/groupcast-bb393c81.js.map +0 -1
- package/dist/cjs/groupcast-e1e52bd1.js +0 -213
- package/dist/cjs/groupcast-e1e52bd1.js.map +0 -1
- package/dist/cjs/runtime-controls-a70872fe.js.map +0 -1
- package/dist/components/GroupCast2.js.map +0 -1
- package/dist/esm/chat-tile_3.entry.js.map +0 -1
- package/dist/esm/groupcast-4f15b050.js.map +0 -1
- package/dist/esm/groupcast-c6da3918.js.map +0 -1
- package/dist/esm/runtime-controls-bdb84aeb.js.map +0 -1
- package/dist/isometrik-webchat/p-03933431.entry.js +0 -2
- package/dist/isometrik-webchat/p-03933431.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-1f0e8230.entry.js +0 -2
- package/dist/isometrik-webchat/p-1f0e8230.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-3a0409fc.js +0 -2
- package/dist/isometrik-webchat/p-3a0409fc.js.map +0 -1
- package/dist/isometrik-webchat/p-46be73c5.js +0 -2
- package/dist/isometrik-webchat/p-46be73c5.js.map +0 -1
- package/dist/isometrik-webchat/p-605cb14e.entry.js +0 -2
- package/dist/isometrik-webchat/p-605cb14e.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-69d953cb.entry.js +0 -2
- package/dist/isometrik-webchat/p-69d953cb.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-6c5eb178.js +0 -2
- package/dist/isometrik-webchat/p-a83932d4.js +0 -2
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js +0 -2
- package/dist/isometrik-webchat/p-b0f6f9ab.entry.js.map +0 -1
- /package/dist/isometrik-webchat/{p-6c5eb178.js.map → p-05b33578.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-57f97cef.entry.js.map → p-0649db69.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-0bb42151.entry.js.map → p-94f0c983.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-02db2116.entry.js.map → p-ec03caec.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-3dca1e56.js.map → p-f97e3f6d.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const runtimeControls = require('./runtime-controls-
|
|
4
|
-
const
|
|
3
|
+
const runtimeControls = require('./runtime-controls-6d4fd7ed.js');
|
|
4
|
+
const session = require('./session-d44ca719.js');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Expose public SDK helpers on window for www demos / script-tag hosts.
|
|
@@ -20,7 +20,7 @@ function appGlobalScript () {
|
|
|
20
20
|
w.destroyChat = runtimeControls.destroyIsometrikWebchat;
|
|
21
21
|
w.isometrikWebchatApi = runtimeControls.isometrikWebchatApi;
|
|
22
22
|
w.createWebChatApi = runtimeControls.createWebChatApi;
|
|
23
|
-
w.THEME_TOKEN_NAMES =
|
|
23
|
+
w.THEME_TOKEN_NAMES = session.THEME_TOKEN_NAMES;
|
|
24
24
|
w.mountReactInSlot = runtimeControls.mountReactInSlot;
|
|
25
25
|
w.defineReactCustomPart = runtimeControls.defineReactCustomPart;
|
|
26
26
|
w.unmountReactSlot = runtimeControls.unmountReactSlot;
|
|
@@ -35,4 +35,4 @@ const globalScripts = appGlobalScript;
|
|
|
35
35
|
|
|
36
36
|
exports.globalScripts = globalScripts;
|
|
37
37
|
|
|
38
|
-
//# sourceMappingURL=app-globals-
|
|
38
|
+
//# sourceMappingURL=app-globals-f55c4dba.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"app-globals-
|
|
1
|
+
{"file":"app-globals-f55c4dba.js","mappings":";;;;;AAAA;;;;;IAwBE,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAC1C,MAAM,CAAC,GAAG,MAAa,CAAC;IACxB,CAAC,CAAC,0BAA0B,GAAGA,0CAA0B,CAAC;IAC1D,CAAC,CAAC,uBAAuB,GAAGC,uCAAuB,CAAC;IACpD,CAAC,CAAC,sBAAsB,GAAGC,sCAAsB,CAAC;IAClD,CAAC,CAAC,sBAAsB,GAAGC,sCAAsB,CAAC;IAClD,CAAC,CAAC,uBAAuB,GAAGC,uCAAuB,CAAC;IACpD,CAAC,CAAC,cAAc,GAAGJ,0CAA0B,CAAC;IAC9C,CAAC,CAAC,WAAW,GAAGC,uCAAuB,CAAC;IACxC,CAAC,CAAC,mBAAmB,GAAGI,mCAAmB,CAAC;IAC5C,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,iBAAiB,GAAGC,yBAAiB,CAAC;IACxC,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,qBAAqB,GAAGC,qCAAqB,CAAC;IAChD,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,eAAe,GAAGC,+BAAe,CAAC;IACpC,CAAC,CAAC,gBAAgB,GAAGC,gCAAgB,CAAC;IACtC,CAAC,CAAC,WAAW,GAAGC,2BAAW,CAAC;IAC5B,CAAC,CAAC,oBAAoB,GAAGC,oCAAoB,CAAC;IAC9C,CAAC,CAAC,cAAc,GAAGC,8BAAc,CAAC;AACpC;;AC3CY,MAAC,aAAa,GAAG;;;;","names":["initializeIsometrikWebchat","destroyIsometrikWebchat","ensureIsometrikWebchat","retainIsometrikWebchat","releaseIsometrikWebchat","isometrikWebchatApi","createWebChatApi","THEME_TOKEN_NAMES","mountReactInSlot","defineReactCustomPart","unmountReactSlot","switchChatTheme","applyCustomTheme","toggleTheme","resolveThemeProvider","resolveWebChat"],"sources":["src/global/expose-sdk.ts","@stencil/core/internal/app-globals"],"sourcesContent":["/**\n * Expose public SDK helpers on window for www demos / script-tag hosts.\n * Bundlers should prefer named ESM imports from the package entry.\n */\nimport {\n initializeIsometrikWebchat,\n destroyIsometrikWebchat,\n ensureIsometrikWebchat,\n retainIsometrikWebchat,\n releaseIsometrikWebchat,\n mountReactInSlot,\n defineReactCustomPart,\n unmountReactSlot,\n createWebChatApi,\n isometrikWebchatApi,\n THEME_TOKEN_NAMES,\n switchChatTheme,\n applyCustomTheme,\n toggleTheme,\n resolveThemeProvider,\n resolveWebChat,\n} from '../sdk';\n\nexport default function () {\n if (typeof window === 'undefined') return;\n const w = window as any;\n w.initializeIsometrikWebchat = initializeIsometrikWebchat;\n w.destroyIsometrikWebchat = destroyIsometrikWebchat;\n w.ensureIsometrikWebchat = ensureIsometrikWebchat;\n w.retainIsometrikWebchat = retainIsometrikWebchat;\n w.releaseIsometrikWebchat = releaseIsometrikWebchat;\n w.initializeChat = initializeIsometrikWebchat;\n w.destroyChat = destroyIsometrikWebchat;\n w.isometrikWebchatApi = isometrikWebchatApi;\n w.createWebChatApi = createWebChatApi;\n w.THEME_TOKEN_NAMES = THEME_TOKEN_NAMES;\n w.mountReactInSlot = mountReactInSlot;\n w.defineReactCustomPart = defineReactCustomPart;\n w.unmountReactSlot = unmountReactSlot;\n w.switchChatTheme = switchChatTheme;\n w.applyCustomTheme = applyCustomTheme;\n w.toggleTheme = toggleTheme;\n w.resolveThemeProvider = resolveThemeProvider;\n w.resolveWebChat = resolveWebChat;\n}\n","import appGlobalScript from '/Users/3embed/Desktop/isometrik-webchat/src/global/expose-sdk.ts';\nexport const globalScripts = appGlobalScript;\n"],"version":3}
|
|
@@ -14,7 +14,7 @@ const index$1 = require('./index-3411923c.js');
|
|
|
14
14
|
const toast = require('./toast-a75f822c.js');
|
|
15
15
|
const storageQuota = require('./storage-quota-2e81fb71.js');
|
|
16
16
|
const localNotification = require('./local-notification-a86a2b34.js');
|
|
17
|
-
const groupcast = require('./groupcast-
|
|
17
|
+
const groupcast = require('./groupcast-9456b0c7.js');
|
|
18
18
|
const play = require('./play-b473e0ab.js');
|
|
19
19
|
const IsometrikLogo = require('./IsometrikLogo-9e642f65.js');
|
|
20
20
|
const groupAdminLeave = require('./group-admin-leave-b5cfdb33.js');
|
|
@@ -493,10 +493,30 @@ const ChatSidebar = class {
|
|
|
493
493
|
this.submitMemberPicker = (selectedIds, selectedNames) => {
|
|
494
494
|
if (!(selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length))
|
|
495
495
|
return;
|
|
496
|
-
|
|
496
|
+
const members = selectedIds.map((id, i) => ({
|
|
497
497
|
userId: id,
|
|
498
498
|
userName: (selectedNames === null || selectedNames === void 0 ? void 0 : selectedNames[i]) || id,
|
|
499
499
|
}));
|
|
500
|
+
if (this.memberPickerIsGroupCast) {
|
|
501
|
+
if (selectedIds.length < 2) {
|
|
502
|
+
toast.showToast({
|
|
503
|
+
message: 'Select at least 2 recipients for a groupcast',
|
|
504
|
+
type: 'error',
|
|
505
|
+
position: 'bottom-right',
|
|
506
|
+
});
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
this.showMemberPicker = false;
|
|
510
|
+
this.showNewChat = false;
|
|
511
|
+
this.pendingGroupMembers = [];
|
|
512
|
+
this.el.dispatchEvent(new CustomEvent('groupcast-draft-ready', {
|
|
513
|
+
detail: { members },
|
|
514
|
+
bubbles: true,
|
|
515
|
+
composed: true,
|
|
516
|
+
}));
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
this.pendingGroupMembers = members;
|
|
500
520
|
this.selectedGroupUserIds = selectedIds;
|
|
501
521
|
this.showMemberPicker = false;
|
|
502
522
|
this.showGroupInfo = true;
|
|
@@ -1306,6 +1326,9 @@ const ChatSidebar = class {
|
|
|
1306
1326
|
}
|
|
1307
1327
|
async handleGroupSubmitted(event) {
|
|
1308
1328
|
const { conversationTitle, imageFile, selectedUserIds, isGroupCast, selectedUsers } = event.detail;
|
|
1329
|
+
// Groupcast uses lazy create (groupcast-draft-ready); not this form.
|
|
1330
|
+
if (isGroupCast)
|
|
1331
|
+
return;
|
|
1309
1332
|
try {
|
|
1310
1333
|
this.isGroupCreationLoading = true;
|
|
1311
1334
|
let conversationImageUrl = '';
|
|
@@ -1464,7 +1487,7 @@ const ChatSidebar = class {
|
|
|
1464
1487
|
}
|
|
1465
1488
|
render() {
|
|
1466
1489
|
const filteredConversations = (this.sortedConversationList || []).filter((tile) => sendMedia.conversationMatchesSearch(tile, this.searchQuery));
|
|
1467
|
-
return (index.h("div", { key: '
|
|
1490
|
+
return (index.h("div", { key: 'ba7c00d29272c4645a3554b400e27fc588addb56', class: "chat-sidebar-container", style: { backgroundColor: this.sidebarColor || undefined } }, this.isGroupCreationLoading && (index.h("div", { key: '78d764f8af984da76a108c15aacf2fe83e628819', class: "loader" }, index.h("spinner-loader", { key: '06f5fbf342060935780f8309a07e24db398e89bd', height: "30px", width: "30px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary)", spinnerSecondaryColor: "var(--text-primary)", spinnerBorderWidth: "2px" }))), this.showGroupInfo ? (index.h("div", { class: "new-chat-panel" }, index.h("iso-group-info", { label: this.memberPickerIsGroupCast ? 'Create New Groupcast' : 'Create New Group', selectedUserIds: this.pendingGroupMembers.map(m => m.userId), selectedUsers: this.pendingGroupMembers, isGroupCast: this.memberPickerIsGroupCast, closeGroupInfo: this.closeGroupInfoStep, afterCreate: this.finishGroupInfoStep }))) : this.showMemberPicker ? (index.h("div", { class: "new-chat-panel" }, index.h("div", { class: "picker-back" }, index.h("button", { type: "button", onClick: this.closeMemberPicker, "aria-label": "Back" }, index.h("img", { class: "theme-icon", src: chatAssets.Left_Arrow, alt: "" })), index.h("h2", { class: "picker-title" }, this.memberPickerIsGroupCast ? 'New Group Cast' : 'New Group')), index.h("searchable-list", { label: this.memberPickerIsGroupCast ? 'New Group Cast' : 'New Group', hideTopbar: true, contactList: this.nonBlockedContacts, isSearching: true, isLoading: this.isLoadingMember, hasMore: this.hasMoreMembers, skip: this.skip, paginationLoading: this.isPaginationMember, getForwardMessageMemberList: (query, skip) => this.getAllGroupMemeber(query || '', skip || 0), onSend: this.submitMemberPicker, height: "100%" }))) : this.showNewChat ? (index.h("div", { class: "new-chat-panel" }, index.h("new-chat", { contactList: this.nonBlockedContacts, isLoading: this.isLoadingMember, hasMore: this.hasMoreMembers, skip: this.skip, paginationLoading: this.isPaginationMember, onSearch: (query, skip) => this.getAllMemeber(query || '', skip || 0), onSelect: this.handleNewChatContactPick, onClose: () => this.closeNewChat(), customParts: this.customParts, groupcastEnabled: this.groupcastEnabled }))) : ([
|
|
1468
1491
|
index.h("div", { class: "chat-sidebar-top" }, index.h("div", { class: "chat-sidebar-header-row" }, this.isSidebarHeaderLabel ? (index.h("h1", { class: "chat-sidebar-header" }, this.sidebarHeaderLabel || 'Chats')) : (index.h("span", null)), index.h("div", { class: "chat-sidebar-actions" }, this.showMqttStatus !== false ? (index.h("span", { class: { 'mqtt-status': true, 'is-offline': !this.isMqttConnected }, title: this.isMqttConnected ? 'Realtime connected' : 'Realtime disconnected', "aria-label": this.isMqttConnected ? 'MQTT connected' : 'MQTT disconnected' }, index.h("span", { class: { 'mqtt-status-dot': true, 'is-connected': !!this.isMqttConnected } }), this.isMqttConnected ? 'Live' : 'Offline')) : null, index.h("button", { type: "button", class: "icon-btn", title: "New Chat", onClick: () => this.openNewChat() }, index.h("img", { src: chatAssets.New_Chat, alt: "New chat" })), index.h("div", { class: "more-wrap" }, index.h("button", { type: "button", class: "icon-btn", title: "More Options", "aria-label": "More options", "aria-haspopup": "menu", "aria-expanded": this.showMoreMenu ? 'true' : 'false', onClick: this.toggleMoreMenu }, index.h("img", { class: "theme-icon", src: chatAssets.Three_Dots, alt: "" })), this.showMoreMenu ? (index.h("div", { class: "more-menu", role: "menu" }, index.h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.onNewGroupFromMenu }, index.h("img", { class: "theme-icon", src: chatAssets.New_Group, alt: "" }), index.h("span", null, "New group")), index.h("div", { class: "more-divider" }), index.h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.onLogoutFromMenu }, index.h("img", { class: "theme-icon", src: chatAssets.Logout, alt: "" }), index.h("span", null, "Log out")))) : null))), this.isSidebarHeaderSearch !== false ? (index.h("div", { class: "chat-sidebar-search" }, index.h("input", { type: "search", placeholder: "Search or start new chat", value: this.searchQuery, onInput: (e) => this.handleSearch(e) }))) : null, this.renderStorageQuotaBanner()),
|
|
1469
1492
|
index.h("div", { class: "chat-sidebar-list", onScroll: (e) => this.handleListScroll(e) }, this.isConversationLoading ? (index.h("div", { class: "chat-sidebar-loading" }, index.h("spinner-loader", { height: "15px", width: "15px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary)", spinnerSecondaryColor: "var(--text-primary)", spinnerBorderWidth: "2px" }))) : filteredConversations.length > 0 ? (filteredConversations.map((tile) => this.renderConversationTile(tile))) : (index.h("div", { class: "chat-sidebar-empty" }, "No conversation found")), this.isLoading && this.hasMoreConversations && (index.h("div", { class: "chat-sidebar-loading" }, index.h("spinner-loader", { height: "15px", width: "15px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary)", spinnerSecondaryColor: "var(--text-primary)", spinnerBorderWidth: "2px" })))),
|
|
1470
1493
|
])));
|
|
@@ -1532,6 +1555,7 @@ const GroupCast = class {
|
|
|
1532
1555
|
index.registerInstance(this, hostRef);
|
|
1533
1556
|
this.groupcastTileSelected = index.createEvent(this, "groupcastTileSelected", 7);
|
|
1534
1557
|
this.groupcastScrolledToBottom = index.createEvent(this, "groupcastScrolledToBottom", 7);
|
|
1558
|
+
this.groupcastDraftReady = index.createEvent(this, "groupcast-draft-ready", 7);
|
|
1535
1559
|
this.handleScroll = (event) => {
|
|
1536
1560
|
const target = event.target;
|
|
1537
1561
|
const isBottom = target.scrollHeight - target.scrollTop <= target.clientHeight + 100;
|
|
@@ -1568,14 +1592,10 @@ const GroupCast = class {
|
|
|
1568
1592
|
};
|
|
1569
1593
|
this.openCreate = () => {
|
|
1570
1594
|
this.showMemberPicker = true;
|
|
1571
|
-
this.showGroupInfo = false;
|
|
1572
|
-
this.pendingMembers = [];
|
|
1573
1595
|
this.getMembers('', 0);
|
|
1574
1596
|
};
|
|
1575
1597
|
this.closeCreate = () => {
|
|
1576
1598
|
this.showMemberPicker = false;
|
|
1577
|
-
this.showGroupInfo = false;
|
|
1578
|
-
this.pendingMembers = [];
|
|
1579
1599
|
this.nonBlockedContacts = [];
|
|
1580
1600
|
};
|
|
1581
1601
|
this.getMembers = async (searchTag = '', skip = 0) => {
|
|
@@ -1615,30 +1635,20 @@ const GroupCast = class {
|
|
|
1615
1635
|
this.onMembersNext = (selectedIds, selectedNames) => {
|
|
1616
1636
|
if (!(selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length))
|
|
1617
1637
|
return;
|
|
1618
|
-
|
|
1638
|
+
if (selectedIds.length < 2) {
|
|
1639
|
+
toast.showToast({
|
|
1640
|
+
message: 'Select at least 2 recipients for a groupcast',
|
|
1641
|
+
type: 'error',
|
|
1642
|
+
position: 'bottom-right',
|
|
1643
|
+
});
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
const members = selectedIds.map((id, i) => ({
|
|
1619
1647
|
userId: id,
|
|
1620
1648
|
userName: (selectedNames === null || selectedNames === void 0 ? void 0 : selectedNames[i]) || id,
|
|
1621
1649
|
}));
|
|
1622
|
-
this.
|
|
1623
|
-
this.
|
|
1624
|
-
};
|
|
1625
|
-
this.backToMembers = () => {
|
|
1626
|
-
this.showGroupInfo = false;
|
|
1627
|
-
this.showMemberPicker = true;
|
|
1628
|
-
};
|
|
1629
|
-
this.getPresignedUrl = async (file) => {
|
|
1630
|
-
var _a;
|
|
1631
|
-
const mediaExtension = file.name.split('.').pop();
|
|
1632
|
-
const res = await index_m.M.getInstance().user.getPresignedurlCreate({
|
|
1633
|
-
userIdentifier: (_a = this.userMetaData) === null || _a === void 0 ? void 0 : _a.userIdentifier,
|
|
1634
|
-
mediaExtension,
|
|
1635
|
-
});
|
|
1636
|
-
await fetch(res.presignedUrl, {
|
|
1637
|
-
method: 'PUT',
|
|
1638
|
-
body: file,
|
|
1639
|
-
headers: { 'Content-Type': file.type },
|
|
1640
|
-
});
|
|
1641
|
-
return res.mediaUrl;
|
|
1650
|
+
this.closeCreate();
|
|
1651
|
+
this.groupcastDraftReady.emit({ members });
|
|
1642
1652
|
};
|
|
1643
1653
|
this.groupCastData = [];
|
|
1644
1654
|
this.isLoadingMore = undefined;
|
|
@@ -1649,15 +1659,11 @@ const GroupCast = class {
|
|
|
1649
1659
|
this.isContextMenuOpen = false;
|
|
1650
1660
|
this.selectedTileForMenu = undefined;
|
|
1651
1661
|
this.showMemberPicker = false;
|
|
1652
|
-
this.showGroupInfo = false;
|
|
1653
|
-
this.pendingMembers = [];
|
|
1654
1662
|
this.nonBlockedContacts = [];
|
|
1655
1663
|
this.skip = 0;
|
|
1656
1664
|
this.hasMoreMembers = false;
|
|
1657
1665
|
this.isLoadingMember = false;
|
|
1658
1666
|
this.isPaginationMember = false;
|
|
1659
|
-
this.isCreating = false;
|
|
1660
|
-
this.onCreated = undefined;
|
|
1661
1667
|
}
|
|
1662
1668
|
async componentDidLoad() {
|
|
1663
1669
|
document.addEventListener('menu-item-selected', this.handleMenuItemSelected);
|
|
@@ -1687,49 +1693,6 @@ const GroupCast = class {
|
|
|
1687
1693
|
this.isContextMenuOpen = true;
|
|
1688
1694
|
this.selectedTileForMenu = tile;
|
|
1689
1695
|
}
|
|
1690
|
-
async handleCreateSubmitted(event) {
|
|
1691
|
-
var _a;
|
|
1692
|
-
const { conversationTitle, imageFile, selectedUserIds, selectedUsers } = event.detail || {};
|
|
1693
|
-
try {
|
|
1694
|
-
this.isCreating = true;
|
|
1695
|
-
// Empty → avatar fallback (avoid broken CDN placeholder X).
|
|
1696
|
-
let groupcastImageUrl = '';
|
|
1697
|
-
if (imageFile)
|
|
1698
|
-
groupcastImageUrl = await this.getPresignedUrl(imageFile);
|
|
1699
|
-
const members = (selectedUserIds || []).map((id) => {
|
|
1700
|
-
const user = selectedUsers === null || selectedUsers === void 0 ? void 0 : selectedUsers.find((u) => (u === null || u === void 0 ? void 0 : u.userId) === id);
|
|
1701
|
-
return {
|
|
1702
|
-
newConversationTypingEvents: true,
|
|
1703
|
-
newConversationReadEvents: true,
|
|
1704
|
-
newConversationPushNotificationsEvents: true,
|
|
1705
|
-
newConversationMetadata: {},
|
|
1706
|
-
memberId: id,
|
|
1707
|
-
newConversationCustomType: 'Groupcast',
|
|
1708
|
-
userName: (user === null || user === void 0 ? void 0 : user.userName) || id,
|
|
1709
|
-
};
|
|
1710
|
-
});
|
|
1711
|
-
const trimmedGroupcastImage = (groupcastImageUrl || '').trim();
|
|
1712
|
-
const res = await groupcast.postGroupCast(Object.assign(Object.assign({ groupcastTitle: conversationTitle }, (trimmedGroupcastImage ? { groupcastImageUrl: trimmedGroupcastImage } : {})), { searchableTags: [conversationTitle], metaData: { description: 'groupcast created', members: selectedUsers }, customType: 'groupcast', members }));
|
|
1713
|
-
this.closeCreate();
|
|
1714
|
-
const groupcastId = res.groupcastId;
|
|
1715
|
-
const created = Object.assign(Object.assign({ groupcastId, groupcastTitle: conversationTitle }, (trimmedGroupcastImage ? { groupcastImageUrl: trimmedGroupcastImage } : {})), { membersCount: members.length, createdAt: Date.now(), metaData: { description: 'groupcast created' } });
|
|
1716
|
-
(_a = this.onCreated) === null || _a === void 0 ? void 0 : _a.call(this, created);
|
|
1717
|
-
const url = new URL(window.location.href);
|
|
1718
|
-
url.search = '';
|
|
1719
|
-
url.searchParams.set('groupcast', groupcastId);
|
|
1720
|
-
window.history.pushState({}, '', url);
|
|
1721
|
-
this.groupcastTileSelected.emit({ groupcastId });
|
|
1722
|
-
toast.showToast({ message: 'Group Cast created successfully', type: 'success', position: 'bottom-right' });
|
|
1723
|
-
}
|
|
1724
|
-
catch (error) {
|
|
1725
|
-
console.error(error);
|
|
1726
|
-
toast.showToast({ message: 'Failed to create group cast', type: 'error', position: 'bottom-right' });
|
|
1727
|
-
}
|
|
1728
|
-
finally {
|
|
1729
|
-
this.isCreating = false;
|
|
1730
|
-
this.closeCreate();
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
1696
|
renderList() {
|
|
1734
1697
|
if (!this.groupCastData) {
|
|
1735
1698
|
return index.h("div", { class: "empty" }, "Unable to load groupcast chats");
|
|
@@ -1760,12 +1723,6 @@ const GroupCast = class {
|
|
|
1760
1723
|
});
|
|
1761
1724
|
}
|
|
1762
1725
|
render() {
|
|
1763
|
-
if (this.showGroupInfo) {
|
|
1764
|
-
return (index.h("div", { class: "group-cast-container", style: { position: 'relative' } }, this.isCreating ? (index.h("div", { class: "loader" }, index.h("spinner-loader", { height: "30px", width: "30px" }))) : null, index.h("div", { class: "create-panel" }, index.h("iso-group-info", { label: "Create New Groupcast", selectedUserIds: this.pendingMembers.map(m => m.userId), selectedUsers: this.pendingMembers, isGroupCast: true, closeGroupInfo: this.backToMembers, afterCreate: () => {
|
|
1765
|
-
this.showGroupInfo = false;
|
|
1766
|
-
this.showMemberPicker = false;
|
|
1767
|
-
} }))));
|
|
1768
|
-
}
|
|
1769
1726
|
if (this.showMemberPicker) {
|
|
1770
1727
|
return (index.h("div", { class: "group-cast-container" }, index.h("div", { class: "create-panel" }, index.h("div", { class: "picker-back" }, index.h("button", { type: "button", onClick: this.closeCreate, "aria-label": "Back" }, "\u2190")), index.h("searchable-list", { label: "New Group Cast", contactList: this.nonBlockedContacts, isSearching: true, isLoading: this.isLoadingMember, hasMore: this.hasMoreMembers, skip: this.skip, paginationLoading: this.isPaginationMember, getForwardMessageMemberList: (query, skip) => this.getMembers(query || '', skip || 0), onSend: this.onMembersNext, height: "100%" }))));
|
|
1771
1728
|
}
|
|
@@ -1779,7 +1736,7 @@ const GroupCast = class {
|
|
|
1779
1736
|
}
|
|
1780
1737
|
get element() { return index.getElement(this); }
|
|
1781
1738
|
};
|
|
1782
|
-
GroupCast.style = ":host {\n display: block;\n height: 100%;\n background: var(--bg-primary, var(--bg-primary-color));\n color: var(--text-primary, var(--text-primary-color));\n }\n .group-cast-container {\n padding: 20px 0 20px 20px;\n height: 96%;\n display: flex;\n flex-direction: column;\n gap: 5px;\n box-sizing: border-box;\n }\n .group-cast-header-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 20px 0 0;\n }\n .group-cast-header {\n font-size: var(--title-font-size, 24px);\n font-weight: 600;\n margin: 0;\n }\n .icon-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n }\n .icon-btn img {\n width: 28px;\n height: 28px;\n }\n .group-cast-body {\n flex: 1;\n min-height: 0;\n overflow: hidden auto;\n padding: 0 15px 0 0;\n }\n .group-cast-body::-webkit-scrollbar { width: 5px; }\n .group-cast-body::-webkit-scrollbar-track { background: transparent; }\n .group-cast-body::-webkit-scrollbar-thumb {\n background-color: var(--bg-secondary, var(--bg-secondary-color)) !important;\n border-radius: 10px;\n }\n chat-tile:hover {\n background-color: var(--bg-secondary, var(--bg-secondary-color)) !important;\n }\n .create-panel {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n height: 100%;\n padding-right: 20px;\n }\n .create-panel searchable-list
|
|
1739
|
+
GroupCast.style = ":host {\n display: block;\n height: 100%;\n background: var(--bg-primary, var(--bg-primary-color));\n color: var(--text-primary, var(--text-primary-color));\n }\n .group-cast-container {\n padding: 20px 0 20px 20px;\n height: 96%;\n display: flex;\n flex-direction: column;\n gap: 5px;\n box-sizing: border-box;\n }\n .group-cast-header-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 20px 0 0;\n }\n .group-cast-header {\n font-size: var(--title-font-size, 24px);\n font-weight: 600;\n margin: 0;\n }\n .icon-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 0;\n display: flex;\n align-items: center;\n }\n .icon-btn img {\n width: 28px;\n height: 28px;\n }\n .group-cast-body {\n flex: 1;\n min-height: 0;\n overflow: hidden auto;\n padding: 0 15px 0 0;\n }\n .group-cast-body::-webkit-scrollbar { width: 5px; }\n .group-cast-body::-webkit-scrollbar-track { background: transparent; }\n .group-cast-body::-webkit-scrollbar-thumb {\n background-color: var(--bg-secondary, var(--bg-secondary-color)) !important;\n border-radius: 10px;\n }\n chat-tile:hover {\n background-color: var(--bg-secondary, var(--bg-secondary-color)) !important;\n }\n .create-panel {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n height: 100%;\n padding-right: 20px;\n }\n .create-panel searchable-list {\n display: block;\n flex: 1;\n min-height: 0;\n height: 100%;\n }\n .picker-back {\n display: flex;\n align-items: center;\n padding: 0 0 8px;\n }\n .picker-back button {\n border: none;\n background: transparent;\n color: inherit;\n font-size: 18px;\n cursor: pointer;\n }\n .empty {\n text-align: center;\n padding: 20px;\n color: var(--text-tertiary, var(--text-tertiary-color));\n }\n .theme-icon { filter: var(--svg-icon-filter); }";
|
|
1783
1740
|
|
|
1784
1741
|
const WebChatHeader = class {
|
|
1785
1742
|
constructor(hostRef) {
|
|
@@ -1991,11 +1948,19 @@ const WebChatHeader = class {
|
|
|
1991
1948
|
this.menuOpen = false;
|
|
1992
1949
|
}
|
|
1993
1950
|
title() {
|
|
1994
|
-
var _a;
|
|
1951
|
+
var _a, _b, _c, _d;
|
|
1995
1952
|
const d = this.conversationDetails || {};
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1953
|
+
if (d.groupcastId) {
|
|
1954
|
+
const title = d.groupcastTitle;
|
|
1955
|
+
if (!title || title === groupcast.DEFAULT_GROUPCAST_TITLE) {
|
|
1956
|
+
const n = (_c = (_a = d.membersCount) !== null && _a !== void 0 ? _a : (_b = d.members) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
|
|
1957
|
+
if (n > 0)
|
|
1958
|
+
return `${n} Recipients Selected`;
|
|
1959
|
+
}
|
|
1960
|
+
return title || this.displayTitle || '';
|
|
1961
|
+
}
|
|
1962
|
+
return (this.displayTitle ||
|
|
1963
|
+
(d.isGroup ? d.conversationTitle : (_d = d.opponentDetails) === null || _d === void 0 ? void 0 : _d.userName) ||
|
|
1999
1964
|
'');
|
|
2000
1965
|
}
|
|
2001
1966
|
avatarSrc() {
|
|
@@ -2081,10 +2046,10 @@ const WebChatHeader = class {
|
|
|
2081
2046
|
const groupcast = this.isGroupcast();
|
|
2082
2047
|
const isGroup = !!((_a = this.conversationDetails) === null || _a === void 0 ? void 0 : _a.isGroup) && !groupcast;
|
|
2083
2048
|
const showBlock = !groupcast && !((_b = this.conversationDetails) === null || _b === void 0 ? void 0 : _b.isGroup);
|
|
2084
|
-
return (index.h(index.Fragment, { key: '
|
|
2049
|
+
return (index.h(index.Fragment, { key: 'c68bdc0943a8cc40e5c824f7db173837abceb47c' }, index.h("div", { key: '54c2e8da13e855def886ab2dd032e53f256ac90b', class: "head-container", style: {
|
|
2085
2050
|
backgroundColor: this.headerBgColor || undefined,
|
|
2086
2051
|
color: this.headerUsernameColor || undefined,
|
|
2087
|
-
} }, index.h("div", { key: '
|
|
2052
|
+
} }, index.h("div", { key: '65fe7a87cf1f6d8592a0520e8d8330000b8232b7', class: "head-left" }, index.h("button", { key: '6bab0547697d7cf42181840c29eb09ac4fbe9670', class: "back-button", type: "button", onClick: () => typeof this.onBackButtonClick === 'function' && this.onBackButtonClick(), "aria-label": "Back" }, index.h("img", { key: 'dab7d02b39cdba326dfef6a98f0766f025c5d7d6', class: "theme-icon", src: chatAssets.Left_Arrow, alt: "" })), index.h("div", { key: '52bac68e64e3d3544b58d29673a0b6d6184868a4', class: "identity", onClick: this.handleTextClick }, index.h("profile-avatar", { key: 'cf6ad330b5390f027f09da32e00f6f2809a29fdd', src: this.avatarSrc(), name: this.title(), size: "var(--avatar-sm)", isGroup: this.avatarIsGroup() }), index.h("div", { key: '25333a9f60b44307fb4997af01eb8bac7cd069f7', class: "text-container" }, index.h("div", { key: '2df66ba46c912a15bd0ce1967b29fbc9e5bd4aa4', class: "title" }, this.title()), index.h("div", { key: 'be4b3217e2062a47a010449c78f7d112d63b5808', class: "subtitle", style: { color: this.headerLastSeenColor || undefined } }, this.subtitle(formattedLastSeen))))), index.h("div", { key: '8a7669948f4481f9c8ab21df0ed91079701676a6', class: "actions" }, !groupcast ? (index.h("button", { type: "button", class: "icon-btn", title: "Search in conversation", onClick: () => this.openSearch() }, index.h("img", { class: "theme-icon", src: chatAssets.Search, alt: "" }))) : null, index.h("div", { key: 'd5e70edf9f5d66bae8c2b308ea12a776d7b811be', class: "more-wrap" }, index.h("button", { key: 'bf4401660fa67ee3d45b7832a420a9e1b41278fd', type: "button", class: "icon-btn", title: "Menu", "aria-label": "Menu", "aria-haspopup": "menu", "aria-expanded": this.menuOpen ? 'true' : 'false', onClick: this.toggleMenu }, index.h("img", { key: '62aa9d892f20715623b8e921d53c81aad8ffed3a', class: "theme-icon", src: chatAssets.Three_Dots, alt: "" })), this.menuOpen ? (index.h("div", { class: "more-menu", role: "menu" }, isGroup ? (index.h(index.Fragment, null, this.isSelfAdmin() ? (index.h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.openAddMember }, index.h("img", { class: "theme-icon", src: chatAssets.Add_User, alt: "" }), index.h("span", null, "Add member"))) : null, index.h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.openGroupInfo }, index.h("img", { class: "theme-icon", src: chatAssets.Info, alt: "" }), index.h("span", null, "Group info")))) : null, !groupcast ? (index.h("button", { type: "button", class: "more-item", role: "menuitem", onClick: () => this.openSearch() }, index.h("img", { class: "theme-icon", src: chatAssets.Search, alt: "" }), index.h("span", null, "Search"))) : null, index.h("button", { type: "button", class: "more-item", role: "menuitem", onClick: () => this.doCloseChat() }, index.h("img", { class: "theme-icon", src: chatAssets.CloseButton, alt: "" }), index.h("span", null, "Close chat")), !groupcast ? (index.h(index.Fragment, null, index.h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.handleClearChat }, index.h("img", { class: "theme-icon", src: chatAssets.Clear_Chat, alt: "" }), index.h("span", null, "Clear chat")), !isGroup ? (index.h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.deleteChat }, index.h("img", { class: "theme-icon", src: chatAssets.Delete, alt: "" }), index.h("span", null, "Delete chat"))) : null)) : null, isGroup ? (index.h(index.Fragment, null, index.h("div", { class: "more-divider" }), index.h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.exitGroup }, index.h("img", { class: "theme-icon", src: chatAssets.Logout, alt: "" }), index.h("span", null, "Exit group")))) : null, showBlock ? (index.h(index.Fragment, null, index.h("div", { class: "more-divider" }), index.h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.doBlock }, index.h("img", { class: "theme-icon", src: chatAssets.Block_User, alt: "" }), index.h("span", null, this.isBlocked ? 'Unblock Chat' : 'Block Chat')))) : null)) : null))), this.isLoading && (index.h("div", { key: '53b3961296cc5c5bbb0b62fbe2cf99a77675a8a6', class: "loading-overlay" }, index.h("spinner-loader", { key: '452252d887289026b1633128565371cb12fba34f', height: "30px", width: "30px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary)", spinnerSecondaryColor: "var(--text-primary)", spinnerBorderWidth: "2px" })))));
|
|
2088
2053
|
}
|
|
2089
2054
|
get el() { return index.getElement(this); }
|
|
2090
2055
|
static get watchers() { return {
|
|
@@ -5724,6 +5689,7 @@ const ChatFooter = class {
|
|
|
5724
5689
|
this.conversationDetails = {};
|
|
5725
5690
|
this.allConversationList = [];
|
|
5726
5691
|
this.updateConversationListProp = undefined;
|
|
5692
|
+
this.ensureGroupcastReady = undefined;
|
|
5727
5693
|
this.showCamera = false;
|
|
5728
5694
|
this.linkPreview = '';
|
|
5729
5695
|
this.linkToPreview = '';
|
|
@@ -5847,7 +5813,24 @@ const ChatFooter = class {
|
|
|
5847
5813
|
conversation: this.conversationDetails,
|
|
5848
5814
|
});
|
|
5849
5815
|
if (isGroupcast) {
|
|
5850
|
-
|
|
5816
|
+
let resolvedGroupcastId = groupcastId;
|
|
5817
|
+
if (groupcast.isGroupcastDraftId(groupcastId) && this.ensureGroupcastReady) {
|
|
5818
|
+
try {
|
|
5819
|
+
resolvedGroupcastId = await this.ensureGroupcastReady();
|
|
5820
|
+
this.groupcastId = resolvedGroupcastId;
|
|
5821
|
+
}
|
|
5822
|
+
catch (err) {
|
|
5823
|
+
console.error(err);
|
|
5824
|
+
toast.showToast({
|
|
5825
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || 'Could not create groupcast',
|
|
5826
|
+
type: 'error',
|
|
5827
|
+
position: 'bottom-right',
|
|
5828
|
+
});
|
|
5829
|
+
this.changeMessageSendingState(false);
|
|
5830
|
+
return;
|
|
5831
|
+
}
|
|
5832
|
+
}
|
|
5833
|
+
const payloadForGroupcastMessage = localNotification.withHostMessagePushFields(Object.assign({ showInConversation: true, sendPushForNewConversationCreated: true, searchableTags: this.generateSearchableTags(body), metaData: this.getReplyMetadata(), body: body, groupcastId: resolvedGroupcastId, readCount: 1, notifyOnCompletion: true, messageType: this.replyMessage ? 2 : 0, hideNewConversationsForSender: true, encrypted: true, deviceId: this.deviceId, deliveryCount: 1, customType: (body === null || body === void 0 ? void 0 : body.match(/(https?:\/\/[^\s]+)/g))
|
|
5851
5834
|
? 'AttachmentMessage:Link'
|
|
5852
5835
|
: 'AttachmentMessage:Text' }, (mentionedUsers.length > 0 && { mentionedUsers })), pushContext, this.el);
|
|
5853
5836
|
try {
|
|
@@ -6068,7 +6051,23 @@ const ChatFooter = class {
|
|
|
6068
6051
|
deviceId: this.deviceId,
|
|
6069
6052
|
metaData: this.getReplyMetadata(),
|
|
6070
6053
|
}, pushContext, this.el);
|
|
6071
|
-
let
|
|
6054
|
+
let resolvedGroupcastId = this.groupcastId;
|
|
6055
|
+
if (this.isGroupcast && groupcast.isGroupcastDraftId(String(resolvedGroupcastId)) && this.ensureGroupcastReady) {
|
|
6056
|
+
try {
|
|
6057
|
+
resolvedGroupcastId = await this.ensureGroupcastReady();
|
|
6058
|
+
this.groupcastId = resolvedGroupcastId;
|
|
6059
|
+
}
|
|
6060
|
+
catch (err) {
|
|
6061
|
+
console.error(err);
|
|
6062
|
+
toast.showToast({
|
|
6063
|
+
message: (err === null || err === void 0 ? void 0 : err.message) || 'Could not create groupcast',
|
|
6064
|
+
type: 'error',
|
|
6065
|
+
position: 'bottom-right',
|
|
6066
|
+
});
|
|
6067
|
+
return;
|
|
6068
|
+
}
|
|
6069
|
+
}
|
|
6070
|
+
let payloadForGroupcastMessage = localNotification.withHostMessagePushFields(Object.assign(Object.assign({}, payload), { hideNewConversationsForSender: false, groupcastId: resolvedGroupcastId, notifyOnCompletion: true, sendPushForNewConversationCreated: true }), pushContext, this.el);
|
|
6072
6071
|
const mentionedUsers = this.mentionedUsersForApi(caption);
|
|
6073
6072
|
if (mentionedUsers.length > 0) {
|
|
6074
6073
|
payload['mentionedUsers'] = mentionedUsers;
|
|
@@ -6134,7 +6133,7 @@ const ChatFooter = class {
|
|
|
6134
6133
|
const webChat = index$1.findWebChatHost(this.el);
|
|
6135
6134
|
const hasCustomReply = (webChat ? index$1.hasNamedSlot(webChat, 'reply-preview') : false) || index$1.hasNamedSlot(this.el, 'reply-preview');
|
|
6136
6135
|
const showAttachment = this.attachmentDetails || this.showCamera;
|
|
6137
|
-
return (index.h(index.Host, { key: '
|
|
6136
|
+
return (index.h(index.Host, { key: '3523142e7c942228bda8f3ff08ab160d3ab29350', class: { 'attachment-open': !!showAttachment } }, index.h("div", { key: '4127452ec1c81f7ccd83070f04b22be1b7a14f4b', class: "chat-footer-container" }, showAttachment ? (index.h("slot", { name: "attachment-preview" }, index.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 }))) : (index.h(index.Fragment, null, hasCustomReply ? index.h("slot", { name: "reply-preview" }) : null, index.h("slot", { name: "composer-input" }, !hasCustomReply && this.replyMessage ? (index.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)
|
|
6138
6137
|
? 'You'
|
|
6139
6138
|
: (_f = (_e = this.replyMessage) === null || _e === void 0 ? void 0 : _e.senderInfo) === null || _f === void 0 ? void 0 : _f.userName, onIconClick: this.handleremoveReplyMessage })) : null, index.h("div", { class: "composer-wrap", key: this.inputKey, ref: el => (this.composerWrapRef = el) }, this.showEmojiPicker ? (index.h("div", { class: "emoji-panel", style: this.emojiPanelStyle }, index.h("div", { class: "emoji-panel-header" }, index.h("span", null, "Emoji"), index.h("button", { class: "emoji-panel-close", type: "button", "aria-label": "Close", onClick: this.handleEmojiToggle }, "\u00D7")), index.h("emoji-picker", { class: "emoji-picker light", ref: this.bindEmojiPicker }))) : null, index.h("div", { class: { composer: true, recording: this.isRecording } }, this.isRecording ? (index.h("div", { class: "rec-body" }, index.h("div", { class: "rec-left" }, index.h("button", { class: "rec-icon-btn danger", type: "button", title: "Delete recording", "aria-label": "Delete recording", onClick: this.handleRecDelete }, index.h("img", { class: "theme-icon", src: chatAssets.Delete, alt: "" })), index.h("div", { class: "rec-timer-wrap" }, index.h("span", { class: { 'rec-dot': true, live: !this.isPaused } }), index.h("span", { class: "rec-timer" }, this.formatRecTime(this.recordingSeconds)))), index.h("div", { class: "rec-wave" }, index.h("audio-bubble", { liveRecord: true, audioProgressColor: "#2563eb", audioWaveColor: "#2563eb", ref: el => (this.recBubble = el), onRecordingProgress: this.onRecordingProgress, onRecordingError: this.onRecordingError })), index.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 }, index.h("img", { class: "theme-icon", src: this.isPaused ? play.PlayIcon : PauseIcon, alt: "" })), index.h("button", { class: "rec-send", type: "button", title: "Send voice note", "aria-label": "Send voice note", onClick: this.handleRecSend }, index.h("img", { src: chatAssets.Send, alt: "" })))) : (index.h(index.Fragment, null, index.h("div", { class: "attach-wrap" }, index.h("button", { class: "icon-btn", type: "button", title: "Attach file", "aria-label": "Attach", onClick: this.handleAttachClick }, index.h("img", { src: chatAssets.Attachment, alt: "" })), this.showAttachMenu ? (index.h("div", { class: "attach-menu", style: this.attachMenuStyle }, index.h("button", { class: "attach-opt", type: "button", onClick: this.pickDocument }, index.h("span", { class: "attach-opt-icon attach-opt-icon--doc" }, index.h("img", { src: play.DocumentsIcon, alt: "" })), index.h("span", null, "Document")), index.h("button", { class: "attach-opt", type: "button", onClick: this.pickPhotos }, index.h("span", { class: "attach-opt-icon attach-opt-icon--photos" }, index.h("img", { class: "theme-icon", src: play.PhotosIcon, alt: "" })), index.h("span", null, "Photos & videos")), index.h("button", { class: "attach-opt", type: "button", onClick: this.pickCamera }, index.h("span", { class: "attach-opt-icon attach-opt-icon--camera" }, index.h("img", { class: "theme-icon", src: CameraIcon, alt: "" })), index.h("span", null, "Camera")))) : null), index.h("button", { class: "icon-btn", type: "button", title: "Emojis", "aria-label": "Emojis", onClick: this.handleEmojiToggle }, index.h("img", { src: chatAssets.Smile, alt: "" })), index.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 }), index.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 }), index.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, onPaste: this.handleComposerPaste }), this.messageBody.trim() ? (index.h("button", { class: "icon-btn", type: "button", title: "Send", "aria-label": "Send", onClick: this.handleSendMessage }, index.h("img", { src: chatAssets.Send, alt: "" }))) : (index.h("button", { class: "icon-btn", type: "button", title: "Voice note", "aria-label": "Voice note", onClick: this.handleMicClick }, index.h("img", { src: chatAssets.Microphone, alt: "" })))))))))))));
|
|
6140
6139
|
}
|
|
@@ -6516,6 +6515,7 @@ const ContactInfo = class {
|
|
|
6516
6515
|
});
|
|
6517
6516
|
};
|
|
6518
6517
|
this.openAddMember = () => {
|
|
6518
|
+
var _a;
|
|
6519
6519
|
if (!this.isSelfAdmin())
|
|
6520
6520
|
return;
|
|
6521
6521
|
const id = this.groupcastId || this.conversationId;
|
|
@@ -6525,6 +6525,7 @@ const ContactInfo = class {
|
|
|
6525
6525
|
selectedConversationId: id,
|
|
6526
6526
|
conversationId: id,
|
|
6527
6527
|
isGroupcast: !!this.isGroupcast || !!this.groupcastId,
|
|
6528
|
+
metaData: (_a = this.conversationMetaData) === null || _a === void 0 ? void 0 : _a.metaData,
|
|
6528
6529
|
});
|
|
6529
6530
|
};
|
|
6530
6531
|
this.startTitleEdit = (e) => {
|
|
@@ -6859,9 +6860,9 @@ const ContactInfo = class {
|
|
|
6859
6860
|
render() {
|
|
6860
6861
|
const members = this.isGroupcast ? this.groupcastMembers || [] : this.groupMembers || [];
|
|
6861
6862
|
const isGroup = !!(this.isGroup || this.isGroupcast);
|
|
6862
|
-
return (index.h("div", { key: '
|
|
6863
|
+
return (index.h("div", { key: '4c2dccbd52cfc7ebe82d59fa1d7b971000997b3b', class: "panel" }, !this.infoMediaListOpen ? (index.h("div", { class: "header" }, index.h("button", { class: "close-btn", type: "button", "aria-label": "Close", title: "Close", onClick: () => this.close() }, index.h("img", { class: "theme-icon", src: cancel.CancelIcon, alt: "" })), index.h("h2", null, isGroup ? 'Group info' : 'Contact info'))) : null, index.h("div", { key: '27f75b9b69e23705882843b1c5b88a6655693e7a', class: "body", style: this.infoMediaListOpen
|
|
6863
6864
|
? { flex: '1', display: 'flex', flexDirection: 'column', minHeight: '0', overflow: 'hidden' }
|
|
6864
|
-
: undefined }, !this.infoMediaListOpen ? (index.h("div", { class: "card hero" }, index.h("div", { class: "hero-avatar-wrap" }, index.h("profile-avatar", { src: this.contactImage || '', name: this.contactName || '?', size: "7rem", isGroup: isGroup }), this.canEditGroupInfo() ? (index.h("button", { class: "photo-edit-btn", type: "button", "aria-label": "Change group photo", title: "Change group photo", disabled: this.imageUploading, onClick: this.openImagePicker }, index.h("img", { class: "theme-icon", src: CameraAddIcon, alt: "" }))) : null, index.h("input", { type: "file", accept: "image/*", hidden: true, ref: el => (this.imageFileInput = el), onChange: this.onImageFileChange })), this.titleEditing ? (index.h("div", { class: "title-edit-row" }, index.h("input", { class: "title-edit-input", type: "text", maxlength: 100, value: this.titleDraft, "aria-label": "Group name", onInput: this.onTitleDraftInput, onKeyDown: this.onTitleDraftKeyDown }), index.h("button", { class: "title-edit-save", type: "button", onClick: this.saveTitleEdit }, "Save"), index.h("button", { class: "title-edit-cancel", type: "button", onClick: this.cancelTitleEdit }, "Cancel"))) : (index.h("div", { class: "hero-name-row" }, index.h("h3", { class: "hero-name" }, this.contactName || 'Unknown'), this.canEditGroupInfo() ? (index.h("button", { class: "title-edit-btn", type: "button", "aria-label": "Edit group name", title: "Edit group name", onClick: this.startTitleEdit }, index.h("img", { class: "theme-icon", src: EditIcon, alt: "" }))) : null)), isGroup ? (index.h("p", { class: "hero-meta" }, "Group \u00B7 ", index.h("span", { class: "count" }, members.length, " members"))) : this.contactEmail ? (index.h("p", { class: "hero-meta" }, this.contactEmail)) : null)) : null, index.h("info-panel-media", { key: '
|
|
6865
|
+
: undefined }, !this.infoMediaListOpen ? (index.h("div", { class: "card hero" }, index.h("div", { class: "hero-avatar-wrap" }, index.h("profile-avatar", { src: this.contactImage || '', name: this.contactName || '?', size: "7rem", isGroup: isGroup }), this.canEditGroupInfo() ? (index.h("button", { class: "photo-edit-btn", type: "button", "aria-label": "Change group photo", title: "Change group photo", disabled: this.imageUploading, onClick: this.openImagePicker }, index.h("img", { class: "theme-icon", src: CameraAddIcon, alt: "" }))) : null, index.h("input", { type: "file", accept: "image/*", hidden: true, ref: el => (this.imageFileInput = el), onChange: this.onImageFileChange })), this.titleEditing ? (index.h("div", { class: "title-edit-row" }, index.h("input", { class: "title-edit-input", type: "text", maxlength: 100, value: this.titleDraft, "aria-label": "Group name", onInput: this.onTitleDraftInput, onKeyDown: this.onTitleDraftKeyDown }), index.h("button", { class: "title-edit-save", type: "button", onClick: this.saveTitleEdit }, "Save"), index.h("button", { class: "title-edit-cancel", type: "button", onClick: this.cancelTitleEdit }, "Cancel"))) : (index.h("div", { class: "hero-name-row" }, index.h("h3", { class: "hero-name" }, this.contactName || 'Unknown'), this.canEditGroupInfo() ? (index.h("button", { class: "title-edit-btn", type: "button", "aria-label": "Edit group name", title: "Edit group name", onClick: this.startTitleEdit }, index.h("img", { class: "theme-icon", src: EditIcon, alt: "" }))) : null)), isGroup ? (index.h("p", { class: "hero-meta" }, "Group \u00B7 ", index.h("span", { class: "count" }, members.length, " members"))) : this.contactEmail ? (index.h("p", { class: "hero-meta" }, this.contactEmail)) : null)) : null, index.h("info-panel-media", { key: '5062cfc6469a6faf05dd89b3ab6a2dbb20acdaf5', ref: el => (this.mediaPanelRef = el), allAttachments: this.allAttachments, allLinks: this.allLinks, allLinksCount: this.allLinksCount, conversationId: this.conversationId, onMediaListOpenChange: this.onMediaListOpenChange }), !this.infoMediaListOpen && isGroup ? (index.h("div", { class: "card" }, index.h("div", { class: "members-head" }, members.length, " members"), this.isSelfAdmin() ? (index.h("button", { type: "button", class: "add-member-row", onClick: this.openAddMember }, index.h("span", { class: "add-member-icon" }, index.h("img", { class: "theme-icon", src: AddUserIcon, alt: "" })), index.h("span", null, "Add member"))) : null, members.map((m) => {
|
|
6865
6866
|
var _a, _b, _c;
|
|
6866
6867
|
const isSelf = m.userId === ((_a = this.userMetaData) === null || _a === void 0 ? void 0 : _a.userId);
|
|
6867
6868
|
const canManage = this.isSelfAdmin() && !isSelf;
|
|
@@ -7020,7 +7021,7 @@ const MessageSearch = class {
|
|
|
7020
7021
|
this.onSearchHandler(query);
|
|
7021
7022
|
}, 500);
|
|
7022
7023
|
this.onInput = (e) => {
|
|
7023
|
-
const value =
|
|
7024
|
+
const value = e.target.value || '';
|
|
7024
7025
|
this.searchValue = value;
|
|
7025
7026
|
this.debouncedSearch(value);
|
|
7026
7027
|
};
|
|
@@ -7060,12 +7061,12 @@ const MessageSearch = class {
|
|
|
7060
7061
|
return text || '';
|
|
7061
7062
|
const esc = q.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
7062
7063
|
return String(text)
|
|
7063
|
-
.split(new RegExp(`(${esc})`, '
|
|
7064
|
-
.map((part, i) => (part
|
|
7064
|
+
.split(new RegExp(`(${esc})`, 'g'))
|
|
7065
|
+
.map((part, i) => (part === q ? index.h("span", { class: "hit", key: i }, part) : part));
|
|
7065
7066
|
}
|
|
7066
7067
|
render() {
|
|
7067
7068
|
const results = this.searchedMessageDetails || [];
|
|
7068
|
-
return (index.h("div", { key: '
|
|
7069
|
+
return (index.h("div", { key: 'f974d61f345d826542b3ed930ac9593e7116d19e', class: "panel", onClick: e => e.stopPropagation() }, index.h("div", { key: 'c3bd4d1ff017f363fda20d33f9326d298bc6b4a7', class: "header" }, index.h("button", { key: '52a69e649d336b7bd62e358d07575e9bc31ad61c', class: "icon-btn", type: "button", "aria-label": "Close", onClick: () => this.closeSearch() }, index.h("img", { key: 'fa53c6faf6f3eba7642630c583a802e7a8d693cf', class: "theme-icon", src: cancel.CancelIcon, alt: "" })), index.h("h3", { key: '97d0cb42cc31cf024128dee83096d98a189e2c1c', class: "title" }, "Search messages")), index.h("div", { key: '50428bbca2b2a8659eeef745c770e2a146bb2b4a', class: "search-wrap" }, index.h("div", { key: '523403917721237a6502e61970a9809e85776aa9', class: "search-bar" }, index.h("img", { key: 'a1adf0dac5c992b0b3e3a88da63220ad7c337afd', class: "theme-icon search-icon", src: chatAssets.Search, alt: "" }), index.h("input", { key: '0b0149ba1426e95bfc2148ddb39040035b711d3f', type: "text", placeholder: "Search", value: this.searchValue, onInput: this.onInput, autofocus: true }), this.searchValue ? (index.h("button", { class: "clear-btn", type: "button", "aria-label": "Clear", onClick: this.clearInput }, index.h("img", { class: "theme-icon", src: cancel.CancelIcon, alt: "" }))) : null)), index.h("div", { key: 'c45c12f41704a489e5f946008bd92d5ad648a5fc', class: "results" }, this.isLoadingMessage ? (index.h("div", { class: "empty" }, index.h("spinner-loader", { height: "15px", width: "15px" }))) : results.length === 0 ? (index.h("div", { class: "empty" }, index.h("p", null, this.searchValue ? 'No results found' : 'Search for messages'))) : (results.map(message => (index.h("div", { class: "row", onClick: () => this.handleResultClick(message.messageId) }, index.h("span", { class: "date" }, this.formatDate(message.sentAt)), index.h("span", { class: "body" }, this.highlight(message.body)))))))));
|
|
7069
7070
|
}
|
|
7070
7071
|
};
|
|
7071
7072
|
MessageSearch.style = ":host {\n display: block;\n height: 100%;\n font-family: var(--font-primary);\n color: var(--text-primary);\n }\n .panel {\n display: flex;\n flex-direction: column;\n height: 100%;\n box-sizing: border-box;\n background: var(--bg-primary);\n }\n .header {\n height: 4rem;\n padding: 0 var(--space-16);\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n border-bottom: 1px solid var(--border);\n flex-shrink: 0;\n box-sizing: border-box;\n }\n .icon-btn {\n width: var(--control);\n height: var(--control);\n border: none;\n border-radius: var(--rounded-full);\n background: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--icon);\n flex-shrink: 0;\n }\n .icon-btn:hover { background: var(--hover-overlay); color: var(--text-primary); }\n .icon-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n }\n .title {\n margin: 0;\n font-size: var(--text-16);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .search-wrap {\n padding: var(--space-16) var(--space-16) var(--space-8);\n border-bottom: 1px solid var(--border-subtle);\n }\n .search-bar {\n position: relative;\n display: flex;\n align-items: center;\n }\n .search-icon {\n position: absolute;\n left: 0.75rem;\n width: 1.125rem;\n height: 1.125rem;\n opacity: 0.55;\n pointer-events: none;\n }\n .search-bar input {\n width: 100%;\n box-sizing: border-box;\n border: none;\n outline: none;\n border-radius: var(--rounded-8);\n background: var(--bg-input);\n color: var(--text-primary);\n font-size: var(--text-14);\n font-family: var(--font-primary);\n padding: var(--gap-8) 2.25rem var(--gap-8) 2.25rem;\n }\n .search-bar input::placeholder { color: var(--text-tertiary); }\n .search-bar input:focus {\n box-shadow: 0 0 0 2px var(--focus-ring);\n }\n .clear-btn {\n position: absolute;\n right: 0.5rem;\n width: 1.75rem;\n height: 1.75rem;\n border: none;\n border-radius: var(--rounded-full);\n background: transparent;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--text-tertiary);\n }\n .clear-btn:hover { color: var(--text-secondary); }\n .clear-btn img { width: 0.875rem; height: 0.875rem; display: block; }\n .results {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n }\n .empty {\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 2rem;\n text-align: center;\n box-sizing: border-box;\n }\n .empty p {\n margin: 0;\n max-width: 15rem;\n font-size: var(--text-12);\n color: var(--text-tertiary);\n line-height: 1.6;\n }\n .row {\n display: flex;\n flex-direction: column;\n gap: var(--gap-4);\n padding: var(--space-12) var(--space-16);\n border-bottom: 1px solid var(--border-subtle);\n cursor: pointer;\n }\n .row:hover { background: var(--hover-overlay); }\n .date {\n font-size: var(--text-12);\n color: var(--text-secondary);\n }\n .body {\n font-size: var(--text-14);\n color: var(--text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .hit {\n background-color: var(--brand, #2563eb);\n color: var(--text-on-brand, #ffffff);\n border-radius: var(--rounded-2);\n padding: 0 2px;\n }\n .theme-icon { filter: var(--svg-icon-filter); }";
|