@univerjs/sheets-drawing-ui 0.6.10-nightly.202504141607 → 0.6.10-nightly.202504161609

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.
@@ -1,13 +1,19 @@
1
- import { Disposable } from '@univerjs/core';
1
+ import { Disposable, Injector } from '@univerjs/core';
2
2
  import { IDrawingManagerService } from '@univerjs/drawing';
3
3
  import { DrawingRenderService } from '@univerjs/drawing-ui';
4
4
  import { IRenderManagerService } from '@univerjs/engine-render';
5
5
  import { SheetPrintInterceptorService } from '@univerjs/sheets-ui';
6
+ import { ComponentManager } from '@univerjs/ui';
7
+ import { SheetCanvasFloatDomManagerService } from '../services/canvas-float-dom-manager.service';
6
8
  export declare class SheetDrawingPrintingController extends Disposable {
7
9
  private readonly _sheetPrintInterceptorService;
8
10
  private readonly _drawingRenderService;
9
11
  private readonly _drawingManagerService;
10
12
  private readonly _renderManagerService;
11
- constructor(_sheetPrintInterceptorService: SheetPrintInterceptorService, _drawingRenderService: DrawingRenderService, _drawingManagerService: IDrawingManagerService, _renderManagerService: IRenderManagerService);
13
+ private readonly _canvasFloatDomManagerService;
14
+ private readonly _componetManager;
15
+ private readonly _injector;
16
+ constructor(_sheetPrintInterceptorService: SheetPrintInterceptorService, _drawingRenderService: DrawingRenderService, _drawingManagerService: IDrawingManagerService, _renderManagerService: IRenderManagerService, _canvasFloatDomManagerService: SheetCanvasFloatDomManagerService, _componetManager: ComponentManager, _injector: Injector);
12
17
  private _initPrinting;
18
+ private _initPrintingDom;
13
19
  }
@@ -1,5 +1,5 @@
1
1
  import { IDisposable, IPosition, IRange, ITransformState, Serializable, Worksheet, Disposable, DrawingTypeEnum, ICommandService, IUniverInstanceService, LifecycleService } from '@univerjs/core';
2
- import { IBoundRectNoAngle, Scene, SpreadsheetSkeleton, IRenderManagerService, Rect } from '@univerjs/engine-render';
2
+ import { BaseObject, IBoundRectNoAngle, Scene, SpreadsheetSkeleton, IRenderManagerService, Rect } from '@univerjs/engine-render';
3
3
  import { IFloatDomLayout, CanvasFloatDomService } from '@univerjs/ui';
4
4
  import { IDrawingManagerService } from '@univerjs/drawing';
5
5
  import { ISheetDrawingService } from '@univerjs/sheets-drawing';
