@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.
Files changed (94) hide show
  1. package/lib/cjs/facade.js +18 -43
  2. package/lib/cjs/index.js +510 -67
  3. package/lib/cjs/locale/ar-SA.js +1 -0
  4. package/lib/cjs/locale/ca-ES.js +1 -0
  5. package/lib/cjs/locale/de-DE.js +1 -0
  6. package/lib/cjs/locale/en-US.js +1 -0
  7. package/lib/cjs/locale/es-ES.js +1 -0
  8. package/lib/cjs/locale/fa-IR.js +1 -0
  9. package/lib/cjs/locale/fr-FR.js +1 -0
  10. package/lib/cjs/locale/id-ID.js +1 -0
  11. package/lib/cjs/locale/it-IT.js +1 -0
  12. package/lib/cjs/locale/ja-JP.js +1 -0
  13. package/lib/cjs/locale/ko-KR.js +1 -0
  14. package/lib/cjs/locale/pl-PL.js +1 -0
  15. package/lib/cjs/locale/pt-BR.js +1 -0
  16. package/lib/cjs/locale/ru-RU.js +1 -0
  17. package/lib/cjs/locale/sk-SK.js +1 -0
  18. package/lib/cjs/locale/vi-VN.js +1 -0
  19. package/lib/cjs/locale/zh-CN.js +1 -0
  20. package/lib/cjs/locale/zh-HK.js +1 -0
  21. package/lib/cjs/locale/zh-TW.js +1 -0
  22. package/lib/es/facade.js +18 -43
  23. package/lib/es/index.js +509 -66
  24. package/lib/es/locale/ar-SA.js +1 -0
  25. package/lib/es/locale/ca-ES.js +1 -0
  26. package/lib/es/locale/de-DE.js +1 -0
  27. package/lib/es/locale/en-US.js +1 -0
  28. package/lib/es/locale/es-ES.js +1 -0
  29. package/lib/es/locale/fa-IR.js +1 -0
  30. package/lib/es/locale/fr-FR.js +1 -0
  31. package/lib/es/locale/id-ID.js +1 -0
  32. package/lib/es/locale/it-IT.js +1 -0
  33. package/lib/es/locale/ja-JP.js +1 -0
  34. package/lib/es/locale/ko-KR.js +1 -0
  35. package/lib/es/locale/pl-PL.js +1 -0
  36. package/lib/es/locale/pt-BR.js +1 -0
  37. package/lib/es/locale/ru-RU.js +1 -0
  38. package/lib/es/locale/sk-SK.js +1 -0
  39. package/lib/es/locale/vi-VN.js +1 -0
  40. package/lib/es/locale/zh-CN.js +1 -0
  41. package/lib/es/locale/zh-HK.js +1 -0
  42. package/lib/es/locale/zh-TW.js +1 -0
  43. package/lib/facade.js +18 -43
  44. package/lib/index.css +290 -0
  45. package/lib/index.js +509 -66
  46. package/lib/locale/ar-SA.js +1 -0
  47. package/lib/locale/ca-ES.js +1 -0
  48. package/lib/locale/de-DE.js +1 -0
  49. package/lib/locale/en-US.js +1 -0
  50. package/lib/locale/es-ES.js +1 -0
  51. package/lib/locale/fa-IR.js +1 -0
  52. package/lib/locale/fr-FR.js +1 -0
  53. package/lib/locale/id-ID.js +1 -0
  54. package/lib/locale/it-IT.js +1 -0
  55. package/lib/locale/ja-JP.js +1 -0
  56. package/lib/locale/ko-KR.js +1 -0
  57. package/lib/locale/pl-PL.js +1 -0
  58. package/lib/locale/pt-BR.js +1 -0
  59. package/lib/locale/ru-RU.js +1 -0
  60. package/lib/locale/sk-SK.js +1 -0
  61. package/lib/locale/vi-VN.js +1 -0
  62. package/lib/locale/zh-CN.js +1 -0
  63. package/lib/locale/zh-HK.js +1 -0
  64. package/lib/locale/zh-TW.js +1 -0
  65. package/lib/types/commands/operations/preview-sheet-image-opacity.operation.d.ts +20 -0
  66. package/lib/types/controllers/sheet-drawing-active-render.controller.d.ts +7 -2
  67. package/lib/types/facade/f-worksheet.d.ts +1 -0
  68. package/lib/types/locale/en-US.d.ts +3 -0
  69. package/lib/types/services/canvas-float-dom-manager.service.d.ts +2 -0
  70. package/lib/types/views/sheet-image-panel/SheetImageTransparency.d.ts +20 -0
  71. package/lib/types/views/sheet-image-panel/SheetImageTransparencySlider.d.ts +24 -0
  72. package/lib/types/views/sheet-image-panel/sheet-drawing-panel.util.d.ts +18 -0
  73. package/lib/umd/facade.js +1 -1
  74. package/lib/umd/index.js +2 -2
  75. package/lib/umd/locale/ar-SA.js +1 -1
  76. package/lib/umd/locale/ca-ES.js +1 -1
  77. package/lib/umd/locale/de-DE.js +1 -1
  78. package/lib/umd/locale/en-US.js +1 -1
  79. package/lib/umd/locale/es-ES.js +1 -1
  80. package/lib/umd/locale/fa-IR.js +1 -1
  81. package/lib/umd/locale/fr-FR.js +1 -1
  82. package/lib/umd/locale/id-ID.js +1 -1
  83. package/lib/umd/locale/it-IT.js +1 -1
  84. package/lib/umd/locale/ja-JP.js +1 -1
  85. package/lib/umd/locale/ko-KR.js +1 -1
  86. package/lib/umd/locale/pl-PL.js +1 -1
  87. package/lib/umd/locale/pt-BR.js +1 -1
  88. package/lib/umd/locale/ru-RU.js +1 -1
  89. package/lib/umd/locale/sk-SK.js +1 -1
  90. package/lib/umd/locale/vi-VN.js +1 -1
  91. package/lib/umd/locale/zh-CN.js +1 -1
  92. package/lib/umd/locale/zh-HK.js +1 -1
  93. package/lib/umd/locale/zh-TW.js +1 -1
  94. 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
- if (!info) return null;
17
- const { unitId, subUnitId } = info;
18
- const { rect } = info;
19
- const { left = 0, top = 0, width = 0, height = 0, flipX = false, flipY = false, angle = 0, skewX = 0, skewY = 0 } = rect.getState();
20
- const drawingParm = this._injector.get(_univerjs_sheets_drawing.ISheetDrawingService).getDrawingByParam({
21
- drawingId: info.id,
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 (!drawingParm) return null;
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: drawingParm.componentKey,
39
- allowTransform: drawingParm.allowTransform,
40
- data: drawingParm.data,
41
- id: info.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);