@univerjs/sheets-ui 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { BreakLineCommand, CoverContentCommand, DOCS_COMPONENT_MAIN_LAYER_INDEX, DOCS_VIEW_KEY, DOC_VERTICAL_PADDING, DeleteLeftCommand, DeleteRightCommand, DocSelectionRenderService, EnterCommand, IEditorService, IMEInputCommand, MobileRichTextToolbar, MoveCursorOperation, MoveSelectionOperation, NodePositionConvertToCursor, ReplaceSnapshotCommand, SetDocInputStyleCommand, SetInlineFormatBoldCommand, SetInlineFormatCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatFontSizeCommand, SetInlineFormatItalicCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatTextColorCommand, SetInlineFormatUnderlineCommand, UniverDocsUIPlugin, VIEWPORT_KEY, convertBodyToHtml, getCanvasOffsetByEngine, getLineBounding } from "@univerjs/docs-ui";
1
+ import { BreakLineCommand, CoverContentCommand, DOCS_COMPONENT_MAIN_LAYER_INDEX, DOCS_VIEW_KEY, DOC_VERTICAL_PADDING, DeleteLeftCommand, DeleteRightCommand, DocSelectionRenderService, EnterCommand, IEditorService, IMEInputCommand, InnerPasteCommand, MobileRichTextToolbar, MoveCursorOperation, MoveSelectionOperation, NodePositionConvertToCursor, ReplaceSnapshotCommand, SetDocInputStyleCommand, SetInlineFormatBoldCommand, SetInlineFormatCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatFontSizeCommand, SetInlineFormatItalicCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatTextColorCommand, SetInlineFormatUnderlineCommand, UniverDocsUIPlugin, VIEWPORT_KEY, convertBodyToHtml, getCanvasOffsetByEngine, getLineBounding } from "@univerjs/docs-ui";
2
2
  import { AbsoluteRefType, BaselineOffset, BooleanNumber, BorderStyleTypes, BorderType, CellModeEnum, CellValueType, ColorKit, CommandType, CustomRangeType, DEFAULT_EMPTY_DOCUMENT_VALUE, DEFAULT_STYLES, DEFAULT_WORKSHEET_COLUMN_COUNT, DEFAULT_WORKSHEET_COLUMN_WIDTH, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_ROW_COUNT, DEFAULT_WORKSHEET_ROW_HEIGHT, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DataStreamTreeTokenType, DependentOn, Direction, Disposable, DisposableCollection, DocumentFlavor, EDITOR_ACTIVATED, ErrorService, FOCUSING_COMMENT_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_EDITOR_STANDALONE, FOCUSING_FX_BAR_EDITOR, FOCUSING_SHAPE_TEXT_EDITOR, FOCUSING_SHEET, FOCUSING_UNIVER_EDITOR, FontItalic, FontWeight, HorizontalAlign, IAuthzIoService, ICommandService, IConfigService, IConfirmService, IContextService, ILogService, IPermissionService, IUndoRedoService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, InterceptorManager, LRUMap, LocaleService, LocaleType, LookUp, NilCommand, ObjectMatrix, Optional, Plugin, PresetListType, Quantity, RANGE_TYPE, Range, Rectangle, RxDisposable, SHEET_EDITOR_UNITS, ThemeService, Tools, UndoCommandId, UniverInstanceType, UserManagerService, VerticalAlign, Workbook, WorksheetHiddenState, WrapStrategy, cloneCellData, cloneCellDataMatrix, cloneCellDataWithSpanAndDisplay, composeStyles, convertCellToRange, createDocumentModelWithStyle, createIdentifier, createInterceptorKey, createParagraphId, createSectionId, dateKit, debounce, extractPureTextFromCell, fromEventSubject, generateRandomId, get, getEmptyCell, getIntersectRange, getNumfmtLocaleTag, getNumfmtParseValueFilter, getReverseDirection, handleStyleToString, isDefaultFormat, isFormulaString, isNotNullOrUndefined, isRealNum, isSafeUrl, isTextFormat, isValidRange, merge, mergeOverrideWithDependencies, nameCharacterCheck, numberToABC, numfmt, registerDependencies, sequenceExecute, set, skipParseTagNames, sortRules, splitIntoGrid, throttle, toDisposable, touchDependencies, willLoseNumericPrecision } from "@univerjs/core";
3
3
  import { AUTO_FILL_APPLY_TYPE, AUTO_FILL_HOOK_TYPE, AddMergeUndoMutationFactory, AddRangeProtectionCommand, AddRangeProtectionMutation, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeMutation, AddWorksheetMergeVerticalCommand, AddWorksheetProtectionCommand, AutoClearContentCommand, AutoFillCommand, AutoFillController, BEFORE_CELL_EDIT, BorderStyleManagerService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, CancelFrozenCommand, CancelMarkDirtyRowAutoHeightOperation, ClearSelectionAllCommand, ClearSelectionContentCommand, ClearSelectionFormatCommand, CopySheetCommand, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, DeleteRangeProtectionCommand, DeleteRangeProtectionMutation, DeleteWorksheetProtectionCommand, DeltaColumnWidthCommand, DeltaRowHeightCommand, EditStateEnum, IAutoFillService, IExclusiveRangeService, INTERCEPTOR_POINT, INumfmtService, IRefSelectionsService, InsertColBeforeCommand, InsertColCommand, InsertColMutation, InsertDefinedNameCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, InsertRowBeforeCommand, InsertRowCommand, InsertRowMutation, InsertSheetCommand, InsertSheetMutation, MAX_CELL_PER_SHEET_KEY, MERGE_CELL_INTERCEPTOR_CHECK, MarkDirtyRowAutoHeightOperation, MergeCellController, MoveColsCommand, MoveColsMutation, MoveRangeCommand, MoveRangeMutation, MoveRowsCommand, MoveRowsMutation, REF_SELECTIONS_ENABLED, RangeProtectionCache, RangeProtectionPermissionEditPoint, RangeProtectionPermissionViewPoint, RangeProtectionRuleModel, RefRangeService, RefSelectionsService, RefillCommand, RemoveColCommand, RemoveColMutation, RemoveDefinedNameCommand, RemoveMergeUndoMutationFactory, RemoveRowCommand, RemoveRowMutation, RemoveSheetCommand, RemoveSheetMutation, RemoveWorksheetMergeCommand, RemoveWorksheetMergeMutation, ResetBackgroundColorCommand, ResetTextColorCommand, SCOPE_WORKBOOK_VALUE_DEFINED_NAME, SELECTIONS_ENABLED, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, SHEETS_PLUGIN_CONFIG_KEY, ScrollToCellOperation, SelectionMoveType, SetBackgroundColorCommand, SetBoldCommand, SetBorderBasicCommand, SetBorderCommand, SetColHiddenCommand, SetColHiddenMutation, SetColVisibleMutation, SetColWidthCommand, SetDefinedNameCommand, SetFontFamilyCommand, SetFontSizeCommand, SetFrozenCommand, SetFrozenMutation, SetFrozenMutationFactory, SetHorizontalTextAlignCommand, SetItalicCommand, SetProtectionCommand, SetRangeValuesCommand, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SetRowHeightCommand, SetRowHiddenCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedColsVisibleCommand, SetSelectedRowsVisibleCommand, SetSelectionsOperation, SetShrinkToFitCommand, SetSpecificColsVisibleCommand, SetSpecificRowsVisibleCommand, SetStrikeThroughCommand, SetStyleCommand, SetTabColorCommand, SetTabColorMutation, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, SetWorksheetActivateCommand, SetWorksheetActiveOperation, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, SetWorksheetHideCommand, SetWorksheetHideMutation, SetWorksheetNameCommand, SetWorksheetNameMutation, SetWorksheetOrderCommand, SetWorksheetOrderMutation, SetWorksheetPermissionPointsCommand, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowIsAutoHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetWorksheetShowCommand, SheetCopyDownCommand, SheetCopyRightCommand, SheetInterceptorService, SheetPermissionCheckController, SheetPermissionInitController, SheetSkeletonService, SheetsSelectionsService, TextToNumberCommand, ToggleCellCheckboxCommand, ToggleGridlinesCommand, ToggleGridlinesMutation, UniverSheetsPlugin, ViewStateEnum, WorkbookCopyPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteColumnPermission, WorkbookDeleteRowPermission, WorkbookDeleteSheetPermission, WorkbookEditablePermission, WorkbookHideSheetPermission, WorkbookInsertColumnPermission, WorkbookInsertRowPermission, WorkbookManageCollaboratorPermission, WorkbookRenameSheetPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditPermission, WorksheetInsertColumnPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetProtectionPointModel, WorksheetProtectionRuleModel, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetViewPermission, adjustRangeOnMutation, alignToMergedCellsBorders, attachPrimaryWithCoord, attachRangeWithCoord, attachSelectionWithCoord, baseProtectionActions, convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, countCells, defaultLargeSheetOperationConfig, deserializeListOptions, discreteRangeToRange, expandToContinuousRange, findFirstNonEmptyCell, getAddMergeMutationRangeByType, getAllWorksheetPermissionPoint, getCellAtRowCol, getCellType, getCellValue, getClearContentMutationParamsForRanges, getMoveRangeCommandMutations, getPrimaryForRange, getSelectionsService, getSheetCommandTarget, isCellImage, rangeToDiscreteRange, serializeListOptions, setEndForRange, validateDefinedName } from "@univerjs/sheets";
4
4
  import { AnchoredContextMenu, BuiltInUIPart, COLOR_PICKER_COMPONENT, ComponentContainer, ComponentManager, ContextMenuGroup, ContextMenuPosition, CopyCommand, CutCommand, DISABLE_AUTO_FOCUS_KEY, FILE_PNG_CLIPBOARD_MIME_TYPE, FILE__BMP_CLIPBOARD_MIME_TYPE, FILE__JPEG_CLIPBOARD_MIME_TYPE, FILE__WEBP_CLIPBOARD_MIME_TYPE, FONT_FAMILY_COMPONENT, FONT_FAMILY_ITEM_COMPONENT, FONT_SIZE_COMPONENT, FONT_SIZE_LIST, FormatPainterSessionService, HTML_CLIPBOARD_MIME_TYPE, ICanvasPopupService, IClipboardInterfaceService, IContextMenuService, IDialogService, IFontService, ILayoutService, IMenuManagerService, IMessageService, INotificationService, IPlatformService, IRibbonService, IShortcutService, ISidebarService, IUIPartsService, IUIRuntimeScopeService, IWorkbenchService, IconManager, KeyCode, MenuItemType, MetaKeys, MobileDrawer, MobileMenu, MobileZoomIndicator, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, PasteCommand, RibbonPosition, RibbonStartGroup, RibbonViewGroup, SheetPasteShortKeyCommandName, Slider, ToggleFullscreenOperation, ToolbarItem, UI_PLUGIN_CONFIG_KEY, UniverMobileUIPlugin, ZoomInput, bindFormatPainterCanvas, connectInjector, getEmbedBoundaryOwner, getEmbedChildUnitId, getMenuHiddenObservable, handleStringToStyle, imageMimeTypeSet, sanitizeParsedHtml, textTrim, useComponentsOfPart, useConfigValue, useDependency, useEvent, useObservable, useSidebarClick, useToolbarItemStatus, useVirtualList } from "@univerjs/ui";
5
- import { CURSOR_TYPE, DashedRect, DeviceInputEventType, DeviceType, FIX_ONE_PIXEL_BLUR_OFFSET, Group, IRenderManagerService, Layer, RENDER_CLASS_TYPE, RENDER_RAW_FORMULA_KEY, Rect, RegularPolygon, SHEET_EXTENSION_PREFIX, SHEET_VIEWPORT_KEY, ScrollBar, ScrollTimer, ScrollTimerType, Shape, SheetExtension, Spreadsheet, SpreadsheetColumnHeader, SpreadsheetRowHeader, TRANSFORM_CHANGE_OBSERVABLE_TYPE, UniverRenderEnginePlugin, Vector2, Viewport, calculateCellImageRect, cancelRequestFrame, convertTextRotation, convertTransformToOffsetX, convertTransformToOffsetY, fixLineWidthByScale, getCurrentTypeOfRenderer, getNextWheelZoomRatio, ptToPixel, requestNewFrame, withCurrentTypeOfRenderer } from "@univerjs/engine-render";
6
- import { BehaviorSubject, EMPTY, Observable, Subject, Subscription, combineLatest, combineLatestWith, distinctUntilChanged, filter, from, fromEvent, isObservable, map, merge as merge$1, of, shareReplay, skip, startWith, switchMap, takeUntil, throttleTime, withLatestFrom } from "rxjs";
5
+ import { CURSOR_TYPE, DashedRect, DeviceInputEventType, DeviceType, FIX_ONE_PIXEL_BLUR_OFFSET, Group, IRenderManagerService, Layer, NORMAL_TEXT_SELECTION_PLUGIN_STYLE, RENDER_CLASS_TYPE, RENDER_RAW_FORMULA_KEY, Rect, RegularPolygon, SHEET_EXTENSION_PREFIX, SHEET_VIEWPORT_KEY, ScrollBar, ScrollTimer, ScrollTimerType, Shape, SheetExtension, Spreadsheet, SpreadsheetColumnHeader, SpreadsheetRowHeader, TRANSFORM_CHANGE_OBSERVABLE_TYPE, UniverRenderEnginePlugin, Vector2, Viewport, calculateCellImageRect, cancelRequestFrame, convertTextRotation, convertTransformToOffsetX, convertTransformToOffsetY, fixLineWidthByScale, getCurrentTypeOfRenderer, getNextWheelZoomRatio, ptToPixel, requestNewFrame, withCurrentTypeOfRenderer } from "@univerjs/engine-render";
6
+ import { BehaviorSubject, EMPTY, Observable, Subject, Subscription, combineLatest, combineLatestWith, distinctUntilChanged, filter, from, fromEvent, isObservable, map, merge as merge$1, of, shareReplay, skip, startWith, switchMap, takeUntil, tap, throttleTime, withLatestFrom } from "rxjs";
7
7
  import { DocSelectionManagerService, DocSkeletonManagerService, DocStateChangeManagerService, InsertTextCommand, RichTextEditingMutation, SetTextSelectionsOperation, UniverDocsPlugin } from "@univerjs/docs";
8
8
  import { ObjectScope, UnitAction, UnitObject, UnitRole } from "@univerjs/protocol";
9
9
  import { ActionRow, Avatar, Button, Calendar, CascaderList, ColorPicker, ColorPickerPanel, ConfigContext, Confirm, Dropdown, DropdownMenu, FormLayout, Input, InputNumber, MessageType, MobileActionRow, MobileActionRowGroup, MobileColorPicker, MobileColorPresets, MobileConfirm, MobileDialog, MobileDropdown, MobileDropdownMenu, MobileSelect, Radio, RadioGroup, Select, Separator, Switch, TimeInput, Tooltip, borderBottomClassName, borderClassName, borderLeftClassName, borderRightClassName, borderTopClassName, clsx, resetButtonClassName, scrollbarClassName, useMobileKeyboardViewportLayout } from "@univerjs/design";
@@ -437,6 +437,15 @@ const SetColumnHeaderHeightCommand = {
437
437
  }
438
438
  };
439
439
 
440
+ //#endregion
441
+ //#region src/common/selection-input.ts
442
+ function isSheetContextMenuGesture(event, isMac, refSelectionsEnabled) {
443
+ return event.button === 2 || isMac && !refSelectionsEnabled && event.button === 0 && event.ctrlKey;
444
+ }
445
+ function isSheetMultiSelectModifier(event, isMac) {
446
+ return isMac ? event.metaKey : event.ctrlKey;
447
+ }
448
+
440
449
  //#endregion
441
450
  //#region src/services/selection/selection-layer.ts
442
451
  var SelectionLayer = class extends Layer {
@@ -941,9 +950,15 @@ var BaseSelectionRenderService = class extends Disposable {
941
950
  rangeWithCoord
942
951
  };
943
952
  }
953
+ _isContextMenuGesture(evt) {
954
+ return isSheetContextMenuGesture(evt, this._injector.get(IPlatformService).isMac, this.inRefSelectionMode());
955
+ }
956
+ _isMultiSelectModifier(evt) {
957
+ return isSheetMultiSelectModifier(evt, this._injector.get(IPlatformService).isMac);
958
+ }
944
959
  _checkClearPreviousControls(evt) {
945
960
  if (this.getSelectionControls().length === 0) return;
946
- if (!evt.ctrlKey && !evt.metaKey && !evt.shiftKey && !this._remainLastEnabled || this._singleSelectionEnabled && !evt.shiftKey) this._clearAllSelectionControls();
961
+ if (this._isContextMenuGesture(evt) && !this.inRefSelectionMode() || !this._isMultiSelectModifier(evt) && !evt.shiftKey && !this._remainLastEnabled || this._singleSelectionEnabled && !evt.shiftKey) this._clearAllSelectionControls();
947
962
  }
