@univerjs/sheets-ui 0.2.7 → 0.2.8

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 (211) hide show
  1. package/lib/cjs/index.js +6 -6
  2. package/lib/es/index.js +156 -128
  3. package/lib/index.css +1 -1
  4. package/lib/types/basics/const/permission.d.ts +0 -1
  5. package/lib/types/basics/editor/get-editor-object.d.ts +0 -1
  6. package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -1
  7. package/lib/types/commands/commands/__tests__/create-selection-command-test-bed.d.ts +0 -1
  8. package/lib/types/commands/commands/add-worksheet-merge.command.d.ts +0 -1
  9. package/lib/types/commands/commands/auto-fill.command.d.ts +0 -1
  10. package/lib/types/commands/commands/clipboard.command.d.ts +0 -1
  11. package/lib/types/commands/commands/delete-range-move-left-confirm.command.d.ts +0 -1
  12. package/lib/types/commands/commands/delete-range-move-up-confirm.command.d.ts +0 -1
  13. package/lib/types/commands/commands/hide-row-col-confirm.command.d.ts +0 -1
  14. package/lib/types/commands/commands/inline-format.command.d.ts +0 -1
  15. package/lib/types/commands/commands/insert-range-move-down-confirm.command.d.ts +0 -1
  16. package/lib/types/commands/commands/insert-range-move-right-confirm.command.d.ts +0 -1
  17. package/lib/types/commands/commands/range-protection.command.d.ts +0 -1
  18. package/lib/types/commands/commands/refill.command.d.ts +0 -1
  19. package/lib/types/commands/commands/remove-row-col-confirm.command.d.ts +0 -1
  20. package/lib/types/commands/commands/remove-sheet-confirm.command.d.ts +0 -1
  21. package/lib/types/commands/commands/set-format-painter.command.d.ts +0 -1
  22. package/lib/types/commands/commands/set-frozen.command.d.ts +0 -1
  23. package/lib/types/commands/commands/set-scroll.command.d.ts +0 -1
  24. package/lib/types/commands/commands/set-selection.command.d.ts +0 -1
  25. package/lib/types/commands/commands/set-zoom-ratio.command.d.ts +0 -1
  26. package/lib/types/commands/commands/unhide.command.d.ts +0 -1
  27. package/lib/types/commands/commands/utils/selection-utils.d.ts +0 -1
  28. package/lib/types/commands/commands/worksheet-protection.command.d.ts +0 -1
  29. package/lib/types/commands/operations/activate-cell-edit.operation.d.ts +0 -1
  30. package/lib/types/commands/operations/cell-edit.operation.d.ts +0 -1
  31. package/lib/types/commands/operations/rename-sheet.operation.d.ts +0 -1
  32. package/lib/types/commands/operations/scroll-to-range.operation.d.ts +0 -1
  33. package/lib/types/commands/operations/scroll.operation.d.ts +0 -1
  34. package/lib/types/commands/operations/set-format-painter.operation.d.ts +0 -1
  35. package/lib/types/commands/operations/set-zoom-ratio.operation.d.ts +0 -1
  36. package/lib/types/commands/operations/sheet-permission-open-dialog.operation.d.ts +0 -1
  37. package/lib/types/commands/operations/sheet-permission-open-panel.operation.d.ts +0 -1
  38. package/lib/types/commands/operations/sidebar-defined-name.operation.d.ts +0 -1
  39. package/lib/types/common/utils.d.ts +0 -1
  40. package/lib/types/components/border-panel/BorderPanel.d.ts +0 -1
  41. package/lib/types/components/border-panel/border-line/BorderLine.d.ts +0 -1
  42. package/lib/types/components/border-panel/border-line/icons/BorderDashDot.d.ts +0 -1
  43. package/lib/types/components/border-panel/border-line/icons/BorderDashDotDot.d.ts +0 -1
  44. package/lib/types/components/border-panel/border-line/icons/BorderDashed.d.ts +0 -1
  45. package/lib/types/components/border-panel/border-line/icons/BorderDotted.d.ts +0 -1
  46. package/lib/types/components/border-panel/border-line/icons/BorderHair.d.ts +0 -1
  47. package/lib/types/components/border-panel/border-line/icons/BorderMedium.d.ts +0 -1
  48. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDot.d.ts +0 -1
  49. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDotDot.d.ts +0 -1
  50. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashed.d.ts +0 -1
  51. package/lib/types/components/border-panel/border-line/icons/BorderThick.d.ts +0 -1
  52. package/lib/types/components/border-panel/border-line/icons/BorderThin.d.ts +0 -1
  53. package/lib/types/components/border-panel/interface.d.ts +0 -1
  54. package/lib/types/components/hook.d.ts +0 -1
  55. package/lib/types/components/menu-item-input/MenuItemInput.d.ts +0 -1
  56. package/lib/types/components/menu-item-input/interface.d.ts +0 -1
  57. package/lib/types/controllers/active-worksheet/active-worksheet.controller.d.ts +0 -1
  58. package/lib/types/controllers/auto-fill.controller.d.ts +0 -1
  59. package/lib/types/controllers/auto-height.controller.d.ts +0 -1
  60. package/lib/types/controllers/cell-alert.controller.d.ts +0 -1
  61. package/lib/types/controllers/cell-custom-render.controller.d.ts +0 -1
  62. package/lib/types/controllers/clipboard/clipboard.controller.d.ts +0 -1
  63. package/lib/types/controllers/clipboard/utils.d.ts +0 -1
  64. package/lib/types/controllers/defined-name/defined-name.controller.d.ts +0 -1
  65. package/lib/types/controllers/drag-render.controller.d.ts +0 -1
  66. package/lib/types/controllers/editor/__tests__/create-test-bed.d.ts +0 -1
  67. package/lib/types/controllers/editor/__tests__/mock-function.service.d.ts +0 -1
  68. package/lib/types/controllers/editor/editing.render-controller.d.ts +0 -1
  69. package/lib/types/controllers/editor/formula-editor.controller.d.ts +0 -1
  70. package/lib/types/controllers/force-string-alert-render.controller.d.ts +0 -1
  71. package/lib/types/controllers/force-string-render.controller.d.ts +0 -1
  72. package/lib/types/controllers/format-painter/format-painter.controller.d.ts +0 -1
  73. package/lib/types/controllers/hover-render.controller.d.ts +0 -1
  74. package/lib/types/controllers/mark-selection.controller.d.ts +0 -1
  75. package/lib/types/controllers/menu/__tests__/create-menu-test-bed.d.ts +0 -1
  76. package/lib/types/controllers/menu/border.menu.d.ts +0 -1
  77. package/lib/types/controllers/menu/clear.menu.d.ts +0 -1
  78. package/lib/types/controllers/menu/delete.menu.d.ts +0 -1
  79. package/lib/types/controllers/menu/insert.menu.d.ts +0 -1
  80. package/lib/types/controllers/menu/menu-util.d.ts +0 -1
  81. package/lib/types/controllers/menu/menu.d.ts +0 -1
  82. package/lib/types/controllers/menu/merge.menu.d.ts +0 -1
  83. package/lib/types/controllers/menu/permission-menu-util.d.ts +0 -1
  84. package/lib/types/controllers/menu/permission.menu.d.ts +0 -1
  85. package/lib/types/controllers/menu/sheet.menu.d.ts +0 -1
  86. package/lib/types/controllers/mobile/mobile-sheet-ui.controller.d.ts +0 -1
  87. package/lib/types/controllers/move-range.controller.d.ts +0 -1
  88. package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +1 -1
  89. package/lib/types/controllers/permission/sheet-permission-interceptor-base.controller.d.ts +0 -1
  90. package/lib/types/controllers/permission/sheet-permission-interceptor-canvas-render.controller.d.ts +0 -1
  91. package/lib/types/controllers/permission/sheet-permission-interceptor-clipboard.controller.d.ts +0 -1
  92. package/lib/types/controllers/permission/sheet-permission-interceptor-formula-render.controller.d.ts +0 -1
  93. package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +0 -1
  94. package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +0 -1
  95. package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +0 -1
  96. package/lib/types/controllers/render-controllers/format-painter.render-controller.d.ts +0 -1
  97. package/lib/types/controllers/render-controllers/freeze.render-controller.d.ts +0 -1
  98. package/lib/types/controllers/render-controllers/header-menu.render-controller.d.ts +0 -1
  99. package/lib/types/controllers/render-controllers/header-move.render-controller.d.ts +0 -1
  100. package/lib/types/controllers/render-controllers/header-resize.render-controller.d.ts +0 -1
  101. package/lib/types/controllers/render-controllers/header-unhide.render-controller.d.ts +0 -1
  102. package/lib/types/controllers/render-controllers/mobile/mobile-contextmenu.render-controller.d.ts +0 -1
  103. package/lib/types/controllers/render-controllers/mobile/mobile-scroll.render-controller.d.ts +0 -1
  104. package/lib/types/controllers/render-controllers/scroll.render-controller.d.ts +0 -1
  105. package/lib/types/controllers/render-controllers/sheet.render-controller.d.ts +1 -2
  106. package/lib/types/controllers/render-controllers/skeleton.render-controller.d.ts +0 -1
  107. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +0 -1
  108. package/lib/types/controllers/sheet-ui.controller.d.ts +0 -1
  109. package/lib/types/controllers/shortcuts/editor.shortcut.d.ts +0 -1
  110. package/lib/types/controllers/shortcuts/operation.shortcut.d.ts +0 -1
  111. package/lib/types/controllers/shortcuts/selection.shortcut.d.ts +0 -1
  112. package/lib/types/controllers/shortcuts/style.shortcut.d.ts +0 -1
  113. package/lib/types/controllers/shortcuts/utils.d.ts +0 -1
  114. package/lib/types/controllers/shortcuts/value.shortcut.d.ts +0 -1
  115. package/lib/types/controllers/shortcuts/view.shortcut.d.ts +0 -1
  116. package/lib/types/controllers/status-bar.controller.d.ts +0 -1
  117. package/lib/types/controllers/utils/char-tools.d.ts +0 -1
  118. package/lib/types/controllers/utils/component-tools.d.ts +0 -1
  119. package/lib/types/controllers/utils/range-tools.d.ts +0 -1
  120. package/lib/types/controllers/utils/selections-tools.d.ts +0 -1
  121. package/lib/types/hooks/useHighlightRange.d.ts +0 -1
  122. package/lib/types/locale/en-US.d.ts +0 -1
  123. package/lib/types/locale/ru-RU.d.ts +0 -1
  124. package/lib/types/locale/vi-VN.d.ts +0 -1
  125. package/lib/types/locale/zh-TW.d.ts +0 -1
  126. package/lib/types/mobile-sheets-ui-plugin.d.ts +0 -1
  127. package/lib/types/services/auto-fill/auto-fill.service.d.ts +0 -1
  128. package/lib/types/services/auto-fill/rules.d.ts +0 -1
  129. package/lib/types/services/auto-fill/tools.d.ts +0 -1
  130. package/lib/types/services/auto-fill/type.d.ts +0 -1
  131. package/lib/types/services/canvas-pop-manager.service.d.ts +1 -2
  132. package/lib/types/services/cell-alert-manager.service.d.ts +0 -1
  133. package/lib/types/services/clipboard/__tests__/clipboard-test-bed.d.ts +0 -1
  134. package/lib/types/services/clipboard/clipboard.service.d.ts +0 -1
  135. package/lib/types/services/clipboard/copy-content-cache.d.ts +0 -1
  136. package/lib/types/services/clipboard/html-to-usm/converter.d.ts +0 -1
  137. package/lib/types/services/clipboard/html-to-usm/parse-node-style.d.ts +0 -1
  138. package/lib/types/services/clipboard/html-to-usm/paste-plugins/plugin-lark.d.ts +0 -1
  139. package/lib/types/services/clipboard/html-to-usm/paste-plugins/plugin-univer.d.ts +0 -1
  140. package/lib/types/services/clipboard/html-to-usm/paste-plugins/plugin-word.d.ts +0 -1
  141. package/lib/types/services/clipboard/html-to-usm/paste-plugins/type.d.ts +0 -1
  142. package/lib/types/services/clipboard/html-to-usm/utils.d.ts +0 -1
  143. package/lib/types/services/clipboard/type.d.ts +0 -1
  144. package/lib/types/services/clipboard/usm-to-html/convertor.d.ts +0 -1
  145. package/lib/types/services/clipboard/utils.d.ts +0 -1
  146. package/lib/types/services/drag-manager.service.d.ts +0 -1
  147. package/lib/types/services/editor/cell-editor-manager.service.d.ts +0 -1
  148. package/lib/types/services/editor/formula-editor-manager.service.d.ts +0 -1
  149. package/lib/types/services/editor-bridge.service.d.ts +0 -1
  150. package/lib/types/services/format-painter/format-painter.service.d.ts +0 -1
  151. package/lib/types/services/hover-manager.service.d.ts +0 -1
  152. package/lib/types/services/mark-selection/mark-selection.service.d.ts +0 -1
  153. package/lib/types/services/permission/sheet-permission-panel.model.d.ts +0 -1
  154. package/lib/types/services/permission/sheet-permission-user-list.service.d.ts +0 -1
  155. package/lib/types/services/permission/worksheet-permission-render.service.d.ts +0 -1
  156. package/lib/types/services/print-interceptor.service.d.ts +0 -1
  157. package/lib/types/services/scroll-manager.service.d.ts +0 -1
  158. package/lib/types/services/selection/base-selection-render.service.d.ts +0 -1
  159. package/lib/types/services/selection/const.d.ts +0 -1
  160. package/lib/types/services/selection/mobile-selection-render.service.d.ts +0 -1
  161. package/lib/types/services/selection/mobile-selection-shape.d.ts +0 -1
  162. package/lib/types/services/selection/selection-render-model.d.ts +0 -1
  163. package/lib/types/services/selection/selection-render.service.d.ts +0 -1
  164. package/lib/types/services/selection/selection-shape-extension.d.ts +0 -1
  165. package/lib/types/services/selection/selection-shape.d.ts +0 -1
  166. package/lib/types/services/selection/util.d.ts +0 -1
  167. package/lib/types/services/sheet-bar/sheet-bar.service.d.ts +0 -1
  168. package/lib/types/services/sheet-skeleton-manager.service.d.ts +0 -1
  169. package/lib/types/services/sheets-render.service.d.ts +0 -1
  170. package/lib/types/services/shortcut-experience.service.d.ts +0 -1
  171. package/lib/types/services/status-bar.service.d.ts +0 -1
  172. package/lib/types/services/utils/selection-util.d.ts +0 -1
  173. package/lib/types/sheets-ui-plugin.d.ts +1 -2
  174. package/lib/types/views/cell-alert/CellAlertPopup.d.ts +0 -1
  175. package/lib/types/views/count-bar/CountBar.d.ts +0 -1
  176. package/lib/types/views/count-bar/ZoomSlider.d.ts +0 -1
  177. package/lib/types/views/defined-name/DefinedName.d.ts +0 -1
  178. package/lib/types/views/defined-name/DefinedNameContainer.d.ts +0 -1
  179. package/lib/types/views/defined-name/DefinedNameInput.d.ts +0 -1
  180. package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +0 -1
  181. package/lib/types/views/editor-container/EditorContainer.d.ts +0 -1
  182. package/lib/types/views/formula-bar/FormulaBar.d.ts +0 -1
  183. package/lib/types/views/header-menu-shape.d.ts +0 -1
  184. package/lib/types/views/header-resize-shape.d.ts +0 -1
  185. package/lib/types/views/header-unhide-shape.d.ts +0 -1
  186. package/lib/types/views/mobile/sheet-bar/MobileSheetBar.d.ts +0 -1
  187. package/lib/types/views/operate-container/AutoFillPopupMenu.d.ts +0 -1
  188. package/lib/types/views/operate-container/OperateContainer.d.ts +0 -1
  189. package/lib/types/views/permission/error-msg-dialog/index.d.ts +0 -1
  190. package/lib/types/views/permission/extensions/range-protection.render.d.ts +0 -1
  191. package/lib/types/views/permission/extensions/worksheet-permission.render.d.ts +0 -1
  192. package/lib/types/views/permission/footer/index.d.ts +0 -1
  193. package/lib/types/views/permission/footer/permission-detail-footer.d.ts +0 -1
  194. package/lib/types/views/permission/footer/permission-list-footer.d.ts +0 -1
  195. package/lib/types/views/permission/panel/index.d.ts +0 -1
  196. package/lib/types/views/permission/panel-detail/index.d.ts +0 -1
  197. package/lib/types/views/permission/panel-list/index.d.ts +0 -1
  198. package/lib/types/views/permission/permission-dialog/index.d.ts +0 -1
  199. package/lib/types/views/permission/spin/index.d.ts +0 -1
  200. package/lib/types/views/permission/user-dialog/index.d.ts +0 -1
  201. package/lib/types/views/sheet-bar/SheetBar.d.ts +0 -1
  202. package/lib/types/views/sheet-bar/sheet-bar-button/SheetBarButton.d.ts +0 -1
  203. package/lib/types/views/sheet-bar/sheet-bar-menu/SheetBarMenu.d.ts +0 -1
  204. package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarItem.d.ts +0 -1
  205. package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.d.ts +0 -1
  206. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +0 -1
  207. package/lib/types/views/sheet-container/SheetContainer.d.ts +0 -1
  208. package/lib/types/views/status-bar/CopyableStatisticItem.d.ts +0 -1
  209. package/lib/types/views/status-bar/StatusBar.d.ts +0 -1
  210. package/lib/umd/index.js +6 -6
  211. package/package.json +19 -21
