@univerjs/sheets-drawing-ui 0.6.0-nightly.202502031606 → 0.6.0-nightly.202502051606

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,21 +1,21 @@
1
1
  var Mr = Object.defineProperty;
2
2
  var yr = (i, e, n) => e in i ? Mr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
3
  var z = (i, e, n) => yr(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { CommandType as Z, ICommandService as F, IUndoRedoService as Fe, sequenceExecute as Pn, LocaleService as xt, IUniverInstanceService as Ye, useDependency as ye, Inject as N, Injector as Qe, IContextService as Un, RxDisposable as Tr, UniverInstanceType as X, connectInjector as Or, toDisposable as Er, FOCUSING_COMMON_DRAWINGS as ke, DrawingTypeEnum as L, Disposable as oe, ArrangeTypeEnum as gt, createDocumentModelWithStyle as Pr, ObjectRelativeFromH as Ur, ObjectRelativeFromV as Ar, BooleanNumber as Nr, PositionedObjectLayoutType as jr, WrapTextType as Br, BuildTextUtils as Wr, Range as $r, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as mt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ft, InterceptorEffectEnum as xr, ObjectMatrix as kr, Tools as Te, UserManagerService as Lr, IPermissionService as Fr, Rectangle as Yr, Direction as _e, FOCUSING_FX_BAR_EDITOR as Gr, EDITOR_ACTIVATED as Xr, FOCUSING_PANEL_EDITOR as Vr, LifecycleService as Hr, LifecycleStages as zr, DisposableCollection as pt, fromEventSubject as Kr, generateRandomId as Ht, DependentOn as Zr, Plugin as Jr, merge as qr, registerDependencies as Qr, touchDependencies as zt, IConfigService as ei } from "@univerjs/core";
4
+ import { CommandType as Z, ICommandService as F, IUndoRedoService as Fe, sequenceExecute as Pn, LocaleService as kt, IUniverInstanceService as Ye, useDependency as ye, Inject as N, Injector as Qe, IContextService as Un, RxDisposable as Tr, UniverInstanceType as X, connectInjector as Or, toDisposable as Er, FOCUSING_COMMON_DRAWINGS as xe, DrawingTypeEnum as L, Disposable as oe, ArrangeTypeEnum as gt, createDocumentModelWithStyle as Pr, ObjectRelativeFromH as Ur, ObjectRelativeFromV as Ar, BooleanNumber as Nr, PositionedObjectLayoutType as jr, WrapTextType as Br, BuildTextUtils as Wr, Range as $r, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as mt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as ft, InterceptorEffectEnum as kr, ObjectMatrix as xr, Tools as Te, UserManagerService as Lr, IPermissionService as Fr, Rectangle as Yr, Direction as _e, FOCUSING_FX_BAR_EDITOR as Gr, EDITOR_ACTIVATED as Xr, FOCUSING_PANEL_EDITOR as Vr, LifecycleService as Hr, LifecycleStages as zr, DisposableCollection as pt, fromEventSubject as Kr, generateRandomId as Ht, DependentOn as Zr, Plugin as Jr, merge as qr, registerDependencies as Qr, touchDependencies as zt, IConfigService as ei } from "@univerjs/core";
5
5
  import { DocDrawingController as ti, UniverDocsDrawingPlugin as ni } from "@univerjs/docs-drawing";
6
- import { SetDrawingSelectedOperation as kt, IImageIoService as An, IDrawingManagerService as te, DRAWING_IMAGE_ALLOW_IMAGE_LIST as pn, DRAWING_IMAGE_COUNT_LIMIT as wn, ImageUploadStatusType as je, DRAWING_IMAGE_ALLOW_SIZE as _n, getImageSize as vn, DRAWING_IMAGE_WIDTH_LIMIT as Sn, DRAWING_IMAGE_HEIGHT_LIMIT as In, ImageSourceType as ri, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as ii } from "@univerjs/drawing";
6
+ import { SetDrawingSelectedOperation as xt, IImageIoService as An, IDrawingManagerService as te, DRAWING_IMAGE_ALLOW_IMAGE_LIST as pn, DRAWING_IMAGE_COUNT_LIMIT as wn, ImageUploadStatusType as je, DRAWING_IMAGE_ALLOW_SIZE as _n, getImageSize as vn, DRAWING_IMAGE_WIDTH_LIMIT as Sn, DRAWING_IMAGE_HEIGHT_LIMIT as In, ImageSourceType as ri, getDrawingShapeKeyByDrawingSearch as Ce, UniverDrawingPlugin as ii } from "@univerjs/drawing";
7
7
  import { ImageCropperObject as si, COMPONENT_IMAGE_POPUP_MENU as oi, OpenImageCropOperation as ai, ImageResetSizeOperation as ci, DrawingRenderService as Nn, DrawingCommonPanel as di, UniverDrawingUIPlugin as li } from "@univerjs/drawing-ui";
8
8
  import { IRenderManagerService as J, precisionTo as wt, getGroupState as ui, transformObjectOutOfGroup as hi, RENDER_CLASS_TYPE as Be, Rect as We, ObjectType as Cn, DRAWING_OBJECT_LAYER_INDEX as Kt, SHEET_VIEWPORT_KEY as jn } from "@univerjs/engine-render";
9
9
  import { ISheetDrawingService as ne, SetDrawingApplyMutation as P, DrawingApplyType as U, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as gi } from "@univerjs/sheets-drawing";
10
- import { SheetCanvasPopManagerService as mi, convertPositionSheetOverGridToAbsolute as fi, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as Y, attachRangeWithCoord as Bn, IEditorBridgeService as pi, IAutoFillService as wi, HoverManagerService as _i, PREDEFINED_HOOK_NAME as xe, COPY_TYPE as be, discreteRangeToRange as bn, virtualizeDiscreteRanges as vi, ISheetClipboardService as Si, SheetPrintInterceptorService as Ii, getCurrentRangeDisable$ as Ci, SetZoomRatioOperation as Rn, SetScrollOperation as bi } from "@univerjs/sheets-ui";
10
+ import { SheetCanvasPopManagerService as mi, convertPositionSheetOverGridToAbsolute as fi, ISheetSelectionRenderService as Ge, SheetSkeletonManagerService as Y, attachRangeWithCoord as Bn, IEditorBridgeService as pi, IAutoFillService as wi, HoverManagerService as _i, PREDEFINED_HOOK_NAME as ke, COPY_TYPE as be, discreteRangeToRange as bn, virtualizeDiscreteRanges as vi, ISheetClipboardService as Si, SheetPrintInterceptorService as Ii, getCurrentRangeDisable$ as Ci, SetZoomRatioOperation as Rn, SetScrollOperation as bi } from "@univerjs/sheets-ui";
11
11
  import { ISidebarService as Ri, IUIPartsService as Di, BuiltInUIPart as Mi, ILocalFileService as yi, IMessageService as Ti, IClipboardInterfaceService as Oi, MenuItemType as cn, getMenuHiddenObservable as Wn, RibbonStartGroup as Ei, KeyCode as Le, ComponentManager as Pi, IMenuManagerService as Ui, IShortcutService as Ai, CanvasFloatDomService as Ni } from "@univerjs/ui";
12
12
  import { takeUntil as Dn, combineLatest as _t, map as Je, filter as ve, distinctUntilChanged as vt, Subject as Zt, take as ji, BehaviorSubject as He, switchMap as Mn } from "rxjs";
13
- import { SheetInterceptorService as Lt, getSheetCommandTarget as G, SheetsSelectionsService as dn, SetRangeValuesCommand as Bi, SetWorksheetRowHeightMutation as $n, SetWorksheetColWidthMutation as xn, SetWorksheetRowIsAutoHeightMutation as Wi, SetWorksheetRowAutoHeightMutation as kn, AddWorksheetMergeMutation as $i, RemoveWorksheetMergeMutation as xi, AFTER_CELL_EDIT as ki, INTERCEPTOR_POINT as Li, InterceptCellContentPriority as Fi, WorkbookViewPermission as yn, WorksheetViewPermission as Jt, WorkbookEditablePermission as en, WorksheetEditPermission as yt, InsertRowCommand as Ln, InsertColCommand as Fn, RemoveRowCommand as Yn, RemoveColCommand as Gn, DeleteRangeMoveLeftCommand as Xn, DeleteRangeMoveUpCommand as Vn, InsertRangeMoveDownCommand as Hn, InsertRangeMoveRightCommand as zn, DeltaRowHeightCommand as tn, SetRowHeightCommand as nn, DeltaColumnWidthCommand as Kn, SetColWidthCommand as Zn, SetRowHiddenCommand as Jn, SetSpecificRowsVisibleCommand as qn, SetSpecificColsVisibleCommand as Qn, SetColHiddenCommand as er, MoveColsCommand as tr, MoveRowsCommand as nr, MoveRangeCommand as rr, SetRowVisibleMutation as Yi, SetRowHiddenMutation as Gi, SetColVisibleMutation as Xi, SetColHiddenMutation as Vi, SetWorksheetActiveOperation as Hi, RangeProtectionPermissionEditPoint as zi, SetFrozenMutation as Ki, COMMAND_LISTENER_SKELETON_CHANGE as Zi } from "@univerjs/sheets";
13
+ import { SheetInterceptorService as Lt, getSheetCommandTarget as G, SheetsSelectionsService as dn, SetRangeValuesCommand as Bi, SetWorksheetRowHeightMutation as $n, SetWorksheetColWidthMutation as kn, SetWorksheetRowIsAutoHeightMutation as Wi, SetWorksheetRowAutoHeightMutation as xn, AddWorksheetMergeMutation as $i, RemoveWorksheetMergeMutation as ki, AFTER_CELL_EDIT as xi, INTERCEPTOR_POINT as Li, InterceptCellContentPriority as Fi, WorkbookViewPermission as yn, WorksheetViewPermission as Jt, WorkbookEditablePermission as en, WorksheetEditPermission as yt, InsertRowCommand as Ln, InsertColCommand as Fn, RemoveRowCommand as Yn, RemoveColCommand as Gn, DeleteRangeMoveLeftCommand as Xn, DeleteRangeMoveUpCommand as Vn, InsertRangeMoveDownCommand as Hn, InsertRangeMoveRightCommand as zn, DeltaRowHeightCommand as tn, SetRowHeightCommand as nn, DeltaColumnWidthCommand as Kn, SetColWidthCommand as Zn, SetRowHiddenCommand as Jn, SetSpecificRowsVisibleCommand as qn, SetSpecificColsVisibleCommand as Qn, SetColHiddenCommand as er, MoveColsCommand as tr, MoveRowsCommand as nr, MoveRangeCommand as rr, SetRowVisibleMutation as Yi, SetRowHiddenMutation as Gi, SetColVisibleMutation as Xi, SetColHiddenMutation as Vi, SetWorksheetActiveOperation as Hi, RangeProtectionPermissionEditPoint as zi, SetFrozenMutation as Ki, COMMAND_LISTENER_SKELETON_CHANGE as Zi } from "@univerjs/sheets";
14
14
  import { jsx as K, jsxs as Tt } from "react/jsx-runtime";
15
15
  import Ji, { useEffect as ln, forwardRef as ir, useRef as qi, createElement as sr, useState as rn } from "react";
16
16
  import { docDrawingPositionToTransform as Qi, ReplaceSnapshotCommand as es } from "@univerjs/docs-ui";
17
17
  import { MessageType as Re, RadioGroup as ts, Radio as qt } from "@univerjs/design";
18
- const ns = "sheets-drawing-ui.config", Tn = {}, k = {
18
+ const ns = "sheets-drawing-ui.config", Tn = {}, x = {
19
19
  id: "sheet.operation.clear-drawing-transformer",
20
20
  type: Z.MUTATION,
21
21
  handler: (i, e) => {
@@ -44,13 +44,13 @@ const ns = "sheets-drawing-ui.config", Tn = {}, k = {
44
44
  ...(I = m.preUndos) != null ? I : [],
45
45
  f,
46
46
  ...m.undos,
47
- { id: k.id, params: c }
47
+ { id: x.id, params: c }
48
48
  ],
49
49
  redoMutations: [
50
50
  ...(D = m.preRedos) != null ? D : [],
51
51
  p,
52
52
  ...m.redos,
53
- { id: k.id, params: c }
53
+ { id: x.id, params: c }
54
54
  ]
55
55
  }), !0) : !1;
56
56
  }
