@mobilon-dev/chotto 0.3.84 → 0.3.86

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 (135) 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 +174 -165
  10. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +21 -18
  11. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.js +32 -27
  12. package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.js +44 -35
  13. package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +10 -9
  14. package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +8 -7
  15. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +2 -2
  16. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +48 -37
  17. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +3 -2
  18. package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +7 -6
  19. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +3 -2
  20. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +3 -2
  21. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +3 -2
  22. package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +27 -26
  23. package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +3 -2
  24. package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +3 -2
  25. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +3 -2
  26. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +3 -2
  27. package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +6 -5
  28. package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +10 -9
  29. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +3 -2
  30. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +1 -1
  31. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +169 -143
  32. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue.js +4 -4
  33. package/dist/components/2_feed_elements/BaseReplyMessage/BaseReplyMessage.vue2.js +33 -32
  34. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +8 -2
  35. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
  36. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +134 -108
  37. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +1 -1
  38. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +116 -97
  39. package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +3 -2
  40. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue.js +2 -2
  41. package/dist/components/2_feed_elements/MessageReactions/MessageReactions.vue2.js +232 -113
  42. package/dist/components/2_feed_elements/MessageReactions/composables/usePositioning.js +77 -62
  43. package/dist/components/2_feed_elements/MessageReactions/composables/useReactions.js +62 -20
  44. package/dist/components/2_feed_elements/MessageReactions/composables/useReactionsPanel.js +91 -69
  45. package/dist/components/2_feed_elements/MessageReactions/composables/useReactionsState.js +46 -22
  46. package/dist/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.js +21 -0
  47. package/dist/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.js +21 -0
  48. package/dist/components/2_feed_elements/MessageReactions/utils/quickReactions.js +2 -8
  49. package/dist/components/2_feed_elements/MessageReactions/utils/reactionTooltip.js +39 -0
  50. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +26 -20
  51. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue.js +2 -2
  52. package/dist/components/2_feed_elements/ReplyAudioMessage/ReplyAudioMessage.vue2.js +27 -18
  53. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue.js +2 -2
  54. package/dist/components/2_feed_elements/ReplyCallMessage/ReplyCallMessage.vue2.js +16 -15
  55. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue.js +3 -3
  56. package/dist/components/2_feed_elements/ReplyFileMessage/ReplyFileMessage.vue2.js +27 -18
  57. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue.js +1 -1
  58. package/dist/components/2_feed_elements/ReplyImageMessage/ReplyImageMessage.vue2.js +16 -12
  59. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue.js +4 -4
  60. package/dist/components/2_feed_elements/ReplyStickerMessage/ReplyStickerMessage.vue2.js +74 -65
  61. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue.js +1 -1
  62. package/dist/components/2_feed_elements/ReplyTextMessage/ReplyTextMessage.vue2.js +20 -11
  63. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue.js +2 -2
  64. package/dist/components/2_feed_elements/ReplyVideoMessage/ReplyVideoMessage.vue2.js +13 -9
  65. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue.js +4 -4
  66. package/dist/components/2_feed_elements/StickerMessage/StickerMessage.vue2.js +74 -55
  67. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +4 -4
  68. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +102 -76
  69. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +2 -2
  70. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +74 -55
  71. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
  72. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +99 -82
  73. package/dist/components/3_compounds/Feed/Feed.vue.js +3 -3
  74. package/dist/components/3_compounds/Feed/Feed.vue2.js +159 -139
  75. package/dist/components/3_compounds/Feed/composables/useFeedReply.js +22 -25
  76. package/dist/functions/renderAppleEmojis.js +92 -0
  77. package/dist/hooks/messages/buildReplyPayload.js +14 -0
  78. package/dist/hooks/messages/useMessageLinks.js +60 -50
  79. package/dist/hooks/messages/useStartReply.js +29 -0
  80. package/dist/hooks/useEmojiNative.js +19 -0
  81. package/dist/index.js +130 -122
  82. package/dist/themes/dark.css +1 -1
  83. package/dist/themes/default.css +1 -1
  84. package/dist/themes/glass.css +1 -1
  85. package/dist/themes/green.css +1 -1
  86. package/dist/themes/mobilon1.css +1 -1
  87. package/dist/types/apps/data/messages.d.ts +20 -18
  88. package/dist/types/components/1_atoms/EmojiGlyph/EmojiGlyph.vue.d.ts +12 -0
  89. package/dist/types/components/1_atoms/Tooltip/stories/Tooltip.stories.d.ts +3 -0
  90. package/dist/types/components/1_icons/CloseIcon.vue.d.ts +2 -0
  91. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -0
  92. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +3 -1
  93. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationMenu.d.ts +3 -0
  94. package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationSubMenu.d.ts +4 -2
  95. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +1 -0
  96. package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +9 -1
  97. package/dist/types/components/2_feed_elements/AudioMessage/AudioMessage.vue.d.ts +29 -0
  98. package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +24 -16
  99. package/dist/types/components/2_feed_elements/BaseReplyMessage/styles/types.d.ts +8 -4
  100. package/dist/types/components/2_feed_elements/FileMessage/FileMessage.vue.d.ts +29 -0
  101. package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +20 -0
  102. package/dist/types/components/2_feed_elements/ImageMessage/ImageMessage.vue.d.ts +29 -0
  103. package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +2 -0
  104. package/dist/types/components/2_feed_elements/MessageReactions/MessageReactions.vue.d.ts +64 -1
  105. package/dist/types/components/2_feed_elements/MessageReactions/composables/index.d.ts +2 -2
  106. package/dist/types/components/2_feed_elements/MessageReactions/composables/usePositioning.d.ts +11 -1
  107. package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactions.d.ts +20 -12
  108. package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactionsPanel.d.ts +3 -3
  109. package/dist/types/components/2_feed_elements/MessageReactions/composables/useReactionsState.d.ts +13 -22
  110. package/dist/types/components/2_feed_elements/MessageReactions/icons/ExpandReactionsIcon.vue.d.ts +2 -0
  111. package/dist/types/components/2_feed_elements/MessageReactions/icons/ReplyIcon.vue.d.ts +2 -0
  112. package/dist/types/components/2_feed_elements/MessageReactions/styles/types.d.ts +14 -74
  113. package/dist/types/components/2_feed_elements/MessageReactions/utils/quickReactions.d.ts +1 -1
  114. package/dist/types/components/2_feed_elements/MessageReactions/utils/reactionTooltip.d.ts +14 -0
  115. package/dist/types/components/2_feed_elements/ReplyAudioMessage/styles/types.d.ts +6 -0
  116. package/dist/types/components/2_feed_elements/ReplyCallMessage/styles/types.d.ts +6 -0
  117. package/dist/types/components/2_feed_elements/ReplyFileMessage/styles/types.d.ts +6 -0
  118. package/dist/types/components/2_feed_elements/ReplyImageMessage/styles/types.d.ts +6 -0
  119. package/dist/types/components/2_feed_elements/ReplyStickerMessage/styles/types.d.ts +6 -0
  120. package/dist/types/components/2_feed_elements/ReplyTextMessage/styles/types.d.ts +4 -0
  121. package/dist/types/components/2_feed_elements/ReplyVideoMessage/styles/types.d.ts +6 -0
  122. package/dist/types/components/2_feed_elements/StickerMessage/StickerMessage.vue.d.ts +29 -0
  123. package/dist/types/components/2_feed_elements/TextMessage/TextMessage.vue.d.ts +29 -0
  124. package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +22 -0
  125. package/dist/types/components/2_feed_elements/VideoMessage/VideoMessage.vue.d.ts +29 -0
  126. package/dist/types/components/2_feed_elements/types/messages.d.ts +11 -6
  127. package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
  128. package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +33 -0
  129. package/dist/types/functions/renderAppleEmojis.d.ts +16 -0
  130. package/dist/types/hooks/index.d.ts +1 -0
  131. package/dist/types/hooks/messages/buildReplyPayload.d.ts +11 -0
  132. package/dist/types/hooks/messages/index.d.ts +2 -0
  133. package/dist/types/hooks/messages/useStartReply.d.ts +6 -0
  134. package/dist/types/hooks/useEmojiNative.d.ts +9 -0
  135. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { defineComponent as ie, inject as le, ref as w, computed as p, watch as me, createElementBlock as r, openBlock as o, Fragment as re, createElementVNode as l, createBlock as c, unref as a, normalizeStyle as F, normalizeClass as y, createCommentVNode as i, createVNode as m, withCtx as d, createTextVNode as ue, toDisplayString as T, Transition as b, withModifiers as P, Teleport as de } from "vue";
