@univerjs/thread-comment-ui 0.6.10 → 0.7.0-beta.1

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.
Files changed (39) hide show
  1. package/lib/cjs/index.js +49 -8
  2. package/lib/cjs/locale/en-US.js +1 -1
  3. package/lib/cjs/locale/fa-IR.js +1 -1
  4. package/lib/cjs/locale/fr-FR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/index.js +526 -438
  10. package/lib/es/locale/en-US.js +2 -1
  11. package/lib/es/locale/fa-IR.js +2 -1
  12. package/lib/es/locale/fr-FR.js +2 -1
  13. package/lib/es/locale/ru-RU.js +2 -1
  14. package/lib/es/locale/vi-VN.js +2 -1
  15. package/lib/es/locale/zh-CN.js +2 -1
  16. package/lib/es/locale/zh-TW.js +2 -1
  17. package/lib/index.css +1 -1
  18. package/lib/index.js +526 -438
  19. package/lib/locale/en-US.js +2 -1
  20. package/lib/locale/fa-IR.js +2 -1
  21. package/lib/locale/fr-FR.js +2 -1
  22. package/lib/locale/ru-RU.js +2 -1
  23. package/lib/locale/vi-VN.js +2 -1
  24. package/lib/locale/zh-CN.js +2 -1
  25. package/lib/locale/zh-TW.js +2 -1
  26. package/lib/types/locale/ru-RU.d.ts +1 -0
  27. package/lib/types/locale/zh-CN.d.ts +1 -0
  28. package/lib/types/views/thread-comment-editor/index.d.ts +6 -3
  29. package/lib/types/views/thread-comment-editor/util.d.ts +1 -1
  30. package/lib/types/views/thread-comment-tree/index.d.ts +2 -0
  31. package/lib/umd/index.js +49 -8
  32. package/lib/umd/locale/en-US.js +1 -1
  33. package/lib/umd/locale/fa-IR.js +1 -1
  34. package/lib/umd/locale/fr-FR.js +1 -1
  35. package/lib/umd/locale/ru-RU.js +1 -1
  36. package/lib/umd/locale/vi-VN.js +1 -1
  37. package/lib/umd/locale/zh-CN.js +1 -1
  38. package/lib/umd/locale/zh-TW.js +1 -1
  39. package/package.json +10 -11
