@univerjs/sheets-drawing-ui 0.6.1-nightly.202502251606 → 0.6.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,30 +1,30 @@
1
- var K = Object.defineProperty;
2
- var L = (e, r, t) => r in e ? K(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var T = (e, r, t) => L(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { Inject as U, Injector as P, ICommandService as j, ImageSourceType as f, ArrangeTypeEnum as v, DrawingTypeEnum as _, generateRandomId as X, toDisposable as y } from "@univerjs/core";
5
- import { FBase as Y, FEnum as W, FEventName as M, FUniver as H } from "@univerjs/core/facade";
6
- import { getImageSize as V, IDrawingManagerService as I, SetDrawingSelectedOperation as x } from "@univerjs/drawing";
7
- import { IRenderManagerService as A } from "@univerjs/engine-render";
8
- import { RemoveSheetDrawingCommand as S, SetSheetDrawingCommand as h, SetDrawingArrangeCommand as w, SheetCanvasFloatDomManagerService as D, InsertSheetDrawingCommand as p } from "@univerjs/sheets-drawing-ui";
9
- import { SheetSkeletonManagerService as F, ISheetSelectionRenderService as q, convertPositionSheetOverGridToAbsolute as J, convertPositionCellToSheetOverGrid as Q } from "@univerjs/sheets-ui";
10
- import { ISheetDrawingService as l, SheetDrawingAnchorType as Z } from "@univerjs/sheets-drawing";
1
+ var L = Object.defineProperty;
2
+ var V = (r, e, t) => e in r ? L(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var U = (r, e, t) => V(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Inject as A, Injector as j, ICommandService as P, ImageSourceType as f, ArrangeTypeEnum as v, DrawingTypeEnum as _, generateRandomId as X, toDisposable as y, UniverInstanceType as Y, IUniverInstanceService as q } from "@univerjs/core";
5
+ import { FBase as J, FEnum as W, FEventName as M, FUniver as H } from "@univerjs/core/facade";
6
+ import { getImageSize as Q, IDrawingManagerService as I, SetDrawingSelectedOperation as x } from "@univerjs/drawing";
7
+ import { IRenderManagerService as B, getCurrentTypeOfRenderer as Z } from "@univerjs/engine-render";
8
+ import { RemoveSheetDrawingCommand as S, SetSheetDrawingCommand as h, SetDrawingArrangeCommand as w, SheetCanvasFloatDomManagerService as D, InsertSheetDrawingCommand as p, SheetDrawingUpdateController as ee } from "@univerjs/sheets-drawing-ui";
9
+ import { SheetSkeletonManagerService as F, ISheetSelectionRenderService as te, convertPositionSheetOverGridToAbsolute as re, convertPositionCellToSheetOverGrid as ie } from "@univerjs/sheets-ui";
10
+ import { ISheetDrawingService as l, SheetDrawingAnchorType as ne } from "@univerjs/sheets-drawing";
11
11
  import { transformComponentKey as R } from "@univerjs/sheets-ui/facade";
12
- import { FWorksheet as z } from "@univerjs/sheets/facade";
12
+ import { FWorksheet as z, FRange as N } from "@univerjs/sheets/facade";
13
13
  import { ComponentManager as G } from "@univerjs/ui";
14
- var ee = Object.getOwnPropertyDescriptor, N = (e, r, t, i) => {
15
- for (var n = i > 1 ? void 0 : i ? ee(r, t) : r, s = e.length - 1, o; s >= 0; s--)
16
- (o = e[s]) && (n = o(n) || n);
14
+ var se = Object.getOwnPropertyDescriptor, $ = (r, e, t, i) => {
15
+ for (var n = i > 1 ? void 0 : i ? se(e, t) : e, s = r.length - 1, o; s >= 0; s--)
16
+ (o = r[s]) && (n = o(n) || n);
17
17
  return n;
18
- }, B = (e, r) => (t, i) => r(t, i, e);
19
- function te(e, r) {
20
- const { from: t, to: i, flipY: n = !1, flipX: s = !1, angle: o = 0, skewX: d = 0, skewY: a = 0 } = e.sheetTransform, { column: g, columnOffset: c, row: u, rowOffset: O } = t, k = J(
21
- e.unitId,
22
- e.subUnitId,
18
+ }, T = (r, e) => (t, i) => e(t, i, r);
19
+ function oe(r, e) {
20
+ const { from: t, to: i, flipY: n = !1, flipX: s = !1, angle: o = 0, skewX: d = 0, skewY: a = 0 } = r.sheetTransform, { column: g, columnOffset: c, row: u, rowOffset: O } = t, k = re(
21
+ r.unitId,
22
+ r.subUnitId,
23
23
  { from: t, to: i },
24
- r
24
+ e
25
25
  ), { width: E, height: C } = k;
26
26
  return {
27
- ...e,
27
+ ...r,
28
28
  column: g,
29
29
  columnOffset: c,
30
30
  row: u,
@@ -38,18 +38,18 @@ function te(e, r) {
38
38
  skewY: a
39
39
  };
40
40
  }
41
- function re(e, r, t) {
42
- const { column: i, columnOffset: n, row: s, rowOffset: o, flipY: d = !1, flipX: a = !1, angle: g = 0, skewX: c = 0, skewY: u = 0, width: O, height: k } = e, E = Q(
43
- e.unitId,
44
- e.subUnitId,
41
+ function ae(r, e, t) {
42
+ const { column: i, columnOffset: n, row: s, rowOffset: o, flipY: d = !1, flipX: a = !1, angle: g = 0, skewX: c = 0, skewY: u = 0, width: O, height: k } = r, E = ie(
43
+ r.unitId,
44
+ r.subUnitId,
45
45
  { column: i, columnOffset: n, row: s, rowOffset: o },
46
46
  O,
47
47
  k,
48
- r,
48
+ e,
49
49
  t
50
- ), { sheetTransform: C, transform: $ } = E;
50
+ ), { sheetTransform: C, transform: K } = E;
51
51
  return {
52
- ...e,
52
+ ...r,
53
53
  sheetTransform: {
54
54
  ...C,
55
55
  flipY: d,
@@ -59,7 +59,7 @@ function re(e, r, t) {
59
59
  skewY: u
60
60
  },
61
61
  transform: {
62
- ...$,
62
+ ...K,
63
63
  flipY: d,
64
64
  flipX: a,
65
65
  angle: g,
@@ -69,15 +69,15 @@ function re(e, r, t) {
69
69
  };
70
70
  }
71
71
  let b = class {
72
- constructor(e, r, t) {
73
- T(this, "_image");
72
+ constructor(r, e, t) {
73
+ U(this, "_image");
74
74
  this._injector = t, this._image = {
75
75
  drawingId: X(6),
76
76
  drawingType: _.DRAWING_IMAGE,
77
77
  imageSourceType: f.BASE64,
78
78
  source: "",
79
- unitId: e,
80
- subUnitId: r,
79
+ unitId: r,
80
+ subUnitId: e,
81
81
  column: 0,
82
82
  columnOffset: 0,
83
83
  row: 0,
@@ -111,12 +111,12 @@ let b = class {
111
111
  * fWorksheet.insertImages([image]);
112
112
  * ```
113
113
  */
114
- setImage(e) {
115
- const t = this._injector.get(A).getRenderById(e.unitId);
114
+ setImage(r) {
115
+ const t = this._injector.get(B).getRenderById(r.unitId);
116
116
  if (!t)
117
- throw new Error(`Render Unit with unitId ${e.unitId} not found`);
117
+ throw new Error(`Render Unit with unitId ${r.unitId} not found`);
118
118
  const i = t.with(F);
119
- return e.sheetTransform == null && (e.sheetTransform = {
119
+ return r.sheetTransform == null && (r.sheetTransform = {
120
120
  from: {
121
121
  column: 0,
122
122
  columnOffset: 0,
@@ -129,11 +129,11 @@ let b = class {
129
129
  row: 0,
130
130
  rowOffset: 0
131
131
  }
132
- }), this._image = te(e, i), this;
132
+ }), this._image = oe(r, i), this;
133
133
  }
134
- setSource(e, r) {
135
- const t = r != null ? r : f.URL;
136
- return this._image.source = e, this._image.imageSourceType = t, this;
134
+ setSource(r, e) {
135
+ const t = e != null ? e : f.URL;
136
+ return this._image.source = r, this._image.imageSourceType = t, this;
137
137
  }
138
138
  /**
139
139
  * Get the source of the image
@@ -185,8 +185,8 @@ let b = class {
185
185
  * fWorksheet.insertImages([image]);
186
186
  * ```
187
187
  */
188
- setColumn(e) {
189
- return this._image.column = e, this;
188
+ setColumn(r) {
189
+ return this._image.column = r, this;
190
190
  }
191
191
  /**
192
192
  * Set the vertical position of the image
@@ -206,8 +206,8 @@ let b = class {
206
206
  * fWorksheet.insertImages([image]);
207
207
  * ```
208
208
  */
209
- setRow(e) {
210
- return this._image.row = e, this;
209
+ setRow(r) {
210
+ return this._image.row = r, this;
211
211
  }
212
212
  /**
213
213
  * Set the horizontal offset of the image
@@ -228,8 +228,8 @@ let b = class {
228
228
  * fWorksheet.insertImages([image]);
229
229
  * ```
230
230
  */
231
- setColumnOffset(e) {
232
- return this._image.columnOffset = e, this;
231
+ setColumnOffset(r) {
232
+ return this._image.columnOffset = r, this;
233
233
  }
234
234
  /**
235
235
  * Set the vertical offset of the image
@@ -250,8 +250,8 @@ let b = class {
250
250
  * fWorksheet.insertImages([image]);
251
251
  * ```
252
252
  */
253
- setRowOffset(e) {
254
- return this._image.rowOffset = e, this;
253
+ setRowOffset(r) {
254
+ return this._image.rowOffset = r, this;
255
255
  }
256
256
  /**
257
257
  * Set the width of the image
@@ -273,8 +273,8 @@ let b = class {
273
273
  * fWorksheet.insertImages([image]);
274
274
  * ```
275
275
  */
276
- setWidth(e) {
277
- return this._image.width = e, this;
276
+ setWidth(r) {
277
+ return this._image.width = r, this;
278
278
  }
279
279
  /**
280
280
  * Set the height of the image
@@ -296,8 +296,8 @@ let b = class {
296
296
  * fWorksheet.insertImages([image]);
297
297
  * ```
298
298
  */
299
- setHeight(e) {
300
- return this._image.height = e, this;
299
+ setHeight(r) {
300
+ return this._image.height = r, 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 b = class {
345
345
  * }, 2000);
346
346
  * ```
347
347
  */
348
- setAnchorType(e) {
349
- return this._image.anchorType = e, this;
348
+ setAnchorType(r) {
349
+ return this._image.anchorType = r, 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 b = class {
367
367
  * fWorksheet.insertImages([image]);
368
368
  * ```
369
369
  */
370
- setCropTop(e) {
371
- return this._initializeSrcRect(), this._image.srcRect.top = e, this;
370
+ setCropTop(r) {
371
+ return this._initializeSrcRect(), this._image.srcRect.top = r, 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 b = class {
389
389
  * fWorksheet.insertImages([image]);
390
390
  * ```
391
391
  */
392
- setCropLeft(e) {
393
- return this._initializeSrcRect(), this._image.srcRect.left = e, this;
392
+ setCropLeft(r) {
393
+ return this._initializeSrcRect(), this._image.srcRect.left = r, 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 b = class {
411
411
  * fWorksheet.insertImages([image]);
412
412
  * ```
413
413
  */
414
- setCropBottom(e) {
415
- return this._initializeSrcRect(), this._image.srcRect.bottom = e, this;
414
+ setCropBottom(r) {
415
+ return this._initializeSrcRect(), this._image.srcRect.bottom = r, 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 b = class {
433
433
  * fWorksheet.insertImages([image]);
434
434
  * ```
435
435
  */
436
- setCropRight(e) {
437
- return this._initializeSrcRect(), this._image.srcRect.right = e, this;
436
+ setCropRight(r) {
437
+ return this._initializeSrcRect(), this._image.srcRect.right = r, this;
438
438
  }
439
439
  _initializeSrcRect() {
440
440
  this._image.srcRect == null && (this._image.srcRect = {
@@ -463,33 +463,33 @@ let b = class {
463
463
  * fWorksheet.insertImages([image]);
464
464
  * ```
465
465
  */
466
- setRotate(e) {
467
- return this._image.angle = e, this;
466
+ setRotate(r) {
467
+ return this._image.angle = r, this;
468
468
  }
469
- setUnitId(e) {
470
- return this._image.unitId = e, this;
469
+ setUnitId(r) {
470
+ return this._image.unitId = r, this;
471
471
  }
472
- setSubUnitId(e) {
473
- return this._image.subUnitId = e, this;
472
+ setSubUnitId(r) {
473
+ return this._image.subUnitId = r, this;
474
474
  }
475
475
  async buildAsync() {
476
- const r = this._injector.get(A).getRenderById(this._image.unitId);
477
- if (!r)
476
+ const e = this._injector.get(B).getRenderById(this._image.unitId);
477
+ if (!e)
478
478
  throw new Error(`Render Unit with unitId ${this._image.unitId} not found`);
479
- const t = r.with(q), i = r.with(F);
479
+ const t = e.with(te), i = e.with(F);
480
480
  if (this._image.width === 0 || this._image.height === 0) {
481
- const n = await V(this._image.source), s = n.width, o = n.height;
481
+ const n = await Q(this._image.source), s = n.width, o = n.height;
482
482
  this._image.width === 0 && (this._image.width = s), this._image.height === 0 && (this._image.height = o);
483
483
  }
484
- return re(this._image, t, i);
484
+ return ae(this._image, t, i);
485
485
  }
486
486
  };
487
- b = N([
488
- B(2, U(P))
487
+ b = $([
488
+ T(2, A(j))
489
489
  ], b);
490
- let m = class extends Y {
491
- constructor(e, r, t) {
492
- super(), this._image = e, this._commandService = r, this._injector = t;
490
+ let m = class extends J {
491
+ constructor(r, e, t) {
492
+ super(), this._image = r, this._commandService = e, this._injector = t;
493
493
  }
494
494
  /**
495
495
  * Get the id of the image
@@ -552,16 +552,16 @@ let m = class extends Y {
552
552
  * ```
553
553
  */
554
554
  toBuilder() {
555
- const e = this._injector.createInstance(b);
556
- return e.setImage(this._image), e;
555
+ const r = this._injector.createInstance(b);
556
+ return r.setImage(this._image), r;
557
557
  }
558
- setSource(e, r) {
559
- const t = r != null ? r : f.URL;
560
- return this._image.source = e, this._image.imageSourceType = t, this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
558
+ setSource(r, e) {
559
+ const t = e != null ? e : f.URL;
560
+ return this._image.source = r, this._image.imageSourceType = t, this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
561
561
  }
562
- async setPositionAsync(e, r, t, i) {
562
+ async setPositionAsync(r, e, t, i) {
563
563
  const n = this.toBuilder();
564
- n.setColumn(r), n.setRow(e), t != null && n.setRowOffset(t), i != null && n.setColumnOffset(i);
564
+ n.setColumn(e), n.setRow(r), t != null && n.setRowOffset(t), i != null && n.setColumnOffset(i);
565
565
  const s = await n.buildAsync();
566
566
  return this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [s] });
567
567
  }
@@ -580,9 +580,9 @@ let m = class extends Y {
580
580
  * console.log(result);
581
581
  * ```
582
582
  */
583
- async setSizeAsync(e, r) {
583
+ async setSizeAsync(r, e) {
584
584
  const t = this.toBuilder();
585
- t.setWidth(e), t.setHeight(r);
585
+ t.setWidth(r), t.setHeight(e);
586
586
  const i = await t.buildAsync();
587
587
  return this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [i] });
588
588
  }
@@ -603,13 +603,13 @@ let m = class extends Y {
603
603
  * console.log(result);
604
604
  * ```
605
605
  */
606
- setCrop(e, r, t, i) {
606
+ setCrop(r, e, t, i) {
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
- }), e != null && (this._image.srcRect.top = e), r != null && (this._image.srcRect.left = r), t != null && (this._image.srcRect.bottom = t), i != null && (this._image.srcRect.right = i), this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
612
+ }), r != null && (this._image.srcRect.top = r), e != null && (this._image.srcRect.left = e), t != null && (this._image.srcRect.bottom = t), i != null && (this._image.srcRect.right = i), this._commandService.syncExecuteCommand(h.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 Y {
625
625
  * console.log(result);
626
626
  * ```
627
627
  */
628
- setRotate(e) {
629
- return this._image.sheetTransform.angle = e, this._image.transform && (this._image.transform.angle = e), this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
628
+ setRotate(r) {
629
+ return this._image.sheetTransform.angle = r, this._image.transform && (this._image.transform.angle = r), this._commandService.syncExecuteCommand(h.id, { unitId: this._image.unitId, drawings: [this._image] });
630
630
  }
631
631
  /**
632
632
  * Move the image layer forward by one level
@@ -709,13 +709,13 @@ let m = class extends Y {
709
709
  });
710
710
  }
711
711
  };
712
- m = N([
713
- B(1, j),
714
- B(2, U(P))
712
+ m = $([
713
+ T(1, P),
714
+ T(2, A(j))
715
715
  ], m);
716
- class ie extends z {
717
- addFloatDomToPosition(r, t) {
718
- const i = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), { key: s, disposableCollection: o } = R(r, this._injector.get(G)), a = this._injector.get(D).addFloatDomToPosition({ ...r, componentKey: s, unitId: i, subUnitId: n }, t);
716
+ class de extends z {
717
+ addFloatDomToPosition(e, t) {
718
+ const i = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), { key: s, disposableCollection: o } = R(e, this._injector.get(G)), a = this._injector.get(D).addFloatDomToPosition({ ...e, componentKey: s, unitId: i, subUnitId: n }, t);
719
719
  return a ? (o.add(a.dispose), {
720
720
  id: a.id,
721
721
  dispose: () => {
@@ -723,8 +723,8 @@ class ie extends z {
723
723
  }
724
724
  }) : (o.dispose(), null);
725
725
  }
726
- addFloatDomToRange(r, t, i, n) {
727
- const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = R(t, this._injector.get(G)), c = this._injector.get(D).addFloatDomToRange(r.getRange(), { ...t, componentKey: d, unitId: s, subUnitId: o }, i, n);
726
+ addFloatDomToRange(e, t, i, n) {
727
+ const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = R(t, this._injector.get(G)), c = this._injector.get(D).addFloatDomToRange(e.getRange(), { ...t, componentKey: d, unitId: s, subUnitId: o }, i, n);
728
728
  return c ? (a.add(c.dispose), {
729
729
  id: c.id,
730
730
  dispose: () => {
@@ -732,8 +732,8 @@ class ie extends z {
732
732
  }
733
733
  }) : (a.dispose(), null);
734
734
  }
735
- addFloatDomToColumnHeader(r, t, i, n) {
736
- const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = R(t, this._injector.get(G)), c = this._injector.get(D).addFloatDomToColumnHeader(r, { ...t, componentKey: d, unitId: s, subUnitId: o }, i, n);
735
+ addFloatDomToColumnHeader(e, t, i, n) {
736
+ const s = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), { key: d, disposableCollection: a } = R(t, this._injector.get(G)), c = this._injector.get(D).addFloatDomToColumnHeader(e, { ...t, componentKey: d, unitId: s, subUnitId: o }, i, n);
737
737
  return c ? (a.add(c.dispose), {
738
738
  id: c.id,
739
739
  dispose: () => {
@@ -741,24 +741,24 @@ class ie extends z {
741
741
  }
742
742
  }) : (a.dispose(), null);
743
743
  }
744
- async insertImage(r, t, i, n, s) {
744
+ async insertImage(e, t, i, n, s) {
745
745
  const o = this.newOverGridImage();
746
- if (typeof r == "string")
747
- o.setSource(r);
746
+ if (typeof e == "string")
747
+ o.setSource(e);
748
748
  else {
749
- const g = await r.getBlob().getDataAsString();
749
+ const g = await e.getBlob().getDataAsString();
750
750
  o.setSource(g, f.BASE64);
751
751
  }
752
752
  t !== void 0 ? o.setColumn(t) : o.setColumn(0), i !== void 0 ? o.setRow(i) : o.setRow(0), n !== void 0 ? o.setColumnOffset(n) : o.setColumnOffset(0), s !== void 0 ? o.setRowOffset(s) : o.setRowOffset(0);
753
753
  const d = await o.buildAsync();
754
754
  return this._commandService.syncExecuteCommand(p.id, { unitId: this._fWorkbook.getId(), drawings: [d] });
755
755
  }
756
- insertImages(r) {
757
- const t = r.map((i) => (i.unitId = this._fWorkbook.getId(), i.subUnitId = this.getSheetId(), i));
756
+ insertImages(e) {
757
+ const t = e.map((i) => (i.unitId = this._fWorkbook.getId(), i.subUnitId = this.getSheetId(), i));
758
758
  return this._commandService.syncExecuteCommand(p.id, { unitId: this._fWorkbook.getId(), drawings: t }), this;
759
759
  }
760
- deleteImages(r) {
761
- const t = r.map((i) => ({
760
+ deleteImages(e) {
761
+ const t = e.map((i) => ({
762
762
  unitId: this._fWorkbook.getId(),
763
763
  drawingId: i.getId(),
764
764
  subUnitId: this.getSheetId(),
@@ -774,8 +774,8 @@ class ie extends z {
774
774
  }
775
775
  return i;
776
776
  }
777
- getImageById(r) {
778
- const i = this._injector.get(l).getDrawingByParam({ unitId: this._fWorkbook.getId(), subUnitId: this.getSheetId(), drawingId: r });
777
+ getImageById(e) {
778
+ const i = this._injector.get(l).getDrawingByParam({ unitId: this._fWorkbook.getId(), subUnitId: this.getSheetId(), drawingId: e });
779
779
  return i && i.drawingType === _.DRAWING_IMAGE ? this._injector.createInstance(m, i) : null;
780
780
  }
781
781
  getActiveImages() {
@@ -786,43 +786,43 @@ class ie extends z {
786
786
  }
787
787
  return i;
788
788
  }
789
- updateImages(r) {
790
- return this._commandService.syncExecuteCommand(h.id, { unitId: this._fWorkbook.getId(), drawings: r }), this;
789
+ updateImages(e) {
790
+ return this._commandService.syncExecuteCommand(h.id, { unitId: this._fWorkbook.getId(), drawings: e }), this;
791
791
  }
792
- onImageInserted(r) {
792
+ onImageInserted(e) {
793
793
  const t = this._injector.get(l);
794
794
  return y(t.add$.subscribe((i) => {
795
795
  const n = i.map(
796
796
  (s) => this._injector.createInstance(m, t.getDrawingByParam(s))
797
797
  );
798
- r(n);
798
+ e(n);
799
799
  }));
800
800
  }
801
- onImageDeleted(r) {
801
+ onImageDeleted(e) {
802
802
  const t = this._injector.get(l);
803
803
  return y(t.remove$.subscribe((i) => {
804
804
  const n = i.map(
805
805
  (s) => this._injector.createInstance(m, t.getDrawingByParam(s))
806
806
  );
807
- r(n);
807
+ e(n);
808
808
  }));
809
809
  }
810
- onImageChanged(r) {
810
+ onImageChanged(e) {
811
811
  const t = this._injector.get(l);
812
812
  return y(t.update$.subscribe((i) => {
813
813
  const n = i.map(
814
814
  (s) => this._injector.createInstance(m, t.getDrawingByParam(s))
815
815
  );
816
- r(n);
816
+ e(n);
817
817
  }));
818
818
  }
819
819
  newOverGridImage() {
820
- const r = this._fWorkbook.getId(), t = this.getSheetId();
821
- return this._injector.createInstance(b, r, t);
820
+ const e = this._fWorkbook.getId(), t = this.getSheetId();
821
+ return this._injector.createInstance(b, e, t);
822
822
  }
823
823
  }
824
- z.extend(ie);
825
- class ne extends W {
824
+ z.extend(de);
825
+ class ce extends W {
826
826
  get DrawingType() {
827
827
  return _;
828
828
  }
@@ -830,11 +830,11 @@ class ne extends W {
830
830
  return f;
831
831
  }
832
832
  get SheetDrawingAnchorType() {
833
- return Z;
833
+ return ne;
834
834
  }
835
835
  }
836
- W.extend(ne);
837
- class se extends M {
836
+ W.extend(ce);
837
+ class ge extends M {
838
838
  get BeforeOverGridImageChange() {
839
839
  return "BeforeOverGridImageChange";
840
840
  }
@@ -860,14 +860,14 @@ class se extends M {
860
860
  return "OverGridImageSelected";
861
861
  }
862
862
  }
863
- M.extend(se);
864
- class oe extends H {
863
+ M.extend(ge);
864
+ class me extends H {
865
865
  /**
866
866
  * @ignore
867
867
  */
868
868
  // eslint-disable-next-line max-lines-per-function
869
- _initialize(r) {
870
- const t = r.get(j);
869
+ _initialize(e) {
870
+ const t = e.get(P);
871
871
  this.registerEventHandler(
872
872
  this.Event.BeforeOverGridImageInsert,
873
873
  () => t.beforeCommandExecuted((i) => {
@@ -889,7 +889,7 @@ class oe extends H {
889
889
  const n = i.params, s = this.getActiveWorkbook();
890
890
  if (s == null || n == null)
891
891
  return;
892
- const o = r.get(I), { drawings: d } = n, a = d.map((c) => o.getDrawingByParam(c)), g = {
892
+ const o = e.get(I), { drawings: d } = n, a = d.map((c) => o.getDrawingByParam(c)), g = {
893
893
  workbook: s,
894
894
  images: this._createFOverGridImage(a)
895
895
  };
@@ -903,7 +903,7 @@ class oe extends H {
903
903
  const n = i.params, s = this.getActiveWorkbook();
904
904
  if (s == null || n == null)
905
905
  return;
906
- const { drawings: o } = n, d = r.get(I), a = [];
906
+ const { drawings: o } = n, d = e.get(I), a = [];
907
907
  o.forEach((c) => {
908
908
  const u = d.getDrawingByParam(c);
909
909
  u != null && a.push({
@@ -925,7 +925,7 @@ class oe extends H {
925
925
  const n = i.params, s = this.getActiveWorkbook();
926
926
  if (s == null)
927
927
  return;
928
- const o = r.get(I), d = o.getFocusDrawings(), a = n.map((c) => o.getDrawingByParam(c)), g = {
928
+ const o = e.get(I), d = o.getFocusDrawings(), a = n.map((c) => o.getDrawingByParam(c)), g = {
929
929
  workbook: s,
930
930
  selectedImages: this._createFOverGridImage(a),
931
931
  oldSelectedImages: this._createFOverGridImage(d)
@@ -966,7 +966,7 @@ class oe extends H {
966
966
  const n = i.params, s = this.getActiveWorkbook();
967
967
  if (s == null || n == null)
968
968
  return;
969
- const { drawings: o } = n, d = r.get(I), a = o.map((g) => this._injector.createInstance(m, d.getDrawingByParam(g)));
969
+ const { drawings: o } = n, d = e.get(I), a = o.map((g) => this._injector.createInstance(m, d.getDrawingByParam(g)));
970
970
  this.fireEvent(this.Event.OverGridImageChanged, {
971
971
  workbook: s,
972
972
  images: a
@@ -979,7 +979,7 @@ class oe extends H {
979
979
  const n = i.params, s = this.getActiveWorkbook();
980
980
  if (s == null)
981
981
  return;
982
- const o = r.get(I), d = n.map((a) => o.getDrawingByParam(a));
982
+ const o = e.get(I), d = n.map((a) => o.getDrawingByParam(a));
983
983
  this.fireEvent(this.Event.OverGridImageSelected, {
984
984
  workbook: s,
985
985
  selectedImages: this._createFOverGridImage(d)
@@ -987,8 +987,24 @@ class oe extends H {
987
987
  })
988
988
  );
989
989
  }
990
- _createFOverGridImage(r) {
991
- return r.map((t) => this._injector.createInstance(m, t));
990
+ _createFOverGridImage(e) {
991
+ return e.map((t) => this._injector.createInstance(m, t));
992
992
  }
993
993
  }
994
- H.extend(oe);
994
+ H.extend(me);
995
+ class he extends N {
996
+ async insertCellImageAsync(e) {
997
+ var s;
998
+ const t = this._injector.get(B), i = (s = Z(Y.UNIVER_SHEET, this._injector.get(q), t)) == null ? void 0 : s.with(ee);
999
+ if (!i)
1000
+ return !1;
1001
+ const n = {
1002
+ unitId: this._workbook.getUnitId(),
1003
+ subUnitId: this._worksheet.getSheetId(),
1004
+ row: this.getRow(),
1005
+ col: this.getColumn()
1006
+ };
1007
+ return typeof e == "string" ? i.insertCellImageByUrl(e, n) : i.insertCellImageByFile(e, n);
1008
+ }
1009
+ }
1010
+ N.extend(he);