@univerjs/thread-comment-ui 0.6.10-nightly.202504271606 → 0.6.10-nightly.202504281607
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/lib/cjs/index.js +12 -16
- package/lib/es/index.js +116 -121
- package/lib/index.css +1 -1
- package/lib/index.js +116 -121
- package/lib/types/views/thread-comment-editor/index.d.ts +1 -2
- package/lib/umd/index.js +12 -16
- package/package.json +6 -6
package/lib/es/index.js
CHANGED
|
@@ -5,15 +5,15 @@ import { Inject as Se, IUniverInstanceService as Ve, Disposable as Ae, UniverIns
|
|
|
5
5
|
import { UniverThreadCommentPlugin as Xe, ThreadCommentModel as Ne, getDT as et, AddCommentCommand as tt, ResolveCommentCommand as nt, DeleteCommentTreeCommand as we, UpdateCommentCommand as rt, DeleteCommentCommand as it } from "@univerjs/thread-comment";
|
|
6
6
|
import { ISidebarService as Ue, useDependency as N, KeyCode as pe, useObservable as G, useConfigValue as lt, UI_PLUGIN_CONFIG_KEY as ot } from "@univerjs/ui";
|
|
7
7
|
import { BehaviorSubject as ge, filter as at, debounceTime as st } from "rxjs";
|
|
8
|
-
import { jsxs as
|
|
9
|
-
import { Button as se, clsx as Ce, Tooltip as dt, Dropdown as ut, Select as
|
|
8
|
+
import { jsxs as x, jsx as a } from "react/jsx-runtime";
|
|
9
|
+
import { Button as se, clsx as Ce, Tooltip as dt, Dropdown as ut, Select as Ie } from "@univerjs/design";
|
|
10
10
|
import { forwardRef as B, useRef as te, createElement as Z, useState as A, useEffect as de, useMemo as ee, useImperativeHandle as ct } from "react";
|
|
11
11
|
import { IEditorService as vt, BreakLineCommand as mt, RichTextEditor as ft } from "@univerjs/docs-ui";
|
|
12
12
|
var ht = Object.getOwnPropertyDescriptor, pt = (t, e, n, r) => {
|
|
13
13
|
for (var i = r > 1 ? void 0 : r ? ht(e, n) : e, l = t.length - 1, d; l >= 0; l--)
|
|
14
14
|
(d = t[l]) && (i = d(i) || i);
|
|
15
15
|
return i;
|
|
16
|
-
},
|
|
16
|
+
}, xe = (t, e) => (n, r) => e(n, r, t);
|
|
17
17
|
let q = class extends Ae {
|
|
18
18
|
constructor(e, n) {
|
|
19
19
|
super();
|
|
@@ -52,10 +52,10 @@ let q = class extends Ae {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
q = pt([
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
xe(0, Se(Ue)),
|
|
56
|
+
xe(1, Ve)
|
|
57
57
|
], q);
|
|
58
|
-
const gt = "thread-comment-panel", Ct = "UNIVER_THREAD_COMMENT_UI_PLUGIN",
|
|
58
|
+
const gt = "thread-comment-panel", Ct = "UNIVER_THREAD_COMMENT_UI_PLUGIN", It = {
|
|
59
59
|
id: "thread-comment-ui.operation.toggle-panel",
|
|
60
60
|
type: _e.OPERATION,
|
|
61
61
|
handler(t) {
|
|
@@ -72,7 +72,7 @@ const gt = "thread-comment-panel", Ct = "UNIVER_THREAD_COMMENT_UI_PLUGIN", xt =
|
|
|
72
72
|
handler(t, e) {
|
|
73
73
|
return t.get(q).setActiveComment(e), !0;
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, xt = "thread-comment-ui.config", be = {};
|
|
76
76
|
var bt = Object.defineProperty, yt = Object.getOwnPropertyDescriptor, St = (t, e, n) => e in t ? bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, _t = (t, e, n, r) => {
|
|
77
77
|
for (var i = r > 1 ? void 0 : r ? yt(e, n) : e, l = t.length - 1, d; l >= 0; l--)
|
|
78
78
|
(d = t[l]) && (i = d(i) || i);
|
|
@@ -86,7 +86,7 @@ let ue = class extends ze {
|
|
|
86
86
|
be,
|
|
87
87
|
this._config
|
|
88
88
|
);
|
|
89
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
|
89
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(xt, l);
|
|
90
90
|
}
|
|
91
91
|
onStarting() {
|
|
92
92
|
var t;
|
|
@@ -94,7 +94,7 @@ let ue = class extends ze {
|
|
|
94
94
|
[q]
|
|
95
95
|
], (t = this._config) == null ? void 0 : t.overrides).forEach((e) => {
|
|
96
96
|
this._injector.add(e);
|
|
97
|
-
}), [
|
|
97
|
+
}), [It, K].forEach((e) => {
|
|
98
98
|
this._commandService.registerCommand(e);
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -201,7 +201,6 @@ var Mt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em"
|
|
|
201
201
|
}));
|
|
202
202
|
});
|
|
203
203
|
Re.displayName = "SolveSingle";
|
|
204
|
-
const Rt = {};
|
|
205
204
|
function ye(t) {
|
|
206
205
|
return {
|
|
207
206
|
id: "d",
|
|
@@ -246,7 +245,7 @@ const je = B((t, e) => {
|
|
|
246
245
|
}]);
|
|
247
246
|
}
|
|
248
247
|
}));
|
|
249
|
-
const
|
|
248
|
+
const I = () => {
|
|
250
249
|
if (c.current) {
|
|
251
250
|
const u = Ye.deepClone(c.current.getDocumentData().body);
|
|
252
251
|
T(!1), r == null || r({
|
|
@@ -258,13 +257,13 @@ const je = B((t, e) => {
|
|
|
258
257
|
}, 10);
|
|
259
258
|
}
|
|
260
259
|
};
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ x("div", { onClick: (u) => u.preventDefault(), children: [
|
|
261
|
+
/* @__PURE__ */ a(
|
|
263
262
|
ft,
|
|
264
263
|
{
|
|
264
|
+
className: "univer-w-full",
|
|
265
265
|
editorRef: c,
|
|
266
266
|
autoFocus: d,
|
|
267
|
-
style: { width: "100%" },
|
|
268
267
|
keyboardEventConfig: V,
|
|
269
268
|
placeholder: O.t("threadCommentUI.editor.placeholder"),
|
|
270
269
|
initialValue: (n == null ? void 0 : n.text) && ye(n.text),
|
|
@@ -278,8 +277,8 @@ const je = B((t, e) => {
|
|
|
278
277
|
}
|
|
279
278
|
}
|
|
280
279
|
),
|
|
281
|
-
P ? /* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
280
|
+
P ? /* @__PURE__ */ x("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-end", children: [
|
|
281
|
+
/* @__PURE__ */ a(
|
|
283
282
|
se,
|
|
284
283
|
{
|
|
285
284
|
style: { marginRight: 12 },
|
|
@@ -290,18 +289,18 @@ const je = B((t, e) => {
|
|
|
290
289
|
children: O.t("threadCommentUI.editor.cancel")
|
|
291
290
|
}
|
|
292
291
|
),
|
|
293
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ a(
|
|
294
293
|
se,
|
|
295
294
|
{
|
|
296
295
|
variant: "primary",
|
|
297
296
|
disabled: !E,
|
|
298
|
-
onClick:
|
|
297
|
+
onClick: I,
|
|
299
298
|
children: O.t(i ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
|
|
300
299
|
}
|
|
301
300
|
)
|
|
302
301
|
] }) : null
|
|
303
302
|
] });
|
|
304
|
-
}),
|
|
303
|
+
}), Rt = (t) => {
|
|
305
304
|
const { dataStream: e, customRanges: n } = t, r = e.endsWith(`\r
|
|
306
305
|
`) ? e.length - 2 : e.length, i = [];
|
|
307
306
|
let l = 0;
|
|
@@ -320,14 +319,14 @@ const je = B((t, e) => {
|
|
|
320
319
|
type: "text",
|
|
321
320
|
content: e.slice(l, r)
|
|
322
321
|
}), i;
|
|
323
|
-
},
|
|
322
|
+
}, jt = (t) => {
|
|
324
323
|
const { paragraphs: e = [] } = t;
|
|
325
324
|
let n = 0;
|
|
326
325
|
return e.map((r) => {
|
|
327
326
|
const i = Je(t, n, r.startIndex);
|
|
328
|
-
return n = r.startIndex + 1,
|
|
327
|
+
return n = r.startIndex + 1, Rt(i);
|
|
329
328
|
});
|
|
330
|
-
},
|
|
329
|
+
}, Ht = (t) => {
|
|
331
330
|
let e = "";
|
|
332
331
|
const n = [];
|
|
333
332
|
return t.forEach((r) => {
|
|
@@ -367,8 +366,8 @@ const je = B((t, e) => {
|
|
|
367
366
|
dataStream: e,
|
|
368
367
|
customRanges: n
|
|
369
368
|
};
|
|
370
|
-
}, He = "__mock__",
|
|
371
|
-
const { item: e, unitId: n, subUnitId: r, editing: i, onEditingChange: l, onReply: d, resolved: f, isRoot: h, onClose: w, onDeleteComment: O, type: P } = t, T = N(ne), b = N(fe), c = N(he), v = c.getUser(e.personId), E = G(c.currentUser$), y = (E == null ? void 0 : E.userID) === e.personId, V = e.id === He, [
|
|
369
|
+
}, He = "__mock__", Lt = (t) => {
|
|
370
|
+
const { item: e, unitId: n, subUnitId: r, editing: i, onEditingChange: l, onReply: d, resolved: f, isRoot: h, onClose: w, onDeleteComment: O, type: P } = t, T = N(ne), b = N(fe), c = N(he), v = c.getUser(e.personId), E = G(c.currentUser$), y = (E == null ? void 0 : E.userID) === e.personId, V = e.id === He, [I, R] = A(!1), u = lt(ot), m = u == null ? void 0 : u.avatarFallback, p = () => {
|
|
372
371
|
(O == null ? void 0 : O(e)) !== !1 && (T.executeCommand(
|
|
373
372
|
h ? we.id : it.id,
|
|
374
373
|
{
|
|
@@ -378,8 +377,8 @@ const je = B((t, e) => {
|
|
|
378
377
|
}
|
|
379
378
|
), h && (w == null || w()));
|
|
380
379
|
};
|
|
381
|
-
return /* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
380
|
+
return /* @__PURE__ */ x("div", { className: "univer-relative univer-mb-3 univer-pl-[30px]", onMouseLeave: () => R(!1), onMouseEnter: () => R(!0), children: [
|
|
381
|
+
/* @__PURE__ */ a(
|
|
383
382
|
"div",
|
|
384
383
|
{
|
|
385
384
|
className: `
|
|
@@ -391,26 +390,26 @@ const je = B((t, e) => {
|
|
|
391
390
|
}
|
|
392
391
|
}
|
|
393
392
|
),
|
|
394
|
-
v ? /* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
V || f ? null :
|
|
393
|
+
v ? /* @__PURE__ */ x("div", { className: "univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between", children: [
|
|
394
|
+
/* @__PURE__ */ a("div", { className: "univer-text-sm univer-font-medium univer-leading-5", children: (v == null ? void 0 : v.name) || " " }),
|
|
395
|
+
/* @__PURE__ */ x("div", { children: [
|
|
396
|
+
V || f ? null : I && v ? /* @__PURE__ */ a(
|
|
398
397
|
"div",
|
|
399
398
|
{
|
|
400
399
|
className: `
|
|
401
400
|
univer-ml-1 univer-inline-flex univer-h-6 univer-w-6
|
|
402
401
|
univer-cursor-pointer univer-items-center univer-justify-center
|
|
403
|
-
univer-rounded-
|
|
402
|
+
univer-rounded-sm univer-text-base
|
|
404
403
|
hover:univer-bg-gray-50
|
|
405
404
|
`,
|
|
406
405
|
onClick: () => d(v),
|
|
407
|
-
children: /* @__PURE__ */
|
|
406
|
+
children: /* @__PURE__ */ a($e, {})
|
|
408
407
|
}
|
|
409
408
|
) : null,
|
|
410
|
-
y && !V && !f ? /* @__PURE__ */
|
|
409
|
+
y && !V && !f ? /* @__PURE__ */ a(
|
|
411
410
|
ut,
|
|
412
411
|
{
|
|
413
|
-
overlay: /* @__PURE__ */
|
|
412
|
+
overlay: /* @__PURE__ */ a("div", { className: "univer-rounded-lg univer-p-4 univer-theme", children: /* @__PURE__ */ x(
|
|
414
413
|
"ul",
|
|
415
414
|
{
|
|
416
415
|
className: `
|
|
@@ -419,7 +418,7 @@ const je = B((t, e) => {
|
|
|
419
418
|
[&_a]:univer-cursor-pointer [&_a]:univer-rounded [&_a]:univer-p-1
|
|
420
419
|
`,
|
|
421
420
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
423
422
|
"a",
|
|
424
423
|
{
|
|
425
424
|
className: "hover:univer-bg-gray-200",
|
|
@@ -427,7 +426,7 @@ const je = B((t, e) => {
|
|
|
427
426
|
children: b.t("threadCommentUI.item.edit")
|
|
428
427
|
}
|
|
429
428
|
) }),
|
|
430
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
431
430
|
"a",
|
|
432
431
|
{
|
|
433
432
|
className: "hover:univer-bg-gray-200",
|
|
@@ -438,7 +437,7 @@ const je = B((t, e) => {
|
|
|
438
437
|
]
|
|
439
438
|
}
|
|
440
439
|
) }),
|
|
441
|
-
children: /* @__PURE__ */
|
|
440
|
+
children: /* @__PURE__ */ a(
|
|
442
441
|
"div",
|
|
443
442
|
{
|
|
444
443
|
className: `
|
|
@@ -447,15 +446,15 @@ const je = B((t, e) => {
|
|
|
447
446
|
univer-text-base
|
|
448
447
|
hover:univer-bg-gray-50
|
|
449
448
|
`,
|
|
450
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ a(De, {})
|
|
451
450
|
}
|
|
452
451
|
)
|
|
453
452
|
}
|
|
454
453
|
) : null
|
|
455
454
|
] })
|
|
456
455
|
] }) : null,
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
i ? /* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ a("div", { className: "univer-mb-1 univer-text-xs univer-leading-[1.5] univer-text-gray-600", children: e.dT }),
|
|
457
|
+
i ? /* @__PURE__ */ a(
|
|
459
458
|
je,
|
|
460
459
|
{
|
|
461
460
|
type: P,
|
|
@@ -480,10 +479,10 @@ const je = B((t, e) => {
|
|
|
480
479
|
);
|
|
481
480
|
}
|
|
482
481
|
}
|
|
483
|
-
) : /* @__PURE__ */
|
|
482
|
+
) : /* @__PURE__ */ a("div", { className: "univer-text-[13px] univer-leading-5 univer-text-gray-900", children: jt(e.text).map((S, g) => /* @__PURE__ */ a("div", { className: "univer-break-words", children: S.map((o, _) => {
|
|
484
483
|
switch (o.type) {
|
|
485
484
|
case "mention":
|
|
486
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ x("a", { className: "univer-text-primary-600", children: [
|
|
487
486
|
o.content.label,
|
|
488
487
|
" "
|
|
489
488
|
] }, _);
|
|
@@ -492,8 +491,8 @@ const je = B((t, e) => {
|
|
|
492
491
|
}
|
|
493
492
|
}) }, g)) })
|
|
494
493
|
] });
|
|
495
|
-
},
|
|
496
|
-
var ae, X,
|
|
494
|
+
}, Pt = (t) => {
|
|
495
|
+
var ae, X, s;
|
|
497
496
|
const {
|
|
498
497
|
id: e,
|
|
499
498
|
unitId: n,
|
|
@@ -513,7 +512,7 @@ const je = B((t, e) => {
|
|
|
513
512
|
onResolve: E,
|
|
514
513
|
type: y,
|
|
515
514
|
style: V,
|
|
516
|
-
full:
|
|
515
|
+
full: I
|
|
517
516
|
} = t, R = N(Ne), [u, m] = A(!1), [p, S] = A(""), g = ee(() => R.commentUpdate$.pipe(st(16)), [R]);
|
|
518
517
|
G(g);
|
|
519
518
|
const o = e ? R.getCommentWithChildren(n, r, e) : null, _ = N(ne), W = N(he), k = o == null ? void 0 : o.root.resolved, D = G(W.currentUser$), H = te(null), J = [
|
|
@@ -556,8 +555,8 @@ const je = B((t, e) => {
|
|
|
556
555
|
), h == null || h());
|
|
557
556
|
};
|
|
558
557
|
de(() => b == null ? void 0 : b(), []);
|
|
559
|
-
const ie = w((
|
|
560
|
-
return /* @__PURE__ */
|
|
558
|
+
const ie = w((s = o == null ? void 0 : o.root.subUnitId) != null ? s : r), le = l && !p && !k, oe = `${i || (o == null ? void 0 : o.root.ref) || ""}${ie ? " · " : ""}${ie}`;
|
|
559
|
+
return /* @__PURE__ */ x(
|
|
561
560
|
"div",
|
|
562
561
|
{
|
|
563
562
|
className: Ce(
|
|
@@ -565,7 +564,7 @@ const je = B((t, e) => {
|
|
|
565
564
|
univer-relative univer-box-border univer-rounded-lg univer-border univer-border-solid
|
|
566
565
|
univer-border-gray-200 univer-bg-white univer-p-4
|
|
567
566
|
`,
|
|
568
|
-
|
|
567
|
+
I ? "univer-w-full" : "univer-w-[278px]",
|
|
569
568
|
{
|
|
570
569
|
"univer-shadow": !k && (f || u || O === "cell")
|
|
571
570
|
}
|
|
@@ -580,16 +579,16 @@ const je = B((t, e) => {
|
|
|
580
579
|
b == null || b(), m(!1);
|
|
581
580
|
},
|
|
582
581
|
children: [
|
|
583
|
-
!k && f ? /* @__PURE__ */
|
|
582
|
+
!k && f ? /* @__PURE__ */ a(
|
|
584
583
|
"div",
|
|
585
584
|
{
|
|
586
585
|
className: `
|
|
587
|
-
univer-absolute univer-left-0 univer-right-0 univer-top-0 univer-h-
|
|
588
|
-
univer-
|
|
586
|
+
univer-absolute univer-left-0 univer-right-0 univer-top-0 univer-h-1.5 univer-rounded-t-md
|
|
587
|
+
univer-bg-yellow-400
|
|
589
588
|
`
|
|
590
589
|
}
|
|
591
590
|
) : null,
|
|
592
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ x(
|
|
593
592
|
"div",
|
|
594
593
|
{
|
|
595
594
|
className: `
|
|
@@ -597,17 +596,17 @@ const je = B((t, e) => {
|
|
|
597
596
|
univer-leading-5
|
|
598
597
|
`,
|
|
599
598
|
children: [
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ x("div", { className: "univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden", children: [
|
|
600
|
+
/* @__PURE__ */ a(
|
|
602
601
|
"div",
|
|
603
602
|
{
|
|
604
603
|
className: `
|
|
605
|
-
univer-mr-2 univer-h-
|
|
606
|
-
univer-rounded-
|
|
604
|
+
univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0
|
|
605
|
+
univer-rounded-sm univer-bg-yellow-400
|
|
607
606
|
`
|
|
608
607
|
}
|
|
609
608
|
),
|
|
610
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ a(dt, { showIfEllipsis: !0, title: oe, children: /* @__PURE__ */ a(
|
|
611
610
|
"div",
|
|
612
611
|
{
|
|
613
612
|
className: `
|
|
@@ -617,8 +616,8 @@ const je = B((t, e) => {
|
|
|
617
616
|
}
|
|
618
617
|
) })
|
|
619
618
|
] }),
|
|
620
|
-
o ? /* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
619
|
+
o ? /* @__PURE__ */ x("div", { className: "univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row", children: [
|
|
620
|
+
/* @__PURE__ */ a(
|
|
622
621
|
"div",
|
|
623
622
|
{
|
|
624
623
|
onClick: re,
|
|
@@ -632,10 +631,10 @@ const je = B((t, e) => {
|
|
|
632
631
|
"univer-text-green-500": k
|
|
633
632
|
}
|
|
634
633
|
),
|
|
635
|
-
children: k ? /* @__PURE__ */
|
|
634
|
+
children: k ? /* @__PURE__ */ a(Me, {}) : /* @__PURE__ */ a(Re, {})
|
|
636
635
|
}
|
|
637
636
|
),
|
|
638
|
-
(D == null ? void 0 : D.userID) === o.root.personId ? /* @__PURE__ */
|
|
637
|
+
(D == null ? void 0 : D.userID) === o.root.personId ? /* @__PURE__ */ a(
|
|
639
638
|
"div",
|
|
640
639
|
{
|
|
641
640
|
className: `
|
|
@@ -645,25 +644,21 @@ const je = B((t, e) => {
|
|
|
645
644
|
hover:univer-bg-gray-50
|
|
646
645
|
`,
|
|
647
646
|
onClick: Q,
|
|
648
|
-
children: /* @__PURE__ */
|
|
647
|
+
children: /* @__PURE__ */ a(Ee, {})
|
|
649
648
|
}
|
|
650
649
|
) : null
|
|
651
650
|
] }) : null
|
|
652
651
|
]
|
|
653
652
|
}
|
|
654
653
|
),
|
|
655
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ a(
|
|
656
655
|
"div",
|
|
657
656
|
{
|
|
658
|
-
className: `
|
|
659
|
-
univer-max-h-[300px] univer-overflow-y-auto univer-overflow-x-hidden
|
|
660
|
-
[scrollbar-gutter:auto]
|
|
661
|
-
[scrollbar-width:thin]
|
|
662
|
-
`,
|
|
663
657
|
ref: j,
|
|
658
|
+
className: "univer-max-h-[300px] univer-overflow-y-auto univer-overflow-x-hidden",
|
|
664
659
|
children: J.map(
|
|
665
|
-
(C) => /* @__PURE__ */
|
|
666
|
-
|
|
660
|
+
(C) => /* @__PURE__ */ a(
|
|
661
|
+
Lt,
|
|
667
662
|
{
|
|
668
663
|
onClose: h,
|
|
669
664
|
unitId: n,
|
|
@@ -679,7 +674,7 @@ const je = B((t, e) => {
|
|
|
679
674
|
onReply: ($) => {
|
|
680
675
|
$ && requestAnimationFrame(() => {
|
|
681
676
|
var L;
|
|
682
|
-
(L = H.current) == null || L.reply(
|
|
677
|
+
(L = H.current) == null || L.reply(Ht([
|
|
683
678
|
{
|
|
684
679
|
type: "mention",
|
|
685
680
|
content: {
|
|
@@ -702,7 +697,7 @@ const je = B((t, e) => {
|
|
|
702
697
|
)
|
|
703
698
|
}
|
|
704
699
|
),
|
|
705
|
-
le ? /* @__PURE__ */
|
|
700
|
+
le ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
706
701
|
je,
|
|
707
702
|
{
|
|
708
703
|
ref: H,
|
|
@@ -741,7 +736,7 @@ const je = B((t, e) => {
|
|
|
741
736
|
]
|
|
742
737
|
}
|
|
743
738
|
);
|
|
744
|
-
},
|
|
739
|
+
}, Yt = (t) => {
|
|
745
740
|
const {
|
|
746
741
|
unitId: e,
|
|
747
742
|
subUnitId$: n,
|
|
@@ -757,9 +752,9 @@ const je = B((t, e) => {
|
|
|
757
752
|
onAddComment: T,
|
|
758
753
|
onDeleteComment: b,
|
|
759
754
|
showComments: c
|
|
760
|
-
} = t, [v, E] = A("all"), [y, V] = A("all"),
|
|
755
|
+
} = t, [v, E] = A("all"), [y, V] = A("all"), I = N(fe), R = N(he), u = N(Ne), [m, p] = A(() => u.getUnit(e)), S = N(q), g = G(S.activeCommentId$), o = G(u.commentUpdate$), _ = N(ne), W = G(n), k = te(!0), D = "panel", H = G(R.currentUser$), J = ee(() => {
|
|
761
756
|
var L;
|
|
762
|
-
const
|
|
757
|
+
const s = v === "all" ? m : (L = m.filter((U) => U.subUnitId === W)) != null ? L : [], C = f != null ? f : (U) => U, $ = s.map((U) => {
|
|
763
758
|
var F;
|
|
764
759
|
return { ...U.root, children: (F = U.children) != null ? F : [], users: U.relativeUsers };
|
|
765
760
|
});
|
|
@@ -771,9 +766,9 @@ const je = B((t, e) => {
|
|
|
771
766
|
} else
|
|
772
767
|
return C($);
|
|
773
768
|
}, [c, v, m, f, W]), j = ee(() => [
|
|
774
|
-
...J.filter((
|
|
775
|
-
...J.filter((
|
|
776
|
-
], [J]), re = ee(() => y === "resolved" ? j.filter((
|
|
769
|
+
...J.filter((s) => !s.resolved),
|
|
770
|
+
...J.filter((s) => s.resolved)
|
|
771
|
+
], [J]), re = ee(() => y === "resolved" ? j.filter((s) => s.resolved) : y === "unsolved" ? j.filter((s) => !s.resolved) : y === "concern_me" && H != null && H.userID ? j.filter((s) => s == null ? void 0 : s.users.has(H.userID)) : j, [j, H == null ? void 0 : H.userID, y]), Q = P ? [P, ...re] : re, ie = Q.filter((s) => !s.resolved), le = Q.filter((s) => s.resolved), oe = y !== "all" || v !== "all", ae = () => {
|
|
777
772
|
V("all"), E("all");
|
|
778
773
|
};
|
|
779
774
|
de(() => {
|
|
@@ -788,89 +783,89 @@ const je = B((t, e) => {
|
|
|
788
783
|
k.current = !0;
|
|
789
784
|
return;
|
|
790
785
|
}
|
|
791
|
-
const { unitId:
|
|
786
|
+
const { unitId: s, subUnitId: C, commentId: $ } = g, L = `${D}-${s}-${C}-${$}`;
|
|
792
787
|
(U = document.getElementById(L)) == null || U.scrollIntoView({ block: "center" });
|
|
793
788
|
}, [g]);
|
|
794
|
-
const X = (
|
|
795
|
-
|
|
789
|
+
const X = (s) => /* @__PURE__ */ a(
|
|
790
|
+
Pt,
|
|
796
791
|
{
|
|
797
792
|
full: !0,
|
|
798
793
|
prefix: D,
|
|
799
794
|
getSubUnitName: l,
|
|
800
|
-
id:
|
|
801
|
-
unitId:
|
|
802
|
-
subUnitId:
|
|
803
|
-
refStr:
|
|
795
|
+
id: s.id,
|
|
796
|
+
unitId: s.unitId,
|
|
797
|
+
subUnitId: s.subUnitId,
|
|
798
|
+
refStr: s.ref,
|
|
804
799
|
type: r,
|
|
805
|
-
showEdit: (g == null ? void 0 : g.commentId) ===
|
|
806
|
-
showHighlight: (g == null ? void 0 : g.commentId) ===
|
|
800
|
+
showEdit: (g == null ? void 0 : g.commentId) === s.id,
|
|
801
|
+
showHighlight: (g == null ? void 0 : g.commentId) === s.id,
|
|
807
802
|
onClick: () => {
|
|
808
|
-
k.current = !1,
|
|
803
|
+
k.current = !1, s.resolved ? _.executeCommand(K.id) : _.executeCommand(
|
|
809
804
|
K.id,
|
|
810
805
|
{
|
|
811
|
-
unitId:
|
|
812
|
-
subUnitId:
|
|
813
|
-
commentId:
|
|
806
|
+
unitId: s.unitId,
|
|
807
|
+
subUnitId: s.subUnitId,
|
|
808
|
+
commentId: s.id,
|
|
814
809
|
temp: !1
|
|
815
810
|
}
|
|
816
811
|
);
|
|
817
812
|
},
|
|
818
|
-
onMouseEnter: () => w == null ? void 0 : w(
|
|
819
|
-
onMouseLeave: () => h == null ? void 0 : h(
|
|
813
|
+
onMouseEnter: () => w == null ? void 0 : w(s),
|
|
814
|
+
onMouseLeave: () => h == null ? void 0 : h(s),
|
|
820
815
|
onAddComment: T,
|
|
821
816
|
onDeleteComment: b,
|
|
822
|
-
onResolve: (C) => d == null ? void 0 : d(
|
|
817
|
+
onResolve: (C) => d == null ? void 0 : d(s.id, C)
|
|
823
818
|
},
|
|
824
|
-
|
|
819
|
+
s.id
|
|
825
820
|
);
|
|
826
|
-
return /* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
828
|
-
r === ce.UNIVER_SHEET ? /* @__PURE__ */
|
|
829
|
-
|
|
821
|
+
return /* @__PURE__ */ x("div", { className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3", children: [
|
|
822
|
+
/* @__PURE__ */ x("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between", children: [
|
|
823
|
+
r === ce.UNIVER_SHEET ? /* @__PURE__ */ a(
|
|
824
|
+
Ie,
|
|
830
825
|
{
|
|
831
826
|
borderless: !0,
|
|
832
827
|
value: v,
|
|
833
|
-
onChange: (a) => E(a),
|
|
834
828
|
options: [
|
|
835
829
|
{
|
|
836
830
|
value: "current",
|
|
837
|
-
label:
|
|
831
|
+
label: I.t("threadCommentUI.filter.sheet.current")
|
|
838
832
|
},
|
|
839
833
|
{
|
|
840
834
|
value: "all",
|
|
841
|
-
label:
|
|
835
|
+
label: I.t("threadCommentUI.filter.sheet.all")
|
|
842
836
|
}
|
|
843
|
-
]
|
|
837
|
+
],
|
|
838
|
+
onChange: E
|
|
844
839
|
}
|
|
845
840
|
) : null,
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
|
|
841
|
+
/* @__PURE__ */ a(
|
|
842
|
+
Ie,
|
|
848
843
|
{
|
|
849
844
|
borderless: !0,
|
|
850
845
|
value: y,
|
|
851
|
-
onChange: (a) => V(a),
|
|
852
846
|
options: [
|
|
853
847
|
{
|
|
854
848
|
value: "all",
|
|
855
|
-
label:
|
|
849
|
+
label: I.t("threadCommentUI.filter.status.all")
|
|
856
850
|
},
|
|
857
851
|
{
|
|
858
852
|
value: "resolved",
|
|
859
|
-
label:
|
|
853
|
+
label: I.t("threadCommentUI.filter.status.resolved")
|
|
860
854
|
},
|
|
861
855
|
{
|
|
862
856
|
value: "unsolved",
|
|
863
|
-
label:
|
|
857
|
+
label: I.t("threadCommentUI.filter.status.unsolved")
|
|
864
858
|
},
|
|
865
859
|
{
|
|
866
860
|
value: "concern_me",
|
|
867
|
-
label:
|
|
861
|
+
label: I.t("threadCommentUI.filter.status.concernMe")
|
|
868
862
|
}
|
|
869
|
-
]
|
|
863
|
+
],
|
|
864
|
+
onChange: V
|
|
870
865
|
}
|
|
871
866
|
)
|
|
872
867
|
] }),
|
|
873
|
-
Q.length === 0 ? /* @__PURE__ */
|
|
868
|
+
Q.length === 0 ? /* @__PURE__ */ x(
|
|
874
869
|
"div",
|
|
875
870
|
{
|
|
876
871
|
className: `
|
|
@@ -878,16 +873,16 @@ const je = B((t, e) => {
|
|
|
878
873
|
univer-text-[13px] univer-text-gray-600
|
|
879
874
|
`,
|
|
880
875
|
children: [
|
|
881
|
-
|
|
882
|
-
oe ? /* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
884
|
-
|
|
876
|
+
I.t("threadCommentUI.panel.empty"),
|
|
877
|
+
oe ? /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ a(se, { onClick: ae, children: I.t("threadCommentUI.panel.reset") }) }) : O ? null : /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ x(se, { onClick: i, children: [
|
|
878
|
+
/* @__PURE__ */ a(ke, { className: "univer-mr-1.5" }),
|
|
879
|
+
I.t("threadCommentUI.panel.add")
|
|
885
880
|
] }) })
|
|
886
881
|
]
|
|
887
882
|
}
|
|
888
|
-
) : /* @__PURE__ */
|
|
883
|
+
) : /* @__PURE__ */ x("div", { className: "univer-mt-3 univer-flex univer-flex-col univer-gap-3", children: [
|
|
889
884
|
ie.map(X),
|
|
890
|
-
le.length > 0 && /* @__PURE__ */
|
|
885
|
+
le.length > 0 && /* @__PURE__ */ a("div", { className: "univer-text-xs", children: I.t("threadCommentUI.panel.solved") }),
|
|
891
886
|
le.map(X)
|
|
892
887
|
] })
|
|
893
888
|
] });
|
|
@@ -895,9 +890,9 @@ const je = B((t, e) => {
|
|
|
895
890
|
export {
|
|
896
891
|
K as SetActiveCommentOperation,
|
|
897
892
|
gt as THREAD_COMMENT_PANEL,
|
|
898
|
-
|
|
893
|
+
Yt as ThreadCommentPanel,
|
|
899
894
|
q as ThreadCommentPanelService,
|
|
900
|
-
|
|
901
|
-
|
|
895
|
+
Pt as ThreadCommentTree,
|
|
896
|
+
It as ToggleSheetCommentPanelOperation,
|
|
902
897
|
ue as UniverThreadCommentUIPlugin
|
|
903
898
|
};
|
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-left-0{left:0}.univer-right-0{right:0}.univer-top-0{top:0}.univer-m-0{margin:0}.univer-mb-1{margin-bottom:4px}.univer-mb-3{margin-bottom:12px}.univer-mb-4{margin-bottom:16px}.univer-ml-1{margin-left:4px}.univer-mr-
|
|
1
|
+
.univer-absolute{position:absolute}.univer-relative{position:relative}.univer-left-0{left:0}.univer-right-0{right:0}.univer-top-0{top:0}.univer-m-0{margin:0}.univer-mb-1{margin-bottom:4px}.univer-mb-3{margin-bottom:12px}.univer-mb-4{margin-bottom:16px}.univer-ml-1{margin-left:4px}.univer-mr-1\.5{margin-right:6px}.univer-mr-2{margin-right:8px}.univer-mt-2{margin-top:8px}.univer-mt-3{margin-top:12px}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-inline-flex{display:inline-flex}.univer-grid{display:grid}.univer-h-1\.5{height:6px}.univer-h-3\.5{height:14px}.univer-h-6{height:24px}.univer-max-h-\[300px\]{max-height:300px}.univer-min-h-full{min-height:100%}.univer-w-6{width:24px}.univer-w-\[278px\]{width:278px}.univer-w-\[3px\]{width:3px}.univer-w-full{width:100%}.univer-flex-1{flex:1 1 0%}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow-0{flex-grow:0}.univer-cursor-pointer{cursor:pointer}.univer-list-none{list-style-type:none}.univer-flex-row{flex-direction:row}.univer-flex-col{flex-direction:column}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:8px}.univer-gap-3{gap:12px}.univer-overflow-hidden{overflow:hidden}.univer-overflow-y-auto{overflow-y:auto}.univer-overflow-x-hidden{overflow-x:hidden}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-break-words{word-wrap:break-word}.univer-rounded-\[3px\]{border-radius:3px}.univer-rounded-full{border-radius:9999px}.univer-rounded-lg{border-radius:8px}.univer-rounded-sm{border-radius:2px}.univer-rounded-t-md{border-top-left-radius:6px;border-top-right-radius:6px}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-gray-200{--tw-border-opacity: 1;border-color:#e3e5ea;border-color:rgba(227,229,234,var(--tw-border-opacity, 1))}.univer-bg-gray-50{--tw-bg-opacity: 1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--tw-bg-opacity, 1))}.univer-bg-white{--tw-bg-opacity: 1;background-color:#fff;background-color:rgba(255,255,255,var(--tw-bg-opacity, 1))}.univer-bg-yellow-400{--tw-bg-opacity: 1;background-color:#f1b312;background-color:rgba(241,179,18,var(--tw-bg-opacity, 1))}.univer-bg-cover{background-size:cover}.univer-bg-center{background-position:center}.univer-bg-no-repeat{background-repeat:no-repeat}.univer-p-0{padding:0}.univer-p-4{padding:16px}.univer-pb-3{padding-bottom:12px}.univer-pl-\[30px\]{padding-left:30px}.univer-text-\[13px\]{font-size:13px}.univer-text-base{font-size:16px;line-height:24px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-font-medium{font-weight:500}.univer-leading-5{line-height:20px}.univer-leading-\[1\.5\]{line-height:1.5}.univer-text-gray-600{--tw-text-opacity: 1;color:#31363f;color:rgba(49,54,63,var(--tw-text-opacity, 1))}.univer-text-gray-900{--tw-text-opacity: 1;color:#1b1c1f;color:rgba(27,28,31,var(--tw-text-opacity, 1))}.univer-text-green-500{--tw-text-opacity: 1;color:#0da471;color:rgba(13,164,113,var(--tw-text-opacity, 1))}.univer-text-primary-600{--tw-text-opacity: 1;color:#2c53f1;color:rgba(44,83,241,var(--tw-text-opacity, 1))}.univer-shadow{--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.hover\:univer-bg-gray-200:hover{--tw-bg-opacity: 1;background-color:#e3e5ea;background-color:rgba(227,229,234,var(--tw-bg-opacity, 1))}.hover\:univer-bg-gray-50:hover{--tw-bg-opacity: 1;background-color:#f9fafb;background-color:rgba(249,250,251,var(--tw-bg-opacity, 1))}.\[\&_a\]\:univer-cursor-pointer a{cursor:pointer}.\[\&_a\]\:univer-rounded a{border-radius:4px}.\[\&_a\]\:univer-p-1 a{padding:4px}
|