@univerjs/sheets-ui 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/lib/cjs/index.js +775 -483
  2. package/lib/cjs/locale/ar-SA.js +15 -0
  3. package/lib/cjs/locale/ca-ES.js +15 -0
  4. package/lib/cjs/locale/de-DE.js +15 -0
  5. package/lib/cjs/locale/en-US.js +15 -0
  6. package/lib/cjs/locale/es-ES.js +15 -0
  7. package/lib/cjs/locale/fa-IR.js +15 -0
  8. package/lib/cjs/locale/fr-FR.js +15 -0
  9. package/lib/cjs/locale/id-ID.js +15 -0
  10. package/lib/cjs/locale/it-IT.js +15 -0
  11. package/lib/cjs/locale/ja-JP.js +15 -0
  12. package/lib/cjs/locale/ko-KR.js +15 -0
  13. package/lib/cjs/locale/pl-PL.js +15 -0
  14. package/lib/cjs/locale/pt-BR.js +15 -0
  15. package/lib/cjs/locale/ru-RU.js +15 -0
  16. package/lib/cjs/locale/sk-SK.js +15 -0
  17. package/lib/cjs/locale/vi-VN.js +15 -0
  18. package/lib/cjs/locale/zh-CN.js +15 -0
  19. package/lib/cjs/locale/zh-HK.js +15 -0
  20. package/lib/cjs/locale/zh-TW.js +15 -0
  21. package/lib/es/index.js +742 -451
  22. package/lib/es/locale/ar-SA.js +15 -0
  23. package/lib/es/locale/ca-ES.js +15 -0
  24. package/lib/es/locale/de-DE.js +15 -0
  25. package/lib/es/locale/en-US.js +15 -0
  26. package/lib/es/locale/es-ES.js +15 -0
  27. package/lib/es/locale/fa-IR.js +15 -0
  28. package/lib/es/locale/fr-FR.js +15 -0
  29. package/lib/es/locale/id-ID.js +15 -0
  30. package/lib/es/locale/it-IT.js +15 -0
  31. package/lib/es/locale/ja-JP.js +15 -0
  32. package/lib/es/locale/ko-KR.js +15 -0
  33. package/lib/es/locale/pl-PL.js +15 -0
  34. package/lib/es/locale/pt-BR.js +15 -0
  35. package/lib/es/locale/ru-RU.js +15 -0
  36. package/lib/es/locale/sk-SK.js +15 -0
  37. package/lib/es/locale/vi-VN.js +15 -0
  38. package/lib/es/locale/zh-CN.js +15 -0
  39. package/lib/es/locale/zh-HK.js +15 -0
  40. package/lib/es/locale/zh-TW.js +15 -0
  41. package/lib/index.css +0 -28
  42. package/lib/index.js +742 -451
  43. package/lib/locale/ar-SA.js +15 -0
  44. package/lib/locale/ca-ES.js +15 -0
  45. package/lib/locale/de-DE.js +15 -0
  46. package/lib/locale/en-US.js +15 -0
  47. package/lib/locale/es-ES.js +15 -0
  48. package/lib/locale/fa-IR.js +15 -0
  49. package/lib/locale/fr-FR.js +15 -0
  50. package/lib/locale/id-ID.js +15 -0
  51. package/lib/locale/it-IT.js +15 -0
  52. package/lib/locale/ja-JP.js +15 -0
  53. package/lib/locale/ko-KR.js +15 -0
  54. package/lib/locale/pl-PL.js +15 -0
  55. package/lib/locale/pt-BR.js +15 -0
  56. package/lib/locale/ru-RU.js +15 -0
  57. package/lib/locale/sk-SK.js +15 -0
  58. package/lib/locale/vi-VN.js +15 -0
  59. package/lib/locale/zh-CN.js +15 -0
  60. package/lib/locale/zh-HK.js +15 -0
  61. package/lib/locale/zh-TW.js +15 -0
  62. package/lib/types/commands/commands/set-selection.command.d.ts +2 -0
  63. package/lib/types/{views/editor-container/index.d.ts → common/selection-input.d.ts} +3 -2
  64. package/lib/types/config/config.d.ts +6 -0
  65. package/lib/types/controllers/editor/data-sync.controller.d.ts +1 -0
  66. package/lib/types/controllers/editor/editing.render-controller.d.ts +1 -0
  67. package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +6 -3
  68. package/lib/types/controllers/render-controllers/desktop-cell-edit.render-controller.d.ts +3 -1
  69. package/lib/types/index.d.ts +6 -4
  70. package/lib/types/locale/en-US.d.ts +15 -0
  71. package/lib/types/menu/zoom.menu.d.ts +2 -2
  72. package/lib/types/services/cell-alert-manager.service.d.ts +1 -0
  73. package/lib/types/services/editor/cell-editor-resize.service.d.ts +6 -0
  74. package/lib/types/services/editor-bridge.service.d.ts +4 -0
  75. package/lib/types/services/hover-manager.service.d.ts +2 -2
  76. package/lib/types/services/selection/base-selection-render.service.d.ts +2 -0
  77. package/lib/types/services/selection/selection-control.d.ts +6 -1
  78. package/lib/types/services/selection/selection-render.service.d.ts +1 -0
  79. package/lib/types/views/border-panel/interface.d.ts +37 -4
  80. package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +5 -2
  81. package/lib/types/views/editor-container/focus-editor.d.ts +3 -2
  82. package/lib/umd/facade.js +3 -1
  83. package/lib/umd/index.js +12 -12
  84. package/lib/umd/locale/ar-SA.js +1 -1
  85. package/lib/umd/locale/ca-ES.js +1 -1
  86. package/lib/umd/locale/de-DE.js +1 -1
  87. package/lib/umd/locale/en-US.js +1 -1
  88. package/lib/umd/locale/es-ES.js +1 -1
  89. package/lib/umd/locale/fa-IR.js +1 -1
  90. package/lib/umd/locale/fr-FR.js +1 -1
  91. package/lib/umd/locale/id-ID.js +1 -1
  92. package/lib/umd/locale/it-IT.js +1 -1
  93. package/lib/umd/locale/ja-JP.js +1 -1
  94. package/lib/umd/locale/ko-KR.js +1 -1
  95. package/lib/umd/locale/pl-PL.js +1 -1
  96. package/lib/umd/locale/pt-BR.js +1 -1
  97. package/lib/umd/locale/ru-RU.js +1 -1
  98. package/lib/umd/locale/sk-SK.js +1 -1
  99. package/lib/umd/locale/vi-VN.js +1 -1
  100. package/lib/umd/locale/zh-CN.js +1 -1
  101. package/lib/umd/locale/zh-HK.js +1 -1
  102. package/lib/umd/locale/zh-TW.js +1 -1
  103. package/package.json +16 -16
  104. package/lib/types/views/sheet-slider/SheetZoomInput.d.ts +0 -18
package/lib/cjs/index.js CHANGED
@@ -241,7 +241,7 @@ let SHEET_VIEW_KEY = /* @__PURE__ */ function(SHEET_VIEW_KEY) {
241
241
  }({});
242
242
 
243
243
  //#endregion
