@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,11 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Ee, inject as M, ref as b, computed as a, unref as s, onMounted as Ce, onUnmounted as _e, watch as Ne, createElementBlock as d, openBlock as l, normalizeClass as w, createBlock as K, Fragment as Q, renderList as A, withCtx as E, createElementVNode as f, createCommentVNode as F, createVNode as c, toDisplayString as Se, Teleport as Ue, Transition as D, withDirectives as V, normalizeStyle as $, withModifiers as C, vShow as z } from "vue";
|
|
2
|
+
import je from "../../../node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
4
|
+
import "../../../hooks/useMessageDraft.js";
|
|
5
|
+
import "../../../hooks/useSearchModel.js";
|
|
6
|
+
import "../../../hooks/useTheme.js";
|
|
7
|
+
import { useEmojiNative as Pe } from "../../../hooks/useEmojiNative.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
/* empty css */
|
|
10
|
+
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
11
|
+
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
12
|
+
import "../../../functions/parseMarkdown.js";
|
|
13
|
+
import { useStartReply as Le } from "../../../hooks/messages/useStartReply.js";
|
|
14
|
+
import J from "../../1_atoms/EmojiGlyph/EmojiGlyph.vue.js";
|
|
15
|
+
import xe from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
16
|
+
import qe from "./icons/ExpandReactionsIcon.vue.js";
|
|
17
|
+
import Te from "./icons/ReplyIcon.vue.js";
|
|
18
|
+
import { QUICK_REACTION_EMOJIS as Be } from "./utils/quickReactions.js";
|
|
19
|
+
import { buildReactionTooltipText as Oe } from "./utils/reactionTooltip.js";
|
|
20
|
+
import { isRightMessage as we, findMessageContent as Ke } from "./composables/usePositioning.js";
|
|
21
|
+
import { useReactionsState as Qe } from "./composables/useReactionsState.js";
|
|
22
|
+
import { useReactionsPanel as Ae } from "./composables/useReactionsPanel.js";
|
|
23
|
+
const Fe = ["onClick"], De = { class: "message-reactions__emoji" }, Ve = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "message-reactions__count"
|
|
26
|
+
}, $e = ["title", "onClick"], pt = /* @__PURE__ */ Ee({
|
|
9
27
|
__name: "MessageReactions",
|
|
10
28
|
props: {
|
|
11
29
|
reactions: {
|
|
@@ -24,138 +42,239 @@ const ve = ["title", "onClick"], Re = { class: "message-reactions__emoji" }, be
|
|
|
24
42
|
enabled: {
|
|
25
43
|
type: Boolean,
|
|
26
44
|
default: !0
|
|
45
|
+
},
|
|
46
|
+
mode: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: "single",
|
|
49
|
+
validator: (i) => ["single", "multi"].includes(i)
|
|
50
|
+
},
|
|
51
|
+
/** Id текущего пользователя — для расчёта reactedByMe и локальных add/remove */
|
|
52
|
+
currentUserId: {
|
|
53
|
+
type: [String, Number],
|
|
54
|
+
default: void 0
|
|
55
|
+
},
|
|
56
|
+
/** Имя текущего пользователя — для тултипа при локальном добавлении реакции */
|
|
57
|
+
currentUserName: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: void 0
|
|
60
|
+
},
|
|
61
|
+
/** userId → имя (если в item нет name) */
|
|
62
|
+
reactionUserNames: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default: void 0
|
|
65
|
+
},
|
|
66
|
+
reply: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: void 0
|
|
69
|
+
},
|
|
70
|
+
replyEnabled: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: !0
|
|
27
73
|
}
|
|
28
74
|
},
|
|
29
75
|
emits: ["toggle-reaction", "add-reaction", "remove-reaction"],
|
|
30
|
-
setup(i, { emit:
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
76
|
+
setup(i, { emit: G }) {
|
|
77
|
+
const n = i, r = G, p = M("chatAppId"), H = M("currentUserId", void 0), W = M("reactionUserNames", void 0), { startReply: X } = Le(p || ""), u = b(null), m = b(null), _ = b("light"), { isNative: Y } = Pe(p || ""), N = a(() => Be), Z = a(() => n.mode), y = a(() => n.currentUserId ?? s(H)), S = a(() => n.reactionUserNames ?? s(W)), ee = a(() => {
|
|
78
|
+
var t, g;
|
|
79
|
+
const e = (t = n.currentUserName) == null ? void 0 : t.trim();
|
|
80
|
+
if (e) return e;
|
|
81
|
+
const o = y.value;
|
|
82
|
+
if (o != null)
|
|
83
|
+
return (g = S.value) == null ? void 0 : g[String(o)];
|
|
84
|
+
}), te = a(() => n.mode === "multi"), U = Qe(
|
|
85
|
+
a(() => n.reactions),
|
|
86
|
+
Z,
|
|
87
|
+
y,
|
|
88
|
+
ee
|
|
89
|
+
), { displayedReactions: ne, hasReactions: oe, addReaction: k, removeReaction: j, toggleReaction: se, isMyReaction: P } = U;
|
|
90
|
+
function ie(e) {
|
|
91
|
+
return Oe(e.events, S.value);
|
|
92
|
+
}
|
|
93
|
+
const re = Ae(N, u), {
|
|
94
|
+
isQuickReactionsOpen: ae,
|
|
95
|
+
isFullPickerOpen: le,
|
|
96
|
+
pickerRef: ce,
|
|
97
|
+
quickReactionsRef: ue,
|
|
98
|
+
quickPanelStyle: de,
|
|
99
|
+
pickerStyle: me,
|
|
100
|
+
closeQuickPanel: v,
|
|
101
|
+
handleMessageMouseEnter: fe,
|
|
102
|
+
handleMessageMouseLeave: pe,
|
|
103
|
+
openFullPicker: ve,
|
|
104
|
+
closeFullPicker: L,
|
|
105
|
+
handleQuickPanelMouseEnter: x,
|
|
106
|
+
handleQuickPanelMouseLeave: q,
|
|
107
|
+
handlePickerMouseEnter: T,
|
|
108
|
+
handlePickerMouseLeave: B,
|
|
109
|
+
handleClickOutside: O
|
|
110
|
+
} = re, ge = a(() => u.value ? we(u.value) : !1), ye = () => {
|
|
111
|
+
var o;
|
|
49
112
|
if (!p) return "light";
|
|
50
|
-
const
|
|
51
|
-
return (
|
|
113
|
+
const e = document.getElementById(p);
|
|
114
|
+
return (o = e == null ? void 0 : e.getAttribute("data-theme")) != null && o.includes("dark") ? "dark" : "light";
|
|
52
115
|
};
|
|
53
|
-
function
|
|
54
|
-
|
|
116
|
+
function I() {
|
|
117
|
+
return !n.readonly && n.enabled && y.value != null;
|
|
118
|
+
}
|
|
119
|
+
function ke(e) {
|
|
120
|
+
if (I()) {
|
|
121
|
+
if (n.mode === "single") {
|
|
122
|
+
if (U.myReactionKey.value === e)
|
|
123
|
+
j(e), r("remove-reaction", { messageId: n.messageId, key: e });
|
|
124
|
+
else {
|
|
125
|
+
const t = k(e);
|
|
126
|
+
t && r("remove-reaction", { messageId: n.messageId, key: t }), r("add-reaction", { messageId: n.messageId, key: e });
|
|
127
|
+
}
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
se(e), r("toggle-reaction", { messageId: n.messageId, key: e });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function Ie(e) {
|
|
134
|
+
var o, t;
|
|
135
|
+
return e instanceof Node ? !!((o = m.value) != null && o.contains(e) || (t = u.value) != null && t.contains(e)) : !1;
|
|
136
|
+
}
|
|
137
|
+
function R() {
|
|
138
|
+
n.readonly || !n.enabled || fe();
|
|
55
139
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
140
|
+
function h(e) {
|
|
141
|
+
n.readonly || !n.enabled || Ie(e.relatedTarget) || pe();
|
|
58
142
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
143
|
+
function Re(e) {
|
|
144
|
+
if (I()) {
|
|
145
|
+
if (P(e))
|
|
146
|
+
j(e), r("remove-reaction", { messageId: n.messageId, key: e });
|
|
147
|
+
else {
|
|
148
|
+
const o = k(e);
|
|
149
|
+
o && r("remove-reaction", { messageId: n.messageId, key: o }), r("add-reaction", { messageId: n.messageId, key: e });
|
|
150
|
+
}
|
|
151
|
+
v();
|
|
152
|
+
}
|
|
63
153
|
}
|
|
64
|
-
|
|
65
|
-
|
|
154
|
+
function he() {
|
|
155
|
+
n.readonly || !n.enabled || !n.reply || (X(n.reply), v());
|
|
66
156
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
157
|
+
async function Me() {
|
|
158
|
+
n.readonly || !n.enabled || (_.value = ye(), await ve());
|
|
69
159
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
160
|
+
function be(e) {
|
|
161
|
+
if (L(), v(), !I()) return;
|
|
162
|
+
const o = e.i;
|
|
163
|
+
if (P(o))
|
|
164
|
+
return;
|
|
165
|
+
const t = k(o);
|
|
166
|
+
t && r("remove-reaction", { messageId: n.messageId, key: t }), r("add-reaction", { messageId: n.messageId, key: o });
|
|
167
|
+
}
|
|
168
|
+
return Ce(() => {
|
|
169
|
+
document.addEventListener("click", O);
|
|
170
|
+
const e = Ke(u.value);
|
|
171
|
+
e && (m.value = e, e.addEventListener("pointerenter", R), e.addEventListener("pointerleave", h));
|
|
172
|
+
}), _e(() => {
|
|
173
|
+
document.removeEventListener("click", O), m.value && (m.value.removeEventListener("pointerenter", R), m.value.removeEventListener("pointerleave", h));
|
|
174
|
+
}), Ne(
|
|
175
|
+
() => [n.enabled, n.readonly],
|
|
176
|
+
([e, o]) => {
|
|
177
|
+
(!e || o) && (v(), L());
|
|
178
|
+
}
|
|
179
|
+
), (e, o) => (l(), d("div", {
|
|
75
180
|
ref_key: "reactionsContainerRef",
|
|
76
181
|
ref: u,
|
|
77
|
-
class:
|
|
182
|
+
class: w(["message-reactions", { "has-reactions": s(oe), "is-right-message": ge.value, "is-disabled": !i.enabled }]),
|
|
183
|
+
onPointerenter: R,
|
|
184
|
+
onPointerleave: h
|
|
78
185
|
}, [
|
|
79
|
-
(
|
|
80
|
-
key:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
ref_key: "addButtonRef",
|
|
91
|
-
ref: y,
|
|
92
|
-
class: "message-reactions__add",
|
|
93
|
-
"aria-label": "Add reaction",
|
|
94
|
-
title: "Добавить реакцию",
|
|
95
|
-
onClick: ne
|
|
96
|
-
}, [...n[4] || (n[4] = [
|
|
97
|
-
r("span", null, "+", -1)
|
|
98
|
-
])], 512)) : de("", !0),
|
|
99
|
-
k(T, { name: "message-reactions-popover" }, {
|
|
100
|
-
default: w(() => [
|
|
101
|
-
L(r("div", {
|
|
102
|
-
ref_key: "quickReactionsRef",
|
|
103
|
-
ref: K,
|
|
104
|
-
class: "message-reactions__quick-panel",
|
|
105
|
-
style: N(o(G)),
|
|
106
|
-
onMouseenter: n[0] || (n[0] = //@ts-ignore
|
|
107
|
-
(...e) => o(E) && o(E)(...e)),
|
|
108
|
-
onMouseleave: n[1] || (n[1] = //@ts-ignore
|
|
109
|
-
(...e) => o(P) && o(P)(...e))
|
|
186
|
+
(l(!0), d(Q, null, A(s(ne), (t) => (l(), K(xe, {
|
|
187
|
+
key: t.key,
|
|
188
|
+
text: ie(t),
|
|
189
|
+
position: "bottom-right",
|
|
190
|
+
offset: 6,
|
|
191
|
+
delay: 400
|
|
192
|
+
}, {
|
|
193
|
+
default: E(() => [
|
|
194
|
+
f("button", {
|
|
195
|
+
class: w(["message-reactions__chip", { "is-active": t.reactedByMe && t.count === 1 }]),
|
|
196
|
+
onClick: (g) => ke(t.key)
|
|
110
197
|
}, [
|
|
111
|
-
(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class: "message-reactions__expand",
|
|
119
|
-
title: "Развернуть",
|
|
120
|
-
onClick: O(ae, ["stop"])
|
|
121
|
-
}, [...n[5] || (n[5] = [
|
|
122
|
-
r("span", null, "⋯", -1)
|
|
123
|
-
])])
|
|
124
|
-
], 36), [
|
|
125
|
-
[F, o(C) && !i.readonly && i.enabled && !o(I)]
|
|
126
|
-
])
|
|
198
|
+
f("span", De, [
|
|
199
|
+
c(J, {
|
|
200
|
+
emoji: t.key
|
|
201
|
+
}, null, 8, ["emoji"])
|
|
202
|
+
]),
|
|
203
|
+
te.value || t.count > 1 ? (l(), d("span", Ve, Se(t.count), 1)) : F("", !0)
|
|
204
|
+
], 10, Fe)
|
|
127
205
|
]),
|
|
128
|
-
_:
|
|
129
|
-
}),
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
default:
|
|
133
|
-
|
|
206
|
+
_: 2
|
|
207
|
+
}, 1032, ["text"]))), 128)),
|
|
208
|
+
(l(), K(Ue, { to: "body" }, [
|
|
209
|
+
c(D, { name: "message-reactions-popover" }, {
|
|
210
|
+
default: E(() => [
|
|
211
|
+
V(f("div", {
|
|
212
|
+
ref_key: "quickReactionsRef",
|
|
213
|
+
ref: ue,
|
|
214
|
+
class: "message-reactions__quick-panel",
|
|
215
|
+
style: $(s(de)),
|
|
216
|
+
onMouseenter: o[0] || (o[0] = //@ts-ignore
|
|
217
|
+
(...t) => s(x) && s(x)(...t)),
|
|
218
|
+
onMouseleave: o[1] || (o[1] = //@ts-ignore
|
|
219
|
+
(...t) => s(q) && s(q)(...t))
|
|
220
|
+
}, [
|
|
221
|
+
(l(!0), d(Q, null, A(N.value, (t) => (l(), d("button", {
|
|
222
|
+
key: t,
|
|
223
|
+
class: "message-reactions__quick-item",
|
|
224
|
+
title: t,
|
|
225
|
+
onClick: C((g) => Re(t), ["stop"])
|
|
226
|
+
}, [
|
|
227
|
+
c(J, { emoji: t }, null, 8, ["emoji"])
|
|
228
|
+
], 8, $e))), 128)),
|
|
229
|
+
f("button", {
|
|
230
|
+
class: "message-reactions__expand",
|
|
231
|
+
title: "Развернуть",
|
|
232
|
+
onClick: C(Me, ["stop"])
|
|
233
|
+
}, [
|
|
234
|
+
c(qe)
|
|
235
|
+
]),
|
|
236
|
+
i.replyEnabled && i.reply ? (l(), d("button", {
|
|
237
|
+
key: 0,
|
|
238
|
+
class: "message-reactions__quick-item",
|
|
239
|
+
title: "Ответить",
|
|
240
|
+
onClick: C(he, ["stop"])
|
|
241
|
+
}, [
|
|
242
|
+
c(Te)
|
|
243
|
+
])) : F("", !0)
|
|
244
|
+
], 36), [
|
|
245
|
+
[z, s(ae) && !i.readonly && i.enabled]
|
|
246
|
+
])
|
|
247
|
+
]),
|
|
248
|
+
_: 1
|
|
249
|
+
}),
|
|
250
|
+
c(D, { name: "message-reactions-popover" }, {
|
|
251
|
+
default: E(() => [
|
|
252
|
+
V(f("div", {
|
|
134
253
|
ref_key: "pickerRef",
|
|
135
|
-
ref:
|
|
254
|
+
ref: ce,
|
|
136
255
|
class: "message-reactions__picker",
|
|
137
|
-
style:
|
|
138
|
-
onMouseenter:
|
|
139
|
-
(...
|
|
140
|
-
onMouseleave:
|
|
141
|
-
(...
|
|
256
|
+
style: $(s(me)),
|
|
257
|
+
onMouseenter: o[2] || (o[2] = //@ts-ignore
|
|
258
|
+
(...t) => s(T) && s(T)(...t)),
|
|
259
|
+
onMouseleave: o[3] || (o[3] = //@ts-ignore
|
|
260
|
+
(...t) => s(B) && s(B)(...t))
|
|
142
261
|
}, [
|
|
143
|
-
|
|
144
|
-
native:
|
|
145
|
-
theme:
|
|
262
|
+
c(s(je), {
|
|
263
|
+
native: s(Y),
|
|
264
|
+
theme: _.value,
|
|
146
265
|
"picker-type": "",
|
|
147
|
-
onSelect:
|
|
148
|
-
}, null, 8, ["theme"])
|
|
266
|
+
onSelect: be
|
|
267
|
+
}, null, 8, ["native", "theme"])
|
|
149
268
|
], 36), [
|
|
150
|
-
[
|
|
269
|
+
[z, s(le) && !i.readonly && i.enabled]
|
|
151
270
|
])
|
|
152
271
|
]),
|
|
153
272
|
_: 1
|
|
154
273
|
})
|
|
155
274
|
]))
|
|
156
|
-
],
|
|
275
|
+
], 34));
|
|
157
276
|
}
|
|
158
277
|
});
|
|
159
278
|
export {
|
|
160
|
-
|
|
279
|
+
pt as default
|
|
161
280
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { nextTick as
|
|
2
|
-
function
|
|
3
|
-
if (!
|
|
4
|
-
let t =
|
|
1
|
+
import { nextTick as p } from "vue";
|
|
2
|
+
function l(o) {
|
|
3
|
+
if (!o) return null;
|
|
4
|
+
let t = o.parentElement;
|
|
5
5
|
for (; t; ) {
|
|
6
6
|
if (t.classList.contains("message-feed"))
|
|
7
7
|
return t;
|
|
@@ -9,12 +9,25 @@ function R(i) {
|
|
|
9
9
|
}
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (!
|
|
14
|
-
let t =
|
|
12
|
+
function R(o) {
|
|
13
|
+
if (!o) return null;
|
|
14
|
+
let t = o.parentElement;
|
|
15
15
|
for (; t; ) {
|
|
16
|
-
for (const
|
|
17
|
-
if (
|
|
16
|
+
for (const s of t.classList)
|
|
17
|
+
if (s.endsWith("__content"))
|
|
18
|
+
return t;
|
|
19
|
+
if (t.classList.contains("message-feed"))
|
|
20
|
+
break;
|
|
21
|
+
t = t.parentElement;
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
function w(o) {
|
|
26
|
+
if (!o) return !1;
|
|
27
|
+
let t = o.parentElement;
|
|
28
|
+
for (; t; ) {
|
|
29
|
+
for (const s of t.classList)
|
|
30
|
+
if (s.includes("__right"))
|
|
18
31
|
return !0;
|
|
19
32
|
if (t.classList.contains("message-feed"))
|
|
20
33
|
break;
|
|
@@ -22,83 +35,85 @@ function w(i) {
|
|
|
22
35
|
}
|
|
23
36
|
return !1;
|
|
24
37
|
}
|
|
25
|
-
async function
|
|
38
|
+
async function H(o, t, s = 300) {
|
|
26
39
|
if (!t) return {};
|
|
27
|
-
const a = R(t);
|
|
28
|
-
if (!a) return {};
|
|
29
|
-
const
|
|
30
|
-
await
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return c <= p - o ? {
|
|
37
|
-
left: `${h + C + 6}px`,
|
|
38
|
-
// справа от кнопки с gap 6px
|
|
39
|
-
right: "auto",
|
|
40
|
-
transform: "none"
|
|
41
|
-
} : {
|
|
42
|
-
left: `${h - c - 6}px`,
|
|
43
|
-
right: "auto",
|
|
44
|
-
transform: "none"
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const u = e.left - g.left, l = e.width, r = e.left - s.left;
|
|
48
|
-
return c <= r - o ? {
|
|
49
|
-
left: `${u - c - 6}px`,
|
|
50
|
-
// слева от кнопки с gap 6px
|
|
51
|
-
right: "auto",
|
|
52
|
-
transform: "none"
|
|
53
|
-
} : {
|
|
54
|
-
left: `${u + l + 6}px`,
|
|
55
|
-
// справа от кнопки с gap 6px
|
|
40
|
+
const g = l(t), a = R(t);
|
|
41
|
+
if (!g || !a) return {};
|
|
42
|
+
const e = w(t);
|
|
43
|
+
await p();
|
|
44
|
+
const i = a.getBoundingClientRect(), f = (o == null ? void 0 : o.offsetWidth) || s, c = (o == null ? void 0 : o.offsetHeight) || 44, r = 6, u = i.top + i.height / 2 - c / 2, n = e ? i.left - f - r : i.right + r;
|
|
45
|
+
return {
|
|
46
|
+
position: "fixed",
|
|
47
|
+
top: `${u}px`,
|
|
48
|
+
left: `${n}px`,
|
|
56
49
|
right: "auto",
|
|
50
|
+
marginTop: "0",
|
|
57
51
|
transform: "none"
|
|
58
52
|
};
|
|
59
53
|
}
|
|
60
|
-
async function
|
|
54
|
+
async function P(o, t, s = 300) {
|
|
61
55
|
if (!t) return {};
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
-
const
|
|
65
|
-
await
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
56
|
+
const g = l(t);
|
|
57
|
+
if (!g) return {};
|
|
58
|
+
const a = w(t);
|
|
59
|
+
await p();
|
|
60
|
+
const e = R(t);
|
|
61
|
+
if (!e) return {};
|
|
62
|
+
const i = e.getBoundingClientRect(), f = g.getBoundingClientRect(), c = (o == null ? void 0 : o.offsetWidth) || s, r = (o == null ? void 0 : o.offsetHeight) || 450, u = 8, n = 6, d = window.innerHeight - i.bottom - n, x = i.top - n;
|
|
63
|
+
let h;
|
|
64
|
+
if (d >= r || d >= x ? h = { top: `${i.bottom + n}px` } : h = { bottom: `${window.innerHeight - i.top + n}px` }, a) {
|
|
65
|
+
const $ = f.right - i.right;
|
|
66
|
+
return c <= $ - u ? {
|
|
71
67
|
position: "fixed",
|
|
72
|
-
...
|
|
73
|
-
left: `${
|
|
68
|
+
...h,
|
|
69
|
+
left: `${i.right + n}px`,
|
|
74
70
|
right: "auto",
|
|
75
71
|
transform: "none"
|
|
76
72
|
} : {
|
|
77
73
|
position: "fixed",
|
|
78
|
-
...
|
|
79
|
-
left: `${
|
|
74
|
+
...h,
|
|
75
|
+
left: `${i.left - c - n}px`,
|
|
80
76
|
right: "auto",
|
|
81
77
|
transform: "none"
|
|
82
78
|
};
|
|
83
79
|
}
|
|
84
|
-
const
|
|
85
|
-
return
|
|
80
|
+
const C = i.left - f.left;
|
|
81
|
+
return c <= C - u ? {
|
|
86
82
|
position: "fixed",
|
|
87
|
-
...
|
|
88
|
-
left: `${
|
|
83
|
+
...h,
|
|
84
|
+
left: `${i.left - c - n}px`,
|
|
89
85
|
right: "auto",
|
|
90
86
|
transform: "none"
|
|
91
87
|
} : {
|
|
92
88
|
position: "fixed",
|
|
93
|
-
...
|
|
94
|
-
left: `${
|
|
89
|
+
...h,
|
|
90
|
+
left: `${i.right + n}px`,
|
|
91
|
+
right: "auto",
|
|
92
|
+
transform: "none"
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
async function W(o, t, s, g = 350) {
|
|
96
|
+
if (!t || !s) return {};
|
|
97
|
+
const a = l(s);
|
|
98
|
+
if (!a) return {};
|
|
99
|
+
await p();
|
|
100
|
+
const e = t.getBoundingClientRect(), i = a.getBoundingClientRect(), f = (o == null ? void 0 : o.offsetWidth) || g, c = (o == null ? void 0 : o.offsetHeight) || 450, r = 8, u = 6;
|
|
101
|
+
let n = e.left + e.width / 2 - f / 2;
|
|
102
|
+
n + f > i.right - r && (n = i.right - r - f), n < i.left + r && (n = i.left + r);
|
|
103
|
+
const d = e.top - c - u;
|
|
104
|
+
return {
|
|
105
|
+
position: "fixed",
|
|
106
|
+
top: `${d >= r ? d : e.bottom + u}px`,
|
|
107
|
+
left: `${n}px`,
|
|
95
108
|
right: "auto",
|
|
96
109
|
transform: "none"
|
|
97
110
|
};
|
|
98
111
|
}
|
|
99
112
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
113
|
+
P as calculateFixedPanelPosition,
|
|
114
|
+
H as calculatePanelPosition,
|
|
115
|
+
W as calculatePickerPositionAboveQuickPanel,
|
|
116
|
+
l as findFeedContainer,
|
|
117
|
+
R as findMessageContent,
|
|
103
118
|
w as isRightMessage
|
|
104
119
|
};
|
|
@@ -1,30 +1,72 @@
|
|
|
1
|
-
function
|
|
2
|
-
e
|
|
1
|
+
function v(e, t) {
|
|
2
|
+
return e == null || t == null ? !1 : String(e) === String(t);
|
|
3
|
+
}
|
|
4
|
+
function s(e, t, i) {
|
|
5
|
+
var n, u;
|
|
6
|
+
return i == null ? !1 : ((u = (n = e.value) == null ? void 0 : n.items) == null ? void 0 : u.some(
|
|
7
|
+
(f) => f.key === t && v(f.userId, i)
|
|
8
|
+
)) ?? !1;
|
|
9
|
+
}
|
|
10
|
+
function l(e, t) {
|
|
11
|
+
var i, n, u;
|
|
12
|
+
if (t != null)
|
|
13
|
+
return (u = (n = (i = e.value) == null ? void 0 : i.items) == null ? void 0 : n.find(
|
|
14
|
+
(f) => v(f.userId, t)
|
|
15
|
+
)) == null ? void 0 : u.key;
|
|
16
|
+
}
|
|
17
|
+
function p(e, t) {
|
|
18
|
+
var n;
|
|
19
|
+
if (!((n = e == null ? void 0 : e.items) != null && n.length)) return [];
|
|
20
|
+
const i = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const u of e.items) {
|
|
22
|
+
const f = i.get(u.key), r = v(u.userId, t);
|
|
23
|
+
f ? (f.count++, r && (f.reactedByMe = !0), f.events.push({ ...u })) : i.set(u.key, {
|
|
24
|
+
key: u.key,
|
|
25
|
+
count: 1,
|
|
26
|
+
reactedByMe: r,
|
|
27
|
+
events: [{ ...u }]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return Array.from(i.values());
|
|
31
|
+
}
|
|
32
|
+
function g(e, t, i, n = "multi", u) {
|
|
33
|
+
e.value ? e.value.meta = { ...e.value.meta, mode: n } : e.value = {
|
|
3
34
|
items: [],
|
|
4
|
-
meta: { mode:
|
|
5
|
-
})
|
|
6
|
-
const u = e.value.items.find((i) => i.key === t);
|
|
7
|
-
u ? (u.count++, u.reactedByMe = !0) : e.value.items.push({
|
|
35
|
+
meta: { mode: n }
|
|
36
|
+
}, !s(e, t, i) && e.value.items.push({
|
|
8
37
|
key: t,
|
|
9
|
-
|
|
10
|
-
|
|
38
|
+
userId: i,
|
|
39
|
+
date: Math.floor(Date.now() / 1e3),
|
|
40
|
+
...u ? { name: u } : {}
|
|
11
41
|
});
|
|
12
42
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
43
|
+
function m(e, t, i) {
|
|
44
|
+
e.value && (e.value.items = e.value.items.filter(
|
|
45
|
+
(n) => !(n.key === t && v(n.userId, i))
|
|
46
|
+
), e.value.items.length === 0 && (e.value = void 0));
|
|
17
47
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
48
|
+
function a(e, t, i, n) {
|
|
49
|
+
const u = l(e, i);
|
|
50
|
+
return u && u !== t && m(e, u, i), g(e, t, i, "single", n), u && u !== t ? u : void 0;
|
|
51
|
+
}
|
|
52
|
+
function d(e, t, i, n = "multi", u) {
|
|
53
|
+
if (s(e, t, i)) {
|
|
54
|
+
m(e, t, i);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (n === "single") {
|
|
58
|
+
a(e, t, i, u);
|
|
21
59
|
return;
|
|
22
60
|
}
|
|
23
|
-
|
|
24
|
-
u != null && u.reactedByMe ? d(e, t) : f(e, t);
|
|
61
|
+
g(e, t, i, n, u);
|
|
25
62
|
}
|
|
26
63
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
64
|
+
p as aggregateReactions,
|
|
65
|
+
l as getMyReactionKey,
|
|
66
|
+
s as hasMyReaction,
|
|
67
|
+
v as sameUserId,
|
|
68
|
+
g as updateLocalReactionsAdd,
|
|
69
|
+
m as updateLocalReactionsRemove,
|
|
70
|
+
a as updateLocalReactionsReplace,
|
|
71
|
+
d as updateLocalReactionsToggle
|
|
30
72
|
};
|