@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.
- package/dist/chotto.css +1 -1
- package/dist/components/1_atoms/ButtonContextMenu/ButtonContextMenu.vue2.js +11 -10
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +7 -6
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +3 -2
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +41 -39
- package/dist/components/2_blocks/FeedSearch/FeedSearch.vue2.js +9 -8
- package/dist/components/2_chatinput_elements/ButtonCommandsSelector/ButtonCommandsSelector.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/ButtonTemplateSelector/ButtonTemplateSelector.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/ButtonWabaTemplateSelector/ButtonWabaTemplateSelector.vue.js +9 -8
- package/dist/components/2_chatinput_elements/FilePreview/FilePreview.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/TemplateSelector/TemplateSelector.vue.js +3 -2
- package/dist/components/2_chatinput_elements/TextFormatToolbar/TextFormatToolbar.vue2.js +3 -2
- package/dist/components/2_chatinput_elements/WABAAttachmentSection/WABAAttachmentSection.vue2.js +14 -13
- package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +15 -14
- package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +3 -2
- package/dist/components/2_elements/ChannelSelector/ChannelSelector.vue.js +3 -2
- package/dist/components/2_elements/ThemeMode/ThemeMode.vue.js +3 -2
- package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +3 -2
- package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +3 -2
- package/dist/components/2_feed_elements/MessageKeyboard/MessageKeyboard.vue2.js +3 -2
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +13 -12
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +69 -65
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +15 -14
- package/dist/components/3_compounds/ChatList/ChatList.vue.js +57 -49
- package/dist/components/3_compounds/Feed/Feed.vue.js +2 -2
- package/dist/components/3_compounds/Feed/composables/useFeedReply.js +8 -7
- package/dist/hooks/messages/useMessageLinks.js +41 -33
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/apps/data/chats.d.ts +9 -0
- package/dist/types/components/2_blocks/CommunicationPanel/styles/types.d.ts +10 -0
- package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +4 -0
- package/dist/types/hooks/messages/useMessageLinks.d.ts +3 -6
- 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
|
|
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" },
|
|
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),
|
|
84
|
-
`).length > 1,
|
|
85
|
-
|
|
86
|
-
const Y =
|
|
87
|
-
document.body.removeChild(
|
|
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)),
|
|
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(
|
|
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
|
|
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 ? (
|
|
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",
|
|
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,
|
|
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
|
-
|
|
198
|
+
De as default
|
|
198
199
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ref as I, computed as M, createElementBlock as
|
|
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
|
|
7
|
-
import { useChatListSelection as
|
|
8
|
-
import { useChatListFilter as
|
|
9
|
-
import { useChatListActions as
|
|
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
|
|
12
|
-
const
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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,
|
|
97
|
+
const l = s, h = F, S = I(), k = M(() => l.chats), {
|
|
90
98
|
isShowButton: B,
|
|
91
|
-
scrollToTopForce:
|
|
92
|
-
scrollCheck:
|
|
93
|
-
startScrollWatch:
|
|
94
|
-
stopScrollWatch:
|
|
95
|
-
} =
|
|
99
|
+
scrollToTopForce: _,
|
|
100
|
+
scrollCheck: C,
|
|
101
|
+
startScrollWatch: T,
|
|
102
|
+
stopScrollWatch: b
|
|
103
|
+
} = H({ refChatList: S, chats: k, emit: h }), {
|
|
96
104
|
selectChat: g
|
|
97
|
-
} =
|
|
105
|
+
} = P({ chats: k, emit: h }), {
|
|
98
106
|
getSortedAndFilteredChats: c,
|
|
99
107
|
getFilter: A
|
|
100
|
-
} =
|
|
108
|
+
} = U({ props: l, emit: h }), {
|
|
101
109
|
expandChat: m,
|
|
102
110
|
action: f,
|
|
103
111
|
handleTabClick: E
|
|
104
|
-
} =
|
|
105
|
-
return (v,
|
|
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(),
|
|
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(),
|
|
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(),
|
|
119
|
-
r("div",
|
|
120
|
-
r("div",
|
|
121
|
-
s.isSearching ? (a(),
|
|
122
|
-
D(' Поиск "' +
|
|
123
|
-
s.searchStats.loaded > 0 ? (a(),
|
|
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(),
|
|
134
|
+
s.searchQuery ? (a(), o("button", {
|
|
127
135
|
key: 0,
|
|
128
136
|
class: "chat-list__search-clear",
|
|
129
137
|
title: "Очистить поиск",
|
|
130
|
-
onClick:
|
|
131
|
-
}, [...
|
|
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(),
|
|
137
|
-
(a(!0),
|
|
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:
|
|
153
|
-
onMousedown:
|
|
154
|
-
onMouseup:
|
|
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(),
|
|
161
|
-
r("div",
|
|
162
|
-
r("p",
|
|
163
|
-
r("p",
|
|
164
|
-
]
|
|
165
|
-
])
|
|
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(),
|
|
177
|
-
(a(!0),
|
|
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(),
|
|
198
|
+
e(B) ? (a(), o("button", {
|
|
191
199
|
key: 0,
|
|
192
200
|
class: "chat-list__button-up",
|
|
193
|
-
onClick:
|
|
194
|
-
}, [...
|
|
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
|
-
},
|
|
210
|
+
}, yt = /* @__PURE__ */ j(it, [["__scopeId", "data-v-53a4e79e"]]);
|
|
203
211
|
export {
|
|
204
|
-
|
|
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
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a6f40e16"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { useMessageDraft as
|
|
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
|
|
10
|
-
const 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 (
|
|
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"),
|
|
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
|
-
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
15
|
-
|
|
16
|
-
if (
|
|
22
|
+
const l = document.createDocumentFragment();
|
|
23
|
+
a.forEach((s) => {
|
|
24
|
+
if (s.isLink) {
|
|
17
25
|
const c = document.createElement("a");
|
|
18
|
-
c.href =
|
|
26
|
+
c.href = s.toHref(), c.target = "_blank", c.textContent = s.toString(), l.appendChild(c);
|
|
19
27
|
} else
|
|
20
|
-
|
|
21
|
-
}), (
|
|
22
|
-
},
|
|
23
|
-
|
|
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: (
|
|
27
|
-
let
|
|
28
|
-
for (;
|
|
29
|
-
if (
|
|
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
|
-
|
|
39
|
+
n = n.parentNode;
|
|
32
40
|
}
|
|
33
41
|
return NodeFilter.FILTER_ACCEPT;
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
|
-
),
|
|
37
|
-
let
|
|
38
|
-
for (;
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
}), inNewWindow: (
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
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
|
-
|
|
55
|
+
_ as useMessageLinks
|
|
48
56
|
};
|