@univerjs/sheets-drawing-ui 0.9.1 → 0.9.2

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/es/facade.js CHANGED
@@ -1,83 +1,83 @@
1
- var V = Object.defineProperty;
2
- var X = (i, e, t) => e in i ? V(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var x = (i, e, t) => X(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as j, Injector as P, ICommandService as W, ImageSourceType as f, ArrangeTypeEnum as w, DrawingTypeEnum as S, generateRandomId as Y, toDisposable as D, CanceledError as v, UniverInstanceType as q, IUniverInstanceService as J } from "@univerjs/core";
5
- import { FBase as Q, FEnum as M, FEventName as H, FUniver as z } from "@univerjs/core/facade";
6
- import { getImageSize as Z, IDrawingManagerService as I, SetDrawingSelectedOperation as F } from "@univerjs/drawing";
7
- import { IRenderManagerService as T, getCurrentTypeOfRenderer as ee } from "@univerjs/engine-render";
8
- import { RemoveSheetDrawingCommand as p, SetSheetDrawingCommand as h, SetDrawingArrangeCommand as _, SheetCanvasFloatDomManagerService as R, InsertSheetDrawingCommand as b, SheetDrawingUpdateController as te } from "@univerjs/sheets-drawing-ui";
9
- import { SheetSkeletonManagerService as A, ISheetSelectionRenderService as ie, convertPositionSheetOverGridToAbsolute as re, convertPositionCellToSheetOverGrid as ne } from "@univerjs/sheets-ui";
10
- import { ISheetDrawingService as l, SheetDrawingAnchorType as se } from "@univerjs/sheets-drawing";
11
- import { transformComponentKey as G } from "@univerjs/sheets-ui/facade";
12
- import { FWorksheet as N, FRange as $ } from "@univerjs/sheets/facade";
13
- import { ComponentManager as B } from "@univerjs/ui";
14
- var oe = Object.getOwnPropertyDescriptor, K = (i, e, t, r) => {
15
- for (var n = r > 1 ? void 0 : r ? oe(e, t) : e, s = i.length - 1, o; s >= 0; s--)
16
- (o = i[s]) && (n = o(n) || n);
17
- return n;
18
- }, U = (i, e) => (t, r) => e(t, r, i);
19
- function ae(i, e) {
20
- const { from: t, to: r, flipY: n = !1, flipX: s = !1, angle: o = 0, skewX: d = 0, skewY: a = 0 } = i.sheetTransform, { column: g, columnOffset: c, row: u, rowOffset: O } = t, E = re(
21
- i.unitId,
22
- i.subUnitId,
23
- { from: t, to: r },
24
- e
25
- ), { width: C, height: y } = E;
1
+ var q = Object.defineProperty;
2
+ var J = (o, r, t) => r in o ? q(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t;
3
+ var P = (o, r, t) => J(o, typeof r != "symbol" ? r + "" : r, t);
4
+ import { Inject as H, Injector as K, ICommandService as N, ImageSourceType as E, ArrangeTypeEnum as C, DrawingTypeEnum as I, generateRandomId as Q, toDisposable as T, CanceledError as S, UniverInstanceType as Z, IUniverInstanceService as ee } from "@univerjs/core";
5
+ import { FBase as te, FEnum as z, FEventName as X, FUniver as Y } from "@univerjs/core/facade";
6
+ import { getImageSize as re, IDrawingManagerService as p, SetDrawingSelectedOperation as W } from "@univerjs/drawing";
7
+ import { IRenderManagerService as y, getCurrentTypeOfRenderer as ie } from "@univerjs/engine-render";
8
+ import { RemoveSheetDrawingCommand as k, SetSheetDrawingCommand as f, SetDrawingArrangeCommand as R, SheetCanvasFloatDomManagerService as D, transformToDrawingPosition as j, InsertSheetDrawingCommand as b, SheetDrawingUpdateController as ne } from "@univerjs/sheets-drawing-ui";
9
+ import { SheetSkeletonManagerService as M, ISheetSelectionRenderService as A, convertPositionSheetOverGridToAbsolute as oe, convertPositionCellToSheetOverGrid as se } from "@univerjs/sheets-ui";
10
+ import { ISheetDrawingService as w, SheetDrawingAnchorType as ae } from "@univerjs/sheets-drawing";
11
+ import { transformComponentKey as U } from "@univerjs/sheets-ui/facade";
12
+ import { FWorksheet as $, FRange as L } from "@univerjs/sheets/facade";
13
+ import { ComponentManager as G } from "@univerjs/ui";
14
+ var de = Object.getOwnPropertyDescriptor, V = (o, r, t, e) => {
15
+ for (var i = e > 1 ? void 0 : e ? de(r, t) : r, n = o.length - 1, s; n >= 0; n--)
16
+ (s = o[n]) && (i = s(i) || i);
17
+ return i;
18
+ }, x = (o, r) => (t, e) => r(t, e, o);
19
+ function ce(o, r) {
20
+ const { from: t, to: e, flipY: i = !1, flipX: n = !1, angle: s = 0, skewX: a = 0, skewY: d = 0 } = o.sheetTransform, { column: g, columnOffset: c, row: m, rowOffset: l } = t, _ = oe(
21
+ o.unitId,
22
+ o.subUnitId,
23
+ { from: t, to: e },
24
+ r
25
+ ), { width: h, height: u } = _;
26
26
  return {
27
- ...i,
27
+ ...o,
28
28
  column: g,
29
29
  columnOffset: c,
30
- row: u,
31
- rowOffset: O,
32
- width: C,
33
- height: y,
34
- flipY: n,
35
- flipX: s,
36
- angle: o,
37
- skewX: d,
38
- skewY: a
30
+ row: m,
31
+ rowOffset: l,
32
+ width: h,
33
+ height: u,
34
+ flipY: i,
35
+ flipX: n,
36
+ angle: s,
37
+ skewX: a,
38
+ skewY: d
39
39
  };
40
40
  }
41
- function de(i, e, t) {
42
- const { column: r, columnOffset: n, row: s, rowOffset: o, flipY: d = !1, flipX: a = !1, angle: g = 0, skewX: c = 0, skewY: u = 0, width: O, height: E } = i, C = ne(
43
- i.unitId,
44
- i.subUnitId,
45
- { column: r, columnOffset: n, row: s, rowOffset: o },
46
- O,
47
- E,
48
- e,
41
+ function ge(o, r, t) {
42
+ const { column: e, columnOffset: i, row: n, rowOffset: s, flipY: a = !1, flipX: d = !1, angle: g = 0, skewX: c = 0, skewY: m = 0, width: l, height: _ } = o, h = se(
43
+ o.unitId,
44
+ o.subUnitId,
45
+ { column: e, columnOffset: i, row: n, rowOffset: s },
46
+ l,
47
+ _,
48
+ r,
49
49
  t
50
- ), { sheetTransform: y, transform: L } = C;
50
+ ), { sheetTransform: u, transform: B } = h;
51
51
  return {
52
- ...i,
52
+ ...o,
53
53
  sheetTransform: {
54
- ...y,
55
- flipY: d,
56
- flipX: a,
54
+ ...u,
55
+ flipY: a,
56
+ flipX: d,
57
57
  angle: g,
58
58
  skewX: c,
59
- skewY: u
59
+ skewY: m
60
60
  },
61
61
  transform: {
62
- ...L,
63
- flipY: d,
64
- flipX: a,
62
+ ...B,
63
+ flipY: a,
64
+ flipX: d,
65
65
  angle: g,
66
66
  skewX: c,
67
- skewY: u
67
+ skewY: m
68
68
  }
69
69
  };
70
70
  }
71
- let k = class {
72
- constructor(i, e, t) {
73
- x(this, "_image");
71
+ let F = class {
72
+ constructor(o, r, t) {
73
+ P(this, "_image");
74
74
  this._injector = t, this._image = {
75
- drawingId: Y(6),
76
- drawingType: S.DRAWING_IMAGE,
77
- imageSourceType: f.BASE64,
75
+ drawingId: Q(6),
76
+ drawingType: I.DRAWING_IMAGE,
77
+ imageSourceType: E.BASE64,
78
78
  source: "",
79
- unitId: i,
80
- subUnitId: e,
79
+ unitId: o,
80
+ subUnitId: r,
81
81
  column: 0,
82
82
  columnOffset: 0,
83
83
  row: 0,
@@ -111,12 +111,12 @@ let k = class {
111
111
  * fWorksheet.insertImages([image]);
112
112
  * ```
113
113
  */
114
- setImage(i) {
115
- const t = this._injector.get(T).getRenderById(i.unitId);
114
+ setImage(o) {
115
+ const t = this._injector.get(y).getRenderById(o.unitId);
116
116
  if (!t)
117
- throw new Error(`Render Unit with unitId ${i.unitId} not found`);
118
- const r = t.with(A);
119
- return i.sheetTransform == null && (i.sheetTransform = {
117
+ throw new Error(`Render Unit with unitId ${o.unitId} not found`);
118
+ const e = t.with(M);
119
+ return o.sheetTransform == null && (o.sheetTransform = {
120
120
  from: {
121
121
  column: 0,
122
122
  columnOffset: 0,
@@ -129,11 +129,11 @@ let k = class {
129
129
  row: 0,
130
130
  rowOffset: 0
131
131
  }
132
- }), this._image = ae(i, r), this;
132
+ }), this._image = ce(o, e), this;
133
133
  }
134
- setSource(i, e) {
135
- const t = e != null ? e : f.URL;
136
- return this._image.source = i, this._image.imageSourceType = t, this;
134
+ setSource(o, r) {
135
+ const t = r != null ? r : E.URL;
136
+ return this._image.source = o, this._image.imageSourceType = t, this;
137
137
  }
138
138
  /**
139
139
  * Get the source of the image
@@ -185,8 +185,8 @@ let k = class {
185
185
  * fWorksheet.insertImages([image]);
186
186
  * ```
187
187
  */
188
- setColumn(i) {
189
- return this._image.column = i, this;
188
+ setColumn(o) {
189
+ return this._image.column = o, this;
190
190
  }
191
191
  /**
192
192
  * Set the vertical position of the image
@@ -206,8 +206,8 @@ let k = class {
206
206
  * fWorksheet.insertImages([image]);
207
207
  * ```
208
208
  */
209
- setRow(i) {
210
- return this._image.row = i, this;
209
+ setRow(o) {
210
+ return this._image.row = o, this;
211
211
  }
212
212
  /**
213
213
  * Set the horizontal offset of the image
@@ -228,8 +228,8 @@ let k = class {
228
228
  * fWorksheet.insertImages([image]);
229
229
  * ```
230
230
  */
231
- setColumnOffset(i) {
232
- return this._image.columnOffset = i, this;
231
+ setColumnOffset(o) {
232
+ return this._image.columnOffset = o, this;
233
233
  }
234
234
  /**
235
235
  * Set the vertical offset of the image
@@ -250,8 +250,8 @@ let k = class {
250
250
  * fWorksheet.insertImages([image]);
251
251
  * ```
252
252
  */
253
- setRowOffset(i) {
254
- return this._image.rowOffset = i, this;
253
+ setRowOffset(o) {
254
+ return this._image.rowOffset = o, this;
255
255
  }
256
256
  /**
257
257
  * Set the width of the image
@@ -273,8 +273,8 @@ let k = class {
273
273
  * fWorksheet.insertImages([image]);
274
274
  * ```
275
275
  */
276
- setWidth(i) {
277
- return this._image.width = i, this;
276
+ setWidth(o) {
277
+ return this._image.width = o, this;
278
278
  }
279
279
  /**
280
280
  * Set the height of the image
@@ -296,8 +296,8 @@ let k = class {
296
296
  * fWorksheet.insertImages([image]);
297
297
  * ```
298
298
  */
299
- setHeight(i) {
300
- return this._image.height = i, this;
299
+ setHeight(o) {
300
+ return this._image.height = o, this;
301
301
  }
302
302
  /**
303
303
  * Set the anchor type of the image, whether the position and size change with the cell
@@ -345,8 +345,8 @@ let k = class {
345
345
  * }, 2000);
346
346
  * ```
347
347
  */
348
- setAnchorType(i) {
349
- return this._image.anchorType = i, this;
348
+ setAnchorType(o) {
349
+ return this._image.anchorType = o, this;
350
350
  }
351
351
  /**
352
352
  * Set the cropping region of the image by defining the top edges, thereby displaying the specific part of the image you want.
@@ -367,8 +367,8 @@ let k = class {
367
367
  * fWorksheet.insertImages([image]);
368
368
  * ```
369
369
  */
370
- setCropTop(i) {
371
- return this._initializeSrcRect(), this._image.srcRect.top = i, this;
370
+ setCropTop(o) {
371
+ return this._initializeSrcRect(), this._image.srcRect.top = o, this;
372
372
  }
373
373
  /**
374
374
  * Set the cropping region of the image by defining the left edges, thereby displaying the specific part of the image you want.
@@ -389,8 +389,8 @@ let k = class {
389
389
  * fWorksheet.insertImages([image]);
390
390
  * ```
391
391
  */
392
- setCropLeft(i) {
393
- return this._initializeSrcRect(), this._image.srcRect.left = i, this;
392
+ setCropLeft(o) {
393
+ return this._initializeSrcRect(), this._image.srcRect.left = o, this;
394
394
  }
395
395
  /**
396
396
  * Set the cropping region of the image by defining the bottom edges, thereby displaying the specific part of the image you want.
@@ -411,8 +411,8 @@ let k = class {
411
411
  * fWorksheet.insertImages([image]);
412
412
  * ```
413
413
  */
414
- setCropBottom(i) {
415
- return this._initializeSrcRect(), this._image.srcRect.bottom = i, this;
414
+ setCropBottom(o) {
415
+ return this._initializeSrcRect(), this._image.srcRect.bottom = o, this;
416
416
  }
417
417
  /**
418
418
  * Set the cropping region of the image by defining the right edges, thereby displaying the specific part of the image you want.
@@ -433,8 +433,8 @@ let k = class {
433
433
  * fWorksheet.insertImages([image]);
434
434
  * ```
435
435
  */
436
- setCropRight(i) {
437
- return this._initializeSrcRect(), this._image.srcRect.right = i, this;
436
+ setCropRight(o) {
437
+ return this._initializeSrcRect(), this._image.srcRect.right = o, this;
438
438
  }
439
439
  _initializeSrcRect() {
440
440
  this._image.srcRect == null && (this._image.srcRect = {
@@ -463,33 +463,33 @@ let k = class {
463
463
  * fWorksheet.insertImages([image]);
464
464
  * ```
465
465
  */
466
- setRotate(i) {
467
- return this._image.angle = i, this;
466
+ setRotate(o) {
467
+ return this._image.angle = o, this;
468
468
  }
469
- setUnitId(i) {
470
- return this._image.unitId = i, this;
469
+ setUnitId(o) {
470
+ return this._image.unitId = o, this;
471
471
  }
472
- setSubUnitId(i) {
473
- return this._image.subUnitId = i, this;
472
+ setSubUnitId(o) {
473
+ return this._image.subUnitId = o, this;
474
474
  }
475
475
  async buildAsync() {
476
- const e = this._injector.get(T).getRenderById(this._image.unitId);
477
- if (!e)
476
+ const r = this._injector.get(y).getRenderById(this._image.unitId);
477
+ if (!r)
478
478
  throw new Error(`Render Unit with unitId ${this._image.unitId} not found`);
479
- const t = e.with(ie), r = e.with(A);
479
+ const t = r.with(A), e = r.with(M);
480
480
  if (this._image.width === 0 || this._image.height === 0) {
481
- const n = await Z(this._image.source), s = n.width, o = n.height;
482
- this._image.width === 0 && (this._image.width = s), this._image.height === 0 && (this._image.height = o);
481
+ const i = await re(this._image.source), n = i.width, s = i.height;
482
+ this._image.width === 0 && (this._image.width = n), this._image.height === 0 && (this._image.height = s);
483
483
  }
484
- return de(this._image, t, r);
484
+ return ge(this._image, t, e);
485
485
  }
486
486
  };
487
- k = K([
488
- U(2, j(P))
489
- ], k);
490
- let m = class extends Q {
491
- constructor(i, e, t) {
492
- super(), this._image = i, this._commandService = e, this._injector = t;
487
+ F = V([
488
+ x(2, H(K))
489
+ ], F);
490
+ let v = class extends te {
491
+ constructor(o, r, t) {
492
+ super(), this._image = o, this._commandService = r, this._injector = t;
493
493
  }
494
494
  /**
495
495
  * Get the id of the image
@@ -536,7 +536,7 @@ let m = class extends Q {
536
536
  * ```
537
537
  */
538
538
  remove() {
539
- return this._commandService.syncExecuteCommand(p.id, { unitId: this._image.unitId, drawings: [this._image] });
539
+ return this._commandService.syncExecuteCommand(k.id, { unitId: this._image.unitId, drawings: [this._image] });
540
540
  }
541
541
  /**
542
542
  * Convert the image to a FOverGridImageBuilder
@@ -552,18 +552,18 @@ let m = class extends Q {
552
552
  * ```
553
553
  */
554
554
  toBuilder() {
555
- const i = this._injector.createInstance(k);
556
- return i.setImage(this._image), i;
555
+ const o = this._injector.createInstance(F);
556
+ return o.setImage(this._image), o;
557
557
  }
558
- setSource(i, e) {
559
- const t = e != null ? e : f.URL;
560
- return this._image.source = i, this._image.imageSourceType = t, this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
558
+ setSource(o, r) {
559
+ const t = r != null ? r : E.URL;
560
+ return this._image.source = o, this._image.imageSourceType = t, this._commandService.syncExecuteCommand(f.id, { unitId: this._image.unitId, drawings: [this._image] });
561
561
  }
562
- async setPositionAsync(i, e, t, r) {
563
- const n = this.toBuilder();
564
- n.setColumn(e), n.setRow(i), t != null && n.setRowOffset(t), r != null && n.setColumnOffset(r);
565
- const s = await n.buildAsync();
566
- return this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [s] });
562
+ async setPositionAsync(o, r, t, e) {
563
+ const i = this.toBuilder();
564
+ i.setColumn(r), i.setRow(o), t != null && i.setRowOffset(t), e != null && i.setColumnOffset(e);
565
+ const n = await i.buildAsync();
566
+ return this._commandService.syncExecuteCommand(f.id, { unitId: this._image.unitId, drawings: [n] });
567
567
  }
568
568
  /**
569
569
  * Set the size of the image
@@ -580,11 +580,11 @@ let m = class extends Q {
580
580
  * console.log(result);
581
581
  * ```
582
582
  */
583
- async setSizeAsync(i, e) {
583
+ async setSizeAsync(o, r) {
584
584
  const t = this.toBuilder();
585
- t.setWidth(i), t.setHeight(e);
586
- const r = await t.buildAsync();
587
- return this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [r] });
585
+ t.setWidth(o), t.setHeight(r);
586
+ const e = await t.buildAsync();
587
+ return this._commandService.syncExecuteCommand(f.id, { unitId: this._image.unitId, drawings: [e] });
588
588
  }
589
589
  /**
590
590
  * Set the cropping region of the image by defining the top, bottom, left, and right edges, thereby displaying the specific part of the image you want.
@@ -603,13 +603,13 @@ let m = class extends Q {
603
603
  * console.log(result);
604
604
  * ```
605
605
  */
606
- setCrop(i, e, t, r) {
606
+ setCrop(o, r, t, e) {
607
607
  return this._image.srcRect == null && (this._image.srcRect = {
608
608
  top: 0,
609
609
  left: 0,
610
610
  bottom: 0,
611
611
  right: 0
612
- }), i != null && (this._image.srcRect.top = i), e != null && (this._image.srcRect.left = e), t != null && (this._image.srcRect.bottom = t), r != null && (this._image.srcRect.right = r), this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
612
+ }), o != null && (this._image.srcRect.top = o), r != null && (this._image.srcRect.left = r), t != null && (this._image.srcRect.bottom = t), e != null && (this._image.srcRect.right = e), this._commandService.syncExecuteCommand(f.id, { unitId: this._image.unitId, drawings: [this._image] });
613
613
  }
614
614
  /**
615
615
  * Set the rotation angle of the image
@@ -625,8 +625,8 @@ let m = class extends Q {
625
625
  * console.log(result);
626
626
  * ```
627
627
  */
628
- setRotate(i) {
629
- return this._image.sheetTransform.angle = i, this._image.transform && (this._image.transform.angle = i), this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
628
+ setRotate(o) {
629
+ return this._image.sheetTransform.angle = o, this._image.transform && (this._image.transform.angle = o), this._commandService.syncExecuteCommand(f.id, { unitId: this._image.unitId, drawings: [this._image] });
630
630
  }
631
631
  /**
632
632
  * Move the image layer forward by one level
@@ -641,11 +641,11 @@ let m = class extends Q {
641
641
  * ```
642
642
  */
643
643
  setForward() {
644
- return this._commandService.syncExecuteCommand(_.id, {
644
+ return this._commandService.syncExecuteCommand(R.id, {
645
645
  unitId: this._image.unitId,
646
646
  subUnitId: this._image.subUnitId,
647
647
  drawingIds: [this._image.drawingId],
648
- arrangeType: w.forward
648
+ arrangeType: C.forward
649
649
  });
650
650
  }
651
651
  /**
@@ -661,11 +661,11 @@ let m = class extends Q {
661
661
  * ```
662
662
  */
663
663
  setBackward() {
664
- return this._commandService.syncExecuteCommand(_.id, {
664
+ return this._commandService.syncExecuteCommand(R.id, {
665
665
  unitId: this._image.unitId,
666
666
  subUnitId: this._image.subUnitId,
667
667
  drawingIds: [this._image.drawingId],
668
- arrangeType: w.backward
668
+ arrangeType: C.backward
669
669
  });
670
670
  }
671
671
  /**
@@ -681,11 +681,11 @@ let m = class extends Q {
681
681
  * ```
682
682
  */
683
683
  setBack() {
684
- return this._commandService.syncExecuteCommand(_.id, {
684
+ return this._commandService.syncExecuteCommand(R.id, {
685
685
  unitId: this._image.unitId,
686
686
  subUnitId: this._image.subUnitId,
687
687
  drawingIds: [this._image.drawingId],
688
- arrangeType: w.back
688
+ arrangeType: C.back
689
689
  });
690
690
  }
691
691
  /**
@@ -701,140 +701,299 @@ let m = class extends Q {
701
701
  * ```
702
702
  */
703
703
  setFront() {
704
- return this._commandService.syncExecuteCommand(_.id, {
704
+ return this._commandService.syncExecuteCommand(R.id, {
705
705
  unitId: this._image.unitId,
706
706
  subUnitId: this._image.subUnitId,
707
707
  drawingIds: [this._image.drawingId],
708
- arrangeType: w.front
708
+ arrangeType: C.front
709
709
  });
710
710
  }
711
711
  };
712
- m = K([
713
- U(1, W),
714
- U(2, j(P))
715
- ], m);
716
- class ce extends N {
717
- addFloatDomToPosition(e, t) {
718
- const r = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), { key: s, disposableCollection: o } = G(e, this._injector.get(B)), a = this._injector.get(R).addFloatDomToPosition({ ...e, componentKey: s, unitId: r, subUnitId: n }, t);
719
- return a ? (o.add(a.dispose), {
720
- id: a.id,
712
+ v = V([
713
+ x(1, N),
714
+ x(2, H(K))
715
+ ], v);
716
+ class me extends $ {
717
+ getFloatDomById(r) {
718
+ const e = this._injector.get(D).getFloatDomInfo(r);
719
+ if (!e) return null;
720
+ const { unitId: i, subUnitId: n } = e, { rect: s } = e, a = s.getState(), { left: d = 0, top: g = 0, width: c = 0, height: m = 0, flipX: l = !1, flipY: _ = !1, angle: h = 0, skewX: u = 0, skewY: B = 0 } = a, O = this._injector.get(w).getDrawingByParam({
721
+ drawingId: e.id,
722
+ unitId: i,
723
+ subUnitId: n
724
+ });
725
+ return O ? {
726
+ position: {
727
+ left: d,
728
+ top: g,
729
+ width: c,
730
+ height: m,
731
+ flipX: l,
732
+ flipY: _,
733
+ angle: h,
734
+ skewX: u,
735
+ skewY: B
736
+ },
737
+ componentKey: O.componentKey,
738
+ allowTransform: O.allowTransform,
739
+ data: O.data,
740
+ id: e.id
741
+ } : null;
742
+ }
743
+ getAllFloatDoms() {
744
+ const r = this._injector.get(D), t = this._workbook.getUnitId(), e = this._worksheet.getSheetId();
745
+ return Array.from(r.getFloatDomsBySubUnitId(t, e).values()).map((i) => {
746
+ const { rect: n } = i, s = this._injector.get(w).getDrawingByParam({
747
+ drawingId: i.id,
748
+ unitId: t,
749
+ subUnitId: e
750
+ }), { left: a, top: d, width: g, height: c, flipX: m, flipY: l, angle: _, skewX: h, skewY: u } = n.getState();
751
+ return {
752
+ position: {
753
+ left: a,
754
+ top: d,
755
+ width: g,
756
+ height: c,
757
+ flipX: m,
758
+ flipY: l,
759
+ angle: _,
760
+ skewX: h,
761
+ skewY: u
762
+ },
763
+ componentKey: s.componentKey,
764
+ allowTransform: s.allowTransform,
765
+ data: s.data,
766
+ id: i.id
767
+ };
768
+ });
769
+ }
770
+ updateFloatDom(r, t) {
771
+ var h, u;
772
+ const i = this._injector.get(D).getFloatDomInfo(r);
773
+ if (!i) return this;
774
+ const { unitId: n, subUnitId: s } = i, a = this._injector.get(w).getDrawingByParam({
775
+ unitId: n,
776
+ subUnitId: s,
777
+ drawingId: r
778
+ }), d = this._injector.get(y);
779
+ if (!d.getRenderById(n)) return this;
780
+ if (!this.getSkeleton()) return this;
781
+ const m = (h = d.getRenderById(this.getWorkbook().getUnitId())) == null ? void 0 : h.with(A);
782
+ if (!m) return this;
783
+ const l = {
784
+ ...a,
785
+ componentKey: t.componentKey || a.componentKey,
786
+ allowTransform: t.allowTransform !== void 0 ? t.allowTransform : a.allowTransform,
787
+ data: t.data || a.data,
788
+ sheetTransform: t.position && (u = j(
789
+ t.position,
790
+ m
791
+ )) != null ? u : a.sheetTransform,
792
+ transform: {
793
+ ...a.transform,
794
+ ...t.position
795
+ // Merge with existing transform
796
+ }
797
+ };
798
+ if (!this._commandService.syncExecuteCommand(f.id, { unitId: n, subUnitId: s, drawings: [l] }))
799
+ throw new Error("updateFloatDom failed");
800
+ return this;
801
+ }
802
+ batchUpdateFloatDoms(r) {
803
+ var s;
804
+ const t = this._injector.get(D), e = this._injector.get(w), i = this._injector.get(y), n = [];
805
+ for (const a of r) {
806
+ const d = t.getFloatDomInfo(a.id);
807
+ if (!d) continue;
808
+ const { unitId: g, subUnitId: c } = d, m = e.getDrawingByParam({
809
+ unitId: g,
810
+ subUnitId: c,
811
+ drawingId: a.id
812
+ });
813
+ if (!m) continue;
814
+ const l = i.getRenderById(g);
815
+ if (!l || !this.getSkeleton()) continue;
816
+ const h = l.with(A);
817
+ if (!h) return this;
818
+ const u = {
819
+ ...m,
820
+ componentKey: a.config.componentKey || m.componentKey,
821
+ allowTransform: a.config.allowTransform !== void 0 ? a.config.allowTransform : m.allowTransform,
822
+ data: a.config.data || m.data,
823
+ sheetTransform: a.config.position && (s = j(
824
+ a.config.position,
825
+ h
826
+ )) != null ? s : m.sheetTransform,
827
+ transform: {
828
+ ...m.transform,
829
+ ...a.config.position
830
+ // Merge with existing transform
831
+ }
832
+ };
833
+ n.push(u);
834
+ }
835
+ if (n.length > 0) {
836
+ const a = this._workbook.getUnitId(), d = this._worksheet.getSheetId();
837
+ if (!this._commandService.syncExecuteCommand(f.id, { unitId: a, subUnitId: d, drawings: n }))
838
+ throw new Error("batchUpdateFloatDoms failed");
839
+ }
840
+ return this;
841
+ }
842
+ removeFloatDom(r) {
843
+ const e = this._injector.get(D).getFloatDomInfo(r);
844
+ if (!e) return this;
845
+ const { unitId: i, subUnitId: n } = e, a = this._injector.get(w).getDrawingByParam({
846
+ unitId: i,
847
+ subUnitId: n,
848
+ drawingId: r
849
+ });
850
+ if (!a) return this;
851
+ if (!this._commandService.syncExecuteCommand(k.id, {
852
+ unitId: i,
853
+ drawings: [a]
854
+ }))
855
+ throw new Error("removeFloatDom failed");
856
+ return this;
857
+ }
858
+ addFloatDomToPosition(r, t) {
859
+ const e = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), { key: n, disposableCollection: s } = U(r, this._injector.get(G)), d = this._injector.get(D).addFloatDomToPosition({ ...r, componentKey: n, unitId: e, subUnitId: i }, t);
860
+ return d ? (s.add(d.dispose), {
861
+ id: d.id,
721
862
  dispose: () => {
722
- o.dispose(), a.dispose();
863
+ s.dispose(), d.dispose();
723
864
  }
724
- }) : (o.dispose(), null);
865
+ }) : (s.dispose(), null);
725
866
  }
726
- addFloatDomToRange(e, t, r, n) {
727
- const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = G(t, this._injector.get(B)), c = this._injector.get(R).addFloatDomToRange(e.getRange(), { ...t, componentKey: d, unitId: s, subUnitId: o }, r, n);
728
- return c ? (a.add(c.dispose), {
867
+ addFloatDomToRange(r, t, e, i) {
868
+ const n = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), { key: a, disposableCollection: d } = U(t, this._injector.get(G)), c = this._injector.get(D).addFloatDomToRange(r.getRange(), { ...t, componentKey: a, unitId: n, subUnitId: s }, e, i);
869
+ return c ? (d.add(c.dispose), {
729
870
  id: c.id,
730
871
  dispose: () => {
731
- a.dispose(), c.dispose();
872
+ d.dispose(), c.dispose();
732
873
  }
733
- }) : (a.dispose(), null);
874
+ }) : (d.dispose(), null);
734
875
  }
735
- addFloatDomToColumnHeader(e, t, r, n) {
736
- const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = G(t, this._injector.get(B)), c = this._injector.get(R).addFloatDomToColumnHeader(e, { ...t, componentKey: d, unitId: s, subUnitId: o }, r, n);
737
- return c ? (a.add(c.dispose), {
876
+ addFloatDomToColumnHeader(r, t, e, i) {
877
+ const n = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), { key: a, disposableCollection: d } = U(t, this._injector.get(G)), c = this._injector.get(D).addFloatDomToColumnHeader(r, { ...t, componentKey: a, unitId: n, subUnitId: s }, e, i);
878
+ return c ? (d.add(c.dispose), {
738
879
  id: c.id,
739
880
  dispose: () => {
740
- a.dispose(), c.dispose();
881
+ d.dispose(), c.dispose();
741
882
  }
742
- }) : (a.dispose(), null);
883
+ }) : (d.dispose(), null);
743
884
  }
744
- async insertImage(e, t, r, n, s) {
745
- const o = this.newOverGridImage();
746
- if (typeof e == "string")
747
- o.setSource(e);
885
+ async insertImage(r, t, e, i, n) {
886
+ const s = this.newOverGridImage();
887
+ if (typeof r == "string")
888
+ s.setSource(r);
748
889
  else {
749
- const g = await e.getBlob().getDataAsString();
750
- o.setSource(g, f.BASE64);
890
+ const g = await r.getBlob().getDataAsString();
891
+ s.setSource(g, E.BASE64);
751
892
  }
752
- t !== void 0 ? o.setColumn(t) : o.setColumn(0), r !== void 0 ? o.setRow(r) : o.setRow(0), n !== void 0 ? o.setColumnOffset(n) : o.setColumnOffset(0), s !== void 0 ? o.setRowOffset(s) : o.setRowOffset(0);
753
- const d = await o.buildAsync();
754
- return this._commandService.syncExecuteCommand(b.id, { unitId: this._fWorkbook.getId(), drawings: [d] });
893
+ t !== void 0 ? s.setColumn(t) : s.setColumn(0), e !== void 0 ? s.setRow(e) : s.setRow(0), i !== void 0 ? s.setColumnOffset(i) : s.setColumnOffset(0), n !== void 0 ? s.setRowOffset(n) : s.setRowOffset(0);
894
+ const a = await s.buildAsync();
895
+ return this._commandService.syncExecuteCommand(b.id, { unitId: this._fWorkbook.getId(), drawings: [a] });
755
896
  }
756
- insertImages(e) {
757
- const t = e.map((r) => (r.unitId = this._fWorkbook.getId(), r.subUnitId = this.getSheetId(), r));
897
+ insertImages(r) {
898
+ const t = r.map((e) => (e.unitId = this._fWorkbook.getId(), e.subUnitId = this.getSheetId(), e));
758
899
  return this._commandService.syncExecuteCommand(b.id, { unitId: this._fWorkbook.getId(), drawings: t }), this;
759
900
  }
760
- deleteImages(e) {
761
- const t = e.map((r) => ({
901
+ deleteImages(r) {
902
+ const t = r.map((e) => ({
762
903
  unitId: this._fWorkbook.getId(),
763
- drawingId: r.getId(),
904
+ drawingId: e.getId(),
764
905
  subUnitId: this.getSheetId(),
765
- drawingType: r.getType()
906
+ drawingType: e.getType()
766
907
  }));
767
- return this._commandService.syncExecuteCommand(p.id, { unitId: this._fWorkbook.getId(), drawings: t }), this;
908
+ return this._commandService.syncExecuteCommand(k.id, { unitId: this._fWorkbook.getId(), drawings: t }), this;
768
909
  }
769
910
  getImages() {
770
- const t = this._injector.get(l).getDrawingData(this._fWorkbook.getId(), this.getSheetId()), r = [];
771
- for (const n in t) {
772
- const s = t[n];
773
- s.drawingType === S.DRAWING_IMAGE && r.push(this._injector.createInstance(m, s));
911
+ const t = this._injector.get(w).getDrawingData(this._fWorkbook.getId(), this.getSheetId()), e = [];
912
+ for (const i in t) {
913
+ const n = t[i];
914
+ n.drawingType === I.DRAWING_IMAGE && e.push(this._injector.createInstance(v, n));
774
915
  }
775
- return r;
916
+ return e;
776
917
  }
777
- getImageById(e) {
778
- const r = this._injector.get(l).getDrawingByParam({ unitId: this._fWorkbook.getId(), subUnitId: this.getSheetId(), drawingId: e });
779
- return r && r.drawingType === S.DRAWING_IMAGE ? this._injector.createInstance(m, r) : null;
918
+ getImageById(r) {
919
+ const e = this._injector.get(w).getDrawingByParam({ unitId: this._fWorkbook.getId(), subUnitId: this.getSheetId(), drawingId: r });
920
+ return e && e.drawingType === I.DRAWING_IMAGE ? this._injector.createInstance(v, e) : null;
780
921
  }
781
922
  getActiveImages() {
782
- const t = this._injector.get(l).getFocusDrawings(), r = [];
783
- for (const n in t) {
784
- const s = t[n];
785
- r.push(this._injector.createInstance(m, s));
923
+ const t = this._injector.get(w).getFocusDrawings(), e = [];
924
+ for (const i in t) {
925
+ const n = t[i];
926
+ e.push(this._injector.createInstance(v, n));
786
927
  }
787
- return r;
928
+ return e;
788
929
  }
789
- updateImages(e) {
790
- return this._commandService.syncExecuteCommand(h.id, { unitId: this._fWorkbook.getId(), drawings: e }), this;
930
+ updateImages(r) {
931
+ return this._commandService.syncExecuteCommand(f.id, { unitId: this._fWorkbook.getId(), drawings: r }), this;
791
932
  }
792
- onImageInserted(e) {
793
- const t = this._injector.get(l);
794
- return D(t.add$.subscribe((r) => {
795
- const n = r.map(
796
- (s) => this._injector.createInstance(m, t.getDrawingByParam(s))
933
+ onImageInserted(r) {
934
+ const t = this._injector.get(w);
935
+ return T(t.add$.subscribe((e) => {
936
+ const i = e.map(
937
+ (n) => this._injector.createInstance(v, t.getDrawingByParam(n))
797
938
  );
798
- e(n);
939
+ r(i);
799
940
  }));
800
941
  }
801
- onImageDeleted(e) {
802
- const t = this._injector.get(l);
803
- return D(t.remove$.subscribe((r) => {
804
- const n = r.map(
805
- (s) => this._injector.createInstance(m, t.getDrawingByParam(s))
942
+ onImageDeleted(r) {
943
+ const t = this._injector.get(w);
944
+ return T(t.remove$.subscribe((e) => {
945
+ const i = e.map(
946
+ (n) => this._injector.createInstance(v, t.getDrawingByParam(n))
806
947
  );
807
- e(n);
948
+ r(i);
808
949
  }));
809
950
  }
810
- onImageChanged(e) {
811
- const t = this._injector.get(l);
812
- return D(t.update$.subscribe((r) => {
813
- const n = r.map(
814
- (s) => this._injector.createInstance(m, t.getDrawingByParam(s))
951
+ onImageChanged(r) {
952
+ const t = this._injector.get(w);
953
+ return T(t.update$.subscribe((e) => {
954
+ const i = e.map(
955
+ (n) => this._injector.createInstance(v, t.getDrawingByParam(n))
815
956
  );
816
- e(n);
957
+ r(i);
817
958
  }));
818
959
  }
819
960
  newOverGridImage() {
820
- const e = this._fWorkbook.getId(), t = this.getSheetId();
821
- return this._injector.createInstance(k, e, t);
961
+ const r = this._fWorkbook.getId(), t = this.getSheetId();
962
+ return this._injector.createInstance(F, r, t);
822
963
  }
823
964
  }
824
- N.extend(ce);
825
- class ge extends M {
965
+ $.extend(me);
966
+ class he extends z {
826
967
  get DrawingType() {
827
- return S;
968
+ return I;
828
969
  }
829
970
  get ImageSourceType() {
830
- return f;
971
+ return E;
831
972
  }
832
973
  get SheetDrawingAnchorType() {
833
- return se;
974
+ return ae;
834
975
  }
835
976
  }
836
- M.extend(ge);
837
- class me extends H {
977
+ z.extend(he);
978
+ class le extends X {
979
+ get BeforeFloatDomAdd() {
980
+ return "BeforeFloatDomAdd";
981
+ }
982
+ get FloatDomAdded() {
983
+ return "FloatDomAdded";
984
+ }
985
+ get BeforeFloatDomUpdate() {
986
+ return "BeforeFloatDomUpdate";
987
+ }
988
+ get FloatDomUpdated() {
989
+ return "FloatDomUpdated";
990
+ }
991
+ get BeforeFloatDomDelete() {
992
+ return "BeforeFloatDomDelete";
993
+ }
994
+ get FloatDomDeleted() {
995
+ return "FloatDomDeleted";
996
+ }
838
997
  get BeforeOverGridImageChange() {
839
998
  return "BeforeOverGridImageChange";
840
999
  }
@@ -860,151 +1019,253 @@ class me extends H {
860
1019
  return "OverGridImageSelected";
861
1020
  }
862
1021
  }
863
- H.extend(me);
864
- class he extends z {
1022
+ X.extend(le);
1023
+ class ue extends Y {
865
1024
  /**
866
1025
  * @ignore
867
1026
  */
868
1027
  // eslint-disable-next-line max-lines-per-function
869
- _initialize(e) {
870
- const t = e.get(W);
1028
+ _initialize(r) {
1029
+ const t = r.get(N);
871
1030
  this.registerEventHandler(
1031
+ this.Event.BeforeFloatDomAdd,
1032
+ () => t.beforeCommandExecuted((e) => {
1033
+ if (e.id !== b.id) return;
1034
+ const i = e.params, n = this.getActiveWorkbook();
1035
+ if (n == null || i == null)
1036
+ return;
1037
+ const { drawings: s } = i, a = s.filter(
1038
+ (g) => g.drawingType === I.DRAWING_DOM
1039
+ );
1040
+ if (a.length === 0)
1041
+ return;
1042
+ const d = {
1043
+ workbook: n,
1044
+ drawings: a
1045
+ };
1046
+ if (this.fireEvent(this.Event.BeforeFloatDomAdd, d), d.cancel)
1047
+ throw new S();
1048
+ })
1049
+ ), this.registerEventHandler(
1050
+ this.Event.FloatDomAdded,
1051
+ () => t.onCommandExecuted((e) => {
1052
+ if (e.id !== b.id) return;
1053
+ const i = e.params, n = this.getActiveWorkbook();
1054
+ if (n == null || i == null)
1055
+ return;
1056
+ const { drawings: s } = i, a = s.filter(
1057
+ (d) => d.drawingType === I.DRAWING_DOM
1058
+ );
1059
+ a.length !== 0 && this.fireEvent(this.Event.FloatDomAdded, {
1060
+ workbook: n,
1061
+ drawings: a
1062
+ });
1063
+ })
1064
+ ), this.registerEventHandler(
872
1065
  this.Event.BeforeOverGridImageInsert,
873
- () => t.beforeCommandExecuted((r) => {
874
- if (r.id !== b.id) return;
875
- const n = r.params, s = this.getActiveWorkbook();
876
- if (s == null || n == null)
1066
+ () => t.beforeCommandExecuted((e) => {
1067
+ if (e.id !== b.id) return;
1068
+ const i = e.params, n = this.getActiveWorkbook();
1069
+ if (n == null || i == null)
877
1070
  return;
878
- const { drawings: o } = n, d = {
879
- workbook: s,
880
- insertImageParams: o
1071
+ const { drawings: s } = i, a = {
1072
+ workbook: n,
1073
+ insertImageParams: s
881
1074
  };
882
- if (this.fireEvent(this.Event.BeforeOverGridImageInsert, d), d.cancel)
883
- throw new v();
1075
+ if (this.fireEvent(this.Event.BeforeOverGridImageInsert, a), a.cancel)
1076
+ throw new S();
884
1077
  })
885
1078
  ), this.registerEventHandler(
886
1079
  this.Event.BeforeOverGridImageRemove,
887
- () => t.beforeCommandExecuted((r) => {
888
- if (r.id !== p.id) return;
889
- const n = r.params, s = this.getActiveWorkbook();
890
- if (s == null || n == null)
1080
+ () => t.beforeCommandExecuted((e) => {
1081
+ if (e.id !== k.id) return;
1082
+ const i = e.params, n = this.getActiveWorkbook();
1083
+ if (n == null || i == null)
891
1084
  return;
892
- const o = e.get(I), { drawings: d } = n, a = d.map((c) => o.getDrawingByParam(c)), g = {
893
- workbook: s,
894
- images: this._createFOverGridImage(a)
1085
+ const s = r.get(p), { drawings: a } = i, d = a.map((c) => s.getDrawingByParam(c)), g = {
1086
+ workbook: n,
1087
+ images: this._createFOverGridImage(d)
895
1088
  };
896
1089
  if (this.fireEvent(this.Event.BeforeOverGridImageRemove, g), g.cancel)
897
- throw new v();
1090
+ throw new S();
898
1091
  })
899
1092
  ), this.registerEventHandler(
900
1093
  this.Event.BeforeOverGridImageChange,
901
- () => t.beforeCommandExecuted((r) => {
902
- if (r.id !== h.id) return;
903
- const n = r.params, s = this.getActiveWorkbook();
904
- if (s == null || n == null)
1094
+ () => t.beforeCommandExecuted((e) => {
1095
+ if (e.id !== f.id) return;
1096
+ const i = e.params, n = this.getActiveWorkbook();
1097
+ if (n == null || i == null)
905
1098
  return;
906
- const { drawings: o } = n, d = e.get(I), a = [];
907
- o.forEach((c) => {
908
- const u = d.getDrawingByParam(c);
909
- u != null && a.push({
1099
+ const { drawings: s } = i, a = r.get(p), d = [];
1100
+ s.forEach((c) => {
1101
+ const m = a.getDrawingByParam(c);
1102
+ m != null && d.push({
910
1103
  changeParam: c,
911
- image: this._injector.createInstance(m, u)
1104
+ image: this._injector.createInstance(v, m)
912
1105
  });
913
1106
  });
914
1107
  const g = {
915
- workbook: s,
916
- images: a
1108
+ workbook: n,
1109
+ images: d
917
1110
  };
918
1111
  if (this.fireEvent(this.Event.BeforeOverGridImageChange, g), g.cancel)
919
- throw d.updateNotification(o), new v();
1112
+ throw a.updateNotification(s), new S();
1113
+ })
1114
+ ), this.registerEventHandler(
1115
+ this.Event.BeforeFloatDomUpdate,
1116
+ () => t.beforeCommandExecuted((e) => {
1117
+ if (e.id !== f.id) return;
1118
+ const i = e.params, n = this.getActiveWorkbook();
1119
+ if (n == null || i == null)
1120
+ return;
1121
+ const { drawings: s } = i, a = r.get(p), d = [];
1122
+ if (s.forEach((c) => {
1123
+ const m = a.getDrawingByParam(c);
1124
+ (m == null ? void 0 : m.drawingType) === I.DRAWING_DOM && d.push(m);
1125
+ }), d.length === 0)
1126
+ return;
1127
+ const g = {
1128
+ workbook: n,
1129
+ drawings: d
1130
+ };
1131
+ if (this.fireEvent(this.Event.BeforeFloatDomUpdate, g), g.cancel)
1132
+ throw a.updateNotification(s), new S();
1133
+ })
1134
+ ), this.registerEventHandler(
1135
+ this.Event.FloatDomUpdated,
1136
+ () => t.onCommandExecuted((e) => {
1137
+ if (e.id !== f.id) return;
1138
+ const i = e.params, n = this.getActiveWorkbook();
1139
+ if (n == null || i == null)
1140
+ return;
1141
+ const { drawings: s } = i, a = r.get(p), d = [];
1142
+ s.forEach((g) => {
1143
+ const c = a.getDrawingByParam(g);
1144
+ (c == null ? void 0 : c.drawingType) === I.DRAWING_DOM && d.push(c);
1145
+ }), d.length !== 0 && this.fireEvent(this.Event.FloatDomUpdated, {
1146
+ workbook: n,
1147
+ drawings: d
1148
+ });
1149
+ })
1150
+ ), this.registerEventHandler(
1151
+ this.Event.BeforeFloatDomDelete,
1152
+ () => t.beforeCommandExecuted((e) => {
1153
+ if (e.id !== k.id) return;
1154
+ const i = e.params, n = this.getActiveWorkbook();
1155
+ if (n == null || i == null)
1156
+ return;
1157
+ const s = r.get(p), { drawings: a } = i, d = a.map((c) => s.getDrawingByParam(c)).filter(
1158
+ (c) => (c == null ? void 0 : c.drawingType) === I.DRAWING_DOM
1159
+ );
1160
+ if (d.length === 0)
1161
+ return;
1162
+ const g = {
1163
+ workbook: n,
1164
+ drawings: d
1165
+ };
1166
+ if (this.fireEvent(this.Event.BeforeFloatDomDelete, g), g.cancel)
1167
+ throw new S();
1168
+ })
1169
+ ), this.registerEventHandler(
1170
+ this.Event.FloatDomDeleted,
1171
+ () => t.onCommandExecuted((e) => {
1172
+ if (e.id !== k.id) return;
1173
+ const i = e.params, n = this.getActiveWorkbook();
1174
+ if (n == null || i == null)
1175
+ return;
1176
+ const { drawings: s } = i;
1177
+ this.fireEvent(this.Event.FloatDomDeleted, {
1178
+ workbook: n,
1179
+ drawings: s.filter((a) => a.drawingType === I.DRAWING_DOM).map((a) => a.drawingId)
1180
+ });
920
1181
  })
921
1182
  ), this.registerEventHandler(
922
1183
  this.Event.BeforeOverGridImageSelect,
923
- () => t.beforeCommandExecuted((r) => {
924
- if (r.id !== F.id) return;
925
- const n = r.params, s = this.getActiveWorkbook();
926
- if (s == null)
1184
+ () => t.beforeCommandExecuted((e) => {
1185
+ if (e.id !== W.id) return;
1186
+ const i = e.params, n = this.getActiveWorkbook();
1187
+ if (n == null)
927
1188
  return;
928
- const o = e.get(I), d = o.getFocusDrawings(), a = n.map((c) => o.getDrawingByParam(c)), g = {
929
- workbook: s,
930
- selectedImages: this._createFOverGridImage(a),
931
- oldSelectedImages: this._createFOverGridImage(d)
1189
+ const s = r.get(p), a = s.getFocusDrawings(), d = i.map((c) => s.getDrawingByParam(c)), g = {
1190
+ workbook: n,
1191
+ selectedImages: this._createFOverGridImage(d),
1192
+ oldSelectedImages: this._createFOverGridImage(a)
932
1193
  };
933
1194
  if (this.fireEvent(this.Event.BeforeOverGridImageSelect, g), g.cancel)
934
- throw new v();
1195
+ throw new S();
935
1196
  })
936
1197
  ), this.registerEventHandler(
937
1198
  this.Event.OverGridImageInserted,
938
- () => t.onCommandExecuted((r) => {
939
- if (r.id !== b.id) return;
940
- const n = r.params, s = this.getActiveWorkbook();
941
- if (s == null || n == null)
1199
+ () => t.onCommandExecuted((e) => {
1200
+ if (e.id !== b.id) return;
1201
+ const i = e.params, n = this.getActiveWorkbook();
1202
+ if (n == null || i == null)
942
1203
  return;
943
- const { drawings: o } = n;
1204
+ const { drawings: s } = i;
944
1205
  this.fireEvent(this.Event.OverGridImageInserted, {
945
- workbook: s,
946
- images: this._createFOverGridImage(o)
1206
+ workbook: n,
1207
+ images: this._createFOverGridImage(s)
947
1208
  });
948
1209
  })
949
1210
  ), this.registerEventHandler(
950
1211
  this.Event.OverGridImageRemoved,
951
- () => t.onCommandExecuted((r) => {
952
- if (r.id !== p.id) return;
953
- const n = r.params, s = this.getActiveWorkbook();
954
- if (s == null || n == null)
1212
+ () => t.onCommandExecuted((e) => {
1213
+ if (e.id !== k.id) return;
1214
+ const i = e.params, n = this.getActiveWorkbook();
1215
+ if (n == null || i == null)
955
1216
  return;
956
- const { drawings: o } = n;
1217
+ const { drawings: s } = i;
957
1218
  this.fireEvent(this.Event.OverGridImageRemoved, {
958
- workbook: s,
959
- removeImageParams: o
1219
+ workbook: n,
1220
+ removeImageParams: s
960
1221
  });
961
1222
  })
962
1223
  ), this.registerEventHandler(
963
1224
  this.Event.OverGridImageChanged,
964
- () => t.onCommandExecuted((r) => {
965
- if (r.id !== h.id) return;
966
- const n = r.params, s = this.getActiveWorkbook();
967
- if (s == null || n == null)
1225
+ () => t.onCommandExecuted((e) => {
1226
+ if (e.id !== f.id) return;
1227
+ const i = e.params, n = this.getActiveWorkbook();
1228
+ if (n == null || i == null)
968
1229
  return;
969
- const { drawings: o } = n, d = e.get(I), a = o.map((g) => this._injector.createInstance(m, d.getDrawingByParam(g)));
1230
+ const { drawings: s } = i, a = r.get(p), d = s.map((g) => this._injector.createInstance(v, a.getDrawingByParam(g)));
970
1231
  this.fireEvent(this.Event.OverGridImageChanged, {
971
- workbook: s,
972
- images: a
1232
+ workbook: n,
1233
+ images: d
973
1234
  });
974
1235
  })
975
1236
  ), this.registerEventHandler(
976
1237
  this.Event.OverGridImageSelected,
977
- () => t.onCommandExecuted((r) => {
978
- if (r.id !== F.id) return;
979
- const n = r.params, s = this.getActiveWorkbook();
980
- if (s == null)
1238
+ () => t.onCommandExecuted((e) => {
1239
+ if (e.id !== W.id) return;
1240
+ const i = e.params, n = this.getActiveWorkbook();
1241
+ if (n == null)
981
1242
  return;
982
- const o = e.get(I), d = n.map((a) => o.getDrawingByParam(a));
1243
+ const s = r.get(p), a = i.map((d) => s.getDrawingByParam(d));
983
1244
  this.fireEvent(this.Event.OverGridImageSelected, {
984
- workbook: s,
985
- selectedImages: this._createFOverGridImage(d)
1245
+ workbook: n,
1246
+ selectedImages: this._createFOverGridImage(a)
986
1247
  });
987
1248
  })
988
1249
  );
989
1250
  }
990
- _createFOverGridImage(e) {
991
- return e.map((t) => this._injector.createInstance(m, t));
1251
+ _createFOverGridImage(r) {
1252
+ return r.map((t) => this._injector.createInstance(v, t));
992
1253
  }
993
1254
  }
994
- z.extend(he);
995
- class ue extends $ {
996
- async insertCellImageAsync(e) {
997
- var s;
998
- const t = this._injector.get(T), r = (s = ee(q.UNIVER_SHEET, this._injector.get(J), t)) == null ? void 0 : s.with(te);
999
- if (!r)
1255
+ Y.extend(ue);
1256
+ class fe extends L {
1257
+ async insertCellImageAsync(r) {
1258
+ var n;
1259
+ const t = this._injector.get(y), e = (n = ie(Z.UNIVER_SHEET, this._injector.get(ee), t)) == null ? void 0 : n.with(ne);
1260
+ if (!e)
1000
1261
  return !1;
1001
- const n = {
1262
+ const i = {
1002
1263
  unitId: this._workbook.getUnitId(),
1003
1264
  subUnitId: this._worksheet.getSheetId(),
1004
1265
  row: this.getRow(),
1005
1266
  col: this.getColumn()
1006
1267
  };
1007
- return typeof e == "string" ? r.insertCellImageByUrl(e, n) : r.insertCellImageByFile(e, n);
1268
+ return typeof r == "string" ? e.insertCellImageByUrl(r, i) : e.insertCellImageByFile(r, i);
1008
1269
  }
1009
1270
  }
1010
- $.extend(ue);
1271
+ L.extend(fe);