package/lib/es/index.js CHANGED
@@ -3,12 +3,11 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
5
  import { DOCS_VIEW_KEY, SetInlineFormatBoldCommand, SetInlineFormatItalicCommand, SetInlineFormatUnderlineCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatFontSizeCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatTextColorCommand, SetTextSelectionsOperation, SetInlineFormatCommand, TextSelectionManagerService, BreakLineCommand, DeleteLeftCommand, CoverContentCommand, RichTextEditingMutation, DocSkeletonManagerService, VIEWPORT_KEY, DOCS_COMPONENT_MAIN_LAYER_INDEX, MoveSelectionOperation, MoveCursorOperation, IMEInputCommand, InsertCommand } from "@univerjs/docs";
6
- import { Disposable, Inject, Injector, CommandType, IUniverInstanceService, ICommandService, UniverInstanceType, LocaleService, Direction, Rectangle, getReverseDirection, RANGE_TYPE, Tools, Workbook, toDisposable, IContextService, UserManagerService, FOCUSING_COMMON_DRAWINGS, IPermissionService, RxDisposable, OnLifecycle, LifecycleStages, ObjectMatrix, isFormulaString, isFormulaId, CellValueType, createIdentifier, IUndoRedoService, createInterceptorKey, makeCellToSelection, ColorKit, Quantity, InterceptorManager, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, EDITOR_ACTIVATED, FOCUSING_EDITOR_STANDALONE, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, ThemeService, FOCUSING_SHEET, DisposableCollection, getCellInfoInMergeData, sortRules, sequenceExecute, Dimension, ILogService, BorderStyleTypes, useDependency, DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, HorizontalAlign, VerticalAlign, WrapStrategy, BooleanNumber, FOCUSING_UNIVER_EDITOR, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_FX_BAR_EDITOR, LRUMap, BaselineOffset, DataStreamTreeTokenType, skipParseTagNames, ErrorService, extractPureTextFromCell, FontWeight, FontItalic, DEFAULT_STYLES, nameCharacterCheck, debounce, createInternalEditorID, AbsoluteRefType, NilCommand, connectInjector, Range, cellToRange, convertBodyToHtml, handleStyleToString, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, Optional, IConfigService, FOCUSING_EDITOR_BUT_HIDDEN, LocaleType, IResourceLoaderService, isRealNum, isICellData, IAuthzIoService, isValidRange, Plugin, mergeOverrideWithDependencies, DependentOn } from "@univerjs/core";
6
+ import { Disposable, Inject, Injector, CommandType, IUniverInstanceService, ICommandService, UniverInstanceType, LocaleService, Direction, Rectangle, getReverseDirection, RANGE_TYPE, Tools, Workbook, toDisposable, IContextService, UserManagerService, FOCUSING_COMMON_DRAWINGS, IPermissionService, RxDisposable, OnLifecycle, LifecycleStages, ObjectMatrix, isFormulaString, isFormulaId, CellValueType, numfmt, createIdentifier, IUndoRedoService, createInterceptorKey, makeCellToSelection, ColorKit, Quantity, InterceptorManager, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, EDITOR_ACTIVATED, FOCUSING_EDITOR_STANDALONE, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, ThemeService, FOCUSING_SHEET, DisposableCollection, getCellInfoInMergeData, sortRules, sequenceExecute, Dimension, ILogService, BorderStyleTypes, useDependency, DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentFlavor, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, HorizontalAlign, VerticalAlign, WrapStrategy, BooleanNumber, FOCUSING_UNIVER_EDITOR, FOCUSING_EDITOR_INPUT_FORMULA, FOCUSING_FX_BAR_EDITOR, LRUMap, BaselineOffset, DataStreamTreeTokenType, skipParseTagNames, ErrorService, extractPureTextFromCell, FontWeight, FontItalic, DEFAULT_STYLES, nameCharacterCheck, debounce, createInternalEditorID, AbsoluteRefType, NilCommand, connectInjector, Range, cellToRange, convertBodyToHtml, handleStyleToString, DEFAULT_WORKSHEET_ROW_HEIGHT, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, Optional, IConfigService, FOCUSING_EDITOR_BUT_HIDDEN, LocaleType, IResourceLoaderService, isRealNum, isICellData, IAuthzIoService, isValidRange, Plugin, mergeOverrideWithDependencies, DependentOn } from "@univerjs/core";
7
7
  import { SpreadsheetSkeleton, IRenderManagerService, Vector2, SHEET_VIEWPORT_KEY as SHEET_VIEWPORT_KEY$1, RENDER_RAW_FORMULA_KEY, Spreadsheet, Rect, DashedRect, Group, TRANSFORM_CHANGE_OBSERVABLE_TYPE, cancelRequestFrame, requestNewFrame, FIX_ONE_PIXEL_BLUR_OFFSET, CURSOR_TYPE, ScrollTimer, ScrollTimerType, isRectIntersect, DeviceInputEventType, getCanvasOffsetByEngine, convertTextRotation, ptToPixel, hasCJKText, ITextSelectionRenderManager, DEFAULT_PADDING_DATA, ptToPx, ScrollBar, fixLineWidthByScale, Shape, RegularPolygon, Layer, SpreadsheetRowHeader, SpreadsheetColumnHeader, Viewport, PointerInput, RENDER_CLASS_TYPE, SheetExtension } from "@univerjs/engine-render";
