@univerjs/sheets-drawing-ui 0.6.10-experimental.20250411-f5b7b16 → 0.6.10-experimental.20250419-8830bd4

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 (38) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/cjs/locale/en-US.js +1 -1
  3. package/lib/cjs/locale/fa-IR.js +1 -1
  4. package/lib/cjs/locale/fr-FR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/index.js +2538 -2435
  10. package/lib/es/locale/en-US.js +0 -10
  11. package/lib/es/locale/fa-IR.js +0 -10
  12. package/lib/es/locale/fr-FR.js +0 -10
  13. package/lib/es/locale/ru-RU.js +0 -10
  14. package/lib/es/locale/vi-VN.js +2 -12
  15. package/lib/es/locale/zh-CN.js +0 -10
  16. package/lib/es/locale/zh-TW.js +0 -10
  17. package/lib/index.css +1 -1
  18. package/lib/index.js +2538 -2435
  19. package/lib/locale/en-US.js +0 -10
  20. package/lib/locale/fa-IR.js +0 -10
  21. package/lib/locale/fr-FR.js +0 -10
  22. package/lib/locale/ru-RU.js +0 -10
  23. package/lib/locale/vi-VN.js +2 -12
  24. package/lib/locale/zh-CN.js +0 -10
  25. package/lib/locale/zh-TW.js +0 -10
  26. package/lib/types/controllers/sheet-drawing-printing.controller.d.ts +8 -2
  27. package/lib/types/locale/zh-CN.d.ts +0 -10
  28. package/lib/types/services/canvas-float-dom-manager.service.d.ts +14 -23
  29. package/lib/types/views/printing-float-dom/index.d.ts +16 -0
  30. package/lib/umd/index.js +2 -2
  31. package/lib/umd/locale/en-US.js +1 -1
  32. package/lib/umd/locale/fa-IR.js +1 -1
  33. package/lib/umd/locale/fr-FR.js +1 -1
  34. package/lib/umd/locale/ru-RU.js +1 -1
  35. package/lib/umd/locale/vi-VN.js +1 -1
  36. package/lib/umd/locale/zh-CN.js +1 -1
  37. package/lib/umd/locale/zh-TW.js +1 -1
  38. package/package.json +19 -14
@@ -28,16 +28,6 @@ const e = {
28
28
  exceedMaxCount: "Only {0} images can be uploaded at a time",
29
29
  invalidImage: "Invalid image"
30
30
  },
