@univerjs/sheets-ui 1.0.4 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/lib/cjs/index.js +352 -230
  2. package/lib/cjs/locale/ar-SA.js +15 -0
  3. package/lib/cjs/locale/ca-ES.js +15 -0
  4. package/lib/cjs/locale/de-DE.js +15 -0
  5. package/lib/cjs/locale/en-US.js +15 -0
  6. package/lib/cjs/locale/es-ES.js +15 -0
  7. package/lib/cjs/locale/fa-IR.js +15 -0
  8. package/lib/cjs/locale/fr-FR.js +15 -0
  9. package/lib/cjs/locale/id-ID.js +15 -0
  10. package/lib/cjs/locale/it-IT.js +15 -0
  11. package/lib/cjs/locale/ja-JP.js +15 -0
  12. package/lib/cjs/locale/ko-KR.js +15 -0
  13. package/lib/cjs/locale/pl-PL.js +15 -0
  14. package/lib/cjs/locale/pt-BR.js +15 -0
  15. package/lib/cjs/locale/ru-RU.js +15 -0
  16. package/lib/cjs/locale/sk-SK.js +15 -0
  17. package/lib/cjs/locale/vi-VN.js +15 -0
  18. package/lib/cjs/locale/zh-CN.js +15 -0
  19. package/lib/cjs/locale/zh-HK.js +15 -0
  20. package/lib/cjs/locale/zh-TW.js +15 -0
  21. package/lib/es/index.js +318 -196
  22. package/lib/es/locale/ar-SA.js +15 -0
  23. package/lib/es/locale/ca-ES.js +15 -0
  24. package/lib/es/locale/de-DE.js +15 -0
  25. package/lib/es/locale/en-US.js +15 -0
  26. package/lib/es/locale/es-ES.js +15 -0
  27. package/lib/es/locale/fa-IR.js +15 -0
  28. package/lib/es/locale/fr-FR.js +15 -0
  29. package/lib/es/locale/id-ID.js +15 -0
  30. package/lib/es/locale/it-IT.js +15 -0
  31. package/lib/es/locale/ja-JP.js +15 -0
  32. package/lib/es/locale/ko-KR.js +15 -0
  33. package/lib/es/locale/pl-PL.js +15 -0
  34. package/lib/es/locale/pt-BR.js +15 -0
  35. package/lib/es/locale/ru-RU.js +15 -0
  36. package/lib/es/locale/sk-SK.js +15 -0
  37. package/lib/es/locale/vi-VN.js +15 -0
  38. package/lib/es/locale/zh-CN.js +15 -0
  39. package/lib/es/locale/zh-HK.js +15 -0
  40. package/lib/es/locale/zh-TW.js +15 -0
  41. package/lib/index.css +0 -20
  42. package/lib/index.js +318 -196
  43. package/lib/locale/ar-SA.js +15 -0
  44. package/lib/locale/ca-ES.js +15 -0
  45. package/lib/locale/de-DE.js +15 -0
  46. package/lib/locale/en-US.js +15 -0
  47. package/lib/locale/es-ES.js +15 -0
  48. package/lib/locale/fa-IR.js +15 -0
  49. package/lib/locale/fr-FR.js +15 -0
  50. package/lib/locale/id-ID.js +15 -0
  51. package/lib/locale/it-IT.js +15 -0
  52. package/lib/locale/ja-JP.js +15 -0
  53. package/lib/locale/ko-KR.js +15 -0
  54. package/lib/locale/pl-PL.js +15 -0
  55. package/lib/locale/pt-BR.js +15 -0
  56. package/lib/locale/ru-RU.js +15 -0
  57. package/lib/locale/sk-SK.js +15 -0
  58. package/lib/locale/vi-VN.js +15 -0
  59. package/lib/locale/zh-CN.js +15 -0
  60. package/lib/locale/zh-HK.js +15 -0
  61. package/lib/locale/zh-TW.js +15 -0
  62. package/lib/types/controllers/editor/utils/get-edit-cell-input-position.d.ts +31 -0
  63. package/lib/types/locale/en-US.d.ts +15 -0
  64. package/lib/types/menu/zoom.menu.d.ts +2 -2
  65. package/lib/types/services/cell-alert-manager.service.d.ts +1 -0
  66. package/lib/types/services/editor/cell-editor-resize.service.d.ts +6 -0
  67. package/lib/types/views/border-panel/interface.d.ts +37 -4
  68. package/lib/umd/facade.js +3 -1
  69. package/lib/umd/index.js +10 -12
  70. package/lib/umd/locale/ar-SA.js +1 -1
  71. package/lib/umd/locale/ca-ES.js +1 -1
  72. package/lib/umd/locale/de-DE.js +1 -1
  73. package/lib/umd/locale/en-US.js +1 -1
  74. package/lib/umd/locale/es-ES.js +1 -1
  75. package/lib/umd/locale/fa-IR.js +1 -1
  76. package/lib/umd/locale/fr-FR.js +1 -1
  77. package/lib/umd/locale/id-ID.js +1 -1
  78. package/lib/umd/locale/it-IT.js +1 -1
  79. package/lib/umd/locale/ja-JP.js +1 -1
  80. package/lib/umd/locale/ko-KR.js +1 -1
  81. package/lib/umd/locale/pl-PL.js +1 -1
  82. package/lib/umd/locale/pt-BR.js +1 -1
  83. package/lib/umd/locale/ru-RU.js +1 -1
  84. package/lib/umd/locale/sk-SK.js +1 -1
  85. package/lib/umd/locale/vi-VN.js +1 -1
  86. package/lib/umd/locale/zh-CN.js +1 -1
  87. package/lib/umd/locale/zh-HK.js +1 -1
  88. package/lib/umd/locale/zh-TW.js +1 -1
  89. package/package.json +17 -17
  90. package/lib/types/views/sheet-slider/SheetZoomInput.d.ts +0 -18
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
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
- 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";
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, bindFormatPainterCanvas, connectInjector, getEmbedBoundaryOwner, getEmbedChildUnitId, getMenuHiddenObservable, handleStringToStyle, imageMimeTypeSet, sanitizeParsedHtml, textTrim, useComponentsOfPart, useConfigValue, useDependency, useEvent, useObservable, useSidebarClick, useToolbarItemStatus, useVirtualList } from "@univerjs/ui";
5
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
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";
@@ -12,7 +12,7 @@ import { ITelemetryService } from "@univerjs/telemetry";
12
12
  import { debounceTime, filter as filter$1, map as map$1, shareReplay as shareReplay$1, startWith as startWith$1, switchMap as switchMap$1 } from "rxjs/operators";
13
13
  import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
14
14
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
- import { AddImageIcon, AdjustHeightDoubleIcon, AdjustWidthDoubleIcon, AlignBottomIcon, AlignTopIcon, AllBorderIcon, AutoHeightDoubleIcon, AutoWidthDoubleIcon, AutofillDoubleIcon, AutowrapIcon, BackSlashDoubleIcon, BasesMultiIcon, BoardsMultiIcon, BoldIcon, BrushIcon, CancelFreezeIcon, CancelMergeIcon, CheckMarkIcon, ClearFormatDoubleIcon, CloseIcon, CodeIcon, ConvertIcon, ConvertToNumberIcon, CopyDoubleIcon, CutIcon, DeleteCellShiftLeftDoubleIcon, DeleteCellShiftUpDoubleIcon, DeleteColumnDoubleIcon, DeleteIcon, DeleteRowDoubleIcon, DocsMultiIcon, DownBorderDoubleIcon, DownIcon, DownloadImageIcon, ErrorIcon, EyeIcon, EyelashIcon, FontColorDoubleIcon, FontSizeIncreaseIcon, FontSizeReduceIcon, FreezeColumnIcon, FreezeRowIcon, FreezeToSelectedIcon, FxIcon, HideDoubleIcon, HideGridlinesIcon, HorizontalBorderDoubleIcon, HorizontalMergeIcon, HorizontallyIcon, IncreaseIcon, InfoIcon, InnerBorderDoubleIcon, InsertCellDownDoubleIcon, InsertCellShiftRightDoubleIcon, InsertDoubleIcon, InsertRowAboveDoubleIcon, InsertRowBelowDoubleIcon, ItalicIcon, KeyboardIcon, LeftBorderDoubleIcon, LeftDoubleDiagonalDoubleIcon, LeftInsertColumnDoubleIcon, LeftJustifyingIcon, LeftRotationFortyFiveDegreesIcon, LeftRotationNinetyDegreesIcon, LeftTridiagonalDoubleIcon, LockIcon, MenuIcon, MergeAllIcon, MoreDownIcon, MoreLeftIcon, MoreRightIcon, NoBorderIcon, NoColorDoubleIcon, NoRotationIcon, OuterBorderDoubleIcon, OverflowIcon, PaintBucketDoubleIcon, PasteSpecialDoubleIcon, PenIcon, ProtectIcon, ReduceDoubleIcon, RightBorderDoubleIcon, RightDoubleDiagonalDoubleIcon, RightInsertColumnDoubleIcon, RightJustifyingIcon, RightRotationFortyFiveDegreesIcon, RightRotationNinetyDegreesIcon, SheetsMultiIcon, ShrinkToFitIcon, SlashDoubleIcon, SlidesMultiIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TruncationIcon, UnderlineIcon, UpBorderDoubleIcon, VerticalBorderDoubleIcon, VerticalCenterIcon, VerticalIntegrationIcon, VerticalTextIcon, WarningIcon, WriteIcon } from "@univerjs/icons";
15
+ import { AddImageIcon, AdjustHeightDoubleIcon, AdjustWidthDoubleIcon, AlignBottomIcon, AlignTopIcon, AllBorderIcon, AutoHeightDoubleIcon, AutoWidthDoubleIcon, AutofillDoubleIcon, AutowrapIcon, BackSlashDoubleIcon, BasesMultiIcon, BoardsMultiIcon, BoldIcon, BrushIcon, CancelFreezeIcon, CancelMergeIcon, CheckMarkIcon, ClearFormatDoubleIcon, CloseIcon, CodeIcon, ConvertIcon, ConvertToNumberIcon, CopyDoubleIcon, CutIcon, DeleteCellShiftLeftDoubleIcon, DeleteCellShiftUpDoubleIcon, DeleteColumnDoubleIcon, DeleteIcon, DeleteRowDoubleIcon, DocPasteOptionsIcon, DocsMultiIcon, DownBorderDoubleIcon, DownIcon, DownloadImageIcon, ErrorIcon, EyeIcon, EyelashIcon, FontColorDoubleIcon, FontSizeIncreaseIcon, FontSizeReduceIcon, FreezeColumnIcon, FreezeRowIcon, FreezeToSelectedIcon, FxIcon, HideDoubleIcon, HideGridlinesIcon, HorizontalBorderDoubleIcon, HorizontalMergeIcon, HorizontallyIcon, IncreaseIcon, InfoIcon, InnerBorderDoubleIcon, InsertCellDownDoubleIcon, InsertCellShiftRightDoubleIcon, InsertDoubleIcon, InsertRowAboveDoubleIcon, InsertRowBelowDoubleIcon, ItalicIcon, KeyboardIcon, LeftBorderDoubleIcon, LeftDoubleDiagonalDoubleIcon, LeftInsertColumnDoubleIcon, LeftJustifyingIcon, LeftRotationFortyFiveDegreesIcon, LeftRotationNinetyDegreesIcon, LeftTridiagonalDoubleIcon, LockIcon, MenuIcon, MergeAllIcon, MoreDownIcon, MoreLeftIcon, MoreRightIcon, NoBorderIcon, NoColorDoubleIcon, NoRotationIcon, OuterBorderDoubleIcon, OverflowIcon, PaintBucketDoubleIcon, PasteSpecialDoubleIcon, PenIcon, ProtectIcon, ReduceDoubleIcon, RightBorderDoubleIcon, RightDoubleDiagonalDoubleIcon, RightInsertColumnDoubleIcon, RightJustifyingIcon, RightRotationFortyFiveDegreesIcon, RightRotationNinetyDegreesIcon, SheetsMultiIcon, ShrinkToFitIcon, SlashDoubleIcon, SlidesMultiIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TruncationIcon, UnderlineIcon, UpBorderDoubleIcon, VerticalBorderDoubleIcon, VerticalCenterIcon, VerticalIntegrationIcon, VerticalTextIcon, WarningIcon, WriteIcon, ZoomInIcon } from "@univerjs/icons";
16
16
 