@@ -58,7 +58,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, k = {
58
58
  id: "sidebar.operation.sheet-image",
59
59
  type: Z.COMMAND,
60
60
  handler: async (i, e) => {
61
- const n = i.get(Ri), t = i.get(xt), r = i.get(Ye), s = i.get(F);
61
+ const n = i.get(Ri), t = i.get(kt), r = i.get(Ye), s = i.get(F);
62
62
  if (!G(r)) return !1;
63
63
  switch (e.value) {
64
64
  case "open":
@@ -66,7 +66,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, k = {
66
66
  header: { title: t.t("sheetImage.panel.title") },
67
67
  children: { label: or },
68
68
  onClose: () => {
69
- s.syncExecuteCommand(kt.id, []);
69
+ s.syncExecuteCommand(xt.id, []);
70
70
  },
71
71
  width: 360
72
72
  });
@@ -83,7 +83,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, k = {
83
83
  type: Z.OPERATION,
84
84
  handler: (i, e) => {
85
85
  const n = i.get(F);
86
- return e == null ? !1 : (n.syncExecuteCommand(kt.id, [e]), n.executeCommand(ar.id, { value: "open" }), !0);
86
+ return e == null ? !1 : (n.syncExecuteCommand(xt.id, [e]), n.executeCommand(ar.id, { value: "open" }), !0);
87
87
  }
88
88
  }, rs = "univer-upload-loading", is = "univer-upload-loading-body", ss = "univer-upload-loading-body-animation", os = "univer-UniverCircleAnimation", as = "univer-upload-loading-body-text", St = {
89
89
  uploadLoading: rs,
@@ -92,7 +92,7 @@ const ns = "sheets-drawing-ui.config", Tn = {}, k = {
92
92
  univerCircleAnimation: os,
93
93
  uploadLoadingBodyText: as
94
94
  }, cs = () => {
95
- const i = ye(An), e = ye(xt), [n, t] = Ji.useState(0);
95
+ const i = ye(An), e = ye(kt), [n, t] = Ji.useState(0);
96
96
  return ln(() => {
97
97
  const r = i.change$.subscribe((s) => {
98
98
  t(s);
@@ -148,7 +148,7 @@ let Ot = class extends Tr {
148
148
  this.disposeWithMe(
149
149
  Er(
150
150
  t.createControl$.subscribe(() => {
151
- if (this._contextService.setContextValue(ke, !0), this._hasCropObject(n))
151
+ if (this._contextService.setContextValue(xe, !0), this._hasCropObject(n))
152
152
  return;
153
153
  const o = t.getSelectedObjectMap();
154
154
  if (o.size > 1) {
@@ -178,11 +178,11 @@ let Ot = class extends Tr {
178
178
  )
179
179
  ), this.disposeWithMe(
180
180
  t.clearControl$.subscribe(() => {
181
- r == null || r.dispose(), this._contextService.setContextValue(ke, !1), this._commandService.syncExecuteCommand(kt.id, []);
181
+ r == null || r.dispose(), this._contextService.setContextValue(xe, !1), this._commandService.syncExecuteCommand(xt.id, []);
182
182
  })
183
183
  ), this.disposeWithMe(
184
184
  this._contextService.contextChanged$.subscribe((o) => {
185
- o[ke] === !1 && (r == null || r.dispose());
185
+ o[xe] === !1 && (r == null || r.dispose());
186
186
  })
187
187
  ), this.disposeWithMe(
188
188
  t.changing$.subscribe(() => {
@@ -393,11 +393,11 @@ const dr = {
393
393
  unitID: c,
394
394
  undoMutations: [
395
395
  { id: P.id, params: { op: g, unitId: c, subUnitId: a, objects: ps(l), type: U.UNGROUP } },
396
- { id: k.id, params: s }
396
+ { id: x.id, params: s }
397
397
  ],
398
398
  redoMutations: [
399
399
  { id: P.id, params: { op: d, unitId: c, subUnitId: a, objects: l, type: U.GROUP } },
400
- { id: k.id, params: s }
400
+ { id: x.id, params: s }
401
401
  ]
402
402
  }), !0) : !1;
403
403
  }
@@ -415,13 +415,13 @@ const dr = {
415
415
  ...(I = m.preUndos) != null ? I : [],
416
416
  f,
417
417
  ...m.undos,
418
- { id: k.id, params: c }
418
+ { id: x.id, params: c }
419
419
  ],
420
420
  redoMutations: [
421
421
  ...(D = m.preRedos) != null ? D : [],
422
422
  p,
423
423
  ...m.redos,
424
- { id: k.id, params: c }
424
+ { id: x.id, params: c }
425
425
  ]
426
426
  }), !0) : !1;
427
427
  }
@@ -457,11 +457,11 @@ const dr = {
457
457
  unitID: c,
458
458
  undoMutations: [
459
459
  { id: P.id, params: { unitId: c, subUnitId: a, op: g, objects: l, type: U.UPDATE } },
460
- { id: k.id, params: [c] }
460
+ { id: x.id, params: [c] }
461
461
  ],
462
462
  redoMutations: [
463
463
  { id: P.id, params: { unitId: c, subUnitId: a, op: d, objects: l, type: U.UPDATE } },
464
- { id: k.id, params: [c] }
464
+ { id: x.id, params: [c] }
465
465
  ]
466
466
  }), !0) : !1;
467
467
  }
@@ -482,11 +482,11 @@ const dr = {
482
482
  unitID: c,
483
483
  undoMutations: [
484
484
  { id: P.id, params: { op: g, unitId: c, subUnitId: a, objects: fs(l), type: U.GROUP } },
485
- { id: k.id, params: s }
485
+ { id: x.id, params: s }
486
486
  ],
487
487
  redoMutations: [
488
488
  { id: P.id, params: { op: d, unitId: c, subUnitId: a, objects: l, type: U.UNGROUP } },
489
- { id: k.id, params: s }
489
+ { id: x.id, params: s }
490
490
  ]
491
491
  }), !0) : !1;
492
492
  }
@@ -758,7 +758,7 @@ let qe = class extends oe {
758
758
  this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
759
759
  this._commandService.executeCommand(dr.id, e);
760
760
  const { unitId: n, subUnitId: t, drawingId: r } = e[0].parent;
761
- this._commandService.syncExecuteCommand(kt.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
761
+ this._commandService.syncExecuteCommand(xt.id, [{ unitId: n, subUnitId: t, drawingId: r }]);
762
762
  })), this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
763
763
  this._commandService.executeCommand(ur.id, e);
764
764
  }));