31
- "sheet-drawing-view": "Drawing",
32
- shortcut: {
33
- sheet: {
34
- "drawing-move-down": "Move Drawing down",
35
- "drawing-move-up": "Move Drawing up",
36
- "drawing-move-left": "Move Drawing left",
37
- "drawing-move-right": "Move Drawing right",
38
- "drawing-delete": "Delete Drawing"
39
- }
40
- },
41
31
  "cell-image": {
42
32
  pasteTitle: "Paste as cell image",
43
33
  pasteContent: "Pasting a cell image will overwrite the existing content of the cell, continue pasting",
@@ -28,16 +28,6 @@ const e = {
28
28
  exceedMaxCount: "فقط {0} تصویر می‌توانند همزمان آپلود شوند",
29
29
  invalidImage: "تصویر نامعتبر است"
30
30
  },
31
- "sheet-drawing-view": "طراحی",
32
- shortcut: {
33
- sheet: {
34
- "drawing-move-down": "جابه‌جایی طراحی به پایین",
35
- "drawing-move-up": "جابه‌جایی طراحی به بالا",
36
- "drawing-move-left": "جابه‌جایی طراحی به چپ",
37
- "drawing-move-right": "جابه‌جایی طراحی به راست",
38
- "drawing-delete": "حذف طراحی"
39
- }
40
- },
41
31
  "cell-image": {
42
32
  pasteTitle: "چسباندن به عنوان تصویر سلول",
43
33
  pasteContent: "چسباندن تصویر سلول محتوای موجود سلول را پاک خواهد کرد، ادامه چسباندن",
@@ -28,16 +28,6 @@ const e = {
28
28
  exceedMaxCount: "Seulement {0} images peuvent être téléchargées à la fois",
29
29
  invalidImage: "Image invalide"
30
30
  },
31
- "sheet-drawing-view": "Dessin",
32
- shortcut: {
33
- sheet: {
34
- "drawing-move-down": "Déplacer le dessin vers le bas",
35
- "drawing-move-up": "Déplacer le dessin vers le haut",
36
- "drawing-move-left": "Déplacer le dessin vers la gauche",
37
- "drawing-move-right": "Déplacer le dessin vers la droite",
38
- "drawing-delete": "Supprimer le dessin"
39
- }
40
- },
41
31
  "cell-image": {
42
32
  pasteTitle: "Coller comme image de cellule",
43
33
  pasteContent: "Coller une image de cellule écrasera le contenu existant de la cellule, continuer le collage",
@@ -28,16 +28,6 @@ const e = {
28
28
  exceedMaxCount: "За один раз можно загрузить только {0} изображений",
29
29
  invalidImage: "Недопустимое изображение"
30
30
  },
31
- "sheet-drawing-view": "Drawing",
32
- shortcut: {
33
- sheet: {
34
- "drawing-move-down": "Move Drawing down",
35
- "drawing-move-up": "Move Drawing up",
36
- "drawing-move-left": "Move Drawing left",
37
- "drawing-move-right": "Move Drawing right",
38
- "drawing-delete": "Delete Drawing"
39
- }
40
- },
41
31
  "cell-image": {
42
32
  pasteTitle: "Вставить как изображение ячейки",
43
33
  pasteContent: "Вставка изображения ячейки перезапишет существующее содержимое ячейки, продолжить вставку",
@@ -1,4 +1,4 @@
1
- const n = {
1
+ const h = {
2
2
  sheetImage: {
3
3
  title: "Hình ảnh",
4
4
  upload: {
@@ -28,16 +28,6 @@ const n = {
28
28
  exceedMaxCount: "Chỉ có thể tải lên {0} hình ảnh một lần",
29
29
  invalidImage: "Hình ảnh không hợp lệ"
30
30
  },
31
- "sheet-drawing-view": "Drawing",
32
- shortcut: {
33
- sheet: {
34
- "drawing-move-down": "Move Drawing down",
35
- "drawing-move-up": "Move Drawing up",
36
- "drawing-move-left": "Move Drawing left",
37
- "drawing-move-right": "Move Drawing right",
38
- "drawing-delete": "Delete Drawing"
39
- }
40
- },
41
31
  "cell-image": {
42
32
  pasteTitle: "Dán như hình ảnh ô",
43
33
  pasteContent: "Dán hình ảnh ô sẽ ghi đè lên nội dung hiện có của ô, tiếp tục dán",
@@ -45,5 +35,5 @@ const n = {
45
35
  }
46
36
  };
47
37
  export {
48
- n as default
38
+ h as default
49
39
  };
@@ -28,16 +28,6 @@ const e = {
28
28
  exceedMaxCount: "图片只能一次上传{0}张",
29
29
  invalidImage: "无效图片"
30
30
  },
31
- "sheet-drawing-view": "绘图",
32
- shortcut: {
33
- sheet: {
34
- "drawing-move-down": "下移绘图",
35
- "drawing-move-up": "上移绘图",
36
- "drawing-move-left": "左移绘图",
37
- "drawing-move-right": "右移绘图",
38
- "drawing-delete": "删除绘图"
39
- }
40
- },
41
31
  "cell-image": {
42
32
  pasteTitle: "粘贴为单元格图片",
43
33
  pasteContent: "粘贴单元格图片将覆盖单元格中的现有内容,继续粘贴",
@@ -28,16 +28,6 @@ const e = {
28
28
  exceedMaxCount: "圖片只能一次上傳{0}張",
29
29
  invalidImage: "無效圖片"
30
30
  },
31
- "sheet-drawing-view": "繪圖",
32
- shortcut: {
33
- sheet: {
34
- "drawing-move-down": "下移繪圖",
35
- "drawing-move-up": "上移繪圖",
36
- "drawing-move-left": "左移繪圖",
37
- "drawing-move-right": "右移繪圖",
38
- "drawing-delete": "刪除繪圖"
39
- }
40
- },
41
31
  "cell-image": {
42
32
  pasteTitle: "粘貼為儲存格圖片",
43
33
  pasteContent: "粘貼儲存格圖片將覆蓋儲存格中的現有內容,繼續粘貼",
@@ -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
  }
@@ -43,16 +43,6 @@ declare const locale: {
43
43
  exceedMaxCount: string;
44
44
  invalidImage: string;
45
45
  };
46
- 'sheet-drawing-view': string;
47
- shortcut: {
48
- sheet: {
49
- 'drawing-move-down': string;
50
- 'drawing-move-up': string;
51
- 'drawing-move-left': string;
52
- 'drawing-move-right': string;
53
- 'drawing-delete': string;
54
- };
55
- };
56
46
  'cell-image': {
57
47
  pasteTitle: string;
58
48
  pasteContent: string;
@@ -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,16 @@
1
+ import { Worksheet } from '@univerjs/core';
2
+ import { Scene, SpreadsheetSkeleton } from '@univerjs/engine-render';
3
+ import { IFloatDomData } from '@univerjs/sheets-drawing';
4
+ import { IFloatDom, IFloatDomLayout } from '@univerjs/ui';
5
+ export interface IPrintingFloatDomProps {
6
+ floatDomInfos: IFloatDomData[];
7
+ scene: Scene;
8
+ skeleton: SpreadsheetSkeleton;
9
+ worksheet: Worksheet;
10
+ }
11
+ export declare const FloatDomSingle: import('react').MemoExoticComponent<(props: {
12
+ layer: IFloatDom;
13
+ id: string;
14
+ position: IFloatDomLayout;
15
+ }) => import("react/jsx-runtime").JSX.Element | null>;
16
+ export declare const PrintingFloatDom: (props: IPrintingFloatDomProps) => import("react/jsx-runtime").JSX.Element;