@mobilon-dev/chotto 0.3.89 → 0.3.90
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/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +2 -2
- package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +41 -33
- package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ButtonEmojiPicker.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1b5902eb"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as D, ref as
|
|
1
|
+
import { defineComponent as D, ref as l, inject as R, watch as W, computed as z, watchEffect as U, onMounted as $, onUnmounted as q, createElementBlock as j, openBlock as C, Fragment as G, createCommentVNode as J, createVNode as g, unref as y, normalizeClass as K, createElementVNode as B, Transition as Q, withCtx as X, withDirectives as Y, vShow as Z } from "vue";
|
|
2
2
|
import ee from "../../../node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { useMessageDraft as te } from "../../../hooks/useMessageDraft.js";
|
|
@@ -13,7 +13,7 @@ import "../../../node_modules/linkifyjs/dist/linkify.js";
|
|
|
13
13
|
import "../../../node_modules/linkify-string/dist/linkify-string.js";
|
|
14
14
|
import "../../../functions/parseMarkdown.js";
|
|
15
15
|
import ne from "./icons/SmilesIcon.vue.js";
|
|
16
|
-
const
|
|
16
|
+
const ye = /* @__PURE__ */ D({
|
|
17
17
|
__name: "ButtonEmojiPicker",
|
|
18
18
|
props: {
|
|
19
19
|
state: {
|
|
@@ -24,7 +24,7 @@ const be = /* @__PURE__ */ D({
|
|
|
24
24
|
type: String,
|
|
25
25
|
default: "click",
|
|
26
26
|
// или 'hover'
|
|
27
|
-
validator: (
|
|
27
|
+
validator: (a) => ["click", "hover"].includes(a)
|
|
28
28
|
},
|
|
29
29
|
/**
|
|
30
30
|
* true — системные эмодзи; false — 3D (Apple) в пикере, инпуте и ленте.
|
|
@@ -33,17 +33,24 @@ const be = /* @__PURE__ */ D({
|
|
|
33
33
|
native: {
|
|
34
34
|
type: Boolean,
|
|
35
35
|
default: !0
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Показывать группу недавно использованных эмодзи.
|
|
39
|
+
*/
|
|
40
|
+
displayRecent: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !0
|
|
36
43
|
}
|
|
37
44
|
},
|
|
38
|
-
setup(
|
|
39
|
-
const t =
|
|
40
|
-
|
|
45
|
+
setup(a) {
|
|
46
|
+
const t = a, v = l(null), f = l(null), o = l(!1), b = l("light"), i = R("chatAppId"), { setMessageText: P, getMessage: E } = te(i), { setNative: w } = oe(i);
|
|
47
|
+
W(
|
|
41
48
|
() => t.native,
|
|
42
49
|
(e) => w(e),
|
|
43
50
|
{ immediate: !0 }
|
|
44
51
|
);
|
|
45
|
-
const c =
|
|
46
|
-
let
|
|
52
|
+
const c = l("#5F5F5F"), s = l("#404040"), p = l(!1);
|
|
53
|
+
let r = null;
|
|
47
54
|
const h = () => {
|
|
48
55
|
if (!i) {
|
|
49
56
|
c.value = "#5F5F5F", s.value = "#404040";
|
|
@@ -56,7 +63,7 @@ const be = /* @__PURE__ */ D({
|
|
|
56
63
|
}
|
|
57
64
|
const n = window.getComputedStyle(e), d = n.getPropertyValue("--chotto-buttonemojipicker-button-span-color").trim(), A = n.getPropertyValue("--chotto-buttonemojipicker-button-span-hover-color").trim();
|
|
58
65
|
c.value = d || "#5F5F5F", s.value = A || "#404040";
|
|
59
|
-
}, I =
|
|
66
|
+
}, I = z(() => p.value ? s.value : c.value);
|
|
60
67
|
U(() => {
|
|
61
68
|
h();
|
|
62
69
|
});
|
|
@@ -66,24 +73,24 @@ const be = /* @__PURE__ */ D({
|
|
|
66
73
|
const e = document.getElementById(i);
|
|
67
74
|
return (n = e == null ? void 0 : e.getAttribute("data-theme")) != null && n.includes("dark") ? "dark" : "light";
|
|
68
75
|
}, S = (e) => {
|
|
69
|
-
P(
|
|
70
|
-
},
|
|
71
|
-
t.state === "active" && (
|
|
76
|
+
P(E().text + e.i), t.mode === "click" && (o.value = !1);
|
|
77
|
+
}, M = () => {
|
|
78
|
+
t.state === "active" && (b.value = N(), o.value = !0);
|
|
72
79
|
}, k = () => {
|
|
73
80
|
o.value = !1;
|
|
74
|
-
}, _ = () => {
|
|
75
|
-
t.mode === "click" && (o.value = !o.value, o.value && y());
|
|
76
81
|
}, T = () => {
|
|
77
|
-
t.mode === "
|
|
82
|
+
t.mode === "click" && (o.value = !o.value, o.value && M());
|
|
78
83
|
}, V = () => {
|
|
84
|
+
t.mode === "hover" && (u = !0, M());
|
|
85
|
+
}, x = () => {
|
|
79
86
|
t.mode === "hover" && (u = !1, setTimeout(() => {
|
|
80
87
|
!m && !u && k();
|
|
81
88
|
}, 150));
|
|
82
|
-
}, x = () => {
|
|
83
|
-
p.value = !0, T();
|
|
84
89
|
}, L = () => {
|
|
85
|
-
p.value = !
|
|
90
|
+
p.value = !0, V();
|
|
86
91
|
}, O = () => {
|
|
92
|
+
p.value = !1, x();
|
|
93
|
+
}, _ = () => {
|
|
87
94
|
t.mode === "hover" && (m = !0);
|
|
88
95
|
}, H = () => {
|
|
89
96
|
t.mode === "hover" && (m = !1, setTimeout(() => {
|
|
@@ -95,29 +102,29 @@ const be = /* @__PURE__ */ D({
|
|
|
95
102
|
return $(() => {
|
|
96
103
|
if (document.addEventListener("click", F), h(), i) {
|
|
97
104
|
const e = document.getElementById(i);
|
|
98
|
-
e && (
|
|
105
|
+
e && (r = new MutationObserver((n) => {
|
|
99
106
|
n.forEach((d) => {
|
|
100
107
|
d.type === "attributes" && d.attributeName === "data-theme" && h();
|
|
101
108
|
});
|
|
102
|
-
}),
|
|
109
|
+
}), r.observe(e, {
|
|
103
110
|
attributes: !0,
|
|
104
111
|
attributeFilter: ["data-theme"]
|
|
105
112
|
}));
|
|
106
113
|
}
|
|
107
114
|
}), q(() => {
|
|
108
|
-
document.removeEventListener("click", F),
|
|
115
|
+
document.removeEventListener("click", F), r && (r.disconnect(), r = null);
|
|
109
116
|
}), (e, n) => (C(), j(G, null, [
|
|
110
|
-
|
|
117
|
+
y(E)().isRecording ? J("", !0) : (C(), j("button", {
|
|
111
118
|
key: 0,
|
|
112
119
|
ref_key: "emojiButton",
|
|
113
120
|
ref: f,
|
|
114
|
-
class: K(["button", { "button-disabled":
|
|
115
|
-
onClick:
|
|
116
|
-
onMouseenter:
|
|
117
|
-
onMouseleave:
|
|
121
|
+
class: K(["button", { "button-disabled": a.state === "disabled" }]),
|
|
122
|
+
onClick: T,
|
|
123
|
+
onMouseenter: L,
|
|
124
|
+
onMouseleave: O
|
|
118
125
|
}, [
|
|
119
126
|
B("span", null, [
|
|
120
|
-
g(
|
|
127
|
+
g(y(ne), { fill: I.value }, null, 8, ["fill"])
|
|
121
128
|
])
|
|
122
129
|
], 34)),
|
|
123
130
|
g(Q, null, {
|
|
@@ -126,15 +133,16 @@ const be = /* @__PURE__ */ D({
|
|
|
126
133
|
ref_key: "emoji",
|
|
127
134
|
ref: v,
|
|
128
135
|
class: "emoji",
|
|
129
|
-
onMouseenter:
|
|
136
|
+
onMouseenter: _,
|
|
130
137
|
onMouseleave: H
|
|
131
138
|
}, [
|
|
132
|
-
g(
|
|
133
|
-
native:
|
|
134
|
-
theme:
|
|
139
|
+
g(y(ee), {
|
|
140
|
+
native: a.native,
|
|
141
|
+
theme: b.value,
|
|
142
|
+
"display-recent": a.displayRecent,
|
|
135
143
|
"picker-type": "",
|
|
136
144
|
onSelect: S
|
|
137
|
-
}, null, 8, ["native", "theme"])
|
|
145
|
+
}, null, 8, ["native", "theme", "display-recent"])
|
|
138
146
|
], 544), [
|
|
139
147
|
[Z, o.value]
|
|
140
148
|
])
|
|
@@ -145,5 +153,5 @@ const be = /* @__PURE__ */ D({
|
|
|
145
153
|
}
|
|
146
154
|
});
|
|
147
155
|
export {
|
|
148
|
-
|
|
156
|
+
ye as default
|
|
149
157
|
};
|
package/dist/types/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.d.ts
CHANGED
|
@@ -17,6 +17,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
17
17
|
type: BooleanConstructor;
|
|
18
18
|
default: boolean;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Показывать группу недавно использованных эмодзи.
|
|
22
|
+
*/
|
|
23
|
+
displayRecent: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
20
27
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
28
|
state: {
|
|
22
29
|
type: StringConstructor;
|
|
@@ -35,9 +42,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
35
42
|
type: BooleanConstructor;
|
|
36
43
|
default: boolean;
|
|
37
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Показывать группу недавно использованных эмодзи.
|
|
47
|
+
*/
|
|
48
|
+
displayRecent: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
38
52
|
}>> & Readonly<{}>, {
|
|
39
53
|
native: boolean;
|
|
40
54
|
mode: string;
|
|
41
55
|
state: string;
|
|
56
|
+
displayRecent: boolean;
|
|
42
57
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
43
58
|
export default _default;
|