@mobilon-dev/chotto 0.3.71 → 0.3.72
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./ContactContextMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-10e21295"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as V, inject as _, useId as R, ref as h, computed as j, onMounted as z, watch as P, onUnmounted as U, createElementBlock as D, openBlock as v, createElementVNode as M, normalizeClass as b, unref as a, createBlock as w, createVNode as F, Teleport as G, createCommentVNode as H, nextTick as A } from "vue";
|
|
2
|
+
import J from "../ContextMenu/ContextMenu.vue.js";
|
|
3
3
|
import "../../../hooks/useMessageDraft.js";
|
|
4
4
|
import "../../../hooks/useSearchModel.js";
|
|
5
|
-
import { useTheme as
|
|
5
|
+
import { useTheme as K } from "../../../hooks/useTheme.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
9
9
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
10
10
|
import "../../../functions/parseMarkdown.js";
|
|
11
|
-
import
|
|
12
|
-
const
|
|
11
|
+
import Q from "../../1_icons/MenuIcon.vue.js";
|
|
12
|
+
const W = { class: "contact-context-menu__wrapper" }, X = ["id"], se = /* @__PURE__ */ V({
|
|
13
13
|
__name: "ContactContextMenu",
|
|
14
14
|
props: {
|
|
15
15
|
actions: {
|
|
@@ -33,26 +33,28 @@ const K = { class: "contact-context-menu__wrapper" }, Q = ["id"], ce = /* @__PUR
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
emits: ["click", "buttonClick", "menuMouseEnter", "menuMouseLeave"],
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, S = () => {
|
|
42
|
-
!n.disabled && i.value && n.mode == "hover" && d();
|
|
43
|
-
}, q = () => {
|
|
44
|
-
!n.disabled && i.value && n.mode == "hover" && c();
|
|
36
|
+
setup(y, { expose: B, emit: E }) {
|
|
37
|
+
const I = _("chatAppId"), m = _("extChatAppId", ""), { getTheme: g } = K(I), n = y, f = R(), u = E, c = h(null), s = h(), r = h(!1), i = j(() => Array.isArray(n.actions) && n.actions.length > 0);
|
|
38
|
+
let d = !1;
|
|
39
|
+
const S = (t) => {
|
|
40
|
+
l(), u("click", t);
|
|
45
41
|
}, L = () => {
|
|
46
|
-
|
|
42
|
+
!n.disabled && i.value && (n.mode == "click" && !r.value ? p() : n.mode == "click" && r.value && l(), u("buttonClick"));
|
|
47
43
|
}, O = () => {
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
!n.disabled && i.value && n.mode == "hover" && p();
|
|
45
|
+
}, q = () => {
|
|
46
|
+
!n.disabled && i.value && n.mode == "hover" && l();
|
|
47
|
+
}, T = () => {
|
|
48
|
+
u("menuMouseEnter"), !n.disabled && i.value && n.mode == "hover" && p();
|
|
49
|
+
}, N = () => {
|
|
50
|
+
u("menuMouseLeave"), !n.disabled && i.value && n.mode == "hover" && l();
|
|
51
|
+
}, p = () => {
|
|
52
|
+
if (i.value && s.value && c.value) {
|
|
53
|
+
const t = c.value, e = s.value.getBoundingClientRect();
|
|
52
54
|
t.style.display = "inherit";
|
|
53
|
-
const o =
|
|
54
|
-
t.style.display = "none",
|
|
55
|
-
const
|
|
55
|
+
const o = c.value.getBoundingClientRect();
|
|
56
|
+
t.style.display = "none", A(() => {
|
|
57
|
+
const C = {
|
|
56
58
|
left: { top: e.top - (o.height - e.height) / 2 - o.top, left: e.left - o.width - o.left },
|
|
57
59
|
right: { top: e.top - (o.height - e.height) / 2 - o.top, left: e.left + e.width - o.left },
|
|
58
60
|
bottom: { top: (e == null ? void 0 : e.bottom) - o.top, left: (e == null ? void 0 : e.left) - (o.width - e.width) / 2 - o.left },
|
|
@@ -60,67 +62,70 @@ const K = { class: "contact-context-menu__wrapper" }, Q = ["id"], ce = /* @__PUR
|
|
|
60
62
|
"top-right": { top: e.top - o.height, left: e.right - o.width / 2 },
|
|
61
63
|
"bottom-left": { top: (e == null ? void 0 : e.bottom) - o.top + 10, left: e.left - o.width - o.left + 50 }
|
|
62
64
|
};
|
|
63
|
-
t.style.top =
|
|
65
|
+
t.style.top = C[n.menuSide].top + "px", t.style.left = C[n.menuSide].left + "px", t.style.opacity = "1", t.style.visibility = "visible", t.style.display = "inherit", r.value = !0;
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
|
-
},
|
|
67
|
-
if (
|
|
68
|
-
const t =
|
|
68
|
+
}, l = () => {
|
|
69
|
+
if (c.value) {
|
|
70
|
+
const t = c.value;
|
|
69
71
|
t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.visibility = "hidden", t.style.display = "none", r.value = !1);
|
|
70
72
|
}
|
|
71
|
-
},
|
|
72
|
-
n.mode == "click" && s.value && !s.value.contains(t.target) &&
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (l.value = document.getElementById("context-menu-" + m + p), l.value) {
|
|
77
|
-
const t = l.value;
|
|
78
|
-
t.style.display = "none", t.style.visibility = "hidden", t.style.opacity = "0", c(), document.addEventListener("click", g);
|
|
79
|
-
}
|
|
73
|
+
}, k = (t) => {
|
|
74
|
+
n.mode == "click" && s.value && !s.value.contains(t.target) && l();
|
|
75
|
+
}, x = () => {
|
|
76
|
+
A(() => {
|
|
77
|
+
c.value = document.getElementById("context-menu-" + f + m), c.value && (l(), d || (document.addEventListener("click", k), d = !0));
|
|
80
78
|
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
};
|
|
80
|
+
return z(() => {
|
|
81
|
+
x();
|
|
82
|
+
}), P(i, (t) => {
|
|
83
|
+
if (t) {
|
|
84
|
+
x();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
l();
|
|
88
|
+
}), U(() => {
|
|
89
|
+
d && (document.removeEventListener("click", k), d = !1), c.value && l();
|
|
90
|
+
}), B({
|
|
91
|
+
updatePosition: p,
|
|
92
|
+
hideMenu: l
|
|
93
|
+
}), (t, e) => (v(), D("div", W, [
|
|
94
|
+
M("button", {
|
|
95
|
+
id: "container-" + a(f) + a(m),
|
|
91
96
|
ref_key: "actionScope",
|
|
92
97
|
ref: s,
|
|
93
|
-
class:
|
|
98
|
+
class: b([
|
|
94
99
|
"contact-context-menu__button",
|
|
95
100
|
{ "contact-context-menu__button--no-actions": !i.value }
|
|
96
101
|
]),
|
|
97
|
-
onMouseenter:
|
|
102
|
+
onMouseenter: O,
|
|
98
103
|
onMouseleave: q,
|
|
99
|
-
onClick:
|
|
104
|
+
onClick: L
|
|
100
105
|
}, [
|
|
101
|
-
|
|
102
|
-
class:
|
|
106
|
+
M("span", {
|
|
107
|
+
class: b([
|
|
103
108
|
"contact-context-menu__icon",
|
|
104
109
|
{ "contact-context-menu__icon--no-actions": !i.value }
|
|
105
110
|
])
|
|
106
111
|
}, [
|
|
107
|
-
|
|
112
|
+
F(Q)
|
|
108
113
|
], 2),
|
|
109
|
-
(
|
|
110
|
-
i.value ? (
|
|
114
|
+
(v(), w(G, { to: "body" }, [
|
|
115
|
+
i.value ? (v(), w(J, {
|
|
111
116
|
key: 0,
|
|
112
|
-
id: "context-menu-" + a(
|
|
113
|
-
actions:
|
|
114
|
-
"data-theme": a(
|
|
115
|
-
onMouseenter:
|
|
116
|
-
onMouseleave:
|
|
117
|
-
onClick:
|
|
118
|
-
}, null, 8, ["id", "actions", "data-theme"])) :
|
|
117
|
+
id: "context-menu-" + a(f) + a(m),
|
|
118
|
+
actions: y.actions,
|
|
119
|
+
"data-theme": a(g)().theme ? a(g)().theme : "light",
|
|
120
|
+
onMouseenter: T,
|
|
121
|
+
onMouseleave: N,
|
|
122
|
+
onClick: S
|
|
123
|
+
}, null, 8, ["id", "actions", "data-theme"])) : H("", !0)
|
|
119
124
|
]))
|
|
120
|
-
], 42,
|
|
125
|
+
], 42, X)
|
|
121
126
|
]));
|
|
122
127
|
}
|
|
123
128
|
});
|
|
124
129
|
export {
|
|
125
|
-
|
|
130
|
+
se as default
|
|
126
131
|
};
|