@univerjs/sheets-ui 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/lib/cjs/index.js +11 -11
  2. package/lib/es/index.js +6323 -6184
  3. package/lib/index.css +1 -1
  4. package/lib/locale/en-US.json +2 -2
  5. package/lib/types/commands/commands/set-format-painter.command.d.ts +2 -4
  6. package/lib/types/commands/commands/set-scroll.command.d.ts +2 -0
  7. package/lib/types/commands/operations/scroll-to-range.operation.d.ts +4 -0
  8. package/lib/types/common/keys.d.ts +1 -1
  9. package/lib/types/controllers/auto-height.controller.d.ts +7 -7
  10. package/lib/types/controllers/cell-alert.controller.d.ts +2 -2
  11. package/lib/types/controllers/cell-custom-render.controller.d.ts +2 -5
  12. package/lib/types/controllers/clipboard/clipboard.controller.d.ts +3 -4
  13. package/lib/types/controllers/drag-render.controller.d.ts +3 -3
  14. package/lib/types/controllers/editor/formula-editor.controller.d.ts +4 -12
  15. package/lib/types/controllers/editor/start-edit.controller.d.ts +1 -1
  16. package/lib/types/controllers/force-string-alert-render.controller.d.ts +4 -5
  17. package/lib/types/controllers/force-string-render.controller.d.ts +2 -5
  18. package/lib/types/controllers/format-painter/format-painter.controller.d.ts +9 -2
  19. package/lib/types/controllers/hover-render.controller.d.ts +3 -4
  20. package/lib/types/controllers/mark-selection.controller.d.ts +2 -2
  21. package/lib/types/controllers/menu/menu-util.d.ts +2 -2
  22. package/lib/types/controllers/menu/permission-menu-util.d.ts +0 -3
  23. package/lib/types/controllers/permission/sheet-permission-interceptor-canvas-render.controller.d.ts +2 -2
  24. package/lib/types/controllers/permission/sheet-permission-interceptor-formula-render.controller.d.ts +2 -3
  25. package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +16 -2
  26. package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +4 -7
  27. package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +2 -2
  28. package/lib/types/controllers/render-controllers/format-painter.render-controller.d.ts +2 -2
  29. package/lib/types/controllers/render-controllers/freeze.render-controller.d.ts +2 -2
  30. package/lib/types/controllers/render-controllers/header-menu.render-controller.d.ts +2 -2
  31. package/lib/types/controllers/render-controllers/header-move.render-controller.d.ts +2 -2
  32. package/lib/types/controllers/render-controllers/header-resize.render-controller.d.ts +2 -2
  33. package/lib/types/controllers/render-controllers/scroll.render-controller.d.ts +4 -5
  34. package/lib/types/controllers/render-controllers/selection.render-controller.d.ts +2 -2
  35. package/lib/types/controllers/render-controllers/sheet-render.controller.d.ts +41 -0
  36. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +2 -2
  37. package/lib/types/index.d.ts +7 -4
  38. package/lib/types/services/canvas-pop-manager.service.d.ts +1 -3
  39. package/lib/types/services/clipboard/clipboard.service.d.ts +3 -3
  40. package/lib/types/services/clipboard/html-to-usm/converter.d.ts +5 -5
  41. package/lib/types/services/drag-manager.service.d.ts +1 -3
  42. package/lib/types/services/editor-bridge.service.d.ts +4 -5
  43. package/lib/types/services/format-painter/format-painter.service.d.ts +26 -4
  44. package/lib/types/services/hover-manager.service.d.ts +1 -3
  45. package/lib/types/services/mark-selection/mark-selection.service.d.ts +1 -3
  46. package/lib/types/services/permission/worksheet-permission-render.service.d.ts +10 -0
  47. package/lib/types/services/print-interceptor.service.d.ts +17 -0
  48. package/lib/types/services/scroll-manager.service.d.ts +40 -10
  49. package/lib/types/services/selection/selection-render.service.d.ts +5 -5
  50. package/lib/types/services/sheet-skeleton-manager.service.d.ts +10 -13
  51. package/lib/types/services/sheets-render.service.d.ts +27 -0
  52. package/lib/types/sheets-ui-plugin.d.ts +2 -0
  53. package/lib/types/views/permission/extensions/protect-background-img.d.ts +16 -0
  54. package/lib/types/views/permission/extensions/range-protection.render.d.ts +32 -0
  55. package/lib/types/views/permission/extensions/worksheet-permission.render.d.ts +13 -0
  56. package/lib/umd/index.js +11 -11
  57. package/package.json +44 -33
  58. package/lib/types/controllers/sheet-render.controller.d.ts +0 -38
  59. package/lib/types/services/permission/permission-render.service.d.ts +0 -17
  60. package/lib/types/views/sheet-canvas-view.d.ts +0 -30
@@ -1,11 +1,11 @@
1
1
  import { IRange, Workbook, Disposable, ICommandService, InterceptorManager } from '@univerjs/core';
2
- import { IRenderContext, IRenderController } from '@univerjs/engine-render';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { SelectionManagerService } from '@univerjs/sheets';
4
4
  import { ISelectionRenderService } from '../../services/selection/selection-render.service';
5
5
  import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
6
6
 
7
7
  export declare const HEADER_MOVE_PERMISSION_CHECK: import('@univerjs/core').IInterceptor<boolean, IRange>;
