@univerjs/thread-comment-ui 0.16.1 → 0.17.0

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
@@ -1,20 +1,20 @@
1
- var He = Object.defineProperty;
2
- var Ve = (r, e, t) => e in r ? He(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var W = (r, e, t) => Ve(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as ye, IUniverInstanceService as je, Disposable as Pe, UniverInstanceType as de, CommandType as _e, DependentOn as Ae, Injector as Be, ICommandService as te, IConfigService as We, Plugin as Ze, merge as Fe, mergeOverrideWithDependencies as ze, LocaleService as he, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ke, BuildTextUtils as ue, DOCS_COMMENT_EDITOR_UNIT_ID_KEY as Ge, Tools as Ye, CustomRangeType as qe, getBodySlice as Je, UserManagerService as fe, generateRandomId as Qe } from "@univerjs/core";
5
- import { ISidebarService as we, useDependency as N, KeyCode as pe, useObservable as Z, useConfigValue as Xe, UI_PLUGIN_CONFIG_KEY as et } from "@univerjs/ui";
6
- import { BehaviorSubject as Ce, filter as tt, debounceTime as rt } from "rxjs";
7
- import { UniverThreadCommentPlugin as nt, ThreadCommentModel as Ne, getDT as it, AddCommentCommand as ot, ResolveCommentCommand as st, DeleteCommentTreeCommand as Se, UpdateCommentCommand as at, DeleteCommentCommand as lt } from "@univerjs/thread-comment";
1
+ var je = Object.defineProperty;
2
+ var Ve = (n, e, t) => e in n ? je(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var W = (n, e, t) => Ve(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Inject as _e, IUniverInstanceService as Pe, Disposable as Ae, UniverInstanceType as de, CommandType as we, DependentOn as Be, Injector as We, ICommandService as ne, IConfigService as Ze, Plugin as Fe, merge as ze, mergeOverrideWithDependencies as Ke, LocaleService as fe, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ge, BuildTextUtils as ve, DOCS_COMMENT_EDITOR_UNIT_ID_KEY as Ye, Tools as qe, CustomRangeType as Je, getBodySlice as Qe, UserManagerService as pe, generateRandomId as Xe } from "@univerjs/core";
5
+ import { ISidebarService as Ne, useDependency as N, KeyCode as ge, useObservable as Z, useConfigValue as et, UI_PLUGIN_CONFIG_KEY as tt } from "@univerjs/ui";
6
+ import { BehaviorSubject as Ce, filter as nt, debounceTime as rt } from "rxjs";
7
+ import { UniverThreadCommentPlugin as it, ThreadCommentModel as Se, getDT as ot, AddCommentCommand as st, ResolveCommentCommand as at, DeleteCommentTreeCommand as ke, UpdateCommentCommand as lt, DeleteCommentCommand as ct } from "@univerjs/thread-comment";
8
8
  import { jsxs as I, jsx as a } from "react/jsx-runtime";
9
- import { Button as ae, clsx as ve, Tooltip as ct, scrollbarClassName as dt, borderClassName as ut, Dropdown as vt, Select as ge } from "@univerjs/design";
10
- import { useRef as ee, createElement as z, forwardRef as K, useState as P, useEffect as le, useMemo as X, useImperativeHandle as mt } from "react";
11
- import { IEditorService as ht, BreakLineCommand as ft, RichTextEditor as pt } from "@univerjs/docs-ui";
12
- var Ct = Object.getOwnPropertyDescriptor, gt = (r, e, t, n) => {
13
- for (var i = n > 1 ? void 0 : n ? Ct(e, t) : e, o = r.length - 1, c; o >= 0; o--)
14
- (c = r[o]) && (i = c(i) || i);
9
+ import { Button as le, clsx as me, Tooltip as dt, scrollbarClassName as ut, borderClassName as vt, Dropdown as mt, Select as Ie } from "@univerjs/design";
10
+ import { useRef as te, createElement as z, forwardRef as K, useState as P, useEffect as ce, useMemo as ee, useImperativeHandle as ht } from "react";
11
+ import { IEditorService as ft, BreakLineCommand as pt, RichTextEditor as gt } from "@univerjs/docs-ui";
12
+ var Ct = Object.getOwnPropertyDescriptor, It = (n, e, t, r) => {
13
+ for (var i = r > 1 ? void 0 : r ? Ct(e, t) : e, o = n.length - 1, c; o >= 0; o--)
14
+ (c = n[o]) && (i = c(i) || i);
15
15
  return i;
16
- }, Ie = (r, e) => (t, n) => e(t, n, r);
17
- let Y = class extends Pe {
16
+ }, xe = (n, e) => (t, r) => e(t, r, n);
17
+ let Y = class extends Ae {
18
18
  constructor(e, t) {
19
19
  super();
20
20
  W(this, "_panelVisible", !1);
@@ -33,7 +33,7 @@ let Y = class extends Pe {
33
33
  e.visible || this.setPanelVisible(!1);
34
34
  })
35
35
  ), this.disposeWithMe(
36
- this._univerInstanceService.getCurrentTypeOfUnit$(de.UNIVER_SHEET).pipe(tt((e) => !e)).subscribe(() => {
36
+ this._univerInstanceService.getCurrentTypeOfUnit$(de.UNIVER_SHEET).pipe(nt((e) => !e)).subscribe(() => {
37
37
  this._sidebarService.close();
38
38
  })
39
39
  );
@@ -51,109 +51,114 @@ let Y = class extends Pe {
51
51
  this._activeCommentId = e, this._activeCommentId$.next(e);
52
52
  }
53
53
  };
54
- Y = gt([
55
- Ie(0, ye(we)),
56
- Ie(1, je)
54
+ Y = It([
55
+ xe(0, _e(Ne)),
56
+ xe(1, Pe)
57
57
  ], Y);
58
- const It = "thread-comment-panel", xt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt = {
58
+ const xt = "thread-comment-panel", bt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", yt = {
59
59
  id: "thread-comment-ui.operation.toggle-panel",
60
- type: _e.OPERATION,
61
- handler(r) {
62
- const e = r.get(we), t = r.get(Y);
60
+ type: we.OPERATION,
61
+ handler(n) {
62
+ const e = n.get(Ne), t = n.get(Y);
63
63
  return t.panelVisible ? (e.close(), t.setPanelVisible(!1)) : (e.open({
64
64
  header: { title: "threadCommentUI.panel.title" },
65
- children: { label: It },
65
+ children: { label: xt },
66
66
  width: 360
67
67
  }), t.setPanelVisible(!0)), !0;
68
68
  }
69
69
  }, F = {
70
70
  id: "thread-comment-ui.operation.set-active-comment",
71
- type: _e.OPERATION,
72
- handler(r, e) {
73
- return r.get(Y).setActiveComment(e), !0;
71
+ type: we.OPERATION,
72
+ handler(n, e) {
73
+ return n.get(Y).setActiveComment(e), !0;
74
74
  }
75
- }, yt = "thread-comment-ui.config", xe = {};
76
- var _t = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, Nt = (r, e, t) => e in r ? _t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, St = (r, e, t, n) => {
77
- for (var i = n > 1 ? void 0 : n ? wt(e, t) : e, o = r.length - 1, c; o >= 0; o--)
78
- (c = r[o]) && (i = c(i) || i);
75
+ }, _t = "@univerjs/thread-comment-ui", wt = "0.17.0", $e = {
76
+ name: _t,
77
+ version: wt
78
+ }, Nt = "thread-comment-ui.config", be = {};
79
+ var St = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, $t = (n, e, t) => e in n ? St(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Ut = (n, e, t, r) => {
80
+ for (var i = r > 1 ? void 0 : r ? kt(e, t) : e, o = n.length - 1, c; o >= 0; o--)
81
+ (c = n[o]) && (i = c(i) || i);
79
82
  return i;
80
- }, me = (r, e) => (t, n) => e(t, n, r), $e = (r, e, t) => Nt(r, typeof e != "symbol" ? e + "" : e, t);
81
- let ce = class extends Ze {
82
- constructor(r = xe, e, t, n) {
83
- super(), this._config = r, this._injector = e, this._commandService = t, this._configService = n;
84
- const { menu: i, ...o } = Fe(
83
+ }, he = (n, e) => (t, r) => e(t, r, n), ue = (n, e, t) => $t(n, typeof e != "symbol" ? e + "" : e, t);
84
+ let q = class extends Fe {
85
+ constructor(n = be, e, t, r) {
86
+ super(), this._config = n, this._injector = e, this._commandService = t, this._configService = r;
87
+ const { menu: i, ...o } = ze(
85
88
  {},
86
- xe,
89
+ be,
87
90
  this._config
88
91
  );
89
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(yt, o);
92
+ i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Nt, o);
90
93
  }
91
94
  onStarting() {
92
- var r;
93
- ze([
95
+ var n;
96
+ Ke([
94
97
  [Y]
95
- ], (r = this._config) == null ? void 0 : r.overrides).forEach((e) => {
98
+ ], (n = this._config) == null ? void 0 : n.overrides).forEach((e) => {
96
99
  this._injector.add(e);
97
- }), [bt, F].forEach((e) => {
100
+ }), [yt, F].forEach((e) => {
98
101
  this._commandService.registerCommand(e);
99
102
  });
100
103
  }
101
104
  };
102
- $e(ce, "pluginName", xt);
103
- $e(ce, "type", de.UNIVER_UNKNOWN);
104
- ce = St([
105
- Ae(nt),
106
- me(1, ye(Be)),
107
- me(2, te),
108
- me(3, We)
109
- ], ce);
110
- function G({ ref: r, ...e }) {
111
- const { icon: t, id: n, className: i, extend: o, ...c } = e, x = `univerjs-icon univerjs-icon-${n} ${i || ""}`.trim(), h = ee(`_${kt()}`);
112
- return Ue(t, `${n}`, {
105
+ ue(q, "pluginName", bt);
106
+ ue(q, "packageName", $e.name);
107
+ ue(q, "version", $e.version);
108
+ ue(q, "type", de.UNIVER_UNKNOWN);
109
+ q = Ut([
110
+ Be(it),
111
+ he(1, _e(We)),
112
+ he(2, ne),
113
+ he(3, Ze)
114
+ ], q);
115
+ function G({ ref: n, ...e }) {
116
+ const { icon: t, id: r, className: i, extend: o, ...c } = e, x = `univerjs-icon univerjs-icon-${r} ${i || ""}`.trim(), h = te(`_${Et()}`);
117
+ return Ue(t, `${r}`, {
113
118
  defIds: t.defIds,
114
119
  idSuffix: h.current
115
120
  }, {
116
- ref: r,
121
+ ref: n,
117
122
  className: x,
118
123
  ...c
119
124
  }, o);
120
125
  }
121
- function Ue(r, e, t, n, i) {
122
- return z(r.tag, {
126
+ function Ue(n, e, t, r, i) {
127
+ return z(n.tag, {
123
128
  key: e,
124
- ...$t(r, t, i),
125
- ...n
126
- }, (Ut(r, t).children || []).map((o, c) => Ue(o, `${e}-${r.tag}-${c}`, t, void 0, i)));
129
+ ...Tt(n, t, i),
130
+ ...r
131
+ }, (Dt(n, t).children || []).map((o, c) => Ue(o, `${e}-${n.tag}-${c}`, t, void 0, i)));
127
132
  }
128
- function $t(r, e, t) {
129
- const n = { ...r.attrs };
130
- t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1), r.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(([o, c]) => {
131
- o === "mask" && typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
133
+ function Tt(n, e, t) {
134
+ const r = { ...n.attrs };
135
+ t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1), n.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(([o, c]) => {
136
+ o === "mask" && typeof c == "string" && (r[o] = c.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
132
137
  });
133
138
  const { defIds: i } = e;
134
- return !i || i.length === 0 || (r.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(([o, c]) => {
135
- typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
136
- })), n;
139
+ return !i || i.length === 0 || (n.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(([o, c]) => {
140
+ typeof c == "string" && (r[o] = c.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
141
+ })), r;
137
142
  }
138
- function Ut(r, e) {
139
- var n;
143
+ function Dt(n, e) {
144
+ var r;
140
145
  const { defIds: t } = e;
141
- return !t || t.length === 0 ? r : r.tag === "defs" && ((n = r.children) != null && n.length) ? {
142
- ...r,
143
- children: r.children.map((i) => typeof i.attrs.id == "string" && t && t.includes(i.attrs.id) ? {
146
+ return !t || t.length === 0 ? n : n.tag === "defs" && ((r = n.children) != null && r.length) ? {
147
+ ...n,
148
+ children: n.children.map((i) => typeof i.attrs.id == "string" && t && t.includes(i.attrs.id) ? {
144
149
  ...i,
145
150
  attrs: {
146
151
  ...i.attrs,
147
152
  id: i.attrs.id + e.idSuffix
148
153
  }
149
154
  } : i)
150
- } : r;
155
+ } : n;
151
156
  }
152
- function kt() {
157
+ function Et() {
153
158
  return Math.random().toString(36).substring(2, 8);
154
159
  }
155
160
  G.displayName = "UniverIcon";
156
- const Tt = {
161
+ const Mt = {
157
162
  tag: "svg",
158
163
  attrs: {
159
164
  xmlns: "http://www.w3.org/2000/svg",
@@ -194,15 +199,15 @@ const Tt = {
194
199
  }
195
200
  }
196
201
  ]
197
- }, ke = K(function(e, t) {
202
+ }, Te = K(function(e, t) {
198
203
  return z(G, Object.assign({}, e, {
199
204
  id: "delete-icon",
200
205
  ref: t,
201
- icon: Tt
206
+ icon: Mt
202
207
  }));
203
208
  });
204
- ke.displayName = "DeleteIcon";
205
- const Dt = {
209
+ Te.displayName = "DeleteIcon";
210
+ const Ot = {
206
211
  tag: "svg",
207
212
  attrs: {
208
213
  xmlns: "http://www.w3.org/2000/svg",
@@ -218,15 +223,15 @@ const Dt = {
218
223
  d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"
219
224
  }
220
225
  }]
221
- }, Te = K(function(e, t) {
226
+ }, De = K(function(e, t) {
222
227
  return z(G, Object.assign({}, e, {
223
228
  id: "increase-icon",
224
229
  ref: t,
225
- icon: Dt
230
+ icon: Ot
226
231
  }));
227
232
  });
228
- Te.displayName = "IncreaseIcon";
229
- const Et = {
233
+ De.displayName = "IncreaseIcon";
234
+ const Rt = {
230
235
  tag: "svg",
231
236
  attrs: {
232
237
  xmlns: "http://www.w3.org/2000/svg",
@@ -258,15 +263,15 @@ const Et = {
258
263
  }
259
264
  }
260
265
  ]
261
- }, De = K(function(e, t) {
266
+ }, Ee = K(function(e, t) {
262
267
  return z(G, Object.assign({}, e, {
263
268
  id: "more-horizontal-icon",
264
269
  ref: t,
265
- icon: Et
270
+ icon: Rt
266
271
  }));
267
272
  });
268
- De.displayName = "MoreHorizontalIcon";
269
- const Mt = {
273
+ Ee.displayName = "MoreHorizontalIcon";
274
+ const Lt = {
270
275
  tag: "svg",
271
276
  attrs: {
272
277
  xmlns: "http://www.w3.org/2000/svg",
@@ -324,15 +329,15 @@ const Mt = {
324
329
  }
325
330
  }
326
331
  ]
327
- }, Ee = K(function(e, t) {
332
+ }, Me = K(function(e, t) {
328
333
  return z(G, Object.assign({}, e, {
329
334
  id: "reply-to-comment-icon",
330
335
  ref: t,
331
- icon: Mt
336
+ icon: Lt
332
337
  }));
333
338
  });
334
- Ee.displayName = "ReplyToCommentIcon";
335
- const Ot = {
339
+ Me.displayName = "ReplyToCommentIcon";
340
+ const Ht = {
336
341
  tag: "svg",
337
342
  attrs: {
338
343
  xmlns: "http://www.w3.org/2000/svg",
@@ -350,15 +355,15 @@ const Ot = {
350
355
  clipRule: "evenodd"
351
356
  }
352
357
  }]
353
- }, Me = K(function(e, t) {
358
+ }, Oe = K(function(e, t) {
354
359
  return z(G, Object.assign({}, e, {
355
360
  id: "resolved-icon",
356
361
  ref: t,
357
- icon: Ot
362
+ icon: Ht
358
363
  }));
359
364
  });
360
- Me.displayName = "ResolvedIcon";
361
- const Rt = {
365
+ Oe.displayName = "ResolvedIcon";
366
+ const jt = {
362
367
  tag: "svg",
363
368
  attrs: {
364
369
  xmlns: "http://www.w3.org/2000/svg",
@@ -386,51 +391,51 @@ const Rt = {
386
391
  strokeWidth: 1.2
387
392
  }
388
393
  }]
389
- }, Oe = K(function(e, t) {
394
+ }, Re = K(function(e, t) {
390
395
  return z(G, Object.assign({}, e, {
391
396
  id: "solve-icon",
392
397
  ref: t,
393
- icon: Rt
398
+ icon: jt
394
399
  }));
395
400
  });
396
- Oe.displayName = "SolveIcon";
397
- function be(r) {
401
+ Re.displayName = "SolveIcon";
402
+ function ye(n) {
398
403
  return {
399
404
  id: "d",
400
- body: r,
405
+ body: n,
401
406
  documentStyle: {}
402
407
  };
403
408
  }
404
- const Re = K((r, e) => {
409
+ const Le = K((n, e) => {
405
410
  var O;
406
- const { comment: t, onSave: n, id: i, onCancel: o, autoFocus: c, unitId: x, type: h } = r, S = N(te), U = N(he), [V, k] = P(!1), b = N(ht), u = ee(null), v = h === de.UNIVER_DOC ? Ke : x, [T, y] = P(() => {
411
+ const { comment: t, onSave: r, id: i, onCancel: o, autoFocus: c, unitId: x, type: h } = n, S = N(ne), $ = N(fe), [j, U] = P(!1), b = N(ft), u = te(null), v = h === de.UNIVER_DOC ? Ge : x, [T, y] = P(() => {
407
412
  var d, m, f;
408
- return ue.transform.getPlainText((f = (m = (d = u.current) == null ? void 0 : d.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? f : "");
413
+ return ve.transform.getPlainText((f = (m = (d = u.current) == null ? void 0 : d.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? f : "");
409
414
  });
410
- le(() => {
415
+ ce(() => {
411
416
  var m, f, _, p;
412
- y(ue.transform.getPlainText((_ = (f = (m = u.current) == null ? void 0 : m.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? _ : ""));
417
+ y(ve.transform.getPlainText((_ = (f = (m = u.current) == null ? void 0 : m.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? _ : ""));
413
418
  const d = (p = u.current) == null ? void 0 : p.selectionChange$.subscribe(() => {
414
419
  var s, w, A;
415
- y(ue.transform.getPlainText((A = (w = (s = u.current) == null ? void 0 : s.getDocumentData().body) == null ? void 0 : w.dataStream) != null ? A : ""));
420
+ y(ve.transform.getPlainText((A = (w = (s = u.current) == null ? void 0 : s.getDocumentData().body) == null ? void 0 : w.dataStream) != null ? A : ""));
416
421
  });
417
422
  return () => d == null ? void 0 : d.unsubscribe();
418
423
  }, [(O = u.current) == null ? void 0 : O.selectionChange$]);
419
- const j = X(() => ({
420
- keyCodes: [{ keyCode: pe.ENTER }],
424
+ const V = ee(() => ({
425
+ keyCodes: [{ keyCode: ge.ENTER }],
421
426
  handler: (d) => {
422
- d === pe.ENTER && S.executeCommand(
423
- ft.id
427
+ d === ge.ENTER && S.executeCommand(
428
+ pt.id
424
429
  );
425
430
  }
426
431
  }), [S]);
427
- mt(e, () => ({
432
+ ht(e, () => ({
428
433
  reply(d) {
429
434
  var f, _;
430
435
  if (!u.current)
431
436
  return;
432
437
  b.focus((f = u.current.getEditorId()) != null ? f : "");
433
- const m = be(d);
438
+ const m = ye(d);
434
439
  (_ = u.current) == null || _.setDocumentData(m, [{
435
440
  startOffset: m.body.dataStream.length - 2,
436
441
  endOffset: m.body.dataStream.length - 2,
@@ -438,10 +443,10 @@ const Re = K((r, e) => {
438
443
  }]);
439
444
  }
440
445
  }));
441
- const C = () => {
446
+ const g = () => {
442
447
  if (u.current) {
443
- const d = Ye.deepClone(u.current.getDocumentData().body);
444
- k(!1), n == null || n({
448
+ const d = qe.deepClone(u.current.getDocumentData().body);
449
+ U(!1), r == null || r({
445
450
  ...t,
446
451
  text: d
447
452
  }), u.current.replaceText(""), setTimeout(() => {
@@ -452,16 +457,16 @@ const Re = K((r, e) => {
452
457
  };
453
458
  return /* @__PURE__ */ I("div", { onClick: (d) => d.preventDefault(), children: [
454
459
  /* @__PURE__ */ a(
455
- pt,
460
+ gt,
456
461
  {
457
462
  className: "univer-w-full",
458
463
  editorRef: u,
459
- editorId: Ge,
464
+ editorId: Ye,
460
465
  autoFocus: c,
461
- keyboardEventConfig: j,
462
- placeholder: U.t("threadCommentUI.editor.placeholder"),
463
- initialValue: (t == null ? void 0 : t.text) && be(t.text),
464
- onFocusChange: (d) => d && k(d),
466
+ keyboardEventConfig: V,
467
+ placeholder: $.t("threadCommentUI.editor.placeholder"),
468
+ initialValue: (t == null ? void 0 : t.text) && ye(t.text),
469
+ onFocusChange: (d) => d && U(d),
465
470
  isSingle: !1,
466
471
  maxHeight: 64,
467
472
  onClickOutside: () => {
@@ -471,30 +476,30 @@ const Re = K((r, e) => {
471
476
  }
472
477
  }
473
478
  ),
474
- V ? /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
479
+ j ? /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
475
480
  /* @__PURE__ */ a(
476
- ae,
481
+ le,
477
482
  {
478
483
  onClick: () => {
479
484
  var d;
480
- o == null || o(), k(!1), (d = u.current) == null || d.replaceText("", !0), S.executeCommand(F.id);
485
+ o == null || o(), U(!1), (d = u.current) == null || d.replaceText("", !0), S.executeCommand(F.id);
481
486
  },
482
- children: U.t("threadCommentUI.editor.cancel")
487
+ children: $.t("threadCommentUI.editor.cancel")
483
488
  }
484
489
  ),
485
490
  /* @__PURE__ */ a(
486
- ae,
491
+ le,
487
492
  {
488
493
  variant: "primary",
489
494
  disabled: !T,
490
- onClick: C,
491
- children: U.t(i ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
495
+ onClick: g,
496
+ children: $.t(i ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
492
497
  }
493
498
  )
494
499
  ] }) : null
495
500
  ] });
496
- }), Lt = (r) => {
497
- const { dataStream: e, customRanges: t } = r, n = e.endsWith(`\r
501
+ }), Vt = (n) => {
502
+ const { dataStream: e, customRanges: t } = n, r = e.endsWith(`\r
498
503
  `) ? e.length - 2 : e.length, i = [];
499
504
  let o = 0;
500
505
  return t == null || t.forEach((c) => {
@@ -510,31 +515,31 @@ const Re = K((r, e) => {
510
515
  }), o = c.endIndex + 1;
511
516
  }), i.push({
512
517
  type: "text",
513
- content: e.slice(o, n)
518
+ content: e.slice(o, r)
514
519
  }), i;
515
- }, Ht = (r) => {
516
- if (!r)
520
+ }, Pt = (n) => {
521
+ if (!n)
517
522
  return [];
518
- const { paragraphs: e = [] } = r;
519
- return e.map((t, n) => {
520
- const i = n === 0 ? 0 : e[n - 1].startIndex + 1, o = Je(r, i, t.startIndex);
521
- return Lt(o);
523
+ const { paragraphs: e = [] } = n;
524
+ return e.map((t, r) => {
525
+ const i = r === 0 ? 0 : e[r - 1].startIndex + 1, o = Qe(n, i, t.startIndex);
526
+ return Vt(o);
522
527
  });
523
- }, Vt = (r) => {
528
+ }, At = (n) => {
524
529
  let e = "";
525
530
  const t = [];
526
- return r.forEach((n) => {
527
- switch (n.type) {
531
+ return n.forEach((r) => {
532
+ switch (r.type) {
528
533
  case "text":
529
- e += n.content;
534
+ e += r.content;
530
535
  break;
531
536
  case "mention": {
532
537
  const i = e.length;
533
- e += n.content.label;
538
+ e += r.content.label;
534
539
  const o = e.length - 1;
535
540
  t.push({
536
- rangeId: n.content.id,
537
- rangeType: qe.MENTION,
541
+ rangeId: r.content.id,
542
+ rangeType: Je.MENTION,
538
543
  startIndex: i,
539
544
  endIndex: o,
540
545
  properties: {},
@@ -560,13 +565,13 @@ const Re = K((r, e) => {
560
565
  dataStream: e,
561
566
  customRanges: t
562
567
  };
563
- }, Le = "__mock__", jt = (r) => {
564
- const { item: e, unitId: t, subUnitId: n, editing: i, onEditingChange: o, onReply: c, resolved: x, isRoot: h, onClose: S, onDeleteComment: U, type: V } = r, k = N(te), b = N(he), u = N(fe), v = u.getUser(e.personId), T = Z(u.currentUser$), y = (T == null ? void 0 : T.userID) === e.personId, j = e.id === Le, [C, O] = P(!1), d = Xe(et), m = d == null ? void 0 : d.avatarFallback, f = () => {
565
- (U == null ? void 0 : U(e)) !== !1 && (k.executeCommand(
566
- h ? Se.id : lt.id,
568
+ }, He = "__mock__", Bt = (n) => {
569
+ const { item: e, unitId: t, subUnitId: r, editing: i, onEditingChange: o, onReply: c, resolved: x, isRoot: h, onClose: S, onDeleteComment: $, type: j } = n, U = N(ne), b = N(fe), u = N(pe), v = u.getUser(e.personId), T = Z(u.currentUser$), y = (T == null ? void 0 : T.userID) === e.personId, V = e.id === He, [g, O] = P(!1), d = et(tt), m = d == null ? void 0 : d.avatarFallback, f = () => {
570
+ ($ == null ? void 0 : $(e)) !== !1 && (U.executeCommand(
571
+ h ? ke.id : ct.id,
567
572
  {
568
573
  unitId: t,
569
- subUnitId: n,
574
+ subUnitId: r,
570
575
  commentId: e.id
571
576
  }
572
577
  ), h && (S == null || S()));
@@ -584,16 +589,16 @@ const Re = K((r, e) => {
584
589
  v ? /* @__PURE__ */ I("div", { className: "univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between", children: [
585
590
  /* @__PURE__ */ a("div", { className: "univer-text-sm univer-font-medium univer-leading-5", children: (v == null ? void 0 : v.name) || " " }),
586
591
  /* @__PURE__ */ I("div", { children: [
587
- j || x ? null : C && v ? /* @__PURE__ */ a(
592
+ V || x ? null : g && v ? /* @__PURE__ */ a(
588
593
  "div",
589
594
  {
590
595
  className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
591
596
  onClick: () => c(v),
592
- children: /* @__PURE__ */ a(Ee, {})
597
+ children: /* @__PURE__ */ a(Me, {})
593
598
  }
594
599
  ) : null,
595
- y && !j && !x ? /* @__PURE__ */ a(
596
- vt,
600
+ y && !V && !x ? /* @__PURE__ */ a(
601
+ mt,
597
602
  {
598
603
  overlay: /* @__PURE__ */ a("div", { className: "univer-rounded-lg", children: /* @__PURE__ */ I(
599
604
  "ul",
@@ -623,7 +628,7 @@ const Re = K((r, e) => {
623
628
  "div",
624
629
  {
625
630
  className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
626
- children: /* @__PURE__ */ a(De, {})
631
+ children: /* @__PURE__ */ a(Ee, {})
627
632
  }
628
633
  )
629
634
  }
@@ -638,21 +643,21 @@ const Re = K((r, e) => {
638
643
  }
639
644
  ),
640
645
  i ? /* @__PURE__ */ a(
641
- Re,
646
+ Le,
642
647
  {
643
- type: V,
648
+ type: j,
644
649
  id: e.id,
645
650
  comment: e,
646
651
  onCancel: () => o == null ? void 0 : o(!1),
647
652
  autoFocus: !0,
648
653
  unitId: t,
649
- subUnitId: n,
654
+ subUnitId: r,
650
655
  onSave: ({ text: _, attachments: p }) => {
651
- o == null || o(!1), k.executeCommand(
652
- at.id,
656
+ o == null || o(!1), U.executeCommand(
657
+ lt.id,
653
658
  {
654
659
  unitId: t,
655
- subUnitId: n,
660
+ subUnitId: r,
656
661
  payload: {
657
662
  commentId: e.id,
658
663
  text: _,
@@ -666,91 +671,91 @@ const Re = K((r, e) => {
666
671
  "div",
667
672
  {
668
673
  className: "univer-text-sm univer-text-gray-900 dark:!univer-text-white",
669
- children: Ht(e.text).map((_, p) => /* @__PURE__ */ a("div", { className: "univer-break-words", children: _.map((s, w) => s.type === "mention" ? /* @__PURE__ */ I("a", { className: "univer-text-primary-600", children: [
674
+ children: Pt(e.text).map((_, p) => /* @__PURE__ */ a("div", { className: "univer-break-words", children: _.map((s, w) => s.type === "mention" ? /* @__PURE__ */ I("a", { className: "univer-text-primary-600", children: [
670
675
  s.content.label,
671
676
  " "
672
677
  ] }, w) : s.content) }, p))
673
678
  }
674
679
  )
675
680
  ] });
676
- }, Pt = (r) => {
677
- var se, Q, l;
681
+ }, Wt = (n) => {
682
+ var ae, X, l;
678
683
  const {
679
684
  id: e,
680
685
  unitId: t,
681
- subUnitId: n,
686
+ subUnitId: r,
682
687
  refStr: i,
683
688
  showEdit: o = !0,
684
689
  onClick: c,
685
690
  showHighlight: x,
686
691
  onClose: h,
687
692
  getSubUnitName: S,
688
- prefix: U,
689
- autoFocus: V,
690
- onMouseEnter: k,
693
+ prefix: $,
694
+ autoFocus: j,
695
+ onMouseEnter: U,
691
696
  onMouseLeave: b,
692
697
  onAddComment: u,
693
698
  onDeleteComment: v,
694
699
  onResolve: T,
695
700
  type: y,
696
- style: j,
697
- full: C
698
- } = r, O = N(Ne), [d, m] = P(!1), [f, _] = P(""), p = X(() => O.commentUpdate$.pipe(rt(16)), [O]);
701
+ style: V,
702
+ full: g
703
+ } = n, O = N(Se), [d, m] = P(!1), [f, _] = P(""), p = ee(() => O.commentUpdate$.pipe(rt(16)), [O]);
699
704
  Z(p);
700
- const s = e ? O.getCommentWithChildren(t, n, e) : null, w = N(te), A = N(fe), D = s == null ? void 0 : s.root.resolved, E = Z(A.currentUser$), L = ee(null), q = [
705
+ const s = e ? O.getCommentWithChildren(t, r, e) : null, w = N(ne), A = N(pe), D = s == null ? void 0 : s.root.resolved, E = Z(A.currentUser$), L = te(null), J = [
701
706
  ...s ? [s.root] : (
702
707
  // mock empty comment
703
708
  [{
704
- id: Le,
709
+ id: He,
705
710
  text: {
706
711
  dataStream: `
707
712
  \r`
708
713
  },
709
- personId: (se = E == null ? void 0 : E.userID) != null ? se : "",
714
+ personId: (ae = E == null ? void 0 : E.userID) != null ? ae : "",
710
715
  ref: i != null ? i : "",
711
716
  dT: "",
712
717
  unitId: t,
713
- subUnitId: n,
718
+ subUnitId: r,
714
719
  threadId: ""
715
720
  }]
716
721
  ),
717
- ...(Q = s == null ? void 0 : s.children) != null ? Q : []
718
- ], R = ee(null), re = (g) => {
719
- g.stopPropagation(), D ? w.executeCommand(F.id, {
722
+ ...(X = s == null ? void 0 : s.children) != null ? X : []
723
+ ], R = te(null), re = (C) => {
724
+ C.stopPropagation(), D ? w.executeCommand(F.id, {
720
725
  unitId: t,
721
- subUnitId: n,
726
+ subUnitId: r,
722
727
  commentId: e
723
- }) : w.executeCommand(F.id), w.executeCommand(st.id, {
728
+ }) : w.executeCommand(F.id), w.executeCommand(at.id, {
724
729
  unitId: t,
725
- subUnitId: n,
730
+ subUnitId: r,
726
731
  commentId: e,
727
732
  resolved: !D
728
733
  }), T == null || T(!D);
729
- }, J = (g) => {
730
- g.stopPropagation(), w.executeCommand(F.id), !(s != null && s.root && (v == null ? void 0 : v(s.root)) === !1) && (w.executeCommand(
731
- Se.id,
734
+ }, Q = (C) => {
735
+ C.stopPropagation(), w.executeCommand(F.id), !(s != null && s.root && (v == null ? void 0 : v(s.root)) === !1) && (w.executeCommand(
736
+ ke.id,
732
737
  {
733
738
  unitId: t,
734
- subUnitId: n,
739
+ subUnitId: r,
735
740
  commentId: e
736
741
  }
737
742
  ), h == null || h());
738
743
  };
739
- le(() => b == null ? void 0 : b(), []);
740
- const ne = S((l = s == null ? void 0 : s.root.subUnitId) != null ? l : n), ie = o && !f && !D, oe = `${i || (s == null ? void 0 : s.root.ref) || ""}${ne ? " · " : ""}${ne}`;
744
+ ce(() => b == null ? void 0 : b(), []);
745
+ const ie = S((l = s == null ? void 0 : s.root.subUnitId) != null ? l : r), oe = o && !f && !D, se = `${i || (s == null ? void 0 : s.root.ref) || ""}${ie ? " · " : ""}${ie}`;
741
746
  return /* @__PURE__ */ I(
742
747
  "div",
743
748
  {
744
- id: `${U}-${t}-${n}-${e}`,
745
- className: ve("univer-relative univer-box-border univer-rounded-md univer-bg-white univer-p-4 dark:!univer-bg-gray-900 dark:!univer-text-white", ut, {
746
- "univer-w-[278px]": !C,
747
- "univer-w-full": C,
748
- "univer-shadow": !D && (x || d || U === "cell")
749
+ id: `${$}-${t}-${r}-${e}`,
750
+ className: me("univer-relative univer-box-border univer-rounded-md univer-bg-white univer-p-4 dark:!univer-bg-gray-900 dark:!univer-text-white", vt, {
751
+ "univer-w-[278px]": !g,
752
+ "univer-w-full": g,
753
+ "univer-shadow": !D && (x || d || $ === "cell")
749
754
  }),
750
- style: j,
755
+ style: V,
751
756
  onClick: c,
752
757
  onMouseEnter: () => {
753
- k == null || k(), m(!0);
758
+ U == null || U(), m(!0);
754
759
  },
755
760
  onMouseLeave: () => {
756
761
  b == null || b(), m(!1);
@@ -774,11 +779,11 @@ const Re = K((r, e) => {
774
779
  className: "univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0 univer-rounded-sm univer-bg-yellow-500"
775
780
  }
776
781
  ),
777
- /* @__PURE__ */ a(ct, { showIfEllipsis: !0, title: oe, children: /* @__PURE__ */ a(
782
+ /* @__PURE__ */ a(dt, { showIfEllipsis: !0, title: se, children: /* @__PURE__ */ a(
778
783
  "span",
779
784
  {
780
785
  className: "univer-flex-1 univer-truncate",
781
- children: oe
786
+ children: se
782
787
  }
783
788
  ) })
784
789
  ] }),
@@ -786,19 +791,19 @@ const Re = K((r, e) => {
786
791
  /* @__PURE__ */ a(
787
792
  "div",
788
793
  {
789
- className: ve("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800", {
794
+ className: me("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800", {
790
795
  "univer-text-green-500": D
791
796
  }),
792
797
  onClick: re,
793
- children: D ? /* @__PURE__ */ a(Me, {}) : /* @__PURE__ */ a(Oe, {})
798
+ children: D ? /* @__PURE__ */ a(Oe, {}) : /* @__PURE__ */ a(Re, {})
794
799
  }
795
800
  ),
796
801
  (E == null ? void 0 : E.userID) === s.root.personId ? /* @__PURE__ */ a(
797
802
  "div",
798
803
  {
799
804
  className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",
800
- onClick: J,
801
- children: /* @__PURE__ */ a(ke, {})
805
+ onClick: Q,
806
+ children: /* @__PURE__ */ a(Te, {})
802
807
  }
803
808
  ) : null
804
809
  ] })
@@ -809,26 +814,26 @@ const Re = K((r, e) => {
809
814
  "div",
810
815
  {
811
816
  ref: R,
812
- className: ve("univer-max-h-80 univer-overflow-y-auto univer-overflow-x-hidden", dt),
813
- children: q.map(
814
- (g) => /* @__PURE__ */ a(
815
- jt,
817
+ className: me("univer-max-h-80 univer-overflow-y-auto univer-overflow-x-hidden", ut),
818
+ children: J.map(
819
+ (C) => /* @__PURE__ */ a(
820
+ Bt,
816
821
  {
817
822
  unitId: t,
818
- subUnitId: n,
819
- item: g,
820
- isRoot: g.id === (s == null ? void 0 : s.root.id),
821
- editing: f === g.id,
823
+ subUnitId: r,
824
+ item: C,
825
+ isRoot: C.id === (s == null ? void 0 : s.root.id),
826
+ editing: f === C.id,
822
827
  resolved: s == null ? void 0 : s.root.resolved,
823
828
  type: y,
824
829
  onClose: h,
825
830
  onEditingChange: (M) => {
826
- _(M ? g.id : "");
831
+ _(M ? C.id : "");
827
832
  },
828
833
  onReply: (M) => {
829
834
  M && requestAnimationFrame(() => {
830
835
  var H;
831
- (H = L.current) == null || H.reply(Vt([
836
+ (H = L.current) == null || H.reply(At([
832
837
  {
833
838
  type: "mention",
834
839
  content: {
@@ -846,102 +851,102 @@ const Re = K((r, e) => {
846
851
  onAddComment: u,
847
852
  onDeleteComment: v
848
853
  },
849
- g.id
854
+ C.id
850
855
  )
851
856
  )
852
857
  }
853
858
  ),
854
- ie && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
855
- Re,
859
+ oe && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
860
+ Le,
856
861
  {
857
862
  ref: L,
858
863
  type: y,
859
864
  unitId: t,
860
- subUnitId: n,
861
- onSave: async ({ text: g, attachments: M }) => {
865
+ subUnitId: r,
866
+ onSave: async ({ text: C, attachments: M }) => {
862
867
  const H = {
863
- text: g,
868
+ text: C,
864
869
  attachments: M,
865
- dT: it(),
866
- id: Qe(),
870
+ dT: ot(),
871
+ id: Xe(),
867
872
  ref: i,
868
873
  personId: E == null ? void 0 : E.userID,
869
874
  parentId: s == null ? void 0 : s.root.id,
870
875
  unitId: t,
871
- subUnitId: n,
876
+ subUnitId: r,
872
877
  threadId: s == null ? void 0 : s.root.threadId
873
878
  };
874
879
  (u == null ? void 0 : u(H)) !== !1 && (await w.executeCommand(
875
- ot.id,
880
+ st.id,
876
881
  {
877
882
  unitId: t,
878
- subUnitId: n,
883
+ subUnitId: r,
879
884
  comment: H
880
885
  }
881
886
  ), R.current && (R.current.scrollTop = R.current.scrollHeight));
882
887
  },
883
- autoFocus: V || !s,
888
+ autoFocus: j || !s,
884
889
  onCancel: () => {
885
890
  s || h == null || h();
886
891
  }
887
892
  },
888
- `${V}`
893
+ `${j}`
889
894
  ) })
890
895
  ]
891
896
  }
892
897
  );
893
- }, qt = (r) => {
898
+ }, Xt = (n) => {
894
899
  const {
895
900
  unitId: e,
896
901
  subUnitId$: t,
897
- type: n,
902
+ type: r,
898
903
  onAdd: i,
899
904
  getSubUnitName: o,
900
905
  onResolve: c,
901
906
  sortComments: x,
902
907
  onItemLeave: h,
903
908
  onItemEnter: S,
904
- disableAdd: U,
905
- tempComment: V,
906
- onAddComment: k,
909
+ disableAdd: $,
910
+ tempComment: j,
911
+ onAddComment: U,
907
912
  onDeleteComment: b,
908
913
  showComments: u
909
- } = r, [v, T] = P("all"), [y, j] = P("all"), C = N(he), O = N(fe), d = N(Ne), [m, f] = P(() => d.getUnit(e)), _ = N(Y), p = Z(_.activeCommentId$), s = Z(d.commentUpdate$), w = N(te), A = Z(t), D = ee(!0), E = "panel", L = Z(O.currentUser$), q = X(() => {
914
+ } = n, [v, T] = P("all"), [y, V] = P("all"), g = N(fe), O = N(pe), d = N(Se), [m, f] = P(() => d.getUnit(e)), _ = N(Y), p = Z(_.activeCommentId$), s = Z(d.commentUpdate$), w = N(ne), A = Z(t), D = te(!0), E = "panel", L = Z(O.currentUser$), J = ee(() => {
910
915
  var H;
911
- const l = v === "all" ? m : (H = m.filter(($) => $.subUnitId === A)) != null ? H : [], g = x != null ? x : (($) => $), M = l.map(($) => {
916
+ const l = v === "all" ? m : (H = m.filter((k) => k.subUnitId === A)) != null ? H : [], C = x != null ? x : ((k) => k), M = l.map((k) => {
912
917
  var B;
913
- return { ...$.root, children: (B = $.children) != null ? B : [], users: $.relativeUsers };
918
+ return { ...k.root, children: (B = k.children) != null ? B : [], users: k.relativeUsers };
914
919
  });
915
920
  if (u) {
916
- const $ = /* @__PURE__ */ new Map();
921
+ const k = /* @__PURE__ */ new Map();
917
922
  return M.forEach((B) => {
918
- $.set(B.id, B);
919
- }), [...u, ""].map((B) => $.get(B)).filter(Boolean);
923
+ k.set(B.id, B);
924
+ }), [...u, ""].map((B) => k.get(B)).filter(Boolean);
920
925
  } else
921
- return g(M);
922
- }, [u, v, m, x, A]), R = X(() => [
923
- ...q.filter((l) => !l.resolved),
924
- ...q.filter((l) => l.resolved)
925
- ], [q]), re = X(() => y === "resolved" ? R.filter((l) => l.resolved) : y === "unsolved" ? R.filter((l) => !l.resolved) : y === "concern_me" && L != null && L.userID ? R.filter((l) => l == null ? void 0 : l.users.has(L.userID)) : R, [R, L == null ? void 0 : L.userID, y]), J = V ? [V, ...re] : re, ne = J.filter((l) => !l.resolved), ie = J.filter((l) => l.resolved), oe = y !== "all" || v !== "all", se = () => {
926
- j("all"), T("all");
926
+ return C(M);
927
+ }, [u, v, m, x, A]), R = ee(() => [
928
+ ...J.filter((l) => !l.resolved),
929
+ ...J.filter((l) => l.resolved)
930
+ ], [J]), re = ee(() => y === "resolved" ? R.filter((l) => l.resolved) : y === "unsolved" ? R.filter((l) => !l.resolved) : y === "concern_me" && L != null && L.userID ? R.filter((l) => l == null ? void 0 : l.users.has(L.userID)) : R, [R, L == null ? void 0 : L.userID, y]), Q = j ? [j, ...re] : re, ie = Q.filter((l) => !l.resolved), oe = Q.filter((l) => l.resolved), se = y !== "all" || v !== "all", ae = () => {
931
+ V("all"), T("all");
927
932
  };
928
- le(() => {
933
+ ce(() => {
929
934
  e && f(
930
935
  d.getUnit(e)
931
936
  );
932
- }, [e, d, s]), le(() => {
933
- var $;
937
+ }, [e, d, s]), ce(() => {
938
+ var k;
934
939
  if (!p)
935
940
  return;
936
941
  if (!D.current) {
937
942
  D.current = !0;
938
943
  return;
939
944
  }
940
- const { unitId: l, subUnitId: g, commentId: M } = p, H = `${E}-${l}-${g}-${M}`;
941
- ($ = document.getElementById(H)) == null || $.scrollIntoView({ block: "center" });
945
+ const { unitId: l, subUnitId: C, commentId: M } = p, H = `${E}-${l}-${C}-${M}`;
946
+ (k = document.getElementById(H)) == null || k.scrollIntoView({ block: "center" });
942
947
  }, [p]);
943
- const Q = (l) => /* @__PURE__ */ a(
944
- Pt,
948
+ const X = (l) => /* @__PURE__ */ a(
949
+ Wt,
945
950
  {
946
951
  prefix: E,
947
952
  getSubUnitName: o,
@@ -949,7 +954,7 @@ const Re = K((r, e) => {
949
954
  unitId: l.unitId,
950
955
  subUnitId: l.subUnitId,
951
956
  refStr: l.ref,
952
- type: n,
957
+ type: r,
953
958
  showEdit: (p == null ? void 0 : p.commentId) === l.id,
954
959
  showHighlight: (p == null ? void 0 : p.commentId) === l.id,
955
960
  onClick: () => {
@@ -965,84 +970,84 @@ const Re = K((r, e) => {
965
970
  },
966
971
  onMouseEnter: () => S == null ? void 0 : S(l),
967
972
  onMouseLeave: () => h == null ? void 0 : h(l),
968
- onAddComment: k,
973
+ onAddComment: U,
969
974
  onDeleteComment: b,
970
- onResolve: (g) => c == null ? void 0 : c(l.id, g)
975
+ onResolve: (C) => c == null ? void 0 : c(l.id, C)
971
976
  },
972
977
  l.id
973
978
  );
974
979
  return /* @__PURE__ */ I("div", { className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3", children: [
975
980
  /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between", children: [
976
- n === de.UNIVER_SHEET ? /* @__PURE__ */ a(
977
- ge,
981
+ r === de.UNIVER_SHEET ? /* @__PURE__ */ a(
982
+ Ie,
978
983
  {
979
984
  borderless: !0,
980
985
  value: v,
981
986
  options: [
982
987
  {
983
988
  value: "current",
984
- label: C.t("threadCommentUI.filter.sheet.current")
989
+ label: g.t("threadCommentUI.filter.sheet.current")
985
990
  },
986
991
  {
987
992
  value: "all",
988
- label: C.t("threadCommentUI.filter.sheet.all")
993
+ label: g.t("threadCommentUI.filter.sheet.all")
989
994
  }
990
995
  ],
991
996
  onChange: T
992
997
  }
993
998
  ) : null,
994
999
  /* @__PURE__ */ a(
995
- ge,
1000
+ Ie,
996
1001
  {
997
1002
  borderless: !0,
998
1003
  value: y,
999
1004
  options: [
1000
1005
  {
1001
1006
  value: "all",
1002
- label: C.t("threadCommentUI.filter.status.all")
1007
+ label: g.t("threadCommentUI.filter.status.all")
1003
1008
  },
1004
1009
  {
1005
1010
  value: "resolved",
1006
- label: C.t("threadCommentUI.filter.status.resolved")
1011
+ label: g.t("threadCommentUI.filter.status.resolved")
1007
1012
  },
1008
1013
  {
1009
1014
  value: "unsolved",
1010
- label: C.t("threadCommentUI.filter.status.unsolved")
1015
+ label: g.t("threadCommentUI.filter.status.unsolved")
1011
1016
  },
1012
1017
  {
1013
1018
  value: "concern_me",
1014
- label: C.t("threadCommentUI.filter.status.concernMe")
1019
+ label: g.t("threadCommentUI.filter.status.concernMe")
1015
1020
  }
1016
1021
  ],
1017
- onChange: j
1022
+ onChange: V
1018
1023
  }
1019
1024
  )
1020
1025
  ] }),
1021
- J.length === 0 ? /* @__PURE__ */ I(
1026
+ Q.length === 0 ? /* @__PURE__ */ I(
1022
1027
  "div",
1023
1028
  {
1024
1029
  className: "univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1025
1030
  children: [
1026
- C.t("threadCommentUI.panel.empty"),
1027
- oe ? /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ a(ae, { onClick: se, children: C.t("threadCommentUI.panel.reset") }) }) : U ? null : /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ I(ae, { onClick: i, children: [
1028
- /* @__PURE__ */ a(Te, { className: "univer-mr-1.5" }),
1029
- C.t("threadCommentUI.panel.addComment")
1031
+ g.t("threadCommentUI.panel.empty"),
1032
+ se ? /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ a(le, { onClick: ae, children: g.t("threadCommentUI.panel.reset") }) }) : $ ? null : /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ I(le, { onClick: i, children: [
1033
+ /* @__PURE__ */ a(De, { className: "univer-mr-1.5" }),
1034
+ g.t("threadCommentUI.panel.addComment")
1030
1035
  ] }) })
1031
1036
  ]
1032
1037
  }
1033
1038
  ) : /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-col univer-gap-3", children: [
1034
- ne.map(Q),
1035
- ie.length > 0 && /* @__PURE__ */ a("div", { className: "univer-text-xs", children: C.t("threadCommentUI.panel.solved") }),
1036
- ie.map(Q)
1039
+ ie.map(X),
1040
+ oe.length > 0 && /* @__PURE__ */ a("div", { className: "univer-text-xs", children: g.t("threadCommentUI.panel.solved") }),
1041
+ oe.map(X)
1037
1042
  ] })
1038
1043
  ] });
1039
1044
  };
1040
1045
  export {
1041
1046
  F as SetActiveCommentOperation,
1042
- It as THREAD_COMMENT_PANEL,
1043
- qt as ThreadCommentPanel,
1047
+ xt as THREAD_COMMENT_PANEL,
1048
+ Xt as ThreadCommentPanel,
1044
1049
  Y as ThreadCommentPanelService,
1045
- Pt as ThreadCommentTree,
1046
- bt as ToggleSheetCommentPanelOperation,
1047
- ce as UniverThreadCommentUIPlugin
1050
+ Wt as ThreadCommentTree,
1051
+ yt as ToggleSheetCommentPanelOperation,
1052
+ q as UniverThreadCommentUIPlugin
1048
1053
  };