@mobilon-dev/chotto 0.3.83 → 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.
Files changed (145) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +3 -2
  3. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +3 -2
  4. package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.js +38 -0
  5. package/dist/components/1_atoms/EmojiGlyph/EmojiGlyph.vue2.js +4 -0
  6. package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +1 -1
  7. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +49 -36
  8. package/dist/components/1_icons/CloseIcon.vue.js +21 -0
  9. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +351 -282
  10. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.js +38 -33
  11. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +64 -39
  12. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +116 -61
  13. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationChannels.js +1 -1
  14. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.js +30 -16
  15. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.js +47 -0
  16. package/dist/components/2_blocks/CommunicationPanel/icons/{CommunicationPanelConfirmSpinner.vue2.js → CommunicationPanelConfirmSpinner.vue.js} +1 -1
  17. package/dist/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.js +19 -0
  18. package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +10 -9
  19. package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +8 -7
  20. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +2 -2
  21. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +48 -37
  22. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +3 -2
  23. package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +7 -6
  24. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +3 -2
  25. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +3 -2
  26. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +3 -2
  27. package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +27 -26
  28. package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +3 -2
  29. package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +3 -2
  30. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +3 -2
  31. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +3 -2
  32. package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +6 -5
  33. package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +10 -9
  34. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +3 -2
  35. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +1 -1
  36. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +169 -143
  37. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js +4 -4
  38. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue2.js +33 -32
  39. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +8 -2
  40. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
  41. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +134 -108
  42. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
  43. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +116 -97
  44. package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +3 -2
  45. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +2 -2
  46. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +232 -113
  47. package/dist/components/2_feed_elements/MessageReactions/composables/usePositioning.js +77 -62
  48. package/dist/components/2_feed_elements/MessageReactions/composables/useReactions.js +62 -20
  49. package/dist/components/2_feed_elements/MessageReactions/composables/useReactionsPanel.js +91 -69
  50. package/dist/components/2_feed_elements/MessageReactions/composables/useReactionsState.js +46 -22
  51. package/dist/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.js +21 -0
  52. package/dist/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.js +21 -0
  53. package/dist/components/2_feed_elements/MessageReactions/utils/quickReactions.js +2 -8
  54. package/dist/components/2_feed_elements/MessageReactions/utils/reactionTooltip.js +39 -0
  55. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +26 -20
  56. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue.js +2 -2
  57. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue2.js +27 -18
  58. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue.js +2 -2
  59. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue2.js +16 -15
  60. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue.js +3 -3
  61. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue2.js +27 -18
  62. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +1 -1
  63. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +16 -12
  64. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +4 -4
  65. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +74 -65
  66. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +1 -1
  67. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +20 -11
  68. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +2 -2
  69. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +13 -9
  70. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -4
  71. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +74 -55
  72. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +4 -4
  73. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +102 -76
  74. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +2 -2
  75. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +74 -55
  76. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
  77. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +99 -82
  78. package/dist/components/3_compounds/Feed/Feed.vue.js +3 -3
  79. package/dist/components/3_compounds/Feed/Feed.vue2.js +159 -139
  80. package/dist/components/3_compounds/Feed/composables/useFeedReply.js +22 -25
  81. package/dist/functions/renderAppleEmojis.js +92 -0
  82. package/dist/hooks/messages/buildReplyPayload.js +14 -0
  83. package/dist/hooks/messages/useMessageLinks.js +60 -50
  84. package/dist/hooks/messages/useStartReply.js +29 -0
  85. package/dist/hooks/useEmojiNative.js +19 -0
  86. package/dist/index.js +130 -122
  87. package/dist/themes/dark.css +1 -1
  88. package/dist/themes/default.css +1 -1
  89. package/dist/themes/glass.css +1 -1
  90. package/dist/themes/green.css +1 -1
  91. package/dist/themes/mobilon1.css +1 -1
  92. package/dist/types/apps/data/messages.d.ts +20 -18
  93. package/dist/types/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.d.ts +12 -0
  94. package/dist/types/components/1_atoms/Tooltip/stories/Tooltip.stories.d.ts +3 -0
  95. package/dist/types/components/1_icons/CloseIcon.vue.d.ts +2 -0
  96. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -0
  97. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanelAttributeIndicator.vue.d.ts +2 -2
  98. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +10 -1
  99. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.d.ts +23 -2
  100. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +1 -0
  101. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationRecentSelection.d.ts +20 -0
  102. package/dist/types/components/2_blocks/CommunicationPanel/icons/CommunicationPanelUnconfirmedIcon.vue.d.ts +2 -0
  103. package/dist/types/components/2_blocks/CommunicationPanel/icons/index.d.ts +1 -0
  104. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -0
  105. package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +42 -10
  106. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +9 -1
  107. package/dist/types/components/2_feed_elements/AudioMessage/AudioMessage.vue.d.ts +29 -0
  108. package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +24 -16
  109. package/dist/types/components/2_feed_elements/BaseReplyMessage/styles/types.d.ts +8 -4
  110. package/dist/types/components/2_feed_elements/FileMessage/FileMessage.vue.d.ts +29 -0
  111. package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +20 -0
  112. package/dist/types/components/2_feed_elements/ImageMessage/ImageMessage.vue.d.ts +29 -0
  113. package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +2 -0
  114. package/dist/types/components/2_feed_elements/MessageReactions/MessageReactions.vue.d.ts +64 -1
  115. package/dist/types/components/2_feed_elements/MessageReactions/composables/index.d.ts +2 -2
  116. package/dist/types/components/2_feed_elements/MessageReactions/composables/usePositioning.d.ts +11 -1
  117. package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactions.d.ts +20 -12
  118. package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactionsPanel.d.ts +3 -3
  119. package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactionsState.d.ts +13 -22
  120. package/dist/types/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.d.ts +2 -0
  121. package/dist/types/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.d.ts +2 -0
  122. package/dist/types/components/2_feed_elements/MessageReactions/styles/types.d.ts +14 -74
  123. package/dist/types/components/2_feed_elements/MessageReactions/utils/quickReactions.d.ts +1 -1
  124. package/dist/types/components/2_feed_elements/MessageReactions/utils/reactionTooltip.d.ts +14 -0
  125. package/dist/types/components/2_feed_elements/ReplyAudioMessage/styles/types.d.ts +6 -0
  126. package/dist/types/components/2_feed_elements/ReplyCallMessage/styles/types.d.ts +6 -0
  127. package/dist/types/components/2_feed_elements/ReplyFileMessage/styles/types.d.ts +6 -0
  128. package/dist/types/components/2_feed_elements/ReplyImageMessage/styles/types.d.ts +6 -0
  129. package/dist/types/components/2_feed_elements/ReplyStickerMessage/styles/types.d.ts +6 -0
  130. package/dist/types/components/2_feed_elements/ReplyTextMessage/styles/types.d.ts +4 -0
  131. package/dist/types/components/2_feed_elements/ReplyVideoMessage/styles/types.d.ts +6 -0
  132. package/dist/types/components/2_feed_elements/StickerMessage/StickerMessage.vue.d.ts +29 -0
  133. package/dist/types/components/2_feed_elements/TextMessage/TextMessage.vue.d.ts +29 -0
  134. package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +22 -0
  135. package/dist/types/components/2_feed_elements/VideoMessage/VideoMessage.vue.d.ts +29 -0
  136. package/dist/types/components/2_feed_elements/types/messages.d.ts +11 -6
  137. package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
  138. package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +33 -0
  139. package/dist/types/functions/renderAppleEmojis.d.ts +16 -0
  140. package/dist/types/hooks/index.d.ts +1 -0
  141. package/dist/types/hooks/messages/buildReplyPayload.d.ts +11 -0
  142. package/dist/types/hooks/messages/index.d.ts +2 -0
  143. package/dist/types/hooks/messages/useStartReply.d.ts +6 -0
  144. package/dist/types/hooks/useEmojiNative.d.ts +9 -0
  145. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { defineComponent as Y, inject as Z, ref as y, computed as b, watch as E, onMounted as _, createElementBlock as i, openBlock as t, unref as a, normalizeStyle as ee, normalizeClass as w, createCommentVNode as l, createElementVNode as r, createBlock as g, toDisplayString as I, createVNode as u, Transition as h, withCtx as d, withModifiers as V, Teleport as se } from "vue";
