@mobilon-dev/chotto 0.3.84 → 0.3.85
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/chotto.css +1 -1
- package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +3 -2
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +3 -2
- package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.js +38 -0
- package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue2.js +4 -0
- package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +1 -1
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +49 -36
- package/dist/components/1_icons/CloseIcon.vue.js +21 -0
- package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +10 -9
- package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +8 -7
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +2 -2
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +48 -37
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +7 -6
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +27 -26
- package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +3 -2
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +3 -2
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +3 -2
- package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +6 -5
- package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +10 -9
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +3 -2
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +169 -143
- package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue2.js +33 -32
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +8 -2
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +134 -108
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +116 -97
- package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +3 -2
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +2 -2
- package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +232 -113
- package/dist/components/2_feed_elements/MessageReactions/composables/usePositioning.js +77 -62
- package/dist/components/2_feed_elements/MessageReactions/composables/useReactions.js +62 -20
- package/dist/components/2_feed_elements/MessageReactions/composables/useReactionsPanel.js +91 -69
- package/dist/components/2_feed_elements/MessageReactions/composables/useReactionsState.js +46 -22
- package/dist/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.js +21 -0
- package/dist/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.js +21 -0
- package/dist/components/2_feed_elements/MessageReactions/utils/quickReactions.js +2 -8
- package/dist/components/2_feed_elements/MessageReactions/utils/reactionTooltip.js +39 -0
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +26 -20
- package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue2.js +27 -18
- package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue2.js +16 -15
- package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue2.js +27 -18
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +16 -12
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +74 -65
- package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +20 -11
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +13 -9
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +74 -55
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +102 -76
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +2 -2
- package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +74 -55
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +99 -82
- package/dist/components/3_compounds/Feed/Feed.vue.js +3 -3
- package/dist/components/3_compounds/Feed/Feed.vue2.js +159 -139
- package/dist/components/3_compounds/Feed/composables/useFeedReply.js +22 -25
- package/dist/functions/renderAppleEmojis.js +92 -0
- package/dist/hooks/messages/buildReplyPayload.js +14 -0
- package/dist/hooks/messages/useMessageLinks.js +60 -50
- package/dist/hooks/messages/useStartReply.js +29 -0
- package/dist/hooks/useEmojiNative.js +19 -0
- package/dist/index.js +130 -122
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/apps/data/messages.d.ts +20 -18
- package/dist/types/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.d.ts +12 -0
- package/dist/types/components/1_atoms/Tooltip/stories/Tooltip.stories.d.ts +3 -0
- package/dist/types/components/1_icons/CloseIcon.vue.d.ts +2 -0
- package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +9 -1
- package/dist/types/components/2_feed_elements/AudioMessage/AudioMessage.vue.d.ts +29 -0
- package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +24 -16
- package/dist/types/components/2_feed_elements/BaseReplyMessage/styles/types.d.ts +8 -4
- package/dist/types/components/2_feed_elements/FileMessage/FileMessage.vue.d.ts +29 -0
- package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +20 -0
- package/dist/types/components/2_feed_elements/ImageMessage/ImageMessage.vue.d.ts +29 -0
- package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +2 -0
- package/dist/types/components/2_feed_elements/MessageReactions/MessageReactions.vue.d.ts +64 -1
- package/dist/types/components/2_feed_elements/MessageReactions/composables/index.d.ts +2 -2
- package/dist/types/components/2_feed_elements/MessageReactions/composables/usePositioning.d.ts +11 -1
- package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactions.d.ts +20 -12
- package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactionsPanel.d.ts +3 -3
- package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactionsState.d.ts +13 -22
- package/dist/types/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.d.ts +2 -0
- package/dist/types/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.d.ts +2 -0
- package/dist/types/components/2_feed_elements/MessageReactions/styles/types.d.ts +14 -74
- package/dist/types/components/2_feed_elements/MessageReactions/utils/quickReactions.d.ts +1 -1
- package/dist/types/components/2_feed_elements/MessageReactions/utils/reactionTooltip.d.ts +14 -0
- package/dist/types/components/2_feed_elements/ReplyAudioMessage/styles/types.d.ts +6 -0
- package/dist/types/components/2_feed_elements/ReplyCallMessage/styles/types.d.ts +6 -0
- package/dist/types/components/2_feed_elements/ReplyFileMessage/styles/types.d.ts +6 -0
- package/dist/types/components/2_feed_elements/ReplyImageMessage/styles/types.d.ts +6 -0
- package/dist/types/components/2_feed_elements/ReplyStickerMessage/styles/types.d.ts +6 -0
- package/dist/types/components/2_feed_elements/ReplyTextMessage/styles/types.d.ts +4 -0
- package/dist/types/components/2_feed_elements/ReplyVideoMessage/styles/types.d.ts +6 -0
- package/dist/types/components/2_feed_elements/StickerMessage/StickerMessage.vue.d.ts +29 -0
- package/dist/types/components/2_feed_elements/TextMessage/TextMessage.vue.d.ts +29 -0
- package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +22 -0
- package/dist/types/components/2_feed_elements/VideoMessage/VideoMessage.vue.d.ts +29 -0
- package/dist/types/components/2_feed_elements/types/messages.d.ts +11 -6
- package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
- package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +33 -0
- package/dist/types/functions/renderAppleEmojis.d.ts +16 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/messages/buildReplyPayload.d.ts +11 -0
- package/dist/types/hooks/messages/index.d.ts +2 -0
- package/dist/types/hooks/messages/useStartReply.d.ts +6 -0
- package/dist/types/hooks/useEmojiNative.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useFeedButton as
|
|
9
|
-
import { useFeedComponents as
|
|
10
|
-
import { useFeedGrouping as
|
|
11
|
-
import { useFeedKeyboard as
|
|
12
|
-
import { useFeedLoadMore as
|
|
13
|
-
import { useFeedMessageVisibility as
|
|
14
|
-
import { useFeedReply as
|
|
15
|
-
import { useFeedScroll as
|
|
16
|
-
import { useFeedScrollTo as
|
|
17
|
-
import { useStickyDate as
|
|
18
|
-
import { throttle as
|
|
19
|
-
import
|
|
20
|
-
const
|
|
1
|
+
import { defineComponent as be, ref as k, computed as i, provide as j, inject as K, unref as s, watch as ke, nextTick as x, onMounted as ve, createElementBlock as c, openBlock as r, createVNode as g, createBlock as f, createCommentVNode as u, normalizeStyle as L, renderSlot as U, withDirectives as he, createElementVNode as v, vShow as Se, Transition as h, withCtx as S, Fragment as Me, renderList as Ie, resolveDynamicComponent as Re, mergeProps as Be, toDisplayString as Te, Teleport as Ae } from "vue";
|
|
2
|
+
import Ce from "../../2_feed_elements/DateMessageSticky/DateMessageSticky.vue.js";
|
|
3
|
+
import Fe from "../../2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
4
|
+
import De from "../../2_feed_elements/MessageKeyboard/MessageKeyboard.vue.js";
|
|
5
|
+
import we from "../../2_feed_elements/FeedKeyboard/FeedKeyboard.vue.js";
|
|
6
|
+
import Oe from "../../2_feed_elements/TypingMessage/TypingMessage.vue.js";
|
|
7
|
+
import je from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
|
|
8
|
+
import { useFeedButton as Ke } from "./composables/useFeedButton.js";
|
|
9
|
+
import { useFeedComponents as xe } from "./composables/useFeedComponents.js";
|
|
10
|
+
import { useFeedGrouping as Le } from "./composables/useFeedGrouping.js";
|
|
11
|
+
import { useFeedKeyboard as Ue } from "./composables/useFeedKeyboard.js";
|
|
12
|
+
import { useFeedLoadMore as Ne } from "./composables/useFeedLoadMore.js";
|
|
13
|
+
import { useFeedMessageVisibility as Ve } from "./composables/useFeedMessageVisibility.js";
|
|
14
|
+
import { useFeedReply as $e } from "./composables/useFeedReply.js";
|
|
15
|
+
import { useFeedScroll as qe } from "./composables/useFeedScroll.js";
|
|
16
|
+
import { useFeedScrollTo as Pe } from "./composables/useFeedScrollTo.js";
|
|
17
|
+
import { useStickyDate as ze } from "./composables/useStickyDate.js";
|
|
18
|
+
import { throttle as Ee } from "./functions/throttle.js";
|
|
19
|
+
import We from "./assets/chat-background.svg.js";
|
|
20
|
+
const Ge = { class: "message-feed-wrapper" }, He = ["id"], Je = { class: "message-feed__loading" }, Qe = ["id", "data-timestamp", "onDblclick"], Xe = { style: { margin: "auto" } }, Ye = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "message-feed__unread-amount"
|
|
23
|
-
},
|
|
23
|
+
}, bt = /* @__PURE__ */ be({
|
|
24
24
|
__name: "Feed",
|
|
25
25
|
props: {
|
|
26
26
|
objects: {
|
|
@@ -80,6 +80,21 @@ const Ee = { class: "message-feed-wrapper" }, We = ["id"], Ne = { class: "messag
|
|
|
80
80
|
type: Boolean,
|
|
81
81
|
default: !0
|
|
82
82
|
},
|
|
83
|
+
reactionsMode: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: "single",
|
|
86
|
+
validator: (e) => ["single", "multi"].includes(e)
|
|
87
|
+
},
|
|
88
|
+
/** Id текущего пользователя — для расчёта «моих» реакций */
|
|
89
|
+
currentUserId: {
|
|
90
|
+
type: [String, Number],
|
|
91
|
+
default: void 0
|
|
92
|
+
},
|
|
93
|
+
/** userId → имя для тултипов реакций */
|
|
94
|
+
reactionUserNames: {
|
|
95
|
+
type: Object,
|
|
96
|
+
default: void 0
|
|
97
|
+
},
|
|
83
98
|
subtextTooltipData: {
|
|
84
99
|
type: Object,
|
|
85
100
|
required: !1,
|
|
@@ -107,93 +122,95 @@ const Ee = { class: "message-feed-wrapper" }, We = ["id"], Ne = { class: "messag
|
|
|
107
122
|
"smsInvite",
|
|
108
123
|
"delimiterRead"
|
|
109
124
|
],
|
|
110
|
-
setup(e, { emit:
|
|
111
|
-
const a = e, b = k(),
|
|
112
|
-
isShowButton:
|
|
113
|
-
isKeyboardPlace:
|
|
114
|
-
checkButtonVisibility:
|
|
115
|
-
} =
|
|
116
|
-
feedRef:
|
|
117
|
-
keyboardRef:
|
|
118
|
-
}), { componentsMap:
|
|
125
|
+
setup(e, { emit: N }) {
|
|
126
|
+
const a = e, b = k(), l = k(), M = k(), {
|
|
127
|
+
isShowButton: V,
|
|
128
|
+
isKeyboardPlace: $,
|
|
129
|
+
checkButtonVisibility: q
|
|
130
|
+
} = Ke({
|
|
131
|
+
feedRef: l,
|
|
132
|
+
keyboardRef: M
|
|
133
|
+
}), { componentsMap: P } = xe(), z = i(() => a.reactionsEnabled), E = i(() => a.reactionsMode), I = i(() => a.currentUserId), R = i(() => a.reactionUserNames);
|
|
134
|
+
j("currentUserId", I), j("reactionUserNames", R);
|
|
135
|
+
const { groupedObjects: W } = Le({
|
|
119
136
|
objects: i(() => a.objects)
|
|
120
|
-
}), y =
|
|
121
|
-
if (
|
|
122
|
-
return s(
|
|
137
|
+
}), y = K("chatAppId"), B = K("selectedChat", void 0), T = i(() => {
|
|
138
|
+
if (B)
|
|
139
|
+
return s(B);
|
|
123
140
|
});
|
|
124
|
-
function
|
|
141
|
+
function G(o) {
|
|
125
142
|
return o.timestamp;
|
|
126
143
|
}
|
|
127
|
-
function
|
|
144
|
+
function H(o) {
|
|
128
145
|
var m;
|
|
129
146
|
const n = o;
|
|
130
|
-
if (!n.dialogId || !((m =
|
|
147
|
+
if (!n.dialogId || !((m = T.value) != null && m.dialogs))
|
|
131
148
|
return;
|
|
132
|
-
const t =
|
|
149
|
+
const t = T.value.dialogs.find((p) => p.dialogId === n.dialogId);
|
|
133
150
|
return t == null ? void 0 : t.channelId;
|
|
134
151
|
}
|
|
135
|
-
function
|
|
152
|
+
function J(o) {
|
|
136
153
|
return o.type === "message.call" && typeof a.callMessageOnCallback == "function" ? { onCall: a.callMessageOnCallback } : {};
|
|
137
154
|
}
|
|
138
|
-
const d =
|
|
139
|
-
checkScrollPosition:
|
|
140
|
-
startScrollWatch:
|
|
141
|
-
stopScrollWatch:
|
|
142
|
-
resetAllowFlags:
|
|
143
|
-
} =
|
|
144
|
-
feedRef:
|
|
155
|
+
const d = N, {
|
|
156
|
+
checkScrollPosition: Q,
|
|
157
|
+
startScrollWatch: A,
|
|
158
|
+
stopScrollWatch: C,
|
|
159
|
+
resetAllowFlags: X
|
|
160
|
+
} = Ne({
|
|
161
|
+
feedRef: l,
|
|
145
162
|
emit: d,
|
|
146
163
|
isLoadingMoreRef: i(() => a.isLoadingMore)
|
|
147
164
|
}), {
|
|
148
|
-
getMessage:
|
|
149
|
-
messageAction:
|
|
150
|
-
handleClickReplied:
|
|
151
|
-
feedObjectDoubleClick:
|
|
152
|
-
handleResetReply:
|
|
153
|
-
} =
|
|
165
|
+
getMessage: F,
|
|
166
|
+
messageAction: Y,
|
|
167
|
+
handleClickReplied: Z,
|
|
168
|
+
feedObjectDoubleClick: _,
|
|
169
|
+
handleResetReply: ee
|
|
170
|
+
} = $e({
|
|
154
171
|
enableDoubleClickReply: a.enableDoubleClickReply,
|
|
155
172
|
emit: d
|
|
156
173
|
});
|
|
157
|
-
function
|
|
174
|
+
function te(o) {
|
|
158
175
|
d("smsInvite", o);
|
|
159
176
|
}
|
|
160
|
-
function
|
|
177
|
+
function oe(o) {
|
|
161
178
|
d("delimiterRead", o);
|
|
162
179
|
}
|
|
163
180
|
const {
|
|
164
|
-
showKeyboard:
|
|
165
|
-
keyboardAction:
|
|
166
|
-
feedKeyboardAction:
|
|
167
|
-
} =
|
|
168
|
-
isKeyboardPlace:
|
|
181
|
+
showKeyboard: se,
|
|
182
|
+
keyboardAction: ae,
|
|
183
|
+
feedKeyboardAction: ne
|
|
184
|
+
} = Ue({
|
|
185
|
+
isKeyboardPlace: $,
|
|
169
186
|
objects: i(() => a.objects),
|
|
170
187
|
emit: d
|
|
171
188
|
}), {
|
|
172
|
-
showStickyDate:
|
|
173
|
-
stickyDateText:
|
|
174
|
-
show:
|
|
175
|
-
} =
|
|
176
|
-
feedRef:
|
|
189
|
+
showStickyDate: re,
|
|
190
|
+
stickyDateText: ie,
|
|
191
|
+
show: le
|
|
192
|
+
} = ze({
|
|
193
|
+
feedRef: l,
|
|
177
194
|
trackingObjects: b
|
|
178
195
|
}), {
|
|
179
|
-
isInitialized:
|
|
180
|
-
performScrollToBottom:
|
|
181
|
-
ensureScrollToBottom:
|
|
182
|
-
initializeScroll:
|
|
183
|
-
smoothScrollToBottom:
|
|
184
|
-
} =
|
|
185
|
-
feedRef:
|
|
196
|
+
isInitialized: de,
|
|
197
|
+
performScrollToBottom: ce,
|
|
198
|
+
ensureScrollToBottom: D,
|
|
199
|
+
initializeScroll: ue,
|
|
200
|
+
smoothScrollToBottom: me
|
|
201
|
+
} = qe({
|
|
202
|
+
feedRef: l,
|
|
186
203
|
objectsRef: i(() => a.objects),
|
|
187
204
|
scrollToBottomRef: i(() => a.scrollToBottom)
|
|
188
|
-
}),
|
|
189
|
-
function
|
|
190
|
-
|
|
205
|
+
}), w = i(() => a.chatBackground ?? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(We)}`);
|
|
206
|
+
function O(o = !0) {
|
|
207
|
+
q(), Q(o), le();
|
|
191
208
|
}
|
|
192
|
-
const
|
|
193
|
-
function
|
|
194
|
-
d("forceScrollToBottom"),
|
|
209
|
+
const fe = Ee(() => O(), 250);
|
|
210
|
+
function ge() {
|
|
211
|
+
d("forceScrollToBottom"), me();
|
|
195
212
|
}
|
|
196
|
-
function
|
|
213
|
+
function ye(o) {
|
|
197
214
|
const n = a.objects;
|
|
198
215
|
if (o.startsWith("mid-")) {
|
|
199
216
|
const t = parseInt(o.slice(4), 10);
|
|
@@ -201,158 +218,161 @@ const Ee = { class: "message-feed-wrapper" }, We = ["id"], Ne = { class: "messag
|
|
|
201
218
|
}
|
|
202
219
|
return n.find((t) => t.messageId === o);
|
|
203
220
|
}
|
|
204
|
-
const { restartObserving:
|
|
221
|
+
const { restartObserving: pe } = Ve({
|
|
205
222
|
trackingObjects: b,
|
|
206
223
|
chatAppId: y,
|
|
207
|
-
getMessageById:
|
|
224
|
+
getMessageById: ye,
|
|
208
225
|
onMessageVisible: (o) => d("messageVisible", o)
|
|
209
226
|
});
|
|
210
|
-
return
|
|
227
|
+
return ke(
|
|
211
228
|
() => a.objects,
|
|
212
229
|
() => {
|
|
213
|
-
|
|
230
|
+
x(() => {
|
|
214
231
|
requestAnimationFrame(() => {
|
|
215
|
-
|
|
232
|
+
X(), O(!1), b.value = document.querySelectorAll(".tracking-message"), pe();
|
|
216
233
|
});
|
|
217
234
|
});
|
|
218
235
|
},
|
|
219
236
|
{ immediate: !0 }
|
|
220
|
-
),
|
|
237
|
+
), Pe({
|
|
221
238
|
targetIdRef: i(() => a.scrollTo),
|
|
222
239
|
feedContainerId: `feed-container-${y}`
|
|
223
|
-
}),
|
|
224
|
-
|
|
225
|
-
a.objects.length > 0 && !
|
|
240
|
+
}), ve(() => {
|
|
241
|
+
x(() => {
|
|
242
|
+
a.objects.length > 0 && !de.value && ue();
|
|
226
243
|
const o = new ResizeObserver(() => {
|
|
227
|
-
a.scrollToBottom && (
|
|
228
|
-
|
|
244
|
+
a.scrollToBottom && (ce(), setTimeout(() => {
|
|
245
|
+
D();
|
|
229
246
|
}, 200), setTimeout(() => {
|
|
230
|
-
|
|
247
|
+
D();
|
|
231
248
|
}, 800));
|
|
232
249
|
});
|
|
233
|
-
|
|
250
|
+
l.value && o.observe(l.value);
|
|
234
251
|
});
|
|
235
|
-
}), (o, n) => (
|
|
236
|
-
e.objects.length > 0 || e.typing ? (
|
|
252
|
+
}), (o, n) => (r(), c("div", Ge, [
|
|
253
|
+
e.objects.length > 0 || e.typing ? (r(), c("div", {
|
|
237
254
|
key: 0,
|
|
238
255
|
id: "feed-container-" + s(y),
|
|
239
256
|
ref_key: "refFeed",
|
|
240
|
-
ref:
|
|
257
|
+
ref: l,
|
|
241
258
|
class: "message-feed",
|
|
242
|
-
style:
|
|
243
|
-
onScroll: n[0] || (n[0] = (t) => s(
|
|
259
|
+
style: L({ backgroundImage: `url(${w.value})` }),
|
|
260
|
+
onScroll: n[0] || (n[0] = (t) => s(fe)()),
|
|
244
261
|
onMousedown: n[1] || (n[1] = //@ts-ignore
|
|
245
|
-
(...t) => s(
|
|
262
|
+
(...t) => s(A) && s(A)(...t)),
|
|
246
263
|
onMouseup: n[2] || (n[2] = //@ts-ignore
|
|
247
|
-
(...t) => s(
|
|
264
|
+
(...t) => s(C) && s(C)(...t))
|
|
248
265
|
}, [
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
g(
|
|
266
|
+
U(o.$slots, "prepend", {}, void 0, !0),
|
|
267
|
+
he(v("div", Je, [
|
|
268
|
+
g(je, {
|
|
252
269
|
"is-loading": e.isLoadingMore,
|
|
253
270
|
size: "small",
|
|
254
271
|
position: "top"
|
|
255
272
|
}, null, 8, ["is-loading"])
|
|
256
273
|
], 512), [
|
|
257
|
-
[
|
|
274
|
+
[Se, e.isLoadingMore]
|
|
258
275
|
]),
|
|
259
|
-
g(
|
|
276
|
+
g(h, null, {
|
|
260
277
|
default: S(() => [
|
|
261
|
-
s(
|
|
278
|
+
s(re) && !e.isLoadingMore ? (r(), f(Ce, {
|
|
262
279
|
key: 0,
|
|
263
280
|
class: "message-feed__sticky-date",
|
|
264
|
-
text: s(
|
|
281
|
+
text: s(ie)
|
|
265
282
|
}, null, 8, ["text"])) : u("", !0)
|
|
266
283
|
]),
|
|
267
284
|
_: 1
|
|
268
285
|
}),
|
|
269
|
-
(
|
|
286
|
+
(r(!0), c(Me, null, Ie(s(W), (t, m) => (r(), c("div", {
|
|
270
287
|
id: "msg-" + (t.messageId ?? "mid-" + m),
|
|
271
288
|
key: t.messageId ?? "mid-" + m,
|
|
272
|
-
"data-timestamp":
|
|
289
|
+
"data-timestamp": G(t),
|
|
273
290
|
class: "tracking-message",
|
|
274
|
-
onDblclick: (p) => s(
|
|
291
|
+
onDblclick: (p) => s(_)(p, t)
|
|
275
292
|
}, [
|
|
276
|
-
(
|
|
293
|
+
(r(), f(Re(s(P)(t.type)), Be({
|
|
277
294
|
key: t.messageId ?? "mid-" + m,
|
|
278
295
|
class: "message-feed__message",
|
|
279
296
|
message: t,
|
|
280
297
|
"apply-style": e.applyStyle,
|
|
281
298
|
"is-first-in-series": t.isFirstInSeries,
|
|
282
|
-
"reactions-enabled":
|
|
299
|
+
"reactions-enabled": z.value,
|
|
300
|
+
"reactions-mode": E.value,
|
|
301
|
+
"current-user-id": I.value,
|
|
302
|
+
"reaction-user-names": R.value,
|
|
283
303
|
"subtext-tooltip-data": e.subtextTooltipData,
|
|
284
|
-
channel:
|
|
285
|
-
}, { ref_for: !0 },
|
|
286
|
-
onAction: s(
|
|
287
|
-
onReply: s(
|
|
288
|
-
onSmsInvite: (p) =>
|
|
289
|
-
onRead:
|
|
290
|
-
}), null, 16, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "subtext-tooltip-data", "channel", "onAction", "onReply", "onSmsInvite"]))
|
|
291
|
-
], 40,
|
|
292
|
-
e.typing ? (
|
|
304
|
+
channel: H(t)
|
|
305
|
+
}, { ref_for: !0 }, J(t), {
|
|
306
|
+
onAction: s(Y),
|
|
307
|
+
onReply: s(Z),
|
|
308
|
+
onSmsInvite: (p) => te(t),
|
|
309
|
+
onRead: oe
|
|
310
|
+
}), null, 16, ["message", "apply-style", "is-first-in-series", "reactions-enabled", "reactions-mode", "current-user-id", "reaction-user-names", "subtext-tooltip-data", "channel", "onAction", "onReply", "onSmsInvite"]))
|
|
311
|
+
], 40, Qe))), 128)),
|
|
312
|
+
e.typing ? (r(), f(Oe, {
|
|
293
313
|
key: 0,
|
|
294
314
|
message: {
|
|
295
315
|
subText: e.typing.title,
|
|
296
316
|
avatar: e.typing.avatar
|
|
297
317
|
}
|
|
298
318
|
}, null, 8, ["message"])) : u("", !0),
|
|
299
|
-
g(
|
|
319
|
+
g(h, null, {
|
|
300
320
|
default: S(() => [
|
|
301
|
-
s(
|
|
321
|
+
s(se) ? (r(), f(De, {
|
|
302
322
|
key: 0,
|
|
303
323
|
ref_key: "keyboardRef",
|
|
304
|
-
ref:
|
|
324
|
+
ref: M,
|
|
305
325
|
class: "message-feed__keyboard",
|
|
306
326
|
keyboard: e.objects[e.objects.length - 1].keyboard,
|
|
307
327
|
align: e.keyboardAlign,
|
|
308
|
-
onAction: s(
|
|
328
|
+
onAction: s(ae)
|
|
309
329
|
}, null, 8, ["keyboard", "align", "onAction"])) : u("", !0)
|
|
310
330
|
]),
|
|
311
331
|
_: 1
|
|
312
332
|
}),
|
|
313
|
-
e.feedKeyboards && e.feedKeyboards.length > 0 ? (
|
|
333
|
+
e.feedKeyboards && e.feedKeyboards.length > 0 ? (r(), f(we, {
|
|
314
334
|
key: 1,
|
|
315
335
|
buttons: e.feedKeyboards,
|
|
316
336
|
align: e.feedKeyboardAlign,
|
|
317
|
-
onAction: s(
|
|
337
|
+
onAction: s(ne)
|
|
318
338
|
}, null, 8, ["buttons", "align", "onAction"])) : u("", !0)
|
|
319
|
-
], 44,
|
|
339
|
+
], 44, He)) : (r(), c("div", {
|
|
320
340
|
key: 1,
|
|
321
341
|
ref_key: "refFeed",
|
|
322
|
-
ref:
|
|
342
|
+
ref: l,
|
|
323
343
|
class: "message-feed",
|
|
324
|
-
style:
|
|
344
|
+
style: L({ backgroundImage: `url(${w.value})` })
|
|
325
345
|
}, [
|
|
326
|
-
|
|
327
|
-
|
|
346
|
+
v("div", Xe, [
|
|
347
|
+
U(o.$slots, "empty-feed", {}, void 0, !0)
|
|
328
348
|
])
|
|
329
349
|
], 4)),
|
|
330
|
-
g(
|
|
350
|
+
g(h, null, {
|
|
331
351
|
default: S(() => [
|
|
332
|
-
s(
|
|
352
|
+
s(V) ? (r(), c("button", {
|
|
333
353
|
key: 0,
|
|
334
354
|
class: "message-feed__button-down",
|
|
335
|
-
onClick:
|
|
355
|
+
onClick: ge
|
|
336
356
|
}, [
|
|
337
|
-
e.buttonParams ? (
|
|
338
|
-
n[3] || (n[3] =
|
|
357
|
+
e.buttonParams ? (r(), c("div", Ye, Te(e.buttonParams.unreadAmount), 1)) : u("", !0),
|
|
358
|
+
n[3] || (n[3] = v("span", { class: "pi pi-angle-down message-feed__icon-down" }, null, -1))
|
|
339
359
|
])) : u("", !0)
|
|
340
360
|
]),
|
|
341
361
|
_: 1
|
|
342
362
|
}),
|
|
343
|
-
s(
|
|
363
|
+
s(F)().reply ? (r(), f(Ae, {
|
|
344
364
|
key: 2,
|
|
345
365
|
to: "#chat-input-reply-line-" + s(y)
|
|
346
366
|
}, [
|
|
347
|
-
g(
|
|
367
|
+
g(Fe, {
|
|
348
368
|
class: "chat-input-reply",
|
|
349
|
-
message: s(
|
|
350
|
-
onReset: s(
|
|
369
|
+
message: s(F)().reply,
|
|
370
|
+
onReset: s(ee)
|
|
351
371
|
}, null, 8, ["message", "onReset"])
|
|
352
372
|
], 8, ["to"])) : u("", !0)
|
|
353
373
|
]));
|
|
354
374
|
}
|
|
355
375
|
});
|
|
356
376
|
export {
|
|
357
|
-
|
|
377
|
+
bt as default
|
|
358
378
|
};
|
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { useMessageDraft as
|
|
1
|
+
import { inject as n } from "vue";
|
|
2
|
+
import { useMessageDraft as o } from "../../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../../hooks/useSearchModel.js";
|
|
4
4
|
import "../../../../hooks/useTheme.js";
|
|
5
|
+
import "../../../../hooks/useEmojiNative.js";
|
|
5
6
|
/* empty css */
|
|
6
7
|
/* empty css */
|
|
7
8
|
import "../../../../node_modules/linkifyjs/dist/linkify.js";
|
|
8
9
|
import "../../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
9
10
|
import "../../../../functions/parseMarkdown.js";
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
import { useStartReply as m, hideReplyPreview as d } from "../../../../hooks/messages/useStartReply.js";
|
|
12
|
+
function w({ enableDoubleClickReply: s, emit: p }) {
|
|
13
|
+
const i = n("chatAppId"), { getMessage: r, resetReply: l } = o(i), { startReply: a } = m(i);
|
|
12
14
|
return {
|
|
13
15
|
getMessage: r,
|
|
14
|
-
messageAction: (
|
|
15
|
-
|
|
16
|
+
messageAction: (t) => {
|
|
17
|
+
p("messageAction", t);
|
|
16
18
|
},
|
|
17
|
-
handleClickReplied: (
|
|
18
|
-
|
|
19
|
+
handleClickReplied: (t) => {
|
|
20
|
+
p("clickRepliedMessage", t);
|
|
19
21
|
},
|
|
20
|
-
feedObjectDoubleClick: (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
callDuration: t.callDuration
|
|
31
|
-
});
|
|
32
|
-
}
|
|
22
|
+
feedObjectDoubleClick: (t, e) => {
|
|
23
|
+
s && (t == null || t.preventDefault(), e.type.indexOf("system") === -1 && e.type.indexOf("typing") === -1 && a({
|
|
24
|
+
messageId: e.messageId,
|
|
25
|
+
type: e.type,
|
|
26
|
+
text: e.text,
|
|
27
|
+
filename: e.filename,
|
|
28
|
+
url: e.url,
|
|
29
|
+
header: e.header,
|
|
30
|
+
callDuration: e.callDuration
|
|
31
|
+
}));
|
|
33
32
|
},
|
|
34
33
|
handleResetReply: () => {
|
|
35
|
-
|
|
36
|
-
const e = document.getElementById("chat-input-reply-line-" + i);
|
|
37
|
-
e && (e.style.display = "none");
|
|
34
|
+
l(), d(i);
|
|
38
35
|
}
|
|
39
36
|
};
|
|
40
37
|
}
|
|
41
38
|
export {
|
|
42
|
-
|
|
39
|
+
w as useFeedReply
|
|
43
40
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const f = "https://cdn.jsdelivr.net/npm/emoji-datasource-apple@6.0.1/img/apple/64", p = new RegExp("(?:\\p{Regional_Indicator}{2})|(?:[#*0-9]\\uFE0F?\\u20E3)|(?:\\p{Extended_Pictographic}(?:\\uFE0F|\\uFE0E)?(?:\\u200D(?:\\p{Extended_Pictographic}|\\p{Emoji_Modifier_Base})(?:\\uFE0F|\\uFE0E)?)*)", "gu"), g = "height:1.2em;width:1.2em;margin:0 0.05em;vertical-align:-0.2em;display:inline";
|
|
2
|
+
function u(e, t) {
|
|
3
|
+
const n = [];
|
|
4
|
+
for (const c of e) {
|
|
5
|
+
const a = c.codePointAt(0);
|
|
6
|
+
a !== void 0 && (t != null && t.stripVariationSelectors && (a === 65039 || a === 65038) || n.push(a.toString(16)));
|
|
7
|
+
}
|
|
8
|
+
return n.join("-");
|
|
9
|
+
}
|
|
10
|
+
function F(e) {
|
|
11
|
+
return `${f}/${u(e)}.png`;
|
|
12
|
+
}
|
|
13
|
+
function h(e) {
|
|
14
|
+
const t = u(e), n = u(e, { stripVariationSelectors: !0 });
|
|
15
|
+
if (t !== n)
|
|
16
|
+
return `${f}/${n}.png`;
|
|
17
|
+
if (!/[\uFE0E\uFE0F]/.test(e)) {
|
|
18
|
+
const c = u(`${e}️`);
|
|
19
|
+
if (c !== t)
|
|
20
|
+
return `${f}/${c}.png`;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
function T(e, t) {
|
|
25
|
+
const n = h(t);
|
|
26
|
+
n && e.addEventListener(
|
|
27
|
+
"error",
|
|
28
|
+
() => {
|
|
29
|
+
e.src !== n && (e.src = n);
|
|
30
|
+
},
|
|
31
|
+
{ once: !0 }
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function x(e) {
|
|
35
|
+
const t = u(e);
|
|
36
|
+
if (!t) return e;
|
|
37
|
+
const n = `${f}/${t}.png`, c = h(e), a = c ? ` data-fallback="${E(c)}" onerror="if(this.dataset.fallback&&this.src!==this.dataset.fallback){this.onerror=null;this.src=this.dataset.fallback}"` : "";
|
|
38
|
+
return `<img class="chotto-emoji" src="${E(n)}" alt="${E(e)}" draggable="false" style="${g}"${a} />`;
|
|
39
|
+
}
|
|
40
|
+
function E(e) {
|
|
41
|
+
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
42
|
+
}
|
|
43
|
+
function N(e) {
|
|
44
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
45
|
+
}
|
|
46
|
+
function I(e) {
|
|
47
|
+
return e ? N(e).replace(p, (n) => x(n)) : "";
|
|
48
|
+
}
|
|
49
|
+
function $(e) {
|
|
50
|
+
var m;
|
|
51
|
+
if (!e || typeof document > "u") return e;
|
|
52
|
+
const t = document.createElement("div");
|
|
53
|
+
t.innerHTML = e;
|
|
54
|
+
const n = document.createTreeWalker(t, NodeFilter.SHOW_TEXT, {
|
|
55
|
+
acceptNode: (s) => {
|
|
56
|
+
let r = s.parentNode;
|
|
57
|
+
for (; r && r !== t; ) {
|
|
58
|
+
const o = r.nodeName;
|
|
59
|
+
if (o === "SCRIPT" || o === "STYLE" || o === "TEXTAREA")
|
|
60
|
+
return NodeFilter.FILTER_REJECT;
|
|
61
|
+
r = r.parentNode;
|
|
62
|
+
}
|
|
63
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
64
|
+
}
|
|
65
|
+
}), c = [];
|
|
66
|
+
let a;
|
|
67
|
+
for (; a = n.nextNode(); )
|
|
68
|
+
c.push(a);
|
|
69
|
+
for (const s of c.reverse()) {
|
|
70
|
+
const r = s.textContent || "";
|
|
71
|
+
if (p.lastIndex = 0, !p.test(r)) continue;
|
|
72
|
+
p.lastIndex = 0;
|
|
73
|
+
const o = document.createDocumentFragment();
|
|
74
|
+
let d = 0, i;
|
|
75
|
+
for (; i = p.exec(r); ) {
|
|
76
|
+
i.index > d && o.appendChild(document.createTextNode(r.slice(d, i.index)));
|
|
77
|
+
const l = document.createElement("img");
|
|
78
|
+
l.className = "chotto-emoji", l.src = F(i[0]), l.alt = i[0], l.draggable = !1, l.setAttribute("style", g), T(l, i[0]), o.appendChild(l), d = i.index + i[0].length;
|
|
79
|
+
}
|
|
80
|
+
d < r.length && o.appendChild(document.createTextNode(r.slice(d))), (m = s.parentNode) == null || m.replaceChild(o, s);
|
|
81
|
+
}
|
|
82
|
+
return t.innerHTML;
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
f as APPLE_EMOJI_CDN,
|
|
86
|
+
x as createAppleEmojiImgHtml,
|
|
87
|
+
u as emojiToAppleCode,
|
|
88
|
+
h as getAppleEmojiFallbackUrl,
|
|
89
|
+
F as getAppleEmojiUrl,
|
|
90
|
+
$ as replaceEmojisInHtml,
|
|
91
|
+
I as textToAppleEmojiHtml
|
|
92
|
+
};
|