@univerjs/sheets-ui 0.23.0 → 0.24.0-insiders.20260527-b1d726f

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 (98) hide show
  1. package/lib/cjs/index.js +1356 -1219
  2. package/lib/cjs/locale/ar-SA.js +411 -0
  3. package/lib/cjs/locale/ca-ES.js +7 -60
  4. package/lib/cjs/locale/de-DE.js +411 -0
  5. package/lib/cjs/locale/en-US.js +7 -60
  6. package/lib/cjs/locale/es-ES.js +7 -60
  7. package/lib/cjs/locale/fa-IR.js +7 -60
  8. package/lib/cjs/locale/fr-FR.js +8 -61
  9. package/lib/cjs/locale/id-ID.js +411 -0
  10. package/lib/cjs/locale/it-IT.js +411 -0
  11. package/lib/cjs/locale/ja-JP.js +7 -60
  12. package/lib/cjs/locale/ko-KR.js +7 -60
  13. package/lib/cjs/locale/pl-PL.js +411 -0
  14. package/lib/cjs/locale/pt-BR.js +411 -0
  15. package/lib/cjs/locale/ru-RU.js +10 -63
  16. package/lib/cjs/locale/sk-SK.js +7 -60
  17. package/lib/cjs/locale/vi-VN.js +11 -64
  18. package/lib/cjs/locale/zh-CN.js +11 -64
  19. package/lib/cjs/locale/zh-HK.js +411 -0
  20. package/lib/cjs/locale/zh-TW.js +11 -64
  21. package/lib/es/index.js +1351 -1223
  22. package/lib/es/locale/ar-SA.js +410 -0
  23. package/lib/es/locale/ca-ES.js +7 -60
  24. package/lib/es/locale/de-DE.js +410 -0
  25. package/lib/es/locale/en-US.js +7 -60
  26. package/lib/es/locale/es-ES.js +7 -60
  27. package/lib/es/locale/fa-IR.js +7 -60
  28. package/lib/es/locale/fr-FR.js +8 -61
  29. package/lib/es/locale/id-ID.js +410 -0
  30. package/lib/es/locale/it-IT.js +410 -0
  31. package/lib/es/locale/ja-JP.js +7 -60
  32. package/lib/es/locale/ko-KR.js +7 -60
  33. package/lib/es/locale/pl-PL.js +410 -0
  34. package/lib/es/locale/pt-BR.js +410 -0
  35. package/lib/es/locale/ru-RU.js +10 -63
  36. package/lib/es/locale/sk-SK.js +7 -60
  37. package/lib/es/locale/vi-VN.js +11 -64
  38. package/lib/es/locale/zh-CN.js +11 -64
  39. package/lib/es/locale/zh-HK.js +410 -0
  40. package/lib/es/locale/zh-TW.js +11 -64
  41. package/lib/index.js +1351 -1223
  42. package/lib/locale/ar-SA.js +410 -0
  43. package/lib/locale/ca-ES.js +7 -60
  44. package/lib/locale/de-DE.js +410 -0
  45. package/lib/locale/en-US.js +7 -60
  46. package/lib/locale/es-ES.js +7 -60
  47. package/lib/locale/fa-IR.js +7 -60
  48. package/lib/locale/fr-FR.js +8 -61
  49. package/lib/locale/id-ID.js +410 -0
  50. package/lib/locale/it-IT.js +410 -0
  51. package/lib/locale/ja-JP.js +7 -60
  52. package/lib/locale/ko-KR.js +7 -60
  53. package/lib/locale/pl-PL.js +410 -0
  54. package/lib/locale/pt-BR.js +410 -0
  55. package/lib/locale/ru-RU.js +10 -63
  56. package/lib/locale/sk-SK.js +7 -60
  57. package/lib/locale/vi-VN.js +11 -64
  58. package/lib/locale/zh-CN.js +11 -64
  59. package/lib/locale/zh-HK.js +410 -0
  60. package/lib/locale/zh-TW.js +11 -64
  61. package/lib/types/controllers/render-controllers/header-unhide.render-controller.d.ts +10 -2
  62. package/lib/types/controllers/render-controllers/sheet.render-controller.d.ts +9 -0
  63. package/lib/types/index.d.ts +2 -0
  64. package/lib/types/locale/ar-SA.d.ts +18 -0
  65. package/lib/types/locale/de-DE.d.ts +18 -0
  66. package/lib/types/locale/en-US.d.ts +391 -442
  67. package/lib/types/locale/id-ID.d.ts +18 -0
  68. package/lib/types/locale/it-IT.d.ts +18 -0
  69. package/lib/types/locale/pl-PL.d.ts +18 -0
  70. package/lib/types/locale/pt-BR.d.ts +18 -0
  71. package/lib/types/locale/zh-HK.d.ts +18 -0
  72. package/lib/types/menu/clear.menu.d.ts +1 -0
  73. package/lib/types/services/clipboard/copy-content-cache.d.ts +0 -1
  74. package/lib/types/services/header-unhide-range.service.d.ts +32 -0
  75. package/lib/types/services/selection/mobile-selection-shape.d.ts +2 -0
  76. package/lib/types/services/selection/selection-control.d.ts +4 -0
  77. package/lib/umd/index.js +11 -11
  78. package/lib/umd/locale/ar-SA.js +1 -0
  79. package/lib/umd/locale/ca-ES.js +1 -1
  80. package/lib/umd/locale/de-DE.js +1 -0
  81. package/lib/umd/locale/en-US.js +1 -1
  82. package/lib/umd/locale/es-ES.js +1 -1
  83. package/lib/umd/locale/fa-IR.js +1 -1
  84. package/lib/umd/locale/fr-FR.js +1 -1
  85. package/lib/umd/locale/id-ID.js +1 -0
  86. package/lib/umd/locale/it-IT.js +1 -0
  87. package/lib/umd/locale/ja-JP.js +1 -1
  88. package/lib/umd/locale/ko-KR.js +1 -1
  89. package/lib/umd/locale/pl-PL.js +1 -0
  90. package/lib/umd/locale/pt-BR.js +1 -0
  91. package/lib/umd/locale/ru-RU.js +1 -1
  92. package/lib/umd/locale/sk-SK.js +1 -1
  93. package/lib/umd/locale/vi-VN.js +1 -1
  94. package/lib/umd/locale/zh-CN.js +1 -1
  95. package/lib/umd/locale/zh-HK.js +1 -0
  96. package/lib/umd/locale/zh-TW.js +1 -1
  97. package/package.json +14 -14
  98. package/LICENSE +0 -176
package/lib/cjs/index.js CHANGED
@@ -518,11 +518,13 @@ var BaseSelectionRenderService = class extends _univerjs_core.Disposable {
518
518
  }
519
519
  newSelectionControl(scene, skeleton, selection) {
520
520
  const zIndex = this.getSelectionControls().length;
521
- const { rowHeaderWidth, columnHeaderHeight } = skeleton;
521
+ const { rowHeaderWidth, rowHeaderWidthAndMarginLeft, columnHeaderHeight, columnHeaderHeightAndMarginTop } = skeleton;
522
522
  const control = new SelectionControl(scene, zIndex, this._selectionTheme, {
523
523
  highlightHeader: this._highlightHeader,
524
524
  rowHeaderWidth,
525
- columnHeaderHeight
525
+ columnHeaderHeight,
526
+ rowHeaderOffsetX: Math.max(0, rowHeaderWidthAndMarginLeft - rowHeaderWidth),
527
+ columnHeaderOffsetY: Math.max(0, columnHeaderHeightAndMarginTop - columnHeaderHeight)
526
528
  });
527
529
  this._selectionControls.push(control);
528
530
  const selectionWithCoord = (0, _univerjs_sheets.attachSelectionWithCoord)(selection, skeleton);
@@ -1808,7 +1810,7 @@ const SELECTION_TITLE_HIGHLIGHT_ALPHA = .3;
1808
1810
  */
1809
1811
  var SelectionControl = class extends _univerjs_core.Disposable {
1810
1812
  constructor(_scene, _zIndex, _themeService, options) {
1811
- var _options$enableAutoFi, _options$highlightHea, _options$rowHeaderWid, _options$columnHeader;
1813
+ var _options$enableAutoFi, _options$highlightHea, _options$rowHeaderWid, _options$columnHeader, _options$rowHeaderOff, _options$columnHeader2;
1812
1814
  super();
1813
1815
  this._scene = _scene;
1814
1816
  this._zIndex = _zIndex;
@@ -1847,6 +1849,8 @@ var SelectionControl = class extends _univerjs_core.Disposable {
1847
1849
  _defineProperty(this, "_currentStyle", void 0);
1848
1850
  _defineProperty(this, "_rowHeaderWidth", 0);
1849
1851
  _defineProperty(this, "_columnHeaderHeight", 0);
1852
+ _defineProperty(this, "_rowHeaderOffsetX", 0);
1853
+ _defineProperty(this, "_columnHeaderOffsetY", 0);
1850
1854
  _defineProperty(this, "_widgetRects", []);
1851
1855
  _defineProperty(this, "_controlExtension", void 0);
1852
1856
  _defineProperty(this, "_dispose$", new rxjs.BehaviorSubject(this));
@@ -1864,6 +1868,8 @@ var SelectionControl = class extends _univerjs_core.Disposable {
1864
1868
  this._highlightHeader = (_options$highlightHea = options === null || options === void 0 ? void 0 : options.highlightHeader) !== null && _options$highlightHea !== void 0 ? _options$highlightHea : true;
1865
1869
  this._rowHeaderWidth = (_options$rowHeaderWid = options === null || options === void 0 ? void 0 : options.rowHeaderWidth) !== null && _options$rowHeaderWid !== void 0 ? _options$rowHeaderWid : 0;
1866
1870
  this._columnHeaderHeight = (_options$columnHeader = options === null || options === void 0 ? void 0 : options.columnHeaderHeight) !== null && _options$columnHeader !== void 0 ? _options$columnHeader : 0;
1871
+ this._rowHeaderOffsetX = (_options$rowHeaderOff = options === null || options === void 0 ? void 0 : options.rowHeaderOffsetX) !== null && _options$rowHeaderOff !== void 0 ? _options$rowHeaderOff : 0;
1872
+ this._columnHeaderOffsetY = (_options$columnHeader2 = options === null || options === void 0 ? void 0 : options.columnHeaderOffsetY) !== null && _options$columnHeader2 !== void 0 ? _options$columnHeader2 : 0;
1867
1873
  this._initializeSheetBody();
1868
1874
  this._initialHeader();
1869
1875
  }
@@ -2228,6 +2234,8 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2228
2234
  if (sk) {
2229
2235
  this._rowHeaderWidth = sk.rowHeaderWidth;
2230
2236
  this._columnHeaderHeight = sk.columnHeaderHeight;
2237
+ this._rowHeaderOffsetX = Math.max(0, sk.rowHeaderWidthAndMarginLeft - sk.rowHeaderWidth);
2238
+ this._columnHeaderOffsetY = Math.max(0, sk.columnHeaderHeightAndMarginTop - sk.columnHeaderHeight);
2231
2239
  }
2232
2240
  this._selectionRenderModel.setValue(selectionWthCoord.rangeWithCoord, selectionWthCoord.primaryWithCoord);
2233
2241
  this._showAutoFill = selectionWthCoord.primaryWithCoord !== null;
@@ -2248,6 +2256,8 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2248
2256
  update(newSelectionRange, rowHeaderWidth = 0, columnHeaderHeight = 0, style, primaryCell) {
2249
2257
  this._rowHeaderWidth = rowHeaderWidth;
2250
2258
  this._columnHeaderHeight = columnHeaderHeight;
2259
+ this._rowHeaderOffsetX = 0;
2260
+ this._columnHeaderOffsetY = 0;
2251
2261
  this.updateRangeBySelectionWithCoord({
2252
2262
  rangeWithCoord: newSelectionRange,
2253
2263
  primaryWithCoord: primaryCell,
@@ -2367,6 +2377,8 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2367
2377
  columnHeaderStrokeWidth /= scale;
2368
2378
  const rowHeaderWidth = this._rowHeaderWidth;
2369
2379
  const columnHeaderHeight = this._columnHeaderHeight;
2380
+ const rowHeaderOffsetX = this._rowHeaderOffsetX;
2381
+ const columnHeaderOffsetY = this._columnHeaderOffsetY;
2370
2382
  if (this._highlightHeader && columnHeaderHeight > 0) {
2371
2383
  let highlightTitleColor = columnHeaderFill;
2372
2384
  if (rangeType === _univerjs_core.RANGE_TYPE.COLUMN) highlightTitleColor = new _univerjs_core.ColorKit(stroke).setAlpha(SELECTION_TITLE_HIGHLIGHT_ALPHA).toString();
@@ -2379,7 +2391,7 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2379
2391
  top: columnHeaderHeight - columnHeaderStrokeWidth + 1 / scale
2380
2392
  });
2381
2393
  this._columnHeaderGroup.show();
2382
- this._columnHeaderGroup.translate(startX, 0);
2394
+ this._columnHeaderGroup.translate(startX, columnHeaderOffsetY);
2383
2395
  } else this._columnHeaderGroup.hide();
2384
2396
  this._columnHeaderGroup.makeDirty(true);
2385
2397
  if (this._highlightHeader && rowHeaderWidth > 0) {
@@ -2394,7 +2406,7 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2394
2406
  left: rowHeaderWidth - rowHeaderStrokeWidth + 1 / scale
2395
2407
  });
2396
2408
  this._rowHeaderGroup.show();
2397
- this._rowHeaderGroup.translate(0, startY);
2409
+ this._rowHeaderGroup.translate(rowHeaderOffsetX, startY);
2398
2410
  } else this._rowHeaderGroup.hide();
2399
2411
  this._rowHeaderGroup.makeDirty(true);
2400
2412
  }
@@ -2608,7 +2620,7 @@ let MarkSelectionService = class MarkSelectionService extends _univerjs_core.Dis
2608
2620
  }
2609
2621
  addShape(selection, exits = [], zIndex = DEFAULT_Z_INDEX) {
2610
2622
  var _workbook$getActiveSh;
2611
- const workbook = this._currentService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2623
+ const workbook = this._currentService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2612
2624
  const subUnitId = (_workbook$getActiveSh = workbook.getActiveSheet()) === null || _workbook$getActiveSh === void 0 ? void 0 : _workbook$getActiveSh.getSheetId();
2613
2625
  if (!subUnitId) return null;
2614
2626
  const id = (0, _univerjs_core.generateRandomId)();
@@ -2626,7 +2638,7 @@ let MarkSelectionService = class MarkSelectionService extends _univerjs_core.Dis
2626
2638
  }
2627
2639
  addShapeWithNoFresh(selection, exits = [], zIndex = DEFAULT_Z_INDEX) {
2628
2640
  var _workbook$getActiveSh2;
2629
- const workbook = this._currentService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2641
+ const workbook = this._currentService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2630
2642
  const subUnitId = (_workbook$getActiveSh2 = workbook.getActiveSheet()) === null || _workbook$getActiveSh2 === void 0 ? void 0 : _workbook$getActiveSh2.getSheetId();
2631
2643
  if (!subUnitId) return null;
2632
2644
  const id = (0, _univerjs_core.generateRandomId)();
@@ -2642,7 +2654,7 @@ let MarkSelectionService = class MarkSelectionService extends _univerjs_core.Dis
2642
2654
  }
2643
2655
  refreshShapes() {
2644
2656
  var _currentSheet$getActi;
2645
- const currentSheet = this._currentService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2657
+ const currentSheet = this._currentService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
2646
2658
  if (!currentSheet) return;
2647
2659
  const currentUnitId = currentSheet.getUnitId();
2648
2660
  const currentSubUnitId = (_currentSheet$getActi = currentSheet.getActiveSheet()) === null || _currentSheet$getActi === void 0 ? void 0 : _currentSheet$getActi.getSheetId();
@@ -2734,10 +2746,6 @@ function cloneCellDataWithSpanInfo(cell) {
2734
2746
  //#endregion
2735
2747
  //#region src/services/clipboard/copy-content-cache.ts
2736
2748
  const COPY_CONTENT_CACHE_LIMIT = 10;
2737
- const ID_LENGTH = 6;
2738
- function genId() {
2739
- return (0, _univerjs_core.generateRandomId)(ID_LENGTH);
2740
- }
2741
2749
  function extractId(html) {
2742
2750
  const match = html.match(/data-copy-id="([^\s]+)"/);
2743
2751
  if (match && match[1]) return match[1];
@@ -4064,7 +4072,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4064
4072
  async copy(options) {
4065
4073
  const selection = this._selectionManagerService.getCurrentLastSelection();
4066
4074
  if (!selection) return false;
4067
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4075
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4068
4076
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
4069
4077
  if (!workbook || !worksheet) return false;
4070
4078
  const workbookId = workbook.getUnitId();
@@ -4104,8 +4112,8 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4104
4112
  if (html && shouldUseHTMLPaste) {
4105
4113
  if (this._platformService.isWindows && htmlIsFromExcel(html)) this._notificationService.show({
4106
4114
  type: "warning",
4107
- title: this._localeService.t("clipboard.shortCutNotify.title"),
4108
- content: this._localeService.t("clipboard.shortCutNotify.useShortCutInstead")
4115
+ title: this._localeService.t("sheets-ui.clipboard.shortCutNotify.title"),
4116
+ content: this._localeService.t("sheets-ui.clipboard.shortCutNotify.useShortCutInstead")
4109
4117
  });
4110
4118
  return this._pasteHTML(html, pasteType);
4111
4119
  }
@@ -4225,7 +4233,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4225
4233
  rowIndex += 1;
4226
4234
  }
4227
4235
  for (let c = startColumn; c <= endColumn; c++) discreteRange.cols.push(c);
4228
- const copyId = genId();
4236
+ const copyId = (0, _univerjs_core.generateRandomId)(6);
4229
4237
  const html = this._usmToHtml.convert(matrix, discreteRange, hooks, copyId);
4230
4238
  return {
4231
4239
  copyId,
@@ -4277,7 +4285,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4277
4285
  });
4278
4286
  const result = redoMutationsInfo.every((m) => this._commandService.executeCommand(m.id, m.params));
4279
4287
  if (result) this._undoRedoService.pushUndoRedo({
4280
- unitID: this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId(),
4288
+ unitID: this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId(),
4281
4289
  undoMutations: undoMutationsInfo,
4282
4290
  redoMutations: redoMutationsInfo
4283
4291
  });
@@ -4319,7 +4327,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4319
4327
  if (mergeData.some((m) => {
4320
4328
  return rangeIntersectWithDiscreteRange(m, pasteTarget.pastedRange) && !discreteRangeContainsRange(pasteTarget.pastedRange, m);
4321
4329
  })) {
4322
- this._errorService.emit(this._localeService.t("clipboard.paste.overlappingMergedCells"));
4330
+ this._errorService.emit(this._localeService.t("sheets-ui.clipboard.paste.overlappingMergedCells"));
4323
4331
  return false;
4324
4332
  }
4325
4333
  }
@@ -4365,7 +4373,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4365
4373
  if (mergeData.some((m) => {
4366
4374
  return rangeIntersectWithDiscreteRange(m, pasteTarget.pastedRange) && !discreteRangeContainsRange(pasteTarget.pastedRange, m);
4367
4375
  })) {
4368
- this._errorService.emit(this._localeService.t("clipboard.paste.overlappingMergedCells"));
4376
+ this._errorService.emit(this._localeService.t("sheets-ui.clipboard.paste.overlappingMergedCells"));
4369
4377
  return false;
4370
4378
  }
4371
4379
  }
@@ -4624,7 +4632,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4624
4632
  };
4625
4633
  }
4626
4634
  _getPastingTarget() {
4627
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4635
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4628
4636
  const worksheet = workbook.getActiveSheet();
4629
4637
  const selection = this._selectionManagerService.getCurrentLastSelection();
4630
4638
  return {
@@ -4686,7 +4694,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4686
4694
  const { startRow, startColumn, endRow, endColumn } = vRange;
4687
4695
  const destinationRows = endRow - startRow + 1;
4688
4696
  const destinationColumns = endColumn - startColumn + 1;
4689
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4697
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4690
4698
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
4691
4699
  if (!worksheet) return null;
4692
4700
  const mergedCellsInRange = worksheet.getMergeData().filter((rect) => discreteRange.rows.includes(rect.startRow) && discreteRange.cols.includes(rect.startColumn));
@@ -4826,7 +4834,7 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4826
4834
  * @param range
4827
4835
  */
4828
4836
  _topLeftCellsMatch(rowCount, colCount, range) {
4829
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4837
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
4830
4838
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
4831
4839
  if (!worksheet) return false;
4832
4840
  const { topRow, leftCol } = range;
@@ -5029,10 +5037,10 @@ const DeleteRangeMoveLeftConfirmCommand = {
5029
5037
  })) return commandService.executeCommand(_univerjs_sheets.DeleteRangeMoveLeftCommand.id);
5030
5038
  if (await confirmService.confirm({
5031
5039
  id: DeleteRangeMoveLeftConfirmCommand.id,
5032
- title: { title: localeService.t("merge.confirm.warning") },
5033
- children: { title: localeService.t("merge.confirm.dismantleMergeCellWarning") },
5034
- cancelText: localeService.t("button.cancel"),
5035
- confirmText: localeService.t("button.confirm")
5040
+ title: { title: localeService.t("sheets-ui.merge.confirm.warning") },
5041
+ children: { title: localeService.t("sheets-ui.merge.confirm.dismantleMergeCellWarning") },
5042
+ cancelText: localeService.t("sheets-ui.button.cancel"),
5043
+ confirmText: localeService.t("sheets-ui.button.confirm")
5036
5044
  })) return commandService.executeCommand(_univerjs_sheets.DeleteRangeMoveLeftCommand.id);
5037
5045
  return true;
5038
5046
  }
@@ -5063,9 +5071,9 @@ const DeleteRangeMoveUpConfirmCommand = {
5063
5071
  for (let i = range.startRow; i <= range.endRow; i++) if (worksheet.getRowFiltered(i)) {
5064
5072
  if (await confirmService.confirm({
5065
5073
  id: DeleteRangeMoveUpConfirmCommand.id,
5066
- title: { title: localeService.t("filter.confirm.error") },
5067
- children: { title: localeService.t("filter.confirm.notAllowedToInsertRange") },
5068
- confirmText: localeService.t("button.confirm")
5074
+ title: { title: localeService.t("sheets-ui.filter.confirm.error") },
5075
+ children: { title: localeService.t("sheets-ui.filter.confirm.notAllowedToInsertRange") },
5076
+ confirmText: localeService.t("sheets-ui.button.confirm")
5069
5077
  })) return false;
5070
5078
  }
5071
5079
  const getColLength = (range) => range.endColumn - range.startColumn;
@@ -5075,10 +5083,10 @@ const DeleteRangeMoveUpConfirmCommand = {
5075
5083
  })) return commandService.executeCommand(_univerjs_sheets.DeleteRangeMoveUpCommand.id);
5076
5084
  if (await confirmService.confirm({
5077
5085
  id: DeleteRangeMoveUpConfirmCommand.id,
5078
- title: { title: localeService.t("merge.confirm.warning") },
5079
- children: { title: localeService.t("merge.confirm.dismantleMergeCellWarning") },
5080
- cancelText: localeService.t("button.cancel"),
5081
- confirmText: localeService.t("button.confirm")
5086
+ title: { title: localeService.t("sheets-ui.merge.confirm.warning") },
5087
+ children: { title: localeService.t("sheets-ui.merge.confirm.dismantleMergeCellWarning") },
5088
+ cancelText: localeService.t("sheets-ui.button.cancel"),
5089
+ confirmText: localeService.t("sheets-ui.button.confirm")
5082
5090
  })) return commandService.executeCommand(_univerjs_sheets.DeleteRangeMoveUpCommand.id);
5083
5091
  return true;
5084
5092
  }
@@ -5510,10 +5518,10 @@ const HideRowConfirmCommand = {
5510
5518
  const localeService = accessor.get(_univerjs_core.LocaleService);
5511
5519
  await confirmService.confirm({
5512
5520
  id: "sheet.confirm.hide-row",
5513
- title: { title: localeService.t("info.problem") },
5514
- children: { title: localeService.t("rightClick.hideAllRowsAlert") },
5515
- cancelText: localeService.t("button.cancel"),
5516
- confirmText: localeService.t("button.confirm")
5521
+ title: { title: localeService.t("sheets-ui.info.problem") },
5522
+ children: { title: localeService.t("sheets-ui.rightClick.hideAllRowsAlert") },
5523
+ cancelText: localeService.t("sheets-ui.button.cancel"),
5524
+ confirmText: localeService.t("sheets-ui.button.confirm")
5517
5525
  });
5518
5526
  return false;
5519
5527
  }
@@ -5537,10 +5545,10 @@ const HideColConfirmCommand = {
5537
5545
  const localeService = accessor.get(_univerjs_core.LocaleService);
5538
5546
  await confirmService.confirm({
5539
5547
  id: "sheet.confirm.hide-col",
5540
- title: { title: localeService.t("info.problem") },
5541
- children: { title: localeService.t("rightClick.hideAllColumnsAlert") },
5542
- cancelText: localeService.t("button.cancel"),
5543
- confirmText: localeService.t("button.confirm")
5548
+ title: { title: localeService.t("sheets-ui.info.problem") },
5549
+ children: { title: localeService.t("sheets-ui.rightClick.hideAllColumnsAlert") },
5550
+ cancelText: localeService.t("sheets-ui.button.cancel"),
5551
+ confirmText: localeService.t("sheets-ui.button.confirm")
5544
5552
  });
5545
5553
  return false;
5546
5554
  }
@@ -5753,9 +5761,9 @@ const InsertRangeMoveDownConfirmCommand = {
5753
5761
  for (let i = range.startRow; i <= range.endRow; i++) if (worksheet.getRowFiltered(i)) {
5754
5762
  if (await confirmService.confirm({
5755
5763
  id: InsertRangeMoveDownConfirmCommand.id,
5756
- title: { title: localeService.t("filter.confirm.error") },
5757
- children: { title: localeService.t("filter.confirm.notAllowedToInsertRange") },
5758
- confirmText: localeService.t("button.confirm")
5764
+ title: { title: localeService.t("sheets-ui.filter.confirm.error") },
5765
+ children: { title: localeService.t("sheets-ui.filter.confirm.notAllowedToInsertRange") },
5766
+ confirmText: localeService.t("sheets-ui.button.confirm")
5759
5767
  })) return false;
5760
5768
  }
5761
5769
  const getColLength = (range) => range.endColumn - range.startColumn;
@@ -5765,10 +5773,10 @@ const InsertRangeMoveDownConfirmCommand = {
5765
5773
  })) return commandService.executeCommand(_univerjs_sheets.InsertRangeMoveDownCommand.id);
5766
5774
  if (await confirmService.confirm({
5767
5775
  id: InsertRangeMoveDownConfirmCommand.id,
5768
- title: { title: localeService.t("merge.confirm.warning") },
5769
- children: { title: localeService.t("merge.confirm.dismantleMergeCellWarning") },
5770
- cancelText: localeService.t("button.cancel"),
5771
- confirmText: localeService.t("button.confirm")
5776
+ title: { title: localeService.t("sheets-ui.merge.confirm.warning") },
5777
+ children: { title: localeService.t("sheets-ui.merge.confirm.dismantleMergeCellWarning") },
5778
+ cancelText: localeService.t("sheets-ui.button.cancel"),
5779
+ confirmText: localeService.t("sheets-ui.button.confirm")
5772
5780
  })) return commandService.executeCommand(_univerjs_sheets.InsertRangeMoveDownCommand.id);
5773
5781
  return true;
5774
5782
  }
@@ -5803,10 +5811,10 @@ const InsertRangeMoveRightConfirmCommand = {
5803
5811
  })) return commandService.executeCommand(_univerjs_sheets.InsertRangeMoveRightCommand.id);
5804
5812
  if (await confirmService.confirm({
5805
5813
  id: InsertRangeMoveRightConfirmCommand.id,
5806
- title: { title: localeService.t("merge.confirm.warning") },
5807
- children: { title: localeService.t("merge.confirm.dismantleMergeCellWarning") },
5808
- cancelText: localeService.t("button.cancel"),
5809
- confirmText: localeService.t("button.confirm")
5814
+ title: { title: localeService.t("sheets-ui.merge.confirm.warning") },
5815
+ children: { title: localeService.t("sheets-ui.merge.confirm.dismantleMergeCellWarning") },
5816
+ cancelText: localeService.t("sheets-ui.button.cancel"),
5817
+ confirmText: localeService.t("sheets-ui.button.confirm")
5810
5818
  })) return commandService.executeCommand(_univerjs_sheets.InsertRangeMoveRightCommand.id);
5811
5819
  return true;
5812
5820
  }
