@univerjs/sheets-drawing-ui 0.1.16 → 0.1.17

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/index.js CHANGED
@@ -1,19 +1,19 @@
1
- var Jt = Object.defineProperty;
2
- var Zt = (r, e, n) => e in r ? Jt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
- var K = (r, e, n) => Zt(r, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as G, ICommandService as W, IUndoRedoService as ae, LocaleService as pe, IUniverInstanceService as ce, RxDisposable as qt, UniverInstanceType as Y, toDisposable as Ve, FOCUSING_COMMON_DRAWINGS as fe, OnLifecycle as de, LifecycleStages as le, IContextService as ht, Disposable as ue, Direction as J, FOCUSING_FORMULA_EDITOR as Qt, EDITOR_ACTIVATED as en, Rectangle as tn, DrawingTypeEnum as Ge, DisposableCollection as nn, Tools as ie, UserManagerService as rn, IPermissionService as sn, Plugin as on, DependentOn as an } from "@univerjs/core";
5
- import { Inject as B, Injector as qe } from "@wendellhu/redi";
1
+ var kt = Object.defineProperty;
2
+ var Jt = (r, e, n) => e in r ? kt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
+ var K = (r, e, n) => Jt(r, typeof e != "symbol" ? e + "" : e, n);
4
+ import { CommandType as G, ICommandService as B, IUndoRedoService as ae, LocaleService as pe, IUniverInstanceService as ce, RxDisposable as Zt, UniverInstanceType as Y, toDisposable as qt, FOCUSING_COMMON_DRAWINGS as fe, OnLifecycle as de, LifecycleStages as le, IContextService as gt, Disposable as ue, Direction as J, FOCUSING_FORMULA_EDITOR as Qt, EDITOR_ACTIVATED as en, Rectangle as tn, DrawingTypeEnum as Ve, DisposableCollection as nn, Tools as ie, UserManagerService as rn, IPermissionService as sn, Plugin as on, DependentOn as an } from "@univerjs/core";
5
+ import { Inject as $, Injector as Ze } from "@wendellhu/redi";
6
6
  import { ImageCropperObject as cn, COMPONENT_IMAGE_POPUP_MENU as dn, OpenImageCropOperation as ln, ImageResetSizeOperation as un, DrawingCommonPanel as mn, DrawingRenderService as gn, UniverDrawingUIPlugin as hn } from "@univerjs/drawing-ui";
7
7
  import { ISheetDrawingService as X, SetDrawingApplyMutation as O, DrawingApplyType as P, SheetDrawingAnchorType as b, UniverSheetsDrawingPlugin as fn } from "@univerjs/sheets-drawing";
8
- import { IDrawingManagerService as H, IImageIoService as ft, ArrangeTypeEnum as ve, DrawingTypeEnum as Le, DRAWING_IMAGE_COUNT_LIMIT as st, ImageUploadStatusType as xe, DRAWING_IMAGE_ALLOW_SIZE as pn, getImageSize as wn, DRAWING_IMAGE_WIDTH_LIMIT as ot, DRAWING_IMAGE_HEIGHT_LIMIT as at, DRAWING_IMAGE_ALLOW_IMAGE_LIST as _n, getDrawingShapeKeyByDrawingSearch as vn, UniverDrawingPlugin as Sn } from "@univerjs/drawing";
8
+ import { IDrawingManagerService as H, IImageIoService as ht, ArrangeTypeEnum as ve, DrawingTypeEnum as Le, DRAWING_IMAGE_COUNT_LIMIT as it, ImageUploadStatusType as Ge, DRAWING_IMAGE_ALLOW_SIZE as pn, getImageSize as wn, DRAWING_IMAGE_WIDTH_LIMIT as st, DRAWING_IMAGE_HEIGHT_LIMIT as ot, DRAWING_IMAGE_ALLOW_IMAGE_LIST as _n, getDrawingShapeKeyByDrawingSearch as vn, UniverDrawingPlugin as Sn } from "@univerjs/drawing";
9
9
  import { IRenderManagerService as te, getGroupState as Cn, transformObjectOutOfGroup as In, precisionTo as Z, Rect as Rn, DRAWING_OBJECT_LAYER_INDEX as Dn, SHEET_VIEWPORT_KEY as Mn, RENDER_CLASS_TYPE as ne } from "@univerjs/engine-render";
10
- import { SheetCanvasPopManagerService as bn, ISelectionRenderService as Be, getCurrentRangeDisable$ as On, SheetSkeletonManagerService as He, SetScrollOperation as Pn, SetZoomRatioOperation as En, SheetPrintInterceptorService as yn } from "@univerjs/sheets-ui";
11
- import { takeUntil as ct, Subject as dt, BehaviorSubject as Tn, combineLatest as Se, map as lt, filter as Ce, distinctUntilChanged as Ie } from "rxjs";
12
- import { ISidebarService as Un, BuiltInUIPart as An, IUIPartsService as Nn, IMessageService as jn, MenuItemType as pt, MenuPosition as Ln, MenuGroup as Bn, getMenuHiddenObservable as wt, KeyCode as oe, ComponentManager as Wn, IMenuService as $n, IShortcutService as Vn, CanvasFloatDomService as Gn } from "@univerjs/ui";
10
+ import { SheetCanvasPopManagerService as bn, ISelectionRenderService as $e, getCurrentRangeDisable$ as On, SheetSkeletonManagerService as Xe, SetScrollOperation as Pn, SetZoomRatioOperation as En, SheetPrintInterceptorService as yn } from "@univerjs/sheets-ui";
11
+ import { takeUntil as at, Subject as ct, BehaviorSubject as Tn, combineLatest as Se, map as dt, filter as Ce, distinctUntilChanged as Ie } from "rxjs";
12
+ import { ISidebarService as Un, BuiltInUIPart as An, IUIPartsService as Nn, IMessageService as jn, MenuItemType as ft, MenuPosition as Ln, MenuGroup as $n, getMenuHiddenObservable as pt, KeyCode as oe, ComponentManager as Bn, IMenuService as Wn, IShortcutService as Vn, CanvasFloatDomService as Gn } from "@univerjs/ui";
13
13
  import { useDependency as q, connectInjector as xn } from "@wendellhu/redi/react-bindings";
14
- import { getSheetCommandTarget as se, SelectionManagerService as Fn, WorkbookEditablePermission as ze, WorksheetEditPermission as Oe, RangeProtectionPermissionEditPoint as Yn, InsertRowCommand as _t, InsertColCommand as vt, RemoveRowCommand as St, RemoveColCommand as Ct, DeleteRangeMoveLeftCommand as It, DeleteRangeMoveUpCommand as Rt, InsertRangeMoveDownCommand as Dt, InsertRangeMoveRightCommand as Mt, DeltaRowHeightCommand as Ke, SetRowHeightCommand as ke, DeltaColumnWidthCommand as bt, SetColWidthCommand as Ot, SetRowHiddenCommand as Pt, SetSpecificRowsVisibleCommand as Et, SetSpecificColsVisibleCommand as yt, SetColHiddenCommand as Tt, SetRowVisibleMutation as Xn, SetRowHiddenMutation as Hn, SetColVisibleMutation as zn, SetColHiddenMutation as Kn, SetWorksheetRowHeightMutation as kn, SetWorksheetColWidthMutation as Jn, SetWorksheetActiveOperation as Zn, SheetInterceptorService as qn, SetFrozenMutation as Qn, WorkbookViewPermission as ut, WorksheetViewPermission as Fe } from "@univerjs/sheets";
15
- import L, { useEffect as Qe, forwardRef as Ut, useRef as At, createElement as Nt, useState as Je } from "react";
16
- import { MessageType as Re, RadioGroup as er, Radio as Ye } from "@univerjs/design";
14
+ import { getSheetCommandTarget as se, SelectionManagerService as Fn, WorkbookEditablePermission as He, WorksheetEditPermission as Oe, RangeProtectionPermissionEditPoint as Yn, InsertRowCommand as wt, InsertColCommand as _t, RemoveRowCommand as vt, RemoveColCommand as St, DeleteRangeMoveLeftCommand as Ct, DeleteRangeMoveUpCommand as It, InsertRangeMoveDownCommand as Rt, InsertRangeMoveRightCommand as Dt, DeltaRowHeightCommand as ze, SetRowHeightCommand as Ke, DeltaColumnWidthCommand as Mt, SetColWidthCommand as bt, SetRowHiddenCommand as Ot, SetSpecificRowsVisibleCommand as Pt, SetSpecificColsVisibleCommand as Et, SetColHiddenCommand as yt, SetRowVisibleMutation as Xn, SetRowHiddenMutation as Hn, SetColVisibleMutation as zn, SetColHiddenMutation as Kn, SetWorksheetRowHeightMutation as kn, SetWorksheetColWidthMutation as Jn, SetWorksheetActiveOperation as Zn, SheetInterceptorService as qn, SetFrozenMutation as Qn, WorkbookViewPermission as lt, WorksheetViewPermission as xe } from "@univerjs/sheets";
15
+ import L, { useEffect as qe, forwardRef as Tt, useRef as Ut, createElement as At, useState as ke } from "react";
16
+ import { MessageType as Re, RadioGroup as er, Radio as Fe } from "@univerjs/design";
17
17
  import De from "clsx";
18
18
  const j = {
19
19
  id: "sheet.operation.clear-drawing-transformer",
@@ -25,11 +25,11 @@ const j = {
25
25
  (s = (i = n.getRenderById(t)) == null ? void 0 : i.scene.getTransformer()) == null || s.debounceRefreshControls();
26
26
  }), !0;
27
27
  }
28
- }, et = {
28
+ }, Qe = {
29
29
  id: "sheet.command.remove-sheet-image",
30
30
  type: G.COMMAND,
31
31
  handler: (r, e) => {
32
- const n = r.get(W), t = r.get(ae), i = r.get(X);
32
+ const n = r.get(B), t = r.get(ae), i = r.get(X);
33
33
  if (!e) return !1;
34
34
  const { drawings: s } = e, o = [];
35
35
  s.forEach((f) => {
@@ -49,7 +49,7 @@ const j = {
49
49
  ]
50
50
  }), !0) : !1;
51
51
  }