1
+ import { defineComponent as Y, inject as Z, ref as y, computed as b, watch as E, onMounted as _, createElementBlock as i, openBlock as t, unref as a, normalizeStyle as ee, normalizeClass as w, createCommentVNode as l, createElementVNode as r, createBlock as g, toDisplayString as R, createVNode as u, Transition as h, withCtx as d, withModifiers as N, Teleport as se } from "vue";
2
2
  import te from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
3
3
  import ae from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
4
4
  import ie from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
@@ -10,27 +10,29 @@ import re from "../MessageSmsInvite/MessageSmsInvite.vue.js";
10
10
  import { useMessageActions as ue } from "../../../hooks/messages/useMessageActions.js";
11
11
  import { useMessageLinks as ce } from "../../../hooks/messages/useMessageLinks.js";
12
12
  import { useChannelAccentColor as ge } from "../../../hooks/messages/useChannelAccentColor.js";
13
- import { getStatus as de, getStatusTitle as ve } from "../../../functions/getStatusMessage.js";
14
- import { getMessageClass as ke } from "../../../functions/getMessageClass.js";
15
- import { createReactionHandlers as fe } from "../../../functions/createReactionHandlers.js";
16
- import "../../../functions/parseMarkdown.js";
17
13
  import "../../../hooks/useMessageDraft.js";
18
14
  import "../../../hooks/useSearchModel.js";
19
- import { useTheme as ye } from "../../../hooks/useTheme.js";
15
+ import { useTheme as de } from "../../../hooks/useTheme.js";
16
+ import "../../../hooks/useEmojiNative.js";
20
17
  /* empty css */
21
18
  /* empty css */