@@ -5953,7 +5961,7 @@ const SheetPermissionOpenPanelOperation = {
5953
5961
  const sheetPermissionUserManagerService = accessor.get(SheetPermissionUserManagerService);
5954
5962
  const { showDetail = true, fromSheetBar = false, rule, oldRule } = _params;
5955
5963
  const sidebarProps = {
5956
- header: { title: "permission.panel.title" },
5964
+ header: { title: "sheets-ui.permission.panel.title" },
5957
5965
  children: {
5958
5966
  label: UNIVER_SHEET_PERMISSION_PANEL,
5959
5967
  showDetail,
@@ -6027,7 +6035,7 @@ const DeleteRangeProtectionFromContextMenuCommand = {
6027
6035
  const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
6028
6036
  const selectionManagerService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
6029
6037
  const worksheetRuleModel = accessor.get(_univerjs_sheets.WorksheetProtectionRuleModel);
6030
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
6038
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
6031
6039
  const worksheet = workbook.getActiveSheet();
6032
6040
  const unitId = workbook.getUnitId();
6033
6041
  const subUnitId = worksheet.getSheetId();
@@ -6078,7 +6086,7 @@ const SetRangeProtectionFromContextMenuCommand = {
6078
6086
  const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
6079
6087
  const selectionManagerService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
6080
6088
  const worksheetRuleModel = accessor.get(_univerjs_sheets.WorksheetProtectionRuleModel);
6081
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
6089
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
6082
6090
  const worksheet = workbook.getActiveSheet();
6083
6091
  const unitId = workbook.getUnitId();
6084
6092
  const subUnitId = worksheet.getSheetId();
@@ -6143,10 +6151,10 @@ const RemoveRowConfirmCommand = {
6143
6151
  const localeService = accessor.get(_univerjs_core.LocaleService);
6144
6152
  await confirmService.confirm({
6145
6153
  id: "sheet.confirm.remove-row",
6146
- title: { title: localeService.t("info.problem") },
6147
- children: { title: localeService.t("rightClick.deleteAllRowsAlert") },
6148
- cancelText: localeService.t("button.cancel"),
6149
- confirmText: localeService.t("button.confirm")
6154
+ title: { title: localeService.t("sheets-ui.info.problem") },
6155
+ children: { title: localeService.t("sheets-ui.rightClick.deleteAllRowsAlert") },
6156
+ cancelText: localeService.t("sheets-ui.button.cancel"),
6157
+ confirmText: localeService.t("sheets-ui.button.confirm")
6150
6158
  });
6151
6159
  return false;
6152
6160
  }
@@ -6174,10 +6182,10 @@ const RemoveColConfirmCommand = {
6174
6182
  const localeService = accessor.get(_univerjs_core.LocaleService);
6175
6183
  await confirmService.confirm({
6176
6184
  id: "sheet.confirm.remove-col",
6177
- title: { title: localeService.t("info.problem") },
6178
- children: { title: localeService.t("rightClick.deleteAllColumnsAlert") },
6179
- cancelText: localeService.t("button.cancel"),
6180
- confirmText: localeService.t("button.confirm")
6185
+ title: { title: localeService.t("sheets-ui.info.problem") },
6186
+ children: { title: localeService.t("sheets-ui.rightClick.deleteAllColumnsAlert") },
6187
+ cancelText: localeService.t("sheets-ui.button.cancel"),
6188
+ confirmText: localeService.t("sheets-ui.button.confirm")
6181
6189
  });
6182
6190
  return false;
6183
6191
  }
@@ -6208,10 +6216,10 @@ const RemoveSheetConfirmCommand = {
6208
6216
  const isLargeSheet = (0, _univerjs_sheets.countCells)(worksheet.getCellMatrix()) >= largeSheetConfig.largeSheetCellCountThreshold;
6209
6217
  if (!await confirmService.confirm({
6210
6218
  id: "sheet.confirm.remove-sheet",
6211
- title: { title: localeService.t("sheetConfig.deleteSheet") },
6212
- children: { title: isLargeSheet ? localeService.t("sheetConfig.deleteLargeSheetContent") : localeService.t("sheetConfig.deleteSheetContent") },
6213
- cancelText: localeService.t("button.cancel"),
6214
- confirmText: localeService.t("button.confirm")
6219
+ title: { title: localeService.t("sheets-ui.sheetConfig.deleteSheet") },
6220
+ children: { title: isLargeSheet ? localeService.t("sheets-ui.sheetConfig.deleteLargeSheetContent") : localeService.t("sheets-ui.sheetConfig.deleteSheetContent") },
6221
+ cancelText: localeService.t("sheets-ui.button.cancel"),
6222
+ confirmText: localeService.t("sheets-ui.button.confirm")
6215
6223
  })) return false;
6216
6224
  await commandService.executeCommand(_univerjs_sheets.RemoveSheetCommand.id, { subUnitId });
6217
6225
  return true;
@@ -6999,7 +7007,7 @@ function isRenderManagerService(renderManagerService) {
6999
7007
  * Get render objects of a spreadsheet.
7000
7008
  */
7001
7009
  function getSheetObject(univerInstanceService, renderManagerService) {
7002
- const workbook = univerInstanceService instanceof _univerjs_core.Workbook ? univerInstanceService : univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
7010
+ const workbook = univerInstanceService instanceof _univerjs_core.Workbook ? univerInstanceService : univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
7003
7011
  if (!workbook) return null;
7004
7012
  const unitId = workbook.getUnitId();
7005
7013
  let components, mainComponent, scene, engine;
@@ -7551,7 +7559,7 @@ const ScrollToCellCommand = {
7551
7559
  type: _univerjs_core.CommandType.COMMAND,
7552
7560
  handler: (accessor, params) => {
7553
7561
  const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
7554
- return accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderById(instanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId()).with(SheetsScrollRenderController).scrollToRange(params.range, params.forceTop, params.forceLeft);
7562
+ return accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderById(instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId()).with(SheetsScrollRenderController).scrollToRange(params.range, params.forceTop, params.forceLeft);
7555
7563
  }
7556
7564
  };
7557
7565
  /**
@@ -8161,7 +8169,7 @@ const DeleteWorksheetProtectionFormSheetBarCommand = {
8161
8169
  const commandService = accessor.get(_univerjs_core.ICommandService);
8162
8170
  const undoRedoService = accessor.get(_univerjs_core.IUndoRedoService);
8163
8171
  const worksheetProtectionRuleModel = accessor.get(_univerjs_sheets.WorksheetProtectionRuleModel);
8164
- const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8172
+ const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8165
8173
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
8166
8174
  const unitId = workbook.getUnitId();
8167
8175
  if (!worksheet) return false;
@@ -8248,7 +8256,7 @@ const SetCellEditVisibleOperation = {
8248
8256
  if (!params) return false;
8249
8257
  if (((_configService$getCon = accessor.get(_univerjs_core.IConfigService).getConfig("sheets-ui.config")) === null || _configService$getCon === void 0 ? void 0 : _configService$getCon.disableEdit) && params.visible) return false;
8250
8258
  const { unitId } = params;
8251
- const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8259
+ const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8252
8260
  if (!workbook) return false;
8253
8261
  accessor.get(IEditorBridgeService).changeVisible({
8254
8262
  ...params,
@@ -8262,7 +8270,7 @@ const SetCellEditVisibleWithF2Operation = {
8262
8270
  type: _univerjs_core.CommandType.OPERATION,
8263
8271
  handler: (accessor, params) => {
8264
8272
  const commandService = accessor.get(_univerjs_core.ICommandService);
8265
- const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8273
+ const workbook = accessor.get(_univerjs_core.IUniverInstanceService).getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8266
8274
  if (!workbook) return false;
8267
8275
  return commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
8268
8276
  ...params,
@@ -8302,7 +8310,7 @@ const ScrollToRangeOperation = {
8302
8310
  handler: (accessor, params) => {
8303
8311
  if (!params) return false;
8304
8312
  const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
8305
- return accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderById(instanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId()).with(SheetsScrollRenderController).scrollToRange(params.range, params.forceTop, params.forceLeft);
8313
+ return accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderById(instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId()).with(SheetsScrollRenderController).scrollToRange(params.range, params.forceTop, params.forceLeft);
8306
8314
  }
8307
8315
  };
8308
8316
 
@@ -8316,7 +8324,7 @@ const SheetPermissionOpenDialogOperation = {
8316
8324
  dialogService.close("DESKTOP_FIND_REPLACE_DIALOG");
8317
8325
  dialogService.open({
8318
8326
  id: UNIVER_SHEET_PERMISSION_DIALOG_ID,
8319
- title: { title: "permission.dialog.allowedPermissionType" },
8327
+ title: { title: "sheets-ui.permission.dialog.allowedPermissionType" },
8320
8328
  children: { label: UNIVER_SHEET_PERMISSION_DIALOG },
8321
8329
  width: 393,
8322
8330
  destroyOnClose: true,
@@ -8361,7 +8369,7 @@ const SidebarDefinedNameOperation = {
8361
8369
  case "open":
8362
8370
  sidebarService.open({
8363
8371
  id: DEFINED_NAME_CONTAINER,
8364
- header: { title: localeService.t("definedName.featureTitle") },
8372
+ header: { title: localeService.t("sheets-ui.definedName.featureTitle") },
8365
8373
  children: { label: DEFINED_NAME_CONTAINER },
8366
8374
  onClose: () => {},
8367
8375
  width: 333,
@@ -8877,7 +8885,7 @@ let AutoHeightController = class AutoHeightController extends _univerjs_core.Dis
8877
8885
  }
8878
8886
  getUndoRedoParamsOfAutoHeight(ranges, subUnitIdParam, currentCellHeights) {
8879
8887
  const { _univerInstanceService: univerInstanceService } = this;
8880
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8888
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
8881
8889
  const unitId = workbook.getUnitId();
8882
8890
  let worksheet = workbook.getActiveSheet();
8883
8891
  let subUnitId = worksheet.getSheetId();
@@ -9073,23 +9081,23 @@ const DEFAULT_PADDING = 2;
9073
9081
  const SheetPasteOptions = [
9074
9082
  {
9075
9083
  value: "DEFAULT_PASTE",
9076
- label: "rightClick.paste"
9084
+ label: "sheets-ui.rightClick.paste"
9077
9085
  },
9078
9086
  {
9079
9087
  value: "SPECIAL_PASTE_VALUE",
9080
- label: "rightClick.pasteValue"
9088
+ label: "sheets-ui.rightClick.pasteValue"
9081
9089
  },
9082
9090
  {
9083
9091
  value: "SPECIAL_PASTE_FORMAT",
9084
- label: "rightClick.pasteFormat"
9092
+ label: "sheets-ui.rightClick.pasteFormat"
9085
9093
  },
9086
9094
  {
9087
9095
  value: "SPECIAL_PASTE_COL_WIDTH",
9088
- label: "rightClick.pasteColWidth"
9096
+ label: "sheets-ui.rightClick.pasteColWidth"
9089
9097
  },
9090
9098
  {
9091
9099
  value: "SPECIAL_PASTE_BESIDES_BORDER",
9092
- label: "rightClick.pasteBesidesBorder"
9100
+ label: "sheets-ui.rightClick.pasteBesidesBorder"
9093
9101
  },
9094
9102
  {
9095
9103
  value: "SPECIAL_PASTE_FORMULA",
@@ -9873,7 +9881,7 @@ const permissionCheckMap = {
9873
9881
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission],
9874
9882
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
9875
9883
  },
9876
- errorMessageKey: "permission.dialog.editErr"
9884
+ errorMessageKey: "sheets-ui.permission.dialog.editErr"
9877
9885
  },
9878
9886
  ["cellStyle"]: {
9879
9887
  permissionTypes: {
@@ -9881,7 +9889,7 @@ const permissionCheckMap = {
9881
9889
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission],
9882
9890
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
9883
9891
  },
9884
- errorMessageKey: "permission.dialog.setStyleErr"
9892
+ errorMessageKey: "sheets-ui.permission.dialog.setStyleErr"
9885
9893
  },
9886
9894
  ["cellValue"]: {
9887
9895
  permissionTypes: {
@@ -9889,7 +9897,7 @@ const permissionCheckMap = {
9889
9897
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellValuePermission],
9890
9898
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
9891
9899
  },
9892
- errorMessageKey: "permission.dialog.editErr"
9900
+ errorMessageKey: "sheets-ui.permission.dialog.editErr"
9893
9901
  },
9894
9902
  ["rowStyle"]: {
9895
9903
  permissionTypes: {
@@ -9897,7 +9905,7 @@ const permissionCheckMap = {
9897
9905
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetRowStylePermission],
9898
9906
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
9899
9907
  },
9900
- errorMessageKey: "permission.dialog.setRowColStyleErr"
9908
+ errorMessageKey: "sheets-ui.permission.dialog.setRowColStyleErr"
9901
9909
  },
9902
9910
  ["columnStyle"]: {
9903
9911
  permissionTypes: {
@@ -9905,7 +9913,7 @@ const permissionCheckMap = {
9905
9913
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetColumnStylePermission],
9906
9914
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
9907
9915
  },
9908
- errorMessageKey: "permission.dialog.setRowColStyleErr"
9916
+ errorMessageKey: "sheets-ui.permission.dialog.setRowColStyleErr"
9909
9917
  }
9910
9918
  };
9911
9919
  const RepeatLastActionCommand = {
@@ -9982,7 +9990,7 @@ function generateArrowSelectionShortCutItem() {
9982
9990
  const StartEditWithF2Shortcut = {
9983
9991
  id: SetCellEditVisibleWithF2Operation.id,
9984
9992
  binding: _univerjs_ui.KeyCode.F2,
9985
- description: "shortcut.sheet.start-editing",
9993
+ description: "sheets-ui.shortcut.sheet.start-editing",
9986
9994
  group: "4_sheet-edit",
9987
9995
  preconditions: whenSheetEditorFocused,
9988
9996
  staticParameters: {
@@ -9994,14 +10002,14 @@ const StartEditWithF2Shortcut = {
9994
10002
  const RepeatLastActionShortcut = {
9995
10003
  id: RepeatLastActionCommand.id,
9996
10004
  binding: _univerjs_ui.KeyCode.F4,
9997
- description: "shortcut.sheet.repeat-last-action",
10005
+ description: "sheets-ui.shortcut.sheet.repeat-last-action",
9998
10006
  group: "4_sheet-edit",
9999
10007
  preconditions: whenSheetEditorFocused
10000
10008
  };
10001
10009
  const EditorCursorEnterShortcut = {
10002
10010
  id: SetCellEditVisibleOperation.id,
10003
10011
  binding: _univerjs_ui.KeyCode.ENTER,
10004
- description: "shortcut.sheet.toggle-editing",
10012
+ description: "sheets-ui.shortcut.sheet.toggle-editing",
10005
10013
  group: "4_sheet-edit",
10006
10014
  preconditions: (contextService) => whenEditorDidNotInputFormulaActivated(contextService),
10007
10015
  staticParameters: {
@@ -10023,7 +10031,7 @@ const EditorCursorTabShortcut = {
10023
10031
  const EditorCursorEscShortcut = {
10024
10032
  id: SetCellEditVisibleOperation.id,
10025
10033
  binding: _univerjs_ui.KeyCode.ESC,
10026
- description: "shortcut.sheet.abort-editing",
10034
+ description: "sheets-ui.shortcut.sheet.abort-editing",
10027
10035
  group: "4_sheet-edit",
10028
10036
  preconditions: (contextService) => whenEditorDidNotInputFormulaActivated(contextService),
10029
10037
  staticParameters: {
@@ -10045,7 +10053,7 @@ const EditorCursorCtrlEnterShortcut = {
10045
10053
  };
10046
10054
  const EditorBreakLineShortcut = {
10047
10055
  id: _univerjs_docs_ui.BreakLineCommand.id,
10048
- description: "shortcut.sheet.break-line",
10056
+ description: "sheets-ui.shortcut.sheet.break-line",
10049
10057
  group: "4_sheet-edit",
10050
10058
  preconditions: (contextService) => whenSheetEditorActivated(contextService),
10051
10059
  binding: _univerjs_ui.KeyCode.ENTER | _univerjs_ui.MetaKeys.ALT
@@ -10067,7 +10075,7 @@ const ShiftEditorDeleteLeftShortcut = {
10067
10075
  };
10068
10076
  const EditorDeleteLeftShortcutInActive = {
10069
10077
  id: SetCellEditVisibleOperation.id,
10070
- description: "shortcut.sheet.delete-and-start-editing",
10078
+ description: "sheets-ui.shortcut.sheet.delete-and-start-editing",
10071
10079
  group: "4_sheet-edit",
10072
10080
  preconditions: (contextService) => whenSheetEditorFocused(contextService) && !whenFormulaEditorFocused(contextService),
10073
10081
  binding: _univerjs_ui.KeyCode.BACKSPACE,
@@ -10429,7 +10437,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
10429
10437
  _initialCursorSync(d) {
10430
10438
  d.add(this._cellEditorManagerService.focus$.pipe((0, rxjs.filter)((f) => !!f)).subscribe(() => {
10431
10439
  var _this$_renderManagerS2;
10432
- const currentDoc = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_DOC);
10440
+ const currentDoc = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_DOC);
10433
10441
  if (!currentDoc) return;
10434
10442
  const docSelectionRenderManager = (_this$_renderManagerS2 = this._renderManagerService.getRenderById(currentDoc === null || currentDoc === void 0 ? void 0 : currentDoc.getUnitId())) === null || _this$_renderManagerS2 === void 0 ? void 0 : _this$_renderManagerS2.with(_univerjs_docs_ui.DocSelectionRenderService);
10435
10443
  if (!docSelectionRenderManager) return;
@@ -11524,7 +11532,7 @@ let SheetClipboardController = class SheetClipboardController extends _univerjs_
11524
11532
  if (maxConfig && endRow * endColumn > maxConfig) {
11525
11533
  self._messageService.show({
11526
11534
  type: _univerjs_design.MessageType.Error,
11527
- content: self._localService.t("clipboard.paste.exceedMaxCells")
11535
+ content: self._localService.t("sheets-ui.clipboard.paste.exceedMaxCells")
11528
11536
  });
11529
11537
  return false;
11530
11538
  }
@@ -11795,7 +11803,7 @@ let SheetClipboardController = class SheetClipboardController extends _univerjs_
11795
11803
  id: PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_BESIDES_BORDER,
11796
11804
  specialPasteInfo: { label: "specialPaste.besidesBorder" },
11797
11805
  onPasteCells: (pasteFrom, pasteTo, matrix, payload) => {
11798
- self._instanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
11806
+ self._instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
11799
11807
  const redoMutationsInfo = [];
11800
11808
  const undoMutationsInfo = [];
11801
11809
  const { range, unitId, subUnitId } = pasteTo;
@@ -11914,7 +11922,7 @@ let DragManagerService = class DragManagerService extends _univerjs_core.Disposa
11914
11922
  }));
11915
11923
  }
11916
11924
  _calcActiveCell(offsetX, offsetY) {
11917
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
11925
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
11918
11926
  if (!workbook) return null;
11919
11927
  const worksheet = workbook.getActiveSheet();
11920
11928
  if (!worksheet) return;
@@ -12924,7 +12932,7 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
12924
12932
  _haveNotPermissionHandle(errorMsg) {
12925
12933
  const dialogProps = {
12926
12934
  id: UNIVER_SHEET_PERMISSION_ALERT_DIALOG_ID,
12927
- title: { title: "permission.dialog.alert" },
12935
+ title: { title: "sheets-ui.permission.dialog.alert" },
12928
12936
  children: {
12929
12937
  label: UNIVER_SHEET_PERMISSION_ALERT_DIALOG,
12930
12938
  errorMsg
@@ -12958,7 +12966,7 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
12958
12966
  worksheetTypes: [_univerjs_sheets.WorksheetSetCellValuePermission, _univerjs_sheets.WorksheetEditPermission],
12959
12967
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
12960
12968
  });
12961
- errorMsg = this._localeService.t("permission.dialog.editErr");
12969
+ errorMsg = this._localeService.t("sheets-ui.permission.dialog.editErr");
12962
12970
  break;
12963
12971
  case SetCellEditVisibleOperation.id:
12964
12972
  params = commandInfo.params;
@@ -12968,7 +12976,7 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
12968
12976
  worksheetTypes: [_univerjs_sheets.WorksheetSetCellValuePermission, _univerjs_sheets.WorksheetEditPermission],
12969
12977
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
12970
12978
  });
12971
- errorMsg = this._localeService.t("permission.dialog.editErr");
12979
+ errorMsg = this._localeService.t("sheets-ui.permission.dialog.editErr");
12972
12980
  break;
12973
12981
  case SheetPasteColWidthCommand.id:
12974
12982
  permission = this._sheetPermissionCheckController.permissionCheckWithoutRange({
@@ -12976,13 +12984,13 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
12976
12984
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetColumnStylePermission],
12977
12985
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
12978
12986
  });
12979
- errorMsg = this._localeService.t("permission.dialog.pasteErr");
12987
+ errorMsg = this._localeService.t("sheets-ui.permission.dialog.pasteErr");
12980
12988
  break;
12981
12989
  case SheetPasteShortKeyCommand.id:
12982
12990
  case SheetPasteCommand.id:
12983
12991
  params = commandInfo.params;
12984
12992
  permission = this._permissionCheckByPaste(params);
12985
- errorMsg = this._localeService.t("permission.dialog.pasteErr");
12993
+ errorMsg = this._localeService.t("sheets-ui.permission.dialog.pasteErr");
12986
12994
  break;
12987
12995
  case ApplyFormatPainterCommand.id:
12988
12996
  permission = this._sheetPermissionCheckController.permissionCheckWithRanges({
@@ -12994,7 +13002,7 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
12994
13002
  ],
12995
13003
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
12996
13004
  });
12997
- errorMsg = this._localeService.t("permission.dialog.commonErr");
13005
+ errorMsg = this._localeService.t("sheets-ui.permission.dialog.commonErr");
12998
13006
  break;
12999
13007
  case SheetCopyCommand.id:
13000
13008
  var _this$_permissionServ;
@@ -13003,9 +13011,9 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
13003
13011
  worksheetTypes: [_univerjs_sheets.WorksheetCopyPermission],
13004
13012
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionViewPoint]
13005
13013
  });
13006
- errorMsg = this._localeService.t("permission.dialog.copyErr");
13014
+ errorMsg = this._localeService.t("sheets-ui.permission.dialog.copyErr");
13007
13015
  target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService);
13008
- if (!permission && target && !((_this$_permissionServ = this._permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookCopyPermission(target.unitId).id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value)) errorMsg = this._localeService.t("permission.dialog.workbookCopyErr");
13016
+ if (!permission && target && !((_this$_permissionServ = this._permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookCopyPermission(target.unitId).id)) === null || _this$_permissionServ === void 0 ? void 0 : _this$_permissionServ.value)) errorMsg = this._localeService.t("sheets-ui.permission.dialog.workbookCopyErr");
13009
13017
  break;
13010
13018
  case SheetCutCommand.id:
13011
13019
  var _this$_permissionServ2;
@@ -13014,9 +13022,9 @@ let SheetPermissionCheckUIController = class SheetPermissionCheckUIController ex
13014
13022
  worksheetTypes: [_univerjs_sheets.WorksheetCopyPermission, _univerjs_sheets.WorksheetEditPermission],
13015
13023
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionViewPoint, _univerjs_sheets.RangeProtectionPermissionEditPoint]
13016
13024
  });
13017
- errorMsg = this._localeService.t("permission.dialog.copyErr");
13025
+ errorMsg = this._localeService.t("sheets-ui.permission.dialog.copyErr");
13018
13026
  target = (0, _univerjs_sheets.getSheetCommandTarget)(this._univerInstanceService);
13019
- if (!permission && target && !((_this$_permissionServ2 = this._permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookCopyPermission(target.unitId).id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value)) errorMsg = this._localeService.t("permission.dialog.workbookCopyErr");
13027
+ if (!permission && target && !((_this$_permissionServ2 = this._permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookCopyPermission(target.unitId).id)) === null || _this$_permissionServ2 === void 0 ? void 0 : _this$_permissionServ2.value)) errorMsg = this._localeService.t("sheets-ui.permission.dialog.workbookCopyErr");
13020
13028
  break;
13021
13029
  default: break;
13022
13030
  }
@@ -14517,7 +14525,7 @@ let HeaderResizeRenderController = class HeaderResizeRenderController extends _u
14517
14525
  var _this$_sheetSkeletonM;
14518
14526
  const skeleton = (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton;
14519
14527
  if (skeleton == null || this._rowResizeRect == null || this._columnResizeRect == null) return;
14520
- const { rowHeaderWidth, columnHeaderHeight } = skeleton;
14528
+ const { rowBaseWidth, rowGutterWidth, columnBaseHeight, columnGutterHeight } = getHeaderBaseLayout$1(skeleton);
14521
14529
  const { startX, startY, endX, endY, row, column } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton);
14522
14530
  const isLastRow = row === skeleton.worksheet.getRowCount() - 1;
14523
14531
  const isLastColumn = column === skeleton.worksheet.getColumnCount() - 1;
@@ -14537,9 +14545,9 @@ let HeaderResizeRenderController = class HeaderResizeRenderController extends _u
14537
14545
  }
14538
14546
  if (this._currentRow === -1) return;
14539
14547
  if (!this.interceptor.fetchThroughInterceptors(HEADER_RESIZE_PERMISSION_CHECK)(null, { row: this._currentRow })) return false;
14540
- const rowSize = Math.min(44, rowHeaderWidth / 3);
14548
+ const rowSize = Math.min(44, rowBaseWidth / 3);
14541
14549
  this._rowResizeRect.transformByState({
14542
- left: rowHeaderWidth / 2 - rowSize / 2,
14550
+ left: rowGutterWidth + rowBaseWidth / 2 - rowSize / 2,
14543
14551
  top
14544
14552
  });
14545
14553
  this._rowResizeRect.setShapeProps({ size: rowSize });
@@ -14557,10 +14565,10 @@ let HeaderResizeRenderController = class HeaderResizeRenderController extends _u
14557
14565
  }
14558
14566
  if (this._currentColumn === -1) return;
14559
14567
  if (!this.interceptor.fetchThroughInterceptors(HEADER_RESIZE_PERMISSION_CHECK)(null, { col: this._currentColumn })) return false;
14560
- const columnSize = columnHeaderHeight * .7;
14568
+ const columnSize = columnBaseHeight * .7;
14561
14569
  this._columnResizeRect.transformByState({
14562
14570
  left,
14563
- top: columnHeaderHeight / 2 - columnSize / 2
14571
+ top: columnGutterHeight + columnBaseHeight / 2 - columnSize / 2
14564
14572
  });
14565
14573
  this._columnResizeRect.setShapeProps({ size: columnSize });
14566
14574
  this._columnResizeRect.show();
@@ -14605,9 +14613,9 @@ let HeaderResizeRenderController = class HeaderResizeRenderController extends _u
14605
14613
  let isStartMove = false;
14606
14614
  let moveChangeX = 0;
14607
14615
  let moveChangeY = 0;
14608
- const { columnTotalWidth, rowHeaderWidth, rowTotalHeight, columnHeaderHeight } = skeleton;
14609
- const shapeWidth = canvasMaxWidth > columnTotalWidth + rowHeaderWidth ? canvasMaxWidth : columnTotalWidth + rowHeaderWidth;
14610
- const shapeHeight = canvasMaxHeight > rowTotalHeight + columnHeaderHeight ? canvasMaxHeight : rowTotalHeight + columnHeaderHeight;
14616
+ const { columnTotalWidth, rowHeaderWidthAndMarginLeft, rowTotalHeight, columnHeaderHeightAndMarginTop } = skeleton;
14617
+ const shapeWidth = canvasMaxWidth > columnTotalWidth + rowHeaderWidthAndMarginLeft ? canvasMaxWidth : columnTotalWidth + rowHeaderWidthAndMarginLeft;
14618
+ const shapeHeight = canvasMaxHeight > rowTotalHeight + columnHeaderHeightAndMarginTop ? canvasMaxHeight : rowTotalHeight + columnHeaderHeightAndMarginTop;
14611
14619
  const HEADER_MENU_SHAPE_THUMB_SIZE_SCALE = 4 / Math.max(scaleX, scaleY);
14612
14620
  if (initialType === 0) this._resizeHelperShape = new _univerjs_engine_render.Rect(HEADER_RESIZE_CONTROLLER_SHAPE_HELPER, {
14613
14621
  width: shapeWidth,
@@ -14740,208 +14748,580 @@ HeaderResizeRenderController = __decorate([
14740
14748
  __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetsSelectionsService)),
14741
14749
  __decorateParam(3, _univerjs_core.ICommandService)
14742
14750
  ], HeaderResizeRenderController);
14751
+ function getHeaderBaseLayout$1(skeleton) {
14752
+ var _skeleton$worksheet$g, _skeleton$worksheet, _config$rowHeader, _config$columnHeader;
14753
+ const config = (_skeleton$worksheet$g = (_skeleton$worksheet = skeleton.worksheet).getConfig) === null || _skeleton$worksheet$g === void 0 ? void 0 : _skeleton$worksheet$g.call(_skeleton$worksheet);
14754
+ const configuredRowWidth = config === null || config === void 0 || (_config$rowHeader = config.rowHeader) === null || _config$rowHeader === void 0 ? void 0 : _config$rowHeader.width;
14755
+ const configuredColumnHeight = config === null || config === void 0 || (_config$columnHeader = config.columnHeader) === null || _config$columnHeader === void 0 ? void 0 : _config$columnHeader.height;
14756
+ const rowBaseWidth = typeof configuredRowWidth === "number" && configuredRowWidth > 0 ? Math.min(configuredRowWidth, skeleton.rowHeaderWidth) : skeleton.rowHeaderWidth;
14757
+ const columnBaseHeight = typeof configuredColumnHeight === "number" && configuredColumnHeight > 0 ? Math.min(configuredColumnHeight, skeleton.columnHeaderHeight) : skeleton.columnHeaderHeight;
14758
+ return {
14759
+ rowBaseWidth,
14760
+ rowGutterWidth: Math.max(0, skeleton.rowHeaderWidthAndMarginLeft - rowBaseWidth),
14761
+ columnBaseHeight,
14762
+ columnGutterHeight: Math.max(0, skeleton.columnHeaderHeightAndMarginTop - columnBaseHeight)
14763
+ };
14764
+ }
14743
14765
 
14744
14766
  //#endregion
14745
- //#region src/controllers/render-controllers/sheet.render-controller.ts
14746
- const FRAME_STACK_THRESHOLD = 60;
14747
- let SheetRenderController = class SheetRenderController extends _univerjs_core.RxDisposable {
14748
- constructor(_context, _configService, _sheetSkeletonManagerService, _sheetRenderService, _commandService, _telemetryService) {
14749
- super();
14750
- this._context = _context;
14751
- this._configService = _configService;
14752
- this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
14753
- this._sheetRenderService = _sheetRenderService;
14754
- this._commandService = _commandService;
14755
- this._telemetryService = _telemetryService;
14756
- _defineProperty(this, "_renderMetric$", new rxjs.Subject());
14757
- _defineProperty(this, "renderMetric$", this._renderMetric$.asObservable());
14758
- _defineProperty(this, "_renderFrameTimeMetric", null);
14759
- _defineProperty(this, "_renderFrameTags", {});
14760
- _defineProperty(this, "_afterRenderMetric$", new rxjs.Subject());
14761
- this._addNewRender();
14762
- this._initRenderMetricSubscriber();
14767
+ //#region src/services/header-unhide-range.service.ts
14768
+ let HeaderUnhideRangeAxis = /* @__PURE__ */ function(HeaderUnhideRangeAxis) {
14769
+ HeaderUnhideRangeAxis["ROW"] = "row";
14770
+ HeaderUnhideRangeAxis["COLUMN"] = "column";
14771
+ return HeaderUnhideRangeAxis;
14772
+ }({});
14773
+ var HeaderUnhideRangeService = class {
14774
+ constructor() {
14775
+ _defineProperty(this, "_visibleHandlers", /* @__PURE__ */ new Set());
14763
14776
  }
14764
- _addNewRender() {
14765
- const { scene, engine, unit: workbook } = this._context;
14766
- this._addComponent(workbook);
14767
- this._initRerenderScheduler();
14768
- this._initCommandListener();
14769
- const worksheet = this._context.unit.getActiveSheet();
14770
- if (!worksheet) throw new Error("No active sheet found");
14771
- const sheetId = worksheet.getSheetId();
14772
- this._sheetSkeletonManagerService.setCurrent({ sheetId });
14773
- const frameFn = () => scene.render();
14774
- this.disposeWithMe(this._context.activated$.subscribe((activated) => {
14775
- if (activated) engine.runRenderLoop(frameFn);
14776
- else engine.stopRenderLoop(frameFn);
14777
- }));
14777
+ registerRangeVisibleHandler(handler) {
14778
+ this._visibleHandlers.add(handler);
14779
+ const dispose = () => this._visibleHandlers.delete(handler);
14780
+ return {
14781
+ dispose,
14782
+ unsubscribe: dispose
14783
+ };
14778
14784
  }
14779
- _initRenderMetricSubscriber() {
14780
- const { engine } = this._context;
14781
- this.disposeWithMe(engine.beginFrame$.subscribe(() => {
14782
- this._renderFrameTimeMetric = null;
14783
- this._renderFrameTags = {};
14784
- }));
14785
- this.disposeWithMe(engine.endFrame$.subscribe(() => {
14786
- if (this._renderFrameTimeMetric && Object.keys(this._renderFrameTimeMetric).filter((key) => key.startsWith(_univerjs_engine_render.SHEET_EXTENSION_PREFIX)).length > 0) this._afterRenderMetric$.next({
14787
- frameTimeMetric: this._renderFrameTimeMetric,
14788
- tags: this._renderFrameTags
14789
- });
14790
- }));
14791
- this.disposeWithMe(engine.renderFrameTimeMetric$.subscribe(([key, value]) => {
14792
- if (!this._renderFrameTimeMetric) this._renderFrameTimeMetric = {};
14793
- if (!this._renderFrameTimeMetric[key]) this._renderFrameTimeMetric[key] = [];
14794
- this._renderFrameTimeMetric[key].push(Math.round(value * 100) / 100);
14795
- }));
14796
- this.disposeWithMe(engine.renderFrameTags$.subscribe(([key, value]) => {
14797
- this._renderFrameTags[key] = value;
14798
- }));
14799
- const frameInfoList = [];
14800
- this.disposeWithMe(this._afterRenderMetric$.pipe((0, rxjs.withLatestFrom)(engine.endFrame$)).subscribe(([sceneRenderDetail, basicFrameTimeInfo]) => {
14801
- frameInfoList.push({
14802
- FPS: basicFrameTimeInfo.FPS,
14803
- elapsedTime: basicFrameTimeInfo.elapsedTime,
14804
- frameTime: Math.round(basicFrameTimeInfo.frameTime * 100) / 100,
14805
- ...sceneRenderDetail.frameTimeMetric,
14806
- ...sceneRenderDetail.tags
14807
- });
14808
- if (frameInfoList.length > FRAME_STACK_THRESHOLD) {
14809
- this._captureRenderMetric(frameInfoList);
14810
- frameInfoList.length = 0;
14811
- }
14812
- }));
14785
+ shouldRenderRange(visible, payload) {
14786
+ let nextVisible = visible;
14787
+ for (const handler of this._visibleHandlers) nextVisible = handler(nextVisible, payload);
14788
+ return nextVisible;
14813
14789
  }
14814
- /**
14815
- * Send render metric to telemetry service
14816
- * @param frameInfoList
14817
- */
14818
- _captureRenderMetric(frameInfoList) {
14819
- var _this$_telemetryServi;
14820
- const filteredFrameInfo = frameInfoList;
14821
- if (filteredFrameInfo.length === 0) return;
14822
- const sumValueForNumListFields = (data) => {
14823
- let totalSum = 0;
14824
- const sums = Object.entries(data).filter(([_, value]) => Array.isArray(value)).map(([key]) => key).reduce((acc, key) => {
14825
- acc[key] = data[key].reduce((sum, num) => sum + num, 0);
14826
- return acc;
14827
- }, {});
14828
- Object.keys(data).filter((key) => key.startsWith(_univerjs_engine_render.SHEET_EXTENSION_PREFIX)).forEach((key) => {
14829
- totalSum += sums[key];
14830
- });
14831
- return {
14832
- ...sums,
14833
- extensionTotal: totalSum
14834
- };
14835
- };
14836
- const frameTimeListAfterSum = frameInfoList.map((info) => {
14837
- return {
14838
- ...info,
14839
- ...sumValueForNumListFields(info)
14840
- };
14841
- });
14842
- const getSummaryStats = (list) => {
14843
- return Object.entries(list[0]).filter(([key, _]) => !["elapsedTime"].includes(key)).filter(([_, value]) => typeof value === "number").map(([key]) => key).reduce((acc, key) => {
14844
- const values = list.map((obj) => obj[key]);
14845
- const max = Math.max(...values);
14846
- const min = Math.min(...values);
14847
- const avg = values.reduce((sum, val) => sum + val, 0) / values.length;
14848
- acc[key] = {
14849
- max: Math.round(max * 100) / 100,
14850
- min: Math.round(min * 100) / 100,
14851
- avg: Math.round(avg * 100) / 100
14852
- };
14853
- return acc;
14854
- }, {});
14855
- };
14856
- const summaryFrameStats = getSummaryStats(frameTimeListAfterSum);
14857
- const elapsedTimeToStart = filteredFrameInfo[filteredFrameInfo.length - 1].elapsedTime;
14858
- const telemetryData = {
14859
- sheetId: this._context.unit.getActiveSheet().getSheetId(),
14860
- unitId: this._context.unit.getUnitId(),
14861
- elapsedTimeToStart,
14862
- ...summaryFrameStats
14863
- };
14864
- this._renderMetric$.next(telemetryData);
14865
- (_this$_telemetryServi = this._telemetryService) === null || _this$_telemetryServi === void 0 || _this$_telemetryServi.capture("sheet_render_cost", telemetryData);
14790
+ };
14791
+
14792
+ //#endregion
14793
+ //#region src/menu/header-menu-shape.ts
14794
+ const HEADER_MENU_SHAPE_CIRCLE_FILL = "rgba(0, 0, 0, 0.15)";
14795
+ const HEADER_MENU_SHAPE_TRIANGLE_FILL = "rgb(0, 0, 0)";
14796
+ const HEADER_MENU_BACKGROUND_COLOR = "rgb(255, 255, 255, 1)";
14797
+ var HeaderMenuShape = class extends _univerjs_engine_render.Shape {
14798
+ constructor(key, props) {
14799
+ super(key, props);
14800
+ _defineProperty(this, "_size", 12);
14801
+ _defineProperty(this, "_iconRatio", .4);
14802
+ _defineProperty(this, "_mode", 0);
14803
+ this.setShapeProps(props);
14866
14804
  }
14867
- _addComponent(workbook) {
14868
- const { scene, components } = this._context;
14869
- const worksheet = workbook.getActiveSheet();
14870
- const spreadsheet = new _univerjs_engine_render.Spreadsheet("__SpreadsheetRender__");
14871
- this._addViewport(worksheet);
14872
- const spreadsheetRowHeader = new _univerjs_engine_render.SpreadsheetRowHeader("__SpreadsheetRowHeader__");
14873
- const spreadsheetColumnHeader = new _univerjs_engine_render.SpreadsheetColumnHeader("__SpreadsheetColumnHeader__");
14874
- const SpreadsheetLeftTopPlaceholder = new _univerjs_engine_render.Rect("__SpreadsheetLeftTopPlaceholder__", {
14875
- zIndex: 2,
14876
- left: -1,
14877
- top: -1,
14878
- fill: "rgb(248, 249, 250)",
14879
- stroke: "rgb(217, 217, 217)",
14880
- strokeWidth: 1
14805
+ setShapeProps(props) {
14806
+ if (props === null || props === void 0 ? void 0 : props.size) this._size = props.size;
14807
+ if (props === null || props === void 0 ? void 0 : props.mode) this._mode = props.mode;
14808
+ this.transformByState({
14809
+ width: this._size,
14810
+ height: this._size
14881
14811
  });
14882
- this._context.mainComponent = spreadsheet;
14883
- components.set("__SpreadsheetRender__", spreadsheet);
14884
- components.set("__SpreadsheetRowHeader__", spreadsheetRowHeader);
14885
- components.set("__SpreadsheetColumnHeader__", spreadsheetColumnHeader);
14886
- components.set("__SpreadsheetLeftTopPlaceholder__", SpreadsheetLeftTopPlaceholder);
14887
- scene.addObjects([spreadsheet], 0);
14888
- scene.addObjects([
14889
- spreadsheetRowHeader,
14890
- spreadsheetColumnHeader,
14891
- SpreadsheetLeftTopPlaceholder
14892
- ], 10);
14893
- scene.enableLayerCache(0, 10);
14894
14812
  }
14895
- _initViewports(scene, rowHeader, columnHeader) {
14896
- const rowHeaderWidth = rowHeader.hidden ? 0 : rowHeader.width;
14897
- const columnHeaderHeight = columnHeader.hidden ? 0 : columnHeader.height;
14898
- const bufferEdgeX = 100;
14899
- const bufferEdgeY = 100;
14900
- const viewMain = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN, scene, {
14901
- left: rowHeaderWidth,
14902
- top: columnHeaderHeight,
14903
- bottom: 0,
14904
- right: 0,
14905
- isWheelPreventDefaultX: true,
14906
- allowCache: true,
14907
- bufferEdgeX,
14908
- bufferEdgeY
14909
- });
14910
- const viewMainLeftTop = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP, scene, {
14911
- isWheelPreventDefaultX: true,
14912
- active: false,
14913
- allowCache: true,
14914
- bufferEdgeX: 0,
14915
- bufferEdgeY: 0
14916
- });
14917
- const viewMainLeft = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT, scene, {
14918
- isWheelPreventDefaultX: true,
14919
- active: false,
14920
- allowCache: true,
14921
- bufferEdgeX: 0,
14922
- bufferEdgeY
14923
- });
14924
- const viewMainTop = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP, scene, {
14925
- isWheelPreventDefaultX: true,
14926
- active: false,
14927
- allowCache: true,
14928
- bufferEdgeX,
14929
- bufferEdgeY: 0
14930
- });
14931
- const viewRowTop = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP, scene, {
14932
- active: false,
14933
- isWheelPreventDefaultX: true
14813
+ _draw(ctx) {
14814
+ if (this._mode === 1) _univerjs_engine_render.Rect.drawWith(ctx, {
14815
+ width: this._size,
14816
+ height: this._size,
14817
+ radius: this._size,
14818
+ fill: HEADER_MENU_SHAPE_CIRCLE_FILL
14934
14819
  });
14935
- const viewRowBottom = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM, scene, {
14936
- left: 0,
14937
- top: columnHeaderHeight,
14938
- bottom: 0,
14939
- width: rowHeaderWidth + 1,
14940
- isWheelPreventDefaultX: true
14820
+ const iconSize = this._size * .5 * this._iconRatio;
14821
+ const sixtyDegree = Math.PI / 180 * 60;
14822
+ const left = iconSize * Math.sin(sixtyDegree);
14823
+ const top = iconSize * Math.cos(sixtyDegree);
14824
+ _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
14825
+ pointsGroup: [[
14826
+ {
14827
+ x: -left + this._size / 2,
14828
+ y: -top + this._size / 2
14829
+ },
14830
+ {
14831
+ x: left + this._size / 2,
14832
+ y: -top + this._size / 2
14833
+ },
14834
+ {
14835
+ x: this._size / 2,
14836
+ y: iconSize + this._size / 2
14837
+ }
14838
+ ]],
14839
+ fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
14941
14840
  });
14942
- const viewColumnLeft = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT, scene, {
14943
- active: false,
14944
- isWheelPreventDefaultX: true
14841
+ }
14842
+ };
14843
+
14844
+ //#endregion
14845
+ //#region src/views/header-unhide-shape.ts
14846
+ const UNHIDE_ICON_SIZE = 12;
14847
+ const UNHIDE_ARROW_RATIO = .4;
14848
+ var HeaderUnhideShape = class extends _univerjs_engine_render.Shape {
14849
+ constructor(key, props, onClick) {
14850
+ super(key, props);
14851
+ _defineProperty(this, "_size", 12);
14852
+ _defineProperty(this, "_iconRatio", UNHIDE_ARROW_RATIO);
14853
+ _defineProperty(this, "_hovered", true);
14854
+ _defineProperty(this, "_hasPrevious", true);
14855
+ _defineProperty(this, "_hasNext", true);
14856
+ _defineProperty(this, "_unhideType", void 0);
14857
+ if (props) this.setShapeProps(props);
14858
+ this.onPointerEnter$.subscribeEvent(() => this.setShapeProps({ hovered: true }));
14859
+ this.onPointerLeave$.subscribeEvent(() => this.setShapeProps({ hovered: false }));
14860
+ this.onPointerDown$.subscribeEvent(() => onClick === null || onClick === void 0 ? void 0 : onClick());
14861
+ }
14862
+ setShapeProps(props) {
14863
+ if (props.type !== void 0) this._unhideType = props.type;
14864
+ if (props.hovered !== void 0) this._hovered = props.hovered;
14865
+ if (props.hasPrevious !== void 0) this._hasPrevious = props.hasPrevious;
14866
+ if (props.hasNext !== void 0) this._hasNext = props.hasNext;
14867
+ this.transformByState({
14868
+ width: this._size * (this._unhideType === 1 ? 2 : 1),
14869
+ height: this._size * (this._unhideType === 0 ? 2 : 1)
14870
+ });
14871
+ }
14872
+ _draw(ctx) {
14873
+ if (this._unhideType === 0) this._drawOnRow(ctx);
14874
+ else this._drawOnCol(ctx);
14875
+ }
14876
+ _drawOnRow(ctx) {
14877
+ if (this._hovered) if (!this._hasNext || !this._hasPrevious) _univerjs_engine_render.Rect.drawWith(ctx, {
14878
+ width: this._size,
14879
+ height: this._size,
14880
+ stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
14881
+ fill: HEADER_MENU_BACKGROUND_COLOR
14882
+ });
14883
+ else _univerjs_engine_render.Rect.drawWith(ctx, {
14884
+ width: this._size,
14885
+ height: 2 * this._size,
14886
+ stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
14887
+ fill: HEADER_MENU_BACKGROUND_COLOR
14888
+ });
14889
+ const iconSize = this._size * .5 * this._iconRatio;
14890
+ const sixtyDegree = Math.PI / 3;
14891
+ const top = iconSize * Math.cos(sixtyDegree);
14892
+ const left = iconSize * Math.sin(sixtyDegree);
14893
+ if (this._hasPrevious) _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
14894
+ pointsGroup: [[
14895
+ {
14896
+ x: this._size / 2,
14897
+ y: this._size / 2 - left
14898
+ },
14899
+ {
14900
+ x: this._size / 2 - left,
14901
+ y: this._size / 2 + top
14902
+ },
14903
+ {
14904
+ x: this._size / 2 + left,
14905
+ y: this._size / 2 + top
14906
+ }
14907
+ ]],
14908
+ fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
14909
+ });
14910
+ if (this._hasNext) {
14911
+ const offset = this._hasPrevious ? 3 : 1;
14912
+ _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
14913
+ pointsGroup: [[
14914
+ {
14915
+ x: this._size / 2,
14916
+ y: this._size * offset / 2 + left
14917
+ },
14918
+ {
14919
+ x: this._size / 2 - left,
14920
+ y: this._size * offset / 2 - top
14921
+ },
14922
+ {
14923
+ x: this._size / 2 + left,
14924
+ y: this._size * offset / 2 - top
14925
+ }
14926
+ ]],
14927
+ fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
14928
+ });
14929
+ }
14930
+ }
14931
+ /**
14932
+ *
14933
+ * @param ctx
14934
+ */
14935
+ _drawOnCol(ctx) {
14936
+ if (this._hovered) if (!this._hasNext || !this._hasPrevious) _univerjs_engine_render.Rect.drawWith(ctx, {
14937
+ width: this._size,
14938
+ height: this._size,
14939
+ stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
14940
+ fill: HEADER_MENU_BACKGROUND_COLOR
14941
+ });
14942
+ else _univerjs_engine_render.Rect.drawWith(ctx, {
14943
+ width: 2 * this._size,
14944
+ height: this._size,
14945
+ stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
14946
+ fill: HEADER_MENU_BACKGROUND_COLOR
14947
+ });
14948
+ const iconSize = this._size * .5 * this._iconRatio;
14949
+ const sixtyDegree = Math.PI / 3;
14950
+ const top = iconSize * Math.cos(sixtyDegree);
14951
+ const left = iconSize * Math.sin(sixtyDegree);
14952
+ if (this._hasPrevious) _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
14953
+ pointsGroup: [[
14954
+ {
14955
+ x: -top + this._size / 2,
14956
+ y: this._size / 2
14957
+ },
14958
+ {
14959
+ x: this._size / 2 + left,
14960
+ y: this._size / 2 - left
14961
+ },
14962
+ {
14963
+ x: this._size / 2 + left,
14964
+ y: this._size / 2 + left
14965
+ }
14966
+ ]],
14967
+ fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
14968
+ });
14969
+ if (this._hasNext) {
14970
+ const offset = this._hasPrevious ? 3 : 1;
14971
+ _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
14972
+ pointsGroup: [[
14973
+ {
14974
+ x: top + this._size * offset / 2,
14975
+ y: this._size / 2
14976
+ },
14977
+ {
14978
+ x: -left + this._size * offset / 2,
14979
+ y: this._size / 2 - left
14980
+ },
14981
+ {
14982
+ x: -left + this._size * offset / 2,
14983
+ y: this._size / 2 + left
14984
+ }
14985
+ ]],
14986
+ fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
14987
+ });
14988
+ }
14989
+ }
14990
+ };
14991
+
14992
+ //#endregion
14993
+ //#region src/controllers/render-controllers/header-unhide.render-controller.ts
14994
+ const HEADER_UNHIDE_CONTROLLER_SHAPE = "__SpreadsheetHeaderUnhideSHAPEControllerShape__";
14995
+ const HEADER_UNHIDE_RANGE_VISIBLE_CHECK = (0, _univerjs_core.createInterceptorKey)("headerUnhideRangeVisibleCheck");
14996
+ let HeaderUnhideRenderController = class HeaderUnhideRenderController extends _univerjs_core.RxDisposable {
14997
+ get _workbook() {
14998
+ return this._context.unit;
14999
+ }
15000
+ constructor(_context, _sheetSkeletonManagerService, _headerUnhideRangeService, _commandService) {
15001
+ super();
15002
+ this._context = _context;
15003
+ this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
15004
+ this._headerUnhideRangeService = _headerUnhideRangeService;
15005
+ this._commandService = _commandService;
15006
+ _defineProperty(this, "_shapes", {
15007
+ cols: [],
15008
+ rows: []
15009
+ });
15010
+ _defineProperty(this, "interceptor", new _univerjs_core.InterceptorManager({ HEADER_UNHIDE_RANGE_VISIBLE_CHECK }));
15011
+ this._init();
15012
+ }
15013
+ dispose() {
15014
+ super.dispose();
15015
+ this._clearShapes();
15016
+ }
15017
+ _init() {
15018
+ let activeSheetId = "";
15019
+ this._context.unit.activeSheet$.pipe((0, rxjs.takeUntil)(this.dispose$)).subscribe((worksheet) => {
15020
+ this._clearShapes();
15021
+ if (!worksheet) {
15022
+ activeSheetId = "";
15023
+ return;
15024
+ }
15025
+ activeSheetId = worksheet.getSheetId();
15026
+ this._update(this._workbook, worksheet);
15027
+ });
15028
+ this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((param) => {
15029
+ if (param) {
15030
+ const { unitId, sheetId } = param;
15031
+ if (unitId === this._workbook.getUnitId() && sheetId === activeSheetId) {
15032
+ const worksheet = this._workbook.getSheetBySheetId(sheetId);
15033
+ if (worksheet) this._update(this._workbook, worksheet);
15034
+ }
15035
+ }
15036
+ }));
15037
+ }
15038
+ _update(workbook, worksheet) {
15039
+ var _this$_sheetSkeletonM;
15040
+ const skeleton = (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getSkeletonParam(worksheet.getSheetId())) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton;
15041
+ if (!skeleton) return;
15042
+ const visibleCheck = this.interceptor.fetchThroughInterceptors(HEADER_UNHIDE_RANGE_VISIBLE_CHECK);
15043
+ const shouldRenderRange = (payload) => {
15044
+ var _visibleCheck;
15045
+ return this._headerUnhideRangeService.shouldRenderRange((_visibleCheck = visibleCheck(true, payload)) !== null && _visibleCheck !== void 0 ? _visibleCheck : true, payload);
15046
+ };
15047
+ const hiddenRowRanges = worksheet.getHiddenRows().filter((range) => shouldRenderRange({
15048
+ axis: "row",
15049
+ range,
15050
+ workbook,
15051
+ worksheet
15052
+ }));
15053
+ const hiddenColRanges = worksheet.getHiddenCols().filter((range) => shouldRenderRange({
15054
+ axis: "column",
15055
+ range,
15056
+ workbook,
15057
+ worksheet
15058
+ }));
15059
+ const { scene } = this._getSheetObject();
15060
+ const rowCount = worksheet.getRowCount();
15061
+ const rowShapes = hiddenRowRanges.map((range) => {
15062
+ const { startRow, endRow } = range;
15063
+ const position = getCoordByCell(startRow, 0, scene, skeleton);
15064
+ const hasPrevious = startRow !== 0;
15065
+ const hasNext = endRow !== rowCount - 1;
15066
+ return new HeaderUnhideShape(HEADER_UNHIDE_CONTROLLER_SHAPE, {
15067
+ type: 0,
15068
+ hovered: false,
15069
+ hasPrevious,
15070
+ hasNext,
15071
+ top: position.startY - (hasPrevious ? 12 : 0),
15072
+ left: position.startX - 12
15073
+ }, () => this._commandService.executeCommand(_univerjs_sheets.SetSpecificRowsVisibleCommand.id, {
15074
+ unitId: workbook.getUnitId(),
15075
+ subUnitId: worksheet.getSheetId(),
15076
+ ranges: [range]
15077
+ }));
15078
+ });
15079
+ const colCount = worksheet.getColumnCount();
15080
+ const colShapes = hiddenColRanges.map((range) => {
15081
+ const { startColumn, endColumn } = range;
15082
+ const position = getCoordByCell(0, startColumn, scene, skeleton);
15083
+ const hasPrevious = startColumn !== 0;
15084
+ const hasNext = endColumn !== colCount - 1;
15085
+ return new HeaderUnhideShape(HEADER_UNHIDE_CONTROLLER_SHAPE, {
15086
+ type: 1,
15087
+ hovered: false,
15088
+ hasPrevious,
15089
+ hasNext,
15090
+ top: Math.max(skeleton.columnHeaderHeight, skeleton.columnHeaderHeightAndMarginTop) - 12,
15091
+ left: position.startX - (hasPrevious ? 12 : 0)
15092
+ }, () => this._commandService.executeCommand(_univerjs_sheets.SetSpecificColsVisibleCommand.id, {
15093
+ unitId: workbook.getUnitId(),
15094
+ subUnitId: worksheet.getSheetId(),
15095
+ ranges: [range]
15096
+ }));
15097
+ });
15098
+ scene.addObjects(colShapes, 12);
15099
+ scene.addObjects(rowShapes, 12);
15100
+ this._clearShapes();
15101
+ this._shapes = {
15102
+ cols: colShapes,
15103
+ rows: rowShapes
15104
+ };
15105
+ }
15106
+ _clearShapes() {
15107
+ this._shapes.cols.forEach((shape) => shape.dispose());
15108
+ this._shapes.rows.forEach((shape) => shape.dispose());
15109
+ this._shapes = {
15110
+ cols: [],
15111
+ rows: []
15112
+ };
15113
+ }
15114
+ _getSheetObject() {
15115
+ return getSheetObject(this._workbook, this._context);
15116
+ }
15117
+ };
15118
+ HeaderUnhideRenderController = __decorate([
15119
+ __decorateParam(1, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
15120
+ __decorateParam(2, (0, _univerjs_core.Inject)(HeaderUnhideRangeService)),
15121
+ __decorateParam(3, _univerjs_core.ICommandService)
15122
+ ], HeaderUnhideRenderController);
15123
+
15124
+ //#endregion
15125
+ //#region src/controllers/render-controllers/sheet.render-controller.ts
15126
+ const FRAME_STACK_THRESHOLD = 60;
15127
+ let SheetRenderController = class SheetRenderController extends _univerjs_core.RxDisposable {
15128
+ constructor(_context, _configService, _sheetSkeletonManagerService, _sheetRenderService, _commandService, _telemetryService) {
15129
+ super();
15130
+ this._context = _context;
15131
+ this._configService = _configService;
15132
+ this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
15133
+ this._sheetRenderService = _sheetRenderService;
15134
+ this._commandService = _commandService;
15135
+ this._telemetryService = _telemetryService;
15136
+ _defineProperty(this, "_renderMetric$", new rxjs.Subject());
15137
+ _defineProperty(this, "renderMetric$", this._renderMetric$.asObservable());
15138
+ _defineProperty(this, "_renderFrameTimeMetric", null);
15139
+ _defineProperty(this, "_renderFrameTags", {});
15140
+ _defineProperty(this, "_afterRenderMetric$", new rxjs.Subject());
15141
+ this._addNewRender();
15142
+ this._initRenderMetricSubscriber();
15143
+ }
15144
+ _addNewRender() {
15145
+ const { scene, engine, unit: workbook } = this._context;
15146
+ this._addComponent(workbook);
15147
+ this._initRerenderScheduler();
15148
+ this._initCommandListener();
15149
+ const worksheet = this._context.unit.getActiveSheet();
15150
+ if (!worksheet) throw new Error("No active sheet found");
15151
+ const sheetId = worksheet.getSheetId();
15152
+ this._sheetSkeletonManagerService.setCurrent({ sheetId });
15153
+ const frameFn = () => scene.render();
15154
+ this.disposeWithMe(this._context.activated$.subscribe((activated) => {
15155
+ if (activated) engine.runRenderLoop(frameFn);
15156
+ else engine.stopRenderLoop(frameFn);
15157
+ }));
15158
+ }
15159
+ _initRenderMetricSubscriber() {
15160
+ const { engine } = this._context;
15161
+ this.disposeWithMe(engine.beginFrame$.subscribe(() => {
15162
+ this._renderFrameTimeMetric = null;
15163
+ this._renderFrameTags = {};
15164
+ }));
15165
+ this.disposeWithMe(engine.endFrame$.subscribe(() => {
15166
+ if (this._renderFrameTimeMetric && Object.keys(this._renderFrameTimeMetric).filter((key) => key.startsWith(_univerjs_engine_render.SHEET_EXTENSION_PREFIX)).length > 0) this._afterRenderMetric$.next({
15167
+ frameTimeMetric: this._renderFrameTimeMetric,
15168
+ tags: this._renderFrameTags
15169
+ });
15170
+ }));
15171
+ this.disposeWithMe(engine.renderFrameTimeMetric$.subscribe(([key, value]) => {
15172
+ if (!this._renderFrameTimeMetric) this._renderFrameTimeMetric = {};
15173
+ if (!this._renderFrameTimeMetric[key]) this._renderFrameTimeMetric[key] = [];
15174
+ this._renderFrameTimeMetric[key].push(Math.round(value * 100) / 100);
15175
+ }));
15176
+ this.disposeWithMe(engine.renderFrameTags$.subscribe(([key, value]) => {
15177
+ this._renderFrameTags[key] = value;
15178
+ }));
15179
+ const frameInfoList = [];
15180
+ this.disposeWithMe(this._afterRenderMetric$.pipe((0, rxjs.withLatestFrom)(engine.endFrame$)).subscribe(([sceneRenderDetail, basicFrameTimeInfo]) => {
15181
+ frameInfoList.push({
15182
+ FPS: basicFrameTimeInfo.FPS,
15183
+ elapsedTime: basicFrameTimeInfo.elapsedTime,
15184
+ frameTime: Math.round(basicFrameTimeInfo.frameTime * 100) / 100,
15185
+ ...sceneRenderDetail.frameTimeMetric,
15186
+ ...sceneRenderDetail.tags
15187
+ });
15188
+ if (frameInfoList.length > FRAME_STACK_THRESHOLD) {
15189
+ this._captureRenderMetric(frameInfoList);
15190
+ frameInfoList.length = 0;
15191
+ }
15192
+ }));
15193
+ }
15194
+ /**
15195
+ * Send render metric to telemetry service
15196
+ * @param frameInfoList
15197
+ */
15198
+ _captureRenderMetric(frameInfoList) {
15199
+ var _this$_telemetryServi;
15200
+ const filteredFrameInfo = frameInfoList;
15201
+ if (filteredFrameInfo.length === 0) return;
15202
+ const sumValueForNumListFields = (data) => {
15203
+ let totalSum = 0;
15204
+ const sums = Object.entries(data).filter(([_, value]) => Array.isArray(value)).map(([key]) => key).reduce((acc, key) => {
15205
+ acc[key] = data[key].reduce((sum, num) => sum + num, 0);
15206
+ return acc;
15207
+ }, {});
15208
+ Object.keys(data).filter((key) => key.startsWith(_univerjs_engine_render.SHEET_EXTENSION_PREFIX)).forEach((key) => {
15209
+ totalSum += sums[key];
15210
+ });
15211
+ return {
15212
+ ...sums,
15213
+ extensionTotal: totalSum
15214
+ };
15215
+ };
15216
+ const frameTimeListAfterSum = frameInfoList.map((info) => {
15217
+ return {
15218
+ ...info,
15219
+ ...sumValueForNumListFields(info)
15220
+ };
15221
+ });
15222
+ const getSummaryStats = (list) => {
15223
+ return Object.entries(list[0]).filter(([key, _]) => !["elapsedTime"].includes(key)).filter(([_, value]) => typeof value === "number").map(([key]) => key).reduce((acc, key) => {
15224
+ const values = list.map((obj) => obj[key]);
15225
+ const max = Math.max(...values);
15226
+ const min = Math.min(...values);
15227
+ const avg = values.reduce((sum, val) => sum + val, 0) / values.length;
15228
+ acc[key] = {
15229
+ max: Math.round(max * 100) / 100,
15230
+ min: Math.round(min * 100) / 100,
15231
+ avg: Math.round(avg * 100) / 100
15232
+ };
15233
+ return acc;
15234
+ }, {});
15235
+ };
15236
+ const summaryFrameStats = getSummaryStats(frameTimeListAfterSum);
15237
+ const elapsedTimeToStart = filteredFrameInfo[filteredFrameInfo.length - 1].elapsedTime;
15238
+ const telemetryData = {
15239
+ sheetId: this._context.unit.getActiveSheet().getSheetId(),
15240
+ unitId: this._context.unit.getUnitId(),
15241
+ elapsedTimeToStart,
15242
+ ...summaryFrameStats
15243
+ };
15244
+ this._renderMetric$.next(telemetryData);
15245
+ (_this$_telemetryServi = this._telemetryService) === null || _this$_telemetryServi === void 0 || _this$_telemetryServi.capture("sheet_render_cost", telemetryData);
15246
+ }
15247
+ _addComponent(workbook) {
15248
+ const { scene, components } = this._context;
15249
+ const worksheet = workbook.getActiveSheet();
15250
+ const spreadsheet = new _univerjs_engine_render.Spreadsheet("__SpreadsheetRender__");
15251
+ this._addViewport(worksheet);
15252
+ const spreadsheetRowHeader = new _univerjs_engine_render.SpreadsheetRowHeader("__SpreadsheetRowHeader__");
15253
+ const spreadsheetColumnHeader = new _univerjs_engine_render.SpreadsheetColumnHeader("__SpreadsheetColumnHeader__");
15254
+ const SpreadsheetLeftTopPlaceholder = new _univerjs_engine_render.Rect("__SpreadsheetLeftTopPlaceholder__", {
15255
+ zIndex: 2,
15256
+ left: -1,
15257
+ top: -1,
15258
+ fill: "rgb(248, 249, 250)",
15259
+ stroke: "rgb(217, 217, 217)",
15260
+ strokeWidth: 1
15261
+ });
15262
+ this._context.mainComponent = spreadsheet;
15263
+ components.set("__SpreadsheetRender__", spreadsheet);
15264
+ components.set("__SpreadsheetRowHeader__", spreadsheetRowHeader);
15265
+ components.set("__SpreadsheetColumnHeader__", spreadsheetColumnHeader);
15266
+ components.set("__SpreadsheetLeftTopPlaceholder__", SpreadsheetLeftTopPlaceholder);
15267
+ scene.addObjects([spreadsheet], 0);
15268
+ scene.addObjects([
15269
+ spreadsheetRowHeader,
15270
+ spreadsheetColumnHeader,
15271
+ SpreadsheetLeftTopPlaceholder
15272
+ ], 10);
15273
+ scene.enableLayerCache(0, 10);
15274
+ }
15275
+ _initViewports(scene, rowHeader, columnHeader) {
15276
+ const rowHeaderWidth = rowHeader.hidden ? 0 : rowHeader.width;
15277
+ const columnHeaderHeight = columnHeader.hidden ? 0 : columnHeader.height;
15278
+ const bufferEdgeX = 100;
15279
+ const bufferEdgeY = 100;
15280
+ const viewMain = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN, scene, {
15281
+ left: rowHeaderWidth,
15282
+ top: columnHeaderHeight,
15283
+ bottom: 0,
15284
+ right: 0,
15285
+ isWheelPreventDefaultX: true,
15286
+ allowCache: true,
15287
+ bufferEdgeX,
15288
+ bufferEdgeY
15289
+ });
15290
+ const viewMainLeftTop = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP, scene, {
15291
+ isWheelPreventDefaultX: true,
15292
+ active: false,
15293
+ allowCache: true,
15294
+ bufferEdgeX: 0,
15295
+ bufferEdgeY: 0
15296
+ });
15297
+ const viewMainLeft = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT, scene, {
15298
+ isWheelPreventDefaultX: true,
15299
+ active: false,
15300
+ allowCache: true,
15301
+ bufferEdgeX: 0,
15302
+ bufferEdgeY
15303
+ });
15304
+ const viewMainTop = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN_TOP, scene, {
15305
+ isWheelPreventDefaultX: true,
15306
+ active: false,
15307
+ allowCache: true,
15308
+ bufferEdgeX,
15309
+ bufferEdgeY: 0
15310
+ });
15311
+ const viewRowTop = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP, scene, {
15312
+ active: false,
15313
+ isWheelPreventDefaultX: true
15314
+ });
15315
+ const viewRowBottom = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM, scene, {
15316
+ left: 0,
15317
+ top: columnHeaderHeight,
15318
+ bottom: 0,
15319
+ width: rowHeaderWidth + 1,
15320
+ isWheelPreventDefaultX: true
15321
+ });
15322
+ const viewColumnLeft = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT, scene, {
15323
+ active: false,
15324
+ isWheelPreventDefaultX: true
14945
15325
  });
