@mobilon-dev/chotto 0.3.112 → 0.3.115
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 +77 -65
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +4 -4
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +42 -44
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
- package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +204 -191
- package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue.js +2 -2
- package/dist/components/2_feed_elements/MessageReactions/MessageReactionsOverlay.vue2.js +1 -0
- package/dist/components/2_feed_elements/MessageReactions/composables/useReactionsPanel.js +1 -1
- package/dist/components/3_compounds/Feed/Feed.vue.js +1 -1
- package/dist/components/3_compounds/Feed/Feed.vue2.js +1 -0
- package/dist/hooks/messages/buildReplyPayload.js +9 -8
- package/dist/hooks/messages/getFileMessageItems.js +20 -0
- package/dist/index.js +72 -69
- 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/src/apps/data/messages.d.ts +45 -0
- package/dist/types/src/components/1_atoms/Tooltip/Tooltip.vue.d.ts +11 -0
- package/dist/types/src/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +11 -0
- package/dist/types/src/components/2_feed_elements/FileMessage/stories/FileMessage.stories.d.ts +1 -0
- package/dist/types/src/components/2_feed_elements/FileMessage/styles/types.d.ts +8 -0
- package/dist/types/src/components/2_feed_elements/types/components.d.ts +3 -3
- package/dist/types/src/components/2_feed_elements/types/messages.d.ts +12 -2
- package/dist/types/src/hooks/messages/buildReplyPayload.d.ts +2 -2
- package/dist/types/src/hooks/messages/getFileMessageItems.d.ts +11 -0
- package/dist/types/src/hooks/messages/index.d.ts +1 -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-0e9ba92c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
1
|
+
import { defineComponent as st, inject as ct, useSlots as ht, ref as u, computed as s, onMounted as mt, onUnmounted as pt, createElementBlock as m, openBlock as c, Fragment as L, createElementVNode as vt, createBlock as gt, renderSlot as R, Teleport as dt, createVNode as yt, Transition as Tt, withCtx as wt, createCommentVNode as xt, renderList as _t, normalizeStyle as Ct, normalizeClass as St, unref as A, createTextVNode as Mt, toDisplayString as kt, nextTick as E } from "vue";
|
|
2
|
+
import { useTheme as Lt } from "../../../hooks/useTheme.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
import "../../../locale/useLocale.js";
|
|
@@ -7,7 +7,7 @@ import "../../../locale/useLocale.js";
|
|
|
7
7
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
8
8
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
9
9
|
import "../../../functions/parseMarkdown.js";
|
|
10
|
-
const
|
|
10
|
+
const At = { key: 0 }, Et = ["data-theme"], Dt = 6, Pt = 120, Yt = /* @__PURE__ */ st({
|
|
11
11
|
__name: "Tooltip",
|
|
12
12
|
props: {
|
|
13
13
|
text: {
|
|
@@ -51,19 +51,24 @@ const Ct = { key: 0 }, Mt = ["data-theme"], Lt = 6, At = 120, Vt = /* @__PURE__
|
|
|
51
51
|
bubbleStyle: {
|
|
52
52
|
type: Object,
|
|
53
53
|
default: () => ({})
|
|
54
|
+
},
|
|
55
|
+
/** Позиционировать пузырь под курсором (clientX/Y), а не по bounds триггера */
|
|
56
|
+
followCursor: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
54
59
|
}
|
|
55
60
|
},
|
|
56
|
-
setup(
|
|
57
|
-
const
|
|
61
|
+
setup(V, { expose: H }) {
|
|
62
|
+
const w = ct("chatAppId"), { getTheme: D } = Lt(w), X = ht(), x = u(), p = u([]), f = u(!1), v = u(null), n = u(null), r = u(null), g = u(!1), d = u(!1), y = u({ x: 0, y: 0 }), e = V, _ = s(() => typeof X.content == "function"), Y = s(() => ({
|
|
58
63
|
tooltip__text: !0,
|
|
59
64
|
[`tooltip--${e.position}`]: !0
|
|
60
|
-
})),
|
|
65
|
+
})), j = s(() => ({
|
|
61
66
|
maxWidth: e.maxWidth || void 0,
|
|
62
67
|
...e.bubbleStyle
|
|
63
|
-
})),
|
|
68
|
+
})), P = s(() => {
|
|
64
69
|
const t = Array.isArray(e.texts) ? e.texts.map((o) => String(o ?? "").trim()).filter(Boolean) : [];
|
|
65
70
|
return t.length > 0 ? t : e.text ? [e.text] : [];
|
|
66
|
-
}),
|
|
71
|
+
}), q = s(() => _.value ? ["__content__"] : P.value), z = s(() => _.value ? !0 : P.value.length > 0), F = (t, o) => {
|
|
67
72
|
const l = o.left < 0 ? o.left : 0, i = o.top < 0 ? o.top : 0;
|
|
68
73
|
return {
|
|
69
74
|
left: {
|
|
@@ -107,92 +112,99 @@ const Ct = { key: 0 }, Mt = ["data-theme"], Lt = 6, At = 120, Vt = /* @__PURE__
|
|
|
107
112
|
left: t.left - l
|
|
108
113
|
}
|
|
109
114
|
}[e.position];
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
}, G = (t) => ({
|
|
116
|
+
// «под курсором»: ниже pointer, по горизонтали — центр пузыря у X курсора
|
|
117
|
+
top: y.value.y + e.offset,
|
|
118
|
+
left: y.value.x - t.width / 2
|
|
119
|
+
}), C = () => {
|
|
120
|
+
if (!x.value || p.value.length === 0) return;
|
|
121
|
+
const t = x.value.getBoundingClientRect(), o = !e.followCursor && e.position.startsWith("top"), l = 8, i = w ? document.getElementById(w) : null, a = i == null ? void 0 : i.getBoundingClientRect(), tt = (a == null ? void 0 : a.top) ?? 0, et = (a == null ? void 0 : a.left) ?? 0, ot = (a == null ? void 0 : a.right) ?? window.innerWidth, lt = (a == null ? void 0 : a.bottom) ?? window.innerHeight;
|
|
122
|
+
p.value.forEach((M, it) => {
|
|
123
|
+
const h = M.getBoundingClientRect(), k = e.followCursor ? G(h) : F(t, h), O = it * (h.height + Dt), rt = o ? k.top - O : k.top + O, $ = tt + l, at = lt - h.height - l, W = et + l, nt = ot - h.width - l, ut = Math.min(Math.max(rt, $), Math.max($, at)), ft = Math.min(Math.max(k.left, W), Math.max(W, nt));
|
|
124
|
+
M.style.top = `${ut}px`, M.style.left = `${ft}px`;
|
|
116
125
|
});
|
|
117
126
|
}, K = () => {
|
|
118
127
|
e.trigger !== "auto" && (n.value && (clearTimeout(n.value), n.value = null), r.value && (clearTimeout(r.value), r.value = null), n.value = setTimeout(() => {
|
|
119
|
-
f.value = !0,
|
|
120
|
-
|
|
128
|
+
f.value = !0, E(() => {
|
|
129
|
+
C();
|
|
121
130
|
}), n.value = null;
|
|
122
131
|
}, e.delay));
|
|
123
|
-
},
|
|
124
|
-
e.trigger !== "auto" && (n.value && (clearTimeout(n.value), n.value = null), r.value && (clearTimeout(r.value), r.value = null), f.value = !1,
|
|
125
|
-
|
|
132
|
+
}, S = () => {
|
|
133
|
+
e.trigger !== "auto" && (n.value && (clearTimeout(n.value), n.value = null), r.value && (clearTimeout(r.value), r.value = null), f.value = !1, E(() => {
|
|
134
|
+
A(p).forEach((o) => {
|
|
126
135
|
o.style.top = "0", o.style.left = "0";
|
|
127
136
|
});
|
|
128
137
|
}));
|
|
129
138
|
}, I = () => {
|
|
130
139
|
e.trigger !== "auto" && (r.value && clearTimeout(r.value), r.value = setTimeout(() => {
|
|
131
|
-
!
|
|
132
|
-
},
|
|
133
|
-
}, U = () => {
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
g.value = !0, r.value && (clearTimeout(r.value), r.value = null);
|
|
139
|
-
}, J = () => {
|
|
140
|
+
!g.value && !d.value && S();
|
|
141
|
+
}, Pt));
|
|
142
|
+
}, U = (t) => {
|
|
143
|
+
g.value = !0, e.followCursor && (y.value = { x: t.clientX, y: t.clientY }), K();
|
|
144
|
+
}, J = (t) => {
|
|
145
|
+
e.followCursor && (y.value = { x: t.clientX, y: t.clientY }, f.value && C());
|
|
146
|
+
}, Q = () => {
|
|
140
147
|
g.value = !1, I();
|
|
148
|
+
}, Z = () => {
|
|
149
|
+
d.value = !0, r.value && (clearTimeout(r.value), r.value = null);
|
|
150
|
+
}, b = () => {
|
|
151
|
+
d.value = !1, I();
|
|
141
152
|
}, N = () => {
|
|
142
153
|
if (e.hideOnClick) {
|
|
143
|
-
if (
|
|
144
|
-
|
|
154
|
+
if (g.value = !1, d.value = !1, e.trigger === "auto") {
|
|
155
|
+
T(), f.value = !1;
|
|
145
156
|
return;
|
|
146
157
|
}
|
|
147
|
-
|
|
158
|
+
S();
|
|
148
159
|
}
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}), e.autoShowDuration > 0 && (
|
|
160
|
+
}, B = () => {
|
|
161
|
+
T(), f.value = !0, E(() => {
|
|
162
|
+
C();
|
|
163
|
+
}), e.autoShowDuration > 0 && (v.value = setTimeout(() => {
|
|
153
164
|
f.value = !1;
|
|
154
165
|
}, e.autoShowDuration));
|
|
155
|
-
},
|
|
156
|
-
|
|
166
|
+
}, T = () => {
|
|
167
|
+
v.value && (clearTimeout(v.value), v.value = null);
|
|
157
168
|
};
|
|
158
|
-
return
|
|
169
|
+
return mt(() => {
|
|
159
170
|
e.hideOnClick && document.addEventListener("mousedown", N, !0);
|
|
160
|
-
}),
|
|
161
|
-
e.hideOnClick && document.removeEventListener("mousedown", N, !0), n.value && clearTimeout(n.value), r.value && clearTimeout(r.value),
|
|
162
|
-
}),
|
|
163
|
-
startAutoShow:
|
|
164
|
-
clearAutoTimer:
|
|
165
|
-
hide:
|
|
166
|
-
}), (t, o) => (c(),
|
|
167
|
-
|
|
171
|
+
}), pt(() => {
|
|
172
|
+
e.hideOnClick && document.removeEventListener("mousedown", N, !0), n.value && clearTimeout(n.value), r.value && clearTimeout(r.value), T();
|
|
173
|
+
}), H({
|
|
174
|
+
startAutoShow: B,
|
|
175
|
+
clearAutoTimer: T,
|
|
176
|
+
hide: S
|
|
177
|
+
}), (t, o) => (c(), m(L, null, [
|
|
178
|
+
vt("div", {
|
|
168
179
|
ref_key: "container",
|
|
169
|
-
ref:
|
|
180
|
+
ref: x,
|
|
170
181
|
class: "tooltip-wrapper",
|
|
171
182
|
onMouseenter: U,
|
|
172
|
-
|
|
183
|
+
onMousemove: J,
|
|
184
|
+
onMouseleave: Q
|
|
173
185
|
}, [
|
|
174
|
-
|
|
186
|
+
R(t.$slots, "default", {}, void 0, !0)
|
|
175
187
|
], 544),
|
|
176
|
-
(c(),
|
|
177
|
-
|
|
178
|
-
default:
|
|
179
|
-
f.value &&
|
|
180
|
-
(c(!0),
|
|
188
|
+
(c(), gt(dt, { to: "body" }, [
|
|
189
|
+
yt(Tt, null, {
|
|
190
|
+
default: wt(() => [
|
|
191
|
+
f.value && z.value ? (c(), m("div", At, [
|
|
192
|
+
(c(!0), m(L, null, _t(q.value, (l, i) => (c(), m("span", {
|
|
181
193
|
key: `${l}-${i}`,
|
|
182
194
|
ref_for: !0,
|
|
183
195
|
ref_key: "tooltipItems",
|
|
184
|
-
ref:
|
|
185
|
-
"data-theme":
|
|
186
|
-
class:
|
|
187
|
-
style:
|
|
188
|
-
onMouseenter:
|
|
189
|
-
onMouseleave:
|
|
196
|
+
ref: p,
|
|
197
|
+
"data-theme": A(D)().theme ? A(D)().theme : "light",
|
|
198
|
+
class: St(Y.value),
|
|
199
|
+
style: Ct(j.value),
|
|
200
|
+
onMouseenter: Z,
|
|
201
|
+
onMouseleave: b
|
|
190
202
|
}, [
|
|
191
|
-
|
|
192
|
-
|
|
203
|
+
_.value ? R(t.$slots, "content", { key: 0 }, void 0, !0) : (c(), m(L, { key: 1 }, [
|
|
204
|
+
Mt(kt(l), 1)
|
|
193
205
|
], 64))
|
|
194
|
-
], 46,
|
|
195
|
-
])) :
|
|
206
|
+
], 46, Et))), 128))
|
|
207
|
+
])) : xt("", !0)
|
|
196
208
|
]),
|
|
197
209
|
_: 3
|
|
198
210
|
})
|
|
@@ -201,5 +213,5 @@ const Ct = { key: 0 }, Mt = ["data-theme"], Lt = 6, At = 120, Vt = /* @__PURE__
|
|
|
201
213
|
}
|
|
202
214
|
});
|
|
203
215
|
export {
|
|
204
|
-
|
|
216
|
+
Yt as default
|
|
205
217
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./DelimiterMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a4bf1ccf"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const k = {
|
|
4
|
-
key:
|
|
5
|
-
class: "delimiter-
|
|
6
|
-
},
|
|
1
|
+
import { defineComponent as v, computed as T, ref as m, onMounted as y, onBeforeUnmount as x, watch as _, createElementBlock as c, openBlock as n, normalizeClass as R, createBlock as D, withCtx as O, createElementVNode as b, toDisplayString as f } from "vue";
|
|
2
|
+
import h from "../../1_atoms/Tooltip/Tooltip.vue.js";
|
|
3
|
+
const w = { class: "delimiter-message__text" }, k = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "delimiter-message__text"
|
|
6
|
+
}, B = 3e3, C = 400, A = /* @__PURE__ */ v({
|
|
7
7
|
__name: "DelimiterMessage",
|
|
8
8
|
props: {
|
|
9
9
|
message: {
|
|
@@ -29,71 +29,69 @@ const k = {
|
|
|
29
29
|
tooltipDelay: {
|
|
30
30
|
type: Number,
|
|
31
31
|
default: 100
|
|
32
|
+
},
|
|
33
|
+
/** Позиционировать тултип под курсором (FDR-0028) */
|
|
34
|
+
tooltipFollowCursor: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !0
|
|
32
37
|
}
|
|
33
38
|
},
|
|
34
39
|
emits: ["read"],
|
|
35
|
-
setup(o, { emit:
|
|
36
|
-
const i = o, r =
|
|
40
|
+
setup(o, { emit: d }) {
|
|
41
|
+
const i = o, r = T(
|
|
37
42
|
() => i.tooltipText || i.message.tooltipText || ""
|
|
38
|
-
),
|
|
43
|
+
), p = d, l = m(null), a = m(!1);
|
|
39
44
|
let t = null, e = null;
|
|
40
|
-
const
|
|
41
|
-
!i.message.autoRemove || !
|
|
42
|
-
(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
},
|
|
45
|
+
const u = () => {
|
|
46
|
+
!i.message.autoRemove || !l.value || (t = new IntersectionObserver(
|
|
47
|
+
(s) => {
|
|
48
|
+
s[0].isIntersecting ? (e && clearTimeout(e), e = setTimeout(() => {
|
|
49
|
+
a.value = !0, t && l.value && (t.disconnect(), t = null), setTimeout(() => {
|
|
50
|
+
p("read", i.message.messageId);
|
|
51
|
+
}, C);
|
|
52
|
+
}, B)) : e && (clearTimeout(e), e = null);
|
|
48
53
|
},
|
|
49
54
|
{
|
|
50
55
|
threshold: 0.75,
|
|
51
56
|
// Элемент должен быть виден минимум на 75%
|
|
52
57
|
rootMargin: "0px"
|
|
53
58
|
}
|
|
54
|
-
), t.observe(
|
|
59
|
+
), t.observe(l.value));
|
|
55
60
|
};
|
|
56
|
-
return
|
|
61
|
+
return y(() => {
|
|
57
62
|
i.message.autoRemove && setTimeout(() => {
|
|
58
|
-
|
|
63
|
+
u();
|
|
59
64
|
}, 100);
|
|
60
|
-
}),
|
|
65
|
+
}), x(() => {
|
|
61
66
|
e && (clearTimeout(e), e = null), t && (t.disconnect(), t = null);
|
|
62
|
-
}),
|
|
67
|
+
}), _(
|
|
63
68
|
() => i.message.autoRemove,
|
|
64
|
-
(
|
|
65
|
-
t && (t.disconnect(), t = null), e && (clearTimeout(e), e = null),
|
|
66
|
-
|
|
69
|
+
(s) => {
|
|
70
|
+
t && (t.disconnect(), t = null), e && (clearTimeout(e), e = null), s && setTimeout(() => {
|
|
71
|
+
u();
|
|
67
72
|
}, 100);
|
|
68
73
|
}
|
|
69
|
-
), (
|
|
70
|
-
|
|
74
|
+
), (s, g) => (n(), c("div", {
|
|
75
|
+
ref_key: "containerRef",
|
|
76
|
+
ref: l,
|
|
77
|
+
class: R(["delimiter-message__container", { "delimiter-message__container--removing": a.value }])
|
|
78
|
+
}, [
|
|
79
|
+
r.value ? (n(), D(h, {
|
|
80
|
+
key: 0,
|
|
71
81
|
text: r.value,
|
|
72
82
|
position: o.tooltipPosition,
|
|
73
83
|
offset: o.tooltipOffset,
|
|
74
|
-
delay: o.tooltipDelay
|
|
84
|
+
delay: o.tooltipDelay,
|
|
85
|
+
"follow-cursor": o.tooltipFollowCursor
|
|
75
86
|
}, {
|
|
76
87
|
default: O(() => [
|
|
77
|
-
|
|
78
|
-
ref_key: "containerRef",
|
|
79
|
-
ref: s,
|
|
80
|
-
class: d(["delimiter-message__container", { "delimiter-message__container--removing": l.value }])
|
|
81
|
-
}, [
|
|
82
|
-
a("p", N, p(o.message.text), 1)
|
|
83
|
-
], 2)
|
|
88
|
+
b("p", w, f(o.message.text), 1)
|
|
84
89
|
]),
|
|
85
90
|
_: 1
|
|
86
|
-
}, 8, ["text", "position", "offset", "delay"])
|
|
87
|
-
])) : (f(), u("div", {
|
|
88
|
-
key: 1,
|
|
89
|
-
ref_key: "containerRef",
|
|
90
|
-
ref: s,
|
|
91
|
-
class: d(["delimiter-message__container", { "delimiter-message__container--removing": l.value }])
|
|
92
|
-
}, [
|
|
93
|
-
a("p", I, p(o.message.text), 1)
|
|
91
|
+
}, 8, ["text", "position", "offset", "delay", "follow-cursor"])) : (n(), c("p", k, f(o.message.text), 1))
|
|
94
92
|
], 2));
|
|
95
93
|
}
|
|
96
94
|
});
|
|
97
95
|
export {
|
|
98
|
-
|
|
96
|
+
A as default
|
|
99
97
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FileMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f338c10a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|