1
+ import { defineComponent as ie, inject as le, ref as w, computed as p, watch as me, createElementBlock as r, openBlock as o, Fragment as re, createElementVNode as l, createBlock as c, unref as a, normalizeStyle as B, normalizeClass as y, createCommentVNode as i, createVNode as m, withCtx as d, createTextVNode as ue, toDisplayString as R, Transition as b, withModifiers as F, Teleport as de } from "vue";
2
2
  import ce from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
3
3
  import ge from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
4
4
  import ve from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
@@ -11,27 +11,29 @@ import pe from "../../1_atoms/Tooltip/Tooltip.vue.js";
11
11
  import { useMessageActions as he } from "../../../hooks/messages/useMessageActions.js";
12
12
  import { useMessageLinks as xe } from "../../../hooks/messages/useMessageLinks.js";
13
13
  import { useChannelAccentColor as Me } from "../../../hooks/messages/useChannelAccentColor.js";
14
- import { useSubtextTooltip as Te } from "../../../hooks/messages/useSubtextTooltip.js";
15
- import { getStatus as Re, getStatusTitle as Ce } from "../../../functions/getStatusMessage.js";
16
- import { safeMediaPlayVoid as $ } from "../../../functions/safeMediaPlay.js";
17
- import { getMessageClass as Se } from "../../../functions/getMessageClass.js";
18
- import { createReactionHandlers as Ie } from "../../../functions/createReactionHandlers.js";
19
- import "../../../functions/parseMarkdown.js";
14
+ import { useSubtextTooltip as Re } from "../../../hooks/messages/useSubtextTooltip.js";
20
15
  import "../../../hooks/useMessageDraft.js";
21
16
  import "../../../hooks/useSearchModel.js";
22
- import { useTheme as Ae } from "../../../hooks/useTheme.js";
17
+ import { useTheme as Te } from "../../../hooks/useTheme.js";
18
+ import "../../../hooks/useEmojiNative.js";
23
19
  /* empty css */