8
- export declare class HeaderMoveRenderController extends Disposable implements IRenderController {
8
+ export declare class HeaderMoveRenderController extends Disposable implements IRenderModule {
9
9
  private readonly _context;
10
10
  private readonly _sheetSkeletonManagerService;
11
11
  private readonly _commandService;
@@ -1,5 +1,5 @@
1
1
  import { Workbook, Disposable, ICommandService, InterceptorManager } from '@univerjs/core';
2
- import { IRenderContext, IRenderController } from '@univerjs/engine-render';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { IEditorBridgeService } from '../../services/editor-bridge.service';
4
4
  import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
5
5
 
@@ -7,7 +7,7 @@ export declare const HEADER_RESIZE_PERMISSION_CHECK: import('@univerjs/core').II
7
7
  row?: number | undefined;
8
8
  col?: number | undefined;
9
9
  }>;
10
- export declare class HeaderResizeRenderController extends Disposable implements IRenderController {
10
+ export declare class HeaderResizeRenderController extends Disposable implements IRenderModule {
11
11
  private readonly _context;
12
12
  private readonly _sheetSkeletonManagerService;
13
13
  private readonly _commandService;
@@ -1,5 +1,5 @@
1
- import { IRange, Workbook, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
- import { IRenderContext, IRenderController, IRenderManagerService } from '@univerjs/engine-render';
1
+ import { IRange, Workbook, Disposable, ICommandService } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { SelectionManagerService } from '@univerjs/sheets';
4
4
  import { ScrollManagerService } from '../../services/scroll-manager.service';
5
5
  import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
@@ -7,15 +7,14 @@ import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manag
7
7
  /**
8
8
  * This controller handles scroll logic in sheet interaction.
9
9
  */
10
- export declare class SheetsScrollRenderController extends Disposable implements IRenderController {
10
+ export declare class SheetsScrollRenderController extends Disposable implements IRenderModule {
11
11
  private readonly _context;
12
12
  private readonly _sheetSkeletonManagerService;
13
- private readonly _univerInstanceService;
14
13
  private readonly _commandService;
15
14
  private readonly _renderManagerService;
16
15
  private readonly _selectionManagerService;
17
16
  private readonly _scrollManagerService;
18
- constructor(_context: IRenderContext<Workbook>, _sheetSkeletonManagerService: SheetSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _renderManagerService: IRenderManagerService, _selectionManagerService: SelectionManagerService, _scrollManagerService: ScrollManagerService);
17
+ constructor(_context: IRenderContext<Workbook>, _sheetSkeletonManagerService: SheetSkeletonManagerService, _commandService: ICommandService, _renderManagerService: IRenderManagerService, _selectionManagerService: SelectionManagerService, _scrollManagerService: ScrollManagerService);
19
18
  scrollToRange(range: IRange): boolean;
20
19
  private _init;
21
20
  private _initCommandListener;
@@ -1,11 +1,11 @@
1
1
  import { Workbook, Disposable, ICommandService, ThemeService } from '@univerjs/core';
2
- import { IRenderContext, IRenderController } from '@univerjs/engine-render';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { SelectionManagerService } from '@univerjs/sheets';
4
4
  import { IDefinedNamesService } from '@univerjs/engine-formula';
5
5
  import { ISelectionRenderService } from '../../services/selection/selection-render.service';
6
6
  import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
7
7
 
8
- export declare class SelectionRenderController extends Disposable implements IRenderController {
8
+ export declare class SelectionRenderController extends Disposable implements IRenderModule {
9
9
  private readonly _context;
10
10
  private readonly _sheetSkeletonManagerService;
11
11
  private readonly _commandService;
@@ -0,0 +1,41 @@
1
+ import { Workbook, ICommandService, RxDisposable } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
+ import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
4
+ import { SheetsRenderService } from '../../services/sheets-render.service';
5
+
6
+ export declare class SheetRenderController extends RxDisposable implements IRenderModule {
7
+ private readonly _context;
8
+ private readonly _sheetSkeletonManagerService;
9
+ private readonly _sheetRenderService;
10
+ private readonly _commandService;
11
+ constructor(_context: IRenderContext<Workbook>, _sheetSkeletonManagerService: SheetSkeletonManagerService, _sheetRenderService: SheetsRenderService, _commandService: ICommandService);
12
+ private _addNewRender;
13
+ private _addComponent;
14
+ private _initViewports;
15
+ /**
16
+ *
17
+ * initViewport & wheel event
18
+ * +-----------------+--------------------+-------------------+
19
+ * | VIEW_LEFT_TOP | VIEW_COLUMN_LEFT | VIEW_COLUMN_RIGHT |
20
+ * +-----------------+--------------------+-------------------+
21
+ * | VIEW_ROW_TOP | VIEW_MAIN_LEFT_TOP | VIEW_MAIN_TOP |
22
+ * +-----------------+--------------------+-------------------+
23
+ * | VIEW_ROW_BOTTOM | VIEW_MAIN_LEFT | VIEW_MAIN |
24
+ * +-----------------+--------------------+-------------------+
25
+ */
26
+ private _addViewport;
27
+ private _initRerenderScheduler;
28
+ private _initCommandListener;
29
+ private _markUnitDirty;
30
+ /**
31
+ * cellValue data structure:
32
+ * {[row]: { [col]: value}}
33
+ * @param cellValue
34
+ * @returns
35
+ */
36
+ private _cellValueToRange;
37
+ private _rangeToBounds;
38
+ private _markViewportDirty;
39
+ private _spreadsheetViewports;
40
+ private _initMouseWheel;
41
+ }
@@ -1,8 +1,8 @@
1
1
  import { Workbook, Disposable, ICommandService } from '@univerjs/core';
2
- import { IRenderContext, IRenderController } from '@univerjs/engine-render';
2
+ import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
4
4
 
5
- export declare class SheetsZoomRenderController extends Disposable implements IRenderController {
5
+ export declare class SheetsZoomRenderController extends Disposable implements IRenderModule {
6
6
  private readonly _context;
7
7
  private readonly _sheetSkeletonManagerService;
8
8
  private readonly _commandService;
@@ -23,10 +23,10 @@ export { SetCellEditVisibleArrowOperation, SetCellEditVisibleOperation } from '.
23
23
  export { SetScrollOperation } from './commands/operations/scroll.operation';
24
24
  export { SheetsScrollRenderController } from './controllers/render-controllers/scroll.render-controller';
25
25
  export { deriveStateFromActiveSheet$, getCurrentRangeDisable$, getCommentDisable$ } from './controllers/menu/menu-util';
26
- export { SheetRenderController } from './controllers/sheet-render.controller';
26
+ export { SheetsRenderService } from './services/sheets-render.service';
27
27
  export { SetZoomRatioOperation } from './commands/operations/set-zoom-ratio.operation';
28
28
  export { ResetScrollCommand, ScrollCommand, ScrollToCellCommand, SetScrollRelativeCommand, type IScrollCommandParams, type IScrollToCellCommandParams, type ISetScrollRelativeCommandParams, } from './commands/commands/set-scroll.command';
29
- export { VIEWPORT_KEY } from './common/keys';
29
+ export { SHEET_VIEWPORT_KEY as VIEWPORT_KEY } from './common/keys';
30
30
  export { AutoFillController } from './controllers/auto-fill.controller';
31
31
  export { CellCustomRenderController } from './controllers/cell-custom-render.controller';
32
32
  export { PASTE_SPECIAL_MENU_ID } from './controllers/menu/menu';
@@ -36,7 +36,7 @@ export { useActiveWorkbook, useActiveWorksheet } from './components/hook';
36
36
  export { whenSheetEditorFocused } from './controllers/shortcuts/utils';
37
37
  export type { IEditorBridgeServiceParam } from './services/editor-bridge.service';
38
38
  export { AutoFillService, IAutoFillService } from './services/auto-fill/auto-fill.service';
39
- export { getAutoFillRepeatRange } from './services/auto-fill/tools';
39
+ export { getAutoFillRepeatRange, generateNullCellValue } from './services/auto-fill/tools';
40
40
  export type { ICopyDataPiece, ISheetAutoFillHook } from './services/auto-fill/type';
41
41
  export { APPLY_TYPE, DATA_TYPE, type IAutoFillRule } from './services/auto-fill/type';
42
42
  export { type ICopyDataInTypeIndexInfo } from './services/auto-fill/type';
@@ -55,7 +55,7 @@ export { SelectionShape } from './services/selection/selection-shape';
55
55
  export type { ISheetSkeletonManagerParam } from './services/sheet-skeleton-manager.service';
56
56
  export { SheetSkeletonManagerService } from './services/sheet-skeleton-manager.service';
57
57
  export { UniverSheetsUIPlugin } from './sheets-ui-plugin';
58
- export { SheetCanvasView } from './views/sheet-canvas-view';
58
+ export { SheetRenderController } from './controllers/render-controllers/sheet-render.controller';
59
59
  export { HoverManagerService } from './services/hover-manager.service';
60
60
  export { DragManagerService } from './services/drag-manager.service';
61
61
  export { CellAlertManagerService, CellAlertType, type ICellAlert } from './services/cell-alert-manager.service';
@@ -82,3 +82,6 @@ export { HeaderFreezeRenderController } from './controllers/render-controllers/f
82
82
  export { FormulaEditorController } from './controllers/editor/formula-editor.controller';
83
83
  export { StatusBarController } from './controllers/status-bar.controller';
84
84
  export { SheetPermissionInterceptorBaseController } from './controllers/permission/sheet-permission-interceptor-base.controller';
85
+ export type { IRangeProtectionRenderCellData } from './views/permission/extensions/range-protection.render';
86
+ export { ScrollToRangeOperation } from './commands/operations/scroll-to-range.operation';
87
+ export { SheetPrintInterceptorService } from './services/print-interceptor.service';
@@ -3,7 +3,6 @@ import { IRenderManagerService, BaseObject, Viewport } from '@univerjs/engine-re
3
3
  import { IPopup, ICanvasPopupService } from '@univerjs/ui';
4
4
  import { IDisposable } from '@wendellhu/redi';
5
5
  import { RefRangeService } from '@univerjs/sheets';
6
- import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
7
6
 
8
7
  export interface ICanvasPopup extends Pick<IPopup, 'direction' | 'excludeOutside' | 'closeOnSelfTarget' | 'componentKey' | 'offset' | 'onClickOutside'> {
9
8
  mask?: boolean;
@@ -13,10 +12,9 @@ export declare class SheetCanvasPopManagerService extends Disposable {
13
12
  private readonly _globalPopupManagerService;
14
13
  private readonly _renderManagerService;
15
14
  private readonly _univerInstanceService;
16
- private readonly _sheetSkeletonManagerService;
17
15
  private readonly _refRangeService;
18
16
  private readonly _commandService;
19
- constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _refRangeService: RefRangeService, _commandService: ICommandService);
17
+ constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _refRangeService: RefRangeService, _commandService: ICommandService);
20
18
  private _createObjectPositionObserver;
21
19
  /**
22
20
  * attach a popup to canvas object
@@ -2,8 +2,8 @@ import { IRange, Nullable, Disposable, ErrorService, ICommandService, ILogServic
2
2
  import { SelectionManagerService } from '@univerjs/sheets';
3
3
  import { IClipboardInterfaceService, INotificationService, IPlatformService } from '@univerjs/ui';
4
4
  import { IDisposable, Injector } from '@wendellhu/redi';
5
+ import { IRenderManagerService } from '@univerjs/engine-render';
5
6
  import { IMarkSelectionService } from '../mark-selection/mark-selection.service';
6
- import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
7
7
  import { IDiscreteRange } from '../../controllers/utils/range-tools';
8
8
  import { CopyContentCache } from './copy-content-cache';
9
9
  import { ICellDataWithSpanInfo, ISheetClipboardHook, COPY_TYPE } from './type';
@@ -42,9 +42,9 @@ export declare class SheetClipboardService extends Disposable implements ISheetC
42
42
  private readonly _undoRedoService;
43
43
  private readonly _commandService;
44
44
  private readonly _markSelectionService;
45
- private readonly _sheetSkeletonManagerService;
46
45
  private readonly _notificationService;
47
46
  private readonly _platformService;
47
+ private readonly _renderManagerService;
48
48
  private readonly _localeService;
49
49
  private readonly _errorService;
50
50
  private readonly _injector;
@@ -55,7 +55,7 @@ export declare class SheetClipboardService extends Disposable implements ISheetC
55
55
  private _usmToHtml;
56
56
  private _copyContentCache;
57
57
  private _copyMarkId;
58
- constructor(_logService: ILogService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SelectionManagerService, _clipboardInterfaceService: IClipboardInterfaceService, _undoRedoService: IUndoRedoService, _commandService: ICommandService, _markSelectionService: IMarkSelectionService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _notificationService: INotificationService, _platformService: IPlatformService, _localeService: LocaleService, _errorService: ErrorService, _injector: Injector);
58
+ constructor(_logService: ILogService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SelectionManagerService, _clipboardInterfaceService: IClipboardInterfaceService, _undoRedoService: IUndoRedoService, _commandService: ICommandService, _markSelectionService: IMarkSelectionService, _notificationService: INotificationService, _platformService: IPlatformService, _renderManagerService: IRenderManagerService, _localeService: LocaleService, _errorService: ErrorService, _injector: Injector);
59
59
  copyContentCache(): CopyContentCache;
60
60
  generateCopyContent(workbookId: string, worksheetId: string, range: IRange): Nullable<ICopyContent>;
61
61
  copy(copyType?: COPY_TYPE): Promise<boolean>;
@@ -16,11 +16,11 @@ interface IHtmlToUSMServiceProps {
16
16
  export declare class HtmlToUSMService {
17
17
  private static pluginList;
18
18
  static use(plugin: IPastePlugin): void;
19
- private styleCache;
20
- private styleRules;
21
- private afterProcessRules;
22
- private htmlElement;
23
- private getCurrentSkeleton;
19
+ private _styleCache;
20
+ private _styleRules;
21
+ private _afterProcessRules;
22
+ private _htmlElement;
23
+ private _getCurrentSkeleton;
24
24
  constructor(props: IHtmlToUSMServiceProps);
25
25
  convert(html: string): IUniverSheetCopyDataModel;
26
26
  private _parseTable;
@@ -1,7 +1,6 @@
1
1
  import { Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
2
2
  import { IDragEvent, IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ScrollManagerService } from './scroll-manager.service';
4
- import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
5
4
  import { IHoverCellPosition } from './hover-manager.service';
6
5
 
7
6
  export interface IDragCellPosition extends IHoverCellPosition {
@@ -10,13 +9,12 @@ export interface IDragCellPosition extends IHoverCellPosition {
10
9
  export declare class DragManagerService extends Disposable {
11
10
  private readonly _univerInstanceService;
12
11
  private readonly _scrollManagerService;
13
- private readonly _sheetSkeletonManagerService;
14
12
  private readonly _renderManagerService;
15
13
  private _currentCell$;
16
14
  currentCell$: import('rxjs').Observable<Nullable<IDragCellPosition>>;
17
15
  private _endCell$;
18
16
  endCell$: import('rxjs').Observable<Nullable<IDragCellPosition>>;
19
- constructor(_univerInstanceService: IUniverInstanceService, _scrollManagerService: ScrollManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _renderManagerService: IRenderManagerService);
17
+ constructor(_univerInstanceService: IUniverInstanceService, _scrollManagerService: ScrollManagerService, _renderManagerService: IRenderManagerService);
20
18
  dispose(): void;
21
19
  private _initCellDisposableListener;
22
20
  private _calcActiveCell;
@@ -1,11 +1,10 @@
1
1
  import { ICellDataForSheetInterceptor, IPosition, ISelectionCell, Nullable, Disposable, InterceptorManager, IUniverInstanceService, ThemeService } from '@univerjs/core';
2
- import { Engine, IDocumentLayoutObject, Scene, DeviceInputEventType } from '@univerjs/engine-render';
2
+ import { Engine, IDocumentLayoutObject, Scene, DeviceInputEventType, IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ISheetLocation } from '@univerjs/sheets';
4
4
  import { IEditorService, KeyCode } from '@univerjs/ui';
5
5
  import { IDisposable } from '@wendellhu/redi';
6
6
  import { Observable } from 'rxjs';
7
7
  import { ISelectionRenderService } from './selection/selection-render.service';
8
- import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
9
8
 
10
9
  export interface IEditorBridgeServiceVisibleParam {
11
10
  visible: boolean;
@@ -61,7 +60,7 @@ export interface IEditorBridgeService {
61
60
  getCurrentEditorId(): Nullable<string>;
62
61
  }
63
62
  export declare class EditorBridgeService extends Disposable implements IEditorBridgeService, IDisposable {
64
- private readonly _sheetSkeletonManagerService;
63
+ private readonly _renderManagerService;
65
64
  private readonly _selectionRenderService;
66
65
  private readonly _themeService;
67
66
  private readonly _univerInstanceService;
@@ -78,12 +77,12 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
78
77
  readonly visible$: Observable<IEditorBridgeServiceVisibleParam>;
79
78
  private readonly _afterVisible$;
80
79
  readonly afterVisible$: Observable<IEditorBridgeServiceVisibleParam>;
81
- interceptor: InterceptorManager<{
80
+ readonly interceptor: InterceptorManager<{
82
81
  BEFORE_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
83
82
  AFTER_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
84
83
  AFTER_CELL_EDIT_ASYNC: import('@univerjs/core').IInterceptor<Promise<Nullable<ICellDataForSheetInterceptor>>, ISheetLocation>;
85
84
  }>;
86
- constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _selectionRenderService: ISelectionRenderService, _themeService: ThemeService, _univerInstanceService: IUniverInstanceService, _editorService: IEditorService);
85
+ constructor(_renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _themeService: ThemeService, _univerInstanceService: IUniverInstanceService, _editorService: IEditorService);
87
86
  refreshEditCellState(): void;
88
87
  setEditCell(param: ICurrentEditCellParam): void;
89
88
  getEditCellState(): Readonly<Nullable<IEditorBridgeServiceParam>>;
@@ -1,18 +1,32 @@
1
- import { IRange, IStyleData, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
1
+ import { IMutationInfo, IRange, IStyleData, Disposable, ICommandService, ILogService, IUndoRedoService, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
2
2
  import { SelectionManagerService } from '@univerjs/sheets';
3
3
  import { Observable } from 'rxjs';
4
4
  import { IMarkSelectionService } from '../mark-selection/mark-selection.service';
5
5
 
6
6
  export interface IFormatPainterService {
7
7
  status$: Observable<FormatPainterStatus>;
8
+ addHook(hooks: IFormatPainterHook): void;
9
+ getHooks(): IFormatPainterHook[];
8
10
  setStatus(status: FormatPainterStatus): void;
9
11
  getStatus(): FormatPainterStatus;
12
+ setSelectionFormat(format: ISelectionFormatInfo): void;
10
13
  getSelectionFormat(): ISelectionFormatInfo;
14
+ applyFormatPainter(unitId: string, subUnitId: string, range: IRange): boolean;
11
15
  }
12
16
  export interface ISelectionFormatInfo {
13
17
  styles: ObjectMatrix<IStyleData>;
14
18
  merges: IRange[];
15
19
  }
20
+ export interface IFormatPainterHook {
21
+ id: string;
22
+ isDefaultHook?: boolean;
23
+ priority?: number;
24
+ onStatusChange(status: FormatPainterStatus): void;
25
+ onApply(unitId: string, subUnitId: string, range: IRange, format: ISelectionFormatInfo): {
26
+ undos: IMutationInfo[];
27
+ redos: IMutationInfo[];
28
+ };
29
+ }
16
30
  export declare enum FormatPainterStatus {
17
31
  OFF = 0,
18
32
  ONCE = 1,
@@ -23,14 +37,22 @@ export declare class FormatPainterService extends Disposable implements IFormatP
23
37
  private readonly _selectionManagerService;
24
38
  private readonly _univerInstanceService;
25
39
  private readonly _markSelectionService;
40
+ private readonly _logService;
41
+ private readonly _commandService;
42
+ private readonly _undoRedoService;
26
43
  readonly status$: Observable<FormatPainterStatus>;
27
44
  private _selectionFormat;
28
45
  private _markId;
29
46
  private readonly _status$;
30
- constructor(_selectionManagerService: SelectionManagerService, _univerInstanceService: IUniverInstanceService, _markSelectionService: IMarkSelectionService);
47
+ private _defaultHook;
48
+ private _extendHooks;
49
+ constructor(_selectionManagerService: SelectionManagerService, _univerInstanceService: IUniverInstanceService, _markSelectionService: IMarkSelectionService, _logService: ILogService, _commandService: ICommandService, _undoRedoService: IUndoRedoService);
50
+ addHook(hook: IFormatPainterHook): void;
51
+ getHooks(): IFormatPainterHook[];
31
52
  setStatus(status: FormatPainterStatus): void;
32
53
  getStatus(): FormatPainterStatus;
33
- private _updateRangeMark;
34
- private _getSelectionRangeFormat;
54
+ setSelectionFormat(format: ISelectionFormatInfo): void;
35
55
  getSelectionFormat(): ISelectionFormatInfo;
56
+ applyFormatPainter(unitId: string, subUnitId: string, range: IRange): boolean;
57
+ private _updateRangeMark;
36
58
  }
@@ -2,7 +2,6 @@ import { IPosition, Nullable, Disposable, IUniverInstanceService } from '@univer
2
2
  import { ISheetLocation } from '@univerjs/sheets';
3
3
  import { IRenderManagerService } from '@univerjs/engine-render';
4
4
  import { ScrollManagerService } from './scroll-manager.service';
5
- import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
6
5
 
7
6
  export interface IHoverCellPosition {
8
7
  position: IPosition;
@@ -11,13 +10,12 @@ export interface IHoverCellPosition {
11
10
  export declare class HoverManagerService extends Disposable {
12
11
  private readonly _univerInstanceService;
13
12
  private readonly _scrollManagerService;
14
- private readonly _sheetSkeletonManagerService;
15
13
  private readonly _renderManagerService;
16
14
  private _currentCell$;
17
15
  currentCell$: import('rxjs').Observable<Nullable<IHoverCellPosition>>;
18
16
  currentPosition$: import('rxjs').Observable<Nullable<IHoverCellPosition>>;
19
17
  private _lastPosition;
20
- constructor(_univerInstanceService: IUniverInstanceService, _scrollManagerService: ScrollManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _renderManagerService: IRenderManagerService);
18
+ constructor(_univerInstanceService: IUniverInstanceService, _scrollManagerService: ScrollManagerService, _renderManagerService: IRenderManagerService);
21
19
  dispose(): void;
22
20
  private _initCellDisposableListener;
23
21
  private _calcActiveCell;
@@ -3,7 +3,6 @@ import { IRenderManagerService } from '@univerjs/engine-render';
3
3
  import { ISelectionWithStyle } from '@univerjs/sheets';
4
4
  import { ISelectionRenderService } from '../selection/selection-render.service';
5
5
  import { SelectionShape } from '../selection/selection-shape';
6
- import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
7
6
 
8
7
  export interface IMarkSelectionService {
9
8
  addShape(selection: ISelectionWithStyle, exits?: string[], zIndex?: number): string | null;
@@ -25,10 +24,9 @@ export declare class MarkSelectionService extends Disposable implements IMarkSel
25
24
  private readonly _currentService;
26
25
  private readonly _renderManagerService;
27
26
  private readonly _selectionRenderService;
28
- private readonly _sheetSkeletonManagerService;
29
27
  private readonly _themeService;
30
28
  private _shapeMap;
31
- constructor(_currentService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _themeService: ThemeService);
29
+ constructor(_currentService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _themeService: ThemeService);
32
30
  addShape(selection: ISelectionWithStyle, exits?: string[], zIndex?: number): string | null;
33
31
  refreshShapes(): void;
34
32
  getShapeMap(): Map<string, IMarkSelectionInfo>;
@@ -0,0 +1,10 @@
1
+ import { IRenderManagerService } from '@univerjs/engine-render';
2
+ import { Disposable, IUniverInstanceService } from '@univerjs/core';
3
+
4
+ export declare class WorksheetProtectionRenderService extends Disposable {
5
+ private _renderManagerService;
6
+ private _univerInstanceService;
7
+ private _worksheetProtectionRenderExtension;
8
+ constructor(_renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService);
9
+ private _initRender;
10
+ }
@@ -0,0 +1,17 @@
1
+ import { IRange, Disposable, InterceptorManager } from '@univerjs/core';
2
+ import { Scene } from '@univerjs/engine-render';
3
+
4
+ interface ISheetPos {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ }
8
+ export declare class SheetPrintInterceptorService extends Disposable {
9
+ readonly interceptor: InterceptorManager<{
10
+ PRINTING_RANGE: import('@univerjs/core').IInterceptor<IRange, ISheetPos>;
11
+ PRINTING_COMPONENT_COLLECT: import('@univerjs/core').IInterceptor<undefined, ISheetPos & {
12
+ scene: Scene;
13
+ }>;
14
+ }>;
15
+ constructor();
16
+ }
17
+ export {};
@@ -1,10 +1,13 @@
1
- import { Nullable } from '@univerjs/core';
1
+ import { IUniverInstanceService, Nullable } from '@univerjs/core';
2
+ import { IRenderManagerService } from '@univerjs/engine-render';
2
3
 
3
4
  export interface IScrollManagerParam {
4
5
  offsetX: number;
5
6
  offsetY: number;
6
7
  sheetViewStartRow: number;
7
8
  sheetViewStartColumn: number;
9
+ viewportScrollX?: number;
10
+ viewportScrollY?: number;
8
11
  }
9
12
  export interface IScrollManagerSearchParam {
10
13
  unitId: string;
@@ -20,20 +23,47 @@ export type IScrollInfo = Map<string, Map<string, IScrollManagerParam>>;
20
23
  * ScrollController subscribes to the changes in service data to refresh the view scrolling.
21
24
  */
22
25
  export declare class ScrollManagerService {
26
+ private readonly _univerInstanceService;
27
+ private readonly _renderManagerService;
23
28
  private readonly _scrollInfo;
24
29
  private readonly _scrollInfo$;
25
30
  readonly scrollInfo$: import('rxjs').Observable<Nullable<IScrollManagerParam>>;
26
- private _currentScroll;
31
+ private _searchParamForScroll;
32
+ constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
27
33
  dispose(): void;
28
- setCurrentScroll(param: IScrollManagerSearchParam): void;
29
- getScrollByParam(param: IScrollManagerSearchParam): Readonly<Nullable<IScrollManagerParam>>;
30
- getCurrentScroll(): Readonly<Nullable<IScrollManagerParam>>;
31
- addOrReplace(scroll: IScrollManagerParam): void;
32
- addOrReplaceNoRefresh(scroll: IScrollManagerParam): void;
33
- addOrReplaceByParam(param: IScrollManagerInsertParam): void;
34
+ setSearchParam(param: IScrollManagerSearchParam): void;
35
+ setSearchParamAndRefresh(param: IScrollManagerSearchParam): void;
36
+ getScrollInfoByParam(param: IScrollManagerSearchParam): Readonly<Nullable<IScrollManagerParam>>;
37
+ getCurrentScrollInfo(): Readonly<Nullable<IScrollManagerParam>>;
38
+ setScrollInfoToSnapshot(scrollInfo: IScrollManagerParam): void;
39
+ /**
40
+ * set scrollInfo by cmd,
41
+ * call _setScrollInfo twice after one scrolling.
42
+ * first time set scrollInfo bt scrollOperation, but offsetXY is derived from scroll event.
43
+ * second time set scrollInfo by viewport.scrollTo(scrol.render-controller --> onScrollAfterObserver), this time offsetXY has been limited.
44
+ *
45
+ * wheelevent --> sheetCanvasView --> set-scroll.command('sheet.command.set-scroll-relative') --> scrollOperation --> this.setScrollInfo --> scrollInfo$.next --> scroll.render-controller@viewportMain.scrollTo & notify -->
46
+ * scroll.render-controller@onScrollAfterObserver --> this.setScrollInfoToCurrSheetWithoutNotify --> this._setScrollInfo({}, false)
47
+ * call _setScrollInfo again, a loop!, so we should call setScrollInfoToCurrSheetWithoutNotify
48
+ * @param param
49
+ */
50
+ setScrollInfo(param: IScrollManagerInsertParam): void;
51
+ setScrollInfoToCurrSheet(scrollInfo: IScrollManagerParam): void;
52
+ setScrollInfoToCurrSheetWithoutNotify(scroll: IScrollManagerParam): void;
34
53
  clear(): void;
35
- private _addByParam;
54
+ calcViewportScrollFromOffset(scrollInfo: IScrollManagerInsertParam): {
55
+ scrollTop: number;
56
+ scrollLeft: number;
57
+ viewportScrollX?: undefined;
58
+ viewportScrollY?: undefined;
59
+ } | {
60
+ viewportScrollX: number;
61
+ viewportScrollY: number;
62
+ scrollTop?: undefined;
63
+ scrollLeft?: undefined;
64
+ };
65
+ private _setScrollInfo;
36
66
  private _clearByParam;
37
67
  private _getCurrentScroll;
38
- private _refresh;
68
+ private _notifyCurrentScrollInfo;
39
69
  }
@@ -1,10 +1,9 @@
1
- import { IInterceptor, IRange, IRangeWithCoord, ISelection, ISelectionCell, ISelectionCellWithCoord, Nullable, InterceptorManager, RANGE_TYPE, ThemeService } from '@univerjs/core';
2
- import { IMouseEvent, IPointerEvent, Scene, SpreadsheetSkeleton, Viewport, ScrollTimerType } from '@univerjs/engine-render';
1
+ import { IInterceptor, IRange, IRangeWithCoord, ISelection, ISelectionCell, ISelectionCellWithCoord, Nullable, InterceptorManager, IUniverInstanceService, RANGE_TYPE, ThemeService } from '@univerjs/core';
2
+ import { IMouseEvent, IPointerEvent, Scene, SpreadsheetSkeleton, Viewport, IRenderManagerService, ScrollTimerType } from '@univerjs/engine-render';
3
3
  import { ISelectionStyle, ISelectionWithCoordAndStyle, ISelectionWithStyle } from '@univerjs/sheets';
4
4
  import { IShortcutService } from '@univerjs/ui';
5
5
  import { Injector } from '@wendellhu/redi';
6
6
  import { Observable } from 'rxjs';
7
- import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
8
7
  import { SelectionShape } from './selection-shape';
9
8
 
10
9
  export interface IControlFillConfig {
@@ -81,7 +80,8 @@ export declare const RANGE_FILL_PERMISSION_CHECK: IInterceptor<boolean, {
81
80
  export declare class SelectionRenderService implements ISelectionRenderService {
82
81
  private readonly _themeService;
83
82
  private readonly _shortcutService;
84
- private readonly _sheetSkeletonManagerService;
83
+ private readonly _renderManagerService;
84
+ private readonly _instanceService;
85
85
  private readonly _injector;
86
86
  hasSelection: boolean;
87
87
  private _downObserver;
@@ -133,7 +133,7 @@ export declare class SelectionRenderService implements ISelectionRenderService {
133
133
  skeleton: SpreadsheetSkeleton;
134
134
  }>;
135
135
  }>;
136
- constructor(_themeService: ThemeService, _shortcutService: IShortcutService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _injector: Injector);
136
+ constructor(_themeService: ThemeService, _shortcutService: IShortcutService, _renderManagerService: IRenderManagerService, _instanceService: IUniverInstanceService, _injector: Injector);
137
137
  enableHeaderHighlight(): void;
138
138
  disableHeaderHighlight(): void;
139
139
  enableDetectMergedCell(): void;
@@ -1,32 +1,31 @@
1
- import { Nullable, IUniverInstanceService } from '@univerjs/core';
2
- import { SpreadsheetSkeleton } from '@univerjs/engine-render';
1
+ import { Nullable, Workbook } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule, SpreadsheetSkeleton } from '@univerjs/engine-render';
3
3
  import { IDisposable, Injector } from '@wendellhu/redi';
4
4
 
5
5
  export interface ISheetSkeletonManagerParam {
6
- unitId: string;
7
6
  sheetId: string;
8
7
  skeleton: SpreadsheetSkeleton;
9
8
  dirty: boolean;
10
9
  commandId?: string;
11
10
  }
12
11
  export interface ISheetSkeletonManagerSearch {
13
- unitId: string;
14
12
  sheetId: string;
15
13
  commandId?: string;
16
14
  }
17
15
  /**
18
16
  * This service manages the drawing of the sheet's viewModel (skeleton).
17
+ *
19
18
  * Each time there is a content change, it will trigger the viewModel of the render to recalculate.
19
+ *
20
20
  * Each application and sub-table has its own viewModel (skeleton).
21
+ *
21
22
  * The viewModel is also a temporary storage variable, which does not need to be persisted,
22
23
  * so it is managed uniformly through the service.
23
- *
24
- * @todo RenderUnit - We should move this to RenderUnit as well after all dependents have been moved.
25
24
  */
26
- export declare class SheetSkeletonManagerService implements IDisposable {
27
- private readonly _univerInstanceService;
25
+ export declare class SheetSkeletonManagerService implements IDisposable, IRenderModule {
26
+ private readonly _context;
28
27
  private readonly _injector;
29
- private _currentSkeleton;
28
+ private _currentSkeletonSearchParam;
30
29
  private _sheetSkeletonParam;
31
30
  private readonly _currentSkeleton$;
32
31
  readonly currentSkeleton$: import('rxjs').Observable<Nullable<ISheetSkeletonManagerParam>>;
@@ -35,18 +34,16 @@ export declare class SheetSkeletonManagerService implements IDisposable {
35
34
  */
36
35
  private readonly _currentSkeletonBefore$;
37
36
  readonly currentSkeletonBefore$: import('rxjs').Observable<Nullable<ISheetSkeletonManagerParam>>;
38
- constructor(_univerInstanceService: IUniverInstanceService, _injector: Injector);
37
+ constructor(_context: IRenderContext<Workbook>, _injector: Injector);
39
38
  dispose(): void;
39
+ getCurrentSkeleton(): SpreadsheetSkeleton;
40
40
  /** @deprecated */
41
41
  getCurrent(): Nullable<ISheetSkeletonManagerParam>;
42
42
  getUnitSkeleton(unitId: string, sheetId: string): Nullable<ISheetSkeletonManagerParam>;
43
43
  setCurrent(searchParam: ISheetSkeletonManagerSearch): Nullable<ISheetSkeletonManagerParam>;
44
- removeSkeleton(searchParam: Pick<ISheetSkeletonManagerSearch, 'unitId'>): void;
45
- private _compareSearch;
46
44
  private _setCurrent;
47
45
  reCalculate(): void;
48
46
  private _reCalculate;
49
- makeDirtyCurrent(state?: boolean): void;
50
47
  makeDirty(searchParm: ISheetSkeletonManagerSearch, state?: boolean): void;
51
48
  getOrCreateSkeleton(searchParam: ISheetSkeletonManagerSearch): SpreadsheetSkeleton | undefined;
52
49
  private _getSkeleton;
@@ -0,0 +1,27 @@
1
+ import { IContextService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
2
+ import { IRenderManagerService } from '@univerjs/engine-render';
3
+ import { IDisposable } from '@wendellhu/redi';
4
+
5
+ /**
6
+ * This controller is responsible for managing units of a specific kind to be rendered on the canvas.
7
+ */
8
+ export declare class SheetsRenderService extends RxDisposable {
9
+ private readonly _contextService;
10
+ private readonly _univerInstanceService;
11
+ private readonly _renderManagerService;
12
+ private _skeletonChangeMutations;
13
+ constructor(_contextService: IContextService, _univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
14
+ /**
15
+ * Register a mutation id that will trigger the skeleton change.
16
+ *
17
+ * @param mutationId the id of the mutation
18
+ * @returns a disposable to unregister the mutation
19
+ */
20
+ registerSkeletonChangingMutations(mutationId: string): IDisposable;
21
+ checkMutationShouldTriggerRerender(id: string): boolean;
22
+ private _init;
23
+ private _initWorkbookListener;
24
+ private _createRenderer;
25
+ private _disposeRenderer;
26
+ private _initContextListener;
27
+ }