@univerjs/thread-comment-ui 0.16.1 → 0.17.0-insiders.20260318-d69dc16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/lib/cjs/index.js +55 -4
  2. package/lib/cjs/locale/ca-ES.js +1 -1
  3. package/lib/cjs/locale/en-US.js +1 -1
  4. package/lib/cjs/locale/es-ES.js +1 -1
  5. package/lib/cjs/locale/fa-IR.js +1 -1
  6. package/lib/cjs/locale/fr-FR.js +1 -1
  7. package/lib/cjs/locale/ja-JP.js +1 -1
  8. package/lib/cjs/locale/ko-KR.js +1 -1
  9. package/lib/cjs/locale/ru-RU.js +1 -1
  10. package/lib/cjs/locale/sk-SK.js +1 -1
  11. package/lib/cjs/locale/vi-VN.js +1 -1
  12. package/lib/cjs/locale/zh-CN.js +1 -1
  13. package/lib/cjs/locale/zh-TW.js +1 -1
  14. package/lib/es/index.js +55 -1048
  15. package/lib/es/locale/ca-ES.js +1 -37
  16. package/lib/es/locale/en-US.js +1 -37
  17. package/lib/es/locale/es-ES.js +1 -37
  18. package/lib/es/locale/fa-IR.js +1 -37
  19. package/lib/es/locale/fr-FR.js +1 -37
  20. package/lib/es/locale/ja-JP.js +1 -37
  21. package/lib/es/locale/ko-KR.js +1 -37
  22. package/lib/es/locale/ru-RU.js +1 -37
  23. package/lib/es/locale/sk-SK.js +1 -37
  24. package/lib/es/locale/vi-VN.js +1 -37
  25. package/lib/es/locale/zh-CN.js +1 -37
  26. package/lib/es/locale/zh-TW.js +1 -37
  27. package/lib/index.css +358 -1
  28. package/lib/index.js +55 -1048
  29. package/lib/locale/ca-ES.js +1 -37
  30. package/lib/locale/en-US.js +1 -37
  31. package/lib/locale/es-ES.js +1 -37
  32. package/lib/locale/fa-IR.js +1 -37
  33. package/lib/locale/fr-FR.js +1 -37
  34. package/lib/locale/ja-JP.js +1 -37
  35. package/lib/locale/ko-KR.js +1 -37
  36. package/lib/locale/ru-RU.js +1 -37
  37. package/lib/locale/sk-SK.js +1 -37
  38. package/lib/locale/vi-VN.js +1 -37
  39. package/lib/locale/zh-CN.js +1 -37
  40. package/lib/locale/zh-TW.js +1 -37
  41. package/lib/types/commands/operations/comment.operations.d.ts +16 -1
  42. package/lib/types/config/config.d.ts +24 -0
  43. package/lib/types/index.d.ts +1 -1
  44. package/lib/types/locale/ca-ES.d.ts +16 -1
  45. package/lib/types/locale/es-ES.d.ts +16 -1
  46. package/lib/types/locale/fa-IR.d.ts +16 -1
  47. package/lib/types/locale/fr-FR.d.ts +16 -1
  48. package/lib/types/locale/ja-JP.d.ts +16 -1
  49. package/lib/types/locale/ko-KR.d.ts +16 -1
  50. package/lib/types/locale/ru-RU.d.ts +16 -1
  51. package/lib/types/locale/sk-SK.d.ts +16 -1
  52. package/lib/types/locale/vi-VN.d.ts +16 -1
  53. package/lib/types/locale/zh-CN.d.ts +16 -1
  54. package/lib/types/locale/zh-TW.d.ts +16 -1
  55. package/lib/types/plugin.d.ts +18 -1
  56. package/lib/types/services/thread-comment-panel.service.d.ts +19 -3
  57. package/lib/types/views/thread-comment-editor/index.d.ts +19 -3
  58. package/lib/types/views/thread-comment-editor/util.d.ts +17 -2
  59. package/lib/types/views/thread-comment-panel/index.d.ts +20 -4
  60. package/lib/types/views/thread-comment-tree/index.d.ts +17 -2
  61. package/lib/umd/index.js +55 -4
  62. package/lib/umd/locale/ca-ES.js +1 -1
  63. package/lib/umd/locale/en-US.js +1 -1
  64. package/lib/umd/locale/es-ES.js +1 -1
  65. package/lib/umd/locale/fa-IR.js +1 -1
  66. package/lib/umd/locale/fr-FR.js +1 -1
  67. package/lib/umd/locale/ja-JP.js +1 -1
  68. package/lib/umd/locale/ko-KR.js +1 -1
  69. package/lib/umd/locale/ru-RU.js +1 -1
  70. package/lib/umd/locale/sk-SK.js +1 -1
  71. package/lib/umd/locale/vi-VN.js +1 -1
  72. package/lib/umd/locale/zh-CN.js +1 -1
  73. package/lib/umd/locale/zh-TW.js +1 -1
  74. package/package.json +12 -11
  75. package/LICENSE +0 -176
  76. package/lib/types/controllers/config.schema.d.ts +0 -9
