@univerjs/sheets-thread-comment-ui 0.11.0 → 0.12.0

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Re = Object.defineProperty;
2
- var Ue = (t, e, r) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var y = (t, e, r) => Ue(t, typeof e != "symbol" ? e + "" : e, r);
2
+ var Ue = (n, e, r) => e in n ? Re(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r;
3
+ var y = (n, e, r) => Ue(n, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { Inject as p, Disposable as $, DisposableCollection as $e, CommandType as Oe, IUniverInstanceService as x, InterceptorEffectEnum as ke, UniverInstanceType as M, Range as Ne, ICommandService as ne, RANGE_TYPE as se, Rectangle as De, Tools as xe, DependentOn as Ae, Injector as Ve, IConfigService as Be, Plugin as He, merge as Le } from "@univerjs/core";
5
5
  import { SheetsSelectionsService as de, getSheetCommandTarget as je, SheetInterceptorService as Fe, INTERCEPTOR_POINT as We, SheetPermissionCheckController as ue, RangeProtectionPermissionViewPoint as G, WorksheetViewPermission as z, WorkbookCommentPermission as K, SetWorksheetActiveOperation as Ze } from "@univerjs/sheets";
6
6
  import { SheetsThreadCommentModel as O, UniverSheetsThreadCommentPlugin as Ge } from "@univerjs/sheets-thread-comment";
@@ -16,19 +16,19 @@ import { AddCommentCommand as ln, DeleteCommentCommand as pn, DeleteCommentTreeC
16
16
  import { useRef as fe, createElement as ge, forwardRef as St, useMemo as ft, useCallback as he, useEffect as gt } from "react";
17
17
  import { jsx as Ie } from "react/jsx-runtime";
18
18
  const Pe = "univer.sheet.thread-comment-modal", Te = "SHEET_THREAD_COMMENT";
19
- var It = Object.getOwnPropertyDescriptor, Pt = (t, e, r, n) => {
20
- for (var o = n > 1 ? void 0 : n ? It(e, r) : e, i = t.length - 1, s; i >= 0; i--)
21
- (s = t[i]) && (o = s(o) || o);
19
+ var It = Object.getOwnPropertyDescriptor, Pt = (n, e, r, t) => {
20
+ for (var o = t > 1 ? void 0 : t ? It(e, r) : e, i = n.length - 1, s; i >= 0; i--)
21
+ (s = n[i]) && (o = s(o) || o);
22
22
  return o;
23
- }, J = (t, e) => (r, n) => e(r, n, t);
23
+ }, J = (n, e) => (r, t) => e(r, t, n);
24
24
  let R = class extends $ {
25
- constructor(e, r, n) {
25
+ constructor(e, r, t) {
26
26
  super();
27
27
  y(this, "_lastPopup", null);
28
28
  y(this, "_activePopup");
29
29
  y(this, "_activePopup$", new pt(null));
30
30
  y(this, "activePopup$", this._activePopup$.asObservable());
31
- this._canvasPopupManagerService = e, this._zenZoneService = r, this._cellPopupManagerService = n, this._initZenVisible(), this.disposeWithMe(() => {
31
+ this._canvasPopupManagerService = e, this._zenZoneService = r, this._cellPopupManagerService = t, this._initZenVisible(), this.disposeWithMe(() => {
32
32
  this._activePopup$.complete();
33
33
  });
34
34
  }
@@ -45,8 +45,8 @@ let R = class extends $ {
45
45
  }
46
46
  showPopup(e, r) {
47
47
  var h;
48
- const { row: n, col: o, unitId: i, subUnitId: s } = e;
49
- if (this._activePopup && n === this._activePopup.row && o === this._activePopup.col && i === this._activePopup.unitId && s === ((h = this.activePopup) == null ? void 0 : h.subUnitId)) {
48
+ const { row: t, col: o, unitId: i, subUnitId: s } = e;
49
+ if (this._activePopup && t === this._activePopup.row && o === this._activePopup.col && i === this._activePopup.unitId && s === ((h = this.activePopup) == null ? void 0 : h.subUnitId)) {
50
50
  this._activePopup = e, this._activePopup$.next(e);
51
51
  return;
52
52
  }
@@ -55,7 +55,7 @@ let R = class extends $ {
55
55
  this._activePopup = e, this._activePopup$.next(e);
56
56
  const a = this._cellPopupManagerService.showPopup(
57
57
  {
58
- row: n,
58
+ row: t,
59
59
  col: o,
60
60
  unitId: i,
61
61
  subUnitId: s
@@ -100,9 +100,9 @@ R = Pt([
100
100
  const A = {
101
101
  type: Oe.OPERATION,
102
102
  id: "sheets.operation.show-comment-modal",
103
- handler(t) {
103
+ handler(n) {
104
104
  var _;
105
- const e = t.get(de), r = t.get(x), n = t.get(R), o = t.get(re), i = (_ = e.getCurrentLastSelection()) == null ? void 0 : _.primary, s = t.get(O);
105
+ const e = n.get(de), r = n.get(x), t = n.get(R), o = n.get(re), i = (_ = e.getCurrentLastSelection()) == null ? void 0 : _.primary, s = n.get(O);
106
106
  if (!i)
107
107
  return !1;
108
108
  const a = je(r);
@@ -116,7 +116,7 @@ const A = {
116
116
  row: i.startRow,
117
117
  col: i.startColumn
118
118
  };
119
- n.showPopup(C);
119
+ t.showPopup(C);
120
120
  const l = s.getByLocation(d, m, i.startRow, i.startColumn);
121
121
  return l && o.setActiveComment({
122
122
  unitId: d,
@@ -126,14 +126,14 @@ const A = {
126
126
  }), !0;
127
127
  }
128
128
  }, Tt = "sheets-thread-comment.config", me = {};
129
- var wt = Object.getOwnPropertyDescriptor, Mt = (t, e, r, n) => {
130
- for (var o = n > 1 ? void 0 : n ? wt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
131
- (s = t[i]) && (o = s(o) || o);
129
+ var wt = Object.getOwnPropertyDescriptor, Mt = (n, e, r, t) => {
130
+ for (var o = t > 1 ? void 0 : t ? wt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
131
+ (s = n[i]) && (o = s(o) || o);
132
132
  return o;
133
- }, V = (t, e) => (r, n) => e(r, n, t);
133
+ }, V = (n, e) => (r, t) => e(r, t, n);
134
134
  let H = class extends $ {
135
- constructor(t, e, r, n) {
136
- super(), this._sheetInterceptorService = t, this._sheetsThreadCommentModel = e, this._univerInstanceService = r, this._renderManagerService = n, this._initViewModelIntercept(), this._initSkeletonChange();
135
+ constructor(n, e, r, t) {
136
+ super(), this._sheetInterceptorService = n, this._sheetsThreadCommentModel = e, this._univerInstanceService = r, this._renderManagerService = t, this._initViewModelIntercept(), this._initSkeletonChange();
137
137
  }
138
138
  _initViewModelIntercept() {
139
139
  this.disposeWithMe(
@@ -141,15 +141,15 @@ let H = class extends $ {
141
141
  We.CELL_CONTENT,
142
142
  {
143
143
  effect: ke.Style,
144
- handler: (t, e, r) => {
145
- const { row: n, col: o, unitId: i, subUnitId: s } = e;
146
- return this._sheetsThreadCommentModel.showCommentMarker(i, s, n, o) && ((!t || t === e.rawData) && (t = { ...e.rawData }), t.markers = {
147
- ...t == null ? void 0 : t.markers,
144
+ handler: (n, e, r) => {
145
+ const { row: t, col: o, unitId: i, subUnitId: s } = e;
146
+ return this._sheetsThreadCommentModel.showCommentMarker(i, s, t, o) && ((!n || n === e.rawData) && (n = { ...e.rawData }), n.markers = {
147
+ ...n == null ? void 0 : n.markers,
148
148
  tr: {
149
149
  color: "#FFBD37",
150
150
  size: 6
151
151
  }
152
- }), r(t);
152
+ }), r(n);
153
153
  },
154
154
  priority: 100
155
155
  }
@@ -157,15 +157,15 @@ let H = class extends $ {
157
157
  );
158
158
  }
159
159
  _initSkeletonChange() {
160
- const t = () => {
160
+ const n = () => {
161
161
  var o;
162
162
  const e = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
163
163
  if (!e) return;
164
- const r = e.getUnitId(), n = this._renderManagerService.getRenderById(r);
165
- (o = n == null ? void 0 : n.mainComponent) == null || o.makeForceDirty();
164
+ const r = e.getUnitId(), t = this._renderManagerService.getRenderById(r);
165
+ (o = t == null ? void 0 : t.mainComponent) == null || o.makeForceDirty();
166
166
  };
167
167
  this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.pipe(oe(16)).subscribe(() => {
168
- t();
168
+ n();
169
169
  }));
170
170
  }
171
171
  };
@@ -175,40 +175,40 @@ H = Mt([
175
175
  V(2, x),
176
176
  V(3, Se)
177
177
  ], H);
178
- var bt = Object.getOwnPropertyDescriptor, yt = (t, e, r, n) => {
179
- for (var o = n > 1 ? void 0 : n ? bt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
180
- (s = t[i]) && (o = s(o) || o);
178
+ var bt = Object.getOwnPropertyDescriptor, yt = (n, e, r, t) => {
179
+ for (var o = t > 1 ? void 0 : t ? bt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
180
+ (s = n[i]) && (o = s(o) || o);
181
181
  return o;
182
- }, Q = (t, e) => (r, n) => e(r, n, t);
183
- const Et = (t, e, r) => {
184
- const n = D(t), o = r.row - e.row, i = r.column - e.column, s = {
185
- startColumn: n.column + i,
186
- startRow: n.row + o,
187
- endColumn: n.column + i,
188
- endRow: n.row + o
182
+ }, Q = (n, e) => (r, t) => e(r, t, n);
183
+ const Et = (n, e, r) => {
184
+ const t = D(n), o = r.row - e.row, i = r.column - e.column, s = {
185
+ startColumn: t.column + i,
186
+ startRow: t.row + o,
187
+ endColumn: t.column + i,
188
+ endRow: t.row + o
189
189
  };
190
190
  return _t(s);
191
191
  };
192
192
  let L = class extends $ {
193
- constructor(e, r, n) {
193
+ constructor(e, r, t) {
194
194
  super();
195
195
  y(this, "_copyInfo");
196
- this._sheetClipboardService = e, this._sheetsThreadCommentModel = r, this._threadCommentDataSourceService = n, this._initClipboardHook();
196
+ this._sheetClipboardService = e, this._sheetsThreadCommentModel = r, this._threadCommentDataSourceService = t, this._initClipboardHook();
197
197
  }
198
198
  // eslint-disable-next-line max-lines-per-function
199
199
  _initClipboardHook() {
200
200
  this.disposeWithMe(
201
201
  this._sheetClipboardService.addClipboardHook({
202
202
  id: Te,
203
- onBeforeCopy: (e, r, n) => {
203
+ onBeforeCopy: (e, r, t) => {
204
204
  this._copyInfo = {
205
205
  unitId: e,
206
206
  subUnitId: r,
207
- range: n
207
+ range: t
208
208
  };
209
209
  },
210
210
  // eslint-disable-next-line max-lines-per-function
211
- onPasteCells: (e, r, n, o) => {
211
+ onPasteCells: (e, r, t, o) => {
212
212
  const { unitId: i, subUnitId: s, range: a } = r, c = {
213
213
  row: a.rows[0],
214
214
  column: a.cols[0]
@@ -288,31 +288,31 @@ L = yt([
288
288
  Q(1, p(O)),
289
289
  Q(2, vt)
290
290
  ], L);
291
- var Rt = Object.getOwnPropertyDescriptor, Ut = (t, e, r, n) => {
292
- for (var o = n > 1 ? void 0 : n ? Rt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
293
- (s = t[i]) && (o = s(o) || o);
291
+ var Rt = Object.getOwnPropertyDescriptor, Ut = (n, e, r, t) => {
292
+ for (var o = t > 1 ? void 0 : t ? Rt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
293
+ (s = n[i]) && (o = s(o) || o);
294
294
  return o;
295
- }, B = (t, e) => (r, n) => e(r, n, t);
295
+ }, B = (n, e) => (r, t) => e(r, t, n);
296
296
  let j = class extends $ {
297
- constructor(t, e, r, n) {
298
- super(), this._hoverManagerService = t, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel = r, this._sheetPermissionCheckController = n, this._initHoverEvent();
297
+ constructor(n, e, r, t) {
298
+ super(), this._hoverManagerService = n, this._sheetsThreadCommentPopupService = e, this._sheetsThreadCommentModel = r, this._sheetPermissionCheckController = t, this._initHoverEvent();
299
299
  }
300
300
  _initHoverEvent() {
301
301
  this.disposeWithMe(
302
- this._hoverManagerService.currentCell$.pipe(oe(100)).subscribe((t) => {
302
+ this._hoverManagerService.currentCell$.pipe(oe(100)).subscribe((n) => {
303
303
  const e = this._sheetsThreadCommentPopupService.activePopup;
304
- if (t && (e && e.temp || !e)) {
305
- const { location: r } = t, { unitId: n, subUnitId: o, row: i, col: s } = r, a = this._sheetsThreadCommentModel.getByLocation(n, o, i, s);
304
+ if (n && (e && e.temp || !e)) {
305
+ const { location: r } = n, { unitId: t, subUnitId: o, row: i, col: s } = r, a = this._sheetsThreadCommentModel.getByLocation(t, o, i, s);
306
306
  if (a) {
307
307
  if (!this._sheetPermissionCheckController.permissionCheckWithRanges({
308
308
  workbookTypes: [K],
309
309
  worksheetTypes: [z],
310
310
  rangeTypes: [G]
311
- }, [{ startRow: i, startColumn: s, endRow: i, endColumn: s }]))
311
+ }, [{ startRow: i, startColumn: s, endRow: i, endColumn: s }], t, o))
312
312
  return;
313
- const h = this._sheetsThreadCommentModel.getComment(n, o, a);
313
+ const h = this._sheetsThreadCommentModel.getComment(t, o, a);
314
314
  h && !h.resolved && this._sheetsThreadCommentPopupService.showPopup({
315
- unitId: n,
315
+ unitId: t,
316
316
  subUnitId: o,
317
317
  row: i,
318
318
  col: s,
@@ -332,21 +332,21 @@ j = Ut([
332
332
  B(2, p(O)),
333
333
  B(3, p(ue))
334
334
  ], j);
335
- var $t = Object.getOwnPropertyDescriptor, Ot = (t, e, r, n) => {
336
- for (var o = n > 1 ? void 0 : n ? $t(e, r) : e, i = t.length - 1, s; i >= 0; i--)
337
- (s = t[i]) && (o = s(o) || o);
335
+ var $t = Object.getOwnPropertyDescriptor, Ot = (n, e, r, t) => {
336
+ for (var o = t > 1 ? void 0 : t ? $t(e, r) : e, i = n.length - 1, s; i >= 0; i--)
337
+ (s = n[i]) && (o = s(o) || o);
338
338
  return o;
339
- }, w = (t, e) => (r, n) => e(r, n, t);
339
+ }, w = (n, e) => (r, t) => e(r, t, n);
340
340
  let F = class extends $ {
341
- constructor(e, r, n, o, i, s, a, c, h, d) {
341
+ constructor(e, r, t, o, i, s, a, c, h, d) {
342
342
  super();
343
343
  y(this, "_isSwitchToCommenting", !1);
344
344
  y(this, "_selectionShapeInfo", null);
345
- this._commandService = e, this._sheetsThreadCommentPopupService = r, this._sheetsThreadCommentModel = n, this._threadCommentPanelService = o, this._univerInstanceService = i, this._sheetPermissionCheckController = s, this._markSelectionService = a, this._sheetSelectionService = c, this._editorBridgeService = h, this._renderManagerService = d, this._initCommandListener(), this._initPanelListener(), this._initMarkSelection(), this._initSelectionUpdateListener(), this._initEditorBridge();
345
+ this._commandService = e, this._sheetsThreadCommentPopupService = r, this._sheetsThreadCommentModel = t, this._threadCommentPanelService = o, this._univerInstanceService = i, this._sheetPermissionCheckController = s, this._markSelectionService = a, this._sheetSelectionService = c, this._editorBridgeService = h, this._renderManagerService = d, this._initCommandListener(), this._initPanelListener(), this._initMarkSelection(), this._initSelectionUpdateListener(), this._initEditorBridge();
346
346
  }
347
- _handleSelectionChange(e, r, n) {
347
+ _handleSelectionChange(e, r, t) {
348
348
  var C, l, _;
349
- const o = (C = e[0]) == null ? void 0 : C.range, i = this._renderManagerService.getRenderById(r), s = (l = i == null ? void 0 : i.with(rt).getSkeletonParam(n)) == null ? void 0 : l.skeleton;
349
+ const o = (C = e[0]) == null ? void 0 : C.range, i = this._renderManagerService.getRenderById(r), s = (l = i == null ? void 0 : i.with(rt).getSkeletonParam(t)) == null ? void 0 : l.skeleton;
350
350
  if (!s || !o)
351
351
  return;
352
352
  const a = s.getCellWithCoordByIndex(o.startRow, o.startColumn);
@@ -355,14 +355,14 @@ let F = class extends $ {
355
355
  return;
356
356
  }
357
357
  const h = a.actualRow, d = a.actualColumn;
358
- if (!this._sheetsThreadCommentModel.showCommentMarker(r, n, h, d)) {
358
+ if (!this._sheetsThreadCommentModel.showCommentMarker(r, t, h, d)) {
359
359
  this._threadCommentPanelService.activeCommentId && this._commandService.executeCommand(q.id);
360
360
  return;
361
361
  }
362
- const m = this._sheetsThreadCommentModel.getByLocation(r, n, h, d);
362
+ const m = this._sheetsThreadCommentModel.getByLocation(r, t, h, d);
363
363
  m && this._commandService.executeCommand(q.id, {
364
364
  unitId: r,
365
- subUnitId: n,
365
+ subUnitId: t,
366
366
  commentId: m
367
367
  });
368
368
  }
@@ -386,10 +386,10 @@ let F = class extends $ {
386
386
  _initCommandListener() {
387
387
  this._commandService.onCommandExecuted((e) => {
388
388
  if (e.id === te.id) {
389
- const r = e.params, n = this._sheetsThreadCommentPopupService.activePopup;
390
- if (!n)
389
+ const r = e.params, t = this._sheetsThreadCommentPopupService.activePopup;
390
+ if (!t)
391
391
  return;
392
- const { unitId: o, subUnitId: i, commentId: s } = n;
392
+ const { unitId: o, subUnitId: i, commentId: s } = t;
393
393
  r.unitId === o && r.subUnitId === i && r.commentId === s && this._sheetsThreadCommentPopupService.hidePopup();
394
394
  }
395
395
  });
@@ -398,14 +398,14 @@ let F = class extends $ {
398
398
  this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async (e) => {
399
399
  var r;
400
400
  if (e) {
401
- const { unitId: n, subUnitId: o, commentId: i, trigger: s } = e, a = this._sheetsThreadCommentModel.getComment(n, o, i);
401
+ const { unitId: t, subUnitId: o, commentId: i, trigger: s } = e, a = this._sheetsThreadCommentModel.getComment(t, o, i);
402
402
  if (!a || a.resolved)
403
403
  return;
404
404
  const c = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
405
- if (!c || c.getUnitId() !== n)
405
+ if (!c || c.getUnitId() !== t)
406
406
  return;
407
407
  this._isSwitchToCommenting = !0, ((r = c.getActiveSheet()) == null ? void 0 : r.getSheetId()) !== o && await this._commandService.executeCommand(Ze.id, {
408
- unitId: n,
408
+ unitId: t,
409
409
  subUnitId: o
410
410
  }), this._isSwitchToCommenting = !1;
411
411
  const m = D(a.ref), { row: C, column: l } = m;
@@ -413,7 +413,7 @@ let F = class extends $ {
413
413
  workbookTypes: [K],
414
414
  worksheetTypes: [z],
415
415
  rangeTypes: [G]
416
- }, [{ startRow: C, startColumn: l, endRow: C, endColumn: l }]))
416
+ }, [{ startRow: C, startColumn: l, endRow: C, endColumn: l }], t, o))
417
417
  return;
418
418
  const f = 1;
419
419
  if (await this._commandService.executeCommand(ot.id, {
@@ -426,7 +426,7 @@ let F = class extends $ {
426
426
  }), this._editorBridgeService.isVisible().visible)
427
427
  return;
428
428
  this._sheetsThreadCommentPopupService.showPopup({
429
- unitId: n,
429
+ unitId: t,
430
430
  subUnitId: o,
431
431
  row: m.row,
432
432
  col: m.column,
@@ -444,15 +444,15 @@ let F = class extends $ {
444
444
  this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
445
445
  return;
446
446
  }
447
- const { unitId: r, subUnitId: n, commentId: o } = e;
447
+ const { unitId: r, subUnitId: t, commentId: o } = e;
448
448
  this._selectionShapeInfo && (this._markSelectionService.removeShape(this._selectionShapeInfo.shapeId), this._selectionShapeInfo = null);
449
- const i = this._sheetsThreadCommentModel.getComment(r, n, o);
449
+ const i = this._sheetsThreadCommentModel.getComment(r, t, o);
450
450
  if (!i)
451
451
  return;
452
452
  const s = D(i.ref), { row: a, column: c } = s;
453
453
  if (Number.isNaN(a) || Number.isNaN(c))
454
454
  return null;
455
- const h = (C = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET)) == null ? void 0 : C.getSheetBySheetId(n), d = (l = h == null ? void 0 : h.getMergedCell(a, c)) != null ? l : {
455
+ const h = (C = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET)) == null ? void 0 : C.getSheetBySheetId(t), d = (l = h == null ? void 0 : h.getMergedCell(a, c)) != null ? l : {
456
456
  startColumn: c,
457
457
  endColumn: c,
458
458
  startRow: a,
@@ -491,47 +491,47 @@ F = Ot([
491
491
  w(8, nt),
492
492
  w(9, Se)
493
493
  ], F);
494
- function we({ ref: t, ...e }) {
495
- const { icon: r, id: n, className: o, extend: i, ...s } = e, a = `univerjs-icon univerjs-icon-${n} ${o || ""}`.trim(), c = fe(`_${Dt()}`);
496
- return Me(r, `${n}`, {
494
+ function we({ ref: n, ...e }) {
495
+ const { icon: r, id: t, className: o, extend: i, ...s } = e, a = `univerjs-icon univerjs-icon-${t} ${o || ""}`.trim(), c = fe(`_${Dt()}`);
496
+ return Me(r, `${t}`, {
497
497
  defIds: r.defIds,
498
498
  idSuffix: c.current
499
499
  }, {
500
- ref: t,
500
+ ref: n,
501
501
  className: a,
502
502
  ...s
503
503
  }, i);
504
504
  }
505
- function Me(t, e, r, n, o) {
506
- return ge(t.tag, {
505
+ function Me(n, e, r, t, o) {
506
+ return ge(n.tag, {
507
507
  key: e,
508
- ...kt(t, r, o),
509
- ...n
510
- }, (Nt(t, r).children || []).map((i, s) => Me(i, `${e}-${t.tag}-${s}`, r, void 0, o)));
508
+ ...kt(n, r, o),
509
+ ...t
510
+ }, (Nt(n, r).children || []).map((i, s) => Me(i, `${e}-${n.tag}-${s}`, r, void 0, o)));
511
511
  }
512
- function kt(t, e, r) {
513
- const n = { ...t.attrs };
514
- 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(([i, s]) => {
515
- i === "mask" && typeof s == "string" && (n[i] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
512
+ function kt(n, e, r) {
513
+ const t = { ...n.attrs };
514
+ r != null && r.colorChannel1 && t.fill === "colorChannel1" && (t.fill = r.colorChannel1), n.tag === "mask" && t.id && (t.id = t.id + e.idSuffix), Object.entries(t).forEach(([i, s]) => {
515
+ i === "mask" && typeof s == "string" && (t[i] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
516
516
  });
517
517
  const { defIds: o } = e;
518
- return !o || o.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(([i, s]) => {
519
- typeof s == "string" && (n[i] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
520
- })), n;
518
+ return !o || o.length === 0 || (n.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(([i, s]) => {
519
+ typeof s == "string" && (t[i] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
520
+ })), t;
521
521
  }
522
- function Nt(t, e) {
523
- var n;
522
+ function Nt(n, e) {
523
+ var t;
524
524
  const { defIds: r } = e;
525
- return !r || r.length === 0 ? t : t.tag === "defs" && ((n = t.children) != null && n.length) ? {
526
- ...t,
527
- children: t.children.map((o) => typeof o.attrs.id == "string" && r && r.includes(o.attrs.id) ? {
525
+ return !r || r.length === 0 ? n : n.tag === "defs" && ((t = n.children) != null && t.length) ? {
526
+ ...n,
527
+ children: n.children.map((o) => typeof o.attrs.id == "string" && r && r.includes(o.attrs.id) ? {
528
528
  ...o,
529
529
  attrs: {
530
530
  ...o.attrs,
531
531
  id: o.attrs.id + e.idSuffix
532
532
  }
533
533
  } : o)
534
- } : t;
534
+ } : n;
535
535
  }
536
536
  function Dt() {
537
537
  return Math.random().toString(36).substring(2, 8);
@@ -596,14 +596,14 @@ const xt = {
596
596
  });
597
597
  be.displayName = "CommentIcon";
598
598
  const At = () => {
599
- const t = E(x), e = E(R), r = N(e.activePopup$), n = E(O);
600
- if (N(n.commentUpdate$), !r)
599
+ const n = E(x), e = E(R), r = N(e.activePopup$), t = E(O);
600
+ if (N(t.commentUpdate$), !r)
601
601
  return null;
602
- const { row: o, col: i, unitId: s, subUnitId: a, trigger: c } = r, h = n.getByLocation(s, a, o, i), d = `${xe.chatAtABC(i)}${o + 1}`, m = () => {
602
+ const { row: o, col: i, unitId: s, subUnitId: a, trigger: c } = r, h = t.getByLocation(s, a, o, i), d = `${xe.chatAtABC(i)}${o + 1}`, m = () => {
603
603
  e.hidePopup();
604
604
  }, C = (l) => {
605
605
  var _, f, U;
606
- return (U = (f = (_ = t.getCurrentUnitForType(M.UNIVER_SHEET)) == null ? void 0 : _.getSheetBySheetId(l)) == null ? void 0 : f.getName()) != null ? U : "";
606
+ return (U = (f = (_ = n.getCurrentUnitForType(M.UNIVER_SHEET)) == null ? void 0 : _.getSheetBySheetId(l)) == null ? void 0 : f.getName()) != null ? U : "";
607
607
  };
608
608
  return /* @__PURE__ */ Ie(
609
609
  ze,
@@ -624,8 +624,8 @@ const At = () => {
624
624
  );
625
625
  }, Vt = () => {
626
626
  var g;
627
- const t = E(pe), e = E(x), r = E(R), n = e.getCurrentUnitForType(M.UNIVER_SHEET), o = n.getUnitId(), i = E(ne), s = ft(() => n.activeSheet$.pipe(Ct((u) => u == null ? void 0 : u.getSheetId())), [n.activeSheet$]), a = N(s, (g = n.getActiveSheet()) == null ? void 0 : g.getSheetId()), c = fe(null), h = E(re), d = N(h.activeCommentId$), m = N(h.panelVisible$, h.panelVisible), C = he((u) => {
628
- const I = n.getSheets(), v = {};
627
+ const n = E(pe), e = E(x), r = E(R), t = e.getCurrentUnitForType(M.UNIVER_SHEET), o = t.getUnitId(), i = E(ne), s = ft(() => t.activeSheet$.pipe(Ct((u) => u == null ? void 0 : u.getSheetId())), [t.activeSheet$]), a = N(s, (g = t.getActiveSheet()) == null ? void 0 : g.getSheetId()), c = fe(null), h = E(re), d = N(h.activeCommentId$), m = N(h.panelVisible$, h.panelVisible), C = he((u) => {
628
+ const I = t.getSheets(), v = {};
629
629
  I.forEach((P, S) => {
630
630
  v[P.getSheetId()] = S;
631
631
  });
@@ -638,17 +638,17 @@ const At = () => {
638
638
  ...T(u.filter((P) => !P.resolved)),
639
639
  ...T(u.filter((P) => P.resolved))
640
640
  ];
641
- }, [n]), l = he((u) => {
641
+ }, [t]), l = he((u) => {
642
642
  var I;
643
643
  if (u.unitId === o && u.subUnitId === a && !u.resolved) {
644
- const { row: v, column: T } = D(u.ref), P = n.getSheetBySheetId(u.subUnitId), S = (I = P == null ? void 0 : P.getMergedCell(v, T)) != null ? I : {
644
+ const { row: v, column: T } = D(u.ref), P = t.getSheetBySheetId(u.subUnitId), S = (I = P == null ? void 0 : P.getMergedCell(v, T)) != null ? I : {
645
645
  startColumn: T,
646
646
  endColumn: T,
647
647
  startRow: v,
648
648
  endRow: v
649
649
  };
650
650
  if (!Number.isNaN(v) && !Number.isNaN(T))
651
- return t.addShape({
651
+ return n.addShape({
652
652
  range: S,
653
653
  style: {
654
654
  // hasAutoFill: false,
@@ -661,21 +661,21 @@ const At = () => {
661
661
  });
662
662
  }
663
663
  return null;
664
- }, [t, a, o]), _ = (u) => {
664
+ }, [n, a, o]), _ = (u) => {
665
665
  var I, v;
666
- return (v = (I = n.getSheetBySheetId(u)) == null ? void 0 : I.getName()) != null ? v : "";
666
+ return (v = (I = t.getSheetBySheetId(u)) == null ? void 0 : I.getName()) != null ? v : "";
667
667
  }, f = () => {
668
668
  i.executeCommand(A.id);
669
669
  }, U = (u) => {
670
- d && d.unitId === u.unitId && d.subUnitId === u.subUnitId && d.commentId === u.id || (c.current && (t.removeShape(c.current), c.current = null), c.current = l(u));
670
+ d && d.unitId === u.unitId && d.subUnitId === u.subUnitId && d.commentId === u.id || (c.current && (n.removeShape(c.current), c.current = null), c.current = l(u));
671
671
  }, k = () => {
672
- c.current && (t.removeShape(c.current), c.current = null);
672
+ c.current && (n.removeShape(c.current), c.current = null);
673
673
  }, Y = (u, I) => {
674
674
  I && r.hidePopup();
675
675
  };
676
676
  return gt(() => {
677
- !m && c.current && t.removeShape(c.current);
678
- }, [t, m]), /* @__PURE__ */ Ie(
677
+ !m && c.current && n.removeShape(c.current);
678
+ }, [n, m]), /* @__PURE__ */ Ie(
679
679
  Ke,
680
680
  {
681
681
  unitId: o,
@@ -690,28 +690,28 @@ const At = () => {
690
690
  onDeleteComment: () => (k(), !0)
691
691
  }
692
692
  );
693
- }, Bt = (t) => ({
693
+ }, Bt = (n) => ({
694
694
  id: A.id,
695
695
  type: ve.BUTTON,
696
696
  icon: "CommentIcon",
697
697
  title: "sheetThreadComment.menu.addComment",
698
- hidden$: _e(t, M.UNIVER_SHEET),
699
- disabled$: Ce(t, {
698
+ hidden$: _e(n, M.UNIVER_SHEET),
699
+ disabled$: Ce(n, {
700
700
  workbookTypes: [K],
701
701
  worksheetTypes: [z],
702
702
  rangeTypes: [G]
703
703
  })
704
- }), Ht = (t) => ({
704
+ }), Ht = (n) => ({
705
705
  id: le.id,
706
706
  type: ve.BUTTON,
707
707
  icon: "CommentIcon",
708
708
  tooltip: "sheetThreadComment.menu.commentManagement",
709
- disabled$: Ce(t, {
709
+ disabled$: Ce(n, {
710
710
  workbookTypes: [K],
711
711
  worksheetTypes: [z],
712
712
  rangeTypes: [G]
713
713
  }),
714
- hidden$: _e(t, M.UNIVER_SHEET)
714
+ hidden$: _e(n, M.UNIVER_SHEET)
715
715
  }), Lt = {
716
716
  id: A.id,
717
717
  binding: at.M | ae.CTRL_COMMAND | ae.ALT,
@@ -732,14 +732,14 @@ const At = () => {
732
732
  }
733
733
  }
734
734
  };
735
- var Ft = Object.getOwnPropertyDescriptor, Wt = (t, e, r, n) => {
736
- for (var o = n > 1 ? void 0 : n ? Ft(e, r) : e, i = t.length - 1, s; i >= 0; i--)
737
- (s = t[i]) && (o = s(o) || o);
735
+ var Ft = Object.getOwnPropertyDescriptor, Wt = (n, e, r, t) => {
736
+ for (var o = t > 1 ? void 0 : t ? Ft(e, r) : e, i = n.length - 1, s; i >= 0; i--)
737
+ (s = n[i]) && (o = s(o) || o);
738
738
  return o;
739
- }, X = (t, e) => (r, n) => e(r, n, t);
739
+ }, X = (n, e) => (r, t) => e(r, t, n);
740
740
  let W = class extends $ {
741
- constructor(t, e, r) {
742
- super(), this._menuManagerService = t, this._componentManager = e, this._shortcutService = r, this._initMenu(), this._initShortcut(), this._initComponent();
741
+ constructor(n, e, r) {
742
+ super(), this._menuManagerService = n, this._componentManager = e, this._shortcutService = r, this._initMenu(), this._initShortcut(), this._initComponent();
743
743
  }
744
744
  _initShortcut() {
745
745
  this._shortcutService.registerShortcut(Lt);
@@ -752,9 +752,9 @@ let W = class extends $ {
752
752
  [Pe, At],
753
753
  [Ye, Vt],
754
754
  ["CommentIcon", be]
755
- ].forEach(([t, e]) => {
755
+ ].forEach(([n, e]) => {
756
756
  this.disposeWithMe(
757
- this._componentManager.register(t, e)
757
+ this._componentManager.register(n, e)
758
758
  );
759
759
  });
760
760
  }
@@ -764,14 +764,14 @@ W = Wt([
764
764
  X(1, p(ut)),
765
765
  X(2, lt)
766
766
  ], W);
767
- var Zt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, zt = (t, e, r) => e in t ? Zt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Kt = (t, e, r, n) => {
768
- for (var o = n > 1 ? void 0 : n ? Gt(e, r) : e, i = t.length - 1, s; i >= 0; i--)
769
- (s = t[i]) && (o = s(o) || o);
767
+ var Zt = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, zt = (n, e, r) => e in n ? Zt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r, Kt = (n, e, r, t) => {
768
+ for (var o = t > 1 ? void 0 : t ? Gt(e, r) : e, i = n.length - 1, s; i >= 0; i--)
769
+ (s = n[i]) && (o = s(o) || o);
770
770
  return o;
771
- }, ee = (t, e) => (r, n) => e(r, n, t), ye = (t, e, r) => zt(t, typeof e != "symbol" ? e + "" : e, r);
771
+ }, ee = (n, e) => (r, t) => e(r, t, n), ye = (n, e, r) => zt(n, typeof e != "symbol" ? e + "" : e, r);
772
772
  let Z = class extends He {
773
- constructor(t = me, e, r, n) {
774
- super(), this._config = t, this._injector = e, this._commandService = r, this._configService = n;
773
+ constructor(n = me, e, r, t) {
774
+ super(), this._config = n, this._injector = e, this._commandService = r, this._configService = t;
775
775
  const { menu: o, ...i } = Le(
776
776
  {},
777
777
  me,
@@ -787,10 +787,10 @@ let Z = class extends He {
787
787
  [j],
788
788
  [F],
789
789
  [R]
790
- ].forEach((t) => {
791
- this._injector.add(t);
792
- }), [A].forEach((t) => {
793
- this._commandService.registerCommand(t);
790
+ ].forEach((n) => {
791
+ this._injector.add(n);
792
+ }), [A].forEach((n) => {
793
+ this._commandService.registerCommand(n);
794
794
  }), this._injector.get(W);
795
795
  }
796
796
  onReady() {
@@ -0,0 +1,11 @@
1
+ const e = {
2
+ sheetThreadComment: {
3
+ menu: {
4
+ addComment: "コメントを追加",
5
+ commentManagement: "コメント管理"
6
+ }
7
+ }
8
+ };
9
+ export {
10
+ e as default
11
+ };
@@ -0,0 +1,3 @@
1
+ import { default as enUS } from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;