@@ -22,10 +22,6 @@ export interface ICanvasFloatDom {
22
22
  * subUnitId of worksheet, if not set, will use current worksheet
23
23
  */
24
24
  subUnitId?: string;
25
- /**
26
- * @deprecated Please use `data`. for saving to disk, everything add to float-dom must be serializable.
27
- */
28
- props?: Record<string, any>;
29
25
  /**
30
26
  * data of component, will save to snapshot, json-like data
31
27
  */
@@ -44,7 +40,7 @@ declare enum ScrollDirectionResponse {
44
40
  HORIZONTAL = "HORIZONTAL",
45
41
  VERTICAL = "VERTICAL"
46
42
  }
47
- interface ICanvasFloatDomInfo {
43
+ export interface ICanvasFloatDomInfo {
48
44
  position$: BehaviorSubject<IFloatDomLayout>;
49
45
  dispose: IDisposable;
50
46
  rect: Rect;
@@ -53,6 +49,7 @@ interface ICanvasFloatDomInfo {
53
49
  boundsOfViewArea?: IBoundRectNoAngle;
54
50
  scrollDirectionResponse?: ScrollDirectionResponse;
55
51
  domAnchor?: IDOMAnchor;
52
+ id: string;
56
53
  }
57
54
  export interface IDOMAnchor {
58
55
  width: number;
@@ -81,10 +78,16 @@ export interface ILimitBound extends IBoundRectNoAngle {
81
78
  * @param worksheet
82
79
  * @returns ILimitBound
83
80
  */
84
- export declare function transformBound2DOMBound(posOfFloatObject: IBoundRectNoAngle, scene: Scene, skeleton: SpreadsheetSkeleton, worksheet: Worksheet, floatDomInfo?: ICanvasFloatDomInfo): ILimitBound;
85
- export interface ISheetCanvasFloatDomHook {
86
- onGetFloatDomProps: (id: string) => Record<string, any>;
87
- }
81
+ export declare function transformBound2DOMBound(posOfFloatObject: IBoundRectNoAngle, scene: Scene, skeleton: SpreadsheetSkeleton, worksheet: Worksheet, floatDomInfo?: ICanvasFloatDomInfo, skipBoundsOfViewArea?: boolean): ILimitBound;
82
+ /**
83
+ * Calculate the position of the floating dom, limited by bounds of viewMain in transformBound2DOMBound
84
+ * @param floatObject
85
+ * @param renderUnit
86
+ * @param skeleton
87
+ * @param worksheet
88
+ * @returns {IFloatDomLayout} position
89
+ */
90
+ export declare const calcSheetFloatDomPosition: (floatObject: BaseObject, scene: Scene, skeleton: SpreadsheetSkeleton, worksheet: Worksheet, floatDomInfo?: ICanvasFloatDomInfo) => IFloatDomLayout;
88
91
  export declare class SheetCanvasFloatDomManagerService extends Disposable {
89
92
  private _renderManagerService;
90
93
  private _univerInstanceService;
@@ -93,10 +96,6 @@ export declare class SheetCanvasFloatDomManagerService extends Disposable {
93
96
  private readonly _canvasFloatDomService;
94
97
  private readonly _sheetDrawingService;
95
98
  protected readonly _lifecycleService: LifecycleService;
96
- /**
97
- * for update dom container position when scrolling and zoom
98
- */
99
- private _domLayerMap;
100
99
  /**
101
100
  * for update dom container position when scrolling and zoom
102
101
  */
@@ -119,18 +118,11 @@ export declare class SheetCanvasFloatDomManagerService extends Disposable {
119
118
  subUnitId: string;
120
119
  id: string;
121
120
  }>;
122
- private _hooks;
123
121
  constructor(_renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _drawingManagerService: IDrawingManagerService, _canvasFloatDomService: CanvasFloatDomService, _sheetDrawingService: ISheetDrawingService, _lifecycleService: LifecycleService);
124
122
  private _bindScrollEvent;
125
- /**
126
- * For scrolling and zoom
127
- * @param unitId
128
- * @param subUnitId
129
- */
130
- private _ensureMap;
131
123
  getFloatDomInfo(id: string): ICanvasFloatDomInfo | undefined;
124
+ getFloatDomsBySubUnitId(unitId: string, subUnitId: string): ICanvasFloatDomInfo[];
132
125
  private _getSceneAndTransformerByDrawingSearch;
133
- private _getFloatDomProps;
134
126
  private _drawingAddListener;
135
127
  private _scrollUpdateListener;
136
128
  private _getPosition;
@@ -142,7 +134,6 @@ export declare class SheetCanvasFloatDomManagerService extends Disposable {
142
134
  dispose: () => void;
143
135
  } | undefined;
144
136
  private _removeDom;
145
- addHook(hook: ISheetCanvasFloatDomHook): IDisposable;
146
137
  addFloatDomToRange(range: IRange, config: ICanvasFloatDom, domAnchor: Partial<IDOMAnchor>, propId?: string): {
147
138
  id: string;
148
139
  dispose: () => void;
@@ -0,0 +1,10 @@
1
+ import { Worksheet } from '@univerjs/core';
2
+ import { Scene, SpreadsheetSkeleton } from '@univerjs/engine-render';
3
+ import { IFloatDomData } from '@univerjs/sheets-drawing';
4
+ export interface IPrintingFloatDomProps {
5
+ floatDomInfos: IFloatDomData[];
6
+ scene: Scene;
7
+ skeleton: SpreadsheetSkeleton;
8
+ worksheet: Worksheet;
9
+ }
10
+ export declare const PrintingFloatDom: (props: IPrintingFloatDomProps) => import("react/jsx-runtime").JSX.Element;