@univerjs/thread-comment-ui 0.6.1 → 0.6.2

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