@univerjs/sheets-ui 0.1.13 → 0.1.14

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 (51) hide show
  1. package/lib/cjs/index.js +11 -11
  2. package/lib/es/index.js +5568 -5522
  3. package/lib/locale/en-US.json +2 -2
  4. package/lib/types/controllers/auto-height.controller.d.ts +7 -7
  5. package/lib/types/controllers/cell-alert.controller.d.ts +2 -2
  6. package/lib/types/controllers/cell-custom-render.controller.d.ts +2 -5
  7. package/lib/types/controllers/clipboard/clipboard.controller.d.ts +3 -4
  8. package/lib/types/controllers/drag-render.controller.d.ts +3 -3
  9. package/lib/types/controllers/editor/formula-editor.controller.d.ts +3 -11
  10. package/lib/types/controllers/force-string-alert-render.controller.d.ts +4 -5
  11. package/lib/types/controllers/force-string-render.controller.d.ts +2 -5
  12. package/lib/types/controllers/hover-render.controller.d.ts +3 -4
  13. package/lib/types/controllers/mark-selection.controller.d.ts +2 -2
  14. package/lib/types/controllers/menu/menu-util.d.ts +2 -2
  15. package/lib/types/controllers/menu/permission-menu-util.d.ts +0 -3
  16. package/lib/types/controllers/permission/sheet-permission-interceptor-canvas-render.controller.d.ts +2 -2
  17. package/lib/types/controllers/permission/sheet-permission-interceptor-formula-render.controller.d.ts +2 -3
  18. package/lib/types/controllers/permission/sheet-permission-render.controller.d.ts +16 -2
  19. package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +4 -7
  20. package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +2 -2
  21. package/lib/types/controllers/render-controllers/format-painter.render-controller.d.ts +2 -2
  22. package/lib/types/controllers/render-controllers/freeze.render-controller.d.ts +2 -2
  23. package/lib/types/controllers/render-controllers/header-menu.render-controller.d.ts +2 -2
  24. package/lib/types/controllers/render-controllers/header-move.render-controller.d.ts +2 -2
  25. package/lib/types/controllers/render-controllers/header-resize.render-controller.d.ts +2 -2
  26. package/lib/types/controllers/render-controllers/scroll.render-controller.d.ts +4 -5
  27. package/lib/types/controllers/render-controllers/selection.render-controller.d.ts +2 -2
  28. package/lib/types/controllers/render-controllers/sheet-render.controller.d.ts +41 -0
  29. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +2 -2
  30. package/lib/types/index.d.ts +4 -2
  31. package/lib/types/services/canvas-pop-manager.service.d.ts +1 -3
  32. package/lib/types/services/clipboard/clipboard.service.d.ts +3 -3
  33. package/lib/types/services/clipboard/html-to-usm/converter.d.ts +5 -5
  34. package/lib/types/services/drag-manager.service.d.ts +1 -3
  35. package/lib/types/services/editor-bridge.service.d.ts +4 -5
  36. package/lib/types/services/hover-manager.service.d.ts +1 -3
  37. package/lib/types/services/mark-selection/mark-selection.service.d.ts +1 -3
  38. package/lib/types/services/permission/worksheet-permission-render.service.d.ts +10 -0
  39. package/lib/types/services/print-interceptor.service.d.ts +17 -0
  40. package/lib/types/services/selection/selection-render.service.d.ts +5 -5
  41. package/lib/types/services/sheet-skeleton-manager.service.d.ts +9 -12
  42. package/lib/types/services/sheets-render.service.d.ts +27 -0
  43. package/lib/types/sheets-ui-plugin.d.ts +2 -0
  44. package/lib/types/views/permission/extensions/protect-background-img.d.ts +16 -0
  45. package/lib/types/views/permission/extensions/range-protection.render.d.ts +32 -0
  46. package/lib/types/views/permission/extensions/worksheet-permission.render.d.ts +13 -0
  47. package/lib/umd/index.js +11 -11
  48. package/package.json +39 -29
  49. package/lib/types/controllers/sheet-render.controller.d.ts +0 -38
  50. package/lib/types/services/permission/permission-render.service.d.ts +0 -17
  51. package/lib/types/views/sheet-canvas-view.d.ts +0 -30
@@ -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>>;
@@ -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,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,30 +1,29 @@
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
28
  private _currentSkeleton;
