@univerjs/thread-comment-ui 0.6.0 → 0.6.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,21 +1,21 @@
1
1
  var Be = Object.defineProperty;
2
- var We = (t, e, n) => e in t ? Be(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var B = (t, e, n) => We(t, typeof e != "symbol" ? e + "" : e, n);
2
+ var We = (t, e, r) => e in t ? Be(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
4
  import { Inject as Ne, IUniverInstanceService as Fe, Disposable as ze, UniverInstanceType as he, CommandType as Ue, DependentOn as Ze, Injector as Ke, ICommandService as oe, IConfigService as Ge, Plugin as Ye, merge as qe, mergeOverrideWithDependencies as Je, LocaleService as fe, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Qe, BuildTextUtils as Ce, Tools as Xe, CustomRangeType as et, getBodySlice as tt, UserManagerService as pe, generateRandomId as nt } from "@univerjs/core";
5
- import { UniverThreadCommentPlugin as rt, ThreadCommentModel as Ee, getDT as ot, AddCommentCommand as it, ResolveCommentCommand as at, DeleteCommentTreeCommand as Pe, UpdateCommentCommand as st, DeleteCommentCommand as lt } from "@univerjs/thread-comment";
6
- import { ISidebarService as Oe, useDependency as T, KeyCode as ge, useObservable as W } from "@univerjs/ui";
5
+ import { UniverThreadCommentPlugin as rt, ThreadCommentModel as Ee, getDT as ot, AddCommentCommand as it, ResolveCommentCommand as at, DeleteCommentTreeCommand as Oe, UpdateCommentCommand as st, DeleteCommentCommand as lt } from "@univerjs/thread-comment";
6
+ import { ISidebarService as Pe, useDependency as T, KeyCode as ge, useObservable as W } from "@univerjs/ui";
7
7
  import { BehaviorSubject as Ie, filter as dt, debounceTime as ct } from "rxjs";
8
8
  import { jsxs as S, jsx as l } from "react/jsx-runtime";
9
9
  import { Button as ce, Tooltip as mt, DropdownLegacy as ut, Menu as ht, MenuItem as be, Select as Se } from "@univerjs/design";
10
- import { forwardRef as A, useRef as re, createElement as z, useState as V, useEffect as me, useMemo as ne, useImperativeHandle as Ct } from "react";
10
+ import { forwardRef as j, useRef as re, createElement as z, useState as V, useEffect as me, useMemo as ne, useImperativeHandle as Ct } from "react";
11
11
  import { IEditorService as vt, BreakLineCommand as ft, RichTextEditor as pt } from "@univerjs/docs-ui";
12
- var gt = Object.getOwnPropertyDescriptor, It = (t, e, n, r) => {
13
- for (var o = r > 1 ? void 0 : r ? gt(e, n) : e, s = t.length - 1, c; s >= 0; s--)
14
- (c = t[s]) && (o = c(o) || o);
12
+ var gt = Object.getOwnPropertyDescriptor, It = (t, e, r, n) => {
13
+ for (var o = n > 1 ? void 0 : n ? gt(e, r) : e, a = t.length - 1, d; a >= 0; a--)
14
+ (d = t[a]) && (o = d(o) || o);
15
15
  return o;
16
- }, ye = (t, e) => (n, r) => e(n, r, t);
16
+ }, ye = (t, e) => (r, n) => e(r, n, t);
17
17
  let Y = class extends ze {
18
- constructor(e, n) {
18
+ constructor(e, r) {
19
19
  super();
20
20
  B(this, "_panelVisible", !1);
21
21
  B(this, "_panelVisible$", new Ie(!1));
@@ -23,7 +23,7 @@ let Y = class extends ze {
23
23
  B(this, "_activeCommentId$", new Ie(void 0));
24
24
  B(this, "panelVisible$", this._panelVisible$.asObservable());
25
25
  B(this, "activeCommentId$", this._activeCommentId$.asObservable());
26
- this._sidebarService = e, this._univerInstanceService = n, this._init(), this.disposeWithMe(() => {
26
+ this._sidebarService = e, this._univerInstanceService = r, this._init(), this.disposeWithMe(() => {
27
27
  this._activeCommentId$.complete(), this._panelVisible$.complete();
28
28
  });
29
29
  }
@@ -52,19 +52,19 @@ let Y = class extends ze {
52
52
  }
53
53
  };
54
54
  Y = It([
55
- ye(0, Ne(Oe)),
55
+ ye(0, Ne(Pe)),
56
56
  ye(1, Fe)
57
57
  ], Y);
58
58
  const bt = "thread-comment-panel", St = "UNIVER_THREAD_COMMENT_UI_PLUGIN", yt = {
59
59
  id: "thread-comment-ui.operation.toggle-panel",
60
60
  type: Ue.OPERATION,
61
61
  handler(t) {
62
- const e = t.get(Oe), n = t.get(Y);
63
- return n.panelVisible ? (e.close(), n.setPanelVisible(!1)) : (e.open({
62
+ const e = t.get(Pe), r = t.get(Y);
63
+ return r.panelVisible ? (e.close(), r.setPanelVisible(!1)) : (e.open({
64
64
  header: { title: "threadCommentUI.panel.title" },
65
65
  children: { label: bt },
66
66
  width: 330
67
- }), n.setPanelVisible(!0)), !0;
67
+ }), r.setPanelVisible(!0)), !0;
68
68
  }
69
69
  }, F = {
70
70
  id: "thread-comment-ui.operation.set-active-comment",
@@ -73,20 +73,20 @@ const bt = "thread-comment-panel", St = "UNIVER_THREAD_COMMENT_UI_PLUGIN", yt =
73
73
  return t.get(Y).setActiveComment(e), !0;
74
74
  }
75
75
  }, _t = "thread-comment-ui.config", _e = {};
76
- var xt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, Nt = (t, e, n) => e in t ? xt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ut = (t, e, n, r) => {
77
- for (var o = r > 1 ? void 0 : r ? Tt(e, n) : e, s = t.length - 1, c; s >= 0; s--)
78
- (c = t[s]) && (o = c(o) || o);
76
+ var xt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, Nt = (t, e, r) => e in t ? xt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Ut = (t, e, r, n) => {
77
+ for (var o = n > 1 ? void 0 : n ? Tt(e, r) : e, a = t.length - 1, d; a >= 0; a--)
78
+ (d = t[a]) && (o = d(o) || o);
79
79
  return o;
80
- }, ve = (t, e) => (n, r) => e(n, r, t), Me = (t, e, n) => Nt(t, typeof e != "symbol" ? e + "" : e, n);
80
+ }, ve = (t, e) => (r, n) => e(r, n, t), Me = (t, e, r) => Nt(t, typeof e != "symbol" ? e + "" : e, r);
81
81
  let ue = class extends Ye {
82
- constructor(t = _e, e, n, r) {
83
- super(), this._config = t, this._injector = e, this._commandService = n, this._configService = r;
84
- const { menu: o, ...s } = qe(
82
+ constructor(t = _e, e, r, n) {
83
+ super(), this._config = t, this._injector = e, this._commandService = r, this._configService = n;
84
+ const { menu: o, ...a } = qe(
85
85
  {},
86
86
  _e,
87
87
  this._config
88
88
  );
89
- o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(_t, s);
89
+ o && this._configService.setConfig("menu", o, { merge: !0 }), this._configService.setConfig(_t, a);
90
90
  }
91
91
  onStarting() {
92
92
  var t;
@@ -107,109 +107,112 @@ ue = Ut([
107
107
  ve(2, oe),
108
108
  ve(3, Ge)
109
109
  ], ue);
110
- var H = function() {
111
- return H = Object.assign || function(t) {
112
- for (var e, n = 1, r = arguments.length; n < r; n++) {
113
- e = arguments[n];
110
+ var D = function() {
111
+ return D = Object.assign || function(t) {
112
+ for (var e, r = 1, n = arguments.length; r < n; r++) {
113
+ e = arguments[r];
114
114
  for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
115
115
  }
116
116
  return t;
117
- }, H.apply(this, arguments);
117
+ }, D.apply(this, arguments);
118
118
  }, Et = function(t, e) {
119
- var n = {};
120
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
119
+ var r = {};
120
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
121
121
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
122
- for (var o = 0, r = Object.getOwnPropertySymbols(t); o < r.length; o++)
123
- e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
124
- return n;
125
- }, Z = A(function(t, e) {
126
- var n = t.icon, r = t.id, o = t.className, s = t.extend, c = Et(t, ["icon", "id", "className", "extend"]), g = "univerjs-icon univerjs-icon-".concat(r, " ").concat(o || "").trim(), p = re("_".concat(Mt()));
127
- return De(n, "".concat(r), { defIds: n.defIds, idSuffix: p.current }, H({ ref: e, className: g }, c), s);
122
+ for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
123
+ e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
124
+ return r;
125
+ }, Z = j(function(t, e) {
126
+ var r = t.icon, n = t.id, o = t.className, a = t.extend, d = Et(t, ["icon", "id", "className", "extend"]), C = "univerjs-icon univerjs-icon-".concat(n, " ").concat(o || "").trim(), g = re("_".concat(Mt()));
127
+ return $e(r, "".concat(n), { defIds: r.defIds, idSuffix: g.current }, D({ ref: e, className: C }, d), a);
128
128
  });
129
- function De(t, e, n, r, o) {
130
- return z(t.tag, H(H({ key: e }, Pt(t, n, o)), r), (Ot(t, n).children || []).map(function(s, c) {
131
- return De(s, "".concat(e, "-").concat(t.tag, "-").concat(c), n, void 0, o);
129
+ function $e(t, e, r, n, o) {
130
+ return z(t.tag, D(D({ key: e }, Ot(t, r, o)), n), (Pt(t, r).children || []).map(function(a, d) {
131
+ return $e(a, "".concat(e, "-").concat(t.tag, "-").concat(d), r, void 0, o);
132
132
  }));
133
133
  }
134
- function Pt(t, e, n) {
135
- var r = H({}, t.attrs);
136
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
134
+ function Ot(t, e, r) {
135
+ var n = D({}, t.attrs);
136
+ r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), t.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(a) {
137
+ var d = a[0], C = a[1];
138
+ d === "mask" && typeof C == "string" && (n[d] = C.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
139
+ });
137
140
  var o = e.defIds;
138
- return !o || o.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(s) {
139
- var c = s[0], g = s[1];
140
- typeof g == "string" && (r[c] = g.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
141
- })), r;
141
+ return !o || o.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(a) {
142
+ var d = a[0], C = a[1];
143
+ typeof C == "string" && (n[d] = C.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
144
+ })), n;
142
145
  }
143
- function Ot(t, e) {
144
- var n, r = e.defIds;
145
- return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? H(H({}, t), { children: t.children.map(function(o) {
146
- return typeof o.attrs.id == "string" && r && r.indexOf(o.attrs.id) > -1 ? H(H({}, o), { attrs: H(H({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
146
+ function Pt(t, e) {
147
+ var r, n = e.defIds;
148
+ return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? D(D({}, t), { children: t.children.map(function(o) {
149
+ return typeof o.attrs.id == "string" && n && n.indexOf(o.attrs.id) > -1 ? D(D({}, o), { attrs: D(D({}, o.attrs), { id: o.attrs.id + e.idSuffix }) }) : o;
147
150
  }) }) : t;
148
151
  }
149
152
  function Mt() {
150
153
  return Math.random().toString(36).substring(2, 8);
151
154
  }
152
155
  Z.displayName = "UniverIcon";
153
- 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" } }] }, He = A(function(t, e) {
156
+ var $t = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, De = j(function(t, e) {
154
157
  return z(Z, Object.assign({}, t, {
155
158
  id: "delete-single",
156
159
  ref: e,
157
- icon: Dt
160
+ icon: $t
158
161
  }));
159
162
  });
160
- He.displayName = "DeleteSingle";
161
- var Ht = { 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) {
163
+ De.displayName = "DeleteSingle";
164
+ var Dt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, He = j(function(t, e) {
162
165
  return z(Z, Object.assign({}, t, {
163
166
  id: "increase-single",
164
167
  ref: e,
165
- icon: Ht
168
+ icon: Dt
166
169
  }));
167
170
  });
168
- $e.displayName = "IncreaseSingle";
169
- var $t = { 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" } }] }, Re = A(function(t, e) {
171
+ He.displayName = "IncreaseSingle";
172
+ var Ht = { 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" } }] }, ke = j(function(t, e) {
170
173
  return z(Z, Object.assign({}, t, {
171
174
  id: "more-horizontal-single",
172
175
  ref: e,
173
- icon: $t
176
+ icon: Ht
174
177
  }));
175
178
  });
176
- Re.displayName = "MoreHorizontalSingle";
177
- var Rt = { 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 } }] }, we = A(function(t, e) {
179
+ ke.displayName = "MoreHorizontalSingle";
180
+ var kt = { 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 = j(function(t, e) {
178
181
  return z(Z, Object.assign({}, t, {
179
182
  id: "reply-to-comment-single",
180
183
  ref: e,
181
- icon: Rt
184
+ icon: kt
182
185
  }));
183
186
  });
184
- we.displayName = "ReplyToCommentSingle";
185
- 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" } }] }, ke = A(function(t, e) {
187
+ Re.displayName = "ReplyToCommentSingle";
188
+ var Rt = { 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" } }] }, we = j(function(t, e) {
186
189
  return z(Z, Object.assign({}, t, {
187
190
  id: "resolved-single",
188
191
  ref: e,
189
- icon: wt
192
+ icon: Rt
190
193
  }));
191
194
  });
192
- ke.displayName = "ResolvedSingle";
193
- var kt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "circle", attrs: { cx: 8.73, cy: 8.4, r: 6.4, stroke: "currentColor", strokeWidth: 1.2 } }, { tag: "path", attrs: { stroke: "currentColor", d: "M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.2 } }] }, Le = A(function(t, e) {
195
+ we.displayName = "ResolvedSingle";
196
+ var wt = { 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 } }] }, Le = j(function(t, e) {
194
197
  return z(Z, Object.assign({}, t, {
195
198
  id: "solve-single",
196
199
  ref: e,
197
- icon: kt
200
+ icon: wt
198
201
  }));
199
202
  });
200
203
  Le.displayName = "SolveSingle";
201
204
  function Ve(t) {
202
- var e, n, r = "";
203
- if (typeof t == "string" || typeof t == "number") r += t;
205
+ var e, r, n = "";
206
+ if (typeof t == "string" || typeof t == "number") n += t;
204
207
  else if (typeof t == "object") if (Array.isArray(t)) {
205
208
  var o = t.length;
206
- for (e = 0; e < o; e++) t[e] && (n = Ve(t[e])) && (r && (r += " "), r += n);
207
- } else for (n in t) t[n] && (r && (r += " "), r += n);
208
- return r;
209
+ for (e = 0; e < o; e++) t[e] && (r = Ve(t[e])) && (n && (n += " "), n += r);
210
+ } else for (r in t) t[r] && (n && (n += " "), n += r);
211
+ return n;
209
212
  }
210
213
  function Lt() {
211
- for (var t, e, n = 0, r = "", o = arguments.length; n < o; n++) (t = arguments[n]) && (e = Ve(t)) && (r && (r += " "), r += e);
212
- return r;
214
+ for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = Ve(t)) && (n && (n += " "), n += e);
215
+ return n;
213
216
  }
214
217
  const Vt = "univer-thread-comment-editor-buttons", xe = {
215
218
  threadCommentEditorButtons: Vt
@@ -221,77 +224,77 @@ function Te(t) {
221
224
  documentStyle: {}
222
225
  };
223
226
  }
224
- const Ae = A((t, e) => {
225
- var w;
226
- const { comment: n, onSave: r, id: o, onCancel: s, autoFocus: c, unitId: g, type: p } = t, N = T(oe), P = T(fe), [k, O] = V(!1), U = T(vt), m = re(null), v = p === he.UNIVER_SHEET ? Qe : g, [M, y] = V(() => {
227
- var d, u, f;
228
- return Ce.transform.getPlainText((f = (u = (d = m.current) == null ? void 0 : d.getDocumentData().body) == null ? void 0 : u.dataStream) != null ? f : "");
227
+ const je = j((t, e) => {
228
+ var R;
229
+ const { comment: r, onSave: n, id: o, onCancel: a, autoFocus: d, unitId: C, type: g } = t, N = T(oe), O = T(fe), [w, P] = V(!1), U = T(vt), m = re(null), f = g === he.UNIVER_SHEET ? Qe : C, [M, y] = V(() => {
230
+ var c, u, p;
231
+ return Ce.transform.getPlainText((p = (u = (c = m.current) == null ? void 0 : c.getDocumentData().body) == null ? void 0 : u.dataStream) != null ? p : "");
229
232
  });
230
233
  me(() => {
231
- var u, f, a, h;
232
- y(Ce.transform.getPlainText((a = (f = (u = m.current) == null ? void 0 : u.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? a : ""));
233
- const d = (h = m.current) == null ? void 0 : h.selectionChange$.subscribe(() => {
234
+ var u, p, s, h;
235
+ y(Ce.transform.getPlainText((s = (p = (u = m.current) == null ? void 0 : u.getDocumentData().body) == null ? void 0 : p.dataStream) != null ? s : ""));
236
+ const c = (h = m.current) == null ? void 0 : h.selectionChange$.subscribe(() => {
234
237
  var K, _, b;
235
238
  y(Ce.transform.getPlainText((b = (_ = (K = m.current) == null ? void 0 : K.getDocumentData().body) == null ? void 0 : _.dataStream) != null ? b : ""));
236
239
  });
237
- return () => d == null ? void 0 : d.unsubscribe();
238
- }, [(w = m.current) == null ? void 0 : w.selectionChange$]);
239
- const $ = ne(() => ({
240
+ return () => c == null ? void 0 : c.unsubscribe();
241
+ }, [(R = m.current) == null ? void 0 : R.selectionChange$]);
242
+ const H = ne(() => ({
240
243
  keyCodes: [{ keyCode: ge.ENTER }],
241
- handler: (d) => {
242
- d === ge.ENTER && N.executeCommand(
244
+ handler: (c) => {
245
+ c === ge.ENTER && N.executeCommand(
243
246
  ft.id
244
247
  );
245
248
  }
246
249
  }), [N]);
247
250
  Ct(e, () => ({
248
- reply(d) {
249
- var u, f;
250
- (u = m.current) == null || u.focus(), (f = m.current) == null || f.setDocumentData(Te(d));
251
+ reply(c) {
252
+ var u, p;
253
+ (u = m.current) == null || u.focus(), (p = m.current) == null || p.setDocumentData(Te(c));
251
254
  }
252
255
  }));
253
256
  const I = () => {
254
257
  if (m.current) {
255
- const d = Xe.deepClone(m.current.getDocumentData().body);
256
- O(!1), r == null || r({
257
- ...n,
258
- text: d
258
+ const c = Xe.deepClone(m.current.getDocumentData().body);
259
+ P(!1), n == null || n({
260
+ ...r,
261
+ text: c
259
262
  }), m.current.replaceText(""), setTimeout(() => {
260
- var u, f;
261
- (u = m.current) == null || u.setSelectionRanges([]), (f = m.current) == null || f.blur();
263
+ var u, p;
264
+ (u = m.current) == null || u.setSelectionRanges([]), (p = m.current) == null || p.blur();
262
265
  }, 10);
263
266
  }
264
267
  };
265
- return /* @__PURE__ */ S("div", { className: xe.threadCommentEditor, onClick: (d) => d.preventDefault(), children: [
268
+ return /* @__PURE__ */ S("div", { className: xe.threadCommentEditor, onClick: (c) => c.preventDefault(), children: [
266
269
  /* @__PURE__ */ l(
267
270
  pt,
268
271
  {
269
272
  ref: m,
270
- autoFocus: c,
273
+ autoFocus: d,
271
274
  style: { width: "100%" },
272
- keyboardEventConfig: $,
273
- placeholder: P.t("threadCommentUI.editor.placeholder"),
274
- initialValue: (n == null ? void 0 : n.text) && Te(n.text),
275
- onFocusChange: (d) => d && O(d),
275
+ keyboardEventConfig: H,
276
+ placeholder: O.t("threadCommentUI.editor.placeholder"),
277
+ initialValue: (r == null ? void 0 : r.text) && Te(r.text),
278
+ onFocusChange: (c) => c && P(c),
276
279
  isSingle: !1,
277
280
  maxHeight: 64,
278
281
  onClickOutside: () => {
279
282
  setTimeout(() => {
280
- U.focus(v);
283
+ U.focus(f);
281
284
  }, 30);
282
285
  }
283
286
  }
284
287
  ),
285
- k ? /* @__PURE__ */ S("div", { className: xe.threadCommentEditorButtons, children: [
288
+ w ? /* @__PURE__ */ S("div", { className: xe.threadCommentEditorButtons, children: [
286
289
  /* @__PURE__ */ l(
287
290
  ce,
288
291
  {
289
292
  style: { marginRight: 12 },
290
293
  onClick: () => {
291
- var d;
292
- s == null || s(), O(!1), (d = m.current) == null || d.replaceText("", !0), N.executeCommand(F.id);
294
+ var c;
295
+ a == null || a(), P(!1), (c = m.current) == null || c.replaceText("", !0), N.executeCommand(F.id);
293
296
  },
294
- children: P.t("threadCommentUI.editor.cancel")
297
+ children: O.t("threadCommentUI.editor.cancel")
295
298
  }
296
299
  ),
297
300
  /* @__PURE__ */ l(
@@ -300,54 +303,54 @@ const Ae = A((t, e) => {
300
303
  type: "primary",
301
304
  disabled: !M,
302
305
  onClick: I,
303
- children: P.t(o ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
306
+ children: O.t(o ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
304
307
  }
305
308
  )
306
309
  ] }) : null
307
310
  ] });
308
- }), At = (t) => {
309
- const { dataStream: e, customRanges: n } = t, r = e.endsWith(`\r
311
+ }), jt = (t) => {
312
+ const { dataStream: e, customRanges: r } = t, n = e.endsWith(`\r
310
313
  `) ? e.length - 2 : e.length, o = [];
311
- let s = 0;
312
- return n == null || n.forEach((c) => {
313
- s < c.startIndex && o.push({
314
+ let a = 0;
315
+ return r == null || r.forEach((d) => {
316
+ a < d.startIndex && o.push({
314
317
  type: "text",
315
- content: e.slice(s, c.startIndex)
318
+ content: e.slice(a, d.startIndex)
316
319
  }), o.push({
317
320
  type: "mention",
318
321
  content: {
319
- label: e.slice(c.startIndex, c.endIndex + 1),
320
- id: c.rangeId
322
+ label: e.slice(d.startIndex, d.endIndex + 1),
323
+ id: d.rangeId
321
324
  }
322
- }), s = c.endIndex + 1;
325
+ }), a = d.endIndex + 1;
323
326
  }), o.push({
324
327
  type: "text",
325
- content: e.slice(s, r)
328
+ content: e.slice(a, n)
326
329
  }), o;
327
- }, jt = (t) => {
330
+ }, At = (t) => {
328
331
  const { paragraphs: e = [] } = t;
329
- let n = 0;
330
- return e.map((r) => {
331
- const o = tt(t, n, r.startIndex);
332
- return n = r.startIndex + 1, At(o);
332
+ let r = 0;
333
+ return e.map((n) => {
334
+ const o = tt(t, r, n.startIndex);
335
+ return r = n.startIndex + 1, jt(o);
333
336
  });
334
337
  }, Bt = (t) => {
335
338
  let e = "";
336
- const n = [];
337
- return t.forEach((r) => {
338
- switch (r.type) {
339
+ const r = [];
340
+ return t.forEach((n) => {
341
+ switch (n.type) {
339
342
  case "text":
340
- e += r.content;
343
+ e += n.content;
341
344
  break;
342
345
  case "mention": {
343
346
  const o = e.length;
344
- e += r.content.label;
345
- const s = e.length - 1;
346
- n.push({
347
- rangeId: r.content.id,
347
+ e += n.content.label;
348
+ const a = e.length - 1;
349
+ r.push({
350
+ rangeId: n.content.id,
348
351
  rangeType: et.MENTION,
349
352
  startIndex: o,
350
- endIndex: s,
353
+ endIndex: a,
351
354
  properties: {}
352
355
  });
353
356
  break;
@@ -368,9 +371,9 @@ const Ae = A((t, e) => {
368
371
  }
369
372
  ],
370
373
  dataStream: e,
371
- customRanges: n
374
+ customRanges: r
372
375
  };
373
- }, Wt = "univer-thread-comment", Ft = "univer-thread-comment-active", zt = "univer-thread-comment-content", Zt = "univer-thread-comment-highlight", Kt = "univer-thread-comment-icon-container", Gt = "univer-thread-comment-icon", Yt = "univer-thread-comment-title", qt = "univer-thread-comment-title-position", Jt = "univer-thread-comment-title-highlight", Qt = "univer-thread-comment-title-position-text", Xt = "univer-thread-comment-username", en = "univer-thread-comment-item", tn = "univer-thread-comment-item-head", nn = "univer-thread-comment-item-title", rn = "univer-thread-comment-item-time", on = "univer-thread-comment-item-content", an = "univer-thread-comment-item-at", C = {
376
+ }, Wt = "univer-thread-comment", Ft = "univer-thread-comment-active", zt = "univer-thread-comment-content", Zt = "univer-thread-comment-highlight", Kt = "univer-thread-comment-icon-container", Gt = "univer-thread-comment-icon", Yt = "univer-thread-comment-title", qt = "univer-thread-comment-title-position", Jt = "univer-thread-comment-title-highlight", Qt = "univer-thread-comment-title-position-text", Xt = "univer-thread-comment-username", en = "univer-thread-comment-item", tn = "univer-thread-comment-item-head", nn = "univer-thread-comment-item-title", rn = "univer-thread-comment-item-time", on = "univer-thread-comment-item-content", an = "univer-thread-comment-item-at", v = {
374
377
  threadComment: Wt,
375
378
  threadCommentActive: Ft,
376
379
  threadCommentContent: zt,
@@ -388,100 +391,100 @@ const Ae = A((t, e) => {
388
391
  threadCommentItemTime: rn,
389
392
  threadCommentItemContent: on,
390
393
  threadCommentItemAt: an
391
- }, je = "__mock__", sn = (t) => {
392
- const { item: e, unitId: n, subUnitId: r, editing: o, onEditingChange: s, onReply: c, resolved: g, isRoot: p, onClose: N, onDeleteComment: P, type: k } = t, O = T(oe), U = T(fe), m = T(pe), v = m.getUser(e.personId), M = W(m.currentUser$), y = (M == null ? void 0 : M.userID) === e.personId, $ = e.id === je, [I, w] = V(!1), d = () => {
393
- (P == null ? void 0 : P(e)) !== !1 && (O.executeCommand(
394
- p ? Pe.id : lt.id,
394
+ }, Ae = "__mock__", sn = (t) => {
395
+ const { item: e, unitId: r, subUnitId: n, editing: o, onEditingChange: a, onReply: d, resolved: C, isRoot: g, onClose: N, onDeleteComment: O, type: w } = t, P = T(oe), U = T(fe), m = T(pe), f = m.getUser(e.personId), M = W(m.currentUser$), y = (M == null ? void 0 : M.userID) === e.personId, H = e.id === Ae, [I, R] = V(!1), c = () => {
396
+ (O == null ? void 0 : O(e)) !== !1 && (P.executeCommand(
397
+ g ? Oe.id : lt.id,
395
398
  {
396
- unitId: n,
397
- subUnitId: r,
399
+ unitId: r,
400
+ subUnitId: n,
398
401
  commentId: e.id
399
402
  }
400
- ), p && (N == null || N()));
403
+ ), g && (N == null || N()));
401
404
  };
402
- return /* @__PURE__ */ S("div", { className: C.threadCommentItem, onMouseLeave: () => w(!1), onMouseEnter: () => w(!0), children: [
403
- /* @__PURE__ */ l("img", { className: C.threadCommentItemHead, src: v == null ? void 0 : v.avatar }),
404
- /* @__PURE__ */ S("div", { className: C.threadCommentItemTitle, children: [
405
- /* @__PURE__ */ l("div", { className: C.threadCommentUsername, children: (v == null ? void 0 : v.name) || " " }),
405
+ return /* @__PURE__ */ S("div", { className: v.threadCommentItem, onMouseLeave: () => R(!1), onMouseEnter: () => R(!0), children: [
406
+ /* @__PURE__ */ l("img", { className: v.threadCommentItemHead, src: f == null ? void 0 : f.avatar }),
407
+ /* @__PURE__ */ S("div", { className: v.threadCommentItemTitle, children: [
408
+ /* @__PURE__ */ l("div", { className: v.threadCommentUsername, children: (f == null ? void 0 : f.name) || " " }),
406
409
  /* @__PURE__ */ S("div", { children: [
407
- $ || g ? null : I ? /* @__PURE__ */ l("div", { className: C.threadCommentIcon, onClick: () => c(v), children: /* @__PURE__ */ l(we, {}) }) : null,
408
- y && !$ && !g ? /* @__PURE__ */ l(
410
+ H || C ? null : I ? /* @__PURE__ */ l("div", { className: v.threadCommentIcon, onClick: () => d(f), children: /* @__PURE__ */ l(Re, {}) }) : null,
411
+ y && !H && !C ? /* @__PURE__ */ l(
409
412
  ut,
410
413
  {
411
414
  overlay: /* @__PURE__ */ S(ht, { children: [
412
- /* @__PURE__ */ l(be, { onClick: () => s == null ? void 0 : s(!0), children: U.t("threadCommentUI.item.edit") }, "edit"),
413
- /* @__PURE__ */ l(be, { onClick: d, children: U.t("threadCommentUI.item.delete") }, "delete")
415
+ /* @__PURE__ */ l(be, { onClick: () => a == null ? void 0 : a(!0), children: U.t("threadCommentUI.item.edit") }, "edit"),
416
+ /* @__PURE__ */ l(be, { onClick: c, children: U.t("threadCommentUI.item.delete") }, "delete")
414
417
  ] }),
415
- children: /* @__PURE__ */ l("div", { className: C.threadCommentIcon, children: /* @__PURE__ */ l(Re, {}) })
418
+ children: /* @__PURE__ */ l("div", { className: v.threadCommentIcon, children: /* @__PURE__ */ l(ke, {}) })
416
419
  }
417
420
  ) : null
418
421
  ] })
419
422
  ] }),
420
- /* @__PURE__ */ l("div", { className: C.threadCommentItemTime, children: e.dT }),
423
+ /* @__PURE__ */ l("div", { className: v.threadCommentItemTime, children: e.dT }),
421
424
  o ? /* @__PURE__ */ l(
422
- Ae,
425
+ je,
423
426
  {
424
- type: k,
427
+ type: w,
425
428
  id: e.id,
426
429
  comment: e,
427
- onCancel: () => s == null ? void 0 : s(!1),
430
+ onCancel: () => a == null ? void 0 : a(!1),
428
431
  autoFocus: !0,
429
- unitId: n,
430
- subUnitId: r,
431
- onSave: ({ text: u, attachments: f }) => {
432
- s == null || s(!1), O.executeCommand(
432
+ unitId: r,
433
+ subUnitId: n,
434
+ onSave: ({ text: u, attachments: p }) => {
435
+ a == null || a(!1), P.executeCommand(
433
436
  st.id,
434
437
  {
435
- unitId: n,
436
- subUnitId: r,
438
+ unitId: r,
439
+ subUnitId: n,
437
440
  payload: {
438
441
  commentId: e.id,
439
442
  text: u,
440
- attachments: f
443
+ attachments: p
441
444
  }
442
445
  }
443
446
  );
444
447
  }
445
448
  }
446
- ) : /* @__PURE__ */ l("div", { className: C.threadCommentItemContent, children: jt(e.text).map((u, f) => /* @__PURE__ */ l("div", { children: u.map((a, h) => {
447
- switch (a.type) {
449
+ ) : /* @__PURE__ */ l("div", { className: v.threadCommentItemContent, children: At(e.text).map((u, p) => /* @__PURE__ */ l("div", { children: u.map((s, h) => {
450
+ switch (s.type) {
448
451
  case "mention":
449
- return /* @__PURE__ */ S("a", { className: C.threadCommentItemAt, children: [
450
- a.content.label,
452
+ return /* @__PURE__ */ S("a", { className: v.threadCommentItemAt, children: [
453
+ s.content.label,
451
454
  " "
452
455
  ] }, h);
453
456
  default:
454
- return a.content;
457
+ return s.content;
455
458
  }
456
- }) }, f)) })
459
+ }) }, p)) })
457
460
  ] });
458
461
  }, ln = (t) => {
459
462
  var X, ee, se;
460
463
  const {
461
464
  id: e,
462
- unitId: n,
463
- subUnitId: r,
465
+ unitId: r,
466
+ subUnitId: n,
464
467
  refStr: o,
465
- showEdit: s = !0,
466
- onClick: c,
467
- showHighlight: g,
468
- onClose: p,
468
+ showEdit: a = !0,
469
+ onClick: d,
470
+ showHighlight: C,
471
+ onClose: g,
469
472
  getSubUnitName: N,
470
- prefix: P,
471
- autoFocus: k,
472
- onMouseEnter: O,
473
+ prefix: O,
474
+ autoFocus: w,
475
+ onMouseEnter: P,
473
476
  onMouseLeave: U,
474
477
  onAddComment: m,
475
- onDeleteComment: v,
478
+ onDeleteComment: f,
476
479
  onResolve: M,
477
480
  type: y
478
- } = t, $ = T(Ee), [I, w] = V(!1), [d, u] = V(""), f = ne(() => $.commentUpdate$.pipe(ct(16)), [$]);
479
- W(f);
480
- const a = e ? $.getCommentWithChildren(n, r, e) : null, h = T(oe), K = T(pe), _ = a == null ? void 0 : a.root.resolved, b = W(K.currentUser$), G = re(null), ie = [
481
- ...a ? [a.root] : (
481
+ } = t, H = T(Ee), [I, R] = V(!1), [c, u] = V(""), p = ne(() => H.commentUpdate$.pipe(ct(16)), [H]);
482
+ W(p);
483
+ const s = e ? H.getCommentWithChildren(r, n, e) : null, h = T(oe), K = T(pe), _ = s == null ? void 0 : s.root.resolved, b = W(K.currentUser$), G = re(null), ie = [
484
+ ...s ? [s.root] : (
482
485
  // mock empty comment
483
486
  [{
484
- id: je,
487
+ id: Ae,
485
488
  text: {
486
489
  dataStream: `
487
490
  \r`
@@ -489,88 +492,88 @@ const Ae = A((t, e) => {
489
492
  personId: (X = b == null ? void 0 : b.userID) != null ? X : "",
490
493
  ref: o != null ? o : "",
491
494
  dT: "",
492
- unitId: n,
493
- subUnitId: r,
495
+ unitId: r,
496
+ subUnitId: n,
494
497
  threadId: ""
495
498
  }]
496
499
  ),
497
- ...(ee = a == null ? void 0 : a.children) != null ? ee : []
498
- ], D = re(null), q = (x) => {
500
+ ...(ee = s == null ? void 0 : s.children) != null ? ee : []
501
+ ], $ = re(null), q = (x) => {
499
502
  x.stopPropagation(), _ ? h.executeCommand(F.id, {
500
- unitId: n,
501
- subUnitId: r,
503
+ unitId: r,
504
+ subUnitId: n,
502
505
  commentId: e
503
506
  }) : h.executeCommand(F.id), h.executeCommand(at.id, {
504
- unitId: n,
505
- subUnitId: r,
507
+ unitId: r,
508
+ subUnitId: n,
506
509
  commentId: e,
507
510
  resolved: !_
508
511
  }), M == null || M(!_);
509
512
  }, L = (x) => {
510
- x.stopPropagation(), h.executeCommand(F.id), !(a != null && a.root && (v == null ? void 0 : v(a.root)) === !1) && (h.executeCommand(
511
- Pe.id,
513
+ x.stopPropagation(), h.executeCommand(F.id), !(s != null && s.root && (f == null ? void 0 : f(s.root)) === !1) && (h.executeCommand(
514
+ Oe.id,
512
515
  {
513
- unitId: n,
514
- subUnitId: r,
516
+ unitId: r,
517
+ subUnitId: n,
515
518
  commentId: e
516
519
  }
517
- ), p == null || p());
520
+ ), g == null || g());
518
521
  };
519
522
  me(() => U == null ? void 0 : U(), []);
520
- const J = N((se = a == null ? void 0 : a.root.subUnitId) != null ? se : r), Q = s && !d && !_, ae = `${o || (a == null ? void 0 : a.root.ref) || ""}${J ? " · " : ""}${J}`;
523
+ const J = N((se = s == null ? void 0 : s.root.subUnitId) != null ? se : n), Q = a && !c && !_, ae = `${o || (s == null ? void 0 : s.root.ref) || ""}${J ? " · " : ""}${J}`;
521
524
  return /* @__PURE__ */ S(
522
525
  "div",
523
526
  {
524
- className: Lt(C.threadComment, {
525
- [C.threadCommentActive]: !_ && (g || I || P === "cell")
527
+ className: Lt(v.threadComment, {
528
+ [v.threadCommentActive]: !_ && (C || I || O === "cell")
526
529
  }),
527
- onClick: c,
528
- id: `${P}-${n}-${r}-${e}`,
530
+ onClick: d,
531
+ id: `${O}-${r}-${n}-${e}`,
529
532
  onMouseEnter: () => {
530
- O == null || O(), w(!0);
533
+ P == null || P(), R(!0);
531
534
  },
532
535
  onMouseLeave: () => {
533
- U == null || U(), w(!1);
536
+ U == null || U(), R(!1);
534
537
  },
535
538
  children: [
536
- !_ && g ? /* @__PURE__ */ l("div", { className: C.threadCommentHighlight }) : null,
537
- /* @__PURE__ */ S("div", { className: C.threadCommentTitle, children: [
538
- /* @__PURE__ */ S("div", { className: C.threadCommentTitlePosition, children: [
539
- /* @__PURE__ */ l("div", { className: C.threadCommentTitleHighlight }),
540
- /* @__PURE__ */ l(mt, { showIfEllipsis: !0, title: ae, children: /* @__PURE__ */ l("div", { className: C.threadCommentTitlePositionText, children: ae }) })
539
+ !_ && C ? /* @__PURE__ */ l("div", { className: v.threadCommentHighlight }) : null,
540
+ /* @__PURE__ */ S("div", { className: v.threadCommentTitle, children: [
541
+ /* @__PURE__ */ S("div", { className: v.threadCommentTitlePosition, children: [
542
+ /* @__PURE__ */ l("div", { className: v.threadCommentTitleHighlight }),
543
+ /* @__PURE__ */ l(mt, { showIfEllipsis: !0, title: ae, children: /* @__PURE__ */ l("div", { className: v.threadCommentTitlePositionText, children: ae }) })
541
544
  ] }),
542
- a ? /* @__PURE__ */ S("div", { className: C.threadCommentIconContainer, children: [
545
+ s ? /* @__PURE__ */ S("div", { className: v.threadCommentIconContainer, children: [
543
546
  /* @__PURE__ */ l(
544
547
  "div",
545
548
  {
546
549
  onClick: q,
547
- className: C.threadCommentIcon,
550
+ className: v.threadCommentIcon,
548
551
  style: { color: _ ? "rgb(var(--green-500))" : "" },
549
- children: _ ? /* @__PURE__ */ l(ke, {}) : /* @__PURE__ */ l(Le, {})
552
+ children: _ ? /* @__PURE__ */ l(we, {}) : /* @__PURE__ */ l(Le, {})
550
553
  }
551
554
  ),
552
- (b == null ? void 0 : b.userID) === a.root.personId ? /* @__PURE__ */ l("div", { className: C.threadCommentIcon, onClick: L, children: /* @__PURE__ */ l(He, {}) }) : null
555
+ (b == null ? void 0 : b.userID) === s.root.personId ? /* @__PURE__ */ l("div", { className: v.threadCommentIcon, onClick: L, children: /* @__PURE__ */ l(De, {}) }) : null
553
556
  ] }) : null
554
557
  ] }),
555
- /* @__PURE__ */ l("div", { className: C.threadCommentContent, ref: D, children: ie.map(
558
+ /* @__PURE__ */ l("div", { className: v.threadCommentContent, ref: $, children: ie.map(
556
559
  (x) => /* @__PURE__ */ l(
557
560
  sn,
558
561
  {
559
- onClose: p,
560
- unitId: n,
561
- subUnitId: r,
562
+ onClose: g,
563
+ unitId: r,
564
+ subUnitId: n,
562
565
  item: x,
563
- isRoot: x.id === (a == null ? void 0 : a.root.id),
564
- editing: d === x.id,
565
- resolved: a == null ? void 0 : a.root.resolved,
566
+ isRoot: x.id === (s == null ? void 0 : s.root.id),
567
+ editing: c === x.id,
568
+ resolved: s == null ? void 0 : s.root.resolved,
566
569
  type: y,
567
570
  onEditingChange: (i) => {
568
571
  u(i ? x.id : "");
569
572
  },
570
573
  onReply: (i) => {
571
574
  i && requestAnimationFrame(() => {
572
- var R;
573
- (R = G.current) == null || R.reply(Bt([{
575
+ var k;
576
+ (k = G.current) == null || k.reply(Bt([{
574
577
  type: "mention",
575
578
  content: {
576
579
  id: i.userID,
@@ -580,46 +583,46 @@ const Ae = A((t, e) => {
580
583
  });
581
584
  },
582
585
  onAddComment: m,
583
- onDeleteComment: v
586
+ onDeleteComment: f
584
587
  },
585
588
  x.id
586
589
  )
587
590
  ) }),
588
591
  Q ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
589
- Ae,
592
+ je,
590
593
  {
591
594
  ref: G,
592
595
  type: y,
593
- unitId: n,
594
- subUnitId: r,
596
+ unitId: r,
597
+ subUnitId: n,
595
598
  onSave: async ({ text: x, attachments: i }) => {
596
- const R = {
599
+ const k = {
597
600
  text: x,
598
601
  attachments: i,
599
602
  dT: ot(),
600
603
  id: nt(),
601
604
  ref: o,
602
605
  personId: b == null ? void 0 : b.userID,
603
- parentId: a == null ? void 0 : a.root.id,
604
- unitId: n,
605
- subUnitId: r,
606
- threadId: a == null ? void 0 : a.root.threadId
606
+ parentId: s == null ? void 0 : s.root.id,
607
+ unitId: r,
608
+ subUnitId: n,
609
+ threadId: s == null ? void 0 : s.root.threadId
607
610
  };
608
- (m == null ? void 0 : m(R)) !== !1 && (await h.executeCommand(
611
+ (m == null ? void 0 : m(k)) !== !1 && (await h.executeCommand(
609
612
  it.id,
610
613
  {
611
- unitId: n,
612
- subUnitId: r,
613
- comment: R
614
+ unitId: r,
615
+ subUnitId: n,
616
+ comment: k
614
617
  }
615
- ), D.current && (D.current.scrollTop = D.current.scrollHeight));
618
+ ), $.current && ($.current.scrollTop = $.current.scrollHeight));
616
619
  },
617
- autoFocus: k || !a,
620
+ autoFocus: w || !s,
618
621
  onCancel: () => {
619
- a || p == null || p();
622
+ s || g == null || g();
620
623
  }
621
624
  },
622
- `${k}`
625
+ `${w}`
623
626
  ) }) : null
624
627
  ]
625
628
  }
@@ -633,43 +636,43 @@ const Ae = A((t, e) => {
633
636
  }, _n = (t) => {
634
637
  const {
635
638
  unitId: e,
636
- subUnitId$: n,
637
- type: r,
639
+ subUnitId$: r,
640
+ type: n,
638
641
  onAdd: o,
639
- getSubUnitName: s,
640
- onResolve: c,
641
- sortComments: g,
642
- onItemLeave: p,
642
+ getSubUnitName: a,
643
+ onResolve: d,
644
+ sortComments: C,
645
+ onItemLeave: g,
643
646
  onItemEnter: N,
644
- disableAdd: P,
645
- tempComment: k,
646
- onAddComment: O,
647
+ disableAdd: O,
648
+ tempComment: w,
649
+ onAddComment: P,
647
650
  onDeleteComment: U,
648
651
  showComments: m
649
- } = t, [v, M] = V("all"), [y, $] = V("all"), I = T(fe), w = T(pe), d = T(Ee), [u, f] = V(() => d.getUnit(e)), a = T(Y), h = W(a.activeCommentId$), K = W(d.commentUpdate$), _ = T(oe), b = W(n), G = re(!0), ie = "panel", D = W(w.currentUser$), q = ne(() => {
652
+ } = t, [f, M] = V("all"), [y, H] = V("all"), I = T(fe), R = T(pe), c = T(Ee), [u, p] = V(() => c.getUnit(e)), s = T(Y), h = W(s.activeCommentId$), K = W(c.commentUpdate$), _ = T(oe), b = W(r), G = re(!0), ie = "panel", $ = W(R.currentUser$), q = ne(() => {
650
653
  var de;
651
- const i = v === "all" ? u : (de = u.filter((E) => E.subUnitId === b)) != null ? de : [], R = g != null ? g : (E) => E, le = i.map((E) => {
652
- var j;
653
- return { ...E.root, children: (j = E.children) != null ? j : [], users: E.relativeUsers };
654
+ const i = f === "all" ? u : (de = u.filter((E) => E.subUnitId === b)) != null ? de : [], k = C != null ? C : (E) => E, le = i.map((E) => {
655
+ var A;
656
+ return { ...E.root, children: (A = E.children) != null ? A : [], users: E.relativeUsers };
654
657
  });
655
658
  if (m) {
656
659
  const E = /* @__PURE__ */ new Map();
657
- return le.forEach((j) => {
658
- E.set(j.id, j);
659
- }), [...m, ""].map((j) => E.get(j)).filter(Boolean);
660
+ return le.forEach((A) => {
661
+ E.set(A.id, A);
662
+ }), [...m, ""].map((A) => E.get(A)).filter(Boolean);
660
663
  } else
661
- return R(le);
662
- }, [m, v, u, g, b]), L = ne(() => [
664
+ return k(le);
665
+ }, [m, f, u, C, b]), L = ne(() => [
663
666
  ...q.filter((i) => !i.resolved),
664
667
  ...q.filter((i) => i.resolved)
665
- ], [q]), J = ne(() => y === "resolved" ? L.filter((i) => i.resolved) : y === "unsolved" ? L.filter((i) => !i.resolved) : y === "concern_me" && D != null && D.userID ? L.filter((i) => i == null ? void 0 : i.users.has(D.userID)) : L, [L, D == null ? void 0 : D.userID, y]), Q = k ? [k, ...J] : J, ae = Q.filter((i) => !i.resolved), X = Q.filter((i) => i.resolved), ee = y !== "all" || v !== "all", se = () => {
666
- $("all"), M("all");
668
+ ], [q]), J = ne(() => y === "resolved" ? L.filter((i) => i.resolved) : y === "unsolved" ? L.filter((i) => !i.resolved) : y === "concern_me" && $ != null && $.userID ? L.filter((i) => i == null ? void 0 : i.users.has($.userID)) : L, [L, $ == null ? void 0 : $.userID, y]), Q = w ? [w, ...J] : J, ae = Q.filter((i) => !i.resolved), X = Q.filter((i) => i.resolved), ee = y !== "all" || f !== "all", se = () => {
669
+ H("all"), M("all");
667
670
  };
668
671
  me(() => {
669
- e && f(
670
- d.getUnit(e)
672
+ e && p(
673
+ c.getUnit(e)
671
674
  );
672
- }, [e, d, K]), me(() => {
675
+ }, [e, c, K]), me(() => {
673
676
  var E;
674
677
  if (!h)
675
678
  return;
@@ -677,19 +680,19 @@ const Ae = A((t, e) => {
677
680
  G.current = !0;
678
681
  return;
679
682
  }
680
- const { unitId: i, subUnitId: R, commentId: le } = h, de = `${ie}-${i}-${R}-${le}`;
683
+ const { unitId: i, subUnitId: k, commentId: le } = h, de = `${ie}-${i}-${k}-${le}`;
681
684
  (E = document.getElementById(de)) == null || E.scrollIntoView({ block: "center" });
682
685
  }, [h]);
683
686
  const x = (i) => /* @__PURE__ */ l(
684
687
  ln,
685
688
  {
686
689
  prefix: ie,
687
- getSubUnitName: s,
690
+ getSubUnitName: a,
688
691
  id: i.id,
689
692
  unitId: i.unitId,
690
693
  subUnitId: i.subUnitId,
691
694
  refStr: i.ref,
692
- type: r,
695
+ type: n,
693
696
  showEdit: (h == null ? void 0 : h.commentId) === i.id,
694
697
  showHighlight: (h == null ? void 0 : h.commentId) === i.id,
695
698
  onClick: () => {
@@ -704,20 +707,20 @@ const Ae = A((t, e) => {
704
707
  );
705
708
  },
706
709
  onMouseEnter: () => N == null ? void 0 : N(i),
707
- onMouseLeave: () => p == null ? void 0 : p(i),
708
- onAddComment: O,
710
+ onMouseLeave: () => g == null ? void 0 : g(i),
711
+ onAddComment: P,
709
712
  onDeleteComment: U,
710
- onResolve: (R) => c == null ? void 0 : c(i.id, R)
713
+ onResolve: (k) => d == null ? void 0 : d(i.id, k)
711
714
  },
712
715
  i.id
713
716
  );
714
717
  return /* @__PURE__ */ S("div", { className: te.threadCommentPanel, children: [
715
718
  /* @__PURE__ */ S("div", { className: te.threadCommentPanelForms, children: [
716
- r === he.UNIVER_SHEET ? /* @__PURE__ */ l(
719
+ n === he.UNIVER_SHEET ? /* @__PURE__ */ l(
717
720
  Se,
718
721
  {
719
722
  borderless: !0,
720
- value: v,
723
+ value: f,
721
724
  onChange: (i) => M(i),
722
725
  options: [
723
726
  {
@@ -736,7 +739,7 @@ const Ae = A((t, e) => {
736
739
  {
737
740
  borderless: !0,
738
741
  value: y,
739
- onChange: (i) => $(i),
742
+ onChange: (i) => H(i),
740
743
  options: [
741
744
  {
742
745
  value: "all",
@@ -777,9 +780,9 @@ const Ae = A((t, e) => {
777
780
  className: te.threadCommentPanelAdd,
778
781
  type: "primary",
779
782
  onClick: o,
780
- disabled: P,
783
+ disabled: O,
781
784
  children: [
782
- /* @__PURE__ */ l($e, {}),
785
+ /* @__PURE__ */ l(He, {}),
783
786
  I.t("threadCommentUI.panel.addComment")
784
787
  ]
785
788
  }