24
20
  /* empty css */
25
- const Ee = ["messageId"], Le = ["src"], Be = {
21
+ import { buildReplyPayload as Se } from "../../../hooks/messages/buildReplyPayload.js";
22
+ import { getStatus as Ce, getStatusTitle as Ie } from "../../../functions/getStatusMessage.js";
23
+ import { safeMediaPlayVoid as N } from "../../../functions/safeMediaPlay.js";
24
+ import { getMessageClass as Ae } from "../../../functions/getMessageClass.js";
25
+ import { createReactionHandlers as Ee } from "../../../functions/createReactionHandlers.js";
26
+ import "../../../functions/parseMarkdown.js";
27
+ const Le = ["messageId"], Pe = ["src"], Be = {
26
28
  key: 1,
27
29
  class: "video-message__subtext"
28
- }, Fe = ["src"], Pe = {
30
+ }, Fe = ["src"], Ne = {
29
31
  key: 0,
30
32
  class: "video-message__info-container"
31
- }, $e = { class: "video-message__time" }, Oe = {
33
+ }, Ue = { class: "video-message__time" }, $e = {
32
34
  key: 1,
33
35
  class: "video-message__text-container"
34
- }, je = ["innerHTML"], He = ["src", "alt"], us = /* @__PURE__ */ ie({
36
+ }, Oe = ["innerHTML"], je = ["src", "alt"], gs = /* @__PURE__ */ ie({
35
37
  inheritAttrs: !1,
36
38
  __name: "VideoMessage",
37
39
  props: {
@@ -51,6 +53,19 @@ const Ee = ["messageId"], Le = ["src"], Be = {
51
53
  type: Boolean,
52
54
  default: !0
53
55
  },
56
+ reactionsMode: {
57
+ type: String,
58
+ default: "single",
59
+ validator: (e) => ["single", "multi"].includes(e)
60
+ },
61
+ currentUserId: {
62
+ type: [String, Number],
63
+ default: void 0
64
+ },
65
+ reactionUserNames: {
66
+ type: Object,
67
+ default: void 0
68
+ },
54
69
  subtextTooltipData: {
55
70
  type: Object,
56
71
  required: !1,
@@ -63,31 +78,31 @@ const Ee = ["messageId"], Le = ["src"], Be = {
63
78
  }
64
79
  },
65
80
  emits: ["action", "reply", "sms-invite"],
66
- setup(e, { emit: O }) {
67
- const j = le("chatAppId"), { getTheme: R } = Ae(j), t = e, h = O;
68
- function C(u) {
69
- return Se(u.position, "video-message");
81
+ setup(e, { emit: U }) {
82
+ const $ = le("chatAppId"), { getTheme: T } = Te($), t = e, h = U;
83
+ function S(u) {
84
+ return Ae(u.position, "video-message");
70
85
  }
71
- const S = w(), g = w(), x = w(!1), v = w(!1), { linkedHtml: H, inNewWindow: I } = xe(() => t.message.text), {
86
+ const C = w(), g = w(), x = w(!1), v = w(!1), { linkedHtml: O, inNewWindow: I } = xe(() => t.message.text), {
72
87
  isOpenMenu: M,
73
- buttonMenuVisible: N,
74
- showMenu: V,
88
+ buttonMenuVisible: j,
89
+ showMenu: H,
75
90
  hideMenu: A,
76
- clickAction: q,
91
+ clickAction: V,
77
92
  viewsAction: E,
78
- handleClickReplied: D
79
- } = he(t.message, h), U = () => {
80
- V(), v.value = !0;
81
- }, z = p(() => Re(t.message.status)), W = p(() => Ce(t.message.status, t.message.statusMsg)), { bubbleStyle: G } = Me(
93
+ handleClickReplied: q
94
+ } = he(t.message, h), D = () => {
95
+ H(), v.value = !0;
96
+ }, z = p(() => Ce(t.message.status)), W = p(() => Ie(t.message.status, t.message.statusMsg)), { bubbleStyle: G } = Me(
82
97
  p(() => t.message),
83
98
  { cssVariable: "--chotto-videomessage-right-bg", position: "right" }
84
99
  ), J = () => {
85
- g.value && (g.value.currentTime = 0, $(g.value));
100
+ g.value && (g.value.currentTime = 0, N(g.value));
86
101
  };
87
- me([S, g], ([u, s]) => {
88
- u ? s && (s.pause(), s.currentTime = 0) : s && (s.currentTime = 0, $(s));
102
+ me([C, g], ([u, s]) => {
103
+ u ? s && (s.pause(), s.currentTime = 0) : s && (s.currentTime = 0, N(s));
89
104
  });
90
- const K = p(() => t.message.reply && t.message.text ? "0" : t.message.text ? "5px 5px 0 0" : t.message.reply ? "0 0 5px 5px" : "8px"), Q = () => x.value = !1, { onToggleReaction: X, onAddReaction: Y, onRemoveReaction: Z } = Ie(h), _ = async () => {
105
+ const K = p(() => t.message.reply && t.message.text ? "0" : t.message.text ? "5px 5px 0 0" : t.message.reply ? "0 0 5px 5px" : "8px"), Q = () => x.value = !1, { onToggleReaction: X, onAddReaction: Y, onRemoveReaction: Z } = Ee(h), _ = async () => {
91
106
  var u, s;
92
107
  if (t.message.url)
93
108
  try {
@@ -107,23 +122,23 @@ const Ee = ["messageId"], Le = ["src"], Be = {
107
122
  "application/octet-stream": k || "mp4"
108
123
  };
109
124
  let L = k && ["mp4", "mov", "webm", "ogv", "mkv"].includes(k) ? k : ne[te] || "mp4";
110
- const oe = t.message.alt ? t.message.alt.includes(".") ? t.message.alt : `${t.message.alt}.${L}` : `video-${t.message.messageId}.${L}`, B = window.URL.createObjectURL(ae), f = document.createElement("a");
111
- f.href = B, f.download = oe, document.body.appendChild(f), f.click(), document.body.removeChild(f), window.URL.revokeObjectURL(B);
125
+ const oe = t.message.alt ? t.message.alt.includes(".") ? t.message.alt : `${t.message.alt}.${L}` : `video-${t.message.messageId}.${L}`, P = window.URL.createObjectURL(ae), f = document.createElement("a");
126
+ f.href = P, f.download = oe, document.body.appendChild(f), f.click(), document.body.removeChild(f), window.URL.revokeObjectURL(P);
112
127
  } catch (n) {
113
128
  console.error("Ошибка при скачивании видео:", n), window.open(t.message.url, "_blank");
114
129
  }
115
- }, ee = Te(() => t.message, () => t.subtextTooltipData);
130
+ }, ee = Re(() => t.message, () => t.subtextTooltipData);
116
131
  function se() {
117
132
  h("sms-invite", t.message);
118
133
  }
119
134
  return (u, s) => (o(), r(re, null, [
120
135
  l("div", {
121
136
  class: y(["video-message", [
122
- C(e.message),
137
+ S(e.message),
123
138
  e.applyStyle(e.message)
124
139
  ]]),
125
140
  messageId: e.message.messageId,
126
- style: F(a(G)),
141
+ style: B(a(G)),
127
142
  onMouseleave: s[5] || (s[5] = //@ts-ignore
128
143
  (...n) => a(A) && a(A)(...n))
129
144
  }, [
@@ -133,7 +148,7 @@ const Ee = ["messageId"], Le = ["src"], Be = {
133
148
  src: e.message.avatar,
134
149
  height: "32",
135
150
  width: "32"
136
- }, null, 8, Le)) : i("", !0),
151
+ }, null, 8, Pe)) : i("", !0),
137
152
  e.message.subText && e.isFirstInSeries ? (o(), r("p", Be, [
138
153
  m(pe, {
139
154
  text: a(ee),
@@ -141,7 +156,7 @@ const Ee = ["messageId"], Le = ["src"], Be = {
141
156
  offset: 8
142
157
  }, {
143
158
  default: d(() => [
144
- ue(T(e.message.subText), 1)
159
+ ue(R(e.message.subText), 1)
145
160
  ]),
146
161
  _: 1
147
162
  }, 8, ["text", "position"])
@@ -154,19 +169,19 @@ const Ee = ["messageId"], Le = ["src"], Be = {
154
169
  style: { margin: "10px 10px 4px 16px" },
155
170
  class: y(e.message.position),
156
171
  message: e.message.reply,
157
- onReply: a(D)
172
+ onReply: a(q)
158
173
  }, null, 8, ["class", "message", "onReply"])) : i("", !0),
159
174
  l("div", {
160
175
  class: "video-message__preview-button",
161
176
  onClick: s[1] || (s[1] = (n) => x.value = !0),
162
- onMouseenter: U,
177
+ onMouseenter: D,
163
178
  onMouseleave: s[2] || (s[2] = (n) => v.value = !v.value)
164
179
  }, [
165
180
  l("video", {
166
181
  ref_key: "previewPlayer",
167
182
  ref: g,
168
183
  class: "video-message__video",
169
- style: F({ borderRadius: K.value }),
184
+ style: B({ borderRadius: K.value }),
170
185
  src: e.message.url,
171
186
  muted: !0,
172
187
  autoplay: "",
@@ -174,23 +189,23 @@ const Ee = ["messageId"], Le = ["src"], Be = {
174
189
  }, null, 44, Fe),
175
190
  m(b, { name: "modal-fade" }, {
176
191
  default: d(() => [
177
- v.value ? (o(), r("div", Pe, [
192
+ v.value ? (o(), r("div", Ne, [
178
193
  e.message.views ? (o(), r("div", {
179
194
  key: 0,
180
195
  class: "video-message__views",
181
- onClick: s[0] || (s[0] = P(
196
+ onClick: s[0] || (s[0] = F(
182
197
  //@ts-ignore
183
198
  (...n) => a(E) && a(E)(...n),
184
199
  ["stop"]
185
200
  ))
186
201
  }, [
187
202
  s[6] || (s[6] = l("span", { class: "pi pi-eye" }, null, -1)),
188
- l("p", null, T(e.message.views), 1)
203
+ l("p", null, R(e.message.views), 1)
189
204
  ])) : i("", !0),
190
- l("span", $e, T(e.message.time), 1),
205
+ l("span", Ue, R(e.message.time), 1),
191
206
  m(ke, {
192
207
  "base-class": "video-message",
193
- "message-class": C(e.message),
208
+ "message-class": S(e.message),
194
209
  "message-status": e.message.status,
195
210
  "status-class": z.value,
196
211
  "status-title": W.value
@@ -205,7 +220,7 @@ const Ee = ["messageId"], Le = ["src"], Be = {
205
220
  key: 0,
206
221
  class: "video-message__download-button",
207
222
  type: "button",
208
- onClick: P(_, ["stop"])
223
+ onClick: F(_, ["stop"])
209
224
  }, [...s[7] || (s[7] = [
210
225
  l("span", { class: "pi pi-download" }, null, -1)
211
226
  ])])) : i("", !0)
@@ -215,7 +230,7 @@ const Ee = ["messageId"], Le = ["src"], Be = {
215
230
  ], 32),
216
231
  m(b, { name: "modal-fade" }, {
217
232
  default: d(() => [
218
- a(N) && e.message.actions ? (o(), r("button", {
233
+ a(j) && e.message.actions ? (o(), r("button", {
219
234
  key: 0,
220
235
  class: "video-message__menu-button",
221
236
  onClick: s[3] || (s[3] = (n) => M.value = !a(M))
@@ -231,17 +246,17 @@ const Ee = ["messageId"], Le = ["src"], Be = {
231
246
  key: 0,
232
247
  class: "video-message__context-menu",
233
248
  actions: e.message.actions,
234
- onClick: a(q)
249
+ onClick: a(V)
235
250
  }, null, 8, ["actions", "onClick"])) : i("", !0)
236
251
  ]),
237
252
  _: 1
238
253
  }),
239
- e.message.text ? (o(), r("div", Oe, [
254
+ e.message.text ? (o(), r("div", $e, [
240
255
  l("p", {
241
256
  onClick: s[4] || (s[4] = //@ts-ignore
242
257
  (...n) => a(I) && a(I)(...n)),
243
- innerHTML: a(H)
244
- }, null, 8, je)
258
+ innerHTML: a(O)
259
+ }, null, 8, Oe)
245
260
  ])) : i("", !0),
246
261
  m(we, {
247
262
  status: e.message.status,
@@ -262,32 +277,36 @@ const Ee = ["messageId"], Le = ["src"], Be = {
262
277
  m(be, {
263
278
  reactions: e.message.reactions,
264
279
  "message-id": e.message.messageId,
280
+ reply: a(Se)(e.message, "message.video"),
265
281
  enabled: e.reactionsEnabled,
282
+ mode: e.reactionsMode,
283
+ "current-user-id": e.currentUserId,
284
+ "reaction-user-names": e.reactionUserNames,
266
285
  onToggleReaction: a(X),
267
286
  onAddReaction: a(Y),
268
287
  onRemoveReaction: a(Z)
269
- }, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"])
288
+ }, null, 8, ["reactions", "message-id", "reply", "enabled", "mode", "current-user-id", "reaction-user-names", "onToggleReaction", "onAddReaction", "onRemoveReaction"])
270
289
  ], 2)
271
- ], 46, Ee),
290
+ ], 46, Le),
272
291
  (o(), c(de, { to: "body" }, [
273
292
  m(b, { name: "modal-fade" }, {
274
293
  default: d(() => [
275
294
  x.value ? (o(), c(ye, {
276
295
  key: 0,
277
- "data-theme": a(R)().theme ? a(R)().theme : "light",
296
+ "data-theme": a(T)().theme ? a(T)().theme : "light",
278
297
  title: e.message.alt,
279
298
  onClose: Q
280
299
  }, {
281
300
  default: d(() => [
282
301
  l("video", {
283
302
  ref_key: "player",
284
- ref: S,
303
+ ref: C,
285
304
  class: "video-message__modal-video",
286
305
  src: e.message.url,
287
306
  alt: e.message.alt,
288
307
  controls: "",
289
308
  autoplay: ""
290
- }, null, 8, He)
309
+ }, null, 8, je)
291
310
  ]),
292
311
  _: 1
293
312
  }, 8, ["data-theme", "title"])) : i("", !0)
@@ -299,5 +318,5 @@ const Ee = ["messageId"], Le = ["src"], Be = {
299
318
  }
300
319
  });
301
320
  export {
302
- us as default
321
+ gs as default
303
322
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./ChatInput.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-efefc137"]]);
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-db02cef9"]]);
5
5
  export {
6
- a as default
6
+ f as default
7
7
  };
@@ -1,20 +1,25 @@
1
- import { defineComponent as N, inject as G, ref as y, computed as x, watch as p, nextTick as f, unref as r, onMounted as U, createElementBlock as _, openBlock as b, createElementVNode as u, withDirectives as J, createVNode as w, renderSlot as T, toDisplayString as Q, withKeys as X, vModelText as Z, normalizeClass as ee } from "vue";
2
- import { useImmediateDebouncedRef as te } from "../../../hooks/useImmediateDebouncedRef.js";
3
- import { useMessageDraft as ne } from "../../../hooks/useMessageDraft.js";
1
+ import { defineComponent as X, inject as Z, ref as f, computed as h, watch as m, nextTick as v, unref as a, onMounted as ee, createElementBlock as g, openBlock as y, createElementVNode as u, createVNode as H, renderSlot as A, toDisplayString as te, createCommentVNode as ne, withDirectives as le, withKeys as ie, normalizeClass as E, vModelText as oe } from "vue";
2
+ import { useImmediateDebouncedRef as se } from "../../../hooks/useImmediateDebouncedRef.js";
3
+ import { useMessageDraft as ae } from "../../../hooks/useMessageDraft.js";
4
4
  import "../../../hooks/useSearchModel.js";
5
5
  import "../../../hooks/useTheme.js";
6
+ import { useEmojiNative as re } from "../../../hooks/useEmojiNative.js";
6
7
  /* empty css */
7
8
  /* empty css */
8
9
  import "../../../node_modules/linkifyjs/dist/linkify.js";
9
10
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
10
11
  import "../../../functions/parseMarkdown.js";
12
+ import { textToAppleEmojiHtml as ue } from "../../../functions/renderAppleEmojis.js";
11
13
  import { t as c } from "../../../locale/useLocale.js";
12
- import le from "./icons/SendIcon.vue.js";
13
- import ie from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
14
- const oe = { class: "chat-input__container" }, se = ["id"], ae = ["id"], re = { class: "chat-input__inline-buttons" }, ue = {
14
+ import ce from "./icons/SendIcon.vue.js";
15
+ import de from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
16
+ const pe = { class: "chat-input__container" }, fe = ["id"], he = ["id"], me = { class: "chat-input__inline-buttons" }, ve = {
15
17
  key: 0,
16
18
  class: "chat-input__input chat-input__disabled-placeholder"
17
- }, ce = ["disabled", "placeholder"], de = ["disabled"], pe = { class: "" }, fe = { class: "chat-input__third-line" }, De = /* @__PURE__ */ N({
19
+ }, ge = {
20
+ key: 1,
21
+ class: "chat-input__input-wrap"
22
+ }, ye = ["innerHTML"], _e = ["disabled", "placeholder"], xe = ["disabled"], be = { class: "" }, Ie = { class: "chat-input__third-line" }, We = /* @__PURE__ */ X({
18
23
  __name: "ChatInput",
19
24
  props: {
20
25
  state: {
@@ -43,101 +48,103 @@ const oe = { class: "chat-input__container" }, se = ["id"], ae = ["id"], re = {
43
48
  }
44
49
  },
45
50
  emits: ["send", "typing"],
46
- setup(d, { emit: A }) {
47
- const h = A, m = G("chatAppId"), { resetMessage: D, getMessage: i, setMessageText: v, setForceSendMessage: F } = ne(m), n = y(), E = te("", 2e3), M = y(), a = d, P = x(() => !!(a.state == "disabled" || i().text == "" && !i().file || i().isRecording)), R = x(() => {
51
+ setup(d, { emit: k }) {
52
+ const _ = k, p = Z("chatAppId"), { resetMessage: D, getMessage: l, setMessageText: x, setForceSendMessage: F } = ae(p), { isNative: C } = re(p), n = f(), b = f(), L = se("", 2e3), P = f(), R = h(() => ue(l().text || "")), T = () => {
53
+ b.value && n.value && (b.value.scrollTop = n.value.scrollTop);
54
+ }, r = d, z = h(() => !!(r.state == "disabled" || l().text == "" && !l().file || l().isRecording)), B = h(() => {
48
55
  var t;
49
- if (a.inputButtonColor)
50
- return a.inputButtonColor;
51
- if (!((t = a.selectedChannel) != null && t.channelId))
56
+ if (r.inputButtonColor)
57
+ return r.inputButtonColor;
58
+ if (!((t = r.selectedChannel) != null && t.channelId))
52
59
  return "#25D366";
53
- const e = a.selectedChannel.channelId.toLowerCase();
60
+ const e = r.selectedChannel.channelId.toLowerCase();
54
61
  return e.includes("whatsapp") || e.includes("waba") ? "#25D366" : e.includes("telegram") ? "#37AFE2" : e.includes("sms") ? "#6C757D" : e.includes("max") ? "#4B0082" : "#25D366";
55
- }), k = x(() => {
62
+ }), W = h(() => {
56
63
  var t;
57
- if (!((t = a.selectedChannel) != null && t.channelId))
64
+ if (!((t = r.selectedChannel) != null && t.channelId))
58
65
  return c("component.ChatInput.InputPlaceholder");
59
- const e = a.selectedChannel.channelId.toLowerCase();
66
+ const e = r.selectedChannel.channelId.toLowerCase();
60
67
  return e.includes("whatsapp") || e.includes("waba") ? c("component.ChatInput.WhatsappInputPlaceholder") : e.includes("telegram") ? c("component.ChatInput.TelegramInputPlaceholder") : e.includes("sms") ? c("component.ChatInput.SmsInputPlaceholder") : e.includes("max") ? c("component.ChatInput.MaxInputPlaceholder") : c("component.ChatInput.InputPlaceholder");
61
68
  });
62
- p(
63
- () => E.value,
69
+ m(
70
+ () => L.value,
64
71
  () => {
65
- h("typing");
72
+ _("typing");
66
73
  }
67
- ), p(
68
- () => a.focusOnInputArea,
74
+ ), m(
75
+ () => r.focusOnInputArea,
69
76
  () => {
70
- a.focusOnInputArea && f(() => {
71
- const e = r(n);
77
+ r.focusOnInputArea && v(() => {
78
+ const e = a(n);
72
79
  e == null || e.focus();
73
80
  });
74
81
  },
75
82
  { immediate: !0 }
76
- ), p(
77
- () => i().text,
83
+ ), m(
84
+ () => l().text,
78
85
  () => {
79
- f(() => {
86
+ v(() => {
80
87
  const e = n.value;
81
88
  if (!e) return;
82
89
  const t = e.scrollTop;
83
90
  e.style.height = "auto";
84
- const l = getComputedStyle(e), o = parseFloat(l.fontSize) || 16, W = parseFloat(l.lineHeight) || o * 1.4, I = 40, C = W * 11, S = e.scrollHeight, O = i().text.split(`
91
+ const i = getComputedStyle(e), o = parseFloat(i.fontSize) || 16, q = parseFloat(i.lineHeight) || o * 1.4, S = 40, w = q * 11, M = e.scrollHeight, K = l().text.split(`
85
92
  `).length > 1, s = document.createElement("div");
86
- s.style.position = "absolute", s.style.visibility = "hidden", s.style.whiteSpace = "nowrap", s.style.font = l.font, s.style.fontSize = l.fontSize, s.style.fontFamily = l.fontFamily, s.style.fontWeight = l.fontWeight, s.style.letterSpacing = l.letterSpacing, s.textContent = i().text, document.body.appendChild(s);
87
- const Y = s.offsetWidth;
93
+ s.style.position = "absolute", s.style.visibility = "hidden", s.style.whiteSpace = "nowrap", s.style.font = i.font, s.style.fontSize = i.fontSize, s.style.fontFamily = i.fontFamily, s.style.fontWeight = i.fontWeight, s.style.letterSpacing = i.letterSpacing, s.textContent = l().text, document.body.appendChild(s);
94
+ const V = s.offsetWidth;
88
95
  document.body.removeChild(s);
89
- const q = parseFloat(l.paddingLeft) || 0, K = parseFloat(l.paddingRight) || 0, j = e.clientWidth - q - K, V = Y > j, $ = O || V;
90
- i().text.trim() && $ ? S <= C ? (e.style.height = S + "px", e.style.overflowY = "hidden") : (e.style.height = C + "px", e.style.overflowY = "auto", e.scrollTop = t) : (e.style.height = I + "px", e.style.overflowY = "hidden");
96
+ const $ = parseFloat(i.paddingLeft) || 0, G = parseFloat(i.paddingRight) || 0, U = e.clientWidth - $ - G, J = V > U, Q = K || J;
97
+ l().text.trim() && Q ? M <= w ? (e.style.height = M + "px", e.style.overflowY = "hidden") : (e.style.height = w + "px", e.style.overflowY = "auto", e.scrollTop = t) : (e.style.height = S + "px", e.style.overflowY = "hidden"), T();
91
98
  });
92
99
  },
93
100
  { immediate: !0 }
94
- ), p(
95
- () => i().forceSend,
101
+ ), m(
102
+ () => l().forceSend,
96
103
  () => {
97
- i().forceSend && (g(), F(!1));
104
+ l().forceSend && (I(), F(!1));
98
105
  }
99
106
  );
100
- const z = (e) => {
107
+ const j = (e) => {
101
108
  const t = e.target;
102
- h("typing", t.value);
103
- }, B = () => {
104
- f(() => {
109
+ _("typing", t.value);
110
+ }, N = () => {
111
+ v(() => {
105
112
  const e = n.value;
106
113
  e && (e.style.height = "40px", e.style.overflowY = "hidden");
107
114
  });
108
115
  };
109
- U(() => {
110
- B();
116
+ ee(() => {
117
+ N();
111
118
  });
112
- const H = (e) => {
119
+ const O = (e) => {
113
120
  if (e.shiftKey) {
114
121
  if (n.value instanceof HTMLTextAreaElement) {
115
122
  let t = n.value.selectionStart;
116
123
  t && (n.value.setRangeText(`
117
- `, t, t, "end"), v(n.value.value));
124
+ `, t, t, "end"), x(n.value.value));
118
125
  }
119
126
  e.preventDefault();
120
127
  } else if (e.ctrlKey) {
121
128
  if (n.value instanceof HTMLTextAreaElement) {
122
129
  let t = n.value.selectionStart;
123
130
  t && (n.value.setRangeText(`
124
- `, t, t, "end"), v(n.value.value));
131
+ `, t, t, "end"), x(n.value.value));
125
132
  }
126
133
  e.preventDefault();
127
134
  } else
128
- e.preventDefault(), g();
129
- }, L = (e) => {
135
+ e.preventDefault(), I();
136
+ }, Y = (e) => {
130
137
  if (n.value) {
131
138
  const t = n.value.value;
132
139
  n.value.value = e.newText;
133
- const l = e.newText.length - (t.length - (e.end - e.start)), o = e.start + l;
134
- v(e.newText), f(() => {
140
+ const i = e.newText.length - (t.length - (e.end - e.start)), o = e.start + i;
141
+ x(e.newText), v(() => {
135
142
  n.value && (n.value.setSelectionRange(o, o), n.value.focus());
136
143
  });
137
144
  }
138
- }, g = () => {
139
- var t, l;
140
- const e = y(i());
145
+ }, I = () => {
146
+ var t, i;
147
+ const e = f(l());
141
148
  if (e.value.text != "" || e.value.file) {
142
149
  const o = {
143
150
  type: "",
@@ -147,53 +154,63 @@ const oe = { class: "chat-input__container" }, se = ["id"], ae = ["id"], re = {
147
154
  size: "",
148
155
  reply: void 0
149
156
  };
150
- e.value.file ? (o.type = "message." + e.value.file.type, o.url = e.value.file.url, o.filename = e.value.file.name, o.size = (t = e.value.file.size) == null ? void 0 : t.toString(), o.text = (l = e == null ? void 0 : e.value) == null ? void 0 : l.text.trim()) : (o.type = "message.text", o.text = e.value.text.trim()), e.value.reply && (o.reply = e.value.reply), h("send", o), D(), M.value = void 0, n.value && n.value.focus();
157
+ e.value.file ? (o.type = "message." + e.value.file.type, o.url = e.value.file.url, o.filename = e.value.file.name, o.size = (t = e.value.file.size) == null ? void 0 : t.toString(), o.text = (i = e == null ? void 0 : e.value) == null ? void 0 : i.text.trim()) : (o.type = "message.text", o.text = e.value.text.trim()), e.value.reply && (o.reply = e.value.reply), _("send", o), D(), P.value = void 0, n.value && n.value.focus();
151
158
  }
152
159
  };
153
- return (e, t) => (b(), _("div", oe, [
160
+ return (e, t) => (y(), g("div", pe, [
154
161
  u("div", {
155
- id: "chat-input-reply-line-" + r(m),
162
+ id: "chat-input-reply-line-" + a(p),
156
163
  class: "chat-input__reply-line"
157
- }, null, 8, se),
164
+ }, null, 8, fe),
158
165
  u("div", {
159
- id: "chat-input-file-line-" + r(m),
166
+ id: "chat-input-file-line-" + a(p),
160
167
  class: "chat-input__file-line"
161
- }, null, 8, ae),
162
- u("div", re, [
163
- T(e.$slots, "inline-buttons", {}, void 0, !0)
168
+ }, null, 8, he),
169
+ u("div", me, [
170
+ A(e.$slots, "inline-buttons", {}, void 0, !0)
164
171
  ]),
165
- d.disabledPlaceholder && (d.state == "disabled" || r(i)().isRecording) ? (b(), _("div", ue, Q(d.disabledPlaceholder), 1)) : J((b(), _("textarea", {
166
- key: 1,
167
- ref_key: "refInput",
168
- ref: n,
169
- "onUpdate:modelValue": t[0] || (t[0] = (l) => r(i)().text = l),
170
- disabled: d.state == "disabled" || r(i)().isRecording,
171
- class: "chat-input__input",
172
- placeholder: k.value,
173
- onKeydown: X(H, ["enter"]),
174
- onInput: z
175
- }, null, 40, ce)), [
176
- [Z, r(i)().text]
177
- ]),
178
- w(ie, {
172
+ d.disabledPlaceholder && (d.state == "disabled" || a(l)().isRecording) ? (y(), g("div", ve, te(d.disabledPlaceholder), 1)) : (y(), g("div", ge, [
173
+ !a(C) && a(l)().text ? (y(), g("div", {
174
+ key: 0,
175
+ ref_key: "refMirror",
176
+ ref: b,
177
+ class: "chat-input__input-mirror",
178
+ "aria-hidden": "true",
179
+ innerHTML: R.value
180
+ }, null, 8, ye)) : ne("", !0),
181
+ le(u("textarea", {
182
+ ref_key: "refInput",
183
+ ref: n,
184
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => a(l)().text = i),
185
+ disabled: d.state == "disabled" || a(l)().isRecording,
186
+ class: E(["chat-input__input", { "chat-input__input--emoji-images": !a(C) }]),
187
+ placeholder: W.value,
188
+ onKeydown: ie(O, ["enter"]),
189
+ onInput: j,
190
+ onScroll: T
191
+ }, null, 42, _e), [
192
+ [oe, a(l)().text]
193
+ ])
194
+ ])),
195
+ H(de, {
179
196
  textarea: n.value,
180
- onFormatApplied: L
197
+ onFormatApplied: Y
181
198
  }, null, 8, ["textarea"]),
182
199
  u("button", {
183
- class: ee(["chat-input__button", { "chat-input__button-disabled": P.value }]),
184
- disabled: r(i)().isRecording,
185
- onClick: g
200
+ class: E(["chat-input__button", { "chat-input__button-disabled": z.value }]),
201
+ disabled: a(l)().isRecording,
202
+ onClick: I
186
203
  }, [
187
- u("span", pe, [
188
- w(r(le), { color: R.value }, null, 8, ["color"])
204
+ u("span", be, [
205
+ H(a(ce), { color: B.value }, null, 8, ["color"])
189
206
  ])
190
- ], 10, de),
191
- u("div", fe, [
192
- T(e.$slots, "buttons", {}, void 0, !0)
207
+ ], 10, xe),
208
+ u("div", Ie, [
209
+ A(e.$slots, "buttons", {}, void 0, !0)
193
210
  ])
194
211
  ]));
195
212
  }
196
213
  });
197
214
  export {
198
- De as default
215
+ We as default
199
216
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./Feed.vue2.js";
2
2
  /* empty css */
3
- import d from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ d(o, [["__scopeId", "data-v-dd263ded"]]);
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7733717c"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };