@univerjs/sheets-ui 1.2.0 → 1.3.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.
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
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";
1
+ import { BreakLineCommand, CoverContentCommand, DOCS_COMPONENT_MAIN_LAYER_INDEX, DOCS_VIEW_KEY, DOC_VERTICAL_PADDING, DeleteLeftCommand, DeleteRightCommand, DocSelectionRenderService, EditorColorPicker, EnterCommand, IEditorService, IMEInputCommand, InnerPasteCommand, MobileRichTextToolbar, MoveCursorOperation, MoveSelectionOperation, NodePositionConvertToCursor, ReplaceSnapshotCommand, SetDocInputStyleCommand, SetInlineFormatBoldCommand, SetInlineFormatCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatFontSizeCommand, SetInlineFormatItalicCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatTextColorCommand, SetInlineFormatUnderlineCommand, UniverDocsMobileUIPlugin, 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, bindFormatPainterCanvas, connectInjector, getEmbedBoundaryOwner, getEmbedChildUnitId, getMenuHiddenObservable, handleStringToStyle, imageMimeTypeSet, sanitizeParsedHtml, textTrim, useComponentsOfPart, useConfigValue, useDependency, useEvent, useObservable, useSidebarClick, useToolbarItemStatus, useVirtualList } from "@univerjs/ui";
4
+ import { AnchoredContextMenu, BuiltInUIPart, 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";
@@ -15916,7 +15916,7 @@ let HeaderResizeRenderController = class HeaderResizeRenderController extends Di
15916
15916
  if (Math.abs(initialType === 0 ? moveChangeY : moveChangeX) >= MINIMAL_OFFSET$1) isStartMove = true;
15917
15917
  if (initialType === 0) {
15918
15918
  if (moveChangeY > canvasMaxHeight - scrollBarHorizontalHeight + scrollXY.y - cell.startY) moveChangeY = canvasMaxHeight - scrollBarHorizontalHeight + scrollXY.y - cell.startY;
15919
- if (moveChangeY < -(cell.endY - cell.startY) + 2) moveChangeY = -(cell.endY - cell.startY) + 2;
15919
+ moveChangeY = Math.max(moveChangeY, -(cell.endY - cell.startY));
15920
15920
  if (isStartMove) {
15921
15921
  var _this$_resizeHelperSh, _this$_rowResizeRect4, _this$_rowResizeRect5;
15922
15922
  (_this$_resizeHelperSh = this._resizeHelperShape) === null || _this$_resizeHelperSh === void 0 || _this$_resizeHelperSh.transformByState({ top: currentOffsetY + moveChangeY });
@@ -15926,7 +15926,7 @@ let HeaderResizeRenderController = class HeaderResizeRenderController extends Di
15926
15926
  }
15927
15927
  } else {
15928
15928
  if (moveChangeX > canvasMaxWidth - scrollBarVerticalWidth + scrollXY.x - cell.startX) moveChangeX = canvasMaxWidth - scrollBarVerticalWidth + scrollXY.x - cell.startX;
15929
- if (moveChangeX < -(cell.endX - cell.startX) + 2) moveChangeX = -(cell.endX - cell.startX) + 2;
15929
+ moveChangeX = Math.max(moveChangeX, -(cell.endX - cell.startX));
15930
15930
  if (isStartMove) {
15931
15931
  var _this$_resizeHelperSh2, _this$_columnResizeRe4, _this$_columnResizeRe5;
15932
15932
  (_this$_resizeHelperSh2 = this._resizeHelperShape) === null || _this$_resizeHelperSh2 === void 0 || _this$_resizeHelperSh2.transformByState({ left: currentOffsetX + moveChangeX });
@@ -15936,7 +15936,7 @@ let HeaderResizeRenderController = class HeaderResizeRenderController extends Di
15936
15936
  }
15937
15937
  }
15938
15938
  });