14946
15326
  const viewColumnRight = new _univerjs_engine_render.Viewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT, scene, {
14947
15327
  left: rowHeaderWidth,
@@ -15000,13 +15380,13 @@ let SheetRenderController = class SheetRenderController extends _univerjs_core.R
15000
15380
  const spreadsheetRowHeader = components.get("__SpreadsheetRowHeader__");
15001
15381
  const spreadsheetColumnHeader = components.get("__SpreadsheetColumnHeader__");
15002
15382
  const spreadsheetLeftTopPlaceholder = components.get("__SpreadsheetLeftTopPlaceholder__");
15003
- const { rowHeaderWidth, columnHeaderHeight } = spreadsheetSkeleton;
15383
+ const leftTopPlaceholderSize = getLeftTopPlaceholderSize(spreadsheetSkeleton);
15004
15384
  spreadsheet === null || spreadsheet === void 0 || spreadsheet.updateSkeleton(spreadsheetSkeleton);
15005
15385
  spreadsheetRowHeader === null || spreadsheetRowHeader === void 0 || spreadsheetRowHeader.updateSkeleton(spreadsheetSkeleton);
15006
15386
  spreadsheetColumnHeader === null || spreadsheetColumnHeader === void 0 || spreadsheetColumnHeader.updateSkeleton(spreadsheetSkeleton);
15007
15387
  spreadsheetLeftTopPlaceholder === null || spreadsheetLeftTopPlaceholder === void 0 || spreadsheetLeftTopPlaceholder.transformByState({
15008
- width: rowHeaderWidth,
15009
- height: columnHeaderHeight
15388
+ width: leftTopPlaceholderSize.width,
15389
+ height: leftTopPlaceholderSize.height
15010
15390
  });
15011
15391
  }));
15012
15392
  }
@@ -15126,6 +15506,13 @@ SheetRenderController = __decorate([
15126
15506
  __decorateParam(4, _univerjs_core.ICommandService),
15127
15507
  __decorateParam(5, (0, _univerjs_core.Optional)(_univerjs_telemetry.ITelemetryService))
15128
15508
  ], SheetRenderController);
15509
+ function getLeftTopPlaceholderSize(skeleton) {
15510
+ var _skeleton$rowHeaderWi, _skeleton$columnHeade;
15511
+ return {
15512
+ width: (_skeleton$rowHeaderWi = skeleton.rowHeaderWidthAndMarginLeft) !== null && _skeleton$rowHeaderWi !== void 0 ? _skeleton$rowHeaderWi : skeleton.rowHeaderWidth,
15513
+ height: (_skeleton$columnHeade = skeleton.columnHeaderHeightAndMarginTop) !== null && _skeleton$columnHeade !== void 0 ? _skeleton$columnHeade : skeleton.columnHeaderHeight
15514
+ };
15515
+ }
15129
15516
 
15130
15517
  //#endregion
15131
15518
  //#region src/components/border-panel/border-line/icons/BorderDashDot.tsx
@@ -15695,77 +16082,77 @@ const COMPONENT_PREFIX = "UI_PLUGIN_SHEETS";
15695
16082
  const BORDER_PANEL_COMPONENT = `${COMPONENT_PREFIX}_BORDER_PANEL_COMPONENT`;
15696
16083
  const BORDER_LINE_CHILDREN = [
15697
16084
  {
15698
- label: "borderLine.borderTop",
16085
+ label: "sheets-ui.borderLine.borderTop",
15699
16086
  icon: "UpBorderDoubleIcon",
15700
16087
  value: "top"
15701
16088
  },
15702
16089
  {
15703
- label: "borderLine.borderBottom",
16090
+ label: "sheets-ui.borderLine.borderBottom",
15704
16091
  icon: "DownBorderDoubleIcon",
15705
16092
  value: "bottom"
15706
16093
  },
15707
16094
  {
15708
- label: "borderLine.borderLeft",
16095
+ label: "sheets-ui.borderLine.borderLeft",
15709
16096
  icon: "LeftBorderDoubleIcon",
15710
16097
  value: "left"
15711
16098
  },
15712
16099
  {
15713
- label: "borderLine.borderRight",
16100
+ label: "sheets-ui.borderLine.borderRight",
15714
16101
  icon: "RightBorderDoubleIcon",
15715
16102
  value: "right"
15716
16103
  },
15717
16104
  {
15718
- label: "borderLine.borderNone",
16105
+ label: "sheets-ui.borderLine.borderNone",
15719
16106
  icon: "NoBorderIcon",
15720
16107
  value: "none"
15721
16108
  },
15722
16109
  {
15723
- label: "borderLine.borderAll",
16110
+ label: "sheets-ui.borderLine.borderAll",
15724
16111
  icon: "AllBorderIcon",
15725
16112
  value: "all"
15726
16113
  },
15727
16114
  {
15728
- label: "borderLine.borderOutside",
16115
+ label: "sheets-ui.borderLine.borderOutside",
15729
16116
  icon: "OuterBorderDoubleIcon",
15730
16117
  value: "outside"
15731
16118
  },
15732
16119
  {
15733
- label: "borderLine.borderInside",
16120
+ label: "sheets-ui.borderLine.borderInside",
15734
16121
  icon: "InnerBorderDoubleIcon",
15735
16122
  value: "inside"
15736
16123
  },
15737
16124
  {
15738
- label: "borderLine.borderHorizontal",
16125
+ label: "sheets-ui.borderLine.borderHorizontal",
15739
16126
  icon: "HorizontalBorderDoubleIcon",
15740
16127
  value: "horizontal"
15741
16128
  },
15742
16129
  {
15743
- label: "borderLine.borderVertical",
16130
+ label: "sheets-ui.borderLine.borderVertical",
15744
16131
  icon: "VerticalBorderDoubleIcon",
15745
16132
  value: "vertical"
15746
16133
  },
15747
16134
  {
15748
- label: "borderLine.borderTlbr",
16135
+ label: "sheets-ui.borderLine.borderTlbr",
15749
16136
  icon: "BackSlashDoubleIcon",
15750
16137
  value: "tlbr"
15751
16138
  },
15752
16139
  {
15753
- label: "borderLine.borderTlbcTlmr",
16140
+ label: "sheets-ui.borderLine.borderTlbcTlmr",
15754
16141
  icon: "LeftDoubleDiagonalDoubleIcon",
15755
16142
  value: "tlbc_tlmr"
15756
16143
  },
15757
16144
  {
15758
- label: "borderLine.borderTlbrTlbcTlmr",
16145
+ label: "sheets-ui.borderLine.borderTlbrTlbcTlmr",
15759
16146
  icon: "LeftTridiagonalDoubleIcon",
15760
16147
  value: "tlbr_tlbc_tlmr"
15761
16148
  },
15762
16149
  {
15763
- label: "borderLine.borderBlTr",
16150
+ label: "sheets-ui.borderLine.borderBlTr",
15764
16151
  icon: "SlashDoubleIcon",
15765
16152
  value: "bltr"
15766
16153
  },
15767
16154
  {
15768
- label: "borderLine.borderMltrBctr",
16155
+ label: "sheets-ui.borderLine.borderMltrBctr",
15769
16156
  icon: "RightDoubleDiagonalDoubleIcon",
15770
16157
  value: "mltr_bctr"
15771
16158
  }
@@ -15950,9 +16337,9 @@ const MenuItemFrozen = (props) => {
15950
16337
  if (contextMenuService.visible) updateValue(selectionManagerService.getCurrentLastSelection());
15951
16338
  }, [contextMenuService.visible]);
15952
16339
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
15953
- type === "row" && localeService.t("rightClick.freezeRow", value.row),
15954
- type === "col" && localeService.t("rightClick.freezeCol", value.col),
15955
- type === "all" && localeService.t("rightClick.freezeCell", value.row, value.col)
16340
+ type === "row" && localeService.t("sheets-ui.rightClick.freezeRow", value.row),
16341
+ type === "col" && localeService.t("sheets-ui.rightClick.freezeCol", value.col),
16342
+ type === "all" && localeService.t("sheets-ui.rightClick.freezeCell", value.row, value.col)
15956
16343
  ] });
15957
16344
  };
15958
16345
 
