@mobilon-dev/chotto 0.3.54 → 0.3.56

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 (41) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +11 -10
  3. package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +7 -6
  4. package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +3 -2
  5. package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +41 -39
  6. package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +9 -8
  7. package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +3 -2
  8. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +3 -2
  9. package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +3 -2
  10. package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +9 -8
  11. package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +3 -2
  12. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +3 -2
  13. package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +3 -2
  14. package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +3 -2
  15. package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +3 -2
  16. package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +14 -13
  17. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +15 -14
  18. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +3 -2
  19. package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +3 -2
  20. package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +3 -2
  21. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +3 -2
  22. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +3 -2
  23. package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +3 -2
  24. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +13 -12
  25. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +3 -3
  26. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +69 -65
  27. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +15 -14
  28. package/dist/components/3_compounds/ChatList/ChatList.vue.js +57 -49
  29. package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
  30. package/dist/components/3_compounds/Feed/composables/useFeedReply.js +8 -7
  31. package/dist/hooks/messages/useMessageLinks.js +41 -33
  32. package/dist/themes/dark.css +1 -1
  33. package/dist/themes/default.css +1 -1
  34. package/dist/themes/glass.css +1 -1
  35. package/dist/themes/green.css +1 -1
  36. package/dist/themes/mobilon1.css +1 -1
  37. package/dist/types/apps/data/chats.d.ts +9 -0
  38. package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +10 -0
  39. package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +4 -0
  40. package/dist/types/hooks/messages/useMessageLinks.d.ts +3 -6
  41. package/package.json +1 -1
@@ -6,14 +6,15 @@ import "../../../hooks/useTheme.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  import "../../../node_modules/linkifyjs/dist/linkify.js";
9
+ import "../../../node_modules/linkify-string/dist/linkify-string.js";
9
10
  import "../../../functions/parseMarkdown.js";
10
11
  import { t as c } from "../../../locale/useLocale.js";
11
12
  import le from "./icons/SendIcon.vue.js";
12
13
  import ie from "../../2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue.js";