@@ -766,7 +766,7 @@ let qe = class extends oe {
766
766
  _focusDrawingListener() {
767
767
  this.disposeWithMe(
768
768
  this._drawingManagerService.focus$.subscribe((e) => {
769
- e == null || e.length === 0 ? (this._contextService.setContextValue(ke, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(ke, !0), this._sheetDrawingService.focusDrawing(e));
769
+ e == null || e.length === 0 ? (this._contextService.setContextValue(xe, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(xe, !0), this._sheetDrawingService.focusDrawing(e));
770
770
  })
771
771
  );
772
772
  }
@@ -781,7 +781,7 @@ qe = vs([
781
781
  Q(7, te),
782
782
  Q(8, Un),
783
783
  Q(9, Ti),
784
- Q(10, N(xt)),
784
+ Q(10, N(kt)),
785
785
  Q(11, N(dn)),
786
786
  Q(12, N(Qe))
787
787
  ], qe);
@@ -820,13 +820,13 @@ let Et = class extends oe {
820
820
  if (i.id === $n.id) {
821
821
  const t = i.params;
822
822
  n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
823
- } else if (i.id === xn.id) {
823
+ } else if (i.id === kn.id) {
824
824
  const t = i.params;
825
825
  n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
826
826
  } else if (i.id === Wi.id) {
827
827
  const t = i.params;
828
828
  n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
829
- } else if (i.id === kn.id) {
829
+ } else if (i.id === xn.id) {
830
830
  const t = i.params;
831
831
  e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId }), n = t.rowsAutoHeightInfo.map((r) => ({
832
832
  startRow: r.row,
@@ -837,7 +837,7 @@ let Et = class extends oe {
837
837
  } else if (i.id === $i.id) {
838
838
  const t = i.params;
839
839
  n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
840
- } else if (i.id === xi.id) {
840
+ } else if (i.id === ki.id) {
841
841
  const t = i.params;
842
842
  n = t.ranges, e = G(this._univerInstanceService, { unitId: t.unitId, subUnitId: t.subUnitId });
843
843
  }
@@ -857,7 +857,7 @@ let Et = class extends oe {
857
857
  }));
858
858
  }
859
859
  _handleWriteCell() {
860
- this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(ki, {
860
+ this.disposeWithMe(this._sheetInterceptorService.writeCellInterceptor.intercept(xi, {
861
861
  priority: 9999,
862
862
  handler: (i, e, n) => (on(this._injector, { unitId: e.unitId, subUnitId: e.subUnitId, row: e.row, col: e.col }, i), n(i))
863
863
  }));
@@ -867,7 +867,7 @@ let Et = class extends oe {
867
867
  this._sheetInterceptorService.intercept(
868
868
  Li.CELL_CONTENT,
869
869
  {
870
- effect: xr.Style,
870
+ effect: kr.Style,
871
871
  priority: Fi.CELL_IMAGE,
872
872
  handler: (i, e, n) => {
873
873
  var t;
@@ -901,7 +901,7 @@ let Pt = class extends oe {
901
901
  this._autoFillService.addHook({
902
902
  id: "sheet-cell-image-autofill",
903
903
  onBeforeSubmit: (i, e, n, t) => {
904
- new kr(t).forValue((r, s, o) => {
904
+ new xr(t).forValue((r, s, o) => {
905
905
  on(this._injector, { unitId: i.unitId, subUnitId: i.subUnitId, row: r, col: s }, o);
906
906
  });
907
907
  }
@@ -987,10 +987,10 @@ function js() {
987
987
  };
988
988
  }
989
989
  const En = [
990
- xe.SPECIAL_PASTE_COL_WIDTH,
991
- xe.SPECIAL_PASTE_VALUE,
992
- xe.SPECIAL_PASTE_FORMAT,
993
- xe.SPECIAL_PASTE_FORMULA
990
+ ke.SPECIAL_PASTE_COL_WIDTH,
991
+ ke.SPECIAL_PASTE_VALUE,
992
+ ke.SPECIAL_PASTE_FORMAT,
993
+ ke.SPECIAL_PASTE_FORMULA
994
994
  ];
995
995
  let At = class extends oe {
996
996
  constructor(e, n, t, r, s) {
@@ -1038,10 +1038,10 @@ let At = class extends oe {
1038
1038
  return this._copyInfo.copyRange ? this._generateRangeDrawingsPasteMutations({ pasteType: o, unitId: g, subUnitId: d, pasteRange: a }, { copyRange: c, copyType: s }) : this._generateSingleDrawingPasteMutations({ pasteTo: n, pasteType: o }, be.COPY);
1039
1039
  },
1040
1040
  onPastePlainText: (e, n) => ({ undos: [], redos: [] }),
1041
- onPasteUnrecognized: (e) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: xe.DEFAULT_PASTE }, be.COPY) : { undos: [], redos: [] },
1041
+ onPasteUnrecognized: (e) => this._copyInfo ? this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: ke.DEFAULT_PASTE }, be.COPY) : { undos: [], redos: [] },
1042
1042
  onPasteFiles: (e, n) => {
1043
1043
  if (this._copyInfo)
1044
- return this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: xe.DEFAULT_PASTE }, be.COPY);
1044
+ return this._generateSingleDrawingPasteMutations({ pasteTo: e, pasteType: ke.DEFAULT_PASTE }, be.COPY);
1045
1045
  {
1046
1046
  const t = n.filter((r) => r.type.includes("image"));
1047
1047
  if (t.length)
@@ -1396,10 +1396,10 @@ Nt = $s([
1396
1396
  Ke(3, Ye),
1397
1397
  Ke(4, N(Lr))
1398
1398
  ], Nt);
1399
- var xs = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
1400
- for (var r = t > 1 ? void 0 : t ? ks(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1399
+ var ks = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ls = (i, e, n, t) => {
1400
+ for (var r = t > 1 ? void 0 : t ? xs(e, n) : e, s = i.length - 1, o; s >= 0; s--)
1401
1401
  (o = i[s]) && (r = (t ? o(e, n, r) : o(r)) || r);
1402
- return t && r && xs(e, n, r), r;
1402
+ return t && r && ks(e, n, r), r;
1403
1403
  }, bt = (i, e) => (n, t) => e(n, t, i);
1404
1404
  let jt = class extends oe {
1405
1405
  constructor(i, e, n, t) {
@@ -1482,7 +1482,7 @@ const Xs = [
1482
1482
  Xi.id,
1483
1483
  Vi.id,
1484
1484
  $n.id,
1485
- xn.id
1485
+ kn.id
1486
1486
  ];
1487
1487
  let an = class extends oe {
1488
1488
  constructor(i, e, n, t, r, s, o, c, a) {
@@ -1568,7 +1568,7 @@ let an = class extends oe {
1568
1568
  const d = this._sheetDrawingService.getBatchRemoveOp(g), l = d.undo, h = d.redo, u = d.objects;
1569
1569
  s.push({ id: P.id, params: { unitId: t, subUnitId: r, op: h, objects: u, type: U.REMOVE } }), o.push({ id: P.id, params: { unitId: t, subUnitId: r, op: l, objects: u, type: U.INSERT } });
1570
1570
  }
1571
- return s.push({ id: k.id, params: [t] }), o.push({ id: k.id, params: [t] }), {
1571
+ return s.push({ id: x.id, params: [t] }), o.push({ id: x.id, params: [t] }), {
1572
1572
  redos: s,
1573
1573
  undos: o
1574
1574
  };
@@ -1632,10 +1632,10 @@ let an = class extends oe {
1632
1632
  if (m === O.Position) {
1633
1633
  let R = null, T = null;
1634
1634
  if (S >= M && S <= y) {
1635
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: f.row });
1636
- if (x == null)
1635
+ const k = this._skeletonManagerService.attachRangeWithCoord({ startColumn: S, endColumn: y, startRow: p.row, endRow: f.row });
1636
+ if (k == null)
1637
1637
  return;
1638
- T = { ...u, left: x.startX };
1638
+ T = { ...u, left: k.startX };
1639
1639
  }
1640
1640
  if (T != null && (R = $(T, this._selectionRenderService), R != null && T != null)) {
1641
1641
  r.push({ ...l, sheetTransform: R, transform: T });
@@ -1700,10 +1700,10 @@ let an = class extends oe {
1700
1700
  _createUndoAndRedoMutation(i, e, n) {
1701
1701
  const t = this._sheetDrawingService.getBatchUpdateOp(n), { undo: r, redo: s, objects: o } = t, c = [
1702
1702
  { id: P.id, params: { unitId: i, subUnitId: e, op: s, objects: o, type: U.UPDATE } },
1703
- { id: k.id, params: [i] }
1703
+ { id: x.id, params: [i] }
1704
1704
  ], a = [
1705
1705
  { id: P.id, params: { unitId: i, subUnitId: e, op: r, objects: o, type: U.UPDATE } },
1706
- { id: k.id, params: [i] }
1706
+ { id: x.id, params: [i] }
1707
1707
  ];
1708
1708
  return {
1709
1709
  redos: c,
@@ -1726,10 +1726,10 @@ let an = class extends oe {
1726
1726
  if (m === O.Position) {
1727
1727
  let R = null, T = null;
1728
1728
  if (w >= _ && w <= E) {
1729
- const x = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: E });
1730
- if (x == null)
1729
+ const k = this._skeletonManagerService.attachRangeWithCoord({ startColumn: p.column, endColumn: f.column, startRow: w, endRow: E });
1730
+ if (k == null)
1731
1731
  return;
1732
- T = { ...u, top: x.startY };
1732
+ T = { ...u, top: k.startY };
1733
1733
  }
1734
1734
  if (T != null && (R = $(T, this._selectionRenderService), R != null && T != null)) {
1735
1735
  r.push({ ...l, sheetTransform: R, transform: T });
@@ -1854,13 +1854,13 @@ let an = class extends oe {
1854
1854
  const { transform: _ } = C;
1855
1855
  if (!_)
1856
1856
  return;
1857
- const { left: E = 0, top: M = 0, width: y = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: R, drawingStartY: T, drawingEndY: x } = {
1857
+ const { left: E = 0, top: M = 0, width: y = 0, height: A = 0 } = _, { drawingStartX: b, drawingEndX: R, drawingStartY: T, drawingEndY: k } = {
1858
1858
  drawingStartX: E,
1859
1859
  drawingEndX: E + y,
1860
1860
  drawingStartY: M,
1861
1861
  drawingEndY: M + A
1862
1862
  };
1863
- a <= b && R <= g && d <= T && x <= l && u.push(C);
1863
+ a <= b && R <= g && d <= T && k <= l && u.push(C);
1864
1864
  });
1865
1865
  const m = [], p = [], f = e.startRow - n.startRow, w = e.startColumn - n.startColumn, S = u.map((v) => {
1866
1866
  const C = v.sheetTransform, _ = {
@@ -1917,7 +1917,7 @@ let an = class extends oe {
1917
1917
  const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
1918
1918
  a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
1919
1919
  }
1920
- return a.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), {
1920
+ return a.push({ id: x.id, params: [t] }), g.push({ id: x.id, params: [t] }), {
1921
1921
  redos: a,
1922
1922
  undos: g
1923
1923
  };
@@ -1958,7 +1958,7 @@ let an = class extends oe {
1958
1958
  const u = this._sheetDrawingService.getBatchRemoveOp(h), m = u.undo, p = u.redo, f = u.objects;
1959
1959
  a.push({ id: P.id, params: { unitId: t, subUnitId: r, op: p, objects: f, type: U.REMOVE } }), g.push({ id: P.id, params: { unitId: t, subUnitId: r, op: m, objects: f, type: U.INSERT } });
1960
1960
  }
1961
- return a.push({ id: k.id, params: [t] }), g.push({ id: k.id, params: [t] }), { redos: a, undos: g };
1961
+ return a.push({ id: x.id, params: [t] }), g.push({ id: x.id, params: [t] }), { redos: a, undos: g };
1962
1962
  }
1963
1963
  _expandCol(i, e, n, t, r = O.Position) {
1964
1964
  const s = t - n + 1, { from: o, to: c } = i, { column: a } = o, { column: g } = c;
@@ -2132,26 +2132,58 @@ let an = class extends oe {
2132
2132
  }
2133
2133
  _commandListener() {
2134
2134
  this.disposeWithMe(
2135
+ // TODO@weird94: this should subscribe to the command service
2136
+ // but the skeleton changes like other render modules. These two signals are not equivalent.
2137
+ // As a temp solution, I subscribed to activate$ here.
2135
2138
  this._commandService.onCommandExecuted((i) => {
2136
- i.id === Hi.id && setTimeout(() => {
2137
- const e = i.params, { unitId: n, subUnitId: t } = e, r = this._drawingManagerService.drawingManagerData, s = [], o = [];
2138
- Object.keys(r).forEach((c) => {
2139
- const a = r[c];
2140
- a != null && Object.keys(a).forEach((g) => {
2141
- const d = a[g].data;
2142
- d != null && Object.keys(d).forEach((l) => {
2143
- if (c === n && g === t) {
2144
- const h = d[l];
2145
- h.transform = V(h.sheetTransform, this._selectionRenderService, this._skeletonManagerService), s.push(d[l]);
2146
- } else
2147
- o.push(d[l]);
2148
- });
2149
- });
2150
- }), this._drawingManagerService.removeNotification(o), this._drawingManagerService.addNotification(s);
2151
- }, 0);
2139
+ if (i.id === Hi.id) {
2140
+ const { unitId: e, subUnitId: n } = i.params;
2141
+ this._updateDrawings(e, n);
2142
+ }
2143
+ })
2144
+ ), this.disposeWithMe(
2145
+ this._context.activated$.subscribe((i) => {
2146
+ const { unit: e, unitId: n } = this._context;
2147
+ if (i) {
2148
+ const t = e.getActiveSheet().getSheetId();
2149
+ this._updateDrawings(n, t);
2150
+ } else
2151
+ this._clearDrawings(n);
2152
2152
  })
2153
2153
  );
2154
2154
  }
2155
+ _clearDrawings(i) {
2156
+ setTimeout(() => {
2157
+ const e = this._drawingManagerService.drawingManagerData, n = [];
2158
+ Object.keys(e).forEach((t) => {
2159
+ const r = e[t];
2160
+ r != null && Object.keys(r).forEach((s) => {
2161
+ const o = r[s].data;
2162
+ o != null && Object.keys(o).forEach((c) => {
2163
+ t === i && n.push(o[c]);
2164
+ });
2165
+ });
2166
+ }), this._drawingManagerService.removeNotification(n);
2167
+ });
2168
+ }
2169
+ _updateDrawings(i, e) {
2170
+ setTimeout(() => {
2171
+ const n = this._drawingManagerService.drawingManagerData, t = [], r = [];
2172
+ Object.keys(n).forEach((s) => {
2173
+ const o = n[s];
2174
+ o != null && Object.keys(o).forEach((c) => {
2175
+ const a = o[c].data;
2176
+ a != null && Object.keys(a).forEach((g) => {
2177
+ if (s === i && c === e) {
2178
+ const d = a[g];
2179
+ d.transform = V(d.sheetTransform, this._selectionRenderService, this._skeletonManagerService), t.push(a[g]);
2180
+ } else
2181
+ r.push(a[g]);
2182
+ });
2183
+ });
2184
+ }), this._drawingManagerService.removeNotification(r), this._drawingManagerService.addNotification(t);
2185
+ }, 0);
2186
+ }
2155
2187
  _sheetRefreshListener() {
2156
2188
  this.disposeWithMe(
2157
2189
  this._commandService.onCommandExecuted((i) => {
@@ -2197,7 +2229,7 @@ let an = class extends oe {
2197
2229
  break;
2198
2230
  }
2199
2231
  }
2200
- }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(k.id, [i]));
2232
+ }), r.length !== 0 && (this._drawingManagerService.refreshTransform(r), this._commandService.syncExecuteCommand(x.id, [i]));
2201
2233
  }
2202
2234
  };
2203
2235
  an = Gs([
@@ -2303,7 +2335,7 @@ const wr = {
2303
2335
  return n.syncExecuteCommand(Yt.id, {
2304
2336
  unitId: c,
2305
2337
  drawings: a
2306
- }) ? (n.syncExecuteCommand(k.id, [c]), !0) : !1;
2338
+ }) ? (n.syncExecuteCommand(x.id, [c]), !0) : !1;
2307
2339
  }
2308
2340
  }, _r = "addition-and-subtraction-single", vr = "sheet.menu.image";
2309
2341
  function qs(i) {
@@ -2363,7 +2395,7 @@ function Rt() {
2363
2395
  }
2364
2396
  const wo = (i) => {
2365
2397
  var I;
2366
- const e = ye(F), n = ye(xt), t = ye(te), r = ye(J), { drawings: s } = i, o = s[0];
2398
+ const e = ye(F), n = ye(kt), t = ye(te), r = ye(J), { drawings: s } = i, o = s[0];
2367
2399
  if (o == null)
2368
2400
  return;
2369
2401
  const { unitId: c } = o, a = r.getRenderById(c), g = a == null ? void 0 : a.scene;
@@ -2376,13 +2408,13 @@ const wo = (i) => {
2376
2408
  const { oKey: E } = _, M = v.getDrawingOKey(E);
2377
2409
  if (M == null)
2378
2410
  return C.push(null), !0;
2379
- const { unitId: y, subUnitId: A, drawingId: b, drawingType: R, anchorType: T, sheetTransform: x } = M;
2411
+ const { unitId: y, subUnitId: A, drawingId: b, drawingType: R, anchorType: T, sheetTransform: k } = M;
2380
2412
  C.push({
2381
2413
  unitId: y,
2382
2414
  subUnitId: A,
2383
2415
  drawingId: b,
2384
2416
  anchorType: T,
2385
- sheetTransform: x,
2417
+ sheetTransform: k,
2386
2418
  drawingType: R
2387
2419
  });
2388
2420
  }), C;
@@ -2460,7 +2492,7 @@ const wo = (i) => {
2460
2492
  }
2461
2493
  };
2462
2494
  function nt(i) {
2463
- return !i.getContextValue(Gr) && !i.getContextValue(Xr) && !i.getContextValue(Vr) && i.getContextValue(ke);
2495
+ return !i.getContextValue(Gr) && !i.getContextValue(Xr) && !i.getContextValue(Vr) && i.getContextValue(xe);
2464
2496
  }
2465
2497
  const So = {
2466
2498
  id: tt.id,
@@ -2535,7 +2567,7 @@ let Bt = class extends oe {
2535
2567
  et,
2536
2568
  Yt,
2537
2569
  ar,
2538
- k,
2570
+ x,
2539
2571
  cr,
2540
2572
  dr,
2541
2573
  ur,
@@ -2725,7 +2757,7 @@ let Wt = class extends oe {
2725
2757
  }
2726
2758
  const T = new We(y, b);
2727
2759
  R && T.setObjectType(Cn.CHART), p.addObject(T, Kt), c.allowTransform !== !1 && p.attachTransformerTo(T);
2728
- const x = this._ensureMap(t, r), ae = new pt(), Se = ge(T, m.renderUnit, d.skeleton, o.worksheet), ce = new He(Se), Ie = {
2760
+ const k = this._ensureMap(t, r), ae = new pt(), Se = ge(T, m.renderUnit, d.skeleton, o.worksheet), ce = new He(Se), Ie = {
2729
2761
  dispose: ae,
2730
2762
  rect: T,
2731
2763
  position$: ce,
@@ -2748,7 +2780,7 @@ let Wt = class extends oe {
2748
2780
  onWheel: (W) => {
2749
2781
  f.dispatchEvent(new WheelEvent(W.type, W));
2750
2782
  },
2751
- props: (H = (ie = x.get(s)) == null ? void 0 : ie.props) != null ? H : this._getFloatDomProps(s),
2783
+ props: (H = (ie = k.get(s)) == null ? void 0 : ie.props) != null ? H : this._getFloatDomProps(s),
2752
2784
  data: u,
2753
2785
  unitId: t
2754
2786
  });
@@ -2760,8 +2792,8 @@ let Wt = class extends oe {
2760
2792
  });
2761
2793
  ae.add(() => {
2762
2794
  this._canvasFloatDomService.removeFloatDom(s);
2763
- }), de && ae.add(de), this._domLayerInfoMap.set(s, Ie), x.set(s, {
2764
- ...x.get(s)
2795
+ }), de && ae.add(de), this._domLayerInfoMap.set(s, Ie), k.set(s, {
2796
+ ...k.get(s)
2765
2797
  });
2766
2798
  });
2767
2799
  })
@@ -2973,11 +3005,11 @@ let Wt = class extends oe {
2973
3005
  allowTransform: u
2974
3006
  };
2975
3007
  {
2976
- const { unitId: b, subUnitId: R, drawingId: T } = C, x = G(this._univerInstanceService, { unitId: b, subUnitId: R }), ae = C, Se = this._univerInstanceService.getUnit(b, X.UNIVER_SHEET);
3008
+ const { unitId: b, subUnitId: R, drawingId: T } = C, k = G(this._univerInstanceService, { unitId: b, subUnitId: R }), ae = C, Se = this._univerInstanceService.getUnit(b, X.UNIVER_SHEET);
2977
3009
  if (!Se)
2978
3010
  return;
2979
3011
  const ce = Se.getActiveSheet().getSheetId();
2980
- if (!ae || !x)
3012
+ if (!ae || !k)
2981
3013
  return;
2982
3014
  const Ie = (E = this._renderManagerService.getRenderById(b)) == null ? void 0 : E.with(Y);
2983
3015
  if (!Ie)
@@ -3025,7 +3057,7 @@ let Wt = class extends oe {
3025
3057
  domAnchor: t,
3026
3058
  unitId: b,
3027
3059
  subUnitId: R
3028
- }, lt = ge(se, W.renderUnit, de.skeleton, x.worksheet, he), me = new He(lt);
3060
+ }, lt = ge(se, W.renderUnit, de.skeleton, k.worksheet, he), me = new He(lt);
3029
3061
  he.position$ = me;
3030
3062
  let B = {
3031
3063
  position$: me,
@@ -3075,7 +3107,7 @@ let Wt = class extends oe {
3075
3107
  width: (mn = t.width) != null ? mn : j.width,
3076
3108
  height: (fn = t.height) != null ? fn : j.height,
3077
3109
  zIndex: this._drawingManagerService.getDrawingOrder(b, R).length - 1
3078
- }), Dr = ge(Rr, W.renderUnit, de.skeleton, x.worksheet, he);
3110
+ }), Dr = ge(Rr, W.renderUnit, de.skeleton, k.worksheet, he);
3079
3111
  me.next(Dr);
3080
3112
  }));
3081
3113
  const Ve = (A = this._renderManagerService.getRenderById(b)) == null ? void 0 : A.with(Y);
@@ -3083,7 +3115,7 @@ let Wt = class extends oe {
3083
3115
  j && d.sheetId !== j.sheetId && this._removeDom(m, !0);
3084
3116
  });
3085
3117
  const ut = se.onTransformChange$.subscribeEvent(() => {
3086
- const j = ge(se, W.renderUnit, de.skeleton, x.worksheet, he);
3118
+ const j = ge(se, W.renderUnit, de.skeleton, k.worksheet, he);
3087
3119
  me.next(
3088
3120
  j
3089
3121
  );
@@ -3143,10 +3175,10 @@ let Wt = class extends oe {
3143
3175
  allowTransform: u
3144
3176
  };
3145
3177
  {
3146
- const { unitId: y, subUnitId: A, drawingId: b } = D, R = G(this._univerInstanceService, { unitId: y, subUnitId: A }), T = D, x = this._univerInstanceService.getUnit(y, X.UNIVER_SHEET);
3147
- if (!x)
3178
+ const { unitId: y, subUnitId: A, drawingId: b } = D, R = G(this._univerInstanceService, { unitId: y, subUnitId: A }), T = D, k = this._univerInstanceService.getUnit(y, X.UNIVER_SHEET);
3179
+ if (!k)
3148
3180
  return;
3149
- const ae = x.getActiveSheet().getSheetId();
3181
+ const ae = k.getActiveSheet().getSheetId();
3150
3182
  if (!T || !R)
3151
3183
  return;
3152
3184
  const Se = (C = this._renderManagerService.getRenderById(y)) == null ? void 0 : C.with(Y);
@@ -3294,7 +3326,7 @@ let Wt = class extends oe {
3294
3326
  c.next(f), g.next(w);
3295
3327
  }, l = new pt();
3296
3328
  l.add(n.engine.clientRect$.subscribe(() => d())), l.add(this._commandService.onCommandExecuted((f) => {
3297
- if (f.id === kn.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
3329
+ if (f.id === xn.id && f.params.rowsAutoHeightInfo.findIndex((S) => S.row === r) > -1) {
3298
3330
  d();
3299
3331
  return;
3300
3332
  }
@@ -3465,7 +3497,7 @@ $t = No([
3465
3497
  Qt(3, ei)
3466
3498
  ], $t);
3467
3499
  export {
3468
- k as ClearSheetDrawingTransformerOperation,
3500
+ x as ClearSheetDrawingTransformerOperation,
3469
3501
  wr as DeleteDrawingsCommand,
3470
3502
  cr as EditSheetDrawingOperation,
3471
3503
  dr as GroupSheetDrawingCommand,
@@ -1,6 +1,6 @@
1
1
  import { Workbook, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
2
3
  import { IDrawingManagerService } from '@univerjs/drawing';
3
- import { IRenderContext, IRenderManagerService, IRenderModule } from '@univerjs/engine-render';
4
4
  import { SheetInterceptorService } from '@univerjs/sheets';
5
5
  import { ISheetDrawingService } from '@univerjs/sheets-drawing';
6
6
  import { ISheetSelectionRenderService, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
@@ -32,6 +32,8 @@ export declare class SheetDrawingTransformAffectedController extends Disposable
32
32
  private _expandRow;
33
33
  private _shrinkRow;
34
34
  private _commandListener;
35
+ private _clearDrawings;
36
+ private _updateDrawings;
35
37
  private _sheetRefreshListener;
36
38
  private _refreshDrawingTransform;
37
39
  }