244
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
244
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
245
245
  function _typeof(o) {
246
246
  "@babel/helpers - typeof";
247
247
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -252,7 +252,7 @@ function _typeof(o) {
252
252
  }
253
253
 
254
254
  //#endregion
255
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js
255
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
256
256
  function toPrimitive(t, r) {
257
257
  if ("object" != _typeof(t) || !t) return t;
258
258
  var e = t[Symbol.toPrimitive];
@@ -265,14 +265,14 @@ function toPrimitive(t, r) {
265
265
  }
266
266
 
267
267
  //#endregion
268
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js
268
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
269
269
  function toPropertyKey(t) {
270
270
  var i = toPrimitive(t, "string");
271
271
  return "symbol" == _typeof(i) ? i : i + "";
272
272
  }
273
273
 
274
274
  //#endregion
275
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js
275
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
276
276
  function _defineProperty(e, r, t) {
277
277
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
278
278
  value: t,
@@ -438,6 +438,15 @@ const SetColumnHeaderHeightCommand = {
438
438
  }
439
439
  };
440
440
 
441
+ //#endregion
442
+ //#region src/common/selection-input.ts
443
+ function isSheetContextMenuGesture(event, isMac, refSelectionsEnabled) {
444
+ return event.button === 2 || isMac && !refSelectionsEnabled && event.button === 0 && event.ctrlKey;
445
+ }
446
+ function isSheetMultiSelectModifier(event, isMac) {
447
+ return isMac ? event.metaKey : event.ctrlKey;
448
+ }
449
+
441
450
  //#endregion
442
451
  //#region src/services/selection/selection-layer.ts
443
452
  var SelectionLayer = class extends _univerjs_engine_render.Layer {
@@ -942,9 +951,15 @@ var BaseSelectionRenderService = class extends _univerjs_core.Disposable {
942
951
  rangeWithCoord
943
952
  };
944
953
  }
954
+ _isContextMenuGesture(evt) {
955
+ return isSheetContextMenuGesture(evt, this._injector.get(_univerjs_ui.IPlatformService).isMac, this.inRefSelectionMode());
956
+ }
957
+ _isMultiSelectModifier(evt) {
958
+ return isSheetMultiSelectModifier(evt, this._injector.get(_univerjs_ui.IPlatformService).isMac);
959
+ }
945
960
  _checkClearPreviousControls(evt) {
946
961
  if (this.getSelectionControls().length === 0) return;
947
- if (!evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !this._remainLastEnabled || this._singleSelectionEnabled && !evt.shiftKey) this._clearAllSelectionControls();
962
+ if (this._isContextMenuGesture(evt) && !this.inRefSelectionMode() || !this._isMultiSelectModifier(evt) && !evt.shiftKey && !this._remainLastEnabled || this._singleSelectionEnabled && !evt.shiftKey) this._clearAllSelectionControls();
948
963
  }
949
964
  _makeSelectionByTwoCells(currentCell, startSelectionRange, skeleton, rangeType, activeControl) {
950
965
  const { actualRow, actualColumn, mergeInfo: actualMergeInfo } = currentCell;
@@ -1030,7 +1045,7 @@ function genSelectionByRange(skeleton, range) {
1030
1045
  }
1031
1046
 
1032
1047
  //#endregion
1033
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorateParam.js
1048
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
1034
1049
  function __decorateParam(paramIndex, decorator) {
1035
1050
  return function(target, key) {
1036
1051
  decorator(target, key, paramIndex);
@@ -1038,7 +1053,7 @@ function __decorateParam(paramIndex, decorator) {
1038
1053
  }
1039
1054
 
1040
1055
  //#endregion
1041
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorate.js
1056
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
1042
1057
  function __decorate(decorators, target, key, desc) {
1043
1058
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1044
1059
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1850,6 +1865,7 @@ var SelectionShapeExtension = class {
1850
1865
  //#endregion
1851
1866
  //#region src/services/selection/selection-control.ts
1852
1867
  const SELECTION_TITLE_HIGHLIGHT_ALPHA = .3;
1868
+ const SELECTION_MOVE_DURATION = 120;
1853
1869
  /**
1854
1870
  * The main selection canvas component, includes leftControl,rightControl,topControl,bottomControl,backgroundControlTop,backgroundControlMiddleLeft,backgroundControlMiddleRight,backgroundControlBottom,fillControl
1855
1871
  */
@@ -1859,6 +1875,9 @@ var SelectionControl = class extends _univerjs_core.Disposable {
1859
1875
  this._scene = _scene;
1860
1876
  this._zIndex = _zIndex;
1861
1877
  this._themeService = _themeService;
1878
+ _defineProperty(this, "_moveAnimationFrame", -1);
1879
+ _defineProperty(this, "_animatedRange", null);
1880
+ _defineProperty(this, "_restoreMoveEvents", null);
1862
1881
  _defineProperty(this, "_isHelperSelection", true);
1863
1882
  _defineProperty(this, "_enableAutoFill", true);
1864
1883
  _defineProperty(this, "_showAutoFill", false);
@@ -1970,6 +1989,7 @@ var SelectionControl = class extends _univerjs_core.Disposable {
1970
1989
  scene.addObject(this._selectionShapeGroup, 1);
1971
1990
  this.disposeWithMe((0, _univerjs_core.toDisposable)(scene.onTransformChange$.subscribeEvent((state) => {
1972
1991
  if (state.type !== _univerjs_engine_render.TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale) return;
1992
+ this._stopMoveAnimation();
1973
1993
  this._updateLayoutOfSelectionControl(this._currentStyle);
1974
1994
  this._updateControlCoord();
1975
1995
  })));
@@ -2132,6 +2152,11 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2132
2152
  if (this._controlExtension) this._controlExtension.setDisabled(disable);
2133
2153
  }
2134
2154
  setEvent(state) {
2155
+ if (this._animatedRange) {
2156
+ this._stopMoveAnimation();
2157
+ this._updateLayoutOfSelectionControl();
2158
+ this._updateControlCoord();
2159
+ }
2135
2160
  this.leftControl.evented = state;
2136
2161
  this.rightControl.evented = state;
2137
2162
  this.topControl.evented = state;
@@ -2158,7 +2183,7 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2158
2183
  autofillStrokeWidth /= scale < 1 ? 1 : scale;
2159
2184
  const borderBuffer = _univerjs_sheets.SELECTION_CONTROL_BORDER_BUFFER_WIDTH / scale;
2160
2185
  const fixOnePixelBlurOffset = _univerjs_engine_render.FIX_ONE_PIXEL_BLUR_OFFSET / scale;
2161
- const { startX, startY, endX, endY } = this._selectionRenderModel;
2186
+ const { startX, startY, endX, endY } = this._animatedRange ?? this._selectionRenderModel;
2162
2187
  this.leftControl.transformByState({
2163
2188
  height: endY - startY,
2164
2189
  left: -leftAdjustWidth + fixOnePixelBlurOffset,
@@ -2239,19 +2264,20 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2239
2264
  this._autoFillControl.show();
2240
2265
  } else this._autoFillControl.hide();
2241
2266
  this._updateBackgroundControl(currentStyle);
2242
- this._updateHeaderBackground(currentStyle);
2267
+ if (!this._animatedRange) this._updateHeaderBackground(currentStyle);
2243
2268
  this._updateWidgets(currentStyle);
2244
2269
  }
2245
2270
  /**
2246
2271
  * update selection control coordination by curr selection model
2247
2272
  */
2248
2273
  _updateControlCoord() {
2249
- const { startX, startY } = this._selectionRenderModel;
2274
+ const { startX, startY } = this._animatedRange ?? this._selectionRenderModel;
2250
2275
  this.selectionShapeGroup.show();
2251
2276
  this.selectionShapeGroup.translate(startX, startY);
2252
2277
  this.selectionShapeGroup.makeDirtyNoDebounce(true);
2253
2278
  }
2254
2279
  updateStyle(style) {
2280
+ this._stopMoveAnimation();
2255
2281
  this._updateLayoutOfSelectionControl(style);
2256
2282
  this._updateControlCoord();
2257
2283
  }
@@ -2265,6 +2291,7 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2265
2291
  * @param primaryWithCoord
2266
2292
  */
2267
2293
  updateRange(rangeWithCoord, primaryWithCoord) {
2294
+ this._stopMoveAnimation();
2268
2295
  this._selectionRenderModel.setValue(rangeWithCoord, primaryWithCoord);
2269
2296
  this._showAutoFill = primaryWithCoord !== null;
2270
2297
  this._updateLayoutOfSelectionControl();
@@ -2274,7 +2301,11 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2274
2301
  * Update range and primary range and style.
2275
2302
  * @param selectionWthCoord
2276
2303
  */
2277
- updateRangeBySelectionWithCoord(selectionWthCoord, sk) {
2304
+ updateRangeBySelectionWithCoord(selectionWthCoord, sk, animate = false) {
2305
+ const previousRange = this._animatedRange ?? this.getRange();
2306
+ const targetRange = selectionWthCoord.rangeWithCoord;
2307
+ const rangeChanged = !_univerjs_core.Rectangle.equals(this.model, targetRange) || this.model.startX !== targetRange.startX || this.model.startY !== targetRange.startY || this.model.endX !== targetRange.endX || this.model.endY !== targetRange.endY;
2308
+ if (animate || rangeChanged || selectionWthCoord.primaryWithCoord === null) this._stopMoveAnimation();
2278
2309
  if (sk) {
2279
2310
  this._rowHeaderWidth = sk.rowHeaderWidth;
2280
2311
  this._columnHeaderHeight = sk.columnHeaderHeight;
@@ -2285,6 +2316,47 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2285
2316
  this._showAutoFill = selectionWthCoord.primaryWithCoord !== null;
2286
2317
  this._updateLayoutOfSelectionControl(selectionWthCoord.style);
2287
2318
  this._updateControlCoord();
2319
+ if (animate && rangeChanged && !window.matchMedia("(prefers-reduced-motion: reduce)").matches) this._animateMove(previousRange);
2320
+ }
2321
+ _animateMove(from) {
2322
+ const target = this.getRange();
2323
+ const startedAt = _univerjs_core.Tools.now();
2324
+ const eventedShapes = this.selectionShapeGroup.getObjects().filter((shape) => shape.evented);
2325
+ eventedShapes.forEach((shape) => {
2326
+ shape.evented = false;
2327
+ });
2328
+ this._restoreMoveEvents = () => eventedShapes.forEach((shape) => {
2329
+ shape.evented = true;
2330
+ });
2331
+ this._animatedRange = from;
2332
+ this._updateLayoutOfSelectionControl();
2333
+ this._updateControlCoord();
2334
+ const frame = () => {
2335
+ const progress = Math.min(1, (_univerjs_core.Tools.now() - startedAt) / SELECTION_MOVE_DURATION);
2336
+ const eased = 1 - (1 - progress) ** 3;
2337
+ if (progress === 1) this._stopMoveAnimation();
2338
+ this._animatedRange = progress < 1 ? {
2339
+ ...target,
2340
+ startX: from.startX + (target.startX - from.startX) * eased,
2341
+ startY: from.startY + (target.startY - from.startY) * eased,
2342
+ endX: from.endX + (target.endX - from.endX) * eased,
2343
+ endY: from.endY + (target.endY - from.endY) * eased
2344
+ } : null;
2345
+ this._updateLayoutOfSelectionControl();
2346
+ this._updateControlCoord();
2347
+ this._moveAnimationFrame = progress < 1 ? (0, _univerjs_engine_render.requestNewFrame)(frame) : -1;
2348
+ };
2349
+ this._moveAnimationFrame = (0, _univerjs_engine_render.requestNewFrame)(frame);
2350
+ }
2351
+ _stopMoveAnimation() {
2352
+ var _this$_restoreMoveEve;
2353
+ if (this._moveAnimationFrame !== -1) {
2354
+ (0, _univerjs_engine_render.cancelRequestFrame)(this._moveAnimationFrame);
2355
+ this._moveAnimationFrame = -1;
2356
+ }
2357
+ this._animatedRange = null;
2358
+ (_this$_restoreMoveEve = this._restoreMoveEvents) === null || _this$_restoreMoveEve === void 0 || _this$_restoreMoveEve.call(this);
2359
+ this._restoreMoveEvents = null;
2288
2360
  }
2289
2361
  /**
2290
2362
  * Update primary range.
@@ -2299,40 +2371,22 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2299
2371
  this._selectionRenderModel.setCurrentCell(primaryCell);
2300
2372
  }
2301
2373
  clearHighlight() {
2374
+ this._stopMoveAnimation();
2302
2375
  this._showAutoFill = false;
2303
2376
  this._selectionRenderModel.clearCurrentCell();
2304
2377
  this._updateLayoutOfSelectionControl(this._currentStyle);
2378
+ this._updateControlCoord();
2305
2379
  }
2306
2380
  getScene() {
2307
2381
  return this._scene;
2308
2382
  }
2309
2383
  dispose() {
2310
- var _this$_leftBorder, _this$_rightBorder, _this$_topBorder, _this$_bottomBorder, _this$_backgroundCont, _this$_backgroundCont2, _this$_backgroundCont3, _this$_backgroundCont4, _this$_selectionShape, _this$_rowHeaderBackg, _this$_rowHeaderBorde, _this$_rowHeaderGroup, _this$_rowHeaderBackg2, _this$_columnHeaderBa, _this$_columnHeaderBo, _this$_columnHeaderGr, _this$_topLeftWidget, _this$_topCenterWidge, _this$_topRightWidget, _this$_middleLeftWidg, _this$_middleRightWid, _this$_bottomLeftWidg, _this$_bottomCenterWi, _this$_bottomRightWid, _this$_controlExtensi;
2311
- (_this$_leftBorder = this._leftBorder) === null || _this$_leftBorder === void 0 || _this$_leftBorder.dispose();
2312
- (_this$_rightBorder = this._rightBorder) === null || _this$_rightBorder === void 0 || _this$_rightBorder.dispose();
2313
- (_this$_topBorder = this._topBorder) === null || _this$_topBorder === void 0 || _this$_topBorder.dispose();
2314
- (_this$_bottomBorder = this._bottomBorder) === null || _this$_bottomBorder === void 0 || _this$_bottomBorder.dispose();
2315
- (_this$_backgroundCont = this._backgroundControlTop) === null || _this$_backgroundCont === void 0 || _this$_backgroundCont.dispose();
2316
- (_this$_backgroundCont2 = this._backgroundControlMiddleLeft) === null || _this$_backgroundCont2 === void 0 || _this$_backgroundCont2.dispose();
2317
- (_this$_backgroundCont3 = this._backgroundControlMiddleRight) === null || _this$_backgroundCont3 === void 0 || _this$_backgroundCont3.dispose();
2318
- (_this$_backgroundCont4 = this._backgroundControlBottom) === null || _this$_backgroundCont4 === void 0 || _this$_backgroundCont4.dispose();
2319
- this._autoFillControl.dispose();
2320
- (_this$_selectionShape = this._selectionShapeGroup) === null || _this$_selectionShape === void 0 || _this$_selectionShape.dispose();
2321
- (_this$_rowHeaderBackg = this._rowHeaderBackground) === null || _this$_rowHeaderBackg === void 0 || _this$_rowHeaderBackg.dispose();
2322
- (_this$_rowHeaderBorde = this._rowHeaderBorder) === null || _this$_rowHeaderBorde === void 0 || _this$_rowHeaderBorde.dispose();
2323
- (_this$_rowHeaderGroup = this._rowHeaderGroup) === null || _this$_rowHeaderGroup === void 0 || _this$_rowHeaderGroup.dispose();
2324
- (_this$_rowHeaderBackg2 = this._rowHeaderBackground) === null || _this$_rowHeaderBackg2 === void 0 || _this$_rowHeaderBackg2.dispose();
2325
- (_this$_columnHeaderBa = this._columnHeaderBackground) === null || _this$_columnHeaderBa === void 0 || _this$_columnHeaderBa.dispose();
2326
- (_this$_columnHeaderBo = this._columnHeaderBorder) === null || _this$_columnHeaderBo === void 0 || _this$_columnHeaderBo.dispose();
2327
- (_this$_columnHeaderGr = this._columnHeaderGroup) === null || _this$_columnHeaderGr === void 0 || _this$_columnHeaderGr.dispose();
2328
- (_this$_topLeftWidget = this._topLeftWidget) === null || _this$_topLeftWidget === void 0 || _this$_topLeftWidget.dispose();
2329
- (_this$_topCenterWidge = this._topCenterWidget) === null || _this$_topCenterWidge === void 0 || _this$_topCenterWidge.dispose();
2330
- (_this$_topRightWidget = this._topRightWidget) === null || _this$_topRightWidget === void 0 || _this$_topRightWidget.dispose();
2331
- (_this$_middleLeftWidg = this._middleLeftWidget) === null || _this$_middleLeftWidg === void 0 || _this$_middleLeftWidg.dispose();
2332
- (_this$_middleRightWid = this._middleRightWidget) === null || _this$_middleRightWid === void 0 || _this$_middleRightWid.dispose();
2333
- (_this$_bottomLeftWidg = this._bottomLeftWidget) === null || _this$_bottomLeftWidg === void 0 || _this$_bottomLeftWidg.dispose();
2334
- (_this$_bottomCenterWi = this._bottomCenterWidget) === null || _this$_bottomCenterWi === void 0 || _this$_bottomCenterWi.dispose();
2335
- (_this$_bottomRightWid = this._bottomRightWidget) === null || _this$_bottomRightWid === void 0 || _this$_bottomRightWid.dispose();
2384
+ var _this$_controlExtensi;
2385
+ this._stopMoveAnimation();
2386
+ this._stopAntLineAnimation();
2387
+ this._selectionShapeGroup.dispose();
2388
+ this._rowHeaderGroup.dispose();
2389
+ this._columnHeaderGroup.dispose();
2336
2390
  (_this$_controlExtensi = this._controlExtension) === null || _this$_controlExtensi === void 0 || _this$_controlExtensi.dispose();
2337
2391
  super.dispose();
2338
2392
  this._dispose$.next(this);
@@ -2432,12 +2486,12 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2432
2486
  this._rowHeaderGroup.makeDirty(true);
2433
2487
  }
2434
2488
  _updateBackgroundControl(style) {
2435
- const { startX, startY, endX, endY } = this._selectionRenderModel;
2489
+ const { startX, startY, endX, endY } = this._animatedRange ?? this._selectionRenderModel;
2436
2490
  const scale = this._getScale();
2437
2491
  const { fill = style.fill } = style;
2438
2492
  let { strokeWidth } = style;
2439
2493
  strokeWidth /= scale;
2440
- const highlightSelection = this._selectionRenderModel.highlightToSelection();
2494
+ const highlightSelection = this._animatedRange ?? this._selectionRenderModel.highlightToSelection();
2441
2495
  if (!highlightSelection) {
2442
2496
  this._backgroundControlTop.resize(endX - startX, endY - startY);
2443
2497
  this._backgroundControlTop.setProps({ fill });
@@ -2498,7 +2552,7 @@ var SelectionControl = class extends _univerjs_core.Disposable {
2498
2552
  this._backgroundControlBottom.setProps({ fill });
2499
2553
  }
2500
2554
  _updateWidgets(style) {
2501
- const { startX, startY, endX, endY } = this._selectionRenderModel;
2555
+ const { startX, startY, endX, endY } = this._animatedRange ?? this._selectionRenderModel;
2502
2556
  const { stroke = style.stroke, widgets = style.widgets, widgetStroke = style.widgetStroke } = style;
2503
2557
  const scale = this._getScale();
2504
2558
  let { widgetSize, widgetStrokeWidth } = style;
@@ -3052,9 +3106,10 @@ var HtmlToUSMService = class HtmlToUSMService {
3052
3106
  cellDataStream = `${dataStream.substring(starts[i])}\r\n`;
3053
3107
  if (cellDataStream === "\r\n") continue;
3054
3108
  } else cellDataStream = `${dataStream.substring(starts[i], starts[i + 1] - 1)}\r\n`;
3109
+ const end = starts[i + 1] ?? dataStream.length;
3055
3110
  const cellTextRuns = [];
3056
3111
  textRuns === null || textRuns === void 0 || textRuns.forEach((t) => {
3057
- if (t.st >= starts[i] && t.ed <= starts[i + 1]) cellTextRuns.push({
3112
+ if (t.st >= starts[i] && t.ed <= end) cellTextRuns.push({
3058
3113
  st: t.st - starts[i],
3059
3114
  ed: t.ed - starts[i],
3060
3115
  ts: t.ts
@@ -3062,7 +3117,7 @@ var HtmlToUSMService = class HtmlToUSMService {
3062
3117
  });
3063
3118
  const cellCustomRanges = [];
3064
3119
  customRanges === null || customRanges === void 0 || customRanges.forEach((c) => {
3065
- if (c.startIndex >= starts[i] && c.endIndex <= starts[i + 1]) cellCustomRanges.push({
3120
+ if (c.startIndex >= starts[i] && c.endIndex <= end) cellCustomRanges.push({
3066
3121
  ...c,
3067
3122
  startIndex: c.startIndex - starts[i],
3068
3123
  endIndex: c.endIndex - starts[i]
@@ -3090,14 +3145,9 @@ var HtmlToUSMService = class HtmlToUSMService {
3090
3145
  payloads,
3091
3146
  customRanges
3092
3147
  };
3093
- if (!(customRanges === null || customRanges === void 0 ? void 0 : customRanges.length)) valueMatrix.setValue(0, 0, convertToCellStyle({ v: dataStream }, dataStream, textRuns));
3094
- else {
3095
- const p = this._generateDocumentDataModelSnapshot({ body: singleDocBody });
3096
- valueMatrix.setValue(0, 0, convertToCellStyle({
3097
- v: dataStream,
3098
- p
3099
- }, dataStream, textRuns));
3100
- }
3148
+ const cell = { v: dataStream };
3149
+ if ((textRuns === null || textRuns === void 0 ? void 0 : textRuns.length) || (customRanges === null || customRanges === void 0 ? void 0 : customRanges.length)) cell.p = this._generateDocumentDataModelSnapshot({ body: singleDocBody });
3150
+ valueMatrix.setValue(0, 0, convertToCellStyle(cell, dataStream, textRuns));
3101
3151
  rowProperties.push({});
3102
3152
  }
3103
3153
  if (tableStrings) tableStrings.forEach((t, index) => {
@@ -3714,7 +3764,7 @@ const LarkPastePlugin = {
3714
3764
  const UniverPastePlugin = {
3715
3765
  name: "univer-sheet-paste-plugin-univer",
3716
3766
  checkPasteType(html) {
3717
- return /UniverNormal/i.test(html);
3767
+ return /<p\b[^>]*\sclass\s*=\s*["'](?:[^"']*\s)?UniverNormal(?:\s[^"']*)?["']/i.test(html);
3718
3768
  },
3719
3769
  stylesRules: [],
3720
3770
  afterProcessRules: [{
@@ -4091,9 +4141,9 @@ function wrapHtmlForExcel(html) {
4091
4141
  /**
4092
4142
  * This service provide hooks for sheet features to supplement content or modify behavior of clipboard.
4093
4143
  */
4144
+ HtmlToUSMService.use(UniverPastePlugin);
4094
4145
  HtmlToUSMService.use(WordPastePlugin);
4095
4146
  HtmlToUSMService.use(LarkPastePlugin);
4096
- HtmlToUSMService.use(UniverPastePlugin);
4097
4147
  const ISheetClipboardService = (0, _univerjs_core.createIdentifier)("sheet.clipboard-service");
4098
4148
  let SheetClipboardService = class SheetClipboardService extends _univerjs_core.Disposable {
4099
4149
  constructor(_logService, _univerInstanceService, _selectionManagerService, _clipboardInterfaceService, _undoRedoService, _commandService, _markSelectionService, _notificationService, _platformService, _renderManagerService, _themeService, _localeService, _errorService, _injector) {
@@ -4622,6 +4672,19 @@ let SheetClipboardService = class SheetClipboardService extends _univerjs_core.D
4622
4672
  const start = pasteTarget.pastedRange.rows[0];
4623
4673
  const end = range.rows[range.rows.length - 1] - range.rows[0] + start;
4624
4674
  pasteTarget.pastedRange.rows = Array.from(new Array(end + 1).keys()).slice(start);
4675
+ if (!skipCellCopy) {
4676
+ if (!await this._injector.get(_univerjs_sheets.SheetInterceptorService).beforeCommandExecute({
4677
+ id: _univerjs_sheets.MoveRangeCommand.id,
4678
+ params: {
4679
+ fromUnitId: copyUnitId,
4680
+ fromSubUnitId: copySubUnitId,
4681
+ fromRange: (0, _univerjs_sheets.discreteRangeToRange)(range),
4682
+ toUnitId: target.unitId,
4683
+ toSubUnitId: target.subUnitId,
4684
+ toRange: (0, _univerjs_sheets.discreteRangeToRange)(pasteTarget.pastedRange)
4685
+ }
4686
+ })) return false;
4687
+ }
4625
4688
  }
4626
4689
  const pasteRes = this._pasteUSM({
4627
4690
  cellMatrix,
@@ -6875,7 +6938,7 @@ const SetSelectionFrozenCommand = {
6875
6938
  if (selectRow === 0) selectRow = 1;
6876
6939
  let selectColumn = (primary === null || primary === void 0 ? void 0 : primary.startColumn) ?? range.startColumn;
6877
6940
  if (selectColumn === 0) selectColumn = 1;
6878
- const rangeType = range.rangeType;
6941
+ const rangeType = range.rangeType ?? _univerjs_core.RANGE_TYPE.NORMAL;
6879
6942
  if (rangeType === _univerjs_core.RANGE_TYPE.ROW || type === 1) {
6880
6943
  startRow = selectRow;
6881
6944
  freezedRowCount = selectRow - sheetViewStartRow;
@@ -6952,6 +7015,30 @@ const SetFirstColumnFrozenCommand = {
6952
7015
  }
6953
7016
  };
6954
7017
 
7018
+ //#endregion
7019
+ //#region src/config/config.ts
7020
+ const SHEETS_UI_PLUGIN_CONFIG_KEY = "sheets-ui.config";
7021
+ const configSymbol = Symbol(SHEETS_UI_PLUGIN_CONFIG_KEY);
7022
+ const defaultPluginConfig = {
7023
+ allowArrowKeyWrapOnSheetBoundary: true,
7024
+ formulaBar: true,
7025
+ protectedRangeShadow: true,
7026
+ maxAutoHeightCount: 1e3
7027
+ };
7028
+ /**
7029
+ * Convert the protectedRangeShadow config to shadow strategy
7030
+ * - true -> 'always'
7031
+ * - false -> 'none'
7032
+ * - string values remain unchanged
7033
+ * @param config The protectedRangeShadow config value
7034
+ * @returns The shadow strategy
7035
+ */
7036
+ function convertToShadowStrategy(config) {
7037
+ if (config === true) return "always";
7038
+ if (config === false) return "none";
7039
+ return config || "always";
7040
+ }
7041
+
6955
7042
  //#endregion
6956
7043
  //#region src/services/select-all/select-all.service.ts
6957
7044
  var SelectAllService = class extends _univerjs_core.Disposable {
@@ -7045,7 +7132,9 @@ const MoveSelectionCommand = {
7045
7132
  }
7046
7133
  }
7047
7134
  const startRange = getStartRange(range, primary, direction);
7048
- const next = jumpOver === 1 ? findNextGapRange(startRange, direction, worksheet) : findNextRange(startRange, direction, worksheet);
7135
+ const config = accessor.get(_univerjs_core.IConfigService).getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
7136
+ const allowWrap = (config === null || config === void 0 ? void 0 : config.allowArrowKeyWrapOnSheetBoundary) ?? true;
7137
+ const next = jumpOver === 1 ? findNextGapRange(startRange, direction, worksheet) : findNextRange(startRange, direction, worksheet, void 0, true, 1, allowWrap);
7049
7138
  const destRange = (0, _univerjs_sheets.getCellAtRowCol)(next.startRow, next.startColumn, worksheet);
7050
7139
  if (_univerjs_core.Rectangle.equals(destRange, startRange)) return false;
7051
7140
  const unitId = workbook.getUnitId();
@@ -7168,13 +7257,7 @@ const MoveSelectionEnterAndTabCommand = {
7168
7257
  keycode: _univerjs_ui.KeyCode.TAB
7169
7258
  });
7170
7259
  }
7171
- /**
7172
- * The start range is from the primary selection range.
7173
- * If the edited cell is the last row/column of the worksheet, and the submitted operation is Enter/Tab to move down/right, the next selected cell should still be the current cell (not move to the first row/column of the worksheet).
7174
- */
7175
- const isLastRowCell = keycode === _univerjs_ui.KeyCode.ENTER && direction === _univerjs_core.Direction.DOWN && startRange.endRow === worksheet.getMaxRows() - 1;
7176
- const isLastColumnCell = keycode === _univerjs_ui.KeyCode.TAB && direction === _univerjs_core.Direction.RIGHT && startRange.endColumn === worksheet.getMaxColumns() - 1;
7177
- const next = isLastRowCell || isLastColumnCell ? startRange : findNextRange(startRange, direction, worksheet);
7260
+ const next = findNextRange(startRange, direction, worksheet, void 0, true, 1, false);
7178
7261
  const destRange = (0, _univerjs_sheets.getCellAtRowCol)(next.startRow, next.startColumn, worksheet);
7179
7262
  if (_univerjs_core.Rectangle.equals(destRange, startRange)) return false;
7180
7263
  resultRange = {
@@ -7218,11 +7301,19 @@ const ExpandSelectionCommand = {
7218
7301
  const target = (0, _univerjs_sheets.getSheetCommandTarget)(accessor.get(_univerjs_core.IUniverInstanceService));
7219
7302
  if (!target) return false;
7220
7303
  const { worksheet, unitId, subUnitId } = target;
7221
- const selection = (0, _univerjs_sheets.getSelectionsService)(accessor).getCurrentLastSelection();
7304
+ const selectionsService = (0, _univerjs_sheets.getSelectionsService)(accessor, params.fromCurrentSelection);
7305
+ const selection = selectionsService.getCurrentLastSelection();
7222
7306
  if (!selection) return false;
7223
7307
  const { jumpOver, direction, extra } = params;
7224
7308
  let { range: startRange, primary } = selection;
7225
7309
  if (extra === "formula-editor") {
7310
+ if (params.fromCurrentSelection && primary) startRange = {
7311
+ startRow: primary.startRow,
7312
+ endRow: primary.endRow,
7313
+ startColumn: primary.startColumn,
7314
+ endColumn: primary.endColumn,
7315
+ rangeType: _univerjs_core.RANGE_TYPE.NORMAL
7316
+ };
7226
7317
  if (startRange.startRow === startRange.endRow && startRange.startColumn === startRange.endColumn) {
7227
7318
  const mergedCell = worksheet.getMergedCell(startRange.startRow, startRange.startColumn);
7228
7319
  if (mergedCell) startRange = {
@@ -7231,18 +7322,21 @@ const ExpandSelectionCommand = {
7231
7322
  };
7232
7323
  }
7233
7324
  if (!primary) {
7234
- const lastSelectionPrimary = (0, _univerjs_sheets.getSelectionsService)(accessor).getCurrentLastSelectionPrimaryCell();
7325
+ const lastSelectionPrimary = selectionsService.getCurrentLastSelectionPrimaryCell();
7235
7326
  if (lastSelectionPrimary && _univerjs_core.Rectangle.contains(startRange, lastSelectionPrimary)) primary = lastSelectionPrimary;
7236
7327
  }
7237
7328
  }
7238
- const destRange = !checkIfShrink({
7329
+ const isShrink = checkIfShrink({
7239
7330
  range: startRange,
7240
7331
  primary
7241
- }, direction, worksheet) ? jumpOver === 1 ? expandToNextGapRange(startRange, direction, worksheet) : expandToNextCell(startRange, direction, worksheet) : jumpOver === 1 ? shrinkToNextGapRange(startRange, {
7332
+ }, direction, worksheet);
7333
+ let destRange;
7334
+ if (isShrink) destRange = jumpOver === 1 ? shrinkToNextGapRange(startRange, {
7242
7335
  ..._univerjs_core.Rectangle.clone(primary),
7243
7336
  rangeType: _univerjs_core.RANGE_TYPE.NORMAL
7244
7337
  }, direction, worksheet) : shrinkToNextCell(startRange, direction, worksheet);
7245
- destRange.rangeType = selection.range.rangeType;
7338
+ else destRange = jumpOver === 1 ? expandToNextGapRange(startRange, direction, worksheet) : expandToNextCell(startRange, direction, worksheet);
7339
+ destRange.rangeType = startRange.rangeType;
7246
7340
  if (_univerjs_core.Rectangle.equals(destRange, startRange)) return false;
7247
7341
  return accessor.get(_univerjs_core.ICommandService).syncExecuteCommand(_univerjs_sheets.SetSelectionsOperation.id, {
7248
7342
  unitId,
@@ -8143,14 +8237,17 @@ function transformPosition2Offset(x, y, scene, skeleton, worksheet) {
8143
8237
  const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(startRow, startColumn, false);
8144
8238
  const { rowHeaderWidth, columnHeaderHeight } = skeleton;
8145
8239
  const freezeWidth = endSheetView.startX - startSheetView.startX;
8146
- const freezeHeight = endSheetView.startY - startSheetView.startY;
8240
+ const freezeStartY = ySplit > 0 && startRow === ySplit ? 0 : startSheetView.startY;
8241
+ const freezeHeight = endSheetView.startY - freezeStartY;
8147
8242
  const { top, left, viewportScrollX, viewportScrollY } = viewMain;
8243
+ const viewportLeft = left / scaleX;
8244
+ const viewportTop = top / scaleY;
8148
8245
  let offsetX;
8149
- if (x > left) offsetX = (x - viewportScrollX) * scaleX;
8150
- else offsetX = (freezeWidth + rowHeaderWidth - (left - x)) * scaleX;
8246
+ if (x > viewportLeft) offsetX = (x - viewportScrollX) * scaleX;
8247
+ else offsetX = (freezeWidth + rowHeaderWidth - (viewportLeft - x)) * scaleX;
8151
8248
  let offsetY;
8152
- if (y > top) offsetY = (y - viewportScrollY) * scaleY;
8153
- else offsetY = (freezeHeight + columnHeaderHeight - (top - y)) * scaleX;
8249
+ if (y > viewportTop) offsetY = (y - viewportScrollY) * scaleY;
8250
+ else offsetY = (freezeHeight + columnHeaderHeight - (viewportTop - y)) * scaleY;
8154
8251
  return {
8155
8252
  x: offsetX,
8156
8253
  y: offsetY
@@ -8293,7 +8390,7 @@ let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Dispo
8293
8390
  }
8294
8391
  refreshEditCellPosition(resetSizeOnly) {
8295
8392
  if (!this._currentEditCell || !this._currentEditCellState) return;
8296
- const { unitId, sheetId, primary, scene, engine } = this._currentEditCell;
8393
+ const { unitId, sheetId, primary: selectedCell, scene, engine } = this._currentEditCell;
8297
8394
  const workbook = this._getWorkbookForEditUnit(unitId);
8298
8395
  if (!workbook || workbook.getUnitId() !== unitId) return;
8299
8396
  const worksheet = workbook.getActiveSheet();
@@ -8301,6 +8398,7 @@ let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Dispo
8301
8398
  if (!this._renderManagerService.getRenderUnitById(unitId)) return;
8302
8399
  const skeleton = this._sheetSkeletonService.getSkeleton(unitId, sheetId);
8303
8400
  if (!skeleton) return;
8401
+ const primary = worksheet.getCellInfoInMergeData(selectedCell.actualRow, selectedCell.actualColumn);
8304
8402
  const primaryWithCoord = (0, _univerjs_sheets.attachPrimaryWithCoord)(skeleton, primary);
8305
8403
  const actualRangeWithCoord = (0, _univerjs_core.convertCellToRange)(primaryWithCoord);
8306
8404
  const canvasOffset = (0, _univerjs_docs_ui.getCanvasOffsetByEngine)(engine);
@@ -8398,7 +8496,7 @@ let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Dispo
8398
8496
  getLatestEditCellState() {
8399
8497
  var _documentLayoutObject, _documentLayoutObject2;
8400
8498
  if (!this._currentEditCell) return;
8401
- const { unitId, sheetId, primary, scene, engine } = this._currentEditCell;
8499
+ const { unitId, sheetId, primary: selectedCell, scene, engine } = this._currentEditCell;
8402
8500
  const workbook = this._getWorkbookForEditUnit(unitId);
8403
8501
  if (!workbook || workbook.getUnitId() !== unitId) return;
8404
8502
  const worksheet = workbook.getActiveSheet();
@@ -8406,6 +8504,7 @@ let EditorBridgeService = class EditorBridgeService extends _univerjs_core.Dispo
8406
8504
  if (!this._renderManagerService.getRenderUnitById(unitId)) return;
8407
8505
  const skeleton = this._sheetSkeletonService.getSkeleton(unitId, sheetId);
8408
8506
  if (!skeleton) return;
8507
+ const primary = worksheet.getCellInfoInMergeData(selectedCell.actualRow, selectedCell.actualColumn);
8409
8508
  const { startRow, startColumn } = primary;
8410
8509
  const primaryWithCoord = (0, _univerjs_sheets.attachPrimaryWithCoord)(skeleton, primary);
8411
8510
  const actualRangeWithCoord = (0, _univerjs_core.convertCellToRange)(primaryWithCoord);
@@ -8777,29 +8876,6 @@ const SetActivateCellEditOperation = {
8777
8876
  }
8778
8877
  };
8779
8878
 
8780
- //#endregion
8781
- //#region src/config/config.ts
8782
- const SHEETS_UI_PLUGIN_CONFIG_KEY = "sheets-ui.config";
8783
- const configSymbol = Symbol(SHEETS_UI_PLUGIN_CONFIG_KEY);
8784
- const defaultPluginConfig = {
8785
- formulaBar: true,
8786
- protectedRangeShadow: true,
8787
- maxAutoHeightCount: 1e3
8788
- };
8789
- /**
8790
- * Convert the protectedRangeShadow config to shadow strategy
8791
- * - true -> 'always'
8792
- * - false -> 'none'
8793
- * - string values remain unchanged
8794
- * @param config The protectedRangeShadow config value
8795
- * @returns The shadow strategy
8796
- */
8797
- function convertToShadowStrategy(config) {
8798
- if (config === true) return "always";
8799
- if (config === false) return "none";
8800
- return config || "always";
8801
- }
8802
-
8803
8879
  //#endregion
8804
8880
  //#region src/commands/operations/cell-edit.operation.ts
8805
8881
  const SetCellEditVisibleOperation = {
@@ -10317,6 +10393,18 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10317
10393
  this._univerInstanceService = _univerInstanceService;
10318
10394
  this._configService = _configService;
10319
10395
  this._embedFloatingGeometryService = _embedFloatingGeometryService;
10396
+ _defineProperty(this, "_editorWidth", 0);
10397
+ _defineProperty(this, "_editorHeight", 0);
10398
+ _defineProperty(this, "_initialEditorSize", null);
10399
+ _defineProperty(this, "_cellSize", null);
10400
+ this.disposeWithMe(this._editorBridgeService.visible$.subscribe(({ visible }) => {
10401
+ if (!visible) {
10402
+ this._editorWidth = 0;
10403
+ this._editorHeight = 0;
10404
+ this._initialEditorSize = null;
10405
+ this._cellSize = null;
10406
+ }
10407
+ }));
10320
10408
  }
10321
10409
  get _currentRenderer() {
10322
10410
  return (0, _univerjs_engine_render.getCurrentTypeOfRenderer)(_univerjs_core.UniverInstanceType.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService);
@@ -10344,10 +10432,13 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10344
10432
  if (!param) return;
10345
10433
  const { position, documentLayoutObject, canvasOffset, scaleX, scaleY } = param;
10346
10434
  const { startX, startY, endX, endY } = position;
10435
+ const cellWidth = endX - startX;
10436
+ const cellHeight = endY - startY;
10347
10437
  const documentDataModel = this._univerInstanceService.getUnit(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
10348
10438
  if (documentDataModel == null) return;
10349
10439
  const documentSkeleton = this._getEditorSkeleton();
10350
10440
  if (!documentSkeleton) return;
10441
+ this._syncCellSize(cellWidth / scaleX, cellHeight / scaleY);
10351
10442
  documentSkeleton.resetInitialWidth();
10352
10443
  const info = this._predictingSize(position, canvasOffset, documentSkeleton, documentLayoutObject, scaleX, scaleY);
10353
10444
  if (!info || info.actualWidth <= 0) return;
@@ -10355,17 +10446,17 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10355
10446
  const { verticalAlign, horizontalAlign, paddingData, fill } = documentLayoutObject;
10356
10447
  actualWidth = actualWidth + (paddingData.l ?? 0) * scaleX + (paddingData.r ?? 0) * scaleX;
10357
10448
  actualHeight = actualHeight + (paddingData.t ?? 0) * scaleY + (paddingData.b ?? 0) * scaleY;
10358
- let editorWidth = endX - startX;
10359
- let editorHeight = endY - startY;
10360
- if (editorWidth < actualWidth) editorWidth = Math.ceil(actualWidth);
10361
- if (editorHeight < actualHeight) editorHeight = Math.ceil(actualHeight);
10449
+ const contentWidth = cellWidth < actualWidth ? Math.ceil(actualWidth) : cellWidth;
10450
+ const contentHeight = cellHeight < actualHeight ? Math.ceil(actualHeight) : cellHeight;
10451
+ const editorWidth = Math.max(contentWidth, Math.min(this._editorWidth * scaleX, info.maxSize.width));
10452
+ const editorHeight = Math.max(contentHeight, Math.min(this._editorHeight * scaleY, info.maxSize.height));
10362
10453
  let offsetTop = 0;
10363
10454
  if (verticalAlign === _univerjs_core.VerticalAlign.MIDDLE) offsetTop = (editorHeight - actualHeight) / 2 / scaleY;
10364
10455
  else if (verticalAlign === _univerjs_core.VerticalAlign.TOP) offsetTop = paddingData.t || 0;
10365
10456
  else offsetTop = (editorHeight - actualHeight) / scaleY;
10366
10457
  let offsetLeft = 0;
10367
- if (horizontalAlign === _univerjs_core.HorizontalAlign.CENTER) {} else if (horizontalAlign === _univerjs_core.HorizontalAlign.RIGHT) offsetLeft = (editorWidth - actualWidth) / scaleX;
10368
- else offsetLeft = paddingData.l || 0;
10458
+ if (horizontalAlign === _univerjs_core.HorizontalAlign.RIGHT) offsetLeft = (editorWidth - actualWidth) / scaleX;
10459
+ else if (horizontalAlign !== _univerjs_core.HorizontalAlign.CENTER) offsetLeft = paddingData.l || 0;
10369
10460
  offsetTop = Math.max(offsetTop, paddingData.t || 0);
10370
10461
  offsetLeft = Math.max(offsetLeft, paddingData.l || 0);
10371
10462
  documentDataModel.updateDocumentDataMargin({
@@ -10373,7 +10464,22 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10373
10464
  l: offsetLeft
10374
10465
  });
10375
10466
  documentSkeleton.calculate();
10376
- this._editAreaProcessing(editorWidth, editorHeight, position, canvasOffset, fill, scaleX, scaleY, horizontalAlign, callback);
10467
+ this._editAreaProcessing({
10468
+ width: editorWidth,
10469
+ height: editorHeight,
10470
+ contentWidth
10471
+ }, position, canvasOffset, fill, scaleX, scaleY, horizontalAlign, callback);
10472
+ }
10473
+ _syncCellSize(width, height) {
10474
+ if (this._cellSize && (Math.abs(this._cellSize.width - width) > 1e-6 || Math.abs(this._cellSize.height - height) > 1e-6)) {
10475
+ var _this$_initialEditorS, _this$_initialEditorS2;
10476
+ this._editorWidth = ((_this$_initialEditorS = this._initialEditorSize) === null || _this$_initialEditorS === void 0 ? void 0 : _this$_initialEditorS.width) ?? 0;
10477
+ this._editorHeight = ((_this$_initialEditorS2 = this._initialEditorSize) === null || _this$_initialEditorS2 === void 0 ? void 0 : _this$_initialEditorS2.height) ?? 0;
10478
+ }
10479
+ this._cellSize = {
10480
+ width,
10481
+ height
10482
+ };
10377
10483
  }
10378
10484
  /**
10379
10485
  * Mainly used to pre-calculate the width of the editor,
@@ -10384,25 +10490,26 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10384
10490
  const { textRotation, wrapStrategy, paddingData } = documentLayoutObject;
10385
10491
  const documentDataModel = this._univerInstanceService.getUnit(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
10386
10492
  const { vertexAngle: angle } = (0, _univerjs_engine_render.convertTextRotation)(textRotation);
10493
+ const maxSize = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, documentLayoutObject.horizontalAlign);
10494
+ if (!maxSize) return;
10495
+ documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataMargin({
10496
+ l: paddingData.l,
10497
+ t: paddingData.t
10498
+ });
10387
10499
  if (wrapStrategy === _univerjs_core.WrapStrategy.WRAP && angle === 0) {
10388
10500
  documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize((endX - startX) / scaleX);
10389
- documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataMargin({
10390
- l: paddingData.l,
10391
- t: paddingData.t
10392
- });
10393
10501
  documentSkeleton.calculate();
10394
10502
  const { actualWidth, actualHeight } = documentSkeleton.getActualSize();
10395
10503
  return {
10396
10504
  actualWidth: actualWidth * scaleX,
10397
- actualHeight: actualHeight * scaleY
10505
+ actualHeight: actualHeight * scaleY,
10506
+ maxSize
10398
10507
  };
10399
10508
  }
10400
- const maxSize = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, documentLayoutObject.horizontalAlign);
10401
- if (!maxSize) return;
10402
10509
  documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize(maxSize.width / scaleX);
10403
10510
  documentSkeleton.calculate();
10404
10511
  const size = documentSkeleton.getActualSize();
10405
- let editorWidth = endX - startX;
10512
+ let editorWidth = Math.max(endX - startX, Math.min(this._editorWidth * scaleX, maxSize.width));
10406
10513
  if (editorWidth < size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX) editorWidth = size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX;
10407
10514
  documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize(editorWidth / scaleX);
10408
10515
  /**
@@ -10414,7 +10521,8 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10414
10521
  });
10415
10522
  return {
10416
10523
  actualWidth: size.actualWidth * scaleX,
10417
- actualHeight: size.actualHeight * scaleY
10524
+ actualHeight: size.actualHeight * scaleY,
10525
+ maxSize
10418
10526
  };
10419
10527
  }
10420
10528
  _getEditorMaxSize(position, canvasOffset, horizontalAlign) {
@@ -10460,7 +10568,7 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10460
10568
  * determine whether a scrollbar appears,
10461
10569
  * and calculate the editor's boundaries relative to the browser.
10462
10570
  */
10463
- _editAreaProcessing(editorWidth, editorHeight, actualRangeWithCoord, canvasOffset, fill, scaleX = 1, scaleY = 1, horizontalAlign, callback) {
10571
+ _editAreaProcessing(size, actualRangeWithCoord, canvasOffset, fill, scaleX = 1, scaleY = 1, horizontalAlign, callback) {
10464
10572
  const editorObject = this._getEditorObject();
10465
10573
  if (editorObject == null) return;
10466
10574
  const engine = this.engine;
@@ -10468,25 +10576,16 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10468
10576
  const canvasElement = engine.getCanvasElement();
10469
10577
  let { startX, startY } = actualRangeWithCoord;
10470
10578
  const { document: documentComponent, scene: editorScene, engine: docEngine } = editorObject;
10471
- const viewportMain = editorScene.getViewport(_univerjs_docs_ui.VIEWPORT_KEY.VIEW_MAIN);
10472
10579
  const { height: clientHeight, width: clientWidth, contentScaleX, contentScaleY, scaleAdjustX, scaleAdjustY } = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, horizontalAlign);
10473
- let physicHeight = editorHeight;
10474
- let scrollBar = viewportMain === null || viewportMain === void 0 ? void 0 : viewportMain.getScrollBar();
10475
- if (physicHeight > clientHeight) {
10476
- if (scrollBar == null) viewportMain && new _univerjs_engine_render.ScrollBar(viewportMain, {
10477
- enableHorizontal: false,
10478
- barSize: 8
10479
- });
10480
- else viewportMain === null || viewportMain === void 0 || viewportMain.resetCanvasSizeAndUpdateScroll();
10481
- viewportMain === null || viewportMain === void 0 || viewportMain.scrollToViewportPos({ viewportScrollY: physicHeight - clientHeight });
10482
- physicHeight = clientHeight;
10483
- } else {
10484
- var _viewportMain$getScro;
10485
- scrollBar = null;
10486
- viewportMain === null || viewportMain === void 0 || (_viewportMain$getScro = viewportMain.getScrollBar()) === null || _viewportMain$getScro === void 0 || _viewportMain$getScro.dispose();
10487
- }
10488
- editorWidth += (scrollBar === null || scrollBar === void 0 ? void 0 : scrollBar.barSize) || 0;
10489
- if (editorWidth > clientWidth) editorWidth = clientWidth;
10580
+ const { physicHeight, scrollBarWidth } = this._fitEditorViewport(editorScene, size.height, clientHeight);
10581
+ const editorWidth = Math.min(Math.max(size.width, size.contentWidth + scrollBarWidth), clientWidth);
10582
+ const editorHeight = size.height;
10583
+ this._editorWidth = Math.max(this._editorWidth, editorWidth / scaleX);
10584
+ this._editorHeight = Math.max(this._editorHeight, physicHeight / scaleY);
10585
+ if (!this._initialEditorSize && this._editorBridgeService.isVisible().visible) this._initialEditorSize = {
10586
+ width: editorWidth / scaleX,
10587
+ height: physicHeight / scaleY
10588
+ };
10490
10589
  this._addBackground(editorScene, editorWidth / scaleX, editorHeight / scaleY, fill);
10491
10590
  const { scaleX: precisionScaleX, scaleY: precisionScaleY } = editorScene.getPrecisionScale();
10492
10591
  editorScene.transformByState({
@@ -10496,11 +10595,6 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10496
10595
  scaleY: scaleY * scaleAdjustY
10497
10596
  });
10498
10597
  documentComponent.resize(editorWidth * scaleAdjustX / scaleX, editorHeight * scaleAdjustY / scaleY);
10499
- /**
10500
- * sometimes requestIdleCallback is invalid, so use setTimeout to ensure the successful execution of the resizeBySize method.
10501
- * resize canvas
10502
- * When modifying the selection area for a formula, it is necessary to add a setTimeout to ensure successful updating.
10503
- */
10504
10598
  setTimeout(() => {
10505
10599
  docEngine.resizeBySize((0, _univerjs_engine_render.fixLineWidthByScale)(editorWidth, precisionScaleX), (0, _univerjs_engine_render.fixLineWidthByScale)(physicHeight, precisionScaleY));
10506
10600
  callback === null || callback === void 0 || callback();
@@ -10520,6 +10614,26 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends _u
10520
10614
  show: true
10521
10615
  });
10522
10616
  }
10617
+ _fitEditorViewport(editorScene, editorHeight, clientHeight) {
10618
+ const viewportMain = editorScene.getViewport(_univerjs_docs_ui.VIEWPORT_KEY.VIEW_MAIN);
10619
+ let scrollBar = viewportMain === null || viewportMain === void 0 ? void 0 : viewportMain.getScrollBar();
10620
+ if (editorHeight > clientHeight) {
10621
+ if (scrollBar == null) viewportMain && new _univerjs_engine_render.ScrollBar(viewportMain, {
10622
+ enableHorizontal: false,
10623
+ barSize: 8
10624
+ });
10625
+ else viewportMain === null || viewportMain === void 0 || viewportMain.resetCanvasSizeAndUpdateScroll();
10626
+ viewportMain === null || viewportMain === void 0 || viewportMain.scrollToViewportPos({ viewportScrollY: editorHeight - clientHeight });
10627
+ } else {
10628
+ var _viewportMain$getScro;
10629
+ scrollBar = null;
10630
+ viewportMain === null || viewportMain === void 0 || (_viewportMain$getScro = viewportMain.getScrollBar()) === null || _viewportMain$getScro === void 0 || _viewportMain$getScro.dispose();
10631
+ }
10632
+ return {
10633
+ physicHeight: Math.min(editorHeight, clientHeight),
10634
+ scrollBarWidth: (scrollBar === null || scrollBar === void 0 ? void 0 : scrollBar.barSize) ?? 0
10635
+ };
10636
+ }
10523
10637
  _getEditorContentElement() {
10524
10638
  var _this$_embedFloatingG;
10525
10639
  return ((_this$_embedFloatingG = this._embedFloatingGeometryService) === null || _this$_embedFloatingG === void 0 || (_this$_embedFloatingG = _this$_embedFloatingG.getRegistrationByChildUnitId(this._editingUnitId)) === null || _this$_embedFloatingG === void 0 ? void 0 : _this$_embedFloatingG.contentRoot) ?? this._layoutService.getContentElement();
@@ -10978,27 +11092,6 @@ function generateArrowSelectionShortCutItem() {
10978
11092
  }
10979
11093
  });
10980
11094
  }
10981
- for (const [binding, macArrow, direction] of [[
10982
- _univerjs_ui.KeyCode.HOME,
10983
- _univerjs_ui.KeyCode.ARROW_LEFT,
10984
- _univerjs_core.Direction.LEFT
10985
- ], [
10986
- _univerjs_ui.KeyCode.END,
10987
- _univerjs_ui.KeyCode.ARROW_RIGHT,
10988
- _univerjs_core.Direction.RIGHT
10989
- ]]) for (const extend of [false, true]) {
10990
- const shift = extend ? _univerjs_ui.MetaKeys.SHIFT : 0;
10991
- shortcutList.push({
10992
- id: extend ? _univerjs_docs_ui.MoveSelectionOperation.id : _univerjs_docs_ui.MoveCursorOperation.id,
10993
- binding: binding | shift,
10994
- mac: macArrow | _univerjs_ui.MetaKeys.CTRL_COMMAND | shift,
10995
- preconditions: whenEditorDidNotInputFormulaActivated,
10996
- staticParameters: {
10997
- direction,
10998
- granularity: "line"
10999
- }
11000
- });
11001
- }
11002
11095
  return shortcutList;
11003
11096
  }
11004
11097
  const StartEditWithF2Shortcut = {
@@ -11399,15 +11492,15 @@ function getPercentOffset(editCellState, dataStream) {
11399
11492
  }
11400
11493
  function getPercentEditorSelection(editCellState, visibleParam, dataStream) {
11401
11494
  const percentOffset = getPercentOffset(editCellState, dataStream);
11402
- if (percentOffset == null) return null;
11403
- const { eventType, initialValue, keycode } = visibleParam;
11404
- if ((0, _univerjs_core.isFormulaString)(dataStream) && (eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick || keycode === _univerjs_ui.KeyCode.F2)) return null;
11405
- if (eventType === _univerjs_engine_render.DeviceInputEventType.Keyboard && keycode === _univerjs_ui.KeyCode.F2) return {
11495
+ if (percentOffset == null || visibleParam.eventType !== _univerjs_engine_render.DeviceInputEventType.Keyboard) return null;
11496
+ const { initialValue, keycode } = visibleParam;
11497
+ if ((0, _univerjs_core.isFormulaString)(dataStream) && keycode === _univerjs_ui.KeyCode.F2) return null;
11498
+ if (keycode === _univerjs_ui.KeyCode.F2) return {
11406
11499
  startOffset: percentOffset,
11407
11500
  endOffset: percentOffset,
11408
11501
  collapsed: true
11409
11502
  };
11410
- if (eventType !== _univerjs_engine_render.DeviceInputEventType.Dblclick && (eventType !== _univerjs_engine_render.DeviceInputEventType.Keyboard || keycode === _univerjs_ui.KeyCode.BACKSPACE || keycode === _univerjs_ui.KeyCode.DELETE || !/^\d/.test(initialValue ?? ""))) return null;
11503
+ if (keycode === _univerjs_ui.KeyCode.BACKSPACE || keycode === _univerjs_ui.KeyCode.DELETE || !/^\d/.test(initialValue ?? "")) return null;
11411
11504
  return {
11412
11505
  startOffset: 0,
11413
11506
  endOffset: percentOffset,
@@ -11657,7 +11750,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
11657
11750
  }));
11658
11751
  }
11659
11752
  _handleEditorVisible(param) {
11660
- var _this$_sheetCellEdito4, _documentDataModel$ge, _this$_renderManagerS5;
11753
+ var _documentDataModel$ge, _this$_renderManagerS6;
11661
11754
  const { eventType, keycode } = param;
11662
11755
  this._cursorChange = eventType === _univerjs_engine_render.DeviceInputEventType.PointerDown || eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick ? 2 : 1;
11663
11756
  const editCellState = this._editorBridgeService.getEditLocation();
@@ -11676,21 +11769,25 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
11676
11769
  this._editorBridgeService.refreshEditCellPosition(false);
11677
11770
  const editorObject = this._getEditorObject();
11678
11771
  if (editorObject == null) return;
11679
- const { document, scene } = editorObject;
11772
+ const { document } = editorObject;
11680
11773
  this._contextService.setContextValue(_univerjs_core.EDITOR_ACTIVATED, true);
11681
11774
  const documentDataModel = this._getDocumentDataModel();
11682
11775
  const skeleton = this._getEditorSkeleton(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
11683
11776
  if (!skeleton || !documentDataModel) return;
11684
- (_this$_sheetCellEdito4 = this._sheetCellEditorResizeService) === null || _this$_sheetCellEdito4 === void 0 || _this$_sheetCellEdito4.fitTextSize(() => {
11685
- const viewMain = scene.getViewport(_univerjs_docs_ui.VIEWPORT_KEY.VIEW_MAIN);
11686
- viewMain === null || viewMain === void 0 || viewMain.scrollToViewportPos({
11687
- viewportScrollX: Number.POSITIVE_INFINITY,
11688
- viewportScrollY: Number.POSITIVE_INFINITY
11689
- });
11690
- });
11777
+ this._resizeEditorOnOpen(param, editorObject, !!isInArrayFormulaRange);
11691
11778
  const clearAndEdit = () => {
11779
+ const resetPointerSelection = isInArrayFormulaRange && eventType === _univerjs_engine_render.DeviceInputEventType.PointerDown;
11780
+ const editorId = this._contextService.getContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR) ? _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY : this._editorBridgeService.getCurrentEditorId();
11781
+ if (resetPointerSelection) {
11782
+ var _this$_renderManagerS5;
11783
+ (_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS5 === void 0 || _this$_renderManagerS5.with(_univerjs_docs_ui.DocSelectionRenderService).cancelPointerSelection();
11784
+ }
11692
11785
  this._emptyDocumentDataModel(documentDataModel.getSnapshot().documentStyle, !!isInArrayFormulaRange);
11693
11786
  document.makeDirty();
11787
+ if (resetPointerSelection) {
11788
+ var _this$_getEditorSkele;
11789
+ (_this$_getEditorSkele = this._getEditorSkeleton(editorId)) === null || _this$_getEditorSkele === void 0 || _this$_getEditorSkele.calculate();
11790
+ }
11694
11791
  if (keycode === _univerjs_ui.KeyCode.BACKSPACE || eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick) {
11695
11792
  skeleton.calculate();
11696
11793
  this._editorBridgeService.changeEditorDirty(true);
@@ -11702,6 +11799,27 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
11702
11799
  unitId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
11703
11800
  subUnitId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY
11704
11801
  });
11802
+ if (resetPointerSelection && editorId !== _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY) {
11803
+ const selectionTarget = {
11804
+ unitId: editorId,
11805
+ subUnitId: editorId
11806
+ };
11807
+ const previousSelection = this._textSelectionManagerService.getSelectionInfo(selectionTarget);
11808
+ this._textSelectionManagerService.replaceSelectionInfoWithoutRefresh({
11809
+ textRanges: [{
11810
+ startOffset: 0,
11811
+ endOffset: 0,
11812
+ collapsed: true,
11813
+ isActive: true
11814
+ }],
11815
+ rectRanges: [],
11816
+ segmentId: "",
11817
+ segmentPage: -1,
11818
+ style: (previousSelection === null || previousSelection === void 0 ? void 0 : previousSelection.style) ?? _univerjs_engine_render.NORMAL_TEXT_SELECTION_PLUGIN_STYLE,
11819
+ isEditing: true
11820
+ }, selectionTarget);
11821
+ this._textSelectionManagerService.refreshSelection(selectionTarget, true);
11822
+ }
11705
11823
  };
11706
11824
  const replaceSelection = (selection) => {
11707
11825
  this._textSelectionManagerService.replaceDocRanges([selection], {
@@ -11712,7 +11830,7 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
11712
11830
  const percentSelection = getPercentEditorSelection(editCellState, param, (_documentDataModel$ge = documentDataModel.getBody()) === null || _documentDataModel$ge === void 0 ? void 0 : _documentDataModel$ge.dataStream);
11713
11831
  const cellImage = (0, _univerjs_sheets.isCellImage)(documentDataModel.getSnapshot());
11714
11832
  this._submitEmptyCellImageEdit = cellImage && eventType === _univerjs_engine_render.DeviceInputEventType.Keyboard && keycode === _univerjs_ui.KeyCode.BACKSPACE;
11715
- if (cellImage) clearAndEdit();
11833
+ if (cellImage || isInArrayFormulaRange) clearAndEdit();
11716
11834
  else if (eventType === _univerjs_engine_render.DeviceInputEventType.Keyboard && keycode === _univerjs_ui.KeyCode.F2) {
11717
11835
  var _documentDataModel$ge2;
11718
11836
  document.makeDirty();
@@ -11727,19 +11845,39 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
11727
11845
  endOffset,
11728
11846
  collapsed: true
11729
11847
  });
11730
- } else if (eventType === _univerjs_engine_render.DeviceInputEventType.Keyboard || eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick && isInArrayFormulaRange) {
11848
+ } else if (eventType === _univerjs_engine_render.DeviceInputEventType.Keyboard) {
11731
11849
  if (percentSelection) replaceSelection(percentSelection);
11732
11850
  else clearAndEdit();
11733
11851
  } else if (eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick) {
11734
11852
  if (this._contextService.getContextValue(_univerjs_core.FOCUSING_EDITOR_INPUT_FORMULA)) return;
11735
- const endOffset = documentDataModel.getBody().dataStream.length - 2 || 0;
11736
- replaceSelection(percentSelection ?? {
11737
- startOffset: 0,
11853
+ const dataStream = documentDataModel.getBody().dataStream;
11854
+ const endOffset = (!(0, _univerjs_core.isFormulaString)(dataStream) ? getPercentOffset(editCellState, dataStream) : null) ?? dataStream.length - 2;
11855
+ replaceSelection({
11856
+ startOffset: endOffset,
11738
11857
  endOffset,
11739
- collapsed: endOffset === 0
11858
+ collapsed: true
11740
11859
  });
11741
11860
  }
11742
- (_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS5 === void 0 || _this$_renderManagerS5.scene.resetCursor();
11861
+ (_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS6 === void 0 || _this$_renderManagerS6.scene.resetCursor();
11862
+ }
11863
+ _resizeEditorOnOpen(param, editorObject, isInArrayFormulaRange) {
11864
+ var _this$_sheetCellEdito4;
11865
+ const pointerPosition = param.eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick ? param.pointerPosition : void 0;
11866
+ (_this$_sheetCellEdito4 = this._sheetCellEditorResizeService) === null || _this$_sheetCellEdito4 === void 0 || _this$_sheetCellEdito4.fitTextSize(() => {
11867
+ var _scene$getViewport;
11868
+ if (pointerPosition && this._editorBridgeService.isVisible() !== param) return;
11869
+ const { engine, scene } = editorObject;
11870
+ (_scene$getViewport = scene.getViewport(_univerjs_docs_ui.VIEWPORT_KEY.VIEW_MAIN)) === null || _scene$getViewport === void 0 || _scene$getViewport.scrollToViewportPos({
11871
+ viewportScrollX: pointerPosition ? 0 : Number.POSITIVE_INFINITY,
11872
+ viewportScrollY: pointerPosition ? 0 : Number.POSITIVE_INFINITY
11873
+ });
11874
+ if (!pointerPosition || isInArrayFormulaRange) return;
11875
+ const rect = engine.getCanvasElement().getBoundingClientRect();
11876
+ if (rect.width > 0 && rect.height > 0) {
11877
+ var _this$_renderManagerS7;
11878
+ (_this$_renderManagerS7 = this._renderManagerService.getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS7 === void 0 || _this$_renderManagerS7.with(_univerjs_docs_ui.DocSelectionRenderService).setCursorManually((pointerPosition.x - rect.left) * engine.width / rect.width, (pointerPosition.y - rect.top) * engine.height / rect.height, true, true, { strict: false });
11879
+ }
11880
+ });
11743
11881
  }
11744
11882
  _cacheEmptyCellTextStyle() {
11745
11883
  var _this$_editorBridgeSe, _sourceBody$textRuns;
@@ -11872,8 +12010,8 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
11872
12010
  const editorUnitId = this._editorBridgeService.getCurrentEditorId();
11873
12011
  if (editorUnitId == null || !this._editorService.isSheetEditor(editorUnitId)) return;
11874
12012
  if (editorUnitId === _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY) {
11875
- var _this$_getEditorSkele;
11876
- (_this$_getEditorSkele = this._getEditorSkeleton(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_getEditorSkele === void 0 || _this$_getEditorSkele.resetInitialWidth();
12013
+ var _this$_getEditorSkele2;
12014
+ (_this$_getEditorSkele2 = this._getEditorSkeleton(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_getEditorSkele2 === void 0 || _this$_getEditorSkele2.resetInitialWidth();
11877
12015
  }
11878
12016
  this._clearEditorHistory();
11879
12017
  }
@@ -11939,12 +12077,12 @@ let EditingRenderController = class EditingRenderController extends _univerjs_co
11939
12077
  return this._univerInstanceService.getUnit(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
11940
12078
  }
11941
12079
  _getEditorSkeleton(editorId) {
11942
- var _this$_renderManagerS6;
11943
- return (_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS6 === void 0 ? void 0 : _this$_renderManagerS6.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
12080
+ var _this$_renderManagerS8;
12081
+ return (_this$_renderManagerS8 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS8 === void 0 ? void 0 : _this$_renderManagerS8.with(_univerjs_docs.DocSkeletonManagerService).getSkeleton();
11944
12082
  }
11945
12083
  _getEditorViewModel(editorId) {
11946
- var _this$_renderManagerS7;
11947
- return (_this$_renderManagerS7 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS7 === void 0 ? void 0 : _this$_renderManagerS7.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
12084
+ var _this$_renderManagerS9;
12085
+ return (_this$_renderManagerS9 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS9 === void 0 ? void 0 : _this$_renderManagerS9.with(_univerjs_docs.DocSkeletonManagerService).getViewModel();
11948
12086
  }
11949
12087
  _getEditingUnit() {
11950
12088
  return this._editingUnit ? this._univerInstanceService.getUnit(this._editingUnit, _univerjs_core.UniverInstanceType.UNIVER_SHEET) : null;
@@ -13915,14 +14053,15 @@ let HoverManagerService = class HoverManagerService extends _univerjs_core.Dispo
13915
14053
  location: getLocationBase(activeCell.location)
13916
14054
  });
13917
14055
  }
13918
- triggerDbClick(unitId, offsetX, offsetY) {
14056
+ triggerDbClick(unitId, event) {
13919
14057
  const deps = this._getCalcDeps(unitId);
13920
14058
  if (!deps) return;
13921
14059
  const { currentRender, workbook, worksheet, skeletonParam } = deps;
13922
- const activeCell = this._calcActiveCell(currentRender, workbook, worksheet, skeletonParam, offsetX, offsetY);
14060
+ const activeCell = this._calcActiveCell(currentRender, workbook, worksheet, skeletonParam, event.offsetX, event.offsetY);
13923
14061
  if (activeCell) this._currentDbClickedCell$.next({
13924
14062
  ...activeCell,
13925
- location: getLocationBase(activeCell.location)
14063
+ location: getLocationBase(activeCell.location),
14064
+ event
13926
14065
  });
13927
14066
  }
13928
14067
  triggerScroll() {
@@ -13992,7 +14131,7 @@ let HoverRenderController = class HoverRenderController extends _univerjs_core.D
13992
14131
  if (!skeletonParam) return;
13993
14132
  const { mainComponent, unitId, components } = this._context;
13994
14133
  if (!mainComponent) return;
13995
- disposeSet.add(mainComponent.onPointerEnter$.subscribeEvent((evt) => {
14134
+ disposeSet.add(mainComponent.onPointerEnter$.subscribeEvent(() => {
13996
14135
  this._active = true;
13997
14136
  }));
13998
14137
  disposeSet.add((0, _univerjs_core.fromEventSubject)(mainComponent.onPointerMove$).subscribe((evt) => {
@@ -14009,7 +14148,7 @@ let HoverRenderController = class HoverRenderController extends _univerjs_core.D
14009
14148
  this._hoverManagerService.triggerClick(unitId, evt.offsetX, evt.offsetY);
14010
14149
  }));
14011
14150
  disposeSet.add(mainComponent.onDblclick$.subscribeEvent((evt) => {
14012
- this._hoverManagerService.triggerDbClick(unitId, evt.offsetX, evt.offsetY);
14151
+ this._hoverManagerService.triggerDbClick(unitId, evt);
14013
14152
  }));
14014
14153
  disposeSet.add(mainComponent.onPointerLeave$.subscribeEvent(() => {
14015
14154
  this._active = false;
@@ -14583,6 +14722,7 @@ let HeaderFreezeRenderController = class HeaderFreezeRenderController extends _u
14583
14722
  if (row === -1 || row === 0) isTopView = false;
14584
14723
  if (column === -1 || column === 0) isLeftView = false;
14585
14724
  const startSheetView = skeleton.getNoMergeCellWithCoordByIndex(row - ySplit, column - xSplit, false);
14725
+ if (isTopView && row === ySplit) startSheetView.startY = 0;
14586
14726
  const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(row, column, false);
14587
14727
  viewMainLeftTop.disable();
14588
14728
  viewMainTop.disable();
@@ -14815,6 +14955,10 @@ let HeaderFreezeRenderController = class HeaderFreezeRenderController extends _u
14815
14955
  * When switching sheet tabs, it is necessary to update the frozen state of the current view.
14816
14956
  */
14817
14957
  _skeletonListener() {
14958
+ this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.pipe((0, rxjs.switchMap)((param) => {
14959
+ var _param$skeleton;
14960
+ return (param === null || param === void 0 || (_param$skeleton = param.skeleton) === null || _param$skeleton === void 0 ? void 0 : _param$skeleton.gapConfigChanged$) ?? rxjs.EMPTY;
14961
+ })).subscribe(() => this._refreshCurrent()));
14818
14962
  this.disposeWithMe((0, _univerjs_core.toDisposable)(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((param) => {
14819
14963
  if ([
14820
14964
  _univerjs_sheets.SetWorksheetActiveOperation.id,
@@ -17202,6 +17346,10 @@ const MoveRangeConfirmCommand = {
17202
17346
  id: "sheet.command.move-range-confirm",
17203
17347
  handler: async (accessor, params) => {
17204
17348
  if (!params) return false;
17349
+ if (!await accessor.get(_univerjs_sheets.SheetInterceptorService).beforeCommandExecute({
17350
+ id: _univerjs_sheets.MoveRangeCommand.id,
17351
+ params
17352
+ })) return false;
17205
17353
  const commandService = accessor.get(_univerjs_core.ICommandService);
17206
17354
  const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
17207
17355
  const sourceTarget = (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService, {
@@ -17346,51 +17494,51 @@ const BORDER_LINE_CHILDREN = [
17346
17494
  ];
17347
17495
  const BORDER_SIZE_CHILDREN = [
17348
17496
  {
17349
- label: _univerjs_core.BorderStyleTypes.THIN,
17497
+ label: "sheets-ui.borderStyle.thin",
17350
17498
  value: _univerjs_core.BorderStyleTypes.THIN
17351
17499
  },
17352
17500
  {
17353
- label: _univerjs_core.BorderStyleTypes.HAIR,
17501
+ label: "sheets-ui.borderStyle.hair",
17354
17502
  value: _univerjs_core.BorderStyleTypes.HAIR
17355
17503
  },
17356
17504
  {
17357
- label: _univerjs_core.BorderStyleTypes.DOTTED,
17505
+ label: "sheets-ui.borderStyle.dotted",
17358
17506
  value: _univerjs_core.BorderStyleTypes.DOTTED
17359
17507
  },
17360
17508
  {
17361
- label: _univerjs_core.BorderStyleTypes.DASHED,
17509
+ label: "sheets-ui.borderStyle.dashed",
17362
17510
  value: _univerjs_core.BorderStyleTypes.DASHED
17363
17511
  },
17364
17512
  {
17365
- label: _univerjs_core.BorderStyleTypes.DASH_DOT,
17513
+ label: "sheets-ui.borderStyle.dashDot",
17366
17514
  value: _univerjs_core.BorderStyleTypes.DASH_DOT
17367
17515
  },
17368
17516
  {
17369
- label: _univerjs_core.BorderStyleTypes.DASH_DOT_DOT,
17517
+ label: "sheets-ui.borderStyle.dashDotDot",
17370
17518
  value: _univerjs_core.BorderStyleTypes.DASH_DOT_DOT
17371
17519
  },
17372
17520
  {
17373
- label: _univerjs_core.BorderStyleTypes.MEDIUM,
17521
+ label: "sheets-ui.borderStyle.medium",
17374
17522
  value: _univerjs_core.BorderStyleTypes.MEDIUM
17375
17523
  },
17376
17524
  {
17377
- label: _univerjs_core.BorderStyleTypes.MEDIUM_DASHED,
17525
+ label: "sheets-ui.borderStyle.mediumDashed",
17378
17526
  value: _univerjs_core.BorderStyleTypes.MEDIUM_DASHED
17379
17527
  },
17380
17528
  {
17381
- label: _univerjs_core.BorderStyleTypes.MEDIUM_DASH_DOT,
17529
+ label: "sheets-ui.borderStyle.mediumDashDot",
17382
17530
  value: _univerjs_core.BorderStyleTypes.MEDIUM_DASH_DOT
17383
17531
  },
17384
17532
  {
17385
- label: _univerjs_core.BorderStyleTypes.MEDIUM_DASH_DOT_DOT,
17533
+ label: "sheets-ui.borderStyle.mediumDashDotDot",
17386
17534
  value: _univerjs_core.BorderStyleTypes.MEDIUM_DASH_DOT_DOT
17387
17535
  },
17388
17536
  {
17389
- label: _univerjs_core.BorderStyleTypes.THICK,
17537
+ label: "sheets-ui.borderStyle.thick",
17390
17538
  value: _univerjs_core.BorderStyleTypes.THICK
17391
17539
  },
17392
17540
  {
17393
- label: _univerjs_core.BorderStyleTypes.DOUBLE,
17541
+ label: "sheets-ui.borderStyle.double",
17394
17542
  value: _univerjs_core.BorderStyleTypes.DOUBLE
17395
17543
  }
17396
17544
  ];
@@ -19198,7 +19346,7 @@ function WrapTextMenuItemFactory(accessor) {
19198
19346
  const disposable = accessor.get(_univerjs_core.ICommandService).onCommandExecuted((c) => {
19199
19347
  var _selectionManagerServ14;
19200
19348
  const id = c.id;
19201
- if (id !== _univerjs_sheets.SetTextWrapCommand.id && id !== _univerjs_sheets.SetSelectionsOperation.id && id !== _univerjs_sheets.SetWorksheetActiveOperation.id) return;
19349
+ if (id !== _univerjs_sheets.SetRangeValuesMutation.id && id !== _univerjs_sheets.SetSelectionsOperation.id && id !== _univerjs_sheets.SetWorksheetActiveOperation.id) return;
19202
19350
  const primary = (_selectionManagerServ14 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ14 === void 0 ? void 0 : _selectionManagerServ14.primary;
19203
19351
  let tb;
19204
19352
  if (primary != null) {
@@ -19230,33 +19378,34 @@ function ShrinkToFitMenuItemFactory(accessor) {
19230
19378
  const commandService = accessor.get(_univerjs_core.ICommandService);
19231
19379
  const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
19232
19380
  const selectionManagerService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
19381
+ const style$ = deriveStateFromActiveSheet$(univerInstanceService, {}, ({ worksheet }) => new rxjs.Observable((subscriber) => {
19382
+ const update = () => {
19383
+ var _selectionManagerServ16;
19384
+ const primary = (_selectionManagerServ16 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ16 === void 0 ? void 0 : _selectionManagerServ16.primary;
19385
+ subscriber.next(primary != null ? worksheet.getComposedCellStyle(primary.startRow, primary.startColumn) ?? {} : {});
19386
+ };
19387
+ const disposable = commandService.onCommandExecuted((command) => {
19388
+ if ([
19389
+ _univerjs_sheets.SetRangeValuesMutation.id,
19390
+ _univerjs_sheets.SetSelectionsOperation.id,
19391
+ _univerjs_sheets.SetWorksheetActiveOperation.id
19392
+ ].includes(command.id)) update();
19393
+ });
19394
+ update();
19395
+ return disposable.dispose;
19396
+ }));
19233
19397
  return {
19234
19398
  id: _univerjs_sheets.SetShrinkToFitCommand.id,
19235
19399
  type: _univerjs_ui.MenuItemType.BUTTON,
19236
19400
  icon: "ShrinkToFitIcon",
19237
19401
  title: "sheets-ui.toolbar.shrinkToFit",
19238
19402
  tooltip: "sheets-ui.toolbar.shrinkToFit",
19239
- activated$: deriveStateFromActiveSheet$(univerInstanceService, false, ({ worksheet }) => new rxjs.Observable((subscriber) => {
19240
- const update = () => {
19241
- var _selectionManagerServ16, _worksheet$getCompose;
19242
- const primary = (_selectionManagerServ16 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ16 === void 0 ? void 0 : _selectionManagerServ16.primary;
19243
- subscriber.next(primary != null && ((_worksheet$getCompose = worksheet.getComposedCellStyle(primary.startRow, primary.startColumn)) === null || _worksheet$getCompose === void 0 ? void 0 : _worksheet$getCompose.stf) === _univerjs_core.BooleanNumber.TRUE);
19244
- };
19245
- const disposable = commandService.onCommandExecuted((command) => {
19246
- if ([
19247
- _univerjs_sheets.SetRangeValuesMutation.id,
19248
- _univerjs_sheets.SetSelectionsOperation.id,
19249
- _univerjs_sheets.SetWorksheetActiveOperation.id
19250
- ].includes(command.id)) update();
19251
- });
19252
- update();
19253
- return disposable.dispose;
19254
- })),
19255
- disabled$: getCurrentRangeDisable$(accessor, {
19403
+ activated$: style$.pipe((0, rxjs.map)((style) => style.stf === _univerjs_core.BooleanNumber.TRUE && style.tb !== _univerjs_core.WrapStrategy.WRAP)),
19404
+ disabled$: (0, rxjs.combineLatest)([getCurrentRangeDisable$(accessor, {
19256
19405
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
19257
19406
  worksheetTypes: [_univerjs_sheets.WorksheetEditPermission, _univerjs_sheets.WorksheetSetCellStylePermission],
19258
19407
  rangeTypes: [_univerjs_sheets.RangeProtectionPermissionEditPoint]
19259
- }),
19408
+ }), style$]).pipe((0, rxjs.map)(([disabled, style]) => disabled || style.tb === _univerjs_core.WrapStrategy.WRAP)),
19260
19409
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
19261
19410
  };
19262
19411
  }
@@ -19419,6 +19568,7 @@ function PasteRibbonMenuItemFactory(accessor) {
19419
19568
  return {
19420
19569
  ...PasteSpacialMenuItemFactory(accessor),
19421
19570
  id: PASTE_RIBBON_MENU_ID,
19571
+ icon: "DocPasteOptionsIcon",
19422
19572
  title: "sheets-ui.rightClick.paste",
19423
19573
  hidden$: (0, rxjs.combineLatest)([getObservableWithExclusiveRange$(accessor, (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)), accessor.get(_univerjs_core.IContextService).subscribeContextValue$(_univerjs_core.FOCUSING_SHAPE_TEXT_EDITOR).pipe((0, rxjs.startWith)(false))]).pipe((0, rxjs.map)(([hidden, editing]) => hidden || editing))
19424
19574
  };
@@ -19691,6 +19841,9 @@ function SetColWidthMenuItemFactory(accessor) {
19691
19841
  //#endregion
19692
19842
  //#region src/menu/merge.menu.ts
19693
19843
  function CellMergeMenuItemFactory(accessor) {
19844
+ const commandService = accessor.get(_univerjs_core.ICommandService);
19845
+ const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
19846
+ const selectionService = accessor.get(_univerjs_sheets.SheetsSelectionsService);
19694
19847
  const editDisabled$ = getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
19695
19848
  workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
19696
19849
  worksheetTypes: [
@@ -19706,6 +19859,22 @@ function CellMergeMenuItemFactory(accessor) {
19706
19859
  icon: "MergeAllIcon",
19707
19860
  tooltip: "sheets-ui.toolbar.mergeCell.main",
19708
19861
  type: _univerjs_ui.MenuItemType.SUBITEMS,
19862
+ activated$: deriveStateFromActiveSheet$(instanceService, false, ({ worksheet }) => new rxjs.Observable((subscriber) => {
19863
+ const update = () => {
19864
+ var _selectionService$get;
19865
+ const primary = (_selectionService$get = selectionService.getCurrentLastSelection()) === null || _selectionService$get === void 0 ? void 0 : _selectionService$get.primary;
19866
+ subscriber.next(!!primary && !!worksheet.getMergedCell(primary.actualRow, primary.actualColumn));
19867
+ };
19868
+ const selectionSubscription = selectionService.selectionChanged$.subscribe(update);
19869
+ const commandDisposable = commandService.onCommandExecuted((command) => {
19870
+ if (command.id === _univerjs_sheets.AddWorksheetMergeMutation.id || command.id === _univerjs_sheets.RemoveWorksheetMergeMutation.id) update();
19871
+ });
19872
+ update();
19873
+ return () => {
19874
+ selectionSubscription.unsubscribe();
19875
+ commandDisposable.dispose();
19876
+ };
19877
+ })).pipe((0, rxjs.distinctUntilChanged)()),
19709
19878
  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)),
19710
19879
  disabled$: editDisabled$.pipe((0, rxjs.combineLatestWith)(selectionsHasCross$), (0, rxjs.map)(([disable, hasCross]) => disable || hasCross))
19711
19880
  };
@@ -20289,18 +20458,6 @@ function Text2NumberContextMenuItemFactory(accessor) {
20289
20458
  };
20290
20459
  }
20291
20460
 
20292
- //#endregion
20293
- //#region src/views/sheet-slider/SheetZoomInput.tsx
20294
- const SHEET_ZOOM_INPUT_COMPONENT = "SHEET_ZOOM_INPUT_COMPONENT";
20295
- function SheetZoomInput({ className, ...props }) {
20296
- const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
20297
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_ui.ZoomInput, {
20298
- ...props,
20299
- className: (0, _univerjs_design.clsx)("!univer-bg-transparent dark:!univer-bg-transparent", className),
20300
- onChange: (value) => commandService.executeCommand(SetZoomRatioFromToolbarCommand.id, { value })
20301
- });
20302
- }
20303
-
20304
20461
  //#endregion
20305
20462
  //#region src/menu/zoom.menu.ts
20306
20463
  const ZOOM_RATIO_MENU_ID = "sheet.menu.zoom-ratio";
@@ -20329,16 +20486,14 @@ function getZoomRatioValue$(accessor) {
20329
20486
  function ZoomRatioMenuItemFactory(accessor) {
20330
20487
  return {
20331
20488
  id: ZOOM_RATIO_MENU_ID,
20332
- commandId: SetZoomRatioFromToolbarCommand.id,
20333
- type: _univerjs_ui.MenuItemType.BUTTON,
20334
- label: {
20335
- name: SHEET_ZOOM_INPUT_COMPONENT,
20336
- props: {
20337
- min: SHEET_ZOOM_RANGE[0],
20338
- max: SHEET_ZOOM_RANGE[1],
20339
- shortcuts: ZOOM_RATIO_LIST
20340
- }
20341
- },
20489
+ selectionsCommandId: SetZoomRatioFromToolbarCommand.id,
20490
+ type: _univerjs_ui.MenuItemType.SELECTOR,
20491
+ icon: "ZoomInIcon",
20492
+ tooltip: "sheets-ui.toolbar.zoom",
20493
+ selections: ZOOM_RATIO_LIST.map((value) => ({
20494
+ value,
20495
+ label: `${value}%`
20496
+ })),
20342
20497
  value$: getZoomRatioValue$(accessor),
20343
20498
  hidden$: (0, _univerjs_ui.getMenuHiddenObservable)(accessor, _univerjs_core.UniverInstanceType.UNIVER_SHEET)
20344
20499
  };
@@ -20575,31 +20730,29 @@ const menuSchema = {
20575
20730
  order: 1,
20576
20731
  gridLayout: {
20577
20732
  row: 1,
20578
- column: 2,
20579
- width: 112
20733
+ column: 2
20580
20734
  },
20581
20735
  menuItemFactory: ZoomRatioMenuItemFactory
20736
+ }
20737
+ },
20738
+ [_univerjs_ui.RibbonViewGroup.VISIBILITY]: {
20739
+ [_univerjs_sheets.ToggleGridlinesCommand.id]: {
20740
+ order: 0,
20741
+ gridLayout: {
20742
+ row: 1,
20743
+ column: 1
20744
+ },
20745
+ menuItemFactory: ToggleGridlinesMenuFactory
20582
20746
  },
20583
20747
  [_univerjs_ui.ToggleFullscreenOperation.id]: {
20584
- order: 2,
20748
+ order: 1,
20585
20749
  gridLayout: {
20586
20750
  row: 2,
20587
- column: 2,
20588
- showLabel: true,
20589
- width: 112
20751
+ column: 1
20590
20752
  },
20591
20753
  menuItemFactory: FullscreenMenuItemFactory
20592
20754
  }
20593
- },
20594
- [_univerjs_ui.RibbonViewGroup.VISIBILITY]: { [_univerjs_sheets.ToggleGridlinesCommand.id]: {
20595
- order: 0,
20596
- gridLayout: {
20597
- row: 1,
20598
- column: 1,
20599
- showLabel: true
20600
- },
20601
- menuItemFactory: ToggleGridlinesMenuFactory
20602
- } }
20755
+ }
20603
20756
  },
20604
20757
  [_univerjs_ui.ContextMenuPosition.MAIN_AREA]: {
20605
20758
  [_univerjs_ui.ContextMenuGroup.QUICK]: {
@@ -21107,14 +21260,12 @@ function useWorkbooks() {
21107
21260
 
21108
21261
  //#endregion
21109
21262
  //#region src/views/editor-container/focus-editor.ts
21110
- const SHEET_CELL_EDITOR_ELEMENT_ID = `__editor_${_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY}`;
21111
- const SHEET_CELL_EDITOR_SELECTION_CONTAINER_ID = `univer-doc-selection-container-${_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY}`;
21112
- function focusSheetCellEditorElement(ownerDocument = document) {
21113
- const element = ownerDocument.getElementById(SHEET_CELL_EDITOR_ELEMENT_ID);
21114
- if (element == null || ownerDocument.activeElement === element) return false;
21115
- if (!element.hasAttribute("tabindex")) element.tabIndex = -1;
21116
- element.focus({ preventScroll: true });
21117
- return ownerDocument.activeElement === element;
21263
+ function focusSheetCellEditorElement(editorService) {
21264
+ var _editorService$getEdi;
21265
+ const selection = (_editorService$getEdi = editorService.getEditor(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _editorService$getEdi === void 0 ? void 0 : _editorService$getEdi.docSelectionRenderService;
21266
+ if (!selection || selection.isFocusing) return false;
21267
+ selection.focus();
21268
+ return selection.isFocusing;
21118
21269
  }
21119
21270
  function registerSheetCellEditorRuntimePortal(options) {
21120
21271
  const ownerDocument = options.ownerDocument ?? (typeof document === "undefined" ? void 0 : document);
@@ -21127,8 +21278,10 @@ function registerSheetCellEditorRuntimePortal(options) {
21127
21278
  const frameHandles = [];
21128
21279
  let observer;
21129
21280
  const tryRegister = () => {
21281
+ var _options$editorServic;
21130
21282
  if (disposed) return;
21131
- const portalRoot = resolveSheetCellEditorPortalRoot(ownerDocument);
21283
+ const selection = (_options$editorServic = options.editorService.getEditor(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _options$editorServic === void 0 ? void 0 : _options$editorServic.docSelectionRenderService;
21284
+ const portalRoot = (selection === null || selection === void 0 ? void 0 : selection.selectionContainer.isConnected) ? selection.selectionContainer : null;
21132
21285
  if (portalRoot === registeredPortalRoot) return;
21133
21286
  portalRegistration === null || portalRegistration === void 0 || portalRegistration.dispose();
21134
21287
  portalRegistration = void 0;
@@ -21143,7 +21296,7 @@ function registerSheetCellEditorRuntimePortal(options) {
21143
21296
  role: "child-editor",
21144
21297
  element: portalRoot
21145
21298
  }));
21146
- const editorElement = ownerDocument.getElementById(SHEET_CELL_EDITOR_ELEMENT_ID);
21299
+ const editorElement = selection === null || selection === void 0 ? void 0 : selection.inputElement;
21147
21300
  if (editorElement && editorElement !== portalRoot) rootRegistration.add(options.focusCoordinator.registerElement({
21148
21301
  embedId: options.embedId,
21149
21302
  role: "child-editor",
@@ -21186,9 +21339,6 @@ function registerSheetCellEditorRuntimePortal(options) {
21186
21339
  }));
21187
21340
  return collection;
21188
21341
  }
21189
- function resolveSheetCellEditorPortalRoot(ownerDocument = document) {
21190
- return ownerDocument.getElementById(SHEET_CELL_EDITOR_SELECTION_CONTAINER_ID) ?? ownerDocument.getElementById(SHEET_CELL_EDITOR_ELEMENT_ID);
21191
- }
21192
21342
 
21193
21343
  //#endregion
21194
21344
  //#region src/views/editor-container/hooks.ts
@@ -21258,19 +21408,6 @@ const EDITOR_DEFAULT_POSITION = {
21258
21408
  };
21259
21409
  const CELL_EDITOR_DARK_SURFACE_THEME_COLOR = "gray.800";
21260
21410
  const CELL_EDITOR_LIGHT_SURFACE_THEME_COLOR = "gray.0";
21261
- /**
21262
- * @returns the host background color for the cell editor.
21263
- */
21264
- function getCellEditorHostBackgroundColor(editState, options = {}) {
21265
- var _options$getColorFrom;
21266
- const cellFill = editState === null || editState === void 0 ? void 0 : editState.documentLayoutObject.fill;
21267
- if (cellFill && !isTransparentColor(cellFill)) return cellFill;
21268
- return (_options$getColorFrom = options.getColorFromTheme) === null || _options$getColorFrom === void 0 ? void 0 : _options$getColorFrom.call(options, options.darkMode ? CELL_EDITOR_DARK_SURFACE_THEME_COLOR : CELL_EDITOR_LIGHT_SURFACE_THEME_COLOR);
21269
- }
21270
- function isTransparentColor(color) {
21271
- const normalizedColor = color.trim().toLowerCase().replace(/\s+/g, "");
21272
- return normalizedColor === "transparent" || normalizedColor === "rgba(0,0,0,0)";
21273
- }
21274
21411
  function shouldRefocusCellEditorAfterPointerDown(options) {
21275
21412
  const { root, target, activeElement, isEditorFocusing } = options;
21276
21413
  if (!root || !(target instanceof HTMLElement) || !(activeElement instanceof HTMLElement)) return true;
@@ -21335,10 +21472,13 @@ function EditorContainer({ hidden = false }) {
21335
21472
  const workbook = editState ? instanceService.getUnit(editState.unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET) ?? null : null;
21336
21473
  const activeSheet = useActiveWorksheet(workbook);
21337
21474
  const darkMode = (0, _univerjs_ui.useObservable)(themeService.darkMode$, themeService.darkMode);
21475
+ const cellFill = editState === null || editState === void 0 ? void 0 : editState.documentLayoutObject.fill;
21476
+ const normalizedFill = cellFill === null || cellFill === void 0 ? void 0 : cellFill.trim().toLowerCase().replace(/\s+/g, "");
21477
+ const editorBackgroundColor = cellFill && normalizedFill !== "transparent" && normalizedFill !== "rgba(0,0,0,0)" ? cellFill : themeService.getColorFromTheme(darkMode ? CELL_EDITOR_DARK_SURFACE_THEME_COLOR : CELL_EDITOR_LIGHT_SURFACE_THEME_COLOR);
21338
21478
  const [showEditCellAddress, setShowEditCellAddress] = (0, react.useState)(false);
21339
21479
  const editSheetName = editState ? workbook === null || workbook === void 0 || (_workbook$getSheetByS = workbook.getSheetBySheetId(editState.sheetId)) === null || _workbook$getSheetByS === void 0 ? void 0 : _workbook$getSheetByS.getName() : null;
21340
21480
  const editCellAddress = editState ? `${activeSheet && editSheetName && activeSheet.getSheetId() !== editState.sheetId ? `'${(0, _univerjs_engine_formula.quoteSheetName)(editSheetName)}'!` : ""}${(0, _univerjs_core.numberToABC)(editState.column)}${editState.row + 1}` : null;
21341
- const editorBorderColor = genNormalSelectionStyle(themeService).stroke;
21481
+ const { stroke: editorBorderColor, strokeWidth: editorBorderWidth } = genNormalSelectionStyle(themeService);
21342
21482
  const focusCoordinator = injector.has(ISheetEmbedRuntimeFocusCoordinator) ? injector.get(ISheetEmbedRuntimeFocusCoordinator) : void 0;
21343
21483
  const resolveRuntimeFocusState = () => {
21344
21484
  var _instanceService$getF;
@@ -21427,21 +21567,18 @@ function EditorContainer({ hidden = false }) {
21427
21567
  const focusCellEditorElement = () => {
21428
21568
  const scope = rootRef.current ? resolveSheetEmbedRuntimeDomScope(rootRef.current) ?? resolveActiveSheetEmbedRuntimeDomScope(ownerDocument) : resolveActiveSheetEmbedRuntimeDomScope(ownerDocument);
21429
21569
  if (shouldPreserveEmbedInteractiveFocus(scope === null || scope === void 0 ? void 0 : scope.embedId, ownerDocument)) return;
21430
- focusSheetCellEditorElement(ownerDocument);
21570
+ focusSheetCellEditorElement(editorService);
21431
21571
  if (delayedFocusTimer != null) ownerWindow.clearTimeout(delayedFocusTimer);
21432
21572
  delayedFocusTimer = ownerWindow.setTimeout(() => {
21433
21573
  delayedFocusTimer = void 0;
21434
21574
  if (shouldPreserveEmbedInteractiveFocus(scope === null || scope === void 0 ? void 0 : scope.embedId, ownerDocument)) return;
21435
- focusSheetCellEditorElement(ownerDocument);
21575
+ focusSheetCellEditorElement(editorService);
21436
21576
  }, 0);
21437
21577
  };
21438
21578
  const focusEditor = () => {
21439
21579
  if (contextService.getContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR)) return;
21440
21580
  const scope = rootRef.current ? resolveSheetEmbedRuntimeDomScope(rootRef.current) ?? resolveActiveSheetEmbedRuntimeDomScope(ownerDocument) : resolveActiveSheetEmbedRuntimeDomScope(ownerDocument);
21441
21581
  if (shouldPreserveEmbedControlFocus(scope === null || scope === void 0 ? void 0 : scope.embedId, ownerDocument)) return;
21442
- const editor = editorService.getEditor(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
21443
- const docSelectionRenderService = editor === null || editor === void 0 ? void 0 : editor.render.with(_univerjs_docs_ui.DocSelectionRenderService);
21444
- if (!(docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing)) docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
21445
21582
  focusCellEditorElement();
21446
21583
  };
21447
21584
  focusEditor();
@@ -21493,6 +21630,7 @@ function EditorContainer({ hidden = false }) {
21493
21630
  element: editorRoot
21494
21631
  }));
21495
21632
  collection.add(registerSheetCellEditorRuntimePortal({
21633
+ editorService,
21496
21634
  embedId: scope.embedId,
21497
21635
  ownerDocument: rootRef.current.ownerDocument,
21498
21636
  interactionBoundaryService,
@@ -21503,10 +21641,7 @@ function EditorContainer({ hidden = false }) {
21503
21641
  let pointerRetryFrame = 0;
21504
21642
  const focusEditor = () => {
21505
21643
  if (contextService.getContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR) || shouldPreserveEmbedControlFocus(scope.embedId, ownerDocument)) return;
21506
- const editor = editorService.getEditor(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
21507
- const docSelectionRenderService = editor === null || editor === void 0 ? void 0 : editor.render.with(_univerjs_docs_ui.DocSelectionRenderService);
21508
- if (!(docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing)) docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
21509
- focusSheetCellEditorElement(ownerDocument);
21644
+ focusSheetCellEditorElement(editorService);
21510
21645
  };
21511
21646
  const refocusEditorAfterRuntimePointer = (event) => {
21512
21647
  if (!focusCoordinator.isChildUnitRuntimeEvent(scope.childUnitId, event.target, event) || isEmbedRuntimeEditorOrPopup(event.target)) return;
@@ -21541,6 +21676,7 @@ function EditorContainer({ hidden = false }) {
21541
21676
  const ownerDocument = ((_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.ownerDocument) ?? document;
21542
21677
  const interactionBoundaryService = injector.has(ISheetEmbedInteractionBoundaryService) ? injector.get(ISheetEmbedInteractionBoundaryService) : void 0;
21543
21678
  const portalRegistration = registerSheetCellEditorRuntimePortal({
21679
+ editorService,
21544
21680
  embedId: activeSessionScope.embedId,
21545
21681
  ownerDocument,
21546
21682
  interactionBoundaryService,
@@ -21550,12 +21686,12 @@ function EditorContainer({ hidden = false }) {
21550
21686
  let delayedFocusTimer;
21551
21687
  const focusCellEditorElement = () => {
21552
21688
  if (shouldPreserveEmbedInteractiveFocus(activeSessionScope.embedId, ownerDocument)) return;
21553
- focusSheetCellEditorElement(ownerDocument);
21689
+ focusSheetCellEditorElement(editorService);
21554
21690
  if (delayedFocusTimer != null) ownerWindow.clearTimeout(delayedFocusTimer);
21555
21691
  delayedFocusTimer = ownerWindow.setTimeout(() => {
21556
21692
  delayedFocusTimer = void 0;
21557
21693
  if (shouldPreserveEmbedInteractiveFocus(activeSessionScope.embedId, ownerDocument)) return;
21558
- focusSheetCellEditorElement(ownerDocument);
21694
+ focusSheetCellEditorElement(editorService);
21559
21695
  }, 0);
21560
21696
  };
21561
21697
  const focusHiddenEditor = () => {
@@ -21603,9 +21739,9 @@ function EditorContainer({ hidden = false }) {
21603
21739
  visible === null || visible === void 0 ? void 0 : visible.visible
21604
21740
  ]);
21605
21741
  (0, react.useEffect)(() => {
21742
+ var _rootRef$current3;
21743
+ const ownerWindow = (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.ownerDocument.defaultView;
21606
21744
  return () => {
21607
- var _rootRef$current3;
21608
- const ownerWindow = (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.ownerDocument.defaultView;
21609
21745
  if (ownerWindow && pointerRefocusTimerRef.current != null) ownerWindow.clearTimeout(pointerRefocusTimerRef.current);
21610
21746
  };
21611
21747
  }, []);
@@ -21627,12 +21763,11 @@ function EditorContainer({ hidden = false }) {
21627
21763
  if (pointerRefocusTimerRef.current != null) ownerWindow.clearTimeout(pointerRefocusTimerRef.current);
21628
21764
  pointerRefocusTimerRef.current = ownerWindow.setTimeout(() => {
21629
21765
  pointerRefocusTimerRef.current = void 0;
21630
- if (!(docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing)) docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
21631
- focusSheetCellEditorElement(ownerDocument);
21766
+ focusSheetCellEditorElement(editorService);
21632
21767
  }, 0);
21633
21768
  });
21634
21769
  const handleClickSideBar = (0, _univerjs_ui.useEvent)(() => {
21635
- if (editorBridgeService.isVisible().visible) commandService.executeCommand(SetCellEditVisibleOperation.id, {
21770
+ if (editorBridgeService.isVisible().visible) return commandService.executeCommand(SetCellEditVisibleOperation.id, {
21636
21771
  visible: false,
21637
21772
  eventType: _univerjs_engine_render.DeviceInputEventType.PointerUp,
21638
21773
  unitId: editState === null || editState === void 0 ? void 0 : editState.unitId
@@ -21641,7 +21776,7 @@ function EditorContainer({ hidden = false }) {
21641
21776
  (0, _univerjs_ui.useSidebarClick)(handleClickSideBar);
21642
21777
  const keyCodeConfig = useKeyEventConfig(editState === null || editState === void 0 ? void 0 : editState.unitId);
21643
21778
  const onMoveInEditor = (0, _univerjs_ui.useEvent)((keycode, metaKey) => {
21644
- commandService.executeCommand(SetCellEditVisibleArrowOperation.id, {
21779
+ return commandService.executeCommand(SetCellEditVisibleArrowOperation.id, {
21645
21780
  keycode,
21646
21781
  visible: false,
21647
21782
  eventType: _univerjs_engine_render.DeviceInputEventType.Keyboard,
@@ -21661,41 +21796,51 @@ function EditorContainer({ hidden = false }) {
21661
21796
  height: state.height,
21662
21797
  opacity: hidden ? 0 : void 0,
21663
21798
  pointerEvents: hidden ? "none" : void 0,
21664
- backgroundColor: getCellEditorHostBackgroundColor(editState, {
21665
- darkMode,
21666
- getColorFromTheme: themeService.getColorFromTheme.bind(themeService)
21667
- })
21799
+ backgroundColor: editorBackgroundColor
21668
21800
  },
21669
- children: [(visible === null || visible === void 0 ? void 0 : visible.visible) && showEditCellAddress && editCellAddress && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21670
- "data-u-comp": "sheet-cell-editor-address",
21671
- className: "univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-whitespace-nowrap univer-rounded-t univer-px-1.5 univer-text-xs univer-leading-5",
21672
- style: {
21673
- backgroundColor: editorBorderColor,
21674
- color: themeService.getColorFromTheme("gray.0"),
21675
- transform: "translateY(-100%)"
21676
- },
21677
- children: editCellAddress
21678
- }), FormulaEditor && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormulaEditor, {
21679
- editorId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
21680
- className: "univer-relative univer-flex univer-size-full [&_canvas]:univer-absolute",
21681
- initValue: "",
21682
- onChange: () => {},
21683
- isFocus: !hidden && (visible === null || visible === void 0 ? void 0 : visible.visible),
21684
- unitId: editState === null || editState === void 0 ? void 0 : editState.unitId,
21685
- subUnitId: editState === null || editState === void 0 ? void 0 : editState.sheetId,
21686
- keyboardEventConfig: keyCodeConfig,
21687
- onMoveInEditor,
21688
- isSupportAcrossSheet: true,
21689
- resetSelectionOnBlur: false,
21690
- isSingle: false,
21691
- autoScrollbar: false,
21692
- onFormulaSelectingChange: (isSelecting) => {
21693
- if (isSelecting) editorBridgeService.enableForceKeepVisible();
21694
- else editorBridgeService.disableForceKeepVisible();
21695
- },
21696
- disableContextMenu: false,
21697
- canvasStyle: { backgroundColor: "transparent" }
21698
- })]
21801
+ children: [
21802
+ (visible === null || visible === void 0 ? void 0 : visible.visible) && showEditCellAddress && editCellAddress && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21803
+ "data-u-comp": "sheet-cell-editor-address",
21804
+ className: "univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-whitespace-nowrap univer-rounded-t univer-px-1.5 univer-text-xs univer-leading-5",
21805
+ style: {
21806
+ backgroundColor: editorBorderColor,
21807
+ color: themeService.getColorFromTheme("gray.0"),
21808
+ transform: "translateY(-100%)"
21809
+ },
21810
+ children: editCellAddress
21811
+ }),
21812
+ FormulaEditor && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormulaEditor, {
21813
+ editorId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
21814
+ className: "univer-relative univer-flex univer-size-full [&_canvas]:univer-absolute",
21815
+ initValue: "",
21816
+ onChange: () => {},
21817
+ isFocus: !hidden && (visible === null || visible === void 0 ? void 0 : visible.visible),
21818
+ unitId: editState === null || editState === void 0 ? void 0 : editState.unitId,
21819
+ subUnitId: editState === null || editState === void 0 ? void 0 : editState.sheetId,
21820
+ keyboardEventConfig: keyCodeConfig,
21821
+ onMoveInEditor,
21822
+ isSupportAcrossSheet: true,
21823
+ resetSelectionOnBlur: false,
21824
+ isSingle: false,
21825
+ autoScrollbar: false,
21826
+ borderless: true,
21827
+ onFormulaSelectingChange: (isSelecting) => {
21828
+ if (isSelecting) editorBridgeService.enableForceKeepVisible();
21829
+ else editorBridgeService.disableForceKeepVisible();
21830
+ },
21831
+ disableContextMenu: false,
21832
+ canvasStyle: { backgroundColor: "transparent" }
21833
+ }),
21834
+ (visible === null || visible === void 0 ? void 0 : visible.visible) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21835
+ "aria-hidden": true,
21836
+ className: "univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-box-border",
21837
+ style: {
21838
+ width: state.width + editorBorderWidth,
21839
+ height: state.height + editorBorderWidth,
21840
+ border: `${editorBorderWidth}px solid ${editorBorderColor}`
21841
+ }
21842
+ })
21843
+ ]
21699
21844
  });
21700
21845
  }
21701
21846
 
@@ -21740,7 +21885,7 @@ function getAbsoluteRefStringFromSelection(workbook, selections, lexerTreeBuilde
21740
21885
 
21741
21886
  //#endregion
21742
21887
  //#region src/views/defined-name/DefinedNameOverlay.tsx
21743
- function DefinedNameOverlay({ search, isInputEvent }) {
21888
+ function DefinedNameOverlay({ search, isInputEvent, onClose }) {
21744
21889
  const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
21745
21890
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
21746
21891
  const definedNamesService = (0, _univerjs_ui.useDependency)(_univerjs_engine_formula.IDefinedNamesService);
@@ -21784,8 +21929,9 @@ function DefinedNameOverlay({ search, isInputEvent }) {
21784
21929
  itemHeight: 30,
21785
21930
  overscan: 6
21786
21931
  });
21787
- const openSlider = () => {
21788
- commandService.executeCommand(SidebarDefinedNameOperation.id, { value: "open" });
21932
+ const openSlider = async () => {
21933
+ onClose();
21934
+ await commandService.executeCommand(SidebarDefinedNameOperation.id, { value: "open" });
21789
21935
  };
21790
21936
  const focusDefinedName = async (definedName) => {
21791
21937
  const { formulaOrRefString, id } = definedName;
@@ -21810,8 +21956,9 @@ function DefinedNameOverlay({ search, isInputEvent }) {
21810
21956
  children: virtualDefinedNames.map(({ data: definedName, index }) => {
21811
21957
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
21812
21958
  className: "univer-cursor-pointer univer-px-2 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600",
21813
- onClick: () => {
21814
- focusDefinedName(definedName);
21959
+ onClick: async () => {
21960
+ onClose();
21961
+ await focusDefinedName(definedName);
21815
21962
  },
21816
21963
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
21817
21964
  "data-u-comp": "defined-name-overlay-row",
@@ -21865,6 +22012,7 @@ function DefinedName({ disable }) {
21865
22012
  const themeService = (0, _univerjs_ui.useDependency)(_univerjs_core.ThemeService);
21866
22013
  const [open, setOpen] = (0, react.useState)(false);
21867
22014
  const [isInputEvent, setIsInputEvent] = (0, react.useState)(false);
22015
+ const nameBoxRef = (0, react.useRef)(null);
21868
22016
  const inputRef = (0, react.useRef)(null);
21869
22017
  const getDefinedNameMap = () => {
21870
22018
  const definedNameMap = definedNamesService.getDefinedNameMap(unitId);
@@ -22017,26 +22165,34 @@ function DefinedName({ disable }) {
22017
22165
  return selections;
22018
22166
  }
22019
22167
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
22168
+ ref: nameBoxRef,
22020
22169
  "data-u-comp": "defined-name",
22170
+ onMouseDown: (e) => {
22171
+ if (disable) e.preventDefault();
22172
+ },
22021
22173
  className: "univer-relative univer-box-border univer-flex univer-h-full univer-w-24 univer-border-r-gray-200 univer-py-1.5 univer-transition-all",
22022
22174
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
22023
22175
  ref: inputRef,
22024
22176
  className: (0, _univerjs_design.clsx)("univer-box-border univer-size-full univer-appearance-none univer-bg-transparent univer-pl-1.5 univer-pr-5 univer-text-gray-900 focus:univer-outline-none dark:!univer-border-r-gray-700 dark:!univer-text-gray-0", _univerjs_design.borderRightClassName, { "univer-cursor-not-allowed": disable }),
22025
22177
  type: "text",
22178
+ disabled: disable,
22026
22179
  value: inputValue,
22027
22180
  onChange: handleChangeSelection,
22028
22181
  onKeyDown: handleKeyDown,
22029
22182
  onBlur: () => setIsInputEvent(false)
22030
22183
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Dropdown, {
22184
+ align: "start",
22185
+ anchorRef: nameBoxRef,
22031
22186
  overlay: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
22032
22187
  className: "univer-z-[1001]",
22033
22188
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefinedNameOverlay, {
22034
22189
  search: inputValue,
22035
- isInputEvent
22190
+ isInputEvent,
22191
+ onClose: () => setOpen(false)
22036
22192
  })
22037
22193
  }),
22038
22194
  disabled: disable,
22039
- open,
22195
+ open: !disable && open,
22040
22196
  onOpenChange: setOpen,
22041
22197
  onOpenAutoFocus: (e) => e.preventDefault(),
22042
22198
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
@@ -22217,7 +22373,7 @@ function FormulaBar(props) {
22217
22373
  children: [
22218
22374
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
22219
22375
  className: "univer-relative univer-box-border univer-h-full univer-w-[100px]",
22220
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefinedName, { disable: disableDefinedName ?? editDisable })
22376
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefinedName, { disable: iconActivated || (disableDefinedName ?? editDisable) })
22221
22377
  }),
22222
22378
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
22223
22379
  className: "univer-flex univer-size-full",
@@ -23408,6 +23564,7 @@ function SheetBarTabs() {
23408
23564
  const slideTabBarContainerRef = (0, react.useRef)(null);
23409
23565
  const activeSheetIdRef = (0, react.useRef)(activeSheetId);
23410
23566
  const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
23567
+ const layoutService = (0, _univerjs_ui.useDependency)(_univerjs_ui.ILayoutService);
23411
23568
  const renderManagerService = (0, _univerjs_ui.useDependency)(_univerjs_engine_render.IRenderManagerService);
23412
23569
  const sheetBarService = (0, _univerjs_ui.useDependency)(ISheetBarService);
23413
23570
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
@@ -23593,6 +23750,7 @@ function SheetBarTabs() {
23593
23750
  subUnitId,
23594
23751
  unitId: workbookRef.current.getUnitId()
23595
23752
  }).then((result) => {
23753
+ requestAnimationFrame(() => layoutService.focus(workbookRef.current.getUnitId()));
23596
23754
  if (result !== false) return;
23597
23755
  const worksheet = workbookRef.current.getSheetBySheetId(subUnitId);
23598
23756
  if (worksheet) {
@@ -23600,7 +23758,11 @@ function SheetBarTabs() {
23600
23758
  syncActiveSheetRender(subUnitId);
23601
23759
  }
23602
23760
  });
23603
- }, [commandService, syncActiveSheetRender]);
23761
+ }, [
23762
+ commandService,
23763
+ layoutService,
23764
+ syncActiveSheetRender
23765
+ ]);
23604
23766
  const observeResize = (0, react.useCallback)((slideTabBar) => {
23605
23767
  var _slideTabBarContainer;
23606
23768
  const slideTabBarContainer = (_slideTabBarContainer = slideTabBarContainerRef.current) === null || _slideTabBarContainer === void 0 ? void 0 : _slideTabBarContainer.querySelector("[data-u-comp=slide-tab-bar]");
@@ -24910,7 +25072,7 @@ const useHighlightRange = (ranges = []) => {
24910
25072
  //#endregion
24911
25073
  //#region package.json
24912
25074
  var name = "@univerjs/sheets-ui";
24913
- var version = "1.0.3";
25075
+ var version = "1.1.0";
24914
25076
 
24915
25077
  //#endregion
24916
25078
  //#region src/views/cell-popup/config.ts
@@ -25243,7 +25405,7 @@ function CellAlert({ popup, DropdownMenuComponent = _univerjs_design.DropdownMen
25243
25405
  const [isHovered, setIsHovered] = (0, react.useState)(false);
25244
25406
  const alert = (_popup$extraProps = popup.extraProps) === null || _popup$extraProps === void 0 ? void 0 : _popup$extraProps.alert;
25245
25407
  if (!alert) return null;
25246
- const { type, title, message, menu } = alert;
25408
+ const { type, title, message, menu, action, width } = alert;
25247
25409
  if (menu === null || menu === void 0 ? void 0 : menu.length) {
25248
25410
  const accessibleLabel = [title, message].filter((value) => typeof value === "string").join(": ");
25249
25411
  const showMore = visible || isHovered;
@@ -25283,14 +25445,24 @@ function CellAlert({ popup, DropdownMenuComponent = _univerjs_design.DropdownMen
25283
25445
  [1]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.WarningIcon, { className: "univer-text-yellow-500" })
25284
25446
  };
25285
25447
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
25286
- className: "univer-z-[100] univer-box-border univer-w-[156px] univer-rounded-lg univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0",
25287
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
25288
- className: "univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-gap-x-1.5 univer-text-sm univer-font-medium",
25289
- children: [type ? iconMap[type] : null, title]
25290
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
25291
- className: "univer-text-sm",
25292
- children: message
25293
- })]
25448
+ style: { width },
25449
+ className: "univer-z-[100] univer-box-border univer-rounded-lg univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0",
25450
+ children: [
25451
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
25452
+ className: "univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-gap-x-1.5 univer-text-sm univer-font-medium",
25453
+ children: [type ? iconMap[type] : null, title]
25454
+ }),
25455
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
25456
+ className: "univer-text-sm",
25457
+ children: message
25458
+ }),
25459
+ action && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
25460
+ className: "univer-mt-2",
25461
+ disabled: action.disabled,
25462
+ onClick: action.onSelect,
25463
+ children: action.label
25464
+ })
25465
+ ]
25294
25466
  });
25295
25467
  }
25296
25468
 
@@ -25318,15 +25490,17 @@ let CellAlertManagerService = class CellAlertManagerService extends _univerjs_co
25318
25490
  _defineProperty(this, "_currentAlert", /* @__PURE__ */ new Map());
25319
25491
  _defineProperty(this, "currentAlert$", this._currentAlert$.asObservable());
25320
25492
  this.disposeWithMe(() => {
25493
+ this.clearAlert();
25321
25494
  this._currentAlert$.complete();
25322
25495
  });
25323
25496
  }
25324
25497
  showAlert(alert) {
25325
25498
  var _alert$menu, _alert$menu2, _alert$menu3;
25326
25499
  let lastPopup = this._currentAlert.get(alert.key);
25327
- if (lastPopup) lastPopup.dispose.dispose();
25328
- if (lastPopup) lastPopup.dispose.dispose();
25329
- else {
25500
+ if (lastPopup) {
25501
+ lastPopup.dispose.dispose();
25502
+ lastPopup.alert = alert;
25503
+ } else {
25330
25504
  lastPopup = {
25331
25505
  alert,
25332
25506
  dispose: { dispose() {} }
@@ -25349,13 +25523,7 @@ let CellAlertManagerService = class CellAlertManagerService extends _univerjs_co
25349
25523
  extraProps: { alert },
25350
25524
  priority: 1
25351
25525
  });
25352
- if (disposable) {
25353
- if (lastPopup) {
25354
- var _lastPopup$dispose;
25355
- (_lastPopup$dispose = lastPopup.dispose) === null || _lastPopup$dispose === void 0 || _lastPopup$dispose.dispose();
25356
- }
25357
- lastPopup.dispose = disposable;
25358
- }
25526
+ if (disposable) lastPopup.dispose = disposable;
25359
25527
  this._currentAlert$.next(Array.from(this._currentAlert.entries()));
25360
25528
  }
25361
25529
  removeAlert(key) {
@@ -26207,8 +26375,8 @@ function SelectList(props) {
26207
26375
  const filteredOptions = (0, react.useMemo)(() => {
26208
26376
  return options.filter((item) => lowerFilter ? item.label.toLowerCase().includes(lowerFilter) : true);
26209
26377
  }, [options, lowerFilter]);
26210
- const handleSearchChange = (e) => {
26211
- setLowerFilter(e.target.value.toLowerCase());
26378
+ const handleSearchChange = (value) => {
26379
+ setLowerFilter(value.toLowerCase());
26212
26380
  };
26213
26381
  const sheetPermissionCheckController = (0, _univerjs_ui.useDependency)(_univerjs_sheets.SheetPermissionCheckController);
26214
26382
  const hasPermission = (0, react.useMemo)(() => sheetPermissionCheckController.permissionCheckWithRanges({
@@ -26234,9 +26402,8 @@ function SelectList(props) {
26234
26402
  children: [
26235
26403
  showSearchOnDropdown && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26236
26404
  className: "univer-box-border univer-flex univer-w-full univer-px-2",
26237
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
26405
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Input, {
26238
26406
  ref: searchRef,
26239
- className: (0, _univerjs_design.clsx)("univer-w-full univer-rounded-md univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-sm univer-text-gray-900 focus:univer-border-primary-500 focus:univer-outline-none dark:!univer-bg-gray-1000 dark:!univer-text-gray-0", _univerjs_design.borderClassName),
26240
26407
  type: "text",
26241
26408
  value: lowerFilter,
26242
26409
  autoFocus: true,
@@ -26265,14 +26432,16 @@ function SelectList(props) {
26265
26432
  const index = item.label.toLocaleLowerCase().indexOf(lowerFilter);
26266
26433
  const isThemeColor = Boolean(((_item$color = item.color) === null || _item$color === void 0 ? void 0 : _item$color.includes(".")) && themeService.isValidThemeColor(item.color));
26267
26434
  const backgroundColor = isThemeColor ? themeService.getColorFromTheme(item.color) : item.color;
26268
- const isDark = new _univerjs_core.ColorKit(backgroundColor).isDark();
26435
+ const color = new _univerjs_core.ColorKit(backgroundColor);
26436
+ const hasBackground = Boolean(backgroundColor) && backgroundColor !== "transparent" && color.getAlpha() > 0;
26437
+ const isDark = color.isDark();
26269
26438
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
26270
26439
  className: "univer-flex univer-cursor-pointer univer-flex-row univer-items-center univer-justify-between univer-rounded-md univer-px-1.5 univer-py-1 hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-700",
26271
26440
  onClick: handleClick,
26272
26441
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26273
26442
  className: (0, _univerjs_design.clsx)("univer-inline-flex univer-h-4 univer-w-fit univer-items-center univer-truncate univer-rounded-full univer-px-1.5 univer-text-xs", {
26274
- "univer-text-gray-900": isThemeColor || !isDark,
26275
- "univer-text-gray-0": !isThemeColor && isDark
26443
+ "univer-text-gray-900": hasBackground && (isThemeColor || !isDark),
26444
+ "univer-text-gray-0": hasBackground && !isThemeColor && isDark
26276
26445
  }),
26277
26446
  style: { background: backgroundColor },
26278
26447
  children: lowerFilter && item.label.toLowerCase().includes(lowerFilter) ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
@@ -26488,6 +26657,66 @@ const BorderDashed = ({ className }) => /* @__PURE__ */ (0, react_jsx_runtime.js
26488
26657
  ]
26489
26658
  });
26490
26659
 
26660
+ //#endregion
26661
+ //#region src/views/border-panel/border-line/icons/BorderDotted.tsx
26662
+ /**
26663
+ * Copyright 2023-present DreamNum Co., Ltd.
26664
+ *
26665
+ * Licensed under the Apache License, Version 2.0 (the "License");
26666
+ * you may not use this file except in compliance with the License.
26667
+ * You may obtain a copy of the License at
26668
+ *
26669
+ * http://www.apache.org/licenses/LICENSE-2.0
26670
+ *
26671
+ * Unless required by applicable law or agreed to in writing, software
26672
+ * distributed under the License is distributed on an "AS IS" BASIS,
26673
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26674
+ * See the License for the specific language governing permissions and
26675
+ * limitations under the License.
26676
+ */
26677
+ const BorderDotted = ({ className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
26678
+ className,
26679
+ width: "120",
26680
+ height: "2",
26681
+ viewBox: "0 0 120 2",
26682
+ fill: "none",
26683
+ xmlns: "http://www.w3.org/2000/svg",
26684
+ children: [
26685
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M0.491699 1.69537H1.4917V0.695374H0.491699V1.69537Z" }),
26686
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4.2981 1.69537H5.2981V0.695374H4.2981V1.69537Z" }),
26687
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M9.10449 1.69537H8.10449V0.695374H9.10449V1.69537Z" }),
26688
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M11.9109 1.69537H12.9109V0.695374H11.9109V1.69537Z" }),
26689
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M16.7173 1.69537H15.7173V0.695374H16.7173V1.69537Z" }),
26690
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M19.5237 1.69537H20.5237V0.695374H19.5237V1.69537Z" }),
26691
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M24.3301 1.69537H23.3301V0.695374H24.3301V1.69537Z" }),
26692
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M27.1365 1.69537H28.1365V0.695374H27.1365V1.69537Z" }),
26693
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M31.9429 1.69537H30.9429V0.695374H31.9429V1.69537Z" }),
26694
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M34.7493 1.69537H35.7493V0.695374H34.7493V1.69537Z" }),
26695
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M39.5557 1.69537H38.5557V0.695374H39.5557V1.69537Z" }),
26696
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M42.3621 1.69537H43.3621V0.695374H42.3621V1.69537Z" }),
26697
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M47.1685 1.69537H46.1685V0.695374H47.1685V1.69537Z" }),
26698
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M49.9749 1.69537H50.9749V0.695374H49.9749V1.69537Z" }),
26699
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M54.7812 1.69537H53.7812V0.695374H54.7812V1.69537Z" }),
26700
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M57.5876 1.69537H58.5876V0.695374H57.5876V1.69537Z" }),
26701
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M62.394 1.69537H61.394V0.695374H62.394V1.69537Z" }),
26702
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M65.2004 1.69537H66.2004V0.695374H65.2004V1.69537Z" }),
26703
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M70.0068 1.69537H69.0068V0.695374H70.0068V1.69537Z" }),
26704
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M72.8132 1.69537H73.8132V0.695374H72.8132V1.69537Z" }),
26705
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M77.6196 1.69537H76.6196V0.695374H77.6196V1.69537Z" }),
26706
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M80.426 1.69537H81.426V0.695374H80.426V1.69537Z" }),
26707
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M85.2324 1.69537H84.2324V0.695374H85.2324V1.69537Z" }),
26708
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M88.0388 1.69537H89.0388V0.695374H88.0388V1.69537Z" }),
26709
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M92.8452 1.69537H91.8452V0.695374H92.8452V1.69537Z" }),
26710
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M95.6516 1.69537H96.6516V0.695374H95.6516V1.69537Z" }),
26711
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M100.458 1.69537H99.458V0.695374H100.458V1.69537Z" }),
26712
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M103.264 1.69537H104.264V0.695374H103.264V1.69537Z" }),
26713
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M108.071 1.69537H107.071V0.695374H108.071V1.69537Z" }),
26714
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M110.877 1.69537H111.877V0.695374H110.877V1.69537Z" }),
26715
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M115.684 1.69537H114.684V0.695374H115.684V1.69537Z" }),
26716
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M118.49 1.69537H119.49V0.695374H118.49V1.69537Z" })
26717
+ ]
26718
+ });
26719
+
26491
26720
  //#endregion
26492
26721
  //#region src/views/border-panel/border-line/icons/BorderDouble.tsx
26493
26722
  /**
@@ -26861,6 +27090,7 @@ function BorderLine(props) {
26861
27090
  case _univerjs_core.BorderStyleTypes.DASH_DOT: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderDashDot, { className });
26862
27091
  case _univerjs_core.BorderStyleTypes.DASH_DOT_DOT: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderDashDotDot, { className });
26863
27092
  case _univerjs_core.BorderStyleTypes.DASHED: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderDashed, { className });
27093
+ case _univerjs_core.BorderStyleTypes.DOTTED: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderDotted, { className });
26864
27094
  case _univerjs_core.BorderStyleTypes.HAIR: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderHair, { className });
26865
27095
  case _univerjs_core.BorderStyleTypes.MEDIUM: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderMedium, { className });
26866
27096
  case _univerjs_core.BorderStyleTypes.MEDIUM_DASH_DOT: return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderMediumDashDot, { className });
@@ -26875,31 +27105,22 @@ function BorderLine(props) {
26875
27105
 
26876
27106
  //#endregion
26877
27107
  //#region src/views/border-panel/BorderPanel.tsx
26878
- function getBorderColor(borderData) {
26879
- if (!borderData) return;
26880
- for (const key in borderData) {
26881
- var _border$cl;
26882
- const border = borderData[key];
26883
- if (border === null || border === void 0 || (_border$cl = border.cl) === null || _border$cl === void 0 ? void 0 : _border$cl.rgb) return border.cl.rgb;
26884
- }
26885
- }
26886
- function getBorderStyle(borderData) {
26887
- if (!borderData) return;
26888
- for (const key in borderData) {
26889
- var _border$cl2;
26890
- const border = borderData[key];
26891
- if (border === null || border === void 0 || (_border$cl2 = border.cl) === null || _border$cl2 === void 0 ? void 0 : _border$cl2.rgb) return border.s;
26892
- }
26893
- }
26894
27108
  function BorderPanel(props) {
27109
+ const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
26895
27110
  const iconManager = (0, _univerjs_ui.useDependency)(_univerjs_ui.IconManager);
26896
- const borderStyleManagerService = (0, _univerjs_ui.useDependency)(_univerjs_sheets.BorderStyleManagerService);
26897
27111
  const selectionManagerService = (0, _univerjs_ui.useDependency)(_univerjs_sheets.SheetsSelectionsService);
26898
27112
  const { direction } = (0, react.useContext)(_univerjs_design.ConfigContext);
26899
27113
  const { isAllValuesSame, value: currentValue } = selectionManagerService.getCellStylesProperty("bd");
26900
27114
  const color = isAllValuesSame ? getBorderColor(currentValue) : void 0;
26901
- const type = isAllValuesSame ? getBorderStyle(currentValue) : void 0;
26902
27115
  const { onChange, value, ColorPickerComponent = _univerjs_design.ColorPicker, DropdownComponent = _univerjs_design.Dropdown } = props;
27116
+ function getBorderColor(borderData) {
27117
+ if (!borderData) return;
27118
+ for (const key in borderData) {
27119
+ var _border$cl;
27120
+ const border = borderData[key];
27121
+ if (border === null || border === void 0 || (_border$cl = border.cl) === null || _border$cl === void 0 ? void 0 : _border$cl.rgb) return border.cl.rgb;
27122
+ }
27123
+ }
26903
27124
  function handleClick(v, type) {
26904
27125
  onChange === null || onChange === void 0 || onChange({
26905
27126
  ...value,
@@ -26917,7 +27138,7 @@ function BorderPanel(props) {
26917
27138
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26918
27139
  className: "univer-box-border univer-grid univer-grid-cols-5 univer-gap-2 univer-text-gray-600 dark:!univer-text-gray-200",
26919
27140
  children: BORDER_LINE_CHILDREN.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
26920
- className: (0, _univerjs_design.clsx)("univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-justify-self-center univer-rounded hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-200 dark:!univer-bg-gray-600": borderStyleManagerService.getBorderInfo().type === item.value }),
27141
+ className: (0, _univerjs_design.clsx)("univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-justify-self-center univer-rounded hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-200 dark:!univer-bg-gray-600": value.type === item.value }),
26921
27142
  onClick: (e) => {
26922
27143
  e.stopPropagation();
26923
27144
  handleClick(item.value, "type");
@@ -26949,14 +27170,17 @@ function BorderPanel(props) {
26949
27170
  className: "univer-rounded-lg univer-p-1.5",
26950
27171
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
26951
27172
  className: "univer-m-0 univer-grid univer-list-none univer-gap-1 univer-p-0",
26952
- children: BORDER_SIZE_CHILDREN.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
26953
- className: "univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-px-1 univer-py-3 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
27173
+ children: BORDER_SIZE_CHILDREN.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
27174
+ type: "button",
27175
+ "aria-label": localeService.t(item.label),
27176
+ "aria-pressed": item.value === value.style,
27177
+ className: (0, _univerjs_design.clsx)("univer-flex univer-w-full univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-border-none univer-bg-transparent univer-px-1 univer-py-3 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-200 dark:!univer-bg-gray-600": item.value === value.style }),
26954
27178
  onClick: () => handleClick(item.value, "style"),
26955
- children: [item.value === type && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CheckMarkIcon, { className: "univer-absolute univer-left-3 univer-text-primary-600" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderLine, {
26956
- className: "univer-ml-6 univer-fill-gray-900 dark:!univer-fill-gray-0",
27179
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderLine, {
27180
+ className: "univer-fill-gray-900 dark:!univer-fill-gray-0",
26957
27181
  type: item.value
26958
- })]
26959
- }, item.value))
27182
+ })
27183
+ }) }, item.value))
26960
27184
  })
26961
27185
  }),
26962
27186
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
@@ -26964,7 +27188,7 @@ function BorderPanel(props) {
26964
27188
  type: "button",
26965
27189
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BorderLine, {
26966
27190
  className: "univer-fill-gray-900 dark:!univer-fill-gray-0",
26967
- type: type ?? _univerjs_core.BorderStyleTypes.THIN
27191
+ type: value.style
26968
27192
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.MoreDownIcon, { className: "dark:!univer-text-gray-0" })]
26969
27193
  })
26970
27194
  }) })]
@@ -27496,16 +27720,35 @@ function MobileMenuItemInput(props) {
27496
27720
  const { prefix, suffix, value, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, disabled$, onChange } = props;
27497
27721
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
27498
27722
  const disabled = (0, _univerjs_ui.useObservable)(disabled$ ?? null, false);
27499
- const inputValue = Math.min(max, Math.max(min, Number(value)));
27723
+ const [draft, setDraft] = (0, react.useState)(null);
27724
+ const inputValue = draft !== null && draft.source === value ? draft.value : Math.min(max, Math.max(min, Number(value)));
27725
+ if (draft !== null && draft.source !== value) setDraft(null);
27500
27726
  function handleChange(nextValue) {
27501
- if (nextValue == null) return;
27727
+ setDraft({
27728
+ source: value,
27729
+ value: nextValue
27730
+ });
27731
+ }
27732
+ function handleConfirm() {
27733
+ if (disabled || inputValue == null || !Number.isFinite(inputValue)) return;
27734
+ const nextValue = Math.min(max, Math.max(min, inputValue));
27735
+ setDraft({
27736
+ source: value,
27737
+ value: nextValue
27738
+ });
27502
27739
  onChange(nextValue.toString());
27503
27740
  }
27504
27741
  function handleKeyDown(event) {
27742
+ if (event.key === "Escape" && !event.nativeEvent.isComposing) return;
27505
27743
  event.stopPropagation();
27744
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) {
27745
+ event.preventDefault();
27746
+ handleConfirm();
27747
+ }
27506
27748
  }
27507
27749
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
27508
- className: "univer-flex univer-min-w-0 univer-flex-1 univer-items-center univer-gap-2",
27750
+ className: "univer-flex univer-min-w-0 univer-flex-1 univer-flex-wrap univer-items-center univer-gap-2",
27751
+ onClick: (event) => event.stopPropagation(),
27509
27752
  children: [
27510
27753
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
27511
27754
  className: "univer-shrink-0 univer-text-base univer-font-medium",
@@ -27513,13 +27756,11 @@ function MobileMenuItemInput(props) {
27513
27756
  }),
27514
27757
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
27515
27758
  className: "univer-w-20 univer-shrink-0",
27516
- onClick: (event) => event.stopPropagation(),
27517
27759
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.InputNumber, {
27518
27760
  value: inputValue,
27519
27761
  size: "small",
27520
27762
  precision: 0,
27521
- min,
27522
- max,
27763
+ allowEmpty: true,
27523
27764
  disabled,
27524
27765
  onKeyDown: handleKeyDown,
27525
27766
  onChange: handleChange
@@ -27528,6 +27769,15 @@ function MobileMenuItemInput(props) {
27528
27769
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
27529
27770
  className: "univer-min-w-0 univer-truncate univer-text-base univer-font-medium",
27530
27771
  children: localeService.t(suffix)
27772
+ }),
27773
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
27774
+ type: "button",
27775
+ variant: "primary",
27776
+ size: "large",
27777
+ className: "univer-shrink-0",
27778
+ disabled: disabled || inputValue == null || !Number.isFinite(inputValue),
27779
+ onClick: handleConfirm,
27780
+ children: localeService.t("sheets-ui.button.confirm")
27531
27781
  })
27532
27782
  ]
27533
27783
  });
@@ -28822,6 +29072,7 @@ const sheetsUIIcons = {
28822
29072
  DeleteColumnDoubleIcon: _univerjs_icons.DeleteColumnDoubleIcon,
28823
29073
  DeleteIcon: _univerjs_icons.DeleteIcon,
28824
29074
  DeleteRowDoubleIcon: _univerjs_icons.DeleteRowDoubleIcon,
29075
+ DocPasteOptionsIcon: _univerjs_icons.DocPasteOptionsIcon,
28825
29076
  DownBorderDoubleIcon: _univerjs_icons.DownBorderDoubleIcon,
28826
29077
  DownloadImageIcon: _univerjs_icons.DownloadImageIcon,
28827
29078
  EyeIcon: _univerjs_icons.EyeIcon,
@@ -28879,7 +29130,8 @@ const sheetsUIIcons = {
28879
29130
  VerticalCenterIcon: _univerjs_icons.VerticalCenterIcon,
28880
29131
  VerticalIntegrationIcon: _univerjs_icons.VerticalIntegrationIcon,
28881
29132
  VerticalTextIcon: _univerjs_icons.VerticalTextIcon,
28882
- WriteIcon: _univerjs_icons.WriteIcon
29133
+ WriteIcon: _univerjs_icons.WriteIcon,
29134
+ ZoomInIcon: _univerjs_icons.ZoomInIcon
28883
29135
  };
28884
29136
 
28885
29137
  //#endregion
@@ -28895,7 +29147,6 @@ let MobileComponentsController = class MobileComponentsController extends _unive
28895
29147
  this.disposeWithMe(componentManager.register(CascaderDropdown.componentKey, CascaderDropdown));
28896
29148
  this.disposeWithMe(componentManager.register(MENU_ITEM_INPUT_COMPONENT, MobileMenuItemInput));
28897
29149
  this.disposeWithMe(componentManager.register(MENU_ITEM_FROZEN_COMPONENT, MenuItemFrozen));
28898
- this.disposeWithMe(componentManager.register(SHEET_ZOOM_INPUT_COMPONENT, SheetZoomInput));
28899
29150
  this.disposeWithMe(componentManager.register(BORDER_PANEL_COMPONENT, MobileBorderPanel));
28900
29151
  this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, MobileDefinedNameContainer));
28901
29152
  this.disposeWithMe(componentManager.register(CELL_POPUP_COMPONENT_KEY, CellPopup));
@@ -28975,7 +29226,8 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
28975
29226
  let body = _univerjs_core.Tools.deepClone((_param$documentLayout = param.documentLayoutObject.documentModel) === null || _param$documentLayout === void 0 ? void 0 : _param$documentLayout.getBody());
28976
29227
  const drawings = _univerjs_core.Tools.deepClone((_param$documentLayout2 = param.documentLayoutObject.documentModel) === null || _param$documentLayout2 === void 0 ? void 0 : _param$documentLayout2.drawings);
28977
29228
  const drawingsOrder = _univerjs_core.Tools.deepClone((_param$documentLayout3 = param.documentLayoutObject.documentModel) === null || _param$documentLayout3 === void 0 ? void 0 : _param$documentLayout3.getDrawingsOrder());
28978
- if (!body || param.isInArrayFormulaRange === true && this._editorBridgeService.isVisible().eventType === _univerjs_engine_render.DeviceInputEventType.Dblclick) body = {
29229
+ const { visible } = this._editorBridgeService.isVisible();
29230
+ if (!body || param.isInArrayFormulaRange === true && visible) body = {
28979
29231
  dataStream: "\r\n",
28980
29232
  paragraphs: [{
28981
29233
  startIndex: 0,
@@ -29113,7 +29365,7 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
29113
29365
  ...formulaEditorStyle,
29114
29366
  pageSize: { ...formulaEditorStyle.pageSize },
29115
29367
  renderConfig: { ...formulaEditorStyle.renderConfig },
29116
- textStyle: { cl: { rgb: this._themeService.getColorFromTheme("gray.900") } }
29368
+ textStyle: { cl: { rgb: this._getFormulaBarTextColor() } }
29117
29369
  };
29118
29370
  else snapshot.documentStyle ??= {};
29119
29371
  let renderConfig = snapshot.documentStyle.renderConfig;
@@ -29136,6 +29388,11 @@ let EditorDataSyncController = class EditorDataSyncController extends _univerjs_
29136
29388
  const isFocusFxBar = this._contextService.getContextValue(_univerjs_core.FOCUSING_FX_BAR_EDITOR);
29137
29389
  renderConfig.isRenderStyle = isFormulaBar === isFocusFxBar ? _univerjs_core.BooleanNumber.TRUE : _univerjs_core.BooleanNumber.FALSE;
29138
29390
  }
29391
+ _getFormulaBarTextColor() {
29392
+ var _this$_editorBridgeSe;
29393
+ const isInheritedFormula = ((_this$_editorBridgeSe = this._editorBridgeService.getEditLocation()) === null || _this$_editorBridgeSe === void 0 ? void 0 : _this$_editorBridgeSe.isInArrayFormulaRange) === true && !this._editorBridgeService.isVisible().visible;
29394
+ return this._themeService.getColorFromTheme(isInheritedFormula ? "gray.300" : "gray.900");
29395
+ }
29139
29396
  _getSourceStyleRenderValue(isFormulaBar) {
29140
29397
  return isFormulaBar ? _univerjs_core.BooleanNumber.FALSE : _univerjs_core.BooleanNumber.TRUE;
29141
29398
  }
@@ -30553,6 +30810,7 @@ function MobileBorderColorView(props) {
30553
30810
  }
30554
30811
  function MobileBorderStyleView(props) {
30555
30812
  const { value, onExecute } = props;
30813
+ const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
30556
30814
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
30557
30815
  className: "univer-overflow-hidden univer-rounded-xl univer-bg-gray-0 dark:!univer-bg-gray-800",
30558
30816
  children: BORDER_SIZE_CHILDREN.map((option, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
@@ -30572,7 +30830,7 @@ function MobileBorderStyleView(props) {
30572
30830
  }),
30573
30831
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
30574
30832
  className: "univer-flex-1 univer-text-left univer-text-sm",
30575
- children: option.value
30833
+ children: localeService.t(option.label)
30576
30834
  }),
30577
30835
  value.style === option.value && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CheckMarkIcon, { className: "univer-text-primary-600 dark:!univer-text-primary-400" })
30578
30836
  ]
@@ -31117,7 +31375,11 @@ function MobileFormulaBar() {
31117
31375
  let cursorFrame;
31118
31376
  const contentFrame = requestAnimationFrame(() => {
31119
31377
  editorBridgeService.refreshEditCellState();
31120
- editorService.focus(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31378
+ if (editorService.getFocusId() !== _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) editorService.focus(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31379
+ else {
31380
+ var _editorService$getEdi;
31381
+ (_editorService$getEdi = editorService.getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)) === null || _editorService$getEdi === void 0 || _editorService$getEdi.focus();
31382
+ }
31121
31383
  cursorFrame = requestAnimationFrame(() => {
31122
31384
  var _editor$getDocumentDa;
31123
31385
  const editor = editorService.getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
@@ -31679,7 +31941,7 @@ const MobileFormulaBarSubmitCommand = {
31679
31941
  id: MOBILE_FORMULA_BAR_SUBMIT_COMMAND_ID,
31680
31942
  type: _univerjs_core.CommandType.COMMAND,
31681
31943
  async handler(accessor) {
31682
- var _accessor$get$getCurr, _workbook$getActiveSh, _formulaModel$getBody, _accessor$get$getEdit;
31944
+ var _accessor$get$getCurr, _workbook$getActiveSh, _formulaModel$getBody;
31683
31945
  const instanceService = accessor.get(_univerjs_core.IUniverInstanceService);
31684
31946
  const workbook = instanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
31685
31947
  const formulaModel = instanceService.getUnit(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, _univerjs_core.UniverInstanceType.UNIVER_DOC);
@@ -31711,8 +31973,12 @@ const MobileFormulaBarSubmitCommand = {
31711
31973
  });
31712
31974
  editorBridgeService.refreshEditCellState();
31713
31975
  editorBridgeService.changeEditorDirty(false);
31976
+ const editorService = accessor.get(_univerjs_docs_ui.IEditorService);
31977
+ const formulaEditor = editorService.getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31978
+ if (editorService.getFocusId() !== _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) editorService.focus(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31979
+ else formulaEditor === null || formulaEditor === void 0 || formulaEditor.focus();
31714
31980
  const endOffset = Math.max(0, (((_formulaModel$getBody = formulaModel.getBody()) === null || _formulaModel$getBody === void 0 ? void 0 : _formulaModel$getBody.dataStream.length) ?? 2) - 2);
31715
- (_accessor$get$getEdit = accessor.get(_univerjs_docs_ui.IEditorService).getEditor(_univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)) === null || _accessor$get$getEdit === void 0 || _accessor$get$getEdit.setSelectionRanges([{
31981
+ formulaEditor === null || formulaEditor === void 0 || formulaEditor.setSelectionRanges([{
31716
31982
  startOffset: endOffset,
31717
31983
  endOffset
31718
31984
  }], false);
@@ -31795,6 +32061,7 @@ let SheetUIMobileController = class SheetUIMobileController extends _univerjs_co
31795
32061
  ScrollToRangeOperation,
31796
32062
  _univerjs_sheets.SetUnderlineCommand,
31797
32063
  SetZoomRatioCommand,
32064
+ SetZoomRatioFromToolbarCommand,
31798
32065
  SetZoomRatioOperation,
31799
32066
  ShowMenuListCommand,
31800
32067
  InsertRangeMoveDownConfirmCommand,
@@ -32802,7 +33069,7 @@ let MobileCellEditRenderController = class MobileCellEditRenderController extend
32802
33069
  if (cell.location.unitId !== this._context.unitId) return;
32803
33070
  const snapshot = (_this$_editorBridgeSe = this._editorBridgeService.getEditCellState()) === null || _this$_editorBridgeSe === void 0 || (_this$_editorBridgeSe = _this$_editorBridgeSe.documentLayoutObject.documentModel) === null || _this$_editorBridgeSe === void 0 ? void 0 : _this$_editorBridgeSe.getSnapshot();
32804
33071
  if ((0, _univerjs_sheets.isCellImage)(snapshot)) return;
32805
- this._commandService.executeCommand(SetCellEditVisibleOperation.id, {
33072
+ this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
32806
33073
  visible: true,
32807
33074
  eventType: _univerjs_engine_render.DeviceInputEventType.Dblclick,
32808
33075
  unitId: this._context.unitId
@@ -33238,7 +33505,7 @@ let MobileHoverRenderController = class MobileHoverRenderController extends _uni
33238
33505
  return;
33239
33506
  }
33240
33507
  this._resetCompletedTap();
33241
- this._hoverManagerService.triggerDbClick(unitId, event.offsetX, event.offsetY);
33508
+ this._hoverManagerService.triggerDbClick(unitId, event);
33242
33509
  },
33243
33510
  priority: -1
33244
33511
  }));
@@ -33314,7 +33581,7 @@ let MobileHoverRenderController = class MobileHoverRenderController extends _uni
33314
33581
  this._suppressEngineDoubleClick = false;
33315
33582
  this._suppressEngineDoubleClickTimer = null;
33316
33583
  });
33317
- this._hoverManagerService.triggerDbClick(unitId, event.offsetX, event.offsetY);
33584
+ this._hoverManagerService.triggerDbClick(unitId, event);
33318
33585
  return;
33319
33586
  }
33320
33587
  this._resetCompletedTap();
@@ -35296,7 +35563,6 @@ let ComponentsController = class ComponentsController extends _univerjs_core.Dis
35296
35563
  const componentManager = this._componentManager;
35297
35564
  this.disposeWithMe(componentManager.register(MENU_ITEM_INPUT_COMPONENT, MenuItemInput));
35298
35565
  this.disposeWithMe(componentManager.register(MENU_ITEM_FROZEN_COMPONENT, MenuItemFrozen));
35299
- this.disposeWithMe(componentManager.register(SHEET_ZOOM_INPUT_COMPONENT, SheetZoomInput));
35300
35566
  this.disposeWithMe(componentManager.register(BORDER_PANEL_COMPONENT, BorderPanel));
35301
35567
  this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, DefinedNameContainer));
35302
35568
  this.disposeWithMe(componentManager.register(CELL_POPUP_COMPONENT_KEY, CellPopup));
@@ -35322,20 +35588,22 @@ const ISheetHostChromeOverrideService = (0, _univerjs_core.createIdentifier)("sh
35322
35588
  //#endregion
35323
35589
  //#region src/controllers/render-controllers/contextmenu.render-controller.ts
35324
35590
  let SheetContextMenuRenderController = class SheetContextMenuRenderController extends _univerjs_core.Disposable {
35325
- constructor(_context, _contextMenuService, _selectionManagerService, _selectionRenderService, _injector) {
35591
+ constructor(_context, _contextMenuService, _selectionManagerService, _selectionRenderService, _injector, _platformService, _contextService) {
35326
35592
  super();
35327
35593
  this._context = _context;
35328
35594
  this._contextMenuService = _contextMenuService;
35329
35595
  this._selectionManagerService = _selectionManagerService;
35330
35596
  this._selectionRenderService = _selectionRenderService;
35331
35597
  this._injector = _injector;
35598
+ this._platformService = _platformService;
35599
+ this._contextService = _contextService;
35332
35600
  this._init();
35333
35601
  this._initEmbedRuntimeSessionListener();
35334
35602
  }
35335
35603
  _init() {
35336
35604
  var _this$_context;
35337
35605
  const spreadsheetSubscription = ((_this$_context = this._context) === null || _this$_context === void 0 || (_this$_context = _this$_context.mainComponent) === null || _this$_context === void 0 ? void 0 : _this$_context.onPointerDown$).subscribeEvent((event) => {
35338
- if (event.button === 2) {
35606
+ if (this._isContextMenuGesture(event)) {
35339
35607
  const selections = this._selectionManagerService.getCurrentSelections();
35340
35608
  const currentSelection = selections === null || selections === void 0 ? void 0 : selections[0];
35341
35609
  if (!currentSelection) return;
@@ -35365,20 +35633,23 @@ let SheetContextMenuRenderController = class SheetContextMenuRenderController ex
35365
35633
  this.disposeWithMe(spreadsheetSubscription);
35366
35634
  const spreadsheetColumnHeader = this._context.components.get("__SpreadsheetColumnHeader__");
35367
35635
  const rowHeaderSub = this._context.components.get("__SpreadsheetRowHeader__").onPointerDown$.subscribeEvent((event) => {
35368
- if (event.button === 2) {
35636
+ if (this._isContextMenuGesture(event)) {
35369
35637
  if (this._shouldSuppressHostContextMenu()) return;
35370
35638
  this._contextMenuService.triggerContextMenu(event, _univerjs_ui.ContextMenuPosition.ROW_HEADER);
35371
35639
  }
35372
35640
  });
35373
35641
  this.disposeWithMe(rowHeaderSub);
35374
35642
  const colHeaderObserver = spreadsheetColumnHeader.onPointerDown$.subscribeEvent((event) => {
35375
- if (event.button === 2) {
35643
+ if (this._isContextMenuGesture(event)) {
35376
35644
  if (this._shouldSuppressHostContextMenu()) return;
35377
35645
  this._contextMenuService.triggerContextMenu(event, _univerjs_ui.ContextMenuPosition.COL_HEADER);
35378
35646
  }
35379
35647
  });
35380
35648
  this.disposeWithMe(colHeaderObserver);
35381
35649
  }
35650
+ _isContextMenuGesture(event) {
35651
+ return isSheetContextMenuGesture(event, this._platformService.isMac, this._contextService.getContextValue(_univerjs_sheets.REF_SELECTIONS_ENABLED));
35652
+ }
35382
35653
  _initEmbedRuntimeSessionListener() {
35383
35654
  const runtimeFocusCoordinator = this._getSheetEmbedRuntimeFocusCoordinator();
35384
35655
  if (!runtimeFocusCoordinator) return;
@@ -35401,7 +35672,9 @@ SheetContextMenuRenderController = __decorate([
35401
35672
  __decorateParam(1, _univerjs_ui.IContextMenuService),
35402
35673
  __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetsSelectionsService)),
35403
35674
  __decorateParam(3, ISheetSelectionRenderService),
35404
- __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_core.Injector))
35675
+ __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
35676
+ __decorateParam(5, _univerjs_ui.IPlatformService),
35677
+ __decorateParam(6, _univerjs_core.IContextService)
35405
35678
  ], SheetContextMenuRenderController);
35406
35679
  function shouldHideSheetHostContextMenuForEmbedSession(hostUnitId, activeScope) {
35407
35680
  return (activeScope === null || activeScope === void 0 ? void 0 : activeScope.hostUnitId) === hostUnitId && activeScope.sessionMode !== "host-passive";
@@ -35413,7 +35686,7 @@ function shouldSuppressSheetContextMenuForEmbedOverride(hostUnitId, override) {
35413
35686
  //#endregion
35414
35687
  //#region src/controllers/render-controllers/desktop-cell-edit.render-controller.ts
35415
35688
  let DesktopCellEditRenderController = class DesktopCellEditRenderController extends _univerjs_core.RxDisposable {
35416
- constructor(_context, _instanceService, _commandService, _editorBridgeService, _selectionManagerService, _contextService, _renderManagerService, _embedRuntimeFocusCoordinator) {
35689
+ constructor(_context, _instanceService, _commandService, _editorBridgeService, _selectionManagerService, _contextService, _renderManagerService, _platformService, _embedRuntimeFocusCoordinator) {
35417
35690
  super();
35418
35691
  this._context = _context;
35419
35692
  this._instanceService = _instanceService;
@@ -35422,6 +35695,7 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
35422
35695
  this._selectionManagerService = _selectionManagerService;
35423
35696
  this._contextService = _contextService;
35424
35697
  this._renderManagerService = _renderManagerService;
35698
+ this._platformService = _platformService;
35425
35699
  this._embedRuntimeFocusCoordinator = _embedRuntimeFocusCoordinator;
35426
35700
  _defineProperty(this, "_d", void 0);
35427
35701
  this.disposeWithMe(this._instanceService.getCurrentTypeOfUnit$(_univerjs_core.UniverInstanceType.UNIVER_SHEET).subscribe((workbook) => {
@@ -35449,13 +35723,17 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
35449
35723
  const { spreadsheet, spreadsheetColumnHeader, spreadsheetLeftTopPlaceholder, spreadsheetRowHeader } = sheetObject;
35450
35724
  d.add(spreadsheet.onDblclick$.subscribeEvent((evt) => {
35451
35725
  var _this$_editorBridgeSe;
35452
- if (evt.button === 2) return;
35726
+ if (isSheetContextMenuGesture(evt, this._platformService.isMac, this._contextService.getContextValue(_univerjs_sheets.REF_SELECTIONS_ENABLED))) return;
35453
35727
  const snapshot = (_this$_editorBridgeSe = this._editorBridgeService.getEditCellState()) === null || _this$_editorBridgeSe === void 0 || (_this$_editorBridgeSe = _this$_editorBridgeSe.documentLayoutObject.documentModel) === null || _this$_editorBridgeSe === void 0 ? void 0 : _this$_editorBridgeSe.getSnapshot();
35454
35728
  if ((0, _univerjs_sheets.isCellImage)(snapshot)) return;
35455
- this._commandService.executeCommand(SetCellEditVisibleOperation.id, {
35729
+ this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
35456
35730
  visible: true,
35457
35731
  eventType: _univerjs_engine_render.DeviceInputEventType.Dblclick,
35458
- unitId: this._context.unitId
35732
+ unitId: this._context.unitId,
35733
+ pointerPosition: {
35734
+ x: evt.clientX,
35735
+ y: evt.clientY
35736
+ }
35459
35737
  });
35460
35738
  }));
35461
35739
  d.add(spreadsheet.onPointerDown$.subscribeEvent({
@@ -35584,7 +35862,8 @@ DesktopCellEditRenderController = __decorate([
35584
35862
  __decorateParam(4, (0, _univerjs_core.Inject)(_univerjs_sheets.SheetsSelectionsService)),
35585
35863
  __decorateParam(5, _univerjs_core.IContextService),
35586
35864
  __decorateParam(6, _univerjs_engine_render.IRenderManagerService),
35587
- __decorateParam(7, (0, _univerjs_core.Optional)(ISheetEmbedRuntimeFocusCoordinator))
35865
+ __decorateParam(7, _univerjs_ui.IPlatformService),
35866
+ __decorateParam(8, (0, _univerjs_core.Optional)(ISheetEmbedRuntimeFocusCoordinator))
35588
35867
  ], DesktopCellEditRenderController);
35589
35868
  function resolvePointerEventPayload(payload) {
35590
35869
  return Array.isArray(payload) ? payload[0] : payload;
@@ -35748,38 +36027,34 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35748
36027
  const { spreadsheetRowHeader, spreadsheetColumnHeader, spreadsheet, spreadsheetLeftTopPlaceholder } = sheetObject;
35749
36028
  const { scene } = this._context;
35750
36029
  this.disposeWithMe(spreadsheet === null || spreadsheet === void 0 ? void 0 : spreadsheet.onPointerDown$.subscribeEvent((evt, state) => {
35751
- if (this.isSelectionDisabled()) return;
35752
- if (this.inRefSelectionMode()) return;
36030
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35753
36031
  this._onPointerDown(evt, spreadsheet.zIndex + 1, _univerjs_core.RANGE_TYPE.NORMAL, this._getActiveViewport(evt));
35754
- if (evt.button !== 2) state.stopPropagation();
36032
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35755
36033
  }));
35756
36034
  this.disposeWithMe(spreadsheetRowHeader === null || spreadsheetRowHeader === void 0 ? void 0 : spreadsheetRowHeader.onPointerDown$.subscribeEvent((evt, state) => {
35757
- if (this.isSelectionDisabled()) return;
35758
- if (this.inRefSelectionMode()) return;
36035
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35759
36036
  const skeleton = this._sheetSkeletonManagerService.getCurrentParam().skeleton;
35760
36037
  const { row } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton);
35761
36038
  if (isThisRowSelected(this._workbookSelections.getCurrentSelections(), row)) return;
35762
36039
  this._onPointerDown(evt, (spreadsheet.zIndex || 1) + 1, _univerjs_core.RANGE_TYPE.ROW, this._getActiveViewport(evt), _univerjs_engine_render.ScrollTimerType.Y);
35763
- if (evt.button !== 2) state.stopPropagation();
36040
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35764
36041
  }));
35765
36042
  this.disposeWithMe(spreadsheetColumnHeader === null || spreadsheetColumnHeader === void 0 ? void 0 : spreadsheetColumnHeader.onPointerDown$.subscribeEvent((evt, state) => {
35766
- if (this.isSelectionDisabled()) return;
35767
- if (this.inRefSelectionMode()) return;
36043
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35768
36044
  const skeleton = this._sheetSkeletonManagerService.getCurrentParam().skeleton;
35769
36045
  const { column } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton);
35770
36046
  if (isThisColSelected(this._workbookSelections.getCurrentSelections(), column)) return;
35771
36047
  this._onPointerDown(evt, (spreadsheet.zIndex || 1) + 1, _univerjs_core.RANGE_TYPE.COLUMN, this._getActiveViewport(evt), _univerjs_engine_render.ScrollTimerType.X);
35772
- if (evt.button !== 2) state.stopPropagation();
36048
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35773
36049
  }));
35774
36050
  this.disposeWithMe(spreadsheetLeftTopPlaceholder === null || spreadsheetLeftTopPlaceholder === void 0 ? void 0 : spreadsheetLeftTopPlaceholder.onPointerDown$.subscribeEvent((evt, state) => {
35775
- if (this.isSelectionDisabled()) return;
35776
- if (this.inRefSelectionMode()) return;
36051
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35777
36052
  this._reset();
35778
36053
  const skeleton = this._sheetSkeletonManagerService.getCurrentParam().skeleton;
35779
36054
  const selectionWithStyle = selectionDataForSelectAll(skeleton);
35780
36055
  this._addSelectionControlByModelData(selectionWithStyle);
35781
36056
  this.refreshSelectionMoveEnd();
35782
- if (evt.button !== 2) state.stopPropagation();
36057
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35783
36058
  }));
35784
36059
  }
35785
36060
  _initThemeChangeListener() {
@@ -35860,7 +36135,7 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35860
36135
  const sheetId = workbook.getActiveSheet().getSheetId();
35861
36136
  if (selectionDataWithStyleList.length === 0) return;
35862
36137
  const selectionWithStyles = selectionDataWithStyleList.map((selectionDataWithStyle) => (0, _univerjs_sheets.convertSelectionDataToRange)(selectionDataWithStyle));
35863
- this._commandService.executeCommand(_univerjs_sheets.SetSelectionsOperation.id, {
36138
+ this._commandService.syncExecuteCommand(_univerjs_sheets.SetSelectionsOperation.id, {
35864
36139
  unitId,
35865
36140
  subUnitId: sheetId,
35866
36141
  type,
@@ -35881,6 +36156,7 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35881
36156
  const prevSheetId = (_this$_skeleton = this._skeleton) === null || _this$_skeleton === void 0 || (_this$_skeleton = _this$_skeleton.worksheet) === null || _this$_skeleton === void 0 ? void 0 : _this$_skeleton.getSheetId();
35882
36157
  this._changeRuntime(skeleton, scene, viewportMain);
35883
36158
  if (prevSheetId !== skeleton.worksheet.getSheetId()) {
36159
+ this._reset();
35884
36160
  const selections = this._workbookSelections.getCurrentSelections();
35885
36161
  this._commandService.syncExecuteCommand(_univerjs_sheets.SetSelectionsOperation.id, {
35886
36162
  unitId,
@@ -35915,11 +36191,10 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35915
36191
  this._rangeType = rangeType;
35916
36192
  const skeleton = this._skeleton;
35917
36193
  const scene = this._scene;
35918
- if (!scene || !skeleton) return;
36194
+ const viewportMain = scene === null || scene === void 0 ? void 0 : scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
36195
+ if (!scene || !skeleton || !viewportMain) return;
35919
36196
  if (viewport) this._activeViewport = viewport;
35920
36197
  const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
35921
- const viewportMain = scene.getViewport(_univerjs_engine_render.SHEET_VIEWPORT_KEY.VIEW_MAIN);
35922
- if (!viewportMain) return;
35923
36198
  const relativeCoords = scene.getCoordRelativeToViewport(_univerjs_engine_render.Vector2.FromArray([evtOffsetX, evtOffsetY]));
35924
36199
  const { x: offsetX, y: offsetY } = relativeCoords;
35925
36200
  this._startViewportPosX = offsetX;
@@ -35929,7 +36204,6 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35929
36204
  const selectCell = this._skeleton.getCellByOffset(offsetX, offsetY, scaleX, scaleY, scrollXY);
35930
36205
  if (!selectCell) return;
35931
36206
  switch (rangeType) {
35932
- case _univerjs_core.RANGE_TYPE.NORMAL: break;
35933
36207
  case _univerjs_core.RANGE_TYPE.ROW:
35934
36208
  selectCell.startColumn = 0;
35935
36209
  selectCell.endColumn = this._skeleton.getColumnCount() - 1;
@@ -35956,6 +36230,11 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35956
36230
  selectionWithStyle.range.rangeType = rangeType;
35957
36231
  const activeSelectionControl = this._updateSelectionControl(evt, selectionWithStyle);
35958
36232
  if (!activeSelectionControl) return;
36233
+ if (this._isContextMenuGesture(evt)) {
36234
+ this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
36235
+ this.endSelection();
36236
+ return;
36237
+ }
35959
36238
  scene.disableObjectsEvent();
35960
36239
  this._clearUpdatingListeners();
35961
36240
  this._addEndingListeners();
@@ -35967,20 +36246,32 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35967
36246
  (_this$_scene$getEngin = this._scene.getEngine()) === null || _this$_scene$getEngin === void 0 || _this$_scene$getEngin.setCapture();
35968
36247
  }
35969
36248
  _updateSelectionControl(evt, selection) {
35970
- const cursorRange = (0, _univerjs_sheets.attachSelectionWithCoord)(selection, this._skeleton).rangeWithCoord;
36249
+ const selectionWithCoord = (0, _univerjs_sheets.attachSelectionWithCoord)(selection, this._skeleton);
36250
+ const cursorRange = selectionWithCoord.rangeWithCoord;
35971
36251
  this._startRangeWhenPointerDown = { ...cursorRange };
35972
36252
  const controls = this.getSelectionControls();
35973
36253
  const isSelected = controls.some((control) => _univerjs_core.Rectangle.contains(control.model, cursorRange));
35974
- if (evt.button === 2 && isSelected) return;
35975
- if (evt.button === 0 && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey && !this._singleSelectionEnabled && this._rangeType === _univerjs_core.RANGE_TYPE.NORMAL && isSelected) this._selectionBeforeModifierClick = this.getSelectionDataWithStyle().map(_univerjs_sheets.convertSelectionDataToRange);
36254
+ if (this._isContextMenuGesture(evt) && isSelected) return;
36255
+ if (evt.button === 0 && !this._isContextMenuGesture(evt) && this._isMultiSelectModifier(evt) && !evt.shiftKey && !this._singleSelectionEnabled && this._rangeType === _univerjs_core.RANGE_TYPE.NORMAL && isSelected) this._selectionBeforeModifierClick = this.getSelectionDataWithStyle().map(_univerjs_sheets.convertSelectionDataToRange);
35976
36256
  let activeControl = this.getActiveSelectionControl();
36257
+ if (activeControl && this._canAnimateSelection(evt, activeControl, cursorRange)) {
36258
+ activeControl.updateRangeBySelectionWithCoord(selectionWithCoord, this._skeleton, true);
36259
+ return activeControl;
36260
+ }
35977
36261
  this._checkClearPreviousControls(evt);
35978
36262
  const currentCell = activeControl === null || activeControl === void 0 ? void 0 : activeControl.model.currentCell;
35979
- if (evt.shiftKey && currentCell && activeControl) this._makeSelectionByTwoCells(currentCell, cursorRange, this._skeleton, this._rangeType, activeControl);
36263
+ if (!this._isContextMenuGesture(evt) && evt.shiftKey && currentCell && activeControl) this._makeSelectionByTwoCells(currentCell, cursorRange, this._skeleton, this._rangeType, activeControl);
35980
36264
  else activeControl = this.newSelectionControl(this._scene, this._skeleton, selection);
35981
36265
  for (let i = 0; i < controls.length - 1; i++) controls[i].clearHighlight();
35982
36266
  return activeControl;
35983
36267
  }
36268
+ _canAnimateSelection(evt, control, target) {
36269
+ if (this.getSelectionControls().length !== 1 || this._rangeType !== _univerjs_core.RANGE_TYPE.NORMAL || this._remainLastEnabled || evt.button !== 0 || evt.ctrlKey || evt.metaKey || evt.shiftKey || evt.altKey) return false;
36270
+ const current = control.getCurrentCellInfo();
36271
+ if (!current || !_univerjs_core.Rectangle.equals(control.model, current)) return false;
36272
+ const freeze = this._skeleton.worksheet.getFreeze();
36273
+ return current.startRow < freeze.startRow === target.startRow < freeze.startRow && current.startColumn < freeze.startColumn === target.startColumn < freeze.startColumn;
36274
+ }
35984
36275
  endSelection() {
35985
36276
  const previousSelections = this._selectionBeforeModifierClick;
35986
36277
  this._selectionBeforeModifierClick = null;
@@ -36175,19 +36466,19 @@ exports.AddRangeProtectionFromSheetBarCommand = AddRangeProtectionFromSheetBarCo
36175
36466
  exports.AddRangeProtectionFromToolbarCommand = AddRangeProtectionFromToolbarCommand;
36176
36467
  exports.ApplyFormatPainterCommand = ApplyFormatPainterCommand;
36177
36468
  exports.AutoFillPopupMenu = AutoFillPopupMenu;
36178
- Object.defineProperty(exports, 'AutoFillUIController', {
36469
+ Object.defineProperty(exports, "AutoFillUIController", {
36179
36470
  enumerable: true,
36180
36471
  get: function () {
36181
36472
  return AutoFillUIController;
36182
36473
  }
36183
36474
  });
36184
- Object.defineProperty(exports, 'AutoHeightController', {
36475
+ Object.defineProperty(exports, "AutoHeightController", {
36185
36476
  enumerable: true,
36186
36477
  get: function () {
36187
36478
  return AutoHeightController;
36188
36479
  }
36189
36480
  });
36190
- Object.defineProperty(exports, 'AutoWidthController', {
36481
+ Object.defineProperty(exports, "AutoWidthController", {
36191
36482
  enumerable: true,
36192
36483
  get: function () {
36193
36484
  return AutoWidthController;
@@ -36199,21 +36490,21 @@ exports.BaseSelectionRenderService = BaseSelectionRenderService;
36199
36490
  exports.BorderLine = BorderLine;
36200
36491
  exports.COPY_SPECIAL_MENU_ID = COPY_SPECIAL_MENU_ID;
36201
36492
  exports.COPY_TYPE = COPY_TYPE;
36202
- Object.defineProperty(exports, 'CellAlertManagerService', {
36493
+ Object.defineProperty(exports, "CellAlertManagerService", {
36203
36494
  enumerable: true,
36204
36495
  get: function () {
36205
36496
  return CellAlertManagerService;
36206
36497
  }
36207
36498
  });
36208
36499
  exports.CellAlertType = CellAlertType;
36209
- Object.defineProperty(exports, 'CellCustomRenderController', {
36500
+ Object.defineProperty(exports, "CellCustomRenderController", {
36210
36501
  enumerable: true,
36211
36502
  get: function () {
36212
36503
  return CellCustomRenderController;
36213
36504
  }
36214
36505
  });
36215
36506
  exports.CellEditorManagerService = CellEditorManagerService;
36216
- Object.defineProperty(exports, 'CellPopupManagerService', {
36507
+ Object.defineProperty(exports, "CellPopupManagerService", {
36217
36508
  enumerable: true,
36218
36509
  get: function () {
36219
36510
  return CellPopupManagerService;
@@ -36221,17 +36512,18 @@ Object.defineProperty(exports, 'CellPopupManagerService', {
36221
36512
  });
36222
36513
  exports.ChangeSheetProtectionFromSheetBarCommand = ChangeSheetProtectionFromSheetBarCommand;
36223
36514
  exports.ChangeZoomRatioCommand = ChangeZoomRatioCommand;
36515
+ exports.DEFINED_NAME_CONTAINER = DEFINED_NAME_CONTAINER;
36224
36516
  exports.DeleteRangeMoveLeftConfirmCommand = DeleteRangeMoveLeftConfirmCommand;
36225
36517
  exports.DeleteRangeMoveUpConfirmCommand = DeleteRangeMoveUpConfirmCommand;
36226
36518
  exports.DeleteRangeProtectionFromContextMenuCommand = DeleteRangeProtectionFromContextMenuCommand;
36227
36519
  exports.DeleteWorksheetProtectionFormSheetBarCommand = DeleteWorksheetProtectionFormSheetBarCommand;
36228
- Object.defineProperty(exports, 'DragManagerService', {
36520
+ Object.defineProperty(exports, "DragManagerService", {
36229
36521
  enumerable: true,
36230
36522
  get: function () {
36231
36523
  return DragManagerService;
36232
36524
  }
36233
36525
  });
36234
- Object.defineProperty(exports, 'DragRenderController', {
36526
+ Object.defineProperty(exports, "DragRenderController", {
36235
36527
  enumerable: true,
36236
36528
  get: function () {
36237
36529
  return DragRenderController;
@@ -36239,13 +36531,13 @@ Object.defineProperty(exports, 'DragRenderController', {
36239
36531
  });
36240
36532
  exports.EMBEDDING_FORMULA_EDITOR = EMBEDDING_FORMULA_EDITOR;
36241
36533
  exports.EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY = EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY;
36242
- Object.defineProperty(exports, 'EditingRenderController', {
36534
+ Object.defineProperty(exports, "EditingRenderController", {
36243
36535
  enumerable: true,
36244
36536
  get: function () {
36245
36537
  return EditingRenderController;
36246
36538
  }
36247
36539
  });
36248
- Object.defineProperty(exports, 'EditorBridgeService', {
36540
+ Object.defineProperty(exports, "EditorBridgeService", {
36249
36541
  enumerable: true,
36250
36542
  get: function () {
36251
36543
  return EditorBridgeService;
@@ -36256,26 +36548,26 @@ exports.ExpandSelectionCommand = ExpandSelectionCommand;
36256
36548
  exports.FORMULA_CLIPBOARD_MIME_TYPE = FORMULA_CLIPBOARD_MIME_TYPE;
36257
36549
  exports.FormatPainterStatus = FormatPainterStatus;
36258
36550
  exports.FormulaBar = FormulaBar;
36259
- Object.defineProperty(exports, 'FormulaEditorController', {
36551
+ Object.defineProperty(exports, "FormulaEditorController", {
36260
36552
  enumerable: true,
36261
36553
  get: function () {
36262
36554
  return FormulaEditorController;
36263
36555
  }
36264
36556
  });
36265
36557
  exports.HEADER_UNHIDE_RANGE_VISIBLE_CHECK = HEADER_UNHIDE_RANGE_VISIBLE_CHECK;
36266
- Object.defineProperty(exports, 'HeaderFreezeRenderController', {
36558
+ Object.defineProperty(exports, "HeaderFreezeRenderController", {
36267
36559
  enumerable: true,
36268
36560
  get: function () {
36269
36561
  return HeaderFreezeRenderController;
36270
36562
  }
36271
36563
  });
36272
- Object.defineProperty(exports, 'HeaderMoveRenderController', {
36564
+ Object.defineProperty(exports, "HeaderMoveRenderController", {
36273
36565
  enumerable: true,
36274
36566
  get: function () {
36275
36567
  return HeaderMoveRenderController;
36276
36568
  }
36277
36569
  });
36278
- Object.defineProperty(exports, 'HeaderResizeRenderController', {
36570
+ Object.defineProperty(exports, "HeaderResizeRenderController", {
36279
36571
  enumerable: true,
36280
36572
  get: function () {
36281
36573
  return HeaderResizeRenderController;
@@ -36283,7 +36575,7 @@ Object.defineProperty(exports, 'HeaderResizeRenderController', {
36283
36575
  });
36284
36576
  exports.HeaderUnhideRangeAxis = HeaderUnhideRangeAxis;
36285
36577
  exports.HeaderUnhideRangeService = HeaderUnhideRangeService;
36286
- Object.defineProperty(exports, 'HeaderUnhideRenderController', {
36578
+ Object.defineProperty(exports, "HeaderUnhideRenderController", {
36287
36579
  enumerable: true,
36288
36580
  get: function () {
36289
36581
  return HeaderUnhideRenderController;
@@ -36291,13 +36583,13 @@ Object.defineProperty(exports, 'HeaderUnhideRenderController', {
36291
36583
  });
36292
36584
  exports.HideColConfirmCommand = HideColConfirmCommand;
36293
36585
  exports.HideRowConfirmCommand = HideRowConfirmCommand;
36294
- Object.defineProperty(exports, 'HoverManagerService', {
36586
+ Object.defineProperty(exports, "HoverManagerService", {
36295
36587
  enumerable: true,
36296
36588
  get: function () {
36297
36589
  return HoverManagerService;
36298
36590
  }
36299
36591
  });
36300
- Object.defineProperty(exports, 'HoverRenderController', {
36592
+ Object.defineProperty(exports, "HoverRenderController", {
36301
36593
  enumerable: true,
36302
36594
  get: function () {
36303
36595
  return HoverRenderController;
@@ -36326,7 +36618,7 @@ exports.MOBILE_CONTEXT_MENU = MOBILE_CONTEXT_MENU;
36326
36618
  exports.MOBILE_EXPANDING_SELECTION = MOBILE_EXPANDING_SELECTION;
36327
36619
  exports.MOBILE_FORMULA_FUNCTION_PANEL_OPEN = MOBILE_FORMULA_FUNCTION_PANEL_OPEN;
36328
36620
  exports.MOBILE_PINCH_ZOOMING = MOBILE_PINCH_ZOOMING;
36329
- Object.defineProperty(exports, 'MarkSelectionService', {
36621
+ Object.defineProperty(exports, "MarkSelectionService", {
36330
36622
  enumerable: true,
36331
36623
  get: function () {
36332
36624
  return MarkSelectionService;
@@ -36400,37 +36692,37 @@ exports.SetZoomRatioCommand = SetZoomRatioCommand;
36400
36692
  exports.SetZoomRatioOperation = SetZoomRatioOperation;
36401
36693
  exports.SheetBar = SheetBar;
36402
36694
  exports.SheetBarService = SheetBarService;
36403
- Object.defineProperty(exports, 'SheetCanvasPopManagerService', {
36695
+ Object.defineProperty(exports, "SheetCanvasPopManagerService", {
36404
36696
  enumerable: true,
36405
36697
  get: function () {
36406
36698
  return SheetCanvasPopManagerService;
36407
36699
  }
36408
36700
  });
36409
- Object.defineProperty(exports, 'SheetCellDropdownManagerService', {
36701
+ Object.defineProperty(exports, "SheetCellDropdownManagerService", {
36410
36702
  enumerable: true,
36411
36703
  get: function () {
36412
36704
  return SheetCellDropdownManagerService;
36413
36705
  }
36414
36706
  });
36415
- Object.defineProperty(exports, 'SheetCellEditorResizeService', {
36707
+ Object.defineProperty(exports, "SheetCellEditorResizeService", {
36416
36708
  enumerable: true,
36417
36709
  get: function () {
36418
36710
  return SheetCellEditorResizeService;
36419
36711
  }
36420
36712
  });
36421
- Object.defineProperty(exports, 'SheetClipboardController', {
36713
+ Object.defineProperty(exports, "SheetClipboardController", {
36422
36714
  enumerable: true,
36423
36715
  get: function () {
36424
36716
  return SheetClipboardController;
36425
36717
  }
36426
36718
  });
36427
- Object.defineProperty(exports, 'SheetClipboardService', {
36719
+ Object.defineProperty(exports, "SheetClipboardService", {
36428
36720
  enumerable: true,
36429
36721
  get: function () {
36430
36722
  return SheetClipboardService;
36431
36723
  }
36432
36724
  });
36433
- Object.defineProperty(exports, 'SheetContextMenuMobileRenderController', {
36725
+ Object.defineProperty(exports, "SheetContextMenuMobileRenderController", {
36434
36726
  enumerable: true,
36435
36727
  get: function () {
36436
36728
  return SheetContextMenuMobileRenderController;
@@ -36445,7 +36737,7 @@ exports.SheetPasteCommand = SheetPasteCommand;
36445
36737
  exports.SheetPasteFormatCommand = SheetPasteFormatCommand;
36446
36738
  exports.SheetPasteShortKeyCommand = SheetPasteShortKeyCommand;
36447
36739
  exports.SheetPasteValueCommand = SheetPasteValueCommand;
36448
- Object.defineProperty(exports, 'SheetPermissionCheckUIController', {
36740
+ Object.defineProperty(exports, "SheetPermissionCheckUIController", {
36449
36741
  enumerable: true,
36450
36742
  get: function () {
36451
36743
  return SheetPermissionCheckUIController;
@@ -36453,7 +36745,7 @@ Object.defineProperty(exports, 'SheetPermissionCheckUIController', {
36453
36745
  });
36454
36746
  exports.SheetPermissionOpenDialogOperation = SheetPermissionOpenDialogOperation;
36455
36747
  exports.SheetPermissionOpenPanelOperation = SheetPermissionOpenPanelOperation;
36456
- Object.defineProperty(exports, 'SheetPermissionRenderManagerService', {
36748
+ Object.defineProperty(exports, "SheetPermissionRenderManagerService", {
36457
36749
  enumerable: true,
36458
36750
  get: function () {
36459
36751
  return SheetPermissionRenderManagerService;
@@ -36462,43 +36754,43 @@ Object.defineProperty(exports, 'SheetPermissionRenderManagerService', {
36462
36754
  exports.SheetPermissionUserManagerService = SheetPermissionUserManagerService;
36463
36755
  exports.SheetPrintInterceptorService = SheetPrintInterceptorService;
36464
36756
  exports.SheetPrintingResourceCollector = SheetPrintingResourceCollector;
36465
- Object.defineProperty(exports, 'SheetRenderController', {
36757
+ Object.defineProperty(exports, "SheetRenderController", {
36466
36758
  enumerable: true,
36467
36759
  get: function () {
36468
36760
  return SheetRenderController;
36469
36761
  }
36470
36762
  });
36471
- Object.defineProperty(exports, 'SheetScrollManagerService', {
36763
+ Object.defineProperty(exports, "SheetScrollManagerService", {
36472
36764
  enumerable: true,
36473
36765
  get: function () {
36474
36766
  return SheetScrollManagerService;
36475
36767
  }
36476
36768
  });
36477
- Object.defineProperty(exports, 'SheetSelectionRenderService', {
36769
+ Object.defineProperty(exports, "SheetSelectionRenderService", {
36478
36770
  enumerable: true,
36479
36771
  get: function () {
36480
36772
  return SheetSelectionRenderService;
36481
36773
  }
36482
36774
  });
36483
- Object.defineProperty(exports, 'SheetSkeletonManagerService', {
36775
+ Object.defineProperty(exports, "SheetSkeletonManagerService", {
36484
36776
  enumerable: true,
36485
36777
  get: function () {
36486
36778
  return SheetSkeletonManagerService;
36487
36779
  }
36488
36780
  });
36489
- Object.defineProperty(exports, 'SheetUIController', {
36781
+ Object.defineProperty(exports, "SheetUIController", {
36490
36782
  enumerable: true,
36491
36783
  get: function () {
36492
36784
  return SheetUIController;
36493
36785
  }
36494
36786
  });
36495
- Object.defineProperty(exports, 'SheetsRenderService', {
36787
+ Object.defineProperty(exports, "SheetsRenderService", {
36496
36788
  enumerable: true,
36497
36789
  get: function () {
36498
36790
  return SheetsRenderService;
36499
36791
  }
36500
36792
  });
36501
- Object.defineProperty(exports, 'SheetsScrollRenderController', {
36793
+ Object.defineProperty(exports, "SheetsScrollRenderController", {
36502
36794
  enumerable: true,
36503
36795
  get: function () {
36504
36796
  return SheetsScrollRenderController;
@@ -36508,7 +36800,7 @@ exports.SheetsUIMenuSchema = menuSchema;
36508
36800
  exports.SheetsUIPart = SheetsUIPart;
36509
36801
  exports.ShowMenuListCommand = ShowMenuListCommand;
36510
36802
  exports.SidebarDefinedNameOperation = SidebarDefinedNameOperation;
36511
- Object.defineProperty(exports, 'StatusBarController', {
36803
+ Object.defineProperty(exports, "StatusBarController", {
36512
36804
  enumerable: true,
36513
36805
  get: function () {
36514
36806
  return StatusBarController;
@@ -36516,13 +36808,13 @@ Object.defineProperty(exports, 'StatusBarController', {
36516
36808
  });
36517
36809
  exports.StatusBarService = StatusBarService;
36518
36810
  exports.UNIVER_SHEET_PERMISSION_USER_PART = UNIVER_SHEET_PERMISSION_USER_PART;
36519
- Object.defineProperty(exports, 'UniverSheetsMobileUIPlugin', {
36811
+ Object.defineProperty(exports, "UniverSheetsMobileUIPlugin", {
36520
36812
  enumerable: true,
36521
36813
  get: function () {
36522
36814
  return UniverSheetsMobileUIPlugin;
36523
36815
  }
36524
36816
  });
36525
- Object.defineProperty(exports, 'UniverSheetsUIPlugin', {
36817
+ Object.defineProperty(exports, "UniverSheetsUIPlugin", {
36526
36818
  enumerable: true,
36527
36819
  get: function () {
36528
36820
  return UniverSheetsUIPlugin;