30
29
  private _sheetSkeletonParam;
@@ -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
+ }
@@ -14,6 +14,8 @@ export declare class UniverSheetsUIPlugin extends Plugin {
14
14
  constructor(_config: Partial<IUniverSheetsUIConfig>, _injector: Injector, _localeService: LocaleService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService);
15
15
  onStarting(injector: Injector): void;
16
16
  onReady(): void;
17
+ onRendered(): void;
18
+ private _registerRenderBasics;
17
19
  private _registerRenderControllers;
18
20
  private _markSheetAsFocused;
19
21
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const base64 = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgNCA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8bWFzayBpZD0ibWFzazBfNzU5XzExMDgiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjRDZEOEQ5Ii8+CjwvbWFzaz4KPGcgbWFzaz0idXJsKCNtYXNrMF83NTlfMTEwOCkiPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTS0zLjY0MDAyIDMuNDQxNDFMMi4wNzM5NyAtMi4yNzI1OEwyLjc4MTA4IC0xLjU2NTQ4TC0yLjkzMjkxIDQuMTQ4NTJMLTMuNjQwMDIgMy40NDE0MVoiIGZpbGw9IiNENkQ4REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0tMS41MTg2OCA1LjU2Mjc1TDQuMTk1MzEgLTAuMTUxMjQ1TDQuOTAyNDIgMC41NTU4NjJMLTAuODExNTc1IDYuMjY5ODZMLTEuNTE4NjggNS41NjI3NVoiIGZpbGw9IiNENkQ4REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjYwMjY1NiA3LjY4NDAzTDYuMzE2NjUgMS45NzAwM0w3LjAyMzc2IDIuNjc3MTRMMS4zMDk3NiA4LjM5MTEzTDAuNjAyNjU2IDcuNjg0MDNaIiBmaWxsPSIjRDZEOERCIi8+CjwvZz4KPC9zdmc+";
@@ -0,0 +1,32 @@
1
+ import { ICellDataForSheetInterceptor, IRange, IScale } from '@univerjs/core';
2
+ import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
3
+ import { ICellPermission } from '@univerjs/sheets';
4
+
5
+ export declare const RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY = "RANGE_PROTECTION_CAN_VIEW_RENDER_EXTENSION_KEY";
6
+ export declare const RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY = "RANGE_PROTECTION_CAN_NOT_VIEW_RENDER_EXTENSION_KEY";
7
+ export type IRangeProtectionRenderCellData = ICellDataForSheetInterceptor & {
8
+ selectionProtection: ICellPermission[];
9
+ };
10
+ export declare abstract class RangeProtectionRenderExtension extends SheetExtension {
11
+ abstract uKey: string;
12
+ abstract Z_INDEX: number;
13
+ protected _pattern: CanvasPattern | null;
14
+ protected _img: HTMLImageElement;
15
+ renderCache: Set<string>;
16
+ constructor();
17
+ clearCache(): void;
18
+ protected abstract shouldRender(config: ICellPermission): boolean;
19
+ draw(ctx: UniverRenderingContext, _parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, _diffRanges?: IRange[]): void;
20
+ }
21
+ export declare class RangeProtectionCanViewRenderExtension extends RangeProtectionRenderExtension {
22
+ uKey: string;
23
+ Z_INDEX: number;
24
+ constructor();
25
+ protected shouldRender(config: ICellPermission): boolean;
26
+ }
27
+ export declare class RangeProtectionCanNotViewRenderExtension extends RangeProtectionRenderExtension {
28
+ uKey: string;
29
+ Z_INDEX: number;
30
+ constructor();
31
+ protected shouldRender(config: ICellPermission): boolean;
32
+ }
@@ -0,0 +1,13 @@
1
+ import { IRange, IScale } from '@univerjs/core';
2
+ import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
3
+
4
+ export declare const worksheetProtectionKey = "worksheet-protection";
5
+ export declare class WorksheetProtectionRenderExtension extends SheetExtension {
6
+ uKey: string;
7
+ Z_INDEX: number;
8
+ private _pattern;
9
+ private _img;
10
+ constructor();
11
+ draw(ctx: UniverRenderingContext, _parentScale: IScale, spreadsheetSkeleton: SpreadsheetSkeleton, _diffRanges?: IRange[]): false | undefined;
12
+ setZIndex(zIndex: number): void;
13
+ }