8
- import { getSheetCommandTarget, alignToMergedCellsBorders, getSelectionsService, getCellAtRowCol, SetSelectionsOperation, expandToContinuousRange, ScrollToCellOperation, SheetsSelectionsService, RangeProtectionRuleModel, WorksheetProtectionRuleModel, WorkbookEditablePermission, WorkbookManageCollaboratorPermission, generateNullCellValue, SetRangeValuesUndoMutationFactory, SetRangeValuesMutation, SELECTION_CONTROL_BORDER_BUFFER_COLOR, getNormalSelectionStyle, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, transformCellDataToSelectionData, IRefSelectionsService, SetRangeValuesCommand, SetWorksheetActiveOperation, MoveRangeMutation, RemoveRowMutation, RemoveColMutation, InsertRowMutation, InsertColMutation, MoveRowsMutation, MoveColsMutation, SetWorksheetColWidthMutation, SetWorksheetRowHeightMutation, RemoveSheetMutation, RemoveMergeUndoMutationFactory, RemoveWorksheetMergeMutation, AddWorksheetMergeMutation, getAddMergeMutationRangeByType, AddMergeUndoMutationFactory, AddMergeRedoSelectionsOperationFactory, AddMergeUndoSelectionsOperationFactory, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, SetRowHiddenCommand, SetColHiddenCommand, SetBoldCommand, SetItalicCommand, SetUnderlineCommand, SetStrikeThroughCommand, SetFontSizeCommand, SetFontFamilyCommand, SetTextColorCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, RemoveRowCommand, RemoveColCommand, RemoveSheetCommand, SetFrozenMutationFactory, SetFrozenMutation, BorderStyleManagerService, RangeProtectionPermissionEditPoint, WorksheetSetCellValuePermission, WorksheetEditPermission, SetWorksheetOrderMutation, InsertSheetMutation, SetWorksheetNameMutation, SetWorksheetHideMutation, SetWorksheetShowCommand, SetWorksheetActivateCommand, getPrimaryForRange, WorksheetCopyPermission, WorksheetSetCellStylePermission, ResetTextColorCommand, ResetBackgroundColorCommand, SetBackgroundColorCommand, SetHorizontalTextAlignCommand, SetVerticalTextAlignCommand, SetTextWrapCommand, SetTextRotationCommand, WorkbookCopyPermission, RangeProtectionPermissionViewPoint, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, SetWorksheetRowIsAutoHeightCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedRowsVisibleCommand, SetColHiddenMutation, SetColVisibleMutation, SetSelectedColsVisibleCommand, SetRowHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetColWidthCommand, SetWorksheetNameCommand, SetWorksheetOrderCommand, WorkbookRenameSheetPermission, SetTabColorMutation, WorkbookCreateSheetPermission, InsertSheetCommand, InsertDefinedNameCommand, SetDefinedNameCommand, RemoveDefinedNameCommand, AddWorksheetProtectionMutation, DeleteWorksheetProtectionMutation, SetWorksheetProtectionMutation, AddRangeProtectionMutation, DeleteRangeProtectionMutation, SetRangeProtectionMutation, ClearSelectionContentCommand, ClearSelectionFormatCommand, ClearSelectionAllCommand, WorksheetDeleteColumnPermission, WorksheetDeleteRowPermission, WorksheetInsertColumnPermission, WorksheetInsertRowPermission, InsertRowBeforeCommand, InsertRowAfterCommand, InsertColBeforeCommand, InsertColAfterCommand, CopySheetCommand, SetTabColorCommand, SetWorksheetHideCommand, WorkbookDeleteSheetPermission, WorkbookHideSheetPermission, SetBorderBasicCommand, MergeCellController, MERGE_CELL_INTERCEPTOR_CHECK, RemoveWorksheetMergeCommand, DISABLE_NORMAL_SELECTIONS, SelectionMoveType, convertSelectionDataToRange, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowAutoHeightMutation, SetStyleCommand, SheetInterceptorService, MoveRangeCommand, MAX_CELL_PER_SHEET_KEY, SetFrozenCommand, InsertRowCommand, InsertColCommand, MoveColsCommand, MoveRowsCommand, DeltaRowHeightCommand, DeltaColumnWidthCommand, SetSpecificRowsVisibleCommand, SetSpecificColsVisibleCommand, INumfmtService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, RefRangeService, INTERCEPTOR_POINT, WorkbookMoveSheetPermission, WorksheetViewPermission, getAllRangePermissionPoint, getAllWorksheetPermissionPointByPointPanel, defaultWorkbookPermissionPoints, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, defaultWorksheetPermissionPoint, WorksheetProtectionPointModel, RangeProtectionRenderModel, setEndForRange, DeleteRangeProtectionCommand, AddRangeProtectionCommand as AddRangeProtectionCommand$1, SetWorksheetPermissionPointsCommand, UniverSheetsPlugin } from "@univerjs/sheets";
8
+ import { getSheetCommandTarget, alignToMergedCellsBorders, getSelectionsService, getCellAtRowCol, SetSelectionsOperation, expandToContinuousRange, ScrollToCellOperation, SheetsSelectionsService, RangeProtectionRuleModel, WorksheetProtectionRuleModel, WorkbookEditablePermission, WorkbookManageCollaboratorPermission, generateNullCellValue, SetRangeValuesUndoMutationFactory, SetRangeValuesMutation, SELECTION_CONTROL_BORDER_BUFFER_COLOR, getNormalSelectionStyle, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, transformCellDataToSelectionData, IRefSelectionsService, SetRangeValuesCommand, SetWorksheetActiveOperation, MoveRangeMutation, RemoveRowMutation, RemoveColMutation, InsertRowMutation, InsertColMutation, MoveRowsMutation, MoveColsMutation, SetWorksheetColWidthMutation, SetWorksheetRowHeightMutation, RemoveSheetMutation, AddMergeUndoMutationFactory, RemoveWorksheetMergeMutation, AddWorksheetMergeMutation, getAddMergeMutationRangeByType, RemoveMergeUndoMutationFactory, AddMergeRedoSelectionsOperationFactory, AddMergeUndoSelectionsOperationFactory, DeleteRangeMoveLeftCommand, DeleteRangeMoveUpCommand, SetRowHiddenCommand, SetColHiddenCommand, SetBoldCommand, SetItalicCommand, SetUnderlineCommand, SetStrikeThroughCommand, SetFontSizeCommand, SetFontFamilyCommand, SetTextColorCommand, InsertRangeMoveDownCommand, InsertRangeMoveRightCommand, RemoveRowCommand, RemoveColCommand, RemoveSheetCommand, SetFrozenMutationFactory, SetFrozenMutation, BorderStyleManagerService, RangeProtectionPermissionEditPoint, WorksheetSetCellValuePermission, WorksheetEditPermission, SetWorksheetOrderMutation, InsertSheetMutation, SetWorksheetNameMutation, SetWorksheetHideMutation, SetWorksheetShowCommand, SetWorksheetActivateCommand, getPrimaryForRange, WorksheetCopyPermission, WorksheetSetCellStylePermission, ResetTextColorCommand, ResetBackgroundColorCommand, SetBackgroundColorCommand, SetHorizontalTextAlignCommand, SetVerticalTextAlignCommand, SetTextWrapCommand, SetTextRotationCommand, WorkbookCopyPermission, RangeProtectionPermissionViewPoint, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, SetWorksheetRowIsAutoHeightCommand, SetRowHiddenMutation, SetRowVisibleMutation, SetSelectedRowsVisibleCommand, SetColHiddenMutation, SetColVisibleMutation, SetSelectedColsVisibleCommand, SetRowHeightCommand, SetWorksheetRowIsAutoHeightMutation, SetColWidthCommand, SetWorksheetNameCommand, SetWorksheetOrderCommand, WorkbookRenameSheetPermission, SetTabColorMutation, WorkbookCreateSheetPermission, InsertSheetCommand, InsertDefinedNameCommand, SetDefinedNameCommand, RemoveDefinedNameCommand, AddWorksheetProtectionMutation, DeleteWorksheetProtectionMutation, SetWorksheetProtectionMutation, AddRangeProtectionMutation, DeleteRangeProtectionMutation, SetRangeProtectionMutation, ClearSelectionContentCommand, ClearSelectionFormatCommand, ClearSelectionAllCommand, WorksheetDeleteColumnPermission, WorksheetDeleteRowPermission, WorksheetInsertColumnPermission, WorksheetInsertRowPermission, InsertRowBeforeCommand, InsertRowAfterCommand, InsertColBeforeCommand, InsertColAfterCommand, CopySheetCommand, SetTabColorCommand, SetWorksheetHideCommand, WorkbookDeleteSheetPermission, WorkbookHideSheetPermission, SetBorderBasicCommand, MergeCellController, MERGE_CELL_INTERCEPTOR_CHECK, RemoveWorksheetMergeCommand, DISABLE_NORMAL_SELECTIONS, SelectionMoveType, convertSelectionDataToRange, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowAutoHeightMutation, SetStyleCommand, SheetInterceptorService, MoveRangeCommand, MAX_CELL_PER_SHEET_KEY, SetFrozenCommand, InsertRowCommand, InsertColCommand, MoveColsCommand, MoveRowsCommand, DeltaRowHeightCommand, DeltaColumnWidthCommand, SetSpecificRowsVisibleCommand, SetSpecificColsVisibleCommand, INumfmtService, COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, RefRangeService, INTERCEPTOR_POINT, WorkbookMoveSheetPermission, WorksheetViewPermission, getAllRangePermissionPoint, getAllWorksheetPermissionPointByPointPanel, defaultWorkbookPermissionPoints, getAllWorkbookPermissionPoint, getAllWorksheetPermissionPoint, defaultWorksheetPermissionPoint, WorksheetProtectionPointModel, RangeProtectionRenderModel, setEndForRange, DeleteRangeProtectionCommand, AddRangeProtectionCommand as AddRangeProtectionCommand$1, SetWorksheetPermissionPointsCommand, UniverSheetsPlugin } from "@univerjs/sheets";
9
9
  import { BehaviorSubject, switchMap, of, combineLatest, startWith, map, takeUntil, distinctUntilChanged, Subject, merge, EMPTY, Observable, combineLatestWith, filter, Subscription, throttleTime } from "rxjs";
