@pantograph/vue 0.31.0 → 0.31.2
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/Comment/index.js +67 -74
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/Dialog/Dialog.d.ts +39 -3
- package/dist/Drawer/Drawer.d.ts +4 -0
- package/dist/Modal/Modal.d.ts +4 -0
- package/dist/Tabs/index.js +1 -1
- package/dist/Tabs/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/dist/use/index.js +1 -1
- package/dist/use/index.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/Comment/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as T, ref as B, createElementBlock as U, createCommentVNode as k, unref as n, openBlock as g, normalizeClass as M, createBlock as _, withCtx as $, createTextVNode as ae, toDisplayString as J, createVNode as S, Fragment as fe, renderList as
|
|
2
|
-
import { isEmptyElement as
|
|
1
|
+
import { defineComponent as T, ref as B, createElementBlock as U, createCommentVNode as k, unref as n, openBlock as g, normalizeClass as M, createBlock as _, withCtx as $, createTextVNode as ae, toDisplayString as J, createVNode as S, Fragment as fe, renderList as X, h as v, useSlots as W, createElementVNode as G, useAttrs as Y, computed as D, mergeProps as F, isRef as ie, createSlots as se, renderSlot as K, normalizeProps as Z, guardReactiveProps as ee, normalizeStyle as ge, onMounted as Ce, onBeforeUnmount as be } from "vue";
|
|
2
|
+
import { isEmptyElement as x, useVModel as te, useFormInput as he, useInputDataStates as Be, installComponent as w } from "@pantograph/utils-vue";
|
|
3
3
|
import { _ as ce } from "../Avatar.vue_vue_type_style_index_0_lang-BBeWgKUx.js";
|
|
4
4
|
import { _ as ve } from "../Badge.vue_vue_type_script_setup_true_lang-CHBj_GP4.js";
|
|
5
5
|
import { cva as Se } from "class-variance-authority";
|
|
@@ -9,11 +9,11 @@ import { getComponentOptions as E, normCls as b, getBemElement as y, getBemBlock
|
|
|
9
9
|
import { _ as L } from "../IconButton.vue_vue_type_script_setup_true_lang-BWakPloG.js";
|
|
10
10
|
import { _ as Ae } from "../ActionButton.vue_vue_type_script_setup_true_lang-DeODCM-L.js";
|
|
11
11
|
import { UploadList as Pe, UploadTrigger as je } from "../Upload/index.js";
|
|
12
|
-
import { createContext as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { _ as X } from "../Icon.vue_vue_type_style_index_0_lang-D3lvOgux.js";
|
|
12
|
+
import { createContext as Ne } from "reka-ui";
|
|
13
|
+
import { _ as xe } from "../GraphicalObject.vue_vue_type_script_setup_true_lang-BC9GfN2v.js";
|
|
15
14
|
import { _ as ke } from "../index-CK2Fd4_G.js";
|
|
16
|
-
import { _ as Te, a as
|
|
15
|
+
import { _ as Te, a as re } from "../Menu.vue_vue_type_style_index_0_lang-BcKxpYfi.js";
|
|
16
|
+
import { _ as le } from "../Icon.vue_vue_type_style_index_0_lang-D3lvOgux.js";
|
|
17
17
|
import Ee from "../GOPicker/index.js";
|
|
18
18
|
import { Combobox as $e } from "../Combobox/index.js";
|
|
19
19
|
import { _ as Me } from "../Divider.vue_vue_type_style_index_0_lang-eXMD78c3.js";
|
|
@@ -92,7 +92,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
92
92
|
}, 8, ["active"]);
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
}),
|
|
95
|
+
}), Fe = /* @__PURE__ */ T({
|
|
96
96
|
...E("CommentReactionList"),
|
|
97
97
|
__name: "CommentReactionList",
|
|
98
98
|
setup(r) {
|
|
@@ -101,7 +101,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
101
101
|
}, p = (l) => {
|
|
102
102
|
var c, a;
|
|
103
103
|
const s = (a = (c = o.slots).reactionItem) == null ? void 0 : a.call(c, l);
|
|
104
|
-
return
|
|
104
|
+
return x(s) ? v(pe, l) : s;
|
|
105
105
|
};
|
|
106
106
|
return (l, s) => {
|
|
107
107
|
var c;
|
|
@@ -109,7 +109,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
109
109
|
key: 0,
|
|
110
110
|
class: M(n(b)(n(y)(n(R), "reactions"), n(o).props.reactionsCls))
|
|
111
111
|
}, [
|
|
112
|
-
(g(!0), U(fe, null,
|
|
112
|
+
(g(!0), U(fe, null, X(n(o).props.reactions, (a) => (g(), _(p, {
|
|
113
113
|
key: a == null ? void 0 : a.emoji,
|
|
114
114
|
reaction: a
|
|
115
115
|
}, null, 8, ["reaction"]))), 128)),
|
|
@@ -146,7 +146,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
146
146
|
};
|
|
147
147
|
return (e, p) => (g(), _(t));
|
|
148
148
|
}
|
|
149
|
-
}), R = _e("comment"), [Q, me] =
|
|
149
|
+
}), R = _e("comment"), [Q, me] = Ne("Comment"), ze = /* @__PURE__ */ T({
|
|
150
150
|
...E("Comment"),
|
|
151
151
|
__name: "Comment",
|
|
152
152
|
props: {
|
|
@@ -180,13 +180,13 @@ const Le = /* @__PURE__ */ T({
|
|
|
180
180
|
},
|
|
181
181
|
emits: ["update:open", "openActions", "reaction", "reply", "openReaction"],
|
|
182
182
|
setup(r, { emit: o }) {
|
|
183
|
-
const t = r, e = W(), p = o, l =
|
|
183
|
+
const t = r, e = W(), p = o, l = te(t, "open", p, {
|
|
184
184
|
passive: t.open === void 0
|
|
185
185
|
}), s = () => {
|
|
186
186
|
var C;
|
|
187
187
|
let m;
|
|
188
188
|
const f = (C = e.author) == null ? void 0 : C.call(e, {});
|
|
189
|
-
return !
|
|
189
|
+
return !x(f) ? m = f : m = t.author, m ? v(
|
|
190
190
|
"div",
|
|
191
191
|
{
|
|
192
192
|
class: b(y(R, "author"), t.authorCls)
|
|
@@ -197,7 +197,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
197
197
|
var C;
|
|
198
198
|
let m;
|
|
199
199
|
const f = (C = e.datetime) == null ? void 0 : C.call(e, {});
|
|
200
|
-
return !
|
|
200
|
+
return !x(f) ? m = f : m = t.datetime, m ? v(
|
|
201
201
|
"div",
|
|
202
202
|
{
|
|
203
203
|
class: b(y(R, "datetime"), t.datetimeCls)
|
|
@@ -206,21 +206,21 @@ const Le = /* @__PURE__ */ T({
|
|
|
206
206
|
) : null;
|
|
207
207
|
}, a = () => {
|
|
208
208
|
var C, P;
|
|
209
|
-
const m = (C = e.header) == null ? void 0 : C.call(e, {}), f = !
|
|
209
|
+
const m = (C = e.header) == null ? void 0 : C.call(e, {}), f = !x(m);
|
|
210
210
|
let d;
|
|
211
211
|
if (f) d = m;
|
|
212
212
|
else {
|
|
213
213
|
d = [];
|
|
214
|
-
const
|
|
215
|
-
!
|
|
216
|
-
const
|
|
217
|
-
(
|
|
214
|
+
const z = (P = e.avatar) == null ? void 0 : P.call(e, {});
|
|
215
|
+
!x(z) ? d.push(z) : t.avatar && d.push(v(ce, { ...t.avatarProps ?? {}, src: t.avatar }));
|
|
216
|
+
const N = s(), I = c();
|
|
217
|
+
(N || I) && d.push(
|
|
218
218
|
v(
|
|
219
219
|
"div",
|
|
220
220
|
{
|
|
221
221
|
class: b(y(R, "header__content"), t.headerContentCls)
|
|
222
222
|
},
|
|
223
|
-
[
|
|
223
|
+
[N, I]
|
|
224
224
|
)
|
|
225
225
|
), d.length || (d = void 0);
|
|
226
226
|
}
|
|
@@ -231,7 +231,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
231
231
|
)) : null;
|
|
232
232
|
}, O = () => {
|
|
233
233
|
var d;
|
|
234
|
-
const m = (d = e.content) == null ? void 0 : d.call(e, {}), f = !
|
|
234
|
+
const m = (d = e.content) == null ? void 0 : d.call(e, {}), f = !x(m);
|
|
235
235
|
if (f || t.content)
|
|
236
236
|
return v(
|
|
237
237
|
"div",
|
|
@@ -247,32 +247,25 @@ const Le = /* @__PURE__ */ T({
|
|
|
247
247
|
}
|
|
248
248
|
}), A = () => {
|
|
249
249
|
var P;
|
|
250
|
-
const m = (P = e.replies) == null ? void 0 : P.call(e, {}), f = !
|
|
251
|
-
var
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
i.push(
|
|
250
|
+
const m = (P = e.replies) == null ? void 0 : P.call(e, {}), f = !x(m), d = () => {
|
|
251
|
+
var N, I, H;
|
|
252
|
+
const z = (N = e.repliesHeader) == null ? void 0 : N.call(e, { open: !!l.value }), i = [];
|
|
253
|
+
if (!x(z))
|
|
254
|
+
i.push(z);
|
|
255
255
|
else {
|
|
256
256
|
i.push(
|
|
257
|
-
v(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
default: () => v(X, {
|
|
266
|
-
icon: "tabler:chevron-down",
|
|
267
|
-
class: y(u, "icon"),
|
|
268
|
-
size: "2xsm"
|
|
269
|
-
})
|
|
270
|
-
}
|
|
271
|
-
)
|
|
257
|
+
v(xe, {
|
|
258
|
+
size: "xsm",
|
|
259
|
+
icon: "tabler:chevron-right",
|
|
260
|
+
bg: "transparent",
|
|
261
|
+
br: "transparent",
|
|
262
|
+
flipOnDir: "rtl",
|
|
263
|
+
class: y(u, "icon")
|
|
264
|
+
})
|
|
272
265
|
);
|
|
273
|
-
const
|
|
266
|
+
const oe = (I = e.repliesCount) == null ? void 0 : I.call(e, {}), de = !x(oe), ne = (H = e.repliesTitle) == null ? void 0 : H.call(e, {}), ye = !x(ne);
|
|
274
267
|
let q;
|
|
275
|
-
ye ? q =
|
|
268
|
+
ye ? q = ne : q = t.repliesTitle, i.push(
|
|
276
269
|
v(
|
|
277
270
|
"div",
|
|
278
271
|
{
|
|
@@ -289,7 +282,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
289
282
|
size: "xsm"
|
|
290
283
|
},
|
|
291
284
|
{
|
|
292
|
-
text: () =>
|
|
285
|
+
text: () => oe
|
|
293
286
|
}
|
|
294
287
|
)
|
|
295
288
|
);
|
|
@@ -347,7 +340,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
347
340
|
}, [
|
|
348
341
|
S(O),
|
|
349
342
|
S(ue),
|
|
350
|
-
S(
|
|
343
|
+
S(Fe),
|
|
351
344
|
S(A)
|
|
352
345
|
], 2)
|
|
353
346
|
], 2));
|
|
@@ -403,10 +396,10 @@ const Le = /* @__PURE__ */ T({
|
|
|
403
396
|
e("edit"), s.value = !1;
|
|
404
397
|
}, l = () => {
|
|
405
398
|
e("delete"), s.value = !1;
|
|
406
|
-
}, s =
|
|
399
|
+
}, s = te(t, "open", e, {
|
|
407
400
|
passive: t.open === void 0
|
|
408
|
-
}), c =
|
|
409
|
-
return (O, u) => (g(), _(n(ke),
|
|
401
|
+
}), c = Y(), a = D(() => ({ ...c, ...t }));
|
|
402
|
+
return (O, u) => (g(), _(n(ke), F(a.value, {
|
|
410
403
|
open: n(s),
|
|
411
404
|
"onUpdate:open": u[0] || (u[0] = (h) => ie(s) ? s.value = h : null),
|
|
412
405
|
placement: "bottom-end",
|
|
@@ -416,27 +409,27 @@ const Le = /* @__PURE__ */ T({
|
|
|
416
409
|
content: $(() => [
|
|
417
410
|
S(Te, { style: { width: "114px" } }, {
|
|
418
411
|
default: $(() => [
|
|
419
|
-
r.hasEdit ? (g(), _(
|
|
412
|
+
r.hasEdit ? (g(), _(re, {
|
|
420
413
|
key: "edit",
|
|
421
414
|
title: r.editText,
|
|
422
415
|
onClick: p
|
|
423
416
|
}, {
|
|
424
417
|
leading: $(({ iconSize: h }) => [
|
|
425
|
-
S(
|
|
418
|
+
S(le, {
|
|
426
419
|
icon: "tabler:edit",
|
|
427
420
|
size: h
|
|
428
421
|
}, null, 8, ["size"])
|
|
429
422
|
]),
|
|
430
423
|
_: 1
|
|
431
424
|
}, 8, ["title"])) : k("", !0),
|
|
432
|
-
r.hasDelete ? (g(), _(
|
|
425
|
+
r.hasDelete ? (g(), _(re, {
|
|
433
426
|
key: "delete",
|
|
434
427
|
title: r.deleteText,
|
|
435
428
|
danger: "",
|
|
436
429
|
onClick: l
|
|
437
430
|
}, {
|
|
438
431
|
leading: $(({ iconSize: h }) => [
|
|
439
|
-
S(
|
|
432
|
+
S(le, {
|
|
440
433
|
icon: "tabler:trash",
|
|
441
434
|
size: h
|
|
442
435
|
}, null, 8, ["size"])
|
|
@@ -497,10 +490,10 @@ const Le = /* @__PURE__ */ T({
|
|
|
497
490
|
setup(r, { emit: o }) {
|
|
498
491
|
const t = r, e = o, p = (a) => {
|
|
499
492
|
e("reaction", a.value), l.value = !1;
|
|
500
|
-
}, l =
|
|
493
|
+
}, l = te(t, "open", e, {
|
|
501
494
|
passive: t.open === void 0
|
|
502
|
-
}), s =
|
|
503
|
-
return (a, O) => (g(), _(n(Ee),
|
|
495
|
+
}), s = Y(), c = D(() => ({ ...s, ...t }));
|
|
496
|
+
return (a, O) => (g(), _(n(Ee), F(c.value, {
|
|
504
497
|
noTrigger: "",
|
|
505
498
|
hideClear: "",
|
|
506
499
|
hideGroup: "",
|
|
@@ -614,10 +607,10 @@ const Le = /* @__PURE__ */ T({
|
|
|
614
607
|
setup(r, { expose: o, emit: t }) {
|
|
615
608
|
const e = r, p = t, l = W(), s = (u, h, A) => {
|
|
616
609
|
p("mention", u, A);
|
|
617
|
-
}, c = B(), a =
|
|
610
|
+
}, c = B(), a = Y(), O = D(() => ({ ...a, ...e }));
|
|
618
611
|
return o({
|
|
619
612
|
comboboxRef: c
|
|
620
|
-
}), (u, h) => (g(), _(n($e),
|
|
613
|
+
}), (u, h) => (g(), _(n($e), F({
|
|
621
614
|
ref_key: "comboboxRef",
|
|
622
615
|
ref: c
|
|
623
616
|
}, O.value, {
|
|
@@ -626,10 +619,10 @@ const Le = /* @__PURE__ */ T({
|
|
|
626
619
|
noTrigger: "",
|
|
627
620
|
popupWidth: 200
|
|
628
621
|
}), se({ _: 2 }, [
|
|
629
|
-
|
|
622
|
+
X(Object.keys(l), (A) => ({
|
|
630
623
|
name: A,
|
|
631
624
|
fn: $((j) => [
|
|
632
|
-
K(u.$slots, A, ee(
|
|
625
|
+
K(u.$slots, A, Z(ee(j)))
|
|
633
626
|
])
|
|
634
627
|
}))
|
|
635
628
|
]), 1040));
|
|
@@ -672,7 +665,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
672
665
|
props: e,
|
|
673
666
|
slots: t,
|
|
674
667
|
fileListRef: f
|
|
675
|
-
}), (C, P) => (g(), U("div",
|
|
668
|
+
}), (C, P) => (g(), U("div", F({
|
|
676
669
|
class: n(b)(n(l), e.class)
|
|
677
670
|
}, n(h)), [
|
|
678
671
|
S(Ie, {
|
|
@@ -682,11 +675,11 @@ const Le = /* @__PURE__ */ T({
|
|
|
682
675
|
style: ge({ maxHeight: m.value })
|
|
683
676
|
}, {
|
|
684
677
|
default: $(() => [
|
|
685
|
-
K(C.$slots, "default", ee(
|
|
678
|
+
K(C.$slots, "default", Z(ee(n(A))))
|
|
686
679
|
]),
|
|
687
680
|
_: 3
|
|
688
681
|
}, 8, ["class", "style"]),
|
|
689
|
-
S(ue,
|
|
682
|
+
S(ue, F(r.uploadProps, { ref: "uploadRef" }), null, 16),
|
|
690
683
|
G("div", {
|
|
691
684
|
class: M(n(b)(n(y)(n(l), "footer"), e.footerCls))
|
|
692
685
|
}, [
|
|
@@ -703,7 +696,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
703
696
|
ref: a,
|
|
704
697
|
onClick: O
|
|
705
698
|
}, null, 512)),
|
|
706
|
-
r.noUpload ? k("", !0) : (g(), _(je,
|
|
699
|
+
r.noUpload ? k("", !0) : (g(), _(je, F({
|
|
707
700
|
key: 1,
|
|
708
701
|
accept: "image/*",
|
|
709
702
|
multiple: "",
|
|
@@ -767,14 +760,14 @@ const Le = /* @__PURE__ */ T({
|
|
|
767
760
|
onPointerdown: c,
|
|
768
761
|
onKeyup: c
|
|
769
762
|
}, [
|
|
770
|
-
S(ce,
|
|
763
|
+
S(ce, F(r.avatarProps ?? {}, {
|
|
771
764
|
size: "sm",
|
|
772
765
|
src: r.src
|
|
773
766
|
}), se({ _: 2 }, [
|
|
774
|
-
|
|
767
|
+
X(Object.keys(t), (u) => ({
|
|
775
768
|
name: u,
|
|
776
769
|
fn: $((h) => [
|
|
777
|
-
K(a.$slots, u, ee(
|
|
770
|
+
K(a.$slots, u, Z(ee(h)))
|
|
778
771
|
])
|
|
779
772
|
}))
|
|
780
773
|
]), 1040, ["src"]),
|
|
@@ -785,7 +778,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
785
778
|
ae(J(r.text), 1)
|
|
786
779
|
])
|
|
787
780
|
], 2),
|
|
788
|
-
S(De,
|
|
781
|
+
S(De, F(r.shortcutProps ?? {}, { items: [
|
|
789
782
|
{
|
|
790
783
|
text: "Alt"
|
|
791
784
|
},
|
|
@@ -795,7 +788,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
795
788
|
] }), null, 16)
|
|
796
789
|
], 42, Ge));
|
|
797
790
|
}
|
|
798
|
-
}), yt = w(
|
|
791
|
+
}), yt = w(ze, V("Comment")), ft = w(
|
|
799
792
|
we,
|
|
800
793
|
V("CommentAction")
|
|
801
794
|
), gt = w(
|
|
@@ -814,8 +807,8 @@ const Le = /* @__PURE__ */ T({
|
|
|
814
807
|
Ke,
|
|
815
808
|
V("CommentTrigger")
|
|
816
809
|
), vt = (r) => {
|
|
817
|
-
const o = B(!1), t = B(), e = B(!1), p = (i,
|
|
818
|
-
o.value = !0, e.value =
|
|
810
|
+
const o = B(!1), t = B(), e = B(!1), p = (i, N = !1) => {
|
|
811
|
+
o.value = !0, e.value = N, t.value = i;
|
|
819
812
|
}, l = B(!1), s = B(), c = (i) => {
|
|
820
813
|
l.value = !0, s.value = i;
|
|
821
814
|
}, a = D(() => ({
|
|
@@ -823,10 +816,10 @@ const Le = /* @__PURE__ */ T({
|
|
|
823
816
|
reference: t.value,
|
|
824
817
|
"onUpdate:open": (i) => o.value = i,
|
|
825
818
|
onReaction: (i) => {
|
|
826
|
-
var
|
|
819
|
+
var N, I;
|
|
827
820
|
if (e.value)
|
|
828
821
|
try {
|
|
829
|
-
(
|
|
822
|
+
(N = r.addEmoji) == null || N.call(r, i);
|
|
830
823
|
} catch (H) {
|
|
831
824
|
console.error("error on reaction", H);
|
|
832
825
|
}
|
|
@@ -858,7 +851,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
858
851
|
j.value = void 0, u.value = !1, h.value = void 0;
|
|
859
852
|
}, P = (i) => {
|
|
860
853
|
h.value = i;
|
|
861
|
-
},
|
|
854
|
+
}, z = D(() => ({
|
|
862
855
|
onOpenReaction: (i) => p(i, !0),
|
|
863
856
|
onOpenMention: (i) => {
|
|
864
857
|
i && (j.value = i, u.value = !0, m.value = !0);
|
|
@@ -868,7 +861,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
868
861
|
forwardRefMention: A,
|
|
869
862
|
reactionBinding: a,
|
|
870
863
|
actionBinding: O,
|
|
871
|
-
editorBinding:
|
|
864
|
+
editorBinding: z,
|
|
872
865
|
mentionBinding: f,
|
|
873
866
|
openActions: c,
|
|
874
867
|
openReaction: p,
|
|
@@ -878,7 +871,7 @@ const Le = /* @__PURE__ */ T({
|
|
|
878
871
|
};
|
|
879
872
|
};
|
|
880
873
|
export {
|
|
881
|
-
|
|
874
|
+
ze as Comment,
|
|
882
875
|
we as CommentAction,
|
|
883
876
|
ft as CommentActionPlugin,
|
|
884
877
|
Ue as CommentEditor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("@pantograph/utils-vue"),I=require("../Avatar.vue_vue_type_style_index_0_lang-mKlk9pzA.js"),W=require("../Badge.vue_vue_type_script_setup_true_lang-D51ugS6o.js"),Q=require("class-variance-authority");require("../GraphicalObject/index.umd.cjs");require("../Icon/index.umd.cjs");const n=require("@pantograph/utils"),P=require("../IconButton.vue_vue_type_script_setup_true_lang-D3l2EAmu.js"),J=require("../ActionButton.vue_vue_type_script_setup_true_lang-BbziM36Z.js"),w=require("../Upload/index.umd.cjs"),X=require("reka-ui"),Y=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-DChtamWZ.js"),j=require("../Icon.vue_vue_type_style_index_0_lang-v3QUxO-v.js"),Z=require("../index-DSM5K3qC.js"),x=require("../Menu.vue_vue_type_style_index_0_lang-hS180XrJ.js"),ee=require("../GOPicker/index.umd.cjs"),te=require("../Combobox/index.umd.cjs"),ne=require("../Divider.vue_vue_type_style_index_0_lang-Heq87yk1.js"),oe=require("../ScrollContainer.vue_vue_type_style_index_0_lang-XfGedoBb.js"),re=require("../Shortcut.vue_vue_type_style_index_0_lang-BybYN3_Y.js"),le=e.defineComponent({...n.getComponentOptions("CommentActions"),__name:"CommentActions",setup(l){const r=E(),o=e.ref(),t=e.ref(),p=()=>{r.emit("openActions",t.value)},a=()=>{r.emit("openReaction",o.value)},c=()=>{r.emit("reply",u=>{r.openReplies&&(u!==void 0?r.openReplies.value=u:r.openReplies.value=!r.openReplies.value)})};return(u,i)=>e.unref(r).props.hasReaction||e.unref(r).props.hasEdit||e.unref(r).props.hasDelete||e.unref(r).props.hasReply?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(h),"actions"),e.unref(r).props.actionsCls))},[e.unref(r).props.hasReply?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:corner-up-left",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:o,flipOnDir:"rtl",onClick:c},null,512)):e.createCommentVNode("",!0),e.unref(r).props.hasReaction?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:o,onClick:a},null,512)):e.createCommentVNode("",!0),e.unref(r).props.hasEdit||e.unref(r).props.hasDelete?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"tabler:dots-vertical",color:"neutral",type:"ghost",ref_key:"actionRef",ref:t,onClick:p},null,512)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}}),V=e.defineComponent({...n.getComponentOptions("CommentReactionItem"),__name:"CommentReactionListItem",props:{reaction:{}},setup(l){const r=E(),o=t=>{t&&r.emit("reaction",t)};return(t,p)=>{var a;return e.openBlock(),e.createBlock(J._sfc_main,{active:(a=l.reaction)==null?void 0:a.active,onClick:p[0]||(p[0]=c=>o(l.reaction))},{default:e.withCtx(()=>{var c,u;return[e.createTextVNode(e.toDisplayString((c=l.reaction)==null?void 0:c.emoji)+" "+e.toDisplayString((u=l.reaction)==null?void 0:u.count),1)]}),_:1},8,["active"])}}}),ae=e.defineComponent({...n.getComponentOptions("CommentReactionList"),__name:"CommentReactionList",setup(l){const r=E(),o=e.ref(),t=()=>{r.emit("openReaction",o.value)},p=a=>{var u,i;const c=(i=(u=r.slots).reactionItem)==null?void 0:i.call(u,a);return y.isEmptyElement(c)?e.h(V,a):c};return(a,c)=>{var u;return e.unref(r).props.hasReaction&&((u=e.unref(r).props.reactions)!=null&&u.some(i=>i.count&&i.emoji))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(h),"reactions"),e.unref(r).props.reactionsCls))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).props.reactions,i=>(e.openBlock(),e.createBlock(p,{key:i==null?void 0:i.emoji,reaction:i},null,8,["reaction"]))),128)),e.createVNode(P._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"outline",ref_key:"reactionRef",ref:o,onClick:t},null,512)],2)):e.createCommentVNode("",!0)}}}),D=e.defineComponent({...n.getComponentOptions("CommentFileList"),__name:"CommentFileList",setup(l){const r=E(),o=()=>{var t;return e.h(w.UploadList,{...r.props.uploadProps??{},ref:r.fileListRef,listType:"card",fileListCls:n.normCls(n.getBemElement(h,"file_list"),(t=r.props.uploadProps)==null?void 0:t.fileListCls)},r.slots)};return(t,p)=>(e.openBlock(),e.createBlock(o))}}),h=n.getBemBlock("comment"),[E,T]=X.createContext("Comment"),L=e.defineComponent({...n.getComponentOptions("Comment"),__name:"Comment",props:{class:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},actionsCls:{type:[Array,Object,String,Number,null,Boolean]},bodyCls:{type:[Array,Object,String,Number,null,Boolean]},datetimeCls:{type:[Array,Object,String,Number,null,Boolean]},uploadProps:{},contentCls:{type:[Array,Object,String,Number,null,Boolean]},authorCls:{type:[Array,Object,String,Number,null,Boolean]},repliesCls:{type:[Array,Object,String,Number,null,Boolean]},headerContentCls:{type:[Array,Object,String,Number,null,Boolean]},reactionsCls:{type:[Array,Object,String,Number,null,Boolean]},repliesHeaderCls:{type:[Array,Object,String,Number,null,Boolean]},repliesTitleCls:{type:[Array,Object,String,Number,null,Boolean]},repliesContentCls:{type:[Array,Object,String,Number,null,Boolean]},author:{},avatar:{},content:{},datetime:{},repliesCount:{},repliesTitle:{default:"Replies"},avatarProps:{},open:{type:Boolean,default:void 0},hasReaction:{type:Boolean,default:!0},hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},hasReply:{type:Boolean,default:!0},reactions:{}},emits:["update:open","openActions","reaction","reply","openReaction"],setup(l,{emit:r}){const o=l,t=e.useSlots(),p=r,a=y.useVModel(o,"open",p,{passive:o.open===void 0}),c=()=>{var C;let d;const g=(C=t.author)==null?void 0:C.call(t,{});return!y.isEmptyElement(g)?d=g:d=o.author,d?e.h("div",{class:n.normCls(n.getBemElement(h,"author"),o.authorCls)},d):null},u=()=>{var C;let d;const g=(C=t.datetime)==null?void 0:C.call(t,{});return!y.isEmptyElement(g)?d=g:d=o.datetime,d?e.h("div",{class:n.normCls(n.getBemElement(h,"datetime"),o.datetimeCls)},d):null},i=()=>{var C,_;const d=(C=t.header)==null?void 0:C.call(t,{}),g=!y.isEmptyElement(d);let f;if(g)f=d;else{f=[];const k=(_=t.avatar)==null?void 0:_.call(t,{});!y.isEmptyElement(k)?f.push(k):o.avatar&&f.push(e.h(I._sfc_main,{...o.avatarProps??{},src:o.avatar}));const N=c(),O=u();(N||O)&&f.push(e.h("div",{class:n.normCls(n.getBemElement(h,"header__content"),o.headerContentCls)},[N,O])),f.length||(f=void 0)}return f?(f.push(e.h(le)),e.h("div",{class:n.normCls(n.getBemElement(h,"header"),o.headerCls)},f)):null},b=()=>{var f;const d=(f=t.content)==null?void 0:f.call(t,{}),g=!y.isEmptyElement(d);if(g||o.content)return e.h("div",{class:n.normCls(n.getBemElement(h,"content"),o.contentCls,"paragraph"),innerHTML:g?void 0:o.content},g?d:void 0)},m=n.getBemElement(h,"replies"),B=Q.cva(m,{variants:{open:n.generateVariantClassList("open",m)}}),v=()=>{var _;const d=(_=t.replies)==null?void 0:_.call(t,{}),g=!y.isEmptyElement(d),f=()=>{var N,O,R;const k=(N=t.repliesHeader)==null?void 0:N.call(t,{open:!!a.value}),s=[];if(!y.isEmptyElement(k))s.push(k);else{s.push(e.h(Y._sfc_main,{size:"xsm",bg:"transparent",br:"transparent"},{default:()=>e.h(j._sfc_main,{icon:"tabler:chevron-down",class:n.getBemElement(m,"icon"),size:"2xsm"})}));const M=(O=t.repliesCount)==null?void 0:O.call(t,{}),G=!y.isEmptyElement(M),z=(R=t.repliesTitle)==null?void 0:R.call(t,{}),K=!y.isEmptyElement(z);let A;K?A=z:A=o.repliesTitle,s.push(e.h("div",{class:n.normCls(n.getBemElement(m,"title"),o.repliesTitleCls)},A)),(G||o.repliesCount)&&s.push(e.h(W._sfc_main,{color:"primary-subtle",text:o.repliesCount,size:"xsm"},{text:()=>M}))}return e.h("div",{class:n.normCls(n.getBemElement(m,"header"),o.repliesHeaderCls),onClick:()=>{a.value=!a.value}},s)},C=()=>{if(a.value)return[e.h("div",{class:n.normCls(n.getBemElement(m,"content"),o.repliesContentCls)},d),e.h("div",{class:n.getBemElement(m,"line")})]};return g?e.h("div",{class:n.normCls(B({open:!!a.value}),o.repliesCls)},[f(),C()]):null},S=e.ref();return T({openReplies:a,emit:p,props:o,slots:t,fileListRef:S}),(d,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(h),o.class))},[e.createVNode(i),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(h),"body"),o.bodyCls))},[e.createVNode(b),e.createVNode(D),e.createVNode(ae),e.createVNode(v)],2)],2))}}),q=e.defineComponent({...n.getComponentOptions("CommentAction"),__name:"CommentAction",props:{hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},editText:{default:"Edit"},deleteText:{default:"Delete"},defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0},modal:{type:Boolean},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},sideOffset:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},class:{type:[Array,Object,String,Number,null,Boolean]},containerCls:{type:[Array,Object,String,Number,null,Boolean]},containerClass:{type:[Array,Object,String,Number,null,Boolean]},size:{},to:{},placement:{},reversePlacementOnDir:{},autoFocusInside:{type:Boolean},noPadding:{type:Boolean},zIndex:{},containerStyle:{},containerProps:{},useReferenceAttribute:{type:Boolean},noTrigger:{type:Boolean}},emits:["edit","delete","update:open"],setup(l,{emit:r}){const o=l,t=r,p=()=>{t("edit"),c.value=!1},a=()=>{t("delete"),c.value=!1},c=y.useVModel(o,"open",t,{passive:o.open===void 0}),u=e.useAttrs(),i=e.computed(()=>({...u,...o}));return(b,m)=>(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),e.mergeProps(i.value,{open:e.unref(c),"onUpdate:open":m[0]||(m[0]=B=>e.isRef(c)?c.value=B:null),placement:"bottom-end",sideOffset:3,openDelay:0}),{content:e.withCtx(()=>[e.createVNode(x._sfc_main,{style:{width:"114px"}},{default:e.withCtx(()=>[l.hasEdit?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:"edit",title:l.editText,onClick:p},{leading:e.withCtx(({iconSize:B})=>[e.createVNode(j._sfc_main,{icon:"tabler:edit",size:B},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0),l.hasDelete?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:"delete",title:l.deleteText,danger:"",onClick:a},{leading:e.withCtx(({iconSize:B})=>[e.createVNode(j._sfc_main,{icon:"tabler:trash",size:B},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})]),_:1},16,["open"]))}}),F=e.defineComponent({...n.getComponentOptions("CommentReaction"),__name:"CommentReaction",props:{reference:{},open:{type:Boolean,default:void 0},icons:{},emojis:{},group:{},modelValue:{},defaultValue:{},visibleTabs:{},noTrigger:{type:Boolean},noModel:{type:Boolean},hideClear:{type:Boolean},hideColor:{type:Boolean},hideGroup:{type:Boolean},hideIcons:{type:Boolean},hideEmojis:{type:Boolean},hideSearch:{type:Boolean},hideRandom:{type:Boolean},disabled:{type:Boolean},bordered:{type:Boolean},popoverProps:{},colorPopoverProps:{},fgColorSwatchGroupProps:{},bgColorSwatchGroupProps:{},brColorSwatchGroupProps:{},visibleColorPickers:{},contentCls:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},groupCls:{type:[Array,Object,String,Number,null,Boolean]},searchCls:{type:[Array,Object,String,Number,null,Boolean]},colorsCls:{type:[Array,Object,String,Number,null,Boolean]},emptyCls:{type:[Array,Object,String,Number,null,Boolean]},gridCls:{type:[Array,Object,String,Number,null,Boolean]},scrollContainerProps:{},size:{},id:{},search:{},inputProps:{},resetColorsOnChangeType:{}},emits:["reaction","update:open"],setup(l,{emit:r}){const o=l,t=r,p=i=>{t("reaction",i.value),a.value=!1},a=y.useVModel(o,"open",t,{passive:o.open===void 0}),c=e.useAttrs(),u=e.computed(()=>({...c,...o}));return(i,b)=>(e.openBlock(),e.createBlock(e.unref(ee.default),e.mergeProps(u.value,{noTrigger:"",hideClear:"",hideGroup:"",hideIcons:"",hideRandom:"",group:"emoji",popoverProps:{...l.popoverProps??{},reference:l.reference},placement:"bottom-end",visibleColorPickers:[],noModel:"",onSelect:p,open:e.unref(a),"onUpdate:open":b[0]||(b[0]=m=>e.isRef(a)?a.value=m:null)}),null,16,["popoverProps","open"]))}}),$=e.defineComponent({...n.getComponentOptions("CommentMention"),__name:"CommentMention",props:{modelValue:{},defaultValue:{},multiple:{type:Boolean},disabled:{type:Boolean},highlightOnHover:{type:Boolean},resetSearchTermOnBlur:{type:Boolean},resetSearchTermOnSelect:{type:Boolean},size:{},status:{},noValueOnPlaceholder:{type:Boolean},zIndex:{},checkbox:{type:Boolean},tagRenderMode:{},getTagProps:{type:Function},tree:{type:Boolean},treeProps:{},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{type:[String,Boolean]},selectedItemIconAsTrailingIcon:{type:Boolean},maxCount:{},to:{type:[String,Function]},placeholder:{},indicatorIcon:{},options:{},getDisabled:{type:[String,Number,Function]},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{type:[String,Number,Function]},getSingle:{type:[String,Number,Function]},getClear:{type:[String,Number,Function]},getOptions:{type:[String,Number,Function]},getIcon:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{},lazyLoading:{type:Boolean},bordered:{type:Boolean},clearOnChangeMultiple:{type:Boolean},triggerCls:{type:[Array,Object,String,Number,null,Boolean]},triggerLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentPlaceholderCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentValueCls:{type:[Array,Object,String,Number,null,Boolean]},triggerTrailingCls:{type:[Array,Object,String,Number,null,Boolean]},itemLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},optionCls:{type:[Array,Object,String,Number,null,Boolean]},tagCls:{type:[Array,Object,String,Number,null,Boolean]},popupCls:{type:[Array,Object,String,Number,null,Boolean]},labelCls:{type:[Array,Object,String,Number,null,Boolean]},optionsCls:{type:[Array,Object,String,Number,null,Boolean]},optionTextCls:{type:[Array,Object,String,Number,null,Boolean]},optionContentCls:{type:[Array,Object,String,Number,null,Boolean]},emptyCls:{type:[Array,Object,String,Number,null,Boolean]},skeletonCls:{type:[Array,Object,String,Number,null,Boolean]},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean},popupHeight:{},popupWidth:{},minWidth:{},search:{},filterOptions:{},expandedKeys:{},headerSearch:{type:Boolean},headerSearchInputProps:{},virtual:{type:Boolean},showTriggerTagOnOption:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},getMenuItemProps:{type:[Function,Object]},placement:{},containerProps:{},reversePlacementOnDir:{},open:{type:Boolean},defaultOpen:{type:Boolean},sideOffset:{},alignOffset:{},reference:{},prioritizePosition:{type:Boolean},avoidCollisions:{type:Boolean},dir:{},noTrigger:{type:Boolean}},emits:["mention"],setup(l,{expose:r,emit:o}){const t=l,p=o,a=e.useSlots(),c=(m,B,v)=>{p("mention",m,v)},u=e.ref(),i=e.useAttrs(),b=e.computed(()=>({...i,...t}));return r({comboboxRef:u}),(m,B)=>(e.openBlock(),e.createBlock(e.unref(te.Combobox),e.mergeProps({ref_key:"comboboxRef",ref:u},b.value,{modelValue:"",onSelect:c,noTrigger:"",popupWidth:200}),e.createSlots({_:2},[e.renderList(Object.keys(a),v=>({name:v,fn:e.withCtx(S=>[e.renderSlot(m.$slots,v,e.normalizeProps(e.guardReactiveProps(S)))])}))]),1040))}}),H=e.defineComponent({...n.getComponentOptions("CommentEditor"),__name:"CommentEditor",props:{class:{type:[Array,Object,String,Number,null,Boolean]},actionsCls:{type:[Array,Object,String,Number,null,Boolean]},editorCls:{type:[Array,Object,String,Number,null,Boolean]},footerCls:{type:[Array,Object,String,Number,null,Boolean]},disabled:{type:Boolean,default:void 0},isEmpty:{type:Boolean},noReaction:{type:Boolean},noUpload:{type:Boolean},noMention:{type:Boolean},uploadTriggerProps:{},mentionsReference:{},uploadProps:{},maxHeight:{default:100}},emits:["openReaction","openMention","blur","focus","mention","submit"],setup(l,{emit:r}){const o=e.useSlots(),t=l,p=r,a=n.getBemElement(h,"editor"),c=e.ref(),u=()=>{p("openReaction",c.value)},i=e.ref(),b=()=>{p("openMention",i.value)},{getDisabled:m}=y.useFormInput({exports:["getDisabled"]}),{rootBindings:B,inputBindings:v}=y.useInputDataStates({getDisabled:()=>m.value,emit:p}),S=()=>p("submit"),d=e.computed(()=>n.getPxSize(t.maxHeight,!0)),g=e.ref(),f=C=>{var _;(_=g.value)!=null&&_.addFiles&&C.length&&g.value.addFiles(C)};return T({emit:p,props:t,slots:o,fileListRef:g}),(C,_)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(n.normCls)(e.unref(a),t.class)},e.unref(B)),[e.createVNode(oe._sfc_main,{overlay:!1,hasMask:!1,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(a),"editor"),"paragraph",t.editorCls)),style:e.normalizeStyle({maxHeight:d.value})},{default:e.withCtx(()=>[e.renderSlot(C.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(v))))]),_:3},8,["class","style"]),e.createVNode(D,e.mergeProps(l.uploadProps,{ref:"uploadRef"}),null,16),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(a),"footer"),t.footerCls))},[e.createVNode(ne._sfc_main),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(a),"actions"),t.actionsCls))},[l.noMention?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:at",color:"neutral",type:"ghost",ref_key:"mentionRef",ref:i,onClick:b},null,512)),l.noUpload?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(w.UploadTrigger,e.mergeProps({key:1,accept:"image/*",multiple:"",onAddFiles:f},l.uploadTriggerProps),{default:e.withCtx(()=>[e.createVNode(P._sfc_main,{icon:"tabler:paperclip",color:"neutral",type:"ghost"})]),_:1},16)),l.noReaction?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:c,onClick:u},null,512))],2),e.createVNode(P._sfc_main,{disabled:l.disabled||l.isEmpty,icon:"tabler:arrow-up",onClick:S},null,8,["disabled"])],2)],16))}}),ie=["tabindex","disabled"],U=e.defineComponent({...n.getComponentOptions("CommentTrigger"),__name:"CommentTrigger",props:{class:{type:[Array,Object,String,Number,null,Boolean]},text:{default:"Add a Comment or type @ to Mention..."},src:{},withShortcut:{type:Boolean},ignoreShortcut:{type:Boolean},disabled:{type:Boolean,default:void 0},avatarProps:{},shortcutProps:{}},emits:["add"],setup(l,{emit:r}){const o=e.useSlots(),t=l,p=r,a=n.getBemElement(h,"trigger"),c=i=>{!t.ignoreShortcut&&i.code==="KeyC"&&i.altKey&&u(i)};e.onMounted(()=>{t.withShortcut&&addEventListener("keyup",c)}),e.onBeforeUnmount(()=>{t.withShortcut&&removeEventListener("keyup",c)}),t.withShortcut;const u=i=>p("add",i);return(i,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(a),t.class)),tabindex:l.disabled?-1:0,disabled:l.disabled?"":void 0,onPointerdown:u,onKeyup:u},[e.createVNode(I._sfc_main,e.mergeProps(l.avatarProps??{},{size:"sm",src:l.src}),e.createSlots({_:2},[e.renderList(Object.keys(o),m=>({name:m,fn:e.withCtx(B=>[e.renderSlot(i.$slots,m,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040,["src"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.getBemElement)(e.unref(a),"text"))},[e.renderSlot(i.$slots,"text",{},()=>[e.createTextVNode(e.toDisplayString(l.text),1)])],2),e.createVNode(re._sfc_main,e.mergeProps(l.shortcutProps??{},{items:[{text:"Alt"},{text:"C"}]}),null,16)],42,ie))}}),se=y.installComponent(L,n.getComponentName("Comment")),ce=y.installComponent(q,n.getComponentName("CommentAction")),ue=y.installComponent(V,n.getComponentName("CommentReactionItem")),pe=y.installComponent(F,n.getComponentName("CommentReaction")),me=y.installComponent($,n.getComponentName("CommentMention")),de=y.installComponent(H,n.getComponentName("CommentEditor")),ye=y.installComponent(U,n.getComponentName("CommentTrigger")),fe=l=>{const r=e.ref(!1),o=e.ref(),t=e.ref(!1),p=(s,N=!1)=>{r.value=!0,t.value=N,o.value=s},a=e.ref(!1),c=e.ref(),u=s=>{a.value=!0,c.value=s},i=e.computed(()=>({open:r.value,reference:o.value,"onUpdate:open":s=>r.value=s,onReaction:s=>{var N,O;if(t.value)try{(N=l.addEmoji)==null||N.call(l,s)}catch(R){console.error("error on reaction",R)}try{(O=l.onReaction)==null||O.call(l,s)}catch(R){console.error("error on reaction",R)}}})),b=e.computed(()=>({open:a.value,reference:c.value,"onUpdate:open":s=>a.value=s})),m=e.ref(!1),B=e.ref(),v=e.ref(),S=e.ref(),d=e.ref(!1),g=e.computed(()=>({ref:v,open:m.value,"onUpdate:open":s=>m.value=s,search:B.value,"onUpdate:search":s=>B.value=s,reference:S.value,disableOutsidePointerEvents:!1,resetSearchTermOnBlur:!0,headerSearch:d.value,onPointerDownOutside:C,onEscapeKeyDown:C})),f=s=>{s&&(S.value={getBoundingClientRect:s},m.value=!0,d.value=!1)},C=()=>{S.value=void 0,m.value=!1,B.value=void 0},_=s=>{B.value=s},k=e.computed(()=>({onOpenReaction:s=>p(s,!0),onOpenMention:s=>{s&&(S.value=s,m.value=!0,d.value=!0)}}));return{forwardRefMention:v,reactionBinding:i,actionBinding:b,editorBinding:k,mentionBinding:g,openActions:u,openReaction:p,openMentionInEditor:f,closeMentionInEditor:C,updateMentionQuery:_}};exports.Comment=L;exports.CommentAction=q;exports.CommentActionPlugin=ce;exports.CommentEditor=H;exports.CommentEditorPlugin=de;exports.CommentMention=$;exports.CommentMentionPlugin=me;exports.CommentPlugin=se;exports.CommentReaction=F;exports.CommentReactionItemPlugin=ue;exports.CommentReactionListItem=V;exports.CommentReactionPlugin=pe;exports.CommentTrigger=U;exports.CommentTriggerPlugin=ye;exports.commentPrefix=h;exports.injectCommentContext=E;exports.provideCommentContext=T;exports.useComment=fe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("@pantograph/utils-vue"),I=require("../Avatar.vue_vue_type_style_index_0_lang-mKlk9pzA.js"),W=require("../Badge.vue_vue_type_script_setup_true_lang-D51ugS6o.js"),Q=require("class-variance-authority");require("../GraphicalObject/index.umd.cjs");require("../Icon/index.umd.cjs");const n=require("@pantograph/utils"),P=require("../IconButton.vue_vue_type_script_setup_true_lang-D3l2EAmu.js"),J=require("../ActionButton.vue_vue_type_script_setup_true_lang-BbziM36Z.js"),D=require("../Upload/index.umd.cjs"),X=require("reka-ui"),Y=require("../GraphicalObject.vue_vue_type_script_setup_true_lang-DChtamWZ.js"),Z=require("../index-DSM5K3qC.js"),x=require("../Menu.vue_vue_type_style_index_0_lang-hS180XrJ.js"),z=require("../Icon.vue_vue_type_style_index_0_lang-v3QUxO-v.js"),ee=require("../GOPicker/index.umd.cjs"),te=require("../Combobox/index.umd.cjs"),ne=require("../Divider.vue_vue_type_style_index_0_lang-Heq87yk1.js"),oe=require("../ScrollContainer.vue_vue_type_style_index_0_lang-XfGedoBb.js"),re=require("../Shortcut.vue_vue_type_style_index_0_lang-BybYN3_Y.js"),le=e.defineComponent({...n.getComponentOptions("CommentActions"),__name:"CommentActions",setup(l){const r=E(),o=e.ref(),t=e.ref(),p=()=>{r.emit("openActions",t.value)},i=()=>{r.emit("openReaction",o.value)},c=()=>{r.emit("reply",u=>{r.openReplies&&(u!==void 0?r.openReplies.value=u:r.openReplies.value=!r.openReplies.value)})};return(u,a)=>e.unref(r).props.hasReaction||e.unref(r).props.hasEdit||e.unref(r).props.hasDelete||e.unref(r).props.hasReply?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(h),"actions"),e.unref(r).props.actionsCls))},[e.unref(r).props.hasReply?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:corner-up-left",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:o,flipOnDir:"rtl",onClick:c},null,512)):e.createCommentVNode("",!0),e.unref(r).props.hasReaction?(e.openBlock(),e.createBlock(P._sfc_main,{key:1,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:o,onClick:i},null,512)):e.createCommentVNode("",!0),e.unref(r).props.hasEdit||e.unref(r).props.hasDelete?(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"tabler:dots-vertical",color:"neutral",type:"ghost",ref_key:"actionRef",ref:t,onClick:p},null,512)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}}),j=e.defineComponent({...n.getComponentOptions("CommentReactionItem"),__name:"CommentReactionListItem",props:{reaction:{}},setup(l){const r=E(),o=t=>{t&&r.emit("reaction",t)};return(t,p)=>{var i;return e.openBlock(),e.createBlock(J._sfc_main,{active:(i=l.reaction)==null?void 0:i.active,onClick:p[0]||(p[0]=c=>o(l.reaction))},{default:e.withCtx(()=>{var c,u;return[e.createTextVNode(e.toDisplayString((c=l.reaction)==null?void 0:c.emoji)+" "+e.toDisplayString((u=l.reaction)==null?void 0:u.count),1)]}),_:1},8,["active"])}}}),ie=e.defineComponent({...n.getComponentOptions("CommentReactionList"),__name:"CommentReactionList",setup(l){const r=E(),o=e.ref(),t=()=>{r.emit("openReaction",o.value)},p=i=>{var u,a;const c=(a=(u=r.slots).reactionItem)==null?void 0:a.call(u,i);return y.isEmptyElement(c)?e.h(j,i):c};return(i,c)=>{var u;return e.unref(r).props.hasReaction&&((u=e.unref(r).props.reactions)!=null&&u.some(a=>a.count&&a.emoji))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(h),"reactions"),e.unref(r).props.reactionsCls))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).props.reactions,a=>(e.openBlock(),e.createBlock(p,{key:a==null?void 0:a.emoji,reaction:a},null,8,["reaction"]))),128)),e.createVNode(P._sfc_main,{icon:"tabler:mood-plus",color:"neutral",type:"outline",ref_key:"reactionRef",ref:o,onClick:t},null,512)],2)):e.createCommentVNode("",!0)}}}),w=e.defineComponent({...n.getComponentOptions("CommentFileList"),__name:"CommentFileList",setup(l){const r=E(),o=()=>{var t;return e.h(D.UploadList,{...r.props.uploadProps??{},ref:r.fileListRef,listType:"card",fileListCls:n.normCls(n.getBemElement(h,"file_list"),(t=r.props.uploadProps)==null?void 0:t.fileListCls)},r.slots)};return(t,p)=>(e.openBlock(),e.createBlock(o))}}),h=n.getBemBlock("comment"),[E,V]=X.createContext("Comment"),L=e.defineComponent({...n.getComponentOptions("Comment"),__name:"Comment",props:{class:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},actionsCls:{type:[Array,Object,String,Number,null,Boolean]},bodyCls:{type:[Array,Object,String,Number,null,Boolean]},datetimeCls:{type:[Array,Object,String,Number,null,Boolean]},uploadProps:{},contentCls:{type:[Array,Object,String,Number,null,Boolean]},authorCls:{type:[Array,Object,String,Number,null,Boolean]},repliesCls:{type:[Array,Object,String,Number,null,Boolean]},headerContentCls:{type:[Array,Object,String,Number,null,Boolean]},reactionsCls:{type:[Array,Object,String,Number,null,Boolean]},repliesHeaderCls:{type:[Array,Object,String,Number,null,Boolean]},repliesTitleCls:{type:[Array,Object,String,Number,null,Boolean]},repliesContentCls:{type:[Array,Object,String,Number,null,Boolean]},author:{},avatar:{},content:{},datetime:{},repliesCount:{},repliesTitle:{default:"Replies"},avatarProps:{},open:{type:Boolean,default:void 0},hasReaction:{type:Boolean,default:!0},hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},hasReply:{type:Boolean,default:!0},reactions:{}},emits:["update:open","openActions","reaction","reply","openReaction"],setup(l,{emit:r}){const o=l,t=e.useSlots(),p=r,i=y.useVModel(o,"open",p,{passive:o.open===void 0}),c=()=>{var C;let d;const g=(C=t.author)==null?void 0:C.call(t,{});return!y.isEmptyElement(g)?d=g:d=o.author,d?e.h("div",{class:n.normCls(n.getBemElement(h,"author"),o.authorCls)},d):null},u=()=>{var C;let d;const g=(C=t.datetime)==null?void 0:C.call(t,{});return!y.isEmptyElement(g)?d=g:d=o.datetime,d?e.h("div",{class:n.normCls(n.getBemElement(h,"datetime"),o.datetimeCls)},d):null},a=()=>{var C,_;const d=(C=t.header)==null?void 0:C.call(t,{}),g=!y.isEmptyElement(d);let f;if(g)f=d;else{f=[];const k=(_=t.avatar)==null?void 0:_.call(t,{});!y.isEmptyElement(k)?f.push(k):o.avatar&&f.push(e.h(I._sfc_main,{...o.avatarProps??{},src:o.avatar}));const N=c(),O=u();(N||O)&&f.push(e.h("div",{class:n.normCls(n.getBemElement(h,"header__content"),o.headerContentCls)},[N,O])),f.length||(f=void 0)}return f?(f.push(e.h(le)),e.h("div",{class:n.normCls(n.getBemElement(h,"header"),o.headerCls)},f)):null},b=()=>{var f;const d=(f=t.content)==null?void 0:f.call(t,{}),g=!y.isEmptyElement(d);if(g||o.content)return e.h("div",{class:n.normCls(n.getBemElement(h,"content"),o.contentCls,"paragraph"),innerHTML:g?void 0:o.content},g?d:void 0)},m=n.getBemElement(h,"replies"),B=Q.cva(m,{variants:{open:n.generateVariantClassList("open",m)}}),v=()=>{var _;const d=(_=t.replies)==null?void 0:_.call(t,{}),g=!y.isEmptyElement(d),f=()=>{var N,O,R;const k=(N=t.repliesHeader)==null?void 0:N.call(t,{open:!!i.value}),s=[];if(!y.isEmptyElement(k))s.push(k);else{s.push(e.h(Y._sfc_main,{size:"xsm",icon:"tabler:chevron-right",bg:"transparent",br:"transparent",flipOnDir:"rtl",class:n.getBemElement(m,"icon")}));const T=(O=t.repliesCount)==null?void 0:O.call(t,{}),G=!y.isEmptyElement(T),M=(R=t.repliesTitle)==null?void 0:R.call(t,{}),K=!y.isEmptyElement(M);let A;K?A=M:A=o.repliesTitle,s.push(e.h("div",{class:n.normCls(n.getBemElement(m,"title"),o.repliesTitleCls)},A)),(G||o.repliesCount)&&s.push(e.h(W._sfc_main,{color:"primary-subtle",text:o.repliesCount,size:"xsm"},{text:()=>T}))}return e.h("div",{class:n.normCls(n.getBemElement(m,"header"),o.repliesHeaderCls),onClick:()=>{i.value=!i.value}},s)},C=()=>{if(i.value)return[e.h("div",{class:n.normCls(n.getBemElement(m,"content"),o.repliesContentCls)},d),e.h("div",{class:n.getBemElement(m,"line")})]};return g?e.h("div",{class:n.normCls(B({open:!!i.value}),o.repliesCls)},[f(),C()]):null},S=e.ref();return V({openReplies:i,emit:p,props:o,slots:t,fileListRef:S}),(d,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(h),o.class))},[e.createVNode(a),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(h),"body"),o.bodyCls))},[e.createVNode(b),e.createVNode(w),e.createVNode(ie),e.createVNode(v)],2)],2))}}),q=e.defineComponent({...n.getComponentOptions("CommentAction"),__name:"CommentAction",props:{hasEdit:{type:Boolean,default:!0},hasDelete:{type:Boolean,default:!0},editText:{default:"Edit"},deleteText:{default:"Delete"},defaultOpen:{type:Boolean},open:{type:Boolean,default:void 0},modal:{type:Boolean},disabled:{type:Boolean},defer:{type:Boolean},forceMount:{type:Boolean},sideOffset:{},sideFlip:{type:Boolean},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},class:{type:[Array,Object,String,Number,null,Boolean]},containerCls:{type:[Array,Object,String,Number,null,Boolean]},containerClass:{type:[Array,Object,String,Number,null,Boolean]},size:{},to:{},placement:{},reversePlacementOnDir:{},autoFocusInside:{type:Boolean},noPadding:{type:Boolean},zIndex:{},containerStyle:{},containerProps:{},useReferenceAttribute:{type:Boolean},noTrigger:{type:Boolean}},emits:["edit","delete","update:open"],setup(l,{emit:r}){const o=l,t=r,p=()=>{t("edit"),c.value=!1},i=()=>{t("delete"),c.value=!1},c=y.useVModel(o,"open",t,{passive:o.open===void 0}),u=e.useAttrs(),a=e.computed(()=>({...u,...o}));return(b,m)=>(e.openBlock(),e.createBlock(e.unref(Z._sfc_main),e.mergeProps(a.value,{open:e.unref(c),"onUpdate:open":m[0]||(m[0]=B=>e.isRef(c)?c.value=B:null),placement:"bottom-end",sideOffset:3,openDelay:0}),{content:e.withCtx(()=>[e.createVNode(x._sfc_main,{style:{width:"114px"}},{default:e.withCtx(()=>[l.hasEdit?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:"edit",title:l.editText,onClick:p},{leading:e.withCtx(({iconSize:B})=>[e.createVNode(z._sfc_main,{icon:"tabler:edit",size:B},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0),l.hasDelete?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:"delete",title:l.deleteText,danger:"",onClick:i},{leading:e.withCtx(({iconSize:B})=>[e.createVNode(z._sfc_main,{icon:"tabler:trash",size:B},null,8,["size"])]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})]),_:1},16,["open"]))}}),F=e.defineComponent({...n.getComponentOptions("CommentReaction"),__name:"CommentReaction",props:{reference:{},open:{type:Boolean,default:void 0},icons:{},emojis:{},group:{},modelValue:{},defaultValue:{},visibleTabs:{},noTrigger:{type:Boolean},noModel:{type:Boolean},hideClear:{type:Boolean},hideColor:{type:Boolean},hideGroup:{type:Boolean},hideIcons:{type:Boolean},hideEmojis:{type:Boolean},hideSearch:{type:Boolean},hideRandom:{type:Boolean},disabled:{type:Boolean},bordered:{type:Boolean},popoverProps:{},colorPopoverProps:{},fgColorSwatchGroupProps:{},bgColorSwatchGroupProps:{},brColorSwatchGroupProps:{},visibleColorPickers:{},contentCls:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},groupCls:{type:[Array,Object,String,Number,null,Boolean]},searchCls:{type:[Array,Object,String,Number,null,Boolean]},colorsCls:{type:[Array,Object,String,Number,null,Boolean]},emptyCls:{type:[Array,Object,String,Number,null,Boolean]},gridCls:{type:[Array,Object,String,Number,null,Boolean]},scrollContainerProps:{},size:{},id:{},search:{},inputProps:{},resetColorsOnChangeType:{}},emits:["reaction","update:open"],setup(l,{emit:r}){const o=l,t=r,p=a=>{t("reaction",a.value),i.value=!1},i=y.useVModel(o,"open",t,{passive:o.open===void 0}),c=e.useAttrs(),u=e.computed(()=>({...c,...o}));return(a,b)=>(e.openBlock(),e.createBlock(e.unref(ee.default),e.mergeProps(u.value,{noTrigger:"",hideClear:"",hideGroup:"",hideIcons:"",hideRandom:"",group:"emoji",popoverProps:{...l.popoverProps??{},reference:l.reference},placement:"bottom-end",visibleColorPickers:[],noModel:"",onSelect:p,open:e.unref(i),"onUpdate:open":b[0]||(b[0]=m=>e.isRef(i)?i.value=m:null)}),null,16,["popoverProps","open"]))}}),$=e.defineComponent({...n.getComponentOptions("CommentMention"),__name:"CommentMention",props:{modelValue:{},defaultValue:{},multiple:{type:Boolean},disabled:{type:Boolean},highlightOnHover:{type:Boolean},resetSearchTermOnBlur:{type:Boolean},resetSearchTermOnSelect:{type:Boolean},size:{},status:{},noValueOnPlaceholder:{type:Boolean},zIndex:{},checkbox:{type:Boolean},tagRenderMode:{},getTagProps:{type:Function},tree:{type:Boolean},treeProps:{},contentFit:{type:Boolean},wrapped:{type:Boolean},sortSelectedItems:{type:Boolean},noTrailing:{type:Boolean},leadingIcon:{},trailingIcon:{type:[String,Boolean]},selectedItemIconAsTrailingIcon:{type:Boolean},maxCount:{},to:{type:[String,Function]},placeholder:{},indicatorIcon:{},options:{},getDisabled:{type:[String,Number,Function]},getLabel:{},getDescription:{},getValue:{},getNoCheckbox:{type:[String,Number,Function]},getSingle:{type:[String,Number,Function]},getClear:{type:[String,Number,Function]},getOptions:{type:[String,Number,Function]},getIcon:{},loading:{type:Boolean},skeletonProps:{},loadingRowCount:{},lazyLoading:{type:Boolean},bordered:{type:Boolean},clearOnChangeMultiple:{type:Boolean},triggerCls:{type:[Array,Object,String,Number,null,Boolean]},triggerLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentPlaceholderCls:{type:[Array,Object,String,Number,null,Boolean]},triggerContentValueCls:{type:[Array,Object,String,Number,null,Boolean]},triggerTrailingCls:{type:[Array,Object,String,Number,null,Boolean]},itemLeadingCls:{type:[Array,Object,String,Number,null,Boolean]},optionCls:{type:[Array,Object,String,Number,null,Boolean]},tagCls:{type:[Array,Object,String,Number,null,Boolean]},popupCls:{type:[Array,Object,String,Number,null,Boolean]},labelCls:{type:[Array,Object,String,Number,null,Boolean]},optionsCls:{type:[Array,Object,String,Number,null,Boolean]},optionTextCls:{type:[Array,Object,String,Number,null,Boolean]},optionContentCls:{type:[Array,Object,String,Number,null,Boolean]},emptyCls:{type:[Array,Object,String,Number,null,Boolean]},skeletonCls:{type:[Array,Object,String,Number,null,Boolean]},scrollContainerProps:{},emptyProps:{},samePopupWidth:{type:Boolean},popupHeight:{},popupWidth:{},minWidth:{},search:{},filterOptions:{},expandedKeys:{},headerSearch:{type:Boolean},headerSearchInputProps:{},virtual:{type:Boolean},showTriggerTagOnOption:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},getMenuItemProps:{type:[Function,Object]},placement:{},containerProps:{},reversePlacementOnDir:{},open:{type:Boolean},defaultOpen:{type:Boolean},sideOffset:{},alignOffset:{},reference:{},prioritizePosition:{type:Boolean},avoidCollisions:{type:Boolean},dir:{},noTrigger:{type:Boolean}},emits:["mention"],setup(l,{expose:r,emit:o}){const t=l,p=o,i=e.useSlots(),c=(m,B,v)=>{p("mention",m,v)},u=e.ref(),a=e.useAttrs(),b=e.computed(()=>({...a,...t}));return r({comboboxRef:u}),(m,B)=>(e.openBlock(),e.createBlock(e.unref(te.Combobox),e.mergeProps({ref_key:"comboboxRef",ref:u},b.value,{modelValue:"",onSelect:c,noTrigger:"",popupWidth:200}),e.createSlots({_:2},[e.renderList(Object.keys(i),v=>({name:v,fn:e.withCtx(S=>[e.renderSlot(m.$slots,v,e.normalizeProps(e.guardReactiveProps(S)))])}))]),1040))}}),H=e.defineComponent({...n.getComponentOptions("CommentEditor"),__name:"CommentEditor",props:{class:{type:[Array,Object,String,Number,null,Boolean]},actionsCls:{type:[Array,Object,String,Number,null,Boolean]},editorCls:{type:[Array,Object,String,Number,null,Boolean]},footerCls:{type:[Array,Object,String,Number,null,Boolean]},disabled:{type:Boolean,default:void 0},isEmpty:{type:Boolean},noReaction:{type:Boolean},noUpload:{type:Boolean},noMention:{type:Boolean},uploadTriggerProps:{},mentionsReference:{},uploadProps:{},maxHeight:{default:100}},emits:["openReaction","openMention","blur","focus","mention","submit"],setup(l,{emit:r}){const o=e.useSlots(),t=l,p=r,i=n.getBemElement(h,"editor"),c=e.ref(),u=()=>{p("openReaction",c.value)},a=e.ref(),b=()=>{p("openMention",a.value)},{getDisabled:m}=y.useFormInput({exports:["getDisabled"]}),{rootBindings:B,inputBindings:v}=y.useInputDataStates({getDisabled:()=>m.value,emit:p}),S=()=>p("submit"),d=e.computed(()=>n.getPxSize(t.maxHeight,!0)),g=e.ref(),f=C=>{var _;(_=g.value)!=null&&_.addFiles&&C.length&&g.value.addFiles(C)};return V({emit:p,props:t,slots:o,fileListRef:g}),(C,_)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:e.unref(n.normCls)(e.unref(i),t.class)},e.unref(B)),[e.createVNode(oe._sfc_main,{overlay:!1,hasMask:!1,class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(i),"editor"),"paragraph",t.editorCls)),style:e.normalizeStyle({maxHeight:d.value})},{default:e.withCtx(()=>[e.renderSlot(C.$slots,"default",e.normalizeProps(e.guardReactiveProps(e.unref(v))))]),_:3},8,["class","style"]),e.createVNode(w,e.mergeProps(l.uploadProps,{ref:"uploadRef"}),null,16),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(i),"footer"),t.footerCls))},[e.createVNode(ne._sfc_main),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(i),"actions"),t.actionsCls))},[l.noMention?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(P._sfc_main,{key:0,icon:"tabler:at",color:"neutral",type:"ghost",ref_key:"mentionRef",ref:a,onClick:b},null,512)),l.noUpload?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.UploadTrigger,e.mergeProps({key:1,accept:"image/*",multiple:"",onAddFiles:f},l.uploadTriggerProps),{default:e.withCtx(()=>[e.createVNode(P._sfc_main,{icon:"tabler:paperclip",color:"neutral",type:"ghost"})]),_:1},16)),l.noReaction?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(P._sfc_main,{key:2,icon:"tabler:mood-plus",color:"neutral",type:"ghost",ref_key:"reactionRef",ref:c,onClick:u},null,512))],2),e.createVNode(P._sfc_main,{disabled:l.disabled||l.isEmpty,icon:"tabler:arrow-up",onClick:S},null,8,["disabled"])],2)],16))}}),ae=["tabindex","disabled"],U=e.defineComponent({...n.getComponentOptions("CommentTrigger"),__name:"CommentTrigger",props:{class:{type:[Array,Object,String,Number,null,Boolean]},text:{default:"Add a Comment or type @ to Mention..."},src:{},withShortcut:{type:Boolean},ignoreShortcut:{type:Boolean},disabled:{type:Boolean,default:void 0},avatarProps:{},shortcutProps:{}},emits:["add"],setup(l,{emit:r}){const o=e.useSlots(),t=l,p=r,i=n.getBemElement(h,"trigger"),c=a=>{!t.ignoreShortcut&&a.code==="KeyC"&&a.altKey&&u(a)};e.onMounted(()=>{t.withShortcut&&addEventListener("keyup",c)}),e.onBeforeUnmount(()=>{t.withShortcut&&removeEventListener("keyup",c)}),t.withShortcut;const u=a=>p("add",a);return(a,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(i),t.class)),tabindex:l.disabled?-1:0,disabled:l.disabled?"":void 0,onPointerdown:u,onKeyup:u},[e.createVNode(I._sfc_main,e.mergeProps(l.avatarProps??{},{size:"sm",src:l.src}),e.createSlots({_:2},[e.renderList(Object.keys(o),m=>({name:m,fn:e.withCtx(B=>[e.renderSlot(a.$slots,m,e.normalizeProps(e.guardReactiveProps(B)))])}))]),1040,["src"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.getBemElement)(e.unref(i),"text"))},[e.renderSlot(a.$slots,"text",{},()=>[e.createTextVNode(e.toDisplayString(l.text),1)])],2),e.createVNode(re._sfc_main,e.mergeProps(l.shortcutProps??{},{items:[{text:"Alt"},{text:"C"}]}),null,16)],42,ae))}}),se=y.installComponent(L,n.getComponentName("Comment")),ce=y.installComponent(q,n.getComponentName("CommentAction")),ue=y.installComponent(j,n.getComponentName("CommentReactionItem")),pe=y.installComponent(F,n.getComponentName("CommentReaction")),me=y.installComponent($,n.getComponentName("CommentMention")),de=y.installComponent(H,n.getComponentName("CommentEditor")),ye=y.installComponent(U,n.getComponentName("CommentTrigger")),fe=l=>{const r=e.ref(!1),o=e.ref(),t=e.ref(!1),p=(s,N=!1)=>{r.value=!0,t.value=N,o.value=s},i=e.ref(!1),c=e.ref(),u=s=>{i.value=!0,c.value=s},a=e.computed(()=>({open:r.value,reference:o.value,"onUpdate:open":s=>r.value=s,onReaction:s=>{var N,O;if(t.value)try{(N=l.addEmoji)==null||N.call(l,s)}catch(R){console.error("error on reaction",R)}try{(O=l.onReaction)==null||O.call(l,s)}catch(R){console.error("error on reaction",R)}}})),b=e.computed(()=>({open:i.value,reference:c.value,"onUpdate:open":s=>i.value=s})),m=e.ref(!1),B=e.ref(),v=e.ref(),S=e.ref(),d=e.ref(!1),g=e.computed(()=>({ref:v,open:m.value,"onUpdate:open":s=>m.value=s,search:B.value,"onUpdate:search":s=>B.value=s,reference:S.value,disableOutsidePointerEvents:!1,resetSearchTermOnBlur:!0,headerSearch:d.value,onPointerDownOutside:C,onEscapeKeyDown:C})),f=s=>{s&&(S.value={getBoundingClientRect:s},m.value=!0,d.value=!1)},C=()=>{S.value=void 0,m.value=!1,B.value=void 0},_=s=>{B.value=s},k=e.computed(()=>({onOpenReaction:s=>p(s,!0),onOpenMention:s=>{s&&(S.value=s,m.value=!0,d.value=!0)}}));return{forwardRefMention:v,reactionBinding:a,actionBinding:b,editorBinding:k,mentionBinding:g,openActions:u,openReaction:p,openMentionInEditor:f,closeMentionInEditor:C,updateMentionQuery:_}};exports.Comment=L;exports.CommentAction=q;exports.CommentActionPlugin=ce;exports.CommentEditor=H;exports.CommentEditorPlugin=de;exports.CommentMention=$;exports.CommentMentionPlugin=me;exports.CommentPlugin=se;exports.CommentReaction=F;exports.CommentReactionItemPlugin=ue;exports.CommentReactionListItem=j;exports.CommentReactionPlugin=pe;exports.CommentTrigger=U;exports.CommentTriggerPlugin=ye;exports.commentPrefix=h;exports.injectCommentContext=E;exports.provideCommentContext=V;exports.useComment=fe;
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { DialogPortalProps, DialogRootEmits, DialogContentProps, DialogContentEmits } from 'reka-ui';
|
|
1
|
+
import { FocusOutsideEvent, DialogPortalProps, DialogRootEmits, DialogContentProps, DialogContentEmits } from 'reka-ui';
|
|
2
2
|
import { ButtonProps } from '../Button/Button';
|
|
3
3
|
import { PopoverBaseProps } from '../Popover/type';
|
|
4
4
|
import { ClassValue } from 'clsx';
|
|
5
5
|
import { DialogDrawerSide, DialogSize, DialogType } from './Dialog.model';
|
|
6
6
|
export declare const DIALOG_DEFAULT_PROPS: {
|
|
7
|
+
readonly keyboard: true;
|
|
8
|
+
readonly openAutoFocus: false;
|
|
9
|
+
readonly trapFocus: false;
|
|
10
|
+
readonly closeOnClickOutside: false;
|
|
7
11
|
readonly footer: undefined;
|
|
8
12
|
readonly open: false;
|
|
9
13
|
readonly canFullscreen: true;
|
|
@@ -142,6 +146,34 @@ export interface DialogSlots {
|
|
|
142
146
|
cancelPostIcon?: (data?: object) => never;
|
|
143
147
|
}
|
|
144
148
|
export interface DialogProps extends Omit<DialogPortalProps, 'to'>, Omit<DialogContentProps, 'as' | 'asChild' | 'onCloseAutoFocus'> {
|
|
149
|
+
/**
|
|
150
|
+
* Whether the dialog can be closed with keyboard (ESC key)
|
|
151
|
+
* @default true
|
|
152
|
+
* @example
|
|
153
|
+
* <Dialog :keyboard="false" />
|
|
154
|
+
*/
|
|
155
|
+
keyboard?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Whether the dialog should automatically focus the first focusable element when opened
|
|
158
|
+
* @default false
|
|
159
|
+
* @example
|
|
160
|
+
* <Dialog :open-auto-focus="true" />
|
|
161
|
+
*/
|
|
162
|
+
openAutoFocus?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Whether the dialog should trap focus within it
|
|
165
|
+
* @default false
|
|
166
|
+
* @example
|
|
167
|
+
* <Dialog :trap-focus="true" />
|
|
168
|
+
*/
|
|
169
|
+
trapFocus?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Whether the dialog can be closed by clicking outside of it
|
|
172
|
+
* @default false
|
|
173
|
+
* @example
|
|
174
|
+
* <Dialog :close-on-click-outside="true" />
|
|
175
|
+
*/
|
|
176
|
+
closeOnClickOutside?: boolean;
|
|
145
177
|
/**
|
|
146
178
|
* Whether the dialog is open (v-model)
|
|
147
179
|
* @default false
|
|
@@ -464,7 +496,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Di
|
|
|
464
496
|
close: () => any;
|
|
465
497
|
escapeKeyDown: (event: KeyboardEvent) => any;
|
|
466
498
|
pointerDownOutside: (event: import('reka-ui').PointerDownOutsideEvent) => any;
|
|
467
|
-
focusOutside: (event:
|
|
499
|
+
focusOutside: (event: FocusOutsideEvent) => any;
|
|
468
500
|
"update:open": (value: boolean) => any;
|
|
469
501
|
ok: (event: Event) => any;
|
|
470
502
|
"update:fullScreen": (value: boolean) => any;
|
|
@@ -473,7 +505,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Di
|
|
|
473
505
|
onClose?: (() => any) | undefined;
|
|
474
506
|
onEscapeKeyDown?: ((event: KeyboardEvent) => any) | undefined;
|
|
475
507
|
onPointerDownOutside?: ((event: import('reka-ui').PointerDownOutsideEvent) => any) | undefined;
|
|
476
|
-
onFocusOutside?: ((event:
|
|
508
|
+
onFocusOutside?: ((event: FocusOutsideEvent) => any) | undefined;
|
|
477
509
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
478
510
|
onOk?: ((event: Event) => any) | undefined;
|
|
479
511
|
"onUpdate:fullScreen"?: ((value: boolean) => any) | undefined;
|
|
@@ -483,10 +515,12 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Di
|
|
|
483
515
|
type: DialogType;
|
|
484
516
|
width: DialogSize | number | string;
|
|
485
517
|
open: boolean;
|
|
518
|
+
openAutoFocus: boolean;
|
|
486
519
|
side: DialogDrawerSide;
|
|
487
520
|
zIndex: number;
|
|
488
521
|
screen: boolean;
|
|
489
522
|
closeable: boolean;
|
|
523
|
+
keyboard: boolean;
|
|
490
524
|
okProps: ButtonProps & {
|
|
491
525
|
text: string;
|
|
492
526
|
hide?: boolean;
|
|
@@ -495,6 +529,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Di
|
|
|
495
529
|
text: string;
|
|
496
530
|
hide?: boolean;
|
|
497
531
|
};
|
|
532
|
+
trapFocus: boolean;
|
|
533
|
+
closeOnClickOutside: boolean;
|
|
498
534
|
canFullscreen: boolean;
|
|
499
535
|
fullScreen: boolean;
|
|
500
536
|
frameless: boolean;
|
package/dist/Drawer/Drawer.d.ts
CHANGED
|
@@ -44,10 +44,12 @@ declare const __VLS_component: import('vue').DefineComponent<DrawerProps, {}, {}
|
|
|
44
44
|
mask: boolean;
|
|
45
45
|
width: import('../Dialog/Dialog.model').DialogSize | number | string;
|
|
46
46
|
open: boolean;
|
|
47
|
+
openAutoFocus: boolean;
|
|
47
48
|
side: import('../Dialog/Dialog.model').DialogDrawerSide;
|
|
48
49
|
zIndex: number;
|
|
49
50
|
screen: boolean;
|
|
50
51
|
closeable: boolean;
|
|
52
|
+
keyboard: boolean;
|
|
51
53
|
okProps: import('..').ButtonProps & {
|
|
52
54
|
text: string;
|
|
53
55
|
hide?: boolean;
|
|
@@ -56,6 +58,8 @@ declare const __VLS_component: import('vue').DefineComponent<DrawerProps, {}, {}
|
|
|
56
58
|
text: string;
|
|
57
59
|
hide?: boolean;
|
|
58
60
|
};
|
|
61
|
+
trapFocus: boolean;
|
|
62
|
+
closeOnClickOutside: boolean;
|
|
59
63
|
canFullscreen: boolean;
|
|
60
64
|
fullScreen: boolean;
|
|
61
65
|
frameless: boolean;
|
package/dist/Modal/Modal.d.ts
CHANGED
|
@@ -44,9 +44,11 @@ declare const __VLS_component: import('vue').DefineComponent<ModalProps, {}, {},
|
|
|
44
44
|
mask: boolean;
|
|
45
45
|
width: import('../Dialog/Dialog.model').DialogSize | number | string;
|
|
46
46
|
open: boolean;
|
|
47
|
+
openAutoFocus: boolean;
|
|
47
48
|
zIndex: number;
|
|
48
49
|
screen: boolean;
|
|
49
50
|
closeable: boolean;
|
|
51
|
+
keyboard: boolean;
|
|
50
52
|
okProps: import('..').ButtonProps & {
|
|
51
53
|
text: string;
|
|
52
54
|
hide?: boolean;
|
|
@@ -55,6 +57,8 @@ declare const __VLS_component: import('vue').DefineComponent<ModalProps, {}, {},
|
|
|
55
57
|
text: string;
|
|
56
58
|
hide?: boolean;
|
|
57
59
|
};
|
|
60
|
+
trapFocus: boolean;
|
|
61
|
+
closeOnClickOutside: boolean;
|
|
58
62
|
canFullscreen: boolean;
|
|
59
63
|
fullScreen: boolean;
|
|
60
64
|
frameless: boolean;
|
package/dist/Tabs/index.js
CHANGED
|
@@ -32,7 +32,7 @@ const [se, ze] = ge("Tabs"), $e = /* @__PURE__ */ U({
|
|
|
32
32
|
setup(c, { emit: o }) {
|
|
33
33
|
const t = c, v = o, g = Ce(t, "modelValue", v, {
|
|
34
34
|
defaultValue: t.defaultValue,
|
|
35
|
-
passive: t.
|
|
35
|
+
passive: t.modelValue === void 0,
|
|
36
36
|
onChange: (B) => v("change", B)
|
|
37
37
|
}), { getDir: y } = ye(), f = y();
|
|
38
38
|
return ze({
|