diff --git a/docs/tldr/skeleton.svg b/docs/tldr/skeleton.svg new file mode 100644 index 00000000000..eebe86e8184 --- /dev/null +++ b/docs/tldr/skeleton.svg @@ -0,0 +1,8 @@ +packages/core/src/skeleton.tspackages/core/src/skeleton.tspackages/core/src/sheets/sheet-skeleton.tspackages/core/src/sheets/sheet-skeleton.tspackages/engine-render/.../sheets/sheet.render-skeleton.tspackages/engine-render/.../sheets/sheet.render-skeleton.tspackages/engine-render/.../docs/layout/doc-skeleton.tspackages/engine-render/.../docs/layout/doc-skeleton.ts \ No newline at end of file diff --git a/packages/core/src/sheets/sheet-skeleton.ts b/packages/core/src/sheets/sheet-skeleton.ts index 695def78d75..cc8d534baf0 100644 --- a/packages/core/src/sheets/sheet-skeleton.ts +++ b/packages/core/src/sheets/sheet-skeleton.ts @@ -67,14 +67,6 @@ export class SheetSkeleton extends Skeleton { protected _cellData: ObjectMatrix>; protected _imageCacheMap: ImageCacheMap; - /** Scale of Scene */ - scaleX: number; - scaleY: number; - /** Viewport scrolled value */ - scrollX: number; - /** Viewport scrolled value */ - scrollY: number; - constructor( readonly worksheet: Worksheet, protected _styles: Styles, @@ -99,7 +91,6 @@ export class SheetSkeleton extends Skeleton { /** * @deprecated should never expose a property that is provided by another module! - * @returns */ getWorksheetConfig(): IWorksheetData { return this._worksheetData; @@ -121,6 +112,13 @@ export class SheetSkeleton extends Skeleton { private _columnWidthAccumulation: number[] = []; private _marginTop: number = 0; private _marginLeft: number = 0; + /** Scale of Scene */ + protected _scaleX: number; + protected _scaleY: number; + /** Viewport scrolled value */ + protected _scrollX: number; + /** Viewport scrolled value */ + protected _scrollY: number; get rowHeightAccumulation(): number[] { return this._rowHeightAccumulation; @@ -156,20 +154,36 @@ export class SheetSkeleton extends Skeleton { setScale(value: number, valueY?: number): void { this._updateLayout(); - this.scaleX = value; - this.scaleY = valueY || value; + this._scaleX = value; + this._scaleY = valueY || value; this._updateLayout(); } setScroll(scrollX?: number, scrollY?: number) { if (Tools.isDefine(scrollX)) { - this.scrollX = scrollX; + this._scrollX = scrollX; } if (Tools.isDefine(scrollY)) { - this.scrollY = scrollY; + this._scrollY = scrollY; } } + get scrollX(): number { + return this._scrollX; + } + + get scrollY(): number { + return this._scrollY; + } + + get scaleX(): number { + return this._scaleX; + } + + get scaleY(): number { + return this._scaleY; + } + get rowHeaderWidthAndMarginLeft(): number { return this.rowHeaderWidth + this._marginLeft; } @@ -377,8 +391,6 @@ export class SheetSkeleton extends Skeleton { columnCount, rowHeader, columnHeader, - showGridlines, - gridlinesColor, } = this._worksheetData; const { rowTotalHeight, rowHeightAccumulation } = @@ -534,8 +546,23 @@ export class SheetSkeleton extends Skeleton { * @param column * @returns {ISelectionCell} The cell info with merge data */ - protected _getCellMergeInfo(row: number, column: number): ISelectionCell { - return this.worksheet.getCellInfoInMergeData(row, column); + // protected _getCellMergeInfo(row: number, column: number): ISelectionCell { + // return this.worksheet.getCellInfoInMergeData(row, column); + // } + + /** + * @deprecated use getNoMergeCellWithCoordByIndex instead. + * @param rowIndex + * @param columnIndex + * @param header + * @returns + */ + getNoMergeCellPositionByIndex( + rowIndex: number, + columnIndex: number, + header: boolean = true + ) { + return this.getNoMergeCellWithCoordByIndex(rowIndex, columnIndex, header); } /** @@ -895,7 +922,6 @@ export class SheetSkeleton extends Skeleton { * Original name: getDecomposedOffset * @param offsetX * @param offsetY - * @returns */ getOffsetRelativeToRowCol( offsetX: number, diff --git a/packages/core/src/sheets/workbook.ts b/packages/core/src/sheets/workbook.ts index 6daaa642f88..8a091f1107c 100644 --- a/packages/core/src/sheets/workbook.ts +++ b/packages/core/src/sheets/workbook.ts @@ -254,7 +254,6 @@ export class Workbook extends UnitModel { - if (param.value.scaleX !== undefined) { - this.scaleX = param.value.scaleX; - } - if (param.value.scaleY !== undefined) { - this.scaleY = param.value.scaleY; - } + this.setScale(param.value.scaleX || 1, param.value.scaleY); }); - - // const viewMain = this._scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_MAIN); - // if (viewMain) { - // viewMain; - // } } override _updateLayout() { diff --git a/packages/engine-render/src/components/sheets/spreadsheet.ts b/packages/engine-render/src/components/sheets/spreadsheet.ts index 0944a270990..695b879a5c5 100644 --- a/packages/engine-render/src/components/sheets/spreadsheet.ts +++ b/packages/engine-render/src/components/sheets/spreadsheet.ts @@ -26,7 +26,7 @@ import type { Background } from './extensions/background'; import type { Border } from './extensions/border'; import type { Font } from './extensions/font'; import type { IPaintForRefresh, IPaintForScrolling, SHEET_VIEWPORT_KEY } from './interfaces'; -import type { SpreadsheetSkeleton } from './sheet-skeleton'; +import type { SpreadsheetSkeleton } from './sheet.render-skeleton'; import { BooleanNumber, sortRules, Tools } from '@univerjs/core'; import { FIX_ONE_PIXEL_BLUR_OFFSET, RENDER_CLASS_TYPE } from '../../basics/const'; import { getColor } from '../../basics/tools'; diff --git a/packages/engine-render/src/components/sheets/util.ts b/packages/engine-render/src/components/sheets/util.ts index 37b933025ce..0c91628e763 100644 --- a/packages/engine-render/src/components/sheets/util.ts +++ b/packages/engine-render/src/components/sheets/util.ts @@ -17,7 +17,7 @@ import type { CellValueType, IDocumentData, IPaddingData, IStyleBase, IStyleData, ITextRotation, ITextStyle, Nullable, TextDirection } from '@univerjs/core'; import { DEFAULT_EMPTY_DOCUMENT_VALUE, DocumentDataModel, HorizontalAlign, VerticalAlign, WrapStrategy } from '@univerjs/core'; import { convertTextRotation } from '../../basics/text-rotation'; -import { DEFAULT_PADDING_DATA } from './sheet-skeleton'; +import { DEFAULT_PADDING_DATA } from './sheet.render-skeleton'; export interface ICellStyle { textRotation?: ITextRotation; diff --git a/packages/engine-render/src/index.ts b/packages/engine-render/src/index.ts index 0eccb408df8..6767213e040 100644 --- a/packages/engine-render/src/index.ts +++ b/packages/engine-render/src/index.ts @@ -34,7 +34,7 @@ export { DocumentViewModel } from './components/docs/view-model/document-view-mo export { DocumentEditArea } from './components/docs/view-model/document-view-model'; export { parseDataStreamToTree } from './components/docs/view-model/document-view-model'; export { getLastColumn } from './components/docs/layout/tools'; -export { DEFAULT_PADDING_DATA } from './components/sheets/sheet-skeleton'; +export { DEFAULT_PADDING_DATA } from './components/sheets/sheet.render-skeleton'; export * from './context'; export * from './custom'; export * from './engine'; diff --git a/packages/engine-render/src/scene.ts b/packages/engine-render/src/scene.ts index f689bd17f19..2dcf93306cb 100644 --- a/packages/engine-render/src/scene.ts +++ b/packages/engine-render/src/scene.ts @@ -17,7 +17,7 @@ import type { IKeyValue, Nullable } from '@univerjs/core'; import type { BaseObject } from './base-object'; import type { IDragEvent, IKeyboardEvent, IMouseEvent, IPointerEvent, IWheelEvent } from './basics/i-events'; -import type { IObjectFullState, ISceneTransformState, ITransformChangeState } from './basics/interfaces'; +import type { ISceneTransformState, ITransformChangeState } from './basics/interfaces'; import type { ITransformerConfig } from './basics/transformer-config'; import type { Vector2 } from './basics/vector2'; import type { Canvas } from './canvas'; diff --git a/packages/engine-render/tsconfig.json b/packages/engine-render/tsconfig.json index 09b75d7e95a..0667675684d 100644 --- a/packages/engine-render/tsconfig.json +++ b/packages/engine-render/tsconfig.json @@ -5,5 +5,5 @@ "outDir": "lib/types" }, "references": [{ "path": "./tsconfig.node.json" }], - "include": ["src", "types", "../core/src/skeleton.ts"] + "include": ["src", "types"] } diff --git a/packages/sheets-data-validation-ui/src/controllers/dv-render.controller.ts b/packages/sheets-data-validation-ui/src/controllers/dv-render.controller.ts index 9821d19dc44..fb42bd7df95 100644 --- a/packages/sheets-data-validation-ui/src/controllers/dv-render.controller.ts +++ b/packages/sheets-data-validation-ui/src/controllers/dv-render.controller.ts @@ -191,7 +191,7 @@ export class SheetsDataValidationRenderController extends RxDisposable { interceptorAutoHeight: () => { const skeleton = this._renderManagerService.getRenderById(unitId) ?.with(SheetSkeletonManagerService) - .getWorksheetSkeleton(subUnitId) + .getSkeletonParam(subUnitId) ?.skeleton; if (!skeleton) { return undefined; @@ -200,7 +200,7 @@ export class SheetsDataValidationRenderController extends RxDisposable { const info: ICellRenderContext = { data: cell, - style: skeleton.getsStyles().getStyleByCell(cell), + style: skeleton.getStyles().getStyleByCell(cell), primaryWithCoord: skeleton.getCellWithCoordByIndex(mergeCell?.startRow ?? row, mergeCell?.startColumn ?? col), unitId, subUnitId, @@ -214,7 +214,7 @@ export class SheetsDataValidationRenderController extends RxDisposable { interceptorAutoWidth: () => { const skeleton = this._renderManagerService.getRenderById(unitId) ?.with(SheetSkeletonManagerService) - .getWorksheetSkeleton(subUnitId) + .getSkeletonParam(subUnitId) ?.skeleton; if (!skeleton) { return undefined; @@ -223,7 +223,7 @@ export class SheetsDataValidationRenderController extends RxDisposable { const info: ICellRenderContext = { data: cell, - style: skeleton.getsStyles().getStyleByCell(cell), + style: skeleton.getStyles().getStyleByCell(cell), primaryWithCoord: skeleton.getCellWithCoordByIndex(mergeCell?.startRow ?? row, mergeCell?.startColumn ?? col), unitId, subUnitId, @@ -335,7 +335,7 @@ export class SheetsDataValidationMobileRenderController extends RxDisposable { interceptorAutoHeight: () => { const skeleton = this._renderManagerService.getRenderById(unitId) ?.with(SheetSkeletonManagerService) - .getWorksheetSkeleton(subUnitId) + .getSkeletonParam(subUnitId) ?.skeleton; if (!skeleton) { return undefined; @@ -344,7 +344,7 @@ export class SheetsDataValidationMobileRenderController extends RxDisposable { const info: ICellRenderContext = { data: cell, - style: skeleton.getsStyles().getStyleByCell(cell), + style: skeleton.getStyles().getStyleByCell(cell), primaryWithCoord: skeleton.getCellWithCoordByIndex(mergeCell?.startRow ?? row, mergeCell?.startColumn ?? col), unitId, subUnitId, diff --git a/packages/sheets-data-validation-ui/src/controllers/dv-rerender.controller.ts b/packages/sheets-data-validation-ui/src/controllers/dv-rerender.controller.ts index 82f10cb8eff..c02edba5f40 100644 --- a/packages/sheets-data-validation-ui/src/controllers/dv-rerender.controller.ts +++ b/packages/sheets-data-validation-ui/src/controllers/dv-rerender.controller.ts @@ -41,7 +41,7 @@ export class SheetsDataValidationReRenderController extends Disposable implement sheetIds.add(value.subUnitId); }); sheetIds.forEach((sheetId) => { - this._sheetSkeletonManagerService.getWorksheetSkeleton(sheetId)?.skeleton.makeDirty(true); + this._sheetSkeletonManagerService.getSkeletonParam(sheetId)?.skeleton.makeDirty(true); }); this._context.mainComponent?.makeForceDirty(); }; diff --git a/packages/sheets-drawing-ui/src/controllers/sheet-drawing-printing.controller.ts b/packages/sheets-drawing-ui/src/controllers/sheet-drawing-printing.controller.ts index f866ec8f95e..b7381371e08 100644 --- a/packages/sheets-drawing-ui/src/controllers/sheet-drawing-printing.controller.ts +++ b/packages/sheets-drawing-ui/src/controllers/sheet-drawing-printing.controller.ts @@ -65,7 +65,7 @@ export class SheetDrawingPrintingController extends Disposable { return next(range); } - const skeleton = renderer.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId); + const skeleton = renderer.with(SheetSkeletonManagerService).getSkeletonParam(subUnitId); if (!skeleton) { return next(range); } diff --git a/packages/sheets-drawing-ui/src/controllers/sheet-drawing-update.controller.ts b/packages/sheets-drawing-ui/src/controllers/sheet-drawing-update.controller.ts index 56e33b54d2e..8a07df03cd8 100644 --- a/packages/sheets-drawing-ui/src/controllers/sheet-drawing-update.controller.ts +++ b/packages/sheets-drawing-ui/src/controllers/sheet-drawing-update.controller.ts @@ -57,7 +57,7 @@ export function getDrawingSizeByCell( return false; } const skeletonManagerService = currentRender.with(SheetSkeletonManagerService); - const skeleton = skeletonManagerService.getWorksheetSkeleton(location.subUnitId)?.skeleton; + const skeleton = skeletonManagerService.getSkeletonParam(location.subUnitId)?.skeleton; if (skeleton == null) { return false; } diff --git a/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts b/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts index 1937b209f34..592411e4cbb 100644 --- a/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts +++ b/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts @@ -286,7 +286,7 @@ export class SheetCanvasFloatDomManagerService extends Disposable { return; } - const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId); + const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).getSkeletonParam(subUnitId); if (!skeleton) { return; } @@ -436,7 +436,7 @@ export class SheetCanvasFloatDomManagerService extends Disposable { const map = this._ensureMap(unitId, subUnitId); const ids = Array.from(map.keys()); const target = getSheetCommandTarget(this._univerInstanceService, { unitId, subUnitId }); - const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId); + const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).getSkeletonParam(subUnitId); if (!renderObject || !target || !skeleton) { return; } diff --git a/packages/sheets-formula-ui/src/views/range-selector/hooks/useHighlight.ts b/packages/sheets-formula-ui/src/views/range-selector/hooks/useHighlight.ts index 0111c0778db..9399eafc429 100644 --- a/packages/sheets-formula-ui/src/views/range-selector/hooks/useHighlight.ts +++ b/packages/sheets-formula-ui/src/views/range-selector/hooks/useHighlight.ts @@ -61,7 +61,7 @@ export function useSheetHighlight(unitId: string) { const currentSheetId = worksheet.getSheetId(); const getSheetIdByName = (name: string) => workbook?.getSheetBySheetName(name)?.getSheetId(); - const skeleton = sheetSkeletonManagerService?.getWorksheetSkeleton(currentSheetId)?.skeleton; + const skeleton = sheetSkeletonManagerService?.getSkeletonParam(currentSheetId)?.skeleton; if (!skeleton) return; for (let i = 0, len = refSelections.length; i < len; i++) { diff --git a/packages/sheets-hyper-link-ui/src/controllers/popup.controller.ts b/packages/sheets-hyper-link-ui/src/controllers/popup.controller.ts index 54385867d95..29abf1496c5 100644 --- a/packages/sheets-hyper-link-ui/src/controllers/popup.controller.ts +++ b/packages/sheets-hyper-link-ui/src/controllers/popup.controller.ts @@ -121,7 +121,7 @@ export class SheetsHyperLinkPopupController extends Disposable { } const skeleton = renderer?.with(SheetSkeletonManagerService) - .getWorksheetSkeleton(subUnitId) + .getSkeletonParam(subUnitId) ?.skeleton; const currentCol = col; @@ -209,7 +209,7 @@ export class SheetsHyperLinkPopupController extends Disposable { const rect = customRange.rects[customRange.rects.length - 1]; const skeleton = this._renderManagerService.getRenderById(unitId) ?.with(SheetSkeletonManagerService) - .getWorksheetSkeleton(sheetId) + .getSkeletonParam(sheetId) ?.skeleton; if (!skeleton || !rect) { return; diff --git a/packages/sheets-hyper-link/src/controllers/set-range.controller.ts b/packages/sheets-hyper-link/src/controllers/set-range.controller.ts index d95738fce38..09219f02e62 100644 --- a/packages/sheets-hyper-link/src/controllers/set-range.controller.ts +++ b/packages/sheets-hyper-link/src/controllers/set-range.controller.ts @@ -154,7 +154,7 @@ export class SheetHyperLinkSetRangeController extends Disposable { return next(cell); } // const renderer = this._renderManagerService.getRenderById(unitId); - // const skeleton = renderer?.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId); + // const skeleton = renderer?.with(SheetSkeletonManagerService).getSkeletonParam(subUnitId); // if (!skeleton) { // return next(cell); // } diff --git a/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-popup.controller.ts b/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-popup.controller.ts index 8ef34a29a5d..d109b235271 100644 --- a/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-popup.controller.ts +++ b/packages/sheets-thread-comment-ui/src/controllers/sheets-thread-comment-popup.controller.ts @@ -63,7 +63,7 @@ export class SheetsThreadCommentPopupController extends Disposable { private _handleSelectionChange(selections: ISelectionWithStyle[], unitId: string, subUnitId: string) { const range = selections[0]?.range; const render = this._renderManagerService.getRenderById(unitId); - const skeleton = render?.with(SheetSkeletonManagerService).getWorksheetSkeleton(subUnitId)?.skeleton; + const skeleton = render?.with(SheetSkeletonManagerService).getSkeletonParam(subUnitId)?.skeleton; if (!skeleton) { return; } diff --git a/packages/sheets-ui/src/controllers/auto-height.controller.ts b/packages/sheets-ui/src/controllers/auto-height.controller.ts index c1a3e32cf94..6b0259d60a6 100644 --- a/packages/sheets-ui/src/controllers/auto-height.controller.ts +++ b/packages/sheets-ui/src/controllers/auto-height.controller.ts @@ -61,13 +61,13 @@ export class AutoHeightController extends Disposable { const subUnitId = worksheet.getSheetId(); const sheetSkeletonService = this._renderManagerService.getRenderById(unitId)!.with(SheetSkeletonManagerService); - if (!subUnitId || !sheetSkeletonService.getCurrent()) { + if (!subUnitId || !sheetSkeletonService.getCurrentParam()) { return { redos: [], undos: [], }; } - const { skeleton } = sheetSkeletonService.getCurrent()!; + const { skeleton } = sheetSkeletonService.getCurrentParam()!; const rowsAutoHeightInfo = skeleton.calculateAutoHeightInRange(ranges); const redoParams: ISetWorksheetRowAutoHeightMutationParams = { diff --git a/packages/sheets-ui/src/controllers/auto-width.controller.ts b/packages/sheets-ui/src/controllers/auto-width.controller.ts index 55efee3f6fc..e7b92b7f7ac 100644 --- a/packages/sheets-ui/src/controllers/auto-width.controller.ts +++ b/packages/sheets-ui/src/controllers/auto-width.controller.ts @@ -72,9 +72,9 @@ export class AutoWidthController extends Disposable { const { unitId, subUnitId, worksheet } = target; const sheetSkeletonService = this._renderManagerService.getRenderById(unitId)!.with(SheetSkeletonManagerService); - if (!sheetSkeletonService.getCurrent()) return defaultValue; + if (!sheetSkeletonService.getCurrentParam()) return defaultValue; - const { skeleton } = sheetSkeletonService.getCurrent()!; + const { skeleton } = sheetSkeletonService.getCurrentParam()!; const colsAutoWidthInfo: IColAutoWidthInfo[] = skeleton.calculateAutoWidthInRange(params.ranges); const colWidthObject: IObjectArrayPrimitiveType> = {}; diff --git a/packages/sheets-ui/src/controllers/cell-custom-render.controller.ts b/packages/sheets-ui/src/controllers/cell-custom-render.controller.ts index 2b4ccd13895..f72ec918024 100644 --- a/packages/sheets-ui/src/controllers/cell-custom-render.controller.ts +++ b/packages/sheets-ui/src/controllers/cell-custom-render.controller.ts @@ -197,7 +197,7 @@ export class CellCustomRenderController extends Disposable implements IRenderMod }; this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe(handleSkeletonChange)); - handleSkeletonChange(this._sheetSkeletonManagerService.getCurrent()); + handleSkeletonChange(this._sheetSkeletonManagerService.getCurrentParam()); this.disposeWithMe(disposableCollection); } } diff --git a/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts b/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts index 13a5b05d8f8..891760b4b83 100644 --- a/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts +++ b/packages/sheets-ui/src/controllers/clipboard/clipboard.controller.ts @@ -582,7 +582,7 @@ export class SheetClipboardController extends RxDisposable { } private _generateDocumentDataModelSnapshot(snapshot: Partial) { - const currentSkeleton = this._renderManagerService.withCurrentTypeOfUnit(UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService)?.getCurrent(); + const currentSkeleton = this._renderManagerService.withCurrentTypeOfUnit(UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService)?.getCurrentParam(); if (currentSkeleton == null) { return null; } diff --git a/packages/sheets-ui/src/controllers/drag-render.controller.ts b/packages/sheets-ui/src/controllers/drag-render.controller.ts index fbd137abe52..acaa7bb8ebf 100644 --- a/packages/sheets-ui/src/controllers/drag-render.controller.ts +++ b/packages/sheets-ui/src/controllers/drag-render.controller.ts @@ -58,7 +58,7 @@ export class DragRenderController extends Disposable implements IRenderModule, I }); }; - handleSkeletonChange(this._sheetSkeletonManagerService.getCurrent()); + handleSkeletonChange(this._sheetSkeletonManagerService.getCurrentParam()); this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((skeletonParam) => { handleSkeletonChange(skeletonParam); })); diff --git a/packages/sheets-ui/src/controllers/force-string-render.controller.ts b/packages/sheets-ui/src/controllers/force-string-render.controller.ts index 793cd599fae..20c21d73fd8 100644 --- a/packages/sheets-ui/src/controllers/force-string-render.controller.ts +++ b/packages/sheets-ui/src/controllers/force-string-render.controller.ts @@ -46,7 +46,7 @@ export class ForceStringRenderController extends RxDisposable implements IRender priority: 10, effect: InterceptorEffectEnum.Style, handler: (cell, pos, next) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (!skeleton) { return next(cell); } diff --git a/packages/sheets-ui/src/controllers/hover-render.controller.ts b/packages/sheets-ui/src/controllers/hover-render.controller.ts index 575040d21dc..c6df51e70e3 100644 --- a/packages/sheets-ui/src/controllers/hover-render.controller.ts +++ b/packages/sheets-ui/src/controllers/hover-render.controller.ts @@ -79,7 +79,7 @@ export class HoverRenderController extends Disposable implements IRenderModule { })); }; - handleSkeletonChange(this._sheetSkeletonManagerService.getCurrent()); + handleSkeletonChange(this._sheetSkeletonManagerService.getCurrentParam()); this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((skeletonParam) => { handleSkeletonChange(skeletonParam); })); diff --git a/packages/sheets-ui/src/controllers/render-controllers/editor-bridge.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/editor-bridge.render-controller.ts index 6ffe1e4d6c5..949e3da9939 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/editor-bridge.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/editor-bridge.render-controller.ts @@ -102,7 +102,7 @@ export class EditorBridgeRenderController extends RxDisposable implements IRende const unitId = this._context.unitId; const sheetId = this._context.unit.getActiveSheet()?.getSheetId(); if (!sheetId) return; - const mergeInfo = this._sheetSkeletonManagerService.getWorksheetSkeleton(sheetId)?.skeleton.getCellWithCoordByIndex(primary.actualRow, primary.actualColumn); + const mergeInfo = this._sheetSkeletonManagerService.getSkeletonParam(sheetId)?.skeleton.getCellWithCoordByIndex(primary.actualRow, primary.actualColumn); const newPrimary: ISelectionCell = mergeInfo ? { actualRow: mergeInfo.actualRow, diff --git a/packages/sheets-ui/src/controllers/render-controllers/freeze.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/freeze.render-controller.ts index c069677dc67..53c4c208897 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/freeze.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/freeze.render-controller.ts @@ -197,7 +197,7 @@ export class HeaderFreezeRenderController extends Disposable implements IRenderM const config = freezeConfig ?? this._getFreeze(); if (config == null) return null; - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; const { startRow: freezeRow, startColumn: freezeColumn } = config; const position = this._getPositionByIndex(freezeRow, freezeColumn); @@ -398,7 +398,7 @@ export class HeaderFreezeRenderController extends Disposable implements IRenderM return; } - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } @@ -469,7 +469,7 @@ export class HeaderFreezeRenderController extends Disposable implements IRenderM freezeObjectMainRect: Rect, freezeDirectionType: FREEZE_DIRECTION_TYPE = FREEZE_DIRECTION_TYPE.ROW ) { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } @@ -794,7 +794,7 @@ export class HeaderFreezeRenderController extends Disposable implements IRenderM xSplit: number = 0, resetScroll = ResetScrollType.ALL ) { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } @@ -1545,7 +1545,7 @@ export class HeaderFreezeRenderController extends Disposable implements IRenderM return; } - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; const position = skeleton?.getNoMergeCellWithCoordByIndex(row, column); if (skeleton == null) { return; @@ -1566,7 +1566,7 @@ export class HeaderFreezeRenderController extends Disposable implements IRenderM private _getFreeze() { const config: IWorksheetData | undefined = this._sheetSkeletonManagerService - .getCurrent() + .getCurrentParam() ?.skeleton .getWorksheetConfig(); diff --git a/packages/sheets-ui/src/controllers/render-controllers/header-menu.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/header-menu.render-controller.ts index bae867efe02..db4349aa8d9 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/header-menu.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/header-menu.render-controller.ts @@ -124,7 +124,7 @@ export class HeaderMenuRenderController extends Disposable implements IRenderMod initialType === HEADER_HOVER_TYPE.ROW ? spreadsheetRowHeader : spreadsheetColumnHeader; const pointerMoveHandler = (evt: IPointerEvent | IMouseEvent) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } diff --git a/packages/sheets-ui/src/controllers/render-controllers/header-move.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/header-move.render-controller.ts index ef61d48f0c8..c1f75764556 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/header-move.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/header-move.render-controller.ts @@ -126,7 +126,7 @@ export class HeaderMoveRenderController extends Disposable implements IRenderMod // only style cursor style when pointer move const pointerMoveHandler = (evt: IPointerEvent | IMouseEvent) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } @@ -166,7 +166,7 @@ export class HeaderMoveRenderController extends Disposable implements IRenderMod const pointerDownHandler = (evt: IPointerEvent | IMouseEvent, state: EventState) => { if (state.isStopPropagation) return; - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } @@ -356,7 +356,7 @@ export class HeaderMoveRenderController extends Disposable implements IRenderMod initialType: RANGE_TYPE.ROW | RANGE_TYPE.COLUMN ) { const scene = this._context.scene; - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } diff --git a/packages/sheets-ui/src/controllers/render-controllers/header-resize.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/header-resize.render-controller.ts index 061e976bdf8..8b6dc0aac44 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/header-resize.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/header-resize.render-controller.ts @@ -160,7 +160,7 @@ export class HeaderResizeRenderController extends Disposable implements IRenderM }; const pointerMoveEvent = (evt: IPointerEvent | IMouseEvent, _state: EventState) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null || this._rowResizeRect == null || this._columnResizeRect == null) { return; } @@ -307,7 +307,7 @@ export class HeaderResizeRenderController extends Disposable implements IRenderM this.disposeWithMe( eventBindingObject.onPointerDown$.subscribeEvent((evt: IPointerEvent | IMouseEvent) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) return; const scene = this._context.scene; @@ -488,7 +488,7 @@ export class HeaderResizeRenderController extends Disposable implements IRenderM const scene = this._context.scene; scene.resetCursor(); - const sk = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const sk = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (!sk) return; const startRow = 0; diff --git a/packages/sheets-ui/src/controllers/render-controllers/header-unhide.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/header-unhide.render-controller.ts index 55ef3b54fce..b5998a53ab5 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/header-unhide.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/header-unhide.render-controller.ts @@ -116,7 +116,7 @@ export class HeaderUnhideRenderController extends RxDisposable { } private _update(workbook: Workbook, worksheet: Worksheet): void { - const skeleton = this._sheetSkeletonManagerService.getWorksheetSkeleton(worksheet.getSheetId())?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getSkeletonParam(worksheet.getSheetId())?.skeleton; if (!skeleton) return; // steps to render the unhide button for the current worksheet diff --git a/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-contextmenu.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-contextmenu.render-controller.ts index 473c11c536f..c1f327811a2 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-contextmenu.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-contextmenu.render-controller.ts @@ -46,7 +46,7 @@ export class SheetContextMenuMobileRenderController extends Disposable implement let listenToSelectionChangeEvent = false; this.disposeWithMe(this._selectionManagerService.selectionMoveStart$.subscribe(() => listenToSelectionChangeEvent = true)); this.disposeWithMe(this._selectionManagerService.selectionMoveEnd$.subscribe((selectionWithStyleList: ISelectionWithStyle[]) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; if (!skeleton || !selectionWithStyleList || listenToSelectionChangeEvent === false) { return; } diff --git a/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-scroll.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-scroll.render-controller.ts index 463a592dd08..d41e8e07abe 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-scroll.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/mobile/mobile-scroll.render-controller.ts @@ -150,7 +150,7 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR } private _getFreeze(): Nullable { - const snapshot: IWorksheetData | undefined = this._sheetSkeletonManagerService.getCurrent()?.skeleton.getWorksheetConfig(); + const snapshot: IWorksheetData | undefined = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton.getWorksheetConfig(); if (snapshot == null) { return; } @@ -181,7 +181,7 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR return; } - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (!skeleton) return; // data source: scroll-manager.service.ts@_scrollInfo @@ -208,7 +208,7 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR this.disposeWithMe( viewportMain.onScrollAfter$.subscribeEvent((scrollAfterParam: IScrollObserverParam) => { if (!scrollAfterParam) return; - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) return; const sheetObject = this._getSheetObject(); if (skeleton == null || sheetObject == null) return; @@ -221,11 +221,14 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR viewportScrollY ); - const scrollInfo = { + const scrollInfo: IViewportScrollState = { sheetViewStartRow: row, sheetViewStartColumn: column, offsetX: columnOffset, offsetY: rowOffset, + viewportScrollX, + viewportScrollY, + scrollX, scrollY, }; // lastestScrollInfo derived from viewportScrollX, viewportScrollY from onScrollAfter$ this._scrollManagerService.setValidScrollStateToCurrSheet(scrollInfo); @@ -245,7 +248,7 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR //#region scroll by bar this.disposeWithMe( viewportMain.onScrollByBar$.subscribeEvent((param) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null || param.isTrigger === false) { return; } @@ -493,7 +496,7 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR return; } - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } @@ -503,7 +506,7 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR // eslint-disable-next-line max-lines-per-function, complexity private _scrollToCell(row: number, column: number): boolean { - const { rowHeightAccumulation, columnWidthAccumulation } = this._sheetSkeletonManagerService.getCurrent()?.skeleton ?? {}; + const { rowHeightAccumulation, columnWidthAccumulation } = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton ?? {}; if (rowHeightAccumulation == null || columnWidthAccumulation == null) return false; @@ -513,7 +516,7 @@ export class MobileSheetsScrollRenderController extends Disposable implements IR const viewport = scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_MAIN); if (viewport == null) return false; - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) return false; const worksheet = this._context.unit.getActiveSheet(); diff --git a/packages/sheets-ui/src/controllers/render-controllers/scroll.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/scroll.render-controller.ts index 92ffcf021a7..89d073edbe5 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/scroll.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/scroll.render-controller.ts @@ -125,7 +125,7 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM this.disposeWithMe( toDisposable( this._scrollManagerService.rawScrollInfo$.subscribe((rawScrollInfo: Nullable) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (!skeleton) return; if (rawScrollInfo == null) { @@ -158,7 +158,7 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM this.disposeWithMe( // set scrollInfo, the event is triggered in viewport@_scrollToScrollbarPos viewportMain.onScrollAfter$.subscribeEvent((scrollAfterParam: IScrollObserverParam) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null || scrollAfterParam.isTrigger === false) { return; } @@ -207,7 +207,7 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM this.disposeWithMe( // get scrollByBar event from viewport and exec ScrollCommand.id. viewportMain.onScrollByBar$.subscribeEvent((param) => { - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null || param.isTrigger === false) { return; } @@ -366,7 +366,7 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM } private _getFreeze(): Nullable { - const snapshot: IWorksheetData | undefined = this._sheetSkeletonManagerService.getCurrent()?.skeleton.getWorksheetConfig(); + const snapshot: IWorksheetData | undefined = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton.getWorksheetConfig(); if (snapshot == null) { return; } @@ -467,7 +467,7 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM return; } - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) { return; } @@ -479,7 +479,7 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM // why so complicated? ScrollRenderController@scrollToCell do the same thing, including the scenario of freezing. // eslint-disable-next-line max-lines-per-function, complexity private _scrollToCell(row: number, column: number, forceTop?: boolean, forceLeft?: boolean): boolean { - const { rowHeightAccumulation, columnWidthAccumulation } = this._sheetSkeletonManagerService.getCurrent()?.skeleton ?? {}; + const { rowHeightAccumulation, columnWidthAccumulation } = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton ?? {}; if (rowHeightAccumulation == null || columnWidthAccumulation == null) return false; @@ -489,7 +489,7 @@ export class SheetsScrollRenderController extends Disposable implements IRenderM const viewport = scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_MAIN); if (viewport == null) return false; - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; if (skeleton == null) return false; const worksheet = this._context.unit.getActiveSheet(); diff --git a/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts b/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts index 3de80fd29f2..6a5c550bf64 100644 --- a/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts +++ b/packages/sheets-ui/src/controllers/render-controllers/sheet.render-controller.ts @@ -239,7 +239,6 @@ export class SheetRenderController extends RxDisposable implements IRenderModule const bufferEdgeX = 100; const bufferEdgeY = 100; - window.sc = scene; const viewMain = new Viewport(SHEET_VIEWPORT_KEY.VIEW_MAIN, scene, { left: rowHeader.width, top: columnHeader.height, @@ -490,7 +489,7 @@ export class SheetRenderController extends RxDisposable implements IRenderModule } private _rangeToBounds(ranges: IRange[]) { - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; const { rowHeightAccumulation, columnWidthAccumulation, rowHeaderWidth, columnHeaderHeight } = skeleton; const dirtyBounds: IViewportInfos[] = []; diff --git a/packages/sheets-ui/src/facade/f-range.ts b/packages/sheets-ui/src/facade/f-range.ts index 0475afdb2d5..607d38f1cb9 100644 --- a/packages/sheets-ui/src/facade/f-range.ts +++ b/packages/sheets-ui/src/facade/f-range.ts @@ -82,7 +82,7 @@ class FRangeSheetsUIMixin extends FRange implements IFRangeSheetsUIMixin { const subUnitId = this._worksheet.getSheetId(); const skeleton = renderManagerService.getRenderById(unitId)! .with(SheetSkeletonManagerService) - .getWorksheetSkeleton(subUnitId)!.skeleton; + .getSkeletonParam(subUnitId)!.skeleton; return skeleton.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn); } diff --git a/packages/sheets-ui/src/services/auto-fill/auto-fill.service.ts b/packages/sheets-ui/src/services/auto-fill/auto-fill.service.ts index 548014729db..f541e5fb597 100644 --- a/packages/sheets-ui/src/services/auto-fill/auto-fill.service.ts +++ b/packages/sheets-ui/src/services/auto-fill/auto-fill.service.ts @@ -482,7 +482,7 @@ export class AutoFillService extends Disposable implements IAutoFillService { private _getAutoHeightUndoRedos(unitId: string, subUnitId: string, ranges: IRange[]) { const sheetSkeletonService = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService); - const skeleton = sheetSkeletonService?.getCurrent()?.skeleton; + const skeleton = sheetSkeletonService?.getCurrentParam()?.skeleton; if (!skeleton) return { redos: [], undos: [] }; const rowsAutoHeightInfo = skeleton.calculateAutoHeightInRange(ranges); diff --git a/packages/sheets-ui/src/services/canvas-pop-manager.service.ts b/packages/sheets-ui/src/services/canvas-pop-manager.service.ts index 14096787981..c508a49667a 100644 --- a/packages/sheets-ui/src/services/canvas-pop-manager.service.ts +++ b/packages/sheets-ui/src/services/canvas-pop-manager.service.ts @@ -225,9 +225,7 @@ export class SheetCanvasPopManagerService extends Disposable { const unitId = workbook.getUnitId(); const subUnitId = worksheet.getSheetId(); - const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).getOrCreateSkeleton({ - sheetId: subUnitId, - }); + const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId); const currentRender = this._renderManagerService.getRenderById(unitId); if (!currentRender || !skeleton) { @@ -283,9 +281,7 @@ export class SheetCanvasPopManagerService extends Disposable { return null; } - const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).getOrCreateSkeleton({ - sheetId: subUnitId, - }); + const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId); const currentRender = this._renderManagerService.getRenderById(unitId); if (!currentRender || !skeleton) { @@ -336,9 +332,7 @@ export class SheetCanvasPopManagerService extends Disposable { return null; } - const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).getOrCreateSkeleton({ - sheetId: subUnitId, - }); + const skeleton = this._renderManagerService.getRenderById(unitId)?.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId); const currentRender = this._renderManagerService.getRenderById(unitId); if (!currentRender || !skeleton) { @@ -391,9 +385,7 @@ export class SheetCanvasPopManagerService extends Disposable { return null; } const currentRender = this._renderManagerService.getRenderById(unitId); - const skeleton = currentRender?.with(SheetSkeletonManagerService).getOrCreateSkeleton({ - sheetId: subUnitId, - }); + const skeleton = currentRender?.with(SheetSkeletonManagerService).ensureSkeleton(subUnitId); const sheetSelectionRenderService = currentRender?.with(ISheetSelectionRenderService); if (!currentRender || !skeleton || !sheetSelectionRenderService) { diff --git a/packages/sheets-ui/src/services/clipboard/__tests__/sheet-paste.spec.ts b/packages/sheets-ui/src/services/clipboard/__tests__/sheet-paste.spec.ts index a719d71e9c4..1683674f622 100644 --- a/packages/sheets-ui/src/services/clipboard/__tests__/sheet-paste.spec.ts +++ b/packages/sheets-ui/src/services/clipboard/__tests__/sheet-paste.spec.ts @@ -107,7 +107,7 @@ describe('Test clipboard', () => { const worksheet = get(IUniverInstanceService).getUnit('test')?.getSheetBySheetId('sheet1'); if (!worksheet) return false; const htmlToUSM = new HtmlToUSMService({ - getCurrentSkeleton: () => sheetSkeletonManagerService.getCurrent(), + getCurrentSkeleton: () => sheetSkeletonManagerService.getCurrentParam(), }); const htmlPath = path.join(__dirname, 'assets', 'html', 'excel-base-sample.html'); const html = getHTMLString(htmlPath); @@ -119,7 +119,7 @@ describe('Test clipboard', () => { const worksheet = get(IUniverInstanceService).getUnit('test')?.getSheetBySheetId('sheet1'); if (!worksheet) return false; const htmlToUSM = new HtmlToUSMService({ - getCurrentSkeleton: () => sheetSkeletonManagerService.getCurrent(), + getCurrentSkeleton: () => sheetSkeletonManagerService.getCurrentParam(), }); const htmlPath = path.join(__dirname, 'assets', 'html', 'google-base-sample.html'); const html = getHTMLString(htmlPath); diff --git a/packages/sheets-ui/src/services/clipboard/clipboard.service.ts b/packages/sheets-ui/src/services/clipboard/clipboard.service.ts index f6dae91a44c..9f891b5dc72 100644 --- a/packages/sheets-ui/src/services/clipboard/clipboard.service.ts +++ b/packages/sheets-ui/src/services/clipboard/clipboard.service.ts @@ -140,7 +140,7 @@ export class SheetClipboardService extends Disposable implements ISheetClipboard ) { super(); this._htmlToUSM = new HtmlToUSMService({ - getCurrentSkeleton: () => this._renderManagerService.withCurrentTypeOfUnit(UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService)?.getCurrent(), + getCurrentSkeleton: () => this._renderManagerService.withCurrentTypeOfUnit(UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService)?.getCurrentParam(), }); this._usmToHtml = new USMToHtmlService(); diff --git a/packages/sheets-ui/src/services/drag-manager.service.ts b/packages/sheets-ui/src/services/drag-manager.service.ts index a1476a9d75a..26ed5c0d2b9 100644 --- a/packages/sheets-ui/src/services/drag-manager.service.ts +++ b/packages/sheets-ui/src/services/drag-manager.service.ts @@ -78,7 +78,7 @@ export class DragManagerService extends Disposable { const currentRender = this._renderManagerService.getRenderById(workbook.getUnitId()); if (!currentRender) return; - const skeletonParam = currentRender.with(SheetSkeletonManagerService).getCurrent(); + const skeletonParam = currentRender.with(SheetSkeletonManagerService).getCurrentParam(); const scrollManagerService = currentRender.with(SheetScrollManagerService); const scrollInfo = scrollManagerService.getCurrentScrollState(); diff --git a/packages/sheets-ui/src/services/editor-bridge.service.ts b/packages/sheets-ui/src/services/editor-bridge.service.ts index 66561ea967e..40190033b77 100644 --- a/packages/sheets-ui/src/services/editor-bridge.service.ts +++ b/packages/sheets-ui/src/services/editor-bridge.service.ts @@ -188,7 +188,7 @@ export class EditorBridgeService extends Disposable implements IEditorBridgeServ const ru = this._renderManagerService.getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_SHEET); if (!ru) return; - const skeleton = ru.with(SheetSkeletonManagerService).getWorksheetSkeleton(currentEditCell.sheetId)?.skeleton; + const skeleton = ru.with(SheetSkeletonManagerService).getSkeletonParam(currentEditCell.sheetId)?.skeleton; const selectionRenderService = ru.with(ISheetSelectionRenderService); if (!skeleton) return; if (!this._currentEditCellState) return; diff --git a/packages/sheets-ui/src/services/editor/cell-editor-resize.service.ts b/packages/sheets-ui/src/services/editor/cell-editor-resize.service.ts index 967b9d7687b..047729b8e76 100644 --- a/packages/sheets-ui/src/services/editor/cell-editor-resize.service.ts +++ b/packages/sheets-ui/src/services/editor/cell-editor-resize.service.ts @@ -358,7 +358,7 @@ export class SheetCellEditorResizeService extends Disposable implements IRenderM const editCellState = this._editorBridgeService.getEditCellState(); if (!editCellState) return; - const skeleton = this._sheetSkeletonManagerService.getWorksheetSkeleton(editCellState.sheetId)?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getSkeletonParam(editCellState.sheetId)?.skeleton; if (!skeleton) return; const { row, column, scaleX, scaleY, position, canvasOffset } = editCellState; const maxSize = this._getEditorMaxSize(position, canvasOffset); diff --git a/packages/sheets-ui/src/services/hover-manager.service.ts b/packages/sheets-ui/src/services/hover-manager.service.ts index 1aa3750b368..298e1991022 100644 --- a/packages/sheets-ui/src/services/hover-manager.service.ts +++ b/packages/sheets-ui/src/services/hover-manager.service.ts @@ -208,7 +208,7 @@ export class HoverManagerService extends Disposable { const currentRender = this._renderManagerService.getRenderById(workbook.getUnitId()); if (!currentRender) return null; - const skeletonParam = currentRender.with(SheetSkeletonManagerService).getWorksheetSkeleton(worksheet.getSheetId()); + const skeletonParam = currentRender.with(SheetSkeletonManagerService).getSkeletonParam(worksheet.getSheetId()); if (!skeletonParam) return null; const scrollManagerService = currentRender.with(SheetScrollManagerService); diff --git a/packages/sheets-ui/src/services/scroll-manager.service.ts b/packages/sheets-ui/src/services/scroll-manager.service.ts index 6d07ae45e2d..3c1f623ce58 100644 --- a/packages/sheets-ui/src/services/scroll-manager.service.ts +++ b/packages/sheets-ui/src/services/scroll-manager.service.ts @@ -97,7 +97,6 @@ export class SheetScrollManagerService implements IRenderModule { @Inject(SheetSkeletonManagerService) private readonly _sheetSkeletonManagerService: SheetSkeletonManagerService ) { // empty - window.scroll = this; } dispose(): void { @@ -132,14 +131,6 @@ export class SheetScrollManagerService implements IRenderModule { this._searchParamForScroll = param; } - // setSearchParamAndRefresh(param: IScrollStateSearchParam) { - // this._searchParamForScroll = param; - // const state = this.getScrollStateByParam(param); - // if (state) { - // this._emitRawScroll(state); - // } - // } - getScrollStateByParam(param: IScrollStateSearchParam): Readonly> { return this._getCurrentScroll(param); } @@ -158,12 +149,11 @@ export class SheetScrollManagerService implements IRenderModule { * @param param */ emitRawScrollParam(param: IScrollStateWithSearchParam) { - // this._setValidScrollState(param); this._emitRawScroll(param); } /** - * Set _scrollStateMap but no _scrollInfo$.next + * Set _scrollStateMap * @param scroll */ setValidScrollStateToCurrSheet(scroll: IViewportScrollState) { @@ -176,8 +166,11 @@ export class SheetScrollManagerService implements IRenderModule { ...scroll, }); - // const sheetId = this._searchParamForScroll.sheetId; - this._sheetSkeletonManagerService.setScrollToCurrSk(scroll.viewportScrollX, scroll.viewportScrollY); + const sheetId = this._searchParamForScroll.sheetId; + const sheetSkeleton = this._sheetSkeletonManagerService.getSkeleton(sheetId); + if (sheetSkeleton) { + sheetSkeleton.setScroll(scroll.viewportScrollX, scroll.viewportScrollY); + } } clear(): void { diff --git a/packages/sheets-ui/src/services/selection/base-selection-render.service.ts b/packages/sheets-ui/src/services/selection/base-selection-render.service.ts index 76c257fff69..2c53dc5026b 100644 --- a/packages/sheets-ui/src/services/selection/base-selection-render.service.ts +++ b/packages/sheets-ui/src/services/selection/base-selection-render.service.ts @@ -355,7 +355,7 @@ export class BaseSelectionRenderService extends Disposable implements ISheetSele } protected _getFreeze(): Nullable { - const freeze = this._sheetSkeletonManagerService.getCurrent()?.skeleton.getWorksheetConfig().freeze; + const freeze = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton.getWorksheetConfig().freeze; return freeze; } diff --git a/packages/sheets-ui/src/services/selection/mobile-selection-render.service.ts b/packages/sheets-ui/src/services/selection/mobile-selection-render.service.ts index 6238681bdd2..1417ced215c 100644 --- a/packages/sheets-ui/src/services/selection/mobile-selection-render.service.ts +++ b/packages/sheets-ui/src/services/selection/mobile-selection-render.service.ts @@ -146,7 +146,7 @@ export class MobileSheetsSelectionRenderService extends BaseSelectionRenderServi spreadsheetRowHeader?.onPointerUp$.subscribeEvent((evt: IPointerEvent | IMouseEvent, _state: EventState) => { if (this._normalSelectionDisabled()) return; - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; const { row } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton); const matchSelectionData = isThisRowSelected(this._workbookSelections.getCurrentSelections(), row); if (matchSelectionData) return; @@ -160,7 +160,7 @@ export class MobileSheetsSelectionRenderService extends BaseSelectionRenderServi spreadsheetColumnHeader?.onPointerUp$.subscribeEvent((evt: IPointerEvent | IMouseEvent, _state: EventState) => { if (this._normalSelectionDisabled()) return; - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; const { column } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton); const matchSelectionData = isThisColSelected(this._workbookSelections.getCurrentSelections(), column); if (matchSelectionData) return; @@ -177,7 +177,7 @@ export class MobileSheetsSelectionRenderService extends BaseSelectionRenderServi this._reset(); // remove all other selections - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; const selectionWithStyle = selectionDataForSelectAll(skeleton); this._addSelectionControlByModelData(selectionWithStyle); // pointerup --> create selection @@ -705,7 +705,7 @@ export class MobileSheetsSelectionRenderService extends BaseSelectionRenderServi if (activeControl == null) { return; } - const skeleton = this._sheetSkeletonManagerService.getCurrent()?.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()?.skeleton; const sheetContentHeight = skeleton?.rowTotalHeight; const sheetContentWidth = skeleton?.columnTotalWidth; const rangeType = activeControl.rangeType; diff --git a/packages/sheets-ui/src/services/selection/selection-render.service.ts b/packages/sheets-ui/src/services/selection/selection-render.service.ts index fbae8f4bb01..fff40716836 100644 --- a/packages/sheets-ui/src/services/selection/selection-render.service.ts +++ b/packages/sheets-ui/src/services/selection/selection-render.service.ts @@ -88,7 +88,7 @@ export class SheetSelectionRenderService extends BaseSelectionRenderService impl spreadsheetRowHeader?.onPointerDown$.subscribeEvent((evt: IPointerEvent | IMouseEvent, state) => { if (this._normalSelectionDisabled()) return; - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; const { row } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton); const matchSelectionData = isThisRowSelected(this._workbookSelections.getCurrentSelections(), row); if (matchSelectionData) return; @@ -103,7 +103,7 @@ export class SheetSelectionRenderService extends BaseSelectionRenderService impl this.disposeWithMe(spreadsheetColumnHeader?.onPointerDown$.subscribeEvent((evt: IPointerEvent | IMouseEvent, state) => { if (this._normalSelectionDisabled()) return; - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; const { column } = getCoordByOffset(evt.offsetX, evt.offsetY, scene, skeleton); const matchSelectionData = isThisColSelected(this._workbookSelections.getCurrentSelections(), column); if (matchSelectionData) return; @@ -120,7 +120,7 @@ export class SheetSelectionRenderService extends BaseSelectionRenderService impl this._reset(); // remove all other selections - const skeleton = this._sheetSkeletonManagerService.getCurrent()!.skeleton; + const skeleton = this._sheetSkeletonManagerService.getCurrentParam()!.skeleton; const selectionWithStyle = selectionDataForSelectAll(skeleton); this._addSelectionControlByModelData(selectionWithStyle); this.refreshSelectionMoveEnd(); diff --git a/packages/sheets-ui/src/services/selection/selection-shape-extension.ts b/packages/sheets-ui/src/services/selection/selection-shape-extension.ts index e773fe60144..30d280cc5a8 100644 --- a/packages/sheets-ui/src/services/selection/selection-shape-extension.ts +++ b/packages/sheets-ui/src/services/selection/selection-shape-extension.ts @@ -129,7 +129,7 @@ export class SelectionShapeExtension { private _getFreeze() { const renderManagerService = this._injector.get(IRenderManagerService); const freeze = renderManagerService.withCurrentTypeOfUnit(UniverInstanceType.UNIVER_SHEET, SheetSkeletonManagerService) - ?.getCurrent() + ?.getCurrentParam() ?.skeleton .getWorksheetConfig() .freeze; diff --git a/packages/sheets-ui/src/services/sheet-skeleton-manager.service.ts b/packages/sheets-ui/src/services/sheet-skeleton-manager.service.ts index 06eed6363fd..b92e37c084b 100644 --- a/packages/sheets-ui/src/services/sheet-skeleton-manager.service.ts +++ b/packages/sheets-ui/src/services/sheet-skeleton-manager.service.ts @@ -15,7 +15,7 @@ */ import type { IRange, IRangeWithCoord, Nullable, Workbook, Worksheet } from '@univerjs/core'; -import type { IRenderContext, IRenderModule } from '@univerjs/engine-render'; +import type { IRenderContext, IRenderModule, Scene } from '@univerjs/engine-render'; import { Disposable, Inject, Injector } from '@univerjs/core'; import { SpreadsheetSkeleton } from '@univerjs/engine-render'; import { BehaviorSubject } from 'rxjs'; @@ -67,7 +67,6 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo }); this._initRemoveSheet(); - window.sks = this; } private _initRemoveSheet() { @@ -77,35 +76,53 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo } getCurrentSkeleton(): Nullable { - return this.getCurrent()?.skeleton; + return this.getCurrentParam()?.skeleton; } + /** + * @deprecated use `getCurrentSkeleton` instead. + */ getCurrent(): Nullable { - return this._getSkeleton(this._currentSkeletonSearchParam.sheetId); + return this.getCurrentParam(); } - getWorksheetSkeleton(sheetId: string): Nullable { + getCurrentParam(): Nullable { + return this._getSkeletonParam(this._currentSkeletonSearchParam.sheetId); + } + + getSkeleton(sheetId: string): Nullable { return this._getSkeleton(sheetId); } + getSkeletonParam(sheetId: string): Nullable { + return this._getSkeletonParam(sheetId); + } + /** - * unitId is never read? - * why ?? what does unitId for ??? + * @deprecated use `getSkeleton` instead. */ - getUnitSkeleton(unitId: string, sheetId: string): Nullable { - const param = this._getSkeleton(sheetId); - if (param) { - param.unitId = unitId; - } - return param; + getWorksheetSkeleton(sheetId: string): Nullable { + return this.getSkeletonParam(sheetId); } + /** + * unitId is never read? + * why ?? what does unitId for ??? no need unitId this service is registered in render unit already. + */ + // getUnitSkeleton(sheetId: string): Nullable { + // const param = this._getSkeleton(sheetId); + // // if (param) { + // // param.unitId = unitId; + // // } + // return param; + // } + setCurrent(searchParam: ISheetSkeletonManagerSearch): Nullable { this._setCurrent(searchParam); } private _setCurrent(searchParam: ISheetSkeletonManagerSearch): Nullable { - const skParam = this._getSkeleton(searchParam.sheetId); + const skParam = this._getSkeletonParam(searchParam.sheetId); const unitId = this._context.unitId; if (skParam != null) { this._reCalculate(skParam); @@ -117,7 +134,8 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo return; } - const skeleton = this._buildSkeleton(worksheet); + const scene = this._context.scene; + const skeleton = this._buildSkeleton(worksheet, scene); this._sheetSkeletonStore.set(sheetId, { unitId, sheetId, @@ -128,15 +146,14 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo this._currentSkeletonSearchParam = searchParam; const sheetId = this._currentSkeletonSearchParam.sheetId; - const sheetSkeletonManagerParam = this.getUnitSkeleton(unitId, sheetId); + const sheetSkeletonManagerParam = this._getSkeletonParam(sheetId); - console.log('curr sk !!!'); this._currentSkeletonBefore$.next(sheetSkeletonManagerParam); this._currentSkeleton$.next(sheetSkeletonManagerParam); } reCalculate() { - const param = this.getCurrent(); + const param = this.getCurrentParam(); if (param == null) { return; } @@ -157,7 +174,7 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo * @param state */ makeDirty(searchParm: ISheetSkeletonManagerSearch, state: boolean = true) { - const param = this._getSkeleton(searchParm.sheetId); + const param = this._getSkeletonParam(searchParm.sheetId); if (param == null) { return; } @@ -169,11 +186,11 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo * @param searchParam */ getOrCreateSkeleton(searchParam: ISheetSkeletonManagerSearch) { - this.ensureSkeleton(searchParam.sheetId); + return this.ensureSkeleton(searchParam.sheetId); } ensureSkeleton(sheetId: string) { - const skeleton = this._getSkeleton(sheetId); + const skeleton = this._getSkeletonParam(sheetId); if (skeleton) { return skeleton.skeleton; } @@ -196,7 +213,7 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo } disposeSkeleton(sheetId: string) { - const skParam = this.getWorksheetSkeleton(sheetId); + const skParam = this.getSkeletonParam(sheetId); if (skParam) { skParam.skeleton.dispose(); this._sheetSkeletonStore.delete(sheetId); @@ -217,7 +234,7 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo return attachRangeWithCoord(skeleton, range); } - private _getSkeleton(sheetId: string): Nullable { + private _getSkeletonParam(sheetId: string): Nullable { // const item = this._sheetSkeletonStore.find((param) => param.sheetId === searchParm.sheetId); const item = this._sheetSkeletonStore.get(sheetId); // if (item) { @@ -227,27 +244,20 @@ export class SheetSkeletonManagerService extends Disposable implements IRenderMo return item; } - private _buildSkeleton(worksheet: Worksheet) { + private _getSkeleton(sheetId: string): Nullable { + const param = this._getSkeletonParam(sheetId); + return param ? param.skeleton : null; + } + + private _buildSkeleton(worksheet: Worksheet, scene: Nullable) { const spreadsheetSkeleton = this._injector.createInstance( SpreadsheetSkeleton, worksheet, this._context.unit.getStyles() ); - - return spreadsheetSkeleton; - } - - setScaleToCurrSk(scaleX: number, scaleY?: number) { - const skeleton = this.getCurrentSkeleton(); - if (skeleton) { - skeleton.setScale(scaleX, scaleY || scaleX); - } - } - - setScrollToCurrSk(scrollX?: number, scrollY?: number) { - const skeleton = this.getCurrentSkeleton(); - if (skeleton) { - skeleton.setScroll(scrollX, scrollY); + if (scene) { + spreadsheetSkeleton.setScene(scene); } + return spreadsheetSkeleton; } } diff --git a/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts b/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts index 2f0aca24ac9..ed466c818bf 100644 --- a/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts +++ b/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts @@ -212,7 +212,7 @@ export const getCustomRangePosition = (injector: Injector, unitId: string, subUn } const currentRender = renderManagerService.getRenderById(workbook.getUnitId()); - const skeletonParam = currentRender?.with(SheetSkeletonManagerService).getWorksheetSkeleton(worksheet.getSheetId()); + const skeletonParam = currentRender?.with(SheetSkeletonManagerService).getSkeletonParam(worksheet.getSheetId()); const skeleton = skeletonParam?.skeleton; @@ -282,7 +282,7 @@ export const getEditingCustomRangePosition = (injector: Injector, unitId: string } const docSkeleton = renderer.with(DocSkeletonManagerService).getSkeleton(); - const sheetSkeleton = sheetRenderer.with(SheetSkeletonManagerService).getWorksheetSkeleton(sheetId)?.skeleton; + const sheetSkeleton = sheetRenderer.with(SheetSkeletonManagerService).getSkeletonParam(sheetId)?.skeleton; if (!docSkeleton || !sheetSkeleton) { return null; diff --git a/packages/sheets-ui/src/services/utils/drawing-position-util.ts b/packages/sheets-ui/src/services/utils/drawing-position-util.ts index 9840745963b..33d93d75f7b 100644 --- a/packages/sheets-ui/src/services/utils/drawing-position-util.ts +++ b/packages/sheets-ui/src/services/utils/drawing-position-util.ts @@ -26,7 +26,7 @@ export function convertPositionSheetOverGridToAbsolute(unitId: string, subUnitId const { column: fromColumn, columnOffset: fromColumnOffset, row: fromRow, rowOffset: fromRowOffset } = from; const { column: toColumn, columnOffset: toColumnOffset, row: toRow, rowOffset: toRowOffset } = to; - const skeleton = sheetSkeletonManagerService.getOrCreateSkeleton({ sheetId: subUnitId }); + const skeleton = sheetSkeletonManagerService.ensureSkeleton(subUnitId); if (skeleton == null) { throw new Error('No current skeleton'); @@ -77,7 +77,7 @@ export function convertPositionSheetOverGridToAbsolute(unitId: string, subUnitId export function convertPositionCellToSheetOverGrid(unitId: string, subUnitId: string, cellOverGridPosition: ICellOverGridPosition, width: number, height: number, selectionRenderService: ISheetSelectionRenderService, sheetSkeletonManagerService: SheetSkeletonManagerService) { const { column: fromColumn, columnOffset: fromColumnOffset, row: fromRow, rowOffset: fromRowOffset } = cellOverGridPosition; - const skeleton = sheetSkeletonManagerService.getOrCreateSkeleton({ sheetId: subUnitId }); + const skeleton = sheetSkeletonManagerService.ensureSkeleton(subUnitId); if (skeleton == null) { throw new Error('No current skeleton'); diff --git a/packages/sheets/src/facade/f-worksheet.ts b/packages/sheets/src/facade/f-worksheet.ts index 98d16fb3a96..c571e01f34b 100644 --- a/packages/sheets/src/facade/f-worksheet.ts +++ b/packages/sheets/src/facade/f-worksheet.ts @@ -1142,7 +1142,6 @@ export class FWorksheet extends FBase { if (startRow > endRow) { [startRow, endRow] = [endRow, startRow]; } - this._commandService.syncExecuteCommand; this._commandService.syncExecuteCommand(SetFrozenCommand.id, { startRow: endRow + 1, ySplit: endRow - startRow + 1,