@univerjs/sheets-drawing-ui 1.0.3 → 1.1.0
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.
- package/lib/cjs/facade.js +18 -43
- package/lib/cjs/index.js +510 -67
- package/lib/cjs/locale/ar-SA.js +1 -0
- package/lib/cjs/locale/ca-ES.js +1 -0
- package/lib/cjs/locale/de-DE.js +1 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/es-ES.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/fr-FR.js +1 -0
- package/lib/cjs/locale/id-ID.js +1 -0
- package/lib/cjs/locale/it-IT.js +1 -0
- package/lib/cjs/locale/ja-JP.js +1 -0
- package/lib/cjs/locale/ko-KR.js +1 -0
- package/lib/cjs/locale/pl-PL.js +1 -0
- package/lib/cjs/locale/pt-BR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-HK.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +18 -43
- package/lib/es/index.js +509 -66
- package/lib/es/locale/ar-SA.js +1 -0
- package/lib/es/locale/ca-ES.js +1 -0
- package/lib/es/locale/de-DE.js +1 -0
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/es-ES.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/fr-FR.js +1 -0
- package/lib/es/locale/id-ID.js +1 -0
- package/lib/es/locale/it-IT.js +1 -0
- package/lib/es/locale/ja-JP.js +1 -0
- package/lib/es/locale/ko-KR.js +1 -0
- package/lib/es/locale/pl-PL.js +1 -0
- package/lib/es/locale/pt-BR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/sk-SK.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-HK.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/facade.js +18 -43
- package/lib/index.css +290 -0
- package/lib/index.js +509 -66
- package/lib/locale/ar-SA.js +1 -0
- package/lib/locale/ca-ES.js +1 -0
- package/lib/locale/de-DE.js +1 -0
- package/lib/locale/en-US.js +1 -0
- package/lib/locale/es-ES.js +1 -0
- package/lib/locale/fa-IR.js +1 -0
- package/lib/locale/fr-FR.js +1 -0
- package/lib/locale/id-ID.js +1 -0
- package/lib/locale/it-IT.js +1 -0
- package/lib/locale/ja-JP.js +1 -0
- package/lib/locale/ko-KR.js +1 -0
- package/lib/locale/pl-PL.js +1 -0
- package/lib/locale/pt-BR.js +1 -0
- package/lib/locale/ru-RU.js +1 -0
- package/lib/locale/sk-SK.js +1 -0
- package/lib/locale/vi-VN.js +1 -0
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-HK.js +1 -0
- package/lib/locale/zh-TW.js +1 -0
- package/lib/types/commands/operations/preview-sheet-image-opacity.operation.d.ts +20 -0
- package/lib/types/controllers/sheet-drawing-active-render.controller.d.ts +7 -2
- package/lib/types/facade/f-worksheet.d.ts +1 -0
- package/lib/types/locale/en-US.d.ts +3 -0
- package/lib/types/services/canvas-float-dom-manager.service.d.ts +2 -0
- package/lib/types/views/sheet-image-panel/SheetImageTransparency.d.ts +20 -0
- package/lib/types/views/sheet-image-panel/SheetImageTransparencySlider.d.ts +24 -0
- package/lib/types/views/sheet-image-panel/sheet-drawing-panel.util.d.ts +18 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +16 -16
package/lib/cjs/facade.js
CHANGED
|
@@ -13,16 +13,23 @@ let _univerjs_engine_render = require("@univerjs/engine-render");
|
|
|
13
13
|
var FWorksheetDrawingUIMixin = class extends _univerjs_sheets_facade.FWorksheet {
|
|
14
14
|
getFloatDomById(id) {
|
|
15
15
|
const info = this._injector.get(_univerjs_sheets_drawing_ui.SheetCanvasFloatDomManagerService).getFloatDomInfo(id);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
16
|
+
return info ? this._getFloatDomResult(info) : null;
|
|
17
|
+
}
|
|
18
|
+
getAllFloatDoms() {
|
|
19
|
+
const floatDomService = this._injector.get(_univerjs_sheets_drawing_ui.SheetCanvasFloatDomManagerService);
|
|
20
|
+
const unitId = this._workbook.getUnitId();
|
|
21
|
+
const subUnitId = this._worksheet.getSheetId();
|
|
22
|
+
return floatDomService.getFloatDomsBySubUnitId(unitId, subUnitId).map((info) => this._getFloatDomResult(info)).filter((dom) => dom != null);
|
|
23
|
+
}
|
|
24
|
+
_getFloatDomResult(info) {
|
|
25
|
+
const { unitId, subUnitId, id, rect, runtimeMetadata } = info;
|
|
26
|
+
const metadata = runtimeMetadata ?? this._injector.get(_univerjs_sheets_drawing.ISheetDrawingService).getDrawingByParam({
|
|
27
|
+
drawingId: id,
|
|
22
28
|
unitId,
|
|
23
29
|
subUnitId
|
|
24
30
|
});
|
|
25
|
-
if (!
|
|
31
|
+
if (!metadata) return null;
|
|
32
|
+
const { left = 0, top = 0, width = 0, height = 0, flipX = false, flipY = false, angle = 0, skewX = 0, skewY = 0 } = rect.getState();
|
|
26
33
|
return {
|
|
27
34
|
position: {
|
|
28
35
|
left,
|
|
@@ -35,44 +42,12 @@ var FWorksheetDrawingUIMixin = class extends _univerjs_sheets_facade.FWorksheet
|
|
|
35
42
|
skewX,
|
|
36
43
|
skewY
|
|
37
44
|
},
|
|
38
|
-
componentKey:
|
|
39
|
-
allowTransform:
|
|
40
|
-
data:
|
|
41
|
-
id
|
|
45
|
+
componentKey: metadata.componentKey,
|
|
46
|
+
allowTransform: metadata.allowTransform,
|
|
47
|
+
data: metadata.data,
|
|
48
|
+
id
|
|
42
49
|
};
|
|
43
50
|
}
|
|
44
|
-
getAllFloatDoms() {
|
|
45
|
-
const floatDomService = this._injector.get(_univerjs_sheets_drawing_ui.SheetCanvasFloatDomManagerService);
|
|
46
|
-
const unitId = this._workbook.getUnitId();
|
|
47
|
-
const subUnitId = this._worksheet.getSheetId();
|
|
48
|
-
return Array.from(floatDomService.getFloatDomsBySubUnitId(unitId, subUnitId).values()).map((info) => {
|
|
49
|
-
const { rect } = info;
|
|
50
|
-
const drawingParm = this._injector.get(_univerjs_sheets_drawing.ISheetDrawingService).getDrawingByParam({
|
|
51
|
-
drawingId: info.id,
|
|
52
|
-
unitId,
|
|
53
|
-
subUnitId
|
|
54
|
-
});
|
|
55
|
-
if (!drawingParm) return null;
|
|
56
|
-
const { left, top, width, height, flipX, flipY, angle, skewX, skewY } = rect.getState();
|
|
57
|
-
return {
|
|
58
|
-
position: {
|
|
59
|
-
left,
|
|
60
|
-
top,
|
|
61
|
-
width,
|
|
62
|
-
height,
|
|
63
|
-
flipX,
|
|
64
|
-
flipY,
|
|
65
|
-
angle,
|
|
66
|
-
skewX,
|
|
67
|
-
skewY
|
|
68
|
-
},
|
|
69
|
-
componentKey: drawingParm.componentKey,
|
|
70
|
-
allowTransform: drawingParm.allowTransform,
|
|
71
|
-
data: drawingParm.data,
|
|
72
|
-
id: info.id
|
|
73
|
-
};
|
|
74
|
-
}).filter((dom) => dom != null);
|
|
75
|
-
}
|
|
76
51
|
updateFloatDom(id, config) {
|
|
77
52
|
const sheetSkeletonService = this._injector.get(_univerjs_sheets.SheetSkeletonService);
|
|
78
53
|
const info = this._injector.get(_univerjs_sheets_drawing_ui.SheetCanvasFloatDomManagerService).getFloatDomInfo(id);
|