15939
- this._scenePointerUpSub = scene.onPointerUp$.subscribeEvent((upEvt) => {
15939
+ this._scenePointerUpSub = scene.onPointerUp$.subscribeEvent(() => {
15940
15940
  var _this$_resizeHelperSh3;
15941
15941
  const scene = this._context.scene;
15942
15942
  this._clearObserverEvent();
@@ -16286,6 +16286,7 @@ let HeaderUnhideRenderController = class HeaderUnhideRenderController extends Rx
16286
16286
  dispose() {
16287
16287
  super.dispose();
16288
16288
  this._clearShapes();
16289
+ this.interceptor.dispose();
16289
16290
  }
16290
16291
  _init() {
16291
16292
  let activeSheetId = "";
@@ -16314,18 +16315,54 @@ let HeaderUnhideRenderController = class HeaderUnhideRenderController extends Rx
16314
16315
  if (!skeleton) return;
16315
16316
  const visibleCheck = this.interceptor.fetchThroughInterceptors(HEADER_UNHIDE_RANGE_VISIBLE_CHECK);
16316
16317
  const shouldRenderRange = (payload) => this._headerUnhideRangeService.shouldRenderRange(visibleCheck(true, payload) ?? true, payload);
16317
- const hiddenRowRanges = worksheet.getHiddenRows().filter((range) => shouldRenderRange({
16318
+ const zeroHeightRowRanges = [];
16319
+ const rowData = worksheet.getRowManager().getRowData();
16320
+ for (const rowIndex of Object.keys(rowData)) {
16321
+ const row = Number(rowIndex);
16322
+ if (row >= 0 && row < worksheet.getRowCount() && worksheet.getRowVisible(row) && worksheet.getRowHeight(row) === 0) zeroHeightRowRanges.push({
16323
+ startRow: row,
16324
+ endRow: row,
16325
+ startColumn: 0,
16326
+ endColumn: worksheet.getColumnCount() - 1
16327
+ });
16328
+ }
16329
+ const rowRanges = [...worksheet.getHiddenRows(), ...Rectangle.mergeRanges(zeroHeightRowRanges)].map((range) => ({
16330
+ ...range,
16331
+ rangeType: RANGE_TYPE.ROW
16332
+ })).filter((range) => shouldRenderRange({
16318
16333
  axis: "row",
16319
16334
  range,
16320
16335
  workbook,
16321
16336
  worksheet
16322
16337
  }));
16323
- const hiddenColRanges = worksheet.getHiddenCols().filter((range) => shouldRenderRange({
16338
+ const hiddenRowRanges = Rectangle.mergeRanges(rowRanges).map((range) => ({
16339
+ ...range,
16340
+ rangeType: RANGE_TYPE.ROW
16341
+ }));
16342
+ const zeroWidthColRanges = [];
16343
+ const columnData = worksheet.getColumnManager().getColumnData();
16344
+ for (const columnIndex of Object.keys(columnData)) {
16345
+ const column = Number(columnIndex);
16346
+ if (column >= 0 && column < worksheet.getColumnCount() && worksheet.getColVisible(column) && worksheet.getColumnWidth(column) === 0) zeroWidthColRanges.push({
16347
+ startRow: 0,
16348
+ endRow: worksheet.getRowCount() - 1,
16349
+ startColumn: column,
16350
+ endColumn: column
16351
+ });
16352
+ }
16353
+ const columnRanges = [...worksheet.getHiddenCols(), ...Rectangle.mergeRanges(zeroWidthColRanges)].map((range) => ({
16354
+ ...range,
16355
+ rangeType: RANGE_TYPE.COLUMN
16356
+ })).filter((range) => shouldRenderRange({
16324
16357
  axis: "column",
16325
16358
  range,
16326
16359
  workbook,
16327
16360
  worksheet
16328
16361
  }));
16362
+ const hiddenColRanges = Rectangle.mergeRanges(columnRanges).map((range) => ({
16363
+ ...range,
16364
+ rangeType: RANGE_TYPE.COLUMN
16365
+ }));
16329
16366
  const { scene } = this._getSheetObject();
16330
16367
  const rowCount = worksheet.getRowCount();
16331
16368
  const rowShapes = hiddenRowRanges.map((range) => {
@@ -18392,11 +18429,7 @@ const MenuItemInput = (props) => {
18392
18429
  if (compositionEndTimerRef.current !== null) clearTimeout(compositionEndTimerRef.current);
18393
18430
  }, []);
18394
18431
  const handleChange = (value) => {
18395
- if (!value) {
18396
- setInputValue(min.toString());
18397
- return;
18398
- }
18399
- const inputValue = value.toString();
18432
+ const inputValue = (value ?? min).toString();
18400
18433
  setInputValue(inputValue);
18401
18434
  onChange(inputValue);
18402
18435
  };
@@ -19120,7 +19153,7 @@ function TextColorSelectorMenuItemFactory(accessor) {
19120
19153
  type: MenuItemType.BUTTON_SELECTOR,
19121
19154
  selections: [{
19122
19155
  label: {
19123
- name: COLOR_PICKER_COMPONENT,
19156
+ name: EditorColorPicker.componentKey,
19124
19157
  hoverable: false,
19125
19158
  selectable: false
19126
19159
  },
@@ -19174,7 +19207,7 @@ function BackgroundColorSelectorMenuItemFactory(accessor) {
19174
19207
  icon: "PaintBucketDoubleIcon",
19175
19208
  selections: [{
19176
19209
  label: {
19177
- name: COLOR_PICKER_COMPONENT,
19210
+ name: EditorColorPicker.componentKey,
19178
19211
  hoverable: false,
19179
19212
  selectable: false
19180
19213
  },
@@ -19782,7 +19815,7 @@ function SetRowHeightMenuItemFactory(accessor) {
19782
19815
  const commandService = accessor.get(ICommandService);
19783
19816
  const univerInstanceService = accessor.get(IUniverInstanceService);
19784
19817
  const selectionManagerService = accessor.get(SheetsSelectionsService);
19785
- const min = 2;
19818
+ const min = 0;
19786
19819
  return {
19787
19820
  id: SetRowHeightCommand.id,
19788
19821
  type: MenuItemType.BUTTON,
@@ -19821,7 +19854,7 @@ function SetColWidthMenuItemFactory(accessor) {
19821
19854
  const commandService = accessor.get(ICommandService);
19822
19855
  const univerInstanceService = accessor.get(IUniverInstanceService);
19823
19856
  const selectionManagerService = accessor.get(SheetsSelectionsService);
19824
- const min = 2;
19857
+ const min = 0;
19825
19858
  return {
19826
19859
  id: SetColWidthCommand.id,
19827
19860
  type: MenuItemType.BUTTON,
@@ -20373,15 +20406,35 @@ function RenameSheetMenuItemFactory(accessor) {
20373
20406
  };
20374
20407
  }
20375
20408
  function ChangeColorSheetMenuItemFactory(accessor) {
20409
+ const univerInstanceService = accessor.get(IUniverInstanceService);
20410
+ const commandService = accessor.get(ICommandService);
20376
20411
  return {
20377
20412
  id: SetTabColorCommand.id,
20378
20413
  title: "sheets-ui.sheetConfig.changeColor",
20379
20414
  type: MenuItemType.SELECTOR,
20380
- selections: [{ label: {
20381
- name: COLOR_PICKER_COMPONENT,
20382
- hoverable: false,
20383
- selectable: false
20384
- } }],
20415
+ selections: [{
20416
+ label: "sheets-ui.toolbar.resetColor",
20417
+ icon: "NoColorDoubleIcon",
20418
+ value: ""
20419
+ }, {
20420
+ label: {
20421
+ name: EditorColorPicker.componentKey,
20422
+ hoverable: false,
20423
+ selectable: false
20424
+ },
20425
+ value$: new Observable((subscriber) => {
20426
+ const updateColor = () => {
20427
+ var _workbook$getActiveSh;
20428
+ const workbook = univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET);
20429
+ subscriber.next((workbook === null || workbook === void 0 || (_workbook$getActiveSh = workbook.getActiveSheet()) === null || _workbook$getActiveSh === void 0 ? void 0 : _workbook$getActiveSh.getTabColor()) ?? "");
20430
+ };
20431
+ updateColor();
20432
+ const disposable = commandService.onCommandExecuted(({ id }) => {
20433
+ if (id === SetTabColorMutation.id || id === SetWorksheetActiveOperation.id) updateColor();
20434
+ });
20435
+ return () => disposable.dispose();
20436
+ })
20437
+ }],
20385
20438
  hidden$: getWorkbookPermissionDisable$(accessor, [WorkbookEditablePermission])
20386
20439
  };
20387
20440
  }
@@ -22815,6 +22868,7 @@ function keepTextSelected(inputHtml) {
22815
22868
  if (!selection) return;
22816
22869
  const range = document.createRange();
22817
22870
  range.selectNodeContents(inputHtml);
22871
+ if (!getEditorText(inputHtml)) range.collapse(true);
22818
22872
  selection.removeAllRanges();
22819
22873
  selection.addRange(range);
22820
22874
  });
@@ -23714,7 +23768,7 @@ function SheetBarTabs() {
23714
23768
  embedChildType != null && /* @__PURE__ */ jsx(EmbedSheetTabProductIcon, { childType: embedChildType }),
23715
23769
  hasProtection && /* @__PURE__ */ jsx(LockIcon, { className: "univer-shrink-0" }),
23716
23770
  /* @__PURE__ */ jsx("span", {
23717
- className: "univer-truncate univer-outline-none",
23771
+ className: "univer-min-w-px univer-truncate univer-outline-none",
23718
23772
  children: sheet.getName()
23719
23773
  })
23720
23774
  ] }),
@@ -25091,7 +25145,7 @@ const useHighlightRange = (ranges = []) => {
25091
25145
  //#endregion
25092
25146
  //#region package.json
25093
25147
  var name = "@univerjs/sheets-ui";
25094
- var version = "1.2.0";
25148
+ var version = "1.3.0";
25095
25149
 
25096
25150
  //#endregion
25097
25151
  //#region src/views/cell-popup/config.ts
@@ -28736,7 +28790,7 @@ function SheetPermissionPanelListContent({ ActionRowComponent }) {
28736
28790
  }).filter((r) => !!r).join(",") : ""})`;
28737
28791
  } else if (rule.unitType === UnitObject.Worksheet) ruleName = targetName || "";
28738
28792
  return /* @__PURE__ */ jsxs("div", {
28739
- className: clsx("univer-mt-3 univer-rounded-lg univer-p-3 hover:univer-bg-gray-50", borderClassName),
28793
+ className: clsx("univer-mt-3 univer-rounded-lg univer-p-3 hover:univer-bg-gray-50 dark:hover:!univer-bg-gray-800", borderClassName),
28740
28794
  onMouseMove: () => {
28741
28795
  const { subUnitId, unitType } = rule;
28742
28796
  const activeSheet = workbook.getActiveSheet();
@@ -28770,14 +28824,14 @@ function SheetPermissionPanelListContent({ ActionRowComponent }) {
28770
28824
  children: [hasManagerPermission && /* @__PURE__ */ jsx(Tooltip, {
28771
28825
  title: localeService.t("sheets-ui.permission.panel.edit"),
28772
28826
  children: /* @__PURE__ */ jsx("div", {
28773
- className: "univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200",
28827
+ className: "univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-700",
28774
28828
  onClick: () => handleEdit(rule),
28775
28829
  children: /* @__PURE__ */ jsx(WriteIcon, {})
28776
28830
  })
28777
28831
  }), hasDeletePermission && /* @__PURE__ */ jsx(Tooltip, {
28778
28832
  title: localeService.t("sheets-ui.permission.panel.delete"),
28779
28833
  children: /* @__PURE__ */ jsx("div", {
28780
- className: "univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200",
28834
+ className: "univer-box-border univer-h-6 univer-rounded-sm univer-p-1 hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-700",
28781
28835
  onClick: () => handleDelete(rule),
28782
28836
  children: /* @__PURE__ */ jsx(DeleteIcon, {})
28783
28837
  })
@@ -32135,7 +32189,6 @@ let SheetUIMobileController = class SheetUIMobileController extends Disposable {
32135
32189
  const visualViewport = window.visualViewport;
32136
32190
  let stableHeight = Math.round(window.innerHeight);
32137
32191
  let stableWidth = Math.round(window.innerWidth);
32138
- let keyboardWasVisible = false;
32139
32192
  const update = () => {
32140
32193
  const width = Math.round(window.innerWidth);
32141
32194
  const visibleBottom = visualViewport ? visualViewport.offsetTop + visualViewport.height : window.innerHeight;
@@ -32145,15 +32198,6 @@ let SheetUIMobileController = class SheetUIMobileController extends Disposable {
32145
32198
  } else if (!isMobileKeyboardVisible(stableHeight, visibleBottom)) stableHeight = Math.round(Math.max(stableHeight, window.innerHeight, visibleBottom));
32146
32199
  const keyboardVisible = isMobileKeyboardVisible(stableHeight, visibleBottom);
32147
32200
  this._contextService.setContextValue(MOBILE_KEYBOARD_VISIBLE, keyboardVisible);
32148
- if (shouldHideMobileEditorOnKeyboardClose(keyboardWasVisible && !keyboardVisible, this._contextService.getContextValue("MOBILE_FX_EDITOR_EXPANDED"), this._contextService.getContextValue("MOBILE_FORMULA_FUNCTION_PANEL_OPEN"), this._editorBridgeService.isForceKeepVisible())) {
32149
- const visibleState = this._editorBridgeService.isVisible();
32150
- if (visibleState.visible) this._commandService.executeCommand(SetCellEditVisibleOperation.id, {
32151
- ...visibleState,
32152
- visible: false,
32153
- eventType: DeviceInputEventType.PointerDown
32154
- });
32155
- }
32156
- keyboardWasVisible = keyboardVisible;
32157
32201
  };
32158
32202
  update();
32159
32203
  window.addEventListener("resize", update);
@@ -32210,9 +32254,6 @@ SheetUIMobileController = __decorate([
32210
32254
  function isMobileKeyboardVisible(stableHeight, visibleBottom) {
32211
32255
  return stableHeight - visibleBottom > 80;
32212
32256
  }
32213
- function shouldHideMobileEditorOnKeyboardClose(keyboardClosed, editorExpanded, functionPanelOpen, forceKeepVisible) {
32214
- return keyboardClosed && !editorExpanded && !functionPanelOpen && !forceKeepVisible;
32215
- }
32216
32257
 
32217
32258
  //#endregion
32218
32259
  //#region src/controllers/move-range.controller.ts
@@ -32836,7 +32877,7 @@ let FormatPainterRenderController = class FormatPainterRenderController extends
32836
32877
  getTarget: (event) => {
32837
32878
  var _this$_selections$get, _this$_context$unit$g;
32838
32879
  const picked = this._context.scene.pick(new Vector2(event.offsetX, event.offsetY));
32839
- if (picked && picked !== this._context.mainComponent) return null;
32880
+ if (picked && picked !== this._context.mainComponent && picked !== this._context.components.get("__SpreadsheetRowHeader__") && picked !== this._context.components.get("__SpreadsheetColumnHeader__")) return null;
32840
32881
  const range = (_this$_selections$get = this._selections.getCurrentLastSelection()) === null || _this$_selections$get === void 0 ? void 0 : _this$_selections$get.range;
32841
32882
  return range ? {
32842
32883
  unitId: this._context.unitId,
@@ -33163,27 +33204,22 @@ let MobileHeaderResizeRenderController = class MobileHeaderResizeRenderControlle
33163
33204
  _defineProperty(this, "_columnResizeButton", void 0);
33164
33205
  _defineProperty(this, "_resizeHelperShape", void 0);
33165
33206
  _defineProperty(this, "_isDragging", false);
33166
- _defineProperty(this, "_touchStartX", 0);
33167
- _defineProperty(this, "_touchStartY", 0);
33168
- _defineProperty(this, "_touchMoveHandler", void 0);
33169
- _defineProperty(this, "_touchEndHandler", void 0);
33207
+ _defineProperty(this, "_resizeListeners", void 0);
33170
33208
  _defineProperty(this, "_selectionSubscription", void 0);
33171
33209
  _defineProperty(this, "_scrollSubscription", void 0);
33172
33210
  this._init();
33173
33211
  }
33174
33212
  dispose() {
33175
- var _this$_rowResizeButto, _this$_columnResizeBu, _this$_resizeHelperSh, _this$_selectionSubsc, _this$_scrollSubscrip;
33213
+ var _this$_rowResizeButto, _this$_columnResizeBu, _this$_selectionSubsc, _this$_scrollSubscrip;
33214
+ this._cancelResize();
33176
33215
  (_this$_rowResizeButto = this._rowResizeButton) === null || _this$_rowResizeButto === void 0 || _this$_rowResizeButto.dispose();
33177
33216
  this._rowResizeButton = null;
33178
33217
  (_this$_columnResizeBu = this._columnResizeButton) === null || _this$_columnResizeBu === void 0 || _this$_columnResizeBu.dispose();
33179
33218
  this._columnResizeButton = null;
33180
- (_this$_resizeHelperSh = this._resizeHelperShape) === null || _this$_resizeHelperSh === void 0 || _this$_resizeHelperSh.dispose();
33181
- this._resizeHelperShape = null;
33182
33219
  (_this$_selectionSubsc = this._selectionSubscription) === null || _this$_selectionSubsc === void 0 || _this$_selectionSubsc.unsubscribe();
33183
33220
  this._selectionSubscription = null;
33184
33221
  (_this$_scrollSubscrip = this._scrollSubscription) === null || _this$_scrollSubscrip === void 0 || _this$_scrollSubscrip.unsubscribe();
33185
33222
  this._scrollSubscription = null;
33186
- this._cleanupTouchHandlers();
33187
33223
  super.dispose();
33188
33224
  }
33189
33225
  _init() {
@@ -33204,8 +33240,8 @@ let MobileHeaderResizeRenderController = class MobileHeaderResizeRenderControlle
33204
33240
  zIndex: 100
33205
33241
  });
33206
33242
  scene.addObjects([this._rowResizeButton, this._columnResizeButton], 10);
33207
- this._bindTouchEventsToButton(this._rowResizeButton, "row");
33208
- this._bindTouchEventsToButton(this._columnResizeButton, "column");
33243
+ this._bindPointerEventsToButton(this._rowResizeButton, "row");
33244
+ this._bindPointerEventsToButton(this._columnResizeButton, "column");
33209
33245
  }
33210
33246
  _initSelectionListener() {
33211
33247
  this._selectionSubscription = this._selectionManagerService.selectionMoveEnd$.subscribe((selections) => {
@@ -33290,12 +33326,13 @@ let MobileHeaderResizeRenderController = class MobileHeaderResizeRenderControlle
33290
33326
  });
33291
33327
  }
33292
33328
  }
33293
- _bindTouchEventsToButton(button, type) {
33294
- button.onPointerDown$.subscribeEvent((evt) => {
33329
+ _bindPointerEventsToButton(button, type) {
33330
+ this.disposeWithMe(button.onPointerDown$.subscribeEvent((evt) => {
33331
+ if (evt.button !== 0) return;
33295
33332
  if (this._contextService.getContextValue("MOBILE_PINCH_ZOOMING")) return;
33296
33333
  if (this._contextService.getContextValue("MOBILE_EXPANDING_SELECTION")) return;
33297
33334
  this._startResize(evt, type);
33298
- });
33335
+ }));
33299
33336
  }
33300
33337
  _startResize(evt, type) {
33301
33338
  const skeleton = this._sheetSkeletonManagerService.getCurrentSkeleton();
@@ -33304,69 +33341,80 @@ let MobileHeaderResizeRenderController = class MobileHeaderResizeRenderControlle
33304
33341
  const engine = scene.getEngine();
33305
33342
  const canvasElement = engine === null || engine === void 0 ? void 0 : engine.getCanvasElement();
33306
33343
  if (!canvasElement) return;
33307
- this._touchStartX = evt.offsetX;
33308
- this._touchStartY = evt.offsetY;
33309
- this._isDragging = false;
33344
+ this._cancelResize();
33310
33345
  const currentOffset = type === "row" ? skeleton.getOffsetByRow(this._currentRow) : skeleton.getOffsetByColumn(this._currentColumn);
33311
33346
  this._createResizeHelper(type, currentOffset, skeleton);
33312
33347
  scene.disableObjectsEvent();
33313
- this._setupTouchHandlers(canvasElement, type, currentOffset);
33348
+ this._setupPointerHandlers(canvasElement, evt, type, currentOffset);
33314
33349
  }
33315
- _setupTouchHandlers(canvasElement, type, initialOffset) {
33316
- if (!this._sheetSkeletonManagerService.getCurrentSkeleton()) return;
33317
- const scene = this._context.scene;
33350
+ _setupPointerHandlers(canvasElement, evt, type, initialOffset) {
33318
33351
  const worksheet = this._context.unit.getActiveSheet();
33319
- const zoomRatio = (worksheet === null || worksheet === void 0 ? void 0 : worksheet.getZoomRatio()) || 1;
33352
+ if (!worksheet) {
33353
+ this._cancelResize();
33354
+ return;
33355
+ }
33356
+ const zoomRatio = worksheet.getZoomRatio() || 1;
33357
+ const initialSize = type === "row" ? worksheet.getRowHeight(this._currentRow) : worksheet.getColumnWidth(this._currentColumn);
33358
+ const anchor = type === "row" ? this._currentRow : this._currentColumn;
33359
+ const pointerId = "pointerId" in evt ? evt.pointerId : 0;
33360
+ const startX = evt.offsetX;
33361
+ const startY = evt.offsetY;
33320
33362
  let totalDelta = 0;
33321
- this._touchMoveHandler = (e) => {
33363
+ const handlePointerMove = (e) => {
33364
+ if (e.pointerId !== pointerId) return;
33322
33365
  if (this._contextService.getContextValue("MOBILE_PINCH_ZOOMING")) {
33323
33366
  this._cancelResize();
33324
33367
  return;
33325
33368
  }
33326
- if (e.touches.length !== 1) return;
33327
- const touch = e.touches[0];
33328
33369
  const rect = canvasElement.getBoundingClientRect();
33329
- const offsetX = touch.clientX - rect.left;
33330
- const offsetY = touch.clientY - rect.top;
33331
- const adjustedDelta = (type === "row" ? offsetY - this._touchStartY : offsetX - this._touchStartX) / zoomRatio;
33370
+ const offsetX = e.clientX - rect.left;
33371
+ const offsetY = e.clientY - rect.top;
33372
+ const adjustedDelta = (type === "row" ? offsetY - startY : offsetX - startX) / zoomRatio;
33332
33373
  if (Math.abs(adjustedDelta) >= MINIMAL_OFFSET) this._isDragging = true;
33333
33374
  if (this._isDragging) {
33334
- totalDelta = adjustedDelta;
33335
- this._updateResizeHelper(type, initialOffset + adjustedDelta);
33336
- this._updateResizeButton(type, initialOffset + adjustedDelta);
33375
+ totalDelta = Math.max(adjustedDelta, -initialSize);
33376
+ this._updateResizeHelper(type, initialOffset + totalDelta);
33377
+ this._updateResizeButton(type, initialOffset + totalDelta);
33337
33378
  }
33338
33379
  e.preventDefault();
33339
33380
  };
33340
- this._touchEndHandler = (e) => {
33341
- scene.enableObjectsEvent();
33342
- if (this._isDragging && Math.abs(totalDelta) >= MINIMAL_OFFSET) {
33343
- if (type === "row") this._commandService.executeCommand(DeltaRowHeightCommand.id, {
33344
- deltaY: totalDelta,
33345
- anchorRow: this._currentRow
33346
- });
33347
- else this._commandService.executeCommand(DeltaColumnWidthCommand.id, {
33348
- deltaX: totalDelta,
33349
- anchorCol: this._currentColumn
33350
- });
33351
- }
33381
+ const handlePointerUp = async (e) => {
33382
+ if (e.pointerId !== pointerId) return;
33383
+ const shouldResize = this._isDragging && totalDelta !== 0;
33352
33384
  this._cleanupResize();
33353
- if (this._touchMoveHandler) canvasElement.removeEventListener("touchmove", this._touchMoveHandler);
33354
- if (this._touchEndHandler) {
33355
- canvasElement.removeEventListener("touchend", this._touchEndHandler);
33356
- canvasElement.removeEventListener("touchcancel", this._touchEndHandler);
33357
- }
33358
33385
  e.preventDefault();
33386
+ if (shouldResize) await this._commandService.executeCommand(type === "row" ? DeltaRowHeightCommand.id : DeltaColumnWidthCommand.id, type === "row" ? {
33387
+ deltaY: totalDelta,
33388
+ anchorRow: anchor
33389
+ } : {
33390
+ deltaX: totalDelta,
33391
+ anchorCol: anchor
33392
+ });
33359
33393
  };
33360
- canvasElement.addEventListener("touchmove", this._touchMoveHandler, { passive: false });
33361
- canvasElement.addEventListener("touchend", this._touchEndHandler, { passive: false });
33362
- canvasElement.addEventListener("touchcancel", this._touchEndHandler, { passive: false });
33363
- this.disposeWithMe(toDisposable(() => {
33364
- if (this._touchMoveHandler) canvasElement.removeEventListener("touchmove", this._touchMoveHandler);
33365
- if (this._touchEndHandler) {
33366
- canvasElement.removeEventListener("touchend", this._touchEndHandler);
33367
- canvasElement.removeEventListener("touchcancel", this._touchEndHandler);
33368
- }
33369
- }));
33394
+ this._bindResizeListeners(canvasElement, pointerId, handlePointerMove, handlePointerUp);
33395
+ }
33396
+ _bindResizeListeners(canvasElement, pointerId, handlePointerMove, handlePointerUp) {
33397
+ const ownerDocument = canvasElement.ownerDocument;
33398
+ const ownerWindow = ownerDocument.defaultView;
33399
+ const handlePointerCancel = (e) => {
33400
+ if (e.pointerId === pointerId) this._cancelResize();
33401
+ };
33402
+ const handlePointerDown = (e) => {
33403
+ if (e.pointerId !== pointerId) this._cancelResize();
33404
+ };
33405
+ const handleBlur = () => this._cancelResize();
33406
+ ownerDocument.addEventListener("pointermove", handlePointerMove, { passive: false });
33407
+ ownerDocument.addEventListener("pointerup", handlePointerUp);
33408
+ ownerDocument.addEventListener("pointercancel", handlePointerCancel);
33409
+ ownerDocument.addEventListener("pointerdown", handlePointerDown);
33410
+ ownerWindow === null || ownerWindow === void 0 || ownerWindow.addEventListener("blur", handleBlur);
33411
+ this._resizeListeners = toDisposable(() => {
33412
+ ownerDocument.removeEventListener("pointermove", handlePointerMove);
33413
+ ownerDocument.removeEventListener("pointerup", handlePointerUp);
33414
+ ownerDocument.removeEventListener("pointercancel", handlePointerCancel);
33415
+ ownerDocument.removeEventListener("pointerdown", handlePointerDown);
33416
+ ownerWindow === null || ownerWindow === void 0 || ownerWindow.removeEventListener("blur", handleBlur);
33417
+ });
33370
33418
  }
33371
33419
  _createResizeHelper(type, offset, skeleton) {
33372
33420
  const scene = this._context.scene;
@@ -33407,30 +33455,18 @@ let MobileHeaderResizeRenderController = class MobileHeaderResizeRenderControlle
33407
33455
  else button.transformByState({ left: newOffset - buttonSize / 2 });
33408
33456
  }
33409
33457
  _cleanupResize() {
33410
- var _this$_resizeHelperSh2;
33411
- (_this$_resizeHelperSh2 = this._resizeHelperShape) === null || _this$_resizeHelperSh2 === void 0 || _this$_resizeHelperSh2.dispose();
33458
+ var _this$_resizeListener, _this$_resizeHelperSh;
33459
+ (_this$_resizeListener = this._resizeListeners) === null || _this$_resizeListener === void 0 || _this$_resizeListener.dispose();
33460
+ this._resizeListeners = null;
33461
+ this._context.scene.enableObjectsEvent();
33462
+ (_this$_resizeHelperSh = this._resizeHelperShape) === null || _this$_resizeHelperSh === void 0 || _this$_resizeHelperSh.dispose();
33412
33463
  this._resizeHelperShape = null;
33413
33464
  this._isDragging = false;
33414
33465
  }
33415
- _cleanupTouchHandlers() {
33416
- const engine = this._context.scene.getEngine();
33417
- const canvasElement = engine === null || engine === void 0 ? void 0 : engine.getCanvasElement();
33418
- if (canvasElement) {
33419
- if (this._touchMoveHandler) {
33420
- canvasElement.removeEventListener("touchmove", this._touchMoveHandler);
33421
- this._touchMoveHandler = null;
33422
- }
33423
- if (this._touchEndHandler) {
33424
- canvasElement.removeEventListener("touchend", this._touchEndHandler);
33425
- canvasElement.removeEventListener("touchcancel", this._touchEndHandler);
33426
- this._touchEndHandler = null;
33427
- }
33428
- }
33429
- }
33430
33466
  _cancelResize() {
33431
- this._context.scene.enableObjectsEvent();
33467
+ if (!this._resizeHelperShape && !this._resizeListeners) return;
33432
33468
  this._cleanupResize();
33433
- this._cleanupTouchHandlers();
33469
+ this._updateButtonPositionOnScroll();
33434
33470
  }
33435
33471
  };
33436
33472
  MobileHeaderResizeRenderController = __decorate([
@@ -33444,6 +33480,7 @@ MobileHeaderResizeRenderController = __decorate([
33444
33480
  //#endregion
33445
33481
  //#region src/controllers/render-controllers/mobile/mobile-hover.render-controller.ts
33446
33482
  const TAP_MOVE_THRESHOLD = 10;
33483
+ const DOUBLE_TAP_MOVE_THRESHOLD = 20;
33447
33484
  const DOUBLE_TAP_DELAY = 500;
33448
33485
  function getPointerId(event) {
33449
33486
  return "pointerId" in event ? event.pointerId : void 0;
@@ -33519,6 +33556,7 @@ let MobileHoverRenderController = class MobileHoverRenderController extends Disp
33519
33556
  next: ([event, state]) => {
33520
33557
  state.stopPropagation();
33521
33558
  state.skipNextObservers = true;
33559
+ if (event.deviceType === DeviceType.Touch) return;
33522
33560
  if (this._suppressEngineDoubleClick) {
33523
33561
  this._clearEngineDoubleClickSuppression();
33524
33562
  return;
@@ -33569,15 +33607,15 @@ let MobileHoverRenderController = class MobileHoverRenderController extends Disp
33569
33607
  return;
33570
33608
  }
33571
33609
  this._tapState = {
33572
- offsetX: event.offsetX,
33573
- offsetY: event.offsetY,
33610
+ clientX: event.clientX,
33611
+ clientY: event.clientY,
33574
33612
  pointerId: getPointerId(event)
33575
33613
  };
33576
33614
  }
33577
33615
  _updateTapState(event) {
33578
33616
  const pointerId = getPointerId(event);
33579
33617
  if (!this._tapState || pointerId != null && pointerId !== this._tapState.pointerId) return;
33580
- if (Math.abs(event.offsetX - this._tapState.offsetX) > TAP_MOVE_THRESHOLD || Math.abs(event.offsetY - this._tapState.offsetY) > TAP_MOVE_THRESHOLD) this._resetTapSequence();
33618
+ if (Math.abs(event.clientX - this._tapState.clientX) > TAP_MOVE_THRESHOLD || Math.abs(event.clientY - this._tapState.clientY) > TAP_MOVE_THRESHOLD) this._resetTapSequence();
33581
33619
  }
33582
33620
  _finishTap(event) {
33583
33621
  const tapState = this._tapState;
@@ -33587,14 +33625,28 @@ let MobileHoverRenderController = class MobileHoverRenderController extends Disp
33587
33625
  this._resetCompletedTap();
33588
33626
  return false;
33589
33627
  }
33590
- const completed = Math.abs(event.offsetX - tapState.offsetX) <= TAP_MOVE_THRESHOLD && Math.abs(event.offsetY - tapState.offsetY) <= TAP_MOVE_THRESHOLD && !this._contextService.getContextValue("MOBILE_PINCH_ZOOMING") && !this._contextService.getContextValue("MOBILE_EXPANDING_SELECTION") && !this._contextService.getContextValue("MOBILE_TRIGGER_CONTEXT_MENU");
33628
+ const completed = Math.abs(event.clientX - tapState.clientX) <= TAP_MOVE_THRESHOLD && Math.abs(event.clientY - tapState.clientY) <= TAP_MOVE_THRESHOLD && !this._contextService.getContextValue("MOBILE_PINCH_ZOOMING") && !this._contextService.getContextValue("MOBILE_EXPANDING_SELECTION") && !this._contextService.getContextValue("MOBILE_TRIGGER_CONTEXT_MENU");
33591
33629
  if (!completed) this._resetCompletedTap();
33592
33630
  return completed;
33593
33631
  }
33594
33632
  _completeTap(unitId, event) {
33633
+ const skeletonParam = this._sheetSkeletonManagerService.getCurrentParam();
33634
+ const cellIndex = skeletonParam && getCellIndexByOffsetWithMerge(event.offsetX, event.offsetY, this._context.scene, skeletonParam.skeleton);
33635
+ if (!cellIndex || !skeletonParam) {
33636
+ this._resetCompletedTap();
33637
+ return;
33638
+ }
33639
+ const cell = {
33640
+ unitId,
33641
+ subUnitId: skeletonParam.sheetId,
33642
+ row: cellIndex.actualRow,
33643
+ col: cellIndex.actualCol
33644
+ };
33645
+ const timeStamp = Number.isFinite(event.timeStamp) ? event.timeStamp : performance.now();
33595
33646
  const lastCompletedTap = this._lastCompletedTap;
33596
- if (lastCompletedTap && Math.abs(event.offsetX - lastCompletedTap.offsetX) <= TAP_MOVE_THRESHOLD && Math.abs(event.offsetY - lastCompletedTap.offsetY) <= TAP_MOVE_THRESHOLD) {
33647
+ if (lastCompletedTap && timeStamp >= lastCompletedTap.timeStamp && timeStamp - lastCompletedTap.timeStamp <= DOUBLE_TAP_DELAY && cell.unitId === lastCompletedTap.cell.unitId && cell.subUnitId === lastCompletedTap.cell.subUnitId && cell.row === lastCompletedTap.cell.row && cell.col === lastCompletedTap.cell.col && Math.abs(event.clientX - lastCompletedTap.clientX) <= DOUBLE_TAP_MOVE_THRESHOLD && Math.abs(event.clientY - lastCompletedTap.clientY) <= DOUBLE_TAP_MOVE_THRESHOLD) {
33597
33648
  this._resetCompletedTap();
33649
+ this._clearEngineDoubleClickSuppression();
33598
33650
  this._suppressEngineDoubleClick = true;
33599
33651
  this._suppressEngineDoubleClickTimer = setTimeout(() => {
33600
33652
  this._suppressEngineDoubleClick = false;
@@ -33605,9 +33657,10 @@ let MobileHoverRenderController = class MobileHoverRenderController extends Disp
33605
33657
  }
33606
33658
  this._resetCompletedTap();
33607
33659
  this._lastCompletedTap = {
33608
- offsetX: event.offsetX,
33609
- offsetY: event.offsetY,
33610
- pointerId: getPointerId(event)
33660
+ clientX: event.clientX,
33661
+ clientY: event.clientY,
33662
+ timeStamp,
33663
+ cell
33611
33664
  };
33612
33665
  this._completedTapTimer = setTimeout(() => this._resetCompletedTap(), DOUBLE_TAP_DELAY);
33613
33666
  }
@@ -35440,7 +35493,7 @@ _defineProperty(UniverSheetsMobileUIPlugin, "packageName", name);
35440
35493
  _defineProperty(UniverSheetsMobileUIPlugin, "version", version);
35441
35494
  _defineProperty(UniverSheetsMobileUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
35442
35495
  UniverSheetsMobileUIPlugin = __decorate([
35443
- DependentOn(UniverDocsPlugin, UniverFormulaEnginePlugin, UniverRenderEnginePlugin, UniverSheetsPlugin, UniverMobileUIPlugin, UniverDocsUIPlugin),
35496
+ DependentOn(UniverDocsPlugin, UniverFormulaEnginePlugin, UniverRenderEnginePlugin, UniverSheetsPlugin, UniverMobileUIPlugin, UniverDocsMobileUIPlugin),
35444
35497
  __decorateParam(1, Inject(Injector)),
35445
35498
  __decorateParam(2, IRenderManagerService),
35446
35499
  __decorateParam(3, IConfigService),
@@ -43,4 +43,3 @@ export declare class SheetUIMobileController extends Disposable {
43
43
  private _initMobileFxShortcut;
44
44
  }
45
45
  export declare function isMobileKeyboardVisible(stableHeight: number, visibleBottom: number): boolean;
46
- export declare function shouldHideMobileEditorOnKeyboardClose(keyboardClosed: boolean, editorExpanded: boolean, functionPanelOpen: boolean, forceKeepVisible: boolean): boolean;
@@ -15,8 +15,8 @@
15
15
  */
16
16
  import type { Workbook } from '@univerjs/core';
17
17
  import type { IRenderContext } from '@univerjs/engine-render';
18
- import type { IHeaderUnhideRangeVisibleCheck } from '../../services/header-unhide-range.service';
19
18
  import { ICommandService, InterceptorManager, RxDisposable } from '@univerjs/core';
19
+ import type { IHeaderUnhideRangeVisibleCheck } from '../../services/header-unhide-range.service';
20
20
  import { HeaderUnhideRangeService } from '../../services/header-unhide-range.service';
21
21
  import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
22
22
  export declare const HEADER_UNHIDE_RANGE_VISIBLE_CHECK: import("@univerjs/core").IInterceptor<boolean, IHeaderUnhideRangeVisibleCheck>;