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