22
- import { isAnimatedSticker as be } from "./utils/stickerUtils.js";
19
+ import { buildReplyPayload as ve } from "../../../hooks/messages/buildReplyPayload.js";
20
+ import { getStatus as ke, getStatusTitle as fe } from "../../../functions/getStatusMessage.js";
21
+ import { getMessageClass as ye } from "../../../functions/getMessageClass.js";
22
+ import { createReactionHandlers as be } from "../../../functions/createReactionHandlers.js";
23
+ import "../../../functions/parseMarkdown.js";
24
+ import { isAnimatedSticker as we } from "./utils/stickerUtils.js";
23
25
  import "./utils/suppress-lit-warning.js";
24
- const we = ["messageId"], he = ["src"], Me = {
26
+ const he = ["messageId"], Me = ["src"], Se = {
25
27
  key: 1,
26
28
  class: "sticker-message__subtext"
27
- }, Se = ["src"], Ce = ["src"], Re = ["src", "alt"], Ie = {
29
+ }, Ce = ["src"], Ie = ["src"], Re = ["src", "alt"], Te = {
28
30
  key: 0,
29
31
  class: "sticker-message__info-container"
30
- }, Te = { class: "sticker-message__time" }, xe = ["href"], pe = {
32
+ }, xe = { class: "sticker-message__time" }, pe = ["href"], Le = {
31
33
  key: 1,
32
34
  class: "sticker-message__text-container"
33
- }, Le = ["innerHTML"], Ae = ["src"], Fe = ["src"], Be = ["src", "alt"], ts = /* @__PURE__ */ Y({
35
+ }, Ae = ["innerHTML"], Fe = ["src"], Be = ["src"], Ee = ["src", "alt"], ls = /* @__PURE__ */ Y({
34
36
  __name: "StickerMessage",
35
37
  props: {
36
38
  message: {
@@ -49,6 +51,19 @@ const we = ["messageId"], he = ["src"], Me = {
49
51
  type: Boolean,
50
52
  default: !0
51
53
  },
54
+ reactionsMode: {
55
+ type: String,
56
+ default: "single",
57
+ validator: (e) => ["single", "multi"].includes(e)
58
+ },
59
+ currentUserId: {
60
+ type: [String, Number],
61
+ default: void 0
62
+ },
63
+ reactionUserNames: {
64
+ type: Object,
65
+ default: void 0
66
+ },
52
67
  channel: {
53
68
  type: String,
54
69
  required: !1,
@@ -56,8 +71,8 @@ const we = ["messageId"], he = ["src"], Me = {
56
71
  }
57
72
  },
58
73
  emits: ["action", "reply", "sms-invite"],
59
- setup(e, { emit: $ }) {
60
- const H = Z("chatAppId"), { getTheme: T } = ye(H), c = y(!1), M = y(!1);
74
+ setup(e, { emit: V }) {
75
+ const $ = Z("chatAppId"), { getTheme: T } = de($), c = y(!1), M = y(!1);
61
76
  async function x() {
62
77
  if (!(c.value || M.value)) {
63
78
  M.value = !0;
@@ -70,20 +85,20 @@ const we = ["messageId"], he = ["src"], Me = {
70
85
  }
71
86
  }
72
87
  }
73
- const n = e, S = $, C = y(!1), {
74
- isOpenMenu: R,
75
- buttonMenuVisible: N,
76
- showMenu: P,
88
+ const n = e, S = V, C = y(!1), {
89
+ isOpenMenu: I,
90
+ buttonMenuVisible: P,
91
+ showMenu: j,
77
92
  hideMenu: p,
78
- clickAction: j,
93
+ clickAction: H,
79
94
  viewsAction: L,
80
95
  handleClickReplied: O
81
- } = ue(n.message, S), v = y(!1), { linkedHtml: q, inNewWindow: A } = ce(() => n.message.text), z = () => {
82
- P(), v.value = !0;
83
- }, D = b(() => de(n.message.status)), G = b(() => ve(n.message.status, n.message.statusMsg)), { bubbleStyle: W } = ge(
96
+ } = ue(n.message, S), v = y(!1), { linkedHtml: U, inNewWindow: A } = ce(() => n.message.text), q = () => {
97
+ j(), v.value = !0;
98
+ }, z = b(() => ke(n.message.status)), D = b(() => fe(n.message.status, n.message.statusMsg)), { bubbleStyle: G } = ge(
84
99
  b(() => n.message),
85
100
  { cssVariable: "--chotto-stickermessage-right-bg", position: "right" }
86
- ), k = b(() => be(n.message.url, n.message.isAnimated)), f = y(!1), F = b(() => {
101
+ ), k = b(() => we(n.message.url, n.message.isAnimated)), f = y(!1), F = b(() => {
87
102
  if (k.value) return !1;
88
103
  const m = String(n.message.url || "").toLowerCase();
89
104
  return !/\.(webp|png|jpe?g|gif|bmp|svg)(\?|#|$)/.test(m);
@@ -100,9 +115,9 @@ const we = ["messageId"], he = ["src"], Me = {
100
115
  k.value && !c.value && x();
101
116
  });
102
117
  function B(m) {
103
- return ke(m.position, "sticker-message");
118
+ return ye(m.position, "sticker-message");
104
119
  }
105
- const J = () => C.value = !1, { onToggleReaction: K, onAddReaction: Q, onRemoveReaction: U } = fe(S);
120
+ const W = () => C.value = !1, { onToggleReaction: J, onAddReaction: K, onRemoveReaction: Q } = be(S);
106
121
  function X() {
107
122
  S("sms-invite", n.message);
108
123
  }
@@ -112,7 +127,7 @@ const we = ["messageId"], he = ["src"], Me = {
112
127
  e.applyStyle(e.message)
113
128
  ]]),
114
129
  messageId: e.message.messageId,
115
- style: ee(a(W)),
130
+ style: ee(a(G)),
116
131
  onMouseleave: s[7] || (s[7] = //@ts-ignore
117
132
  (...o) => a(p) && a(p)(...o))
118
133
  }, [
@@ -122,8 +137,8 @@ const we = ["messageId"], he = ["src"], Me = {
122
137
  src: e.message.avatar,
123
138
  height: "32",
124
139
  width: "32"
125
- }, null, 8, he)) : l("", !0),
126
- e.message.subText && e.isFirstInSeries ? (t(), i("p", Me, I(e.message.subText), 1)) : l("", !0),
140
+ }, null, 8, Me)) : l("", !0),
141
+ e.message.subText && e.isFirstInSeries ? (t(), i("p", Se, R(e.message.subText), 1)) : l("", !0),
127
142
  r("div", {
128
143
  class: w(["sticker-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar }])
129
144
  }, [
@@ -137,7 +152,7 @@ const we = ["messageId"], he = ["src"], Me = {
137
152
  r("div", {
138
153
  class: "sticker-message__preview-button",
139
154
  onClick: s[2] || (s[2] = (o) => C.value = !0),
140
- onMouseenter: z,
155
+ onMouseenter: q,
141
156
  onMouseleave: s[3] || (s[3] = (o) => v.value = !v.value)
142
157
  }, [
143
158
  k.value && c.value ? (t(), i("tgs-player", {
@@ -147,7 +162,7 @@ const we = ["messageId"], he = ["src"], Me = {
147
162
  autoplay: "",
148
163
  loop: "",
149
164
  mode: "normal"
150
- }, null, 8, Se)) : F.value && !f.value ? (t(), i("video", {
165
+ }, null, 8, Ce)) : F.value && !f.value ? (t(), i("video", {
151
166
  key: 1,
152
167
  class: "sticker-message__preview-image",
153
168
  src: e.message.url,
@@ -157,7 +172,7 @@ const we = ["messageId"], he = ["src"], Me = {
157
172
  playsinline: "",
158
173
  preload: "metadata",
159
174
  onError: s[0] || (s[0] = (o) => f.value = !0)
160
- }, null, 40, Ce)) : (t(), i("img", {
175
+ }, null, 40, Ie)) : (t(), i("img", {
161
176
  key: 2,
162
177
  class: "sticker-message__preview-image",
163
178
  src: e.message.url,
@@ -165,26 +180,26 @@ const we = ["messageId"], he = ["src"], Me = {
165
180
  }, null, 8, Re)),
166
181
  u(h, { name: "modal-fade" }, {
167
182
  default: d(() => [
168
- v.value ? (t(), i("div", Ie, [
183
+ v.value ? (t(), i("div", Te, [
169
184
  e.message.views ? (t(), i("div", {
170
185
  key: 0,
171
186
  class: "sticker-message__views",
172
- onClick: s[1] || (s[1] = V(
187
+ onClick: s[1] || (s[1] = N(
173
188
  //@ts-ignore
174
189
  (...o) => a(L) && a(L)(...o),
175
190
  ["stop"]
176
191
  ))
177
192
  }, [
178
193
  s[8] || (s[8] = r("span", { class: "pi pi-eye" }, null, -1)),
179
- r("p", null, I(e.message.views), 1)
194
+ r("p", null, R(e.message.views), 1)
180
195
  ])) : l("", !0),
181
- r("span", Te, I(e.message.time), 1),
196
+ r("span", xe, R(e.message.time), 1),
182
197
  u(me, {
183
198
  "base-class": "sticker-message",
184
199
  "message-class": B(e.message),
185
200
  "message-status": e.message.status,
186
- "status-class": D.value,
187
- "status-title": G.value
201
+ "status-class": z.value,
202
+ "status-title": D.value
188
203
  }, null, 8, ["message-class", "message-status", "status-class", "status-title"])
189
204
  ])) : l("", !0)
190
205
  ]),
@@ -198,20 +213,20 @@ const we = ["messageId"], he = ["src"], Me = {
198
213
  href: e.message.url,
199
214
  download: "",
200
215
  target: "_blank",
201
- onClick: V(() => "//Предотвращаем всплытие события клика", ["stop"])
216
+ onClick: N(() => "//Предотвращаем всплытие события клика", ["stop"])
202
217
  }, [...s[9] || (s[9] = [
203
218
  r("span", { class: "pi pi-download" }, null, -1)
204
- ])], 8, xe)) : l("", !0)
219
+ ])], 8, pe)) : l("", !0)
205
220
  ]),
206
221
  _: 1
207
222
  })
208
223
  ], 32),
209
224
  u(h, { name: "modal-fade" }, {
210
225
  default: d(() => [
211
- a(N) && e.message.actions ? (t(), i("button", {
226
+ a(P) && e.message.actions ? (t(), i("button", {
212
227
  key: 0,
213
228
  class: "sticker-message__menu-button",
214
- onClick: s[4] || (s[4] = (o) => R.value = !a(R))
229
+ onClick: s[4] || (s[4] = (o) => I.value = !a(I))
215
230
  }, [...s[10] || (s[10] = [
216
231
  r("span", { class: "pi pi-ellipsis-h" }, null, -1)
217
232
  ])])) : l("", !0)
@@ -220,21 +235,21 @@ const we = ["messageId"], he = ["src"], Me = {
220
235
  }),
221
236
  u(h, { name: "context-menu" }, {
222
237
  default: d(() => [
223
- a(R) && e.message.actions ? (t(), g(te, {
238
+ a(I) && e.message.actions ? (t(), g(te, {
224
239
  key: 0,
225
240
  class: "sticker-message__context-menu",
226
241
  actions: e.message.actions,
227
- onClick: a(j)
242
+ onClick: a(H)
228
243
  }, null, 8, ["actions", "onClick"])) : l("", !0)
229
244
  ]),
230
245
  _: 1
231
246
  }),
232
- e.message.text ? (t(), i("div", pe, [
247
+ e.message.text ? (t(), i("div", Le, [
233
248
  r("p", {
234
249
  onClick: s[5] || (s[5] = //@ts-ignore
235
250
  (...o) => a(A) && a(A)(...o)),
236
- innerHTML: a(q)
237
- }, null, 8, Le)
251
+ innerHTML: a(U)
252
+ }, null, 8, Ae)
238
253
  ])) : l("", !0),
239
254
  u(re, {
240
255
  status: e.message.status,
@@ -255,11 +270,15 @@ const we = ["messageId"], he = ["src"], Me = {
255
270
  u(oe, {
256
271
  reactions: e.message.reactions,
257
272
  "message-id": e.message.messageId,
273
+ reply: a(ve)(e.message, "message.sticker"),
258
274
  enabled: e.reactionsEnabled,
259
- onToggleReaction: a(K),
260
- onAddReaction: a(Q),
261
- onRemoveReaction: a(U)
262
- }, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"])
275
+ mode: e.reactionsMode,
276
+ "current-user-id": e.currentUserId,
277
+ "reaction-user-names": e.reactionUserNames,
278
+ onToggleReaction: a(J),
279
+ onAddReaction: a(K),
280
+ onRemoveReaction: a(Q)
281
+ }, null, 8, ["reactions", "message-id", "reply", "enabled", "mode", "current-user-id", "reaction-user-names", "onToggleReaction", "onAddReaction", "onRemoveReaction"])
263
282
  ], 2),
264
283
  (t(), g(se, { to: "body" }, [
265
284
  u(h, { name: "modal-fade" }, {
@@ -268,7 +287,7 @@ const we = ["messageId"], he = ["src"], Me = {
268
287
  key: 0,
269
288
  "data-theme": a(T)().theme ? a(T)().theme : "light",
270
289
  title: e.message.alt,
271
- onClose: J
290
+ onClose: W
272
291
  }, {
273
292
  default: d(() => [
274
293
  k.value && c.value ? (t(), i("tgs-player", {
@@ -278,7 +297,7 @@ const we = ["messageId"], he = ["src"], Me = {
278
297
  autoplay: "",
279
298
  loop: "",
280
299
  mode: "normal"
281
- }, null, 8, Ae)) : F.value && !f.value ? (t(), i("video", {
300
+ }, null, 8, Fe)) : F.value && !f.value ? (t(), i("video", {
282
301
  key: 1,
283
302
  class: "sticker-message__modal-image",
284
303
  src: e.message.url,
@@ -288,12 +307,12 @@ const we = ["messageId"], he = ["src"], Me = {
288
307
  playsinline: "",
289
308
  preload: "metadata",
290
309
  onError: s[6] || (s[6] = (o) => f.value = !0)
291
- }, null, 40, Fe)) : (t(), i("img", {
310
+ }, null, 40, Be)) : (t(), i("img", {
292
311
  key: 2,
293
312
  class: "sticker-message__modal-image",
294
313
  src: e.message.url,
295
314
  alt: e.message.alt
296
- }, null, 8, Be))
315
+ }, null, 8, Ee))
297
316
  ]),
298
317
  _: 1
299
318
  }, 8, ["data-theme", "title"])) : l("", !0)
@@ -301,9 +320,9 @@ const we = ["messageId"], he = ["src"], Me = {
301
320
  _: 1
302
321
  })
303
322
  ]))
304
- ], 46, we));
323
+ ], 46, he));
305
324
  }
306
325
  });
307
326
  export {
308
- ts as default
327
+ ls as default
309
328
  };
@@ -1,7 +1,7 @@
1
- import e from "./TextMessage.vue2.js";
1
+ import o from "./TextMessage.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-ee1e92cf"]]);
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-adf4ea13"]]);
5
5
  export {
6
- a as default
6
+ s as default
7
7
  };
@@ -1,27 +1,34 @@
1
- import { defineComponent as D, computed as r, createElementBlock as o, openBlock as a, unref as s, normalizeStyle as h, normalizeClass as u, createCommentVNode as i, createElementVNode as m, createVNode as f, withCtx as R, createTextVNode as O, toDisplayString as v, createBlock as g, Transition as j } from "vue";
2
- import z from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
3
- import W from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
4
- import $ from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
5
- import G from "../BaseReplyMessage/BaseReplyMessage.vue.js";
6
- import J from "../MessageReactions/MessageReactions.vue.js";
7
- import K from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
8
- import Q from "../MessageSmsInvite/MessageSmsInvite.vue.js";
9
- import U from "../../1_atoms/Tooltip/Tooltip.vue.js";
1
+ import { defineComponent as U, computed as g, createElementBlock as m, openBlock as a, unref as s, normalizeStyle as h, normalizeClass as u, createCommentVNode as i, createElementVNode as l, createVNode as f, withCtx as R, createTextVNode as j, toDisplayString as y, createBlock as r, Transition as q } from "vue";
2
+ import D from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
3
+ import z from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
4
+ import W from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
5
+ import $ from "../BaseReplyMessage/BaseReplyMessage.vue.js";
6
+ import G from "../MessageReactions/MessageReactions.vue.js";
7
+ import J from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
8
+ import K from "../MessageSmsInvite/MessageSmsInvite.vue.js";
9
+ import Q from "../../1_atoms/Tooltip/Tooltip.vue.js";
10
10
  import { useMessageActions as X } from "../../../hooks/messages/useMessageActions.js";
11
11
  import { useMessageLinks as Y } from "../../../hooks/messages/useMessageLinks.js";
12
12
  import { useChannelAccentColor as Z } from "../../../hooks/messages/useChannelAccentColor.js";
13
13
  import { useSubtextTooltip as p } from "../../../hooks/messages/useSubtextTooltip.js";
14
- import { getStatus as _, getStatusTitle as ee } from "../../../functions/getStatusMessage.js";
15
- import { getMessageClass as se } from "../../../functions/getMessageClass.js";
16
- import { createReactionHandlers as te } from "../../../functions/createReactionHandlers.js";
14
+ import "../../../hooks/useMessageDraft.js";
15
+ import "../../../hooks/useSearchModel.js";
16
+ import "../../../hooks/useTheme.js";
17
+ import "../../../hooks/useEmojiNative.js";
18
+ /* empty css */
19
+ /* empty css */
20
+ import { buildReplyPayload as _ } from "../../../hooks/messages/buildReplyPayload.js";
21
+ import { getStatus as ee, getStatusTitle as se } from "../../../functions/getStatusMessage.js";
22
+ import { getMessageClass as te } from "../../../functions/getMessageClass.js";
23
+ import { createReactionHandlers as ae } from "../../../functions/createReactionHandlers.js";
17
24
  import "../../../functions/parseMarkdown.js";
18
- const ae = ["messageId"], ne = ["src"], ie = {
25
+ const ne = ["messageId"], ie = ["src"], oe = {
19
26
  key: 1,
20
27
  class: "text-message__subtext"
21
- }, le = ["innerHTML"], oe = { class: "text-message__info-container" }, me = {
28
+ }, le = ["innerHTML"], me = { class: "text-message__footer" }, re = { class: "text-message__info-container" }, ue = {
22
29
  key: 1,
23
30
  class: "text-message__time"
24
- }, Ie = /* @__PURE__ */ D({
31
+ }, He = /* @__PURE__ */ U({
25
32
  __name: "TextMessage",
26
33
  props: {
27
34
  message: {
@@ -40,6 +47,19 @@ const ae = ["messageId"], ne = ["src"], ie = {
40
47
  type: Boolean,
41
48
  default: !0
42
49
  },
50
+ reactionsMode: {
51
+ type: String,
52
+ default: "single",
53
+ validator: (e) => ["single", "multi"].includes(e)
54
+ },
55
+ currentUserId: {
56
+ type: [String, Number],
57
+ default: void 0
58
+ },
59
+ reactionUserNames: {
60
+ type: Object,
61
+ default: void 0
62
+ },
43
63
  subtextTooltipData: {
44
64
  type: Object,
45
65
  required: !1,
@@ -53,129 +73,135 @@ const ae = ["messageId"], ne = ["src"], ie = {
53
73
  },
54
74
  emits: ["action", "reply", "sms-invite"],
55
75
  setup(e, { emit: w }) {
56
- const n = e, c = w, { linkedHtml: T, inNewWindow: y } = Y(() => n.message.text), {
76
+ const n = e, c = w, { linkedHtml: I, inNewWindow: v } = Y(() => n.message.text), {
57
77
  isOpenMenu: d,
58
- buttonMenuVisible: I,
78
+ buttonMenuVisible: T,
59
79
  showMenu: b,
60
80
  hideMenu: x,
61
81
  clickAction: C,
62
82
  viewsAction: k,
63
83
  handleClickReplied: A
64
- } = X(n.message, c), B = r(() => _(n.message.status)), F = r(() => ee(n.message.status, n.message.statusMsg)), { bubbleStyle: E } = Z(
65
- r(() => n.message),
84
+ } = X(n.message, c), N = g(() => ee(n.message.status)), B = g(() => se(n.message.status, n.message.statusMsg)), { bubbleStyle: F } = Z(
85
+ g(() => n.message),
66
86
  { cssVariable: "--chotto-textmessage-right-bg", position: "right" }
67
87
  );
68
88
  function S(M) {
69
- return se(M.position, "text-message");
89
+ return te(M.position, "text-message");
70
90
  }
71
- const { onToggleReaction: V, onAddReaction: N, onRemoveReaction: H } = te(c), L = p(() => n.message, () => n.subtextTooltipData), P = r(
91
+ const { onToggleReaction: E, onAddReaction: V, onRemoveReaction: P } = ae(c), H = p(() => n.message, () => n.subtextTooltipData), L = g(
72
92
  () => n.message.status === "error" && n.message.hasMessengerAccount === !1
73
93
  );
74
- function q() {
94
+ function O() {
75
95
  c("sms-invite", n.message);
76
96
  }
77
- return (M, t) => (a(), o("div", {
97
+ return (M, t) => (a(), m("div", {
78
98
  class: u(["text-message", [
79
99
  S(e.message),
80
100
  e.applyStyle(e.message)
81
101
  ]]),
82
102
  messageId: e.message.messageId,
83
- style: h(s(E)),
103
+ style: h(s(F)),
84
104
  onMouseleave: t[4] || (t[4] = //@ts-ignore
85
- (...l) => s(x) && s(x)(...l))
105
+ (...o) => s(x) && s(x)(...o))
86
106
  }, [
87
- e.message.avatar && e.isFirstInSeries ? (a(), o("img", {
107
+ e.message.avatar && e.isFirstInSeries ? (a(), m("img", {
88
108
  key: 0,
89
109
  class: "text-message__avatar",
90
110
  src: e.message.avatar,
91
111
  height: "32",
92
112
  width: "32",
93
113
  style: h({ gridRow: e.message.subText && e.isFirstInSeries ? "2" : "1" })
94
- }, null, 12, ne)) : i("", !0),
95
- e.message.subText && e.isFirstInSeries ? (a(), o("p", ie, [
96
- f(U, {
97
- text: s(L),
114
+ }, null, 12, ie)) : i("", !0),
115
+ e.message.subText && e.isFirstInSeries ? (a(), m("p", oe, [
116
+ f(Q, {
117
+ text: s(H),
98
118
  position: e.message.position === "left" ? "right" : "left",
99
119
  offset: 8
100
120
  }, {
101
121
  default: R(() => [
102
- O(v(e.message.subText), 1)
122
+ j(y(e.message.subText), 1)
103
123
  ]),
104
124
  _: 1
105
125
  }, 8, ["text", "position"])
106
126
  ])) : i("", !0),
107
- m("div", {
127
+ l("div", {
108
128
  class: u(["text-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar }]),
109
129
  onMouseenter: t[3] || (t[3] = //@ts-ignore
110
- (...l) => s(b) && s(b)(...l))
130
+ (...o) => s(b) && s(b)(...o))
111
131
  }, [
112
- e.message.reply ? (a(), g(G, {
132
+ e.message.reply ? (a(), r($, {
113
133
  key: 0,
114
134
  class: u(e.message.position),
115
135
  message: e.message.reply,
116
136
  onReply: s(A)
117
137
  }, null, 8, ["class", "message", "onReply"])) : i("", !0),
118
- m("p", {
138
+ l("p", {
119
139
  class: "text-message__text",
120
140
  onClick: t[0] || (t[0] = //@ts-ignore
121
- (...l) => s(y) && s(y)(...l)),
122
- innerHTML: s(T)
141
+ (...o) => s(v) && s(v)(...o)),
142
+ innerHTML: s(I)
123
143
  }, null, 8, le),
124
- e.message.linkPreview ? (a(), g(W, {
144
+ e.message.linkPreview ? (a(), r(z, {
125
145
  key: 1,
126
146
  class: u(e.message.position),
127
147
  "link-preview": e.message.linkPreview
128
148
  }, null, 8, ["class", "link-preview"])) : i("", !0),
129
- e.message.embed ? (a(), g($, {
149
+ e.message.embed ? (a(), r(W, {
130
150
  key: 2,
131
151
  class: u(e.message.position),
132
152
  embed: e.message.embed
133
153
  }, null, 8, ["class", "embed"])) : i("", !0),
134
- e.reactionsEnabled ? (a(), g(J, {
135
- key: 3,
136
- reactions: e.message.reactions,
137
- "message-id": e.message.messageId,
138
- enabled: e.reactionsEnabled,
139
- onToggleReaction: s(V),
140
- onAddReaction: s(N),
141
- onRemoveReaction: s(H)
142
- }, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"])) : i("", !0),
143
- m("div", oe, [
144
- e.message.views ? (a(), o("div", {
154
+ l("div", me, [
155
+ e.reactionsEnabled ? (a(), r(G, {
145
156
  key: 0,
146
- class: "text-message__views",
147
- onClick: t[1] || (t[1] = //@ts-ignore
148
- (...l) => s(k) && s(k)(...l))
149
- }, [
150
- t[5] || (t[5] = m("span", { class: "pi pi-eye" }, null, -1)),
151
- m("p", null, v(e.message.views), 1)
152
- ])) : i("", !0),
153
- e.message.time ? (a(), o("span", me, v(e.message.time), 1)) : i("", !0),
154
- f(K, {
155
- "base-class": "text-message",
156
- "message-class": S(e.message),
157
- "message-status": e.message.status,
158
- "status-class": B.value,
159
- "status-title": F.value
160
- }, null, 8, ["message-class", "message-status", "status-class", "status-title"])
157
+ reactions: e.message.reactions,
158
+ "message-id": e.message.messageId,
159
+ reply: s(_)(e.message, "message.text"),
160
+ enabled: e.reactionsEnabled,
161
+ mode: e.reactionsMode,
162
+ "current-user-id": e.currentUserId,
163
+ "reaction-user-names": e.reactionUserNames,
164
+ onToggleReaction: s(E),
165
+ onAddReaction: s(V),
166
+ onRemoveReaction: s(P)
167
+ }, null, 8, ["reactions", "message-id", "reply", "enabled", "mode", "current-user-id", "reaction-user-names", "onToggleReaction", "onAddReaction", "onRemoveReaction"])) : i("", !0),
168
+ l("div", re, [
169
+ e.message.views ? (a(), m("div", {
170
+ key: 0,
171
+ class: "text-message__views",
172
+ onClick: t[1] || (t[1] = //@ts-ignore
173
+ (...o) => s(k) && s(k)(...o))
174
+ }, [
175
+ t[5] || (t[5] = l("span", { class: "pi pi-eye" }, null, -1)),
176
+ l("p", null, y(e.message.views), 1)
177
+ ])) : i("", !0),
178
+ e.message.time ? (a(), m("span", ue, y(e.message.time), 1)) : i("", !0),
179
+ f(J, {
180
+ "base-class": "text-message",
181
+ "message-class": S(e.message),
182
+ "message-status": e.message.status,
183
+ "status-class": N.value,
184
+ "status-title": B.value
185
+ }, null, 8, ["message-class", "message-status", "status-class", "status-title"])
186
+ ])
161
187
  ]),
162
- P.value ? (a(), g(Q, {
163
- key: 4,
188
+ L.value ? (a(), r(K, {
189
+ key: 3,
164
190
  status: e.message.status,
165
191
  "has-messenger-account": e.message.hasMessengerAccount,
166
192
  channel: e.channel,
167
- onSmsInvite: q
193
+ onSmsInvite: O
168
194
  }, null, 8, ["status", "has-messenger-account", "channel"])) : i("", !0),
169
- s(I) && e.message.actions ? (a(), o("button", {
170
- key: 5,
195
+ s(T) && e.message.actions ? (a(), m("button", {
196
+ key: 4,
171
197
  class: "text-message__menu-button",
172
- onClick: t[2] || (t[2] = (l) => d.value = !s(d))
198
+ onClick: t[2] || (t[2] = (o) => d.value = !s(d))
173
199
  }, [...t[6] || (t[6] = [
174
- m("span", { class: "pi pi-ellipsis-h" }, null, -1)
200
+ l("span", { class: "pi pi-ellipsis-h" }, null, -1)
175
201
  ])])) : i("", !0),
176
- f(j, null, {
202
+ f(q, null, {
177
203
  default: R(() => [
178
- s(d) && e.message.actions ? (a(), g(z, {
204
+ s(d) && e.message.actions ? (a(), r(D, {
179
205
  key: 0,
180
206
  class: "text-message__context-menu",
181
207
  actions: e.message.actions,
@@ -185,9 +211,9 @@ const ae = ["messageId"], ne = ["src"], ie = {
185
211
  _: 1
186
212
  })
187
213
  ], 34)
188
- ], 46, ae));
214
+ ], 46, ne));
189
215
  }
190
216
  });
191
217
  export {
192
- Ie as default
218
+ He as default
193
219
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./VideoMessage.vue2.js";
2
2
  /* empty css */
3
- import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-dce5c529"]]);
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1bbd7c2f"]]);
5
5
  export {
6
6
  a as default
7
7
  };