@mobilon-dev/chotto 0.3.35 → 0.3.37
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/ContactContextMenu/ContactContextMenu.vue.js +7 -0
- package/dist/components/1_atoms/ContactContextMenu/ContactContextMenu.vue2.js +114 -0
- package/dist/components/1_atoms/ContextMenu/ContextMenu.vue.js +23 -19
- package/dist/components/1_atoms/Tooltip/Tooltip.vue.js +2 -2
- package/dist/components/1_atoms/Tooltip/Tooltip.vue2.js +62 -34
- package/dist/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.js +262 -203
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.js +56 -52
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationAttributes.js +20 -17
- package/dist/components/2_blocks/CommunicationPanel/composables/useCommunicationDialogSync.js +27 -23
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue.js +1 -1
- package/dist/components/2_chatinput_elements/StickerPicker/StickerPicker.vue2.js +176 -203
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.js +7 -0
- package/dist/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue2.js +18 -0
- package/dist/components/2_feed_elements/MessageStatusIndicator/MessageStatusIndicator.vue.js +1 -1
- package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
- package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +71 -65
- package/dist/components/3_compounds/ChatList/composables/useChatListFilter.js +14 -17
- package/dist/components/3_compounds/Feed/composables/useFeedComponents.js +13 -11
- package/dist/index.js +239 -235
- package/dist/locale/en.js +4 -0
- package/dist/locale/ru.js +6 -2
- 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/components/1_atoms/ContactContextMenu/ContactContextMenu.vue.d.ts +59 -0
- package/dist/types/components/1_atoms/ContactContextMenu/stories/ContactContextMenu.stories.d.ts +10 -0
- package/dist/types/components/1_atoms/ContactContextMenu/styles/types.d.ts +67 -0
- package/dist/types/components/1_atoms/ContextMenu/styles/types.d.ts +6 -0
- package/dist/types/components/1_atoms/Tooltip/Tooltip.vue.d.ts +22 -1
- package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +6 -0
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationActions.d.ts +6 -2
- package/dist/types/components/2_blocks/CommunicationPanel/composables/useCommunicationDialogSync.d.ts +10 -2
- package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +6 -0
- package/dist/types/components/2_chatlist_elements/ChatItem/styles/types.d.ts +8 -0
- package/dist/types/components/2_feed_elements/DelimiterMessage/DelimiterMessage.vue.d.ts +13 -0
- package/dist/types/components/2_feed_elements/DelimiterMessage/stories/DelimiterMessage.stories.d.ts +6 -0
- package/dist/types/components/2_feed_elements/DelimiterMessage/styles/types.d.ts +27 -0
- package/dist/types/components/2_feed_elements/types/messages.d.ts +4 -0
- package/dist/types/components/3_compounds/ChatList/ChatList.vue.d.ts +1 -1
- package/dist/types/components/3_compounds/ChatList/composables/useChatListFilter.d.ts +3 -3
- package/dist/types/components/4_layouts/BaseLayout/styles/types.d.ts +6 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/locale/en.d.ts +4 -0
- package/dist/types/locale/ru.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { defineComponent as L, inject as g, useId as O, ref as m, onMounted as T, nextTick as k, onUnmounted as N, createElementBlock as R, openBlock as x, createElementVNode as M, unref as c, createBlock as V, createVNode as _, Teleport as j } from "vue";
|
|
2
|
+
import P from "../ContextMenu/ContextMenu.vue.js";
|
|
3
|
+
import "../../../hooks/useMessageDraft.js";
|
|
4
|
+
import "../../../hooks/useSearchModel.js";
|
|
5
|
+
import { useTheme as U } from "../../../hooks/useTheme.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
9
|
+
import "../../../functions/parseMarkdown.js";
|
|
10
|
+
import z from "../../1_icons/MenuIcon.vue.js";
|
|
11
|
+
const D = { class: "contact-context-menu__wrapper" }, F = ["id"], G = { class: "contact-context-menu__icon" }, te = /* @__PURE__ */ L({
|
|
12
|
+
__name: "ContactContextMenu",
|
|
13
|
+
props: {
|
|
14
|
+
actions: {
|
|
15
|
+
type: Array,
|
|
16
|
+
required: !0
|
|
17
|
+
},
|
|
18
|
+
mode: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: !1,
|
|
21
|
+
default: "hover"
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1,
|
|
26
|
+
required: !1
|
|
27
|
+
},
|
|
28
|
+
menuSide: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: !1,
|
|
31
|
+
default: "top"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: ["click", "buttonClick", "menuMouseEnter", "menuMouseLeave"],
|
|
35
|
+
setup(f, { expose: C, emit: b }) {
|
|
36
|
+
const w = g("chatAppId"), u = g("extChatAppId", ""), { getTheme: h } = U(w), i = f, p = O(), a = b, n = m(), s = m(), d = m(!1), B = (t) => {
|
|
37
|
+
l(), a("click", t);
|
|
38
|
+
}, I = () => {
|
|
39
|
+
i.disabled || (i.mode == "click" && !d.value ? r() : i.mode == "click" && d.value && l(), a("buttonClick"));
|
|
40
|
+
}, E = () => {
|
|
41
|
+
i.disabled || i.mode == "hover" && r();
|
|
42
|
+
}, S = () => {
|
|
43
|
+
i.disabled || i.mode == "hover" && l();
|
|
44
|
+
}, A = () => {
|
|
45
|
+
a("menuMouseEnter"), i.disabled || i.mode == "hover" && r();
|
|
46
|
+
}, q = () => {
|
|
47
|
+
a("menuMouseLeave"), i.disabled || i.mode == "hover" && l();
|
|
48
|
+
}, r = () => {
|
|
49
|
+
if (s.value && n.value) {
|
|
50
|
+
const t = n.value, e = s.value.getBoundingClientRect();
|
|
51
|
+
t.style.display = "inherit";
|
|
52
|
+
const o = n.value.getBoundingClientRect();
|
|
53
|
+
t.style.display = "none", k(() => {
|
|
54
|
+
const y = {
|
|
55
|
+
left: { top: e.top - (o.height - e.height) / 2 - o.top, left: e.left - o.width - o.left },
|
|
56
|
+
right: { top: e.top - (o.height - e.height) / 2 - o.top, left: e.left + e.width - o.left },
|
|
57
|
+
bottom: { top: (e == null ? void 0 : e.bottom) - o.top, left: (e == null ? void 0 : e.left) - (o.width - e.width) / 2 - o.left },
|
|
58
|
+
top: { top: e.top - o.height - o.top, left: (e == null ? void 0 : e.left) - (o.width - e.width) / 2 - o.left },
|
|
59
|
+
"top-right": { top: e.top - o.height, left: e.right - o.width / 2 },
|
|
60
|
+
"bottom-left": { top: (e == null ? void 0 : e.bottom) - o.top + 10, left: e.left - o.width - o.left + 50 }
|
|
61
|
+
};
|
|
62
|
+
t.style.top = y[i.menuSide].top + "px", t.style.left = y[i.menuSide].left + "px", t.style.opacity = "1", t.style.visibility = "visible", t.style.display = "inherit", d.value = !0;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}, l = () => {
|
|
66
|
+
if (n.value) {
|
|
67
|
+
const t = n.value;
|
|
68
|
+
t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.visibility = "hidden", t.style.display = "none", d.value = !1);
|
|
69
|
+
}
|
|
70
|
+
}, v = (t) => {
|
|
71
|
+
i.mode == "click" && s.value && !s.value.contains(t.target) && l();
|
|
72
|
+
};
|
|
73
|
+
return T(() => {
|
|
74
|
+
k(() => {
|
|
75
|
+
if (n.value = document.getElementById("context-menu-" + p + u), n.value) {
|
|
76
|
+
const t = n.value;
|
|
77
|
+
t.style.display = "none", t.style.visibility = "hidden", t.style.opacity = "0", l(), document.addEventListener("click", v);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}), N(() => {
|
|
81
|
+
document.removeEventListener("click", v), n.value && l();
|
|
82
|
+
}), C({
|
|
83
|
+
updatePosition: r,
|
|
84
|
+
hideMenu: l
|
|
85
|
+
}), (t, e) => (x(), R("div", D, [
|
|
86
|
+
M("button", {
|
|
87
|
+
id: "container-" + c(p) + c(u),
|
|
88
|
+
ref_key: "actionScope",
|
|
89
|
+
ref: s,
|
|
90
|
+
class: "contact-context-menu__button",
|
|
91
|
+
onMouseenter: E,
|
|
92
|
+
onMouseleave: S,
|
|
93
|
+
onClick: I
|
|
94
|
+
}, [
|
|
95
|
+
M("span", G, [
|
|
96
|
+
_(z)
|
|
97
|
+
]),
|
|
98
|
+
(x(), V(j, { to: "body" }, [
|
|
99
|
+
_(P, {
|
|
100
|
+
id: "context-menu-" + c(p) + c(u),
|
|
101
|
+
actions: f.actions,
|
|
102
|
+
"data-theme": c(h)().theme ? c(h)().theme : "light",
|
|
103
|
+
onMouseenter: A,
|
|
104
|
+
onMouseleave: q,
|
|
105
|
+
onClick: B
|
|
106
|
+
}, null, 8, ["id", "actions", "data-theme"])
|
|
107
|
+
]))
|
|
108
|
+
], 40, F)
|
|
109
|
+
]));
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
export {
|
|
113
|
+
te as default
|
|
114
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
1
|
+
import { createElementBlock as n, openBlock as t, createElementVNode as _, Fragment as h, renderList as y, normalizeClass as d, createBlock as k, createCommentVNode as r, resolveDynamicComponent as f, toDisplayString as a } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const v = ["id", "data-theme"], x = { class: "context-menu__list" },
|
|
5
|
-
key:
|
|
3
|
+
import g from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const v = ["id", "data-theme"], x = { class: "context-menu__list" }, C = ["onClick"], b = ["src"], w = {
|
|
5
|
+
key: 3,
|
|
6
6
|
style: { "white-space": "nowrap" }
|
|
7
|
-
},
|
|
7
|
+
}, M = { key: 4 }, B = {
|
|
8
8
|
__name: "ContextMenu",
|
|
9
9
|
props: {
|
|
10
10
|
actions: {
|
|
@@ -23,38 +23,42 @@ const v = ["id", "data-theme"], x = { class: "context-menu__list" }, f = ["onCli
|
|
|
23
23
|
emits: ["click", "mouseenter", "mouseleave"],
|
|
24
24
|
setup(o, { emit: u }) {
|
|
25
25
|
const l = o, i = u, p = (c) => {
|
|
26
|
-
const
|
|
27
|
-
i("click",
|
|
26
|
+
const s = l.actions[c];
|
|
27
|
+
i("click", s);
|
|
28
28
|
};
|
|
29
|
-
return (c,
|
|
29
|
+
return (c, s) => (t(), n("div", {
|
|
30
30
|
id: o.id,
|
|
31
31
|
class: "context-menu__container",
|
|
32
32
|
"data-theme": o.dataTheme,
|
|
33
|
-
onMouseenter:
|
|
34
|
-
onMouseleave:
|
|
33
|
+
onMouseenter: s[0] || (s[0] = (e) => i("mouseenter")),
|
|
34
|
+
onMouseleave: s[1] || (s[1] = (e) => i("mouseleave"))
|
|
35
35
|
}, [
|
|
36
36
|
_("ul", x, [
|
|
37
|
-
(
|
|
37
|
+
(t(!0), n(h, null, y(l.actions, (e, m) => (t(), n("li", {
|
|
38
38
|
key: m,
|
|
39
39
|
class: d(["context-menu__item", { "context-menu__item--disabled": e.disabled }]),
|
|
40
|
-
onClick: (
|
|
40
|
+
onClick: (S) => !e.disabled && p(m)
|
|
41
41
|
}, [
|
|
42
|
-
e.icon ? (
|
|
42
|
+
e.icon && typeof e.icon == "string" ? (t(), n("img", {
|
|
43
43
|
key: 0,
|
|
44
44
|
src: e.icon,
|
|
45
45
|
width: "18",
|
|
46
46
|
height: "18"
|
|
47
|
-
}, null, 8,
|
|
47
|
+
}, null, 8, b)) : e.icon && typeof e.icon == "object" ? (t(), k(f(e.icon), {
|
|
48
48
|
key: 1,
|
|
49
|
+
width: "18",
|
|
50
|
+
height: "18"
|
|
51
|
+
})) : e.prime ? (t(), n("i", {
|
|
52
|
+
key: 2,
|
|
49
53
|
class: d("pi pi-" + e.prime)
|
|
50
54
|
}, null, 2)) : r("", !0),
|
|
51
|
-
e.title ? (
|
|
52
|
-
e.description ? (
|
|
53
|
-
], 10,
|
|
55
|
+
e.title ? (t(), n("span", w, a(e.title), 1)) : r("", !0),
|
|
56
|
+
e.description ? (t(), n("span", M, a(e.description), 1)) : r("", !0)
|
|
57
|
+
], 10, C))), 128))
|
|
54
58
|
])
|
|
55
59
|
], 40, v));
|
|
56
60
|
}
|
|
57
|
-
},
|
|
61
|
+
}, N = /* @__PURE__ */ g(B, [["__scopeId", "data-v-e3896a76"]]);
|
|
58
62
|
export {
|
|
59
|
-
|
|
63
|
+
N as default
|
|
60
64
|
};
|
|
@@ -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 f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-16a60fe9"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, inject as k, ref as s, computed as N, createElementBlock as w, openBlock as h, Fragment as A, createElementVNode as D, createBlock as R, renderSlot as V, Teleport as E, createVNode as I, Transition as L, withCtx as M, createCommentVNode as $, normalizeClass as j, unref as u, toDisplayString as q, nextTick as m } from "vue";
|
|
2
2
|
import "../../../hooks/useMessageDraft.js";
|
|
3
3
|
import "../../../hooks/useSearchModel.js";
|
|
4
|
-
import { useTheme as
|
|
4
|
+
import { useTheme as z } 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 F = ["data-theme"], W = /* @__PURE__ */ S({
|
|
10
10
|
__name: "Tooltip",
|
|
11
11
|
props: {
|
|
12
12
|
text: {
|
|
@@ -20,51 +20,79 @@ const q = ["data-theme"], K = /* @__PURE__ */ T({
|
|
|
20
20
|
offset: {
|
|
21
21
|
type: Number,
|
|
22
22
|
default: 8
|
|
23
|
+
},
|
|
24
|
+
trigger: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "hover"
|
|
27
|
+
},
|
|
28
|
+
autoShowDuration: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
33
|
+
setup(g, { expose: T }) {
|
|
34
|
+
const d = k("chatAppId"), { getTheme: v } = z(d), p = s(), r = s(), a = s(!1), n = s(null), e = g, x = N(() => ({
|
|
27
35
|
tooltip__text: !0,
|
|
28
|
-
[`tooltip--${
|
|
36
|
+
[`tooltip--${e.position}`]: !0
|
|
29
37
|
})), _ = () => {
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
const l =
|
|
33
|
-
left: { top: t.top - (
|
|
34
|
-
right: { top: t.top - (
|
|
35
|
-
bottom: { top: (t == null ? void 0 : t.bottom) -
|
|
36
|
-
top: { top: t.top -
|
|
37
|
-
"bottom-left": { top: (t == null ? void 0 : t.bottom) -
|
|
38
|
+
e.trigger !== "auto" && (a.value = !0, m(() => {
|
|
39
|
+
if (p.value && r.value) {
|
|
40
|
+
const l = r.value, t = p.value.getBoundingClientRect(), o = r.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, f = o.top < 0 ? o.top : 0, c = {
|
|
41
|
+
left: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
|
|
42
|
+
right: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
|
|
43
|
+
bottom: { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) - i },
|
|
44
|
+
top: { top: t.top - o.height - e.offset - f, left: (t == null ? void 0 : t.left) - i },
|
|
45
|
+
"bottom-left": { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
|
|
38
46
|
};
|
|
39
|
-
l.style.top =
|
|
47
|
+
l.style.top = c[e.position].top + "px", l.style.left = c[e.position].left + "px";
|
|
40
48
|
}
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
const l =
|
|
49
|
+
}));
|
|
50
|
+
}, B = () => {
|
|
51
|
+
e.trigger !== "auto" && (a.value = !1, m(() => {
|
|
52
|
+
const l = u(r);
|
|
45
53
|
l && (l.style.top = "0", l.style.left = "0");
|
|
46
|
-
});
|
|
54
|
+
}));
|
|
55
|
+
}, C = () => {
|
|
56
|
+
y(), a.value = !0, m(() => {
|
|
57
|
+
if (p.value && r.value) {
|
|
58
|
+
const l = r.value, t = p.value.getBoundingClientRect(), o = r.value.getBoundingClientRect(), i = o.left < 0 ? o.left : 0, f = o.top < 0 ? o.top : 0, c = {
|
|
59
|
+
left: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) - o.width - i - e.offset },
|
|
60
|
+
right: { top: t.top - (o.height - t.height) / 2 - f, left: (t == null ? void 0 : t.left) + t.width - i + e.offset },
|
|
61
|
+
bottom: { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) - i },
|
|
62
|
+
top: { top: t.top - o.height - e.offset - f, left: (t == null ? void 0 : t.left) - i },
|
|
63
|
+
"bottom-left": { top: (t == null ? void 0 : t.bottom) - f + e.offset, left: (t == null ? void 0 : t.left) + t.width - o.width - i }
|
|
64
|
+
};
|
|
65
|
+
l.style.top = c[e.position].top + "px", l.style.left = c[e.position].left + "px";
|
|
66
|
+
}
|
|
67
|
+
}), e.autoShowDuration > 0 && (n.value = setTimeout(() => {
|
|
68
|
+
a.value = !1;
|
|
69
|
+
}, e.autoShowDuration));
|
|
70
|
+
}, y = () => {
|
|
71
|
+
n.value && (clearTimeout(n.value), n.value = null);
|
|
47
72
|
};
|
|
48
|
-
return (
|
|
49
|
-
|
|
73
|
+
return T({
|
|
74
|
+
startAutoShow: C,
|
|
75
|
+
clearAutoTimer: y
|
|
76
|
+
}), (l, t) => (h(), w(A, null, [
|
|
77
|
+
D("div", {
|
|
50
78
|
ref_key: "container",
|
|
51
|
-
ref:
|
|
79
|
+
ref: p,
|
|
52
80
|
class: "tooltip-wrapper",
|
|
53
81
|
onMouseover: _,
|
|
54
|
-
onMouseout:
|
|
82
|
+
onMouseout: B
|
|
55
83
|
}, [
|
|
56
|
-
|
|
84
|
+
V(l.$slots, "default", {}, void 0, !0)
|
|
57
85
|
], 544),
|
|
58
|
-
(
|
|
59
|
-
|
|
60
|
-
default:
|
|
61
|
-
|
|
86
|
+
(h(), R(E, { to: "body" }, [
|
|
87
|
+
I(L, null, {
|
|
88
|
+
default: M(() => [
|
|
89
|
+
a.value ? (h(), w("span", {
|
|
62
90
|
key: 0,
|
|
63
91
|
ref_key: "tooltip",
|
|
64
|
-
ref:
|
|
65
|
-
"data-theme":
|
|
66
|
-
class:
|
|
67
|
-
},
|
|
92
|
+
ref: r,
|
|
93
|
+
"data-theme": u(v)().theme ? u(v)().theme : "light",
|
|
94
|
+
class: j(x.value)
|
|
95
|
+
}, q(g.text), 11, F)) : $("", !0)
|
|
68
96
|
]),
|
|
69
97
|
_: 1
|
|
70
98
|
})
|
|
@@ -73,5 +101,5 @@ const q = ["data-theme"], K = /* @__PURE__ */ T({
|
|
|
73
101
|
}
|
|
74
102
|
});
|
|
75
103
|
export {
|
|
76
|
-
|
|
104
|
+
W as default
|
|
77
105
|
};
|