package/lib/es/index.js CHANGED
@@ -1,1048 +1,55 @@
1
- var He = Object.defineProperty;
2
- var Ve = (r, e, t) => e in r ? He(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var W = (r, e, t) => Ve(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as ye, IUniverInstanceService as je, Disposable as Pe, UniverInstanceType as de, CommandType as _e, DependentOn as Ae, Injector as Be, ICommandService as te, IConfigService as We, Plugin as Ze, merge as Fe, mergeOverrideWithDependencies as ze, LocaleService as he, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ke, BuildTextUtils as ue, DOCS_COMMENT_EDITOR_UNIT_ID_KEY as Ge, Tools as Ye, CustomRangeType as qe, getBodySlice as Je, UserManagerService as fe, generateRandomId as Qe } from "@univerjs/core";
5
- import { ISidebarService as we, useDependency as N, KeyCode as pe, useObservable as Z, useConfigValue as Xe, UI_PLUGIN_CONFIG_KEY as et } from "@univerjs/ui";
6
- import { BehaviorSubject as Ce, filter as tt, debounceTime as rt } from "rxjs";
7
- import { UniverThreadCommentPlugin as nt, ThreadCommentModel as Ne, getDT as it, AddCommentCommand as ot, ResolveCommentCommand as st, DeleteCommentTreeCommand as Se, UpdateCommentCommand as at, DeleteCommentCommand as lt } from "@univerjs/thread-comment";
8
- import { jsxs as I, jsx as a } from "react/jsx-runtime";
9
- import { Button as ae, clsx as ve, Tooltip as ct, scrollbarClassName as dt, borderClassName as ut, Dropdown as vt, Select as ge } from "@univerjs/design";
10
- import { useRef as ee, createElement as z, forwardRef as K, useState as P, useEffect as le, useMemo as X, useImperativeHandle as mt } from "react";
11
- import { IEditorService as ht, BreakLineCommand as ft, RichTextEditor as pt } from "@univerjs/docs-ui";
12
- var Ct = Object.getOwnPropertyDescriptor, gt = (r, e, t, n) => {
13
- for (var i = n > 1 ? void 0 : n ? Ct(e, t) : e, o = r.length - 1, c; o >= 0; o--)
14
- (c = r[o]) && (i = c(i) || i);
15
- return i;
16
- }, Ie = (r, e) => (t, n) => e(t, n, r);
17
- let Y = class extends Pe {
18
- constructor(e, t) {
19
- super();
20
- W(this, "_panelVisible", !1);
21
- W(this, "_panelVisible$", new Ce(!1));
22
- W(this, "_activeCommentId");
23
- W(this, "_activeCommentId$", new Ce(void 0));
24
- W(this, "panelVisible$", this._panelVisible$.asObservable());
25
- W(this, "activeCommentId$", this._activeCommentId$.asObservable());
26
- this._sidebarService = e, this._univerInstanceService = t, this._init(), this.disposeWithMe(() => {
27
- this._activeCommentId$.complete(), this._panelVisible$.complete();
28
- });
29
- }
30
- _init() {
31
- this.disposeWithMe(
32
- this._sidebarService.sidebarOptions$.subscribe((e) => {
33
- e.visible || this.setPanelVisible(!1);
34
- })
35
- ), this.disposeWithMe(
36
- this._univerInstanceService.getCurrentTypeOfUnit$(de.UNIVER_SHEET).pipe(tt((e) => !e)).subscribe(() => {
37
- this._sidebarService.close();
38
- })
39
- );
40
- }
41
- get panelVisible() {
42
- return this._panelVisible;
43
- }
44
- get activeCommentId() {
45
- return this._activeCommentId;
46
- }
47
- setPanelVisible(e) {
48
- this._panelVisible = e, this._panelVisible$.next(e);
49
- }
50
- setActiveComment(e) {
51
- this._activeCommentId = e, this._activeCommentId$.next(e);
52
- }
53
- };
54
- Y = gt([
55
- Ie(0, ye(we)),
56
- Ie(1, je)
57
- ], Y);
58
- const It = "thread-comment-panel", xt = "UNIVER_THREAD_COMMENT_UI_PLUGIN", bt = {
59
- id: "thread-comment-ui.operation.toggle-panel",
60
- type: _e.OPERATION,
61
- handler(r) {
62
- const e = r.get(we), t = r.get(Y);
63
- return t.panelVisible ? (e.close(), t.setPanelVisible(!1)) : (e.open({
64
- header: { title: "threadCommentUI.panel.title" },
65
- children: { label: It },
66
- width: 360
67
- }), t.setPanelVisible(!0)), !0;
68
- }
69
- }, F = {
70
- id: "thread-comment-ui.operation.set-active-comment",
71
- type: _e.OPERATION,
72
- handler(r, e) {
73
- return r.get(Y).setActiveComment(e), !0;
74
- }
75
- }, yt = "thread-comment-ui.config", xe = {};
76
- var _t = Object.defineProperty, wt = Object.getOwnPropertyDescriptor, Nt = (r, e, t) => e in r ? _t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, St = (r, e, t, n) => {
77
- for (var i = n > 1 ? void 0 : n ? wt(e, t) : e, o = r.length - 1, c; o >= 0; o--)
78
- (c = r[o]) && (i = c(i) || i);
79
- return i;
80
- }, me = (r, e) => (t, n) => e(t, n, r), $e = (r, e, t) => Nt(r, typeof e != "symbol" ? e + "" : e, t);
81
- let ce = class extends Ze {
82
- constructor(r = xe, e, t, n) {
83
- super(), this._config = r, this._injector = e, this._commandService = t, this._configService = n;
84
- const { menu: i, ...o } = Fe(
85
- {},
86
- xe,
87
- this._config
88
- );
89
- i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(yt, o);
90
- }
91
- onStarting() {
92
- var r;
93
- ze([
94
- [Y]
95
- ], (r = this._config) == null ? void 0 : r.overrides).forEach((e) => {
96
- this._injector.add(e);
97
- }), [bt, F].forEach((e) => {
98
- this._commandService.registerCommand(e);
99
- });
100
- }
101
- };
102
- $e(ce, "pluginName", xt);
103
- $e(ce, "type", de.UNIVER_UNKNOWN);
104
- ce = St([
105
- Ae(nt),
106
- me(1, ye(Be)),
107
- me(2, te),
108
- me(3, We)
109
- ], ce);
110
- function G({ ref: r, ...e }) {
111
- const { icon: t, id: n, className: i, extend: o, ...c } = e, x = `univerjs-icon univerjs-icon-${n} ${i || ""}`.trim(), h = ee(`_${kt()}`);
112
- return Ue(t, `${n}`, {
113
- defIds: t.defIds,
114
- idSuffix: h.current
115
- }, {
116
- ref: r,
117
- className: x,
118
- ...c
119
- }, o);
120
- }
121
- function Ue(r, e, t, n, i) {
122
- return z(r.tag, {
123
- key: e,
124
- ...$t(r, t, i),
125
- ...n
126
- }, (Ut(r, t).children || []).map((o, c) => Ue(o, `${e}-${r.tag}-${c}`, t, void 0, i)));
127
- }
128
- function $t(r, e, t) {
129
- const n = { ...r.attrs };
130
- t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1), r.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(([o, c]) => {
131
- o === "mask" && typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
132
- });
133
- const { defIds: i } = e;
134
- return !i || i.length === 0 || (r.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(([o, c]) => {
135
- typeof c == "string" && (n[o] = c.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
136
- })), n;
137
- }
138
- function Ut(r, e) {
139
- var n;
140
- const { defIds: t } = e;
141
- return !t || t.length === 0 ? r : r.tag === "defs" && ((n = r.children) != null && n.length) ? {
142
- ...r,
143
- children: r.children.map((i) => typeof i.attrs.id == "string" && t && t.includes(i.attrs.id) ? {
144
- ...i,
145
- attrs: {
146
- ...i.attrs,
147
- id: i.attrs.id + e.idSuffix
148
- }
149
- } : i)
150
- } : r;
151
- }
152
- function kt() {
153
- return Math.random().toString(36).substring(2, 8);
154
- }
155
- G.displayName = "UniverIcon";
156
- const Tt = {
157
- tag: "svg",
158
- attrs: {
159
- xmlns: "http://www.w3.org/2000/svg",
160
- fill: "none",
161
- viewBox: "0 0 16 16",
162
- width: "1em",
163
- height: "1em"
164
- },
165
- children: [
166
- {
167
- tag: "path",
168
- attrs: {
169
- fill: "currentColor",
170
- d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z"
171
- }
172
- },
173
- {
174
- tag: "path",
175
- attrs: {
176
- fill: "currentColor",
177
- d: "M1.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.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z"
178
- }
179
- },
180
- {
181
- tag: "path",
182
- attrs: {
183
- fill: "currentColor",
184
- d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z"
185
- }
186
- },
187
- {
188
- tag: "path",
189
- attrs: {
190
- fill: "currentColor",
191
- 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",
192
- fillRule: "evenodd",
193
- clipRule: "evenodd"
194
- }
195
- }
196
- ]
197
- }, ke = K(function(e, t) {
198
- return z(G, Object.assign({}, e, {
199
- id: "delete-icon",
200
- ref: t,
201
- icon: Tt
202
- }));
203
- });
204
- ke.displayName = "DeleteIcon";
205
- const Dt = {
206
- tag: "svg",
207
- attrs: {
208
- xmlns: "http://www.w3.org/2000/svg",
209
- fill: "none",
210
- viewBox: "0 0 16 16",
211
- width: "1em",
212
- height: "1em"
213
- },
214
- children: [{
215
- tag: "path",
216
- attrs: {
217
- fill: "currentColor",
218
- 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"
219
- }
220
- }]
221
- }, Te = K(function(e, t) {
222
- return z(G, Object.assign({}, e, {
223
- id: "increase-icon",
224
- ref: t,
225
- icon: Dt
226
- }));
227
- });
228
- Te.displayName = "IncreaseIcon";
229
- const Et = {
230
- tag: "svg",
231
- attrs: {
232
- xmlns: "http://www.w3.org/2000/svg",
233
- fill: "none",
234
- viewBox: "0 0 16 16",
235
- width: "1em",
236
- height: "1em"
237
- },
238
- children: [
239
- {
240
- tag: "path",
241
- attrs: {
242
- fill: "currentColor",
243
- d: "M3 9C3.55228 9 4 8.55228 4 8C4 7.44772 3.55228 7 3 7C2.44772 7 2 7.44772 2 8C2 8.55228 2.44772 9 3 9Z"
244
- }
245
- },
246
- {
247
- tag: "path",
248
- attrs: {
249
- fill: "currentColor",
250
- d: "M8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9Z"
251
- }
252
- },
253
- {
254
- tag: "path",
255
- attrs: {
256
- fill: "currentColor",
257
- d: "M13 9C13.5523 9 14 8.55228 14 8C14 7.44772 13.5523 7 13 7C12.4477 7 12 7.44772 12 8C12 8.55228 12.4477 9 13 9Z"
258
- }
259
- }
260
- ]
261
- }, De = K(function(e, t) {
262
- return z(G, Object.assign({}, e, {
263
- id: "more-horizontal-icon",
264
- ref: t,
265
- icon: Et
266
- }));
267
- });
268
- De.displayName = "MoreHorizontalIcon";
269
- const Mt = {
270
- tag: "svg",
271
- attrs: {
272
- xmlns: "http://www.w3.org/2000/svg",
273
- fill: "none",
274
- viewBox: "0 0 16 16",
275
- width: "1em",
276
- height: "1em"
277
- },
278
- children: [
279
- {
280
- tag: "path",
281
- attrs: {
282
- stroke: "currentColor",
283
- 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",
284
- strokeLinecap: "round",
285
- strokeLinejoin: "round",
286
- strokeWidth: 1.2
287
- }
288
- },
289
- {
290
- tag: "path",
291
- attrs: {
292
- stroke: "currentColor",
293
- 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",
294
- strokeLinecap: "round",
295
- strokeLinejoin: "round",
296
- strokeWidth: 1.2
297
- }
298
- },
299
- {
300
- tag: "path",
301
- attrs: {
302
- stroke: "currentColor",
303
- d: "M6.41016 6.1311H6.76813",
304
- strokeLinecap: "round",
305
- strokeWidth: 1.2
306
- }
307
- },
308
- {
309
- tag: "path",
310
- attrs: {
311
- stroke: "currentColor",
312
- d: "M8.91626 6.1311H9.27424",
313
- strokeLinecap: "round",
314
- strokeWidth: 1.2
315
- }
316
- },
317
- {
318
- tag: "path",
319
- attrs: {
320
- stroke: "currentColor",
321
- d: "M3.90454 6.1311H4.26252",
322
- strokeLinecap: "round",
323
- strokeWidth: 1.2
324
- }
325
- }
326
- ]
327
- }, Ee = K(function(e, t) {
328
- return z(G, Object.assign({}, e, {
329
- id: "reply-to-comment-icon",
330
- ref: t,
331
- icon: Mt
332
- }));
333
- });
334
- Ee.displayName = "ReplyToCommentIcon";
335
- const Ot = {
336
- tag: "svg",
337
- attrs: {
338
- xmlns: "http://www.w3.org/2000/svg",
339
- fill: "none",
340
- viewBox: "0 0 17 17",
341
- width: "1em",
342
- height: "1em"
343
- },
344
- children: [{
345
- tag: "path",
346
- attrs: {
347
- fill: "currentColor",
348
- 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",
349
- fillRule: "evenodd",
350
- clipRule: "evenodd"
351
- }
352
- }]
353
- }, Me = K(function(e, t) {
354
- return z(G, Object.assign({}, e, {
355
- id: "resolved-icon",
356
- ref: t,
357
- icon: Ot
358
- }));
359
- });
360
- Me.displayName = "ResolvedIcon";
361
- const Rt = {
362
- tag: "svg",
363
- attrs: {
364
- xmlns: "http://www.w3.org/2000/svg",
365
- fill: "none",
366
- viewBox: "0 0 17 17",
367
- width: "1em",
368
- height: "1em"
369
- },
370
- children: [{
371
- tag: "circle",
372
- attrs: {
373
- cx: 8.73,
374
- cy: 8.4,
375
- r: 6.4,
376
- stroke: "currentColor",
377
- strokeWidth: 1.2
378
- }
379
- }, {
380
- tag: "path",
381
- attrs: {
382
- stroke: "currentColor",
383
- d: "M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",
384
- strokeLinecap: "round",
385
- strokeLinejoin: "round",
386
- strokeWidth: 1.2
387
- }
388
- }]
389
- }, Oe = K(function(e, t) {
390
- return z(G, Object.assign({}, e, {
391
- id: "solve-icon",
392
- ref: t,
393
- icon: Rt
394
- }));
395
- });
396
- Oe.displayName = "SolveIcon";
397
- function be(r) {
398
- return {
399
- id: "d",
400
- body: r,
401
- documentStyle: {}
402
- };
403
- }
404
- const Re = K((r, e) => {
405
- var O;
406
- const { comment: t, onSave: n, id: i, onCancel: o, autoFocus: c, unitId: x, type: h } = r, S = N(te), U = N(he), [V, k] = P(!1), b = N(ht), u = ee(null), v = h === de.UNIVER_DOC ? Ke : x, [T, y] = P(() => {
407
- var d, m, f;
408
- return ue.transform.getPlainText((f = (m = (d = u.current) == null ? void 0 : d.getDocumentData().body) == null ? void 0 : m.dataStream) != null ? f : "");
409
- });
410
- le(() => {
411
- var m, f, _, p;
412
- y(ue.transform.getPlainText((_ = (f = (m = u.current) == null ? void 0 : m.getDocumentData().body) == null ? void 0 : f.dataStream) != null ? _ : ""));
413
- const d = (p = u.current) == null ? void 0 : p.selectionChange$.subscribe(() => {
414
- var s, w, A;
415
- y(ue.transform.getPlainText((A = (w = (s = u.current) == null ? void 0 : s.getDocumentData().body) == null ? void 0 : w.dataStream) != null ? A : ""));
416
- });
417
- return () => d == null ? void 0 : d.unsubscribe();
418
- }, [(O = u.current) == null ? void 0 : O.selectionChange$]);
419
- const j = X(() => ({
420
- keyCodes: [{ keyCode: pe.ENTER }],
421
- handler: (d) => {
422
- d === pe.ENTER && S.executeCommand(
423
- ft.id
424
- );
425
- }
426
- }), [S]);
427
- mt(e, () => ({
428
- reply(d) {
429
- var f, _;
430
- if (!u.current)
431
- return;
432
- b.focus((f = u.current.getEditorId()) != null ? f : "");
433
- const m = be(d);
434
- (_ = u.current) == null || _.setDocumentData(m, [{
435
- startOffset: m.body.dataStream.length - 2,
436
- endOffset: m.body.dataStream.length - 2,
437
- collapsed: !0
438
- }]);
439
- }
440
- }));
441
- const C = () => {
442
- if (u.current) {
443
- const d = Ye.deepClone(u.current.getDocumentData().body);
444
- k(!1), n == null || n({
445
- ...t,
446
- text: d
447
- }), u.current.replaceText(""), setTimeout(() => {
448
- var m, f;
449
- (m = u.current) == null || m.setSelectionRanges([]), (f = u.current) == null || f.blur();
450
- }, 10);
451
- }
452
- };
453
- return /* @__PURE__ */ I("div", { onClick: (d) => d.preventDefault(), children: [
454
- /* @__PURE__ */ a(
455
- pt,
456
- {
457
- className: "univer-w-full",
458
- editorRef: u,
459
- editorId: Ge,
460
- autoFocus: c,
461
- keyboardEventConfig: j,
462
- placeholder: U.t("threadCommentUI.editor.placeholder"),
463
- initialValue: (t == null ? void 0 : t.text) && be(t.text),
464
- onFocusChange: (d) => d && k(d),
465
- isSingle: !1,
466
- maxHeight: 64,
467
- onClickOutside: () => {
468
- setTimeout(() => {
469
- b.focus(v);
470
- }, 30);
471
- }
472
- }
473
- ),
474
- V ? /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
475
- /* @__PURE__ */ a(
476
- ae,
477
- {
478
- onClick: () => {
479
- var d;
480
- o == null || o(), k(!1), (d = u.current) == null || d.replaceText("", !0), S.executeCommand(F.id);
481
- },
482
- children: U.t("threadCommentUI.editor.cancel")
483
- }
484
- ),
485
- /* @__PURE__ */ a(
486
- ae,
487
- {
488
- variant: "primary",
489
- disabled: !T,
490
- onClick: C,
491
- children: U.t(i ? "threadCommentUI.editor.save" : "threadCommentUI.editor.reply")
492
- }
493
- )
494
- ] }) : null
495
- ] });
496
- }), Lt = (r) => {
497
- const { dataStream: e, customRanges: t } = r, n = e.endsWith(`\r
498
- `) ? e.length - 2 : e.length, i = [];
499
- let o = 0;
500
- return t == null || t.forEach((c) => {
501
- o < c.startIndex && i.push({
502
- type: "text",
503
- content: e.slice(o, c.startIndex)
504
- }), i.push({
505
- type: "mention",
506
- content: {
507
- label: e.slice(c.startIndex, c.endIndex + 1),
508
- id: c.rangeId
509
- }
510
- }), o = c.endIndex + 1;
511
- }), i.push({
512
- type: "text",
513
- content: e.slice(o, n)
514
- }), i;
515
- }, Ht = (r) => {
516
- if (!r)
517
- return [];
518
- const { paragraphs: e = [] } = r;
519
- return e.map((t, n) => {
520
- const i = n === 0 ? 0 : e[n - 1].startIndex + 1, o = Je(r, i, t.startIndex);
521
- return Lt(o);
522
- });
523
- }, Vt = (r) => {
524
- let e = "";
525
- const t = [];
526
- return r.forEach((n) => {
527
- switch (n.type) {
528
- case "text":
529
- e += n.content;
530
- break;
531
- case "mention": {
532
- const i = e.length;
533
- e += n.content.label;
534
- const o = e.length - 1;
535
- t.push({
536
- rangeId: n.content.id,
537
- rangeType: qe.MENTION,
538
- startIndex: i,
539
- endIndex: o,
540
- properties: {},
541
- wholeEntity: !0
542
- });
543
- break;
544
- }
545
- }
546
- }), e += `\r
547
- `, {
548
- textRuns: [],
549
- paragraphs: [
550
- {
551
- startIndex: e.length - 2,
552
- paragraphStyle: {}
553
- }
554
- ],
555
- sectionBreaks: [
556
- {
557
- startIndex: e.length - 1
558
- }
559
- ],
560
- dataStream: e,
561
- customRanges: t
562
- };
563
- }, Le = "__mock__", jt = (r) => {
564
- const { item: e, unitId: t, subUnitId: n, editing: i, onEditingChange: o, onReply: c, resolved: x, isRoot: h, onClose: S, onDeleteComment: U, type: V } = r, k = N(te), b = N(he), u = N(fe), v = u.getUser(e.personId), T = Z(u.currentUser$), y = (T == null ? void 0 : T.userID) === e.personId, j = e.id === Le, [C, O] = P(!1), d = Xe(et), m = d == null ? void 0 : d.avatarFallback, f = () => {
565
- (U == null ? void 0 : U(e)) !== !1 && (k.executeCommand(
566
- h ? Se.id : lt.id,
567
- {
568
- unitId: t,
569
- subUnitId: n,
570
- commentId: e.id
571
- }
572
- ), h && (S == null || S()));
573
- };
574
- return /* @__PURE__ */ I("div", { className: "univer-relative univer-mb-3 univer-pl-[30px]", onMouseLeave: () => O(!1), onMouseEnter: () => O(!0), children: [
575
- /* @__PURE__ */ a(
576
- "div",
577
- {
578
- className: "univer-absolute univer-left-0 univer-top-0 univer-size-6 univer-rounded-full univer-bg-cover univer-bg-center univer-bg-no-repeat",
579
- style: {
580
- backgroundImage: `url(${(v == null ? void 0 : v.avatar) || m})`
581
- }
582
- }
583
- ),
584
- v ? /* @__PURE__ */ I("div", { className: "univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between", children: [
585
- /* @__PURE__ */ a("div", { className: "univer-text-sm univer-font-medium univer-leading-5", children: (v == null ? void 0 : v.name) || " " }),
586
- /* @__PURE__ */ I("div", { children: [
587
- j || x ? null : C && v ? /* @__PURE__ */ a(
588
- "div",
589
- {
590
- className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
591
- onClick: () => c(v),
592
- children: /* @__PURE__ */ a(Ee, {})
593
- }
594
- ) : null,
595
- y && !j && !x ? /* @__PURE__ */ a(
596
- vt,
597
- {
598
- overlay: /* @__PURE__ */ a("div", { className: "univer-rounded-lg", children: /* @__PURE__ */ I(
599
- "ul",
600
- {
601
- className: "univer-m-0 univer-box-border univer-grid univer-list-none univer-p-1.5 univer-text-sm [&_a]:univer-block [&_a]:univer-cursor-pointer [&_a]:univer-rounded [&_a]:univer-px-2 [&_a]:univer-py-1.5 [&_a]:univer-transition-colors",
602
- children: [
603
- /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
604
- "a",
605
- {
606
- className: "hover:univer-bg-gray-200",
607
- onClick: () => o == null ? void 0 : o(!0),
608
- children: b.t("threadCommentUI.item.edit")
609
- }
610
- ) }),
611
- /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
612
- "a",
613
- {
614
- className: "hover:univer-bg-gray-200",
615
- onClick: f,
616
- children: b.t("threadCommentUI.item.delete")
617
- }
618
- ) })
619
- ]
620
- }
621
- ) }),
622
- children: /* @__PURE__ */ a(
623
- "div",
624
- {
625
- className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-sm univer-text-base hover:univer-bg-gray-50",
626
- children: /* @__PURE__ */ a(De, {})
627
- }
628
- )
629
- }
630
- ) : null
631
- ] })
632
- ] }) : null,
633
- /* @__PURE__ */ a(
634
- "time",
635
- {
636
- className: "univer-mb-1 univer-text-xs/normal univer-text-gray-600 dark:!univer-text-gray-200",
637
- children: e.dT
638
- }
639
- ),
640
- i ? /* @__PURE__ */ a(
641
- Re,
642
- {
643
- type: V,
644
- id: e.id,
645
- comment: e,
646
- onCancel: () => o == null ? void 0 : o(!1),
647
- autoFocus: !0,
648
- unitId: t,
649
- subUnitId: n,
650
- onSave: ({ text: _, attachments: p }) => {
651
- o == null || o(!1), k.executeCommand(
652
- at.id,
653
- {
654
- unitId: t,
655
- subUnitId: n,
656
- payload: {
657
- commentId: e.id,
658
- text: _,
659
- attachments: p
660
- }
661
- }
662
- );
663
- }
664
- }
665
- ) : /* @__PURE__ */ a(
666
- "div",
667
- {
668
- className: "univer-text-sm univer-text-gray-900 dark:!univer-text-white",
669
- children: Ht(e.text).map((_, p) => /* @__PURE__ */ a("div", { className: "univer-break-words", children: _.map((s, w) => s.type === "mention" ? /* @__PURE__ */ I("a", { className: "univer-text-primary-600", children: [
670
- s.content.label,
671
- " "
672
- ] }, w) : s.content) }, p))
673
- }
674
- )
675
- ] });
676
- }, Pt = (r) => {
677
- var se, Q, l;
678
- const {
679
- id: e,
680
- unitId: t,
681
- subUnitId: n,
682
- refStr: i,
683
- showEdit: o = !0,
684
- onClick: c,
685
- showHighlight: x,
686
- onClose: h,
687
- getSubUnitName: S,
688
- prefix: U,
689
- autoFocus: V,
690
- onMouseEnter: k,
691
- onMouseLeave: b,
692
- onAddComment: u,
693
- onDeleteComment: v,
694
- onResolve: T,
695
- type: y,
696
- style: j,
697
- full: C
698
- } = r, O = N(Ne), [d, m] = P(!1), [f, _] = P(""), p = X(() => O.commentUpdate$.pipe(rt(16)), [O]);
699
- Z(p);
700
- const s = e ? O.getCommentWithChildren(t, n, e) : null, w = N(te), A = N(fe), D = s == null ? void 0 : s.root.resolved, E = Z(A.currentUser$), L = ee(null), q = [
701
- ...s ? [s.root] : (
702
- // mock empty comment
703
- [{
704
- id: Le,
705
- text: {
706
- dataStream: `
707
- \r`
708
- },
709
- personId: (se = E == null ? void 0 : E.userID) != null ? se : "",
710
- ref: i != null ? i : "",
711
- dT: "",
712
- unitId: t,
713
- subUnitId: n,
714
- threadId: ""
715
- }]
716
- ),
717
- ...(Q = s == null ? void 0 : s.children) != null ? Q : []
718
- ], R = ee(null), re = (g) => {
719
- g.stopPropagation(), D ? w.executeCommand(F.id, {
720
- unitId: t,
721
- subUnitId: n,
722
- commentId: e
723
- }) : w.executeCommand(F.id), w.executeCommand(st.id, {
724
- unitId: t,
725
- subUnitId: n,
726
- commentId: e,
727
- resolved: !D
728
- }), T == null || T(!D);
729
- }, J = (g) => {
730
- g.stopPropagation(), w.executeCommand(F.id), !(s != null && s.root && (v == null ? void 0 : v(s.root)) === !1) && (w.executeCommand(
731
- Se.id,
732
- {
733
- unitId: t,
734
- subUnitId: n,
735
- commentId: e
736
- }
737
- ), h == null || h());
738
- };
739
- le(() => b == null ? void 0 : b(), []);
740
- const ne = S((l = s == null ? void 0 : s.root.subUnitId) != null ? l : n), ie = o && !f && !D, oe = `${i || (s == null ? void 0 : s.root.ref) || ""}${ne ? " · " : ""}${ne}`;
741
- return /* @__PURE__ */ I(
742
- "div",
743
- {
744
- id: `${U}-${t}-${n}-${e}`,
745
- className: ve("univer-relative univer-box-border univer-rounded-md univer-bg-white univer-p-4 dark:!univer-bg-gray-900 dark:!univer-text-white", ut, {
746
- "univer-w-[278px]": !C,
747
- "univer-w-full": C,
748
- "univer-shadow": !D && (x || d || U === "cell")
749
- }),
750
- style: j,
751
- onClick: c,
752
- onMouseEnter: () => {
753
- k == null || k(), m(!0);
754
- },
755
- onMouseLeave: () => {
756
- b == null || b(), m(!1);
757
- },
758
- children: [
759
- !D && x && /* @__PURE__ */ a(
760
- "div",
761
- {
762
- className: "univer-absolute univer-left-0 univer-right-0 univer-top-0 univer-h-1.5 univer-rounded-t-md univer-bg-yellow-400"
763
- }
764
- ),
765
- /* @__PURE__ */ I(
766
- "div",
767
- {
768
- className: "univer-mb-4 univer-flex univer-flex-row univer-items-center univer-justify-between univer-text-sm univer-leading-5",
769
- children: [
770
- /* @__PURE__ */ I("div", { className: "univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden", children: [
771
- /* @__PURE__ */ a(
772
- "div",
773
- {
774
- className: "univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0 univer-rounded-sm univer-bg-yellow-500"
775
- }
776
- ),
777
- /* @__PURE__ */ a(ct, { showIfEllipsis: !0, title: oe, children: /* @__PURE__ */ a(
778
- "span",
779
- {
780
- className: "univer-flex-1 univer-truncate",
781
- children: oe
782
- }
783
- ) })
784
- ] }),
785
- !!s && /* @__PURE__ */ I("div", { className: "univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row", children: [
786
- /* @__PURE__ */ a(
787
- "div",
788
- {
789
- className: ve("univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800", {
790
- "univer-text-green-500": D
791
- }),
792
- onClick: re,
793
- children: D ? /* @__PURE__ */ a(Me, {}) : /* @__PURE__ */ a(Oe, {})
794
- }
795
- ),
796
- (E == null ? void 0 : E.userID) === s.root.personId ? /* @__PURE__ */ a(
797
- "div",
798
- {
799
- className: "univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800",
800
- onClick: J,
801
- children: /* @__PURE__ */ a(ke, {})
802
- }
803
- ) : null
804
- ] })
805
- ]
806
- }
807
- ),
808
- /* @__PURE__ */ a(
809
- "div",
810
- {
811
- ref: R,
812
- className: ve("univer-max-h-80 univer-overflow-y-auto univer-overflow-x-hidden", dt),
813
- children: q.map(
814
- (g) => /* @__PURE__ */ a(
815
- jt,
816
- {
817
- unitId: t,
818
- subUnitId: n,
819
- item: g,
820
- isRoot: g.id === (s == null ? void 0 : s.root.id),
821
- editing: f === g.id,
822
- resolved: s == null ? void 0 : s.root.resolved,
823
- type: y,
824
- onClose: h,
825
- onEditingChange: (M) => {
826
- _(M ? g.id : "");
827
- },
828
- onReply: (M) => {
829
- M && requestAnimationFrame(() => {
830
- var H;
831
- (H = L.current) == null || H.reply(Vt([
832
- {
833
- type: "mention",
834
- content: {
835
- id: M.userID,
836
- label: `@${M.name}`
837
- }
838
- },
839
- {
840
- type: "text",
841
- content: " "
842
- }
843
- ]));
844
- });
845
- },
846
- onAddComment: u,
847
- onDeleteComment: v
848
- },
849
- g.id
850
- )
851
- )
852
- }
853
- ),
854
- ie && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
855
- Re,
856
- {
857
- ref: L,
858
- type: y,
859
- unitId: t,
860
- subUnitId: n,
861
- onSave: async ({ text: g, attachments: M }) => {
862
- const H = {
863
- text: g,
864
- attachments: M,
865
- dT: it(),
866
- id: Qe(),
867
- ref: i,
868
- personId: E == null ? void 0 : E.userID,
869
- parentId: s == null ? void 0 : s.root.id,
870
- unitId: t,
871
- subUnitId: n,
872
- threadId: s == null ? void 0 : s.root.threadId
873
- };
874
- (u == null ? void 0 : u(H)) !== !1 && (await w.executeCommand(
875
- ot.id,
876
- {
877
- unitId: t,
878
- subUnitId: n,
879
- comment: H
880
- }
881
- ), R.current && (R.current.scrollTop = R.current.scrollHeight));
882
- },
883
- autoFocus: V || !s,
884
- onCancel: () => {
885
- s || h == null || h();
886
- }
887
- },
888
- `${V}`
889
- ) })
890
- ]
891
- }
892
- );
893
- }, qt = (r) => {
894
- const {
895
- unitId: e,
896
- subUnitId$: t,
897
- type: n,
898
- onAdd: i,
899
- getSubUnitName: o,
900
- onResolve: c,
901
- sortComments: x,
902
- onItemLeave: h,
903
- onItemEnter: S,
904
- disableAdd: U,
905
- tempComment: V,
906
- onAddComment: k,
907
- onDeleteComment: b,
908
- showComments: u
909
- } = r, [v, T] = P("all"), [y, j] = P("all"), C = N(he), O = N(fe), d = N(Ne), [m, f] = P(() => d.getUnit(e)), _ = N(Y), p = Z(_.activeCommentId$), s = Z(d.commentUpdate$), w = N(te), A = Z(t), D = ee(!0), E = "panel", L = Z(O.currentUser$), q = X(() => {
910
- var H;
911
- const l = v === "all" ? m : (H = m.filter(($) => $.subUnitId === A)) != null ? H : [], g = x != null ? x : (($) => $), M = l.map(($) => {
912
- var B;
913
- return { ...$.root, children: (B = $.children) != null ? B : [], users: $.relativeUsers };
914
- });
915
- if (u) {
916
- const $ = /* @__PURE__ */ new Map();
917
- return M.forEach((B) => {
918
- $.set(B.id, B);
919
- }), [...u, ""].map((B) => $.get(B)).filter(Boolean);
920
- } else
921
- return g(M);
922
- }, [u, v, m, x, A]), R = X(() => [
923
- ...q.filter((l) => !l.resolved),
924
- ...q.filter((l) => l.resolved)
925
- ], [q]), re = X(() => y === "resolved" ? R.filter((l) => l.resolved) : y === "unsolved" ? R.filter((l) => !l.resolved) : y === "concern_me" && L != null && L.userID ? R.filter((l) => l == null ? void 0 : l.users.has(L.userID)) : R, [R, L == null ? void 0 : L.userID, y]), J = V ? [V, ...re] : re, ne = J.filter((l) => !l.resolved), ie = J.filter((l) => l.resolved), oe = y !== "all" || v !== "all", se = () => {
926
- j("all"), T("all");
927
- };
928
- le(() => {
929
- e && f(
930
- d.getUnit(e)
931
- );
932
- }, [e, d, s]), le(() => {
933
- var $;
934
- if (!p)
935
- return;
936
- if (!D.current) {
937
- D.current = !0;
938
- return;
939
- }
940
- const { unitId: l, subUnitId: g, commentId: M } = p, H = `${E}-${l}-${g}-${M}`;
941
- ($ = document.getElementById(H)) == null || $.scrollIntoView({ block: "center" });
942
- }, [p]);
943
- const Q = (l) => /* @__PURE__ */ a(
944
- Pt,
945
- {
946
- prefix: E,
947
- getSubUnitName: o,
948
- id: l.id,
949
- unitId: l.unitId,
950
- subUnitId: l.subUnitId,
951
- refStr: l.ref,
952
- type: n,
953
- showEdit: (p == null ? void 0 : p.commentId) === l.id,
954
- showHighlight: (p == null ? void 0 : p.commentId) === l.id,
955
- onClick: () => {
956
- D.current = !1, l.resolved ? w.executeCommand(F.id) : w.executeCommand(
957
- F.id,
958
- {
959
- unitId: l.unitId,
960
- subUnitId: l.subUnitId,
961
- commentId: l.id,
962
- temp: !1
963
- }
964
- );
965
- },
966
- onMouseEnter: () => S == null ? void 0 : S(l),
967
- onMouseLeave: () => h == null ? void 0 : h(l),
968
- onAddComment: k,
969
- onDeleteComment: b,
970
- onResolve: (g) => c == null ? void 0 : c(l.id, g)
971
- },
972
- l.id
973
- );
974
- return /* @__PURE__ */ I("div", { className: "univer-flex univer-min-h-full univer-flex-col univer-pb-3", children: [
975
- /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-row univer-justify-between", children: [
976
- n === de.UNIVER_SHEET ? /* @__PURE__ */ a(
977
- ge,
978
- {
979
- borderless: !0,
980
- value: v,
981
- options: [
982
- {
983
- value: "current",
984
- label: C.t("threadCommentUI.filter.sheet.current")
985
- },
986
- {
987
- value: "all",
988
- label: C.t("threadCommentUI.filter.sheet.all")
989
- }
990
- ],
991
- onChange: T
992
- }
993
- ) : null,
994
- /* @__PURE__ */ a(
995
- ge,
996
- {
997
- borderless: !0,
998
- value: y,
999
- options: [
1000
- {
1001
- value: "all",
1002
- label: C.t("threadCommentUI.filter.status.all")
1003
- },
1004
- {
1005
- value: "resolved",
1006
- label: C.t("threadCommentUI.filter.status.resolved")
1007
- },
1008
- {
1009
- value: "unsolved",
1010
- label: C.t("threadCommentUI.filter.status.unsolved")
1011
- },
1012
- {
1013
- value: "concern_me",
1014
- label: C.t("threadCommentUI.filter.status.concernMe")
1015
- }
1016
- ],
1017
- onChange: j
1018
- }
1019
- )
1020
- ] }),
1021
- J.length === 0 ? /* @__PURE__ */ I(
1022
- "div",
1023
- {
1024
- className: "univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1025
- children: [
1026
- C.t("threadCommentUI.panel.empty"),
1027
- oe ? /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ a(ae, { onClick: se, children: C.t("threadCommentUI.panel.reset") }) }) : U ? null : /* @__PURE__ */ a("div", { className: "univer-mt-2 univer-flex univer-flex-row", children: /* @__PURE__ */ I(ae, { onClick: i, children: [
1028
- /* @__PURE__ */ a(Te, { className: "univer-mr-1.5" }),
1029
- C.t("threadCommentUI.panel.addComment")
1030
- ] }) })
1031
- ]
1032
- }
1033
- ) : /* @__PURE__ */ I("div", { className: "univer-mt-3 univer-flex univer-flex-col univer-gap-3", children: [
1034
- ne.map(Q),
1035
- ie.length > 0 && /* @__PURE__ */ a("div", { className: "univer-text-xs", children: C.t("threadCommentUI.panel.solved") }),
1036
- ie.map(Q)
1037
- ] })
1038
- ] });
1039
- };
1040
- export {
1041
- F as SetActiveCommentOperation,
1042
- It as THREAD_COMMENT_PANEL,
1043
- qt as ThreadCommentPanel,
1044
- Y as ThreadCommentPanelService,
1045
- Pt as ThreadCommentTree,
1046
- bt as ToggleSheetCommentPanelOperation,
1047
- ce as UniverThreadCommentUIPlugin
1048
- };
1
+ import{BuildTextUtils as e,CommandType as t,CustomRangeType as n,DOCS_COMMENT_EDITOR_UNIT_ID_KEY as r,DOCS_NORMAL_EDITOR_UNIT_ID_KEY as i,DependentOn as a,Disposable as o,ICommandService as s,IConfigService as c,IUniverInstanceService as l,Inject as u,Injector as d,LocaleService as f,Plugin as p,Tools as m,UniverInstanceType as h,UserManagerService as g,generateRandomId as _,getBodySlice as v,merge as y,mergeOverrideWithDependencies as b}from"@univerjs/core";import{ISidebarService as x,KeyCode as S,UI_PLUGIN_CONFIG_KEY as C,useConfigValue as w,useDependency as T,useObservable as E}from"@univerjs/ui";import{BehaviorSubject as D,debounceTime as O,filter as k}from"rxjs";import{AddCommentCommand as A,DeleteCommentCommand as ee,DeleteCommentTreeCommand as j,ResolveCommentCommand as te,ThreadCommentModel as ne,UniverThreadCommentPlugin as M,UpdateCommentCommand as N,getDT as P}from"@univerjs/thread-comment";import{Button as F,Dropdown as I,Select as L,Tooltip as R,borderClassName as re,clsx as z,scrollbarClassName as ie}from"@univerjs/design";import{DeleteIcon as ae,IncreaseIcon as oe,MoreHorizontalIcon as B,ReplyToCommentIcon as V,ResolvedIcon as se,SolveIcon as ce}from"@univerjs/icons";import{forwardRef as le,useEffect as H,useImperativeHandle as ue,useMemo as U,useRef as de,useState as W}from"react";import{BreakLineCommand as G,IEditorService as fe,RichTextEditor as pe}from"@univerjs/docs-ui";import{jsx as K,jsxs as q}from"react/jsx-runtime";function J(e){"@babel/helpers - typeof";return J=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},J(e)}function me(e,t){if(J(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(J(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function he(e){var t=me(e,`string`);return J(t)==`symbol`?t:t+``}function Y(e,t,n){return(t=he(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X(e,t){return function(n,r){t(n,r,e)}}function ge(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let Z=class extends o{constructor(e,t){super(),this._sidebarService=e,this._univerInstanceService=t,Y(this,`_panelVisible`,!1),Y(this,`_panelVisible$`,new D(!1)),Y(this,`_activeCommentId`,void 0),Y(this,`_activeCommentId$`,new D(void 0)),Y(this,`panelVisible$`,this._panelVisible$.asObservable()),Y(this,`activeCommentId$`,this._activeCommentId$.asObservable()),this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(e=>{e.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(h.UNIVER_SHEET).pipe(k(e=>!e)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(e){this._panelVisible=e,this._panelVisible$.next(e)}setActiveComment(e){this._activeCommentId=e,this._activeCommentId$.next(e)}};Z=ge([X(0,u(x)),X(1,l)],Z);const _e=`thread-comment-panel`,ve={id:`thread-comment-ui.operation.toggle-panel`,type:t.OPERATION,handler(e){let t=e.get(x),n=e.get(Z);return n.panelVisible?(t.close(),n.setPanelVisible(!1)):(t.open({header:{title:`threadCommentUI.panel.title`},children:{label:_e},width:360}),n.setPanelVisible(!0)),!0}},Q={id:`thread-comment-ui.operation.set-active-comment`,type:t.OPERATION,handler(e,t){return e.get(Z).setActiveComment(t),!0}};var ye=`@univerjs/thread-comment-ui`,be=`0.17.0-insiders.20260318-d69dc16`;const xe=`thread-comment-ui.config`;Symbol(xe);const Se={};let $=class extends p{constructor(e=Se,t,n,r){super(),this._config=e,this._injector=t,this._commandService=n,this._configService=r;let{menu:i,...a}=y({},Se,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(xe,a)}onStarting(){var e;b([[Z]],(e=this._config)==null?void 0:e.overrides).forEach(e=>{this._injector.add(e)}),[ve,Q].forEach(e=>{this._commandService.registerCommand(e)})}};Y($,`pluginName`,`UNIVER_THREAD_COMMENT_UI_PLUGIN`),Y($,`packageName`,ye),Y($,`version`,be),Y($,`type`,h.UNIVER_UNKNOWN),$=ge([a(M),X(1,u(d)),X(2,s),X(3,c)],$);function Ce(e){return{id:`d`,body:e,documentStyle:{}}}const we=le((t,n)=>{var a;let{comment:o,onSave:c,id:l,onCancel:u,autoFocus:d,unitId:p,type:g}=t,_=T(s),v=T(f),[y,b]=W(!1),x=T(fe),C=de(null),w=g===h.UNIVER_DOC?i:p,[E,D]=W(()=>{var t,n;return e.transform.getPlainText((t=(n=C.current)==null||(n=n.getDocumentData().body)==null?void 0:n.dataStream)==null?``:t)});H(()=>{var t,n,r;D(e.transform.getPlainText((t=(n=C.current)==null||(n=n.getDocumentData().body)==null?void 0:n.dataStream)==null?``:t));let i=(r=C.current)==null?void 0:r.selectionChange$.subscribe(()=>{var t,n;D(e.transform.getPlainText((t=(n=C.current)==null||(n=n.getDocumentData().body)==null?void 0:n.dataStream)==null?``:t))});return()=>i==null?void 0:i.unsubscribe()},[(a=C.current)==null?void 0:a.selectionChange$]);let O=U(()=>({keyCodes:[{keyCode:S.ENTER}],handler:e=>{e===S.ENTER&&_.executeCommand(G.id)}}),[_]);return ue(n,()=>({reply(e){var t,n;if(!C.current)return;x.focus((t=C.current.getEditorId())==null?``:t);let r=Ce(e);(n=C.current)==null||n.setDocumentData(r,[{startOffset:r.body.dataStream.length-2,endOffset:r.body.dataStream.length-2,collapsed:!0}])}})),q(`div`,{onClick:e=>e.preventDefault(),children:[K(pe,{className:`univer-w-full`,editorRef:C,editorId:r,autoFocus:d,keyboardEventConfig:O,placeholder:v.t(`threadCommentUI.editor.placeholder`),initialValue:(o==null?void 0:o.text)&&Ce(o.text),onFocusChange:e=>e&&b(e),isSingle:!1,maxHeight:64,onClickOutside:()=>{setTimeout(()=>{x.focus(w)},30)}}),y?q(`div`,{className:`univer-mt-3 univer-flex univer-flex-row univer-justify-end univer-gap-2`,children:[K(F,{onClick:()=>{var e;u==null||u(),b(!1),(e=C.current)==null||e.replaceText(``,!0),_.executeCommand(Q.id)},children:v.t(`threadCommentUI.editor.cancel`)}),K(F,{variant:`primary`,disabled:!E,onClick:()=>{if(C.current){let e=m.deepClone(C.current.getDocumentData().body);b(!1),c==null||c({...o,text:e}),C.current.replaceText(``),setTimeout(()=>{var e,t;(e=C.current)==null||e.setSelectionRanges([]),(t=C.current)==null||t.blur()},10)}},children:v.t(l?`threadCommentUI.editor.save`:`threadCommentUI.editor.reply`)})]}):null]})}),Te=e=>{let{dataStream:t,customRanges:n}=e,r=t.endsWith(`\r
2
+ `)?t.length-2:t.length,i=[],a=0;return n==null||n.forEach(e=>{a<e.startIndex&&i.push({type:`text`,content:t.slice(a,e.startIndex)}),i.push({type:`mention`,content:{label:t.slice(e.startIndex,e.endIndex+1),id:e.rangeId}}),a=e.endIndex+1}),i.push({type:`text`,content:t.slice(a,r)}),i},Ee=e=>{if(!e)return[];let{paragraphs:t=[]}=e;return t.map((n,r)=>Te(v(e,r===0?0:t[r-1].startIndex+1,n.startIndex)))},De=e=>{let t=``,r=[];return e.forEach(e=>{switch(e.type){case`text`:t+=e.content;break;case`mention`:{let i=t.length;t+=e.content.label;let a=t.length-1;r.push({rangeId:e.content.id,rangeType:n.MENTION,startIndex:i,endIndex:a,properties:{},wholeEntity:!0});break}default:break}}),t+=`\r
3
+ `,{textRuns:[],paragraphs:[{startIndex:t.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:t.length-1}],dataStream:t,customRanges:r}},Oe=`__mock__`,ke=e=>{let{item:t,unitId:n,subUnitId:r,editing:i,onEditingChange:a,onReply:o,resolved:c,isRoot:l,onClose:u,onDeleteComment:d,type:p}=e,m=T(s),h=T(f),_=T(g),v=_.getUser(t.personId),y=E(_.currentUser$),b=(y==null?void 0:y.userID)===t.personId,x=t.id===Oe,[S,D]=W(!1),O=w(C),k=O==null?void 0:O.avatarFallback;return q(`div`,{className:`univer-relative univer-mb-3 univer-pl-[30px]`,onMouseLeave:()=>D(!1),onMouseEnter:()=>D(!0),children:[K(`div`,{className:`
4
+ univer-absolute univer-left-0 univer-top-0 univer-size-6 univer-rounded-full univer-bg-cover
5
+ univer-bg-center univer-bg-no-repeat
6
+ `,style:{backgroundImage:`url(${(v==null?void 0:v.avatar)||k})`}}),v?q(`div`,{className:`univer-mb-1 univer-flex univer-h-6 univer-items-center univer-justify-between`,children:[K(`div`,{className:`univer-text-sm univer-font-medium univer-leading-5`,children:(v==null?void 0:v.name)||` `}),q(`div`,{children:[x||c?null:S&&v?K(`div`,{className:`
7
+ univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer
8
+ univer-items-center univer-justify-center univer-rounded-sm
9
+ univer-text-base
10
+ hover:univer-bg-gray-50
11
+ `,onClick:()=>o(v),children:K(V,{})}):null,b&&!x&&!c?K(I,{overlay:K(`div`,{className:`univer-rounded-lg`,children:q(`ul`,{className:`
12
+ univer-m-0 univer-box-border univer-grid univer-list-none
13
+ univer-p-1.5 univer-text-sm
14
+ [&_a]:univer-block [&_a]:univer-cursor-pointer
15
+ [&_a]:univer-rounded [&_a]:univer-px-2 [&_a]:univer-py-1.5
16
+ [&_a]:univer-transition-colors
17
+ `,children:[K(`li`,{children:K(`a`,{className:`hover:univer-bg-gray-200`,onClick:()=>a==null?void 0:a(!0),children:h.t(`threadCommentUI.item.edit`)})}),K(`li`,{children:K(`a`,{className:`hover:univer-bg-gray-200`,onClick:()=>{(d==null?void 0:d(t))!==!1&&(m.executeCommand(l?j.id:ee.id,{unitId:n,subUnitId:r,commentId:t.id}),l&&(u==null||u()))},children:h.t(`threadCommentUI.item.delete`)})})]})}),children:K(`div`,{className:`
18
+ univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer
19
+ univer-items-center univer-justify-center univer-rounded-sm
20
+ univer-text-base
21
+ hover:univer-bg-gray-50
22
+ `,children:K(B,{})})}):null]})]}):null,K(`time`,{className:`
23
+ univer-mb-1 univer-text-xs/normal univer-text-gray-600
24
+ dark:!univer-text-gray-200
25
+ `,children:t.dT}),i?K(we,{type:p,id:t.id,comment:t,onCancel:()=>a==null?void 0:a(!1),autoFocus:!0,unitId:n,subUnitId:r,onSave:({text:e,attachments:i})=>{a==null||a(!1),m.executeCommand(N.id,{unitId:n,subUnitId:r,payload:{commentId:t.id,text:e,attachments:i}})}}):K(`div`,{className:`
26
+ univer-text-sm univer-text-gray-900
27
+ dark:!univer-text-white
28
+ `,children:Ee(t.text).map((e,t)=>K(`div`,{className:`univer-break-words`,children:e.map((e,t)=>{switch(e.type){case`mention`:return q(`a`,{className:`univer-text-primary-600`,children:[e.content.label,` `]},t);default:return e.content}})},t))})]})},Ae=e=>{var t,n,r;let{id:i,unitId:a,subUnitId:o,refStr:c,showEdit:l=!0,onClick:u,showHighlight:d,onClose:f,getSubUnitName:p,prefix:m,autoFocus:h,onMouseEnter:v,onMouseLeave:y,onAddComment:b,onDeleteComment:x,onResolve:S,type:C,style:w,full:D}=e,k=T(ne),[ee,M]=W(!1),[N,F]=W(``);E(U(()=>k.commentUpdate$.pipe(O(16)),[k]));let I=i?k.getCommentWithChildren(a,o,i):null,L=T(s),oe=T(g),B=I==null?void 0:I.root.resolved,V=E(oe.currentUser$),le=de(null),ue=[...I?[I.root]:[{id:Oe,text:{dataStream:`
29
+ \r`},personId:(t=V==null?void 0:V.userID)==null?``:t,ref:c==null?``:c,dT:``,unitId:a,subUnitId:o,threadId:``}],...(n=I==null?void 0:I.children)==null?[]:n],G=de(null),fe=e=>{e.stopPropagation(),B?L.executeCommand(Q.id,{unitId:a,subUnitId:o,commentId:i}):L.executeCommand(Q.id),L.executeCommand(te.id,{unitId:a,subUnitId:o,commentId:i,resolved:!B}),S==null||S(!B)},pe=e=>{e.stopPropagation(),L.executeCommand(Q.id),!(I!=null&&I.root&&(x==null?void 0:x(I.root))===!1)&&(L.executeCommand(j.id,{unitId:a,subUnitId:o,commentId:i}),f==null||f())};H(()=>y==null?void 0:y(),[]);let J=p((r=I==null?void 0:I.root.subUnitId)==null?o:r),me=l&&!N&&!B,he=`${c||(I==null?void 0:I.root.ref)||``}${J?` · `:``}${J}`;return q(`div`,{id:`${m}-${a}-${o}-${i}`,className:z(`
30
+ univer-relative univer-box-border univer-rounded-md univer-bg-white univer-p-4
31
+ dark:!univer-bg-gray-900 dark:!univer-text-white
32
+ `,re,{"univer-w-[278px]":!D,"univer-w-full":D,"univer-shadow":!B&&(d||ee||m===`cell`)}),style:w,onClick:u,onMouseEnter:()=>{v==null||v(),M(!0)},onMouseLeave:()=>{y==null||y(),M(!1)},children:[!B&&d&&K(`div`,{className:`
33
+ univer-absolute univer-left-0 univer-right-0 univer-top-0 univer-h-1.5 univer-rounded-t-md
34
+ univer-bg-yellow-400
35
+ `}),q(`div`,{className:`
36
+ univer-mb-4 univer-flex univer-flex-row univer-items-center univer-justify-between univer-text-sm
37
+ univer-leading-5
38
+ `,children:[q(`div`,{className:`univer-flex univer-flex-1 univer-flex-row univer-items-center univer-overflow-hidden`,children:[K(`div`,{className:`
39
+ univer-mr-2 univer-h-3.5 univer-w-[3px] univer-flex-shrink-0 univer-flex-grow-0
40
+ univer-rounded-sm univer-bg-yellow-500
41
+ `}),K(R,{showIfEllipsis:!0,title:he,children:K(`span`,{className:`univer-flex-1 univer-truncate`,children:he})})]}),!!I&&q(`div`,{className:`univer-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-row`,children:[K(`div`,{className:z(`
42
+ univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer univer-items-center
43
+ univer-justify-center univer-rounded-[3px] univer-text-base
44
+ hover:univer-bg-gray-50
45
+ dark:hover:!univer-bg-gray-800
46
+ `,{"univer-text-green-500":B}),onClick:fe,children:K(B?se:ce,{})}),(V==null?void 0:V.userID)===I.root.personId?K(`div`,{className:`
47
+ univer-ml-1 univer-inline-flex univer-size-6 univer-cursor-pointer
48
+ univer-items-center univer-justify-center univer-rounded-[3px] univer-text-base
49
+ hover:univer-bg-gray-50
50
+ dark:hover:!univer-bg-gray-800
51
+ `,onClick:pe,children:K(ae,{})}):null]})]}),K(`div`,{ref:G,className:z(`univer-max-h-80 univer-overflow-y-auto univer-overflow-x-hidden`,ie),children:ue.map(e=>K(ke,{unitId:a,subUnitId:o,item:e,isRoot:e.id===(I==null?void 0:I.root.id),editing:N===e.id,resolved:I==null?void 0:I.root.resolved,type:C,onClose:f,onEditingChange:t=>{F(t?e.id:``)},onReply:e=>{e&&requestAnimationFrame(()=>{var t;(t=le.current)==null||t.reply(De([{type:`mention`,content:{id:e.userID,label:`@${e.name}`}},{type:`text`,content:` `}]))})},onAddComment:b,onDeleteComment:x},e.id))}),me&&K(`div`,{children:K(we,{ref:le,type:C,unitId:a,subUnitId:o,onSave:async({text:e,attachments:t})=>{if(!(V!=null&&V.userID)||!(I!=null&&I.root))throw Error(`[ThreadCommentTree] No current user or root comment found`);let n={text:e,attachments:t,dT:P(),id:_(),ref:c,personId:V==null?void 0:V.userID,parentId:I==null?void 0:I.root.id,unitId:a,subUnitId:o,threadId:I==null?void 0:I.root.threadId};(b==null?void 0:b(n))!==!1&&(await L.executeCommand(A.id,{unitId:a,subUnitId:o,comment:n}),G.current&&(G.current.scrollTop=G.current.scrollHeight))},autoFocus:h||!I,onCancel:()=>{I||f==null||f()}},`${h}`)})]})},je=e=>{let{unitId:t,subUnitId$:n,type:r,onAdd:i,getSubUnitName:a,onResolve:o,sortComments:c,onItemLeave:l,onItemEnter:u,disableAdd:d,tempComment:p,onAddComment:m,onDeleteComment:_,showComments:v}=e,[y,b]=W(`all`),[x,S]=W(`all`),C=T(f),w=T(g),D=T(ne),[O,k]=W(()=>D.getUnit(t)),A=E(T(Z).activeCommentId$),ee=E(D.commentUpdate$),j=T(s),te=E(n),M=de(!0),N=`panel`,P=E(w.currentUser$),I=U(()=>{var e;let t=y===`all`?O:(e=O.filter(e=>e.subUnitId===te))==null?[]:e,n=c==null?(e=>e):c,r=t.map(e=>{var t;return{...e.root,children:(t=e.children)==null?[]:t,users:e.relativeUsers}});if(v){let e=new Map;return r.forEach(t=>{e.set(t.id,t)}),[...v,``].map(t=>e.get(t)).filter(Boolean)}else return n(r)},[v,y,O,c,te]),R=U(()=>[...I.filter(e=>!e.resolved),...I.filter(e=>e.resolved)],[I]),re=U(()=>x===`resolved`?R.filter(e=>e.resolved):x===`unsolved`?R.filter(e=>!e.resolved):x===`concern_me`&&P!=null&&P.userID?R.filter(e=>e==null?void 0:e.users.has(P.userID)):R,[R,P==null?void 0:P.userID,x]),z=p?[p,...re]:re,ie=z.filter(e=>!e.resolved),ae=z.filter(e=>e.resolved),B=x!==`all`||y!==`all`,V=()=>{S(`all`),b(`all`)};H(()=>{t&&k(D.getUnit(t))},[t,D,ee]),H(()=>{var e;if(!A)return;if(!M.current){M.current=!0;return}let{unitId:t,subUnitId:n,commentId:r}=A,i=`${N}-${t}-${n}-${r}`;(e=document.getElementById(i))==null||e.scrollIntoView({block:`center`})},[A]);let se=e=>K(Ae,{prefix:N,getSubUnitName:a,id:e.id,unitId:e.unitId,subUnitId:e.subUnitId,refStr:e.ref,type:r,showEdit:(A==null?void 0:A.commentId)===e.id,showHighlight:(A==null?void 0:A.commentId)===e.id,onClick:()=>{M.current=!1,e.resolved?j.executeCommand(Q.id):j.executeCommand(Q.id,{unitId:e.unitId,subUnitId:e.subUnitId,commentId:e.id,temp:!1})},onMouseEnter:()=>u==null?void 0:u(e),onMouseLeave:()=>l==null?void 0:l(e),onAddComment:m,onDeleteComment:_,onResolve:t=>o==null?void 0:o(e.id,t)},e.id);return q(`div`,{className:`univer-flex univer-min-h-full univer-flex-col univer-pb-3`,children:[q(`div`,{className:`univer-mt-3 univer-flex univer-flex-row univer-justify-between`,children:[r===h.UNIVER_SHEET?K(L,{borderless:!0,value:y,options:[{value:`current`,label:C.t(`threadCommentUI.filter.sheet.current`)},{value:`all`,label:C.t(`threadCommentUI.filter.sheet.all`)}],onChange:b}):null,K(L,{borderless:!0,value:x,options:[{value:`all`,label:C.t(`threadCommentUI.filter.status.all`)},{value:`resolved`,label:C.t(`threadCommentUI.filter.status.resolved`)},{value:`unsolved`,label:C.t(`threadCommentUI.filter.status.unsolved`)},{value:`concern_me`,label:C.t(`threadCommentUI.filter.status.concernMe`)}],onChange:S})]}),z.length===0?q(`div`,{className:`
52
+ univer-flex univer-flex-1 univer-flex-col univer-items-center univer-justify-center
53
+ univer-text-sm univer-text-gray-600
54
+ dark:!univer-text-gray-200
55
+ `,children:[C.t(`threadCommentUI.panel.empty`),B?K(`div`,{className:`univer-mt-2 univer-flex univer-flex-row`,children:K(F,{onClick:V,children:C.t(`threadCommentUI.panel.reset`)})}):d?null:K(`div`,{className:`univer-mt-2 univer-flex univer-flex-row`,children:q(F,{onClick:i,children:[K(oe,{className:`univer-mr-1.5`}),C.t(`threadCommentUI.panel.addComment`)]})})]}):q(`div`,{className:`univer-mt-3 univer-flex univer-flex-col univer-gap-3`,children:[ie.map(se),ae.length>0&&K(`div`,{className:`univer-text-xs`,children:C.t(`threadCommentUI.panel.solved`)}),ae.map(se)]})]})};export{Q as SetActiveCommentOperation,_e as THREAD_COMMENT_PANEL,je as ThreadCommentPanel,Z as ThreadCommentPanelService,Ae as ThreadCommentTree,ve as ToggleSheetCommentPanelOperation,$ as UniverThreadCommentUIPlugin};