52
- }, jt = "COMPONENT_SHEET_DRAWING_PANEL", Lt = {
52
+ }, Nt = "COMPONENT_SHEET_DRAWING_PANEL", jt = {
53
53
  id: "sidebar.operation.sheet-image",
54
54
  type: G.COMMAND,
55
55
  handler: async (r, e) => {
@@ -59,7 +59,7 @@ const j = {
59
59
  case "open":
60
60
  n.open({
61
61
  header: { title: t.t("sheetImage.panel.title") },
62
- children: { label: jt },
62
+ children: { label: Nt },
63
63
  onClose: () => {
64
64
  s.focusDrawing(null);
65
65
  },
@@ -73,12 +73,12 @@ const j = {
73
73
  }
74
74
  return !0;
75
75
  }
76
- }, Bt = {
76
+ }, Lt = {
77
77
  id: "sheet.operation.edit-sheet-image",
78
78
  type: G.OPERATION,
79
79
  handler: (r, e) => {
80
- const n = r.get(H), t = r.get(W);
81
- return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Lt.id, { value: "open" }), !0);
80
+ const n = r.get(H), t = r.get(B);
81
+ return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(jt.id, { value: "open" }), !0);
82
82
  }
83
83
  }, tr = "univer-upload-loading", nr = "univer-upload-loading-body", rr = "univer-upload-loading-body-animation", ir = "univer-UniverCircleAnimation", sr = "univer-upload-loading-body-text", Me = {
84
84
  uploadLoading: tr,
@@ -87,8 +87,8 @@ const j = {
87
87
  univerCircleAnimation: ir,
88
88
  uploadLoadingBodyText: sr
89
89
  }, or = () => {
90
- const r = q(ft), e = q(pe), [n, t] = L.useState(0);
91
- return Qe(() => {
90
+ const r = q(ht), e = q(pe), [n, t] = L.useState(0);
91
+ return qe(() => {
92
92
  const i = r.change$.subscribe((s) => {
93
93
  t(s);
94
94
  });
@@ -102,14 +102,14 @@ var ar = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, dr = (r, e
102
102
  (o = r[s]) && (i = (t ? o(e, n, i) : o(i)) || i);
103
103
  return t && i && ar(e, n, i), i;
104
104
  }, Q = (r, e) => (n, t) => e(n, t, r);
105
- let Pe = class extends qt {
105
+ let Pe = class extends Zt {
106
106
  constructor(e, n, t, i, s, o, a) {
107
107
  super();
108
108
  K(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
109
109
  this._injector = e, this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = i, this._univerInstanceService = s, this._contextService = o, this._uiPartsService = a, this._init();
110
110
  }
111
111
  _init() {
112
- this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(ct(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Y.UNIVER_SHEET).pipe(ct(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Y.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(An.CONTENT, () => xn(or, this._injector));
112
+ this._univerInstanceService.getCurrentTypeOfUnit$(Y.UNIVER_SHEET).pipe(at(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(Y.UNIVER_SHEET).pipe(at(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(Y.UNIVER_SHEET).forEach((e) => this._create(e)), this._uiPartsService.registerComponent(An.CONTENT, () => xn(or, this._injector));
113
113
  }
114
114
  _dispose(e) {
115
115
  const n = e.getUnitId();
@@ -138,8 +138,8 @@ let Pe = class extends qt {
138
138
  return;
139
139
  const i = [];
140
140
  this.disposeWithMe(
141
- Ve(
142
- t.onCreateControlObservable.add(() => {
141
+ qt(
142
+ t.createControl$.subscribe(() => {
143
143
  if (this._contextService.setContextValue(fe, !0), this._hasCropObject(n))
144
144
  return;
145
145
  const o = t.getSelectedObjectMap();
@@ -169,17 +169,13 @@ let Pe = class extends qt {
169
169
  })
170
170
  )
171
171
  ), this.disposeWithMe(
172
- Ve(
173
- t.onClearControlObservable.add(() => {
174
- i.forEach((o) => o.dispose()), this._contextService.setContextValue(fe, !1), this._drawingManagerService.focusDrawing(null);
175
- })
176
- )
172
+ t.clearControl$.subscribe(() => {
173
+ i.forEach((o) => o.dispose()), this._contextService.setContextValue(fe, !1), this._drawingManagerService.focusDrawing(null);
174
+ })
177
175
  ), this.disposeWithMe(
178
- Ve(
179
- t.onChangingObservable.add(() => {
180
- i.forEach((o) => o.dispose());
181
- })
182
- )
176
+ t.changing$.subscribe(() => {
177
+ i.forEach((o) => o.dispose());
178
+ })
183
179
  );
184
180
  }
185
181
  _getImageMenuItems(e, n, t) {
@@ -187,14 +183,14 @@ let Pe = class extends qt {
187
183
  {
188
184
  label: "image-popup.edit",
189
185
  index: 0,
190
- commandId: Bt.id,
186
+ commandId: Lt.id,
191
187
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
192
188
  disable: !1
193
189
  },
194
190
  {
195
191
  label: "image-popup.delete",
196
192
  index: 1,
197
- commandId: et.id,
193
+ commandId: Qe.id,
198
194
  commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
199
195
  disable: !1
200
196
  },
@@ -217,15 +213,15 @@ let Pe = class extends qt {
217
213
  };
218
214
  Pe = dr([
219
215
  de(le.Steady, Pe),
220
- Q(0, B(qe)),
216
+ Q(0, $(Ze)),
221
217
  Q(1, H),
222
- Q(2, B(bn)),
218
+ Q(2, $(bn)),
223
219
  Q(3, te),
224
220
  Q(4, ce),
225
- Q(5, ht),
226
- Q(6, B(Nn))
221
+ Q(5, gt),
222
+ Q(6, $(Nn))
227
223
  ], Pe);
228
- const We = {
224
+ const Be = {
229
225
  id: "sheet.operation.insert-float-image",
230
226
  type: G.OPERATION,
231
227
  handler: (r, e) => !0
@@ -233,11 +229,11 @@ const We = {
233
229
  id: "sheet.operation.insert-cell-image",
234
230
  type: G.OPERATION,
235
231
  handler: (r, e) => !0
236
- }, tt = {
232
+ }, et = {
237
233
  id: "sheet.command.insert-sheet-image",
238
234
  type: G.COMMAND,
239
235
  handler: (r, e) => {
240
- const n = r.get(W), t = r.get(ae), i = r.get(X);
236
+ const n = r.get(B), t = r.get(ae), i = r.get(X);
241
237
  if (!e) return !1;
242
238
  const s = e.drawings, o = s.map((f) => f.unitId), a = i.getBatchAddOp(s), { unitId: c, subUnitId: g, undo: l, redo: d, objects: m } = a;
243
239
  return n.syncExecuteCommand(O.id, { op: d, unitId: c, subUnitId: g, objects: m, type: P.INSERT }) ? (t.pushUndoRedo({
@@ -252,11 +248,11 @@ const We = {
252
248
  ]
253
249
  }), !0) : !1;
254
250
  }
255
- }, $e = {
251
+ }, We = {
256
252
  id: "sheet.command.set-sheet-image",
257
253
  type: G.COMMAND,
258
254
  handler: (r, e) => {
259
- const n = r.get(W), t = r.get(ae), i = r.get(X);
255
+ const n = r.get(B), t = r.get(ae), i = r.get(X);
260
256
  if (!e) return !1;
261
257
  const { drawings: s } = e, o = i.getBatchUpdateOp(s), { unitId: a, subUnitId: c, undo: g, redo: l, objects: d } = o;
262
258
  return n.syncExecuteCommand(O.id, { unitId: a, subUnitId: c, op: l, objects: d, type: P.UPDATE }) ? (t.pushUndoRedo({
@@ -271,11 +267,11 @@ const We = {
271
267
  ]
272
268
  }), !0) : !1;
273
269
  }
274
- }, Wt = {
270
+ }, $t = {
275
271
  id: "sheet.command.set-drawing-arrange",
276
272
  type: G.COMMAND,
277
273
  handler: (r, e) => {
278
- const n = r.get(W), t = r.get(ae);
274
+ const n = r.get(B), t = r.get(ae);
279
275
  if (!e) return !1;
280
276
  const i = r.get(X), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: c } = e, g = { unitId: s, subUnitId: o, drawingIds: a };
281
277
  let l;
@@ -353,11 +349,11 @@ function ur(r) {
353
349
  });
354
350
  }), e;
355
351
  }
356
- const $t = {
352
+ const Bt = {
357
353
  id: "sheet.command.group-sheet-image",
358
354
  type: G.COMMAND,
359
355
  handler: (r, e) => {
360
- const n = r.get(W), t = r.get(ae), i = r.get(X);
356
+ const n = r.get(B), t = r.get(ae), i = r.get(X);
361
357
  if (!e) return !1;
362
358
  const s = [];
363
359
  e.forEach(({ parent: u, children: f }) => {
@@ -378,11 +374,11 @@ const $t = {
378
374
  ]
379
375
  }), !0) : !1;
380
376
  }
381
- }, Vt = {
377
+ }, Wt = {
382
378
  id: "sheet.command.ungroup-sheet-image",
383
379
  type: G.COMMAND,
384
380
  handler: (r, e) => {
385
- const n = r.get(W), t = r.get(ae), i = r.get(X);
381
+ const n = r.get(B), t = r.get(ae), i = r.get(X);
386
382
  if (!e) return !1;
387
383
  const s = [];
388
384
  e.forEach(({ parent: u, children: f }) => {
@@ -421,12 +417,12 @@ function V(r, e) {
421
417
  });
422
418
  if (u == null)
423
419
  return;
424
- const { startX: f, startY: h } = m, { startX: p, startY: S } = u, I = Z(f + s, 1), v = Z(h + a, 1);
425
- let C = Z(p + g - I, 1), _ = Z(S + d - v, 1);
426
- return m.startX === u.endX && (C = 0), m.startY === u.endY && (_ = 0), {
427
- left: I,
420
+ const { startX: f, startY: h } = m, { startX: p, startY: S } = u, C = Z(f + s, 1), v = Z(h + a, 1);
421
+ let R = Z(p + g - C, 1), _ = Z(S + d - v, 1);
422
+ return m.startX === u.endX && (R = 0), m.startY === u.endY && (_ = 0), {
423
+ left: C,
428
424
  top: v,
429
- width: C,
425
+ width: R,
430
426
  height: _
431
427
  };
432
428
  }
@@ -471,15 +467,15 @@ let Ee = class extends ue {
471
467
  _initCommandListeners() {
472
468
  this.disposeWithMe(
473
469
  this._commandService.onCommandExecuted(async (r) => {
474
- if (r.id === Ae.id || r.id === We.id) {
470
+ if (r.id === Ae.id || r.id === Be.id) {
475
471
  const e = r.params;
476
472
  if (e.files == null)
477
473
  return;
478
474
  const n = e.files.length;
479
- if (n > st) {
475
+ if (n > it) {
480
476
  this._messageService.show({
481
477
  type: Re.Error,
482
- content: this._localeService.t("update-status.exceedMaxCount", String(st))
478
+ content: this._localeService.t("update-status.exceedMaxCount", String(it))
483
479
  });
484
480
  return;
485
481
  }
@@ -498,15 +494,15 @@ let Ee = class extends ue {
498
494
  let e;
499
495
  try {
500
496
  e = await this._imageIoService.saveImage(r);
501
- } catch (I) {
502
- const v = I.message;
503
- v === xe.ERROR_EXCEED_SIZE ? this._messageService.show({
497
+ } catch (C) {
498
+ const v = C.message;
499
+ v === Ge.ERROR_EXCEED_SIZE ? this._messageService.show({
504
500
  type: Re.Error,
505
501
  content: this._localeService.t("update-status.exceedMaxSize", String(pn / (1024 * 1024)))
506
- }) : v === xe.ERROR_IMAGE_TYPE ? this._messageService.show({
502
+ }) : v === Ge.ERROR_IMAGE_TYPE ? this._messageService.show({
507
503
  type: Re.Error,
508
504
  content: this._localeService.t("update-status.invalidImageType")
509
- }) : v === xe.ERROR_IMAGE && this._messageService.show({
505
+ }) : v === Ge.ERROR_IMAGE && this._messageService.show({
510
506
  type: Re.Error,
511
507
  content: this._localeService.t("update-status.invalidImage")
512
508
  });
@@ -522,9 +518,9 @@ let Ee = class extends ue {
522
518
  const { width: u, height: f } = m.scene;
523
519
  this._imageIoService.addImageSourceCache(a, o, d);
524
520
  let h = 1;
525
- if (g > ot || l > at) {
526
- const I = ot / g, v = at / l;
527
- h = Math.max(I, v);
521
+ if (g > st || l > ot) {
522
+ const C = st / g, v = ot / l;
523
+ h = Math.max(C, v);
528
524
  }
529
525
  const p = this._getImagePosition(g * h, l * h, u, f);
530
526
  if (p == null)
@@ -539,7 +535,7 @@ let Ee = class extends ue {
539
535
  transform: V(p, this._selectionRenderService),
540
536
  sheetTransform: p
541
537
  };
542
- this._commandService.executeCommand(tt.id, {
538
+ this._commandService.executeCommand(et.id, {
543
539
  unitId: t,
544
540
  drawings: [S]
545
541
  });
@@ -598,7 +594,7 @@ let Ee = class extends ue {
598
594
  _updateOrderListener() {
599
595
  this._drawingManagerService.featurePluginOrderUpdate$.subscribe((r) => {
600
596
  const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: i } = r;
601
- this._commandService.executeCommand(Wt.id, {
597
+ this._commandService.executeCommand($t.id, {
602
598
  unitId: e,
603
599
  subUnitId: n,
604
600
  drawingIds: t,
@@ -625,7 +621,7 @@ let Ee = class extends ue {
625
621
  sheetTransform: { ...g }
626
622
  };
627
623
  e.push(l);
628
- }), e.length > 0 && this._commandService.executeCommand($e.id, {
624
+ }), e.length > 0 && this._commandService.executeCommand(We.id, {
629
625
  unitId: r[0].unitId,
630
626
  drawings: e
631
627
  }));
@@ -633,11 +629,11 @@ let Ee = class extends ue {
633
629
  }
634
630
  _groupDrawingListener() {
635
631
  this._drawingManagerService.featurePluginGroupUpdate$.subscribe((r) => {
636
- this._commandService.executeCommand($t.id, r);
632
+ this._commandService.executeCommand(Bt.id, r);
637
633
  const { unitId: e, subUnitId: n, drawingId: t } = r[0].parent;
638
634
  this._drawingManagerService.focusDrawing([{ unitId: e, subUnitId: n, drawingId: t }]);
639
635
  }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((r) => {
640
- this._commandService.executeCommand(Vt.id, r);
636
+ this._commandService.executeCommand(Wt.id, r);
641
637
  });
642
638
  }
643
639
  _focusDrawingListener() {
@@ -650,16 +646,16 @@ let Ee = class extends ue {
650
646
  };
651
647
  Ee = hr([
652
648
  de(le.Rendered, Ee),
653
- F(0, W),
649
+ F(0, B),
654
650
  F(1, ce),
655
- F(2, B(Fn)),
656
- F(3, Be),
657
- F(4, ft),
651
+ F(2, $(Fn)),
652
+ F(3, $e),
653
+ F(4, ht),
658
654
  F(5, X),
659
655
  F(6, H),
660
- F(7, ht),
656
+ F(7, gt),
661
657
  F(8, jn),
662
- F(9, B(pe)),
658
+ F(9, $(pe)),
663
659
  F(10, te)
664
660
  ], Ee);
665
661
  var x = function() {
@@ -677,13 +673,13 @@ var x = function() {
677
673
  for (var i = 0, t = Object.getOwnPropertySymbols(r); i < t.length; i++)
678
674
  e.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, t[i]) && (n[t[i]] = r[t[i]]);
679
675
  return n;
680
- }, Gt = Ut(function(r, e) {
681
- var n = r.icon, t = r.id, i = r.className, s = r.extend, o = fr(r, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(i || "").trim(), c = At("_".concat(_r()));
682
- return xt(n, "".concat(t), { defIds: n.defIds, idSuffix: c.current }, x({ ref: e, className: a }, o), s);
676
+ }, Vt = Tt(function(r, e) {
677
+ var n = r.icon, t = r.id, i = r.className, s = r.extend, o = fr(r, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(i || "").trim(), c = Ut("_".concat(_r()));
678
+ return Gt(n, "".concat(t), { defIds: n.defIds, idSuffix: c.current }, x({ ref: e, className: a }, o), s);
683
679
  });
684
- function xt(r, e, n, t, i) {
685
- return Nt(r.tag, x(x({ key: e }, pr(r, n, i)), t), (wr(r, n).children || []).map(function(s, o) {
686
- return xt(s, "".concat(e, "-").concat(r.tag, "-").concat(o), n, void 0, i);
680
+ function Gt(r, e, n, t, i) {
681
+ return At(r.tag, x(x({ key: e }, pr(r, n, i)), t), (wr(r, n).children || []).map(function(s, o) {
682
+ return Gt(s, "".concat(e, "-").concat(r.tag, "-").concat(o), n, void 0, i);
687
683
  }));
688
684
  }
689
685
  function pr(r, e, n) {
@@ -704,22 +700,22 @@ function wr(r, e) {
704
700
  function _r() {
705
701
  return Math.random().toString(36).substring(2, 8);
706
702
  }
707
- Gt.displayName = "UniverIcon";
708
- var vr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, Ft = Ut(function(r, e) {
709
- return Nt(Gt, Object.assign({}, r, {
703
+ Vt.displayName = "UniverIcon";
704
+ var vr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, xt = Tt(function(r, e) {
705
+ return At(Vt, Object.assign({}, r, {
710
706
  id: "add-image-single",
711
707
  ref: e,
712
708
  icon: vr
713
709
  }));
714
710
  });
715
- Ft.displayName = "AddImageSingle";
716
- const Sr = "univer-upload-file-menu", Cr = "univer-upload-file-menu-input", mt = {
711
+ xt.displayName = "AddImageSingle";
712
+ const Sr = "univer-upload-file-menu", Cr = "univer-upload-file-menu-input", ut = {
717
713
  uploadFileMenu: Sr,
718
714
  uploadFileMenuInput: Cr
719
- }, Yt = "COMPONENT_UPLOAD_FILE_MENU";
715
+ }, Ft = "COMPONENT_UPLOAD_FILE_MENU";
720
716
  var Ne = /* @__PURE__ */ ((r) => (r[r.cellImage = 0] = "cellImage", r[r.floatImage = 1] = "floatImage", r))(Ne || {});
721
717
  const Ir = (r) => {
722
- const { type: e } = r, n = q(W), t = At(null), i = () => {
718
+ const { type: e } = r, n = q(B), t = Ut(null), i = () => {
723
719
  var a;
724
720
  (a = t.current) == null || a.click();
725
721
  }, s = _n.map((a) => `.${a.replace("image/", "")}`).join(","), o = (a) => {
@@ -727,48 +723,48 @@ const Ir = (r) => {
727
723
  if (c == null)
728
724
  return;
729
725
  const g = Array.from(c);
730
- e === Ne.floatImage ? n.executeCommand(We.id, { files: g }) : e === Ne.cellImage && n.executeCommand(Ae.id, { files: g }), t.current && (t.current.value = "");
726
+ e === Ne.floatImage ? n.executeCommand(Be.id, { files: g }) : e === Ne.cellImage && n.executeCommand(Ae.id, { files: g }), t.current && (t.current.value = "");
731
727
  };
732
- return /* @__PURE__ */ L.createElement("div", { onClick: i, className: mt.uploadFileMenu }, /* @__PURE__ */ L.createElement(
728
+ return /* @__PURE__ */ L.createElement("div", { onClick: i, className: ut.uploadFileMenu }, /* @__PURE__ */ L.createElement(
733
729
  "input",
734
730
  {
735
731
  type: "file",
736
- className: mt.uploadFileMenuInput,
732
+ className: ut.uploadFileMenuInput,
737
733
  ref: t,
738
734
  onChange: o,
739
735
  accept: s,
740
736
  multiple: !0
741
737
  }
742
738
  ));
743
- }, Xt = "addition-and-subtraction-single", Ht = "sheet.menu.image";
739
+ }, Yt = "addition-and-subtraction-single", Xt = "sheet.menu.image";
744
740
  function Rr(r) {
745
741
  return {
746
- id: Ht,
747
- type: pt.SUBITEMS,
742
+ id: Xt,
743
+ type: ft.SUBITEMS,
748
744
  positions: [Ln.TOOLBAR_START],
749
- group: Bn.TOOLBAR_FORMULAS_INSERT,
750
- icon: Xt,
745
+ group: $n.TOOLBAR_FORMULAS_INSERT,
746
+ icon: Yt,
751
747
  tooltip: "sheetImage.title",
752
- hidden$: wt(r, Y.UNIVER_SHEET),
753
- disabled$: On(r, { workbookTypes: [ze], worksheetTypes: [Oe], rangeTypes: [Yn] })
748
+ hidden$: pt(r, Y.UNIVER_SHEET),
749
+ disabled$: On(r, { workbookTypes: [He], worksheetTypes: [Oe], rangeTypes: [Yn] })
754
750
  };
755
751
  }
756
752
  function Dr(r) {
757
753
  return {
758
- id: We.id,
754
+ id: Be.id,
759
755
  title: "sheetImage.upload.float",
760
- type: pt.SELECTOR,
756
+ type: ft.SELECTOR,
761
757
  label: {
762
- name: Yt,
758
+ name: Ft,
763
759
  props: {
764
760
  type: Ne.floatImage
765
761
  }
766
762
  },
767
- positions: [Ht],
768
- hidden$: wt(r, Y.UNIVER_SHEET)
763
+ positions: [Xt],
764
+ hidden$: pt(r, Y.UNIVER_SHEET)
769
765
  };
770
766
  }
771
- const Mr = "univer-image-common-panel", br = "univer-image-common-panel-grid", Or = "univer-image-common-panel-border", Pr = "univer-image-common-panel-title", Er = "univer-image-common-panel-row", yr = "univer-image-common-panel-row-vertical", Tr = "univer-image-common-panel-column", Ur = "univer-image-common-panel-column-center", Ar = "univer-image-common-panel-inline", Nr = "univer-image-common-panel-span2", jr = "univer-image-common-panel-span3", Lr = "univer-image-common-panel-input", Br = "univer-sheet-image-menu", Wr = "univer-sheet-image-menu-input", k = {
767
+ const Mr = "univer-image-common-panel", br = "univer-image-common-panel-grid", Or = "univer-image-common-panel-border", Pr = "univer-image-common-panel-title", Er = "univer-image-common-panel-row", yr = "univer-image-common-panel-row-vertical", Tr = "univer-image-common-panel-column", Ur = "univer-image-common-panel-column-center", Ar = "univer-image-common-panel-inline", Nr = "univer-image-common-panel-span2", jr = "univer-image-common-panel-span3", Lr = "univer-image-common-panel-input", $r = "univer-sheet-image-menu", Br = "univer-sheet-image-menu-input", k = {
772
768
  imageCommonPanel: Mr,
773
769
  imageCommonPanelGrid: br,
774
770
  imageCommonPanelBorder: Or,
@@ -781,38 +777,38 @@ const Mr = "univer-image-common-panel", br = "univer-image-common-panel-grid", O
781
777
  imageCommonPanelSpan2: Nr,
782
778
  imageCommonPanelSpan3: jr,
783
779
  imageCommonPanelInput: Lr,
784
- sheetImageMenu: Br,
785
- sheetImageMenuInput: Wr
786
- }, $r = (r) => {
780
+ sheetImageMenu: $r,
781
+ sheetImageMenuInput: Br
782
+ }, Wr = (r) => {
787
783
  var v;
788
- const e = q(W), n = q(pe), t = q(H), i = q(te), { drawings: s } = r, o = s[0];
784
+ const e = q(B), n = q(pe), t = q(H), i = q(te), { drawings: s } = r, o = s[0];
789
785
  if (o == null)
790
786
  return;
791
787
  const { unitId: a } = o, c = i.getRenderById(a), g = c == null ? void 0 : c.scene;
792
788
  if (g == null)
793
789
  return;
794
- const l = g.getTransformerByCreate(), [d, m] = Je(!0), u = (v = o.anchorType) != null ? v : b.Position, [f, h] = Je(u);
795
- function p(C, _) {
790
+ const l = g.getTransformerByCreate(), [d, m] = ke(!0), u = (v = o.anchorType) != null ? v : b.Position, [f, h] = ke(u);
791
+ function p(R, _) {
796
792
  const M = [];
797
- return C.forEach((w) => {
793
+ return R.forEach((w) => {
798
794
  const { oKey: y } = w, D = _.getDrawingOKey(y);
799
795
  if (D == null)
800
796
  return M.push(null), !0;
801
- const { unitId: T, subUnitId: U, drawingId: E, drawingType: R, anchorType: A, sheetTransform: z } = D;
797
+ const { unitId: T, subUnitId: U, drawingId: E, drawingType: I, anchorType: A, sheetTransform: z } = D;
802
798
  M.push({
803
799
  unitId: T,
804
800
  subUnitId: U,
805
801
  drawingId: E,
806
802
  anchorType: A,
807
803
  sheetTransform: z,
808
- drawingType: R
804
+ drawingType: I
809
805
  });
810
806
  }), M;
811
807
  }
812
- Qe(() => {
813
- const C = l.onClearControlObservable.add((M) => {
808
+ qe(() => {
809
+ const R = l.clearControl$.subscribe((M) => {
814
810
  M === !0 && m(!1);
815
- }), _ = l.onChangeStartObservable.add((M) => {
811
+ }), _ = l.changeStart$.subscribe((M) => {
816
812
  var D;
817
813
  const { objects: w } = M, y = p(w, t);
818
814
  if (y.length === 0)
@@ -824,11 +820,11 @@ const Mr = "univer-image-common-panel", br = "univer-image-common-panel-grid", O
824
820
  }
825
821
  });
826
822
  return () => {
827
- _ == null || _.dispose(), C == null || C.dispose();
823
+ _.unsubscribe(), R.unsubscribe();
828
824
  };
829
825
  }, []);
830
- function S(C) {
831
- h(C);
826
+ function S(R) {
827
+ h(R);
832
828
  const _ = t.getFocusDrawings();
833
829
  if (_.length === 0)
834
830
  return;
@@ -836,33 +832,30 @@ const Mr = "univer-image-common-panel", br = "univer-image-common-panel-grid", O
836
832
  unitId: w.unitId,
837
833
  subUnitId: w.subUnitId,
838
834
  drawingId: w.drawingId,
839
- anchorType: C
835
+ anchorType: R
840
836
  }));
841
- e.executeCommand($e.id, {
837
+ e.executeCommand(We.id, {
842
838
  unitId: _[0].unitId,
843
839
  drawings: M
844
840
  });
845
841
  }
846
- const I = (C) => C ? "block" : "none";
847
- return /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelGrid, k.imageCommonPanelBorder), style: { display: I(d) } }, /* @__PURE__ */ L.createElement("div", { className: k.imageCommonPanelRow }, /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelColumn, k.imageCommonPanelTitle) }, /* @__PURE__ */ L.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelRow) }, /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelColumn) }, /* @__PURE__ */ L.createElement(er, { value: f, onChange: S, direction: "vertical" }, /* @__PURE__ */ L.createElement(Ye, { value: b.Both }, n.t("drawing-anchor.both")), /* @__PURE__ */ L.createElement(Ye, { value: b.Position }, n.t("drawing-anchor.position")), /* @__PURE__ */ L.createElement(Ye, { value: b.None }, n.t("drawing-anchor.none"))))));
842
+ const C = (R) => R ? "block" : "none";
843
+ return /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelGrid, k.imageCommonPanelBorder), style: { display: C(d) } }, /* @__PURE__ */ L.createElement("div", { className: k.imageCommonPanelRow }, /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelColumn, k.imageCommonPanelTitle) }, /* @__PURE__ */ L.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelRow) }, /* @__PURE__ */ L.createElement("div", { className: De(k.imageCommonPanelColumn) }, /* @__PURE__ */ L.createElement(er, { value: f, onChange: S, direction: "vertical" }, /* @__PURE__ */ L.createElement(Fe, { value: b.Both }, n.t("drawing-anchor.both")), /* @__PURE__ */ L.createElement(Fe, { value: b.Position }, n.t("drawing-anchor.position")), /* @__PURE__ */ L.createElement(Fe, { value: b.None }, n.t("drawing-anchor.none"))))));
848
844
  }, Vr = () => {
849
- const r = q(H), e = r.getFocusDrawings();
850
- if (e == null || e.length === 0)
851
- return;
852
- const [n, t] = Je(e);
853
- return Qe(() => {
845
+ const r = q(H), e = r.getFocusDrawings(), [n, t] = ke(e);
846
+ return qe(() => {
854
847
  const i = r.focus$.subscribe((s) => {
855
848
  t(s);
856
849
  });
857
850
  return () => {
858
851
  i.unsubscribe();
859
852
  };
860
- }, []), /* @__PURE__ */ L.createElement("div", { className: k.imageCommonPanel }, /* @__PURE__ */ L.createElement(mn, { drawings: n }), /* @__PURE__ */ L.createElement($r, { drawings: n }));
853
+ }, []), !!(n != null && n.length) && /* @__PURE__ */ L.createElement("div", { className: k.imageCommonPanel }, /* @__PURE__ */ L.createElement(mn, { drawings: n }), /* @__PURE__ */ L.createElement(Wr, { drawings: n }));
861
854
  }, we = {
862
855
  id: "sheet.command.move-drawing",
863
856
  type: G.COMMAND,
864
857
  handler: (r, e) => {
865
- const n = r.get(W), t = r.get(X), i = r.get(Be), { direction: s } = e, o = t.getFocusDrawings();
858
+ const n = r.get(B), t = r.get(X), i = r.get($e), { direction: s } = e, o = t.getFocusDrawings();
866
859
  if (o.length === 0)
867
860
  return !1;
868
861
  const a = o[0].unitId, c = o.map((l) => {
@@ -876,16 +869,16 @@ const Mr = "univer-image-common-panel", br = "univer-image-common-panel-grid", O
876
869
  sheetTransform: N(m, i)
877
870
  };
878
871
  }).filter((l) => l != null);
879
- return n.syncExecuteCommand($e.id, {
872
+ return n.syncExecuteCommand(We.id, {
880
873
  unitId: a,
881
874
  drawings: c
882
875
  }) ? (n.syncExecuteCommand(j.id, [a]), !0) : !1;
883
876
  }
884
- }, zt = {
877
+ }, Ht = {
885
878
  id: "sheet.command.delete-drawing",
886
879
  type: G.COMMAND,
887
880
  handler: (r) => {
888
- const e = r.get(W), t = r.get(X).getFocusDrawings();
881
+ const e = r.get(B), t = r.get(X).getFocusDrawings();
889
882
  if (t.length === 0)
890
883
  return !1;
891
884
  const i = t[0].unitId, s = t.map((o) => {
@@ -897,7 +890,7 @@ const Mr = "univer-image-common-panel", br = "univer-image-common-panel-grid", O
897
890
  drawingType: l
898
891
  };
899
892
  });
900
- return e.executeCommand(et.id, {
893
+ return e.executeCommand(Qe.id, {
901
894
  unitId: i,
902
895
  drawings: s
903
896
  });
@@ -947,7 +940,7 @@ const Gr = {
947
940
  direction: J.RIGHT
948
941
  }
949
942
  }, Xr = {
950
- id: zt.id,
943
+ id: Ht.id,
951
944
  description: "shortcut.sheet.drawing-delete",
952
945
  group: "4_sheet-drawing-view",
953
946
  // when focusing on any other input tag do not trigger this shortcut
@@ -967,7 +960,7 @@ let he = class extends ue {
967
960
  }
968
961
  _initCustomComponents() {
969
962
  const r = this._componentManager;
970
- this.disposeWithMe(r.register(Xt, Ft)), this.disposeWithMe(r.register(Yt, Ir)), this.disposeWithMe(r.register(jt, Vr));
963
+ this.disposeWithMe(r.register(Yt, xt)), this.disposeWithMe(r.register(Ft, Ir)), this.disposeWithMe(r.register(Nt, Vr));
971
964
  }
972
965
  _initMenus() {
973
966
  const { menu: r = {} } = this._config;
@@ -981,19 +974,19 @@ let he = class extends ue {
981
974
  }
982
975
  _initCommands() {
983
976
  [
984
- We,
977
+ Be,
985
978
  Ae,
986
- tt,
987
979
  et,
988
- $e,
989
- Lt,
980
+ Qe,
981
+ We,
982
+ jt,
990
983
  j,
984
+ Lt,
991
985
  Bt,
992
- $t,
993
- Vt,
986
+ Wt,
994
987
  we,
995
- zt,
996
- Wt
988
+ Ht,
989
+ $t
997
990
  ].forEach((r) => this.disposeWithMe(this._commandService.registerCommand(r)));
998
991
  }
999
992
  _initShortcuts() {
@@ -1014,10 +1007,10 @@ let he = class extends ue {
1014
1007
  };
1015
1008
  he = Kr([
1016
1009
  de(le.Rendered, he),
1017
- me(1, B(qe)),
1018
- me(2, B(Wn)),
1019
- me(3, $n),
1020
- me(4, W),
1010
+ me(1, $(Ze)),
1011
+ me(2, $(Bn)),
1012
+ me(3, Wn),
1013
+ me(4, B),
1021
1014
  me(5, Vn)
1022
1015
  ], he);
1023
1016
  var Jr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, qr = (r, e, n, t) => {
@@ -1026,6 +1019,7 @@ var Jr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, qr = (r, e
1026
1019
  return t && i && Jr(e, n, i), i;
1027
1020
  }, re = (r, e) => (n, t) => e(n, t, r);
1028
1021
  const Qr = [
1022
+ wt.id,
1029
1023
  _t.id,
1030
1024
  vt.id,
1031
1025
  St.id,
@@ -1033,15 +1027,14 @@ const Qr = [
1033
1027
  It.id,
1034
1028
  Rt.id,
1035
1029
  Dt.id,
1036
- Mt.id,
1030
+ ze.id,
1037
1031
  Ke.id,
1038
- ke.id,
1032
+ Mt.id,
1039
1033
  bt.id,
1040
1034
  Ot.id,
1041
1035
  Pt.id,
1042
1036
  Et.id,
1043
- yt.id,
1044
- Tt.id
1037
+ yt.id
1045
1038
  ], ei = [
1046
1039
  Xn.id,
1047
1040
  Hn.id,
@@ -1066,50 +1059,50 @@ let ye = class extends ue {
1066
1059
  if (r.params == null)
1067
1060
  return { redos: [], undos: [] };
1068
1061
  const e = r.id;
1069
- if (e === _t.id)
1062
+ if (e === wt.id)
1070
1063
  return this._moveRowInterceptor(r.params, "insert");
1071
- if (e === vt.id)
1064
+ if (e === _t.id)
1072
1065
  return this._moveColInterceptor(r.params, "insert");
1073
- if (e === St.id)
1066
+ if (e === vt.id)
1074
1067
  return this._moveRowInterceptor(r.params, "remove");
1075
- if (e === Ct.id)
1068
+ if (e === St.id)
1076
1069
  return this._moveColInterceptor(r.params, "remove");
1077
- if (e === It.id) {
1070
+ if (e === Ct.id) {
1078
1071
  const { range: n } = r.params;
1079
1072
  return this._getRangeMoveUndo(
1080
1073
  n,
1081
1074
  0
1082
1075
  /* deleteLeft */
1083
1076
  );
1084
- } else if (e === Rt.id) {
1077
+ } else if (e === It.id) {
1085
1078
  const { range: n } = r.params;
1086
1079
  return this._getRangeMoveUndo(
1087
1080
  n,
1088
1081
  1
1089
1082
  /* deleteUp */
1090
1083
  );
1091
- } else if (e === Dt.id) {
1084
+ } else if (e === Rt.id) {
1092
1085
  const { range: n } = r.params;
1093
1086
  return this._getRangeMoveUndo(
1094
1087
  n,
1095
1088
  2
1096
1089
  /* insertDown */
1097
1090
  );
1098
- } else if (e === Mt.id) {
1091
+ } else if (e === Dt.id) {
1099
1092
  const { range: n } = r.params;
1100
1093
  return this._getRangeMoveUndo(
1101
1094
  n,
1102
1095
  3
1103
1096
  /* insertRight */
1104
1097
  );
1105
- } else if (e === Pt.id || e === Et.id) {
1098
+ } else if (e === Ot.id || e === Pt.id) {
1106
1099
  const n = r.params, { unitId: t, subUnitId: i, ranges: s } = n;
1107
1100
  return this._getDrawingUndoForRowVisible(t, i, s);
1108
- } else if (e === yt.id || e === Tt.id) {
1101
+ } else if (e === Et.id || e === yt.id) {
1109
1102
  const n = r.params, { unitId: t, subUnitId: i, ranges: s } = n;
1110
1103
  return this._getDrawingUndoForColVisible(t, i, s);
1111
- } else if (e === Ke.id || e === ke.id || e === bt.id || e === Ot.id) {
1112
- const n = r.params, { unitId: t, subUnitId: i, ranges: s } = n, o = e === Ke.id || e === ke.id;
1104
+ } else if (e === ze.id || e === Ke.id || e === Mt.id || e === bt.id) {
1105
+ const n = r.params, { unitId: t, subUnitId: i, ranges: s } = n, o = e === ze.id || e === Ke.id;
1113
1106
  return this._getDrawingUndoForRowAndColSize(t, i, s, o);
1114
1107
  }
1115
1108
  return { redos: [], undos: [] };
@@ -1147,27 +1140,27 @@ let ye = class extends ue {
1147
1140
  updateDrawings: t,
1148
1141
  deleteDrawings: i
1149
1142
  };
1150
- const { startRow: S, endRow: I, startColumn: v, endColumn: C } = r;
1143
+ const { startRow: S, endRow: C, startColumn: v, endColumn: R } = r;
1151
1144
  let _ = null, M = null;
1152
- if (e === 0 && u >= S && h <= I)
1153
- if (f >= v && p <= C)
1145
+ if (e === 0 && u >= S && h <= C)
1146
+ if (f >= v && p <= R)
1154
1147
  i.push({ unitId: c, subUnitId: g, drawingId: l });
1155
1148
  else {
1156
- const w = this._shrinkCol(s, a, v, C, o);
1149
+ const w = this._shrinkCol(s, a, v, R, o);
1157
1150
  _ = w == null ? void 0 : w.newSheetTransform, M = w == null ? void 0 : w.newTransform;
1158
1151
  }
1159
- else if (e === 1 && f >= v && p <= C)
1160
- if (u >= S && h <= I)
1152
+ else if (e === 1 && f >= v && p <= R)
1153
+ if (u >= S && h <= C)
1161
1154
  i.push({ unitId: c, subUnitId: g, drawingId: l });
1162
1155
  else {
1163
- const w = this._shrinkRow(s, a, S, I, o);
1156
+ const w = this._shrinkRow(s, a, S, C, o);
1164
1157
  _ = w == null ? void 0 : w.newSheetTransform, M = w == null ? void 0 : w.newTransform;
1165
1158
  }
1166
1159
  else if (e === 2) {
1167
- const w = this._expandRow(s, a, S, I, o);
1160
+ const w = this._expandRow(s, a, S, C, o);
1168
1161
  _ = w == null ? void 0 : w.newSheetTransform, M = w == null ? void 0 : w.newTransform;
1169
1162
  } else if (e === 3) {
1170
- const w = this._expandCol(s, a, v, C, o);
1163
+ const w = this._expandCol(s, a, v, R, o);
1171
1164
  _ = w == null ? void 0 : w.newSheetTransform, M = w == null ? void 0 : w.newTransform;
1172
1165
  }
1173
1166
  if (_ != null && M != null) {
@@ -1191,53 +1184,53 @@ let ye = class extends ue {
1191
1184
  if (f === b.None)
1192
1185
  this._remainDrawingSize(u, i, d);
1193
1186
  else {
1194
- const { from: h, to: p } = m, { row: S, column: I } = h, { row: v, column: C } = p;
1187
+ const { from: h, to: p } = m, { row: S, column: C } = h, { row: v, column: R } = p;
1195
1188
  for (let _ = 0; _ < n.length; _++) {
1196
1189
  const M = n[_], { startRow: w, endRow: y, startColumn: D, endColumn: T } = M;
1197
- if (C < D)
1190
+ if (R < D)
1198
1191
  continue;
1199
1192
  if (f === b.Position) {
1200
- let R = null, A = null;
1201
- if (I >= D && I <= T) {
1202
- const z = this._selectionRenderService.attachRangeWithCoord({ startColumn: I, endColumn: T, startRow: h.row, endRow: p.row });
1193
+ let I = null, A = null;
1194
+ if (C >= D && C <= T) {
1195
+ const z = this._selectionRenderService.attachRangeWithCoord({ startColumn: C, endColumn: T, startRow: h.row, endRow: p.row });
1203
1196
  if (z == null)
1204
1197
  return;
1205
1198
  A = { ...u, left: z.startX };
1206
1199
  }
1207
- if (A != null && (R = N(A, this._selectionRenderService), R != null && A != null)) {
1208
- i.push({ ...d, sheetTransform: R, transform: A });
1200
+ if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
1201
+ i.push({ ...d, sheetTransform: I, transform: A });
1209
1202
  break;
1210
1203
  }
1211
1204
  this._remainDrawingSize(u, i, d);
1212
1205
  continue;
1213
1206
  }
1214
- if (I >= D && C <= T)
1207
+ if (C >= D && R <= T)
1215
1208
  continue;
1216
1209
  let U = null, E = null;
1217
- if (I >= D && I <= T) {
1218
- const R = this._selectionRenderService.attachRangeWithCoord({ startColumn: I, endColumn: T, startRow: h.row, endRow: p.row });
1219
- if (R == null)
1210
+ if (C >= D && C <= T) {
1211
+ const I = this._selectionRenderService.attachRangeWithCoord({ startColumn: C, endColumn: T, startRow: h.row, endRow: p.row });
1212
+ if (I == null)
1220
1213
  return;
1221
1214
  E = {
1222
1215
  ...u,
1223
- left: (R == null ? void 0 : R.startX) || 0,
1224
- width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1216
+ left: (I == null ? void 0 : I.startX) || 0,
1217
+ width: ((u == null ? void 0 : u.width) || 0) - I.endX + I.startX
1225
1218
  };
1226
- } else if (C >= D && C <= T) {
1227
- const R = this._selectionRenderService.attachRangeWithCoord({ startColumn: D, endColumn: C, startRow: h.row, endRow: p.row });
1228
- if (R == null)
1219
+ } else if (R >= D && R <= T) {
1220
+ const I = this._selectionRenderService.attachRangeWithCoord({ startColumn: D, endColumn: R, startRow: h.row, endRow: p.row });
1221
+ if (I == null)
1229
1222
  return;
1230
1223
  E = {
1231
1224
  ...u,
1232
- left: R.startX - ((u == null ? void 0 : u.width) || 0)
1225
+ left: I.startX - ((u == null ? void 0 : u.width) || 0)
1233
1226
  };
1234
1227
  } else {
1235
- const R = this._selectionRenderService.attachRangeWithCoord({ startColumn: D, endColumn: T, startRow: h.row, endRow: p.row });
1236
- if (R == null)
1228
+ const I = this._selectionRenderService.attachRangeWithCoord({ startColumn: D, endColumn: T, startRow: h.row, endRow: p.row });
1229
+ if (I == null)
1237
1230
  return;
1238
1231
  if (E = {
1239
1232
  ...u,
1240
- width: ((u == null ? void 0 : u.width) || 0) - R.endX + R.startX
1233
+ width: ((u == null ? void 0 : u.width) || 0) - I.endX + I.startX
1241
1234
  }, U = N(E, this._selectionRenderService), U != null && E != null) {
1242
1235
  s.push({ ...d, sheetTransform: U, transform: E });
1243
1236
  break;
@@ -1285,21 +1278,21 @@ let ye = class extends ue {
1285
1278
  if (f === b.None)
1286
1279
  this._remainDrawingSize(u, i, d);
1287
1280
  else {
1288
- const { from: h, to: p } = m, { row: S, column: I } = h, { row: v, column: C } = p;
1281
+ const { from: h, to: p } = m, { row: S, column: C } = h, { row: v, column: R } = p;
1289
1282
  for (let _ = 0; _ < n.length; _++) {
1290
1283
  const M = n[_], { startRow: w, endRow: y, startColumn: D, endColumn: T } = M;
1291
1284
  if (v < w)
1292
1285
  continue;
1293
1286
  if (f === b.Position) {
1294
- let R = null, A = null;
1287
+ let I = null, A = null;
1295
1288
  if (S >= w && S <= y) {
1296
1289
  const z = this._selectionRenderService.attachRangeWithCoord({ startColumn: h.column, endColumn: p.column, startRow: S, endRow: y });
1297
1290
  if (z == null)
1298
1291
  return;
1299
1292
  A = { ...u, top: z.startY };
1300
1293
  }
1301
- if (A != null && (R = N(A, this._selectionRenderService), R != null && A != null)) {
1302
- i.push({ ...d, sheetTransform: R, transform: A });
1294
+ if (A != null && (I = N(A, this._selectionRenderService), I != null && A != null)) {
1295
+ i.push({ ...d, sheetTransform: I, transform: A });
1303
1296
  break;
1304
1297
  }
1305
1298
  this._remainDrawingSize(u, i, d);
@@ -1309,29 +1302,29 @@ let ye = class extends ue {
1309
1302
  continue;
1310
1303
  let U = null, E = null;
1311
1304
  if (S >= w && S <= y) {
1312
- const R = this._selectionRenderService.attachRangeWithCoord({ startColumn: h.column, endColumn: p.column, startRow: S, endRow: y });
1313
- if (R == null)
1305
+ const I = this._selectionRenderService.attachRangeWithCoord({ startColumn: h.column, endColumn: p.column, startRow: S, endRow: y });
1306
+ if (I == null)
1314
1307
  return;
1315
1308
  E = {
1316
1309
  ...u,
1317
- top: (R == null ? void 0 : R.startY) || 0,
1318
- height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1310
+ top: (I == null ? void 0 : I.startY) || 0,
1311
+ height: ((u == null ? void 0 : u.height) || 0) - I.endY + I.startY
1319
1312
  };
1320
1313
  } else if (v >= w && v <= y) {
1321
- const R = this._selectionRenderService.attachRangeWithCoord({ startColumn: h.column, endColumn: p.column, startRow: w, endRow: v });
1322
- if (R == null)
1314
+ const I = this._selectionRenderService.attachRangeWithCoord({ startColumn: h.column, endColumn: p.column, startRow: w, endRow: v });
1315
+ if (I == null)
1323
1316
  return;
1324
1317
  E = {
1325
1318
  ...u,
1326
- top: R.startY - ((u == null ? void 0 : u.height) || 0)
1319
+ top: I.startY - ((u == null ? void 0 : u.height) || 0)
1327
1320
  };
1328
1321
  } else {
1329
- const R = this._selectionRenderService.attachRangeWithCoord({ startColumn: h.column, endColumn: p.column, startRow: w, endRow: y });
1330
- if (R == null)
1322
+ const I = this._selectionRenderService.attachRangeWithCoord({ startColumn: h.column, endColumn: p.column, startRow: w, endRow: y });
1323
+ if (I == null)
1331
1324
  return;
1332
1325
  if (E = {
1333
1326
  ...u,
1334
- height: ((u == null ? void 0 : u.height) || 0) - R.endY + R.startY
1327
+ height: ((u == null ? void 0 : u.height) || 0) - I.endY + I.startY
1335
1328
  }, U = N(E, this._selectionRenderService), U != null && E != null) {
1336
1329
  s.push({ ...d, sheetTransform: U, transform: E });
1337
1330
  break;
@@ -1367,10 +1360,10 @@ let ye = class extends ue {
1367
1360
  else {
1368
1361
  const { from: d, to: m } = c, { row: u, column: f } = d, { row: h, column: p } = m;
1369
1362
  for (let S = 0; S < n.length; S++) {
1370
- const I = n[S], { startRow: v, endRow: C, startColumn: _, endColumn: M } = I;
1363
+ const C = n[S], { startRow: v, endRow: R, startColumn: _, endColumn: M } = C;
1371
1364
  if (h < v || p < _)
1372
1365
  continue;
1373
- if (l === b.Position && (u <= v && h >= C || f <= _ && p >= M)) {
1366
+ if (l === b.Position && (u <= v && h >= R || f <= _ && p >= M)) {
1374
1367
  this._remainDrawingSize(g, s, a);
1375
1368
  continue;
1376
1369
  }
@@ -1407,23 +1400,23 @@ let ye = class extends ue {
1407
1400
  const f = l[u], { sheetTransform: h, transform: p, anchorType: S = b.Position } = f;
1408
1401
  if (h == null || p == null)
1409
1402
  return;
1410
- let I, v;
1403
+ let C, v;
1411
1404
  if (e === "insert") {
1412
1405
  const _ = this._expandRow(h, p, o, a, S);
1413
- I = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
1406
+ C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
1414
1407
  } else {
1415
1408
  const { from: _, to: M } = h, { row: w } = _, { row: y } = M;
1416
1409
  if (w >= o && y <= a)
1417
1410
  m.push({ unitId: t, subUnitId: i, drawingId: u });
1418
1411
  else {
1419
1412
  const D = this._shrinkRow(h, p, o, a, S);
1420
- I = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
1413
+ C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
1421
1414
  }
1422
1415
  }
1423
- if (!I || !v)
1416
+ if (!C || !v)
1424
1417
  return;
1425
- const C = { unitId: t, subUnitId: i, drawingId: u, transform: v, sheetTransform: I };
1426
- d.push(C);
1418
+ const R = { unitId: t, subUnitId: i, drawingId: u, transform: v, sheetTransform: C };
1419
+ d.push(R);
1427
1420
  }), d.length === 0 && m.length === 0)
1428
1421
  return { redos: [], undos: [] };
1429
1422
  if (d.length > 0) {
@@ -1448,23 +1441,23 @@ let ye = class extends ue {
1448
1441
  const f = l[u], { sheetTransform: h, transform: p, anchorType: S = b.Position } = f;
1449
1442
  if (h == null || p == null)
1450
1443
  return;
1451
- let I, v;
1444
+ let C, v;
1452
1445
  if (e === "insert") {
1453
1446
  const _ = this._expandCol(h, p, o, a, S);
1454
- I = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
1447
+ C = _ == null ? void 0 : _.newSheetTransform, v = _ == null ? void 0 : _.newTransform;
1455
1448
  } else {
1456
1449
  const { from: _, to: M } = h, { column: w } = _, { column: y } = M;
1457
1450
  if (w >= o && y <= a)
1458
1451
  m.push({ unitId: t, subUnitId: i, drawingId: u });
1459
1452
  else {
1460
1453
  const D = this._shrinkCol(h, p, o, a, S);
1461
- I = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
1454
+ C = D == null ? void 0 : D.newSheetTransform, v = D == null ? void 0 : D.newTransform;
1462
1455
  }
1463
1456
  }
1464
- if (!I || !v)
1457
+ if (!C || !v)
1465
1458
  return;
1466
- const C = { unitId: t, subUnitId: i, drawingId: u, transform: v, sheetTransform: I };
1467
- d.push(C);
1459
+ const R = { unitId: t, subUnitId: i, drawingId: u, transform: v, sheetTransform: C };
1460
+ d.push(R);
1468
1461
  }), d.length === 0 && m.length === 0)
1469
1462
  return { redos: [], undos: [] };
1470
1463
  if (d.length > 0) {
@@ -1683,13 +1676,13 @@ let ye = class extends ue {
1683
1676
  return !0;
1684
1677
  const { from: g, to: l } = a, { row: d, column: m } = g, { row: u, column: f } = l;
1685
1678
  for (let h = 0; h < n.length; h++) {
1686
- const p = n[h], { startRow: S, endRow: I, startColumn: v, endColumn: C } = p;
1679
+ const p = n[h], { startRow: S, endRow: C, startColumn: v, endColumn: R } = p;
1687
1680
  if (tn.intersects(
1688
1681
  {
1689
1682
  startRow: S,
1690
- endRow: I,
1683
+ endRow: C,
1691
1684
  startColumn: v,
1692
- endColumn: C
1685
+ endColumn: R
1693
1686
  },
1694
1687
  {
1695
1688
  startRow: d,
@@ -1697,7 +1690,7 @@ let ye = class extends ue {
1697
1690
  startColumn: m,
1698
1691
  endColumn: f
1699
1692
  }
1700
- ) || d > I || m > C) {
1693
+ ) || d > C || m > R) {
1701
1694
  i.push({
1702
1695
  ...o,
1703
1696
  transform: V(a, this._selectionRenderService)
@@ -1710,11 +1703,11 @@ let ye = class extends ue {
1710
1703
  };
1711
1704
  ye = qr([
1712
1705
  de(le.Rendered, ye),
1713
- re(0, W),
1714
- re(1, B(qn)),
1706
+ re(0, B),
1707
+ re(1, $(qn)),
1715
1708
  re(2, X),
1716
1709
  re(3, H),
1717
- re(4, Be),
1710
+ re(4, $e),
1718
1711
  re(5, ce)
1719
1712
  ], ye);
1720
1713
  var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (r, e, n, t) => {
@@ -1732,7 +1725,7 @@ function ii(r, e, n, t) {
1732
1725
  ...r,
1733
1726
  absolute: a
1734
1727
  };
1735
- const { left: c, right: g, top: l, bottom: d } = r, m = t.getFreeze(), { startColumn: u, startRow: f, xSplit: h, ySplit: p } = m, S = n.getNoMergeCellPositionByIndexWithNoHeader(f - p, u - h), I = n.getNoMergeCellPositionByIndexWithNoHeader(f, u), { rowHeaderWidth: v, columnHeaderHeight: C } = n, _ = I.startX - S.startX, M = I.startY - S.startY, { top: w, left: y, viewportScrollX: D, viewportScrollY: T } = o;
1728
+ const { left: c, right: g, top: l, bottom: d } = r, m = t.getFreeze(), { startColumn: u, startRow: f, xSplit: h, ySplit: p } = m, S = n.getNoMergeCellPositionByIndexWithNoHeader(f - p, u - h), C = n.getNoMergeCellPositionByIndexWithNoHeader(f, u), { rowHeaderWidth: v, columnHeaderHeight: R } = n, _ = C.startX - S.startX, M = C.startY - S.startY, { top: w, left: y, viewportScrollX: D, viewportScrollY: T } = o;
1736
1729
  let U, E;
1737
1730
  c < y ? (a.left = !0, U = (_ + v + (c - y)) * i, E = Math.max(
1738
1731
  Math.min(
@@ -1741,22 +1734,22 @@ function ii(r, e, n, t) {
1741
1734
  ),
1742
1735
  (g - D) * i
1743
1736
  )) : (a.left = !1, U = Math.max((c - D) * i, (_ + v) * i), E = Math.max((g - D) * i, (_ + v) * i));
1744
- let R, A;
1745
- return l < w ? (a.top = !0, R = (M + C + (l - w)) * s, A = Math.max(
1737
+ let I, A;
1738
+ return l < w ? (a.top = !0, I = (M + R + (l - w)) * s, A = Math.max(
1746
1739
  Math.min(
1747
- (M + C + (g - w)) * s,
1748
- (M + C) * s
1740
+ (M + R + (g - w)) * s,
1741
+ (M + R) * s
1749
1742
  ),
1750
1743
  (d - T) * s
1751
- )) : (a.top = !1, R = Math.max((l - T) * s, (M + C) * s), A = Math.max((d - T) * s, (M + C) * s)), {
1744
+ )) : (a.top = !1, I = Math.max((l - T) * s, (M + R) * s), A = Math.max((d - T) * s, (M + R) * s)), {
1752
1745
  left: U,
1753
1746
  right: E,
1754
- top: R,
1747
+ top: I,
1755
1748
  bottom: A,
1756
1749
  absolute: a
1757
1750
  };
1758
1751
  }
1759
- const Xe = (r, e, n, t) => {
1752
+ const Ye = (r, e, n, t) => {
1760
1753
  const { scene: i } = e, { left: s, top: o, width: a, height: c, angle: g } = r, l = {
1761
1754
  left: s,
1762
1755
  right: s + a,
@@ -1774,14 +1767,14 @@ const Xe = (r, e, n, t) => {
1774
1767
  absolute: d.absolute
1775
1768
  };
1776
1769
  };
1777
- let Ze = class extends ue {
1770
+ let Je = class extends ue {
1778
1771
  constructor(e, n, t, i, s, o, a) {
1779
1772
  super();
1780
1773
  K(this, "_domLayerMap", /* @__PURE__ */ new Map());
1781
1774
  K(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1782
- K(this, "_transformChange$", new dt());
1775
+ K(this, "_transformChange$", new ct());
1783
1776
  K(this, "transformChange$", this._transformChange$.asObservable());
1784
- K(this, "_remove$", new dt());
1777
+ K(this, "_remove$", new ct());
1785
1778
  K(this, "remove$", this._remove$.asObservable());
1786
1779
  this._renderManagerService = e, this._univerInstanceService = n, this._commandService = t, this._drawingManagerService = i, this._selectionRenderService = s, this._canvasFloatDomService = o, this._sheetDrawingService = a, this._drawingAddListener(), this._scrollUpdateListener(), this._featureUpdateListener(), this._deleteListener();
1787
1780
  }
@@ -1806,12 +1799,12 @@ let Ze = class extends ue {
1806
1799
  // eslint-disable-next-line max-lines-per-function
1807
1800
  this._drawingManagerService.add$.subscribe((e) => {
1808
1801
  e.forEach((n) => {
1809
- var rt, it;
1810
- const { unitId: t, subUnitId: i, drawingId: s } = n, o = se(this._univerInstanceService, { unitId: t, subUnitId: i }), a = this._drawingManagerService.getDrawingByParam(n), c = (rt = this._renderManagerService.getRenderById(t)) == null ? void 0 : rt.with(He).getUnitSkeleton(t, i);
1802
+ var nt, rt;
1803
+ const { unitId: t, subUnitId: i, drawingId: s } = n, o = se(this._univerInstanceService, { unitId: t, subUnitId: i }), a = this._drawingManagerService.getDrawingByParam(n), c = (nt = this._renderManagerService.getRenderById(t)) == null ? void 0 : nt.with(Xe).getUnitSkeleton(t, i);
1811
1804
  if (a == null || o == null || c == null)
1812
1805
  return;
1813
1806
  const { transform: g, drawingType: l } = a;
1814
- if (l !== Ge.DRAWING_DOM)
1807
+ if (l !== Ve.DRAWING_DOM)
1815
1808
  return;
1816
1809
  const d = this._getSceneAndTransformerByDrawingSearch(t);
1817
1810
  if (d == null)
@@ -1819,9 +1812,9 @@ let Ze = class extends ue {
1819
1812
  const { scene: m, canvas: u } = d;
1820
1813
  if (g == null)
1821
1814
  return !0;
1822
- const { left: f, top: h, width: p, height: S, angle: I, flipX: v, flipY: C, skewX: _, skewY: M } = g, w = vn({ unitId: t, subUnitId: i, drawingId: s }), y = m.getObject(w);
1815
+ const { left: f, top: h, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: M } = g, w = vn({ unitId: t, subUnitId: i, drawingId: s }), y = m.getObject(w);
1823
1816
  if (y != null) {
1824
- y.transformByState({ left: f, top: h, width: p, height: S, angle: I, flipX: v, flipY: C, skewX: _, skewY: M });
1817
+ y.transformByState({ left: f, top: h, width: p, height: S, angle: C, flipX: v, flipY: R, skewX: _, skewY: M });
1825
1818
  return;
1826
1819
  }
1827
1820
  const D = {
@@ -1832,7 +1825,7 @@ let Ze = class extends ue {
1832
1825
  zIndex: this._drawingManagerService.getDrawingOrder(t, i).length - 1
1833
1826
  }, T = new Rn(w, D);
1834
1827
  m.addObject(T, Dn).attachTransformerTo(T);
1835
- const U = this._ensureMap(t, i), E = new nn(), R = Xe(T, d.renderObject, c.skeleton, o.worksheet), A = new Tn(R), z = {
1828
+ const U = this._ensureMap(t, i), E = new nn(), I = Ye(T, d.renderObject, c.skeleton, o.worksheet), A = new Tn(I), z = {
1836
1829
  dispose: E,
1837
1830
  rect: T,
1838
1831
  position$: A,
@@ -1843,29 +1836,29 @@ let Ze = class extends ue {
1843
1836
  position$: A,
1844
1837
  id: s,
1845
1838
  componentKey: a.componentKey,
1846
- onPointerDown: ($) => {
1847
- u.dispatchEvent(new PointerEvent($.type, $));
1839
+ onPointerDown: (W) => {
1840
+ u.dispatchEvent(new PointerEvent(W.type, W));
1848
1841
  },
1849
- onPointerMove: ($) => {
1850
- u.dispatchEvent(new PointerEvent($.type, $));
1842
+ onPointerMove: (W) => {
1843
+ u.dispatchEvent(new PointerEvent(W.type, W));
1851
1844
  },
1852
- onPointerUp: ($) => {
1853
- u.dispatchEvent(new PointerEvent($.type, $));
1845
+ onPointerUp: (W) => {
1846
+ u.dispatchEvent(new PointerEvent(W.type, W));
1854
1847
  },
1855
- onWheel: ($) => {
1856
- u.dispatchEvent(new WheelEvent($.type, $));
1848
+ onWheel: (W) => {
1849
+ u.dispatchEvent(new WheelEvent(W.type, W));
1857
1850
  },
1858
- props: (it = U.get(s)) == null ? void 0 : it.props
1851
+ props: (rt = U.get(s)) == null ? void 0 : rt.props
1859
1852
  });
1860
- const nt = T.onTransformChangeObservable.add(() => {
1861
- const $ = Xe(T, d.renderObject, c.skeleton, o.worksheet);
1853
+ const tt = T.onTransformChange$.subscribeEvent(() => {
1854
+ const W = Ye(T, d.renderObject, c.skeleton, o.worksheet);
1862
1855
  A.next(
1863
- $
1856
+ W
1864
1857
  );
1865
1858
  });
1866
1859
  E.add(() => {
1867
1860
  this._canvasFloatDomService.removeFloatDom(s);
1868
- }), nt && E.add(nt), this._domLayerInfoMap.set(s, z);
1861
+ }), tt && E.add(tt), this._domLayerInfoMap.set(s, z);
1869
1862
  });
1870
1863
  })
1871
1864
  );
@@ -1875,11 +1868,11 @@ let Ze = class extends ue {
1875
1868
  var t, i;
1876
1869
  const n = (s, o) => {
1877
1870
  var m;
1878
- const a = this._getSceneAndTransformerByDrawingSearch(s), c = this._ensureMap(s, o), g = Array.from(c.keys()), l = se(this._univerInstanceService, { unitId: s, subUnitId: o }), d = (m = this._renderManagerService.getRenderById(s)) == null ? void 0 : m.with(He).getUnitSkeleton(s, o);
1871
+ const a = this._getSceneAndTransformerByDrawingSearch(s), c = this._ensureMap(s, o), g = Array.from(c.keys()), l = se(this._univerInstanceService, { unitId: s, subUnitId: o }), d = (m = this._renderManagerService.getRenderById(s)) == null ? void 0 : m.with(Xe).getUnitSkeleton(s, o);
1879
1872
  !a || !l || !d || g.forEach((u) => {
1880
1873
  const f = this._domLayerInfoMap.get(u);
1881
1874
  if (f) {
1882
- const h = Xe(f.rect, a.renderObject, d.skeleton, l.worksheet);
1875
+ const h = Ye(f.rect, a.renderObject, d.skeleton, l.worksheet);
1883
1876
  f.position$.next(h);
1884
1877
  }
1885
1878
  });
@@ -1926,7 +1919,7 @@ let Ze = class extends ue {
1926
1919
  this._drawingManagerService.update$.subscribe((e) => {
1927
1920
  e.forEach((n) => {
1928
1921
  const t = this._drawingManagerService.getDrawingByParam(n);
1929
- if (!t || t.drawingType !== Ge.DRAWING_DOM)
1922
+ if (!t || t.drawingType !== Ve.DRAWING_DOM)
1930
1923
  return;
1931
1924
  const i = {
1932
1925
  ...t.transform
@@ -1960,7 +1953,7 @@ let Ze = class extends ue {
1960
1953
  unitId: t,
1961
1954
  subUnitId: i,
1962
1955
  drawingId: a,
1963
- drawingType: Ge.DRAWING_DOM,
1956
+ drawingType: Ve.DRAWING_DOM,
1964
1957
  componentKey: o,
1965
1958
  sheetTransform: c,
1966
1959
  transform: {
@@ -1970,7 +1963,7 @@ let Ze = class extends ue {
1970
1963
  height: s.endY - s.startY
1971
1964
  }
1972
1965
  };
1973
- return this._commandService.executeCommand(tt.id, {
1966
+ return this._commandService.executeCommand(et.id, {
1974
1967
  unitId: t,
1975
1968
  drawings: [l]
1976
1969
  }), {
@@ -1997,15 +1990,15 @@ let Ze = class extends ue {
1997
1990
  }
1998
1991
  }
1999
1992
  };
2000
- Ze = ri([
2001
- ee(0, B(te)),
1993
+ Je = ri([
1994
+ ee(0, $(te)),
2002
1995
  ee(1, ce),
2003
- ee(2, B(W)),
1996
+ ee(2, $(B)),
2004
1997
  ee(3, H),
2005
- ee(4, Be),
2006
- ee(5, B(Gn)),
1998
+ ee(4, $e),
1999
+ ee(5, $(Gn)),
2007
2000
  ee(6, X)
2008
- ], Ze);
2001
+ ], Je);
2009
2002
  var si = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, ai = (r, e, n, t) => {
2010
2003
  for (var i = t > 1 ? void 0 : t ? oi(e, n) : e, s = r.length - 1, o; s >= 0; s--)
2011
2004
  (o = r[s]) && (i = (t ? o(e, n, i) : o(i)) || i);
@@ -2036,7 +2029,7 @@ let Te = class extends ue {
2036
2029
  const { unitId: t, subUnitId: i } = e, s = this._renderManagerService.getRenderById(t);
2037
2030
  if (!s)
2038
2031
  return n(r);
2039
- const o = s.with(He).getUnitSkeleton(t, i);
2032
+ const o = s.with(Xe).getUnitSkeleton(t, i);
2040
2033
  if (!o)
2041
2034
  return n(r);
2042
2035
  const a = this._drawingManagerService.getDrawingDataForUnit(t), c = a == null ? void 0 : a[e.subUnitId];
@@ -2057,8 +2050,8 @@ let Te = class extends ue {
2057
2050
  };
2058
2051
  Te = ai([
2059
2052
  de(le.Rendered, Te),
2060
- be(0, B(yn)),
2061
- be(1, B(gn)),
2053
+ be(0, $(yn)),
2054
+ be(1, $(gn)),
2062
2055
  be(2, H),
2063
2056
  be(3, te)
2064
2057
  ], Te);
@@ -2085,7 +2078,7 @@ let Ue = class extends ue {
2085
2078
  return;
2086
2079
  }
2087
2080
  const i = e.getUnitId(), s = t.getSheetId();
2088
- if (this._permissionService.composePermission([new ut(i).id, new Fe(i, s).id]).every((a) => a.value))
2081
+ if (this._permissionService.composePermission([new lt(i).id, new xe(i, s).id]).every((a) => a.value))
2089
2082
  this._drawingManagerService.setDrawingVisible(!0);
2090
2083
  else {
2091
2084
  this._drawingManagerService.setDrawingVisible(!1);
@@ -2114,7 +2107,7 @@ let Ue = class extends ue {
2114
2107
  return;
2115
2108
  }
2116
2109
  const i = e.getUnitId(), s = t.getSheetId();
2117
- if (this._permissionService.composePermission([new ze(i).id, new Oe(i, s).id]).every((a) => a.value))
2110
+ if (this._permissionService.composePermission([new He(i).id, new Oe(i, s).id]).every((a) => a.value))
2118
2111
  this._drawingManagerService.setDrawingEditable(!0);
2119
2112
  else {
2120
2113
  this._drawingManagerService.setDrawingEditable(!1);
@@ -2142,7 +2135,7 @@ let Ue = class extends ue {
2142
2135
  const a = this._renderManagerService.getRenderById(i), c = a == null ? void 0 : a.scene;
2143
2136
  if (c == null)
2144
2137
  return;
2145
- const g = c.getTransformerByCreate(), l = this._permissionService.composePermission$([new ut(i).id, new Fe(i, s).id]).pipe(lt((m) => m.every((u) => u.value)));
2138
+ const g = c.getTransformerByCreate(), l = this._permissionService.composePermission$([new lt(i).id, new xe(i, s).id]).pipe(dt((m) => m.every((u) => u.value)));
2146
2139
  l == null || l.pipe(
2147
2140
  Ce((m) => m !== o),
2148
2141
  Ie()
@@ -2154,7 +2147,7 @@ let Ue = class extends ue {
2154
2147
  p.classType === ne.IMAGE && h.some((S) => p.oKey.includes(S.drawingId)) && c.removeObject(p);
2155
2148
  }), g.clearSelectedObjects());
2156
2149
  }
2157
- }), (d = this._permissionService.getPermissionPoint$(new Fe(i, s).id)) == null || d.pipe(
2150
+ }), (d = this._permissionService.getPermissionPoint$(new xe(i, s).id)) == null || d.pipe(
2158
2151
  Ce((m) => m.value !== o),
2159
2152
  Ie()
2160
2153
  ).subscribe({
@@ -2181,7 +2174,7 @@ let Ue = class extends ue {
2181
2174
  const a = this._renderManagerService.getRenderById(i), c = a == null ? void 0 : a.scene;
2182
2175
  if (c == null)
2183
2176
  return;
2184
- const g = c.getTransformerByCreate(), l = this._permissionService.composePermission$([new ze(i).id, new Oe(i, s).id]).pipe(lt((m) => m.every((u) => u.value)));
2177
+ const g = c.getTransformerByCreate(), l = this._permissionService.composePermission$([new He(i).id, new Oe(i, s).id]).pipe(dt((m) => m.every((u) => u.value)));
2185
2178
  l == null || l.pipe(
2186
2179
  Ce((m) => m !== o),
2187
2180
  Ie()
@@ -2205,7 +2198,7 @@ let Ue = class extends ue {
2205
2198
  if (S == null)
2206
2199
  return;
2207
2200
  this._drawingManagerService.setDrawingEditable(!0), S.getAllObjects().forEach((v) => {
2208
- v.classType === ne.IMAGE && h.some((C) => v.oKey.includes(C.drawingId)) && S.detachTransformerFrom(v);
2201
+ v.classType === ne.IMAGE && h.some((R) => v.oKey.includes(R.drawingId)) && S.detachTransformerFrom(v);
2209
2202
  });
2210
2203
  }
2211
2204
  });
@@ -2220,13 +2213,13 @@ Ue = li([
2220
2213
  ge(1, te),
2221
2214
  ge(2, sn),
2222
2215
  ge(3, ce),
2223
- ge(4, B(rn))
2216
+ ge(4, $(rn))
2224
2217
  ], Ue);
2225
- var Kt = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, mi = (r, e, n) => e in r ? Kt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n, gi = (r, e, n, t) => {
2218
+ var zt = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, mi = (r, e, n) => e in r ? zt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n, gi = (r, e, n, t) => {
2226
2219
  for (var i = t > 1 ? void 0 : t ? ui(e, n) : e, s = r.length - 1, o; s >= 0; s--)
2227
2220
  (o = r[s]) && (i = (t ? o(e, n, i) : o(i)) || i);
2228
- return t && i && Kt(e, n, i), i;
2229
- }, gt = (r, e) => (n, t) => e(n, t, r), kt = (r, e, n) => mi(r, typeof e != "symbol" ? e + "" : e, n);
2221
+ return t && i && zt(e, n, i), i;
2222
+ }, mt = (r, e) => (n, t) => e(n, t, r), Kt = (r, e, n) => mi(r, typeof e != "symbol" ? e + "" : e, n);
2230
2223
  const hi = "SHEET_IMAGE_UI_PLUGIN";
2231
2224
  let je = class extends on {
2232
2225
  constructor(e = {}, n, t) {
@@ -2240,7 +2233,7 @@ let je = class extends on {
2240
2233
  _initDependencies(e) {
2241
2234
  [
2242
2235
  // services
2243
- [Ze],
2236
+ [Je],
2244
2237
  // controllers
2245
2238
  [
2246
2239
  he,
@@ -2256,14 +2249,14 @@ let je = class extends on {
2256
2249
  ].forEach((t) => e.add(t));
2257
2250
  }
2258
2251
  };
2259
- kt(je, "type", Y.UNIVER_SHEET);
2260
- kt(je, "pluginName", hi);
2252
+ Kt(je, "type", Y.UNIVER_SHEET);
2253
+ Kt(je, "pluginName", hi);
2261
2254
  je = gi([
2262
2255
  an(Sn, hn, fn),
2263
- gt(1, B(qe)),
2264
- gt(2, B(pe))
2256
+ mt(1, $(Ze)),
2257
+ mt(2, $(pe))
2265
2258
  ], je);
2266
2259
  export {
2267
- Ze as SheetCanvasFloatDomManagerService,
2260
+ Je as SheetCanvasFloatDomManagerService,
2268
2261
  je as UniverSheetsDrawingUIPlugin
2269
2262
  };