@@ -16139,7 +16526,7 @@ function getBaseRangeMenuHidden$(accessor) {
16139
16526
  var _selectionManagerServ;
16140
16527
  const range = (_selectionManagerServ = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.range;
16141
16528
  if (!range) return true;
16142
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16529
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16143
16530
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
16144
16531
  if (!workbook || !worksheet) return true;
16145
16532
  const unitId = workbook.getUnitId();
@@ -16162,7 +16549,7 @@ function getInsertBeforeMenuHidden$(accessor, type) {
16162
16549
  var _selectionManagerServ3;
16163
16550
  const range = (_selectionManagerServ3 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ3 === void 0 ? void 0 : _selectionManagerServ3.range;
16164
16551
  if (!range) return true;
16165
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16552
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16166
16553
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
16167
16554
  if (!workbook || !worksheet) return true;
16168
16555
  const unitId = workbook.getUnitId();
@@ -16190,7 +16577,7 @@ function getDeleteMenuHidden$(accessor, type) {
16190
16577
  var _selectionManagerServ4;
16191
16578
  const range = (_selectionManagerServ4 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ4 === void 0 ? void 0 : _selectionManagerServ4.range;
16192
16579
  if (!range) return true;
16193
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16580
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16194
16581
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
16195
16582
  if (!workbook || !worksheet) return true;
16196
16583
  const unitId = workbook.getUnitId();
@@ -16221,7 +16608,7 @@ function getCellMenuHidden$(accessor, type) {
16221
16608
  var _selectionManagerServ5;
16222
16609
  const range = (_selectionManagerServ5 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ5 === void 0 ? void 0 : _selectionManagerServ5.range;
16223
16610
  if (!range) return true;
16224
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16611
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16225
16612
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
16226
16613
  if (!workbook || !worksheet) return true;
16227
16614
  const unitId = workbook.getUnitId();
@@ -16288,7 +16675,7 @@ function CellBorderSelectorMenuItemFactory(accessor) {
16288
16675
  subscriber.next(defaultIcon);
16289
16676
  return disposable.dispose;
16290
16677
  }),
16291
- tooltip: "toolbar.border.main",
16678
+ tooltip: "sheets-ui.toolbar.border.main",
16292
16679
  type: _univerjs_ui.MenuItemType.BUTTON_SELECTOR,
16293
16680
  slot: true,
16294
16681
  selections: [{
@@ -16313,7 +16700,7 @@ function ClearSelectionMenuItemFactory(accessor) {
16313
16700
  id: CLEAR_SELECTION_MENU_ID,
16314
16701
  type: _univerjs_ui.MenuItemType.SUBITEMS,
16315
16702
  icon: "ClearFormatDoubleIcon",
16316
- title: "rightClick.clearSelection",
16703
+ title: "sheets-ui.rightClick.clearSelection",
16317
16704
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16318
16705
  };
16319
16706
  }
@@ -16321,8 +16708,7 @@ function ClearSelectionContentMenuItemFactory(accessor) {
16321
16708
  return {
16322
16709
  id: _univerjs_sheets.ClearSelectionContentCommand.id,
16323
16710
  type: _univerjs_ui.MenuItemType.BUTTON,
16324
- icon: "ClearFormatDoubleIcon",
16325
- title: "rightClick.clearContent",
16711
+ title: "sheets-ui.rightClick.clearContent",
16326
16712
  disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
16327
16713
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
16328
16714
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellValuePermission],
@@ -16335,8 +16721,7 @@ function ClearSelectionFormatMenuItemFactory(accessor) {
16335
16721
  return {
16336
16722
  id: _univerjs_sheets.ClearSelectionFormatCommand.id,
16337
16723
  type: _univerjs_ui.MenuItemType.BUTTON,
16338
- icon: "ClearFormatDoubleIcon",
16339
- title: "rightClick.clearFormat",
16724
+ title: "sheets-ui.rightClick.clearFormat",
16340
16725
  disabled$: getCurrentRangeDisable$(accessor, {
16341
16726
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
16342
16727
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission],
@@ -16345,13 +16730,30 @@ function ClearSelectionFormatMenuItemFactory(accessor) {
16345
16730
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16346
16731
  };
16347
16732
  }
16348
- function ClearSelectionAllMenuItemFactory(accessor) {
16733
+ function ClearSelectionAllToolbarMenuItemFactory(accessor) {
16349
16734
  return {
16350
16735
  id: _univerjs_sheets.ClearSelectionAllCommand.id,
16351
16736
  type: _univerjs_ui.MenuItemType.BUTTON,
16352
16737
  icon: "ClearFormatDoubleIcon",
16353
- title: "rightClick.clearAll",
16354
- tooltip: "rightClick.clearAll",
16738
+ tooltip: "sheets-ui.rightClick.clearAll",
16739
+ disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
16740
+ workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
16741
+ worksheetTypes: [
16742
+ _univerjs_sheets.WorksheetEditPermission,
16743
+ _univerjs_sheets.WorksheetSetCellValuePermission,
16744
+ _univerjs_sheets.WorksheetSetCellStylePermission
16745
+ ],
16746
+ rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
16747
+ })),
16748
+ hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16749
+ };
16750
+ }
16751
+ function ClearSelectionAllMenuItemFactory(accessor) {
16752
+ return {
16753
+ id: _univerjs_sheets.ClearSelectionAllCommand.id,
16754
+ type: _univerjs_ui.MenuItemType.BUTTON,
16755
+ title: "sheets-ui.rightClick.clearAll",
16756
+ tooltip: "sheets-ui.rightClick.clearAll",
16355
16757
  disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
16356
16758
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
16357
16759
  worksheetTypes: [
@@ -16372,7 +16774,7 @@ function DeleteRangeMenuItemFactory(accessor) {
16372
16774
  return {
16373
16775
  id: DELETE_RANGE_MENU_ID,
16374
16776
  type: _univerjs_ui.MenuItemType.SUBITEMS,
16375
- title: "rightClick.delete",
16777
+ title: "sheets-ui.rightClick.delete",
16376
16778
  icon: "ReduceDoubleIcon",
16377
16779
  hidden$: getObservableWithExclusiveRange$(accessor, getBaseRangeMenuHidden$(accessor)),
16378
16780
  disabled$: getCurrentRangeDisable$(accessor, {
@@ -16386,7 +16788,7 @@ function RemoveColMenuItemFactory(accessor) {
16386
16788
  id: RemoveColConfirmCommand.id,
16387
16789
  type: _univerjs_ui.MenuItemType.BUTTON,
16388
16790
  icon: "DeleteColumnDoubleIcon",
16389
- title: "rightClick.deleteSelectedColumn",
16791
+ title: "sheets-ui.rightClick.deleteSelectedColumn",
16390
16792
  hidden$: getDeleteMenuHidden$(accessor, "col"),
16391
16793
  disabled$: getCurrentRangeDisable$(accessor, {
16392
16794
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission, _univerjs_sheets.WorkbookDeleteColumnPermission],
@@ -16399,7 +16801,7 @@ function RemoveRowMenuItemFactory(accessor) {
16399
16801
  id: RemoveRowConfirmCommand.id,
16400
16802
  type: _univerjs_ui.MenuItemType.BUTTON,
16401
16803
  icon: "DeleteRowDoubleIcon",
16402
- title: "rightClick.deleteSelectedRow",
16804
+ title: "sheets-ui.rightClick.deleteSelectedRow",
16403
16805
  disabled$: getCurrentRangeDisable$(accessor, {
16404
16806
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission, _univerjs_sheets.WorkbookDeleteRowPermission],
16405
16807
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetDeleteRowPermission]
@@ -16411,7 +16813,7 @@ function DeleteRangeMoveLeftMenuItemFactory(accessor) {
16411
16813
  return {
16412
16814
  id: DeleteRangeMoveLeftConfirmCommand.id,
16413
16815
  type: _univerjs_ui.MenuItemType.BUTTON,
16414
- title: "rightClick.moveLeft",
16816
+ title: "sheets-ui.rightClick.moveLeft",
16415
16817
  icon: "DeleteCellShiftLeftDoubleIcon",
16416
16818
  disabled$: getCurrentRangeDisable$(accessor, {
16417
16819
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
@@ -16425,7 +16827,7 @@ function DeleteRangeMoveUpMenuItemFactory(accessor) {
16425
16827
  return {
16426
16828
  id: DeleteRangeMoveUpConfirmCommand.id,
16427
16829
  type: _univerjs_ui.MenuItemType.BUTTON,
16428
- title: "rightClick.moveUp",
16830
+ title: "sheets-ui.rightClick.moveUp",
16429
16831
  icon: "DeleteCellShiftUpDoubleIcon",
16430
16832
  disabled$: getCurrentRangeDisable$(accessor, {
16431
16833
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
@@ -16481,7 +16883,7 @@ function FontSizeSelectorMenuItemFactory(accessor) {
16481
16883
  return {
16482
16884
  id: SetRangeFontSizeCommand.id,
16483
16885
  type: _univerjs_ui.MenuItemType.SELECTOR,
16484
- tooltip: "toolbar.fontSize",
16886
+ tooltip: "sheets-ui.toolbar.fontSize",
16485
16887
  label: {
16486
16888
  name: _univerjs_ui.FONT_SIZE_COMPONENT,
16487
16889
  props: {
@@ -16506,7 +16908,7 @@ function FontSizeIncreaseMenuItemFactory(accessor) {
16506
16908
  id: SetRangeFontIncreaseCommand.id,
16507
16909
  type: _univerjs_ui.MenuItemType.BUTTON,
16508
16910
  icon: "FontSizeIncreaseIcon",
16509
- tooltip: "toolbar.fontSizeIncrease",
16911
+ tooltip: "sheets-ui.toolbar.fontSizeIncrease",
16510
16912
  disabled$,
16511
16913
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16512
16914
  };
@@ -16521,7 +16923,7 @@ function FontSizeDecreaseMenuItemFactory(accessor) {
16521
16923
  id: SetRangeFontDecreaseCommand.id,
16522
16924
  type: _univerjs_ui.MenuItemType.BUTTON,
16523
16925
  icon: "FontSizeReduceIcon",
16524
- tooltip: "toolbar.fontSizeDecrease",
16926
+ tooltip: "sheets-ui.toolbar.fontSizeDecrease",
16525
16927
  disabled$,
16526
16928
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16527
16929
  };
@@ -16555,7 +16957,7 @@ function SheetFrozenMenuItemFactory(accessor) {
16555
16957
  return {
16556
16958
  id: SHEET_FROZEN_MENU_ID,
16557
16959
  type: _univerjs_ui.MenuItemType.SUBITEMS,
16558
- title: "rightClick.freeze",
16960
+ title: "sheets-ui.rightClick.freeze",
16559
16961
  icon: "FreezeToSelectedIcon",
16560
16962
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16561
16963
  };
@@ -16565,7 +16967,7 @@ function SheetFrozenColumnHeaderMenuItemFactory(accessor) {
16565
16967
  return {
16566
16968
  id: SHEET_FROZEN_COLUMN_HEADER_MENU_ID,
16567
16969
  type: _univerjs_ui.MenuItemType.SUBITEMS,
16568
- title: "rightClick.freeze",
16970
+ title: "sheets-ui.rightClick.freeze",
16569
16971
  icon: "FreezeToSelectedIcon",
16570
16972
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16571
16973
  };
@@ -16575,7 +16977,7 @@ function SheetFrozenRowHeaderMenuItemFactory(accessor) {
16575
16977
  return {
16576
16978
  id: SHEET_FROZEN_ROW_HEADER_MENU_ID,
16577
16979
  type: _univerjs_ui.MenuItemType.SUBITEMS,
16578
- title: "rightClick.freeze",
16980
+ title: "sheets-ui.rightClick.freeze",
16579
16981
  icon: "FreezeToSelectedIcon",
16580
16982
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16581
16983
  };
@@ -16620,7 +17022,7 @@ function FrozenFirstRowMenuItemFactory(accessor) {
16620
17022
  return {
16621
17023
  id: SetFirstRowFrozenCommand.id,
16622
17024
  type: _univerjs_ui.MenuItemType.BUTTON,
16623
- title: "rightClick.freezeFirstRow",
17025
+ title: "sheets-ui.rightClick.freezeFirstRow",
16624
17026
  icon: "FreezeRowIcon",
16625
17027
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16626
17028
  };
@@ -16629,7 +17031,7 @@ function FrozenFirstColMenuItemFactory(accessor) {
16629
17031
  return {
16630
17032
  id: SetFirstColumnFrozenCommand.id,
16631
17033
  type: _univerjs_ui.MenuItemType.BUTTON,
16632
- title: "rightClick.freezeFirstCol",
17034
+ title: "sheets-ui.rightClick.freezeFirstCol",
16633
17035
  icon: "FreezeColumnIcon",
16634
17036
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16635
17037
  };
@@ -16638,7 +17040,7 @@ function CancelFrozenMenuItemFactory(accessor) {
16638
17040
  return {
16639
17041
  id: _univerjs_sheets.CancelFrozenCommand.id,
16640
17042
  type: _univerjs_ui.MenuItemType.BUTTON,
16641
- title: "rightClick.cancelFreeze",
17043
+ title: "sheets-ui.rightClick.cancelFreeze",
16642
17044
  icon: "CancelFreezeIcon",
16643
17045
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
16644
17046
  };
@@ -16652,11 +17054,11 @@ function ToggleGridlinesMenuFactory(accessor) {
16652
17054
  return {
16653
17055
  id: _univerjs_sheets.ToggleGridlinesCommand.id,
16654
17056
  type: _univerjs_ui.MenuItemType.BUTTON,
16655
- tooltip: "toolbar.toggleGridlines",
17057
+ tooltip: "sheets-ui.toolbar.toggleGridlines",
16656
17058
  icon: "HideGridlinesDoubleIcon",
16657
17059
  activated$: new rxjs.Observable((observer) => {
16658
17060
  const getValue = () => {
16659
- const workbook = instanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
17061
+ const workbook = instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
16660
17062
  if (workbook) return workbook.getActiveSheet().getConfig().showGridlines === _univerjs_core.BooleanNumber.TRUE;
16661
17063
  return false;
16662
17064
  };
@@ -16684,7 +17086,7 @@ function CellInsertMenuItemFactory(accessor) {
16684
17086
  return {
16685
17087
  id: CELL_INSERT_MENU_ID,
16686
17088
  type: _univerjs_ui.MenuItemType.SUBITEMS,
16687
- title: "rightClick.insert",
17089
+ title: "sheets-ui.rightClick.insert",
16688
17090
  icon: "InsertDoubleIcon",
16689
17091
  hidden$: getObservableWithExclusiveRange$(accessor, getBaseRangeMenuHidden$(accessor)),
16690
17092
  disabled$: getCurrentRangeDisable$(accessor, {
@@ -16724,10 +17126,10 @@ function InsertRowBeforeCellMenuItemFactory(accessor) {
16724
17126
  label: {
16725
17127
  name: MENU_ITEM_INPUT_COMPONENT,
16726
17128
  props: {
16727
- prefix: "rightClick.insertRowsAbove",
17129
+ prefix: "sheets-ui.rightClick.insertRowsAbove",
16728
17130
  min: 1,
16729
17131
  max: 1e3,
16730
- suffix: "rightClick.insertRowsAboveSuffix",
17132
+ suffix: "sheets-ui.rightClick.insertRowsAboveSuffix",
16731
17133
  disabled$
16732
17134
  }
16733
17135
  },
@@ -16770,10 +17172,10 @@ function InsertColLeftCellMenuItemFactory(accessor) {
16770
17172
  label: {
16771
17173
  name: MENU_ITEM_INPUT_COMPONENT,
16772
17174
  props: {
16773
- prefix: "rightClick.insertColsLeft",
17175
+ prefix: "sheets-ui.rightClick.insertColsLeft",
16774
17176
  min: 1,
16775
17177
  max: 1e3,
16776
- suffix: "rightClick.insertColsLeftSuffix",
17178
+ suffix: "sheets-ui.rightClick.insertColsLeftSuffix",
16777
17179
  disabled$
16778
17180
  }
16779
17181
  },
@@ -16799,7 +17201,7 @@ function InsertRangeMoveRightMenuItemFactory(accessor) {
16799
17201
  return {
16800
17202
  id: InsertRangeMoveRightConfirmCommand.id,
16801
17203
  type: _univerjs_ui.MenuItemType.BUTTON,
16802
- title: "rightClick.moveRight",
17204
+ title: "sheets-ui.rightClick.moveRight",
16803
17205
  icon: "InsertCellShiftRightDoubleIcon",
16804
17206
  disabled$: getCurrentRangeDisable$(accessor, {
16805
17207
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
@@ -16817,7 +17219,7 @@ function InsertRangeMoveDownMenuItemFactory(accessor) {
16817
17219
  return {
16818
17220
  id: InsertRangeMoveDownConfirmCommand.id,
16819
17221
  type: _univerjs_ui.MenuItemType.BUTTON,
16820
- title: "rightClick.moveDown",
17222
+ title: "sheets-ui.rightClick.moveDown",
16821
17223
  icon: "InsertCellDownDoubleIcon",
16822
17224
  disabled$: getCurrentRangeDisable$(accessor, {
16823
17225
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
@@ -16848,10 +17250,10 @@ function InsertMultiRowsAfterHeaderMenuItemFactory(accessor) {
16848
17250
  label: {
16849
17251
  name: MENU_ITEM_INPUT_COMPONENT,
16850
17252
  props: {
16851
- prefix: "rightClick.insertRowsAfter",
17253
+ prefix: "sheets-ui.rightClick.insertRowsAfter",
16852
17254
  min: 1,
16853
17255
  max: 1e3,
16854
- suffix: "rightClick.insertRowsAfterSuffix",
17256
+ suffix: "sheets-ui.rightClick.insertRowsAfterSuffix",
16855
17257
  disabled$
16856
17258
  }
16857
17259
  },
@@ -16894,10 +17296,10 @@ function InsertMultiRowsAboveHeaderMenuItemFactory(accessor) {
16894
17296
  label: {
16895
17297
  name: MENU_ITEM_INPUT_COMPONENT,
16896
17298
  props: {
16897
- prefix: "rightClick.insertRowsAbove",
17299
+ prefix: "sheets-ui.rightClick.insertRowsAbove",
16898
17300
  min: 1,
16899
17301
  max: 1e3,
16900
- suffix: "rightClick.insertRowsAboveSuffix",
17302
+ suffix: "sheets-ui.rightClick.insertRowsAboveSuffix",
16901
17303
  disabled$
16902
17304
  }
16903
17305
  },
@@ -16940,10 +17342,10 @@ function InsertMultiColsLeftHeaderMenuItemFactory(accessor) {
16940
17342
  label: {
16941
17343
  name: MENU_ITEM_INPUT_COMPONENT,
16942
17344
  props: {
16943
- prefix: "rightClick.insertColsLeft",
17345
+ prefix: "sheets-ui.rightClick.insertColsLeft",
16944
17346
  min: 1,
16945
17347
  max: 1e3,
16946
- suffix: "rightClick.insertColsLeftSuffix",
17348
+ suffix: "sheets-ui.rightClick.insertColsLeftSuffix",
16947
17349
  disabled$
16948
17350
  }
16949
17351
  },
@@ -16986,10 +17388,10 @@ function InsertMultiColsRightHeaderMenuItemFactory(accessor) {
16986
17388
  label: {
16987
17389
  name: MENU_ITEM_INPUT_COMPONENT,
16988
17390
  props: {
16989
- prefix: "rightClick.insertColsRight",
17391
+ prefix: "sheets-ui.rightClick.insertColsRight",
16990
17392
  min: 1,
16991
17393
  max: 1e3,
16992
- suffix: "rightClick.insertColsRightSuffix",
17394
+ suffix: "sheets-ui.rightClick.insertColsRightSuffix",
16993
17395
  disabled$
16994
17396
  }
16995
17397
  },
@@ -17029,7 +17431,7 @@ function FormatPainterMenuItemFactory(accessor) {
17029
17431
  type: _univerjs_ui.MenuItemType.BUTTON,
17030
17432
  icon: "BrushIcon",
17031
17433
  title: "Format Painter",
17032
- tooltip: "toolbar.formatPainter",
17434
+ tooltip: "sheets-ui.toolbar.formatPainter",
17033
17435
  activated$: new rxjs.Observable((subscriber) => {
17034
17436
  let active = false;
17035
17437
  const status$ = formatPainterService.status$.subscribe((s) => {
@@ -17059,7 +17461,7 @@ function BoldMenuItemFactory(accessor) {
17059
17461
  type: _univerjs_ui.MenuItemType.BUTTON,
17060
17462
  icon: "BoldIcon",
17061
17463
  title: "Set bold",
17062
- tooltip: "toolbar.bold",
17464
+ tooltip: "sheets-ui.toolbar.bold",
17063
17465
  disabled$: getCurrentRangeDisable$(accessor, {
17064
17466
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
17065
17467
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission],
@@ -17113,7 +17515,7 @@ function ItalicMenuItemFactory(accessor) {
17113
17515
  type: _univerjs_ui.MenuItemType.BUTTON,
17114
17516
  icon: "ItalicIcon",
17115
17517
  title: "Set italic",
17116
- tooltip: "toolbar.italic",
17518
+ tooltip: "sheets-ui.toolbar.italic",
17117
17519
  disabled$: getCurrentRangeDisable$(accessor, {
17118
17520
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
17119
17521
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission],
@@ -17163,7 +17565,7 @@ function UnderlineMenuItemFactory(accessor) {
17163
17565
  type: _univerjs_ui.MenuItemType.BUTTON,
17164
17566
  icon: "UnderlineIcon",
17165
17567
  title: "Set underline",
17166
- tooltip: "toolbar.underline",
17568
+ tooltip: "sheets-ui.toolbar.underline",
17167
17569
  activated$: deriveStateFromActiveSheet$(univerInstanceService, false, ({ worksheet }) => new rxjs.Observable((subscriber) => {
17168
17570
  var _selectionManagerServ6;
17169
17571
  const disposable = commandService.onCommandExecuted((c) => {
@@ -17213,7 +17615,7 @@ function StrikeThroughMenuItemFactory(accessor) {
17213
17615
  type: _univerjs_ui.MenuItemType.BUTTON,
17214
17616
  icon: "StrikethroughIcon",
17215
17617
  title: "Set strike through",
17216
- tooltip: "toolbar.strikethrough",
17618
+ tooltip: "sheets-ui.toolbar.strikethrough",
17217
17619
  disabled$: getCurrentRangeDisable$(accessor, {
17218
17620
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
17219
17621
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission],
@@ -17265,7 +17667,7 @@ function FontFamilySelectorMenuItemFactory(accessor) {
17265
17667
  }, true);
17266
17668
  return {
17267
17669
  id: SetRangeFontFamilyCommand.id,
17268
- tooltip: "toolbar.font",
17670
+ tooltip: "sheets-ui.toolbar.font",
17269
17671
  type: _univerjs_ui.MenuItemType.SELECTOR,
17270
17672
  label: {
17271
17673
  name: _univerjs_ui.FONT_FAMILY_COMPONENT,
@@ -17315,7 +17717,7 @@ function ResetTextColorMenuItemFactory(accessor) {
17315
17717
  return {
17316
17718
  id: ResetRangeTextColorCommand.id,
17317
17719
  type: _univerjs_ui.MenuItemType.BUTTON,
17318
- title: "toolbar.resetColor",
17720
+ title: "sheets-ui.toolbar.resetColor",
17319
17721
  icon: "NoColorDoubleIcon",
17320
17722
  disabled$: getCurrentRangeDisable$(accessor, {
17321
17723
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
@@ -17332,7 +17734,7 @@ function TextColorSelectorMenuItemFactory(accessor) {
17332
17734
  return {
17333
17735
  id: SetRangeTextColorCommand.id,
17334
17736
  icon: "FontColorDoubleIcon",
17335
- tooltip: "toolbar.textColor.main",
17737
+ tooltip: "sheets-ui.toolbar.textColor.main",
17336
17738
  type: _univerjs_ui.MenuItemType.BUTTON_SELECTOR,
17337
17739
  selections: [{
17338
17740
  label: {
@@ -17372,7 +17774,7 @@ function ResetBackgroundColorMenuItemFactory(accessor) {
17372
17774
  return {
17373
17775
  id: _univerjs_sheets.ResetBackgroundColorCommand.id,
17374
17776
  type: _univerjs_ui.MenuItemType.BUTTON,
17375
- title: "toolbar.resetColor",
17777
+ title: "sheets-ui.toolbar.resetColor",
17376
17778
  icon: "NoColorDoubleIcon",
17377
17779
  disabled$: getCurrentRangeDisable$(accessor, {
17378
17780
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
@@ -17387,7 +17789,7 @@ function BackgroundColorSelectorMenuItemFactory(accessor) {
17387
17789
  const selectionManagerService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
17388
17790
  return {
17389
17791
  id: _univerjs_sheets.SetBackgroundColorCommand.id,
17390
- tooltip: "toolbar.fillColor.main",
17792
+ tooltip: "sheets-ui.toolbar.fillColor.main",
17391
17793
  type: _univerjs_ui.MenuItemType.BUTTON_SELECTOR,
17392
17794
  icon: "PaintBucketDoubleIcon",
17393
17795
  selections: [{
@@ -17426,17 +17828,17 @@ function BackgroundColorSelectorMenuItemFactory(accessor) {
17426
17828
  }
17427
17829
  const HORIZONTAL_ALIGN_CHILDREN = [
17428
17830
  {
17429
- label: "align.left",
17831
+ label: "sheets-ui.align.left",
17430
17832
  icon: "LeftJustifyingIcon",
17431
17833
  value: _univerjs_core.HorizontalAlign.LEFT
17432
17834
  },
17433
17835
  {
17434
- label: "align.center",
17836
+ label: "sheets-ui.align.center",
17435
17837
  icon: "HorizontallyIcon",
17436
17838
  value: _univerjs_core.HorizontalAlign.CENTER
17437
17839
  },
17438
17840
  {
17439
- label: "align.right",
17841
+ label: "sheets-ui.align.right",
17440
17842
  icon: "RightJustifyingIcon",
17441
17843
  value: _univerjs_core.HorizontalAlign.RIGHT
17442
17844
  }
@@ -17451,7 +17853,7 @@ function HorizontalAlignMenuItemFactory(accessor) {
17451
17853
  return {
17452
17854
  id: _univerjs_sheets.SetHorizontalTextAlignCommand.id,
17453
17855
  icon: (_HORIZONTAL_ALIGN_CHI = HORIZONTAL_ALIGN_CHILDREN.find((child) => child.value === defaultValue)) === null || _HORIZONTAL_ALIGN_CHI === void 0 ? void 0 : _HORIZONTAL_ALIGN_CHI.icon,
17454
- tooltip: "toolbar.horizontalAlignMode.main",
17856
+ tooltip: "sheets-ui.toolbar.horizontalAlignMode.main",
17455
17857
  type: _univerjs_ui.MenuItemType.SELECTOR,
17456
17858
  selections: HORIZONTAL_ALIGN_CHILDREN,
17457
17859
  value$: deriveStateFromActiveSheet$(univerInstanceService, defaultValue, ({ worksheet }) => new rxjs.Observable((subscriber) => {
@@ -17491,17 +17893,17 @@ function HorizontalAlignMenuItemFactory(accessor) {
17491
17893
  }
17492
17894
  const VERTICAL_ALIGN_CHILDREN = [
17493
17895
  {
17494
- label: "align.top",
17896
+ label: "sheets-ui.align.top",
17495
17897
  icon: "AlignTopIcon",
17496
17898
  value: _univerjs_core.VerticalAlign.TOP
17497
17899
  },
17498
17900
  {
17499
- label: "align.middle",
17901
+ label: "sheets-ui.align.middle",
17500
17902
  icon: "VerticalCenterIcon",
17501
17903
  value: _univerjs_core.VerticalAlign.MIDDLE
17502
17904
  },
17503
17905
  {
17504
- label: "align.bottom",
17906
+ label: "sheets-ui.align.bottom",
17505
17907
  icon: "AlignBottomIcon",
17506
17908
  value: _univerjs_core.VerticalAlign.BOTTOM
17507
17909
  }
@@ -17516,7 +17918,7 @@ function VerticalAlignMenuItemFactory(accessor) {
17516
17918
  return {
17517
17919
  id: _univerjs_sheets.SetVerticalTextAlignCommand.id,
17518
17920
  icon: (_VERTICAL_ALIGN_CHILD = VERTICAL_ALIGN_CHILDREN.find((child) => child.value === defaultValue)) === null || _VERTICAL_ALIGN_CHILD === void 0 ? void 0 : _VERTICAL_ALIGN_CHILD.icon,
17519
- tooltip: "toolbar.verticalAlignMode.main",
17921
+ tooltip: "sheets-ui.toolbar.verticalAlignMode.main",
17520
17922
  type: _univerjs_ui.MenuItemType.SELECTOR,
17521
17923
  selections: VERTICAL_ALIGN_CHILDREN,
17522
17924
  value$: deriveStateFromActiveSheet$(univerInstanceService, defaultValue, ({ worksheet }) => new rxjs.Observable((subscriber) => {
@@ -17556,17 +17958,17 @@ function VerticalAlignMenuItemFactory(accessor) {
17556
17958
  }
17557
17959
  const TEXT_WRAP_CHILDREN = [
17558
17960
  {
17559
- label: "textWrap.overflow",
17961
+ label: "sheets-ui.textWrap.overflow",
17560
17962
  icon: "OverflowIcon",
17561
17963
  value: _univerjs_core.WrapStrategy.OVERFLOW
17562
17964
  },
17563
17965
  {
17564
- label: "textWrap.wrap",
17966
+ label: "sheets-ui.textWrap.wrap",
17565
17967
  icon: "AutowrapIcon",
17566
17968
  value: _univerjs_core.WrapStrategy.WRAP
17567
17969
  },
17568
17970
  {
17569
- label: "textWrap.clip",
17971
+ label: "sheets-ui.textWrap.clip",
17570
17972
  icon: "TruncationIcon",
17571
17973
  value: _univerjs_core.WrapStrategy.CLIP
17572
17974
  }
@@ -17580,7 +17982,7 @@ function WrapTextMenuItemFactory(accessor) {
17580
17982
  const defaultValue = (_defaultStyle$tb = defaultStyle === null || defaultStyle === void 0 ? void 0 : defaultStyle.tb) !== null && _defaultStyle$tb !== void 0 ? _defaultStyle$tb : _univerjs_core.WrapStrategy.OVERFLOW;
17581
17983
  return {
17582
17984
  id: _univerjs_sheets.SetTextWrapCommand.id,
17583
- tooltip: "toolbar.textWrapMode.main",
17985
+ tooltip: "sheets-ui.toolbar.textWrapMode.main",
17584
17986
  icon: (_TEXT_WRAP_CHILDREN$f = TEXT_WRAP_CHILDREN.find((child) => child.value === defaultValue)) === null || _TEXT_WRAP_CHILDREN$f === void 0 ? void 0 : _TEXT_WRAP_CHILDREN$f.icon,
17585
17987
  type: _univerjs_ui.MenuItemType.SELECTOR,
17586
17988
  selections: TEXT_WRAP_CHILDREN,
@@ -17621,32 +18023,32 @@ function WrapTextMenuItemFactory(accessor) {
17621
18023
  }
17622
18024
  const TEXT_ROTATE_CHILDREN = [
17623
18025
  {
17624
- label: "textRotate.none",
18026
+ label: "sheets-ui.textRotate.none",
17625
18027
  icon: "NoRotationIcon",
17626
18028
  value: 0
17627
18029
  },
17628
18030
  {
17629
- label: "textRotate.angleUp",
18031
+ label: "sheets-ui.textRotate.angleUp",
17630
18032
  icon: "LeftRotationFortyFiveDegreesIcon",
17631
18033
  value: -45
17632
18034
  },
17633
18035
  {
17634
- label: "textRotate.angleDown",
18036
+ label: "sheets-ui.textRotate.angleDown",
17635
18037
  icon: "RightRotationFortyFiveDegreesIcon",
17636
18038
  value: 45
17637
18039
  },
17638
18040
  {
17639
- label: "textRotate.vertical",
18041
+ label: "sheets-ui.textRotate.vertical",
17640
18042
  icon: "VerticalTextIcon",
17641
18043
  value: "v"
17642
18044
  },
17643
18045
  {
17644
- label: "textRotate.rotationUp",
18046
+ label: "sheets-ui.textRotate.rotationUp",
17645
18047
  icon: "LeftRotationNinetyDegreesIcon",
17646
18048
  value: -90
17647
18049
  },
17648
18050
  {
17649
- label: "textRotate.rotationDown",
18051
+ label: "sheets-ui.textRotate.rotationDown",
17650
18052
  icon: "RightRotationNinetyDegreesIcon",
17651
18053
  value: 90
17652
18054
  }
@@ -17657,7 +18059,7 @@ function TextRotateMenuItemFactory(accessor) {
17657
18059
  const defaultValue = 0;
17658
18060
  return {
17659
18061
  id: _univerjs_sheets.SetTextRotationCommand.id,
17660
- tooltip: "toolbar.textRotateMode.main",
18062
+ tooltip: "sheets-ui.toolbar.textRotateMode.main",
17661
18063
  icon: TEXT_ROTATE_CHILDREN[0].icon,
17662
18064
  type: _univerjs_ui.MenuItemType.SELECTOR,
17663
18065
  selections: TEXT_ROTATE_CHILDREN,
@@ -17715,7 +18117,7 @@ function CopyMenuItemFactory(accessor) {
17715
18117
  id: SheetCopyCommand.name,
17716
18118
  commandId: SheetCopyCommand.id,
17717
18119
  type: _univerjs_ui.MenuItemType.BUTTON,
17718
- title: "rightClick.copy",
18120
+ title: "sheets-ui.rightClick.copy",
17719
18121
  icon: "CopyDoubleIcon",
17720
18122
  disabled$: getCurrentRangeDisable$(accessor, {
17721
18123
  workbookTypes: [_univerjs_sheets.WorkbookCopyPermission],
@@ -17730,7 +18132,7 @@ function CutMenuItemFactory(accessor) {
17730
18132
  id: SheetCutCommand.name,
17731
18133
  commandId: _univerjs_ui.CutCommand.id,
17732
18134
  type: _univerjs_ui.MenuItemType.BUTTON,
17733
- title: "rightClick.cut",
18135
+ title: "sheets-ui.rightClick.cut",
17734
18136
  icon: "CutIcon",
17735
18137
  disabled$: getCurrentRangeDisable$(accessor, {
17736
18138
  workbookTypes: [_univerjs_sheets.WorkbookCopyPermission, _univerjs_sheets.WorkbookEditablePermission],
@@ -17745,7 +18147,7 @@ function PasteMenuItemFactory(accessor) {
17745
18147
  id: SheetPasteCommand.name,
17746
18148
  commandId: SheetPasteCommand.id,
17747
18149
  type: _univerjs_ui.MenuItemType.BUTTON,
17748
- title: "rightClick.paste",
18150
+ title: "sheets-ui.rightClick.paste",
17749
18151
  icon: "PasteSpecialDoubleIcon",
17750
18152
  disabled$: menuClipboardDisabledObservable(accessor).pipe((0, rxjs.combineLatestWith)(getCurrentRangeDisable$(accessor, {
17751
18153
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
@@ -17765,7 +18167,7 @@ function CopySpacialMenuItemFactory(accessor) {
17765
18167
  id: COPY_SPECIAL_MENU_ID,
17766
18168
  type: _univerjs_ui.MenuItemType.SUBITEMS,
17767
18169
  icon: "CopyDoubleIcon",
17768
- title: "rightClick.copySpecial",
18170
+ title: "sheets-ui.rightClick.copySpecial",
17769
18171
  hidden$: getObservableWithExclusiveRange$(accessor, (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET))
17770
18172
  };
17771
18173
  }
@@ -17775,7 +18177,7 @@ function PasteSpacialMenuItemFactory(accessor) {
17775
18177
  id: PASTE_SPECIAL_MENU_ID,
17776
18178
  type: _univerjs_ui.MenuItemType.SUBITEMS,
17777
18179
  icon: "PasteSpecialDoubleIcon",
17778
- title: "rightClick.pasteSpecial",
18180
+ title: "sheets-ui.rightClick.pasteSpecial",
17779
18181
  hidden$: getObservableWithExclusiveRange$(accessor, (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET))
17780
18182
  };
17781
18183
  }
@@ -17783,7 +18185,7 @@ function PasteValueMenuItemFactory(accessor) {
17783
18185
  return {
17784
18186
  id: SheetPasteValueCommand.id,
17785
18187
  type: _univerjs_ui.MenuItemType.BUTTON,
17786
- title: "rightClick.pasteValue",
18188
+ title: "sheets-ui.rightClick.pasteValue",
17787
18189
  disabled$: menuClipboardDisabledObservable(accessor).pipe((0, rxjs.combineLatestWith)(getCurrentRangeDisable$(accessor, {
17788
18190
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
17789
18191
  worksheetTypes: [_univerjs_sheets.WorksheetSetCellValuePermission, _univerjs_sheets.WorksheetEditPermission],
@@ -17796,7 +18198,7 @@ function PasteFormatMenuItemFactory(accessor) {
17796
18198
  return {
17797
18199
  id: SheetPasteFormatCommand.id,
17798
18200
  type: _univerjs_ui.MenuItemType.BUTTON,
17799
- title: "rightClick.pasteFormat",
18201
+ title: "sheets-ui.rightClick.pasteFormat",
17800
18202
  disabled$: menuClipboardDisabledObservable(accessor).pipe((0, rxjs.combineLatestWith)(getCurrentRangeDisable$(accessor, {
17801
18203
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
17802
18204
  worksheetTypes: [_univerjs_sheets.WorksheetSetCellStylePermission, _univerjs_sheets.WorksheetEditPermission],
@@ -17809,7 +18211,7 @@ function PasteColWidthMenuItemFactory(accessor) {
17809
18211
  return {
17810
18212
  id: SheetPasteColWidthCommand.id,
17811
18213
  type: _univerjs_ui.MenuItemType.BUTTON,
17812
- title: "rightClick.pasteColWidth",
18214
+ title: "sheets-ui.rightClick.pasteColWidth",
17813
18215
  disabled$: menuClipboardDisabledObservable(accessor).pipe((0, rxjs.combineLatestWith)(getCurrentRangeDisable$(accessor, {
17814
18216
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
17815
18217
  worksheetTypes: [_univerjs_sheets.WorksheetSetColumnStylePermission, _univerjs_sheets.WorksheetEditPermission],
@@ -17821,7 +18223,7 @@ function PasteBesidesBorderMenuItemFactory(accessor) {
17821
18223
  return {
17822
18224
  id: SheetPasteBesidesBorderCommand.id,
17823
18225
  type: _univerjs_ui.MenuItemType.BUTTON,
17824
- title: "rightClick.pasteBesidesBorder",
18226
+ title: "sheets-ui.rightClick.pasteBesidesBorder",
17825
18227
  disabled$: menuClipboardDisabledObservable(accessor).pipe((0, rxjs.combineLatestWith)(getCurrentRangeDisable$(accessor, {
17826
18228
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint],
17827
18229
  worksheetTypes: [
@@ -17841,7 +18243,7 @@ function FitContentMenuItemFactory(accessor) {
17841
18243
  id: _univerjs_sheets.SetWorksheetRowIsAutoHeightCommand.id,
17842
18244
  type: _univerjs_ui.MenuItemType.BUTTON,
17843
18245
  icon: "AutoHeightDoubleIcon",
17844
- title: "rightClick.fitContent",
18246
+ title: "sheets-ui.rightClick.fitContent",
17845
18247
  disabled$: getCurrentRangeDisable$(accessor, {
17846
18248
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
17847
18249
  worksheetTypes: [_univerjs_sheets.WorksheetSetRowStylePermission, _univerjs_sheets.WorksheetEditPermission],
@@ -17855,7 +18257,7 @@ function ColAutoWidthMenuItemFactory(accessor) {
17855
18257
  id: SetWorksheetColAutoWidthCommand.id,
17856
18258
  type: _univerjs_ui.MenuItemType.BUTTON,
17857
18259
  icon: "AutoWidthDoubleIcon",
17858
- title: "rightClick.fitContent",
18260
+ title: "sheets-ui.rightClick.fitContent",
17859
18261
  disabled$: getCurrentRangeDisable$(accessor, {
17860
18262
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
17861
18263
  worksheetTypes: [_univerjs_sheets.WorksheetSetRowStylePermission, _univerjs_sheets.WorksheetEditPermission],
@@ -17869,7 +18271,7 @@ function HideRowMenuItemFactory(accessor) {
17869
18271
  id: HideRowConfirmCommand.id,
17870
18272
  type: _univerjs_ui.MenuItemType.BUTTON,
17871
18273
  icon: "HideDoubleIcon",
17872
- title: "rightClick.hideSelectedRow",
18274
+ title: "sheets-ui.rightClick.hideSelectedRow",
17873
18275
  disabled$: getCurrentRangeDisable$(accessor, {
17874
18276
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
17875
18277
  worksheetTypes: [_univerjs_sheets.WorksheetSetRowStylePermission, _univerjs_sheets.WorksheetEditPermission],
@@ -17883,7 +18285,7 @@ function HideColMenuItemFactory(accessor) {
17883
18285
  id: HideColConfirmCommand.id,
17884
18286
  type: _univerjs_ui.MenuItemType.BUTTON,
17885
18287
  icon: "HideDoubleIcon",
17886
- title: "rightClick.hideSelectedColumn",
18288
+ title: "sheets-ui.rightClick.hideSelectedColumn",
17887
18289
  disabled$: getCurrentRangeDisable$(accessor, {
17888
18290
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
17889
18291
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetColumnStylePermission],
@@ -17905,7 +18307,7 @@ function ShowRowMenuItemFactory(accessor) {
17905
18307
  id: _univerjs_sheets.SetSelectedRowsVisibleCommand.id,
17906
18308
  type: _univerjs_ui.MenuItemType.BUTTON,
17907
18309
  icon: "EyeOutlineIcon",
17908
- title: "rightClick.showHideRow",
18310
+ title: "sheets-ui.rightClick.showHideRow",
17909
18311
  hidden$: deriveStateFromActiveSheet$(univerInstanceService, true, ({ worksheet }) => new rxjs.Observable((subscriber) => {
17910
18312
  function hasHiddenRowsInSelections() {
17911
18313
  var _selectionManagerServ18;
@@ -17941,7 +18343,7 @@ function ShowColMenuItemFactory(accessor) {
17941
18343
  id: _univerjs_sheets.SetSelectedColsVisibleCommand.id,
17942
18344
  type: _univerjs_ui.MenuItemType.BUTTON,
17943
18345
  icon: "EyeOutlineIcon",
17944
- title: "rightClick.showHideColumn",
18346
+ title: "sheets-ui.rightClick.showHideColumn",
17945
18347
  hidden$: deriveStateFromActiveSheet$(univerInstanceService, true, ({ worksheet }) => new rxjs.Observable((subscriber) => {
17946
18348
  function hasHiddenColsInSelections() {
17947
18349
  var _selectionManagerServ19;
@@ -17977,7 +18379,7 @@ function SetRowHeightMenuItemFactory(accessor) {
17977
18379
  label: {
17978
18380
  name: MENU_ITEM_INPUT_COMPONENT,
17979
18381
  props: {
17980
- prefix: "rightClick.rowHeight",
18382
+ prefix: "sheets-ui.rightClick.rowHeight",
17981
18383
  suffix: "px",
17982
18384
  min,
17983
18385
  max: 1e3
@@ -18016,7 +18418,7 @@ function SetColWidthMenuItemFactory(accessor) {
18016
18418
  label: {
18017
18419
  name: MENU_ITEM_INPUT_COMPONENT,
18018
18420
  props: {
18019
- prefix: "rightClick.columnWidth",
18421
+ prefix: "sheets-ui.rightClick.columnWidth",
18020
18422
  suffix: "px",
18021
18423
  min,
18022
18424
  max: 1e3
@@ -18060,7 +18462,7 @@ function CellMergeMenuItemFactory(accessor) {
18060
18462
  return {
18061
18463
  id: _univerjs_sheets.AddWorksheetMergeCommand.id,
18062
18464
  icon: "MergeAllIcon",
18063
- tooltip: "toolbar.mergeCell.main",
18465
+ tooltip: "sheets-ui.toolbar.mergeCell.main",
18064
18466
  type: _univerjs_ui.MenuItemType.SUBITEMS,
18065
18467
  hidden$: (0, rxjs.combineLatest)([(0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET), accessor.get(_univerjs_core.IContextService).subscribeContextValue$(_univerjs_core.FOCUSING_COMMON_DRAWINGS).pipe((0, rxjs.startWith)(false))]).pipe((0, rxjs.map)(([hidden, focusingDrawing]) => hidden || focusingDrawing)),
18066
18468
  disabled$: editDisabled$.pipe((0, rxjs.combineLatestWith)(selectionsHasCross$), (0, rxjs.map)(([disable, hasCross]) => disable || hasCross))
@@ -18070,7 +18472,7 @@ function CellMergeAllMenuItemFactory(accessor) {
18070
18472
  return {
18071
18473
  id: _univerjs_sheets.AddWorksheetMergeAllCommand.id,
18072
18474
  type: _univerjs_ui.MenuItemType.BUTTON,
18073
- title: "merge.all",
18475
+ title: "sheets-ui.merge.all",
18074
18476
  icon: "MergeAllIcon",
18075
18477
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18076
18478
  };
@@ -18079,7 +18481,7 @@ function CellMergeVerticalMenuItemFactory(accessor) {
18079
18481
  return {
18080
18482
  id: _univerjs_sheets.AddWorksheetMergeVerticalCommand.id,
18081
18483
  type: _univerjs_ui.MenuItemType.BUTTON,
18082
- title: "merge.vertical",
18484
+ title: "sheets-ui.merge.vertical",
18083
18485
  icon: "VerticalIntegrationIcon",
18084
18486
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18085
18487
  };
@@ -18088,7 +18490,7 @@ function CellMergeHorizontalMenuItemFactory(accessor) {
18088
18490
  return {
18089
18491
  id: _univerjs_sheets.AddWorksheetMergeHorizontalCommand.id,
18090
18492
  type: _univerjs_ui.MenuItemType.BUTTON,
18091
- title: "merge.horizontal",
18493
+ title: "sheets-ui.merge.horizontal",
18092
18494
  icon: "HorizontalMergeIcon",
18093
18495
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18094
18496
  };
@@ -18097,7 +18499,7 @@ function CellMergeCancelMenuItemFactory(accessor) {
18097
18499
  return {
18098
18500
  id: _univerjs_sheets.RemoveWorksheetMergeCommand.id,
18099
18501
  type: _univerjs_ui.MenuItemType.BUTTON,
18100
- title: "merge.cancel",
18502
+ title: "sheets-ui.merge.cancel",
18101
18503
  icon: "CancelMergeIcon",
18102
18504
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18103
18505
  };
@@ -18386,7 +18788,7 @@ function sheetPermissionToolbarMenuFactory(accessor) {
18386
18788
  id: AddRangeProtectionFromToolbarCommand.id,
18387
18789
  type: _univerjs_ui.MenuItemType.BUTTON,
18388
18790
  icon: permissionMenuIconKey,
18389
- tooltip: "permission.toolbarMenu",
18791
+ tooltip: "sheets-ui.permission.toolbarMenu",
18390
18792
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET),
18391
18793
  disabled$: getAddPermissionDisableBase$(accessor)
18392
18794
  };
@@ -18395,7 +18797,7 @@ function sheetPermissionContextMenuFactory(accessor) {
18395
18797
  return {
18396
18798
  id: SHEET_PERMISSION_CONTEXT_MENU_ID,
18397
18799
  type: _univerjs_ui.MenuItemType.SUBITEMS,
18398
- title: "rightClick.protectRange",
18800
+ title: "sheets-ui.rightClick.protectRange",
18399
18801
  icon: permissionLockIconKey,
18400
18802
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18401
18803
  };
@@ -18404,7 +18806,7 @@ function sheetPermissionAddProtectContextMenuFactory(accessor) {
18404
18806
  return {
18405
18807
  id: AddRangeProtectionFromContextMenuCommand.id,
18406
18808
  type: _univerjs_ui.MenuItemType.BUTTON,
18407
- title: "rightClick.turnOnProtectRange",
18809
+ title: "sheets-ui.rightClick.turnOnProtectRange",
18408
18810
  hidden$: getAddPermissionHidden$(accessor),
18409
18811
  disabled$: getAddPermissionDisableBase$(accessor)
18410
18812
  };
@@ -18413,7 +18815,7 @@ function sheetPermissionEditProtectContextMenuFactory(accessor) {
18413
18815
  return {
18414
18816
  id: SetRangeProtectionFromContextMenuCommand.id,
18415
18817
  type: _univerjs_ui.MenuItemType.BUTTON,
18416
- title: "rightClick.editProtectRange",
18818
+ title: "sheets-ui.rightClick.editProtectRange",
18417
18819
  disabled$: getPermissionDisableBase$(accessor),
18418
18820
  hidden$: getEditPermissionHidden$(accessor)
18419
18821
  };
@@ -18422,7 +18824,7 @@ function sheetPermissionRemoveProtectContextMenuFactory(accessor) {
18422
18824
  return {
18423
18825
  id: DeleteRangeProtectionFromContextMenuCommand.id,
18424
18826
  type: _univerjs_ui.MenuItemType.BUTTON,
18425
- title: "rightClick.removeProtectRange",
18827
+ title: "sheets-ui.rightClick.removeProtectRange",
18426
18828
  disabled$: getRemovePermissionDisable$(accessor),
18427
18829
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18428
18830
  };
@@ -18431,7 +18833,7 @@ function sheetPermissionViewAllProtectRuleContextMenuFactory(accessor) {
18431
18833
  return {
18432
18834
  id: ViewSheetPermissionFromContextMenuCommand.id,
18433
18835
  type: _univerjs_ui.MenuItemType.BUTTON,
18434
- title: "rightClick.viewAllProtectArea",
18836
+ title: "sheets-ui.rightClick.viewAllProtectArea",
18435
18837
  disabled$: getViewPermissionDisable$(accessor),
18436
18838
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18437
18839
  };
@@ -18440,7 +18842,7 @@ function sheetPermissionProtectSheetInSheetBarMenuFactory(accessor) {
18440
18842
  return {
18441
18843
  id: AddRangeProtectionFromSheetBarCommand.id,
18442
18844
  type: _univerjs_ui.MenuItemType.BUTTON,
18443
- title: "sheetConfig.addProtectSheet",
18845
+ title: "sheets-ui.sheetConfig.addProtectSheet",
18444
18846
  disabled$: getAddPermissionFromSheetBarDisable$(accessor),
18445
18847
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18446
18848
  };
@@ -18449,7 +18851,7 @@ function sheetPermissionRemoveProtectionSheetBarMenuFactory(accessor) {
18449
18851
  return {
18450
18852
  id: DeleteWorksheetProtectionFormSheetBarCommand.id,
18451
18853
  type: _univerjs_ui.MenuItemType.BUTTON,
18452
- title: "sheetConfig.removeProtectSheet",
18854
+ title: "sheets-ui.sheetConfig.removeProtectSheet",
18453
18855
  disabled$: getRemovePermissionFromSheetBarDisable$(accessor),
18454
18856
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18455
18857
  };
@@ -18458,7 +18860,7 @@ function sheetPermissionChangeSheetPermissionSheetBarMenuFactory(accessor) {
18458
18860
  return {
18459
18861
  id: ChangeSheetProtectionFromSheetBarCommand.id,
18460
18862
  type: _univerjs_ui.MenuItemType.BUTTON,
18461
- title: "sheetConfig.changeSheetPermission",
18863
+ title: "sheets-ui.sheetConfig.changeSheetPermission",
18462
18864
  disabled$: getSetPermissionFromSheetBarDisable$(accessor),
18463
18865
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18464
18866
  };
@@ -18467,7 +18869,7 @@ function sheetPermissionViewAllProtectRuleSheetBarMenuFactory(accessor) {
18467
18869
  return {
18468
18870
  id: ViewSheetPermissionFromSheetBarCommand.id,
18469
18871
  type: _univerjs_ui.MenuItemType.BUTTON,
18470
- title: "sheetConfig.viewAllProtectArea",
18872
+ title: "sheets-ui.sheetConfig.viewAllProtectArea",
18471
18873
  disabled$: getViewPermissionDisable$(accessor),
18472
18874
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18473
18875
  };
@@ -18490,7 +18892,7 @@ function DeleteSheetMenuItemFactory(accessor) {
18490
18892
  return {
18491
18893
  id: RemoveSheetConfirmCommand.id,
18492
18894
  type: _univerjs_ui.MenuItemType.BUTTON,
18493
- title: "sheetConfig.delete",
18895
+ title: "sheets-ui.sheetConfig.delete",
18494
18896
  disabled$: (0, rxjs.combineLatest)([defaultDisable$, permissionDisable$]).pipe((0, rxjs.map)(([defaultDisabled, permissionDisabled]) => {
18495
18897
  return defaultDisabled || permissionDisabled;
18496
18898
  })),
@@ -18501,7 +18903,7 @@ function CopySheetMenuItemFactory(accessor) {
18501
18903
  return {
18502
18904
  id: _univerjs_sheets.CopySheetCommand.id,
18503
18905
  type: _univerjs_ui.MenuItemType.BUTTON,
18504
- title: "sheetConfig.copy",
18906
+ title: "sheets-ui.sheetConfig.copy",
18505
18907
  disabled$: getWorkbookPermissionDisable$(accessor, [_univerjs_sheets.WorkbookEditablePermission, _univerjs_sheets.WorkbookCreateSheetPermission]),
18506
18908
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18507
18909
  };
@@ -18510,7 +18912,7 @@ function RenameSheetMenuItemFactory(accessor) {
18510
18912
  return {
18511
18913
  id: RenameSheetOperation.id,
18512
18914
  type: _univerjs_ui.MenuItemType.BUTTON,
18513
- title: "sheetConfig.rename",
18915
+ title: "sheets-ui.sheetConfig.rename",
18514
18916
  disabled$: getWorkbookPermissionDisable$(accessor, [_univerjs_sheets.WorkbookEditablePermission, _univerjs_sheets.WorkbookRenameSheetPermission]),
18515
18917
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
18516
18918
  };
@@ -18518,7 +18920,7 @@ function RenameSheetMenuItemFactory(accessor) {
18518
18920
  function ChangeColorSheetMenuItemFactory(accessor) {
18519
18921
  return {
18520
18922
  id: _univerjs_sheets.SetTabColorCommand.id,
18521
- title: "sheetConfig.changeColor",
18923
+ title: "sheets-ui.sheetConfig.changeColor",
18522
18924
  type: _univerjs_ui.MenuItemType.SELECTOR,
18523
18925
  selections: [{ label: {
18524
18926
  name: _univerjs_ui.COLOR_PICKER_COMPONENT,
@@ -18534,7 +18936,7 @@ function HideSheetMenuItemFactory(accessor) {
18534
18936
  return {
18535
18937
  id: _univerjs_sheets.SetWorksheetHideCommand.id,
18536
18938
  type: _univerjs_ui.MenuItemType.BUTTON,
18537
- title: "sheetConfig.hide",
18939
+ title: "sheets-ui.sheetConfig.hide",
18538
18940
  disabled$: new rxjs.Observable((subscriber) => {
18539
18941
  const disposable = commandService.onCommandExecuted((c) => {
18540
18942
  const id = c.id;
@@ -18552,10 +18954,10 @@ function ShowMenuItemFactory(accessor) {
18552
18954
  return {
18553
18955
  id: ShowMenuListCommand.id,
18554
18956
  type: _univerjs_ui.MenuItemType.BUTTON,
18555
- title: "sheetConfig.unhide",
18957
+ title: "sheets-ui.sheetConfig.unhide",
18556
18958
  disabled$: new rxjs.Observable((subscriber) => {
18557
18959
  function disableFunction() {
18558
- const worksheets = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getWorksheets();
18960
+ const worksheets = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getWorksheets();
18559
18961
  const visibleSheets = Array.from(worksheets.values());
18560
18962
  subscriber.next(visibleSheets.length === 1);
18561
18963
  }
@@ -18570,7 +18972,7 @@ function ShowMenuItemFactory(accessor) {
18570
18972
  };
18571
18973
  }
18572
18974
  function disableFunction(univerInstanceService, subscriber) {
18573
- const worksheets = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getWorksheets();
18975
+ const worksheets = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getWorksheets();
18574
18976
  const visibleSheets = Array.from(worksheets.values()).filter((sheet) => sheet.getConfig().hidden === _univerjs_core.BooleanNumber.FALSE);
18575
18977
  subscriber.next(visibleSheets.length === 1);
18576
18978
  }
@@ -18609,7 +19011,7 @@ function Text2NumberToolbarMenuItemFactory(accessor) {
18609
19011
  id: TEXT_TO_NUMBER_TOOLBAR_MENU_ID,
18610
19012
  commandId: _univerjs_sheets.TextToNumberCommand.id,
18611
19013
  type: _univerjs_ui.MenuItemType.BUTTON,
18612
- title: "toolbar.textToNumber",
19014
+ title: "sheets-ui.toolbar.textToNumber",
18613
19015
  disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
18614
19016
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
18615
19017
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellValuePermission],
@@ -18624,7 +19026,7 @@ function Text2NumberContextMenuItemFactory(accessor) {
18624
19026
  id: TEXT_TO_NUMBER_CONTEXT_MENU_ID,
18625
19027
  commandId: _univerjs_sheets.TextToNumberCommand.id,
18626
19028
  type: _univerjs_ui.MenuItemType.BUTTON,
18627
- title: "rightClick.textToNumber",
19029
+ title: "sheets-ui.rightClick.textToNumber",
18628
19030
  icon: "PipingIcon",
18629
19031
  disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
18630
19032
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
@@ -18646,7 +19048,7 @@ const menuSchema = {
18646
19048
  },
18647
19049
  [_univerjs_sheets.ClearSelectionAllCommand.id]: {
18648
19050
  order: 3,
18649
- menuItemFactory: ClearSelectionAllMenuItemFactory
19051
+ menuItemFactory: ClearSelectionAllToolbarMenuItemFactory
18650
19052
  }
18651
19053
  },
18652
19054
  [_univerjs_ui.RibbonStartGroup.FORMAT]: {
@@ -19399,7 +19801,7 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
19399
19801
  */
19400
19802
  attachPopupToObject(targetObject, popup) {
19401
19803
  var _this$_renderManagerS;
19402
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19804
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19403
19805
  const worksheet = workbook.getActiveSheet();
19404
19806
  if (!worksheet || this._isSelectionMoving && !popup.showOnSelectionMoving) return {
19405
19807
  dispose: () => {},
@@ -19449,7 +19851,7 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
19449
19851
  }
19450
19852
  attachPopupByPosition(bound, popup, location) {
19451
19853
  var _this$_renderManagerS2;
19452
- let workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19854
+ let workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19453
19855
  let worksheet = workbook.getActiveSheet();
19454
19856
  if (!worksheet) return null;
19455
19857
  const unitId = workbook.getUnitId();
@@ -19490,7 +19892,7 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
19490
19892
  }
19491
19893
  attachPopupToAbsolutePosition(bound, popup, _unitId, _subUnitId) {
19492
19894
  var _this$_renderManagerS3;
19493
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19895
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19494
19896
  const worksheet = workbook.getActiveSheet();
19495
19897
  if (!worksheet) return null;
19496
19898
  const unitId = workbook.getUnitId();
@@ -19595,7 +19997,7 @@ let SheetCanvasPopManagerService = class SheetCanvasPopManagerService extends _u
19595
19997
  * @param showOnSelectionMoving
19596
19998
  */
19597
19999
  attachRangePopup(range, popup, _unitId, _subUnitId, viewport, showOnSelectionMoving = false) {
19598
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
20000
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19599
20001
  const worksheet = workbook.getActiveSheet();
19600
20002
  if (!worksheet) return null;
19601
20003
  const unitId = workbook.getUnitId();
@@ -19942,7 +20344,7 @@ const CellPopup = (props) => {
19942
20344
  const DefinedNameInput = (props) => {
19943
20345
  const { inputId, state = false, type = "range", confirm, cancel, name, formulaOrRefString, comment = "", localSheetId = _univerjs_sheets.SCOPE_WORKBOOK_VALUE_DEFINED_NAME, hidden = false, id } = props;
19944
20346
  const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
19945
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
20347
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
19946
20348
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
19947
20349
  const definedNamesService = (0, _univerjs_ui.useDependency)(_univerjs_engine_formula.IDefinedNamesService);
19948
20350
  const superTableService = (0, _univerjs_ui.useDependency)(_univerjs_engine_formula.ISuperTableService);
@@ -19962,7 +20364,7 @@ const DefinedNameInput = (props) => {
19962
20364
  const [typeValue, setTypeValue] = (0, react.useState)(type);
19963
20365
  const [validFormulaOrRange, setValidFormulaOrRange] = (0, react.useState)(true);
19964
20366
  const options = [{
19965
- label: localeService.t("definedName.scopeWorkbook"),
20367
+ label: localeService.t("sheets-ui.definedName.scopeWorkbook"),
19966
20368
  value: _univerjs_sheets.SCOPE_WORKBOOK_VALUE_DEFINED_NAME
19967
20369
  }];
19968
20370
  const isFormula = (token) => {
@@ -20010,7 +20412,7 @@ const DefinedNameInput = (props) => {
20010
20412
  return;
20011
20413
  }
20012
20414
  if (!validFormulaOrRange) {
20013
- setValidString(localeService.t("definedName.formulaOrRefStringInvalid"));
20415
+ setValidString(localeService.t("sheets-ui.definedName.formulaOrRefStringInvalid"));
20014
20416
  return;
20015
20417
  }
20016
20418
  const currentSheetName = workbook.getActiveSheet().getName();
@@ -20041,7 +20443,7 @@ const DefinedNameInput = (props) => {
20041
20443
  children: [
20042
20444
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
20043
20445
  className: "univer-w-full",
20044
- placeholder: localeService.t("definedName.inputNamePlaceholder"),
20446
+ placeholder: localeService.t("sheets-ui.definedName.inputNamePlaceholder"),
20045
20447
  value: nameValue,
20046
20448
  allowClear: true,
20047
20449
  onChange: setNameValue
@@ -20051,10 +20453,10 @@ const DefinedNameInput = (props) => {
20051
20453
  onChange: typeValueChange,
20052
20454
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Radio, {
20053
20455
  value: "range",
20054
- children: localeService.t("definedName.ratioRange")
20456
+ children: localeService.t("sheets-ui.definedName.ratioRange")
20055
20457
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Radio, {
20056
20458
  value: "formula",
20057
- children: localeService.t("definedName.ratioFormula")
20459
+ children: localeService.t("sheets-ui.definedName.ratioFormula")
20058
20460
  })]
20059
20461
  }) }),
20060
20462
  typeValue === "range" ? RangeSelector && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeSelector, {
@@ -20093,7 +20495,7 @@ const DefinedNameInput = (props) => {
20093
20495
  }) }),
20094
20496
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
20095
20497
  className: "univer-w-full",
20096
- placeholder: localeService.t("definedName.inputCommentPlaceholder"),
20498
+ placeholder: localeService.t("sheets-ui.definedName.inputCommentPlaceholder"),
20097
20499
  value: commentValue,
20098
20500
  onChange: setCommentValue,
20099
20501
  allowClear: true
@@ -20111,11 +20513,11 @@ const DefinedNameInput = (props) => {
20111
20513
  onClick: () => {
20112
20514
  cancel === null || cancel === void 0 || cancel();
20113
20515
  },
20114
- children: localeService.t("definedName.cancel")
20516
+ children: localeService.t("sheets-ui.definedName.cancel")
20115
20517
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
20116
20518
  variant: "primary",
20117
20519
  onClick: confirmChange,
20118
- children: localeService.t("definedName.confirm")
20520
+ children: localeService.t("sheets-ui.definedName.confirm")
20119
20521
  })]
20120
20522
  })
20121
20523
  ]
@@ -20234,11 +20636,11 @@ const DefinedNameContainer = () => {
20234
20636
  };
20235
20637
  const getInsertDefinedName = () => {
20236
20638
  const count = definedNames.length + 1;
20237
- const name = localeService.t("definedName.defaultName") + count;
20639
+ const name = localeService.t("sheets-ui.definedName.defaultName") + count;
20238
20640
  if (definedNamesService.getValueByName(unitId, name) == null) return name;
20239
20641
  let i = count + 1;
20240
20642
  while (true) {
20241
- const newName = localeService.t("definedName.defaultName") + i;
20643
+ const newName = localeService.t("sheets-ui.definedName.defaultName") + i;
20242
20644
  if (definedNamesService.getValueByName(unitId, newName) == null) return newName;
20243
20645
  i++;
20244
20646
  }
@@ -20281,7 +20683,7 @@ const DefinedNameContainer = () => {
20281
20683
  onClick: openInsertCloseKeyEditor,
20282
20684
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.IncreaseIcon, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
20283
20685
  className: "univer-ml-1",
20284
- children: localeService.t("definedName.addButton")
20686
+ children: localeService.t("sheets-ui.definedName.addButton")
20285
20687
  })]
20286
20688
  }), editState && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefinedNameInput, {
20287
20689
  confirm: insertConfirm,
@@ -20322,7 +20724,7 @@ const DefinedNameContainer = () => {
20322
20724
  }), checkDefinedNamePermission(definedName) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
20323
20725
  className: "univer-absolute univer-right-5 univer-top-1/2 univer-hidden -univer-translate-y-1/2 univer-cursor-pointer univer-items-center univer-justify-end univer-gap-7 univer-text-xs univer-text-primary-600 group-hover:univer-flex dark:hover:!univer-bg-gray-600",
20324
20726
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
20325
- title: localeService.t("definedName.updateButton"),
20727
+ title: localeService.t("sheets-ui.definedName.updateButton"),
20326
20728
  placement: "top",
20327
20729
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
20328
20730
  className: "univer-rounded univer-p-1 hover:univer-bg-gray-100",
@@ -20333,7 +20735,7 @@ const DefinedNameContainer = () => {
20333
20735
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.PenIcon, {})
20334
20736
  })
20335
20737
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
20336
- title: localeService.t("definedName.deleteButton"),
20738
+ title: localeService.t("sheets-ui.definedName.deleteButton"),
20337
20739
  placement: "top",
20338
20740
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
20339
20741
  className: "univer-rounded univer-p-1 univer-text-red-600 hover:univer-bg-gray-100",
@@ -20352,7 +20754,7 @@ const DefinedNameContainer = () => {
20352
20754
  onConfirm: () => {
20353
20755
  handleDeleteConfirm(definedName.id);
20354
20756
  },
20355
- children: localeService.t("definedName.deleteConfirmText")
20757
+ children: localeService.t("sheets-ui.definedName.deleteConfirmText")
20356
20758
  }),
20357
20759
  definedName.id === editorKey && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefinedNameInput, {
20358
20760
  confirm: insertConfirm,
@@ -20736,7 +21138,7 @@ function DefinedNameOverlay({ search, isInputEvent }) {
20736
21138
  const definedNamesService = (0, _univerjs_ui.useDependency)(_univerjs_engine_formula.IDefinedNamesService);
20737
21139
  const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
20738
21140
  const sidebarService = (0, _univerjs_ui.useDependency)(_univerjs_ui.ISidebarService);
20739
- const unitId = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId();
21141
+ const unitId = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getUnitId();
20740
21142
  const getDefinedNameMap = () => {
20741
21143
  const definedNameMap = definedNamesService.getDefinedNameMap(unitId);
20742
21144
  if (definedNameMap) return Array.from(Object.values(definedNameMap));
@@ -20823,10 +21225,10 @@ function DefinedNameOverlay({ search, isInputEvent }) {
20823
21225
  onClick: openSlider,
20824
21226
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
20825
21227
  className: "univer-mb-2 univer-text-sm univer-font-semibold univer-text-gray-600 dark:!univer-text-gray-200",
20826
- children: localeService.t("definedName.managerTitle")
21228
+ children: localeService.t("sheets-ui.definedName.managerTitle")
20827
21229
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
20828
21230
  className: "univer-text-xs univer-text-gray-400",
20829
- children: localeService.t("definedName.managerDescription")
21231
+ children: localeService.t("sheets-ui.definedName.managerDescription")
20830
21232
  })]
20831
21233
  })]
20832
21234
  });
@@ -22375,10 +22777,10 @@ function SheetBarTabs() {
22375
22777
  const openSheetNameErrorDialog = (0, react.useCallback)((id, description) => {
22376
22778
  confirmService.open({
22377
22779
  id,
22378
- title: { title: localeService.t("sheetConfig.sheetNameErrorTitle") },
22780
+ title: { title: localeService.t("sheets-ui.sheetConfig.sheetNameErrorTitle") },
22379
22781
  children: { title: description },
22380
- cancelText: localeService.t("button.cancel"),
22381
- confirmText: localeService.t("button.confirm"),
22782
+ cancelText: localeService.t("sheets-ui.button.cancel"),
22783
+ confirmText: localeService.t("sheets-ui.button.confirm"),
22382
22784
  onClose() {
22383
22785
  focusTabEditor();
22384
22786
  confirmService.close(id);
@@ -22395,12 +22797,12 @@ function SheetBarTabs() {
22395
22797
  ]);
22396
22798
  const nameEmptyCheck = (0, react.useCallback)((name) => {
22397
22799
  if (name.trim() !== "") return false;
22398
- openSheetNameErrorDialog("sheetNameEmptyAlert", localeService.t("sheetConfig.sheetNameCannotIsEmptyError"));
22800
+ openSheetNameErrorDialog("sheetNameEmptyAlert", localeService.t("sheets-ui.sheetConfig.sheetNameCannotIsEmptyError"));
22399
22801
  return true;
22400
22802
  }, [localeService, openSheetNameErrorDialog]);
22401
22803
  const sheetNameSpecCharCheck = (0, react.useCallback)((name) => {
22402
22804
  if ((0, _univerjs_core.nameCharacterCheck)(name)) return false;
22403
- openSheetNameErrorDialog("sheetNameSpecCharAlert", localeService.t("sheetConfig.sheetNameSpecCharError"));
22805
+ openSheetNameErrorDialog("sheetNameSpecCharAlert", localeService.t("sheets-ui.sheetConfig.sheetNameSpecCharError"));
22404
22806
  return true;
22405
22807
  }, [localeService, openSheetNameErrorDialog]);
22406
22808
  const nameRepeatCheck = (0, react.useCallback)((name) => {
@@ -22410,10 +22812,10 @@ function SheetBarTabs() {
22410
22812
  const id = "sheetNameRepeatAlert";
22411
22813
  confirmService.open({
22412
22814
  id,
22413
- title: { title: localeService.t("sheetConfig.sheetNameErrorTitle") },
22414
- children: { title: localeService.t("sheetConfig.sheetNameAlreadyExistsError") },
22415
- cancelText: localeService.t("button.cancel"),
22416
- confirmText: localeService.t("button.confirm"),
22815
+ title: { title: localeService.t("sheets-ui.sheetConfig.sheetNameErrorTitle") },
22816
+ children: { title: localeService.t("sheets-ui.sheetConfig.sheetNameAlreadyExistsError") },
22817
+ cancelText: localeService.t("sheets-ui.button.cancel"),
22818
+ confirmText: localeService.t("sheets-ui.button.confirm"),
22417
22819
  onClose() {
22418
22820
  confirmService.close(id);
22419
22821
  focusTabEditor();
@@ -22834,7 +23236,7 @@ function ZoomSlider() {
22834
23236
  }, [commandService, getCurrentZoom]);
22835
23237
  function handleChange(value) {
22836
23238
  setZoom(value);
22837
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
23239
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
22838
23240
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
22839
23241
  if (worksheet == null) return;
22840
23242
  const zoomRatio = value / 100;
@@ -22965,12 +23367,12 @@ const allowPatternFunctions = [
22965
23367
  _univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.MAX
22966
23368
  ];
22967
23369
  const functionDisplayNames = {
22968
- [_univerjs_engine_formula.FUNCTION_NAMES_MATH.SUM]: "statusbar.sum",
22969
- [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.AVERAGE]: "statusbar.average",
22970
- [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.MIN]: "statusbar.min",
22971
- [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.MAX]: "statusbar.max",
22972
- [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.COUNT]: "statusbar.count",
22973
- [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.COUNTA]: "statusbar.countA",
23370
+ [_univerjs_engine_formula.FUNCTION_NAMES_MATH.SUM]: "sheets-ui.statusbar.sum",
23371
+ [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.AVERAGE]: "sheets-ui.statusbar.average",
23372
+ [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.MIN]: "sheets-ui.statusbar.min",
23373
+ [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.MAX]: "sheets-ui.statusbar.max",
23374
+ [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.COUNT]: "sheets-ui.statusbar.count",
23375
+ [_univerjs_engine_formula.FUNCTION_NAMES_STATISTICAL.COUNTA]: "sheets-ui.statusbar.countA",
22974
23376
  [_univerjs_engine_formula.FUNCTION_NAMES_TEXT.CONCATENATE]: "concatenate"
22975
23377
  };
22976
23378
  const CopyableStatisticItem = (item) => {
@@ -22982,11 +23384,11 @@ const CopyableStatisticItem = (item) => {
22982
23384
  await clipboardService.writeText(item.value.toString());
22983
23385
  messageService.show({
22984
23386
  type: _univerjs_design.MessageType.Success,
22985
- content: localeService.t("statusbar.copied")
23387
+ content: localeService.t("sheets-ui.statusbar.copied")
22986
23388
  });
22987
23389
  };
22988
23390
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
22989
- title: localeService.t("statusbar.clickToCopy"),
23391
+ title: localeService.t("sheets-ui.statusbar.clickToCopy"),
22990
23392
  placement: "top",
22991
23393
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
22992
23394
  className: "univer-flex univer-cursor-pointer univer-truncate univer-text-center univer-text-xs univer-text-gray-400",
@@ -23190,7 +23592,7 @@ const SetColHiddenShortcutItem = {
23190
23592
  //#region src/controllers/shortcuts/selection.shortcut.ts
23191
23593
  const MoveSelectionDownShortcutItem = {
23192
23594
  id: MoveSelectionCommand.id,
23193
- description: "shortcut.sheet.select-below-cell",
23595
+ description: "sheets-ui.shortcut.sheet.select-below-cell",
23194
23596
  group: "3_sheet-view",
23195
23597
  binding: _univerjs_ui.KeyCode.ARROW_DOWN,
23196
23598
  priority: 100,
@@ -23199,7 +23601,7 @@ const MoveSelectionDownShortcutItem = {
23199
23601
  };
23200
23602
  const MoveSelectionUpShortcutItem = {
23201
23603
  id: MoveSelectionCommand.id,
23202
- description: "shortcut.sheet.select-up-cell",
23604
+ description: "sheets-ui.shortcut.sheet.select-up-cell",
23203
23605
  group: "3_sheet-view",
23204
23606
  binding: _univerjs_ui.KeyCode.ARROW_UP,
23205
23607
  priority: 100,
@@ -23208,7 +23610,7 @@ const MoveSelectionUpShortcutItem = {
23208
23610
  };
23209
23611
  const MoveSelectionLeftShortcutItem = {
23210
23612
  id: MoveSelectionCommand.id,
23211
- description: "shortcut.sheet.select-left-cell",
23613
+ description: "sheets-ui.shortcut.sheet.select-left-cell",
23212
23614
  group: "3_sheet-view",
23213
23615
  binding: _univerjs_ui.KeyCode.ARROW_LEFT,
23214
23616
  priority: 100,
@@ -23217,7 +23619,7 @@ const MoveSelectionLeftShortcutItem = {
23217
23619
  };
23218
23620
  const MoveSelectionRightShortcutItem = {
23219
23621
  id: MoveSelectionCommand.id,
23220
- description: "shortcut.sheet.select-right-cell",
23622
+ description: "sheets-ui.shortcut.sheet.select-right-cell",
23221
23623
  group: "3_sheet-view",
23222
23624
  binding: _univerjs_ui.KeyCode.ARROW_RIGHT,
23223
23625
  priority: 100,
@@ -23226,7 +23628,7 @@ const MoveSelectionRightShortcutItem = {
23226
23628
  };
23227
23629
  const MoveSelectionTabShortcutItem = {
23228
23630
  id: MoveSelectionEnterAndTabCommand.id,
23229
- description: "shortcut.sheet.select-next-cell",
23631
+ description: "sheets-ui.shortcut.sheet.select-next-cell",
23230
23632
  group: "3_sheet-view",
23231
23633
  binding: _univerjs_ui.KeyCode.TAB,
23232
23634
  priority: 100,
@@ -23238,7 +23640,7 @@ const MoveSelectionTabShortcutItem = {
23238
23640
  };
23239
23641
  const MoveSelectionTabLeftShortcutItem = {
23240
23642
  id: MoveSelectionEnterAndTabCommand.id,
23241
- description: "shortcut.sheet.select-previous-cell",
23643
+ description: "sheets-ui.shortcut.sheet.select-previous-cell",
23242
23644
  group: "3_sheet-view",
23243
23645
  binding: _univerjs_ui.KeyCode.TAB | _univerjs_ui.MetaKeys.SHIFT,
23244
23646
  priority: 100,
@@ -23250,7 +23652,7 @@ const MoveSelectionTabLeftShortcutItem = {
23250
23652
  };
23251
23653
  const MoveSelectionEnterShortcutItem = {
23252
23654
  id: MoveSelectionEnterAndTabCommand.id,
23253
- description: "shortcut.sheet.select-below-cell",
23655
+ description: "sheets-ui.shortcut.sheet.select-below-cell",
23254
23656
  group: "3_sheet-view",
23255
23657
  binding: _univerjs_ui.KeyCode.ENTER,
23256
23658
  priority: 100,
@@ -23262,7 +23664,7 @@ const MoveSelectionEnterShortcutItem = {
23262
23664
  };
23263
23665
  const MoveSelectionEnterUpShortcutItem = {
23264
23666
  id: MoveSelectionEnterAndTabCommand.id,
23265
- description: "shortcut.sheet.select-up-cell",
23667
+ description: "sheets-ui.shortcut.sheet.select-up-cell",
23266
23668
  group: "3_sheet-view",
23267
23669
  binding: _univerjs_ui.KeyCode.ENTER | _univerjs_ui.MetaKeys.SHIFT,
23268
23670
  priority: 100,
@@ -23274,7 +23676,7 @@ const MoveSelectionEnterUpShortcutItem = {
23274
23676
  };
23275
23677
  const MoveSelectionEndDownShortcutItem = {
23276
23678
  id: MoveSelectionCommand.id,
23277
- description: "shortcut.sheet.select-below-value-cell",
23679
+ description: "sheets-ui.shortcut.sheet.select-below-value-cell",
23278
23680
  group: "3_sheet-view",
23279
23681
  binding: _univerjs_ui.KeyCode.ARROW_DOWN | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23280
23682
  preconditions: whenSheetEditorFocused,
@@ -23285,7 +23687,7 @@ const MoveSelectionEndDownShortcutItem = {
23285
23687
  };
23286
23688
  const MoveSelectionEndUpShortcutItem = {
23287
23689
  id: MoveSelectionCommand.id,
23288
- description: "shortcut.sheet.select-up-value-cell",
23690
+ description: "sheets-ui.shortcut.sheet.select-up-value-cell",
23289
23691
  group: "3_sheet-view",
23290
23692
  binding: _univerjs_ui.KeyCode.ARROW_UP | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23291
23693
  preconditions: whenSheetEditorFocused,
@@ -23296,7 +23698,7 @@ const MoveSelectionEndUpShortcutItem = {
23296
23698
  };
23297
23699
  const MoveSelectionEndLeftShortcutItem = {
23298
23700
  id: MoveSelectionCommand.id,
23299
- description: "shortcut.sheet.select-left-value-cell",
23701
+ description: "sheets-ui.shortcut.sheet.select-left-value-cell",
23300
23702
  group: "3_sheet-view",
23301
23703
  binding: _univerjs_ui.KeyCode.ARROW_LEFT | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23302
23704
  preconditions: whenSheetEditorFocused,
@@ -23307,7 +23709,7 @@ const MoveSelectionEndLeftShortcutItem = {
23307
23709
  };
23308
23710
  const MoveSelectionEndRightShortcutItem = {
23309
23711
  id: MoveSelectionCommand.id,
23310
- description: "shortcut.sheet.select-right-value-cell",
23712
+ description: "sheets-ui.shortcut.sheet.select-right-value-cell",
23311
23713
  group: "3_sheet-view",
23312
23714
  binding: _univerjs_ui.KeyCode.ARROW_RIGHT | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23313
23715
  preconditions: whenSheetEditorFocused,
@@ -23318,7 +23720,7 @@ const MoveSelectionEndRightShortcutItem = {
23318
23720
  };
23319
23721
  const ExpandSelectionDownShortcutItem = {
23320
23722
  id: ExpandSelectionCommand.id,
23321
- description: "shortcut.sheet.expand-selection-down",
23723
+ description: "sheets-ui.shortcut.sheet.expand-selection-down",
23322
23724
  group: "3_sheet-view",
23323
23725
  binding: _univerjs_ui.KeyCode.ARROW_DOWN | _univerjs_ui.MetaKeys.SHIFT,
23324
23726
  preconditions: whenSheetEditorFocused,
@@ -23326,7 +23728,7 @@ const ExpandSelectionDownShortcutItem = {
23326
23728
  };
23327
23729
  const ExpandSelectionUpShortcutItem = {
23328
23730
  id: ExpandSelectionCommand.id,
23329
- description: "shortcut.sheet.expand-selection-up",
23731
+ description: "sheets-ui.shortcut.sheet.expand-selection-up",
23330
23732
  group: "3_sheet-view",
23331
23733
  binding: _univerjs_ui.KeyCode.ARROW_UP | _univerjs_ui.MetaKeys.SHIFT,
23332
23734
  preconditions: whenSheetEditorFocused,
@@ -23334,7 +23736,7 @@ const ExpandSelectionUpShortcutItem = {
23334
23736
  };
23335
23737
  const ExpandSelectionLeftShortcutItem = {
23336
23738
  id: ExpandSelectionCommand.id,
23337
- description: "shortcut.sheet.expand-selection-left",
23739
+ description: "sheets-ui.shortcut.sheet.expand-selection-left",
23338
23740
  group: "3_sheet-view",
23339
23741
  binding: _univerjs_ui.KeyCode.ARROW_LEFT | _univerjs_ui.MetaKeys.SHIFT,
23340
23742
  preconditions: whenSheetEditorFocused,
@@ -23342,7 +23744,7 @@ const ExpandSelectionLeftShortcutItem = {
23342
23744
  };
23343
23745
  const ExpandSelectionRightShortcutItem = {
23344
23746
  id: ExpandSelectionCommand.id,
23345
- description: "shortcut.sheet.expand-selection-right",
23747
+ description: "sheets-ui.shortcut.sheet.expand-selection-right",
23346
23748
  group: "3_sheet-view",
23347
23749
  binding: _univerjs_ui.KeyCode.ARROW_RIGHT | _univerjs_ui.MetaKeys.SHIFT,
23348
23750
  preconditions: whenSheetEditorFocused,
@@ -23350,7 +23752,7 @@ const ExpandSelectionRightShortcutItem = {
23350
23752
  };
23351
23753
  const ExpandSelectionEndDownShortcutItem = {
23352
23754
  id: ExpandSelectionCommand.id,
23353
- description: "shortcut.sheet.expand-selection-to-below-gap",
23755
+ description: "sheets-ui.shortcut.sheet.expand-selection-to-below-gap",
23354
23756
  group: "3_sheet-view",
23355
23757
  binding: _univerjs_ui.KeyCode.ARROW_DOWN | _univerjs_ui.MetaKeys.SHIFT | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23356
23758
  preconditions: whenSheetEditorFocused,
@@ -23361,7 +23763,7 @@ const ExpandSelectionEndDownShortcutItem = {
23361
23763
  };
23362
23764
  const ExpandSelectionEndUpShortcutItem = {
23363
23765
  id: ExpandSelectionCommand.id,
23364
- description: "shortcut.sheet.expand-selection-to-up-gap",
23766
+ description: "sheets-ui.shortcut.sheet.expand-selection-to-up-gap",
23365
23767
  group: "3_sheet-view",
23366
23768
  binding: _univerjs_ui.KeyCode.ARROW_UP | _univerjs_ui.MetaKeys.SHIFT | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23367
23769
  preconditions: whenSheetEditorFocused,
@@ -23372,7 +23774,7 @@ const ExpandSelectionEndUpShortcutItem = {
23372
23774
  };
23373
23775
  const ExpandSelectionEndLeftShortcutItem = {
23374
23776
  id: ExpandSelectionCommand.id,
23375
- description: "shortcut.sheet.expand-selection-to-left-gap",
23777
+ description: "sheets-ui.shortcut.sheet.expand-selection-to-left-gap",
23376
23778
  group: "3_sheet-view",
23377
23779
  binding: _univerjs_ui.KeyCode.ARROW_LEFT | _univerjs_ui.MetaKeys.SHIFT | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23378
23780
  preconditions: whenSheetEditorFocused,
@@ -23383,7 +23785,7 @@ const ExpandSelectionEndLeftShortcutItem = {
23383
23785
  };
23384
23786
  const ExpandSelectionEndRightShortcutItem = {
23385
23787
  id: ExpandSelectionCommand.id,
23386
- description: "shortcut.sheet.expand-selection-to-right-gap",
23788
+ description: "sheets-ui.shortcut.sheet.expand-selection-to-right-gap",
23387
23789
  group: "3_sheet-view",
23388
23790
  binding: _univerjs_ui.KeyCode.ARROW_RIGHT | _univerjs_ui.MetaKeys.SHIFT | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23389
23791
  preconditions: whenSheetEditorFocused,
@@ -23394,7 +23796,7 @@ const ExpandSelectionEndRightShortcutItem = {
23394
23796
  };
23395
23797
  const SelectAllShortcutItem = {
23396
23798
  id: SelectAllCommand.id,
23397
- description: "shortcut.sheet.select-all",
23799
+ description: "sheets-ui.shortcut.sheet.select-all",
23398
23800
  group: "3_sheet-view",
23399
23801
  binding: _univerjs_ui.KeyCode.A | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23400
23802
  preconditions: whenSheetEditorFocused,
@@ -23408,28 +23810,28 @@ const SelectAllShortcutItem = {
23408
23810
  //#region src/controllers/shortcuts/style.shortcut.ts
23409
23811
  const SetBoldShortcutItem = {
23410
23812
  id: SetRangeBoldCommand.id,
23411
- description: "shortcut.sheet.set-bold",
23813
+ description: "sheets-ui.shortcut.sheet.set-bold",
23412
23814
  group: "4_sheet-edit",
23413
23815
  preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
23414
23816
  binding: _univerjs_ui.KeyCode.B | _univerjs_ui.MetaKeys.CTRL_COMMAND
23415
23817
  };
23416
23818
  const SetItalicShortcutItem = {
23417
23819
  id: SetRangeItalicCommand.id,
23418
- description: "shortcut.sheet.set-italic",
23820
+ description: "sheets-ui.shortcut.sheet.set-italic",
23419
23821
  group: "4_sheet-edit",
23420
23822
  preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
23421
23823
  binding: _univerjs_ui.KeyCode.I | _univerjs_ui.MetaKeys.CTRL_COMMAND
23422
23824
  };
23423
23825
  const SetUnderlineShortcutItem = {
23424
23826
  id: SetRangeUnderlineCommand.id,
23425
- description: "shortcut.sheet.set-underline",
23827
+ description: "sheets-ui.shortcut.sheet.set-underline",
23426
23828
  group: "4_sheet-edit",
23427
23829
  preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
23428
23830
  binding: _univerjs_ui.KeyCode.U | _univerjs_ui.MetaKeys.CTRL_COMMAND
23429
23831
  };
23430
23832
  const SetStrikeThroughShortcutItem = {
23431
23833
  id: SetRangeStrickThroughCommand.id,
23432
- description: "shortcut.sheet.set-strike-through",
23834
+ description: "sheets-ui.shortcut.sheet.set-strike-through",
23433
23835
  group: "4_sheet-edit",
23434
23836
  preconditions: (contextService) => whenSheetFocusedInlineFormat(contextService),
23435
23837
  binding: _univerjs_ui.KeyCode.X | _univerjs_ui.MetaKeys.SHIFT | _univerjs_ui.MetaKeys.CTRL_COMMAND
@@ -23463,7 +23865,7 @@ const ShiftDeleteSelectionValueShortcutItem = {
23463
23865
  //#region src/controllers/shortcuts/view.shortcut.ts
23464
23866
  const ZoomInShortcutItem = {
23465
23867
  id: ChangeZoomRatioCommand.id,
23466
- description: "shortcut.sheet.zoom-in",
23868
+ description: "sheets-ui.shortcut.sheet.zoom-in",
23467
23869
  binding: _univerjs_ui.KeyCode.EQUAL | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23468
23870
  group: "3_sheet-view",
23469
23871
  preconditions: whenSheetEditorFocused,
@@ -23476,7 +23878,7 @@ const PreventDefaultZoomInShortcutItem = {
23476
23878
  };
23477
23879
  const ZoomOutShortcutItem = {
23478
23880
  id: ChangeZoomRatioCommand.id,
23479
- description: "shortcut.sheet.zoom-out",
23881
+ description: "sheets-ui.shortcut.sheet.zoom-out",
23480
23882
  binding: _univerjs_ui.KeyCode.MINUS | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23481
23883
  group: "3_sheet-view",
23482
23884
  preconditions: whenSheetEditorFocused,
@@ -23489,7 +23891,7 @@ const PreventDefaultZoomOutShortcutItem = {
23489
23891
  };
23490
23892
  const ResetZoomShortcutItem = {
23491
23893
  id: ChangeZoomRatioCommand.id,
23492
- description: "shortcut.sheet.reset-zoom",
23894
+ description: "sheets-ui.shortcut.sheet.reset-zoom",
23493
23895
  binding: _univerjs_ui.KeyCode.Digit0 | _univerjs_ui.MetaKeys.CTRL_COMMAND,
23494
23896
  preconditions: whenSheetEditorFocused,
23495
23897
  group: "3_sheet-view",
@@ -23887,14 +24289,14 @@ let StatusBarController = class StatusBarController extends _univerjs_core.Dispo
23887
24289
  return rawCell;
23888
24290
  }
23889
24291
  _calculateSelection(selections, primary) {
23890
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
24292
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
23891
24293
  if (!workbook) return this._clearResult();
23892
24294
  const unitId = workbook.getUnitId();
23893
24295
  const sheet = workbook.getActiveSheet();
23894
24296
  const sheetId = sheet === null || sheet === void 0 ? void 0 : sheet.getSheetId();
23895
24297
  if (!sheetId) return this._clearResult();
23896
24298
  const sheetData = {};
23897
- this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getSheets().forEach((sheet) => {
24299
+ this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getSheets().forEach((sheet) => {
23898
24300
  const sheetConfig = sheet.getConfig();
23899
24301
  sheetData[sheet.getSheetId()] = {
23900
24302
  cellData: new _univerjs_core.ObjectMatrix(sheetConfig.cellData),
@@ -23990,7 +24392,7 @@ const useHighlightRange = (ranges = []) => {
23990
24392
  //#endregion
23991
24393
  //#region package.json
23992
24394
  var name = "@univerjs/sheets-ui";
23993
- var version = "0.23.0";
24395
+ var version = "0.24.0-insiders.20260527-b1d726f";
23994
24396
 
23995
24397
  //#endregion
23996
24398
  //#region src/services/cell-alert-manager.service.ts
@@ -24238,7 +24640,7 @@ let SheetsDefinedNameController = class SheetsDefinedNameController extends _uni
24238
24640
  _syncDefinedNameRange(params) {
24239
24641
  if (params.length === 0) return;
24240
24642
  const lastSelection = params[params.length - 1];
24241
- const workbook = this._instanceSrv.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
24643
+ const workbook = this._instanceSrv.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
24242
24644
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
24243
24645
  if (!worksheet) return;
24244
24646
  this._definedNamesService.setCurrentRange({
@@ -24537,8 +24939,8 @@ let ForceStringAlertRenderController = class ForceStringAlertRenderController ex
24537
24939
  }
24538
24940
  this._cellAlertManagerService.showAlert({
24539
24941
  type: 2,
24540
- title: this._localeService.t("info.error"),
24541
- message: this._localeService.t("info.forceStringInfo"),
24942
+ title: this._localeService.t("sheets-ui.info.error"),
24943
+ message: this._localeService.t("sheets-ui.info.forceStringInfo"),
24542
24944
  location,
24543
24945
  width: 200,
24544
24946
  height: 74,
@@ -24660,7 +25062,7 @@ let FormatPainterController = class FormatPainterController extends _univerjs_co
24660
25062
  const range = selection === null || selection === void 0 ? void 0 : selection.range;
24661
25063
  if (!range) return null;
24662
25064
  const { startRow, endRow, startColumn, endColumn } = range;
24663
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25065
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
24664
25066
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
24665
25067
  if (!worksheet) return null;
24666
25068
  const cellData = worksheet.getCellMatrix();
@@ -25418,7 +25820,7 @@ let SheetPermissionInterceptorCanvasRenderController = class SheetPermissionInte
25418
25820
  _initFreezePermissionInterceptor() {
25419
25821
  this.disposeWithMe(this._headerFreezeRenderController.interceptor.intercept(this._headerFreezeRenderController.interceptor.getInterceptPoints().FREEZE_PERMISSION_CHECK, { handler: (_, __) => {
25420
25822
  var _this$_permissionServ5, _this$_permissionServ6;
25421
- const workbook = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25823
+ const workbook = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25422
25824
  if (!(workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet()) || !workbook) return false;
25423
25825
  return (_this$_permissionServ5 = (_this$_permissionServ6 = this._permissionService.getPermissionPoint(new _univerjs_sheets.WorkbookEditablePermission(workbook.getUnitId()).id)) === null || _this$_permissionServ6 === void 0 ? void 0 : _this$_permissionServ6.value) !== null && _this$_permissionServ5 !== void 0 ? _this$_permissionServ5 : false;
25424
25826
  } }));
@@ -25464,7 +25866,7 @@ let SheetPermissionInterceptorClipboardController = class SheetPermissionInterce
25464
25866
  startColumn: startRange.startColumn + ranges.startColumn,
25465
25867
  endColumn: startRange.startColumn + ranges.endColumn
25466
25868
  };
25467
- const worksheet = this._univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getActiveSheet();
25869
+ const worksheet = this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getActiveSheet();
25468
25870
  if (!worksheet) return false;
25469
25871
  const { startRow, endRow, startColumn, endColumn } = targetRange;
25470
25872
  let hasPermission = true;
@@ -25476,7 +25878,7 @@ let SheetPermissionInterceptorClipboardController = class SheetPermissionInterce
25476
25878
  break;
25477
25879
  }
25478
25880
  }
25479
- if (!hasPermission) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localService.t("permission.dialog.pasteErr"));
25881
+ if (!hasPermission) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localService.t("sheets-ui.permission.dialog.pasteErr"));
25480
25882
  return hasPermission;
25481
25883
  }
25482
25884
  }));
@@ -25551,7 +25953,7 @@ const checkRangeValid = (injector, permissionRanges, permissionId, unitId, subUn
25551
25953
  const worksheetRuleModel = injector.get(_univerjs_sheets.WorksheetProtectionRuleModel);
25552
25954
  const rangeProtectionRuleModel = injector.get(_univerjs_sheets.RangeProtectionRuleModel);
25553
25955
  let rangeErrorString = "";
25554
- if (permissionRanges.length === 0) rangeErrorString = localeService.t("permission.panel.emptyRangeError");
25956
+ if (permissionRanges.length === 0) rangeErrorString = localeService.t("sheets-ui.permission.panel.emptyRangeError");
25555
25957
  else if (permissionRanges.length > 1) {
25556
25958
  let hasLap = false;
25557
25959
  for (let i = 0; i < permissionRanges.length; i++) {
@@ -25561,11 +25963,11 @@ const checkRangeValid = (injector, permissionRanges, permissionId, unitId, subUn
25561
25963
  }
25562
25964
  if (hasLap) break;
25563
25965
  }
25564
- if (hasLap) rangeErrorString = localeService.t("permission.panel.rangeOverlapError");
25966
+ if (hasLap) rangeErrorString = localeService.t("sheets-ui.permission.panel.rangeOverlapError");
25565
25967
  }
25566
25968
  if (!rangeErrorString) {
25567
25969
  if (worksheetRuleModel.getRule(unitId, subUnitId) && !permissionId) {
25568
- rangeErrorString = localeService.t("permission.panel.rangeOverlapOverPermissionError");
25970
+ rangeErrorString = localeService.t("sheets-ui.permission.panel.rangeOverlapOverPermissionError");
25569
25971
  return rangeErrorString;
25570
25972
  }
25571
25973
  const lapRule = rangeProtectionRuleModel.getSubunitRuleList(unitId, subUnitId).filter((rule) => {
@@ -25577,7 +25979,7 @@ const checkRangeValid = (injector, permissionRanges, permissionId, unitId, subUn
25577
25979
  });
25578
25980
  if (lapRule === null || lapRule === void 0 ? void 0 : lapRule.ranges.find((range) => {
25579
25981
  return permissionRanges.some((r) => _univerjs_core.Rectangle.intersects(range, r));
25580
- })) rangeErrorString = localeService.t("permission.panel.rangeOverlapOverPermissionError");
25982
+ })) rangeErrorString = localeService.t("sheets-ui.permission.panel.rangeOverlapOverPermissionError");
25581
25983
  }
25582
25984
  return rangeErrorString === "" ? void 0 : rangeErrorString;
25583
25985
  };
@@ -25593,7 +25995,7 @@ const generateDefaultRule = (injector, fromSheetBar) => {
25593
25995
  var _selectionManagerServ, _selectionManagerServ2;
25594
25996
  const univerInstanceService = injector.get(_univerjs_core.IUniverInstanceService);
25595
25997
  const selectionManagerService = injector.get(_univerjs_sheets.SheetsSelectionsService);
25596
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25998
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25597
25999
  const worksheet = workbook.getActiveSheet();
25598
26000
  let unitType = _univerjs_sheets.UnitObject.SelectRange;
25599
26001
  let ranges = (_selectionManagerServ = (_selectionManagerServ2 = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ2 === void 0 ? void 0 : _selectionManagerServ2.map((s) => s.range)) !== null && _selectionManagerServ !== void 0 ? _selectionManagerServ : [];
@@ -25620,7 +26022,7 @@ const generateDefaultRule = (injector, fromSheetBar) => {
25620
26022
  };
25621
26023
  };
25622
26024
  const generateRuleByUnitType = (injector, rule) => {
25623
- const worksheet = injector.get(_univerjs_core.IUniverInstanceService).getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getActiveSheet();
26025
+ const worksheet = injector.get(_univerjs_core.IUniverInstanceService).getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getActiveSheet();
25624
26026
  const { unitType } = rule;
25625
26027
  if (unitType === _univerjs_sheets.UnitObject.Worksheet) return {
25626
26028
  ...rule,
@@ -25645,7 +26047,7 @@ const PermissionDetailFooterPart = (props) => {
25645
26047
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
25646
26048
  const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
25647
26049
  const sheetPermissionUserManagerService = (0, _univerjs_ui.useDependency)(SheetPermissionUserManagerService);
25648
- const workbook = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService).getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26050
+ const workbook = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService).getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25649
26051
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
25650
26052
  if (!workbook || !worksheet) return null;
25651
26053
  const unitId = workbook.getUnitId();
@@ -25776,7 +26178,7 @@ const PermissionDetailFooterPart = (props) => {
25776
26178
  });
25777
26179
  }
25778
26180
  const sidebarProps = {
25779
- header: { title: `${localeService.t("permission.panel.title")}` },
26181
+ header: { title: `${localeService.t("sheets-ui.permission.panel.title")}` },
25780
26182
  children: {
25781
26183
  label: UNIVER_SHEET_PERMISSION_PANEL,
25782
26184
  showDetail: false
@@ -25785,14 +26187,14 @@ const PermissionDetailFooterPart = (props) => {
25785
26187
  };
25786
26188
  sidebarService.open(sidebarProps);
25787
26189
  },
25788
- children: localeService.t("permission.button.confirm")
26190
+ children: localeService.t("sheets-ui.permission.button.confirm")
25789
26191
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
25790
26192
  onClick: () => {
25791
26193
  sheetPermissionPanelModel.reset();
25792
26194
  sheetPermissionUserManagerService.reset();
25793
26195
  sidebarService.close();
25794
26196
  },
25795
- children: localeService.t("permission.button.cancel")
26197
+ children: localeService.t("sheets-ui.permission.button.cancel")
25796
26198
  })]
25797
26199
  });
25798
26200
  };
@@ -25806,7 +26208,7 @@ const PermissionDetailMainPart = (props) => {
25806
26208
  const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
25807
26209
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
25808
26210
  const injector = (0, _univerjs_ui.useDependency)(_univerjs_core.Injector);
25809
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26211
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25810
26212
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
25811
26213
  if (!workbook || !worksheet) return null;
25812
26214
  const unitId = workbook.getUnitId();
@@ -25814,7 +26216,7 @@ const PermissionDetailMainPart = (props) => {
25814
26216
  const handleRangeChange = (rangeText) => {
25815
26217
  const newRange = rangeText.split(",").map(_univerjs_engine_formula.deserializeRangeWithSheet).map((item) => item.range);
25816
26218
  if (newRange.some((i) => !(0, _univerjs_core.isValidRange)(i) || i.endColumn < i.startColumn || i.endRow < i.startRow)) return;
25817
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26219
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25818
26220
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
25819
26221
  if (!workbook || !worksheet) return;
25820
26222
  const unitId = workbook.getUnitId();
@@ -25827,7 +26229,7 @@ const PermissionDetailMainPart = (props) => {
25827
26229
  };
25828
26230
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, {
25829
26231
  className: "univer-font-medium",
25830
- label: localeService.t("permission.panel.protectedRange"),
26232
+ label: localeService.t("sheets-ui.permission.panel.protectedRange"),
25831
26233
  error: rangesErrMsg,
25832
26234
  children: RangeSelector && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeSelector, {
25833
26235
  unitId,
@@ -25837,11 +26239,11 @@ const PermissionDetailMainPart = (props) => {
25837
26239
  })
25838
26240
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, {
25839
26241
  className: "univer-font-medium",
25840
- label: localeService.t("permission.panel.permissionDirection"),
26242
+ label: localeService.t("sheets-ui.permission.panel.permissionDirection"),
25841
26243
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
25842
26244
  value: desc,
25843
26245
  onChange: (v) => onDescChange(v),
25844
- placeholder: localeService.t("permission.panel.permissionDirectionPlaceholder")
26246
+ placeholder: localeService.t("sheets-ui.permission.panel.permissionDirectionPlaceholder")
25845
26247
  })
25846
26248
  })] });
25847
26249
  };
@@ -25876,7 +26278,7 @@ const PermissionDetailUserPart = (props) => {
25876
26278
  const userManagerService = (0, _univerjs_ui.useDependency)(_univerjs_core.UserManagerService);
25877
26279
  const univerInstanceService = (0, _univerjs_ui.useDependency)(_univerjs_core.IUniverInstanceService);
25878
26280
  const selectUserList = (0, _univerjs_ui.useObservable)(sheetPermissionUserManagerService.selectUserList$, sheetPermissionUserManagerService.selectUserList);
25879
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26281
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
25880
26282
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
25881
26283
  if (!workbook || !worksheet) return null;
25882
26284
  const unitId = workbook.getUnitId();
@@ -25922,17 +26324,17 @@ const PermissionDetailUserPart = (props) => {
25922
26324
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
25923
26325
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, {
25924
26326
  className: "univer-font-medium",
25925
- label: localeService.t("permission.panel.editPermission"),
26327
+ label: localeService.t("sheets-ui.permission.panel.editPermission"),
25926
26328
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_univerjs_design.RadioGroup, {
25927
26329
  value: editState,
25928
26330
  onChange: (v) => onEditStateChange(v),
25929
26331
  className: "univer-flex univer-flex-col",
25930
26332
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Radio, {
25931
26333
  value: _univerjs_sheets.EditStateEnum.OnlyMe,
25932
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("permission.panel.onlyICanEdit") })
26334
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("sheets-ui.permission.panel.onlyICanEdit") })
25933
26335
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Radio, {
25934
26336
  value: _univerjs_sheets.EditStateEnum.DesignedUserCanEdit,
25935
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("permission.panel.designedUserCanEdit") })
26337
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("sheets-ui.permission.panel.designedUserCanEdit") })
25936
26338
  })]
25937
26339
  })
25938
26340
  }),
@@ -25941,10 +26343,10 @@ const PermissionDetailUserPart = (props) => {
25941
26343
  children: [
25942
26344
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
25943
26345
  className: "univer-flex univer-items-center univer-justify-between univer-text-sm",
25944
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("permission.panel.designedPerson") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26346
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("sheets-ui.permission.panel.designedPerson") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
25945
26347
  className: "univer-cursor-pointer univer-text-primary-600",
25946
26348
  onClick: handleAddPerson,
25947
- children: localeService.t("permission.panel.addPerson")
26349
+ children: localeService.t("sheets-ui.permission.panel.addPerson")
25948
26350
  })]
25949
26351
  }),
25950
26352
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "univer-my-2 univer-h-px univer-bg-gray-200" }),
@@ -25968,10 +26370,10 @@ const PermissionDetailUserPart = (props) => {
25968
26370
  borderless: true,
25969
26371
  value: "edit",
25970
26372
  options: [{
25971
- label: `${localeService.t("permission.panel.canEdit")}`,
26373
+ label: `${localeService.t("sheets-ui.permission.panel.canEdit")}`,
25972
26374
  value: "edit"
25973
26375
  }, {
25974
- label: `${localeService.t("permission.panel.delete")}`,
26376
+ label: `${localeService.t("sheets-ui.permission.panel.delete")}`,
25975
26377
  value: "delete"
25976
26378
  }],
25977
26379
  onChange: (v) => {
@@ -25992,7 +26394,7 @@ const PermissionDetailUserPart = (props) => {
25992
26394
  alt: ""
25993
26395
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
25994
26396
  className: "univer-w-60 univer-break-words univer-text-sm univer-text-gray-400",
25995
- children: localeService.t("permission.dialog.userEmpty")
26397
+ children: localeService.t("sheets-ui.permission.dialog.userEmpty")
25996
26398
  })]
25997
26399
  })
25998
26400
  })
@@ -26000,17 +26402,17 @@ const PermissionDetailUserPart = (props) => {
26000
26402
  }),
26001
26403
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, {
26002
26404
  className: "univer-font-medium",
26003
- label: localeService.t("permission.panel.viewPermission"),
26405
+ label: localeService.t("sheets-ui.permission.panel.viewPermission"),
26004
26406
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_univerjs_design.RadioGroup, {
26005
26407
  value: viewState,
26006
26408
  onChange: (v) => onViewStateChange(v),
26007
26409
  className: "univer-flex univer-flex-col last:univer-mb-0",
26008
26410
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Radio, {
26009
26411
  value: _univerjs_sheets.ViewStateEnum.OthersCanView,
26010
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("permission.panel.othersCanView") })
26412
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("sheets-ui.permission.panel.othersCanView") })
26011
26413
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Radio, {
26012
26414
  value: _univerjs_sheets.ViewStateEnum.NoOneElseCanView,
26013
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("permission.panel.noOneElseCanView") })
26415
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: localeService.t("sheets-ui.permission.panel.noOneElseCanView") })
26014
26416
  })]
26015
26417
  })
26016
26418
  })
@@ -26221,7 +26623,7 @@ function SheetPermissionPanelList() {
26221
26623
  subUnitId: rule.subUnitId
26222
26624
  });
26223
26625
  const sidebarProps = {
26224
- header: { title: "permission.panel.title" },
26626
+ header: { title: "sheets-ui.permission.panel.title" },
26225
26627
  children: {
26226
26628
  label: UNIVER_SHEET_PERMISSION_PANEL,
26227
26629
  showDetail: true,
@@ -26246,14 +26648,14 @@ function SheetPermissionPanelList() {
26246
26648
  onClick: () => handleChangeHeaderType(true),
26247
26649
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
26248
26650
  className: (0, _univerjs_design.clsx)("univer-h-6 univer-text-base univer-font-medium univer-leading-6", { "univer-text-blue-500": isCurrentSheet }),
26249
- children: [" ", localeService.t("permission.panel.currentSheet")]
26651
+ children: [" ", localeService.t("sheets-ui.permission.panel.currentSheet")]
26250
26652
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, _univerjs_design.clsx)("univer-mt-1 univer-h-0.5 univer-w-6", { "univer-bg-blue-500": isCurrentSheet }) })]
26251
26653
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
26252
26654
  className: "univer-mr-5 univer-flex univer-cursor-pointer univer-flex-col univer-items-center",
26253
26655
  onClick: () => handleChangeHeaderType(false),
26254
26656
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26255
26657
  className: (0, _univerjs_design.clsx)("univer-h-6 univer-text-base univer-font-medium univer-leading-6", { "univer-text-blue-500": !isCurrentSheet }),
26256
- children: localeService.t("permission.panel.allSheet")
26658
+ children: localeService.t("sheets-ui.permission.panel.allSheet")
26257
26659
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: (0, _univerjs_design.clsx)("univer-mt-1 univer-h-0.5 univer-w-6", { "univer-bg-blue-500": !isCurrentSheet }) })]
26258
26660
  })]
26259
26661
  }),
@@ -26312,14 +26714,14 @@ function SheetPermissionPanelList() {
26312
26714
  }), (hasManagerPermission || hasDeletePermission) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
26313
26715
  className: "univer-flex univer-items-center",
26314
26716
  children: [hasManagerPermission && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
26315
- title: localeService.t("permission.panel.edit"),
26717
+ title: localeService.t("sheets-ui.permission.panel.edit"),
26316
26718
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26317
26719
  className: "univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200",
26318
26720
  onClick: () => handleEdit(rule),
26319
26721
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.WriteIcon, {})
26320
26722
  })
26321
26723
  }), hasDeletePermission && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
26322
- title: localeService.t("permission.panel.delete"),
26724
+ title: localeService.t("sheets-ui.permission.panel.delete"),
26323
26725
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26324
26726
  className: "univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200",
26325
26727
  onClick: () => handleDelete(rule),
@@ -26343,11 +26745,11 @@ function SheetPermissionPanelList() {
26343
26745
  }),
26344
26746
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26345
26747
  className: "univer-h-4 univer-flex-grow univer-text-xs univer-text-gray-900 dark:!univer-text-white",
26346
- children: localeService.t("permission.panel.created")
26748
+ children: localeService.t("sheets-ui.permission.panel.created")
26347
26749
  }),
26348
26750
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26349
26751
  className: "univer-h-4 univer-text-xs univer-text-gray-900 dark:!univer-text-white",
26350
- children: editPermission ? `${localeService.t("permission.panel.iCanEdit")}` : `${localeService.t("permission.panel.iCanNotEdit")}`
26752
+ children: editPermission ? `${localeService.t("sheets-ui.permission.panel.iCanEdit")}` : `${localeService.t("sheets-ui.permission.panel.iCanNotEdit")}`
26351
26753
  })
26352
26754
  ]
26353
26755
  }),
@@ -26355,10 +26757,10 @@ function SheetPermissionPanelList() {
26355
26757
  className: "univer-mt-2 univer-flex univer-items-center",
26356
26758
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26357
26759
  className: "univer-h-4 univer-flex-grow univer-text-xs univer-text-gray-900 dark:!univer-text-white",
26358
- children: localeService.t("permission.panel.viewPermission")
26760
+ children: localeService.t("sheets-ui.permission.panel.viewPermission")
26359
26761
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26360
26762
  className: "univer-h-4 univer-text-xs univer-text-gray-900 dark:!univer-text-white",
26361
- children: viewPermission ? `${localeService.t("permission.panel.iCanView")}` : `${localeService.t("permission.panel.iCanNotView")}`
26763
+ children: viewPermission ? `${localeService.t("sheets-ui.permission.panel.iCanView")}` : `${localeService.t("sheets-ui.permission.panel.iCanNotView")}`
26362
26764
  })]
26363
26765
  }),
26364
26766
  rule.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
@@ -26381,7 +26783,7 @@ function SheetPermissionPanelList() {
26381
26783
  draggable: false
26382
26784
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
26383
26785
  className: "univer-w-60 univer-break-words univer-text-sm univer-text-gray-400",
26384
- children: localeService.t("permission.dialog.listEmpty")
26786
+ children: localeService.t("sheets-ui.permission.dialog.listEmpty")
26385
26787
  })]
26386
26788
  }),
26387
26789
  hasSetProtectPermission && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -26391,7 +26793,7 @@ function SheetPermissionPanelList() {
26391
26793
  variant: "primary",
26392
26794
  onClick: () => {
26393
26795
  const sidebarProps = {
26394
- header: { title: `${localeService.t("permission.panel.title")}` },
26796
+ header: { title: `${localeService.t("sheets-ui.permission.panel.title")}` },
26395
26797
  children: {
26396
26798
  label: "UNIVER_SHEET_PERMISSION_PANEL",
26397
26799
  showDetail: true
@@ -26400,7 +26802,7 @@ function SheetPermissionPanelList() {
26400
26802
  };
26401
26803
  sidebarService.open(sidebarProps);
26402
26804
  },
26403
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: "+ " }), localeService.t("permission.button.addNewPermission")]
26805
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: "+ " }), localeService.t("sheets-ui.permission.button.addNewPermission")]
26404
26806
  })
26405
26807
  })
26406
26808
  ]
@@ -26449,7 +26851,7 @@ const SheetPermissionDialog = () => {
26449
26851
  const worksheetProtectionPointRuleModel = (0, _univerjs_ui.useDependency)(_univerjs_sheets.WorksheetProtectionPointModel);
26450
26852
  const dialogService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IDialogService);
26451
26853
  const permissionService = (0, _univerjs_ui.useDependency)(_univerjs_core.IPermissionService);
26452
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26854
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26453
26855
  const worksheet = workbook.getActiveSheet();
26454
26856
  if (!worksheet) throw new Error("No active sheet found");
26455
26857
  const [collaborators, setCollaborators] = (0, react.useState)([]);
@@ -26500,7 +26902,7 @@ const SheetPermissionDialog = () => {
26500
26902
  getPermissionPoints();
26501
26903
  }, []);
26502
26904
  const handleChangeActionPermission = async () => {
26503
- const workbook = univerInstanceService.getCurrentUnitForType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26905
+ const workbook = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
26504
26906
  const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getActiveSheet();
26505
26907
  if (!worksheet) throw new Error("No active sheet found");
26506
26908
  const unitId = workbook.getUnitId();
@@ -26581,14 +26983,14 @@ const SheetPermissionDialog = () => {
26581
26983
  onClick: () => {
26582
26984
  dialogService.close(UNIVER_SHEET_PERMISSION_DIALOG_ID);
26583
26985
  },
26584
- children: localeService.t("permission.button.cancel")
26986
+ children: localeService.t("sheets-ui.permission.button.cancel")
26585
26987
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
26586
26988
  variant: "primary",
26587
26989
  onClick: () => {
26588
26990
  handleChangeActionPermission();
26589
26991
  dialogService.close(UNIVER_SHEET_PERMISSION_DIALOG_ID);
26590
26992
  },
26591
- children: localeService.t("permission.button.confirm")
26993
+ children: localeService.t("sheets-ui.permission.button.confirm")
26592
26994
  })]
26593
26995
  })]
26594
26996
  })
@@ -26626,7 +27028,7 @@ const SheetPermissionUserDialog = () => {
26626
27028
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
26627
27029
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
26628
27030
  className: "univer-w-full",
26629
- placeholder: localeService.t("permission.dialog.search"),
27031
+ placeholder: localeService.t("sheets-ui.permission.dialog.search"),
26630
27032
  value: inputValue,
26631
27033
  onChange: (v) => setInputValue(v)
26632
27034
  }) }),
@@ -26649,7 +27051,7 @@ const SheetPermissionUserDialog = () => {
26649
27051
  }),
26650
27052
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26651
27053
  className: "univer-text-xs univer-text-rose-600",
26652
- children: localeService.t("permission.dialog.ownerInherit")
27054
+ children: localeService.t("sheets-ui.permission.dialog.ownerInherit")
26653
27055
  })
26654
27056
  ]
26655
27057
  }, (_item$subject4 = item.subject) === null || _item$subject4 === void 0 ? void 0 : _item$subject4.userID);
@@ -26668,7 +27070,7 @@ const SheetPermissionUserDialog = () => {
26668
27070
  }),
26669
27071
  item.role === _univerjs_protocol.UnitRole.Owner && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26670
27072
  className: "univer-text-xs univer-text-rose-600",
26671
- children: localeService.t("permission.dialog.ownerWithoutInherit")
27073
+ children: localeService.t("sheets-ui.permission.dialog.ownerWithoutInherit")
26672
27074
  }),
26673
27075
  (selectUserInfo === null || selectUserInfo === void 0 ? void 0 : selectUserInfo.findIndex((v) => {
26674
27076
  var _v$subject3, _item$subject10;
@@ -26685,7 +27087,7 @@ const SheetPermissionUserDialog = () => {
26685
27087
  draggable: false
26686
27088
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
26687
27089
  className: "univer-text-sm univer-text-gray-400",
26688
- children: localeService.t("permission.dialog.userEmpty")
27090
+ children: localeService.t("sheets-ui.permission.dialog.userEmpty")
26689
27091
  })]
26690
27092
  })
26691
27093
  }),
@@ -26694,14 +27096,14 @@ const SheetPermissionUserDialog = () => {
26694
27096
  className: "univer-flex univer-items-center univer-justify-end univer-gap-1 univer-py-2",
26695
27097
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
26696
27098
  onClick: () => dialogService.close(UNIVER_SHEET_PERMISSION_USER_DIALOG_ID),
26697
- children: localeService.t("permission.button.cancel")
27099
+ children: localeService.t("sheets-ui.permission.button.cancel")
26698
27100
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
26699
27101
  variant: "primary",
26700
27102
  onClick: () => {
26701
27103
  sheetPermissionUserManagerService.setSelectUserList(selectUserInfo);
26702
27104
  dialogService.close(UNIVER_SHEET_PERMISSION_USER_DIALOG_ID);
26703
27105
  },
26704
- children: localeService.t("permission.button.confirm")
27106
+ children: localeService.t("sheets-ui.permission.button.confirm")
26705
27107
  })]
26706
27108
  })
26707
27109
  ] });
@@ -26728,7 +27130,7 @@ const AlertDialog = ({ errorMsg }) => {
26728
27130
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
26729
27131
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
26730
27132
  className: "univer-m-0",
26731
- children: errorMsg || localeService.t("permission.dialog.alertContent")
27133
+ children: errorMsg || localeService.t("sheets-ui.permission.dialog.alertContent")
26732
27134
  }) });
26733
27135
  };
26734
27136
 
@@ -26899,684 +27301,388 @@ var WorksheetProtectionRenderExtension = class extends _univerjs_engine_render.S
26899
27301
  };
26900
27302
 
26901
27303
  //#endregion
26902
- //#region src/controllers/permission/sheet-permission-render.controller.ts
26903
- let SheetPermissionRenderManagerController = class SheetPermissionRenderManagerController extends _univerjs_core.Disposable {
26904
- constructor(_injector, _componentManager) {
26905
- super();
26906
- this._injector = _injector;
26907
- this._componentManager = _componentManager;
26908
- this._init();
26909
- }
26910
- _init() {
26911
- this._initComponents();
26912
- this._initUiPartComponents();
26913
- }
26914
- _initComponents() {
26915
- [
26916
- [permissionMenuIconKey, _univerjs_icons.ProtectIcon],
26917
- [permissionDeleteIconKey, _univerjs_icons.DeleteIcon],
26918
- [permissionEditIconKey, _univerjs_icons.WriteIcon],
26919
- [permissionCheckIconKey, _univerjs_icons.CheckMarkIcon],
26920
- [permissionLockIconKey, _univerjs_icons.LockIcon],
26921
- [UNIVER_SHEET_PERMISSION_PANEL, SheetPermissionPanel],
26922
- [UNIVER_SHEET_PERMISSION_USER_DIALOG, SheetPermissionUserDialog],
26923
- [UNIVER_SHEET_PERMISSION_DIALOG, SheetPermissionDialog],
26924
- [UNIVER_SHEET_PERMISSION_ALERT_DIALOG, AlertDialog]
26925
- ].forEach(([key, comp]) => {
26926
- this.disposeWithMe(this._componentManager.register(key, comp));
26927
- });
26928
- }
26929
- _initUiPartComponents() {
26930
- const config = this._injector.get(_univerjs_core.IConfigService).getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
26931
- if (config === null || config === void 0 ? void 0 : config.protectedRangeUserSelector) {
26932
- const { component, framework } = config.protectedRangeUserSelector;
26933
- this.disposeWithMe(this._componentManager.register(UNIVER_SHEET_PERMISSION_USER_PART, component, { framework }));
26934
- }
26935
- }
26936
- };
26937
- SheetPermissionRenderManagerController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_core.Injector)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager))], SheetPermissionRenderManagerController);
26938
- let SheetPermissionRenderController = class SheetPermissionRenderController extends _univerjs_core.Disposable {
26939
- constructor(_context, _rangeProtectionRuleModel, _sheetSkeletonManagerService, _permissionService, _configService) {
26940
- super();
26941
- this._context = _context;
26942
- this._rangeProtectionRuleModel = _rangeProtectionRuleModel;
26943
- this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
26944
- this._permissionService = _permissionService;
26945
- this._configService = _configService;
26946
- _defineProperty(this, "_rangeProtectionCanViewRenderExtension", void 0);
26947
- _defineProperty(this, "_rangeProtectionCanNotViewRenderExtension", void 0);
26948
- const config = this._configService.getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
26949
- const shadowStrategy = convertToShadowStrategy(config === null || config === void 0 ? void 0 : config.protectedRangeShadow);
26950
- this._rangeProtectionCanViewRenderExtension = new RangeProtectionCanViewRenderExtension(shadowStrategy);
26951
- this._rangeProtectionCanNotViewRenderExtension = new RangeProtectionCanNotViewRenderExtension(shadowStrategy);
26952
- this._initSkeleton();
26953
- this._initRender();
26954
- this.disposeWithMe(this._rangeProtectionRuleModel.ruleChange$.subscribe((info) => {
26955
- var _info$oldRule, _info$oldRule2;
26956
- if (((_info$oldRule = info.oldRule) === null || _info$oldRule === void 0 ? void 0 : _info$oldRule.id) && this._rangeProtectionCanViewRenderExtension.renderCache.has(info.oldRule.id) || this._rangeProtectionCanViewRenderExtension.renderCache.has(info.rule.id)) this._rangeProtectionCanViewRenderExtension.clearCache();
26957
- if (((_info$oldRule2 = info.oldRule) === null || _info$oldRule2 === void 0 ? void 0 : _info$oldRule2.id) && this._rangeProtectionCanNotViewRenderExtension.renderCache.has(info.oldRule.id) || this._rangeProtectionCanNotViewRenderExtension.renderCache.has(info.rule.id)) this._rangeProtectionCanNotViewRenderExtension.clearCache();
26958
- }));
26959
- }
26960
- _initRender() {
26961
- const spreadsheetRender = this._context.mainComponent;
26962
- if (spreadsheetRender) {
26963
- if (!spreadsheetRender.getExtensionByKey("RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY")) spreadsheetRender.register(this._rangeProtectionCanViewRenderExtension);
26964
- if (!spreadsheetRender.getExtensionByKey("RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY")) spreadsheetRender.register(this._rangeProtectionCanNotViewRenderExtension);
26965
- }
26966
- }
26967
- _initSkeleton() {
26968
- const markDirtySkeleton = () => {
26969
- var _this$_context$mainCo;
26970
- this._sheetSkeletonManagerService.reCalculate();
26971
- (_this$_context$mainCo = this._context.mainComponent) === null || _this$_context$mainCo === void 0 || _this$_context$mainCo.makeDirty();
26972
- };
26973
- this.disposeWithMe((0, rxjs.merge)(this._permissionService.permissionPointUpdate$.pipe((0, rxjs.throttleTime)(300, void 0, { trailing: true })), this._rangeProtectionRuleModel.rangeRuleInitStateChange$, this._rangeProtectionRuleModel.ruleChange$).pipe().subscribe(markDirtySkeleton));
26974
- }
26975
- };
26976
- SheetPermissionRenderController = __decorate([
26977
- __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_sheets.RangeProtectionRuleModel)),
26978
- __decorateParam(2, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
26979
- __decorateParam(3, _univerjs_core.IPermissionService),
26980
- __decorateParam(4, _univerjs_core.IConfigService)
26981
- ], SheetPermissionRenderController);
26982
- let WorksheetProtectionRenderController = class WorksheetProtectionRenderController extends _univerjs_core.Disposable {
26983
- constructor(_context, _renderManagerService, _sheetSkeletonManagerService, _worksheetProtectionRuleModel, _configService) {
26984
- super();
26985
- this._context = _context;
26986
- this._renderManagerService = _renderManagerService;
26987
- this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
26988
- this._worksheetProtectionRuleModel = _worksheetProtectionRuleModel;
26989
- this._configService = _configService;
26990
- _defineProperty(this, "_worksheetProtectionRenderExtension", void 0);
26991
- const config = this._configService.getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
26992
- const shadowStrategy = convertToShadowStrategy(config === null || config === void 0 ? void 0 : config.protectedRangeShadow);
26993
- this._worksheetProtectionRenderExtension = new WorksheetProtectionRenderExtension(shadowStrategy);
26994
- this._initSkeleton();
26995
- if (shadowStrategy === "none") return;
26996
- this._initRender();
26997
- }
26998
- _initRender() {
26999
- const renderId = this._context.unitId;
27000
- const render = renderId && this._renderManagerService.getRenderById(renderId);
27001
- const spreadsheetRender = render && render.mainComponent;
27002
- if (spreadsheetRender) {
27003
- if (!spreadsheetRender.getExtensionByKey("worksheet-protection")) spreadsheetRender.register(this._worksheetProtectionRenderExtension);
27004
- }
27005
- }
27006
- _initSkeleton() {
27007
- const markDirtySkeleton = () => {
27008
- var _this$_context$mainCo2;
27009
- this._sheetSkeletonManagerService.reCalculate();
27010
- (_this$_context$mainCo2 = this._context.mainComponent) === null || _this$_context$mainCo2 === void 0 || _this$_context$mainCo2.makeDirty();
27011
- };
27012
- this.disposeWithMe((0, rxjs.merge)(this._worksheetProtectionRuleModel.worksheetRuleInitStateChange$).pipe().subscribe(markDirtySkeleton));
27013
- }
27014
- };
27015
- WorksheetProtectionRenderController = __decorate([
27016
- __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_engine_render.IRenderManagerService)),
27017
- __decorateParam(2, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
27018
- __decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_sheets.WorksheetProtectionRuleModel)),
27019
- __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_core.IConfigService))
27020
- ], WorksheetProtectionRenderController);
27021
-
27022
- //#endregion
27023
- //#region src/controllers/render-controllers/clipboard.render-controller.ts
27024
- let ClipboardRenderController = class ClipboardRenderController extends _univerjs_core.Disposable {
27025
- constructor(_context, _sheetSkeletonManagerService, _sheetClipboardService, _sheetClipboardController) {
27026
- super();
27027
- this._context = _context;
27028
- this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
27029
- this._sheetClipboardService = _sheetClipboardService;
27030
- this._sheetClipboardController = _sheetClipboardController;
27031
- this._initialize();
27032
- }
27033
- _initialize() {
27034
- this.disposeWithMe((0, _univerjs_core.toDisposable)(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((skeleton) => {
27035
- if (!(skeleton === null || skeleton === void 0 ? void 0 : skeleton.unitId)) return;
27036
- if (!this._sheetClipboardService.getPasteMenuVisible()) return;
27037
- const pasteOptionsCache = this._sheetClipboardService.getPasteOptionsCache();
27038
- const menuUnitId = pasteOptionsCache === null || pasteOptionsCache === void 0 ? void 0 : pasteOptionsCache.target.unitId;
27039
- if (skeleton.unitId === menuUnitId) this._sheetClipboardController.refreshOptionalPaste();
27040
- })));
27041
- }
27042
- };
27043
- ClipboardRenderController = __decorate([
27044
- __decorateParam(1, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
27045
- __decorateParam(2, ISheetClipboardService),
27046
- __decorateParam(3, (0, _univerjs_core.Inject)(SheetClipboardController))
27047
- ], ClipboardRenderController);
27048
-
27049
- //#endregion
27050
- //#region src/controllers/render-controllers/format-painter.render-controller.ts
27051
- let FormatPainterRenderController = class FormatPainterRenderController extends _univerjs_core.Disposable {
27052
- constructor(_context, _formatPainterService, _selectionRenderService, _commandService) {
27053
- super();
27054
- this._context = _context;
27055
- this._formatPainterService = _formatPainterService;
27056
- this._selectionRenderService = _selectionRenderService;
27057
- this._commandService = _commandService;
27058
- this._initialize();
27059
- }
27060
- _initialize() {
27061
- this._bindFormatPainterStatus();
27062
- this._commandExecutedListener();
27063
- }
27064
- _commandExecutedListener() {
27065
- this.disposeWithMe(this._selectionRenderService.selectionMoveEnd$.subscribe((selections) => {
27066
- if (this._formatPainterService.getStatus() !== 0) {
27067
- var _this$_context$unit$g;
27068
- const { rangeWithCoord } = selections[selections.length - 1];
27069
- this._commandService.executeCommand(ApplyFormatPainterCommand.id, {
27070
- unitId: this._context.unitId,
27071
- subUnitId: ((_this$_context$unit$g = this._context.unit.getActiveSheet()) === null || _this$_context$unit$g === void 0 ? void 0 : _this$_context$unit$g.getSheetId()) || "",
27072
- range: {
27073
- startRow: rangeWithCoord.startRow,
27074
- startColumn: rangeWithCoord.startColumn,
27075
- endRow: rangeWithCoord.endRow,
27076
- endColumn: rangeWithCoord.endColumn
27077
- }
27078
- });
27079
- if (this._formatPainterService.getStatus() === 1) this._commandService.executeCommand(SetOnceFormatPainterCommand.id);
27080
- }
27081
- }));
27082
- }
27083
- _bindFormatPainterStatus() {
27084
- this.disposeWithMe((0, _univerjs_core.toDisposable)(this._formatPainterService.status$.subscribe((status) => {
27085
- const scene = this._context.scene;
27086
- if (!scene) return;
27087
- if (status !== 0) scene.setDefaultCursor(_univerjs_engine_render.CURSOR_TYPE.CELL);
27088
- else scene.setDefaultCursor(_univerjs_engine_render.CURSOR_TYPE.DEFAULT);
27089
- })));
27090
- }
27091
- };
27092
- FormatPainterRenderController = __decorate([
27093
- __decorateParam(1, IFormatPainterService),
27094
- __decorateParam(2, ISheetSelectionRenderService),
27095
- __decorateParam(3, _univerjs_core.ICommandService)
27096
- ], FormatPainterRenderController);
27097
-
27098
- //#endregion
27099
- //#region src/menu/header-menu-shape.ts
27100
- const HEADER_MENU_SHAPE_CIRCLE_FILL = "rgba(0, 0, 0, 0.15)";
27101
- const HEADER_MENU_SHAPE_TRIANGLE_FILL = "rgb(0, 0, 0)";
27102
- const HEADER_MENU_BACKGROUND_COLOR = "rgb(255, 255, 255, 1)";
27103
- var HeaderMenuShape = class extends _univerjs_engine_render.Shape {
27104
- constructor(key, props) {
27105
- super(key, props);
27106
- _defineProperty(this, "_size", 12);
27107
- _defineProperty(this, "_iconRatio", .4);
27108
- _defineProperty(this, "_mode", 0);
27109
- this.setShapeProps(props);
27304
+ //#region src/controllers/permission/sheet-permission-render.controller.ts
27305
+ let SheetPermissionRenderManagerController = class SheetPermissionRenderManagerController extends _univerjs_core.Disposable {
27306
+ constructor(_injector, _componentManager) {
27307
+ super();
27308
+ this._injector = _injector;
27309
+ this._componentManager = _componentManager;
27310
+ this._init();
27110
27311
  }
27111
- setShapeProps(props) {
27112
- if (props === null || props === void 0 ? void 0 : props.size) this._size = props.size;
27113
- if (props === null || props === void 0 ? void 0 : props.mode) this._mode = props.mode;
27114
- this.transformByState({
27115
- width: this._size,
27116
- height: this._size
27117
- });
27312
+ _init() {
27313
+ this._initComponents();
27314
+ this._initUiPartComponents();
27118
27315
  }
27119
- _draw(ctx) {
27120
- if (this._mode === 1) _univerjs_engine_render.Rect.drawWith(ctx, {
27121
- width: this._size,
27122
- height: this._size,
27123
- radius: this._size,
27124
- fill: HEADER_MENU_SHAPE_CIRCLE_FILL
27125
- });
27126
- const iconSize = this._size * .5 * this._iconRatio;
27127
- const sixtyDegree = Math.PI / 180 * 60;
27128
- const left = iconSize * Math.sin(sixtyDegree);
27129
- const top = iconSize * Math.cos(sixtyDegree);
27130
- _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
27131
- pointsGroup: [[
27132
- {
27133
- x: -left + this._size / 2,
27134
- y: -top + this._size / 2
27135
- },
27136
- {
27137
- x: left + this._size / 2,
27138
- y: -top + this._size / 2
27139
- },
27140
- {
27141
- x: this._size / 2,
27142
- y: iconSize + this._size / 2
27143
- }
27144
- ]],
27145
- fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
27316
+ _initComponents() {
27317
+ [
27318
+ [permissionMenuIconKey, _univerjs_icons.ProtectIcon],
27319
+ [permissionDeleteIconKey, _univerjs_icons.DeleteIcon],
27320
+ [permissionEditIconKey, _univerjs_icons.WriteIcon],
27321
+ [permissionCheckIconKey, _univerjs_icons.CheckMarkIcon],
27322
+ [permissionLockIconKey, _univerjs_icons.LockIcon],
27323
+ [UNIVER_SHEET_PERMISSION_PANEL, SheetPermissionPanel],
27324
+ [UNIVER_SHEET_PERMISSION_USER_DIALOG, SheetPermissionUserDialog],
27325
+ [UNIVER_SHEET_PERMISSION_DIALOG, SheetPermissionDialog],
27326
+ [UNIVER_SHEET_PERMISSION_ALERT_DIALOG, AlertDialog]
27327
+ ].forEach(([key, comp]) => {
27328
+ this.disposeWithMe(this._componentManager.register(key, comp));
27146
27329
  });
27147
27330
  }
27331
+ _initUiPartComponents() {
27332
+ const config = this._injector.get(_univerjs_core.IConfigService).getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
27333
+ if (config === null || config === void 0 ? void 0 : config.protectedRangeUserSelector) {
27334
+ const { component, framework } = config.protectedRangeUserSelector;
27335
+ this.disposeWithMe(this._componentManager.register(UNIVER_SHEET_PERMISSION_USER_PART, component, { framework }));
27336
+ }
27337
+ }
27148
27338
  };
27149
-
27150
- //#endregion
27151
- //#region src/controllers/render-controllers/header-menu.render-controller.ts
27152
- const HEADER_MENU_CONTROLLER_SHAPE = "__SpreadsheetHeaderMenuSHAPEControllerShape__";
27153
- const HEADER_MENU_CONTROLLER_MENU = "__SpreadsheetHeaderMenuMAINControllerShape__";
27154
- const HEADER_MENU_CONTROLLER_SHAPE_COLOR = "rgba(0, 0, 0, 0.1)";
27155
- let HeaderMenuRenderController = class HeaderMenuRenderController extends _univerjs_core.Disposable {
27156
- constructor(_context, _sheetSkeletonManagerService, _contextMenuService, _commandService, _selectionManagerService) {
27339
+ SheetPermissionRenderManagerController = __decorate([__decorateParam(0, (0, _univerjs_core.Inject)(_univerjs_core.Injector)), __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_ui.ComponentManager))], SheetPermissionRenderManagerController);
27340
+ let SheetPermissionRenderController = class SheetPermissionRenderController extends _univerjs_core.Disposable {
27341
+ constructor(_context, _rangeProtectionRuleModel, _sheetSkeletonManagerService, _permissionService, _configService) {
27157
27342
  super();
27158
27343
  this._context = _context;
27344
+ this._rangeProtectionRuleModel = _rangeProtectionRuleModel;
27159
27345
  this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
27160
- this._contextMenuService = _contextMenuService;
27161
- this._commandService = _commandService;
27162
- this._selectionManagerService = _selectionManagerService;
27163
- _defineProperty(this, "_hoverRect", void 0);
27164
- _defineProperty(this, "_hoverMenu", void 0);
27165
- _defineProperty(this, "_currentColumn", Number.POSITIVE_INFINITY);
27166
- _defineProperty(this, "_headerPointerSubs", void 0);
27167
- _defineProperty(this, "_colHeaderPointerSubs", void 0);
27168
- this._initialize();
27169
- }
27170
- dispose() {
27171
- var _this$_hoverRect, _this$_hoverMenu, _this$_headerPointerS;
27172
- (_this$_hoverRect = this._hoverRect) === null || _this$_hoverRect === void 0 || _this$_hoverRect.dispose();
27173
- (_this$_hoverMenu = this._hoverMenu) === null || _this$_hoverMenu === void 0 || _this$_hoverMenu.dispose();
27174
- (_this$_headerPointerS = this._headerPointerSubs) === null || _this$_headerPointerS === void 0 || _this$_headerPointerS.unsubscribe();
27175
- this._headerPointerSubs = null;
27346
+ this._permissionService = _permissionService;
27347
+ this._configService = _configService;
27348
+ _defineProperty(this, "_rangeProtectionCanViewRenderExtension", void 0);
27349
+ _defineProperty(this, "_rangeProtectionCanNotViewRenderExtension", void 0);
27350
+ const config = this._configService.getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
27351
+ const shadowStrategy = convertToShadowStrategy(config === null || config === void 0 ? void 0 : config.protectedRangeShadow);
27352
+ this._rangeProtectionCanViewRenderExtension = new RangeProtectionCanViewRenderExtension(shadowStrategy);
27353
+ this._rangeProtectionCanNotViewRenderExtension = new RangeProtectionCanNotViewRenderExtension(shadowStrategy);
27354
+ this._initSkeleton();
27355
+ this._initRender();
27356
+ this.disposeWithMe(this._rangeProtectionRuleModel.ruleChange$.subscribe((info) => {
27357
+ var _info$oldRule, _info$oldRule2;
27358
+ if (((_info$oldRule = info.oldRule) === null || _info$oldRule === void 0 ? void 0 : _info$oldRule.id) && this._rangeProtectionCanViewRenderExtension.renderCache.has(info.oldRule.id) || this._rangeProtectionCanViewRenderExtension.renderCache.has(info.rule.id)) this._rangeProtectionCanViewRenderExtension.clearCache();
27359
+ if (((_info$oldRule2 = info.oldRule) === null || _info$oldRule2 === void 0 ? void 0 : _info$oldRule2.id) && this._rangeProtectionCanNotViewRenderExtension.renderCache.has(info.oldRule.id) || this._rangeProtectionCanNotViewRenderExtension.renderCache.has(info.rule.id)) this._rangeProtectionCanNotViewRenderExtension.clearCache();
27360
+ }));
27176
27361
  }
27177
- _initialize() {
27178
- const scene = this._context.scene;
27179
- this._hoverRect = new _univerjs_engine_render.Rect(HEADER_MENU_CONTROLLER_SHAPE, {
27180
- fill: HEADER_MENU_CONTROLLER_SHAPE_COLOR,
27181
- evented: false
27182
- });
27183
- this._hoverMenu = new HeaderMenuShape(HEADER_MENU_CONTROLLER_MENU, {
27184
- zIndex: 100,
27185
- visible: false
27186
- });
27187
- scene.addObjects([this._hoverRect, this._hoverMenu], 10);
27188
- this._initialHover(0);
27189
- this._initialHover(1);
27190
- this._initialHoverMenu();
27362
+ _initRender() {
27363
+ const spreadsheetRender = this._context.mainComponent;
27364
+ if (spreadsheetRender) {
27365
+ if (!spreadsheetRender.getExtensionByKey("RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY")) spreadsheetRender.register(this._rangeProtectionCanViewRenderExtension);
27366
+ if (!spreadsheetRender.getExtensionByKey("RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY")) spreadsheetRender.register(this._rangeProtectionCanNotViewRenderExtension);
27367
+ }
27191
27368
  }
27192
- _initialHover(initialType = 0) {
27193
- var _this$_headerPointerS2, _this$_headerPointerS3, _this$_headerPointerS4;
27194
- const spreadsheetColumnHeader = this._context.components.get("__SpreadsheetColumnHeader__");
27195
- const spreadsheetRowHeader = this._context.components.get("__SpreadsheetRowHeader__");
27196
- const eventBindingObject = initialType === 0 ? spreadsheetRowHeader : spreadsheetColumnHeader;
27197
- const pointerMoveHandler = (evt) => {
27198
- var _this$_sheetSkeletonM;
27199
- const skeleton = (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton;
27200
- if (skeleton == null) return;
27201
- const { rowHeaderWidth, columnHeaderHeight } = skeleton;
27202
- const { startX, startY, endX, endY, column } = getCoordByOffset(evt.offsetX, evt.offsetY, this._context.scene, skeleton);
27203
- if (initialType === 0) {
27204
- var _this$_hoverRect2;
27205
- (_this$_hoverRect2 = this._hoverRect) === null || _this$_hoverRect2 === void 0 || _this$_hoverRect2.transformByState({
27206
- width: rowHeaderWidth,
27207
- height: endY - startY,
27208
- left: 0,
27209
- top: startY
27210
- });
27211
- } else {
27212
- var _this$_hoverRect3;
27213
- this._currentColumn = column;
27214
- (_this$_hoverRect3 = this._hoverRect) === null || _this$_hoverRect3 === void 0 || _this$_hoverRect3.transformByState({
27215
- width: endX - startX,
27216
- height: columnHeaderHeight,
27217
- left: startX,
27218
- top: 0
27219
- });
27220
- if (this._hoverMenu == null) return;
27221
- if (endX - startX < columnHeaderHeight * 2) {
27222
- this._hoverMenu.hide();
27223
- return;
27224
- }
27225
- const menuSize = columnHeaderHeight * .8;
27226
- this._hoverMenu.transformByState({
27227
- left: endX - columnHeaderHeight,
27228
- top: columnHeaderHeight / 2 - menuSize / 2
27229
- });
27230
- this._hoverMenu.setShapeProps({ size: menuSize });
27231
- this._hoverMenu.show();
27232
- }
27233
- };
27234
- const pointerEnterHandler = () => {
27235
- var _this$_hoverRect4;
27236
- (_this$_hoverRect4 = this._hoverRect) === null || _this$_hoverRect4 === void 0 || _this$_hoverRect4.show();
27237
- };
27238
- const pointerLeaveHandler = () => {
27239
- var _this$_hoverRect5, _this$_hoverMenu2;
27240
- (_this$_hoverRect5 = this._hoverRect) === null || _this$_hoverRect5 === void 0 || _this$_hoverRect5.hide();
27241
- (_this$_hoverMenu2 = this._hoverMenu) === null || _this$_hoverMenu2 === void 0 || _this$_hoverMenu2.hide();
27369
+ _initSkeleton() {
27370
+ const markDirtySkeleton = () => {
27371
+ var _this$_context$mainCo;
27372
+ this._sheetSkeletonManagerService.reCalculate();
27373
+ (_this$_context$mainCo = this._context.mainComponent) === null || _this$_context$mainCo === void 0 || _this$_context$mainCo.makeDirty();
27242
27374
  };
27243
- this._headerPointerSubs = new rxjs.Subscription();
27244
- const headerPointerMoveSub = eventBindingObject.onPointerMove$.subscribeEvent(pointerMoveHandler);
27245
- const headerPointerEnterSub = eventBindingObject.onPointerEnter$.subscribeEvent(pointerEnterHandler);
27246
- const headerPointerLeaveSub = eventBindingObject.onPointerLeave$.subscribeEvent(pointerLeaveHandler);
27247
- (_this$_headerPointerS2 = this._headerPointerSubs) === null || _this$_headerPointerS2 === void 0 || _this$_headerPointerS2.add(headerPointerMoveSub);
27248
- (_this$_headerPointerS3 = this._headerPointerSubs) === null || _this$_headerPointerS3 === void 0 || _this$_headerPointerS3.add(headerPointerEnterSub);
27249
- (_this$_headerPointerS4 = this._headerPointerSubs) === null || _this$_headerPointerS4 === void 0 || _this$_headerPointerS4.add(headerPointerLeaveSub);
27375
+ this.disposeWithMe((0, rxjs.merge)(this._permissionService.permissionPointUpdate$.pipe((0, rxjs.throttleTime)(300, void 0, { trailing: true })), this._rangeProtectionRuleModel.rangeRuleInitStateChange$, this._rangeProtectionRuleModel.ruleChange$).pipe().subscribe(markDirtySkeleton));
27250
27376
  }
27251
- _initialHoverMenu() {
27252
- if (this._hoverMenu == null) return;
27253
- this._hoverMenu.onPointerEnter$.subscribeEvent(() => {
27254
- if (this._hoverMenu == null) return;
27255
- this._hoverMenu.setProps({
27256
- mode: 1,
27257
- visible: true
27258
- });
27259
- this._context.scene.setCursor(_univerjs_engine_render.CURSOR_TYPE.POINTER);
27260
- });
27261
- this._hoverMenu.onPointerLeave$.subscribeEvent(() => {
27262
- if (this._hoverMenu == null) return;
27263
- this._hoverMenu.setProps({
27264
- mode: 0,
27265
- visible: false
27266
- });
27267
- this._context.scene.resetCursor();
27268
- });
27269
- this._hoverMenu.onPointerDown$.subscribeEvent((evt) => {
27270
- var _this$_selectionManag;
27271
- const currentColumn = this._currentColumn;
27272
- const currentSelectionDatas = (_this$_selectionManag = this._selectionManagerService.getCurrentSelections()) === null || _this$_selectionManag === void 0 ? void 0 : _this$_selectionManag.map((s) => s.range);
27273
- if (!!!(currentSelectionDatas === null || currentSelectionDatas === void 0 ? void 0 : currentSelectionDatas.filter((range) => range.rangeType === _univerjs_core.RANGE_TYPE.COLUMN).find((data) => {
27274
- const { startColumn, endColumn } = data;
27275
- if (currentColumn >= startColumn && currentColumn <= endColumn) return true;
27276
- return false;
27277
- }))) {
27278
- const selection = this._getSelectionOnColumn(currentColumn);
27279
- this._commandService.syncExecuteCommand(_univerjs_sheets.SetSelectionsOperation.id, selection);
27280
- }
27281
- evt.stopPropagation();
27282
- evt.preventDefault();
27283
- this._contextMenuService.triggerContextMenu(evt, _univerjs_ui.ContextMenuPosition.COL_HEADER);
27284
- });
27377
+ };
27378
+ SheetPermissionRenderController = __decorate([
27379
+ __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_sheets.RangeProtectionRuleModel)),
27380
+ __decorateParam(2, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
27381
+ __decorateParam(3, _univerjs_core.IPermissionService),
27382
+ __decorateParam(4, _univerjs_core.IConfigService)
27383
+ ], SheetPermissionRenderController);
27384
+ let WorksheetProtectionRenderController = class WorksheetProtectionRenderController extends _univerjs_core.Disposable {
27385
+ constructor(_context, _renderManagerService, _sheetSkeletonManagerService, _worksheetProtectionRuleModel, _configService) {
27386
+ super();
27387
+ this._context = _context;
27388
+ this._renderManagerService = _renderManagerService;
27389
+ this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
27390
+ this._worksheetProtectionRuleModel = _worksheetProtectionRuleModel;
27391
+ this._configService = _configService;
27392
+ _defineProperty(this, "_worksheetProtectionRenderExtension", void 0);
27393
+ const config = this._configService.getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
27394
+ const shadowStrategy = convertToShadowStrategy(config === null || config === void 0 ? void 0 : config.protectedRangeShadow);
27395
+ this._worksheetProtectionRenderExtension = new WorksheetProtectionRenderExtension(shadowStrategy);
27396
+ this._initSkeleton();
27397
+ if (shadowStrategy === "none") return;
27398
+ this._initRender();
27399
+ }
27400
+ _initRender() {
27401
+ const renderId = this._context.unitId;
27402
+ const render = renderId && this._renderManagerService.getRenderById(renderId);
27403
+ const spreadsheetRender = render && render.mainComponent;
27404
+ if (spreadsheetRender) {
27405
+ if (!spreadsheetRender.getExtensionByKey("worksheet-protection")) spreadsheetRender.register(this._worksheetProtectionRenderExtension);
27406
+ }
27285
27407
  }
27286
- _getSelectionOnColumn(column) {
27287
- const workbook = this._context.unit;
27288
- const worksheet = workbook.getActiveSheet();
27289
- if (!worksheet) throw new Error("No active worksheet");
27290
- return {
27291
- unitId: workbook.getUnitId(),
27292
- subUnitId: worksheet.getSheetId(),
27293
- selections: [{
27294
- range: {
27295
- startRow: 0,
27296
- startColumn: column,
27297
- endRow: worksheet.getRowCount() - 1,
27298
- endColumn: column,
27299
- rangeType: _univerjs_core.RANGE_TYPE.COLUMN
27300
- },
27301
- primary: {
27302
- startRow: 0,
27303
- startColumn: column,
27304
- endRow: 0,
27305
- endColumn: column,
27306
- actualRow: 0,
27307
- actualColumn: column,
27308
- isMerged: false,
27309
- isMergedMainCell: false
27310
- },
27311
- style: null
27312
- }]
27408
+ _initSkeleton() {
27409
+ const markDirtySkeleton = () => {
27410
+ var _this$_context$mainCo2;
27411
+ this._sheetSkeletonManagerService.reCalculate();
27412
+ (_this$_context$mainCo2 = this._context.mainComponent) === null || _this$_context$mainCo2 === void 0 || _this$_context$mainCo2.makeDirty();
27313
27413
  };
27414
+ this.disposeWithMe((0, rxjs.merge)(this._worksheetProtectionRuleModel.worksheetRuleInitStateChange$).pipe().subscribe(markDirtySkeleton));
27314
27415
  }
27315
27416
  };
27316
- HeaderMenuRenderController = __decorate([
27317
- __decorateParam(1, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
27318
- __decorateParam(2, _univerjs_ui.IContextMenuService),
27319
- __decorateParam(3, _univerjs_core.ICommandService),
27320
- __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetsSelectionsService))
27321
- ], HeaderMenuRenderController);
27417
+ WorksheetProtectionRenderController = __decorate([
27418
+ __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_engine_render.IRenderManagerService)),
27419
+ __decorateParam(2, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
27420
+ __decorateParam(3, (0, _univerjs_core.Inject)(_univerjs_sheets.WorksheetProtectionRuleModel)),
27421
+ __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_core.IConfigService))
27422
+ ], WorksheetProtectionRenderController);
27322
27423
 
27323
27424
  //#endregion
27324
- //#region src/views/header-unhide-shape.ts
27325
- const UNHIDE_ICON_SIZE = 12;
27326
- const UNHIDE_ARROW_RATIO = .4;
27327
- var HeaderUnhideShape = class extends _univerjs_engine_render.Shape {
27328
- constructor(key, props, onClick) {
27329
- super(key, props);
27330
- _defineProperty(this, "_size", 12);
27331
- _defineProperty(this, "_iconRatio", UNHIDE_ARROW_RATIO);
27332
- _defineProperty(this, "_hovered", true);
27333
- _defineProperty(this, "_hasPrevious", true);
27334
- _defineProperty(this, "_hasNext", true);
27335
- _defineProperty(this, "_unhideType", void 0);
27336
- if (props) this.setShapeProps(props);
27337
- this.onPointerEnter$.subscribeEvent(() => this.setShapeProps({ hovered: true }));
27338
- this.onPointerLeave$.subscribeEvent(() => this.setShapeProps({ hovered: false }));
27339
- this.onPointerDown$.subscribeEvent(() => onClick === null || onClick === void 0 ? void 0 : onClick());
27425
+ //#region src/controllers/render-controllers/clipboard.render-controller.ts
27426
+ let ClipboardRenderController = class ClipboardRenderController extends _univerjs_core.Disposable {
27427
+ constructor(_context, _sheetSkeletonManagerService, _sheetClipboardService, _sheetClipboardController) {
27428
+ super();
27429
+ this._context = _context;
27430
+ this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
27431
+ this._sheetClipboardService = _sheetClipboardService;
27432
+ this._sheetClipboardController = _sheetClipboardController;
27433
+ this._initialize();
27340
27434
  }
27341
- setShapeProps(props) {
27342
- if (props.type !== void 0) this._unhideType = props.type;
27343
- if (props.hovered !== void 0) this._hovered = props.hovered;
27344
- if (props.hasPrevious !== void 0) this._hasPrevious = props.hasPrevious;
27345
- if (props.hasNext !== void 0) this._hasNext = props.hasNext;
27346
- this.transformByState({
27347
- width: this._size * (this._unhideType === 1 ? 2 : 1),
27348
- height: this._size * (this._unhideType === 0 ? 2 : 1)
27349
- });
27435
+ _initialize() {
27436
+ this.disposeWithMe((0, _univerjs_core.toDisposable)(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((skeleton) => {
27437
+ if (!(skeleton === null || skeleton === void 0 ? void 0 : skeleton.unitId)) return;
27438
+ if (!this._sheetClipboardService.getPasteMenuVisible()) return;
27439
+ const pasteOptionsCache = this._sheetClipboardService.getPasteOptionsCache();
27440
+ const menuUnitId = pasteOptionsCache === null || pasteOptionsCache === void 0 ? void 0 : pasteOptionsCache.target.unitId;
27441
+ if (skeleton.unitId === menuUnitId) this._sheetClipboardController.refreshOptionalPaste();
27442
+ })));
27350
27443
  }
27351
- _draw(ctx) {
27352
- if (this._unhideType === 0) this._drawOnRow(ctx);
27353
- else this._drawOnCol(ctx);
27444
+ };
27445
+ ClipboardRenderController = __decorate([
27446
+ __decorateParam(1, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
27447
+ __decorateParam(2, ISheetClipboardService),
27448
+ __decorateParam(3, (0, _univerjs_core.Inject)(SheetClipboardController))
27449
+ ], ClipboardRenderController);
27450
+
27451
+ //#endregion
27452
+ //#region src/controllers/render-controllers/format-painter.render-controller.ts
27453
+ let FormatPainterRenderController = class FormatPainterRenderController extends _univerjs_core.Disposable {
27454
+ constructor(_context, _formatPainterService, _selectionRenderService, _commandService) {
27455
+ super();
27456
+ this._context = _context;
27457
+ this._formatPainterService = _formatPainterService;
27458
+ this._selectionRenderService = _selectionRenderService;
27459
+ this._commandService = _commandService;
27460
+ this._initialize();
27354
27461
  }
27355
- _drawOnRow(ctx) {
27356
- if (this._hovered) if (!this._hasNext || !this._hasPrevious) _univerjs_engine_render.Rect.drawWith(ctx, {
27357
- width: this._size,
27358
- height: this._size,
27359
- stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
27360
- fill: HEADER_MENU_BACKGROUND_COLOR
27361
- });
27362
- else _univerjs_engine_render.Rect.drawWith(ctx, {
27363
- width: this._size,
27364
- height: 2 * this._size,
27365
- stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
27366
- fill: HEADER_MENU_BACKGROUND_COLOR
27367
- });
27368
- const iconSize = this._size * .5 * this._iconRatio;
27369
- const sixtyDegree = Math.PI / 3;
27370
- const top = iconSize * Math.cos(sixtyDegree);
27371
- const left = iconSize * Math.sin(sixtyDegree);
27372
- if (this._hasPrevious) _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
27373
- pointsGroup: [[
27374
- {
27375
- x: this._size / 2,
27376
- y: this._size / 2 - left
27377
- },
27378
- {
27379
- x: this._size / 2 - left,
27380
- y: this._size / 2 + top
27381
- },
27382
- {
27383
- x: this._size / 2 + left,
27384
- y: this._size / 2 + top
27385
- }
27386
- ]],
27387
- fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
27388
- });
27389
- if (this._hasNext) {
27390
- const offset = this._hasPrevious ? 3 : 1;
27391
- _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
27392
- pointsGroup: [[
27393
- {
27394
- x: this._size / 2,
27395
- y: this._size * offset / 2 + left
27396
- },
27397
- {
27398
- x: this._size / 2 - left,
27399
- y: this._size * offset / 2 - top
27400
- },
27401
- {
27402
- x: this._size / 2 + left,
27403
- y: this._size * offset / 2 - top
27404
- }
27405
- ]],
27406
- fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
27407
- });
27408
- }
27462
+ _initialize() {
27463
+ this._bindFormatPainterStatus();
27464
+ this._commandExecutedListener();
27409
27465
  }
27410
- /**
27411
- *
27412
- * @param ctx
27413
- */
27414
- _drawOnCol(ctx) {
27415
- if (this._hovered) if (!this._hasNext || !this._hasPrevious) _univerjs_engine_render.Rect.drawWith(ctx, {
27416
- width: this._size,
27417
- height: this._size,
27418
- stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
27419
- fill: HEADER_MENU_BACKGROUND_COLOR
27420
- });
27421
- else _univerjs_engine_render.Rect.drawWith(ctx, {
27422
- width: 2 * this._size,
27423
- height: this._size,
27424
- stroke: HEADER_MENU_SHAPE_TRIANGLE_FILL,
27425
- fill: HEADER_MENU_BACKGROUND_COLOR
27426
- });
27427
- const iconSize = this._size * .5 * this._iconRatio;
27428
- const sixtyDegree = Math.PI / 3;
27429
- const top = iconSize * Math.cos(sixtyDegree);
27430
- const left = iconSize * Math.sin(sixtyDegree);
27431
- if (this._hasPrevious) _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
27432
- pointsGroup: [[
27433
- {
27434
- x: -top + this._size / 2,
27435
- y: this._size / 2
27436
- },
27437
- {
27438
- x: this._size / 2 + left,
27439
- y: this._size / 2 - left
27440
- },
27441
- {
27442
- x: this._size / 2 + left,
27443
- y: this._size / 2 + left
27444
- }
27445
- ]],
27446
- fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
27447
- });
27448
- if (this._hasNext) {
27449
- const offset = this._hasPrevious ? 3 : 1;
27450
- _univerjs_engine_render.RegularPolygon.drawWith(ctx, {
27451
- pointsGroup: [[
27452
- {
27453
- x: top + this._size * offset / 2,
27454
- y: this._size / 2
27455
- },
27456
- {
27457
- x: -left + this._size * offset / 2,
27458
- y: this._size / 2 - left
27459
- },
27460
- {
27461
- x: -left + this._size * offset / 2,
27462
- y: this._size / 2 + left
27466
+ _commandExecutedListener() {
27467
+ this.disposeWithMe(this._selectionRenderService.selectionMoveEnd$.subscribe((selections) => {
27468
+ if (this._formatPainterService.getStatus() !== 0) {
27469
+ var _this$_context$unit$g;
27470
+ const { rangeWithCoord } = selections[selections.length - 1];
27471
+ this._commandService.executeCommand(ApplyFormatPainterCommand.id, {
27472
+ unitId: this._context.unitId,
27473
+ subUnitId: ((_this$_context$unit$g = this._context.unit.getActiveSheet()) === null || _this$_context$unit$g === void 0 ? void 0 : _this$_context$unit$g.getSheetId()) || "",
27474
+ range: {
27475
+ startRow: rangeWithCoord.startRow,
27476
+ startColumn: rangeWithCoord.startColumn,
27477
+ endRow: rangeWithCoord.endRow,
27478
+ endColumn: rangeWithCoord.endColumn
27463
27479
  }
27464
- ]],
27465
- fill: HEADER_MENU_SHAPE_TRIANGLE_FILL
27466
- });
27467
- }
27480
+ });
27481
+ if (this._formatPainterService.getStatus() === 1) this._commandService.executeCommand(SetOnceFormatPainterCommand.id);
27482
+ }
27483
+ }));
27484
+ }
27485
+ _bindFormatPainterStatus() {
27486
+ this.disposeWithMe((0, _univerjs_core.toDisposable)(this._formatPainterService.status$.subscribe((status) => {
27487
+ const scene = this._context.scene;
27488
+ if (!scene) return;
27489
+ if (status !== 0) scene.setDefaultCursor(_univerjs_engine_render.CURSOR_TYPE.CELL);
27490
+ else scene.setDefaultCursor(_univerjs_engine_render.CURSOR_TYPE.DEFAULT);
27491
+ })));
27468
27492
  }
27469
27493
  };
27494
+ FormatPainterRenderController = __decorate([
27495
+ __decorateParam(1, IFormatPainterService),
27496
+ __decorateParam(2, ISheetSelectionRenderService),
27497
+ __decorateParam(3, _univerjs_core.ICommandService)
27498
+ ], FormatPainterRenderController);
27470
27499
 
27471
27500
  //#endregion
27472
- //#region src/controllers/render-controllers/header-unhide.render-controller.ts
27473
- const HEADER_UNHIDE_CONTROLLER_SHAPE = "__SpreadsheetHeaderUnhideSHAPEControllerShape__";
27474
- let HeaderUnhideRenderController = class HeaderUnhideRenderController extends _univerjs_core.RxDisposable {
27475
- get _workbook() {
27476
- return this._context.unit;
27477
- }
27478
- constructor(_context, _sheetSkeletonManagerService, _commandService) {
27501
+ //#region src/controllers/render-controllers/header-menu.render-controller.ts
27502
+ const HEADER_MENU_CONTROLLER_SHAPE = "__SpreadsheetHeaderMenuSHAPEControllerShape__";
27503
+ const HEADER_MENU_CONTROLLER_MENU = "__SpreadsheetHeaderMenuMAINControllerShape__";
27504
+ const HEADER_MENU_CONTROLLER_SHAPE_COLOR = "rgba(0, 0, 0, 0.1)";
27505
+ let HeaderMenuRenderController = class HeaderMenuRenderController extends _univerjs_core.Disposable {
27506
+ constructor(_context, _sheetSkeletonManagerService, _contextMenuService, _commandService, _selectionManagerService) {
27479
27507
  super();
27480
27508
  this._context = _context;
27481
27509
  this._sheetSkeletonManagerService = _sheetSkeletonManagerService;
27510
+ this._contextMenuService = _contextMenuService;
27482
27511
  this._commandService = _commandService;
27483
- _defineProperty(this, "_shapes", {
27484
- cols: [],
27485
- rows: []
27486
- });
27487
- this._init();
27512
+ this._selectionManagerService = _selectionManagerService;
27513
+ _defineProperty(this, "_hoverRect", void 0);
27514
+ _defineProperty(this, "_hoverMenu", void 0);
27515
+ _defineProperty(this, "_currentColumn", Number.POSITIVE_INFINITY);
27516
+ _defineProperty(this, "_headerPointerSubs", void 0);
27517
+ _defineProperty(this, "_colHeaderPointerSubs", void 0);
27518
+ this._initialize();
27488
27519
  }
27489
27520
  dispose() {
27490
- super.dispose();
27491
- this._clearShapes();
27521
+ var _this$_hoverRect, _this$_hoverMenu, _this$_headerPointerS;
27522
+ (_this$_hoverRect = this._hoverRect) === null || _this$_hoverRect === void 0 || _this$_hoverRect.dispose();
27523
+ (_this$_hoverMenu = this._hoverMenu) === null || _this$_hoverMenu === void 0 || _this$_hoverMenu.dispose();
27524
+ (_this$_headerPointerS = this._headerPointerSubs) === null || _this$_headerPointerS === void 0 || _this$_headerPointerS.unsubscribe();
27525
+ this._headerPointerSubs = null;
27492
27526
  }
27493
- _init() {
27494
- let activeSheetId = "";
27495
- this._context.unit.activeSheet$.pipe((0, rxjs.takeUntil)(this.dispose$)).subscribe((worksheet) => {
27496
- this._clearShapes();
27497
- if (!worksheet) {
27498
- activeSheetId = "";
27499
- return;
27500
- }
27501
- activeSheetId = worksheet.getSheetId();
27502
- this._update(this._workbook, worksheet);
27527
+ _initialize() {
27528
+ const scene = this._context.scene;
27529
+ this._hoverRect = new _univerjs_engine_render.Rect(HEADER_MENU_CONTROLLER_SHAPE, {
27530
+ fill: HEADER_MENU_CONTROLLER_SHAPE_COLOR,
27531
+ evented: false
27503
27532
  });
27504
- this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((param) => {
27505
- if (param) {
27506
- const { unitId, sheetId } = param;
27507
- if (unitId === this._workbook.getUnitId() && sheetId === activeSheetId) {
27508
- const worksheet = this._workbook.getSheetBySheetId(sheetId);
27509
- if (worksheet) this._update(this._workbook, worksheet);
27533
+ this._hoverMenu = new HeaderMenuShape(HEADER_MENU_CONTROLLER_MENU, {
27534
+ zIndex: 100,
27535
+ visible: false
27536
+ });
27537
+ scene.addObjects([this._hoverRect, this._hoverMenu], 10);
27538
+ this._initialHover(0);
27539
+ this._initialHover(1);
27540
+ this._initialHoverMenu();
27541
+ }
27542
+ _initialHover(initialType = 0) {
27543
+ var _this$_headerPointerS2, _this$_headerPointerS3, _this$_headerPointerS4;
27544
+ const spreadsheetColumnHeader = this._context.components.get("__SpreadsheetColumnHeader__");
27545
+ const spreadsheetRowHeader = this._context.components.get("__SpreadsheetRowHeader__");
27546
+ const eventBindingObject = initialType === 0 ? spreadsheetRowHeader : spreadsheetColumnHeader;
27547
+ const pointerMoveHandler = (evt) => {
27548
+ var _this$_sheetSkeletonM;
27549
+ const skeleton = (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getCurrentParam()) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton;
27550
+ if (skeleton == null) return;
27551
+ const { rowBaseWidth, rowGutterWidth, columnBaseHeight, columnGutterHeight } = getHeaderBaseLayout(skeleton);
27552
+ const { startX, startY, endX, endY, column } = getCoordByOffset(evt.offsetX, evt.offsetY, this._context.scene, skeleton);
27553
+ if (initialType === 0) {
27554
+ var _this$_hoverRect2;
27555
+ (_this$_hoverRect2 = this._hoverRect) === null || _this$_hoverRect2 === void 0 || _this$_hoverRect2.transformByState({
27556
+ width: rowBaseWidth,
27557
+ height: endY - startY,
27558
+ left: rowGutterWidth,
27559
+ top: startY
27560
+ });
27561
+ } else {
27562
+ var _this$_hoverRect3;
27563
+ this._currentColumn = column;
27564
+ (_this$_hoverRect3 = this._hoverRect) === null || _this$_hoverRect3 === void 0 || _this$_hoverRect3.transformByState({
27565
+ width: endX - startX,
27566
+ height: columnBaseHeight,
27567
+ left: startX,
27568
+ top: columnGutterHeight
27569
+ });
27570
+ if (this._hoverMenu == null) return;
27571
+ if (endX - startX < columnBaseHeight * 2) {
27572
+ this._hoverMenu.hide();
27573
+ return;
27510
27574
  }
27575
+ const menuSize = columnBaseHeight * .8;
27576
+ this._hoverMenu.transformByState({
27577
+ left: endX - columnBaseHeight,
27578
+ top: columnGutterHeight + columnBaseHeight / 2 - menuSize / 2
27579
+ });
27580
+ this._hoverMenu.setShapeProps({ size: menuSize });
27581
+ this._hoverMenu.show();
27511
27582
  }
27512
- }));
27583
+ };
27584
+ const pointerEnterHandler = () => {
27585
+ var _this$_hoverRect4;
27586
+ (_this$_hoverRect4 = this._hoverRect) === null || _this$_hoverRect4 === void 0 || _this$_hoverRect4.show();
27587
+ };
27588
+ const pointerLeaveHandler = () => {
27589
+ var _this$_hoverRect5, _this$_hoverMenu2;
27590
+ (_this$_hoverRect5 = this._hoverRect) === null || _this$_hoverRect5 === void 0 || _this$_hoverRect5.hide();
27591
+ (_this$_hoverMenu2 = this._hoverMenu) === null || _this$_hoverMenu2 === void 0 || _this$_hoverMenu2.hide();
27592
+ };
27593
+ this._headerPointerSubs = new rxjs.Subscription();
27594
+ const headerPointerMoveSub = eventBindingObject.onPointerMove$.subscribeEvent(pointerMoveHandler);
27595
+ const headerPointerEnterSub = eventBindingObject.onPointerEnter$.subscribeEvent(pointerEnterHandler);
27596
+ const headerPointerLeaveSub = eventBindingObject.onPointerLeave$.subscribeEvent(pointerLeaveHandler);
27597
+ (_this$_headerPointerS2 = this._headerPointerSubs) === null || _this$_headerPointerS2 === void 0 || _this$_headerPointerS2.add(headerPointerMoveSub);
27598
+ (_this$_headerPointerS3 = this._headerPointerSubs) === null || _this$_headerPointerS3 === void 0 || _this$_headerPointerS3.add(headerPointerEnterSub);
27599
+ (_this$_headerPointerS4 = this._headerPointerSubs) === null || _this$_headerPointerS4 === void 0 || _this$_headerPointerS4.add(headerPointerLeaveSub);
27513
27600
  }
27514
- _update(workbook, worksheet) {
27515
- var _this$_sheetSkeletonM;
27516
- const skeleton = (_this$_sheetSkeletonM = this._sheetSkeletonManagerService.getSkeletonParam(worksheet.getSheetId())) === null || _this$_sheetSkeletonM === void 0 ? void 0 : _this$_sheetSkeletonM.skeleton;
27517
- if (!skeleton) return;
27518
- const hiddenRowRanges = worksheet.getHiddenRows();
27519
- const hiddenColRanges = worksheet.getHiddenCols();
27520
- const { scene } = this._getSheetObject();
27521
- const rowCount = worksheet.getRowCount();
27522
- const rowShapes = hiddenRowRanges.map((range) => {
27523
- const { startRow, endRow } = range;
27524
- const position = getCoordByCell(startRow, 0, scene, skeleton);
27525
- const hasPrevious = startRow !== 0;
27526
- const hasNext = endRow !== rowCount - 1;
27527
- return new HeaderUnhideShape(HEADER_UNHIDE_CONTROLLER_SHAPE, {
27528
- type: 0,
27529
- hovered: false,
27530
- hasPrevious,
27531
- hasNext,
27532
- top: position.startY - (hasPrevious ? 12 : 0),
27533
- left: position.startX - 12
27534
- }, () => this._commandService.executeCommand(_univerjs_sheets.SetSpecificRowsVisibleCommand.id, {
27535
- unitId: workbook.getUnitId(),
27536
- subUnitId: worksheet.getSheetId(),
27537
- ranges: [range]
27538
- }));
27601
+ _initialHoverMenu() {
27602
+ if (this._hoverMenu == null) return;
27603
+ this._hoverMenu.onPointerEnter$.subscribeEvent(() => {
27604
+ if (this._hoverMenu == null) return;
27605
+ this._hoverMenu.setProps({
27606
+ mode: 1,
27607
+ visible: true
27608
+ });
27609
+ this._context.scene.setCursor(_univerjs_engine_render.CURSOR_TYPE.POINTER);
27539
27610
  });
27540
- const colCount = worksheet.getColumnCount();
27541
- const colShapes = hiddenColRanges.map((range) => {
27542
- const { startColumn, endColumn } = range;
27543
- const position = getCoordByCell(0, startColumn, scene, skeleton);
27544
- const hasPrevious = startColumn !== 0;
27545
- const hasNext = endColumn !== colCount - 1;
27546
- return new HeaderUnhideShape(HEADER_UNHIDE_CONTROLLER_SHAPE, {
27547
- type: 1,
27548
- hovered: false,
27549
- hasPrevious,
27550
- hasNext,
27551
- top: 20 - 12,
27552
- left: position.startX - (hasPrevious ? 12 : 0)
27553
- }, () => this._commandService.executeCommand(_univerjs_sheets.SetSpecificColsVisibleCommand.id, {
27554
- unitId: workbook.getUnitId(),
27555
- subUnitId: worksheet.getSheetId(),
27556
- ranges: [range]
27557
- }));
27611
+ this._hoverMenu.onPointerLeave$.subscribeEvent(() => {
27612
+ if (this._hoverMenu == null) return;
27613
+ this._hoverMenu.setProps({
27614
+ mode: 0,
27615
+ visible: false
27616
+ });
27617
+ this._context.scene.resetCursor();
27618
+ });
27619
+ this._hoverMenu.onPointerDown$.subscribeEvent((evt) => {
27620
+ var _this$_selectionManag;
27621
+ const currentColumn = this._currentColumn;
27622
+ const currentSelectionDatas = (_this$_selectionManag = this._selectionManagerService.getCurrentSelections()) === null || _this$_selectionManag === void 0 ? void 0 : _this$_selectionManag.map((s) => s.range);
27623
+ if (!!!(currentSelectionDatas === null || currentSelectionDatas === void 0 ? void 0 : currentSelectionDatas.filter((range) => range.rangeType === _univerjs_core.RANGE_TYPE.COLUMN).find((data) => {
27624
+ const { startColumn, endColumn } = data;
27625
+ if (currentColumn >= startColumn && currentColumn <= endColumn) return true;
27626
+ return false;
27627
+ }))) {
27628
+ const selection = this._getSelectionOnColumn(currentColumn);
27629
+ this._commandService.syncExecuteCommand(_univerjs_sheets.SetSelectionsOperation.id, selection);
27630
+ }
27631
+ evt.stopPropagation();
27632
+ evt.preventDefault();
27633
+ this._contextMenuService.triggerContextMenu(evt, _univerjs_ui.ContextMenuPosition.COL_HEADER);
27558
27634
  });
27559
- scene.addObjects(colShapes, 12);
27560
- scene.addObjects(rowShapes, 12);
27561
- this._clearShapes();
27562
- this._shapes = {
27563
- cols: colShapes,
27564
- rows: rowShapes
27565
- };
27566
27635
  }
27567
- _clearShapes() {
27568
- this._shapes.cols.forEach((shape) => shape.dispose());
27569
- this._shapes.rows.forEach((shape) => shape.dispose());
27570
- this._shapes = {
27571
- cols: [],
27572
- rows: []
27636
+ _getSelectionOnColumn(column) {
27637
+ const workbook = this._context.unit;
27638
+ const worksheet = workbook.getActiveSheet();
27639
+ if (!worksheet) throw new Error("No active worksheet");
27640
+ return {
27641
+ unitId: workbook.getUnitId(),
27642
+ subUnitId: worksheet.getSheetId(),
27643
+ selections: [{
27644
+ range: {
27645
+ startRow: 0,
27646
+ startColumn: column,
27647
+ endRow: worksheet.getRowCount() - 1,
27648
+ endColumn: column,
27649
+ rangeType: _univerjs_core.RANGE_TYPE.COLUMN
27650
+ },
27651
+ primary: {
27652
+ startRow: 0,
27653
+ startColumn: column,
27654
+ endRow: 0,
27655
+ endColumn: column,
27656
+ actualRow: 0,
27657
+ actualColumn: column,
27658
+ isMerged: false,
27659
+ isMergedMainCell: false
27660
+ },
27661
+ style: null
27662
+ }]
27573
27663
  };
27574
27664
  }
27575
- _getSheetObject() {
27576
- return getSheetObject(this._workbook, this._context);
27577
- }
27578
27665
  };
27579
- HeaderUnhideRenderController = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)), __decorateParam(2, _univerjs_core.ICommandService)], HeaderUnhideRenderController);
27666
+ HeaderMenuRenderController = __decorate([
27667
+ __decorateParam(1, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)),
27668
+ __decorateParam(2, _univerjs_ui.IContextMenuService),
27669
+ __decorateParam(3, _univerjs_core.ICommandService),
27670
+ __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetsSelectionsService))
27671
+ ], HeaderMenuRenderController);
27672
+ function getHeaderBaseLayout(skeleton) {
27673
+ var _skeleton$worksheet$g, _skeleton$worksheet, _config$rowHeader, _config$columnHeader;
27674
+ const config = (_skeleton$worksheet$g = (_skeleton$worksheet = skeleton.worksheet).getConfig) === null || _skeleton$worksheet$g === void 0 ? void 0 : _skeleton$worksheet$g.call(_skeleton$worksheet);
27675
+ const configuredRowWidth = config === null || config === void 0 || (_config$rowHeader = config.rowHeader) === null || _config$rowHeader === void 0 ? void 0 : _config$rowHeader.width;
27676
+ const configuredColumnHeight = config === null || config === void 0 || (_config$columnHeader = config.columnHeader) === null || _config$columnHeader === void 0 ? void 0 : _config$columnHeader.height;
27677
+ const rowBaseWidth = typeof configuredRowWidth === "number" && configuredRowWidth > 0 ? Math.min(configuredRowWidth, skeleton.rowHeaderWidth) : skeleton.rowHeaderWidth;
27678
+ const columnBaseHeight = typeof configuredColumnHeight === "number" && configuredColumnHeight > 0 ? Math.min(configuredColumnHeight, skeleton.columnHeaderHeight) : skeleton.columnHeaderHeight;
27679
+ return {
27680
+ rowBaseWidth,
27681
+ rowGutterWidth: Math.max(0, skeleton.rowHeaderWidthAndMarginLeft - rowBaseWidth),
27682
+ columnBaseHeight,
27683
+ columnGutterHeight: Math.max(0, skeleton.columnHeaderHeightAndMarginTop - columnBaseHeight)
27684
+ };
27685
+ }
27580
27686
 
27581
27687
  //#endregion
27582
27688
  //#region src/consts/mobile-context.ts
@@ -28883,7 +28989,7 @@ let SheetSkeletonRenderController = class SheetSkeletonRenderController extends
28883
28989
  }));
28884
28990
  }
28885
28991
  _updateSceneSize(param) {
28886
- var _this$_renderManagerS;
28992
+ var _this$_renderManagerS, _scene$getViewport, _scene$getViewport2, _scene$getViewport3, _scene$getViewport4, _scene$getViewport5;
28887
28993
  if (param == null) return;
28888
28994
  const { unitId } = this._context;
28889
28995
  const { skeleton } = param;
@@ -28896,6 +29002,30 @@ let SheetSkeletonRenderController = class SheetSkeletonRenderController extends
28896
29002
  height: columnHeaderHeightAndMarginTop + rowTotalHeight
28897
29003
  });
28898
29004
  scene.getMainViewport().setMargin(rowHeaderWidthAndMarginLeft, columnHeaderHeightAndMarginTop);
29005
+ scene.getMainViewport().resizeWhenFreezeChange({
29006
+ left: rowHeaderWidthAndMarginLeft,
29007
+ top: columnHeaderHeightAndMarginTop
29008
+ });
29009
+ (_scene$getViewport = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT)) === null || _scene$getViewport === void 0 || _scene$getViewport.resizeWhenFreezeChange({
29010
+ left: rowHeaderWidthAndMarginLeft,
29011
+ height: columnHeaderHeightAndMarginTop
29012
+ });
29013
+ (_scene$getViewport2 = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT)) === null || _scene$getViewport2 === void 0 || _scene$getViewport2.resizeWhenFreezeChange({
29014
+ left: rowHeaderWidthAndMarginLeft,
29015
+ height: columnHeaderHeightAndMarginTop
29016
+ });
29017
+ (_scene$getViewport3 = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM)) === null || _scene$getViewport3 === void 0 || _scene$getViewport3.resizeWhenFreezeChange({
29018
+ width: rowHeaderWidthAndMarginLeft,
29019
+ top: columnHeaderHeightAndMarginTop
29020
+ });
29021
+ (_scene$getViewport4 = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_ROW_TOP)) === null || _scene$getViewport4 === void 0 || _scene$getViewport4.resizeWhenFreezeChange({
29022
+ width: rowHeaderWidthAndMarginLeft,
29023
+ top: columnHeaderHeightAndMarginTop
29024
+ });
29025
+ (_scene$getViewport5 = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP)) === null || _scene$getViewport5 === void 0 || _scene$getViewport5.resizeWhenFreezeChange({
29026
+ width: rowHeaderWidthAndMarginLeft,
29027
+ height: columnHeaderHeightAndMarginTop
29028
+ });
28899
29029
  }
28900
29030
  };
28901
29031
  SheetSkeletonRenderController = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(SheetSkeletonManagerService)), __decorateParam(2, _univerjs_engine_render.IRenderManagerService)], SheetSkeletonRenderController);
@@ -29100,7 +29230,7 @@ function DateDropdown(props) {
29100
29230
  variant: "primary",
29101
29231
  onClick: handleSave,
29102
29232
  disabled: !date || !date.isValid(),
29103
- children: localeService.t("dataValidation.alert.ok")
29233
+ children: localeService.t("sheets-ui.data-validation.alert.ok")
29104
29234
  })
29105
29235
  })]
29106
29236
  });
@@ -29109,12 +29239,6 @@ DateDropdown.componentKey = "sheets.dropdown.date";
29109
29239
 
29110
29240
  //#endregion
29111
29241
  //#region src/views/dropdown/list-dropdown/index.tsx
29112
- function serializeListOptions(options) {
29113
- return options.filter(Boolean).join(",");
29114
- }
29115
- function deserializeListOptions(optionsStr) {
29116
- return optionsStr.split(",").filter(Boolean);
29117
- }
29118
29242
  function SelectList(props) {
29119
29243
  const { value, onChange, multiple, options, title, onEdit, style, location, showEdit: showEditOnDropdown, showSearch: showSearchOnDropdown } = props;
29120
29244
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
@@ -29219,7 +29343,7 @@ function SelectList(props) {
29219
29343
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
29220
29344
  className: "univer-block univer-cursor-pointer univer-rounded univer-px-1.5 univer-py-1 univer-text-xs hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800",
29221
29345
  onClick: onEdit,
29222
- children: localeService.t("dataValidation.list.edit")
29346
+ children: localeService.t("sheets-ui.data-validation.list.edit")
29223
29347
  })
29224
29348
  })
29225
29349
  ]
@@ -29239,11 +29363,11 @@ function ListDropDown(props) {
29239
29363
  minWidth: cellWidth,
29240
29364
  maxWidth: Math.max(cellWidth, 200)
29241
29365
  },
29242
- title: multiple ? localeService.t("dataValidation.listMultiple.dropdown") : localeService.t("dataValidation.list.dropdown"),
29243
- value: deserializeListOptions(localValue !== null && localValue !== void 0 ? localValue : ""),
29366
+ title: multiple ? localeService.t("sheets-ui.data-validation.listMultiple.dropdown") : localeService.t("sheets-ui.data-validation.list.dropdown"),
29367
+ value: (0, _univerjs_sheets.deserializeListOptions)(localValue !== null && localValue !== void 0 ? localValue : ""),
29244
29368
  multiple,
29245
29369
  onChange: async (newValue) => {
29246
- setLocalValue(serializeListOptions(newValue));
29370
+ setLocalValue((0, _univerjs_sheets.serializeListOptions)(newValue));
29247
29371
  if (!(await (onChange === null || onChange === void 0 ? void 0 : onChange(newValue)) === false)) hideFn();
29248
29372
  },
29249
29373
  options,
@@ -29729,16 +29853,18 @@ let MobileSheetsSelectionRenderService = class MobileSheetsSelectionRenderServic
29729
29853
  */
29730
29854
  newSelectionControl(scene, skeleton, selection) {
29731
29855
  const selectionControls = this.getSelectionControls();
29732
- const { rowHeaderWidth, columnHeaderHeight } = skeleton;
29856
+ const { rowHeaderWidth, rowHeaderWidthAndMarginLeft, columnHeaderHeight, columnHeaderHeightAndMarginTop } = skeleton;
29733
29857
  const rangeType = selection.range.rangeType;
29734
29858
  const control = new MobileSelectionControl(scene, selectionControls.length, this._themeService, {
29735
29859
  highlightHeader: this._highlightHeader,
29736
29860
  rowHeaderWidth,
29737
29861
  columnHeaderHeight,
29862
+ rowHeaderOffsetX: Math.max(0, rowHeaderWidthAndMarginLeft - rowHeaderWidth),
29863
+ columnHeaderOffsetY: Math.max(0, columnHeaderHeightAndMarginTop - columnHeaderHeight),
29738
29864
  rangeType
29739
29865
  });
29740
29866
  const selectionWithCoord = (0, _univerjs_sheets.attachSelectionWithCoord)(selection, skeleton);
29741
- control.updateRangeBySelectionWithCoord(selectionWithCoord);
29867
+ control.updateRangeBySelectionWithCoord(selectionWithCoord, skeleton);
29742
29868
  this._selectionControls.push(control);
29743
29869
  const { expandingModeForTopLeft, expandingModeForBottomRight } = (() => {
29744
29870
  switch (rangeType) {
@@ -30014,6 +30140,7 @@ let UniverSheetsMobileUIPlugin = class UniverSheetsMobileUIPlugin extends _unive
30014
30140
  [IStatusBarService, { useClass: StatusBarService }],
30015
30141
  [IMarkSelectionService, { useClass: MarkSelectionService }],
30016
30142
  [HoverManagerService],
30143
+ [HeaderUnhideRangeService],
30017
30144
  [DragManagerService],
30018
30145
  [SheetCanvasPopManagerService],
30019
30146
  [CellPopupManagerService],
@@ -30609,6 +30736,7 @@ let UniverSheetsUIPlugin = class UniverSheetsUIPlugin extends _univerjs_core.Plu
30609
30736
  [IStatusBarService, { useClass: StatusBarService }],
30610
30737
  [IMarkSelectionService, { useClass: MarkSelectionService }],
30611
30738
  [HoverManagerService],
30739
+ [HeaderUnhideRangeService],
30612
30740
  [DragManagerService],
30613
30741
  [SheetCanvasPopManagerService],
30614
30742
  [CellPopupManagerService],
@@ -30823,6 +30951,7 @@ Object.defineProperty(exports, 'FormulaEditorController', {
30823
30951
  return FormulaEditorController;
30824
30952
  }
30825
30953
  });
30954
+ exports.HEADER_UNHIDE_RANGE_VISIBLE_CHECK = HEADER_UNHIDE_RANGE_VISIBLE_CHECK;
30826
30955
  Object.defineProperty(exports, 'HeaderFreezeRenderController', {
30827
30956
  enumerable: true,
30828
30957
  get: function () {
@@ -30841,6 +30970,14 @@ Object.defineProperty(exports, 'HeaderResizeRenderController', {
30841
30970
  return HeaderResizeRenderController;
30842
30971
  }
30843
30972
  });
30973
+ exports.HeaderUnhideRangeAxis = HeaderUnhideRangeAxis;
30974
+ exports.HeaderUnhideRangeService = HeaderUnhideRangeService;
30975
+ Object.defineProperty(exports, 'HeaderUnhideRenderController', {
30976
+ enumerable: true,
30977
+ get: function () {
30978
+ return HeaderUnhideRenderController;
30979
+ }
30980
+ });
30844
30981
  exports.HideColConfirmCommand = HideColConfirmCommand;
30845
30982
  exports.HideRowConfirmCommand = HideRowConfirmCommand;
30846
30983
  Object.defineProperty(exports, 'HoverManagerService', {