@univerjs/thread-comment-ui 0.5.0 → 0.5.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.
package/lib/es/index.js CHANGED
@@ -1,30 +1,30 @@
1
- var Fe = Object.defineProperty;
2
- var We = (t, e, r) => e in t ? Fe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var B = (t, e, r) => We(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { Inject as Se, Disposable as ze, UniverInstanceType as he, IUniverInstanceService as Ze, CommandType as _e, DependentOn as Ge, Injector as qe, Plugin as Ke, mergeOverrideWithDependencies as Ye, ICommandService as re, IConfigService as Je, CustomRangeType as Qe, useDependency as x, IMentionIOService as Xe, LocaleService as fe, UserManagerService as pe, generateRandomId as et } from "@univerjs/core";
5
- import { UniverThreadCommentPlugin as tt, ThreadCommentModel as ye, getDT as nt, AddCommentCommand as rt, UpdateCommentCommand as ot, ResolveCommentCommand as it, DeleteCommentTreeCommand as je, DeleteCommentCommand as st } from "@univerjs/thread-comment";
6
- import { ISidebarService as Ne, useObservable as F } from "@univerjs/ui";
7
- import { BehaviorSubject as ge, filter as at, debounceTime as lt } from "rxjs";
8
- import dt, { forwardRef as A, useRef as ne, createElement as z, useState as k, useImperativeHandle as mt, useMemo as le, useEffect as Ce } from "react";
9
- import { Mentions as ct, Mention as ht, Button as de, Tooltip as ut, Dropdown as vt, Menu as Ct, MenuItem as Ie, Select as xe } from "@univerjs/design";
10
- import { DocSelectionManagerService as ft } from "@univerjs/docs";
11
- import { DocSelectionRenderService as pt } from "@univerjs/docs-ui";
12
- import { IRenderManagerService as gt } from "@univerjs/engine-render";
13
- var It = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, bt = (t, e, r, n) => {
14
- for (var o = n > 1 ? void 0 : n ? xt(e, r) : e, s = t.length - 1, d; s >= 0; s--)
15
- (d = t[s]) && (o = (n ? d(e, r, o) : d(o)) || o);
16
- return n && o && It(e, r, o), o;
17
- }, be = (t, e) => (r, n) => e(r, n, t);
18
- let q = class extends ze {
19
- constructor(e, r) {
1
+ var We = Object.defineProperty;
2
+ var ze = (t, e, n) => e in t ? We(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var B = (t, e, n) => ze(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { Inject as je, Disposable as qe, UniverInstanceType as he, IUniverInstanceService as Ze, CommandType as Ne, DependentOn as Je, Injector as Ge, Plugin as Ke, mergeOverrideWithDependencies as Ye, ICommandService as ie, IConfigService as Qe, CustomRangeType as Xe, useDependency as _, IMentionIOService as et, LocaleService as pe, UserManagerService as ge, generateRandomId as tt } from "@univerjs/core";
5
+ import { UniverThreadCommentPlugin as nt, ThreadCommentModel as Te, getDT as rt, AddCommentCommand as it, UpdateCommentCommand as ot, ResolveCommentCommand as st, DeleteCommentTreeCommand as Ee, DeleteCommentCommand as at } from "@univerjs/thread-comment";
6
+ import { ISidebarService as Oe, useObservable as F } from "@univerjs/ui";
7
+ import { BehaviorSubject as Ie, filter as lt, debounceTime as dt } from "rxjs";
8
+ import mt, { forwardRef as k, useRef as re, createElement as z, useState as A, useImperativeHandle as ct, useMemo as de, useEffect as fe } from "react";
9
+ import { Mentions as ut, Mention as ht, Button as me, Tooltip as vt, Dropdown as Ct, Menu as ft, MenuItem as xe, Select as be } from "@univerjs/design";
10
+ import { DocSelectionManagerService as pt } from "@univerjs/docs";
11
+ import { DocSelectionRenderService as gt } from "@univerjs/docs-ui";
12
+ import { IRenderManagerService as It } from "@univerjs/engine-render";
13
+ var xt = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, _t = (t, e, n, r) => {
14
+ for (var i = r > 1 ? void 0 : r ? bt(e, n) : e, s = t.length - 1, d; s >= 0; s--)
15
+ (d = t[s]) && (i = (r ? d(e, n, i) : d(i)) || i);
16
+ return r && i && xt(e, n, i), i;
17
+ }, _e = (t, e) => (n, r) => e(n, r, t);
18
+ let J = class extends qe {
19
+ constructor(e, n) {
20
20
  super();
21
21
  B(this, "_panelVisible", !1);
22
- B(this, "_panelVisible$", new ge(!1));
22
+ B(this, "_panelVisible$", new Ie(!1));
23
23
  B(this, "_activeCommentId");
24
- B(this, "_activeCommentId$", new ge(void 0));
24
+ B(this, "_activeCommentId$", new Ie(void 0));
25
25
  B(this, "panelVisible$", this._panelVisible$.asObservable());
26
26
  B(this, "activeCommentId$", this._activeCommentId$.asObservable());
27
- this._sidebarService = e, this._univerInstanceService = r, this._init(), this.disposeWithMe(() => {
27
+ this._sidebarService = e, this._univerInstanceService = n, this._init(), this.disposeWithMe(() => {
28
28
  this._activeCommentId$.complete(), this._panelVisible$.complete();
29
29
  });
30
30
  }
@@ -34,7 +34,7 @@ let q = class extends ze {
34
34
  e.visible || this.setPanelVisible(!1);
35
35
  })
36
36
  ), this.disposeWithMe(
37
- this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET).pipe(at((e) => !e)).subscribe(() => {
37
+ this._univerInstanceService.getCurrentTypeOfUnit$(he.UNIVER_SHEET).pipe(lt((e) => !e)).subscribe(() => {
38
38
  this._sidebarService.close();
39
39
  })
40
40
  );
@@ -52,59 +52,59 @@ let q = class extends ze {
52
52
  this._activeCommentId = e, this._activeCommentId$.next(e);
53
53
  }
54
54
  };
55
- q = bt([
56
- be(0, Se(Ne)),
57
- be(1, Ze)
58
- ], q);
59
- const St = "thread-comment-panel", _t = "UNIVER_THREAD_COMMENT_UI_PLUGIN", yt = {
55
+ J = _t([
56
+ _e(0, je(Oe)),
57
+ _e(1, Ze)
58
+ ], J);
59
+ const St = "thread-comment-panel", yt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", jt = {
60
60
  id: "thread-comment-ui.operation.toggle-panel",
61
- type: _e.OPERATION,
61
+ type: Ne.OPERATION,
62
62
  handler(t) {
63
- const e = t.get(Ne), r = t.get(q);
64
- return r.panelVisible ? (e.close(), r.setPanelVisible(!1)) : (e.open({
63
+ const e = t.get(Oe), n = t.get(J);
64
+ return n.panelVisible ? (e.close(), n.setPanelVisible(!1)) : (e.open({
65
65
  header: { title: "threadCommentUI.panel.title" },
66
66
  children: { label: St },
67
67
  width: 330
68
- }), r.setPanelVisible(!0)), !0;
68
+ }), n.setPanelVisible(!0)), !0;
69
69
  }
70
70
  }, W = {
71
71
  id: "thread-comment-ui.operation.set-active-comment",
72
- type: _e.OPERATION,
72
+ type: Ne.OPERATION,
73
73
  handler(t, e) {
74
- return t.get(q).setActiveComment(e), !0;
74
+ return t.get(J).setActiveComment(e), !0;
75
75
  }
76
- }, jt = "thread-comment-ui.config", Nt = {};
77
- var Te = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, Ot = (t, e, r) => e in t ? Te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ut = (t, e, r, n) => {
78
- for (var o = n > 1 ? void 0 : n ? Tt(e, r) : e, s = t.length - 1, d; s >= 0; s--)
79
- (d = t[s]) && (o = (n ? d(e, r, o) : d(o)) || o);
80
- return n && o && Te(e, r, o), o;
81
- }, ve = (t, e) => (r, n) => e(r, n, t), Oe = (t, e, r) => Ot(t, typeof e != "symbol" ? e + "" : e, r);
82
- let me = class extends Ke {
83
- constructor(t = Nt, e, r, n) {
84
- super(), this._config = t, this._injector = e, this._commandService = r, this._configService = n;
85
- const { menu: o, ...s } = this._config;
86
- o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(jt, s);
76
+ }, Nt = "thread-comment-ui.config", Tt = {};
77
+ var Ue = Object.defineProperty, Et = Object.getOwnPropertyDescriptor, Ot = (t, e, n) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ut = (t, e, n, r) => {
78
+ for (var i = r > 1 ? void 0 : r ? Et(e, n) : e, s = t.length - 1, d; s >= 0; s--)
79
+ (d = t[s]) && (i = (r ? d(e, n, i) : d(i)) || i);
80
+ return r && i && Ue(e, n, i), i;
81
+ }, ve = (t, e) => (n, r) => e(n, r, t), Pe = (t, e, n) => Ot(t, typeof e != "symbol" ? e + "" : e, n);
82
+ let ce = class extends Ke {
83
+ constructor(t = Tt, e, n, r) {
84
+ super(), this._config = t, this._injector = e, this._commandService = n, this._configService = r;
85
+ const { menu: i, ...s } = this._config;
86
+ i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Nt, s);
87
87
  }
88
88
  onStarting() {
89
89
  var t;
90
90
  Ye([
91
- [q]
91
+ [J]
92
92
  ], (t = this._config) == null ? void 0 : t.overrides).forEach((e) => {
93
93
  this._injector.add(e);
94
- }), [yt, W].forEach((e) => {
94
+ }), [jt, W].forEach((e) => {
95
95
  this._commandService.registerCommand(e);
96
96
  });
97
97
  }
98
98
  };
99
- Oe(me, "pluginName", _t);
100
- Oe(me, "type", he.UNIVER_UNKNOWN);
101
- me = Ut([
102
- Ge(tt),
103
- ve(1, Se(qe)),
104
- ve(2, re),
105
- ve(3, Je)
106
- ], me);
107
- var Ue = { exports: {} }, ue = {};
99
+ Pe(ce, "pluginName", yt);
100
+ Pe(ce, "type", he.UNIVER_UNKNOWN);
101
+ ce = Ut([
102
+ Je(nt),
103
+ ve(1, je(Ge)),
104
+ ve(2, ie),
105
+ ve(3, Qe)
106
+ ], ce);
107
+ var Ce = { exports: {} }, te = {};
108
108
  /**
109
109
  * @license React
110
110
  * react-jsx-runtime.production.min.js
@@ -114,190 +114,196 @@ var Ue = { exports: {} }, ue = {};
114
114
  * This source code is licensed under the MIT license found in the
115
115
  * LICENSE file in the root directory of this source tree.
116
116
  */
117
- var Et = dt, Pt = Symbol.for("react.element"), Mt = Symbol.for("react.fragment"), $t = Object.prototype.hasOwnProperty, wt = Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, Rt = { key: !0, ref: !0, __self: !0, __source: !0 };
118
- function Ee(t, e, r) {
119
- var n, o = {}, s = null, d = null;
120
- r !== void 0 && (s = "" + r), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (d = e.ref);
121
- for (n in e) $t.call(e, n) && !Rt.hasOwnProperty(n) && (o[n] = e[n]);
122
- if (t && t.defaultProps) for (n in e = t.defaultProps, e) o[n] === void 0 && (o[n] = e[n]);
123
- return { $$typeof: Pt, type: t, key: s, ref: d, props: o, _owner: wt.current };
117
+ var Se;
118
+ function Pt() {
119
+ if (Se) return te;
120
+ Se = 1;
121
+ var t = mt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
122
+ function d(u, m, y) {
123
+ var h, v = {}, C = null, b = null;
124
+ y !== void 0 && (C = "" + y), m.key !== void 0 && (C = "" + m.key), m.ref !== void 0 && (b = m.ref);
125
+ for (h in m) r.call(m, h) && !s.hasOwnProperty(h) && (v[h] = m[h]);
126
+ if (u && u.defaultProps) for (h in m = u.defaultProps, m) v[h] === void 0 && (v[h] = m[h]);
127
+ return { $$typeof: e, type: u, key: C, ref: b, props: v, _owner: i.current };
128
+ }
129
+ return te.Fragment = n, te.jsx = d, te.jsxs = d, te;
130
+ }
131
+ var ye;
132
+ function Rt() {
133
+ return ye || (ye = 1, Ce.exports = Pt()), Ce.exports;
124
134
  }
125
- ue.Fragment = Mt;
126
- ue.jsx = Ee;
127
- ue.jsxs = Ee;
128
- Ue.exports = ue;
129
- var i = Ue.exports, U = function() {
135
+ var o = Rt(), U = function() {
130
136
  return U = Object.assign || function(t) {
131
- for (var e, r = 1, n = arguments.length; r < n; r++) {
132
- e = arguments[r];
133
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
137
+ for (var e, n = 1, r = arguments.length; n < r; n++) {
138
+ e = arguments[n];
139
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
134
140
  }
135
141
  return t;
136
142
  }, U.apply(this, arguments);
137
- }, Ht = function(t, e) {
138
- var r = {};
139
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
143
+ }, Mt = function(t, e) {
144
+ var n = {};
145
+ for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
140
146
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
141
- for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
142
- e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
143
- return r;
144
- }, Z = A(function(t, e) {
145
- var r = t.icon, n = t.id, o = t.className, s = t.extend, d = Ht(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), v = ne("_".concat(At()));
146
- return Pe(r, "".concat(n), { defIds: r.defIds, idSuffix: v.current }, U({ ref: e, className: c }, d), s);
147
+ for (var i = 0, r = Object.getOwnPropertySymbols(t); i < r.length; i++)
148
+ e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
149
+ return n;
150
+ }, q = k(function(t, e) {
151
+ var n = t.icon, r = t.id, i = t.className, s = t.extend, d = Mt(t, ["icon", "id", "className", "extend"]), u = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), m = re("_".concat(Ht()));
152
+ return Re(n, "".concat(r), { defIds: n.defIds, idSuffix: m.current }, U({ ref: e, className: u }, d), s);
147
153
  });
148
- function Pe(t, e, r, n, o) {
149
- return z(t.tag, U(U({ key: e }, Dt(t, r, o)), n), (kt(t, r).children || []).map(function(s, d) {
150
- return Pe(s, "".concat(e, "-").concat(t.tag, "-").concat(d), r, void 0, o);
154
+ function Re(t, e, n, r, i) {
155
+ return z(t.tag, U(U({ key: e }, $t(t, n, i)), r), (wt(t, n).children || []).map(function(s, d) {
156
+ return Re(s, "".concat(e, "-").concat(t.tag, "-").concat(d), n, void 0, i);
151
157
  }));
152
158
  }
153
- function Dt(t, e, r) {
154
- var n = U({}, t.attrs);
155
- r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
156
- var o = e.defIds;
157
- return !o || o.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(s) {
158
- var d = s[0], c = s[1];
159
- typeof c == "string" && (n[d] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
160
- })), n;
159
+ function $t(t, e, n) {
160
+ var r = U({}, t.attrs);
161
+ n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
162
+ var i = e.defIds;
163
+ return !i || i.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(s) {
164
+ var d = s[0], u = s[1];
165
+ typeof u == "string" && (r[d] = u.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
166
+ })), r;
161
167
  }
162
- function kt(t, e) {
163
- var r, n = e.defIds;
164
- return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? U(U({}, t), { children: t.children.map(function(o) {
165
- return typeof o.attrs.id == "string" && n && n.indexOf(o.attrs.id) > -1 ? U(U({}, o), { attrs: U(U({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
168
+ function wt(t, e) {
169
+ var n, r = e.defIds;
170
+ return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? U(U({}, t), { children: t.children.map(function(i) {
171
+ return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? U(U({}, i), { attrs: U(U({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
166
172
  }) }) : t;
167
173
  }
168
- function At() {
174
+ function Ht() {
169
175
  return Math.random().toString(36).substring(2, 8);
170
176
  }
171
- Z.displayName = "UniverIcon";
172
- var Lt = { 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" } }] }, Me = A(function(t, e) {
173
- return z(Z, Object.assign({}, t, {
177
+ q.displayName = "UniverIcon";
178
+ var Dt = { 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" } }] }, Me = k(function(t, e) {
179
+ return z(q, Object.assign({}, t, {
174
180
  id: "delete-single",
175
181
  ref: e,
176
- icon: Lt
182
+ icon: Dt
177
183
  }));
178
184
  });
179
185
  Me.displayName = "DeleteSingle";
180
- var Vt = { 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" } }] }, $e = A(function(t, e) {
181
- return z(Z, Object.assign({}, t, {
186
+ var At = { 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" } }] }, $e = k(function(t, e) {
187
+ return z(q, Object.assign({}, t, {
182
188
  id: "increase-single",
183
189
  ref: e,
184
- icon: Vt
190
+ icon: At
185
191
  }));
186
192
  });
187
193
  $e.displayName = "IncreaseSingle";
188
- var Bt = { 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" } }] }, we = A(function(t, e) {
189
- return z(Z, Object.assign({}, t, {
194
+ 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" } }] }, we = k(function(t, e) {
195
+ return z(q, Object.assign({}, t, {
190
196
  id: "more-horizontal-single",
191
197
  ref: e,
192
- icon: Bt
198
+ icon: kt
193
199
  }));
194
200
  });
195
201
  we.displayName = "MoreHorizontalSingle";
196
- var Ft = { 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 } }] }, Re = A(function(t, e) {
197
- return z(Z, Object.assign({}, t, {
202
+ var Lt = { 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 } }] }, He = k(function(t, e) {
203
+ return z(q, Object.assign({}, t, {
198
204
  id: "reply-to-comment-single",
199
205
  ref: e,
200
- icon: Ft
206
+ icon: Lt
201
207
  }));
202
208
  });
203
- Re.displayName = "ReplyToCommentSingle";
204
- var Wt = { 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" } }] }, He = A(function(t, e) {
205
- return z(Z, Object.assign({}, t, {
209
+ He.displayName = "ReplyToCommentSingle";
210
+ var Vt = { 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" } }] }, De = k(function(t, e) {
211
+ return z(q, Object.assign({}, t, {
206
212
  id: "resolved-single",
207
213
  ref: e,
208
- icon: Wt
214
+ icon: Vt
209
215
  }));
210
216
  });
211
- He.displayName = "ResolvedSingle";
212
- var zt = { 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 } }] }, De = A(function(t, e) {
213
- return z(Z, Object.assign({}, t, {
217
+ De.displayName = "ResolvedSingle";
218
+ var Bt = { 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 } }] }, Ae = k(function(t, e) {
219
+ return z(q, Object.assign({}, t, {
214
220
  id: "solve-single",
215
221
  ref: e,
216
- icon: zt
222
+ icon: Bt
217
223
  }));
218
224
  });
219
- De.displayName = "SolveSingle";
225
+ Ae.displayName = "SolveSingle";
220
226
  function ke(t) {
221
- var e, r, n = "";
222
- if (typeof t == "string" || typeof t == "number") n += t;
227
+ var e, n, r = "";
228
+ if (typeof t == "string" || typeof t == "number") r += t;
223
229
  else if (typeof t == "object") if (Array.isArray(t)) {
224
- var o = t.length;
225
- for (e = 0; e < o; e++) t[e] && (r = ke(t[e])) && (n && (n += " "), n += r);
226
- } else for (r in t) t[r] && (n && (n += " "), n += r);
227
- return n;
230
+ var i = t.length;
231
+ for (e = 0; e < i; e++) t[e] && (n = ke(t[e])) && (r && (r += " "), r += n);
232
+ } else for (n in t) t[n] && (r && (r += " "), r += n);
233
+ return r;
228
234
  }
229
- function Zt() {
230
- for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = ke(t)) && (n && (n += " "), n += e);
231
- return n;
235
+ function Ft() {
236
+ for (var t, e, n = 0, r = "", i = arguments.length; n < i; n++) (t = arguments[n]) && (e = ke(t)) && (r && (r += " "), r += e);
237
+ return r;
232
238
  }
233
- const Gt = "univer-thread-comment-editor-buttons", qt = "univer-thread-comment-editor-suggestion", Kt = "univer-thread-comment-editor-suggestionActive", Yt = "univer-thread-comment-editor-suggestion-icon", ce = {
234
- threadCommentEditorButtons: Gt,
235
- threadCommentEditorSuggestion: qt,
236
- threadCommentEditorSuggestionActive: Kt,
237
- threadCommentEditorSuggestionIcon: Yt
239
+ const Wt = "univer-thread-comment-editor-buttons", zt = "univer-thread-comment-editor-suggestion", qt = "univer-thread-comment-editor-suggestionActive", Zt = "univer-thread-comment-editor-suggestion-icon", ue = {
240
+ threadCommentEditorButtons: Wt,
241
+ threadCommentEditorSuggestion: zt,
242
+ threadCommentEditorSuggestionActive: qt,
243
+ threadCommentEditorSuggestionIcon: Zt
238
244
  }, Jt = (t) => {
239
245
  const e = /@\[(.*?)\]\((.*?)\)|(\w+)/g;
240
- let r, n = 0;
241
- const o = [];
242
- for (; (r = e.exec(t)) !== null; )
243
- r.index > n && o.push({
246
+ let n, r = 0;
247
+ const i = [];
248
+ for (; (n = e.exec(t)) !== null; )
249
+ n.index > r && i.push({
244
250
  type: "text",
245
- content: t.substring(n, r.index)
246
- }), r[1] && r[2] ? o.push({
251
+ content: t.substring(r, n.index)
252
+ }), n[1] && n[2] ? i.push({
247
253
  type: "mention",
248
254
  content: {
249
- label: r[1],
250
- id: r[2]
255
+ label: n[1],
256
+ id: n[2]
251
257
  }
252
- }) : r[3] && o.push({
258
+ }) : n[3] && i.push({
253
259
  type: "text",
254
- content: r[3]
255
- }), n = e.lastIndex;
256
- return n < t.length && o.push({
260
+ content: n[3]
261
+ }), r = e.lastIndex;
262
+ return r < t.length && i.push({
257
263
  type: "text",
258
- content: t.substring(n)
259
- }), o;
260
- }, Qt = (t) => t.map((e) => {
264
+ content: t.substring(r)
265
+ }), i;
266
+ }, Gt = (t) => t.map((e) => {
261
267
  switch (e.type) {
262
268
  case "mention":
263
269
  return `@[${e.content.label}](${e.content.id})`;
264
270
  default:
265
271
  return e.content;
266
272
  }
267
- }).join(""), Ae = (t) => {
268
- const { dataStream: e, customRanges: r } = t, n = e.length - 2, o = [];
273
+ }).join(""), Le = (t) => {
274
+ const { dataStream: e, customRanges: n } = t, r = e.length - 2, i = [];
269
275
  let s = 0;
270
- return r == null || r.forEach((d) => {
271
- s < d.startIndex && o.push({
276
+ return n == null || n.forEach((d) => {
277
+ s < d.startIndex && i.push({
272
278
  type: "text",
273
279
  content: e.slice(s, d.startIndex)
274
- }), o.push({
280
+ }), i.push({
275
281
  type: "mention",
276
282
  content: {
277
283
  label: e.slice(d.startIndex, d.endIndex).slice(1, -1),
278
284
  id: d.rangeId
279
285
  }
280
286
  }), s = d.endIndex;
281
- }), o.push({
287
+ }), i.push({
282
288
  type: "text",
283
- content: e.slice(s, n)
284
- }), o;
285
- }, Le = (t) => {
289
+ content: e.slice(s, r)
290
+ }), i;
291
+ }, Ve = (t) => {
286
292
  let e = "";
287
- const r = [];
288
- return t.forEach((n) => {
289
- switch (n.type) {
293
+ const n = [];
294
+ return t.forEach((r) => {
295
+ switch (r.type) {
290
296
  case "text":
291
- e += n.content;
297
+ e += r.content;
292
298
  break;
293
299
  case "mention": {
294
- const o = e.length;
295
- e += `${n.content.label}`;
300
+ const i = e.length;
301
+ e += `${r.content.label}`;
296
302
  const s = e.length;
297
- r.push({
298
- rangeId: n.content.id,
299
- rangeType: Qe.MENTION,
300
- startIndex: o,
303
+ n.push({
304
+ rangeId: r.content.id,
305
+ rangeType: Xe.MENTION,
306
+ startIndex: i,
301
307
  endIndex: s,
302
308
  properties: {}
303
309
  });
@@ -319,406 +325,406 @@ const Gt = "univer-thread-comment-editor-buttons", qt = "univer-thread-comment-e
319
325
  }
320
326
  ],
321
327
  dataStream: e,
322
- customRanges: r
328
+ customRanges: n
323
329
  };
324
- }, Xt = (t, e, r, n, o) => {
325
- var d, c;
330
+ }, Kt = (t, e, n, r, i) => {
331
+ var d, u;
326
332
  const s = (d = t.raw) == null ? void 0 : d.icon;
327
- return /* @__PURE__ */ i.jsxs("div", { className: ce.threadCommentEditorSuggestion, children: [
328
- s ? /* @__PURE__ */ i.jsx("img", { className: ce.threadCommentEditorSuggestionIcon, src: s }) : null,
329
- /* @__PURE__ */ i.jsx("div", { children: (c = t.display) != null ? c : t.id })
333
+ return /* @__PURE__ */ o.jsxs("div", { className: ue.threadCommentEditorSuggestion, children: [
334
+ s ? /* @__PURE__ */ o.jsx("img", { className: ue.threadCommentEditorSuggestionIcon, src: s }) : null,
335
+ /* @__PURE__ */ o.jsx("div", { children: (u = t.display) != null ? u : t.id })
330
336
  ] });
331
- }, Ve = A((t, e) => {
332
- var R;
333
- const { comment: r, onSave: n, id: o, onCancel: s, autoFocus: d, unitId: c } = t, v = x(Xe), E = x(re), T = x(fe), [f, I] = k({ ...r }), [_, h] = k(!1), p = ne(null), P = x(ft), y = (R = x(gt).getCurrentTypeOfRenderer(he.UNIVER_DOC)) == null ? void 0 : R.with(pt);
334
- mt(e, () => ({
335
- reply(m) {
336
- var g;
337
- I({
338
- ...r,
339
- text: m,
337
+ }, Be = k((t, e) => {
338
+ var w;
339
+ const { comment: n, onSave: r, id: i, onCancel: s, autoFocus: d, unitId: u } = t, m = _(et), y = _(ie), h = _(pe), [v, C] = A({ ...n }), [b, f] = A(!1), I = re(null), P = _(pt), N = (w = _(It).getCurrentTypeOfRenderer(he.UNIVER_DOC)) == null ? void 0 : w.with(gt);
340
+ ct(e, () => ({
341
+ reply(c) {
342
+ var x;
343
+ C({
344
+ ...n,
345
+ text: c,
340
346
  attachments: []
341
- }), (g = p.current) == null || g.inputElement.focus();
347
+ }), (x = I.current) == null || x.inputElement.focus();
342
348
  }
343
349
  }));
344
- const C = () => {
345
- var m;
346
- f.text && (n == null || n({
347
- ...f,
348
- text: f.text
349
- }), h(!1), I({ text: void 0 }), (m = p.current) == null || m.inputElement.blur());
350
+ const g = () => {
351
+ var c;
352
+ v.text && (r == null || r({
353
+ ...v,
354
+ text: v.text
355
+ }), f(!1), C({ text: void 0 }), (c = I.current) == null || c.inputElement.blur());
350
356
  };
351
- return /* @__PURE__ */ i.jsxs("div", { className: ce.threadCommentEditor, onClick: (m) => m.preventDefault(), children: [
352
- /* @__PURE__ */ i.jsx(
353
- ct,
357
+ return /* @__PURE__ */ o.jsxs("div", { className: ue.threadCommentEditor, onClick: (c) => c.preventDefault(), children: [
358
+ /* @__PURE__ */ o.jsx(
359
+ ut,
354
360
  {
355
- ref: p,
361
+ ref: I,
356
362
  autoFocus: d,
357
363
  style: { width: "100%" },
358
- placeholder: T.t("threadCommentUI.editor.placeholder"),
359
- value: f != null && f.text ? Qt(Ae(f.text)) : "",
360
- onChange: (m) => {
361
- m.target.value || I({ ...r, text: void 0 }), I == null || I({ ...r, text: Le(Jt(m.target.value)) });
364
+ placeholder: h.t("threadCommentUI.editor.placeholder"),
365
+ value: v != null && v.text ? Gt(Le(v.text)) : "",
366
+ onChange: (c) => {
367
+ c.target.value || C({ ...n, text: void 0 }), C == null || C({ ...n, text: Ve(Jt(c.target.value)) });
362
368
  },
363
369
  onFocus: () => {
364
- const m = P.getActiveTextRange();
365
- m && m.collapsed && (y == null || y.removeAllRanges()), y == null || y.blur(), h(!0);
370
+ const c = P.getActiveTextRange();
371
+ c && c.collapsed && (N == null || N.removeAllRanges()), N == null || N.blur(), f(!0);
366
372
  },
367
- children: /* @__PURE__ */ i.jsx(
373
+ children: /* @__PURE__ */ o.jsx(
368
374
  ht,
369
375
  {
370
376
  trigger: "@",
371
- data: (m, g) => v.list({ search: m, unitId: c }).then((l) => l.list.map(
372
- (M) => M.mentions.map(
373
- (b) => ({
374
- id: b.objectId,
375
- display: b.label,
376
- raw: b
377
+ data: (c, x) => m.list({ search: c, unitId: u }).then((l) => l.list.map(
378
+ (R) => R.mentions.map(
379
+ (S) => ({
380
+ id: S.objectId,
381
+ display: S.label,
382
+ raw: S
377
383
  })
378
384
  )
379
- ).flat()).then(g),
380
- displayTransform: (m, g) => `@${g} `,
381
- renderSuggestion: Xt
385
+ ).flat()).then(x),
386
+ displayTransform: (c, x) => `@${x} `,
387
+ renderSuggestion: Kt
382
388
  },
383
389
  "@"
384
390
  )
385
391
  }
386
392
  ),
387
- _ ? /* @__PURE__ */ i.jsxs("div", { className: ce.threadCommentEditorButtons, children: [
388
- /* @__PURE__ */ i.jsx(
389
- de,
393
+ b ? /* @__PURE__ */ o.jsxs("div", { className: ue.threadCommentEditorButtons, children: [
394
+ /* @__PURE__ */ o.jsx(
395
+ me,
390
396
  {
391
397
  style: { marginRight: 12 },
392
398
  onClick: () => {
393
- s == null || s(), h(!1), I({ text: void 0 }), E.executeCommand(W.id);
399
+ s == null || s(), f(!1), C({ text: void 0 }), y.executeCommand(W.id);
394
400
  },
395
- children: T.t("threadCommentUI.editor.cancel")
401
+ children: h.t("threadCommentUI.editor.cancel")
396
402
  }
397
403
  ),
398
- /* @__PURE__ */ i.jsx(
399
- de,
404
+ /* @__PURE__ */ o.jsx(
405
+ me,
400
406
  {
401
407
  type: "primary",
402
- disabled: !f.text,
403
- onClick: C,
404
- children: T.t(o ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
408
+ disabled: !v.text,
409
+ onClick: g,
410
+ children: h.t(i ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
405
411
  }
406
412
  )
407
413
  ] }) : null
408
414
  ] });
409
- }), en = "univer-thread-comment", tn = "univer-thread-comment-active", nn = "univer-thread-comment-content", rn = "univer-thread-comment-highlight", on = "univer-thread-comment-icon-container", sn = "univer-thread-comment-icon", an = "univer-thread-comment-title", ln = "univer-thread-comment-title-position", dn = "univer-thread-comment-title-highlight", mn = "univer-thread-comment-title-position-text", cn = "univer-thread-comment-username", hn = "univer-thread-comment-item", un = "univer-thread-comment-item-head", vn = "univer-thread-comment-item-title", Cn = "univer-thread-comment-item-title-position", fn = "univer-thread-comment-item-title-highlight", pn = "univer-thread-comment-item-time", gn = "univer-thread-comment-item-content", In = "univer-thread-comment-item-at", u = {
410
- threadComment: en,
411
- threadCommentActive: tn,
412
- threadCommentContent: nn,
413
- threadCommentHighlight: rn,
414
- threadCommentIconContainer: on,
415
- threadCommentIcon: sn,
416
- threadCommentTitle: an,
417
- threadCommentTitlePosition: ln,
418
- threadCommentTitleHighlight: dn,
419
- threadCommentTitlePositionText: mn,
420
- threadCommentUsername: cn,
421
- threadCommentItem: hn,
422
- threadCommentItemHead: un,
423
- threadCommentItemTitle: vn,
424
- threadCommentItemTitlePosition: Cn,
425
- threadCommentItemTitleHighlight: fn,
426
- threadCommentItemTime: pn,
427
- threadCommentItemContent: gn,
428
- threadCommentItemAt: In
429
- }, Be = "__mock__", xn = (t) => {
430
- const { item: e, unitId: r, subUnitId: n, editing: o, onEditingChange: s, onReply: d, resolved: c, isRoot: v, onClose: E, onDeleteComment: T } = t, f = x(re), I = x(fe), _ = x(pe), h = _.getUser(e.personId), p = F(_.currentUser$), P = (p == null ? void 0 : p.userID) === e.personId, S = e.id === Be, [y, C] = k(!1), R = () => {
431
- (T == null ? void 0 : T(e)) !== !1 && (f.executeCommand(
432
- v ? je.id : st.id,
415
+ }), Yt = "univer-thread-comment", Qt = "univer-thread-comment-active", Xt = "univer-thread-comment-content", en = "univer-thread-comment-highlight", tn = "univer-thread-comment-icon-container", nn = "univer-thread-comment-icon", rn = "univer-thread-comment-title", on = "univer-thread-comment-title-position", sn = "univer-thread-comment-title-highlight", an = "univer-thread-comment-title-position-text", ln = "univer-thread-comment-username", dn = "univer-thread-comment-item", mn = "univer-thread-comment-item-head", cn = "univer-thread-comment-item-title", un = "univer-thread-comment-item-title-position", hn = "univer-thread-comment-item-title-highlight", vn = "univer-thread-comment-item-time", Cn = "univer-thread-comment-item-content", fn = "univer-thread-comment-item-at", p = {
416
+ threadComment: Yt,
417
+ threadCommentActive: Qt,
418
+ threadCommentContent: Xt,
419
+ threadCommentHighlight: en,
420
+ threadCommentIconContainer: tn,
421
+ threadCommentIcon: nn,
422
+ threadCommentTitle: rn,
423
+ threadCommentTitlePosition: on,
424
+ threadCommentTitleHighlight: sn,
425
+ threadCommentTitlePositionText: an,
426
+ threadCommentUsername: ln,
427
+ threadCommentItem: dn,
428
+ threadCommentItemHead: mn,
429
+ threadCommentItemTitle: cn,
430
+ threadCommentItemTitlePosition: un,
431
+ threadCommentItemTitleHighlight: hn,
432
+ threadCommentItemTime: vn,
433
+ threadCommentItemContent: Cn,
434
+ threadCommentItemAt: fn
435
+ }, Fe = "__mock__", pn = (t) => {
436
+ const { item: e, unitId: n, subUnitId: r, editing: i, onEditingChange: s, onReply: d, resolved: u, isRoot: m, onClose: y, onDeleteComment: h } = t, v = _(ie), C = _(pe), b = _(ge), f = b.getUser(e.personId), I = F(b.currentUser$), P = (I == null ? void 0 : I.userID) === e.personId, j = e.id === Fe, [N, g] = A(!1), w = () => {
437
+ (h == null ? void 0 : h(e)) !== !1 && (v.executeCommand(
438
+ m ? Ee.id : at.id,
433
439
  {
434
- unitId: r,
435
- subUnitId: n,
440
+ unitId: n,
441
+ subUnitId: r,
436
442
  commentId: e.id
437
443
  }
438
- ), v && (E == null || E()));
444
+ ), m && (y == null || y()));
439
445
  };
440
- return /* @__PURE__ */ i.jsxs("div", { className: u.threadCommentItem, onMouseLeave: () => C(!1), onMouseEnter: () => C(!0), children: [
441
- /* @__PURE__ */ i.jsx("img", { className: u.threadCommentItemHead, src: h == null ? void 0 : h.avatar }),
442
- /* @__PURE__ */ i.jsxs("div", { className: u.threadCommentItemTitle, children: [
443
- /* @__PURE__ */ i.jsx("div", { className: u.threadCommentUsername, children: (h == null ? void 0 : h.name) || " " }),
444
- /* @__PURE__ */ i.jsxs("div", { children: [
445
- S || c ? null : y ? /* @__PURE__ */ i.jsx("div", { className: u.threadCommentIcon, onClick: () => d(h), children: /* @__PURE__ */ i.jsx(Re, {}) }) : null,
446
- P && !S && !c ? /* @__PURE__ */ i.jsx(
447
- vt,
446
+ return /* @__PURE__ */ o.jsxs("div", { className: p.threadCommentItem, onMouseLeave: () => g(!1), onMouseEnter: () => g(!0), children: [
447
+ /* @__PURE__ */ o.jsx("img", { className: p.threadCommentItemHead, src: f == null ? void 0 : f.avatar }),
448
+ /* @__PURE__ */ o.jsxs("div", { className: p.threadCommentItemTitle, children: [
449
+ /* @__PURE__ */ o.jsx("div", { className: p.threadCommentUsername, children: (f == null ? void 0 : f.name) || " " }),
450
+ /* @__PURE__ */ o.jsxs("div", { children: [
451
+ j || u ? null : N ? /* @__PURE__ */ o.jsx("div", { className: p.threadCommentIcon, onClick: () => d(f), children: /* @__PURE__ */ o.jsx(He, {}) }) : null,
452
+ P && !j && !u ? /* @__PURE__ */ o.jsx(
453
+ Ct,
448
454
  {
449
- overlay: /* @__PURE__ */ i.jsxs(Ct, { children: [
450
- /* @__PURE__ */ i.jsx(Ie, { onClick: () => s == null ? void 0 : s(!0), children: I.t("threadCommentUI.item.edit") }, "edit"),
451
- /* @__PURE__ */ i.jsx(Ie, { onClick: R, children: I.t("threadCommentUI.item.delete") }, "delete")
455
+ overlay: /* @__PURE__ */ o.jsxs(ft, { children: [
456
+ /* @__PURE__ */ o.jsx(xe, { onClick: () => s == null ? void 0 : s(!0), children: C.t("threadCommentUI.item.edit") }, "edit"),
457
+ /* @__PURE__ */ o.jsx(xe, { onClick: w, children: C.t("threadCommentUI.item.delete") }, "delete")
452
458
  ] }),
453
- children: /* @__PURE__ */ i.jsx("div", { className: u.threadCommentIcon, children: /* @__PURE__ */ i.jsx(we, {}) })
459
+ children: /* @__PURE__ */ o.jsx("div", { className: p.threadCommentIcon, children: /* @__PURE__ */ o.jsx(we, {}) })
454
460
  }
455
461
  ) : null
456
462
  ] })
457
463
  ] }),
458
- /* @__PURE__ */ i.jsx("div", { className: u.threadCommentItemTime, children: e.dT }),
459
- o ? /* @__PURE__ */ i.jsx(
460
- Ve,
464
+ /* @__PURE__ */ o.jsx("div", { className: p.threadCommentItemTime, children: e.dT }),
465
+ i ? /* @__PURE__ */ o.jsx(
466
+ Be,
461
467
  {
462
468
  id: e.id,
463
469
  comment: e,
464
470
  onCancel: () => s == null ? void 0 : s(!1),
465
471
  autoFocus: !0,
466
- unitId: r,
467
- subUnitId: n,
468
- onSave: ({ text: m, attachments: g }) => {
469
- s == null || s(!1), f.executeCommand(
472
+ unitId: n,
473
+ subUnitId: r,
474
+ onSave: ({ text: c, attachments: x }) => {
475
+ s == null || s(!1), v.executeCommand(
470
476
  ot.id,
471
477
  {
472
- unitId: r,
473
- subUnitId: n,
478
+ unitId: n,
479
+ subUnitId: r,
474
480
  payload: {
475
481
  commentId: e.id,
476
- text: m,
477
- attachments: g
482
+ text: c,
483
+ attachments: x
478
484
  }
479
485
  }
480
486
  );
481
487
  }
482
488
  }
483
- ) : /* @__PURE__ */ i.jsx("div", { className: u.threadCommentItemContent, children: Ae(e.text).map((m, g) => {
484
- switch (m.type) {
489
+ ) : /* @__PURE__ */ o.jsx("div", { className: p.threadCommentItemContent, children: Le(e.text).map((c, x) => {
490
+ switch (c.type) {
485
491
  case "mention":
486
- return /* @__PURE__ */ i.jsxs("a", { className: u.threadCommentItemAt, children: [
492
+ return /* @__PURE__ */ o.jsxs("a", { className: p.threadCommentItemAt, children: [
487
493
  "@",
488
- m.content.label,
494
+ c.content.label,
489
495
  " "
490
- ] }, g);
496
+ ] }, x);
491
497
  default:
492
- return m.content;
498
+ return c.content;
493
499
  }
494
500
  }) })
495
501
  ] });
496
- }, bn = (t) => {
497
- var ie, Q, X;
502
+ }, gn = (t) => {
503
+ var se, Q, X;
498
504
  const {
499
505
  id: e,
500
- unitId: r,
501
- subUnitId: n,
502
- refStr: o,
506
+ unitId: n,
507
+ subUnitId: r,
508
+ refStr: i,
503
509
  showEdit: s = !0,
504
510
  onClick: d,
505
- showHighlight: c,
506
- onClose: v,
507
- getSubUnitName: E,
508
- prefix: T,
509
- autoFocus: f,
510
- onMouseEnter: I,
511
- onMouseLeave: _,
512
- onAddComment: h,
513
- onDeleteComment: p,
511
+ showHighlight: u,
512
+ onClose: m,
513
+ getSubUnitName: y,
514
+ prefix: h,
515
+ autoFocus: v,
516
+ onMouseEnter: C,
517
+ onMouseLeave: b,
518
+ onAddComment: f,
519
+ onDeleteComment: I,
514
520
  onResolve: P
515
- } = t, S = x(ye), [y, C] = k(!1), [R, m] = k(""), g = le(() => S.commentUpdate$.pipe(lt(16)), [S]);
516
- F(g);
517
- const l = e ? S.getCommentWithChildren(r, n, e) : null, M = x(re), b = x(pe), $ = l == null ? void 0 : l.root.resolved, O = F(b.currentUser$), K = ne(null), Y = [
521
+ } = t, j = _(Te), [N, g] = A(!1), [w, c] = A(""), x = de(() => j.commentUpdate$.pipe(dt(16)), [j]);
522
+ F(x);
523
+ const l = e ? j.getCommentWithChildren(n, r, e) : null, R = _(ie), S = _(ge), M = l == null ? void 0 : l.root.resolved, O = F(S.currentUser$), G = re(null), K = [
518
524
  ...l ? [l.root] : (
519
525
  // mock empty comment
520
526
  [{
521
- id: Be,
527
+ id: Fe,
522
528
  text: {
523
529
  dataStream: `
524
530
  \r`
525
531
  },
526
- personId: (ie = O == null ? void 0 : O.userID) != null ? ie : "",
527
- ref: o != null ? o : "",
532
+ personId: (se = O == null ? void 0 : O.userID) != null ? se : "",
533
+ ref: i != null ? i : "",
528
534
  dT: "",
529
- unitId: r,
530
- subUnitId: n,
535
+ unitId: n,
536
+ subUnitId: r,
531
537
  threadId: ""
532
538
  }]
533
539
  ),
534
540
  ...(Q = l == null ? void 0 : l.children) != null ? Q : []
535
- ], L = ne(null), H = (j) => {
536
- j.stopPropagation(), $ ? M.executeCommand(W.id, {
537
- unitId: r,
538
- subUnitId: n,
541
+ ], L = re(null), H = (T) => {
542
+ T.stopPropagation(), M ? R.executeCommand(W.id, {
543
+ unitId: n,
544
+ subUnitId: r,
539
545
  commentId: e
540
- }) : M.executeCommand(W.id), M.executeCommand(it.id, {
541
- unitId: r,
542
- subUnitId: n,
546
+ }) : R.executeCommand(W.id), R.executeCommand(st.id, {
547
+ unitId: n,
548
+ subUnitId: r,
543
549
  commentId: e,
544
- resolved: !$
545
- }), P == null || P(!$);
546
- }, J = (j) => {
547
- j.stopPropagation(), M.executeCommand(W.id), !(l != null && l.root && (p == null ? void 0 : p(l.root)) === !1) && (M.executeCommand(
548
- je.id,
550
+ resolved: !M
551
+ }), P == null || P(!M);
552
+ }, Y = (T) => {
553
+ T.stopPropagation(), R.executeCommand(W.id), !(l != null && l.root && (I == null ? void 0 : I(l.root)) === !1) && (R.executeCommand(
554
+ Ee.id,
549
555
  {
550
- unitId: r,
551
- subUnitId: n,
556
+ unitId: n,
557
+ subUnitId: r,
552
558
  commentId: e
553
559
  }
554
- ), v == null || v());
560
+ ), m == null || m());
555
561
  };
556
- Ce(() => _ == null ? void 0 : _(), []);
557
- const D = E((X = l == null ? void 0 : l.root.subUnitId) != null ? X : n), oe = s && !R && !$, G = `${o || (l == null ? void 0 : l.root.ref) || ""}${D ? " · " : ""}${D}`;
558
- return /* @__PURE__ */ i.jsxs(
562
+ fe(() => b == null ? void 0 : b(), []);
563
+ const D = y((X = l == null ? void 0 : l.root.subUnitId) != null ? X : r), oe = s && !w && !M, Z = `${i || (l == null ? void 0 : l.root.ref) || ""}${D ? " · " : ""}${D}`;
564
+ return /* @__PURE__ */ o.jsxs(
559
565
  "div",
560
566
  {
561
- className: Zt(u.threadComment, {
562
- [u.threadCommentActive]: !$ && (c || y || T === "cell")
567
+ className: Ft(p.threadComment, {
568
+ [p.threadCommentActive]: !M && (u || N || h === "cell")
563
569
  }),
564
570
  onClick: d,
565
- id: `${T}-${r}-${n}-${e}`,
571
+ id: `${h}-${n}-${r}-${e}`,
566
572
  onMouseEnter: () => {
567
- I == null || I(), C(!0);
573
+ C == null || C(), g(!0);
568
574
  },
569
575
  onMouseLeave: () => {
570
- _ == null || _(), C(!1);
576
+ b == null || b(), g(!1);
571
577
  },
572
578
  children: [
573
- !$ && c ? /* @__PURE__ */ i.jsx("div", { className: u.threadCommentHighlight }) : null,
574
- /* @__PURE__ */ i.jsxs("div", { className: u.threadCommentTitle, children: [
575
- /* @__PURE__ */ i.jsxs("div", { className: u.threadCommentTitlePosition, children: [
576
- /* @__PURE__ */ i.jsx("div", { className: u.threadCommentTitleHighlight }),
577
- /* @__PURE__ */ i.jsx(ut, { showIfEllipsis: !0, title: G, children: /* @__PURE__ */ i.jsx("div", { className: u.threadCommentTitlePositionText, children: G }) })
579
+ !M && u ? /* @__PURE__ */ o.jsx("div", { className: p.threadCommentHighlight }) : null,
580
+ /* @__PURE__ */ o.jsxs("div", { className: p.threadCommentTitle, children: [
581
+ /* @__PURE__ */ o.jsxs("div", { className: p.threadCommentTitlePosition, children: [
582
+ /* @__PURE__ */ o.jsx("div", { className: p.threadCommentTitleHighlight }),
583
+ /* @__PURE__ */ o.jsx(vt, { showIfEllipsis: !0, title: Z, children: /* @__PURE__ */ o.jsx("div", { className: p.threadCommentTitlePositionText, children: Z }) })
578
584
  ] }),
579
- l ? /* @__PURE__ */ i.jsxs("div", { className: u.threadCommentIconContainer, children: [
580
- /* @__PURE__ */ i.jsx(
585
+ l ? /* @__PURE__ */ o.jsxs("div", { className: p.threadCommentIconContainer, children: [
586
+ /* @__PURE__ */ o.jsx(
581
587
  "div",
582
588
  {
583
589
  onClick: H,
584
- className: u.threadCommentIcon,
585
- style: { color: $ ? "rgb(var(--green-500))" : "" },
586
- children: $ ? /* @__PURE__ */ i.jsx(He, {}) : /* @__PURE__ */ i.jsx(De, {})
590
+ className: p.threadCommentIcon,
591
+ style: { color: M ? "rgb(var(--green-500))" : "" },
592
+ children: M ? /* @__PURE__ */ o.jsx(De, {}) : /* @__PURE__ */ o.jsx(Ae, {})
587
593
  }
588
594
  ),
589
- (O == null ? void 0 : O.userID) === l.root.personId ? /* @__PURE__ */ i.jsx("div", { className: u.threadCommentIcon, onClick: J, children: /* @__PURE__ */ i.jsx(Me, {}) }) : null
595
+ (O == null ? void 0 : O.userID) === l.root.personId ? /* @__PURE__ */ o.jsx("div", { className: p.threadCommentIcon, onClick: Y, children: /* @__PURE__ */ o.jsx(Me, {}) }) : null
590
596
  ] }) : null
591
597
  ] }),
592
- /* @__PURE__ */ i.jsx("div", { className: u.threadCommentContent, ref: L, children: Y.map(
593
- (j) => /* @__PURE__ */ i.jsx(
594
- xn,
598
+ /* @__PURE__ */ o.jsx("div", { className: p.threadCommentContent, ref: L, children: K.map(
599
+ (T) => /* @__PURE__ */ o.jsx(
600
+ pn,
595
601
  {
596
- onClose: v,
597
- unitId: r,
598
- subUnitId: n,
599
- item: j,
600
- isRoot: j.id === (l == null ? void 0 : l.root.id),
601
- editing: R === j.id,
602
+ onClose: m,
603
+ unitId: n,
604
+ subUnitId: r,
605
+ item: T,
606
+ isRoot: T.id === (l == null ? void 0 : l.root.id),
607
+ editing: w === T.id,
602
608
  resolved: l == null ? void 0 : l.root.resolved,
603
- onEditingChange: (w) => {
604
- m(w ? j.id : "");
609
+ onEditingChange: ($) => {
610
+ c($ ? T.id : "");
605
611
  },
606
- onReply: (w) => {
607
- w && requestAnimationFrame(() => {
612
+ onReply: ($) => {
613
+ $ && requestAnimationFrame(() => {
608
614
  var a;
609
- (a = K.current) == null || a.reply(Le([{
615
+ (a = G.current) == null || a.reply(Ve([{
610
616
  type: "mention",
611
617
  content: {
612
- id: w.userID,
613
- label: w.name
618
+ id: $.userID,
619
+ label: $.name
614
620
  }
615
621
  }]));
616
622
  });
617
623
  },
618
- onAddComment: h,
619
- onDeleteComment: p
624
+ onAddComment: f,
625
+ onDeleteComment: I
620
626
  },
621
- j.id
627
+ T.id
622
628
  )
623
629
  ) }),
624
- oe ? /* @__PURE__ */ i.jsx("div", { children: /* @__PURE__ */ i.jsx(
625
- Ve,
630
+ oe ? /* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx(
631
+ Be,
626
632
  {
627
- ref: K,
628
- unitId: r,
629
- subUnitId: n,
630
- onSave: async ({ text: j, attachments: w }) => {
633
+ ref: G,
634
+ unitId: n,
635
+ subUnitId: r,
636
+ onSave: async ({ text: T, attachments: $ }) => {
631
637
  const a = {
632
- text: j,
633
- attachments: w,
634
- dT: nt(),
635
- id: et(),
636
- ref: o,
638
+ text: T,
639
+ attachments: $,
640
+ dT: rt(),
641
+ id: tt(),
642
+ ref: i,
637
643
  personId: O == null ? void 0 : O.userID,
638
644
  parentId: l == null ? void 0 : l.root.id,
639
- unitId: r,
640
- subUnitId: n,
645
+ unitId: n,
646
+ subUnitId: r,
641
647
  threadId: l == null ? void 0 : l.root.threadId
642
648
  };
643
- (h == null ? void 0 : h(a)) !== !1 && (await M.executeCommand(
644
- rt.id,
649
+ (f == null ? void 0 : f(a)) !== !1 && (await R.executeCommand(
650
+ it.id,
645
651
  {
646
- unitId: r,
647
- subUnitId: n,
652
+ unitId: n,
653
+ subUnitId: r,
648
654
  comment: a
649
655
  }
650
656
  ), L.current && (L.current.scrollTop = L.current.scrollHeight));
651
657
  },
652
- autoFocus: f || !l,
658
+ autoFocus: v || !l,
653
659
  onCancel: () => {
654
- l || v == null || v();
660
+ l || m == null || m();
655
661
  }
656
662
  },
657
- `${f}`
663
+ `${v}`
658
664
  ) }) : null
659
665
  ]
660
666
  }
661
667
  );
662
- }, Sn = "univer-thread-comment-panel", _n = "univer-thread-comment", yn = "univer-thread-comment-panel-forms", jn = "univer-select", Nn = "univer-thread-comment-panel-empty", Tn = "univer-thread-comment-panel-add", On = "univer-thread-comment-panel-solved", te = {
663
- threadCommentPanel: Sn,
664
- threadComment: _n,
665
- threadCommentPanelForms: yn,
666
- select: jn,
667
- threadCommentPanelEmpty: Nn,
668
- threadCommentPanelAdd: Tn,
669
- threadCommentPanelSolved: On
670
- }, An = (t) => {
668
+ }, In = "univer-thread-comment-panel", xn = "univer-thread-comment", bn = "univer-thread-comment-panel-forms", _n = "univer-select", Sn = "univer-thread-comment-panel-empty", yn = "univer-thread-comment-panel-add", jn = "univer-thread-comment-panel-solved", ne = {
669
+ threadCommentPanel: In,
670
+ threadComment: xn,
671
+ threadCommentPanelForms: bn,
672
+ select: _n,
673
+ threadCommentPanelEmpty: Sn,
674
+ threadCommentPanelAdd: yn,
675
+ threadCommentPanelSolved: jn
676
+ }, Hn = (t) => {
671
677
  const {
672
678
  unitId: e,
673
- subUnitId$: r,
674
- type: n,
675
- onAdd: o,
679
+ subUnitId$: n,
680
+ type: r,
681
+ onAdd: i,
676
682
  getSubUnitName: s,
677
683
  onResolve: d,
678
- sortComments: c,
679
- onItemLeave: v,
680
- onItemEnter: E,
681
- disableAdd: T,
682
- tempComment: f,
683
- onAddComment: I,
684
- onDeleteComment: _,
685
- showComments: h
686
- } = t, [p, P] = k("all"), [S, y] = k("all"), C = x(fe), R = x(pe), m = x(ye), [g, l] = k(() => m.getUnit(e)), M = x(q), b = F(M.activeCommentId$), $ = F(m.commentUpdate$), O = x(re), K = F(r), Y = ne(!0), L = "panel", H = F(R.currentUser$), J = le(() => {
687
- var ae;
688
- const a = p === "all" ? g : (ae = g.filter((N) => N.subUnitId === K)) != null ? ae : [], ee = c != null ? c : (N) => N, se = a.map((N) => {
684
+ sortComments: u,
685
+ onItemLeave: m,
686
+ onItemEnter: y,
687
+ disableAdd: h,
688
+ tempComment: v,
689
+ onAddComment: C,
690
+ onDeleteComment: b,
691
+ showComments: f
692
+ } = t, [I, P] = A("all"), [j, N] = A("all"), g = _(pe), w = _(ge), c = _(Te), [x, l] = A(() => c.getUnit(e)), R = _(J), S = F(R.activeCommentId$), M = F(c.commentUpdate$), O = _(ie), G = F(n), K = re(!0), L = "panel", H = F(w.currentUser$), Y = de(() => {
693
+ var le;
694
+ const a = I === "all" ? x : (le = x.filter((E) => E.subUnitId === G)) != null ? le : [], ee = u != null ? u : (E) => E, ae = a.map((E) => {
689
695
  var V;
690
- return { ...N.root, children: (V = N.children) != null ? V : [], users: N.relativeUsers };
696
+ return { ...E.root, children: (V = E.children) != null ? V : [], users: E.relativeUsers };
691
697
  });
692
- if (h) {
693
- const N = /* @__PURE__ */ new Map();
694
- return se.forEach((V) => {
695
- N.set(V.id, V);
696
- }), [...h, ""].map((V) => N.get(V)).filter(Boolean);
698
+ if (f) {
699
+ const E = /* @__PURE__ */ new Map();
700
+ return ae.forEach((V) => {
701
+ E.set(V.id, V);
702
+ }), [...f, ""].map((V) => E.get(V)).filter(Boolean);
697
703
  } else
698
- return ee(se);
699
- }, [h, p, g, c, K]), D = le(() => [
700
- ...J.filter((a) => !a.resolved),
701
- ...J.filter((a) => a.resolved)
702
- ], [J]), oe = le(() => S === "resolved" ? D.filter((a) => a.resolved) : S === "unsolved" ? D.filter((a) => !a.resolved) : S === "concern_me" && H != null && H.userID ? D.filter((a) => a == null ? void 0 : a.users.has(H.userID)) : D, [D, H == null ? void 0 : H.userID, S]), G = f ? [f, ...oe] : oe, ie = G.filter((a) => !a.resolved), Q = G.filter((a) => a.resolved), X = S !== "all" || p !== "all", j = () => {
703
- y("all"), P("all");
704
+ return ee(ae);
705
+ }, [f, I, x, u, G]), D = de(() => [
706
+ ...Y.filter((a) => !a.resolved),
707
+ ...Y.filter((a) => a.resolved)
708
+ ], [Y]), oe = de(() => j === "resolved" ? D.filter((a) => a.resolved) : j === "unsolved" ? D.filter((a) => !a.resolved) : j === "concern_me" && H != null && H.userID ? D.filter((a) => a == null ? void 0 : a.users.has(H.userID)) : D, [D, H == null ? void 0 : H.userID, j]), Z = v ? [v, ...oe] : oe, se = Z.filter((a) => !a.resolved), Q = Z.filter((a) => a.resolved), X = j !== "all" || I !== "all", T = () => {
709
+ N("all"), P("all");
704
710
  };
705
- Ce(() => {
711
+ fe(() => {
706
712
  e && l(
707
- m.getUnit(e)
713
+ c.getUnit(e)
708
714
  );
709
- }, [e, m, $]), Ce(() => {
710
- var N;
711
- if (!b)
715
+ }, [e, c, M]), fe(() => {
716
+ var E;
717
+ if (!S)
712
718
  return;
713
- if (!Y.current) {
714
- Y.current = !0;
719
+ if (!K.current) {
720
+ K.current = !0;
715
721
  return;
716
722
  }
717
- const { unitId: a, subUnitId: ee, commentId: se } = b, ae = `${L}-${a}-${ee}-${se}`;
718
- (N = document.getElementById(ae)) == null || N.scrollIntoView({ block: "center" });
719
- }, [b]);
720
- const w = (a) => /* @__PURE__ */ i.jsx(
721
- bn,
723
+ const { unitId: a, subUnitId: ee, commentId: ae } = S, le = `${L}-${a}-${ee}-${ae}`;
724
+ (E = document.getElementById(le)) == null || E.scrollIntoView({ block: "center" });
725
+ }, [S]);
726
+ const $ = (a) => /* @__PURE__ */ o.jsx(
727
+ gn,
722
728
  {
723
729
  prefix: L,
724
730
  getSubUnitName: s,
@@ -726,11 +732,11 @@ const Gt = "univer-thread-comment-editor-buttons", qt = "univer-thread-comment-e
726
732
  unitId: a.unitId,
727
733
  subUnitId: a.subUnitId,
728
734
  refStr: a.ref,
729
- type: n,
730
- showEdit: (b == null ? void 0 : b.commentId) === a.id,
731
- showHighlight: (b == null ? void 0 : b.commentId) === a.id,
735
+ type: r,
736
+ showEdit: (S == null ? void 0 : S.commentId) === a.id,
737
+ showHighlight: (S == null ? void 0 : S.commentId) === a.id,
732
738
  onClick: () => {
733
- Y.current = !1, a.resolved ? O.executeCommand(W.id) : O.executeCommand(
739
+ K.current = !1, a.resolved ? O.executeCommand(W.id) : O.executeCommand(
734
740
  W.id,
735
741
  {
736
742
  unitId: a.unitId,
@@ -740,84 +746,84 @@ const Gt = "univer-thread-comment-editor-buttons", qt = "univer-thread-comment-e
740
746
  }
741
747
  );
742
748
  },
743
- onMouseEnter: () => E == null ? void 0 : E(a),
744
- onMouseLeave: () => v == null ? void 0 : v(a),
745
- onAddComment: I,
746
- onDeleteComment: _,
749
+ onMouseEnter: () => y == null ? void 0 : y(a),
750
+ onMouseLeave: () => m == null ? void 0 : m(a),
751
+ onAddComment: C,
752
+ onDeleteComment: b,
747
753
  onResolve: (ee) => d == null ? void 0 : d(a.id, ee)
748
754
  },
749
755
  a.id
750
756
  );
751
- return /* @__PURE__ */ i.jsxs("div", { className: te.threadCommentPanel, children: [
752
- /* @__PURE__ */ i.jsxs("div", { className: te.threadCommentPanelForms, children: [
753
- n === he.UNIVER_SHEET ? /* @__PURE__ */ i.jsx(
754
- xe,
757
+ return /* @__PURE__ */ o.jsxs("div", { className: ne.threadCommentPanel, children: [
758
+ /* @__PURE__ */ o.jsxs("div", { className: ne.threadCommentPanelForms, children: [
759
+ r === he.UNIVER_SHEET ? /* @__PURE__ */ o.jsx(
760
+ be,
755
761
  {
756
762
  borderless: !0,
757
- value: p,
763
+ value: I,
758
764
  onChange: (a) => P(a),
759
765
  options: [
760
766
  {
761
767
  value: "current",
762
- label: C.t("threadCommentUI.filter.sheet.current")
768
+ label: g.t("threadCommentUI.filter.sheet.current")
763
769
  },
764
770
  {
765
771
  value: "all",
766
- label: C.t("threadCommentUI.filter.sheet.all")
772
+ label: g.t("threadCommentUI.filter.sheet.all")
767
773
  }
768
774
  ]
769
775
  }
770
776
  ) : null,
771
- /* @__PURE__ */ i.jsx(
772
- xe,
777
+ /* @__PURE__ */ o.jsx(
778
+ be,
773
779
  {
774
780
  borderless: !0,
775
- value: S,
776
- onChange: (a) => y(a),
781
+ value: j,
782
+ onChange: (a) => N(a),
777
783
  options: [
778
784
  {
779
785
  value: "all",
780
- label: C.t("threadCommentUI.filter.status.all")
786
+ label: g.t("threadCommentUI.filter.status.all")
781
787
  },
782
788
  {
783
789
  value: "resolved",
784
- label: C.t("threadCommentUI.filter.status.resolved")
790
+ label: g.t("threadCommentUI.filter.status.resolved")
785
791
  },
786
792
  {
787
793
  value: "unsolved",
788
- label: C.t("threadCommentUI.filter.status.unsolved")
794
+ label: g.t("threadCommentUI.filter.status.unsolved")
789
795
  },
790
796
  {
791
797
  value: "concern_me",
792
- label: C.t("threadCommentUI.filter.status.concernMe")
798
+ label: g.t("threadCommentUI.filter.status.concernMe")
793
799
  }
794
800
  ]
795
801
  }
796
802
  )
797
803
  ] }),
798
- ie.map(w),
799
- Q.length ? /* @__PURE__ */ i.jsx("div", { className: te.threadCommentPanelSolved, children: "已解决" }) : null,
800
- Q.map(w),
801
- G.length ? null : /* @__PURE__ */ i.jsxs("div", { className: te.threadCommentPanelEmpty, children: [
802
- X ? C.t("threadCommentUI.panel.filterEmpty") : C.t("threadCommentUI.panel.empty"),
803
- X ? /* @__PURE__ */ i.jsx(
804
- de,
804
+ se.map($),
805
+ Q.length ? /* @__PURE__ */ o.jsx("div", { className: ne.threadCommentPanelSolved, children: "已解决" }) : null,
806
+ Q.map($),
807
+ Z.length ? null : /* @__PURE__ */ o.jsxs("div", { className: ne.threadCommentPanelEmpty, children: [
808
+ X ? g.t("threadCommentUI.panel.filterEmpty") : g.t("threadCommentUI.panel.empty"),
809
+ X ? /* @__PURE__ */ o.jsx(
810
+ me,
805
811
  {
806
- onClick: j,
812
+ onClick: T,
807
813
  type: "link",
808
- children: C.t("threadCommentUI.panel.reset")
814
+ children: g.t("threadCommentUI.panel.reset")
809
815
  }
810
- ) : /* @__PURE__ */ i.jsxs(
811
- de,
816
+ ) : /* @__PURE__ */ o.jsxs(
817
+ me,
812
818
  {
813
819
  id: "thread-comment-add",
814
- className: te.threadCommentPanelAdd,
820
+ className: ne.threadCommentPanelAdd,
815
821
  type: "primary",
816
- onClick: o,
817
- disabled: T,
822
+ onClick: i,
823
+ disabled: h,
818
824
  children: [
819
- /* @__PURE__ */ i.jsx($e, {}),
820
- C.t("threadCommentUI.panel.addComment")
825
+ /* @__PURE__ */ o.jsx($e, {}),
826
+ g.t("threadCommentUI.panel.addComment")
821
827
  ]
822
828
  }
823
829
  )
@@ -827,9 +833,9 @@ const Gt = "univer-thread-comment-editor-buttons", qt = "univer-thread-comment-e
827
833
  export {
828
834
  W as SetActiveCommentOperation,
829
835
  St as THREAD_COMMENT_PANEL,
830
- An as ThreadCommentPanel,
831
- q as ThreadCommentPanelService,
832
- bn as ThreadCommentTree,
833
- yt as ToggleSheetCommentPanelOperation,
834
- me as UniverThreadCommentUIPlugin
836
+ Hn as ThreadCommentPanel,
837
+ J as ThreadCommentPanelService,
838
+ gn as ThreadCommentTree,
839
+ jt as ToggleSheetCommentPanelOperation,
840
+ ce as UniverThreadCommentUIPlugin
835
841
  };