isometrik-plugin-chat-sdk 1.0.8 → 1.3.13
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/LICENSE +21 -0
- package/dist/cjs/attachment-preview_22.cjs.entry.js +10 -9
- package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
- package/dist/cjs/audio-bubble_4.cjs.entry.js +1 -1
- package/dist/cjs/chat-assets-e32e80c0.js +73 -0
- package/dist/cjs/chat-assets-e32e80c0.js.map +1 -0
- package/dist/cjs/chat-tile_3.cjs.entry.js +1 -1
- package/dist/cjs/forward-memebers.cjs.entry.js +1 -1
- package/dist/cjs/isometrik-webchat.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/login-page_3.cjs.entry.js +23 -13
- package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
- package/dist/cjs/member-add.cjs.entry.js +1 -1
- package/dist/cjs/new-chat-sidebar.cjs.entry.js +1 -1
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +6 -7
- package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +12 -12
- package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/WebChat.js +39 -6
- package/dist/collection/components/my-component/web-chat/WebChat.js.map +1 -1
- package/dist/collection/components/my-component/web-chat/shell-render.js +4 -2
- package/dist/collection/components/my-component/web-chat/shell-render.js.map +1 -1
- package/dist/collection/components/theme-provider.js +9 -9
- package/dist/collection/components/theme-provider.js.map +1 -1
- package/dist/collection/constants/chat-assets.js +39 -123
- package/dist/components/ChatSidebar.js +2 -2
- package/dist/components/ChatSidebar.js.map +1 -1
- package/dist/components/WebChat.js +15 -4
- package/dist/components/WebChat.js.map +1 -1
- package/dist/components/WebChatBody.js +9 -8
- package/dist/components/WebChatBody.js.map +1 -1
- package/dist/components/chat-assets.js +34 -82
- package/dist/components/chat-assets.js.map +1 -1
- package/dist/components/theme-provider2.js +9 -9
- package/dist/components/theme-provider2.js.map +1 -1
- package/dist/esm/attachment-preview_22.entry.js +10 -9
- package/dist/esm/attachment-preview_22.entry.js.map +1 -1
- package/dist/esm/audio-bubble_4.entry.js +1 -1
- package/dist/esm/chat-assets-4dfb1106.js +38 -0
- package/dist/esm/chat-assets-4dfb1106.js.map +1 -0
- package/dist/esm/chat-tile_3.entry.js +1 -1
- package/dist/esm/forward-memebers.entry.js +1 -1
- package/dist/esm/isometrik-webchat.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/login-page_3.entry.js +23 -13
- package/dist/esm/login-page_3.entry.js.map +1 -1
- package/dist/esm/member-add.entry.js +1 -1
- package/dist/esm/new-chat-sidebar.entry.js +1 -1
- package/dist/isometrik-webchat/isometrik-webchat.css +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-188b2631.entry.js → p-0085b397.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-ab5e1e85.entry.js → p-1ad1127f.entry.js} +2 -2
- package/dist/isometrik-webchat/p-6d9f8cec.entry.js +2 -0
- package/dist/isometrik-webchat/p-6d9f8cec.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-b44f0bd1.entry.js → p-6ec350aa.entry.js} +2 -2
- package/dist/isometrik-webchat/p-6ffeb379.entry.js +2 -0
- package/dist/isometrik-webchat/p-6ffeb379.entry.js.map +1 -0
- package/dist/isometrik-webchat/{p-e589ff24.entry.js → p-71cc96a3.entry.js} +2 -2
- package/dist/isometrik-webchat/{p-ff8f6bd2.entry.js → p-b8cef5e4.entry.js} +2 -2
- package/dist/isometrik-webchat/p-d424871c.js +2 -0
- package/dist/isometrik-webchat/p-d424871c.js.map +1 -0
- package/dist/types/components/ChatUIComponent/ChatSidebar/ChatSidebar.d.ts +2 -1
- package/dist/types/components/ChatUIComponent/WebChatBody/WebChatBody.d.ts +2 -2
- package/dist/types/components/theme-provider.d.ts +3 -2
- package/dist/types/components.d.ts +26 -8
- package/package.json +53 -10
- package/readme.md +428 -0
- package/dist/cjs/chat-assets-ff067e4d.js +0 -121
- package/dist/cjs/chat-assets-ff067e4d.js.map +0 -1
- package/dist/collection/assets/ExcelDocument.js +0 -2
- package/dist/collection/assets/IsometrikLogo.js +0 -38
- package/dist/collection/assets/Moon.svg +0 -1
- package/dist/collection/assets/New-Chat.svg +0 -5
- package/dist/collection/assets/NoChatPlaceholder.js +0 -16
- package/dist/collection/assets/NoContactsPlaceholder.js +0 -9
- package/dist/collection/assets/NoMessagePlaceholder.svg +0 -13
- package/dist/collection/assets/PdfDocument.js +0 -2
- package/dist/collection/assets/ProfilePlaceholder.js +0 -1
- package/dist/collection/assets/SelectChatPlaceholder.js +0 -13
- package/dist/collection/assets/Sun.svg +0 -1
- package/dist/collection/assets/add-user.svg +0 -6
- package/dist/collection/assets/attachment.svg +0 -4
- package/dist/collection/assets/avatar.svg +0 -1
- package/dist/collection/assets/block-user.svg +0 -4
- package/dist/collection/assets/camera-add.svg +0 -4
- package/dist/collection/assets/camera.svg +0 -17
- package/dist/collection/assets/cancel.svg +0 -12
- package/dist/collection/assets/chatBG.png +0 -0
- package/dist/collection/assets/chatdefaultbg.svg +0 -6140
- package/dist/collection/assets/clear-chat.svg +0 -4
- package/dist/collection/assets/close.svg +0 -4
- package/dist/collection/assets/dark-theme.svg +0 -12
- package/dist/collection/assets/delete.svg +0 -8
- package/dist/collection/assets/doc.png +0 -0
- package/dist/collection/assets/documents.svg +0 -15
- package/dist/collection/assets/doublecheck.svg +0 -1
- package/dist/collection/assets/download.svg +0 -4
- package/dist/collection/assets/drop-down.svg +0 -5
- package/dist/collection/assets/edit.svg +0 -4
- package/dist/collection/assets/equalizer.svg +0 -1
- package/dist/collection/assets/excel.svg +0 -2
- package/dist/collection/assets/forward.svg +0 -4
- package/dist/collection/assets/group-cast.svg +0 -1
- package/dist/collection/assets/group.svg +0 -13
- package/dist/collection/assets/imagePlaceholder.png +0 -0
- package/dist/collection/assets/imagePlaceholder.svg +0 -2
- package/dist/collection/assets/info.svg +0 -4
- package/dist/collection/assets/left-arrow.svg +0 -4
- package/dist/collection/assets/link.svg +0 -1
- package/dist/collection/assets/login.svg +0 -3051
- package/dist/collection/assets/logout.svg +0 -5
- package/dist/collection/assets/message-outline.svg +0 -5
- package/dist/collection/assets/message.svg +0 -1
- package/dist/collection/assets/microphone.svg +0 -2
- package/dist/collection/assets/new_group.svg +0 -9
- package/dist/collection/assets/odt-file.png +0 -0
- package/dist/collection/assets/onboarding.webp +0 -0
- package/dist/collection/assets/paper.svg +0 -5
- package/dist/collection/assets/pause.svg +0 -4
- package/dist/collection/assets/pdf.svg +0 -11
- package/dist/collection/assets/photos.svg +0 -4
- package/dist/collection/assets/play.svg +0 -19
- package/dist/collection/assets/profilePlaceholderImage.png +0 -0
- package/dist/collection/assets/reply.svg +0 -4
- package/dist/collection/assets/rtf.png +0 -0
- package/dist/collection/assets/search.svg +0 -4
- package/dist/collection/assets/send.svg +0 -4
- package/dist/collection/assets/singlecheck.svg +0 -1
- package/dist/collection/assets/smile.svg +0 -2
- package/dist/collection/assets/three-dots.svg +0 -5
- package/dist/collection/assets/txt.png +0 -0
- package/dist/collection/assets/videoPlaceholder.svg +0 -4
- package/dist/collection/assets/videoThumbnail.svg +0 -1
- package/dist/collection/components/ChatUIComponent/AudioBubble.js +0 -315
- package/dist/collection/components/ChatUIComponent/BlockChatList.js +0 -177
- package/dist/collection/components/ChatUIComponent/ForwardMessageList.js +0 -152
- package/dist/collection/components/ChatUIComponent/GroupCast.js +0 -461
- package/dist/collection/components/ChatUIComponent/shared/attachment-preview.js +0 -230
- package/dist/collection/components/ChatUIComponent/shared/chat-loading-placeholder.js +0 -70
- package/dist/collection/components/ChatUIComponent/shared/confirm-dialog.js +0 -51
- package/dist/collection/components/ChatUIComponent/shared/contact-info.js +0 -255
- package/dist/collection/components/ChatUIComponent/shared/context-menu.js +0 -112
- package/dist/collection/components/ChatUIComponent/shared/delete-message.js +0 -49
- package/dist/collection/components/ChatUIComponent/shared/document-message.js +0 -161
- package/dist/collection/components/ChatUIComponent/shared/forward-message.js +0 -139
- package/dist/collection/components/ChatUIComponent/shared/group-chat-contacts.js +0 -201
- package/dist/collection/components/ChatUIComponent/shared/group-info.js +0 -170
- package/dist/collection/components/ChatUIComponent/shared/image-message.js +0 -156
- package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble.js +0 -98
- package/dist/collection/components/ChatUIComponent/shared/link-preview.js +0 -125
- package/dist/collection/components/ChatUIComponent/shared/media-gallery.js +0 -152
- package/dist/collection/components/ChatUIComponent/shared/message-body-render.js +0 -19
- package/dist/collection/components/ChatUIComponent/shared/message-bubble.js +0 -189
- package/dist/collection/components/ChatUIComponent/shared/message-date-pill.js +0 -86
- package/dist/collection/components/ChatUIComponent/shared/message-info.js +0 -188
- package/dist/collection/components/ChatUIComponent/shared/message-search.js +0 -125
- package/dist/collection/components/ChatUIComponent/shared/new-chat-sidebar.js +0 -181
- package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble.js +0 -98
- package/dist/collection/components/ChatUIComponent/shared/profile-avatar.js +0 -136
- package/dist/collection/components/ChatUIComponent/shared/profile-info.js +0 -220
- package/dist/collection/components/ChatUIComponent/shared/reply-block.js +0 -162
- package/dist/collection/components/ChatUIComponent/shared/reply-message-container.js +0 -193
- package/dist/collection/components/ChatUIComponent/shared/share-popup.js +0 -69
- package/dist/collection/components/ChatUIComponent/shared/spinner-loader.js +0 -74
- package/dist/collection/components/ChatUIComponent/shared/toast-notification.js +0 -106
- package/dist/collection/components/ChatUIComponent/shared/video-message.js +0 -165
- package/dist/collection/components/my-component/my-component.e2e.js +0 -25
- package/dist/collection/components/my-component/my-component.spec.js +0 -34
- package/dist/collection/components/my-component/web-chat/web-chat-split.spec.js +0 -40
- package/dist/collection/lib/chat/chat.spec.js +0 -28
- package/dist/collection/lib/custom-ui/custom-ui.spec.js +0 -49
- package/dist/collection/lib/message-body-segments.spec.js +0 -21
- package/dist/collection/lib/message-dedup.spec.js +0 -17
- package/dist/collection/lib/mqtt/mqtt.spec.js +0 -39
- package/dist/collection/utils/utils.spec.js +0 -15
- package/dist/esm/chat-assets-95633770.js +0 -86
- package/dist/esm/chat-assets-95633770.js.map +0 -1
- package/dist/isometrik-webchat/assets/ExcelDocument.js +0 -2
- package/dist/isometrik-webchat/assets/IsometrikLogo.js +0 -38
- package/dist/isometrik-webchat/assets/Moon.svg +0 -1
- package/dist/isometrik-webchat/assets/New-Chat.svg +0 -5
- package/dist/isometrik-webchat/assets/NoChatPlaceholder.js +0 -16
- package/dist/isometrik-webchat/assets/NoContactsPlaceholder.js +0 -9
- package/dist/isometrik-webchat/assets/NoMessagePlaceholder.svg +0 -13
- package/dist/isometrik-webchat/assets/PdfDocument.js +0 -2
- package/dist/isometrik-webchat/assets/ProfilePlaceholder.js +0 -1
- package/dist/isometrik-webchat/assets/SelectChatPlaceholder.js +0 -13
- package/dist/isometrik-webchat/assets/Sun.svg +0 -1
- package/dist/isometrik-webchat/assets/add-user.svg +0 -6
- package/dist/isometrik-webchat/assets/attachment.svg +0 -4
- package/dist/isometrik-webchat/assets/avatar.svg +0 -1
- package/dist/isometrik-webchat/assets/block-user.svg +0 -4
- package/dist/isometrik-webchat/assets/camera-add.svg +0 -4
- package/dist/isometrik-webchat/assets/camera.svg +0 -17
- package/dist/isometrik-webchat/assets/cancel.svg +0 -12
- package/dist/isometrik-webchat/assets/chatBG.png +0 -0
- package/dist/isometrik-webchat/assets/chatdefaultbg.svg +0 -6140
- package/dist/isometrik-webchat/assets/clear-chat.svg +0 -4
- package/dist/isometrik-webchat/assets/close.svg +0 -4
- package/dist/isometrik-webchat/assets/dark-theme.svg +0 -12
- package/dist/isometrik-webchat/assets/delete.svg +0 -8
- package/dist/isometrik-webchat/assets/doc.png +0 -0
- package/dist/isometrik-webchat/assets/documents.svg +0 -15
- package/dist/isometrik-webchat/assets/doublecheck.svg +0 -1
- package/dist/isometrik-webchat/assets/download.svg +0 -4
- package/dist/isometrik-webchat/assets/drop-down.svg +0 -5
- package/dist/isometrik-webchat/assets/edit.svg +0 -4
- package/dist/isometrik-webchat/assets/equalizer.svg +0 -1
- package/dist/isometrik-webchat/assets/excel.svg +0 -2
- package/dist/isometrik-webchat/assets/forward.svg +0 -4
- package/dist/isometrik-webchat/assets/group-cast.svg +0 -1
- package/dist/isometrik-webchat/assets/group.svg +0 -13
- package/dist/isometrik-webchat/assets/imagePlaceholder.png +0 -0
- package/dist/isometrik-webchat/assets/imagePlaceholder.svg +0 -2
- package/dist/isometrik-webchat/assets/info.svg +0 -4
- package/dist/isometrik-webchat/assets/left-arrow.svg +0 -4
- package/dist/isometrik-webchat/assets/link.svg +0 -1
- package/dist/isometrik-webchat/assets/login.svg +0 -3051
- package/dist/isometrik-webchat/assets/logout.svg +0 -5
- package/dist/isometrik-webchat/assets/message-outline.svg +0 -5
- package/dist/isometrik-webchat/assets/message.svg +0 -1
- package/dist/isometrik-webchat/assets/microphone.svg +0 -2
- package/dist/isometrik-webchat/assets/new_group.svg +0 -9
- package/dist/isometrik-webchat/assets/odt-file.png +0 -0
- package/dist/isometrik-webchat/assets/onboarding.webp +0 -0
- package/dist/isometrik-webchat/assets/paper.svg +0 -5
- package/dist/isometrik-webchat/assets/pause.svg +0 -4
- package/dist/isometrik-webchat/assets/pdf.svg +0 -11
- package/dist/isometrik-webchat/assets/photos.svg +0 -4
- package/dist/isometrik-webchat/assets/play.svg +0 -19
- package/dist/isometrik-webchat/assets/profilePlaceholderImage.png +0 -0
- package/dist/isometrik-webchat/assets/reply.svg +0 -4
- package/dist/isometrik-webchat/assets/rtf.png +0 -0
- package/dist/isometrik-webchat/assets/search.svg +0 -4
- package/dist/isometrik-webchat/assets/send.svg +0 -4
- package/dist/isometrik-webchat/assets/singlecheck.svg +0 -1
- package/dist/isometrik-webchat/assets/smile.svg +0 -2
- package/dist/isometrik-webchat/assets/three-dots.svg +0 -5
- package/dist/isometrik-webchat/assets/txt.png +0 -0
- package/dist/isometrik-webchat/assets/videoPlaceholder.svg +0 -4
- package/dist/isometrik-webchat/assets/videoThumbnail.svg +0 -1
- package/dist/isometrik-webchat/p-4bad6da9.entry.js +0 -2
- package/dist/isometrik-webchat/p-4bad6da9.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-8c73a5d5.entry.js +0 -2
- package/dist/isometrik-webchat/p-8c73a5d5.entry.js.map +0 -1
- package/dist/isometrik-webchat/p-d6f0838c.js +0 -2
- package/dist/isometrik-webchat/p-d6f0838c.js.map +0 -1
- /package/dist/isometrik-webchat/{p-188b2631.entry.js.map → p-0085b397.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ab5e1e85.entry.js.map → p-1ad1127f.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-b44f0bd1.entry.js.map → p-6ec350aa.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-e589ff24.entry.js.map → p-71cc96a3.entry.js.map} +0 -0
- /package/dist/isometrik-webchat/{p-ff8f6bd2.entry.js.map → p-b8cef5e4.entry.js.map} +0 -0
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, Prop, h, Event, State } from '@stencil/core';
|
|
8
|
-
/**
|
|
9
|
-
* Shared message chrome (Stencil) — timestamp, delivery ticks, reactions, forward badge.
|
|
10
|
-
* Body via default slot.
|
|
11
|
-
*/
|
|
12
|
-
let MessageBubble = class MessageBubble {
|
|
13
|
-
constructor() {
|
|
14
|
-
this.isSelf = false;
|
|
15
|
-
this.timeColor = 'var(--text-secondary-color)';
|
|
16
|
-
this.isRead = false;
|
|
17
|
-
this.reactions = {};
|
|
18
|
-
this.showReactionOnHover = false;
|
|
19
|
-
this.isForwarded = false;
|
|
20
|
-
this.borderRadius = '12px';
|
|
21
|
-
this.padding = '8px 12px';
|
|
22
|
-
this.showReactionButton = false;
|
|
23
|
-
this.showEmojiPicker = false;
|
|
24
|
-
this.onReactionClick = (emojiId) => {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
const users = ((_a = this.reactions) === null || _a === void 0 ? void 0 : _a[emojiId]) || [];
|
|
27
|
-
const already = Array.isArray(users) && users.includes((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId);
|
|
28
|
-
const detail = { messageId: this.messageId, emojiId };
|
|
29
|
-
if (already)
|
|
30
|
-
this.reactionRemoved.emit(detail);
|
|
31
|
-
else
|
|
32
|
-
this.reactionAdded.emit(detail);
|
|
33
|
-
this.showEmojiPicker = false;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
formatTime(value) {
|
|
37
|
-
if (value === null || value === undefined || value === '')
|
|
38
|
-
return '';
|
|
39
|
-
// sentAt is unix ms; Number("1789…") works, new Date("1789…") does not
|
|
40
|
-
const d = new Date(Number(value));
|
|
41
|
-
if (Number.isNaN(d.getTime()))
|
|
42
|
-
return String(value);
|
|
43
|
-
return new Intl.DateTimeFormat('en-US', {
|
|
44
|
-
hour: '2-digit',
|
|
45
|
-
minute: '2-digit',
|
|
46
|
-
hour12: true,
|
|
47
|
-
}).format(d);
|
|
48
|
-
}
|
|
49
|
-
renderTicks() {
|
|
50
|
-
if (!this.isSelf)
|
|
51
|
-
return null;
|
|
52
|
-
if (this.isRead === true)
|
|
53
|
-
return h("span", { class: "tick read" }, "\u2713\u2713");
|
|
54
|
-
if (this.isDelivered === true || this.isDelivered === 'true')
|
|
55
|
-
return h("span", { class: "tick" }, "\u2713\u2713");
|
|
56
|
-
if (this.isDelivered === 'pending')
|
|
57
|
-
return h("span", { class: "tick" }, "\u23F1");
|
|
58
|
-
return h("span", { class: "tick" }, "\u2713");
|
|
59
|
-
}
|
|
60
|
-
renderReactions() {
|
|
61
|
-
const entries = Object.keys(this.reactions || {})
|
|
62
|
-
.map(emojiId => ({ emojiId, users: this.reactions[emojiId] }))
|
|
63
|
-
.filter(r => Array.isArray(r.users) && r.users.length > 0);
|
|
64
|
-
if (!entries.length)
|
|
65
|
-
return null;
|
|
66
|
-
const visible = entries.slice(0, 2);
|
|
67
|
-
const remaining = entries.length > 2 ? entries.length - 2 : 0;
|
|
68
|
-
return (h("div", { class: "reactions-display" },
|
|
69
|
-
visible.map(r => (h("span", { class: "reaction-item", onClick: () => this.onReactionClick(r.emojiId) },
|
|
70
|
-
r.emojiId,
|
|
71
|
-
" ",
|
|
72
|
-
r.users.length))),
|
|
73
|
-
remaining > 0 ? h("span", { class: "reaction-item" },
|
|
74
|
-
"+",
|
|
75
|
-
remaining) : null));
|
|
76
|
-
}
|
|
77
|
-
render() {
|
|
78
|
-
const showActions = this.showReactionOnHover && (this.showReactionButton || this.showEmojiPicker);
|
|
79
|
-
return (h("div", { class: { 'message-container': true, self: !!this.isSelf }, style: {
|
|
80
|
-
['--mb-bg']: this.backgroundColor || 'var(--bg-secondary-color)',
|
|
81
|
-
['--mb-radius']: this.borderRadius || '12px',
|
|
82
|
-
['--mb-padding']: this.padding || '8px 12px',
|
|
83
|
-
['--time-color']: this.timeColor,
|
|
84
|
-
}, onMouseEnter: () => {
|
|
85
|
-
if (this.showReactionOnHover)
|
|
86
|
-
this.showReactionButton = true;
|
|
87
|
-
}, onMouseLeave: () => {
|
|
88
|
-
this.showReactionButton = false;
|
|
89
|
-
} },
|
|
90
|
-
this.isForwarded ? h("div", { class: "forwarded" }, "Forwarded") : null,
|
|
91
|
-
showActions ? (h("div", { class: "reactions-display" },
|
|
92
|
-
h("span", { class: "reaction-item", onClick: () => (this.showEmojiPicker = !this.showEmojiPicker) }, "\uD83D\uDE42"),
|
|
93
|
-
this.showEmojiPicker
|
|
94
|
-
? ['👍', '❤️', '😂', '😮', '😢'].map(e => (h("span", { class: "reaction-item", onClick: () => this.onReactionClick(e) }, e)))
|
|
95
|
-
: null)) : null,
|
|
96
|
-
h("div", { class: "body-slot" },
|
|
97
|
-
h("slot", null)),
|
|
98
|
-
this.renderReactions(),
|
|
99
|
-
h("div", { class: "time-stamp-container" },
|
|
100
|
-
h("span", null, this.formatTime(this.time)),
|
|
101
|
-
this.renderTicks())));
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
__decorate([
|
|
105
|
-
Prop()
|
|
106
|
-
], MessageBubble.prototype, "isSelf", void 0);
|
|
107
|
-
__decorate([
|
|
108
|
-
Prop()
|
|
109
|
-
], MessageBubble.prototype, "time", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
Prop()
|
|
112
|
-
], MessageBubble.prototype, "timeColor", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
Prop()
|
|
115
|
-
], MessageBubble.prototype, "isRead", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
Prop()
|
|
118
|
-
], MessageBubble.prototype, "isDelivered", void 0);
|
|
119
|
-
__decorate([
|
|
120
|
-
Prop()
|
|
121
|
-
], MessageBubble.prototype, "reactions", void 0);
|
|
122
|
-
__decorate([
|
|
123
|
-
Prop()
|
|
124
|
-
], MessageBubble.prototype, "messageId", void 0);
|
|
125
|
-
__decorate([
|
|
126
|
-
Prop()
|
|
127
|
-
], MessageBubble.prototype, "userMetaData", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
Prop()
|
|
130
|
-
], MessageBubble.prototype, "showReactionOnHover", void 0);
|
|
131
|
-
__decorate([
|
|
132
|
-
Prop()
|
|
133
|
-
], MessageBubble.prototype, "isForwarded", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
Prop()
|
|
136
|
-
], MessageBubble.prototype, "backgroundColor", void 0);
|
|
137
|
-
__decorate([
|
|
138
|
-
Prop()
|
|
139
|
-
], MessageBubble.prototype, "borderRadius", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
Prop()
|
|
142
|
-
], MessageBubble.prototype, "padding", void 0);
|
|
143
|
-
__decorate([
|
|
144
|
-
Event({ eventName: 'reaction-added', bubbles: true, composed: true })
|
|
145
|
-
], MessageBubble.prototype, "reactionAdded", void 0);
|
|
146
|
-
__decorate([
|
|
147
|
-
Event({ eventName: 'reaction-removed', bubbles: true, composed: true })
|
|
148
|
-
], MessageBubble.prototype, "reactionRemoved", void 0);
|
|
149
|
-
__decorate([
|
|
150
|
-
State()
|
|
151
|
-
], MessageBubble.prototype, "showReactionButton", void 0);
|
|
152
|
-
__decorate([
|
|
153
|
-
State()
|
|
154
|
-
], MessageBubble.prototype, "showEmojiPicker", void 0);
|
|
155
|
-
MessageBubble = __decorate([
|
|
156
|
-
Component({
|
|
157
|
-
tag: 'message-bubble',
|
|
158
|
-
shadow: true,
|
|
159
|
-
styles: `
|
|
160
|
-
:host { display: block; max-width: 100%; }
|
|
161
|
-
.message-container {
|
|
162
|
-
position: relative;
|
|
163
|
-
display: flex;
|
|
164
|
-
flex-direction: column;
|
|
165
|
-
gap: 4px;
|
|
166
|
-
padding: var(--mb-padding, 8px 12px);
|
|
167
|
-
border-radius: var(--mb-radius, 12px);
|
|
168
|
-
background: var(--mb-bg, var(--bg-secondary-color));
|
|
169
|
-
}
|
|
170
|
-
.message-container.self { align-items: stretch; }
|
|
171
|
-
.forwarded { font-size: 11px; opacity: 0.7; }
|
|
172
|
-
.reactions-display { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
|
|
173
|
-
.reaction-item {
|
|
174
|
-
cursor: pointer; font-size: 14px;
|
|
175
|
-
background: var(--bg-primary-light, #eee);
|
|
176
|
-
border-radius: 10px; padding: 2px 6px;
|
|
177
|
-
}
|
|
178
|
-
.time-stamp-container {
|
|
179
|
-
display: flex; align-items: center; gap: 4px;
|
|
180
|
-
justify-content: flex-end; margin-top: 2px;
|
|
181
|
-
font-size: 11px; color: var(--time-color, var(--text-secondary-color));
|
|
182
|
-
}
|
|
183
|
-
.tick { font-size: 12px; opacity: 0.8; }
|
|
184
|
-
.tick.read { color: #53bdeb; opacity: 1; }
|
|
185
|
-
.body-slot { width: 100%; }
|
|
186
|
-
`,
|
|
187
|
-
})
|
|
188
|
-
], MessageBubble);
|
|
189
|
-
export { MessageBubble };
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
8
|
-
/** Pure Stencil date pill — no Lit. */
|
|
9
|
-
let MessageDatePill = class MessageDatePill {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.bgColor = 'var(--bg-grey-color)';
|
|
12
|
-
this.textColor = 'var(--text-secondary-color)';
|
|
13
|
-
this.width = 'auto';
|
|
14
|
-
this.padding = '5px 20px';
|
|
15
|
-
this.borderRadius = '9px';
|
|
16
|
-
this.borderWidth = '0';
|
|
17
|
-
this.borderColor = 'transparent';
|
|
18
|
-
this.fontSize = '15px';
|
|
19
|
-
this.fontWeight = '500';
|
|
20
|
-
this.fontFamily = 'inherit';
|
|
21
|
-
this.content = '';
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
return (h("span", { class: "pill", style: {
|
|
25
|
-
background: this.bgColor,
|
|
26
|
-
color: this.textColor,
|
|
27
|
-
width: this.width,
|
|
28
|
-
padding: this.padding,
|
|
29
|
-
borderRadius: this.borderRadius,
|
|
30
|
-
borderWidth: this.borderWidth,
|
|
31
|
-
borderColor: this.borderColor,
|
|
32
|
-
borderStyle: 'solid',
|
|
33
|
-
fontSize: this.fontSize,
|
|
34
|
-
fontWeight: this.fontWeight,
|
|
35
|
-
fontFamily: this.fontFamily,
|
|
36
|
-
} }, this.content));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
__decorate([
|
|
40
|
-
Prop()
|
|
41
|
-
], MessageDatePill.prototype, "bgColor", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
Prop()
|
|
44
|
-
], MessageDatePill.prototype, "textColor", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
Prop()
|
|
47
|
-
], MessageDatePill.prototype, "width", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
Prop()
|
|
50
|
-
], MessageDatePill.prototype, "padding", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
Prop()
|
|
53
|
-
], MessageDatePill.prototype, "borderRadius", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
Prop()
|
|
56
|
-
], MessageDatePill.prototype, "borderWidth", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
Prop()
|
|
59
|
-
], MessageDatePill.prototype, "borderColor", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
Prop()
|
|
62
|
-
], MessageDatePill.prototype, "fontSize", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
Prop()
|
|
65
|
-
], MessageDatePill.prototype, "fontWeight", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
Prop()
|
|
68
|
-
], MessageDatePill.prototype, "fontFamily", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
Prop()
|
|
71
|
-
], MessageDatePill.prototype, "content", void 0);
|
|
72
|
-
MessageDatePill = __decorate([
|
|
73
|
-
Component({
|
|
74
|
-
tag: 'message-date-pill',
|
|
75
|
-
shadow: true,
|
|
76
|
-
styles: `
|
|
77
|
-
:host { display: inline-flex; justify-content: center; }
|
|
78
|
-
.pill {
|
|
79
|
-
display: inline-block;
|
|
80
|
-
text-align: center;
|
|
81
|
-
white-space: nowrap;
|
|
82
|
-
}
|
|
83
|
-
`,
|
|
84
|
-
})
|
|
85
|
-
], MessageDatePill);
|
|
86
|
-
export { MessageDatePill };
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, Prop, h } from '@stencil/core';
|
|
8
|
-
import { getFormattedDeliveryTime } from '../../../lib/helpers';
|
|
9
|
-
let MessageInfo = class MessageInfo {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.deliveryUserList = [];
|
|
12
|
-
this.readUserList = [];
|
|
13
|
-
}
|
|
14
|
-
close() {
|
|
15
|
-
if (typeof this.closePopup === 'function')
|
|
16
|
-
this.closePopup();
|
|
17
|
-
}
|
|
18
|
-
previewText() {
|
|
19
|
-
var _a, _b, _c;
|
|
20
|
-
return (this.messagePreviewText ||
|
|
21
|
-
((_a = this.selectedMessage) === null || _a === void 0 ? void 0 : _a.body) ||
|
|
22
|
-
(((_c = (_b = this.selectedMessage) === null || _b === void 0 ? void 0 : _b.attachments) === null || _c === void 0 ? void 0 : _c.length) ? 'Attachment' : ''));
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
const delivery = this.deliveryUserList || [];
|
|
26
|
-
const read = this.readUserList || [];
|
|
27
|
-
return (h("div", { class: "message-info-container", style: {
|
|
28
|
-
padding: this.padding,
|
|
29
|
-
margin: this.margin,
|
|
30
|
-
width: this.width,
|
|
31
|
-
height: this.height,
|
|
32
|
-
backgroundColor: this.backgroundColor,
|
|
33
|
-
color: this.textColor,
|
|
34
|
-
fontFamily: this.fontFamily,
|
|
35
|
-
fontSize: this.fontSize,
|
|
36
|
-
} },
|
|
37
|
-
h("div", { class: "message-info-header" },
|
|
38
|
-
h("strong", null, "Message info"),
|
|
39
|
-
h("button", { class: "close-btn", type: "button", onClick: () => this.close() }, "\u2715")),
|
|
40
|
-
h("div", { class: "preview", style: { backgroundColor: this.messageBackgroundColor || undefined } },
|
|
41
|
-
this.previewText(),
|
|
42
|
-
this.messageDate ? h("div", { style: { fontSize: '12px', opacity: '0.7', marginTop: '6px' } }, this.messageDate) : null),
|
|
43
|
-
h("div", { class: "section" },
|
|
44
|
-
h("h4", null,
|
|
45
|
-
"Read ",
|
|
46
|
-
this.pendingReadCount != null ? `(pending ${this.pendingReadCount})` : ''),
|
|
47
|
-
this.messageReadTime ? h("div", null, (getFormattedDeliveryTime === null || getFormattedDeliveryTime === void 0 ? void 0 : getFormattedDeliveryTime(this.messageReadTime)) || this.messageReadTime) : null,
|
|
48
|
-
read.length === 0 ? (h("div", { style: { opacity: '0.6' } }, "No read receipts")) : (read.map(u => (h("div", { class: "user-row" },
|
|
49
|
-
u.userProfileImageUrl ? h("img", { class: "avatar", src: u.userProfileImageUrl, alt: "" }) : h("div", { class: "avatar" }),
|
|
50
|
-
h("span", null, u.userName)))))),
|
|
51
|
-
h("div", { class: "section" },
|
|
52
|
-
h("h4", null,
|
|
53
|
-
"Delivered ",
|
|
54
|
-
this.pendingDeliveryCount != null ? `(pending ${this.pendingDeliveryCount})` : ''),
|
|
55
|
-
this.messageDeliveryTime ? (h("div", null, (getFormattedDeliveryTime === null || getFormattedDeliveryTime === void 0 ? void 0 : getFormattedDeliveryTime(this.messageDeliveryTime)) || this.messageDeliveryTime)) : null,
|
|
56
|
-
delivery.length === 0 ? (h("div", { style: { opacity: '0.6' } }, "No delivery receipts")) : (delivery.map(u => (h("div", { class: "user-row" },
|
|
57
|
-
u.userProfileImageUrl ? h("img", { class: "avatar", src: u.userProfileImageUrl, alt: "" }) : h("div", { class: "avatar" }),
|
|
58
|
-
h("span", null, u.userName))))))));
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
__decorate([
|
|
62
|
-
Prop()
|
|
63
|
-
], MessageInfo.prototype, "padding", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
Prop()
|
|
66
|
-
], MessageInfo.prototype, "margin", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
Prop()
|
|
69
|
-
], MessageInfo.prototype, "width", void 0);
|
|
70
|
-
__decorate([
|
|
71
|
-
Prop()
|
|
72
|
-
], MessageInfo.prototype, "height", void 0);
|
|
73
|
-
__decorate([
|
|
74
|
-
Prop()
|
|
75
|
-
], MessageInfo.prototype, "borderRadius", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
Prop()
|
|
78
|
-
], MessageInfo.prototype, "borderWidth", void 0);
|
|
79
|
-
__decorate([
|
|
80
|
-
Prop()
|
|
81
|
-
], MessageInfo.prototype, "borderColor", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
Prop()
|
|
84
|
-
], MessageInfo.prototype, "borderStyle", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
Prop()
|
|
87
|
-
], MessageInfo.prototype, "backgroundColor", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
Prop()
|
|
90
|
-
], MessageInfo.prototype, "messageBackgroundColor", void 0);
|
|
91
|
-
__decorate([
|
|
92
|
-
Prop()
|
|
93
|
-
], MessageInfo.prototype, "statusBackgroundColor", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
Prop()
|
|
96
|
-
], MessageInfo.prototype, "textColor", void 0);
|
|
97
|
-
__decorate([
|
|
98
|
-
Prop()
|
|
99
|
-
], MessageInfo.prototype, "fontSize", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
Prop()
|
|
102
|
-
], MessageInfo.prototype, "fontWeight", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
Prop()
|
|
105
|
-
], MessageInfo.prototype, "fontFamily", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
Prop()
|
|
108
|
-
], MessageInfo.prototype, "fontStyle", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
Prop()
|
|
111
|
-
], MessageInfo.prototype, "lineHeight", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
Prop()
|
|
114
|
-
], MessageInfo.prototype, "textAlign", void 0);
|
|
115
|
-
__decorate([
|
|
116
|
-
Prop()
|
|
117
|
-
], MessageInfo.prototype, "contactImage", void 0);
|
|
118
|
-
__decorate([
|
|
119
|
-
Prop()
|
|
120
|
-
], MessageInfo.prototype, "contactName", void 0);
|
|
121
|
-
__decorate([
|
|
122
|
-
Prop()
|
|
123
|
-
], MessageInfo.prototype, "contactEmail", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
Prop()
|
|
126
|
-
], MessageInfo.prototype, "isGroup", void 0);
|
|
127
|
-
__decorate([
|
|
128
|
-
Prop()
|
|
129
|
-
], MessageInfo.prototype, "messageDate", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
Prop()
|
|
132
|
-
], MessageInfo.prototype, "messagePreviewText", void 0);
|
|
133
|
-
__decorate([
|
|
134
|
-
Prop()
|
|
135
|
-
], MessageInfo.prototype, "messageDeliveryTime", void 0);
|
|
136
|
-
__decorate([
|
|
137
|
-
Prop()
|
|
138
|
-
], MessageInfo.prototype, "messageReadTime", void 0);
|
|
139
|
-
__decorate([
|
|
140
|
-
Prop()
|
|
141
|
-
], MessageInfo.prototype, "pendingReadCount", void 0);
|
|
142
|
-
__decorate([
|
|
143
|
-
Prop()
|
|
144
|
-
], MessageInfo.prototype, "pendingDeliveryCount", void 0);
|
|
145
|
-
__decorate([
|
|
146
|
-
Prop()
|
|
147
|
-
], MessageInfo.prototype, "renderAttachmentMessage", void 0);
|
|
148
|
-
__decorate([
|
|
149
|
-
Prop()
|
|
150
|
-
], MessageInfo.prototype, "selectedMessage", void 0);
|
|
151
|
-
__decorate([
|
|
152
|
-
Prop()
|
|
153
|
-
], MessageInfo.prototype, "onMediaClick", void 0);
|
|
154
|
-
__decorate([
|
|
155
|
-
Prop()
|
|
156
|
-
], MessageInfo.prototype, "closePopup", void 0);
|
|
157
|
-
__decorate([
|
|
158
|
-
Prop()
|
|
159
|
-
], MessageInfo.prototype, "allAttachments", void 0);
|
|
160
|
-
__decorate([
|
|
161
|
-
Prop()
|
|
162
|
-
], MessageInfo.prototype, "deliveryUserList", void 0);
|
|
163
|
-
__decorate([
|
|
164
|
-
Prop()
|
|
165
|
-
], MessageInfo.prototype, "readUserList", void 0);
|
|
166
|
-
MessageInfo = __decorate([
|
|
167
|
-
Component({
|
|
168
|
-
tag: 'message-info',
|
|
169
|
-
shadow: true,
|
|
170
|
-
styles: `
|
|
171
|
-
:host { display: block; height: 100%; }
|
|
172
|
-
.message-info-container {
|
|
173
|
-
display: flex; flex-direction: column; gap: 10px; box-sizing: border-box;
|
|
174
|
-
background-color: var(--bg-primary-color); height: 100%; padding: 12px; color: var(--text-primary-color);
|
|
175
|
-
}
|
|
176
|
-
.message-info-header { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
|
|
177
|
-
.close-btn { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 20px; color: inherit; }
|
|
178
|
-
.preview {
|
|
179
|
-
padding: 12px; border-radius: 8px; background: var(--bg-secondary-color); word-break: break-word;
|
|
180
|
-
}
|
|
181
|
-
.section { margin-top: 12px; }
|
|
182
|
-
.section h4 { margin: 0 0 8px; font-size: 14px; opacity: 0.8; }
|
|
183
|
-
.user-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
|
|
184
|
-
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--bg-primary-light); }
|
|
185
|
-
`,
|
|
186
|
-
})
|
|
187
|
-
], MessageInfo);
|
|
188
|
-
export { MessageInfo };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Component, Prop, State, h, Event } from '@stencil/core';
|
|
8
|
-
import { debounce } from '../../../lib/helpers';
|
|
9
|
-
import './spinner-loader';
|
|
10
|
-
let MessageSearch = class MessageSearch {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.searchedMessageDetails = [];
|
|
13
|
-
this.isSearchOpen = true;
|
|
14
|
-
this.isLoadingMessage = false;
|
|
15
|
-
this.searchValue = '';
|
|
16
|
-
this.debouncedSearch = debounce((query) => {
|
|
17
|
-
if (typeof this.onSearchInput === 'function')
|
|
18
|
-
this.onSearchInput(query);
|
|
19
|
-
if (typeof this.onSearchHandler === 'function')
|
|
20
|
-
this.onSearchHandler(query);
|
|
21
|
-
}, 500);
|
|
22
|
-
this.onInput = (e) => {
|
|
23
|
-
const value = (e.target.value || '').toLowerCase();
|
|
24
|
-
this.searchValue = value;
|
|
25
|
-
this.debouncedSearch(value);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
async handleResultClick(messageId) {
|
|
29
|
-
var _a;
|
|
30
|
-
if ((_a = this.chatBodyRef) === null || _a === void 0 ? void 0 : _a.scrollToMessage)
|
|
31
|
-
await this.chatBodyRef.scrollToMessage(messageId);
|
|
32
|
-
if (typeof this.onSearchResultClick === 'function')
|
|
33
|
-
this.onSearchResultClick(messageId);
|
|
34
|
-
this.closeRightSidebar.emit({ type: 'close-right-Sidebar' });
|
|
35
|
-
}
|
|
36
|
-
closeSearch() {
|
|
37
|
-
this.closeRightSidebar.emit({ type: 'close-right-Sidebar' });
|
|
38
|
-
}
|
|
39
|
-
formatDate(ts) {
|
|
40
|
-
if (!ts)
|
|
41
|
-
return '';
|
|
42
|
-
const d = new Date(ts);
|
|
43
|
-
return `${d.getMonth() + 1}/${d.getDate()}/${d.getFullYear()}`;
|
|
44
|
-
}
|
|
45
|
-
render() {
|
|
46
|
-
const results = this.searchedMessageDetails || [];
|
|
47
|
-
return (h("div", { class: "searchMessageContainer", onClick: e => e.stopPropagation() },
|
|
48
|
-
h("div", { class: "search-header" },
|
|
49
|
-
h("h3", null, "Search messages"),
|
|
50
|
-
h("button", { class: "close-search", type: "button", onClick: () => this.closeSearch() }, "\u2715")),
|
|
51
|
-
h("div", { class: "search-input-container" },
|
|
52
|
-
h("input", { class: "search-input", type: "text", placeholder: "Search", value: this.searchValue, onInput: this.onInput }),
|
|
53
|
-
this.searchValue ? (h("button", { class: "clear-button", type: "button", onClick: () => {
|
|
54
|
-
this.searchValue = '';
|
|
55
|
-
} }, "\u2715")) : null),
|
|
56
|
-
h("div", { class: "search-results" }, this.isLoadingMessage ? (h("div", { class: "search-results-placeholder" },
|
|
57
|
-
h("spinner-loader", { height: "15px", width: "15px" }))) : results.length === 0 ? (h("div", { class: "search-results-placeholder" }, this.searchValue ? 'No results found' : 'Search for messages')) : (results.map(message => (h("div", { class: "search-results-container", onClick: () => this.handleResultClick(message.messageId) },
|
|
58
|
-
h("span", { class: "date-label" }, this.formatDate(message.sentAt)),
|
|
59
|
-
h("span", null, message.body))))))));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
__decorate([
|
|
63
|
-
Prop()
|
|
64
|
-
], MessageSearch.prototype, "searchedMessageDetails", void 0);
|
|
65
|
-
__decorate([
|
|
66
|
-
Prop()
|
|
67
|
-
], MessageSearch.prototype, "onSearchResultClick", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
Prop()
|
|
70
|
-
], MessageSearch.prototype, "onSearchInput", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
Prop()
|
|
73
|
-
], MessageSearch.prototype, "isSearchOpen", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
Prop()
|
|
76
|
-
], MessageSearch.prototype, "isLoadingMessage", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
Prop()
|
|
79
|
-
], MessageSearch.prototype, "chatBodyRef", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
Prop()
|
|
82
|
-
], MessageSearch.prototype, "onSearchHandler", void 0);
|
|
83
|
-
__decorate([
|
|
84
|
-
State()
|
|
85
|
-
], MessageSearch.prototype, "searchValue", void 0);
|
|
86
|
-
__decorate([
|
|
87
|
-
Event({ eventName: 'close-right-Sidebar', bubbles: true, composed: true })
|
|
88
|
-
], MessageSearch.prototype, "closeRightSidebar", void 0);
|
|
89
|
-
MessageSearch = __decorate([
|
|
90
|
-
Component({
|
|
91
|
-
tag: 'message-search',
|
|
92
|
-
shadow: true,
|
|
93
|
-
styles: `
|
|
94
|
-
:host { display: block; height: 100%; }
|
|
95
|
-
.searchMessageContainer { background-color: var(--bg-primary-color); height: 100%; }
|
|
96
|
-
.search-header {
|
|
97
|
-
display: flex; justify-content: space-between; align-items: center;
|
|
98
|
-
padding: 16px; font-size: 18px;
|
|
99
|
-
}
|
|
100
|
-
.search-header h3 { margin: 0; color: var(--text-outgoing-message, var(--text-primary-color)); }
|
|
101
|
-
.close-search, .clear-button {
|
|
102
|
-
background: none; border: none; color: var(--text-outgoing-message, var(--text-primary-color));
|
|
103
|
-
cursor: pointer; font-size: 20px; padding: 5px;
|
|
104
|
-
}
|
|
105
|
-
.search-input-container { padding: 8px 16px; position: relative; display: flex; align-items: center; }
|
|
106
|
-
.search-input {
|
|
107
|
-
background-color: var(--bg-secondary-color); border-radius: 20px;
|
|
108
|
-
color: var(--text-outgoing-message, var(--text-primary-color));
|
|
109
|
-
border: none; padding: 8px 36px 8px 16px; width: 100%; height: 40px; font-size: 16px; outline: none;
|
|
110
|
-
}
|
|
111
|
-
.clear-button { position: absolute; right: 24px; }
|
|
112
|
-
.search-results { height: calc(100vh - 160px); overflow-y: auto; }
|
|
113
|
-
.search-results-container {
|
|
114
|
-
display: flex; flex-direction: column; padding: 12px 16px;
|
|
115
|
-
border-bottom: 1px solid var(--bg-secondary-color); cursor: pointer;
|
|
116
|
-
}
|
|
117
|
-
.search-results-placeholder {
|
|
118
|
-
display: flex; justify-content: center; align-items: center;
|
|
119
|
-
height: calc(100vh - 160px); color: var(--text-secondary-color);
|
|
120
|
-
}
|
|
121
|
-
.date-label { padding: 4px 0; color: var(--text-secondary-color); font-size: 14px; }
|
|
122
|
-
`,
|
|
123
|
-
})
|
|
124
|
-
], MessageSearch);
|
|
125
|
-
export { MessageSearch };
|