@mobilon-dev/chotto 0.3.41 → 0.3.43
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/Tooltip/Tooltip.vue.js +2 -2
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +60 -52
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +99 -89
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.js +7 -0
- package/dist/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue2.js +64 -0
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +7 -0
- package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +109 -0
- package/dist/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.js +34 -0
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +1 -1
- package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +74 -64
- package/dist/components/3_compounds/ChatList/ChatListHeader.vue.js +43 -10
- package/dist/components/3_compounds/ChatList/icons/LogoIcon.vue.js +19 -0
- package/dist/components/3_compounds/Feed/Feed.vue.js +1 -1
- package/dist/components/3_compounds/Feed/Feed.vue2.js +134 -127
- package/dist/components/3_compounds/Feed/composables/useFeedComponents.js +10 -8
- package/dist/index.js +147 -145
- package/dist/locale/en.js +2 -1
- package/dist/locale/ru.js +2 -1
- package/dist/themes/dark.css +1 -1
- package/dist/themes/default.css +1 -1
- package/dist/themes/glass.css +1 -1
- package/dist/themes/green.css +1 -1
- package/dist/themes/mobilon1.css +1 -1
- package/dist/types/apps/data/messages.d.ts +166 -7
- package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +9 -0
- package/dist/types/components/1_atoms/Tooltip/styles/types.d.ts +2 -0
- package/dist/types/components/2_feed_elements/FileMessage/FileMessage.vue.d.ts +2 -0
- package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +2 -0
- package/dist/types/components/2_feed_elements/MessageSmsInvite/MessageSmsInvite.vue.d.ts +11 -0
- package/dist/types/components/2_feed_elements/MessageSmsInvite/styles/types.d.ts +49 -0
- package/dist/types/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.d.ts +40 -0
- package/dist/types/components/2_feed_elements/MissedCallMessage/icons/MissedCallIcon.vue.d.ts +2 -0
- package/dist/types/components/2_feed_elements/MissedCallMessage/stories/MissedCallMessage.stories.d.ts +12 -0
- package/dist/types/components/2_feed_elements/TextMessage/TextMessage.vue.d.ts +2 -0
- package/dist/types/components/2_feed_elements/types/messages.d.ts +22 -0
- package/dist/types/components/3_compounds/ChatList/ChatListHeader.vue.d.ts +6 -0
- package/dist/types/components/3_compounds/ChatList/icons/LogoIcon.vue.d.ts +2 -0
- package/dist/types/components/3_compounds/ChatList/styles/types.d.ts +44 -0
- package/dist/types/components/3_compounds/Feed/Feed.vue.d.ts +4 -2
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/hooks/validators/messages/types.d.ts +1 -0
- package/dist/types/locale/en.d.ts +1 -0
- package/dist/types/locale/ru.d.ts +1 -0
- package/dist/types/main.d.ts +3 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Tooltip.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d13721a4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as k, inject as N, ref as c, computed as A, onUnmounted as D, createElementBlock as d, openBlock as m, Fragment as R, createElementVNode as V, createBlock as E, renderSlot as I, Teleport as L, createVNode as M, Transition as $, withCtx as j, createCommentVNode as q, normalizeClass as z, unref as v, toDisplayString as F, nextTick as g } from "vue";
|
|
2
2
|
import "../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../hooks/useSearchModel.js";
|
|
4
|
-
import { useTheme as
|
|
4
|
+
import { useTheme as P } from "../../../hooks/useTheme.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
8
8
|
import "../../../functions/parseMarkdown.js";
|
|
9
|
-
const
|
|
9
|
+
const U = ["data-theme"], Y = /* @__PURE__ */ k({
|
|
10
10
|
__name: "Tooltip",
|
|
11
11
|
props: {
|
|
12
12
|
text: {
|
|
@@ -28,71 +28,79 @@ const F = ["data-theme"], W = /* @__PURE__ */ S({
|
|
|
28
28
|
autoShowDuration: {
|
|
29
29
|
type: Number,
|
|
30
30
|
default: 0
|
|
31
|
+
},
|
|
32
|
+
delay: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 600
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
37
|
+
setup(y, { expose: w }) {
|
|
38
|
+
const x = N("chatAppId"), { getTheme: T } = P(x), p = c(), a = c(), n = c(!1), s = c(null), f = c(null), e = y, _ = A(() => ({
|
|
35
39
|
tooltip__text: !0,
|
|
36
40
|
[`tooltip--${e.position}`]: !0
|
|
37
|
-
})),
|
|
38
|
-
e.trigger !== "auto" && (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
e.
|
|
52
|
-
|
|
41
|
+
})), B = () => {
|
|
42
|
+
e.trigger !== "auto" && (f.value && (clearTimeout(f.value), f.value = null), f.value = setTimeout(() => {
|
|
43
|
+
n.value = !0, g(() => {
|
|
44
|
+
if (p.value && a.value) {
|
|
45
|
+
const l = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, r = o.top < 0 ? o.top : 0, u = {
|
|
46
|
+
left: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
|
|
47
|
+
right: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
|
|
48
|
+
bottom: { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) - i },
|
|
49
|
+
top: { top: t.top - o.height - e.offset - r, left: (t == null ? void 0 : t.left) - i },
|
|
50
|
+
"bottom-left": { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
|
|
51
|
+
};
|
|
52
|
+
l.style.top = u[e.position].top + "px", l.style.left = u[e.position].left + "px";
|
|
53
|
+
}
|
|
54
|
+
}), f.value = null;
|
|
55
|
+
}, e.delay));
|
|
56
|
+
}, C = () => {
|
|
57
|
+
e.trigger !== "auto" && (f.value && (clearTimeout(f.value), f.value = null), n.value = !1, g(() => {
|
|
58
|
+
const l = v(a);
|
|
53
59
|
l && (l.style.top = "0", l.style.left = "0");
|
|
54
60
|
}));
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
if (p.value &&
|
|
58
|
-
const l =
|
|
59
|
-
left: { top: t.top - (o.height - t.height) / 2 -
|
|
60
|
-
right: { top: t.top - (o.height - t.height) / 2 -
|
|
61
|
-
bottom: { top: (t == null ? void 0 : t.bottom) -
|
|
62
|
-
top: { top: t.top - o.height - e.offset -
|
|
63
|
-
"bottom-left": { top: (t == null ? void 0 : t.bottom) -
|
|
61
|
+
}, S = () => {
|
|
62
|
+
h(), n.value = !0, g(() => {
|
|
63
|
+
if (p.value && a.value) {
|
|
64
|
+
const l = a.value, t = p.value.getBoundingClientRect(), o = a.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, r = o.top < 0 ? o.top : 0, u = {
|
|
65
|
+
left: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
|
|
66
|
+
right: { top: t.top - (o.height - t.height) / 2 - r, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
|
|
67
|
+
bottom: { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) - i },
|
|
68
|
+
top: { top: t.top - o.height - e.offset - r, left: (t == null ? void 0 : t.left) - i },
|
|
69
|
+
"bottom-left": { top: (t == null ? void 0 : t.bottom) - r + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
|
|
64
70
|
};
|
|
65
|
-
l.style.top =
|
|
71
|
+
l.style.top = u[e.position].top + "px", l.style.left = u[e.position].left + "px";
|
|
66
72
|
}
|
|
67
|
-
}), e.autoShowDuration > 0 && (
|
|
68
|
-
|
|
73
|
+
}), e.autoShowDuration > 0 && (s.value = setTimeout(() => {
|
|
74
|
+
n.value = !1;
|
|
69
75
|
}, e.autoShowDuration));
|
|
70
|
-
},
|
|
71
|
-
|
|
76
|
+
}, h = () => {
|
|
77
|
+
s.value && (clearTimeout(s.value), s.value = null);
|
|
72
78
|
};
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
return D(() => {
|
|
80
|
+
f.value && clearTimeout(f.value), h();
|
|
81
|
+
}), w({
|
|
82
|
+
startAutoShow: S,
|
|
83
|
+
clearAutoTimer: h
|
|
84
|
+
}), (l, t) => (m(), d(R, null, [
|
|
85
|
+
V("div", {
|
|
78
86
|
ref_key: "container",
|
|
79
87
|
ref: p,
|
|
80
88
|
class: "tooltip-wrapper",
|
|
81
|
-
onMouseover:
|
|
82
|
-
onMouseout:
|
|
89
|
+
onMouseover: B,
|
|
90
|
+
onMouseout: C
|
|
83
91
|
}, [
|
|
84
|
-
|
|
92
|
+
I(l.$slots, "default", {}, void 0, !0)
|
|
85
93
|
], 544),
|
|
86
|
-
(
|
|
87
|
-
|
|
88
|
-
default:
|
|
89
|
-
|
|
94
|
+
(m(), E(L, { to: "body" }, [
|
|
95
|
+
M($, null, {
|
|
96
|
+
default: j(() => [
|
|
97
|
+
n.value ? (m(), d("span", {
|
|
90
98
|
key: 0,
|
|
91
99
|
ref_key: "tooltip",
|
|
92
|
-
ref:
|
|
93
|
-
"data-theme":
|
|
94
|
-
class:
|
|
95
|
-
},
|
|
100
|
+
ref: a,
|
|
101
|
+
"data-theme": v(T)().theme ? v(T)().theme : "light",
|
|
102
|
+
class: z(_.value)
|
|
103
|
+
}, F(y.text), 11, U)) : q("", !0)
|
|
96
104
|
]),
|
|
97
105
|
_: 1
|
|
98
106
|
})
|
|
@@ -101,5 +109,5 @@ const F = ["data-theme"], W = /* @__PURE__ */ S({
|
|
|
101
109
|
}
|
|
102
110
|
});
|
|
103
111
|
export {
|
|
104
|
-
|
|
112
|
+
Y as default
|
|
105
113
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./FileMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const s = /* @__PURE__ */ o
|
|
3
|
+
import a from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const s = /* @__PURE__ */ a(o, [["__scopeId", "data-v-2f66aab8"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { defineComponent as z, computed as y, createElementBlock as r, openBlock as o, unref as s, normalizeStyle as k, normalizeClass as u, createCommentVNode as l, createElementVNode as n, createVNode as d, withCtx as T, createTextVNode as p, toDisplayString as f, createBlock as b, withModifiers as W, Transition as G } from "vue";
|
|
2
|
+
import J from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
|
|
3
|
+
import K from "../../1_atoms/LinkPreview/LinkPreview.vue.js";
|
|
4
|
+
import Q from "../../1_atoms/EmbedPreview/EmbedPreview.vue.js";
|
|
5
|
+
import X from "../BaseReplyMessage/BaseReplyMessage.vue.js";
|
|
6
|
+
import Y from "../MessageReactions/MessageReactions.vue.js";
|
|
7
|
+
import Z from "../MessageStatusIndicator/MessageStatusIndicator.vue.js";
|
|
8
|
+
import _ from "../MessageSmsInvite/MessageSmsInvite.vue.js";
|
|
9
|
+
import ee from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
10
|
+
import { useMessageActions as se } from "../../../hooks/messages/useMessageActions.js";
|
|
11
|
+
import { useMessageLinks as te } from "../../../hooks/messages/useMessageLinks.js";
|
|
12
|
+
import { useChannelAccentColor as ae } from "../../../hooks/messages/useChannelAccentColor.js";
|
|
13
|
+
import { useSubtextTooltip as ie } from "../../../hooks/messages/useSubtextTooltip.js";
|
|
14
|
+
import { getStatus as ne, getStatusTitle as oe } from "../../../functions/getStatusMessage.js";
|
|
15
|
+
import { getMessageClass as le } from "../../../functions/getMessageClass.js";
|
|
16
|
+
import { createReactionHandlers as me } from "../../../functions/createReactionHandlers.js";
|
|
16
17
|
import "../../../functions/parseMarkdown.js";
|
|
17
|
-
const
|
|
18
|
+
const re = ["messageId"], ge = ["src"], ce = {
|
|
18
19
|
key: 1,
|
|
19
20
|
class: "file-message__subtext"
|
|
20
|
-
},
|
|
21
|
+
}, ue = ["href"], de = { class: "file-message__filename-text" }, fe = {
|
|
21
22
|
key: 1,
|
|
22
23
|
class: "file-message__text-container"
|
|
23
|
-
},
|
|
24
|
+
}, be = ["innerHTML"], we = { class: "file-message__info-container" }, ve = { class: "file-message__time" }, Ve = /* @__PURE__ */ z({
|
|
24
25
|
__name: "FileMessage",
|
|
25
26
|
props: {
|
|
26
27
|
message: {
|
|
@@ -45,50 +46,53 @@ const oe = ["messageId"], le = ["src"], me = {
|
|
|
45
46
|
default: () => ({})
|
|
46
47
|
}
|
|
47
48
|
},
|
|
48
|
-
emits: ["action", "reply"],
|
|
49
|
+
emits: ["action", "reply", "sms-invite"],
|
|
49
50
|
setup(e, { emit: I }) {
|
|
50
|
-
const
|
|
51
|
-
isOpenMenu:
|
|
52
|
-
buttonMenuVisible:
|
|
53
|
-
showMenu:
|
|
54
|
-
hideMenu:
|
|
55
|
-
clickAction:
|
|
56
|
-
viewsAction:
|
|
57
|
-
handleClickReplied:
|
|
58
|
-
} =
|
|
59
|
-
y(() =>
|
|
51
|
+
const a = e, w = I, { linkedHtml: L, inNewWindow: h } = te(() => a.message.text), {
|
|
52
|
+
isOpenMenu: v,
|
|
53
|
+
buttonMenuVisible: A,
|
|
54
|
+
showMenu: R,
|
|
55
|
+
hideMenu: C,
|
|
56
|
+
clickAction: E,
|
|
57
|
+
viewsAction: x,
|
|
58
|
+
handleClickReplied: F
|
|
59
|
+
} = se(a.message, w), B = y(() => ne(a.message.status)), O = y(() => oe(a.message.status, a.message.statusMsg)), { bubbleStyle: U, messageChannelId: V } = ae(
|
|
60
|
+
y(() => a.message),
|
|
60
61
|
{ cssVariable: "--chotto-filemessage-right-bg", position: "right" }
|
|
61
62
|
);
|
|
62
|
-
function
|
|
63
|
-
return
|
|
63
|
+
function S(m) {
|
|
64
|
+
return le(m.position, "file-message");
|
|
64
65
|
}
|
|
65
|
-
const { onToggleReaction:
|
|
66
|
-
if (
|
|
66
|
+
const { onToggleReaction: H, onAddReaction: N, onRemoveReaction: P } = me(w), $ = async () => {
|
|
67
|
+
if (a.message.url)
|
|
67
68
|
try {
|
|
68
|
-
const m = new URL(
|
|
69
|
+
const m = new URL(a.message.url, window.location.href);
|
|
69
70
|
if (m.origin === window.location.origin) {
|
|
70
71
|
const c = document.createElement("a");
|
|
71
|
-
c.href = m.toString(), c.download =
|
|
72
|
+
c.href = m.toString(), c.download = a.message.filename || `file-${a.message.messageId}`, document.body.appendChild(c), c.click(), document.body.removeChild(c);
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
76
|
-
throw new Error(`HTTP error! status: ${
|
|
77
|
-
const
|
|
78
|
-
g.href = M, g.download =
|
|
75
|
+
const i = await fetch(a.message.url);
|
|
76
|
+
if (!i.ok)
|
|
77
|
+
throw new Error(`HTTP error! status: ${i.status}`);
|
|
78
|
+
const q = await i.blob(), M = window.URL.createObjectURL(q), g = document.createElement("a");
|
|
79
|
+
g.href = M, g.download = a.message.filename || `file-${a.message.messageId}`, document.body.appendChild(g), g.click(), document.body.removeChild(g), window.URL.revokeObjectURL(M);
|
|
79
80
|
} catch (m) {
|
|
80
|
-
console.error("Ошибка при скачивании файла:", m), window.open(
|
|
81
|
+
console.error("Ошибка при скачивании файла:", m), window.open(a.message.url, "_blank");
|
|
81
82
|
}
|
|
82
|
-
},
|
|
83
|
-
|
|
83
|
+
}, j = ie(() => a.message, () => a.subtextTooltipData);
|
|
84
|
+
function D() {
|
|
85
|
+
w("sms-invite", a.message);
|
|
86
|
+
}
|
|
87
|
+
return (m, t) => (o(), r("div", {
|
|
84
88
|
class: u(["file-message", [
|
|
85
|
-
|
|
89
|
+
S(e.message),
|
|
86
90
|
e.applyStyle(e.message)
|
|
87
91
|
]]),
|
|
88
92
|
messageId: e.message.messageId,
|
|
89
|
-
style: k(
|
|
90
|
-
onMouseleave:
|
|
91
|
-
(...
|
|
93
|
+
style: k(s(U)),
|
|
94
|
+
onMouseleave: t[4] || (t[4] = //@ts-ignore
|
|
95
|
+
(...i) => s(C) && s(C)(...i))
|
|
92
96
|
}, [
|
|
93
97
|
e.message.avatar && e.isFirstInSeries ? (o(), r("img", {
|
|
94
98
|
key: 0,
|
|
@@ -97,15 +101,15 @@ const oe = ["messageId"], le = ["src"], me = {
|
|
|
97
101
|
height: "32",
|
|
98
102
|
width: "32",
|
|
99
103
|
style: k({ gridRow: e.message.subText ? "2" : "1" })
|
|
100
|
-
}, null, 12,
|
|
101
|
-
e.message.subText && e.isFirstInSeries ? (o(), r("p",
|
|
102
|
-
d(
|
|
103
|
-
text:
|
|
104
|
+
}, null, 12, ge)) : l("", !0),
|
|
105
|
+
e.message.subText && e.isFirstInSeries ? (o(), r("p", ce, [
|
|
106
|
+
d(ee, {
|
|
107
|
+
text: s(j),
|
|
104
108
|
position: e.message.position === "left" ? "right" : "left",
|
|
105
109
|
offset: 8
|
|
106
110
|
}, {
|
|
107
|
-
default:
|
|
108
|
-
|
|
111
|
+
default: T(() => [
|
|
112
|
+
p(f(e.message.subText), 1)
|
|
109
113
|
]),
|
|
110
114
|
_: 1
|
|
111
115
|
}, 8, ["text", "position"])
|
|
@@ -113,92 +117,98 @@ const oe = ["messageId"], le = ["src"], me = {
|
|
|
113
117
|
n("div", {
|
|
114
118
|
class: u(["file-message__content", { "is-first": e.isFirstInSeries, "with-avatar-indent": !e.isFirstInSeries && e.message.avatar }]),
|
|
115
119
|
style: k({ gridRow: e.message.subText ? "2" : "1" }),
|
|
116
|
-
onMouseenter:
|
|
117
|
-
(...
|
|
120
|
+
onMouseenter: t[3] || (t[3] = //@ts-ignore
|
|
121
|
+
(...i) => s(R) && s(R)(...i))
|
|
118
122
|
}, [
|
|
119
|
-
e.message.reply ? (o(), b(
|
|
123
|
+
e.message.reply ? (o(), b(X, {
|
|
120
124
|
key: 0,
|
|
121
125
|
message: e.message.reply,
|
|
122
126
|
class: u(e.message.position),
|
|
123
|
-
onReply:
|
|
127
|
+
onReply: s(F)
|
|
124
128
|
}, null, 8, ["message", "class", "onReply"])) : l("", !0),
|
|
125
129
|
n("a", {
|
|
126
130
|
class: "file-message__link",
|
|
127
131
|
href: e.message.url,
|
|
128
|
-
onClick:
|
|
132
|
+
onClick: W($, ["prevent"])
|
|
129
133
|
}, [
|
|
130
|
-
|
|
131
|
-
n("p",
|
|
132
|
-
|
|
134
|
+
t[5] || (t[5] = n("span", { class: "pi pi-file" }, null, -1)),
|
|
135
|
+
n("p", de, f(e.message.filename), 1),
|
|
136
|
+
t[6] || (t[6] = n("div", { class: "file-message__download-button" }, [
|
|
133
137
|
n("span", { class: "pi pi-download" })
|
|
134
138
|
], -1))
|
|
135
|
-
], 8,
|
|
136
|
-
e.message.text ? (o(), r("div",
|
|
139
|
+
], 8, ue),
|
|
140
|
+
e.message.text ? (o(), r("div", fe, [
|
|
137
141
|
n("p", {
|
|
138
|
-
onClick:
|
|
139
|
-
(...
|
|
140
|
-
innerHTML:
|
|
141
|
-
}, null, 8,
|
|
142
|
+
onClick: t[0] || (t[0] = //@ts-ignore
|
|
143
|
+
(...i) => s(h) && s(h)(...i)),
|
|
144
|
+
innerHTML: s(L)
|
|
145
|
+
}, null, 8, be)
|
|
142
146
|
])) : l("", !0),
|
|
143
|
-
e.message.linkPreview ? (o(), b(
|
|
147
|
+
e.message.linkPreview ? (o(), b(K, {
|
|
144
148
|
key: 2,
|
|
145
149
|
class: u(e.message.position),
|
|
146
150
|
"link-preview": e.message.linkPreview
|
|
147
151
|
}, null, 8, ["class", "link-preview"])) : l("", !0),
|
|
148
|
-
e.message.embed ? (o(), b(
|
|
152
|
+
e.message.embed ? (o(), b(Q, {
|
|
149
153
|
key: 3,
|
|
150
154
|
class: u(e.message.position),
|
|
151
155
|
embed: e.message.embed
|
|
152
156
|
}, null, 8, ["class", "embed"])) : l("", !0),
|
|
153
|
-
d(
|
|
157
|
+
d(Y, {
|
|
154
158
|
reactions: e.message.reactions,
|
|
155
159
|
"message-id": e.message.messageId,
|
|
156
160
|
enabled: e.reactionsEnabled,
|
|
157
|
-
onToggleReaction:
|
|
158
|
-
onAddReaction:
|
|
159
|
-
onRemoveReaction:
|
|
161
|
+
onToggleReaction: s(H),
|
|
162
|
+
onAddReaction: s(N),
|
|
163
|
+
onRemoveReaction: s(P)
|
|
160
164
|
}, null, 8, ["reactions", "message-id", "enabled", "onToggleReaction", "onAddReaction", "onRemoveReaction"]),
|
|
161
|
-
n("div",
|
|
165
|
+
n("div", we, [
|
|
162
166
|
e.message.views ? (o(), r("div", {
|
|
163
167
|
key: 0,
|
|
164
168
|
class: "file-message__views",
|
|
165
|
-
onClick:
|
|
166
|
-
(...
|
|
169
|
+
onClick: t[1] || (t[1] = //@ts-ignore
|
|
170
|
+
(...i) => s(x) && s(x)(...i))
|
|
167
171
|
}, [
|
|
168
|
-
|
|
172
|
+
t[7] || (t[7] = n("span", { class: "pi pi-eye" }, null, -1)),
|
|
169
173
|
n("p", null, f(e.message.views), 1)
|
|
170
174
|
])) : l("", !0),
|
|
171
|
-
n("span",
|
|
172
|
-
d(
|
|
175
|
+
n("span", ve, f(e.message.time), 1),
|
|
176
|
+
d(Z, {
|
|
173
177
|
"base-class": "file-message",
|
|
174
|
-
"message-class":
|
|
178
|
+
"message-class": S(e.message),
|
|
175
179
|
"message-status": e.message.status,
|
|
176
180
|
"status-class": B.value,
|
|
177
181
|
"status-title": O.value
|
|
178
182
|
}, null, 8, ["message-class", "message-status", "status-class", "status-title"])
|
|
179
183
|
]),
|
|
180
|
-
|
|
184
|
+
d(_, {
|
|
185
|
+
status: e.message.status,
|
|
186
|
+
"has-messenger-account": e.message.hasMessengerAccount,
|
|
187
|
+
channel: s(V),
|
|
188
|
+
onSmsInvite: D
|
|
189
|
+
}, null, 8, ["status", "has-messenger-account", "channel"]),
|
|
190
|
+
s(A) && e.message.actions ? (o(), r("button", {
|
|
181
191
|
key: 4,
|
|
182
192
|
class: "file-message__menu-button",
|
|
183
|
-
onClick:
|
|
184
|
-
}, [...
|
|
193
|
+
onClick: t[2] || (t[2] = (i) => v.value = !s(v))
|
|
194
|
+
}, [...t[8] || (t[8] = [
|
|
185
195
|
n("span", { class: "pi pi-ellipsis-h" }, null, -1)
|
|
186
196
|
])])) : l("", !0),
|
|
187
|
-
d(
|
|
188
|
-
default:
|
|
189
|
-
|
|
197
|
+
d(G, null, {
|
|
198
|
+
default: T(() => [
|
|
199
|
+
s(v) && e.message.actions ? (o(), b(J, {
|
|
190
200
|
key: 0,
|
|
191
201
|
class: "file-message__context-menu",
|
|
192
202
|
actions: e.message.actions,
|
|
193
|
-
onClick:
|
|
203
|
+
onClick: s(E)
|
|
194
204
|
}, null, 8, ["actions", "onClick"])) : l("", !0)
|
|
195
205
|
]),
|
|
196
206
|
_: 1
|
|
197
207
|
})
|
|
198
208
|
], 38)
|
|
199
|
-
], 46,
|
|
209
|
+
], 46, re));
|
|
200
210
|
}
|
|
201
211
|
});
|
|
202
212
|
export {
|
|
203
|
-
|
|
213
|
+
Ve as default
|
|
204
214
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineComponent as _, inject as m, computed as p, createElementBlock as b, createCommentVNode as C, openBlock as M, createElementVNode as k, toDisplayString as D, unref as A } from "vue";
|
|
2
|
+
import { useLocale as T } from "../../../locale/useLocale.js";
|
|
3
|
+
import { useMessageDraft as $ } from "../../../hooks/useMessageDraft.js";
|
|
4
|
+
import "../../../hooks/useSearchModel.js";
|
|
5
|
+
import "../../../hooks/useTheme.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
9
|
+
import "../../../functions/parseMarkdown.js";
|
|
10
|
+
const I = ["data-channel-type"], j = { class: "message-sms-invite__text" }, F = /* @__PURE__ */ _({
|
|
11
|
+
__name: "MessageSmsInvite",
|
|
12
|
+
props: {
|
|
13
|
+
status: {},
|
|
14
|
+
hasMessengerAccount: { type: Boolean },
|
|
15
|
+
channel: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["sms-invite"],
|
|
18
|
+
setup(h, { emit: f }) {
|
|
19
|
+
const i = h, d = f, { t: v } = T(), g = m("chatAppId"), c = m("selectedChat"), { setMessageText: r } = $(g || ""), x = p(() => i.status === "error" && i.hasMessengerAccount === !1), s = p(() => {
|
|
20
|
+
var a;
|
|
21
|
+
const n = ((a = i.channel) == null ? void 0 : a.toLowerCase()) ?? "";
|
|
22
|
+
return n.includes("whatsapp") || n.includes("waba") ? "whatsapp" : n.includes("max") ? "max" : "telegram";
|
|
23
|
+
}), u = p(() => {
|
|
24
|
+
const n = c && c.value ? c.value : null;
|
|
25
|
+
if (!n || !n.contact || !n.contact.attributes) return null;
|
|
26
|
+
const a = n.contact.attributes, l = (e) => {
|
|
27
|
+
if (!e) return null;
|
|
28
|
+
if (typeof e == "string")
|
|
29
|
+
return e.startsWith("+") ? e : `+${e}`;
|
|
30
|
+
if (typeof e == "object") {
|
|
31
|
+
const t = e;
|
|
32
|
+
if (t.phone)
|
|
33
|
+
return t.phone.startsWith("+") ? t.phone : `+${t.phone}`;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
let o = null;
|
|
38
|
+
if (s.value === "whatsapp") {
|
|
39
|
+
const e = a.find((t) => t.type === "whatsapp" || t.type === "waba");
|
|
40
|
+
o = l((e == null ? void 0 : e.data) ?? (e == null ? void 0 : e.value));
|
|
41
|
+
} else if (s.value === "telegram") {
|
|
42
|
+
const e = a.find((t) => t.type === "telegram");
|
|
43
|
+
o = l((e == null ? void 0 : e.data) ?? (e == null ? void 0 : e.value));
|
|
44
|
+
} else if (s.value === "max") {
|
|
45
|
+
const e = a.find((t) => t.type === "max");
|
|
46
|
+
o = l((e == null ? void 0 : e.data) ?? (e == null ? void 0 : e.value));
|
|
47
|
+
}
|
|
48
|
+
return o ? s.value === "whatsapp" ? `Перейдите в WhatsApp https://wa.me/+${o.replace("+", "")}, чтобы продолжить общение` : s.value === "telegram" ? `Перейдите в Telegram https://t.me/+${o.replace("+", "")}, чтобы продолжить общение` : s.value === "max" ? `Перейдите в Max https://max.ru/ и найдите нас по номеру ${o}, чтобы продолжить общение` : null : null;
|
|
49
|
+
}), y = () => {
|
|
50
|
+
u.value && r && r(u.value), d("sms-invite");
|
|
51
|
+
};
|
|
52
|
+
return (n, a) => x.value ? (M(), b("div", {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "message-sms-invite",
|
|
55
|
+
"data-channel-type": s.value,
|
|
56
|
+
onClick: y
|
|
57
|
+
}, [
|
|
58
|
+
k("span", j, D(A(v)("component.TextMessage.sendSmsInvite")), 1)
|
|
59
|
+
], 8, I)) : C("", !0);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
F as default
|
|
64
|
+
};
|