10
10
  import { KeyCode, IEditorService, IConfirmService, ComponentManager, useObservable, DISABLE_AUTO_FOCUS_KEY, TextEditor, ISidebarService, ProgressBar, DEFAULT_BACKGROUND_COLOR_RGB, DEFAULT_BACKGROUND_COLOR_RGBA, handleStringToStyle, textTrim, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, HTML_CLIPBOARD_MIME_TYPE, IClipboardInterfaceService, INotificationService, IPlatformService, CopyCommand, CutCommand, PasteCommand, MenuGroup, MenuItemType, MenuPosition, getMenuHiddenObservable, FONT_FAMILY_LIST, FONT_SIZE_LIST, Menu as Menu$1, IMessageService, RangeSelector, IDialogService, MetaKeys, FontFamily, FontFamilyItem, FontSize, BuiltInUIPart, ILayoutService, IShortcutService, IMenuService, IUIPartsService, SetEditorResizeOperation, IContextMenuService, ICanvasPopupService, IRangeSelectorService, UniverMobileUIPlugin } from "@univerjs/ui";
11
- import { numfmt } from "@univerjs/engine-numfmt";
12
11
  import React, { forwardRef, useRef, createElement, useState, useEffect, useCallback, useLayoutEffect, useMemo } from "react";
13
12
  import { Dropdown, ColorPicker, Menu, MenuItem, InputNumber, Slider, Input, Tooltip, MessageType, RadioGroup, Radio, Select, Button, Confirm, FormLayout, Avatar, Switch } from "@univerjs/design";
14
13
  import clsx from "clsx";
@@ -153,7 +152,7 @@ SheetSkeletonManagerService = __decorateClass$U([
153
152
  __decorateParam$T(1, Inject(Injector))
154
153
  ], SheetSkeletonManagerService);
