@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/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 I, jsx as s } from "react/jsx-runtime";
9
- import { Button as se, clsx as Ce, Tooltip as dt, Dropdown as ut, Select as xe } from "@univerjs/design";
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
- }, Ie = (t, e) => (n, r) => e(n, r, t);
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
- Ie(0, Se(Ue)),
56
- Ie(1, Ve)
55
+ xe(0, Se(Ue)),
56
+ xe(1, Ve)
57
57
  ], q);
58
- const gt = "thread-comment-panel", Ct = "UNIVER_THREAD_COMMENT_UI_PLUGIN", xt = {
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
- }, It = "thread-comment-ui.config", be = {};
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(It, l);
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
- }), [xt, K].forEach((e) => {
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 x = () => {
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__ */ I("div", { className: Rt.threadCommentEditor, onClick: (u) => u.preventDefault(), children: [
262
- /* @__PURE__ */ s(
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__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-end", children: [
282
- /* @__PURE__ */ s(
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__ */ s(
292
+ /* @__PURE__ */ a(
294
293
  se,
295
294
  {
296
295
  variant: "primary",
297
296
  disabled: !E,
298
- onClick: x,
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
- }), jt = (t) => {
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
- }, Ht = (t) => {
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, jt(i);
327
+ return n = r.startIndex + 1, Rt(i);
329
328
  });
330
- }, Lt = (t) => {
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__", Pt = (t) => {
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, [x, R] = A(!1), u = lt(ot), m = u == null ? void 0 : u.avatarFallback, p = () => {
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__ */ I("div", { className: "univer-relative univer-mb-3 univer-pl-[30px]", onMouseLeave: () => R(!1), onMouseEnter: () => R(!0), children: [
382
- /* @__PURE__ */ s(
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__ */ I("div", { className: "univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between", children: [
395
- /* @__PURE__ */ s("div", { className: "univer-text-sm univer-font-medium univer-leading-5", children: (v == null ? void 0 : v.name) || " " }),
396
- /* @__PURE__ */ I("div", { children: [
397
- V || f ? null : x && v ? /* @__PURE__ */ s(
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-[3px] univer-text-base
402
+ univer-rounded-sm univer-text-base
404
403
  hover:univer-bg-gray-50
405
404
  `,
406
405
  onClick: () => d(v),
407
- children: /* @__PURE__ */ s($e, {})
406
+ children: /* @__PURE__ */ a($e, {})
408
407
  }
409
408
  ) : null,
410
- y && !V && !f ? /* @__PURE__ */ s(
409
+ y && !V && !f ? /* @__PURE__ */ a(
411
410
  ut,
412
411
  {
413
- overlay: /* @__PURE__ */ s("div", { className: "univer-rounded-lg univer-p-4 univer-theme", children: /* @__PURE__ */ I(
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__ */ s("li", { children: /* @__PURE__ */ s(
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__ */ s("li", { children: /* @__PURE__ */ s(
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__ */ s(
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__ */ s(De, {})
449
+ children: /* @__PURE__ */ a(De, {})
451
450
  }
452
451
  )
453
452
  }
454
453
  ) : null
455
454
  ] })
456
455
  ] }) : null,
457
- /* @__PURE__ */ s("div", { className: "univer-mb-1 univer-text-xs univer-leading-[1.5] univer-text-gray-600", children: e.dT }),
458
- i ? /* @__PURE__ */ s(
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__ */ s("div", { className: "univer-text-[13px] univer-leading-5 univer-text-black", children: Ht(e.text).map((S, g) => /* @__PURE__ */ s("div", { className: "univer-break-words", children: S.map((o, _) => {
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__ */ I("a", { className: "univer-text-blue-600", children: [
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
- }, Vt = (t) => {
496
- var ae, X, a;
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: x
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((a = o == null ? void 0 : o.root.subUnitId) != null ? a : r), le = l && !p && !k, oe = `${i || (o == null ? void 0 : o.root.ref) || ""}${ie ? " · " : ""}${ie}`;
560
- return /* @__PURE__ */ I(
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
- x ? "univer-w-full" : "univer-w-[278px]",
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__ */ s(
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-[6px]
588
- univer-rounded-t-[6px] univer-bg-yellow-400
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__ */ I(
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__ */ I("div", { className: "univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden", children: [
601
- /* @__PURE__ */ s(
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-[14px] univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0
606
- univer-rounded-[1.5px] univer-bg-yellow-400
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__ */ s(dt, { showIfEllipsis: !0, title: oe, children: /* @__PURE__ */ s(
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__ */ I("div", { className: "univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row", children: [
621
- /* @__PURE__ */ s(
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__ */ s(Me, {}) : /* @__PURE__ */ s(Re, {})
634
+ children: k ? /* @__PURE__ */ a(Me, {}) : /* @__PURE__ */ a(Re, {})
636
635
  }
637
636
  ),
638
- (D == null ? void 0 : D.userID) === o.root.personId ? /* @__PURE__ */ s(
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__ */ s(Ee, {})
647
+ children: /* @__PURE__ */ a(Ee, {})
649
648
  }
650
649
  ) : null
651
650
  ] }) : null
652
651
  ]
653
652
  }
654
653
  ),
655
- /* @__PURE__ */ s(
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__ */ s(
666
- Pt,
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(Lt([
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__ */ s("div", { children: /* @__PURE__ */ s(
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
- }, qt = (t) => {
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"), x = 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(() => {
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 a = v === "all" ? m : (L = m.filter((U) => U.subUnitId === W)) != null ? L : [], C = f != null ? f : (U) => U, $ = a.map((U) => {
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((a) => !a.resolved),
775
- ...J.filter((a) => a.resolved)
776
- ], [J]), re = ee(() => y === "resolved" ? j.filter((a) => a.resolved) : y === "unsolved" ? j.filter((a) => !a.resolved) : y === "concern_me" && H != null && H.userID ? j.filter((a) => a == null ? void 0 : a.users.has(H.userID)) : j, [j, H == null ? void 0 : H.userID, y]), Q = P ? [P, ...re] : re, ie = Q.filter((a) => !a.resolved), le = Q.filter((a) => a.resolved), oe = y !== "all" || v !== "all", ae = () => {
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: a, subUnitId: C, commentId: $ } = g, L = `${D}-${a}-${C}-${$}`;
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 = (a) => /* @__PURE__ */ s(
795
- Vt,
789
+ const X = (s) => /* @__PURE__ */ a(
790
+ Pt,
796
791
  {
797
792
  full: !0,
798
793
  prefix: D,
799
794
  getSubUnitName: l,
800
- id: a.id,
801
- unitId: a.unitId,
802
- subUnitId: a.subUnitId,
803
- refStr: a.ref,
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) === a.id,
806
- showHighlight: (g == null ? void 0 : g.commentId) === a.id,
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, a.resolved ? _.executeCommand(K.id) : _.executeCommand(
803
+ k.current = !1, s.resolved ? _.executeCommand(K.id) : _.executeCommand(
809
804
  K.id,
810
805
  {
811
- unitId: a.unitId,
812
- subUnitId: a.subUnitId,
813
- commentId: a.id,
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(a),
819
- onMouseLeave: () => h == null ? void 0 : h(a),
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(a.id, C)
817
+ onResolve: (C) => d == null ? void 0 : d(s.id, C)
823
818
  },
824
- a.id
819
+ s.id
825
820
  );
826
- return /* @__PURE__ */ I("div", { className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3", children: [
827
- /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between", children: [
828
- r === ce.UNIVER_SHEET ? /* @__PURE__ */ s(
829
- xe,
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: x.t("threadCommentUI.filter.sheet.current")
831
+ label: I.t("threadCommentUI.filter.sheet.current")
838
832
  },
839
833
  {
840
834
  value: "all",
841
- label: x.t("threadCommentUI.filter.sheet.all")
835
+ label: I.t("threadCommentUI.filter.sheet.all")
842
836
  }
843
- ]
837
+ ],
838
+ onChange: E
844
839
  }
845
840
  ) : null,
846
- /* @__PURE__ */ s(
847
- xe,
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: x.t("threadCommentUI.filter.status.all")
849
+ label: I.t("threadCommentUI.filter.status.all")
856
850
  },
857
851
  {
858
852
  value: "resolved",
859
- label: x.t("threadCommentUI.filter.status.resolved")
853
+ label: I.t("threadCommentUI.filter.status.resolved")
860
854
  },
861
855
  {
862
856
  value: "unsolved",
863
- label: x.t("threadCommentUI.filter.status.unsolved")
857
+ label: I.t("threadCommentUI.filter.status.unsolved")
864
858
  },
865
859
  {
866
860
  value: "concern_me",
867
- label: x.t("threadCommentUI.filter.status.concernMe")
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__ */ I(
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
- x.t("threadCommentUI.panel.empty"),
882
- oe ? /* @__PURE__ */ s("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ s(se, { onClick: ae, children: x.t("threadCommentUI.panel.reset") }) }) : O ? null : /* @__PURE__ */ s("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ I(se, { onClick: i, children: [
883
- /* @__PURE__ */ s(ke, { className: "univer-mr-[6px]" }),
884
- x.t("threadCommentUI.panel.add")
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__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-col univer-gap-3", children: [
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__ */ s("div", { className: "univer-text-xs", children: x.t("threadCommentUI.panel.solved") }),
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
- qt as ThreadCommentPanel,
893
+ Yt as ThreadCommentPanel,
899
894
  q as ThreadCommentPanelService,
900
- Vt as ThreadCommentTree,
901
- xt as ToggleSheetCommentPanelOperation,
895
+ Pt as ThreadCommentTree,
896
+ It as ToggleSheetCommentPanelOperation,
902
897
  ue as UniverThreadCommentUIPlugin
903
898
  };
@@ -1,6 +1,5 @@
1
1
  import { IDocumentBody, IUser, UniverInstanceType } from '@univerjs/core';
2
2
  import { IThreadComment } from '@univerjs/thread-comment';
3
- import { default as React } from 'react';
4
3
  export interface IThreadCommentEditorProps {
5
4
  id?: string;
6
5
  comment?: Pick<IThreadComment, 'attachments' | 'text' | 'mentions'>;
@@ -14,7 +13,7 @@ export interface IThreadCommentEditorProps {
14
13
  export interface IThreadCommentEditorInstance {
15
14
  reply: (text: IDocumentBody) => void;
16
15
  }
17
- export declare const ThreadCommentEditor: React.ForwardRefExoticComponent<IThreadCommentEditorProps & React.RefAttributes<IThreadCommentEditorInstance>>;
16
+ export declare const ThreadCommentEditor: import('react').ForwardRefExoticComponent<IThreadCommentEditorProps & import('react').RefAttributes<IThreadCommentEditorInstance>>;
18
17
  export declare const ThreadCommentSuggestion: ({ active, user }: {
19
18
  active: boolean;
20
19
  user: IUser;