package/lib/es/index.js CHANGED
@@ -1,28 +1,28 @@
1
- var je = Object.defineProperty;
2
- var Ae = (t, e, n) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var B = (t, e, n) => Ae(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { Inject as Ne, IUniverInstanceService as Be, Disposable as We, UniverInstanceType as he, CommandType as Te, DependentOn as Fe, Injector as ze, ICommandService as ie, IConfigService as Ze, Plugin as Ke, merge as Ge, mergeOverrideWithDependencies as Ye, LocaleService as fe, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as qe, BuildTextUtils as ve, Tools as Je, CustomRangeType as Qe, getBodySlice as Xe, UserManagerService as pe, generateRandomId as et } from "@univerjs/core";
5
- import { UniverThreadCommentPlugin as tt, ThreadCommentModel as Ue, getDT as nt, AddCommentCommand as rt, ResolveCommentCommand as it, DeleteCommentTreeCommand as Ee, UpdateCommentCommand as ot, DeleteCommentCommand as at } from "@univerjs/thread-comment";
6
- import { ISidebarService as Oe, useDependency as N, KeyCode as ge, useObservable as W } from "@univerjs/ui";
7
- import { BehaviorSubject as Ie, filter as st, debounceTime as lt } from "rxjs";
8
- import { jsxs as S, jsx as l } from "react/jsx-runtime";
9
- import { Button as ce, clsx as dt, Tooltip as ct, Dropdown as mt, Select as be } from "@univerjs/design";
10
- import { forwardRef as j, useRef as re, createElement as z, useState as V, useEffect as me, useMemo as ne, useImperativeHandle as ut } from "react";
11
- import { IEditorService as ht, BreakLineCommand as vt, RichTextEditor as Ct } from "@univerjs/docs-ui";
12
- var ft = Object.getOwnPropertyDescriptor, pt = (t, e, n, r) => {
13
- for (var i = r > 1 ? void 0 : r ? ft(e, n) : e, a = t.length - 1, d; a >= 0; a--)
14
- (d = t[a]) && (i = d(i) || i);
1
+ var Le = Object.defineProperty;
2
+ var Pe = (t, e, n) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var z = (t, e, n) => Pe(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { Inject as Se, IUniverInstanceService as Ve, Disposable as Ae, UniverInstanceType as ce, CommandType as _e, DependentOn as Be, Injector as We, ICommandService as ne, IConfigService as Fe, Plugin as ze, merge as Ge, mergeOverrideWithDependencies as Ke, LocaleService as fe, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, BuildTextUtils as ve, Tools as Ye, CustomRangeType as qe, getBodySlice as Je, UserManagerService as he, generateRandomId as Qe } from "@univerjs/core";
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
+ import { ISidebarService as Ue, useDependency as N, KeyCode as pe, useObservable as G, useConfigValue as ot, UI_PLUGIN_CONFIG_KEY as lt } from "@univerjs/ui";
7
+ import { BehaviorSubject as ge, filter as at, debounceTime as st } from "rxjs";
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
+ 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
+ import { IEditorService as vt, BreakLineCommand as mt, RichTextEditor as ft } from "@univerjs/docs-ui";
12
+ var ht = Object.getOwnPropertyDescriptor, pt = (t, e, n, r) => {
13
+ for (var i = r > 1 ? void 0 : r ? ht(e, n) : e, o = t.length - 1, d; o >= 0; o--)
14
+ (d = t[o]) && (i = d(i) || i);
15
15
  return i;
16
- }, Se = (t, e) => (n, r) => e(n, r, t);
17
- let Y = class extends We {
16
+ }, xe = (t, e) => (n, r) => e(n, r, t);
17
+ let q = class extends Ae {
18
18
  constructor(e, n) {
19
19
  super();
20
- B(this, "_panelVisible", !1);
21
- B(this, "_panelVisible$", new Ie(!1));
22
- B(this, "_activeCommentId");
23
- B(this, "_activeCommentId$", new Ie(void 0));
24
- B(this, "panelVisible$", this._panelVisible$.asObservable());
25
- B(this, "activeCommentId$", this._activeCommentId$.asObservable());
20
+ z(this, "_panelVisible", !1);
21
+ z(this, "_panelVisible$", new ge(!1));
22
+ z(this, "_activeCommentId");
23
+ z(this, "_activeCommentId$", new ge(void 0));
24
+ z(this, "panelVisible$", this._panelVisible$.asObservable());
25
+ z(this, "activeCommentId$", this._activeCommentId$.asObservable());
26
26
  this._sidebarService = e, this._univerInstanceService = n, this._init(), this.disposeWithMe(() => {
27
27
  this._activeCommentId$.complete(), this._panelVisible$.complete();
28
28
  });
@@ -33,7 +33,7 @@ let Y = class extends We {
33
33
  e.visible || this.setPanelVisible(!1);
34
34
  })
35
35
  ), this.disposeWithMe(
36
- this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET).pipe(st((e) => !e)).subscribe(() => {
36
+ this._univerInstanceService.getCurrentTypeOfUnit$(ce.UNIVER_SHEET).pipe(at((e) => !e)).subscribe(() => {
37
37
  this._sidebarService.close();
38
38
  })
39
39
  );
@@ -51,277 +51,282 @@ let Y = class extends We {
51
51
  this._activeCommentId = e, this._activeCommentId$.next(e);
52
52
  }
53
53
  };
54
- Y = pt([
55
- Se(0, Ne(Oe)),
56
- Se(1, Be)
57
- ], Y);
58
- const gt = "thread-comment-panel", It = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt = {
54
+ q = pt([
55
+ xe(0, Se(Ue)),
56
+ xe(1, Ve)
57
+ ], q);
58
+ const gt = "thread-comment-panel", Ct = "UNIVER_THREAD_COMMENT_UI_PLUGIN", It = {
59
59
  id: "thread-comment-ui.operation.toggle-panel",
60
- type: Te.OPERATION,
60
+ type: _e.OPERATION,
61
61
  handler(t) {
62
- const e = t.get(Oe), n = t.get(Y);
62
+ const e = t.get(Ue), n = t.get(q);
63
63
  return n.panelVisible ? (e.close(), n.setPanelVisible(!1)) : (e.open({
64
64
  header: { title: "threadCommentUI.panel.title" },
65
65
  children: { label: gt },
66
66
  width: 330
67
67
  }), n.setPanelVisible(!0)), !0;
68
68
  }
69
- }, F = {
69
+ }, K = {
70
70
  id: "thread-comment-ui.operation.set-active-comment",
71
- type: Te.OPERATION,
71
+ type: _e.OPERATION,
72
72
  handler(t, e) {
73
- return t.get(Y).setActiveComment(e), !0;
73
+ return t.get(q).setActiveComment(e), !0;
74
74
  }
75
- }, St = "thread-comment-ui.config", ye = {};
76
- var yt = Object.defineProperty, _t = Object.getOwnPropertyDescriptor, xt = (t, e, n) => e in t ? yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Nt = (t, e, n, r) => {
77
- for (var i = r > 1 ? void 0 : r ? _t(e, n) : e, a = t.length - 1, d; a >= 0; a--)
78
- (d = t[a]) && (i = d(i) || i);
75
+ }, xt = "thread-comment-ui.config", be = {};
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
+ for (var i = r > 1 ? void 0 : r ? yt(e, n) : e, o = t.length - 1, d; o >= 0; o--)
78
+ (d = t[o]) && (i = d(i) || i);
79
79
  return i;
80
- }, Ce = (t, e) => (n, r) => e(n, r, t), Pe = (t, e, n) => xt(t, typeof e != "symbol" ? e + "" : e, n);
81
- let ue = class extends Ke {
82
- constructor(t = ye, e, n, r) {
80
+ }, me = (t, e) => (n, r) => e(n, r, t), Oe = (t, e, n) => St(t, typeof e != "symbol" ? e + "" : e, n);
81
+ let ue = class extends ze {
82
+ constructor(t = be, e, n, r) {
83
83
  super(), this._config = t, this._injector = e, this._commandService = n, this._configService = r;
84
- const { menu: i, ...a } = Ge(
84
+ const { menu: i, ...o } = Ge(
85
85
  {},
86
- ye,
86
+ be,
87
87
  this._config
88
88
  );
89
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(St, a);
89
+ i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(xt, o);
90
90
  }
91
91
  onStarting() {
92
92
  var t;
93
- Ye([
94
- [Y]
93
+ Ke([
94
+ [q]
95
95
  ], (t = this._config) == null ? void 0 : t.overrides).forEach((e) => {
96
96
  this._injector.add(e);
97
- }), [bt, F].forEach((e) => {
97
+ }), [It, K].forEach((e) => {
98
98
  this._commandService.registerCommand(e);
99
99
  });
100
100
  }
101
101
  };
102
- Pe(ue, "pluginName", It);
103
- Pe(ue, "type", he.UNIVER_UNKNOWN);
104
- ue = Nt([
105
- Fe(tt),
106
- Ce(1, Ne(ze)),
107
- Ce(2, ie),
108
- Ce(3, Ze)
102
+ Oe(ue, "pluginName", Ct);
103
+ Oe(ue, "type", ce.UNIVER_UNKNOWN);
104
+ ue = _t([
105
+ Be(Xe),
106
+ me(1, Se(We)),
107
+ me(2, ne),
108
+ me(3, Fe)
109
109
  ], ue);
110
- var H = function() {
111
- return H = Object.assign || function(t) {
110
+ var M = function() {
111
+ return M = Object.assign || function(t) {
112
112
  for (var e, n = 1, r = arguments.length; n < r; n++) {
113
113
  e = arguments[n];
114
114
  for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
115
115
  }
116
116
  return t;
117
- }, H.apply(this, arguments);
118
- }, Tt = function(t, e) {
117
+ }, M.apply(this, arguments);
118
+ }, Nt = function(t, e) {
119
119
  var n = {};
120
120
  for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
121
121
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
122
122
  for (var i = 0, r = Object.getOwnPropertySymbols(t); i < r.length; i++)
123
123
  e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
124
124
  return n;
125
- }, Z = j(function(t, e) {
126
- var n = t.icon, r = t.id, i = t.className, a = t.extend, d = Tt(t, ["icon", "id", "className", "extend"]), v = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), g = re("_".concat(Ot()));
127
- return $e(n, "".concat(r), { defIds: n.defIds, idSuffix: g.current }, H({ ref: e, className: v }, d), a);
125
+ }, Y = B(function(t, e) {
126
+ var n = t.icon, r = t.id, i = t.className, o = t.extend, d = Nt(t, ["icon", "id", "className", "extend"]), f = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), h = te("_".concat(Ot()));
127
+ return Te(n, "".concat(r), { defIds: n.defIds, idSuffix: h.current }, M({ ref: e, className: f }, d), o);
128
128
  });
129
- function $e(t, e, n, r, i) {
130
- return z(t.tag, H(H({ key: e }, Ut(t, n, i)), r), (Et(t, n).children || []).map(function(a, d) {
131
- return $e(a, "".concat(e, "-").concat(t.tag, "-").concat(d), n, void 0, i);
129
+ function Te(t, e, n, r, i) {
130
+ return Z(t.tag, M(M({ key: e }, wt(t, n, i)), r), (Ut(t, n).children || []).map(function(o, d) {
131
+ return Te(o, "".concat(e, "-").concat(t.tag, "-").concat(d), n, void 0, i);
132
132
  }));
133
133
  }
134
- function Ut(t, e, n) {
135
- var r = H({}, t.attrs);
136
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(a) {
137
- var d = a[0], v = a[1];
138
- d === "mask" && typeof v == "string" && (r[d] = v.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
134
+ function wt(t, e, n) {
135
+ var r = M({}, t.attrs);
136
+ n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1), t.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(o) {
137
+ var d = o[0], f = o[1];
138
+ d === "mask" && typeof f == "string" && (r[d] = f.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
139
139
  });
140
140
  var i = e.defIds;
141
- return !i || i.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(a) {
142
- var d = a[0], v = a[1];
143
- typeof v == "string" && (r[d] = v.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
141
+ return !i || i.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(o) {
142
+ var d = o[0], f = o[1];
143
+ typeof f == "string" && (r[d] = f.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
144
144
  })), r;
145
145
  }
146
- function Et(t, e) {
146
+ function Ut(t, e) {
147
147
  var n, r = e.defIds;
148
- return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? H(H({}, t), { children: t.children.map(function(i) {
149
- return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? H(H({}, i), { attrs: H(H({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
148
+ return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? M(M({}, t), { children: t.children.map(function(i) {
149
+ return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? M(M({}, i), { attrs: M(M({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
150
150
  }) }) : t;
151
151
  }
152
152
  function Ot() {
153
153
  return Math.random().toString(36).substring(2, 8);
154
154
  }
155
- Z.displayName = "UniverIcon";
156
- var Pt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, De = j(function(t, e) {
157
- return z(Z, Object.assign({}, t, {
155
+ Y.displayName = "UniverIcon";
156
+ var Tt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ee = B(function(t, e) {
157
+ return Z(Y, Object.assign({}, t, {
158
158
  id: "delete-single",
159
159
  ref: e,
160
- icon: Pt
160
+ icon: Tt
161
161
  }));
162
162
  });
163
- De.displayName = "DeleteSingle";
164
- var $t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", 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" } }] }, He = j(function(t, e) {
165
- return z(Z, Object.assign({}, t, {
163
+ Ee.displayName = "DeleteSingle";
164
+ var Et = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", 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" } }] }, ke = B(function(t, e) {
165
+ return Z(Y, Object.assign({}, t, {
166
166
  id: "increase-single",
167
167
  ref: e,
168
- icon: $t
168
+ icon: Et
169
169
  }));
170
170
  });
171
- He.displayName = "IncreaseSingle";
172
- var Dt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z" } }] }, Me = j(function(t, e) {
173
- return z(Z, Object.assign({}, t, {
171
+ ke.displayName = "IncreaseSingle";
172
+ var kt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z" } }] }, De = B(function(t, e) {
173
+ return Z(Y, Object.assign({}, t, {
174
174
  id: "more-horizontal-single",
175
175
  ref: e,
176
- icon: Dt
176
+ icon: kt
177
177
  }));
178
178
  });
179
- Me.displayName = "MoreHorizontalSingle";
180
- var Ht = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { stroke: "currentColor", d: "M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252", strokeLinecap: "round", strokeWidth: 1.2 } }] }, ke = j(function(t, e) {
181
- return z(Z, Object.assign({}, t, {
179
+ De.displayName = "MoreHorizontalSingle";
180
+ var Dt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { stroke: "currentColor", d: "M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252", strokeLinecap: "round", strokeWidth: 1.2 } }] }, $e = B(function(t, e) {
181
+ return Z(Y, Object.assign({}, t, {
182
182
  id: "reply-to-comment-single",
183
183
  ref: e,
184
- icon: Ht
184
+ icon: Dt
185
185
  }));
186
186
  });
187
- ke.displayName = "ReplyToCommentSingle";
188
- var Mt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Re = j(function(t, e) {
189
- return z(Z, Object.assign({}, t, {
187
+ $e.displayName = "ReplyToCommentSingle";
188
+ var $t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Me = B(function(t, e) {
189
+ return Z(Y, Object.assign({}, t, {
190
190
  id: "resolved-single",
191
191
  ref: e,
192
- icon: Mt
192
+ icon: $t
193
193
  }));
194
194
  });
195
- Re.displayName = "ResolvedSingle";
196
- var kt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "circle", attrs: { cx: 8.73, cy: 8.4, r: 6.4, stroke: "currentColor", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }] }, we = j(function(t, e) {
197
- return z(Z, Object.assign({}, t, {
195
+ Me.displayName = "ResolvedSingle";
196
+ var Mt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "circle", attrs: { cx: 8.73, cy: 8.4, r: 6.4, stroke: "currentColor", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }] }, Re = B(function(t, e) {
197
+ return Z(Y, Object.assign({}, t, {
198
198
  id: "solve-single",
199
199
  ref: e,
200
- icon: kt
200
+ icon: Mt
201
201
  }));
202
202
  });
203
- we.displayName = "SolveSingle";
204
- const Rt = "univer-thread-comment-editor-buttons", _e = {
205
- threadCommentEditorButtons: Rt
206
- };
207
- function xe(t) {
203
+ Re.displayName = "SolveSingle";
204
+ function ye(t) {
208
205
  return {
209
206
  id: "d",
210
207
  body: t,
211
208
  documentStyle: {}
212
209
  };
213
210
  }
214
- const Le = j((t, e) => {
211
+ const je = B((t, e) => {
215
212
  var R;
216
- const { comment: n, onSave: r, id: i, onCancel: a, autoFocus: d, unitId: v, type: g } = t, T = N(ie), O = N(fe), [w, P] = V(!1), U = N(ht), m = re(null), f = g === he.UNIVER_SHEET ? qe : v, [$, y] = V(() => {
217
- var c, u, p;
218
- return ve.transform.getPlainText((p = (u = (c = m.current) == null ? void 0 : c.getDocumentData().body) == null ? void 0 : u.dataStream) != null ? p : "");
213
+ const { comment: n, onSave: r, id: i, onCancel: o, autoFocus: d, unitId: f, type: h } = t, w = N(ne), O = N(fe), [P, T] = A(!1), b = N(vt), c = te(null), v = h === ce.UNIVER_SHEET ? Ze : f, [E, y] = A(() => {
214
+ var u, m, p;
215
+ return ve.transform.getPlainText((p = (m = (u = c.current) == null ? void 0 : u.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? p : "");
219
216
  });
220
- me(() => {
221
- var u, p, s, h;
222
- y(ve.transform.getPlainText((s = (p = (u = m.current) == null ? void 0 : u.getDocumentData().body) == null ? void 0 : p.dataStream) != null ? s : ""));
223
- const c = (h = m.current) == null ? void 0 : h.selectionChange$.subscribe(() => {
224
- var K, _, b;
225
- y(ve.transform.getPlainText((b = (_ = (K = m.current) == null ? void 0 : K.getDocumentData().body) == null ? void 0 : _.dataStream) != null ? b : ""));
217
+ de(() => {
218
+ var m, p, S, g;
219
+ y(ve.transform.getPlainText((S = (p = (m = c.current) == null ? void 0 : m.getDocumentData().body) == null ? void 0 : p.dataStream) != null ? S : ""));
220
+ const u = (g = c.current) == null ? void 0 : g.selectionChange$.subscribe(() => {
221
+ var l, _, W;
222
+ y(ve.transform.getPlainText((W = (_ = (l = c.current) == null ? void 0 : l.getDocumentData().body) == null ? void 0 : _.dataStream) != null ? W : ""));
226
223
  });
227
- return () => c == null ? void 0 : c.unsubscribe();
228
- }, [(R = m.current) == null ? void 0 : R.selectionChange$]);
229
- const M = ne(() => ({
230
- keyCodes: [{ keyCode: ge.ENTER }],
231
- handler: (c) => {
232
- c === ge.ENTER && T.executeCommand(
233
- vt.id
224
+ return () => u == null ? void 0 : u.unsubscribe();
225
+ }, [(R = c.current) == null ? void 0 : R.selectionChange$]);
226
+ const V = ee(() => ({
227
+ keyCodes: [{ keyCode: pe.ENTER }],
228
+ handler: (u) => {
229
+ u === pe.ENTER && w.executeCommand(
230
+ mt.id
234
231
  );
235
232
  }
236
- }), [T]);
237
- ut(e, () => ({
238
- reply(c) {
239
- var u, p;
240
- (u = m.current) == null || u.focus(), (p = m.current) == null || p.setDocumentData(xe(c));
233
+ }), [w]);
234
+ ct(e, () => ({
235
+ reply(u) {
236
+ var p, S;
237
+ if (!c.current)
238
+ return;
239
+ b.focus((p = c.current.getEditorId()) != null ? p : "");
240
+ const m = ye(u);
241
+ (S = c.current) == null || S.setDocumentData(m, [{
242
+ startOffset: m.body.dataStream.length - 2,
243
+ endOffset: m.body.dataStream.length - 2,
244
+ collapsed: !0
245
+ }]);
241
246
  }
242
247
  }));
243
248
  const I = () => {
244
- if (m.current) {
245
- const c = Je.deepClone(m.current.getDocumentData().body);
246
- P(!1), r == null || r({
249
+ if (c.current) {
250
+ const u = Ye.deepClone(c.current.getDocumentData().body);
251
+ T(!1), r == null || r({
247
252
  ...n,
248
- text: c
249
- }), m.current.replaceText(""), setTimeout(() => {
250
- var u, p;
251
- (u = m.current) == null || u.setSelectionRanges([]), (p = m.current) == null || p.blur();
253
+ text: u
254
+ }), c.current.replaceText(""), setTimeout(() => {
255
+ var m, p;
256
+ (m = c.current) == null || m.setSelectionRanges([]), (p = c.current) == null || p.blur();
252
257
  }, 10);
253
258
  }
254
259
  };
255
- return /* @__PURE__ */ S("div", { className: _e.threadCommentEditor, onClick: (c) => c.preventDefault(), children: [
256
- /* @__PURE__ */ l(
257
- Ct,
260
+ return /* @__PURE__ */ x("div", { onClick: (u) => u.preventDefault(), children: [
261
+ /* @__PURE__ */ a(
262
+ ft,
258
263
  {
259
- editorRef: m,
264
+ className: "univer-w-full",
265
+ editorRef: c,
260
266
  autoFocus: d,
261
- style: { width: "100%" },
262
- keyboardEventConfig: M,
267
+ keyboardEventConfig: V,
263
268
  placeholder: O.t("threadCommentUI.editor.placeholder"),
264
- initialValue: (n == null ? void 0 : n.text) && xe(n.text),
265
- onFocusChange: (c) => c && P(c),
269
+ initialValue: (n == null ? void 0 : n.text) && ye(n.text),
270
+ onFocusChange: (u) => u && T(u),
266
271
  isSingle: !1,
267
272
  maxHeight: 64,
268
273
  onClickOutside: () => {
269
274
  setTimeout(() => {
270
- U.focus(f);
275
+ b.focus(v);
271
276
  }, 30);
272
277
  }
273
278
  }
274
279
  ),
275
- w ? /* @__PURE__ */ S("div", { className: _e.threadCommentEditorButtons, children: [
276
- /* @__PURE__ */ l(
277
- ce,
280
+ P ? /* @__PURE__ */ x("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-end", children: [
281
+ /* @__PURE__ */ a(
282
+ se,
278
283
  {
279
284
  style: { marginRight: 12 },
280
285
  onClick: () => {
281
- var c;
282
- a == null || a(), P(!1), (c = m.current) == null || c.replaceText("", !0), T.executeCommand(F.id);
286
+ var u;
287
+ o == null || o(), T(!1), (u = c.current) == null || u.replaceText("", !0), w.executeCommand(K.id);
283
288
  },
284
289
  children: O.t("threadCommentUI.editor.cancel")
285
290
  }
286
291
  ),
287
- /* @__PURE__ */ l(
288
- ce,
292
+ /* @__PURE__ */ a(
293
+ se,
289
294
  {
290
295
  variant: "primary",
291
- disabled: !$,
296
+ disabled: !E,
292
297
  onClick: I,
293
298
  children: O.t(i ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
294
299
  }
295
300
  )
296
301
  ] }) : null
297
302
  ] });
298
- }), wt = (t) => {
303
+ }), Rt = (t) => {
299
304
  const { dataStream: e, customRanges: n } = t, r = e.endsWith(`\r
300
305
  `) ? e.length - 2 : e.length, i = [];
301
- let a = 0;
306
+ let o = 0;
302
307
  return n == null || n.forEach((d) => {
303
- a < d.startIndex && i.push({
308
+ o < d.startIndex && i.push({
304
309
  type: "text",
305
- content: e.slice(a, d.startIndex)
310
+ content: e.slice(o, d.startIndex)
306
311
  }), i.push({
307
312
  type: "mention",
308
313
  content: {
309
314
  label: e.slice(d.startIndex, d.endIndex + 1),
310
315
  id: d.rangeId
311
316
  }
312
- }), a = d.endIndex + 1;
317
+ }), o = d.endIndex + 1;
313
318
  }), i.push({
314
319
  type: "text",
315
- content: e.slice(a, r)
320
+ content: e.slice(o, r)
316
321
  }), i;
317
- }, Lt = (t) => {
322
+ }, jt = (t) => {
318
323
  const { paragraphs: e = [] } = t;
319
324
  let n = 0;
320
325
  return e.map((r) => {
321
- const i = Xe(t, n, r.startIndex);
322
- return n = r.startIndex + 1, wt(i);
326
+ const i = Je(t, n, r.startIndex);
327
+ return n = r.startIndex + 1, Rt(i);
323
328
  });
324
- }, Vt = (t) => {
329
+ }, Ht = (t) => {
325
330
  let e = "";
326
331
  const n = [];
327
332
  return t.forEach((r) => {
@@ -332,19 +337,20 @@ const Le = j((t, e) => {
332
337
  case "mention": {
333
338
  const i = e.length;
334
339
  e += r.content.label;
335
- const a = e.length - 1;
340
+ const o = e.length - 1;
336
341
  n.push({
337
342
  rangeId: r.content.id,
338
- rangeType: Qe.MENTION,
343
+ rangeType: qe.MENTION,
339
344
  startIndex: i,
340
- endIndex: a,
341
- properties: {}
345
+ endIndex: o,
346
+ properties: {},
347
+ wholeEntity: !0
342
348
  });
343
349
  break;
344
350
  }
345
351
  }
346
- }), e += `
347
- \r`, {
352
+ }), e += `\r
353
+ `, {
348
354
  textRuns: [],
349
355
  paragraphs: [
350
356
  {
@@ -360,147 +366,167 @@ const Le = j((t, e) => {
360
366
  dataStream: e,
361
367
  customRanges: n
362
368
  };
363
- }, jt = "univer-thread-comment", At = "univer-thread-comment-active", Bt = "univer-thread-comment-content", Wt = "univer-thread-comment-highlight", Ft = "univer-thread-comment-icon-container", zt = "univer-thread-comment-icon", Zt = "univer-thread-comment-title", Kt = "univer-thread-comment-title-position", Gt = "univer-thread-comment-title-highlight", Yt = "univer-thread-comment-title-position-text", qt = "univer-thread-comment-username", Jt = "univer-thread-comment-item", Qt = "univer-thread-comment-item-head", Xt = "univer-thread-comment-item-title", en = "univer-thread-comment-item-time", tn = "univer-thread-comment-item-content", nn = "univer-thread-comment-item-at", C = {
364
- threadComment: jt,
365
- threadCommentActive: At,
366
- threadCommentContent: Bt,
367
- threadCommentHighlight: Wt,
368
- threadCommentIconContainer: Ft,
369
- threadCommentIcon: zt,
370
- threadCommentTitle: Zt,
371
- threadCommentTitlePosition: Kt,
372
- threadCommentTitleHighlight: Gt,
373
- threadCommentTitlePositionText: Yt,
374
- threadCommentUsername: qt,
375
- threadCommentItem: Jt,
376
- threadCommentItemHead: Qt,
377
- threadCommentItemTitle: Xt,
378
- threadCommentItemTime: en,
379
- threadCommentItemContent: tn,
380
- threadCommentItemAt: nn
381
- }, Ve = "__mock__", rn = (t) => {
382
- const { item: e, unitId: n, subUnitId: r, editing: i, onEditingChange: a, onReply: d, resolved: v, isRoot: g, onClose: T, onDeleteComment: O, type: w } = t, P = N(ie), U = N(fe), m = N(pe), f = m.getUser(e.personId), $ = W(m.currentUser$), y = ($ == null ? void 0 : $.userID) === e.personId, M = e.id === Ve, [I, R] = V(!1), c = () => {
383
- (O == null ? void 0 : O(e)) !== !1 && (P.executeCommand(
384
- g ? Ee.id : at.id,
369
+ }, He = "__mock__", Lt = (t) => {
370
+ const { item: e, unitId: n, subUnitId: r, editing: i, onEditingChange: o, 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 = ot(lt), m = u == null ? void 0 : u.avatarFallback, p = () => {
371
+ (O == null ? void 0 : O(e)) !== !1 && (T.executeCommand(
372
+ h ? we.id : it.id,
385
373
  {
386
374
  unitId: n,
387
375
  subUnitId: r,
388
376
  commentId: e.id
389
377
  }
390
- ), g && (T == null || T()));
378
+ ), h && (w == null || w()));
391
379
  };
392
- return /* @__PURE__ */ S("div", { className: C.threadCommentItem, onMouseLeave: () => R(!1), onMouseEnter: () => R(!0), children: [
393
- /* @__PURE__ */ l("img", { className: C.threadCommentItemHead, src: f == null ? void 0 : f.avatar }),
394
- /* @__PURE__ */ S("div", { className: C.threadCommentItemTitle, children: [
395
- /* @__PURE__ */ l("div", { className: C.threadCommentUsername, children: (f == null ? void 0 : f.name) || " " }),
396
- /* @__PURE__ */ S("div", { children: [
397
- M || v ? null : I ? /* @__PURE__ */ l("div", { className: C.threadCommentIcon, onClick: () => d(f), children: /* @__PURE__ */ l(ke, {}) }) : null,
398
- y && !M && !v ? /* @__PURE__ */ l(
399
- mt,
380
+ return /* @__PURE__ */ x("div", { className: "univer-relative univer-mb-3 univer-pl-[30px]", onMouseLeave: () => R(!1), onMouseEnter: () => R(!0), children: [
381
+ /* @__PURE__ */ a(
382
+ "div",
383
+ {
384
+ className: `
385
+ univer-absolute univer-left-0 univer-top-0 univer-h-6 univer-w-6 univer-rounded-full univer-bg-cover
386
+ univer-bg-center univer-bg-no-repeat
387
+ `,
388
+ style: {
389
+ backgroundImage: `url(${(v == null ? void 0 : v.avatar) || m})`
390
+ }
391
+ }
392
+ ),
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(
397
+ "div",
400
398
  {
401
- overlay: /* @__PURE__ */ l("div", { className: "univer-rounded-lg univer-p-4 univer-theme", children: /* @__PURE__ */ S(
399
+ className: `
400
+ univer-ml-1 univer-inline-flex univer-h-6 univer-w-6
401
+ univer-cursor-pointer univer-items-center univer-justify-center
402
+ univer-rounded-sm univer-text-base
403
+ hover:univer-bg-gray-50
404
+ `,
405
+ onClick: () => d(v),
406
+ children: /* @__PURE__ */ a($e, {})
407
+ }
408
+ ) : null,
409
+ y && !V && !f ? /* @__PURE__ */ a(
410
+ ut,
411
+ {
412
+ overlay: /* @__PURE__ */ a("div", { className: "univer-rounded-lg", children: /* @__PURE__ */ x(
402
413
  "ul",
403
414
  {
404
415
  className: `
405
- univer-m-0 univer-grid univer-list-none univer-gap-2 univer-p-0
406
- univer-text-sm
407
- [&_a]:univer-cursor-pointer [&_a]:univer-rounded [&_a]:univer-p-1
408
- `,
416
+ univer-m-0 univer-box-border univer-grid univer-list-none
417
+ univer-p-1.5 univer-text-[13px] univer-text-sm
418
+ [&_a]:univer-block [&_a]:univer-cursor-pointer
419
+ [&_a]:univer-rounded [&_a]:univer-px-2 [&_a]:univer-py-1.5
420
+ [&_a]:univer-transition-colors
421
+ `,
409
422
  children: [
410
- /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
423
+ /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
411
424
  "a",
412
425
  {
413
426
  className: "hover:univer-bg-gray-200",
414
- onClick: () => a == null ? void 0 : a(!0),
415
- children: U.t("threadCommentUI.item.edit")
427
+ onClick: () => o == null ? void 0 : o(!0),
428
+ children: b.t("threadCommentUI.item.edit")
416
429
  }
417
430
  ) }),
418
- /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
431
+ /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
419
432
  "a",
420
433
  {
421
434
  className: "hover:univer-bg-gray-200",
422
- onClick: c,
423
- children: U.t("threadCommentUI.item.delete")
435
+ onClick: p,
436
+ children: b.t("threadCommentUI.item.delete")
424
437
  }
425
438
  ) })
426
439
  ]
427
440
  }
428
441
  ) }),
429
- children: /* @__PURE__ */ l("div", { className: C.threadCommentIcon, children: /* @__PURE__ */ l(Me, {}) })
442
+ children: /* @__PURE__ */ a(
443
+ "div",
444
+ {
445
+ className: `
446
+ univer-ml-1 univer-inline-flex univer-h-6 univer-w-6 univer-cursor-pointer
447
+ univer-items-center univer-justify-center univer-rounded-sm
448
+ univer-text-base
449
+ hover:univer-bg-gray-50
450
+ `,
451
+ children: /* @__PURE__ */ a(De, {})
452
+ }
453
+ )
430
454
  }
431
455
  ) : null
432
456
  ] })
433
- ] }),
434
- /* @__PURE__ */ l("div", { className: C.threadCommentItemTime, children: e.dT }),
435
- i ? /* @__PURE__ */ l(
436
- Le,
457
+ ] }) : null,
458
+ /* @__PURE__ */ a("div", { className: "univer-mb-1 univer-text-xs/normal univer-text-gray-600", children: e.dT }),
459
+ i ? /* @__PURE__ */ a(
460
+ je,
437
461
  {
438
- type: w,
462
+ type: P,
439
463
  id: e.id,
440
464
  comment: e,
441
- onCancel: () => a == null ? void 0 : a(!1),
465
+ onCancel: () => o == null ? void 0 : o(!1),
442
466
  autoFocus: !0,
443
467
  unitId: n,
444
468
  subUnitId: r,
445
- onSave: ({ text: u, attachments: p }) => {
446
- a == null || a(!1), P.executeCommand(
447
- ot.id,
469
+ onSave: ({ text: S, attachments: g }) => {
470
+ o == null || o(!1), T.executeCommand(
471
+ rt.id,
448
472
  {
449
473
  unitId: n,
450
474
  subUnitId: r,
451
475
  payload: {
452
476
  commentId: e.id,
453
- text: u,
454
- attachments: p
477
+ text: S,
478
+ attachments: g
455
479
  }
456
480
  }
457
481
  );
458
482
  }
459
483
  }
460
- ) : /* @__PURE__ */ l("div", { className: C.threadCommentItemContent, children: Lt(e.text).map((u, p) => /* @__PURE__ */ l("div", { className: "univer-break-words", children: u.map((s, h) => {
461
- switch (s.type) {
484
+ ) : /* @__PURE__ */ a("div", { className: "univer-text-[13px]/normal univer-text-gray-900", children: jt(e.text).map((S, g) => /* @__PURE__ */ a("div", { className: "univer-break-words", children: S.map((l, _) => {
485
+ switch (l.type) {
462
486
  case "mention":
463
- return /* @__PURE__ */ S("a", { className: C.threadCommentItemAt, children: [
464
- s.content.label,
487
+ return /* @__PURE__ */ x("a", { className: "univer-text-primary-600", children: [
488
+ l.content.label,
465
489
  " "
466
- ] }, h);
490
+ ] }, _);
467
491
  default:
468
- return s.content;
492
+ return l.content;
469
493
  }
470
- }) }, p)) })
494
+ }) }, g)) })
471
495
  ] });
472
- }, on = (t) => {
473
- var X, ee, se;
496
+ }, Pt = (t) => {
497
+ var ae, X, s;
474
498
  const {
475
499
  id: e,
476
500
  unitId: n,
477
501
  subUnitId: r,
478
502
  refStr: i,
479
- showEdit: a = !0,
503
+ showEdit: o = !0,
480
504
  onClick: d,
481
- showHighlight: v,
482
- onClose: g,
483
- getSubUnitName: T,
505
+ showHighlight: f,
506
+ onClose: h,
507
+ getSubUnitName: w,
484
508
  prefix: O,
485
- autoFocus: w,
486
- onMouseEnter: P,
487
- onMouseLeave: U,
488
- onAddComment: m,
489
- onDeleteComment: f,
490
- onResolve: $,
491
- type: y
492
- } = t, M = N(Ue), [I, R] = V(!1), [c, u] = V(""), p = ne(() => M.commentUpdate$.pipe(lt(16)), [M]);
493
- W(p);
494
- const s = e ? M.getCommentWithChildren(n, r, e) : null, h = N(ie), K = N(pe), _ = s == null ? void 0 : s.root.resolved, b = W(K.currentUser$), G = re(null), oe = [
495
- ...s ? [s.root] : (
509
+ autoFocus: P,
510
+ onMouseEnter: T,
511
+ onMouseLeave: b,
512
+ onAddComment: c,
513
+ onDeleteComment: v,
514
+ onResolve: E,
515
+ type: y,
516
+ style: V,
517
+ full: I
518
+ } = t, R = N(Ne), [u, m] = A(!1), [p, S] = A(""), g = ee(() => R.commentUpdate$.pipe(st(16)), [R]);
519
+ G(g);
520
+ const l = e ? R.getCommentWithChildren(n, r, e) : null, _ = N(ne), W = N(he), k = l == null ? void 0 : l.root.resolved, D = G(W.currentUser$), H = te(null), J = [
521
+ ...l ? [l.root] : (
496
522
  // mock empty comment
497
523
  [{
498
- id: Ve,
524
+ id: He,
499
525
  text: {
500
526
  dataStream: `
501
527
  \r`
502
528
  },
503
- personId: (X = b == null ? void 0 : b.userID) != null ? X : "",
529
+ personId: (ae = D == null ? void 0 : D.userID) != null ? ae : "",
504
530
  ref: i != null ? i : "",
505
531
  dT: "",
506
532
  unitId: n,
@@ -508,231 +534,299 @@ const Le = j((t, e) => {
508
534
  threadId: ""
509
535
  }]
510
536
  ),
511
- ...(ee = s == null ? void 0 : s.children) != null ? ee : []
512
- ], D = re(null), q = (x) => {
513
- x.stopPropagation(), _ ? h.executeCommand(F.id, {
537
+ ...(X = l == null ? void 0 : l.children) != null ? X : []
538
+ ], j = te(null), re = (C) => {
539
+ C.stopPropagation(), k ? _.executeCommand(K.id, {
514
540
  unitId: n,
515
541
  subUnitId: r,
516
542
  commentId: e
517
- }) : h.executeCommand(F.id), h.executeCommand(it.id, {
543
+ }) : _.executeCommand(K.id), _.executeCommand(nt.id, {
518
544
  unitId: n,
519
545
  subUnitId: r,
520
546
  commentId: e,
521
- resolved: !_
522
- }), $ == null || $(!_);
523
- }, L = (x) => {
524
- x.stopPropagation(), h.executeCommand(F.id), !(s != null && s.root && (f == null ? void 0 : f(s.root)) === !1) && (h.executeCommand(
525
- Ee.id,
547
+ resolved: !k
548
+ }), E == null || E(!k);
549
+ }, Q = (C) => {
550
+ C.stopPropagation(), _.executeCommand(K.id), !(l != null && l.root && (v == null ? void 0 : v(l.root)) === !1) && (_.executeCommand(
551
+ we.id,
526
552
  {
527
553
  unitId: n,
528
554
  subUnitId: r,
529
555
  commentId: e
530
556
  }
531
- ), g == null || g());
557
+ ), h == null || h());
532
558
  };
533
- me(() => U == null ? void 0 : U(), []);
534
- const J = T((se = s == null ? void 0 : s.root.subUnitId) != null ? se : r), Q = a && !c && !_, ae = `${i || (s == null ? void 0 : s.root.ref) || ""}${J ? " · " : ""}${J}`;
535
- return /* @__PURE__ */ S(
559
+ de(() => b == null ? void 0 : b(), []);
560
+ const ie = w((s = l == null ? void 0 : l.root.subUnitId) != null ? s : r), oe = o && !p && !k, le = `${i || (l == null ? void 0 : l.root.ref) || ""}${ie ? " · " : ""}${ie}`;
561
+ return /* @__PURE__ */ x(
536
562
  "div",
537
563
  {
538
- className: dt(C.threadComment, {
539
- [C.threadCommentActive]: !_ && (v || I || O === "cell")
540
- }),
564
+ className: Ce(
565
+ `
566
+ univer-relative univer-box-border univer-rounded-md univer-border univer-border-solid
567
+ univer-border-gray-200 univer-bg-white univer-p-4
568
+ `,
569
+ I ? "univer-w-full" : "univer-w-[278px]",
570
+ {
571
+ "univer-shadow": !k && (f || u || O === "cell")
572
+ }
573
+ ),
574
+ style: V,
541
575
  onClick: d,
542
576
  id: `${O}-${n}-${r}-${e}`,
543
577
  onMouseEnter: () => {
544
- P == null || P(), R(!0);
578
+ T == null || T(), m(!0);
545
579
  },
546
580
  onMouseLeave: () => {
547
- U == null || U(), R(!1);
581
+ b == null || b(), m(!1);
548
582
  },
549
583
  children: [
550
- !_ && v ? /* @__PURE__ */ l("div", { className: C.threadCommentHighlight }) : null,
551
- /* @__PURE__ */ S("div", { className: C.threadCommentTitle, children: [
552
- /* @__PURE__ */ S("div", { className: C.threadCommentTitlePosition, children: [
553
- /* @__PURE__ */ l("div", { className: C.threadCommentTitleHighlight }),
554
- /* @__PURE__ */ l(ct, { showIfEllipsis: !0, title: ae, children: /* @__PURE__ */ l("div", { className: C.threadCommentTitlePositionText, children: ae }) })
555
- ] }),
556
- s ? /* @__PURE__ */ S("div", { className: C.threadCommentIconContainer, children: [
557
- /* @__PURE__ */ l(
558
- "div",
559
- {
560
- onClick: q,
561
- className: C.threadCommentIcon,
562
- style: { color: _ ? "rgb(var(--green-500))" : "" },
563
- children: _ ? /* @__PURE__ */ l(Re, {}) : /* @__PURE__ */ l(we, {})
564
- }
565
- ),
566
- (b == null ? void 0 : b.userID) === s.root.personId ? /* @__PURE__ */ l("div", { className: C.threadCommentIcon, onClick: L, children: /* @__PURE__ */ l(De, {}) }) : null
567
- ] }) : null
568
- ] }),
569
- /* @__PURE__ */ l("div", { className: C.threadCommentContent, ref: D, children: oe.map(
570
- (x) => /* @__PURE__ */ l(
571
- rn,
572
- {
573
- onClose: g,
574
- unitId: n,
575
- subUnitId: r,
576
- item: x,
577
- isRoot: x.id === (s == null ? void 0 : s.root.id),
578
- editing: c === x.id,
579
- resolved: s == null ? void 0 : s.root.resolved,
580
- type: y,
581
- onEditingChange: (o) => {
582
- u(o ? x.id : "");
583
- },
584
- onReply: (o) => {
585
- o && requestAnimationFrame(() => {
586
- var k;
587
- (k = G.current) == null || k.reply(Vt([{
588
- type: "mention",
589
- content: {
590
- id: o.userID,
591
- label: o.name
592
- }
593
- }]));
594
- });
595
- },
596
- onAddComment: m,
597
- onDeleteComment: f
598
- },
599
- x.id
600
- )
601
- ) }),
602
- Q ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
603
- Le,
584
+ !k && f ? /* @__PURE__ */ a(
585
+ "div",
586
+ {
587
+ className: `
588
+ univer-absolute univer-left-0 univer-right-0 univer-top-0 univer-h-1.5 univer-rounded-t-md
589
+ univer-bg-yellow-400
590
+ `
591
+ }
592
+ ) : null,
593
+ /* @__PURE__ */ x(
594
+ "div",
604
595
  {
605
- ref: G,
596
+ className: `
597
+ univer-mb-4 univer-flex univer-flex-row univer-items-center univer-justify-between univer-text-sm
598
+ univer-leading-5
599
+ `,
600
+ children: [
601
+ /* @__PURE__ */ x("div", { className: "univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden", children: [
602
+ /* @__PURE__ */ a(
603
+ "div",
604
+ {
605
+ className: `
606
+ univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0
607
+ univer-rounded-sm univer-bg-yellow-400
608
+ `
609
+ }
610
+ ),
611
+ /* @__PURE__ */ a(dt, { showIfEllipsis: !0, title: le, children: /* @__PURE__ */ a(
612
+ "div",
613
+ {
614
+ className: `
615
+ univer-flex-1 univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap
616
+ `,
617
+ children: le
618
+ }
619
+ ) })
620
+ ] }),
621
+ l ? /* @__PURE__ */ x("div", { className: "univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row", children: [
622
+ /* @__PURE__ */ a(
623
+ "div",
624
+ {
625
+ onClick: re,
626
+ className: Ce(
627
+ `
628
+ univer-ml-1 univer-inline-flex univer-h-6 univer-w-6 univer-cursor-pointer
629
+ univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base
630
+ hover:univer-bg-gray-50
631
+ `,
632
+ {
633
+ "univer-text-green-500": k
634
+ }
635
+ ),
636
+ children: k ? /* @__PURE__ */ a(Me, {}) : /* @__PURE__ */ a(Re, {})
637
+ }
638
+ ),
639
+ (D == null ? void 0 : D.userID) === l.root.personId ? /* @__PURE__ */ a(
640
+ "div",
641
+ {
642
+ className: `
643
+ univer-ml-1 univer-inline-flex univer-h-6 univer-w-6 univer-cursor-pointer
644
+ univer-items-center univer-justify-center univer-rounded-[3px]
645
+ univer-text-base
646
+ hover:univer-bg-gray-50
647
+ `,
648
+ onClick: Q,
649
+ children: /* @__PURE__ */ a(Ee, {})
650
+ }
651
+ ) : null
652
+ ] }) : null
653
+ ]
654
+ }
655
+ ),
656
+ /* @__PURE__ */ a(
657
+ "div",
658
+ {
659
+ ref: j,
660
+ className: "univer-max-h-[300px] univer-overflow-y-auto univer-overflow-x-hidden",
661
+ children: J.map(
662
+ (C) => /* @__PURE__ */ a(
663
+ Lt,
664
+ {
665
+ onClose: h,
666
+ unitId: n,
667
+ subUnitId: r,
668
+ item: C,
669
+ isRoot: C.id === (l == null ? void 0 : l.root.id),
670
+ editing: p === C.id,
671
+ resolved: l == null ? void 0 : l.root.resolved,
672
+ type: y,
673
+ onEditingChange: ($) => {
674
+ S($ ? C.id : "");
675
+ },
676
+ onReply: ($) => {
677
+ $ && requestAnimationFrame(() => {
678
+ var L;
679
+ (L = H.current) == null || L.reply(Ht([
680
+ {
681
+ type: "mention",
682
+ content: {
683
+ id: $.userID,
684
+ label: `@${$.name}`
685
+ }
686
+ },
687
+ {
688
+ type: "text",
689
+ content: " "
690
+ }
691
+ ]));
692
+ });
693
+ },
694
+ onAddComment: c,
695
+ onDeleteComment: v
696
+ },
697
+ C.id
698
+ )
699
+ )
700
+ }
701
+ ),
702
+ oe ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
703
+ je,
704
+ {
705
+ ref: H,
606
706
  type: y,
607
707
  unitId: n,
608
708
  subUnitId: r,
609
- onSave: async ({ text: x, attachments: o }) => {
610
- const k = {
611
- text: x,
612
- attachments: o,
613
- dT: nt(),
614
- id: et(),
709
+ onSave: async ({ text: C, attachments: $ }) => {
710
+ const L = {
711
+ text: C,
712
+ attachments: $,
713
+ dT: et(),
714
+ id: Qe(),
615
715
  ref: i,
616
- personId: b == null ? void 0 : b.userID,
617
- parentId: s == null ? void 0 : s.root.id,
716
+ personId: D == null ? void 0 : D.userID,
717
+ parentId: l == null ? void 0 : l.root.id,
618
718
  unitId: n,
619
719
  subUnitId: r,
620
- threadId: s == null ? void 0 : s.root.threadId
720
+ threadId: l == null ? void 0 : l.root.threadId
621
721
  };
622
- (m == null ? void 0 : m(k)) !== !1 && (await h.executeCommand(
623
- rt.id,
722
+ (c == null ? void 0 : c(L)) !== !1 && (await _.executeCommand(
723
+ tt.id,
624
724
  {
625
725
  unitId: n,
626
726
  subUnitId: r,
627
- comment: k
727
+ comment: L
628
728
  }
629
- ), D.current && (D.current.scrollTop = D.current.scrollHeight));
729
+ ), j.current && (j.current.scrollTop = j.current.scrollHeight));
630
730
  },
631
- autoFocus: w || !s,
731
+ autoFocus: P || !l,
632
732
  onCancel: () => {
633
- s || g == null || g();
733
+ l || h == null || h();
634
734
  }
635
735
  },
636
- `${w}`
736
+ `${P}`
637
737
  ) }) : null
638
738
  ]
639
739
  }
640
740
  );
641
- }, an = "univer-thread-comment-panel", sn = "univer-thread-comment-panel-forms", ln = "univer-thread-comment-panel-empty", dn = "univer-thread-comment-panel-add", cn = "univer-thread-comment-panel-solved", te = {
642
- threadCommentPanel: an,
643
- threadCommentPanelForms: sn,
644
- threadCommentPanelEmpty: ln,
645
- threadCommentPanelAdd: dn,
646
- threadCommentPanelSolved: cn
647
- }, bn = (t) => {
741
+ }, Yt = (t) => {
648
742
  const {
649
743
  unitId: e,
650
744
  subUnitId$: n,
651
745
  type: r,
652
746
  onAdd: i,
653
- getSubUnitName: a,
747
+ getSubUnitName: o,
654
748
  onResolve: d,
655
- sortComments: v,
656
- onItemLeave: g,
657
- onItemEnter: T,
749
+ sortComments: f,
750
+ onItemLeave: h,
751
+ onItemEnter: w,
658
752
  disableAdd: O,
659
- tempComment: w,
660
- onAddComment: P,
661
- onDeleteComment: U,
662
- showComments: m
663
- } = t, [f, $] = V("all"), [y, M] = V("all"), I = N(fe), R = N(pe), c = N(Ue), [u, p] = V(() => c.getUnit(e)), s = N(Y), h = W(s.activeCommentId$), K = W(c.commentUpdate$), _ = N(ie), b = W(n), G = re(!0), oe = "panel", D = W(R.currentUser$), q = ne(() => {
664
- var de;
665
- const o = f === "all" ? u : (de = u.filter((E) => E.subUnitId === b)) != null ? de : [], k = v != null ? v : (E) => E, le = o.map((E) => {
666
- var A;
667
- return { ...E.root, children: (A = E.children) != null ? A : [], users: E.relativeUsers };
753
+ tempComment: P,
754
+ onAddComment: T,
755
+ onDeleteComment: b,
756
+ showComments: c
757
+ } = 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$), l = G(u.commentUpdate$), _ = N(ne), W = G(n), k = te(!0), D = "panel", H = G(R.currentUser$), J = ee(() => {
758
+ var L;
759
+ const s = v === "all" ? m : (L = m.filter((U) => U.subUnitId === W)) != null ? L : [], C = f != null ? f : (U) => U, $ = s.map((U) => {
760
+ var F;
761
+ return { ...U.root, children: (F = U.children) != null ? F : [], users: U.relativeUsers };
668
762
  });
669
- if (m) {
670
- const E = /* @__PURE__ */ new Map();
671
- return le.forEach((A) => {
672
- E.set(A.id, A);
673
- }), [...m, ""].map((A) => E.get(A)).filter(Boolean);
763
+ if (c) {
764
+ const U = /* @__PURE__ */ new Map();
765
+ return $.forEach((F) => {
766
+ U.set(F.id, F);
767
+ }), [...c, ""].map((F) => U.get(F)).filter(Boolean);
674
768
  } else
675
- return k(le);
676
- }, [m, f, u, v, b]), L = ne(() => [
677
- ...q.filter((o) => !o.resolved),
678
- ...q.filter((o) => o.resolved)
679
- ], [q]), J = ne(() => y === "resolved" ? L.filter((o) => o.resolved) : y === "unsolved" ? L.filter((o) => !o.resolved) : y === "concern_me" && D != null && D.userID ? L.filter((o) => o == null ? void 0 : o.users.has(D.userID)) : L, [L, D == null ? void 0 : D.userID, y]), Q = w ? [w, ...J] : J, ae = Q.filter((o) => !o.resolved), X = Q.filter((o) => o.resolved), ee = y !== "all" || f !== "all", se = () => {
680
- M("all"), $("all");
769
+ return C($);
770
+ }, [c, v, m, f, W]), j = ee(() => [
771
+ ...J.filter((s) => !s.resolved),
772
+ ...J.filter((s) => s.resolved)
773
+ ], [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), oe = Q.filter((s) => s.resolved), le = y !== "all" || v !== "all", ae = () => {
774
+ V("all"), E("all");
681
775
  };
682
- me(() => {
776
+ de(() => {
683
777
  e && p(
684
- c.getUnit(e)
778
+ u.getUnit(e)
685
779
  );
686
- }, [e, c, K]), me(() => {
687
- var E;
688
- if (!h)
780
+ }, [e, u, l]), de(() => {
781
+ var U;
782
+ if (!g)
689
783
  return;
690
- if (!G.current) {
691
- G.current = !0;
784
+ if (!k.current) {
785
+ k.current = !0;
692
786
  return;
693
787
  }
694
- const { unitId: o, subUnitId: k, commentId: le } = h, de = `${oe}-${o}-${k}-${le}`;
695
- (E = document.getElementById(de)) == null || E.scrollIntoView({ block: "center" });
696
- }, [h]);
697
- const x = (o) => /* @__PURE__ */ l(
698
- on,
788
+ const { unitId: s, subUnitId: C, commentId: $ } = g, L = `${D}-${s}-${C}-${$}`;
789
+ (U = document.getElementById(L)) == null || U.scrollIntoView({ block: "center" });
790
+ }, [g]);
791
+ const X = (s) => /* @__PURE__ */ a(
792
+ Pt,
699
793
  {
700
- prefix: oe,
701
- getSubUnitName: a,
702
- id: o.id,
703
- unitId: o.unitId,
704
- subUnitId: o.subUnitId,
705
- refStr: o.ref,
794
+ full: !0,
795
+ prefix: D,
796
+ getSubUnitName: o,
797
+ id: s.id,
798
+ unitId: s.unitId,
799
+ subUnitId: s.subUnitId,
800
+ refStr: s.ref,
706
801
  type: r,
707
- showEdit: (h == null ? void 0 : h.commentId) === o.id,
708
- showHighlight: (h == null ? void 0 : h.commentId) === o.id,
802
+ showEdit: (g == null ? void 0 : g.commentId) === s.id,
803
+ showHighlight: (g == null ? void 0 : g.commentId) === s.id,
709
804
  onClick: () => {
710
- G.current = !1, o.resolved ? _.executeCommand(F.id) : _.executeCommand(
711
- F.id,
805
+ k.current = !1, s.resolved ? _.executeCommand(K.id) : _.executeCommand(
806
+ K.id,
712
807
  {
713
- unitId: o.unitId,
714
- subUnitId: o.subUnitId,
715
- commentId: o.id,
808
+ unitId: s.unitId,
809
+ subUnitId: s.subUnitId,
810
+ commentId: s.id,
716
811
  temp: !1
717
812
  }
718
813
  );
719
814
  },
720
- onMouseEnter: () => T == null ? void 0 : T(o),
721
- onMouseLeave: () => g == null ? void 0 : g(o),
722
- onAddComment: P,
723
- onDeleteComment: U,
724
- onResolve: (k) => d == null ? void 0 : d(o.id, k)
815
+ onMouseEnter: () => w == null ? void 0 : w(s),
816
+ onMouseLeave: () => h == null ? void 0 : h(s),
817
+ onAddComment: T,
818
+ onDeleteComment: b,
819
+ onResolve: (C) => d == null ? void 0 : d(s.id, C)
725
820
  },
726
- o.id
821
+ s.id
727
822
  );
728
- return /* @__PURE__ */ S("div", { className: te.threadCommentPanel, children: [
729
- /* @__PURE__ */ S("div", { className: te.threadCommentPanelForms, children: [
730
- r === he.UNIVER_SHEET ? /* @__PURE__ */ l(
731
- be,
823
+ return /* @__PURE__ */ x("div", { className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3", children: [
824
+ /* @__PURE__ */ x("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between", children: [
825
+ r === ce.UNIVER_SHEET ? /* @__PURE__ */ a(
826
+ Ie,
732
827
  {
733
828
  borderless: !0,
734
- value: f,
735
- onChange: (o) => $(o),
829
+ value: v,
736
830
  options: [
737
831
  {
738
832
  value: "current",
@@ -742,15 +836,15 @@ const Le = j((t, e) => {
742
836
  value: "all",
743
837
  label: I.t("threadCommentUI.filter.sheet.all")
744
838
  }
745
- ]
839
+ ],
840
+ onChange: E
746
841
  }
747
842
  ) : null,
748
- /* @__PURE__ */ l(
749
- be,
843
+ /* @__PURE__ */ a(
844
+ Ie,
750
845
  {
751
846
  borderless: !0,
752
847
  value: y,
753
- onChange: (o) => M(o),
754
848
  options: [
755
849
  {
756
850
  value: "all",
@@ -768,45 +862,39 @@ const Le = j((t, e) => {
768
862
  value: "concern_me",
769
863
  label: I.t("threadCommentUI.filter.status.concernMe")
770
864
  }
771
- ]
865
+ ],
866
+ onChange: V
772
867
  }
773
868
  )
774
869
  ] }),
775
- ae.map(x),
776
- X.length ? /* @__PURE__ */ l("div", { className: te.threadCommentPanelSolved, children: "已解决" }) : null,
777
- X.map(x),
778
- Q.length ? null : /* @__PURE__ */ S("div", { className: te.threadCommentPanelEmpty, children: [
779
- ee ? I.t("threadCommentUI.panel.filterEmpty") : I.t("threadCommentUI.panel.empty"),
780
- ee ? /* @__PURE__ */ l(
781
- ce,
782
- {
783
- variant: "link",
784
- onClick: se,
785
- children: I.t("threadCommentUI.panel.reset")
786
- }
787
- ) : /* @__PURE__ */ S(
788
- ce,
789
- {
790
- id: "thread-comment-add",
791
- className: te.threadCommentPanelAdd,
792
- variant: "primary",
793
- onClick: i,
794
- disabled: O,
795
- children: [
796
- /* @__PURE__ */ l(He, {}),
797
- I.t("threadCommentUI.panel.addComment")
798
- ]
799
- }
800
- )
870
+ Q.length === 0 ? /* @__PURE__ */ x(
871
+ "div",
872
+ {
873
+ className: `
874
+ univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center
875
+ univer-text-[13px] univer-text-gray-600
876
+ `,
877
+ children: [
878
+ I.t("threadCommentUI.panel.empty"),
879
+ le ? /* @__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: [
880
+ /* @__PURE__ */ a(ke, { className: "univer-mr-1.5" }),
881
+ I.t("threadCommentUI.panel.add")
882
+ ] }) })
883
+ ]
884
+ }
885
+ ) : /* @__PURE__ */ x("div", { className: "univer-mt-3 univer-flex univer-flex-col univer-gap-3", children: [
886
+ ie.map(X),
887
+ oe.length > 0 && /* @__PURE__ */ a("div", { className: "univer-text-xs", children: I.t("threadCommentUI.panel.solved") }),
888
+ oe.map(X)
801
889
  ] })
802
890
  ] });
803
891
  };
804
892
  export {
805
- F as SetActiveCommentOperation,
893
+ K as SetActiveCommentOperation,
806
894
  gt as THREAD_COMMENT_PANEL,
807
- bn as ThreadCommentPanel,
808
- Y as ThreadCommentPanelService,
809
- on as ThreadCommentTree,
810
- bt as ToggleSheetCommentPanelOperation,
895
+ Yt as ThreadCommentPanel,
896
+ q as ThreadCommentPanelService,
897
+ Pt as ThreadCommentTree,
898
+ It as ToggleSheetCommentPanelOperation,
811
899
  ue as UniverThreadCommentUIPlugin
812
900
  };