948
963
  _makeSelectionByTwoCells(currentCell, startSelectionRange, skeleton, rangeType, activeControl) {
949
964
  const { actualRow, actualColumn, mergeInfo: actualMergeInfo } = currentCell;
@@ -1849,6 +1864,7 @@ var SelectionShapeExtension = class {
1849
1864
  //#endregion
1850
1865
  //#region src/services/selection/selection-control.ts
1851
1866
  const SELECTION_TITLE_HIGHLIGHT_ALPHA = .3;
1867
+ const SELECTION_MOVE_DURATION = 120;
1852
1868
  /**
1853
1869
  * The main selection canvas component, includes leftControl,rightControl,topControl,bottomControl,backgroundControlTop,backgroundControlMiddleLeft,backgroundControlMiddleRight,backgroundControlBottom,fillControl
1854
1870
  */
@@ -1858,6 +1874,9 @@ var SelectionControl = class extends Disposable {
1858
1874
  this._scene = _scene;
1859
1875
  this._zIndex = _zIndex;
1860
1876
  this._themeService = _themeService;
1877
+ _defineProperty(this, "_moveAnimationFrame", -1);
1878
+ _defineProperty(this, "_animatedRange", null);
1879
+ _defineProperty(this, "_restoreMoveEvents", null);
1861
1880
  _defineProperty(this, "_isHelperSelection", true);
1862
1881
  _defineProperty(this, "_enableAutoFill", true);
1863
1882
  _defineProperty(this, "_showAutoFill", false);
@@ -1969,6 +1988,7 @@ var SelectionControl = class extends Disposable {
1969
1988
  scene.addObject(this._selectionShapeGroup, 1);
1970
1989
  this.disposeWithMe(toDisposable(scene.onTransformChange$.subscribeEvent((state) => {
1971
1990
  if (state.type !== TRANSFORM_CHANGE_OBSERVABLE_TYPE.scale) return;
1991
+ this._stopMoveAnimation();
1972
1992
  this._updateLayoutOfSelectionControl(this._currentStyle);
1973
1993
  this._updateControlCoord();
1974
1994
  })));
@@ -2131,6 +2151,11 @@ var SelectionControl = class extends Disposable {
2131
2151
  if (this._controlExtension) this._controlExtension.setDisabled(disable);
2132
2152
  }
2133
2153
  setEvent(state) {
2154
+ if (this._animatedRange) {
2155
+ this._stopMoveAnimation();
2156
+ this._updateLayoutOfSelectionControl();
2157
+ this._updateControlCoord();
2158
+ }
2134
2159
  this.leftControl.evented = state;
2135
2160
  this.rightControl.evented = state;
2136
2161
  this.topControl.evented = state;
@@ -2157,7 +2182,7 @@ var SelectionControl = class extends Disposable {
2157
2182
  autofillStrokeWidth /= scale < 1 ? 1 : scale;
2158
2183
  const borderBuffer = SELECTION_CONTROL_BORDER_BUFFER_WIDTH / scale;
2159
2184
  const fixOnePixelBlurOffset = FIX_ONE_PIXEL_BLUR_OFFSET / scale;
2160
- const { startX, startY, endX, endY } = this._selectionRenderModel;
2185
+ const { startX, startY, endX, endY } = this._animatedRange ?? this._selectionRenderModel;
2161
2186
  this.leftControl.transformByState({
2162
2187
  height: endY - startY,
2163
2188
  left: -leftAdjustWidth + fixOnePixelBlurOffset,
@@ -2238,19 +2263,20 @@ var SelectionControl = class extends Disposable {
2238
2263
  this._autoFillControl.show();
2239
2264
  } else this._autoFillControl.hide();
2240
2265
  this._updateBackgroundControl(currentStyle);
2241
- this._updateHeaderBackground(currentStyle);
2266
+ if (!this._animatedRange) this._updateHeaderBackground(currentStyle);
2242
2267
  this._updateWidgets(currentStyle);
2243
2268
  }
2244
2269
  /**
2245
2270
  * update selection control coordination by curr selection model
2246
2271
  */
2247
2272
  _updateControlCoord() {
2248
- const { startX, startY } = this._selectionRenderModel;
2273
+ const { startX, startY } = this._animatedRange ?? this._selectionRenderModel;
2249
2274
  this.selectionShapeGroup.show();
2250
2275
  this.selectionShapeGroup.translate(startX, startY);
2251
2276
  this.selectionShapeGroup.makeDirtyNoDebounce(true);
2252
2277
  }
2253
2278
  updateStyle(style) {
2279
+ this._stopMoveAnimation();
2254
2280
  this._updateLayoutOfSelectionControl(style);
2255
2281
  this._updateControlCoord();
2256
2282
  }
@@ -2264,6 +2290,7 @@ var SelectionControl = class extends Disposable {
2264
2290
  * @param primaryWithCoord
2265
2291
  */
2266
2292
  updateRange(rangeWithCoord, primaryWithCoord) {
2293
+ this._stopMoveAnimation();
2267
2294
  this._selectionRenderModel.setValue(rangeWithCoord, primaryWithCoord);
2268
2295
  this._showAutoFill = primaryWithCoord !== null;
2269
2296
  this._updateLayoutOfSelectionControl();
@@ -2273,7 +2300,11 @@ var SelectionControl = class extends Disposable {
2273
2300
  * Update range and primary range and style.
2274
2301
  * @param selectionWthCoord
2275
2302
  */
2276
- updateRangeBySelectionWithCoord(selectionWthCoord, sk) {
2303
+ updateRangeBySelectionWithCoord(selectionWthCoord, sk, animate = false) {
2304
+ const previousRange = this._animatedRange ?? this.getRange();
2305
+ const targetRange = selectionWthCoord.rangeWithCoord;
2306
+ const rangeChanged = !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;
2307
+ if (animate || rangeChanged || selectionWthCoord.primaryWithCoord === null) this._stopMoveAnimation();
2277
2308
  if (sk) {
2278
2309
  this._rowHeaderWidth = sk.rowHeaderWidth;
2279
2310
  this._columnHeaderHeight = sk.columnHeaderHeight;
@@ -2284,6 +2315,47 @@ var SelectionControl = class extends Disposable {
2284
2315
  this._showAutoFill = selectionWthCoord.primaryWithCoord !== null;
2285
2316
  this._updateLayoutOfSelectionControl(selectionWthCoord.style);
2286
2317
  this._updateControlCoord();
2318
+ if (animate && rangeChanged && !window.matchMedia("(prefers-reduced-motion: reduce)").matches) this._animateMove(previousRange);
2319
+ }
2320
+ _animateMove(from) {
2321
+ const target = this.getRange();
2322
+ const startedAt = Tools.now();
2323
+ const eventedShapes = this.selectionShapeGroup.getObjects().filter((shape) => shape.evented);
2324
+ eventedShapes.forEach((shape) => {
2325
+ shape.evented = false;
2326
+ });
2327
+ this._restoreMoveEvents = () => eventedShapes.forEach((shape) => {
2328
+ shape.evented = true;
2329
+ });
2330
+ this._animatedRange = from;
2331
+ this._updateLayoutOfSelectionControl();
2332
+ this._updateControlCoord();
2333
+ const frame = () => {
2334
+ const progress = Math.min(1, (Tools.now() - startedAt) / SELECTION_MOVE_DURATION);
2335
+ const eased = 1 - (1 - progress) ** 3;
2336
+ if (progress === 1) this._stopMoveAnimation();
2337
+ this._animatedRange = progress < 1 ? {
2338
+ ...target,
2339
+ startX: from.startX + (target.startX - from.startX) * eased,
2340
+ startY: from.startY + (target.startY - from.startY) * eased,
2341
+ endX: from.endX + (target.endX - from.endX) * eased,
2342
+ endY: from.endY + (target.endY - from.endY) * eased
2343
+ } : null;
2344
+ this._updateLayoutOfSelectionControl();
2345
+ this._updateControlCoord();
2346
+ this._moveAnimationFrame = progress < 1 ? requestNewFrame(frame) : -1;
2347
+ };
2348
+ this._moveAnimationFrame = requestNewFrame(frame);
2349
+ }
2350
+ _stopMoveAnimation() {
2351
+ var _this$_restoreMoveEve;
2352
+ if (this._moveAnimationFrame !== -1) {
2353
+ cancelRequestFrame(this._moveAnimationFrame);
2354
+ this._moveAnimationFrame = -1;
2355
+ }
2356
+ this._animatedRange = null;
2357
+ (_this$_restoreMoveEve = this._restoreMoveEvents) === null || _this$_restoreMoveEve === void 0 || _this$_restoreMoveEve.call(this);
2358
+ this._restoreMoveEvents = null;
2287
2359
  }
2288
2360
  /**
2289
2361
  * Update primary range.
@@ -2298,40 +2370,22 @@ var SelectionControl = class extends Disposable {
2298
2370
  this._selectionRenderModel.setCurrentCell(primaryCell);
2299
2371
  }
2300
2372
  clearHighlight() {
2373
+ this._stopMoveAnimation();
2301
2374
  this._showAutoFill = false;
2302
2375
  this._selectionRenderModel.clearCurrentCell();
2303
2376
  this._updateLayoutOfSelectionControl(this._currentStyle);
2377
+ this._updateControlCoord();
2304
2378
  }
2305
2379
  getScene() {
2306
2380
  return this._scene;
2307
2381
  }
2308
2382
  dispose() {
2309
- 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;
2310
- (_this$_leftBorder = this._leftBorder) === null || _this$_leftBorder === void 0 || _this$_leftBorder.dispose();
2311
- (_this$_rightBorder = this._rightBorder) === null || _this$_rightBorder === void 0 || _this$_rightBorder.dispose();
2312
- (_this$_topBorder = this._topBorder) === null || _this$_topBorder === void 0 || _this$_topBorder.dispose();
2313
- (_this$_bottomBorder = this._bottomBorder) === null || _this$_bottomBorder === void 0 || _this$_bottomBorder.dispose();
2314
- (_this$_backgroundCont = this._backgroundControlTop) === null || _this$_backgroundCont === void 0 || _this$_backgroundCont.dispose();
2315
- (_this$_backgroundCont2 = this._backgroundControlMiddleLeft) === null || _this$_backgroundCont2 === void 0 || _this$_backgroundCont2.dispose();
2316
- (_this$_backgroundCont3 = this._backgroundControlMiddleRight) === null || _this$_backgroundCont3 === void 0 || _this$_backgroundCont3.dispose();
2317
- (_this$_backgroundCont4 = this._backgroundControlBottom) === null || _this$_backgroundCont4 === void 0 || _this$_backgroundCont4.dispose();
2318
- this._autoFillControl.dispose();
2319
- (_this$_selectionShape = this._selectionShapeGroup) === null || _this$_selectionShape === void 0 || _this$_selectionShape.dispose();
2320
- (_this$_rowHeaderBackg = this._rowHeaderBackground) === null || _this$_rowHeaderBackg === void 0 || _this$_rowHeaderBackg.dispose();
2321
- (_this$_rowHeaderBorde = this._rowHeaderBorder) === null || _this$_rowHeaderBorde === void 0 || _this$_rowHeaderBorde.dispose();
2322
- (_this$_rowHeaderGroup = this._rowHeaderGroup) === null || _this$_rowHeaderGroup === void 0 || _this$_rowHeaderGroup.dispose();
2323
- (_this$_rowHeaderBackg2 = this._rowHeaderBackground) === null || _this$_rowHeaderBackg2 === void 0 || _this$_rowHeaderBackg2.dispose();
2324
- (_this$_columnHeaderBa = this._columnHeaderBackground) === null || _this$_columnHeaderBa === void 0 || _this$_columnHeaderBa.dispose();
2325
- (_this$_columnHeaderBo = this._columnHeaderBorder) === null || _this$_columnHeaderBo === void 0 || _this$_columnHeaderBo.dispose();
2326
- (_this$_columnHeaderGr = this._columnHeaderGroup) === null || _this$_columnHeaderGr === void 0 || _this$_columnHeaderGr.dispose();
2327
- (_this$_topLeftWidget = this._topLeftWidget) === null || _this$_topLeftWidget === void 0 || _this$_topLeftWidget.dispose();
2328
- (_this$_topCenterWidge = this._topCenterWidget) === null || _this$_topCenterWidge === void 0 || _this$_topCenterWidge.dispose();
2329
- (_this$_topRightWidget = this._topRightWidget) === null || _this$_topRightWidget === void 0 || _this$_topRightWidget.dispose();
2330
- (_this$_middleLeftWidg = this._middleLeftWidget) === null || _this$_middleLeftWidg === void 0 || _this$_middleLeftWidg.dispose();
2331
- (_this$_middleRightWid = this._middleRightWidget) === null || _this$_middleRightWid === void 0 || _this$_middleRightWid.dispose();
2332
- (_this$_bottomLeftWidg = this._bottomLeftWidget) === null || _this$_bottomLeftWidg === void 0 || _this$_bottomLeftWidg.dispose();
2333
- (_this$_bottomCenterWi = this._bottomCenterWidget) === null || _this$_bottomCenterWi === void 0 || _this$_bottomCenterWi.dispose();
2334
- (_this$_bottomRightWid = this._bottomRightWidget) === null || _this$_bottomRightWid === void 0 || _this$_bottomRightWid.dispose();
2383
+ var _this$_controlExtensi;
2384
+ this._stopMoveAnimation();
2385
+ this._stopAntLineAnimation();
2386
+ this._selectionShapeGroup.dispose();
2387
+ this._rowHeaderGroup.dispose();
2388
+ this._columnHeaderGroup.dispose();
2335
2389
  (_this$_controlExtensi = this._controlExtension) === null || _this$_controlExtensi === void 0 || _this$_controlExtensi.dispose();
2336
2390
  super.dispose();
2337
2391
  this._dispose$.next(this);
@@ -2431,12 +2485,12 @@ var SelectionControl = class extends Disposable {
2431
2485
  this._rowHeaderGroup.makeDirty(true);
2432
2486
  }
2433
2487
  _updateBackgroundControl(style) {
2434
- const { startX, startY, endX, endY } = this._selectionRenderModel;
2488
+ const { startX, startY, endX, endY } = this._animatedRange ?? this._selectionRenderModel;
2435
2489
  const scale = this._getScale();
2436
2490
  const { fill = style.fill } = style;
2437
2491
  let { strokeWidth } = style;
2438
2492
  strokeWidth /= scale;
2439
- const highlightSelection = this._selectionRenderModel.highlightToSelection();
2493
+ const highlightSelection = this._animatedRange ?? this._selectionRenderModel.highlightToSelection();
2440
2494
  if (!highlightSelection) {
2441
2495
  this._backgroundControlTop.resize(endX - startX, endY - startY);
2442
2496
  this._backgroundControlTop.setProps({ fill });
@@ -2497,7 +2551,7 @@ var SelectionControl = class extends Disposable {
2497
2551
  this._backgroundControlBottom.setProps({ fill });
2498
2552
  }
2499
2553
  _updateWidgets(style) {
2500
- const { startX, startY, endX, endY } = this._selectionRenderModel;
2554
+ const { startX, startY, endX, endY } = this._animatedRange ?? this._selectionRenderModel;
2501
2555
  const { stroke = style.stroke, widgets = style.widgets, widgetStroke = style.widgetStroke } = style;
2502
2556
  const scale = this._getScale();
2503
2557
  let { widgetSize, widgetStrokeWidth } = style;
@@ -4621,6 +4675,19 @@ let SheetClipboardService = class SheetClipboardService extends Disposable {
4621
4675
  const start = pasteTarget.pastedRange.rows[0];
4622
4676
  const end = range.rows[range.rows.length - 1] - range.rows[0] + start;
4623
4677
  pasteTarget.pastedRange.rows = Array.from(new Array(end + 1).keys()).slice(start);
4678
+ if (!skipCellCopy) {
4679
+ if (!await this._injector.get(SheetInterceptorService).beforeCommandExecute({
4680
+ id: MoveRangeCommand.id,
4681
+ params: {
4682
+ fromUnitId: copyUnitId,
4683
+ fromSubUnitId: copySubUnitId,
4684
+ fromRange: discreteRangeToRange(range),
4685
+ toUnitId: target.unitId,
4686
+ toSubUnitId: target.subUnitId,
4687
+ toRange: discreteRangeToRange(pasteTarget.pastedRange)
4688
+ }
4689
+ })) return false;
4690
+ }
4624
4691
  }
4625
4692
  const pasteRes = this._pasteUSM({
4626
4693
  cellMatrix,
@@ -4779,14 +4846,18 @@ let SheetClipboardService = class SheetClipboardService extends Disposable {
4779
4846
  const pasteRangeStartColumn = cols[0];
4780
4847
  const pasteRangeEndColumn = cols[cols.length - 1];
4781
4848
  const needAutoHeight = [];
4782
- for (let r = pasteRangeStartRow; r <= pasteRangeEndRow; r++) if (!rowManager.getRow(r)) {
4783
- const autoHeight = skeleton.calculateAutoHeightInRange([{
4784
- startRow: r,
4785
- endRow: r,
4786
- startColumn: pasteRangeStartColumn,
4787
- endColumn: pasteRangeEndColumn
4788
- }]).filter((info) => info.autoHeight !== defaultRowHeight);
4789
- needAutoHeight.push(...autoHeight);
4849
+ for (let r = pasteRangeStartRow; r <= pasteRangeEndRow; r++) {
4850
+ const rowData = rowManager.getRow(r);
4851
+ const hasLegacyManualHeight = (rowData === null || rowData === void 0 ? void 0 : rowData.ia) == null && (rowData === null || rowData === void 0 ? void 0 : rowData.ah) == null && typeof (rowData === null || rowData === void 0 ? void 0 : rowData.h) === "number";
4852
+ if (!((rowData === null || rowData === void 0 ? void 0 : rowData.ia) === BooleanNumber.FALSE || hasLegacyManualHeight)) {
4853
+ const autoHeight = skeleton.calculateAutoHeightInRange([{
4854
+ startRow: r,
4855
+ endRow: r,
4856
+ startColumn: pasteRangeStartColumn,
4857
+ endColumn: pasteRangeEndColumn
4858
+ }]).filter((info) => info.autoHeight !== defaultRowHeight);
4859
+ needAutoHeight.push(...autoHeight);
4860
+ }
4790
4861
  }
4791
4862
  if (needAutoHeight.length > 0) {
4792
4863
  const setWorksheetRowAutoHeightMutationParams = {
@@ -6947,6 +7018,30 @@ const SetFirstColumnFrozenCommand = {
6947
7018
  }
6948
7019
  };
6949
7020
 
7021
+ //#endregion
7022
+ //#region src/config/config.ts
7023
+ const SHEETS_UI_PLUGIN_CONFIG_KEY = "sheets-ui.config";
7024
+ const configSymbol = Symbol(SHEETS_UI_PLUGIN_CONFIG_KEY);
7025
+ const defaultPluginConfig = {
7026
+ allowArrowKeyWrapOnSheetBoundary: true,
7027
+ formulaBar: true,
7028
+ protectedRangeShadow: true,
7029
+ maxAutoHeightCount: 1e3
7030
+ };
7031
+ /**
7032
+ * Convert the protectedRangeShadow config to shadow strategy
7033
+ * - true -> 'always'
7034
+ * - false -> 'none'
7035
+ * - string values remain unchanged
7036
+ * @param config The protectedRangeShadow config value
7037
+ * @returns The shadow strategy
7038
+ */
7039
+ function convertToShadowStrategy(config) {
7040
+ if (config === true) return "always";
7041
+ if (config === false) return "none";
7042
+ return config || "always";
7043
+ }
7044
+
6950
7045
  //#endregion
6951
7046
  //#region src/services/select-all/select-all.service.ts
6952
7047
  var SelectAllService = class extends Disposable {
@@ -7040,7 +7135,9 @@ const MoveSelectionCommand = {
7040
7135
  }
7041
7136
  }
7042
7137
  const startRange = getStartRange(range, primary, direction);
7043
- const next = jumpOver === 1 ? findNextGapRange(startRange, direction, worksheet) : findNextRange(startRange, direction, worksheet);
7138
+ const config = accessor.get(IConfigService).getConfig(SHEETS_UI_PLUGIN_CONFIG_KEY);
7139
+ const allowWrap = (config === null || config === void 0 ? void 0 : config.allowArrowKeyWrapOnSheetBoundary) ?? true;
7140
+ const next = jumpOver === 1 ? findNextGapRange(startRange, direction, worksheet) : findNextRange(startRange, direction, worksheet, void 0, true, 1, allowWrap);
7044
7141
  const destRange = getCellAtRowCol(next.startRow, next.startColumn, worksheet);
7045
7142
  if (Rectangle.equals(destRange, startRange)) return false;
7046
7143
  const unitId = workbook.getUnitId();
@@ -7163,13 +7260,7 @@ const MoveSelectionEnterAndTabCommand = {
7163
7260
  keycode: KeyCode.TAB
7164
7261
  });
7165
7262
  }
7166
- /**
7167
- * The start range is from the primary selection range.
7168
- * 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).
7169
- */
7170
- const isLastRowCell = keycode === KeyCode.ENTER && direction === Direction.DOWN && startRange.endRow === worksheet.getMaxRows() - 1;
7171
- const isLastColumnCell = keycode === KeyCode.TAB && direction === Direction.RIGHT && startRange.endColumn === worksheet.getMaxColumns() - 1;
7172
- const next = isLastRowCell || isLastColumnCell ? startRange : findNextRange(startRange, direction, worksheet);
7263
+ const next = findNextRange(startRange, direction, worksheet, void 0, true, 1, false);
7173
7264
  const destRange = getCellAtRowCol(next.startRow, next.startColumn, worksheet);
7174
7265
  if (Rectangle.equals(destRange, startRange)) return false;
7175
7266
  resultRange = {
@@ -7213,11 +7304,19 @@ const ExpandSelectionCommand = {
7213
7304
  const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
7214
7305
  if (!target) return false;
7215
7306
  const { worksheet, unitId, subUnitId } = target;
7216
- const selection = getSelectionsService(accessor).getCurrentLastSelection();
7307
+ const selectionsService = getSelectionsService(accessor, params.fromCurrentSelection);
7308
+ const selection = selectionsService.getCurrentLastSelection();
7217
7309
  if (!selection) return false;
7218
7310
  const { jumpOver, direction, extra } = params;
7219
7311
  let { range: startRange, primary } = selection;
7220
7312
  if (extra === "formula-editor") {
7313
+ if (params.fromCurrentSelection && primary) startRange = {
7314
+ startRow: primary.startRow,
7315
+ endRow: primary.endRow,
7316
+ startColumn: primary.startColumn,
7317
+ endColumn: primary.endColumn,
7318
+ rangeType: RANGE_TYPE.NORMAL
7319
+ };
7221
7320
  if (startRange.startRow === startRange.endRow && startRange.startColumn === startRange.endColumn) {
7222
7321
  const mergedCell = worksheet.getMergedCell(startRange.startRow, startRange.startColumn);
7223
7322
  if (mergedCell) startRange = {
@@ -7226,18 +7325,21 @@ const ExpandSelectionCommand = {
7226
7325
  };
7227
7326
  }
7228
7327
  if (!primary) {
7229
- const lastSelectionPrimary = getSelectionsService(accessor).getCurrentLastSelectionPrimaryCell();
7328
+ const lastSelectionPrimary = selectionsService.getCurrentLastSelectionPrimaryCell();
7230
7329
  if (lastSelectionPrimary && Rectangle.contains(startRange, lastSelectionPrimary)) primary = lastSelectionPrimary;
7231
7330
  }
7232
7331
  }
7233
- const destRange = !checkIfShrink({
7332
+ const isShrink = checkIfShrink({
7234
7333
  range: startRange,
7235
7334
  primary
7236
- }, direction, worksheet) ? jumpOver === 1 ? expandToNextGapRange(startRange, direction, worksheet) : expandToNextCell(startRange, direction, worksheet) : jumpOver === 1 ? shrinkToNextGapRange(startRange, {
7335
+ }, direction, worksheet);
7336
+ let destRange;
7337
+ if (isShrink) destRange = jumpOver === 1 ? shrinkToNextGapRange(startRange, {
7237
7338
  ...Rectangle.clone(primary),
7238
7339
  rangeType: RANGE_TYPE.NORMAL
7239
7340
  }, direction, worksheet) : shrinkToNextCell(startRange, direction, worksheet);
7240
- destRange.rangeType = selection.range.rangeType;
7341
+ else destRange = jumpOver === 1 ? expandToNextGapRange(startRange, direction, worksheet) : expandToNextCell(startRange, direction, worksheet);
7342
+ destRange.rangeType = startRange.rangeType;
7241
7343
  if (Rectangle.equals(destRange, startRange)) return false;
7242
7344
  return accessor.get(ICommandService).syncExecuteCommand(SetSelectionsOperation.id, {
7243
7345
  unitId,
@@ -8288,7 +8390,7 @@ let EditorBridgeService = class EditorBridgeService extends Disposable {
8288
8390
  }
8289
8391
  refreshEditCellPosition(resetSizeOnly) {
8290
8392
  if (!this._currentEditCell || !this._currentEditCellState) return;
8291
- const { unitId, sheetId, primary, scene, engine } = this._currentEditCell;
8393
+ const { unitId, sheetId, primary: selectedCell, scene, engine } = this._currentEditCell;
8292
8394
  const workbook = this._getWorkbookForEditUnit(unitId);
8293
8395
  if (!workbook || workbook.getUnitId() !== unitId) return;
8294
8396
  const worksheet = workbook.getActiveSheet();
@@ -8296,6 +8398,7 @@ let EditorBridgeService = class EditorBridgeService extends Disposable {
8296
8398
  if (!this._renderManagerService.getRenderUnitById(unitId)) return;
8297
8399
  const skeleton = this._sheetSkeletonService.getSkeleton(unitId, sheetId);
8298
8400
  if (!skeleton) return;
8401
+ const primary = worksheet.getCellInfoInMergeData(selectedCell.actualRow, selectedCell.actualColumn);
8299
8402
  const primaryWithCoord = attachPrimaryWithCoord(skeleton, primary);
8300
8403
  const actualRangeWithCoord = convertCellToRange(primaryWithCoord);
8301
8404
  const canvasOffset = getCanvasOffsetByEngine(engine);
@@ -8393,7 +8496,7 @@ let EditorBridgeService = class EditorBridgeService extends Disposable {
8393
8496
  getLatestEditCellState() {
8394
8497
  var _documentLayoutObject, _documentLayoutObject2;
8395
8498
  if (!this._currentEditCell) return;
8396
- const { unitId, sheetId, primary, scene, engine } = this._currentEditCell;
8499
+ const { unitId, sheetId, primary: selectedCell, scene, engine } = this._currentEditCell;
8397
8500
  const workbook = this._getWorkbookForEditUnit(unitId);
8398
8501
  if (!workbook || workbook.getUnitId() !== unitId) return;
8399
8502
  const worksheet = workbook.getActiveSheet();
@@ -8401,6 +8504,7 @@ let EditorBridgeService = class EditorBridgeService extends Disposable {
8401
8504
  if (!this._renderManagerService.getRenderUnitById(unitId)) return;
8402
8505
  const skeleton = this._sheetSkeletonService.getSkeleton(unitId, sheetId);
8403
8506
  if (!skeleton) return;
8507
+ const primary = worksheet.getCellInfoInMergeData(selectedCell.actualRow, selectedCell.actualColumn);
8404
8508
  const { startRow, startColumn } = primary;
8405
8509
  const primaryWithCoord = attachPrimaryWithCoord(skeleton, primary);
8406
8510
  const actualRangeWithCoord = convertCellToRange(primaryWithCoord);
@@ -8772,29 +8876,6 @@ const SetActivateCellEditOperation = {
8772
8876
  }
8773
8877
  };
8774
8878
 
8775
- //#endregion
8776
- //#region src/config/config.ts
8777
- const SHEETS_UI_PLUGIN_CONFIG_KEY = "sheets-ui.config";
8778
- const configSymbol = Symbol(SHEETS_UI_PLUGIN_CONFIG_KEY);
8779
- const defaultPluginConfig = {
8780
- formulaBar: true,
8781
- protectedRangeShadow: true,
8782
- maxAutoHeightCount: 1e3
8783
- };
8784
- /**
8785
- * Convert the protectedRangeShadow config to shadow strategy
8786
- * - true -> 'always'
8787
- * - false -> 'none'
8788
- * - string values remain unchanged
8789
- * @param config The protectedRangeShadow config value
8790
- * @returns The shadow strategy
8791
- */
8792
- function convertToShadowStrategy(config) {
8793
- if (config === true) return "always";
8794
- if (config === false) return "none";
8795
- return config || "always";
8796
- }
8797
-
8798
8879
  //#endregion
8799
8880
  //#region src/commands/operations/cell-edit.operation.ts
8800
8881
  const SetCellEditVisibleOperation = {
@@ -10973,27 +11054,6 @@ function generateArrowSelectionShortCutItem() {
10973
11054
  }
10974
11055
  });
10975
11056
  }
10976
- for (const [binding, macArrow, direction] of [[
10977
- KeyCode.HOME,
10978
- KeyCode.ARROW_LEFT,
10979
- Direction.LEFT
10980
- ], [
10981
- KeyCode.END,
10982
- KeyCode.ARROW_RIGHT,
10983
- Direction.RIGHT
10984
- ]]) for (const extend of [false, true]) {
10985
- const shift = extend ? MetaKeys.SHIFT : 0;
10986
- shortcutList.push({
10987
- id: extend ? MoveSelectionOperation.id : MoveCursorOperation.id,
10988
- binding: binding | shift,
10989
- mac: macArrow | MetaKeys.CTRL_COMMAND | shift,
10990
- preconditions: whenEditorDidNotInputFormulaActivated,
10991
- staticParameters: {
10992
- direction,
10993
- granularity: "line"
10994
- }
10995
- });
10996
- }
10997
11057
  return shortcutList;
10998
11058
  }
10999
11059
  const StartEditWithF2Shortcut = {
@@ -11394,14 +11454,15 @@ function getPercentOffset(editCellState, dataStream) {
11394
11454
  }
11395
11455
  function getPercentEditorSelection(editCellState, visibleParam, dataStream) {
11396
11456
  const percentOffset = getPercentOffset(editCellState, dataStream);
11397
- if (percentOffset == null) return null;
11398
- const { eventType, initialValue, keycode } = visibleParam;
11399
- if (eventType === DeviceInputEventType.Dblclick || eventType === DeviceInputEventType.Keyboard && keycode === KeyCode.F2) return {
11457
+ if (percentOffset == null || visibleParam.eventType !== DeviceInputEventType.Keyboard) return null;
11458
+ const { initialValue, keycode } = visibleParam;
11459
+ if (isFormulaString(dataStream) && keycode === KeyCode.F2) return null;
11460
+ if (keycode === KeyCode.F2) return {
11400
11461
  startOffset: percentOffset,
11401
11462
  endOffset: percentOffset,
11402
11463
  collapsed: true
11403
11464
  };
11404
- if (eventType !== DeviceInputEventType.Keyboard || keycode === KeyCode.BACKSPACE || keycode === KeyCode.DELETE || !/^\d/.test(initialValue ?? "")) return null;
11465
+ if (keycode === KeyCode.BACKSPACE || keycode === KeyCode.DELETE || !/^\d/.test(initialValue ?? "")) return null;
11405
11466
  return {
11406
11467
  startOffset: 0,
11407
11468
  endOffset: percentOffset,
@@ -11586,28 +11647,38 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11586
11647
  */
11587
11648
  _commandExecutedListener(d) {
11588
11649
  d.add(this._commandService.beforeCommandExecuted((command) => {
11589
- var _this$_getDocumentDat;
11590
- if (command.id !== InsertTextCommand.id) return;
11591
- const params = command.params;
11650
+ var _this$_getDocumentDat, _pasteParams$doc$body, _this$_textSelectionM;
11651
+ if (command.id !== InsertTextCommand.id && command.id !== InnerPasteCommand.id) return;
11652
+ const insertParams = command.id === InsertTextCommand.id ? command.params : null;
11653
+ const pasteParams = command.id === InnerPasteCommand.id ? command.params : null;
11654
+ const unitId = (insertParams === null || insertParams === void 0 ? void 0 : insertParams.unitId) ?? (pasteParams === null || pasteParams === void 0 ? void 0 : pasteParams.unitId);
11592
11655
  const visibleParam = this._editorBridgeService.isVisible();
11593
11656
  const editCellState = this._editorBridgeService.getEditLocation();
11594
- if (params.unitId !== DOCS_NORMAL_EDITOR_UNIT_ID_KEY || !visibleParam.visible || editCellState == null) return;
11657
+ if (unitId !== DOCS_NORMAL_EDITOR_UNIT_ID_KEY || !visibleParam.visible || editCellState == null) return;
11595
11658
  const dataStream = (_this$_getDocumentDat = this._getDocumentDataModel()) === null || _this$_getDocumentDat === void 0 || (_this$_getDocumentDat = _this$_getDocumentDat.getBody()) === null || _this$_getDocumentDat === void 0 ? void 0 : _this$_getDocumentDat.dataStream;
11596
11659
  if (dataStream == null) return;
11597
11660
  const percentOffset = getPercentOffset(editCellState, dataStream);
11598
- if (percentOffset != null && !this._editorBridgeService.getEditorDirty() && visibleParam.eventType === DeviceInputEventType.Keyboard && /^\d/.test(visibleParam.initialValue ?? "") && /^\d/.test(params.body.dataStream)) {
11599
- params.range = {
11600
- startOffset: 0,
11601
- endOffset: percentOffset,
11661
+ if (percentOffset == null) return;
11662
+ if (insertParams && !this._editorBridgeService.getEditorDirty() && visibleParam.eventType === DeviceInputEventType.Keyboard && /^\d/.test(visibleParam.initialValue ?? "") && /^\d/.test(insertParams.body.dataStream)) insertParams.range = {
11663
+ startOffset: 0,
11664
+ endOffset: percentOffset + (insertParams.body.dataStream.endsWith("%") ? 1 : 0),
11665
+ collapsed: false
11666
+ };
11667
+ const selectionParams = {
11668
+ unitId,
11669
+ subUnitId: unitId
11670
+ };
11671
+ const ranges = insertParams ? [insertParams.range] : this._textSelectionManagerService.getTextRanges(selectionParams);
11672
+ const input = (insertParams === null || insertParams === void 0 ? void 0 : insertParams.body.dataStream) ?? (pasteParams === null || pasteParams === void 0 || (_pasteParams$doc$body = pasteParams.doc.body) === null || _pasteParams$doc$body === void 0 ? void 0 : _pasteParams$doc$body.dataStream);
11673
+ if (!isFormulaString(dataStream) && (input === null || input === void 0 ? void 0 : input.endsWith("%")) && (ranges === null || ranges === void 0 ? void 0 : ranges.length) === 1 && ranges[0].endOffset === percentOffset && (!pasteParams || !((_this$_textSelectionM = this._textSelectionManagerService.getRectRanges(selectionParams)) === null || _this$_textSelectionM === void 0 ? void 0 : _this$_textSelectionM.length))) {
11674
+ const range = {
11675
+ ...ranges[0],
11676
+ endOffset: percentOffset + 1,
11602
11677
  collapsed: false
11603
11678
  };
11604
- return;
11679
+ if (insertParams) insertParams.range = range;
11680
+ else if (pasteParams) pasteParams.selections = [range];
11605
11681
  }
11606
- if (percentOffset != null && params.body.dataStream === "%" && params.range.collapsed && params.range.startOffset === percentOffset && params.range.endOffset === percentOffset) params.range = {
11607
- ...params.range,
11608
- endOffset: percentOffset + 1,
11609
- collapsed: false
11610
- };
11611
11682
  }));
11612
11683
  d.add(this._commandService.onCommandExecuted((command) => {
11613
11684
  if (command.id === RichTextEditingMutation.id) {
@@ -11641,7 +11712,7 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11641
11712
  }));
11642
11713
  }
11643
11714
  _handleEditorVisible(param) {
11644
- var _this$_sheetCellEdito4, _documentDataModel$ge, _this$_renderManagerS5;
11715
+ var _documentDataModel$ge, _this$_renderManagerS6;
11645
11716
  const { eventType, keycode } = param;
11646
11717
  this._cursorChange = eventType === DeviceInputEventType.PointerDown || eventType === DeviceInputEventType.Dblclick ? 2 : 1;
11647
11718
  const editCellState = this._editorBridgeService.getEditLocation();
@@ -11660,21 +11731,25 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11660
11731
  this._editorBridgeService.refreshEditCellPosition(false);
11661
11732
  const editorObject = this._getEditorObject();
11662
11733
  if (editorObject == null) return;
11663
- const { document, scene } = editorObject;
11734
+ const { document } = editorObject;
11664
11735
  this._contextService.setContextValue(EDITOR_ACTIVATED, true);
11665
11736
  const documentDataModel = this._getDocumentDataModel();
11666
11737
  const skeleton = this._getEditorSkeleton(DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
11667
11738
  if (!skeleton || !documentDataModel) return;
11668
- (_this$_sheetCellEdito4 = this._sheetCellEditorResizeService) === null || _this$_sheetCellEdito4 === void 0 || _this$_sheetCellEdito4.fitTextSize(() => {
11669
- const viewMain = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
11670
- viewMain === null || viewMain === void 0 || viewMain.scrollToViewportPos({
11671
- viewportScrollX: Number.POSITIVE_INFINITY,
11672
- viewportScrollY: Number.POSITIVE_INFINITY
11673
- });
11674
- });
11739
+ this._resizeEditorOnOpen(param, editorObject, !!isInArrayFormulaRange);
11675
11740
  const clearAndEdit = () => {
11741
+ const resetPointerSelection = isInArrayFormulaRange && eventType === DeviceInputEventType.PointerDown;
11742
+ const editorId = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) ? DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY : this._editorBridgeService.getCurrentEditorId();
11743
+ if (resetPointerSelection) {
11744
+ var _this$_renderManagerS5;
11745
+ (_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS5 === void 0 || _this$_renderManagerS5.with(DocSelectionRenderService).cancelPointerSelection();
11746
+ }
11676
11747
  this._emptyDocumentDataModel(documentDataModel.getSnapshot().documentStyle, !!isInArrayFormulaRange);
11677
11748
  document.makeDirty();
11749
+ if (resetPointerSelection) {
11750
+ var _this$_getEditorSkele;
11751
+ (_this$_getEditorSkele = this._getEditorSkeleton(editorId)) === null || _this$_getEditorSkele === void 0 || _this$_getEditorSkele.calculate();
11752
+ }
11678
11753
  if (keycode === KeyCode.BACKSPACE || eventType === DeviceInputEventType.Dblclick) {
11679
11754
  skeleton.calculate();
11680
11755
  this._editorBridgeService.changeEditorDirty(true);
@@ -11686,6 +11761,27 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11686
11761
  unitId: DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
11687
11762
  subUnitId: DOCS_NORMAL_EDITOR_UNIT_ID_KEY
11688
11763
  });
11764
+ if (resetPointerSelection && editorId !== DOCS_NORMAL_EDITOR_UNIT_ID_KEY) {
11765
+ const selectionTarget = {
11766
+ unitId: editorId,
11767
+ subUnitId: editorId
11768
+ };
11769
+ const previousSelection = this._textSelectionManagerService.getSelectionInfo(selectionTarget);
11770
+ this._textSelectionManagerService.replaceSelectionInfoWithoutRefresh({
11771
+ textRanges: [{
11772
+ startOffset: 0,
11773
+ endOffset: 0,
11774
+ collapsed: true,
11775
+ isActive: true
11776
+ }],
11777
+ rectRanges: [],
11778
+ segmentId: "",
11779
+ segmentPage: -1,
11780
+ style: (previousSelection === null || previousSelection === void 0 ? void 0 : previousSelection.style) ?? NORMAL_TEXT_SELECTION_PLUGIN_STYLE,
11781
+ isEditing: true
11782
+ }, selectionTarget);
11783
+ this._textSelectionManagerService.refreshSelection(selectionTarget, true);
11784
+ }
11689
11785
  };
11690
11786
  const replaceSelection = (selection) => {
11691
11787
  this._textSelectionManagerService.replaceDocRanges([selection], {
@@ -11696,36 +11792,54 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11696
11792
  const percentSelection = getPercentEditorSelection(editCellState, param, (_documentDataModel$ge = documentDataModel.getBody()) === null || _documentDataModel$ge === void 0 ? void 0 : _documentDataModel$ge.dataStream);
11697
11793
  const cellImage = isCellImage(documentDataModel.getSnapshot());
11698
11794
  this._submitEmptyCellImageEdit = cellImage && eventType === DeviceInputEventType.Keyboard && keycode === KeyCode.BACKSPACE;
11699
- if (cellImage) clearAndEdit();
11795
+ if (cellImage || isInArrayFormulaRange) clearAndEdit();
11700
11796
  else if (eventType === DeviceInputEventType.Keyboard && keycode === KeyCode.F2) {
11701
11797
  var _documentDataModel$ge2;
11702
11798
  document.makeDirty();
11703
- this._textSelectionManagerService.replaceDocRanges([{
11799
+ replaceSelection({
11704
11800
  startOffset: 0,
11705
- endOffset: 0
11706
- }]);
11801
+ endOffset: 0,
11802
+ collapsed: true
11803
+ });
11707
11804
  const endOffset = (((_documentDataModel$ge2 = documentDataModel.getBody()) === null || _documentDataModel$ge2 === void 0 ? void 0 : _documentDataModel$ge2.dataStream.length) ?? 2) - 2;
11708
- if (percentSelection) replaceSelection(percentSelection);
11709
- else this._textSelectionManagerService.replaceDocRanges([{
11805
+ replaceSelection(percentSelection ?? {
11710
11806
  startOffset: endOffset,
11711
- endOffset
11712
- }], {
11713
- unitId: DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
11714
- subUnitId: DOCS_NORMAL_EDITOR_UNIT_ID_KEY
11807
+ endOffset,
11808
+ collapsed: true
11715
11809
  });
11716
- } else if (eventType === DeviceInputEventType.Keyboard || eventType === DeviceInputEventType.Dblclick && isInArrayFormulaRange) {
11810
+ } else if (eventType === DeviceInputEventType.Keyboard) {
11717
11811
  if (percentSelection) replaceSelection(percentSelection);
11718
11812
  else clearAndEdit();
11719
11813
  } else if (eventType === DeviceInputEventType.Dblclick) {
11720
11814
  if (this._contextService.getContextValue(FOCUSING_EDITOR_INPUT_FORMULA)) return;
11721
- const cursor = documentDataModel.getBody().dataStream.length - 2 || 0;
11722
- if (percentSelection) replaceSelection(percentSelection);
11723
- else this._textSelectionManagerService.replaceDocRanges([{
11724
- startOffset: cursor,
11725
- endOffset: cursor
11726
- }]);
11815
+ const dataStream = documentDataModel.getBody().dataStream;
11816
+ const endOffset = (!isFormulaString(dataStream) ? getPercentOffset(editCellState, dataStream) : null) ?? dataStream.length - 2;
11817
+ replaceSelection({
11818
+ startOffset: endOffset,
11819
+ endOffset,
11820
+ collapsed: true
11821
+ });
11727
11822
  }
11728
- (_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS5 === void 0 || _this$_renderManagerS5.scene.resetCursor();
11823
+ (_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS6 === void 0 || _this$_renderManagerS6.scene.resetCursor();
11824
+ }
11825
+ _resizeEditorOnOpen(param, editorObject, isInArrayFormulaRange) {
11826
+ var _this$_sheetCellEdito4;
11827
+ const pointerPosition = param.eventType === DeviceInputEventType.Dblclick ? param.pointerPosition : void 0;
11828
+ (_this$_sheetCellEdito4 = this._sheetCellEditorResizeService) === null || _this$_sheetCellEdito4 === void 0 || _this$_sheetCellEdito4.fitTextSize(() => {
11829
+ var _scene$getViewport;
11830
+ if (pointerPosition && this._editorBridgeService.isVisible() !== param) return;
11831
+ const { engine, scene } = editorObject;
11832
+ (_scene$getViewport = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN)) === null || _scene$getViewport === void 0 || _scene$getViewport.scrollToViewportPos({
11833
+ viewportScrollX: pointerPosition ? 0 : Number.POSITIVE_INFINITY,
11834
+ viewportScrollY: pointerPosition ? 0 : Number.POSITIVE_INFINITY
11835
+ });
11836
+ if (!pointerPosition || isInArrayFormulaRange) return;
11837
+ const rect = engine.getCanvasElement().getBoundingClientRect();
11838
+ if (rect.width > 0 && rect.height > 0) {
11839
+ var _this$_renderManagerS7;
11840
+ (_this$_renderManagerS7 = this._renderManagerService.getRenderUnitById(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS7 === void 0 || _this$_renderManagerS7.with(DocSelectionRenderService).setCursorManually((pointerPosition.x - rect.left) * engine.width / rect.width, (pointerPosition.y - rect.top) * engine.height / rect.height, true, true, { strict: false });
11841
+ }
11842
+ });
11729
11843
  }
11730
11844
  _cacheEmptyCellTextStyle() {
11731
11845
  var _this$_editorBridgeSe, _sourceBody$textRuns;
@@ -11858,8 +11972,8 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11858
11972
  const editorUnitId = this._editorBridgeService.getCurrentEditorId();
11859
11973
  if (editorUnitId == null || !this._editorService.isSheetEditor(editorUnitId)) return;
11860
11974
  if (editorUnitId === DOCS_NORMAL_EDITOR_UNIT_ID_KEY) {
11861
- var _this$_getEditorSkele;
11862
- (_this$_getEditorSkele = this._getEditorSkeleton(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_getEditorSkele === void 0 || _this$_getEditorSkele.resetInitialWidth();
11975
+ var _this$_getEditorSkele2;
11976
+ (_this$_getEditorSkele2 = this._getEditorSkeleton(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_getEditorSkele2 === void 0 || _this$_getEditorSkele2.resetInitialWidth();
11863
11977
  }
11864
11978
  this._clearEditorHistory();
11865
11979
  }
@@ -11925,12 +12039,12 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11925
12039
  return this._univerInstanceService.getUnit(DOCS_NORMAL_EDITOR_UNIT_ID_KEY, UniverInstanceType.UNIVER_DOC);
11926
12040
  }
11927
12041
  _getEditorSkeleton(editorId) {
11928
- var _this$_renderManagerS6;
11929
- return (_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS6 === void 0 ? void 0 : _this$_renderManagerS6.with(DocSkeletonManagerService).getSkeleton();
12042
+ var _this$_renderManagerS8;
12043
+ return (_this$_renderManagerS8 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS8 === void 0 ? void 0 : _this$_renderManagerS8.with(DocSkeletonManagerService).getSkeleton();
11930
12044
  }
11931
12045
  _getEditorViewModel(editorId) {
11932
- var _this$_renderManagerS7;
11933
- return (_this$_renderManagerS7 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS7 === void 0 ? void 0 : _this$_renderManagerS7.with(DocSkeletonManagerService).getViewModel();
12046
+ var _this$_renderManagerS9;
12047
+ return (_this$_renderManagerS9 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS9 === void 0 ? void 0 : _this$_renderManagerS9.with(DocSkeletonManagerService).getViewModel();
11934
12048
  }
11935
12049
  _getEditingUnit() {
11936
12050
  return this._editingUnit ? this._univerInstanceService.getUnit(this._editingUnit, UniverInstanceType.UNIVER_SHEET) : null;
@@ -13901,14 +14015,15 @@ let HoverManagerService = class HoverManagerService extends Disposable {
13901
14015
  location: getLocationBase(activeCell.location)
13902
14016
  });
13903
14017
  }
13904
- triggerDbClick(unitId, offsetX, offsetY) {
14018
+ triggerDbClick(unitId, event) {
13905
14019
  const deps = this._getCalcDeps(unitId);
13906
14020
  if (!deps) return;
13907
14021
  const { currentRender, workbook, worksheet, skeletonParam } = deps;
13908
- const activeCell = this._calcActiveCell(currentRender, workbook, worksheet, skeletonParam, offsetX, offsetY);
14022
+ const activeCell = this._calcActiveCell(currentRender, workbook, worksheet, skeletonParam, event.offsetX, event.offsetY);
13909
14023
  if (activeCell) this._currentDbClickedCell$.next({
13910
14024
  ...activeCell,
13911
- location: getLocationBase(activeCell.location)
14025
+ location: getLocationBase(activeCell.location),
14026
+ event
13912
14027
  });
13913
14028
  }
13914
14029
  triggerScroll() {
@@ -13978,7 +14093,7 @@ let HoverRenderController = class HoverRenderController extends Disposable {
13978
14093
  if (!skeletonParam) return;
13979
14094
  const { mainComponent, unitId, components } = this._context;
13980
14095
  if (!mainComponent) return;
13981
- disposeSet.add(mainComponent.onPointerEnter$.subscribeEvent((evt) => {
14096
+ disposeSet.add(mainComponent.onPointerEnter$.subscribeEvent(() => {
13982
14097
  this._active = true;
13983
14098
  }));
13984
14099
  disposeSet.add(fromEventSubject(mainComponent.onPointerMove$).subscribe((evt) => {
@@ -13995,7 +14110,7 @@ let HoverRenderController = class HoverRenderController extends Disposable {
13995
14110
  this._hoverManagerService.triggerClick(unitId, evt.offsetX, evt.offsetY);
13996
14111
  }));
13997
14112
  disposeSet.add(mainComponent.onDblclick$.subscribeEvent((evt) => {
13998
- this._hoverManagerService.triggerDbClick(unitId, evt.offsetX, evt.offsetY);
14113
+ this._hoverManagerService.triggerDbClick(unitId, evt);
13999
14114
  }));
14000
14115
  disposeSet.add(mainComponent.onPointerLeave$.subscribeEvent(() => {
14001
14116
  this._active = false;
@@ -17188,6 +17303,10 @@ const MoveRangeConfirmCommand = {
17188
17303
  id: "sheet.command.move-range-confirm",
17189
17304
  handler: async (accessor, params) => {
17190
17305
  if (!params) return false;
17306
+ if (!await accessor.get(SheetInterceptorService).beforeCommandExecute({
17307
+ id: MoveRangeCommand.id,
17308
+ params
17309
+ })) return false;
17191
17310
  const commandService = accessor.get(ICommandService);
17192
17311
  const univerInstanceService = accessor.get(IUniverInstanceService);
17193
17312
  const sourceTarget = getSheetCommandTarget(univerInstanceService, {
@@ -19184,7 +19303,7 @@ function WrapTextMenuItemFactory(accessor) {
19184
19303
  const disposable = accessor.get(ICommandService).onCommandExecuted((c) => {
19185
19304
  var _selectionManagerServ14;
19186
19305
  const id = c.id;
19187
- if (id !== SetTextWrapCommand.id && id !== SetSelectionsOperation.id && id !== SetWorksheetActiveOperation.id) return;
19306
+ if (id !== SetRangeValuesMutation.id && id !== SetSelectionsOperation.id && id !== SetWorksheetActiveOperation.id) return;
19188
19307
  const primary = (_selectionManagerServ14 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ14 === void 0 ? void 0 : _selectionManagerServ14.primary;
19189
19308
  let tb;
19190
19309
  if (primary != null) {
@@ -19216,33 +19335,34 @@ function ShrinkToFitMenuItemFactory(accessor) {
19216
19335
  const commandService = accessor.get(ICommandService);
19217
19336
  const univerInstanceService = accessor.get(IUniverInstanceService);
19218
19337
  const selectionManagerService = accessor.get(SheetsSelectionsService);
19338
+ const style$ = deriveStateFromActiveSheet$(univerInstanceService, {}, ({ worksheet }) => new Observable((subscriber) => {
19339
+ const update = () => {
19340
+ var _selectionManagerServ16;
19341
+ const primary = (_selectionManagerServ16 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ16 === void 0 ? void 0 : _selectionManagerServ16.primary;
19342
+ subscriber.next(primary != null ? worksheet.getComposedCellStyle(primary.startRow, primary.startColumn) ?? {} : {});
19343
+ };
19344
+ const disposable = commandService.onCommandExecuted((command) => {
19345
+ if ([
19346
+ SetRangeValuesMutation.id,
19347
+ SetSelectionsOperation.id,
19348
+ SetWorksheetActiveOperation.id
19349
+ ].includes(command.id)) update();
19350
+ });
19351
+ update();
19352
+ return disposable.dispose;
19353
+ }));
19219
19354
  return {
19220
19355
  id: SetShrinkToFitCommand.id,
19221
19356
  type: MenuItemType.BUTTON,
19222
19357
  icon: "ShrinkToFitIcon",
19223
19358
  title: "sheets-ui.toolbar.shrinkToFit",
19224
19359
  tooltip: "sheets-ui.toolbar.shrinkToFit",
19225
- activated$: deriveStateFromActiveSheet$(univerInstanceService, false, ({ worksheet }) => new Observable((subscriber) => {
19226
- const update = () => {
19227
- var _selectionManagerServ16, _worksheet$getCompose;
19228
- const primary = (_selectionManagerServ16 = selectionManagerService.getCurrentLastSelection()) === null || _selectionManagerServ16 === void 0 ? void 0 : _selectionManagerServ16.primary;
19229
- subscriber.next(primary != null && ((_worksheet$getCompose = worksheet.getComposedCellStyle(primary.startRow, primary.startColumn)) === null || _worksheet$getCompose === void 0 ? void 0 : _worksheet$getCompose.stf) === BooleanNumber.TRUE);
19230
- };
19231
- const disposable = commandService.onCommandExecuted((command) => {
19232
- if ([
19233
- SetRangeValuesMutation.id,
19234
- SetSelectionsOperation.id,
19235
- SetWorksheetActiveOperation.id
19236
- ].includes(command.id)) update();
19237
- });
19238
- update();
19239
- return disposable.dispose;
19240
- })),
19241
- disabled$: getCurrentRangeDisable$(accessor, {
19360
+ activated$: style$.pipe(map((style) => style.stf === BooleanNumber.TRUE && style.tb !== WrapStrategy.WRAP)),
19361
+ disabled$: combineLatest([getCurrentRangeDisable$(accessor, {
19242
19362
  workbookTypes: [WorkbookEditablePermission],
19243
19363
  worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission],
19244
19364
  rangeTypes: [RangeProtectionPermissionEditPoint]
19245
- }),
19365
+ }), style$]).pipe(map(([disabled, style]) => disabled || style.tb === WrapStrategy.WRAP)),
19246
19366
  hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET)
19247
19367
  };
19248
19368
  }
@@ -19400,6 +19520,15 @@ function PasteSpacialMenuItemFactory(accessor) {
19400
19520
  hidden$: getObservableWithExclusiveRange$(accessor, getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET))
19401
19521
  };
19402
19522
  }
19523
+ const PASTE_RIBBON_MENU_ID = "sheet.menu.paste";
19524
+ function PasteRibbonMenuItemFactory(accessor) {
19525
+ return {
19526
+ ...PasteSpacialMenuItemFactory(accessor),
19527
+ id: PASTE_RIBBON_MENU_ID,
19528
+ title: "sheets-ui.rightClick.paste",
19529
+ hidden$: combineLatest([getObservableWithExclusiveRange$(accessor, getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET)), accessor.get(IContextService).subscribeContextValue$(FOCUSING_SHAPE_TEXT_EDITOR).pipe(startWith(false))]).pipe(map(([hidden, editing]) => hidden || editing))
19530
+ };
19531
+ }
19403
19532
  function PasteValueMenuItemFactory(accessor) {
19404
19533
  return {
19405
19534
  id: SheetPasteValueCommand.id,
@@ -20325,6 +20454,39 @@ function ZoomRatioMenuItemFactory(accessor) {
20325
20454
  //#region src/menu/schema.ts
20326
20455
  const menuSchema = {
20327
20456
  [RibbonPosition.START]: {
20457
+ [RibbonStartGroup.HISTORY]: { [PASTE_RIBBON_MENU_ID]: {
20458
+ order: 4,
20459
+ gridLayout: {
20460
+ row: 1,
20461
+ column: 3,
20462
+ rowSpan: 2,
20463
+ showLabel: true
20464
+ },
20465
+ menuItemFactory: PasteRibbonMenuItemFactory,
20466
+ [SheetPasteCommand.name]: {
20467
+ order: 0,
20468
+ menuItemFactory: (accessor) => ({
20469
+ ...PasteMenuItemFactory(accessor),
20470
+ icon: void 0
20471
+ })
20472
+ },
20473
+ [SheetPasteValueCommand.id]: {
20474
+ order: 1,
20475
+ menuItemFactory: PasteValueMenuItemFactory
20476
+ },
20477
+ [SheetPasteFormatCommand.id]: {
20478
+ order: 2,
20479
+ menuItemFactory: PasteFormatMenuItemFactory
20480
+ },
20481
+ [SheetPasteColWidthCommand.id]: {
20482
+ order: 3,
20483
+ menuItemFactory: PasteColWidthMenuItemFactory
20484
+ },
20485
+ [SheetPasteBesidesBorderCommand.id]: {
20486
+ order: 4,
20487
+ menuItemFactory: PasteBesidesBorderMenuItemFactory
20488
+ }
20489
+ } },
20328
20490
  [RibbonStartGroup.FORMAT]: {
20329
20491
  [SetRangeFontFamilyCommand.id]: {
20330
20492
  order: 1,
@@ -21051,14 +21213,12 @@ function useWorkbooks() {
21051
21213
 
21052
21214
  //#endregion
21053
21215
  //#region src/views/editor-container/focus-editor.ts
21054
- const SHEET_CELL_EDITOR_ELEMENT_ID = `__editor_${DOCS_NORMAL_EDITOR_UNIT_ID_KEY}`;
21055
- const SHEET_CELL_EDITOR_SELECTION_CONTAINER_ID = `univer-doc-selection-container-${DOCS_NORMAL_EDITOR_UNIT_ID_KEY}`;
21056
- function focusSheetCellEditorElement(ownerDocument = document) {
21057
- const element = ownerDocument.getElementById(SHEET_CELL_EDITOR_ELEMENT_ID);
21058
- if (element == null || ownerDocument.activeElement === element) return false;
21059
- if (!element.hasAttribute("tabindex")) element.tabIndex = -1;
21060
- element.focus({ preventScroll: true });
21061
- return ownerDocument.activeElement === element;
21216
+ function focusSheetCellEditorElement(editorService) {
21217
+ var _editorService$getEdi;
21218
+ const selection = (_editorService$getEdi = editorService.getEditor(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _editorService$getEdi === void 0 ? void 0 : _editorService$getEdi.docSelectionRenderService;
21219
+ if (!selection || selection.isFocusing) return false;
21220
+ selection.focus();
21221
+ return selection.isFocusing;
21062
21222
  }
21063
21223
  function registerSheetCellEditorRuntimePortal(options) {
21064
21224
  const ownerDocument = options.ownerDocument ?? (typeof document === "undefined" ? void 0 : document);
@@ -21071,8 +21231,10 @@ function registerSheetCellEditorRuntimePortal(options) {
21071
21231
  const frameHandles = [];
21072
21232
  let observer;
21073
21233
  const tryRegister = () => {
21234
+ var _options$editorServic;
21074
21235
  if (disposed) return;
21075
- const portalRoot = resolveSheetCellEditorPortalRoot(ownerDocument);
21236
+ const selection = (_options$editorServic = options.editorService.getEditor(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _options$editorServic === void 0 ? void 0 : _options$editorServic.docSelectionRenderService;
21237
+ const portalRoot = (selection === null || selection === void 0 ? void 0 : selection.selectionContainer.isConnected) ? selection.selectionContainer : null;
21076
21238
  if (portalRoot === registeredPortalRoot) return;
21077
21239
  portalRegistration === null || portalRegistration === void 0 || portalRegistration.dispose();
21078
21240
  portalRegistration = void 0;
@@ -21087,7 +21249,7 @@ function registerSheetCellEditorRuntimePortal(options) {
21087
21249
  role: "child-editor",
21088
21250
  element: portalRoot
21089
21251
  }));
21090
- const editorElement = ownerDocument.getElementById(SHEET_CELL_EDITOR_ELEMENT_ID);
21252
+ const editorElement = selection === null || selection === void 0 ? void 0 : selection.inputElement;
21091
21253
  if (editorElement && editorElement !== portalRoot) rootRegistration.add(options.focusCoordinator.registerElement({
21092
21254
  embedId: options.embedId,
21093
21255
  role: "child-editor",
@@ -21130,9 +21292,6 @@ function registerSheetCellEditorRuntimePortal(options) {
21130
21292
  }));
21131
21293
  return collection;
21132
21294
  }
21133
- function resolveSheetCellEditorPortalRoot(ownerDocument = document) {
21134
- return ownerDocument.getElementById(SHEET_CELL_EDITOR_SELECTION_CONTAINER_ID) ?? ownerDocument.getElementById(SHEET_CELL_EDITOR_ELEMENT_ID);
21135
- }
21136
21295
 
21137
21296
  //#endregion
21138
21297
  //#region src/views/editor-container/hooks.ts
@@ -21202,19 +21361,6 @@ const EDITOR_DEFAULT_POSITION = {
21202
21361
  };
21203
21362
  const CELL_EDITOR_DARK_SURFACE_THEME_COLOR = "gray.800";
21204
21363
  const CELL_EDITOR_LIGHT_SURFACE_THEME_COLOR = "gray.0";
21205
- /**
21206
- * @returns the host background color for the cell editor.
21207
- */
21208
- function getCellEditorHostBackgroundColor(editState, options = {}) {
21209
- var _options$getColorFrom;
21210
- const cellFill = editState === null || editState === void 0 ? void 0 : editState.documentLayoutObject.fill;
21211
- if (cellFill && !isTransparentColor(cellFill)) return cellFill;
21212
- 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);
21213
- }
21214
- function isTransparentColor(color) {
21215
- const normalizedColor = color.trim().toLowerCase().replace(/\s+/g, "");
21216
- return normalizedColor === "transparent" || normalizedColor === "rgba(0,0,0,0)";
21217
- }
21218
21364
  function shouldRefocusCellEditorAfterPointerDown(options) {
21219
21365
  const { root, target, activeElement, isEditorFocusing } = options;
21220
21366
  if (!root || !(target instanceof HTMLElement) || !(activeElement instanceof HTMLElement)) return true;
@@ -21279,10 +21425,13 @@ function EditorContainer({ hidden = false }) {
21279
21425
  const workbook = editState ? instanceService.getUnit(editState.unitId, UniverInstanceType.UNIVER_SHEET) ?? null : null;
21280
21426
  const activeSheet = useActiveWorksheet(workbook);
21281
21427
  const darkMode = useObservable(themeService.darkMode$, themeService.darkMode);
21428
+ const cellFill = editState === null || editState === void 0 ? void 0 : editState.documentLayoutObject.fill;
21429
+ const normalizedFill = cellFill === null || cellFill === void 0 ? void 0 : cellFill.trim().toLowerCase().replace(/\s+/g, "");
21430
+ 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);
21282
21431
  const [showEditCellAddress, setShowEditCellAddress] = useState(false);
21283
21432
  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;
21284
21433
  const editCellAddress = editState ? `${activeSheet && editSheetName && activeSheet.getSheetId() !== editState.sheetId ? `'${quoteSheetName(editSheetName)}'!` : ""}${numberToABC(editState.column)}${editState.row + 1}` : null;
21285
- const editorBorderColor = genNormalSelectionStyle(themeService).stroke;
21434
+ const { stroke: editorBorderColor, strokeWidth: editorBorderWidth } = genNormalSelectionStyle(themeService);
21286
21435
  const focusCoordinator = injector.has(ISheetEmbedRuntimeFocusCoordinator) ? injector.get(ISheetEmbedRuntimeFocusCoordinator) : void 0;
21287
21436
  const resolveRuntimeFocusState = () => {
21288
21437
  var _instanceService$getF;
@@ -21371,21 +21520,18 @@ function EditorContainer({ hidden = false }) {
21371
21520
  const focusCellEditorElement = () => {
21372
21521
  const scope = rootRef.current ? resolveSheetEmbedRuntimeDomScope(rootRef.current) ?? resolveActiveSheetEmbedRuntimeDomScope(ownerDocument) : resolveActiveSheetEmbedRuntimeDomScope(ownerDocument);
21373
21522
  if (shouldPreserveEmbedInteractiveFocus(scope === null || scope === void 0 ? void 0 : scope.embedId, ownerDocument)) return;
21374
- focusSheetCellEditorElement(ownerDocument);
21523
+ focusSheetCellEditorElement(editorService);
21375
21524
  if (delayedFocusTimer != null) ownerWindow.clearTimeout(delayedFocusTimer);
21376
21525
  delayedFocusTimer = ownerWindow.setTimeout(() => {
21377
21526
  delayedFocusTimer = void 0;
21378
21527
  if (shouldPreserveEmbedInteractiveFocus(scope === null || scope === void 0 ? void 0 : scope.embedId, ownerDocument)) return;
21379
- focusSheetCellEditorElement(ownerDocument);
21528
+ focusSheetCellEditorElement(editorService);
21380
21529
  }, 0);
21381
21530
  };
21382
21531
  const focusEditor = () => {
21383
21532
  if (contextService.getContextValue(FOCUSING_FX_BAR_EDITOR)) return;
21384
21533
  const scope = rootRef.current ? resolveSheetEmbedRuntimeDomScope(rootRef.current) ?? resolveActiveSheetEmbedRuntimeDomScope(ownerDocument) : resolveActiveSheetEmbedRuntimeDomScope(ownerDocument);
21385
21534
  if (shouldPreserveEmbedControlFocus(scope === null || scope === void 0 ? void 0 : scope.embedId, ownerDocument)) return;
21386
- const editor = editorService.getEditor(DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
21387
- const docSelectionRenderService = editor === null || editor === void 0 ? void 0 : editor.render.with(DocSelectionRenderService);
21388
- if (!(docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing)) docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
21389
21535
  focusCellEditorElement();
21390
21536
  };
21391
21537
  focusEditor();
@@ -21437,6 +21583,7 @@ function EditorContainer({ hidden = false }) {
21437
21583
  element: editorRoot
21438
21584
  }));
21439
21585
  collection.add(registerSheetCellEditorRuntimePortal({
21586
+ editorService,
21440
21587
  embedId: scope.embedId,
21441
21588
  ownerDocument: rootRef.current.ownerDocument,
21442
21589
  interactionBoundaryService,
@@ -21447,10 +21594,7 @@ function EditorContainer({ hidden = false }) {
21447
21594
  let pointerRetryFrame = 0;
21448
21595
  const focusEditor = () => {
21449
21596
  if (contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) || shouldPreserveEmbedControlFocus(scope.embedId, ownerDocument)) return;
21450
- const editor = editorService.getEditor(DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
21451
- const docSelectionRenderService = editor === null || editor === void 0 ? void 0 : editor.render.with(DocSelectionRenderService);
21452
- if (!(docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing)) docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
21453
- focusSheetCellEditorElement(ownerDocument);
21597
+ focusSheetCellEditorElement(editorService);
21454
21598
  };
21455
21599
  const refocusEditorAfterRuntimePointer = (event) => {
21456
21600
  if (!focusCoordinator.isChildUnitRuntimeEvent(scope.childUnitId, event.target, event) || isEmbedRuntimeEditorOrPopup(event.target)) return;
@@ -21485,6 +21629,7 @@ function EditorContainer({ hidden = false }) {
21485
21629
  const ownerDocument = ((_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.ownerDocument) ?? document;
21486
21630
  const interactionBoundaryService = injector.has(ISheetEmbedInteractionBoundaryService) ? injector.get(ISheetEmbedInteractionBoundaryService) : void 0;
21487
21631
  const portalRegistration = registerSheetCellEditorRuntimePortal({
21632
+ editorService,
21488
21633
  embedId: activeSessionScope.embedId,
21489
21634
  ownerDocument,
21490
21635
  interactionBoundaryService,
@@ -21494,12 +21639,12 @@ function EditorContainer({ hidden = false }) {
21494
21639
  let delayedFocusTimer;
21495
21640
  const focusCellEditorElement = () => {
21496
21641
  if (shouldPreserveEmbedInteractiveFocus(activeSessionScope.embedId, ownerDocument)) return;
21497
- focusSheetCellEditorElement(ownerDocument);
21642
+ focusSheetCellEditorElement(editorService);
21498
21643
  if (delayedFocusTimer != null) ownerWindow.clearTimeout(delayedFocusTimer);
21499
21644
  delayedFocusTimer = ownerWindow.setTimeout(() => {
21500
21645
  delayedFocusTimer = void 0;
21501
21646
  if (shouldPreserveEmbedInteractiveFocus(activeSessionScope.embedId, ownerDocument)) return;
21502
- focusSheetCellEditorElement(ownerDocument);
21647
+ focusSheetCellEditorElement(editorService);
21503
21648
  }, 0);
21504
21649
  };
21505
21650
  const focusHiddenEditor = () => {
@@ -21547,9 +21692,9 @@ function EditorContainer({ hidden = false }) {
21547
21692
  visible === null || visible === void 0 ? void 0 : visible.visible
21548
21693
  ]);
21549
21694
  useEffect(() => {
21695
+ var _rootRef$current3;
21696
+ const ownerWindow = (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.ownerDocument.defaultView;
21550
21697
  return () => {
21551
- var _rootRef$current3;
21552
- const ownerWindow = (_rootRef$current3 = rootRef.current) === null || _rootRef$current3 === void 0 ? void 0 : _rootRef$current3.ownerDocument.defaultView;
21553
21698
  if (ownerWindow && pointerRefocusTimerRef.current != null) ownerWindow.clearTimeout(pointerRefocusTimerRef.current);
21554
21699
  };
21555
21700
  }, []);
@@ -21571,12 +21716,11 @@ function EditorContainer({ hidden = false }) {
21571
21716
  if (pointerRefocusTimerRef.current != null) ownerWindow.clearTimeout(pointerRefocusTimerRef.current);
21572
21717
  pointerRefocusTimerRef.current = ownerWindow.setTimeout(() => {
21573
21718
  pointerRefocusTimerRef.current = void 0;
21574
- if (!(docSelectionRenderService === null || docSelectionRenderService === void 0 ? void 0 : docSelectionRenderService.isFocusing)) docSelectionRenderService === null || docSelectionRenderService === void 0 || docSelectionRenderService.focus();
21575
- focusSheetCellEditorElement(ownerDocument);
21719
+ focusSheetCellEditorElement(editorService);
21576
21720
  }, 0);
21577
21721
  });
21578
21722
  const handleClickSideBar = useEvent(() => {
21579
- if (editorBridgeService.isVisible().visible) commandService.executeCommand(SetCellEditVisibleOperation.id, {
21723
+ if (editorBridgeService.isVisible().visible) return commandService.executeCommand(SetCellEditVisibleOperation.id, {
21580
21724
  visible: false,
21581
21725
  eventType: DeviceInputEventType.PointerUp,
21582
21726
  unitId: editState === null || editState === void 0 ? void 0 : editState.unitId
@@ -21585,7 +21729,7 @@ function EditorContainer({ hidden = false }) {
21585
21729
  useSidebarClick(handleClickSideBar);
21586
21730
  const keyCodeConfig = useKeyEventConfig(editState === null || editState === void 0 ? void 0 : editState.unitId);
21587
21731
  const onMoveInEditor = useEvent((keycode, metaKey) => {
21588
- commandService.executeCommand(SetCellEditVisibleArrowOperation.id, {
21732
+ return commandService.executeCommand(SetCellEditVisibleArrowOperation.id, {
21589
21733
  keycode,
21590
21734
  visible: false,
21591
21735
  eventType: DeviceInputEventType.Keyboard,
@@ -21605,41 +21749,51 @@ function EditorContainer({ hidden = false }) {
21605
21749
  height: state.height,
21606
21750
  opacity: hidden ? 0 : void 0,
21607
21751
  pointerEvents: hidden ? "none" : void 0,
21608
- backgroundColor: getCellEditorHostBackgroundColor(editState, {
21609
- darkMode,
21610
- getColorFromTheme: themeService.getColorFromTheme.bind(themeService)
21611
- })
21752
+ backgroundColor: editorBackgroundColor
21612
21753
  },
21613
- children: [(visible === null || visible === void 0 ? void 0 : visible.visible) && showEditCellAddress && editCellAddress && /* @__PURE__ */ jsx("div", {
21614
- "data-u-comp": "sheet-cell-editor-address",
21615
- 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",
21616
- style: {
21617
- backgroundColor: editorBorderColor,
21618
- color: themeService.getColorFromTheme("gray.0"),
21619
- transform: "translateY(-100%)"
21620
- },
21621
- children: editCellAddress
21622
- }), FormulaEditor && /* @__PURE__ */ jsx(FormulaEditor, {
21623
- editorId: DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
21624
- className: "univer-relative univer-flex univer-size-full [&_canvas]:univer-absolute",
21625
- initValue: "",
21626
- onChange: () => {},
21627
- isFocus: !hidden && (visible === null || visible === void 0 ? void 0 : visible.visible),
21628
- unitId: editState === null || editState === void 0 ? void 0 : editState.unitId,
21629
- subUnitId: editState === null || editState === void 0 ? void 0 : editState.sheetId,
21630
- keyboardEventConfig: keyCodeConfig,
21631
- onMoveInEditor,
21632
- isSupportAcrossSheet: true,
21633
- resetSelectionOnBlur: false,
21634
- isSingle: false,
21635
- autoScrollbar: false,
21636
- onFormulaSelectingChange: (isSelecting) => {
21637
- if (isSelecting) editorBridgeService.enableForceKeepVisible();
21638
- else editorBridgeService.disableForceKeepVisible();
21639
- },
21640
- disableContextMenu: false,
21641
- canvasStyle: { backgroundColor: "transparent" }
21642
- })]
21754
+ children: [
21755
+ (visible === null || visible === void 0 ? void 0 : visible.visible) && showEditCellAddress && editCellAddress && /* @__PURE__ */ jsx("div", {
21756
+ "data-u-comp": "sheet-cell-editor-address",
21757
+ 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",
21758
+ style: {
21759
+ backgroundColor: editorBorderColor,
21760
+ color: themeService.getColorFromTheme("gray.0"),
21761
+ transform: "translateY(-100%)"
21762
+ },
21763
+ children: editCellAddress
21764
+ }),
21765
+ FormulaEditor && /* @__PURE__ */ jsx(FormulaEditor, {
21766
+ editorId: DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
21767
+ className: "univer-relative univer-flex univer-size-full [&_canvas]:univer-absolute",
21768
+ initValue: "",
21769
+ onChange: () => {},
21770
+ isFocus: !hidden && (visible === null || visible === void 0 ? void 0 : visible.visible),
21771
+ unitId: editState === null || editState === void 0 ? void 0 : editState.unitId,
21772
+ subUnitId: editState === null || editState === void 0 ? void 0 : editState.sheetId,
21773
+ keyboardEventConfig: keyCodeConfig,
21774
+ onMoveInEditor,
21775
+ isSupportAcrossSheet: true,
21776
+ resetSelectionOnBlur: false,
21777
+ isSingle: false,
21778
+ autoScrollbar: false,
21779
+ borderless: true,
21780
+ onFormulaSelectingChange: (isSelecting) => {
21781
+ if (isSelecting) editorBridgeService.enableForceKeepVisible();
21782
+ else editorBridgeService.disableForceKeepVisible();
21783
+ },
21784
+ disableContextMenu: false,
21785
+ canvasStyle: { backgroundColor: "transparent" }
21786
+ }),
21787
+ (visible === null || visible === void 0 ? void 0 : visible.visible) && /* @__PURE__ */ jsx("div", {
21788
+ "aria-hidden": true,
21789
+ className: "univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-z-10 univer-box-border",
21790
+ style: {
21791
+ width: state.width + editorBorderWidth,
21792
+ height: state.height + editorBorderWidth,
21793
+ border: `${editorBorderWidth}px solid ${editorBorderColor}`
21794
+ }
21795
+ })
21796
+ ]
21643
21797
  });
21644
21798
  }
21645
21799
 
@@ -21684,7 +21838,7 @@ function getAbsoluteRefStringFromSelection(workbook, selections, lexerTreeBuilde
21684
21838
 
21685
21839
  //#endregion
21686
21840
  //#region src/views/defined-name/DefinedNameOverlay.tsx
21687
- function DefinedNameOverlay({ search, isInputEvent }) {
21841
+ function DefinedNameOverlay({ search, isInputEvent, onClose }) {
21688
21842
  const commandService = useDependency(ICommandService);
21689
21843
  const localeService = useDependency(LocaleService);
21690
21844
  const definedNamesService = useDependency(IDefinedNamesService);
@@ -21728,8 +21882,9 @@ function DefinedNameOverlay({ search, isInputEvent }) {
21728
21882
  itemHeight: 30,
21729
21883
  overscan: 6
21730
21884
  });
21731
- const openSlider = () => {
21732
- commandService.executeCommand(SidebarDefinedNameOperation.id, { value: "open" });
21885
+ const openSlider = async () => {
21886
+ onClose();
21887
+ await commandService.executeCommand(SidebarDefinedNameOperation.id, { value: "open" });
21733
21888
  };
21734
21889
  const focusDefinedName = async (definedName) => {
21735
21890
  const { formulaOrRefString, id } = definedName;
@@ -21754,8 +21909,9 @@ function DefinedNameOverlay({ search, isInputEvent }) {
21754
21909
  children: virtualDefinedNames.map(({ data: definedName, index }) => {
21755
21910
  return /* @__PURE__ */ jsx("li", {
21756
21911
  className: "univer-cursor-pointer univer-px-2 univer-transition-colors univer-duration-200 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-600",
21757
- onClick: () => {
21758
- focusDefinedName(definedName);
21912
+ onClick: async () => {
21913
+ onClose();
21914
+ await focusDefinedName(definedName);
21759
21915
  },
21760
21916
  children: /* @__PURE__ */ jsxs("div", {
21761
21917
  "data-u-comp": "defined-name-overlay-row",
@@ -21809,6 +21965,7 @@ function DefinedName({ disable }) {
21809
21965
  const themeService = useDependency(ThemeService);
21810
21966
  const [open, setOpen] = useState(false);
21811
21967
  const [isInputEvent, setIsInputEvent] = useState(false);
21968
+ const nameBoxRef = useRef(null);
21812
21969
  const inputRef = useRef(null);
21813
21970
  const getDefinedNameMap = () => {
21814
21971
  const definedNameMap = definedNamesService.getDefinedNameMap(unitId);
@@ -21961,6 +22118,7 @@ function DefinedName({ disable }) {
21961
22118
  return selections;
21962
22119
  }
21963
22120
  return /* @__PURE__ */ jsxs("div", {
22121
+ ref: nameBoxRef,
21964
22122
  "data-u-comp": "defined-name",
21965
22123
  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",
21966
22124
  children: [/* @__PURE__ */ jsx("input", {
@@ -21972,11 +22130,14 @@ function DefinedName({ disable }) {
21972
22130
  onKeyDown: handleKeyDown,
21973
22131
  onBlur: () => setIsInputEvent(false)
21974
22132
  }), /* @__PURE__ */ jsx(Dropdown, {
22133
+ align: "start",
22134
+ anchorRef: nameBoxRef,
21975
22135
  overlay: /* @__PURE__ */ jsx("div", {
21976
22136
  className: "univer-z-[1001]",
21977
22137
  children: /* @__PURE__ */ jsx(DefinedNameOverlay, {
21978
22138
  search: inputValue,
21979
- isInputEvent
22139
+ isInputEvent,
22140
+ onClose: () => setOpen(false)
21980
22141
  })
21981
22142
  }),
21982
22143
  disabled: disable,
@@ -24854,7 +25015,7 @@ const useHighlightRange = (ranges = []) => {
24854
25015
  //#endregion
24855
25016
  //#region package.json
24856
25017
  var name = "@univerjs/sheets-ui";
24857
- var version = "1.0.2";
25018
+ var version = "1.0.4";
24858
25019
 
24859
25020
  //#endregion
24860
25021
  //#region src/views/cell-popup/config.ts
@@ -25481,16 +25642,20 @@ let FormatPainterController = class FormatPainterController extends Disposable {
25481
25642
  _initialize() {
25482
25643
  this._addDefaultHook();
25483
25644
  const session = this._injector.get(FormatPainterSessionService);
25645
+ let disabled = true;
25646
+ const disabled$ = this._injector.invoke(ClearSelectionFormatMenuItemFactory).disabled$;
25484
25647
  this.disposeWithMe(session.register({
25485
25648
  id: "sheet-cells",
25486
25649
  priority: 0,
25487
25650
  clear: () => this._commandService.executeCommand(ClearSelectionFormatCommand.id),
25488
- changes$: this._selectionManagerService.selectionMoveEnd$,
25651
+ changes$: disabled$.pipe(tap((value) => {
25652
+ disabled = value;
25653
+ })),
25489
25654
  isActive: () => {
25490
25655
  var _this$_univerInstance;
25491
25656
  return ((_this$_univerInstance = this._univerInstanceService.getFocusedUnit()) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.type) === UniverInstanceType.UNIVER_SHEET;
25492
25657
  },
25493
- canStart: () => !!this._selectionManagerService.getCurrentLastSelection(),
25658
+ canStart: () => !disabled && !!this._selectionManagerService.getCurrentLastSelection(),
25494
25659
  capture: () => {
25495
25660
  const workbook = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
25496
25661
  const format = this._collectSelectionRangeFormat();
@@ -26428,6 +26593,66 @@ const BorderDashed = ({ className }) => /* @__PURE__ */ jsxs("svg", {
26428
26593
  ]
26429
26594
  });
26430
26595
 
26596
+ //#endregion
26597
+ //#region src/views/border-panel/border-line/icons/BorderDotted.tsx
26598
+ /**
26599
+ * Copyright 2023-present DreamNum Co., Ltd.
26600
+ *
26601
+ * Licensed under the Apache License, Version 2.0 (the "License");
26602
+ * you may not use this file except in compliance with the License.
26603
+ * You may obtain a copy of the License at
26604
+ *
26605
+ * http://www.apache.org/licenses/LICENSE-2.0
26606
+ *
26607
+ * Unless required by applicable law or agreed to in writing, software
26608
+ * distributed under the License is distributed on an "AS IS" BASIS,
26609
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26610
+ * See the License for the specific language governing permissions and
26611
+ * limitations under the License.
26612
+ */
26613
+ const BorderDotted = ({ className }) => /* @__PURE__ */ jsxs("svg", {
26614
+ className,
26615
+ width: "120",
26616
+ height: "2",
26617
+ viewBox: "0 0 120 2",
26618
+ fill: "none",
26619
+ xmlns: "http://www.w3.org/2000/svg",
26620
+ children: [
26621
+ /* @__PURE__ */ jsx("path", { d: "M0.491699 1.69537H1.4917V0.695374H0.491699V1.69537Z" }),
26622
+ /* @__PURE__ */ jsx("path", { d: "M4.2981 1.69537H5.2981V0.695374H4.2981V1.69537Z" }),
26623
+ /* @__PURE__ */ jsx("path", { d: "M9.10449 1.69537H8.10449V0.695374H9.10449V1.69537Z" }),
26624
+ /* @__PURE__ */ jsx("path", { d: "M11.9109 1.69537H12.9109V0.695374H11.9109V1.69537Z" }),
26625
+ /* @__PURE__ */ jsx("path", { d: "M16.7173 1.69537H15.7173V0.695374H16.7173V1.69537Z" }),
26626
+ /* @__PURE__ */ jsx("path", { d: "M19.5237 1.69537H20.5237V0.695374H19.5237V1.69537Z" }),
26627
+ /* @__PURE__ */ jsx("path", { d: "M24.3301 1.69537H23.3301V0.695374H24.3301V1.69537Z" }),
26628
+ /* @__PURE__ */ jsx("path", { d: "M27.1365 1.69537H28.1365V0.695374H27.1365V1.69537Z" }),
26629
+ /* @__PURE__ */ jsx("path", { d: "M31.9429 1.69537H30.9429V0.695374H31.9429V1.69537Z" }),
26630
+ /* @__PURE__ */ jsx("path", { d: "M34.7493 1.69537H35.7493V0.695374H34.7493V1.69537Z" }),
26631
+ /* @__PURE__ */ jsx("path", { d: "M39.5557 1.69537H38.5557V0.695374H39.5557V1.69537Z" }),
26632
+ /* @__PURE__ */ jsx("path", { d: "M42.3621 1.69537H43.3621V0.695374H42.3621V1.69537Z" }),
26633
+ /* @__PURE__ */ jsx("path", { d: "M47.1685 1.69537H46.1685V0.695374H47.1685V1.69537Z" }),
26634
+ /* @__PURE__ */ jsx("path", { d: "M49.9749 1.69537H50.9749V0.695374H49.9749V1.69537Z" }),
26635
+ /* @__PURE__ */ jsx("path", { d: "M54.7812 1.69537H53.7812V0.695374H54.7812V1.69537Z" }),
26636
+ /* @__PURE__ */ jsx("path", { d: "M57.5876 1.69537H58.5876V0.695374H57.5876V1.69537Z" }),
26637
+ /* @__PURE__ */ jsx("path", { d: "M62.394 1.69537H61.394V0.695374H62.394V1.69537Z" }),
26638
+ /* @__PURE__ */ jsx("path", { d: "M65.2004 1.69537H66.2004V0.695374H65.2004V1.69537Z" }),
26639
+ /* @__PURE__ */ jsx("path", { d: "M70.0068 1.69537H69.0068V0.695374H70.0068V1.69537Z" }),
26640
+ /* @__PURE__ */ jsx("path", { d: "M72.8132 1.69537H73.8132V0.695374H72.8132V1.69537Z" }),
26641
+ /* @__PURE__ */ jsx("path", { d: "M77.6196 1.69537H76.6196V0.695374H77.6196V1.69537Z" }),
26642
+ /* @__PURE__ */ jsx("path", { d: "M80.426 1.69537H81.426V0.695374H80.426V1.69537Z" }),
26643
+ /* @__PURE__ */ jsx("path", { d: "M85.2324 1.69537H84.2324V0.695374H85.2324V1.69537Z" }),
26644
+ /* @__PURE__ */ jsx("path", { d: "M88.0388 1.69537H89.0388V0.695374H88.0388V1.69537Z" }),
26645
+ /* @__PURE__ */ jsx("path", { d: "M92.8452 1.69537H91.8452V0.695374H92.8452V1.69537Z" }),
26646
+ /* @__PURE__ */ jsx("path", { d: "M95.6516 1.69537H96.6516V0.695374H95.6516V1.69537Z" }),
26647
+ /* @__PURE__ */ jsx("path", { d: "M100.458 1.69537H99.458V0.695374H100.458V1.69537Z" }),
26648
+ /* @__PURE__ */ jsx("path", { d: "M103.264 1.69537H104.264V0.695374H103.264V1.69537Z" }),
26649
+ /* @__PURE__ */ jsx("path", { d: "M108.071 1.69537H107.071V0.695374H108.071V1.69537Z" }),
26650
+ /* @__PURE__ */ jsx("path", { d: "M110.877 1.69537H111.877V0.695374H110.877V1.69537Z" }),
26651
+ /* @__PURE__ */ jsx("path", { d: "M115.684 1.69537H114.684V0.695374H115.684V1.69537Z" }),
26652
+ /* @__PURE__ */ jsx("path", { d: "M118.49 1.69537H119.49V0.695374H118.49V1.69537Z" })
26653
+ ]
26654
+ });
26655
+
26431
26656
  //#endregion
26432
26657
  //#region src/views/border-panel/border-line/icons/BorderDouble.tsx
26433
26658
  /**
@@ -26801,6 +27026,7 @@ function BorderLine(props) {
26801
27026
  case BorderStyleTypes.DASH_DOT: return /* @__PURE__ */ jsx(BorderDashDot, { className });
26802
27027
  case BorderStyleTypes.DASH_DOT_DOT: return /* @__PURE__ */ jsx(BorderDashDotDot, { className });
26803
27028
  case BorderStyleTypes.DASHED: return /* @__PURE__ */ jsx(BorderDashed, { className });
27029
+ case BorderStyleTypes.DOTTED: return /* @__PURE__ */ jsx(BorderDotted, { className });
26804
27030
  case BorderStyleTypes.HAIR: return /* @__PURE__ */ jsx(BorderHair, { className });
26805
27031
  case BorderStyleTypes.MEDIUM: return /* @__PURE__ */ jsx(BorderMedium, { className });
26806
27032
  case BorderStyleTypes.MEDIUM_DASH_DOT: return /* @__PURE__ */ jsx(BorderMediumDashDot, { className });
@@ -26815,31 +27041,21 @@ function BorderLine(props) {
26815
27041
 
26816
27042
  //#endregion
26817
27043
  //#region src/views/border-panel/BorderPanel.tsx
26818
- function getBorderColor(borderData) {
26819
- if (!borderData) return;
26820
- for (const key in borderData) {
26821
- var _border$cl;
26822
- const border = borderData[key];
26823
- if (border === null || border === void 0 || (_border$cl = border.cl) === null || _border$cl === void 0 ? void 0 : _border$cl.rgb) return border.cl.rgb;
26824
- }
26825
- }
26826
- function getBorderStyle(borderData) {
26827
- if (!borderData) return;
26828
- for (const key in borderData) {
26829
- var _border$cl2;
26830
- const border = borderData[key];
26831
- if (border === null || border === void 0 || (_border$cl2 = border.cl) === null || _border$cl2 === void 0 ? void 0 : _border$cl2.rgb) return border.s;
26832
- }
26833
- }
26834
27044
  function BorderPanel(props) {
26835
27045
  const iconManager = useDependency(IconManager);
26836
- const borderStyleManagerService = useDependency(BorderStyleManagerService);
26837
27046
  const selectionManagerService = useDependency(SheetsSelectionsService);
26838
27047
  const { direction } = useContext(ConfigContext);
26839
27048
  const { isAllValuesSame, value: currentValue } = selectionManagerService.getCellStylesProperty("bd");
26840
27049
  const color = isAllValuesSame ? getBorderColor(currentValue) : void 0;
26841
- const type = isAllValuesSame ? getBorderStyle(currentValue) : void 0;
26842
27050
  const { onChange, value, ColorPickerComponent = ColorPicker, DropdownComponent = Dropdown } = props;
27051
+ function getBorderColor(borderData) {
27052
+ if (!borderData) return;
27053
+ for (const key in borderData) {
27054
+ var _border$cl;
27055
+ const border = borderData[key];
27056
+ if (border === null || border === void 0 || (_border$cl = border.cl) === null || _border$cl === void 0 ? void 0 : _border$cl.rgb) return border.cl.rgb;
27057
+ }
27058
+ }
26843
27059
  function handleClick(v, type) {
26844
27060
  onChange === null || onChange === void 0 || onChange({
26845
27061
  ...value,
@@ -26857,7 +27073,7 @@ function BorderPanel(props) {
26857
27073
  /* @__PURE__ */ jsx("div", {
26858
27074
  className: "univer-box-border univer-grid univer-grid-cols-5 univer-gap-2 univer-text-gray-600 dark:!univer-text-gray-200",
26859
27075
  children: BORDER_LINE_CHILDREN.map((item) => /* @__PURE__ */ jsx("a", {
26860
- className: 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 }),
27076
+ className: 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 }),
26861
27077
  onClick: (e) => {
26862
27078
  e.stopPropagation();
26863
27079
  handleClick(item.value, "type");
@@ -26889,14 +27105,17 @@ function BorderPanel(props) {
26889
27105
  className: "univer-rounded-lg univer-p-1.5",
26890
27106
  children: /* @__PURE__ */ jsx("ul", {
26891
27107
  className: "univer-m-0 univer-grid univer-list-none univer-gap-1 univer-p-0",
26892
- children: BORDER_SIZE_CHILDREN.map((item) => /* @__PURE__ */ jsxs("li", {
26893
- 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",
27108
+ children: BORDER_SIZE_CHILDREN.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", {
27109
+ type: "button",
27110
+ "aria-label": BorderStyleTypes[item.value],
27111
+ "aria-pressed": item.value === value.style,
27112
+ className: 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 }),
26894
27113
  onClick: () => handleClick(item.value, "style"),
26895
- children: [item.value === type && /* @__PURE__ */ jsx(CheckMarkIcon, { className: "univer-absolute univer-left-3 univer-text-primary-600" }), /* @__PURE__ */ jsx(BorderLine, {
26896
- className: "univer-ml-6 univer-fill-gray-900 dark:!univer-fill-gray-0",
27114
+ children: /* @__PURE__ */ jsx(BorderLine, {
27115
+ className: "univer-fill-gray-900 dark:!univer-fill-gray-0",
26897
27116
  type: item.value
26898
- })]
26899
- }, item.value))
27117
+ })
27118
+ }) }, item.value))
26900
27119
  })
26901
27120
  }),
26902
27121
  children: /* @__PURE__ */ jsxs("button", {
@@ -26904,7 +27123,7 @@ function BorderPanel(props) {
26904
27123
  type: "button",
26905
27124
  children: [/* @__PURE__ */ jsx(BorderLine, {
26906
27125
  className: "univer-fill-gray-900 dark:!univer-fill-gray-0",
26907
- type: type ?? BorderStyleTypes.THIN
27126
+ type: value.style
26908
27127
  }), /* @__PURE__ */ jsx(MoreDownIcon, { className: "dark:!univer-text-gray-0" })]
26909
27128
  })
26910
27129
  }) })]
@@ -28915,7 +29134,8 @@ let EditorDataSyncController = class EditorDataSyncController extends Disposable
28915
29134
  let body = Tools.deepClone((_param$documentLayout = param.documentLayoutObject.documentModel) === null || _param$documentLayout === void 0 ? void 0 : _param$documentLayout.getBody());
28916
29135
  const drawings = Tools.deepClone((_param$documentLayout2 = param.documentLayoutObject.documentModel) === null || _param$documentLayout2 === void 0 ? void 0 : _param$documentLayout2.drawings);
28917
29136
  const drawingsOrder = Tools.deepClone((_param$documentLayout3 = param.documentLayoutObject.documentModel) === null || _param$documentLayout3 === void 0 ? void 0 : _param$documentLayout3.getDrawingsOrder());
28918
- if (!body || param.isInArrayFormulaRange === true && this._editorBridgeService.isVisible().eventType === DeviceInputEventType.Dblclick) body = {
29137
+ const { visible } = this._editorBridgeService.isVisible();
29138
+ if (!body || param.isInArrayFormulaRange === true && visible) body = {
28919
29139
  dataStream: "\r\n",
28920
29140
  paragraphs: [{
28921
29141
  startIndex: 0,
@@ -29053,7 +29273,7 @@ let EditorDataSyncController = class EditorDataSyncController extends Disposable
29053
29273
  ...formulaEditorStyle,
29054
29274
  pageSize: { ...formulaEditorStyle.pageSize },
29055
29275
  renderConfig: { ...formulaEditorStyle.renderConfig },
29056
- textStyle: { cl: { rgb: this._themeService.getColorFromTheme("gray.900") } }
29276
+ textStyle: { cl: { rgb: this._getFormulaBarTextColor() } }
29057
29277
  };
29058
29278
  else snapshot.documentStyle ??= {};
29059
29279
  let renderConfig = snapshot.documentStyle.renderConfig;
@@ -29076,6 +29296,11 @@ let EditorDataSyncController = class EditorDataSyncController extends Disposable
29076
29296
  const isFocusFxBar = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR);
29077
29297
  renderConfig.isRenderStyle = isFormulaBar === isFocusFxBar ? BooleanNumber.TRUE : BooleanNumber.FALSE;
29078
29298
  }
29299
+ _getFormulaBarTextColor() {
29300
+ var _this$_editorBridgeSe;
29301
+ const isInheritedFormula = ((_this$_editorBridgeSe = this._editorBridgeService.getEditLocation()) === null || _this$_editorBridgeSe === void 0 ? void 0 : _this$_editorBridgeSe.isInArrayFormulaRange) === true && !this._editorBridgeService.isVisible().visible;
29302
+ return this._themeService.getColorFromTheme(isInheritedFormula ? "gray.300" : "gray.900");
29303
+ }
29079
29304
  _getSourceStyleRenderValue(isFormulaBar) {
29080
29305
  return isFormulaBar ? BooleanNumber.FALSE : BooleanNumber.TRUE;
29081
29306
  }
@@ -32742,10 +32967,14 @@ let MobileCellEditRenderController = class MobileCellEditRenderController extend
32742
32967
  if (cell.location.unitId !== this._context.unitId) return;
32743
32968
  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();
32744
32969
  if (isCellImage(snapshot)) return;
32745
- this._commandService.executeCommand(SetCellEditVisibleOperation.id, {
32970
+ this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
32746
32971
  visible: true,
32747
32972
  eventType: DeviceInputEventType.Dblclick,
32748
- unitId: this._context.unitId
32973
+ unitId: this._context.unitId,
32974
+ pointerPosition: {
32975
+ x: cell.event.clientX,
32976
+ y: cell.event.clientY
32977
+ }
32749
32978
  });
32750
32979
  }));
32751
32980
  this.disposeWithMe(hoverManagerService.currentPointerDownCell$.subscribe((cell) => {
@@ -33178,7 +33407,7 @@ let MobileHoverRenderController = class MobileHoverRenderController extends Disp
33178
33407
  return;
33179
33408
  }
33180
33409
  this._resetCompletedTap();
33181
- this._hoverManagerService.triggerDbClick(unitId, event.offsetX, event.offsetY);
33410
+ this._hoverManagerService.triggerDbClick(unitId, event);
33182
33411
  },
33183
33412
  priority: -1
33184
33413
  }));
@@ -33254,7 +33483,7 @@ let MobileHoverRenderController = class MobileHoverRenderController extends Disp
33254
33483
  this._suppressEngineDoubleClick = false;
33255
33484
  this._suppressEngineDoubleClickTimer = null;
33256
33485
  });
33257
- this._hoverManagerService.triggerDbClick(unitId, event.offsetX, event.offsetY);
33486
+ this._hoverManagerService.triggerDbClick(unitId, event);
33258
33487
  return;
33259
33488
  }
33260
33489
  this._resetCompletedTap();
@@ -35262,20 +35491,22 @@ const ISheetHostChromeOverrideService = createIdentifier("sheet-ui.host-chrome-o
35262
35491
  //#endregion
35263
35492
  //#region src/controllers/render-controllers/contextmenu.render-controller.ts
35264
35493
  let SheetContextMenuRenderController = class SheetContextMenuRenderController extends Disposable {
35265
- constructor(_context, _contextMenuService, _selectionManagerService, _selectionRenderService, _injector) {
35494
+ constructor(_context, _contextMenuService, _selectionManagerService, _selectionRenderService, _injector, _platformService, _contextService) {
35266
35495
  super();
35267
35496
  this._context = _context;
35268
35497
  this._contextMenuService = _contextMenuService;
35269
35498
  this._selectionManagerService = _selectionManagerService;
35270
35499
  this._selectionRenderService = _selectionRenderService;
35271
35500
  this._injector = _injector;
35501
+ this._platformService = _platformService;
35502
+ this._contextService = _contextService;
35272
35503
  this._init();
35273
35504
  this._initEmbedRuntimeSessionListener();
35274
35505
  }
35275
35506
  _init() {
35276
35507
  var _this$_context;
35277
35508
  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) => {
35278
- if (event.button === 2) {
35509
+ if (this._isContextMenuGesture(event)) {
35279
35510
  const selections = this._selectionManagerService.getCurrentSelections();
35280
35511
  const currentSelection = selections === null || selections === void 0 ? void 0 : selections[0];
35281
35512
  if (!currentSelection) return;
@@ -35305,20 +35536,23 @@ let SheetContextMenuRenderController = class SheetContextMenuRenderController ex
35305
35536
  this.disposeWithMe(spreadsheetSubscription);
35306
35537
  const spreadsheetColumnHeader = this._context.components.get("__SpreadsheetColumnHeader__");
35307
35538
  const rowHeaderSub = this._context.components.get("__SpreadsheetRowHeader__").onPointerDown$.subscribeEvent((event) => {
35308
- if (event.button === 2) {
35539
+ if (this._isContextMenuGesture(event)) {
35309
35540
  if (this._shouldSuppressHostContextMenu()) return;
35310
35541
  this._contextMenuService.triggerContextMenu(event, ContextMenuPosition.ROW_HEADER);
35311
35542
  }
35312
35543
  });
35313
35544
  this.disposeWithMe(rowHeaderSub);
35314
35545
  const colHeaderObserver = spreadsheetColumnHeader.onPointerDown$.subscribeEvent((event) => {
35315
- if (event.button === 2) {
35546
+ if (this._isContextMenuGesture(event)) {
35316
35547
  if (this._shouldSuppressHostContextMenu()) return;
35317
35548
  this._contextMenuService.triggerContextMenu(event, ContextMenuPosition.COL_HEADER);
35318
35549
  }
35319
35550
  });
35320
35551
  this.disposeWithMe(colHeaderObserver);
35321
35552
  }
35553
+ _isContextMenuGesture(event) {
35554
+ return isSheetContextMenuGesture(event, this._platformService.isMac, this._contextService.getContextValue(REF_SELECTIONS_ENABLED));
35555
+ }
35322
35556
  _initEmbedRuntimeSessionListener() {
35323
35557
  const runtimeFocusCoordinator = this._getSheetEmbedRuntimeFocusCoordinator();
35324
35558
  if (!runtimeFocusCoordinator) return;
@@ -35341,7 +35575,9 @@ SheetContextMenuRenderController = __decorate([
35341
35575
  __decorateParam(1, IContextMenuService),
35342
35576
  __decorateParam(2, Inject(SheetsSelectionsService)),
35343
35577
  __decorateParam(3, ISheetSelectionRenderService),
35344
- __decorateParam(4, Inject(Injector))
35578
+ __decorateParam(4, Inject(Injector)),
35579
+ __decorateParam(5, IPlatformService),
35580
+ __decorateParam(6, IContextService)
35345
35581
  ], SheetContextMenuRenderController);
35346
35582
  function shouldHideSheetHostContextMenuForEmbedSession(hostUnitId, activeScope) {
35347
35583
  return (activeScope === null || activeScope === void 0 ? void 0 : activeScope.hostUnitId) === hostUnitId && activeScope.sessionMode !== "host-passive";
@@ -35353,7 +35589,7 @@ function shouldSuppressSheetContextMenuForEmbedOverride(hostUnitId, override) {
35353
35589
  //#endregion
35354
35590
  //#region src/controllers/render-controllers/desktop-cell-edit.render-controller.ts
35355
35591
  let DesktopCellEditRenderController = class DesktopCellEditRenderController extends RxDisposable {
35356
- constructor(_context, _instanceService, _commandService, _editorBridgeService, _selectionManagerService, _contextService, _renderManagerService, _embedRuntimeFocusCoordinator) {
35592
+ constructor(_context, _instanceService, _commandService, _editorBridgeService, _selectionManagerService, _contextService, _renderManagerService, _platformService, _embedRuntimeFocusCoordinator) {
35357
35593
  super();
35358
35594
  this._context = _context;
35359
35595
  this._instanceService = _instanceService;
@@ -35362,6 +35598,7 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
35362
35598
  this._selectionManagerService = _selectionManagerService;
35363
35599
  this._contextService = _contextService;
35364
35600
  this._renderManagerService = _renderManagerService;
35601
+ this._platformService = _platformService;
35365
35602
  this._embedRuntimeFocusCoordinator = _embedRuntimeFocusCoordinator;
35366
35603
  _defineProperty(this, "_d", void 0);
35367
35604
  this.disposeWithMe(this._instanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET).subscribe((workbook) => {
@@ -35389,13 +35626,17 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
35389
35626
  const { spreadsheet, spreadsheetColumnHeader, spreadsheetLeftTopPlaceholder, spreadsheetRowHeader } = sheetObject;
35390
35627
  d.add(spreadsheet.onDblclick$.subscribeEvent((evt) => {
35391
35628
  var _this$_editorBridgeSe;
35392
- if (evt.button === 2) return;
35629
+ if (isSheetContextMenuGesture(evt, this._platformService.isMac, this._contextService.getContextValue(REF_SELECTIONS_ENABLED))) return;
35393
35630
  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();
35394
35631
  if (isCellImage(snapshot)) return;
35395
- this._commandService.executeCommand(SetCellEditVisibleOperation.id, {
35632
+ this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
35396
35633
  visible: true,
35397
35634
  eventType: DeviceInputEventType.Dblclick,
35398
- unitId: this._context.unitId
35635
+ unitId: this._context.unitId,
35636
+ pointerPosition: {
35637
+ x: evt.clientX,
35638
+ y: evt.clientY
35639
+ }
35399
35640
  });
35400
35641
  }));
35401
35642
  d.add(spreadsheet.onPointerDown$.subscribeEvent({
@@ -35524,7 +35765,8 @@ DesktopCellEditRenderController = __decorate([
35524
35765
  __decorateParam(4, Inject(SheetsSelectionsService)),
35525
35766
  __decorateParam(5, IContextService),
35526
35767
  __decorateParam(6, IRenderManagerService),
35527
- __decorateParam(7, Optional(ISheetEmbedRuntimeFocusCoordinator))
35768
+ __decorateParam(7, IPlatformService),
35769
+ __decorateParam(8, Optional(ISheetEmbedRuntimeFocusCoordinator))
35528
35770
  ], DesktopCellEditRenderController);
35529
35771
  function resolvePointerEventPayload(payload) {
35530
35772
  return Array.isArray(payload) ? payload[0] : payload;
@@ -35688,38 +35930,34 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35688
35930
  const { spreadsheetRowHeader, spreadsheetColumnHeader, spreadsheet, spreadsheetLeftTopPlaceholder } = sheetObject;
35689
35931
  const { scene } = this._context;
35690
35932
  this.disposeWithMe(spreadsheet === null || spreadsheet === void 0 ? void 0 : spreadsheet.onPointerDown$.subscribeEvent((evt, state) => {
35691
- if (this.isSelectionDisabled()) return;
35692
- if (this.inRefSelectionMode()) return;
35933
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35693
35934
  this._onPointerDown(evt, spreadsheet.zIndex + 1, RANGE_TYPE.NORMAL, this._getActiveViewport(evt));
35694
- if (evt.button !== 2) state.stopPropagation();
35935
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35695
35936
  }));
35696
35937
  this.disposeWithMe(spreadsheetRowHeader === null || spreadsheetRowHeader === void 0 ? void 0 : spreadsheetRowHeader.onPointerDown$.subscribeEvent((evt, state) => {
35697
- if (this.isSelectionDisabled()) return;
35698
- if (this.inRefSelectionMode()) return;
35938
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35699
35939
  const skeleton = this._sheetSkeletonManagerService.getCurrentParam().skeleton;
35700
35940
  const { row } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton);
35701
35941
  if (isThisRowSelected(this._workbookSelections.getCurrentSelections(), row)) return;
35702
35942
  this._onPointerDown(evt, (spreadsheet.zIndex || 1) + 1, RANGE_TYPE.ROW, this._getActiveViewport(evt), ScrollTimerType.Y);
35703
- if (evt.button !== 2) state.stopPropagation();
35943
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35704
35944
  }));
35705
35945
  this.disposeWithMe(spreadsheetColumnHeader === null || spreadsheetColumnHeader === void 0 ? void 0 : spreadsheetColumnHeader.onPointerDown$.subscribeEvent((evt, state) => {
35706
- if (this.isSelectionDisabled()) return;
35707
- if (this.inRefSelectionMode()) return;
35946
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35708
35947
  const skeleton = this._sheetSkeletonManagerService.getCurrentParam().skeleton;
35709
35948
  const { column } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton);
35710
35949
  if (isThisColSelected(this._workbookSelections.getCurrentSelections(), column)) return;
35711
35950
  this._onPointerDown(evt, (spreadsheet.zIndex || 1) + 1, RANGE_TYPE.COLUMN, this._getActiveViewport(evt), ScrollTimerType.X);
35712
- if (evt.button !== 2) state.stopPropagation();
35951
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35713
35952
  }));
35714
35953
  this.disposeWithMe(spreadsheetLeftTopPlaceholder === null || spreadsheetLeftTopPlaceholder === void 0 ? void 0 : spreadsheetLeftTopPlaceholder.onPointerDown$.subscribeEvent((evt, state) => {
35715
- if (this.isSelectionDisabled()) return;
35716
- if (this.inRefSelectionMode()) return;
35954
+ if (this.isSelectionDisabled() || this.inRefSelectionMode()) return;
35717
35955
  this._reset();
35718
35956
  const skeleton = this._sheetSkeletonManagerService.getCurrentParam().skeleton;
35719
35957
  const selectionWithStyle = selectionDataForSelectAll(skeleton);
35720
35958
  this._addSelectionControlByModelData(selectionWithStyle);
35721
35959
  this.refreshSelectionMoveEnd();
35722
- if (evt.button !== 2) state.stopPropagation();
35960
+ if (!this._isContextMenuGesture(evt)) state.stopPropagation();
35723
35961
  }));
35724
35962
  }
35725
35963
  _initThemeChangeListener() {
@@ -35800,7 +36038,7 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35800
36038
  const sheetId = workbook.getActiveSheet().getSheetId();
35801
36039
  if (selectionDataWithStyleList.length === 0) return;
35802
36040
  const selectionWithStyles = selectionDataWithStyleList.map((selectionDataWithStyle) => convertSelectionDataToRange(selectionDataWithStyle));
35803
- this._commandService.executeCommand(SetSelectionsOperation.id, {
36041
+ this._commandService.syncExecuteCommand(SetSelectionsOperation.id, {
35804
36042
  unitId,
35805
36043
  subUnitId: sheetId,
35806
36044
  type,
@@ -35821,6 +36059,7 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35821
36059
  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();
35822
36060
  this._changeRuntime(skeleton, scene, viewportMain);
35823
36061
  if (prevSheetId !== skeleton.worksheet.getSheetId()) {
36062
+ this._reset();
35824
36063
  const selections = this._workbookSelections.getCurrentSelections();
35825
36064
  this._commandService.syncExecuteCommand(SetSelectionsOperation.id, {
35826
36065
  unitId,
@@ -35855,11 +36094,10 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35855
36094
  this._rangeType = rangeType;
35856
36095
  const skeleton = this._skeleton;
35857
36096
  const scene = this._scene;
35858
- if (!scene || !skeleton) return;
36097
+ const viewportMain = scene === null || scene === void 0 ? void 0 : scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_MAIN);
36098
+ if (!scene || !skeleton || !viewportMain) return;
35859
36099
  if (viewport) this._activeViewport = viewport;
35860
36100
  const { offsetX: evtOffsetX, offsetY: evtOffsetY } = evt;
35861
- const viewportMain = scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_MAIN);
35862
- if (!viewportMain) return;
35863
36101
  const relativeCoords = scene.getCoordRelativeToViewport(Vector2.FromArray([evtOffsetX, evtOffsetY]));
35864
36102
  const { x: offsetX, y: offsetY } = relativeCoords;
35865
36103
  this._startViewportPosX = offsetX;
@@ -35869,7 +36107,6 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35869
36107
  const selectCell = this._skeleton.getCellByOffset(offsetX, offsetY, scaleX, scaleY, scrollXY);
35870
36108
  if (!selectCell) return;
35871
36109
  switch (rangeType) {
35872
- case RANGE_TYPE.NORMAL: break;
35873
36110
  case RANGE_TYPE.ROW:
35874
36111
  selectCell.startColumn = 0;
35875
36112
  selectCell.endColumn = this._skeleton.getColumnCount() - 1;
@@ -35896,6 +36133,11 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35896
36133
  selectionWithStyle.range.rangeType = rangeType;
35897
36134
  const activeSelectionControl = this._updateSelectionControl(evt, selectionWithStyle);
35898
36135
  if (!activeSelectionControl) return;
36136
+ if (this._isContextMenuGesture(evt)) {
36137
+ this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
36138
+ this.endSelection();
36139
+ return;
36140
+ }
35899
36141
  scene.disableObjectsEvent();
35900
36142
  this._clearUpdatingListeners();
35901
36143
  this._addEndingListeners();
@@ -35907,20 +36149,32 @@ let SheetSelectionRenderService = class SheetSelectionRenderService extends Base
35907
36149
  (_this$_scene$getEngin = this._scene.getEngine()) === null || _this$_scene$getEngin === void 0 || _this$_scene$getEngin.setCapture();
35908
36150
  }
35909
36151
  _updateSelectionControl(evt, selection) {
35910
- const cursorRange = attachSelectionWithCoord(selection, this._skeleton).rangeWithCoord;
36152
+ const selectionWithCoord = attachSelectionWithCoord(selection, this._skeleton);
36153
+ const cursorRange = selectionWithCoord.rangeWithCoord;
35911
36154
  this._startRangeWhenPointerDown = { ...cursorRange };
35912
36155
  const controls = this.getSelectionControls();
35913
36156
  const isSelected = controls.some((control) => Rectangle.contains(control.model, cursorRange));
35914
- if (evt.button === 2 && isSelected) return;
35915
- if (evt.button === 0 && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey && !this._singleSelectionEnabled && this._rangeType === RANGE_TYPE.NORMAL && isSelected) this._selectionBeforeModifierClick = this.getSelectionDataWithStyle().map(convertSelectionDataToRange);
36157
+ if (this._isContextMenuGesture(evt) && isSelected) return;
36158
+ if (evt.button === 0 && !this._isContextMenuGesture(evt) && this._isMultiSelectModifier(evt) && !evt.shiftKey && !this._singleSelectionEnabled && this._rangeType === RANGE_TYPE.NORMAL && isSelected) this._selectionBeforeModifierClick = this.getSelectionDataWithStyle().map(convertSelectionDataToRange);
35916
36159
  let activeControl = this.getActiveSelectionControl();
36160
+ if (activeControl && this._canAnimateSelection(evt, activeControl, cursorRange)) {
36161
+ activeControl.updateRangeBySelectionWithCoord(selectionWithCoord, this._skeleton, true);
36162
+ return activeControl;
36163
+ }
35917
36164
  this._checkClearPreviousControls(evt);
35918
36165
  const currentCell = activeControl === null || activeControl === void 0 ? void 0 : activeControl.model.currentCell;
35919
- if (evt.shiftKey && currentCell && activeControl) this._makeSelectionByTwoCells(currentCell, cursorRange, this._skeleton, this._rangeType, activeControl);
36166
+ if (!this._isContextMenuGesture(evt) && evt.shiftKey && currentCell && activeControl) this._makeSelectionByTwoCells(currentCell, cursorRange, this._skeleton, this._rangeType, activeControl);
35920
36167
  else activeControl = this.newSelectionControl(this._scene, this._skeleton, selection);
35921
36168
  for (let i = 0; i < controls.length - 1; i++) controls[i].clearHighlight();
35922
36169
  return activeControl;
35923
36170
  }
36171
+ _canAnimateSelection(evt, control, target) {
36172
+ if (this.getSelectionControls().length !== 1 || this._rangeType !== RANGE_TYPE.NORMAL || this._remainLastEnabled || evt.button !== 0 || evt.ctrlKey || evt.metaKey || evt.shiftKey || evt.altKey) return false;
36173
+ const current = control.getCurrentCellInfo();
36174
+ if (!current || !Rectangle.equals(control.model, current)) return false;
36175
+ const freeze = this._skeleton.worksheet.getFreeze();
36176
+ return current.startRow < freeze.startRow === target.startRow < freeze.startRow && current.startColumn < freeze.startColumn === target.startColumn < freeze.startColumn;
36177
+ }
35924
36178
  endSelection() {
35925
36179
  const previousSelections = this._selectionBeforeModifierClick;
35926
36180
  this._selectionBeforeModifierClick = null;
@@ -36110,4 +36364,4 @@ UniverSheetsUIPlugin = __decorate([
36110
36364
  ], UniverSheetsUIPlugin);
36111
36365
 
36112
36366
  //#endregion
36113
- export { AddRangeProtectionFromContextMenuCommand, AddRangeProtectionFromSheetBarCommand, AddRangeProtectionFromToolbarCommand, ApplyFormatPainterCommand, AutoFillPopupMenu, AutoFillUIController, AutoHeightController, AutoWidthController, BORDER_LINE_CHILDREN, BORDER_SIZE_CHILDREN, BaseSelectionRenderService, BorderLine, COPY_SPECIAL_MENU_ID, COPY_TYPE, CellAlertManagerService, CellAlertType, CellCustomRenderController, CellEditorManagerService, CellPopupManagerService, ChangeSheetProtectionFromSheetBarCommand, ChangeZoomRatioCommand, DeleteRangeMoveLeftConfirmCommand, DeleteRangeMoveUpConfirmCommand, DeleteRangeProtectionFromContextMenuCommand, DeleteWorksheetProtectionFormSheetBarCommand, DragManagerService, DragRenderController, EMBEDDING_FORMULA_EDITOR, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY, EditingRenderController, EditorBridgeService, EditorContainer, ExpandSelectionCommand, FORMULA_CLIPBOARD_MIME_TYPE, FormatPainterStatus, FormulaBar, FormulaEditorController, HEADER_UNHIDE_RANGE_VISIBLE_CHECK, HeaderFreezeRenderController, HeaderMoveRenderController, HeaderResizeRenderController, HeaderUnhideRangeAxis, HeaderUnhideRangeService, HeaderUnhideRenderController, HideColConfirmCommand, HideRowConfirmCommand, HoverManagerService, HoverRenderController, ICellEditorManagerService, IEditorBridgeService, IFormatPainterService, IFormulaEditorManagerService, IMarkSelectionService, IRepeatLastActionService, ISheetBarService, ISheetCellDropdownManagerService, ISheetClipboardService, ISheetEmbedFloatingGeometryService, ISheetEmbedInteractionBoundaryService, ISheetEmbedRuntimeFocusCoordinator, ISheetEmbedRuntimeService, ISheetHostChromeOverrideService, ISheetSelectionRenderService, IStatusBarService, InsertRangeMoveDownConfirmCommand, InsertRangeMoveRightConfirmCommand, JumpOver, MOBILE_CONTEXT_MENU, MOBILE_EXPANDING_SELECTION, MOBILE_FORMULA_FUNCTION_PANEL_OPEN, MOBILE_PINCH_ZOOMING, MarkSelectionService, MobileSelectionControl, MoveSelectionCommand, MoveSelectionEnterAndTabCommand, PASTE_SPECIAL_MENU_ID, PREDEFINED_HOOK_NAME, PREDEFINED_HOOK_NAME_COPY, PREDEFINED_HOOK_NAME_PASTE, RANGE_SELECTOR_COMPONENT_KEY, RANGE_SELECTOR_SYMBOLS, RemoveColConfirmCommand, RemoveRowConfirmCommand, RemoveSheetConfirmCommand, RenameSheetOperation, RepeatLastActionPermission, ResetRangeTextColorCommand, ResetScrollCommand, SELECTION_SHAPE_DEPTH, SHEETS_UI_PLUGIN_CONFIG_KEY, SHEET_EMBED_CHILD_TYPE_ATTRIBUTE, SHEET_EMBED_CHILD_UNIT_ID_ATTRIBUTE, SHEET_EMBED_FLOAT_DOM_ATTRIBUTE, SHEET_EMBED_HOST_UNIT_ID_ATTRIBUTE, SHEET_EMBED_ID_ATTRIBUTE, SHEET_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE, SHEET_EMBED_RUNTIME_FOCUS_ROLE_ATTRIBUTE, SHEET_FOOTER_BAR_HEIGHT, SHEET_UI_PLUGIN_NAME, SHEET_VIEW_KEY, ScrollCommand, ScrollToCellCommand, ScrollToRangeOperation, SelectAllCommand, SelectionControl, SelectionControl as SelectionShape, SelectionShapeExtension, SetActivateCellEditOperation, SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation, SetCellEditVisibleWithF2Operation, SetColumnFrozenCommand, SetColumnHeaderHeightCommand, SetFirstColumnFrozenCommand, SetFirstRowFrozenCommand, SetFormatPainterOperation, SetInfiniteFormatPainterCommand, SetOnceFormatPainterCommand, SetRangeBoldCommand, SetRangeFontDecreaseCommand, SetRangeFontFamilyCommand, SetRangeFontIncreaseCommand, SetRangeFontSizeCommand, SetRangeItalicCommand, SetRangeProtectionFromContextMenuCommand, SetRangeStrickThroughCommand, SetRangeSubscriptCommand, SetRangeSuperscriptCommand, SetRangeTextColorCommand, SetRangeUnderlineCommand, SetRowFrozenCommand, SetRowHeaderWidthCommand, SetScrollOperation, SetScrollRelativeCommand, SetSelectionFrozenCommand, SetWorksheetColAutoWidthCommand, SetZoomRatioCommand, SetZoomRatioOperation, SheetBar, SheetBarService, SheetCanvasPopManagerService, SheetCellDropdownManagerService, SheetCellEditorResizeService, SheetClipboardController, SheetClipboardService, SheetContextMenuMobileRenderController, SheetCopyCommand, SheetCutCommand, SheetMenuPosition, SheetPasteBesidesBorderCommand, SheetPasteColWidthCommand, SheetPasteCommand, SheetPasteFormatCommand, SheetPasteShortKeyCommand, SheetPasteValueCommand, SheetPermissionCheckUIController, SheetPermissionOpenDialogOperation, SheetPermissionOpenPanelOperation, SheetPermissionRenderManagerService, SheetPermissionUserManagerService, SheetPrintInterceptorService, SheetPrintingResourceCollector, SheetRenderController, SheetScrollManagerService, SheetSelectionRenderService, SheetSkeletonManagerService, SheetUIController, SheetsRenderService, SheetsScrollRenderController, menuSchema as SheetsUIMenuSchema, SheetsUIPart, ShowMenuListCommand, SidebarDefinedNameOperation, StatusBarController, StatusBarService, UNIVER_SHEET_PERMISSION_USER_PART, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, ViewSheetPermissionFromContextMenuCommand, ViewSheetPermissionFromSheetBarCommand, calculateDocSkeletonRects, matchedSelectionByRowColIndex as checkInHeaderRanges, deriveStateFromActiveSheet$, functionDisplayNames, genNormalSelectionStyle, genSelectionByRange, selectionDataForSelectAll as getAllSelection, getCellRealRange, getCoordByCell, getCoordByOffset, getCurrentExclusiveRangeInterest$, getCurrentRangeDisable$, getCustomRangePosition, getEditingCustomRangePosition, getEditorObject, getMatrixPlainText, getObservableWithExclusiveRange$, getRepeatRange, getSheetObject, getTopLeftSelectionOfCurrSheet, getTransformCoord, getViewportByCell, isEmbeddingFormulaEditor, isRangeSelector, menuClipboardDisabledObservable, mergeSetRangeValues, resolveActiveSheetEmbedRuntimeDomScope, resolveSheetEmbedRuntimeDomScope, useActiveWorkbook, useActiveWorksheet, useHighlightRange, useKeyEventConfig, useWorkbooks, virtualizeDiscreteRanges, whenFormulaEditorActivated, whenSheetEditorActivated, whenSheetEditorFocused };
36367
+ export { AddRangeProtectionFromContextMenuCommand, AddRangeProtectionFromSheetBarCommand, AddRangeProtectionFromToolbarCommand, ApplyFormatPainterCommand, AutoFillPopupMenu, AutoFillUIController, AutoHeightController, AutoWidthController, BORDER_LINE_CHILDREN, BORDER_SIZE_CHILDREN, BaseSelectionRenderService, BorderLine, COPY_SPECIAL_MENU_ID, COPY_TYPE, CellAlertManagerService, CellAlertType, CellCustomRenderController, CellEditorManagerService, CellPopupManagerService, ChangeSheetProtectionFromSheetBarCommand, ChangeZoomRatioCommand, DEFINED_NAME_CONTAINER, DeleteRangeMoveLeftConfirmCommand, DeleteRangeMoveUpConfirmCommand, DeleteRangeProtectionFromContextMenuCommand, DeleteWorksheetProtectionFormSheetBarCommand, DragManagerService, DragRenderController, EMBEDDING_FORMULA_EDITOR, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY, EditingRenderController, EditorBridgeService, EditorContainer, ExpandSelectionCommand, FORMULA_CLIPBOARD_MIME_TYPE, FormatPainterStatus, FormulaBar, FormulaEditorController, HEADER_UNHIDE_RANGE_VISIBLE_CHECK, HeaderFreezeRenderController, HeaderMoveRenderController, HeaderResizeRenderController, HeaderUnhideRangeAxis, HeaderUnhideRangeService, HeaderUnhideRenderController, HideColConfirmCommand, HideRowConfirmCommand, HoverManagerService, HoverRenderController, ICellEditorManagerService, IEditorBridgeService, IFormatPainterService, IFormulaEditorManagerService, IMarkSelectionService, IRepeatLastActionService, ISheetBarService, ISheetCellDropdownManagerService, ISheetClipboardService, ISheetEmbedFloatingGeometryService, ISheetEmbedInteractionBoundaryService, ISheetEmbedRuntimeFocusCoordinator, ISheetEmbedRuntimeService, ISheetHostChromeOverrideService, ISheetSelectionRenderService, IStatusBarService, InsertRangeMoveDownConfirmCommand, InsertRangeMoveRightConfirmCommand, JumpOver, MOBILE_CONTEXT_MENU, MOBILE_EXPANDING_SELECTION, MOBILE_FORMULA_FUNCTION_PANEL_OPEN, MOBILE_PINCH_ZOOMING, MarkSelectionService, MobileSelectionControl, MoveSelectionCommand, MoveSelectionEnterAndTabCommand, PASTE_SPECIAL_MENU_ID, PREDEFINED_HOOK_NAME, PREDEFINED_HOOK_NAME_COPY, PREDEFINED_HOOK_NAME_PASTE, RANGE_SELECTOR_COMPONENT_KEY, RANGE_SELECTOR_SYMBOLS, RemoveColConfirmCommand, RemoveRowConfirmCommand, RemoveSheetConfirmCommand, RenameSheetOperation, RepeatLastActionPermission, ResetRangeTextColorCommand, ResetScrollCommand, SELECTION_SHAPE_DEPTH, SHEETS_UI_PLUGIN_CONFIG_KEY, SHEET_EMBED_CHILD_TYPE_ATTRIBUTE, SHEET_EMBED_CHILD_UNIT_ID_ATTRIBUTE, SHEET_EMBED_FLOAT_DOM_ATTRIBUTE, SHEET_EMBED_HOST_UNIT_ID_ATTRIBUTE, SHEET_EMBED_ID_ATTRIBUTE, SHEET_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE, SHEET_EMBED_RUNTIME_FOCUS_ROLE_ATTRIBUTE, SHEET_FOOTER_BAR_HEIGHT, SHEET_UI_PLUGIN_NAME, SHEET_VIEW_KEY, ScrollCommand, ScrollToCellCommand, ScrollToRangeOperation, SelectAllCommand, SelectionControl, SelectionControl as SelectionShape, SelectionShapeExtension, SetActivateCellEditOperation, SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation, SetCellEditVisibleWithF2Operation, SetColumnFrozenCommand, SetColumnHeaderHeightCommand, SetFirstColumnFrozenCommand, SetFirstRowFrozenCommand, SetFormatPainterOperation, SetInfiniteFormatPainterCommand, SetOnceFormatPainterCommand, SetRangeBoldCommand, SetRangeFontDecreaseCommand, SetRangeFontFamilyCommand, SetRangeFontIncreaseCommand, SetRangeFontSizeCommand, SetRangeItalicCommand, SetRangeProtectionFromContextMenuCommand, SetRangeStrickThroughCommand, SetRangeSubscriptCommand, SetRangeSuperscriptCommand, SetRangeTextColorCommand, SetRangeUnderlineCommand, SetRowFrozenCommand, SetRowHeaderWidthCommand, SetScrollOperation, SetScrollRelativeCommand, SetSelectionFrozenCommand, SetWorksheetColAutoWidthCommand, SetZoomRatioCommand, SetZoomRatioOperation, SheetBar, SheetBarService, SheetCanvasPopManagerService, SheetCellDropdownManagerService, SheetCellEditorResizeService, SheetClipboardController, SheetClipboardService, SheetContextMenuMobileRenderController, SheetCopyCommand, SheetCutCommand, SheetMenuPosition, SheetPasteBesidesBorderCommand, SheetPasteColWidthCommand, SheetPasteCommand, SheetPasteFormatCommand, SheetPasteShortKeyCommand, SheetPasteValueCommand, SheetPermissionCheckUIController, SheetPermissionOpenDialogOperation, SheetPermissionOpenPanelOperation, SheetPermissionRenderManagerService, SheetPermissionUserManagerService, SheetPrintInterceptorService, SheetPrintingResourceCollector, SheetRenderController, SheetScrollManagerService, SheetSelectionRenderService, SheetSkeletonManagerService, SheetUIController, SheetsRenderService, SheetsScrollRenderController, menuSchema as SheetsUIMenuSchema, SheetsUIPart, ShowMenuListCommand, SidebarDefinedNameOperation, StatusBarController, StatusBarService, UNIVER_SHEET_PERMISSION_USER_PART, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, ViewSheetPermissionFromContextMenuCommand, ViewSheetPermissionFromSheetBarCommand, calculateDocSkeletonRects, matchedSelectionByRowColIndex as checkInHeaderRanges, deriveStateFromActiveSheet$, functionDisplayNames, genNormalSelectionStyle, genSelectionByRange, selectionDataForSelectAll as getAllSelection, getCellRealRange, getCoordByCell, getCoordByOffset, getCurrentExclusiveRangeInterest$, getCurrentRangeDisable$, getCustomRangePosition, getEditingCustomRangePosition, getEditorObject, getMatrixPlainText, getObservableWithExclusiveRange$, getRepeatRange, getSheetObject, getTopLeftSelectionOfCurrSheet, getTransformCoord, getViewportByCell, isEmbeddingFormulaEditor, isRangeSelector, menuClipboardDisabledObservable, mergeSetRangeValues, resolveActiveSheetEmbedRuntimeDomScope, resolveSheetEmbedRuntimeDomScope, useActiveWorkbook, useActiveWorksheet, useHighlightRange, useKeyEventConfig, useWorkbooks, virtualizeDiscreteRanges, whenFormulaEditorActivated, whenSheetEditorActivated, whenSheetEditorFocused };