155
154
  function attachRangeWithCoord(skeleton, range) {
156
- const { startRow, startColumn, endRow, endColumn, rangeType } = range, startCell = skeleton.getNoMergeCellPositionByIndex(startRow, startColumn), endCell = skeleton.getNoMergeCellPositionByIndex(endRow, endColumn);
155
+ const { startRow, startColumn, endRow, endColumn, rangeType } = range, _startRow = endRow < startRow ? endRow : startRow, _endRow = endRow < startRow ? startRow : endRow, _startColumn = endColumn < startColumn ? endColumn : startColumn, _endColumn = endColumn < startColumn ? startColumn : endColumn, startCell = skeleton.getNoMergeCellPositionByIndex(_startRow, _startColumn), endCell = skeleton.getNoMergeCellPositionByIndex(_endRow, _endColumn);
157
156
  return {
158
157
  startRow,
159
158
  startColumn,
@@ -1334,7 +1333,7 @@ SheetsScrollRenderController = __decorateClass$R([
1334
1333
  __decorateParam$Q(5, IRenderManagerService),
1335
1334
  __decorateParam$Q(6, Inject(SheetScrollManagerService))
1336
1335
  ], SheetsScrollRenderController);
1337
- var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), L = /* @__PURE__ */ ((E) => (E[E.SomeCollaborator = 0] = "SomeCollaborator", E[E.AllCollaborator = 1] = "AllCollaborator", E[E.OneSelf = 2] = "OneSelf", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {}), P = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(P || {}), M = /* @__PURE__ */ ((E) => (E[E.Reader = 0] = "Reader", E[E.Editor = 1] = "Editor", E[E.Owner = 2] = "Owner", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(M || {}), l$1 = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(l$1 || {});
1336
+ var I = /* @__PURE__ */ ((E) => (E[E.UNIVER_UNKNOWN = 0] = "UNIVER_UNKNOWN", E[E.UNIVER_DOC = 1] = "UNIVER_DOC", E[E.UNIVER_SHEET = 2] = "UNIVER_SHEET", E[E.UNIVER_SLIDE = 3] = "UNIVER_SLIDE", E[E.UNIVER_PROJECT = 4] = "UNIVER_PROJECT", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(I || {}), L = /* @__PURE__ */ ((E) => (E[E.SomeCollaborator = 0] = "SomeCollaborator", E[E.AllCollaborator = 1] = "AllCollaborator", E[E.OneSelf = 2] = "OneSelf", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(L || {}), P = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(P || {}), M = /* @__PURE__ */ ((E) => (E[E.Reader = 0] = "Reader", E[E.Editor = 1] = "Editor", E[E.Owner = 2] = "Owner", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(M || {}), l$1 = /* @__PURE__ */ ((E) => (E[E.Unkonwn = 0] = "Unkonwn", E[E.Workbook = 1] = "Workbook", E[E.Worksheet = 2] = "Worksheet", E[E.SelectRange = 3] = "SelectRange", E[E.Document = 4] = "Document", E[E.Slide = 5] = "Slide", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(l$1 || {});
1338
1337
  function getActiveSheet$(univerInstanceService) {
1339
1338
  return univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET).pipe(switchMap((workbook) => workbook ? workbook.activeSheet$.pipe(map((worksheet) => worksheet ? { workbook, worksheet } : null)) : of(null)));
1340
1339
  }
@@ -1557,7 +1556,9 @@ let SheetsRenderService = (_a5 = class extends RxDisposable {
1557
1556
  this._initWorkbookListener(), this._initContextListener();
1558
1557
  }
1559
1558
  _initWorkbookListener() {
1560
- this._instanceSrv.getTypeOfUnitAdded$(UniverInstanceType.UNIVER_SHEET).pipe(takeUntil(this.dispose$)).subscribe((workbook) => this._createRenderer(workbook)), this._instanceSrv.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => this._createRenderer(workbook)), this._instanceSrv.getTypeOfUnitDisposed$(UniverInstanceType.UNIVER_SHEET).pipe(takeUntil(this.dispose$)).subscribe((workbook) => this._disposeRenderer(workbook));
1559
+ this._instanceSrv.getTypeOfUnitAdded$(UniverInstanceType.UNIVER_SHEET).pipe(takeUntil(this.dispose$)).subscribe((workbook) => {
1560
+ this._createRenderer(workbook);
1561
+ }), this._instanceSrv.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => this._createRenderer(workbook)), this._instanceSrv.getTypeOfUnitDisposed$(UniverInstanceType.UNIVER_SHEET).pipe(takeUntil(this.dispose$)).subscribe((workbook) => this._disposeRenderer(workbook));
1561
1562
  }
1562
1563
  _createRenderer(workbook) {
1563
1564
  const unitId = workbook.getUnitId();
@@ -4705,9 +4706,7 @@ let AutoFillController = (_a9 = class extends Disposable {
4705
4706
  const unitId = workbook.getUnitId(), subUnitId = (_a59 = workbook.getActiveSheet()) == null ? void 0 : _a59.getSheetId();
4706
4707
  if (!subUnitId) return;
4707
4708
  this._autoFillService.direction = direction;
4708
- const accessor = {
4709
- get: this._injector.get.bind(this._injector)
4710
- }, autoFillSource = rangeToDiscreteRange(source, accessor), autoFillTarget = rangeToDiscreteRange(target, accessor);
4709
+ const autoFillSource = this._injector.invoke((accessor) => rangeToDiscreteRange(source, accessor)), autoFillTarget = this._injector.invoke((accessor) => rangeToDiscreteRange(target, accessor));
4711
4710
  if (!autoFillSource || !autoFillTarget)
4712
4711
  return;
4713
4712
  this._autoFillService.autoFillLocation = {
@@ -4822,11 +4821,7 @@ let AutoFillController = (_a9 = class extends Disposable {
4822
4821
  throw new Error("No active sheet found");
4823
4822
  const currentCellDatas = worksheet.getCellMatrix(), rules = this._autoFillService.getRules(), copyData = [], isVertical = direction === Direction.DOWN || direction === Direction.UP;
4824
4823
  let aArray, bArray;
4825
- isVertical ? (aArray = source.cols, bArray = source.rows) : (aArray = source.rows, bArray = source.cols);
4826
- const accessor = {
4827
- get: this._injector.get.bind(this._injector)
4828
- };
4829
- return aArray.forEach((a) => {
4824
+ return isVertical ? (aArray = source.cols, bArray = source.rows) : (aArray = source.rows, bArray = source.cols), aArray.forEach((a) => {
4830
4825
  const copyDataPiece = this._getEmptyCopyDataPiece(), prevData = {
4831
4826
  type: void 0,
4832
4827
  cellData: void 0
@@ -4834,7 +4829,7 @@ let AutoFillController = (_a9 = class extends Disposable {
4834
4829
  bArray.forEach((b) => {
4835
4830
  let data;
4836
4831
  isVertical ? data = currentCellDatas.getValue(b, a) : data = currentCellDatas.getValue(a, b);
4837
- const { type, isContinue } = rules.find((r) => r.match(data, accessor)) || otherRule;
4832
+ const { type, isContinue } = rules.find((r) => r.match(data, this._injector)) || otherRule;
4838
4833
  if (isContinue(prevData, data)) {
4839
4834
  const typeInfo = copyDataPiece[type], last = typeInfo[typeInfo.length - 1];
4840
4835
  last.data.push(data), last.index.push(b - bArray[0]);
@@ -4988,9 +4983,7 @@ let AutoFillController = (_a9 = class extends Disposable {
4988
4983
  }
4989
4984
  });
4990
4985
  });
4991
- const accessor = {
4992
- get: this._injector.get.bind(this._injector)
4993
- }, deleteMergeRanges = [], mergeData = (_b = (_a59 = this._univerInstanceService.getUniverSheetInstance(unitId)) == null ? void 0 : _a59.getSheetBySheetId(subUnitId)) == null ? void 0 : _b.getMergeData();
4986
+ const deleteMergeRanges = [], mergeData = (_b = (_a59 = this._univerInstanceService.getUniverSheetInstance(unitId)) == null ? void 0 : _a59.getSheetBySheetId(subUnitId)) == null ? void 0 : _b.getMergeData();
4994
4987
  mergeData && mergeData.forEach((merge2) => {
4995
4988
  Rectangle.intersects(merge2, targetRange) && deleteMergeRanges.push(merge2);
4996
4989
  });
@@ -4998,8 +4991,8 @@ let AutoFillController = (_a9 = class extends Disposable {
4998
4991
  unitId,
4999
4992
  subUnitId,
5000
4993
  ranges: deleteMergeRanges
5001
- }, undoRemoveMergeMutationParams = RemoveMergeUndoMutationFactory(
5002
- accessor,
4994
+ }, undoRemoveMergeMutationParams = this._injector.invoke(
4995
+ AddMergeUndoMutationFactory,
5003
4996
  removeMergeMutationParams
5004
4997
  );
5005
4998
  deleteMergeRanges.length && (redos.push({ id: RemoveWorksheetMergeMutation.id, params: removeMergeMutationParams }), undos.push({ id: AddWorksheetMergeMutation.id, params: undoRemoveMergeMutationParams }));
@@ -5007,8 +5000,8 @@ let AutoFillController = (_a9 = class extends Disposable {
5007
5000
  subUnitId,
5008
5001
  unitId,
5009
5002
  cellValue: generateNullCellValueRowCol([target])
5010
- }, undoClearMutationParams = SetRangeValuesUndoMutationFactory(
5011
- accessor,
5003
+ }, undoClearMutationParams = this._injector.invoke(
5004
+ SetRangeValuesUndoMutationFactory,
5012
5005
  clearMutationParams
5013
5006
  );
5014
5007
  redos.push({ id: SetRangeValuesMutation.id, params: clearMutationParams }), undos.push({ id: SetRangeValuesMutation.id, params: undoClearMutationParams });
@@ -5022,8 +5015,8 @@ let AutoFillController = (_a9 = class extends Disposable {
5022
5015
  subUnitId,
5023
5016
  unitId,
5024
5017
  cellValue: cellValue.getMatrix()
5025
- }, undoSetRangeValuesMutationParams = SetRangeValuesUndoMutationFactory(
5026
- accessor,
5018
+ }, undoSetRangeValuesMutationParams = this._injector.invoke(
5019
+ SetRangeValuesUndoMutationFactory,
5027
5020
  setRangeValuesMutationParams
5028
5021
  );
5029
5022
  if (undos.push({ id: SetRangeValuesMutation.id, params: undoSetRangeValuesMutationParams }), redos.push({ id: SetRangeValuesMutation.id, params: setRangeValuesMutationParams }), applyMergeRanges != null && applyMergeRanges.length) {
@@ -5031,8 +5024,8 @@ let AutoFillController = (_a9 = class extends Disposable {
5031
5024
  unitId,
5032
5025
  subUnitId,
5033
5026
  ranges
5034
- }, undoRemoveMutationParams = AddMergeUndoMutationFactory(
5035
- accessor,
5027
+ }, undoRemoveMutationParams = this._injector.invoke(
5028
+ RemoveMergeUndoMutationFactory,
5036
5029
  addMergeMutationParams
5037
5030
  );
5038
5031
  undos.push({ id: RemoveWorksheetMergeMutation.id, params: undoRemoveMutationParams }), redos.push({ id: AddWorksheetMergeMutation.id, params: addMergeMutationParams });
@@ -8470,9 +8463,7 @@ let SheetClipboardService = (_a13 = class extends Disposable {
8470
8463
  const target = this._getPastingTarget();
8471
8464
  if (!target.subUnitId || !target.selection)
8472
8465
  return !1;
8473
- const accessor = {
8474
- get: this._injector.get.bind(this._injector)
8475
- }, range = rangeToDiscreteRange(target.selection.range, accessor, target.unitId, target.subUnitId);
8466
+ const range = this._injector.invoke((accessor) => rangeToDiscreteRange(target.selection.range, accessor, target.unitId, target.subUnitId));
8476
8467
  if (!range)
8477
8468
  return !1;
8478
8469
  const { unitId, subUnitId } = target, hooks = this._clipboardHooks, enabledHooks = [];
@@ -8749,9 +8740,7 @@ let SheetClipboardService = (_a13 = class extends Disposable {
8749
8740
  const target = this._getPastingTarget(), { selection, unitId, subUnitId } = target;
8750
8741
  if (!subUnitId || !selection)
8751
8742
  return null;
8752
- const accessor = {
8753
- get: this._injector.get.bind(this._injector)
8754
- }, discreteRange = rangeToDiscreteRange(selection.range, accessor, unitId, subUnitId);
8743
+ const discreteRange = this._injector.invoke((accessor) => rangeToDiscreteRange(selection.range, accessor, unitId, subUnitId));
8755
8744
  if (!discreteRange)
8756
8745
  return null;
8757
8746
  const { ranges: [vRange], mapFunc } = virtualizeDiscreteRanges([discreteRange]), { startRow, startColumn, endRow, endColumn } = vRange, destinationRows = endRow - startRow + 1, destinationColumns = endColumn - startColumn + 1, workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook == null ? void 0 : workbook.getActiveSheet();
@@ -8816,9 +8805,7 @@ let SheetClipboardService = (_a13 = class extends Disposable {
8816
8805
  const target = this._getPastingTarget(), { selection, unitId, subUnitId } = target;
8817
8806
  if (!subUnitId || !selection)
8818
8807
  return null;
8819
- const accessor = {
8820
- get: this._injector.get.bind(this._injector)
8821
- }, discreteRange = rangeToDiscreteRange(selection.range, accessor, unitId, subUnitId);
8808
+ const discreteRange = this._injector.invoke((accessor) => rangeToDiscreteRange(selection.range, accessor, unitId, subUnitId));
8822
8809
  if (!discreteRange)
8823
8810
  return null;
8824
8811
  const { startColumn, endColumn, startRow, endRow } = cellMatrix.getDataRange(), rowCount = endRow - startRow + 1, colCount = endColumn - startColumn + 1;
@@ -13593,6 +13580,8 @@ function getMoveRangeMutations(from, to, accessor) {
13593
13580
  newToCellValue.setValue(range.startRow, range.startColumn, fromCellMatrix.getValue(row, col));
13594
13581
  });
13595
13582
  const doMoveRangeMutation = {
13583
+ fromRange,
13584
+ toRange,
13596
13585
  from: {
13597
13586
  value: newFromCellValue.getMatrix(),
13598
13587
  subUnitId: fromSubUnitId
@@ -13603,6 +13592,8 @@ function getMoveRangeMutations(from, to, accessor) {
13603
13592
  },
13604
13593
  unitId
13605
13594
  }, undoMoveRangeMutation = {
13595
+ fromRange: toRange,
13596
+ toRange: fromRange,
13606
13597
  from: {
13607
13598
  value: fromCellValue.getMatrix(),
13608
13599
  subUnitId: fromSubUnitId
@@ -13743,7 +13734,8 @@ function getSetCellStyleMutations(pasteTo, matrix, accessor, withRichFormat = !1
13743
13734
  s: Object.assign({}, {
13744
13735
  ...DEFAULT_STYLES,
13745
13736
  pd: DEFAULT_PADDING_DATA,
13746
- bg: null
13737
+ bg: null,
13738
+ cl: null
13747
13739
  }, value.s)
13748
13740
  };
13749
13741
  withRichFormat && ((_a59 = value.p) != null && _a59.body) && (newValue.p = value.p);
@@ -14171,44 +14163,39 @@ let SheetClipboardController = (_a19 = class extends RxDisposable {
14171
14163
  };
14172
14164
  }
14173
14165
  _onPasteCells(pasteFrom, pasteTo, data, payload) {
14174
- const accessor = {
14175
- get: this._injector.get.bind(this._injector)
14176
- };
14177
- return getDefaultOnPasteCellMutations(pasteFrom, pasteTo, data, payload, accessor);
14166
+ return this._injector.invoke((accessor) => getDefaultOnPasteCellMutations(pasteFrom, pasteTo, data, payload, accessor));
14178
14167
  }
14179
14168
  _initSpecialPasteHooks() {
14180
- const accessor = {
14181
- get: this._injector.get.bind(this._injector)
14182
- }, self = this, specialPasteValueHook = {
14169
+ const self = this, specialPasteValueHook = {
14183
14170
  id: PREDEFINED_HOOK_NAME.SPECIAL_PASTE_VALUE,
14184
14171
  specialPasteInfo: {
14185
14172
  label: "specialPaste.value"
14186
14173
  },
14187
- onPasteCells: /* @__PURE__ */ __name((pasteFrom, pasteTo, data) => getSetCellValueMutations(pasteTo, pasteFrom, data, accessor), "onPasteCells")
14174
+ onPasteCells: /* @__PURE__ */ __name((pasteFrom, pasteTo, data) => this._injector.invoke((accessor) => getSetCellValueMutations(pasteTo, pasteFrom, data, accessor)), "onPasteCells")
14188
14175
  }, specialPasteFormatHook = {
14189
14176
  id: PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,
14190
14177
  specialPasteInfo: {
14191
14178
  label: "specialPaste.format"
14192
14179
  },
14193
- onPasteCells(pasteFrom, pasteTo, matrix) {
14194
- const redoMutationsInfo = [], undoMutationsInfo = [], { undos: styleUndos, redos: styleRedos } = getClearCellStyleMutations(pasteTo, matrix, accessor);
14180
+ onPasteCells: /* @__PURE__ */ __name((pasteFrom, pasteTo, matrix) => {
14181
+ const redoMutationsInfo = [], undoMutationsInfo = [], { undos: styleUndos, redos: styleRedos } = this._injector.invoke((accessor) => getClearCellStyleMutations(pasteTo, matrix, accessor));
14195
14182
  redoMutationsInfo.push(...styleRedos), undoMutationsInfo.push(...styleUndos);
14196
- const { undos: mergeUndos, redos: mergeRedos } = getClearAndSetMergeMutations(
14183
+ const { undos: mergeUndos, redos: mergeRedos } = this._injector.invoke((accessor) => getClearAndSetMergeMutations(
14197
14184
  pasteTo,
14198
14185
  matrix,
14199
14186
  accessor
14200
- );
14187
+ ));
14201
14188
  redoMutationsInfo.push(...mergeRedos), undoMutationsInfo.push(...mergeUndos);
14202
- const { undos: setStyleUndos, redos: setStyleRedos } = getSetCellStyleMutations(
14189
+ const { undos: setStyleUndos, redos: setStyleRedos } = this._injector.invoke((accessor) => getSetCellStyleMutations(
14203
14190
  pasteTo,
14204
14191
  matrix,
14205
14192
  accessor
14206
- );
14193
+ ));
14207
14194
  return redoMutationsInfo.push(...setStyleRedos), undoMutationsInfo.push(...setStyleUndos), {
14208
14195
  undos: undoMutationsInfo,
14209
14196
  redos: redoMutationsInfo
14210
14197
  };
14211
- }
14198
+ }, "onPasteCells")
14212
14199
  }, specialPasteColWidthHook = {
14213
14200
  id: PREDEFINED_HOOK_NAME.SPECIAL_PASTE_COL_WIDTH,
14214
14201
  specialPasteInfo: {
@@ -14252,7 +14239,7 @@ let SheetClipboardController = (_a19 = class extends RxDisposable {
14252
14239
  specialPasteInfo: {
14253
14240
  label: "specialPaste.besidesBorder"
14254
14241
  },
14255
- onPasteCells(pasteFrom, pasteTo, matrix, payload) {
14242
+ onPasteCells: /* @__PURE__ */ __name((pasteFrom, pasteTo, matrix, payload) => {
14256
14243
  self._currentUniverSheet.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
14257
14244
  const redoMutationsInfo = [], undoMutationsInfo = [], { range, unitId, subUnitId } = pasteTo, valueMatrix = new ObjectMatrix();
14258
14245
  matrix.forValue((row, col, value) => {
@@ -14271,20 +14258,20 @@ let SheetClipboardController = (_a19 = class extends RxDisposable {
14271
14258
  id: SetRangeValuesMutation.id,
14272
14259
  params: setValuesMutation
14273
14260
  });
14274
- const undoSetValuesMutation = SetRangeValuesUndoMutationFactory(
14275
- accessor,
14261
+ const undoSetValuesMutation = this._injector.invoke(
14262
+ SetRangeValuesUndoMutationFactory,
14276
14263
  setValuesMutation
14277
14264
  );
14278
14265
  undoMutationsInfo.push({
14279
14266
  id: SetRangeValuesMutation.id,
14280
14267
  params: undoSetValuesMutation
14281
14268
  });
14282
- const { undos, redos } = getClearAndSetMergeMutations(pasteTo, matrix, accessor);
14269
+ const { undos, redos } = this._injector.invoke((accessor) => getClearAndSetMergeMutations(pasteTo, matrix, accessor));
14283
14270
  return undoMutationsInfo.push(...undos), redoMutationsInfo.push(...redos), {
14284
14271
  redos: redoMutationsInfo,
14285
14272
  undos: undoMutationsInfo
14286
14273
  };
14287
- }
14274
+ }, "onPasteCells")
14288
14275
  };
14289
14276
  return [specialPasteValueHook, specialPasteFormatHook, specialPasteColWidthHook, specialPasteBesidesBorder];
14290
14277
  }
@@ -14755,7 +14742,9 @@ let EditingRenderController = (_a21 = class extends Disposable {
14755
14742
  }
14756
14743
  _init() {
14757
14744
  const d = new DisposableCollection();
14758
- return this._subscribeToCurrentCell(d), this._initialKeyboardListener(d), this._initialCursorSync(d), this._listenEditorFocus(d), this._commandExecutedListener(d), this._cursorStateListener(d), d;
14745
+ return this._subscribeToCurrentCell(d), this._initialKeyboardListener(d), this._initialCursorSync(d), this._listenEditorFocus(d), this._commandExecutedListener(d), setTimeout(() => {
14746
+ this._cursorStateListener(d);
14747
+ }, 1e3), d;
14759
14748
  }
14760
14749
  _initEditorVisibilityListener() {
14761
14750
  this.disposeWithMe(this._editorBridgeService.visible$.pipe(distinctUntilChanged((prev, curr) => prev.visible === curr.visible)).subscribe((param) => {
@@ -17049,17 +17038,17 @@ let StatusBarController = (_a29 = class extends Disposable {
17049
17038
  this._statusBarService.setState(null);
17050
17039
  }
17051
17040
  _calculateSelection(selections, primary) {
17052
- var _a59, _b;
17041
+ var _a59;
17053
17042
  const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
17054
17043
  if (!workbook)
17055
17044
  return this._clearResult();
17056
- const unitId = workbook.getUnitId(), sheetId = (_a59 = workbook.getActiveSheet()) == null ? void 0 : _a59.getSheetId();
17045
+ const unitId = workbook.getUnitId(), sheet = workbook.getActiveSheet(), sheetId = sheet == null ? void 0 : sheet.getSheetId();
17057
17046
  if (!sheetId)
17058
17047
  return this._clearResult();
17059
17048
  const sheetData = {}, arrayFormulaMatrixCell = this._formulaDataModel.getArrayFormulaCellData();
17060
- if (this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getSheets().forEach((sheet) => {
17061
- const sheetConfig = sheet.getConfig();
17062
- sheetData[sheet.getSheetId()] = {
17049
+ if (this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getSheets().forEach((sheet2) => {
17050
+ const sheetConfig = sheet2.getConfig();
17051
+ sheetData[sheet2.getSheetId()] = {
17063
17052
  cellData: new ObjectMatrix(sheetConfig.cellData),
17064
17053
  rowCount: sheetConfig.rowCount,
17065
17054
  columnCount: sheetConfig.columnCount,
@@ -17067,7 +17056,15 @@ let StatusBarController = (_a29 = class extends Disposable {
17067
17056
  columnData: sheetConfig.columnData
17068
17057
  };
17069
17058
  }), selections != null && selections.length) {
17070
- const refs = selections.map((s) => new RangeReferenceObject(s, sheetId, unitId));
17059
+ const realSelections = [];
17060
+ selections.forEach((selection) => {
17061
+ const { startRow: start, endRow: end } = selection;
17062
+ let prev = null;
17063
+ for (let r = start; r <= end; r++)
17064
+ sheet.getRowVisible(r) ? prev === null && (prev = r) : prev !== null && (realSelections.push({ ...selection, startRow: prev, endRow: r - 1 }), prev = null);
17065
+ prev !== null && realSelections.push({ ...selection, startRow: prev, endRow: end });
17066
+ });
17067
+ const refs = realSelections.map((s) => new RangeReferenceObject(s, sheetId, unitId));
17071
17068
  refs.forEach((ref) => {
17072
17069
  ref.setUnitData({
17073
17070
  [unitId]: sheetData
@@ -17093,7 +17090,7 @@ let StatusBarController = (_a29 = class extends Disposable {
17093
17090
  let pattern = null;
17094
17091
  if (primary) {
17095
17092
  const { actualRow, actualColumn } = primary;
17096
- pattern = (_b = this._numfmtService.getValue(unitId, sheetId, actualRow, actualColumn)) == null ? void 0 : _b.pattern;
17093
+ pattern = (_a59 = this._numfmtService.getValue(unitId, sheetId, actualRow, actualColumn)) == null ? void 0 : _a59.pattern;
17097
17094
  }
17098
17095
  const newState = {
17099
17096
  values: calcResult.filter((r) => r !== void 0),
@@ -17294,7 +17291,7 @@ let SheetRenderController = (_a30 = class extends RxDisposable {
17294
17291
  this._markViewportDirty(viewports, dirtyBounds), spreadsheet.setDirtyArea(dirtyBounds);
17295
17292
  }
17296
17293
  if (command.id === MoveRangeMutation.id && cmdParams.from && cmdParams.to) {
17297
- const fromRange = this._cellValueToRange(cmdParams.from.value), toRange = this._cellValueToRange(cmdParams.to.value), dirtyBounds = this._rangeToBounds([fromRange, toRange]);
17294
+ const fromRange = cmdParams.fromRange || this._cellValueToRange(cmdParams.from.value), toRange = cmdParams.toRange || this._cellValueToRange(cmdParams.to.value), dirtyBounds = this._rangeToBounds([fromRange, toRange]);
17298
17295
  this._markViewportDirty(viewports, dirtyBounds), spreadsheet.setDirtyArea(dirtyBounds);
17299
17296
  }
17300
17297
  }
@@ -17302,19 +17299,20 @@ let SheetRenderController = (_a30 = class extends RxDisposable {
17302
17299
  * cellValue data structure:
17303
17300
  * {[row]: { [col]: value}}
17304
17301
  * @param cellValue
17305
- * @returns
17302
+ * @returns IRange
17306
17303
  */
17307
17304
  _cellValueToRange(cellValue) {
17308
- const rows = Object.keys(cellValue).map(Number), columns = [];
17309
- for (const [_row, columnObj] of Object.entries(cellValue))
17305
+ let minCol = 0, maxCol = 0, minRow = 0, maxRow = 0;
17306
+ for (const [_row, columnObj] of Object.entries(cellValue)) {
17310
17307
  for (const column in columnObj)
17311
- columns.push(Number(column));
17312
- const startRow = Math.min(...rows), endRow = Math.max(...rows), startColumn = Math.min(...columns), endColumn = Math.max(...columns);
17308
+ minCol > Number(column) && (minCol = Number(column)), maxCol < Number(column) && (maxCol = Number(column));
17309
+ minRow > Number(_row) && (minRow = Number(_row)), maxRow < Number(_row) && (maxRow = Number(_row));
17310
+ }
17313
17311
  return {
17314
- startRow,
17315
- endRow,
17316
- startColumn,
17317
- endColumn
17312
+ startRow: minRow,
17313
+ endRow: maxRow,
17314
+ startColumn: minCol,
17315
+ endColumn: maxCol
17318
17316
  };
17319
17317
  }
17320
17318
  _rangeToBounds(ranges) {
@@ -17548,7 +17546,8 @@ let SheetCanvasPopManagerService = (_a33 = class extends Disposable {
17548
17546
  unitId,
17549
17547
  subUnitId,
17550
17548
  anchorRect: position,
17551
- anchorRect$: position$
17549
+ anchorRect$: position$,
17550
+ canvasElement: currentRender.engine.getCanvasElement()
17552
17551
  });
17553
17552
  return {
17554
17553
  dispose: /* @__PURE__ */ __name(() => {
@@ -17585,7 +17584,8 @@ let SheetCanvasPopManagerService = (_a33 = class extends Disposable {
17585
17584
  unitId,
17586
17585
  subUnitId,
17587
17586
  anchorRect: position,
17588
- anchorRect$: position$
17587
+ anchorRect$: position$,
17588
+ canvasElement: currentRender.engine.getCanvasElement()
17589
17589
  }), disposableCollection = new DisposableCollection();
17590
17590
  disposableCollection.add(positionObserverDisposable), disposableCollection.add(toDisposable(() => {
17591
17591
  this._globalPopupManagerService.removePopup(id), position$.complete();
@@ -18030,9 +18030,7 @@ let FormatPainterController = (_a40 = class extends Disposable {
18030
18030
  };
18031
18031
  }
18032
18032
  _getUndoRedoMutationInfo(unitId, subUnitId, range, format) {
18033
- const sheetInterceptorService = this._sheetInterceptorService, univerInstanceService = this._univerInstanceService, accessor = {
18034
- get: this._injector.get.bind(this._injector)
18035
- }, { merges, styles: stylesMatrix } = format;
18033
+ const sheetInterceptorService = this._sheetInterceptorService, univerInstanceService = this._univerInstanceService, { merges, styles: stylesMatrix } = format;
18036
18034
  if (!stylesMatrix) return { undos: [], redos: [] };
18037
18035
  const { startRow, startColumn, endRow, endColumn } = stylesMatrix.getDataRange(), styleRowsNum = endRow - startRow + 1, styleColsNum = endColumn - startColumn + 1, styleValues = Array.from(
18038
18036
  { length: range.endRow - range.startRow + 1 },
@@ -18079,8 +18077,8 @@ let FormatPainterController = (_a40 = class extends Disposable {
18079
18077
  subUnitId,
18080
18078
  unitId,
18081
18079
  cellValue: realCellValue != null ? realCellValue : cellValue.getMatrix()
18082
- }, undoSetRangeValuesMutationParams = SetRangeValuesUndoMutationFactory(
18083
- accessor,
18080
+ }, undoSetRangeValuesMutationParams = this._injector.invoke(
18081
+ SetRangeValuesUndoMutationFactory,
18084
18082
  setRangeValuesMutationParams
18085
18083
  ), { undos: interceptorUndos, redos: interceptorRedos } = sheetInterceptorService.onCommandExecute({
18086
18084
  id: SetRangeValuesCommand.id,
@@ -18095,9 +18093,15 @@ let FormatPainterController = (_a40 = class extends Disposable {
18095
18093
  ranges
18096
18094
  };
18097
18095
  mergeRedos.push({ id: RemoveWorksheetMergeMutation.id, params: removeMergeMutationParams }), mergeRedos.push({ id: AddWorksheetMergeMutation.id, params: addMergeMutationParams });
18098
- const undoRemoveMergeMutationParams = RemoveMergeUndoMutationFactory(accessor, removeMergeMutationParams), undoMutationParams = AddMergeUndoMutationFactory(accessor, addMergeMutationParams);
18096
+ const undoRemoveMergeMutationParams = this._injector.invoke(
18097
+ RemoveMergeUndoMutationFactory,
18098
+ removeMergeMutationParams
18099
+ ), undoMutationParams = this._injector.invoke(
18100
+ AddMergeUndoMutationFactory,
18101
+ addMergeMutationParams
18102
+ );
18099
18103
  if (mergeUndos.push({ id: RemoveWorksheetMergeMutation.id, params: undoMutationParams }), mergeUndos.push({ id: AddWorksheetMergeMutation.id, params: undoRemoveMergeMutationParams }), willRemoveSomeCell) {
18100
- const data = getClearContentMutationParamsForRanges(accessor, unitId, worksheet, ranges);
18104
+ const data = this._injector.invoke((accessor) => getClearContentMutationParamsForRanges(accessor, unitId, worksheet, ranges));
18101
18105
  mergeRedos.unshift(...data.redos), mergeUndos.push(...data.undos);
18102
18106
  }
18103
18107
  return {
@@ -18263,7 +18267,6 @@ let SheetPermissionInterceptorBaseController = (_a43 = class extends Disposable
18263
18267
  switch (id) {
18264
18268
  case InsertCommand.id:
18265
18269
  case IMEInputCommand.id:
18266
- case SetCellEditVisibleOperation.id:
18267
18270
  if (this._contextService.getContextValue(FOCUSING_EDITOR_STANDALONE) === !0)
18268
18271
  break;
18269
18272
  permission = this.permissionCheckWithoutRange({
@@ -18272,6 +18275,15 @@ let SheetPermissionInterceptorBaseController = (_a43 = class extends Disposable
18272
18275
  worksheetTypes: [WorksheetSetCellValuePermission, WorksheetEditPermission]
18273
18276
  }), errorMsg = this._localeService.t("permission.dialog.editErr");
18274
18277
  break;
18278
+ case SetCellEditVisibleOperation.id:
18279
+ if (params.visible === !1)
18280
+ break;
18281
+ permission = this.permissionCheckWithoutRange({
18282
+ workbookTypes: [WorkbookEditablePermission],
18283
+ rangeTypes: [RangeProtectionPermissionEditPoint],
18284
+ worksheetTypes: [WorksheetSetCellValuePermission, WorksheetEditPermission]
18285
+ }), errorMsg = this._localeService.t("permission.dialog.editErr");
18286
+ break;
18275
18287
  case SetRangeValuesCommand.id:
18276
18288
  isICellData(params.value) && params.value.f ? (permission = this._permissionCheckWithFormula(params), errorMsg = this._localeService.t("permission.dialog.formulaErr")) : permission = this._permissionCheckBySetRangeValue({
18277
18289
  workbookTypes: [WorkbookEditablePermission],
@@ -18716,28 +18728,33 @@ var __defProp$c = Object.defineProperty, __getOwnPropDesc$c = Object.getOwnPrope
18716
18728
  }, "__decorateClass$c"), __decorateParam$c = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$c"), _a45;
18717
18729
  let SheetPermissionInitController = (_a45 = class extends Disposable {
18718
18730
  constructor(_univerInstanceService, _dialogService, _permissionService, _authzIoService, _rangeProtectionRuleModel, _worksheetProtectionRuleModel, _userManagerService, _worksheetProtectionPointRuleModel, _sheetInterceptorService, _selectionProtectionRenderModel) {
18719
- super(), this._univerInstanceService = _univerInstanceService, this._dialogService = _dialogService, this._permissionService = _permissionService, this._authzIoService = _authzIoService, this._rangeProtectionRuleModel = _rangeProtectionRuleModel, this._worksheetProtectionRuleModel = _worksheetProtectionRuleModel, this._userManagerService = _userManagerService, this._worksheetProtectionPointRuleModel = _worksheetProtectionPointRuleModel, this._sheetInterceptorService = _sheetInterceptorService, this._selectionProtectionRenderModel = _selectionProtectionRenderModel, this._initRangePermissionFromSnapshot(), this._initRangePermissionChange(), this._initWorksheetPermissionFromSnapshot(), this._initWorksheetPermissionChange(), this._initWorksheetPermissionPointsChange(), this.initWorkbookPermissionChange(), this._initUserChange(), this._initViewModelByRangeInterceptor(), this._initViewModelBySheetInterceptor();
18731
+ super(), this._univerInstanceService = _univerInstanceService, this._dialogService = _dialogService, this._permissionService = _permissionService, this._authzIoService = _authzIoService, this._rangeProtectionRuleModel = _rangeProtectionRuleModel, this._worksheetProtectionRuleModel = _worksheetProtectionRuleModel, this._userManagerService = _userManagerService, this._worksheetProtectionPointRuleModel = _worksheetProtectionPointRuleModel, this._sheetInterceptorService = _sheetInterceptorService, this._selectionProtectionRenderModel = _selectionProtectionRenderModel, this._initRangePermissionFromSnapshot(), this._initRangePermissionChange(), this._initWorksheetPermissionFromSnapshot(), this._initWorksheetPermissionChange(), this._initWorksheetPermissionPointsChange(), this._initWorkbookPermissionFromSnapshot(), this._initUserChange(), this._initViewModelByRangeInterceptor(), this._initViewModelBySheetInterceptor();
18720
18732
  }
18721
18733
  _initRangePermissionFromSnapshot() {
18722
- const allAllowedParams = [], workbook = this._univerInstanceService.getCurrentUnitForType(I.UNIVER_SHEET), unitId = workbook.getUnitId(), allSheets = workbook.getSheets(), permissionIdWithRuleInstanceMap = /* @__PURE__ */ new Map();
18723
- allSheets.forEach((sheet) => {
18724
- const subunitId = sheet.getSheetId();
18725
- this._rangeProtectionRuleModel.getSubunitRuleList(unitId, subunitId).forEach((rule) => {
18726
- permissionIdWithRuleInstanceMap.set(rule.permissionId, rule), allAllowedParams.push({
18727
- objectID: rule.permissionId,
18728
- unitID: unitId,
18729
- objectType: l$1.SelectRange,
18730
- actions: [P.View, P.Edit]
18734
+ const initRangePermissionFunc = /* @__PURE__ */ __name((workbook) => {
18735
+ const allAllowedParams = [], unitId = workbook.getUnitId(), allSheets = workbook.getSheets(), permissionIdWithRuleInstanceMap = /* @__PURE__ */ new Map();
18736
+ allSheets.forEach((sheet) => {
18737
+ const subunitId = sheet.getSheetId();
18738
+ this._rangeProtectionRuleModel.getSubunitRuleList(unitId, subunitId).forEach((rule) => {
18739
+ permissionIdWithRuleInstanceMap.set(rule.permissionId, rule), allAllowedParams.push({
18740
+ objectID: rule.permissionId,
18741
+ unitID: unitId,
18742
+ objectType: l$1.SelectRange,
18743
+ actions: [P.View, P.Edit]
18744
+ });
18731
18745
  });
18732
- });
18733
- }), allAllowedParams.length && this._authzIoService.batchAllowed(allAllowedParams).then((permissionMap) => {
18734
- permissionMap.forEach((item) => {
18735
- const rule = permissionIdWithRuleInstanceMap.get(item.objectID);
18736
- rule && getAllRangePermissionPoint().forEach((F) => {
18737
- const instance = new F(unitId, rule.subUnitId, item.objectID), unitActionName = instance.subType, result = item.actions.find((action) => action.action === unitActionName);
18738
- (result == null ? void 0 : result.allowed) !== void 0 && this._permissionService.updatePermissionPoint(instance.id, result.allowed);
18746
+ }), allAllowedParams.length && this._authzIoService.batchAllowed(allAllowedParams).then((permissionMap) => {
18747
+ permissionMap.forEach((item) => {
18748
+ const rule = permissionIdWithRuleInstanceMap.get(item.objectID);
18749
+ rule && getAllRangePermissionPoint().forEach((F) => {
18750
+ const instance = new F(unitId, rule.subUnitId, item.objectID), unitActionName = instance.subType, result = item.actions.find((action) => action.action === unitActionName);
18751
+ (result == null ? void 0 : result.allowed) !== void 0 && this._permissionService.updatePermissionPoint(instance.id, result.allowed);
18752
+ });
18739
18753
  });
18740
18754
  });
18755
+ }, "initRangePermissionFunc");
18756
+ this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => {
18757
+ initRangePermissionFunc(workbook);
18741
18758
  });
18742
18759
  }
18743
18760
  _initRangePermissionChange() {
@@ -18766,8 +18783,9 @@ let SheetPermissionInitController = (_a45 = class extends Disposable {
18766
18783
  );
18767
18784
  }
18768
18785
  initWorkbookPermissionChange(_unitId) {
18769
- const unitId = _unitId || this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId();
18770
- this._authzIoService.allowed({
18786
+ var _a59;
18787
+ const unitId = _unitId || ((_a59 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a59.getUnitId());
18788
+ unitId && this._authzIoService.allowed({
18771
18789
  objectID: unitId,
18772
18790
  objectType: l$1.Workbook,
18773
18791
  unitID: unitId,
@@ -18779,6 +18797,11 @@ let SheetPermissionInitController = (_a45 = class extends Disposable {
18779
18797
  });
18780
18798
  });
18781
18799
  }
18800
+ _initWorkbookPermissionFromSnapshot() {
18801
+ this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => {
18802
+ this.initWorkbookPermissionChange(workbook.getUnitId());
18803
+ });
18804
+ }
18782
18805
  _initWorksheetPermissionChange() {
18783
18806
  this.disposeWithMe(
18784
18807
  this._worksheetProtectionRuleModel.ruleChange$.subscribe((info) => {
@@ -18817,30 +18840,35 @@ let SheetPermissionInitController = (_a45 = class extends Disposable {
18817
18840
  );
18818
18841
  }
18819
18842
  _initWorksheetPermissionFromSnapshot() {
18820
- const allAllowedParams = [], workbook = this._univerInstanceService.getCurrentUnitForType(I.UNIVER_SHEET), unitId = workbook.getUnitId(), allSheets = workbook.getSheets(), permissionIdWithRuleInstanceMap = /* @__PURE__ */ new Map();
18821
- allSheets.forEach((sheet) => {
18822
- const subUnitId = sheet.getSheetId(), rule = this._worksheetProtectionRuleModel.getRule(unitId, subUnitId);
18823
- rule && (permissionIdWithRuleInstanceMap.set(rule.permissionId, rule), allAllowedParams.push({
18824
- objectID: rule.permissionId,
18825
- unitID: unitId,
18826
- objectType: l$1.Worksheet,
18827
- actions: [P.Edit, P.View]
18828
- }));
18829
- const pointRule = this._worksheetProtectionPointRuleModel.getRule(unitId, subUnitId);
18830
- pointRule && (permissionIdWithRuleInstanceMap.set(pointRule.permissionId, pointRule), allAllowedParams.push({
18831
- objectID: pointRule.permissionId,
18832
- unitID: unitId,
18833
- objectType: l$1.Worksheet,
18834
- actions: defaultWorksheetPermissionPoint
18835
- }));
18836
- }), allAllowedParams.length && this._authzIoService.batchAllowed(allAllowedParams).then((permissionMap) => {
18837
- permissionMap.forEach((item) => {
18838
- const rule = permissionIdWithRuleInstanceMap.get(item.objectID);
18839
- rule && [...getAllWorksheetPermissionPoint(), ...getAllWorksheetPermissionPointByPointPanel()].forEach((F) => {
18840
- const instance = new F(unitId, rule.subUnitId), unitActionName = instance.subType, result = item.actions.find((action) => action.action === unitActionName);
18841
- (result == null ? void 0 : result.allowed) !== void 0 && this._permissionService.updatePermissionPoint(instance.id, result.allowed);
18843
+ const initSheetPermissionFunc = /* @__PURE__ */ __name((workbook) => {
18844
+ const allAllowedParams = [], unitId = workbook.getUnitId(), allSheets = workbook.getSheets(), permissionIdWithRuleInstanceMap = /* @__PURE__ */ new Map();
18845
+ allSheets.forEach((sheet) => {
18846
+ const subUnitId = sheet.getSheetId(), rule = this._worksheetProtectionRuleModel.getRule(unitId, subUnitId);
18847
+ rule && (permissionIdWithRuleInstanceMap.set(rule.permissionId, rule), allAllowedParams.push({
18848
+ objectID: rule.permissionId,
18849
+ unitID: unitId,
18850
+ objectType: l$1.Worksheet,
18851
+ actions: [P.Edit, P.View]
18852
+ }));
18853
+ const pointRule = this._worksheetProtectionPointRuleModel.getRule(unitId, subUnitId);
18854
+ pointRule && (permissionIdWithRuleInstanceMap.set(pointRule.permissionId, pointRule), allAllowedParams.push({
18855
+ objectID: pointRule.permissionId,
18856
+ unitID: unitId,
18857
+ objectType: l$1.Worksheet,
18858
+ actions: defaultWorksheetPermissionPoint
18859
+ }));
18860
+ }), allAllowedParams.length && this._authzIoService.batchAllowed(allAllowedParams).then((permissionMap) => {
18861
+ permissionMap.forEach((item) => {
18862
+ const rule = permissionIdWithRuleInstanceMap.get(item.objectID);
18863
+ rule && [...getAllWorksheetPermissionPoint(), ...getAllWorksheetPermissionPointByPointPanel()].forEach((F) => {
18864
+ const instance = new F(unitId, rule.subUnitId), unitActionName = instance.subType, result = item.actions.find((action) => action.action === unitActionName);
18865
+ (result == null ? void 0 : result.allowed) !== void 0 && this._permissionService.updatePermissionPoint(instance.id, result.allowed);
18866
+ });
18842
18867
  });
18843
18868
  });
18869
+ }, "initSheetPermissionFunc");
18870
+ this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => {
18871
+ initSheetPermissionFunc(workbook);
18844
18872
  });
18845
18873
  }
18846
18874
  _initUserChange() {
@@ -18863,7 +18891,7 @@ let SheetPermissionInitController = (_a45 = class extends Disposable {
18863
18891
  _map.has(instance.id) && (instance = _map.get(instance.id)), this._permissionService.addPermissionPoint(instance);
18864
18892
  });
18865
18893
  });
18866
- }), this.initWorkbookPermissionChange(), this._initWorksheetPermissionFromSnapshot(), this._initRangePermissionFromSnapshot();
18894
+ }), this._initWorkbookPermissionFromSnapshot(), this._initWorksheetPermissionFromSnapshot(), this._initRangePermissionFromSnapshot();
18867
18895
  });
18868
18896
  })
18869
18897
  );
@@ -20332,7 +20360,7 @@ let UniverSheetsUIPlugin = (_a53 = class extends Plugin {
20332
20360
  constructor(_config = {}, _injector, _renderManagerService, _univerInstanceService) {
20333
20361
  super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService, this._config = Tools.deepMerge({}, DefaultSheetUiConfig, this._config);
20334
20362
  }
20335
- onStarting(injector) {
20363
+ onStarting() {
20336
20364
  mergeOverrideWithDependencies([
20337
20365
  // services
20338
20366
  [ShortcutExperienceService],
@@ -20376,7 +20404,7 @@ let UniverSheetsUIPlugin = (_a53 = class extends Plugin {
20376
20404
  [SheetPermissionInterceptorBaseController],
20377
20405
  [SheetPermissionInitController]
20378
20406
  // [MoveRangeController],
20379
- ], this._config.override).forEach((d) => injector.add(d)), this._injector.add(
20407
+ ], this._config.override).forEach((d) => this._injector.add(d)), this._injector.add(
20380
20408
  [
20381
20409
  SheetPermissionRenderManagerController,
20382
20410
  {