@univerjs/thread-comment-ui 0.1.12 → 0.1.13-nightly.202406041140

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