17
17
  //#region src/basics/editor/get-editor-object.ts
18
18
  function getEditorObject(unitId, renderManagerService) {
@@ -240,7 +240,7 @@ let SHEET_VIEW_KEY = /* @__PURE__ */ function(SHEET_VIEW_KEY) {
240
240
  }({});
241
241
 
242
242
  //#endregion
243
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
243
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
244
244
  function _typeof(o) {
245
245
  "@babel/helpers - typeof";
246
246
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -251,7 +251,7 @@ function _typeof(o) {
251
251
  }
252
252
 
253
253
  //#endregion
254
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js
254
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
255
255
  function toPrimitive(t, r) {
256
256
  if ("object" != _typeof(t) || !t) return t;
257
257
  var e = t[Symbol.toPrimitive];
@@ -264,14 +264,14 @@ function toPrimitive(t, r) {
264
264
  }
265
265
 
266
266
  //#endregion
267
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js
267
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
268
268
  function toPropertyKey(t) {
269
269
  var i = toPrimitive(t, "string");
270
270
  return "symbol" == _typeof(i) ? i : i + "";
271
271
  }
272
272
 
273
273
  //#endregion
274
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js
274
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
275
275
  function _defineProperty(e, r, t) {
276
276
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
277
277
  value: t,
@@ -1044,7 +1044,7 @@ function genSelectionByRange(skeleton, range) {
1044
1044
  }
1045
1045
 
1046
1046
  //#endregion
1047
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorateParam.js
1047
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
1048
1048
  function __decorateParam(paramIndex, decorator) {
1049
1049
  return function(target, key) {
1050
1050
  decorator(target, key, paramIndex);
@@ -1052,7 +1052,7 @@ function __decorateParam(paramIndex, decorator) {
1052
1052
  }
1053
1053
 
1054
1054
  //#endregion
1055
- //#region \0@oxc-project+runtime@0.149.0/helpers/esm/decorate.js
1055
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
1056
1056
  function __decorate(decorators, target, key, desc) {
1057
1057
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1058
1058
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -3105,9 +3105,10 @@ var HtmlToUSMService = class HtmlToUSMService {
3105
3105
  cellDataStream = `${dataStream.substring(starts[i])}\r\n`;
3106
3106
  if (cellDataStream === "\r\n") continue;
3107
3107
  } else cellDataStream = `${dataStream.substring(starts[i], starts[i + 1] - 1)}\r\n`;
3108
+ const end = starts[i + 1] ?? dataStream.length;
3108
3109
  const cellTextRuns = [];
3109
3110
  textRuns === null || textRuns === void 0 || textRuns.forEach((t) => {
3110
- if (t.st >= starts[i] && t.ed <= starts[i + 1]) cellTextRuns.push({
3111
+ if (t.st >= starts[i] && t.ed <= end) cellTextRuns.push({
3111
3112
  st: t.st - starts[i],
3112
3113
  ed: t.ed - starts[i],
3113
3114
  ts: t.ts
@@ -3115,7 +3116,7 @@ var HtmlToUSMService = class HtmlToUSMService {
3115
3116
  });
3116
3117
  const cellCustomRanges = [];
3117
3118
  customRanges === null || customRanges === void 0 || customRanges.forEach((c) => {
3118
- if (c.startIndex >= starts[i] && c.endIndex <= starts[i + 1]) cellCustomRanges.push({
3119
+ if (c.startIndex >= starts[i] && c.endIndex <= end) cellCustomRanges.push({
3119
3120
  ...c,
3120
3121
  startIndex: c.startIndex - starts[i],
3121
3122
  endIndex: c.endIndex - starts[i]
@@ -3143,14 +3144,9 @@ var HtmlToUSMService = class HtmlToUSMService {
3143
3144
  payloads,
3144
3145
  customRanges
3145
3146
  };
3146
- if (!(customRanges === null || customRanges === void 0 ? void 0 : customRanges.length)) valueMatrix.setValue(0, 0, convertToCellStyle({ v: dataStream }, dataStream, textRuns));
3147
- else {
3148
- const p = this._generateDocumentDataModelSnapshot({ body: singleDocBody });
3149
- valueMatrix.setValue(0, 0, convertToCellStyle({
3150
- v: dataStream,
3151
- p
3152
- }, dataStream, textRuns));
3153
- }
3147
+ const cell = { v: dataStream };
3148
+ if ((textRuns === null || textRuns === void 0 ? void 0 : textRuns.length) || (customRanges === null || customRanges === void 0 ? void 0 : customRanges.length)) cell.p = this._generateDocumentDataModelSnapshot({ body: singleDocBody });
3149
+ valueMatrix.setValue(0, 0, convertToCellStyle(cell, dataStream, textRuns));
3154
3150
  rowProperties.push({});
3155
3151
  }
3156
3152
  if (tableStrings) tableStrings.forEach((t, index) => {
@@ -3767,7 +3763,7 @@ const LarkPastePlugin = {
3767
3763
  const UniverPastePlugin = {
3768
3764
  name: "univer-sheet-paste-plugin-univer",
3769
3765
  checkPasteType(html) {
3770
- return /UniverNormal/i.test(html);
3766
+ return /<p\b[^>]*\sclass\s*=\s*["'](?:[^"']*\s)?UniverNormal(?:\s[^"']*)?["']/i.test(html);
3771
3767
  },
3772
3768
  stylesRules: [],
3773
3769
  afterProcessRules: [{
@@ -4144,9 +4140,9 @@ function wrapHtmlForExcel(html) {
4144
4140
  /**
4145
4141
  * This service provide hooks for sheet features to supplement content or modify behavior of clipboard.
4146
4142
  */
4143
+ HtmlToUSMService.use(UniverPastePlugin);
4147
4144
  HtmlToUSMService.use(WordPastePlugin);
4148
4145
  HtmlToUSMService.use(LarkPastePlugin);
4149
- HtmlToUSMService.use(UniverPastePlugin);
4150
4146
  const ISheetClipboardService = createIdentifier("sheet.clipboard-service");
4151
4147
  let SheetClipboardService = class SheetClipboardService extends Disposable {
4152
4148
  constructor(_logService, _univerInstanceService, _selectionManagerService, _clipboardInterfaceService, _undoRedoService, _commandService, _markSelectionService, _notificationService, _platformService, _renderManagerService, _themeService, _localeService, _errorService, _injector) {
@@ -6941,7 +6937,7 @@ const SetSelectionFrozenCommand = {
6941
6937
  if (selectRow === 0) selectRow = 1;
6942
6938
  let selectColumn = (primary === null || primary === void 0 ? void 0 : primary.startColumn) ?? range.startColumn;
6943
6939
  if (selectColumn === 0) selectColumn = 1;
6944
- const rangeType = range.rangeType;
6940
+ const rangeType = range.rangeType ?? RANGE_TYPE.NORMAL;
6945
6941
  if (rangeType === RANGE_TYPE.ROW || type === 1) {
6946
6942
  startRow = selectRow;
6947
6943
  freezedRowCount = selectRow - sheetViewStartRow;
@@ -8240,14 +8236,17 @@ function transformPosition2Offset(x, y, scene, skeleton, worksheet) {
8240
8236
  const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(startRow, startColumn, false);
8241
8237
  const { rowHeaderWidth, columnHeaderHeight } = skeleton;
8242
8238
  const freezeWidth = endSheetView.startX - startSheetView.startX;
8243
- const freezeHeight = endSheetView.startY - startSheetView.startY;
8239
+ const freezeStartY = ySplit > 0 && startRow === ySplit ? 0 : startSheetView.startY;
8240
+ const freezeHeight = endSheetView.startY - freezeStartY;
8244
8241
  const { top, left, viewportScrollX, viewportScrollY } = viewMain;
8242
+ const viewportLeft = left / scaleX;
8243
+ const viewportTop = top / scaleY;
8245
8244
  let offsetX;
8246
- if (x > left) offsetX = (x - viewportScrollX) * scaleX;
8247
- else offsetX = (freezeWidth + rowHeaderWidth - (left - x)) * scaleX;
8245
+ if (x > viewportLeft) offsetX = (x - viewportScrollX) * scaleX;
8246
+ else offsetX = (freezeWidth + rowHeaderWidth - (viewportLeft - x)) * scaleX;
8248
8247
  let offsetY;
8249
- if (y > top) offsetY = (y - viewportScrollY) * scaleY;
8250
- else offsetY = (freezeHeight + columnHeaderHeight - (top - y)) * scaleX;
8248
+ if (y > viewportTop) offsetY = (y - viewportScrollY) * scaleY;
8249
+ else offsetY = (freezeHeight + columnHeaderHeight - (viewportTop - y)) * scaleY;
8251
8250
  return {
8252
8251
  x: offsetX,
8253
8252
  y: offsetY
@@ -10393,6 +10392,18 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10393
10392
  this._univerInstanceService = _univerInstanceService;
10394
10393
  this._configService = _configService;
10395
10394
  this._embedFloatingGeometryService = _embedFloatingGeometryService;
10395
+ _defineProperty(this, "_editorWidth", 0);
10396
+ _defineProperty(this, "_editorHeight", 0);
10397
+ _defineProperty(this, "_initialEditorSize", null);
10398
+ _defineProperty(this, "_cellSize", null);
10399
+ this.disposeWithMe(this._editorBridgeService.visible$.subscribe(({ visible }) => {
10400
+ if (!visible) {
10401
+ this._editorWidth = 0;
10402
+ this._editorHeight = 0;
10403
+ this._initialEditorSize = null;
10404
+ this._cellSize = null;
10405
+ }
10406
+ }));
10396
10407
  }
10397
10408
  get _currentRenderer() {
10398
10409
  return getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_SHEET, this._univerInstanceService, this._renderManagerService);
@@ -10420,10 +10431,13 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10420
10431
  if (!param) return;
10421
10432
  const { position, documentLayoutObject, canvasOffset, scaleX, scaleY } = param;
10422
10433
  const { startX, startY, endX, endY } = position;
10434
+ const cellWidth = endX - startX;
10435
+ const cellHeight = endY - startY;
10423
10436
  const documentDataModel = this._univerInstanceService.getUnit(DOCS_NORMAL_EDITOR_UNIT_ID_KEY, UniverInstanceType.UNIVER_DOC);
10424
10437
  if (documentDataModel == null) return;
10425
10438
  const documentSkeleton = this._getEditorSkeleton();
10426
10439
  if (!documentSkeleton) return;
10440
+ this._syncCellSize(cellWidth / scaleX, cellHeight / scaleY);
10427
10441
  documentSkeleton.resetInitialWidth();
10428
10442
  const info = this._predictingSize(position, canvasOffset, documentSkeleton, documentLayoutObject, scaleX, scaleY);
10429
10443
  if (!info || info.actualWidth <= 0) return;
@@ -10431,17 +10445,17 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10431
10445
  const { verticalAlign, horizontalAlign, paddingData, fill } = documentLayoutObject;
10432
10446
  actualWidth = actualWidth + (paddingData.l ?? 0) * scaleX + (paddingData.r ?? 0) * scaleX;
10433
10447
  actualHeight = actualHeight + (paddingData.t ?? 0) * scaleY + (paddingData.b ?? 0) * scaleY;
10434
- let editorWidth = endX - startX;
10435
- let editorHeight = endY - startY;
10436
- if (editorWidth < actualWidth) editorWidth = Math.ceil(actualWidth);
10437
- if (editorHeight < actualHeight) editorHeight = Math.ceil(actualHeight);
10448
+ const contentWidth = cellWidth < actualWidth ? Math.ceil(actualWidth) : cellWidth;
10449
+ const contentHeight = cellHeight < actualHeight ? Math.ceil(actualHeight) : cellHeight;
10450
+ const editorWidth = Math.max(contentWidth, Math.min(this._editorWidth * scaleX, info.maxSize.width));
10451
+ const editorHeight = Math.max(contentHeight, Math.min(this._editorHeight * scaleY, info.maxSize.height));
10438
10452
  let offsetTop = 0;
10439
10453
  if (verticalAlign === VerticalAlign.MIDDLE) offsetTop = (editorHeight - actualHeight) / 2 / scaleY;
10440
10454
  else if (verticalAlign === VerticalAlign.TOP) offsetTop = paddingData.t || 0;
10441
10455
  else offsetTop = (editorHeight - actualHeight) / scaleY;
10442
10456
  let offsetLeft = 0;
10443
- if (horizontalAlign === HorizontalAlign.CENTER) {} else if (horizontalAlign === HorizontalAlign.RIGHT) offsetLeft = (editorWidth - actualWidth) / scaleX;
10444
- else offsetLeft = paddingData.l || 0;
10457
+ if (horizontalAlign === HorizontalAlign.RIGHT) offsetLeft = (editorWidth - actualWidth) / scaleX;
10458
+ else if (horizontalAlign !== HorizontalAlign.CENTER) offsetLeft = paddingData.l || 0;
10445
10459
  offsetTop = Math.max(offsetTop, paddingData.t || 0);
10446
10460
  offsetLeft = Math.max(offsetLeft, paddingData.l || 0);
10447
10461
  documentDataModel.updateDocumentDataMargin({
@@ -10449,7 +10463,22 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10449
10463
  l: offsetLeft
10450
10464
  });
10451
10465
  documentSkeleton.calculate();
10452
- this._editAreaProcessing(editorWidth, editorHeight, position, canvasOffset, fill, scaleX, scaleY, horizontalAlign, callback);
10466
+ this._editAreaProcessing({
10467
+ width: editorWidth,
10468
+ height: editorHeight,
10469
+ contentWidth
10470
+ }, position, canvasOffset, fill, scaleX, scaleY, horizontalAlign, callback);
10471
+ }
10472
+ _syncCellSize(width, height) {
10473
+ if (this._cellSize && (Math.abs(this._cellSize.width - width) > 1e-6 || Math.abs(this._cellSize.height - height) > 1e-6)) {
10474
+ var _this$_initialEditorS, _this$_initialEditorS2;
10475
+ this._editorWidth = ((_this$_initialEditorS = this._initialEditorSize) === null || _this$_initialEditorS === void 0 ? void 0 : _this$_initialEditorS.width) ?? 0;
10476
+ this._editorHeight = ((_this$_initialEditorS2 = this._initialEditorSize) === null || _this$_initialEditorS2 === void 0 ? void 0 : _this$_initialEditorS2.height) ?? 0;
10477
+ }
10478
+ this._cellSize = {
10479
+ width,
10480
+ height
10481
+ };
10453
10482
  }
10454
10483
  /**
10455
10484
  * Mainly used to pre-calculate the width of the editor,
@@ -10460,25 +10489,26 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10460
10489
  const { textRotation, wrapStrategy, paddingData } = documentLayoutObject;
10461
10490
  const documentDataModel = this._univerInstanceService.getUnit(DOCS_NORMAL_EDITOR_UNIT_ID_KEY, UniverInstanceType.UNIVER_DOC);
10462
10491
  const { vertexAngle: angle } = convertTextRotation(textRotation);
10492
+ const maxSize = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, documentLayoutObject.horizontalAlign);
10493
+ if (!maxSize) return;
10494
+ documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataMargin({
10495
+ l: paddingData.l,
10496
+ t: paddingData.t
10497
+ });
10463
10498
  if (wrapStrategy === WrapStrategy.WRAP && angle === 0) {
10464
10499
  documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize((endX - startX) / scaleX);
10465
- documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataMargin({
10466
- l: paddingData.l,
10467
- t: paddingData.t
10468
- });
10469
10500
  documentSkeleton.calculate();
10470
10501
  const { actualWidth, actualHeight } = documentSkeleton.getActualSize();
10471
10502
  return {
10472
10503
  actualWidth: actualWidth * scaleX,
10473
- actualHeight: actualHeight * scaleY
10504
+ actualHeight: actualHeight * scaleY,
10505
+ maxSize
10474
10506
  };
10475
10507
  }
10476
- const maxSize = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, documentLayoutObject.horizontalAlign);
10477
- if (!maxSize) return;
10478
10508
  documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize(maxSize.width / scaleX);
10479
10509
  documentSkeleton.calculate();
10480
10510
  const size = documentSkeleton.getActualSize();
10481
- let editorWidth = endX - startX;
10511
+ let editorWidth = Math.max(endX - startX, Math.min(this._editorWidth * scaleX, maxSize.width));
10482
10512
  if (editorWidth < size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX) editorWidth = size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX;
10483
10513
  documentDataModel === null || documentDataModel === void 0 || documentDataModel.updateDocumentDataPageSize(editorWidth / scaleX);
10484
10514
  /**
@@ -10490,7 +10520,8 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10490
10520
  });
10491
10521
  return {
10492
10522
  actualWidth: size.actualWidth * scaleX,
10493
- actualHeight: size.actualHeight * scaleY
10523
+ actualHeight: size.actualHeight * scaleY,
10524
+ maxSize
10494
10525
  };
10495
10526
  }
10496
10527
  _getEditorMaxSize(position, canvasOffset, horizontalAlign) {
@@ -10536,7 +10567,7 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10536
10567
  * determine whether a scrollbar appears,
10537
10568
  * and calculate the editor's boundaries relative to the browser.
10538
10569
  */
10539
- _editAreaProcessing(editorWidth, editorHeight, actualRangeWithCoord, canvasOffset, fill, scaleX = 1, scaleY = 1, horizontalAlign, callback) {
10570
+ _editAreaProcessing(size, actualRangeWithCoord, canvasOffset, fill, scaleX = 1, scaleY = 1, horizontalAlign, callback) {
10540
10571
  const editorObject = this._getEditorObject();
10541
10572
  if (editorObject == null) return;
10542
10573
  const engine = this.engine;
@@ -10544,25 +10575,16 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10544
10575
  const canvasElement = engine.getCanvasElement();
10545
10576
  let { startX, startY } = actualRangeWithCoord;
10546
10577
  const { document: documentComponent, scene: editorScene, engine: docEngine } = editorObject;
10547
- const viewportMain = editorScene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
10548
10578
  const { height: clientHeight, width: clientWidth, contentScaleX, contentScaleY, scaleAdjustX, scaleAdjustY } = this._getEditorMaxSize(actualRangeWithCoord, canvasOffset, horizontalAlign);
10549
- let physicHeight = editorHeight;
10550
- let scrollBar = viewportMain === null || viewportMain === void 0 ? void 0 : viewportMain.getScrollBar();
10551
- if (physicHeight > clientHeight) {
10552
- if (scrollBar == null) viewportMain && new ScrollBar(viewportMain, {
10553
- enableHorizontal: false,
10554
- barSize: 8
10555
- });
10556
- else viewportMain === null || viewportMain === void 0 || viewportMain.resetCanvasSizeAndUpdateScroll();
10557
- viewportMain === null || viewportMain === void 0 || viewportMain.scrollToViewportPos({ viewportScrollY: physicHeight - clientHeight });
10558
- physicHeight = clientHeight;
10559
- } else {
10560
- var _viewportMain$getScro;
10561
- scrollBar = null;
10562
- viewportMain === null || viewportMain === void 0 || (_viewportMain$getScro = viewportMain.getScrollBar()) === null || _viewportMain$getScro === void 0 || _viewportMain$getScro.dispose();
10563
- }
10564
- editorWidth += (scrollBar === null || scrollBar === void 0 ? void 0 : scrollBar.barSize) || 0;
10565
- if (editorWidth > clientWidth) editorWidth = clientWidth;
10579
+ const { physicHeight, scrollBarWidth } = this._fitEditorViewport(editorScene, size.height, clientHeight);
10580
+ const editorWidth = Math.min(Math.max(size.width, size.contentWidth + scrollBarWidth), clientWidth);
10581
+ const editorHeight = size.height;
10582
+ this._editorWidth = Math.max(this._editorWidth, editorWidth / scaleX);
10583
+ this._editorHeight = Math.max(this._editorHeight, physicHeight / scaleY);
10584
+ if (!this._initialEditorSize && this._editorBridgeService.isVisible().visible) this._initialEditorSize = {
10585
+ width: editorWidth / scaleX,
10586
+ height: physicHeight / scaleY
10587
+ };
10566
10588
  this._addBackground(editorScene, editorWidth / scaleX, editorHeight / scaleY, fill);
10567
10589
  const { scaleX: precisionScaleX, scaleY: precisionScaleY } = editorScene.getPrecisionScale();
10568
10590
  editorScene.transformByState({
@@ -10572,11 +10594,6 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10572
10594
  scaleY: scaleY * scaleAdjustY
10573
10595
  });
10574
10596
  documentComponent.resize(editorWidth * scaleAdjustX / scaleX, editorHeight * scaleAdjustY / scaleY);
10575
- /**
10576
- * sometimes requestIdleCallback is invalid, so use setTimeout to ensure the successful execution of the resizeBySize method.
10577
- * resize canvas
10578
- * When modifying the selection area for a formula, it is necessary to add a setTimeout to ensure successful updating.
10579
- */
10580
10597
  setTimeout(() => {
10581
10598
  docEngine.resizeBySize(fixLineWidthByScale(editorWidth, precisionScaleX), fixLineWidthByScale(physicHeight, precisionScaleY));
10582
10599
  callback === null || callback === void 0 || callback();
@@ -10596,6 +10613,26 @@ let SheetCellEditorResizeService = class SheetCellEditorResizeService extends Di
10596
10613
  show: true
10597
10614
  });
10598
10615
  }
10616
+ _fitEditorViewport(editorScene, editorHeight, clientHeight) {
10617
+ const viewportMain = editorScene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
10618
+ let scrollBar = viewportMain === null || viewportMain === void 0 ? void 0 : viewportMain.getScrollBar();
10619
+ if (editorHeight > clientHeight) {
10620
+ if (scrollBar == null) viewportMain && new ScrollBar(viewportMain, {
10621
+ enableHorizontal: false,
10622
+ barSize: 8
10623
+ });
10624
+ else viewportMain === null || viewportMain === void 0 || viewportMain.resetCanvasSizeAndUpdateScroll();
10625
+ viewportMain === null || viewportMain === void 0 || viewportMain.scrollToViewportPos({ viewportScrollY: editorHeight - clientHeight });
10626
+ } else {
10627
+ var _viewportMain$getScro;
10628
+ scrollBar = null;
10629
+ viewportMain === null || viewportMain === void 0 || (_viewportMain$getScro = viewportMain.getScrollBar()) === null || _viewportMain$getScro === void 0 || _viewportMain$getScro.dispose();
10630
+ }
10631
+ return {
10632
+ physicHeight: Math.min(editorHeight, clientHeight),
10633
+ scrollBarWidth: (scrollBar === null || scrollBar === void 0 ? void 0 : scrollBar.barSize) ?? 0
10634
+ };
10635
+ }
10599
10636
  _getEditorContentElement() {
10600
10637
  var _this$_embedFloatingG;
10601
10638
  return ((_this$_embedFloatingG = this._embedFloatingGeometryService) === null || _this$_embedFloatingG === void 0 || (_this$_embedFloatingG = _this$_embedFloatingG.getRegistrationByChildUnitId(this._editingUnitId)) === null || _this$_embedFloatingG === void 0 ? void 0 : _this$_embedFloatingG.contentRoot) ?? this._layoutService.getContentElement();
@@ -11422,6 +11459,29 @@ function processNumberStringWithSpaces(token, numStr) {
11422
11459
  };
11423
11460
  }
11424
11461
 
11462
+ //#endregion
11463
+ //#region src/controllers/editor/utils/get-edit-cell-input-position.ts
11464
+ /**
11465
+ * Get the position of the hidden editor input for the current edit cell.
11466
+ *
11467
+ * The OS anchors the IME candidate window to the focused input, so the input should stay on the
11468
+ * selected cell even before the cell editor opens. The position is kept inside the sheet canvas,
11469
+ * so a cell scrolled out of view never moves the input outside the sheet.
11470
+ */
11471
+ function getEditCellInputPosition(layout, canvasSize) {
11472
+ const { position, canvasOffset } = layout;
11473
+ const x = canvasOffset.left + position.startX;
11474
+ const y = canvasOffset.top + position.startY;
11475
+ if (!canvasSize) return {
11476
+ x,
11477
+ y
11478
+ };
11479
+ return {
11480
+ x: Math.min(Math.max(x, canvasOffset.left), canvasOffset.left + canvasSize.width),
11481
+ y: Math.min(Math.max(y, canvasOffset.top), canvasOffset.top + canvasSize.height)
11482
+ };
11483
+ }
11484
+
11425
11485
  //#endregion
11426
11486
  //#region src/controllers/editor/utils/is-range-selector.ts
11427
11487
  /**
@@ -11638,7 +11698,11 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11638
11698
  if ((cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 ? void 0 : cellSelectionRenderManager.canFocusing) || (formulaSelectionRenderManager === null || formulaSelectionRenderManager === void 0 ? void 0 : formulaSelectionRenderManager.canFocusing)) {
11639
11699
  this._univerInstanceService.setCurrentUnitForType(DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
11640
11700
  if (this._contextService.getContextValue(DISABLE_AUTO_FOCUS_KEY)) cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 || cellSelectionRenderManager.setInputPosition(HIDDEN_EDITOR_POSITION$1, HIDDEN_EDITOR_POSITION$1);
11641
- else cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 || cellSelectionRenderManager.activate(HIDDEN_EDITOR_POSITION$1, HIDDEN_EDITOR_POSITION$1, true);
11701
+ else {
11702
+ var _this$_renderManagerS5;
11703
+ const { x, y } = getEditCellInputPosition(state, (_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(state.unitId)) === null || _this$_renderManagerS5 === void 0 ? void 0 : _this$_renderManagerS5.engine);
11704
+ cellSelectionRenderManager === null || cellSelectionRenderManager === void 0 || cellSelectionRenderManager.activate(x, y, true);
11705
+ }
11642
11706
  }
11643
11707
  }));
11644
11708
  }
@@ -11712,7 +11776,7 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11712
11776
  }));
11713
11777
  }
11714
11778
  _handleEditorVisible(param) {
11715
- var _documentDataModel$ge, _this$_renderManagerS6;
11779
+ var _documentDataModel$ge, _this$_renderManagerS7;
11716
11780
  const { eventType, keycode } = param;
11717
11781
  this._cursorChange = eventType === DeviceInputEventType.PointerDown || eventType === DeviceInputEventType.Dblclick ? 2 : 1;
11718
11782
  const editCellState = this._editorBridgeService.getEditLocation();
@@ -11741,8 +11805,8 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11741
11805
  const resetPointerSelection = isInArrayFormulaRange && eventType === DeviceInputEventType.PointerDown;
11742
11806
  const editorId = this._contextService.getContextValue(FOCUSING_FX_BAR_EDITOR) ? DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY : this._editorBridgeService.getCurrentEditorId();
11743
11807
  if (resetPointerSelection) {
11744
- var _this$_renderManagerS5;
11745
- (_this$_renderManagerS5 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS5 === void 0 || _this$_renderManagerS5.with(DocSelectionRenderService).cancelPointerSelection();
11808
+ var _this$_renderManagerS6;
11809
+ (_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS6 === void 0 || _this$_renderManagerS6.with(DocSelectionRenderService).cancelPointerSelection();
11746
11810
  }
11747
11811
  this._emptyDocumentDataModel(documentDataModel.getSnapshot().documentStyle, !!isInArrayFormulaRange);
11748
11812
  document.makeDirty();
@@ -11820,7 +11884,7 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11820
11884
  collapsed: true
11821
11885
  });
11822
11886
  }
11823
- (_this$_renderManagerS6 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS6 === void 0 || _this$_renderManagerS6.scene.resetCursor();
11887
+ (_this$_renderManagerS7 = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS7 === void 0 || _this$_renderManagerS7.scene.resetCursor();
11824
11888
  }
11825
11889
  _resizeEditorOnOpen(param, editorObject, isInArrayFormulaRange) {
11826
11890
  var _this$_sheetCellEdito4;
@@ -11836,8 +11900,8 @@ let EditingRenderController = class EditingRenderController extends Disposable {
11836
11900
  if (!pointerPosition || isInArrayFormulaRange) return;
11837
11901
  const rect = engine.getCanvasElement().getBoundingClientRect();
11838
11902
  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 });
11903
+ var _this$_renderManagerS8;
11904
+ (_this$_renderManagerS8 = this._renderManagerService.getRenderUnitById(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS8 === void 0 || _this$_renderManagerS8.with(DocSelectionRenderService).setCursorManually((pointerPosition.x - rect.left) * engine.width / rect.width, (pointerPosition.y - rect.top) * engine.height / rect.height, true, true, { strict: false });
11841
11905
  }
11842
11906
  });
11843
11907
  }
@@ -12039,12 +12103,12 @@ let EditingRenderController = class EditingRenderController extends Disposable {
12039
12103
  return this._univerInstanceService.getUnit(DOCS_NORMAL_EDITOR_UNIT_ID_KEY, UniverInstanceType.UNIVER_DOC);
12040
12104
  }
12041
12105
  _getEditorSkeleton(editorId) {
12042
- var _this$_renderManagerS8;
12043
- return (_this$_renderManagerS8 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS8 === void 0 ? void 0 : _this$_renderManagerS8.with(DocSkeletonManagerService).getSkeleton();
12106
+ var _this$_renderManagerS9;
12107
+ return (_this$_renderManagerS9 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS9 === void 0 ? void 0 : _this$_renderManagerS9.with(DocSkeletonManagerService).getSkeleton();
12044
12108
  }
12045
12109
  _getEditorViewModel(editorId) {
12046
- var _this$_renderManagerS9;
12047
- return (_this$_renderManagerS9 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS9 === void 0 ? void 0 : _this$_renderManagerS9.with(DocSkeletonManagerService).getViewModel();
12110
+ var _this$_renderManagerS10;
12111
+ return (_this$_renderManagerS10 = this._renderManagerService.getRenderUnitById(editorId)) === null || _this$_renderManagerS10 === void 0 ? void 0 : _this$_renderManagerS10.with(DocSkeletonManagerService).getViewModel();
12048
12112
  }
12049
12113
  _getEditingUnit() {
12050
12114
  return this._editingUnit ? this._univerInstanceService.getUnit(this._editingUnit, UniverInstanceType.UNIVER_SHEET) : null;
@@ -12102,13 +12166,13 @@ function getCellDataByInput(cellData, snapshot, lexerTreeBuilder, localeService,
12102
12166
  cellData.si = null;
12103
12167
  cellData.p = snapshot;
12104
12168
  cellData.t = CellValueType.STRING;
12105
- } else if (cellData.s && isTextFormat(styles === null || styles === void 0 || (_styles$get = styles.get(cellData.s)) === null || _styles$get === void 0 || (_styles$get = _styles$get.n) === null || _styles$get === void 0 ? void 0 : _styles$get.pattern)) {
12169
+ } else if (newDataStream !== "" && cellData.s && isTextFormat(styles === null || styles === void 0 || (_styles$get = styles.get(cellData.s)) === null || _styles$get === void 0 || (_styles$get = _styles$get.n) === null || _styles$get === void 0 ? void 0 : _styles$get.pattern)) {
12106
12170
  cellData.v = newDataStream;
12107
12171
  cellData.f = null;
12108
12172
  cellData.si = null;
12109
12173
  cellData.p = null;
12110
12174
  cellData.t = CellValueType.STRING;
12111
- if (isRichText(body) && body.dataStream !== "\r\n") cellData.p = snapshot;
12175
+ if (isRichText(body)) cellData.p = snapshot;
12112
12176
  const style = getCellStyleBySnapshot(snapshot);
12113
12177
  if (style) cellData.s = style;
12114
12178
  } else if (isFormulaString(newDataStream)) {
@@ -12125,21 +12189,14 @@ function getCellDataByInput(cellData, snapshot, lexerTreeBuilder, localeService,
12125
12189
  cellData.si = null;
12126
12190
  cellData.p = null;
12127
12191
  cellData.t = CellValueType.FORCE_STRING;
12128
- } else if (isRichText(body)) {
12129
- if (body.dataStream === "\r\n") {
12130
- cellData.v = "";
12131
- cellData.f = null;
12132
- cellData.si = null;
12133
- cellData.p = null;
12134
- } else {
12135
- cellData.p = snapshot;
12136
- cellData.v = null;
12137
- cellData.f = null;
12138
- cellData.si = null;
12139
- }
12192
+ } else if (newDataStream !== "" && isRichText(body)) {
12193
+ cellData.p = snapshot;
12194
+ cellData.v = null;
12195
+ cellData.f = null;
12196
+ cellData.si = null;
12140
12197
  } else {
12141
- if (newDataStream === "" && cellData.v == null && cellData.p == null) return null;
12142
- cellData.v = newDataStream;
12198
+ if (newDataStream === "" && cellData.v == null && cellData.p == null && cellData.f == null && cellData.si == null) return null;
12199
+ cellData.v = newDataStream === "" ? null : newDataStream;
12143
12200
  cellData.f = null;
12144
12201
  cellData.si = null;
12145
12202
  cellData.p = null;
@@ -14684,6 +14741,7 @@ let HeaderFreezeRenderController = class HeaderFreezeRenderController extends Di
14684
14741
  if (row === -1 || row === 0) isTopView = false;
14685
14742
  if (column === -1 || column === 0) isLeftView = false;
14686
14743
  const startSheetView = skeleton.getNoMergeCellWithCoordByIndex(row - ySplit, column - xSplit, false);
14744
+ if (isTopView && row === ySplit) startSheetView.startY = 0;
14687
14745
  const endSheetView = skeleton.getNoMergeCellWithCoordByIndex(row, column, false);
14688
14746
  viewMainLeftTop.disable();
14689
14747
  viewMainTop.disable();
@@ -14916,6 +14974,10 @@ let HeaderFreezeRenderController = class HeaderFreezeRenderController extends Di
14916
14974
  * When switching sheet tabs, it is necessary to update the frozen state of the current view.
14917
14975
  */
14918
14976
  _skeletonListener() {
14977
+ this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.pipe(switchMap((param) => {
14978
+ var _param$skeleton;
14979
+ return (param === null || param === void 0 || (_param$skeleton = param.skeleton) === null || _param$skeleton === void 0 ? void 0 : _param$skeleton.gapConfigChanged$) ?? EMPTY;
14980
+ })).subscribe(() => this._refreshCurrent()));
14919
14981
  this.disposeWithMe(toDisposable(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((param) => {
14920
14982
  if ([
14921
14983
  SetWorksheetActiveOperation.id,
@@ -17451,51 +17513,51 @@ const BORDER_LINE_CHILDREN = [
17451
17513
  ];
17452
17514
  const BORDER_SIZE_CHILDREN = [
17453
17515
  {
17454
- label: BorderStyleTypes.THIN,
17516
+ label: "sheets-ui.borderStyle.thin",
17455
17517
  value: BorderStyleTypes.THIN
17456
17518
  },
17457
17519
  {
17458
- label: BorderStyleTypes.HAIR,
17520
+ label: "sheets-ui.borderStyle.hair",
17459
17521
  value: BorderStyleTypes.HAIR
17460
17522
  },
17461
17523
  {
17462
- label: BorderStyleTypes.DOTTED,
17524
+ label: "sheets-ui.borderStyle.dotted",
17463
17525
  value: BorderStyleTypes.DOTTED
17464
17526
  },
17465
17527
  {
17466
- label: BorderStyleTypes.DASHED,
17528
+ label: "sheets-ui.borderStyle.dashed",
17467
17529
  value: BorderStyleTypes.DASHED
17468
17530
  },
17469
17531
  {
17470
- label: BorderStyleTypes.DASH_DOT,
17532
+ label: "sheets-ui.borderStyle.dashDot",
17471
17533
  value: BorderStyleTypes.DASH_DOT
17472
17534
  },
17473
17535
  {
17474
- label: BorderStyleTypes.DASH_DOT_DOT,
17536
+ label: "sheets-ui.borderStyle.dashDotDot",
17475
17537
  value: BorderStyleTypes.DASH_DOT_DOT
17476
17538
  },
17477
17539
  {
17478
- label: BorderStyleTypes.MEDIUM,
17540
+ label: "sheets-ui.borderStyle.medium",
17479
17541
  value: BorderStyleTypes.MEDIUM
17480
17542
  },
17481
17543
  {
17482
- label: BorderStyleTypes.MEDIUM_DASHED,
17544
+ label: "sheets-ui.borderStyle.mediumDashed",
17483
17545
  value: BorderStyleTypes.MEDIUM_DASHED
17484
17546
  },
17485
17547
  {
17486
- label: BorderStyleTypes.MEDIUM_DASH_DOT,
17548
+ label: "sheets-ui.borderStyle.mediumDashDot",
17487
17549
  value: BorderStyleTypes.MEDIUM_DASH_DOT
17488
17550
  },
17489
17551
  {
17490
- label: BorderStyleTypes.MEDIUM_DASH_DOT_DOT,
17552
+ label: "sheets-ui.borderStyle.mediumDashDotDot",
17491
17553
  value: BorderStyleTypes.MEDIUM_DASH_DOT_DOT
17492
17554
  },
17493
17555
  {
17494
- label: BorderStyleTypes.THICK,
17556
+ label: "sheets-ui.borderStyle.thick",
17495
17557
  value: BorderStyleTypes.THICK
17496
17558
  },
17497
17559
  {
17498
- label: BorderStyleTypes.DOUBLE,
17560
+ label: "sheets-ui.borderStyle.double",
17499
17561
  value: BorderStyleTypes.DOUBLE
17500
17562
  }
17501
17563
  ];
@@ -19525,6 +19587,7 @@ function PasteRibbonMenuItemFactory(accessor) {
19525
19587
  return {
19526
19588
  ...PasteSpacialMenuItemFactory(accessor),
19527
19589
  id: PASTE_RIBBON_MENU_ID,
19590
+ icon: "DocPasteOptionsIcon",
19528
19591
  title: "sheets-ui.rightClick.paste",
19529
19592
  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
19593
  };
@@ -19797,6 +19860,9 @@ function SetColWidthMenuItemFactory(accessor) {
19797
19860
  //#endregion
19798
19861
  //#region src/menu/merge.menu.ts
19799
19862
  function CellMergeMenuItemFactory(accessor) {
19863
+ const commandService = accessor.get(ICommandService);
19864
+ const instanceService = accessor.get(IUniverInstanceService);
19865
+ const selectionService = accessor.get(SheetsSelectionsService);
19800
19866
  const editDisabled$ = getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, {
19801
19867
  workbookTypes: [WorkbookEditablePermission],
19802
19868
  worksheetTypes: [
@@ -19812,6 +19878,22 @@ function CellMergeMenuItemFactory(accessor) {
19812
19878
  icon: "MergeAllIcon",
19813
19879
  tooltip: "sheets-ui.toolbar.mergeCell.main",
19814
19880
  type: MenuItemType.SUBITEMS,
19881
+ activated$: deriveStateFromActiveSheet$(instanceService, false, ({ worksheet }) => new Observable((subscriber) => {
19882
+ const update = () => {
19883
+ var _selectionService$get;
19884
+ const primary = (_selectionService$get = selectionService.getCurrentLastSelection()) === null || _selectionService$get === void 0 ? void 0 : _selectionService$get.primary;
19885
+ subscriber.next(!!primary && !!worksheet.getMergedCell(primary.actualRow, primary.actualColumn));
19886
+ };
19887
+ const selectionSubscription = selectionService.selectionChanged$.subscribe(update);
19888
+ const commandDisposable = commandService.onCommandExecuted((command) => {
19889
+ if (command.id === AddWorksheetMergeMutation.id || command.id === RemoveWorksheetMergeMutation.id) update();
19890
+ });
19891
+ update();
19892
+ return () => {
19893
+ selectionSubscription.unsubscribe();
19894
+ commandDisposable.dispose();
19895
+ };
19896
+ })).pipe(distinctUntilChanged()),
19815
19897
  hidden$: combineLatest([getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET), accessor.get(IContextService).subscribeContextValue$(FOCUSING_COMMON_DRAWINGS).pipe(startWith(false))]).pipe(map(([hidden, focusingDrawing]) => hidden || focusingDrawing)),
19816
19898
  disabled$: editDisabled$.pipe(combineLatestWith(selectionsHasCross$), map(([disable, hasCross]) => disable || hasCross))
19817
19899
  };
@@ -20395,18 +20477,6 @@ function Text2NumberContextMenuItemFactory(accessor) {
20395
20477
  };
20396
20478
  }
20397
20479
 
20398
- //#endregion
20399
- //#region src/views/sheet-slider/SheetZoomInput.tsx
20400
- const SHEET_ZOOM_INPUT_COMPONENT = "SHEET_ZOOM_INPUT_COMPONENT";
20401
- function SheetZoomInput({ className, ...props }) {
20402
- const commandService = useDependency(ICommandService);
20403
- return /* @__PURE__ */ jsx(ZoomInput, {
20404
- ...props,
20405
- className: clsx("!univer-bg-transparent dark:!univer-bg-transparent", className),
20406
- onChange: (value) => commandService.executeCommand(SetZoomRatioFromToolbarCommand.id, { value })
20407
- });
20408
- }
20409
-
20410
20480
  //#endregion
20411
20481
  //#region src/menu/zoom.menu.ts
20412
20482
  const ZOOM_RATIO_MENU_ID = "sheet.menu.zoom-ratio";
@@ -20435,16 +20505,14 @@ function getZoomRatioValue$(accessor) {
20435
20505
  function ZoomRatioMenuItemFactory(accessor) {
20436
20506
  return {
20437
20507
  id: ZOOM_RATIO_MENU_ID,
20438
- commandId: SetZoomRatioFromToolbarCommand.id,
20439
- type: MenuItemType.BUTTON,
20440
- label: {
20441
- name: SHEET_ZOOM_INPUT_COMPONENT,
20442
- props: {
20443
- min: SHEET_ZOOM_RANGE[0],
20444
- max: SHEET_ZOOM_RANGE[1],
20445
- shortcuts: ZOOM_RATIO_LIST
20446
- }
20447
- },
20508
+ selectionsCommandId: SetZoomRatioFromToolbarCommand.id,
20509
+ type: MenuItemType.SELECTOR,
20510
+ icon: "ZoomInIcon",
20511
+ tooltip: "sheets-ui.toolbar.zoom",
20512
+ selections: ZOOM_RATIO_LIST.map((value) => ({
20513
+ value,
20514
+ label: `${value}%`
20515
+ })),
20448
20516
  value$: getZoomRatioValue$(accessor),
20449
20517
  hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET)
20450
20518
  };
@@ -20681,31 +20749,29 @@ const menuSchema = {
20681
20749
  order: 1,
20682
20750
  gridLayout: {
20683
20751
  row: 1,
20684
- column: 2,
20685
- width: 112
20752
+ column: 2
20686
20753
  },
20687
20754
  menuItemFactory: ZoomRatioMenuItemFactory
20755
+ }
20756
+ },
20757
+ [RibbonViewGroup.VISIBILITY]: {
20758
+ [ToggleGridlinesCommand.id]: {
20759
+ order: 0,
20760
+ gridLayout: {
20761
+ row: 1,
20762
+ column: 1
20763
+ },
20764
+ menuItemFactory: ToggleGridlinesMenuFactory
20688
20765
  },
20689
20766
  [ToggleFullscreenOperation.id]: {
20690
- order: 2,
20767
+ order: 1,
20691
20768
  gridLayout: {
20692
20769
  row: 2,
20693
- column: 2,
20694
- showLabel: true,
20695
- width: 112
20770
+ column: 1
20696
20771
  },
20697
20772
  menuItemFactory: FullscreenMenuItemFactory
20698
20773
  }
20699
- },
20700
- [RibbonViewGroup.VISIBILITY]: { [ToggleGridlinesCommand.id]: {
20701
- order: 0,
20702
- gridLayout: {
20703
- row: 1,
20704
- column: 1,
20705
- showLabel: true
20706
- },
20707
- menuItemFactory: ToggleGridlinesMenuFactory
20708
- } }
20774
+ }
20709
20775
  },
20710
20776
  [ContextMenuPosition.MAIN_AREA]: {
20711
20777
  [ContextMenuGroup.QUICK]: {
@@ -22120,11 +22186,15 @@ function DefinedName({ disable }) {
22120
22186
  return /* @__PURE__ */ jsxs("div", {
22121
22187
  ref: nameBoxRef,
22122
22188
  "data-u-comp": "defined-name",
22189
+ onMouseDown: (e) => {
22190
+ if (disable) e.preventDefault();
22191
+ },
22123
22192
  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",
22124
22193
  children: [/* @__PURE__ */ jsx("input", {
22125
22194
  ref: inputRef,
22126
22195
  className: clsx("univer-box-border univer-size-full univer-appearance-none univer-bg-transparent univer-pl-1.5 univer-pr-5 univer-text-gray-900 focus:univer-outline-none dark:!univer-border-r-gray-700 dark:!univer-text-gray-0", borderRightClassName, { "univer-cursor-not-allowed": disable }),
22127
22196
  type: "text",
22197
+ disabled: disable,
22128
22198
  value: inputValue,
22129
22199
  onChange: handleChangeSelection,
22130
22200
  onKeyDown: handleKeyDown,
@@ -22141,7 +22211,7 @@ function DefinedName({ disable }) {
22141
22211
  })
22142
22212
  }),
22143
22213
  disabled: disable,
22144
- open,
22214
+ open: !disable && open,
22145
22215
  onOpenChange: setOpen,
22146
22216
  onOpenAutoFocus: (e) => e.preventDefault(),
22147
22217
  children: /* @__PURE__ */ jsx("a", {
@@ -22322,7 +22392,7 @@ function FormulaBar(props) {
22322
22392
  children: [
22323
22393
  /* @__PURE__ */ jsx("div", {
22324
22394
  className: "univer-relative univer-box-border univer-h-full univer-w-[100px]",
22325
- children: /* @__PURE__ */ jsx(DefinedName, { disable: disableDefinedName ?? editDisable })
22395
+ children: /* @__PURE__ */ jsx(DefinedName, { disable: iconActivated || (disableDefinedName ?? editDisable) })
22326
22396
  }),
22327
22397
  /* @__PURE__ */ jsxs("div", {
22328
22398
  className: "univer-flex univer-size-full",
@@ -23513,6 +23583,7 @@ function SheetBarTabs() {
23513
23583
  const slideTabBarContainerRef = useRef(null);
23514
23584
  const activeSheetIdRef = useRef(activeSheetId);
23515
23585
  const commandService = useDependency(ICommandService);
23586
+ const layoutService = useDependency(ILayoutService);
23516
23587
  const renderManagerService = useDependency(IRenderManagerService);
23517
23588
  const sheetBarService = useDependency(ISheetBarService);
23518
23589
  const localeService = useDependency(LocaleService);
@@ -23698,6 +23769,7 @@ function SheetBarTabs() {
23698
23769
  subUnitId,
23699
23770
  unitId: workbookRef.current.getUnitId()
23700
23771
  }).then((result) => {
23772
+ requestAnimationFrame(() => layoutService.focus(workbookRef.current.getUnitId()));
23701
23773
  if (result !== false) return;
23702
23774
  const worksheet = workbookRef.current.getSheetBySheetId(subUnitId);
23703
23775
  if (worksheet) {
@@ -23705,7 +23777,11 @@ function SheetBarTabs() {
23705
23777
  syncActiveSheetRender(subUnitId);
23706
23778
  }
23707
23779
  });
23708
- }, [commandService, syncActiveSheetRender]);
23780
+ }, [
23781
+ commandService,
23782
+ layoutService,
23783
+ syncActiveSheetRender
23784
+ ]);
23709
23785
  const observeResize = useCallback((slideTabBar) => {
23710
23786
  var _slideTabBarContainer;
23711
23787
  const slideTabBarContainer = (_slideTabBarContainer = slideTabBarContainerRef.current) === null || _slideTabBarContainer === void 0 ? void 0 : _slideTabBarContainer.querySelector("[data-u-comp=slide-tab-bar]");
@@ -25015,7 +25091,7 @@ const useHighlightRange = (ranges = []) => {
25015
25091
  //#endregion
25016
25092
  //#region package.json
25017
25093
  var name = "@univerjs/sheets-ui";
25018
- var version = "1.0.4";
25094
+ var version = "1.2.0";
25019
25095
 
25020
25096
  //#endregion
25021
25097
  //#region src/views/cell-popup/config.ts
@@ -25348,7 +25424,7 @@ function CellAlert({ popup, DropdownMenuComponent = DropdownMenu }) {
25348
25424
  const [isHovered, setIsHovered] = useState(false);
25349
25425
  const alert = (_popup$extraProps = popup.extraProps) === null || _popup$extraProps === void 0 ? void 0 : _popup$extraProps.alert;
25350
25426
  if (!alert) return null;
25351
- const { type, title, message, menu } = alert;
25427
+ const { type, title, message, menu, action, width } = alert;
25352
25428
  if (menu === null || menu === void 0 ? void 0 : menu.length) {
25353
25429
  const accessibleLabel = [title, message].filter((value) => typeof value === "string").join(": ");
25354
25430
  const showMore = visible || isHovered;
@@ -25388,14 +25464,24 @@ function CellAlert({ popup, DropdownMenuComponent = DropdownMenu }) {
25388
25464
  [1]: /* @__PURE__ */ jsx(WarningIcon, { className: "univer-text-yellow-500" })
25389
25465
  };
25390
25466
  return /* @__PURE__ */ jsxs("div", {
25391
- className: "univer-z-[100] univer-box-border univer-w-[156px] univer-rounded-lg univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0",
25392
- children: [/* @__PURE__ */ jsxs("div", {
25393
- className: "univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-gap-x-1.5 univer-text-sm univer-font-medium",
25394
- children: [type ? iconMap[type] : null, title]
25395
- }), /* @__PURE__ */ jsx("div", {
25396
- className: "univer-text-sm",
25397
- children: message
25398
- })]
25467
+ style: { width },
25468
+ className: "univer-z-[100] univer-box-border univer-rounded-lg univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-gray-900 univer-shadow dark:!univer-bg-gray-1000 dark:!univer-text-gray-0",
25469
+ children: [
25470
+ /* @__PURE__ */ jsxs("div", {
25471
+ className: "univer-mb-1.5 univer-flex univer-h-5 univer-flex-row univer-items-center univer-gap-x-1.5 univer-text-sm univer-font-medium",
25472
+ children: [type ? iconMap[type] : null, title]
25473
+ }),
25474
+ /* @__PURE__ */ jsx("div", {
25475
+ className: "univer-text-sm",
25476
+ children: message
25477
+ }),
25478
+ action && /* @__PURE__ */ jsx(Button, {
25479
+ className: "univer-mt-2",
25480
+ disabled: action.disabled,
25481
+ onClick: action.onSelect,
25482
+ children: action.label
25483
+ })
25484
+ ]
25399
25485
  });
25400
25486
  }
25401
25487
 
@@ -25423,15 +25509,17 @@ let CellAlertManagerService = class CellAlertManagerService extends Disposable {
25423
25509
  _defineProperty(this, "_currentAlert", /* @__PURE__ */ new Map());
25424
25510
  _defineProperty(this, "currentAlert$", this._currentAlert$.asObservable());
25425
25511
  this.disposeWithMe(() => {
25512
+ this.clearAlert();
25426
25513
  this._currentAlert$.complete();
25427
25514
  });
25428
25515
  }
25429
25516
  showAlert(alert) {
25430
25517
  var _alert$menu, _alert$menu2, _alert$menu3;
25431
25518
  let lastPopup = this._currentAlert.get(alert.key);
25432
- if (lastPopup) lastPopup.dispose.dispose();
25433
- if (lastPopup) lastPopup.dispose.dispose();
25434
- else {
25519
+ if (lastPopup) {
25520
+ lastPopup.dispose.dispose();
25521
+ lastPopup.alert = alert;
25522
+ } else {
25435
25523
  lastPopup = {
25436
25524
  alert,
25437
25525
  dispose: { dispose() {} }
@@ -25454,13 +25542,7 @@ let CellAlertManagerService = class CellAlertManagerService extends Disposable {
25454
25542
  extraProps: { alert },
25455
25543
  priority: 1
25456
25544
  });
25457
- if (disposable) {
25458
- if (lastPopup) {
25459
- var _lastPopup$dispose;
25460
- (_lastPopup$dispose = lastPopup.dispose) === null || _lastPopup$dispose === void 0 || _lastPopup$dispose.dispose();
25461
- }
25462
- lastPopup.dispose = disposable;
25463
- }
25545
+ if (disposable) lastPopup.dispose = disposable;
25464
25546
  this._currentAlert$.next(Array.from(this._currentAlert.entries()));
25465
25547
  }
25466
25548
  removeAlert(key) {
@@ -26312,8 +26394,8 @@ function SelectList(props) {
26312
26394
  const filteredOptions = useMemo(() => {
26313
26395
  return options.filter((item) => lowerFilter ? item.label.toLowerCase().includes(lowerFilter) : true);
26314
26396
  }, [options, lowerFilter]);
26315
- const handleSearchChange = (e) => {
26316
- setLowerFilter(e.target.value.toLowerCase());
26397
+ const handleSearchChange = (value) => {
26398
+ setLowerFilter(value.toLowerCase());
26317
26399
  };
26318
26400
  const sheetPermissionCheckController = useDependency(SheetPermissionCheckController);
26319
26401
  const hasPermission = useMemo(() => sheetPermissionCheckController.permissionCheckWithRanges({
@@ -26339,9 +26421,8 @@ function SelectList(props) {
26339
26421
  children: [
26340
26422
  showSearchOnDropdown && /* @__PURE__ */ jsx("div", {
26341
26423
  className: "univer-box-border univer-flex univer-w-full univer-px-2",
26342
- children: /* @__PURE__ */ jsx("input", {
26424
+ children: /* @__PURE__ */ jsx(Input, {
26343
26425
  ref: searchRef,
26344
- className: clsx("univer-w-full univer-rounded-md univer-bg-gray-0 univer-px-2 univer-py-1 univer-text-sm univer-text-gray-900 focus:univer-border-primary-500 focus:univer-outline-none dark:!univer-bg-gray-1000 dark:!univer-text-gray-0", borderClassName),
26345
26426
  type: "text",
26346
26427
  value: lowerFilter,
26347
26428
  autoFocus: true,
@@ -26370,14 +26451,16 @@ function SelectList(props) {
26370
26451
  const index = item.label.toLocaleLowerCase().indexOf(lowerFilter);
26371
26452
  const isThemeColor = Boolean(((_item$color = item.color) === null || _item$color === void 0 ? void 0 : _item$color.includes(".")) && themeService.isValidThemeColor(item.color));
26372
26453
  const backgroundColor = isThemeColor ? themeService.getColorFromTheme(item.color) : item.color;
26373
- const isDark = new ColorKit(backgroundColor).isDark();
26454
+ const color = new ColorKit(backgroundColor);
26455
+ const hasBackground = Boolean(backgroundColor) && backgroundColor !== "transparent" && color.getAlpha() > 0;
26456
+ const isDark = color.isDark();
26374
26457
  return /* @__PURE__ */ jsxs("div", {
26375
26458
  className: "univer-flex univer-cursor-pointer univer-flex-row univer-items-center univer-justify-between univer-rounded-md univer-px-1.5 univer-py-1 hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-700",
26376
26459
  onClick: handleClick,
26377
26460
  children: [/* @__PURE__ */ jsx("div", {
26378
26461
  className: clsx("univer-inline-flex univer-h-4 univer-w-fit univer-items-center univer-truncate univer-rounded-full univer-px-1.5 univer-text-xs", {
26379
- "univer-text-gray-900": isThemeColor || !isDark,
26380
- "univer-text-gray-0": !isThemeColor && isDark
26462
+ "univer-text-gray-900": hasBackground && (isThemeColor || !isDark),
26463
+ "univer-text-gray-0": hasBackground && !isThemeColor && isDark
26381
26464
  }),
26382
26465
  style: { background: backgroundColor },
26383
26466
  children: lowerFilter && item.label.toLowerCase().includes(lowerFilter) ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -27042,6 +27125,7 @@ function BorderLine(props) {
27042
27125
  //#endregion
27043
27126
  //#region src/views/border-panel/BorderPanel.tsx
27044
27127
  function BorderPanel(props) {
27128
+ const localeService = useDependency(LocaleService);
27045
27129
  const iconManager = useDependency(IconManager);
27046
27130
  const selectionManagerService = useDependency(SheetsSelectionsService);
27047
27131
  const { direction } = useContext(ConfigContext);
@@ -27107,7 +27191,7 @@ function BorderPanel(props) {
27107
27191
  className: "univer-m-0 univer-grid univer-list-none univer-gap-1 univer-p-0",
27108
27192
  children: BORDER_SIZE_CHILDREN.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("button", {
27109
27193
  type: "button",
27110
- "aria-label": BorderStyleTypes[item.value],
27194
+ "aria-label": localeService.t(item.label),
27111
27195
  "aria-pressed": item.value === value.style,
27112
27196
  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 }),
27113
27197
  onClick: () => handleClick(item.value, "style"),
@@ -27524,7 +27608,7 @@ const DefinedNameContainer = ({ ConfirmComponent = Confirm, DefinedNameInputComp
27524
27608
  children: [/* @__PURE__ */ jsxs("div", {
27525
27609
  className: "univer-my-1 univer-max-h-[100px] univer-max-w-[190px] univer-truncate univer-text-sm univer-font-medium univer-text-gray-900 dark:!univer-text-gray-0",
27526
27610
  children: [definedName.name, /* @__PURE__ */ jsx("span", {
27527
- className: "univer-text-xxs univer-ml-1 univer-text-gray-400",
27611
+ className: "univer-ml-1 univer-text-xs univer-text-gray-400",
27528
27612
  children: definedName.localSheetId === SCOPE_WORKBOOK_VALUE_DEFINED_NAME || definedName.localSheetId == null ? "" : getSheetNameBySheetId(definedName.localSheetId)
27529
27613
  })]
27530
27614
  }), /* @__PURE__ */ jsx("div", {
@@ -27655,16 +27739,35 @@ function MobileMenuItemInput(props) {
27655
27739
  const { prefix, suffix, value, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, disabled$, onChange } = props;
27656
27740
  const localeService = useDependency(LocaleService);
27657
27741
  const disabled = useObservable(disabled$ ?? null, false);
27658
- const inputValue = Math.min(max, Math.max(min, Number(value)));
27742
+ const [draft, setDraft] = useState(null);
27743
+ const inputValue = draft !== null && draft.source === value ? draft.value : Math.min(max, Math.max(min, Number(value)));
27744
+ if (draft !== null && draft.source !== value) setDraft(null);
27659
27745
  function handleChange(nextValue) {
27660
- if (nextValue == null) return;
27746
+ setDraft({
27747
+ source: value,
27748
+ value: nextValue
27749
+ });
27750
+ }
27751
+ function handleConfirm() {
27752
+ if (disabled || inputValue == null || !Number.isFinite(inputValue)) return;
27753
+ const nextValue = Math.min(max, Math.max(min, inputValue));
27754
+ setDraft({
27755
+ source: value,
27756
+ value: nextValue
27757
+ });
27661
27758
  onChange(nextValue.toString());
27662
27759
  }
27663
27760
  function handleKeyDown(event) {
27761
+ if (event.key === "Escape" && !event.nativeEvent.isComposing) return;
27664
27762
  event.stopPropagation();
27763
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) {
27764
+ event.preventDefault();
27765
+ handleConfirm();
27766
+ }
27665
27767
  }
27666
27768
  return /* @__PURE__ */ jsxs("div", {
27667
- className: "univer-flex univer-min-w-0 univer-flex-1 univer-items-center univer-gap-2",
27769
+ className: "univer-flex univer-min-w-0 univer-flex-1 univer-flex-wrap univer-items-center univer-gap-2",
27770
+ onClick: (event) => event.stopPropagation(),
27668
27771
  children: [
27669
27772
  /* @__PURE__ */ jsx("span", {
27670
27773
  className: "univer-shrink-0 univer-text-base univer-font-medium",
@@ -27672,13 +27775,11 @@ function MobileMenuItemInput(props) {
27672
27775
  }),
27673
27776
  /* @__PURE__ */ jsx("div", {
27674
27777
  className: "univer-w-20 univer-shrink-0",
27675
- onClick: (event) => event.stopPropagation(),
27676
27778
  children: /* @__PURE__ */ jsx(InputNumber, {
27677
27779
  value: inputValue,
27678
27780
  size: "small",
27679
27781
  precision: 0,
27680
- min,
27681
- max,
27782
+ allowEmpty: true,
27682
27783
  disabled,
27683
27784
  onKeyDown: handleKeyDown,
27684
27785
  onChange: handleChange
@@ -27687,6 +27788,15 @@ function MobileMenuItemInput(props) {
27687
27788
  /* @__PURE__ */ jsx("span", {
27688
27789
  className: "univer-min-w-0 univer-truncate univer-text-base univer-font-medium",
27689
27790
  children: localeService.t(suffix)
27791
+ }),
27792
+ /* @__PURE__ */ jsx(Button, {
27793
+ type: "button",
27794
+ variant: "primary",
27795
+ size: "large",
27796
+ className: "univer-shrink-0",
27797
+ disabled: disabled || inputValue == null || !Number.isFinite(inputValue),
27798
+ onClick: handleConfirm,
27799
+ children: localeService.t("sheets-ui.button.confirm")
27690
27800
  })
27691
27801
  ]
27692
27802
  });
@@ -28710,7 +28820,7 @@ function SheetPermissionPanelListContent({ ActionRowComponent }) {
28710
28820
  rule.description && /* @__PURE__ */ jsx(Tooltip, {
28711
28821
  title: rule.description,
28712
28822
  children: /* @__PURE__ */ jsx("div", {
28713
- className: "univer-text-3 univer-mt-2 univer-max-w-64 univer-truncate univer-text-sm univer-text-gray-400",
28823
+ className: "univer-mt-2 univer-max-w-64 univer-truncate univer-text-sm univer-text-gray-400",
28714
28824
  children: rule.description
28715
28825
  })
28716
28826
  })
@@ -28981,6 +29091,7 @@ const sheetsUIIcons = {
28981
29091
  DeleteColumnDoubleIcon,
28982
29092
  DeleteIcon,
28983
29093
  DeleteRowDoubleIcon,
29094
+ DocPasteOptionsIcon,
28984
29095
  DownBorderDoubleIcon,
28985
29096
  DownloadImageIcon,
28986
29097
  EyeIcon,
@@ -29038,7 +29149,8 @@ const sheetsUIIcons = {
29038
29149
  VerticalCenterIcon,
29039
29150
  VerticalIntegrationIcon,
29040
29151
  VerticalTextIcon,
29041
- WriteIcon
29152
+ WriteIcon,
29153
+ ZoomInIcon
29042
29154
  };
29043
29155
 
29044
29156
  //#endregion
@@ -29054,7 +29166,6 @@ let MobileComponentsController = class MobileComponentsController extends Dispos
29054
29166
  this.disposeWithMe(componentManager.register(CascaderDropdown.componentKey, CascaderDropdown));
29055
29167
  this.disposeWithMe(componentManager.register(MENU_ITEM_INPUT_COMPONENT, MobileMenuItemInput));
29056
29168
  this.disposeWithMe(componentManager.register(MENU_ITEM_FROZEN_COMPONENT, MenuItemFrozen));
29057
- this.disposeWithMe(componentManager.register(SHEET_ZOOM_INPUT_COMPONENT, SheetZoomInput));
29058
29169
  this.disposeWithMe(componentManager.register(BORDER_PANEL_COMPONENT, MobileBorderPanel));
29059
29170
  this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, MobileDefinedNameContainer));
29060
29171
  this.disposeWithMe(componentManager.register(CELL_POPUP_COMPONENT_KEY, CellPopup));
@@ -30718,6 +30829,7 @@ function MobileBorderColorView(props) {
30718
30829
  }
30719
30830
  function MobileBorderStyleView(props) {
30720
30831
  const { value, onExecute } = props;
30832
+ const localeService = useDependency(LocaleService);
30721
30833
  return /* @__PURE__ */ jsx("div", {
30722
30834
  className: "univer-overflow-hidden univer-rounded-xl univer-bg-gray-0 dark:!univer-bg-gray-800",
30723
30835
  children: BORDER_SIZE_CHILDREN.map((option, index) => /* @__PURE__ */ jsxs("button", {
@@ -30737,7 +30849,7 @@ function MobileBorderStyleView(props) {
30737
30849
  }),
30738
30850
  /* @__PURE__ */ jsx("span", {
30739
30851
  className: "univer-flex-1 univer-text-left univer-text-sm",
30740
- children: option.value
30852
+ children: localeService.t(option.label)
30741
30853
  }),
30742
30854
  value.style === option.value && /* @__PURE__ */ jsx(CheckMarkIcon, { className: "univer-text-primary-600 dark:!univer-text-primary-400" })
30743
30855
  ]
@@ -31282,7 +31394,11 @@ function MobileFormulaBar() {
31282
31394
  let cursorFrame;
31283
31395
  const contentFrame = requestAnimationFrame(() => {
31284
31396
  editorBridgeService.refreshEditCellState();
31285
- editorService.focus(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31397
+ if (editorService.getFocusId() !== DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) editorService.focus(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31398
+ else {
31399
+ var _editorService$getEdi;
31400
+ (_editorService$getEdi = editorService.getEditor(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)) === null || _editorService$getEdi === void 0 || _editorService$getEdi.focus();
31401
+ }
31286
31402
  cursorFrame = requestAnimationFrame(() => {
31287
31403
  var _editor$getDocumentDa;
31288
31404
  const editor = editorService.getEditor(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
@@ -31844,7 +31960,7 @@ const MobileFormulaBarSubmitCommand = {
31844
31960
  id: MOBILE_FORMULA_BAR_SUBMIT_COMMAND_ID,
31845
31961
  type: CommandType.COMMAND,
31846
31962
  async handler(accessor) {
31847
- var _accessor$get$getCurr, _workbook$getActiveSh, _formulaModel$getBody, _accessor$get$getEdit;
31963
+ var _accessor$get$getCurr, _workbook$getActiveSh, _formulaModel$getBody;
31848
31964
  const instanceService = accessor.get(IUniverInstanceService);
31849
31965
  const workbook = instanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
31850
31966
  const formulaModel = instanceService.getUnit(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, UniverInstanceType.UNIVER_DOC);
@@ -31876,8 +31992,12 @@ const MobileFormulaBarSubmitCommand = {
31876
31992
  });
31877
31993
  editorBridgeService.refreshEditCellState();
31878
31994
  editorBridgeService.changeEditorDirty(false);
31995
+ const editorService = accessor.get(IEditorService);
31996
+ const formulaEditor = editorService.getEditor(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31997
+ if (editorService.getFocusId() !== DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY) editorService.focus(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY);
31998
+ else formulaEditor === null || formulaEditor === void 0 || formulaEditor.focus();
31879
31999
  const endOffset = Math.max(0, (((_formulaModel$getBody = formulaModel.getBody()) === null || _formulaModel$getBody === void 0 ? void 0 : _formulaModel$getBody.dataStream.length) ?? 2) - 2);
31880
- (_accessor$get$getEdit = accessor.get(IEditorService).getEditor(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)) === null || _accessor$get$getEdit === void 0 || _accessor$get$getEdit.setSelectionRanges([{
32000
+ formulaEditor === null || formulaEditor === void 0 || formulaEditor.setSelectionRanges([{
31881
32001
  startOffset: endOffset,
31882
32002
  endOffset
31883
32003
  }], false);
@@ -31960,6 +32080,7 @@ let SheetUIMobileController = class SheetUIMobileController extends Disposable {
31960
32080
  ScrollToRangeOperation,
31961
32081
  SetUnderlineCommand,
31962
32082
  SetZoomRatioCommand,
32083
+ SetZoomRatioFromToolbarCommand,
31963
32084
  SetZoomRatioOperation,
31964
32085
  ShowMenuListCommand,
31965
32086
  InsertRangeMoveDownConfirmCommand,
@@ -32970,11 +33091,7 @@ let MobileCellEditRenderController = class MobileCellEditRenderController extend
32970
33091
  this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
32971
33092
  visible: true,
32972
33093
  eventType: DeviceInputEventType.Dblclick,
32973
- unitId: this._context.unitId,
32974
- pointerPosition: {
32975
- x: cell.event.clientX,
32976
- y: cell.event.clientY
32977
- }
33094
+ unitId: this._context.unitId
32978
33095
  });
32979
33096
  }));
32980
33097
  this.disposeWithMe(hoverManagerService.currentPointerDownCell$.subscribe((cell) => {
@@ -35465,7 +35582,6 @@ let ComponentsController = class ComponentsController extends Disposable {
35465
35582
  const componentManager = this._componentManager;
35466
35583
  this.disposeWithMe(componentManager.register(MENU_ITEM_INPUT_COMPONENT, MenuItemInput));
35467
35584
  this.disposeWithMe(componentManager.register(MENU_ITEM_FROZEN_COMPONENT, MenuItemFrozen));
35468
- this.disposeWithMe(componentManager.register(SHEET_ZOOM_INPUT_COMPONENT, SheetZoomInput));
35469
35585
  this.disposeWithMe(componentManager.register(BORDER_PANEL_COMPONENT, BorderPanel));
35470
35586
  this.disposeWithMe(componentManager.register(DEFINED_NAME_CONTAINER, DefinedNameContainer));
35471
35587
  this.disposeWithMe(componentManager.register(CELL_POPUP_COMPONENT_KEY, CellPopup));
@@ -35694,6 +35810,12 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
35694
35810
  var _params;
35695
35811
  if (params === null || params === void 0 || (_params = params[params.length - 1]) === null || _params === void 0 ? void 0 : _params.primary) this._updateInputPosition();
35696
35812
  }));
35813
+ const viewportMain = this._context.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_MAIN);
35814
+ if (viewportMain) d.add(viewportMain.onScrollEnd$.subscribeEvent(() => {
35815
+ if (this._editorBridgeService.isVisible().visible) return;
35816
+ this._editorBridgeService.refreshEditCellPosition(false);
35817
+ this._updateInputPosition();
35818
+ }));
35697
35819
  }
35698
35820
  _updateInputPosition() {
35699
35821
  var _this$_renderManagerS;
@@ -35701,8 +35823,8 @@ let DesktopCellEditRenderController = class DesktopCellEditRenderController exte
35701
35823
  const layout = this._editorBridgeService.getEditCellLayout();
35702
35824
  const docSelectionRenderService = (_this$_renderManagerS = this._renderManagerService.getRenderUnitById(DOCS_NORMAL_EDITOR_UNIT_ID_KEY)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.with(DocSelectionRenderService);
35703
35825
  if (!layout || !docSelectionRenderService) return;
35704
- const { position, canvasOffset } = layout;
35705
- docSelectionRenderService.setInputPosition(canvasOffset.left + position.startX, canvasOffset.top + position.startY);
35826
+ const { x, y } = getEditCellInputPosition(layout, this._context.engine);
35827
+ docSelectionRenderService.setInputPosition(x, y);
35706
35828
  }
35707
35829
  _focusCellEditorInput() {
35708
35830
  const focusedChildUnitId = getEmbedChildUnitId(typeof document === "undefined" ? null : document.activeElement);