13
- const se = { class: "chat-input__container" }, oe = ["id"], ae = ["id"], re = { class: "chat-input__inline-buttons" }, ue = {
14
+ const oe = { class: "chat-input__container" }, se = ["id"], ae = ["id"], re = { class: "chat-input__inline-buttons" }, ue = {
14
15
  key: 0,
15
16
  class: "chat-input__input chat-input__disabled-placeholder"
16
- }, ce = ["disabled", "placeholder"], de = ["disabled"], pe = { class: "" }, fe = { class: "chat-input__third-line" }, Ae = /* @__PURE__ */ N({
17
+ }, ce = ["disabled", "placeholder"], de = ["disabled"], pe = { class: "" }, fe = { class: "chat-input__third-line" }, De = /* @__PURE__ */ N({
17
18
  __name: "ChatInput",
18
19
  props: {
19
20
  state: {
@@ -80,11 +81,11 @@ const se = { class: "chat-input__container" }, oe = ["id"], ae = ["id"], re = {
80
81
  if (!e) return;
81
82
  const t = e.scrollTop;
82
83
  e.style.height = "auto";
83
- const l = getComputedStyle(e), s = parseFloat(l.fontSize) || 16, W = parseFloat(l.lineHeight) || s * 1.4, I = 40, C = W * 11, S = e.scrollHeight, O = i().text.split(`
84
- `).length > 1, o = document.createElement("div");
85
- o.style.position = "absolute", o.style.visibility = "hidden", o.style.whiteSpace = "nowrap", o.style.font = l.font, o.style.fontSize = l.fontSize, o.style.fontFamily = l.fontFamily, o.style.fontWeight = l.fontWeight, o.style.letterSpacing = l.letterSpacing, o.textContent = i().text, document.body.appendChild(o);
86
- const Y = o.offsetWidth;
87
- document.body.removeChild(o);
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(`
85
+ `).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;
88
+ document.body.removeChild(s);
88
89
  const q = parseFloat(l.paddingLeft) || 0, K = parseFloat(l.paddingRight) || 0, j = e.clientWidth - q - K, V = Y > j, $ = O || V;
89
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");
90
91
  });
@@ -129,16 +130,16 @@ const se = { class: "chat-input__container" }, oe = ["id"], ae = ["id"], re = {
129
130
  if (n.value) {
130
131
  const t = n.value.value;
131
132
  n.value.value = e.newText;
132
- const l = e.newText.length - (t.length - (e.end - e.start)), s = e.start + l;
133
+ const l = e.newText.length - (t.length - (e.end - e.start)), o = e.start + l;
133
134
  v(e.newText), f(() => {
134
- n.value && (n.value.setSelectionRange(s, s), n.value.focus());
135
+ n.value && (n.value.setSelectionRange(o, o), n.value.focus());
135
136
  });
136
137
  }
137
138
  }, g = () => {
138
139
  var t, l;
139
140
  const e = y(i());
140
141
  if (e.value.text != "" || e.value.file) {
141
- const s = {
142
+ const o = {
142
143
  type: "",
143
144
  text: "",
144
145
  url: "",
@@ -146,14 +147,14 @@ const se = { class: "chat-input__container" }, oe = ["id"], ae = ["id"], re = {
146
147
  size: "",
147
148
  reply: void 0
148
149
  };
149
- e.value.file ? (s.type = "message." + e.value.file.type, s.url = e.value.file.url, s.filename = e.value.file.name, s.size = (t = e.value.file.size) == null ? void 0 : t.toString(), s.text = (l = e == null ? void 0 : e.value) == null ? void 0 : l.text.trim()) : (s.type = "message.text", s.text = e.value.text.trim()), e.value.reply && (s.reply = e.value.reply), h("send", s), D(), M.value = void 0, n.value && n.value.focus();
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();
150
151
  }
151
152
  };
152
- return (e, t) => (b(), _("div", se, [
153
+ return (e, t) => (b(), _("div", oe, [
153
154
  u("div", {
154
155
  id: "chat-input-reply-line-" + r(m),
155
156
  class: "chat-input__reply-line"
156
- }, null, 8, oe),
157
+ }, null, 8, se),
157
158
  u("div", {
158
159
  id: "chat-input-file-line-" + r(m),
159
160
  class: "chat-input__file-line"
@@ -194,5 +195,5 @@ const se = { class: "chat-input__container" }, oe = ["id"], ae = ["id"], re = {
194
195
  }
195
196
  });
196
197
  export {
197
- Ae as default
198
+ De as default
198
199
  };
@@ -1,18 +1,18 @@
1
- import { ref as I, computed as M, createElementBlock as i, openBlock as a, renderSlot as L, createBlock as h, createCommentVNode as n, createElementVNode as r, createVNode as w, unref as e, toDisplayString as u, createTextVNode as D, Fragment as y, renderList as p, Transition as Q, withCtx as N } from "vue";
1
+ import { ref as I, computed as M, createElementBlock as o, openBlock as a, renderSlot as L, createBlock as u, createCommentVNode as n, createElementVNode as r, createVNode as w, unref as e, toDisplayString as d, createTextVNode as D, Fragment as y, renderList as p, Transition as Q, withCtx as N } from "vue";
2
2
  import x from "../../2_chatlist_elements/ChatItem/ChatItem.vue.js";
3
3
  import V from "../../2_chatlist_elements/ChatFilter/ChatFilter.vue.js";
4
4
  import $ from "../../2_chatlist_elements/ChatTabs/ChatTabs.vue.js";
5
5
  import q from "../../1_atoms/LoadingIndicator/LoadingIndicator.vue.js";
6
- import { useChatListScroll as P } from "./composables/useChatListScroll.js";
7
- import { useChatListSelection as U } from "./composables/useChatListSelection.js";
8
- import { useChatListFilter as W } from "./composables/useChatListFilter.js";
9
- import { useChatListActions as j } from "./composables/useChatListActions.js";
6
+ import { useChatListScroll as H } from "./composables/useChatListScroll.js";
7
+ import { useChatListSelection as P } from "./composables/useChatListSelection.js";
8
+ import { useChatListFilter as U } from "./composables/useChatListFilter.js";
9
+ import { useChatListActions as W } from "./composables/useChatListActions.js";
10
10
  /* empty css */
11
- import O from "../../../_virtual/_plugin-vue_export-helper.js";
12
- const R = { class: "chat-list" }, z = {
11
+ import j from "../../../_virtual/_plugin-vue_export-helper.js";
12
+ const O = { class: "chat-list" }, R = {
13
13
  key: 2,
14
14
  class: "chat-list__search-indicator"
15
- }, G = { class: "chat-list__search-content" }, H = { class: "chat-list__search-text" }, J = {
15
+ }, z = { class: "chat-list__search-content" }, G = { class: "chat-list__search-text" }, J = {
16
16
  key: 0,
17
17
  class: "chat-list__search-progress"
18
18
  }, K = {
@@ -27,10 +27,10 @@ const R = { class: "chat-list" }, z = {
27
27
  }, Z = {
28
28
  key: 0,
29
29
  class: "chat-list__no-data"
30
- }, tt = {
30
+ }, tt = { class: "chat-list__placeholder" }, et = { class: "chat-list__placeholder-title" }, st = { class: "chat-list__placeholder-hint" }, at = {
31
31
  key: 4,
32
32
  class: "chat-list__fixed-items-bottom"
33
- }, et = {
33
+ }, it = {
34
34
  __name: "ChatList",
35
35
  props: {
36
36
  chats: {
@@ -82,59 +82,67 @@ const R = { class: "chat-list" }, z = {
82
82
  type: String,
83
83
  default: "hover",
84
84
  validator: (s) => ["hover", "rightClick"].includes(s)
85
+ },
86
+ placeholderTitle: {
87
+ type: String,
88
+ default: "Нет контактных данных, чтобы начать чат"
89
+ },
90
+ placeholderHint: {
91
+ type: String,
92
+ default: "Добавьте номер телефона и Имя в карточку контакта"
85
93
  }
86
94
  },
87
95
  emits: ["select", "action", "loadMoreChats", "expand", "tab-click", "search", "clear-search"],
88
96
  setup(s, { emit: F }) {
89
- const l = s, d = F, S = I(), k = M(() => l.chats), {
97
+ const l = s, h = F, S = I(), k = M(() => l.chats), {
90
98
  isShowButton: B,
91
- scrollToTopForce: C,
92
- scrollCheck: _,
93
- startScrollWatch: b,
94
- stopScrollWatch: T
95
- } = P({ refChatList: S, chats: k, emit: d }), {
99
+ scrollToTopForce: _,
100
+ scrollCheck: C,
101
+ startScrollWatch: T,
102
+ stopScrollWatch: b
103
+ } = H({ refChatList: S, chats: k, emit: h }), {
96
104
  selectChat: g
97
- } = U({ chats: k, emit: d }), {
105
+ } = P({ chats: k, emit: h }), {
98
106
  getSortedAndFilteredChats: c,
99
107
  getFilter: A
100
- } = W({ props: l, emit: d }), {
108
+ } = U({ props: l, emit: h }), {
101
109
  expandChat: m,
102
110
  action: f,
103
111
  handleTabClick: E
104
- } = j({ emit: d });
105
- return (v, o) => (a(), i("div", R, [
112
+ } = W({ emit: h });
113
+ return (v, i) => (a(), o("div", O, [
106
114
  L(v.$slots, "header", {}, void 0, !0),
107
115
  L(v.$slots, "sidebar", {}, void 0, !0),
108
- s.filterEnabled ? (a(), h(V, {
116
+ s.filterEnabled ? (a(), u(V, {
109
117
  key: 0,
110
118
  class: "chat-list__filter",
111
119
  onUpdate: e(A)
112
120
  }, null, 8, ["onUpdate"])) : n("", !0),
113
- s.dialogTabs && s.dialogTabs.length > 0 ? (a(), h($, {
121
+ s.dialogTabs && s.dialogTabs.length > 0 ? (a(), u($, {
114
122
  key: 1,
115
123
  tabs: s.dialogTabs,
116
124
  onTabClick: e(E)
117
125
  }, null, 8, ["tabs", "onTabClick"])) : n("", !0),
118
- s.isSearching || s.searchQuery ? (a(), i("div", z, [
119
- r("div", G, [
120
- r("div", H, [
121
- s.isSearching ? (a(), i("span", J, u(s.searchProgress || "Поиск..."), 1)) : (a(), i("span", K, [
122
- D(' Поиск "' + u(s.searchQuery) + '" завершён ', 1),
123
- s.searchStats.loaded > 0 ? (a(), i("span", X, " (" + u(s.searchStats.loaded) + " " + u(s.searchStats.total !== "?" ? `из ${s.searchStats.total}` : "") + ") ", 1)) : n("", !0)
126
+ s.isSearching || s.searchQuery ? (a(), o("div", R, [
127
+ r("div", z, [
128
+ r("div", G, [
129
+ s.isSearching ? (a(), o("span", J, d(s.searchProgress || "Поиск..."), 1)) : (a(), o("span", K, [
130
+ D(' Поиск "' + d(s.searchQuery) + '" завершён ', 1),
131
+ s.searchStats.loaded > 0 ? (a(), o("span", X, " (" + d(s.searchStats.loaded) + " " + d(s.searchStats.total !== "?" ? `из ${s.searchStats.total}` : "") + ") ", 1)) : n("", !0)
124
132
  ]))
125
133
  ]),
126
- s.searchQuery ? (a(), i("button", {
134
+ s.searchQuery ? (a(), o("button", {
127
135
  key: 0,
128
136
  class: "chat-list__search-clear",
129
137
  title: "Очистить поиск",
130
- onClick: o[0] || (o[0] = (t) => d("clear-search"))
131
- }, [...o[5] || (o[5] = [
138
+ onClick: i[0] || (i[0] = (t) => h("clear-search"))
139
+ }, [...i[5] || (i[5] = [
132
140
  r("i", { class: "pi pi-times" }, null, -1)
133
141
  ])])) : n("", !0)
134
142
  ])
135
143
  ])) : n("", !0),
136
- !l.isLoading && e(c)().filter((t) => t.isFixedTop).length > 0 ? (a(), i("div", Y, [
137
- (a(!0), i(y, null, p(e(c)().filter((t) => t.isFixedTop), (t) => (a(), h(x, {
144
+ !l.isLoading && e(c)().filter((t) => t.isFixedTop).length > 0 ? (a(), o("div", Y, [
145
+ (a(!0), o(y, null, p(e(c)().filter((t) => t.isFixedTop), (t) => (a(), u(x, {
138
146
  key: t.chatId,
139
147
  class: "chat-list__item",
140
148
  chat: t,
@@ -149,20 +157,20 @@ const R = { class: "chat-list" }, z = {
149
157
  ref_key: "refChatList",
150
158
  ref: S,
151
159
  class: "chat-list__items",
152
- onScroll: o[1] || (o[1] = (...t) => e(_) && e(_)(...t)),
153
- onMousedown: o[2] || (o[2] = (...t) => e(b) && e(b)(...t)),
154
- onMouseup: o[3] || (o[3] = (...t) => e(T) && e(T)(...t))
160
+ onScroll: i[1] || (i[1] = (...t) => e(C) && e(C)(...t)),
161
+ onMousedown: i[2] || (i[2] = (...t) => e(T) && e(T)(...t)),
162
+ onMouseup: i[3] || (i[3] = (...t) => e(b) && e(b)(...t))
155
163
  }, [
156
164
  w(q, {
157
165
  class: "chat-list__loading-indicator",
158
166
  "is-loading": l.isLoading
159
167
  }, null, 8, ["is-loading"]),
160
- !l.isLoading && e(c)().length === 0 ? (a(), i("div", Z, [...o[6] || (o[6] = [
161
- r("div", { class: "chat-list__placeholder" }, [
162
- r("p", { class: "chat-list__placeholder-title" }, " Нет контактных данных, чтобы начать чат "),
163
- r("p", { class: "chat-list__placeholder-hint" }, " Добавьте номер телефона или имя Telegram в карточку контакта ")
164
- ], -1)
165
- ])])) : (a(!0), i(y, { key: 1 }, p(e(c)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (a(), h(x, {
168
+ !l.isLoading && e(c)().length === 0 ? (a(), o("div", Z, [
169
+ r("div", tt, [
170
+ r("p", et, d(s.placeholderTitle), 1),
171
+ r("p", st, d(s.placeholderHint), 1)
172
+ ])
173
+ ])) : (a(!0), o(y, { key: 1 }, p(e(c)().filter((t) => !t.isFixedBottom && !t.isFixedTop), (t) => (a(), u(x, {
166
174
  key: t.chatId,
167
175
  class: "chat-list__item",
168
176
  chat: t,
@@ -173,8 +181,8 @@ const R = { class: "chat-list" }, z = {
173
181
  onAction: e(f)
174
182
  }, null, 8, ["chat", "show-dialogs", "context-menu-trigger", "onSelect", "onExpand", "onAction"]))), 128))
175
183
  ], 544),
176
- !l.isLoading && e(c)().filter((t) => t.isFixedBottom).length > 0 ? (a(), i("div", tt, [
177
- (a(!0), i(y, null, p(e(c)().filter((t) => t.isFixedBottom), (t) => (a(), h(x, {
184
+ !l.isLoading && e(c)().filter((t) => t.isFixedBottom).length > 0 ? (a(), o("div", at, [
185
+ (a(!0), o(y, null, p(e(c)().filter((t) => t.isFixedBottom), (t) => (a(), u(x, {
178
186
  key: t.chatId,
179
187
  class: "chat-list__item",
180
188
  chat: t,
@@ -187,11 +195,11 @@ const R = { class: "chat-list" }, z = {
187
195
  ])) : n("", !0),
188
196
  w(Q, null, {
189
197
  default: N(() => [
190
- e(B) ? (a(), i("button", {
198
+ e(B) ? (a(), o("button", {
191
199
  key: 0,
192
200
  class: "chat-list__button-up",
193
- onClick: o[4] || (o[4] = (...t) => e(C) && e(C)(...t))
194
- }, [...o[7] || (o[7] = [
201
+ onClick: i[4] || (i[4] = (...t) => e(_) && e(_)(...t))
202
+ }, [...i[6] || (i[6] = [
195
203
  r("span", { class: "pi pi-angle-up chat-list__icon-down" }, null, -1)
196
204
  ])])) : n("", !0)
197
205
  ]),
@@ -199,7 +207,7 @@ const R = { class: "chat-list" }, z = {
199
207
  })
200
208
  ]));
201
209
  }
202
- }, gt = /* @__PURE__ */ O(et, [["__scopeId", "data-v-60e0e8be"]]);
210
+ }, yt = /* @__PURE__ */ j(it, [["__scopeId", "data-v-53a4e79e"]]);
203
211
  export {
204
- gt as default
212
+ yt as default
205
213
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./Feed.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c2343dea"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a6f40e16"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,13 +1,14 @@
1
- import { inject as d } from "vue";
2
- import { useMessageDraft as o } from "../../../../hooks/useMessageDraft.js";
1
+ import { inject as o } from "vue";
2
+ import { useMessageDraft as d } from "../../../../hooks/useMessageDraft.js";
3
3
  import "../../../../hooks/useSearchModel.js";
4
4
  import "../../../../hooks/useTheme.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  import "../../../../node_modules/linkifyjs/dist/linkify.js";
8
+ import "../../../../node_modules/linkify-string/dist/linkify-string.js";
8
9
  import "../../../../functions/parseMarkdown.js";
9
- function x({ enableDoubleClickReply: s, emit: n }) {
10
- const i = d("chatAppId"), { setReply: p, getMessage: r, resetReply: a } = o(i);
10
+ function A({ enableDoubleClickReply: p, emit: n }) {
11
+ const i = o("chatAppId"), { setReply: s, getMessage: r, resetReply: a } = d(i);
11
12
  return {
12
13
  getMessage: r,
13
14
  messageAction: (e) => {
@@ -17,9 +18,9 @@ function x({ enableDoubleClickReply: s, emit: n }) {
17
18
  n("clickRepliedMessage", e);
18
19
  },
19
20
  feedObjectDoubleClick: (e, t) => {
20
- if (s && (e == null || e.preventDefault(), t.type.indexOf("system") === -1 && t.type.indexOf("typing") === -1)) {
21
+ if (p && (e == null || e.preventDefault(), t.type.indexOf("system") === -1 && t.type.indexOf("typing") === -1)) {
21
22
  const l = document.getElementById("chat-input-reply-line-" + i);
22
- l && (l.style.display = "inherit"), p({
23
+ l && (l.style.display = "inherit"), s({
23
24
  messageId: t.messageId,
24
25
  type: t.type,
25
26
  text: t.text,
@@ -38,5 +39,5 @@ function x({ enableDoubleClickReply: s, emit: n }) {
38
39
  };
39
40
  }
40
41
  export {
41
- x as useFeedReply
42
+ A as useFeedReply
42
43
  };
@@ -1,48 +1,56 @@
1
1
  import { computed as h } from "vue";
2
2
  import { tokenize as N } from "../../node_modules/linkifyjs/dist/linkify.js";
3
- import { parseMarkdown as T } from "../../functions/parseMarkdown.js";
4
- const x = (p) => ({ linkedHtml: h(() => {
5
- const n = p();
6
- if (!n) return "";
7
- const t = T(n), o = document.createElement("div");
8
- o.innerHTML = t;
9
- const f = (r) => {
10
- var m;
11
- const e = r.textContent || "", d = N(e);
12
- if (d.length === 1 && !d[0].isLink)
3
+ import T from "../../node_modules/linkify-string/dist/linkify-string.js";
4
+ import { parseMarkdown as E } from "../../functions/parseMarkdown.js";
5
+ function k(e) {
6
+ return e.includes("**") || e.includes("`") || e.includes("~~") || e.includes(`
7
+
8
+ `) || e.includes(">") && e.trimStart().startsWith(">") || /<\/(u|s|b|i)>|<(u|s|b|i)[\s>]/.test(e);
9
+ }
10
+ const _ = (e) => ({ linkedHtml: h(() => {
11
+ const t = e();
12
+ if (!t) return "";
13
+ if (!k(t))
14
+ return T(t);
15
+ const r = E(t), i = document.createElement("div");
16
+ i.innerHTML = r;
17
+ const p = (o) => {
18
+ var u;
19
+ const n = o.textContent || "", a = N(n);
20
+ if (a.length === 1 && !a[0].isLink)
13
21
  return;
14
- const s = document.createDocumentFragment();
15
- d.forEach((i) => {
16
- if (i.isLink) {
22
+ const l = document.createDocumentFragment();
23
+ a.forEach((s) => {
24
+ if (s.isLink) {
17
25
  const c = document.createElement("a");
18
- c.href = i.toHref(), c.target = "_blank", c.textContent = i.toString(), s.appendChild(c);
26
+ c.href = s.toHref(), c.target = "_blank", c.textContent = s.toString(), l.appendChild(c);
19
27
  } else
20
- s.appendChild(document.createTextNode(i.toString()));
21
- }), (m = r.parentNode) == null || m.replaceChild(s, r);
22
- }, u = document.createTreeWalker(
23
- o,
28
+ l.appendChild(document.createTextNode(s.toString()));
29
+ }), (u = o.parentNode) == null || u.replaceChild(l, o);
30
+ }, f = document.createTreeWalker(
31
+ i,
24
32
  NodeFilter.SHOW_TEXT,
25
33
  {
26
- acceptNode: (r) => {
27
- let e = r.parentNode;
28
- for (; e && e !== o; ) {
29
- if (e.nodeName === "A")
34
+ acceptNode: (o) => {
35
+ let n = o.parentNode;
36
+ for (; n && n !== i; ) {
37
+ if (n.nodeName === "A")
30
38
  return NodeFilter.FILTER_REJECT;
31
- e = e.parentNode;
39
+ n = n.parentNode;
32
40
  }
33
41
  return NodeFilter.FILTER_ACCEPT;
34
42
  }
35
43
  }
36
- ), l = [];
37
- let a;
38
- for (; a = u.nextNode(); )
39
- a.nodeType === Node.TEXT_NODE && l.push(a);
40
- return l.reverse().forEach(f), o.innerHTML;
41
- }), inNewWindow: (n) => {
42
- n.preventDefault();
43
- const t = n.target;
44
- t && "href" in t && t.href && window.open(t.href, "_blank");
44
+ ), m = [];
45
+ let d;
46
+ for (; d = f.nextNode(); )
47
+ d.nodeType === Node.TEXT_NODE && m.push(d);
48
+ return m.reverse().forEach(p), i.innerHTML;
49
+ }), inNewWindow: (t) => {
50
+ t.preventDefault();
51
+ const r = t.target;
52
+ r && "href" in r && r.href && window.open(r.href, "_blank");
45
53
  } });
46
54
  export {
47
- x as useMessageLinks
55
+ _ as useMessageLinks
48
56
  };