@univerjs/sheets-drawing-ui 0.9.3 → 0.9.4-nightly.202507290713

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
@@ -3,16 +3,16 @@ var Tr = (i, t, e) => t in i ? yr(i, t, { enumerable: !0, configurable: !0, writ
3
3
  var ee = (i, t, e) => Tr(i, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { precisionTo as pt, IRenderManagerService as J, transformObjectOutOfGroup as Er, getGroupState as Or, getCurrentTypeOfRenderer as sn, CURSOR_TYPE as Ur, RENDER_CLASS_TYPE as Oe, Rect as Ue, ObjectType as mn, DRAWING_OBJECT_LAYER_INDEX as Ft, SHEET_VIEWPORT_KEY as xn } from "@univerjs/engine-render";
5
5
  import { convertPositionSheetOverGridToAbsolute as Pr, SheetSkeletonManagerService as V, ISheetSelectionRenderService as xe, attachRangeWithCoord as Yn, SheetCanvasPopManagerService as Ar, HoverManagerService as Nr, IEditorBridgeService as kr, IAutoFillService as Wr, EditingRenderController as Br, SetCellEditVisibleOperation as pn, PREDEFINED_HOOK_NAME as We, COPY_TYPE as ve, discreteRangeToRange as wn, virtualizeDiscreteRanges as jr, ISheetClipboardService as $r, SetZoomRatioOperation as _n, SetScrollOperation as Fr, SheetPrintInterceptorService as xr, getCurrentRangeDisable$ as Yr } from "@univerjs/sheets-ui";
6
- import { CommandType as Z, ICommandService as G, IUndoRedoService as Ye, sequenceExecute as Xn, DrawingTypeEnum as B, ArrangeTypeEnum as wt, Inject as A, IContextService as Gn, LocaleService as nt, Injector as Xe, Disposable as ne, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as Sn, ObjectRelativeFromH as vn, WrapTextType as In, PositionedObjectLayoutType as Cn, BooleanNumber as Dn, BuildTextUtils as Ht, ImageSourceType as Rn, generateRandomId as Qe, FOCUSING_COMMON_DRAWINGS as $e, IUniverInstanceService as Se, UniverInstanceType as F, Direction as _e, IImageIoService as Xr, RxDisposable as Gr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Lr, ObjectMatrix as Vr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Hr, IPermissionService as zr, UserManagerService as Kr, LifecycleService as Jr, LifecycleStages as Zr, DisposableCollection as _t, fromEventSubject as qr, Tools as je, PRINT_CHART_COMPONENT_KEY as Qr, Rectangle as ei, FOCUSING_FX_BAR_EDITOR as ti, EDITOR_ACTIVATED as ni, FOCUSING_PANEL_EDITOR as ri, DependentOn as ii, IConfigService as si, Plugin as oi, merge as ai, registerDependencies as ci, touchDependencies as xt } from "@univerjs/core";
6
+ import { CommandType as Z, ICommandService as X, IUndoRedoService as Ye, sequenceExecute as Gn, DrawingTypeEnum as B, ArrangeTypeEnum as wt, Inject as A, IContextService as Xn, LocaleService as nt, Injector as Ge, Disposable as ne, createDocumentModelWithStyle as Vt, ObjectRelativeFromV as Sn, ObjectRelativeFromH as vn, WrapTextType as In, PositionedObjectLayoutType as Cn, BooleanNumber as Dn, BuildTextUtils as Ht, ImageSourceType as Rn, generateRandomId as Qe, FOCUSING_COMMON_DRAWINGS as $e, IUniverInstanceService as Se, UniverInstanceType as F, Direction as _e, IImageIoService as Gr, RxDisposable as Xr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ze, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Be, InterceptorEffectEnum as Lr, ObjectMatrix as Vr, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Hr, IPermissionService as zr, UserManagerService as Kr, LifecycleService as Jr, LifecycleStages as Zr, DisposableCollection as _t, fromEventSubject as qr, Tools as je, PRINT_CHART_COMPONENT_KEY as Qr, Rectangle as ei, FOCUSING_FX_BAR_EDITOR as ti, EDITOR_ACTIVATED as ni, FOCUSING_PANEL_EDITOR as ri, DependentOn as ii, IConfigService as si, Plugin as oi, merge as ai, registerDependencies as ci, touchDependencies as xt } from "@univerjs/core";
7
7
  import { ISheetDrawingService as re, DrawingApplyType as U, SetDrawingApplyMutation as P, SheetDrawingAnchorType as O, UniverSheetsDrawingPlugin as di } from "@univerjs/sheets-drawing";
8
8
  import { SheetInterceptorService as At, SheetsSelectionsService as on, SetRangeValuesCommand as bn, getSheetCommandTarget as se, INTERCEPTOR_POINT as li, InterceptCellContentPriority as ui, WorkbookViewPermission as Mn, WorksheetViewPermission as yn, WorkbookEditablePermission as zt, WorksheetEditPermission as Kt, SetFrozenMutation as hi, SetWorksheetRowAutoHeightMutation as gi, COMMAND_LISTENER_SKELETON_CHANGE as fi, InsertRowCommand as Ln, InsertColCommand as Vn, RemoveRowCommand as Hn, RemoveColCommand as zn, DeleteRangeMoveLeftCommand as Kn, DeleteRangeMoveUpCommand as Jn, InsertRangeMoveDownCommand as Zn, InsertRangeMoveRightCommand as qn, DeltaRowHeightCommand as Jt, SetRowHeightCommand as Zt, DeltaColumnWidthCommand as Qn, SetColWidthCommand as er, SetRowHiddenCommand as tr, SetSpecificRowsVisibleCommand as nr, SetSpecificColsVisibleCommand as rr, SetColHiddenCommand as ir, MoveColsCommand as sr, MoveRowsCommand as or, MoveRangeCommand as ar, SetRowVisibleMutation as mi, SetRowHiddenMutation as pi, SetColVisibleMutation as wi, SetColHiddenMutation as _i, SetWorksheetRowHeightMutation as Si, SetWorksheetColWidthMutation as vi, SetWorksheetActiveOperation as Ii, RangeProtectionPermissionEditPoint as Ci } from "@univerjs/sheets";
9
9
  import { MessageType as pe, render as Di, unmount as Ri, clsx as bi, RadioGroup as Mi, Radio as Yt } from "@univerjs/design";
10
10
  import { docDrawingPositionToTransform as Tn, ReplaceSnapshotCommand as yi, InnerPasteCommand as Ti } from "@univerjs/docs-ui";
11
- import { IImageIoService as Ei, IDrawingManagerService as ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as En, DRAWING_IMAGE_COUNT_LIMIT as On, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as Un, getImageSize as Xt, SetDrawingSelectedOperation as Nt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as An, ImageSourceType as Oi, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as Ui } from "@univerjs/drawing";
11
+ import { IImageIoService as Ei, IDrawingManagerService as ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as En, DRAWING_IMAGE_COUNT_LIMIT as On, ImageUploadStatusType as Pe, DRAWING_IMAGE_ALLOW_SIZE as Un, getImageSize as Gt, SetDrawingSelectedOperation as Nt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as An, ImageSourceType as Oi, getDrawingShapeKeyByDrawingSearch as Ie, UniverDrawingPlugin as Ui } from "@univerjs/drawing";
12
12
  import { ILocalFileService as Pi, IMessageService as cr, ISidebarService as Ai, IDialogService as Ni, IClipboardInterfaceService as ki, CanvasFloatDomService as Wi, PrintFloatDomSingle as Bi, ComponentManager as dr, connectInjector as ji, useDependency as qe, getMenuHiddenObservable as an, MenuItemType as cn, RibbonInsertGroup as $i, KeyCode as Fe, IMenuManagerService as Fi, IShortcutService as xi } from "@univerjs/ui";
13
- import { DocDrawingController as Yi, UniverDocsDrawingPlugin as Xi } from "@univerjs/docs-drawing";
14
- import { ImageCropperObject as Gi, COMPONENT_IMAGE_POPUP_MENU as Li, OpenImageCropOperation as Vi, ImageResetSizeOperation as Hi, DrawingRenderService as lr, DrawingCommonPanel as zi, UniverDrawingUIPlugin as Ki } from "@univerjs/drawing-ui";
15
- import { takeUntil as Nn, throttleTime as Ji, combineLatest as St, switchMap as we, EMPTY as fe, tap as kn, map as Re, distinctUntilChanged as Wn, Subject as Gt, filter as Zi, take as qi, BehaviorSubject as ke, of as Bn } from "rxjs";
13
+ import { DocDrawingController as Yi, UniverDocsDrawingPlugin as Gi } from "@univerjs/docs-drawing";
14
+ import { ImageCropperObject as Xi, COMPONENT_IMAGE_POPUP_MENU as Li, OpenImageCropOperation as Vi, ImageResetSizeOperation as Hi, DrawingRenderService as lr, DrawingCommonPanel as zi, UniverDrawingUIPlugin as Ki } from "@univerjs/drawing-ui";
15
+ import { takeUntil as Nn, throttleTime as Ji, combineLatest as St, switchMap as we, EMPTY as fe, tap as kn, map as Re, distinctUntilChanged as Wn, Subject as Xt, filter as Zi, take as qi, BehaviorSubject as ke, of as Bn } from "rxjs";
16
16
  import { jsx as oe, jsxs as qt } from "react/jsx-runtime";
17
17
  import { useMemo as Qi, useState as Qt, useEffect as ur } from "react";
18
18
  function z(i, t, e) {
@@ -82,7 +82,7 @@ const Y = {
82
82
  type: Z.COMMAND,
83
83
  handler: (i, t) => {
84
84
  var v, I, R;
85
- const e = i.get(G), n = i.get(Ye), r = i.get(At), s = i.get(re);
85
+ const e = i.get(X), n = i.get(Ye), r = i.get(At), s = i.get(re);
86
86
  if (!t) return !1;
87
87
  const { drawings: o } = t, a = [];
88
88
  o.forEach((S) => {
@@ -90,7 +90,7 @@ const Y = {
90
90
  a.push(C);
91
91
  });
92
92
  const d = s.getBatchRemoveOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = r.onCommandExecute({ id: rt.id, params: t }), p = { id: P.id, params: { unitId: u, subUnitId: c, op: g, objects: h, type: U.REMOVE } }, m = { id: P.id, params: { unitId: u, subUnitId: c, op: l, objects: h, type: U.INSERT } };
93
- return Xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
93
+ return Gn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
94
94
  unitID: u,
95
95
  undoMutations: [
96
96
  ...(I = f.preUndos) != null ? I : [],
@@ -110,7 +110,7 @@ const Y = {
110
110
  id: "sheet.command.delete-drawing",
111
111
  type: Z.COMMAND,
112
112
  handler: (i) => {
113
- const t = i.get(G), n = i.get(re).getFocusDrawings();
113
+ const t = i.get(X), n = i.get(re).getFocusDrawings();
114
114
  if (n.length === 0)
115
115
  return !1;
116
116
  const r = n[0].unitId, s = n.map((o) => {
@@ -192,7 +192,7 @@ const gr = {
192
192
  id: "sheet.command.group-sheet-image",
193
193
  type: Z.COMMAND,
194
194
  handler: (i, t) => {
195
- const e = i.get(G), n = i.get(Ye), r = i.get(re);
195
+ const e = i.get(X), n = i.get(Ye), r = i.get(re);
196
196
  if (!t) return !1;
197
197
  const s = [];
198
198
  t.forEach(({ parent: h, children: f }) => {
@@ -218,10 +218,10 @@ const gr = {
218
218
  type: Z.COMMAND,
219
219
  handler: (i, t) => {
220
220
  var v, I, R;
221
- const e = i.get(G), n = i.get(Ye), r = i.get(re), s = i.get(At);
221
+ const e = i.get(X), n = i.get(Ye), r = i.get(re), s = i.get(At);
222
222
  if (!t) return !1;
223
223
  const o = t.drawings, a = o.map((S) => S.unitId), d = r.getBatchAddOp(o), { unitId: u, subUnitId: c, undo: l, redo: g, objects: h } = d, f = s.onCommandExecute({ id: kt.id, params: t }), p = { id: P.id, params: { op: g, unitId: u, subUnitId: c, objects: h, type: U.INSERT } }, m = { id: P.id, params: { op: l, unitId: u, subUnitId: c, objects: h, type: U.REMOVE } };
224
- return Xn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
224
+ return Gn([...(v = f.preRedos) != null ? v : [], p, ...f.redos], e) ? (n.pushUndoRedo({
225
225
  unitID: u,
226
226
  undoMutations: [
227
227
  ...(I = f.preUndos) != null ? I : [],
@@ -241,7 +241,7 @@ const gr = {
241
241
  id: "sheet.command.set-drawing-arrange",
242
242
  type: Z.COMMAND,
243
243
  handler: (i, t) => {
244
- const e = i.get(G), n = i.get(Ye);
244
+ const e = i.get(X), n = i.get(Ye);
245
245
  if (!t) return !1;
246
246
  const r = i.get(re), { unitId: s, subUnitId: o, drawingIds: a, arrangeType: d } = t, u = { unitId: s, subUnitId: o, drawingIds: a };
247
247
  let c;
@@ -262,7 +262,7 @@ const gr = {
262
262
  id: "sheet.command.set-sheet-image",
263
263
  type: Z.COMMAND,
264
264
  handler: (i, t) => {
265
- const e = i.get(G), n = i.get(Ye), r = i.get(re);
265
+ const e = i.get(X), n = i.get(Ye), r = i.get(re);
266
266
  if (!t) return !1;
267
267
  const { drawings: s } = t, o = r.getBatchUpdateOp(s), { unitId: a, subUnitId: d, undo: u, redo: c, objects: l } = o;
268
268
  return e.syncExecuteCommand(P.id, { unitId: a, subUnitId: d, op: c, objects: l, type: U.UPDATE }) ? (n.pushUndoRedo({
@@ -281,7 +281,7 @@ const gr = {
281
281
  id: "sheet.command.ungroup-sheet-image",
282
282
  type: Z.COMMAND,
283
283
  handler: (i, t) => {
284
- const e = i.get(G), n = i.get(Ye), r = i.get(re);
284
+ const e = i.get(X), n = i.get(Ye), r = i.get(re);
285
285
  if (!t) return !1;
286
286
  const s = [];
287
287
  t.forEach(({ parent: h, children: f }) => {
@@ -371,7 +371,7 @@ let et = class extends ne {
371
371
  }
372
372
  if (e == null)
373
373
  return;
374
- const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Xt(u || ""), { width: h, height: f } = this._context.scene;
374
+ const n = this._getUnitInfo(), { unitId: r, subUnitId: s } = n, { imageId: o, imageSourceType: a, source: d, base64Cache: u } = e, { width: c, height: l, image: g } = await Gt(u || ""), { width: h, height: f } = this._context.scene;
375
375
  this._imageIoService.addImageSourceCache(d, a, g);
376
376
  let p = 1;
377
377
  if (c > Pn || l > An) {
@@ -417,7 +417,7 @@ let et = class extends ne {
417
417
  }
418
418
  if (n == null)
419
419
  return !1;
420
- const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Xt(a || "");
420
+ const { imageId: r, imageSourceType: s, source: o, base64Cache: a } = n, { width: d, height: u, image: c } = await Gt(a || "");
421
421
  this._imageIoService.addImageSourceCache(o, s, c);
422
422
  const l = this._workbookSelections.getCurrentLastSelection();
423
423
  if (!l)
@@ -496,7 +496,7 @@ let et = class extends ne {
496
496
  // eslint-disable-next-line max-lines-per-function
497
497
  async insertCellImageByUrl(t, e) {
498
498
  var g, h;
499
- const { width: n, height: r, image: s } = await Xt(t || "");
499
+ const { width: n, height: r, image: s } = await Gt(t || "");
500
500
  this._imageIoService.addImageSourceCache(t, Rn.URL, s);
501
501
  const o = this._workbookSelections.getCurrentLastSelection();
502
502
  if (!o)
@@ -670,17 +670,17 @@ let et = class extends ne {
670
670
  };
671
671
  et = rs([
672
672
  te(1, A(V)),
673
- te(2, G),
673
+ te(2, X),
674
674
  te(3, xe),
675
675
  te(4, Ei),
676
676
  te(5, Pi),
677
677
  te(6, re),
678
678
  te(7, ie),
679
- te(8, Gn),
679
+ te(8, Xn),
680
680
  te(9, cr),
681
681
  te(10, A(nt)),
682
682
  te(11, A(on)),
683
- te(12, A(Xe))
683
+ te(12, A(Ge))
684
684
  ], et);
685
685
  const Bt = {
686
686
  id: "sheet.command.insert-float-image",
@@ -717,7 +717,7 @@ const Bt = {
717
717
  id: "sheet.command.move-drawing",
718
718
  type: Z.COMMAND,
719
719
  handler: (i, t) => {
720
- const e = i.get(G), n = i.get(re), r = i.get(xe), { direction: s } = t, o = n.getFocusDrawings();
720
+ const e = i.get(X), n = i.get(re), r = i.get(xe), { direction: s } = t, o = n.getFocusDrawings();
721
721
  if (o.length === 0)
722
722
  return !1;
723
723
  const a = o[0].unitId, d = o.map((c) => {
@@ -740,7 +740,7 @@ const Bt = {
740
740
  id: "sidebar.operation.sheet-image",
741
741
  type: Z.COMMAND,
742
742
  handler: async (i, t) => {
743
- const e = i.get(Ai), n = i.get(nt), r = i.get(Se), s = i.get(G);
743
+ const e = i.get(Ai), n = i.get(nt), r = i.get(Se), s = i.get(X);
744
744
  if (!se(r)) return !1;
745
745
  switch (t.value) {
746
746
  case "open":
@@ -764,7 +764,7 @@ const Bt = {
764
764
  id: "sheet.operation.edit-sheet-image",
765
765
  type: Z.OPERATION,
766
766
  handler: (i, t) => {
767
- const e = i.get(G);
767
+ const e = i.get(X);
768
768
  return t == null ? !1 : (e.syncExecuteCommand(Nt.id, [t]), e.executeCommand(wr.id, { value: "open" }), !0);
769
769
  }
770
770
  }, ss = "sheets-drawing-ui.config", jn = {};
@@ -773,7 +773,7 @@ var os = Object.getOwnPropertyDescriptor, as = (i, t, e, n) => {
773
773
  (o = i[s]) && (r = o(r) || r);
774
774
  return r;
775
775
  }, ce = (i, t) => (e, n) => t(e, n, i);
776
- let Rt = class extends Gr {
776
+ let Rt = class extends Xr {
777
777
  constructor(t, e, n, r, s, o, a, d, u, c) {
778
778
  super();
779
779
  ee(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
@@ -808,7 +808,7 @@ let Rt = class extends Gr {
808
808
  _hasCropObject(t) {
809
809
  const e = t.getAllObjectsByOrder();
810
810
  for (const n of e)
811
- if (n instanceof Gi)
811
+ if (n instanceof Xi)
812
812
  return !0;
813
813
  return !1;
814
814
  }
@@ -898,16 +898,16 @@ let Rt = class extends Gr {
898
898
  }
899
899
  };
900
900
  Rt = as([
901
- ce(0, A(Xe)),
901
+ ce(0, A(Ge)),
902
902
  ce(1, A(nt)),
903
903
  ce(2, ie),
904
904
  ce(3, A(Ar)),
905
905
  ce(4, J),
906
906
  ce(5, Se),
907
907
  ce(6, cr),
908
- ce(7, Gn),
909
- ce(8, Xr),
910
- ce(9, G)
908
+ ce(7, Xn),
909
+ ce(8, Gr),
910
+ ce(9, X)
911
911
  ], Rt);
912
912
  var cs = Object.getOwnPropertyDescriptor, ds = (i, t, e, n) => {
913
913
  for (var r = n > 1 ? void 0 : n ? cs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
@@ -1028,9 +1028,9 @@ let bt = class extends ne {
1028
1028
  }
1029
1029
  };
1030
1030
  bt = gs([
1031
- Ae(0, G),
1031
+ Ae(0, X),
1032
1032
  Ae(1, A(At)),
1033
- Ae(2, A(Xe)),
1033
+ Ae(2, A(Ge)),
1034
1034
  Ae(3, ie),
1035
1035
  Ae(4, A(Yi)),
1036
1036
  Ae(5, A(kr))
@@ -1059,7 +1059,7 @@ let Mt = class extends ne {
1059
1059
  };
1060
1060
  Mt = ms([
1061
1061
  $n(0, A(Wr)),
1062
- $n(1, A(Xe))
1062
+ $n(1, A(Ge))
1063
1063
  ], Mt);
1064
1064
  var ps = Object.getOwnPropertyDescriptor, ws = (i, t, e, n) => {
1065
1065
  for (var r = n > 1 ? void 0 : n ? ps(t, e) : t, s = i.length - 1, o; s >= 0; s--)
@@ -1134,7 +1134,7 @@ let yt = class extends ne {
1134
1134
  }
1135
1135
  };
1136
1136
  yt = ws([
1137
- He(0, G),
1137
+ He(0, X),
1138
1138
  He(1, Se),
1139
1139
  He(2, Ni),
1140
1140
  He(3, J),
@@ -1417,7 +1417,7 @@ Tt = vs([
1417
1417
  ze(1, J),
1418
1418
  ze(2, ie),
1419
1419
  ze(3, ki),
1420
- ze(4, G)
1420
+ ze(4, X)
1421
1421
  ], Tt);
1422
1422
  var Rs = Object.getOwnPropertyDescriptor, bs = (i, t, e, n) => {
1423
1423
  for (var r = n > 1 ? void 0 : n ? Rs(t, e) : t, s = i.length - 1, o; s >= 0; s--)
@@ -1630,18 +1630,18 @@ function Ir(i, t, e, n, r, s = !1) {
1630
1630
  const k = p - (x - D), ae = m - (x - D);
1631
1631
  m < H ? (M = k * o, b = ae * o) : p <= H && m >= H ? (M = k * o, b = Math.max(R, (m - S) * o)) : p > H && (f.left = !1, M = Math.max((p - S) * o, R), b = Math.max((m - S) * o, R));
1632
1632
  }
1633
- let L = 0, X = 0;
1633
+ let L = 0, G = 0;
1634
1634
  if (h === 0)
1635
- f.top = !1, L = (_ - C) * a, X = (v - C) * a;
1635
+ f.top = !1, L = (_ - C) * a, G = (v - C) * a;
1636
1636
  else {
1637
1637
  const k = _ - (N - T), ae = v - (N - T);
1638
- v < q ? (L = k * a, X = ae * a) : _ <= q && v >= q ? (L = k * a, X = Math.max(I, (v - C) * a)) : _ > q && (f.top = !1, L = Math.max((_ - C) * a, I), X = Math.max((v - C) * a, I));
1638
+ v < q ? (L = k * a, G = ae * a) : _ <= q && v >= q ? (L = k * a, G = Math.max(I, (v - C) * a)) : _ > q && (f.top = !1, L = Math.max((_ - C) * a, I), G = Math.max((v - C) * a, I));
1639
1639
  }
1640
- return M = Math.max(M, E.left), L = Math.max(L, E.top), b = Math.max(b, E.left), X = Math.max(X, E.top), {
1640
+ return M = Math.max(M, E.left), L = Math.max(L, E.top), b = Math.max(b, E.left), G = Math.max(G, E.top), {
1641
1641
  left: M,
1642
1642
  right: b,
1643
1643
  top: L,
1644
- bottom: X,
1644
+ bottom: G,
1645
1645
  absolute: f
1646
1646
  };
1647
1647
  }
@@ -1670,11 +1670,11 @@ let tt = class extends ne {
1670
1670
  * for update dom container position when scrolling and zoom
1671
1671
  */
1672
1672
  ee(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
1673
- ee(this, "_transformChange$", new Gt());
1673
+ ee(this, "_transformChange$", new Xt());
1674
1674
  ee(this, "transformChange$", this._transformChange$.asObservable());
1675
- ee(this, "_add$", new Gt());
1675
+ ee(this, "_add$", new Xt());
1676
1676
  ee(this, "add$", this._add$.asObservable());
1677
- ee(this, "_remove$", new Gt());
1677
+ ee(this, "_remove$", new Xt());
1678
1678
  ee(this, "remove$", this._remove$.asObservable());
1679
1679
  this._renderManagerService = t, this._univerInstanceService = e, this._commandService = n, this._drawingManagerService = r, this._canvasFloatDomService = s, this._sheetDrawingService = o, this._lifecycleService = a, this._drawingAddListener(), this._featureUpdateListener(), this._deleteListener(), this._bindScrollEvent();
1680
1680
  }
@@ -1770,7 +1770,7 @@ let tt = class extends ne {
1770
1770
  data: h,
1771
1771
  unitId: n
1772
1772
  });
1773
- const X = N.onTransformChange$.subscribeEvent(() => {
1773
+ const G = N.onTransformChange$.subscribeEvent(() => {
1774
1774
  const k = ge(N, f.renderUnit.scene, c.skeleton, o.worksheet);
1775
1775
  H.next(
1776
1776
  k
@@ -1778,7 +1778,7 @@ let tt = class extends ne {
1778
1778
  });
1779
1779
  x.add(() => {
1780
1780
  this._canvasFloatDomService.removeFloatDom(s);
1781
- }), X && x.add(X), this._domLayerInfoMap.set(s, L);
1781
+ }), G && x.add(G), this._domLayerInfoMap.set(s, L);
1782
1782
  });
1783
1783
  })
1784
1784
  ), this.disposeWithMe(
@@ -1882,7 +1882,7 @@ let tt = class extends ne {
1882
1882
  ...n
1883
1883
  });
1884
1884
  const s = this._getSceneAndTransformerByDrawingSearch(e.unitId);
1885
- if (s) {
1885
+ if (s && n.drawingType !== B.DRAWING_CHART) {
1886
1886
  const { scene: o } = s, a = this._domLayerInfoMap.get(e.drawingId);
1887
1887
  a != null && a.rect && (n.allowTransform === !1 ? o.detachTransformerFrom(a.rect) : o.attachTransformerTo(a.rect));
1888
1888
  }
@@ -1997,8 +1997,8 @@ let tt = class extends ne {
1997
1997
  const H = q.getWorksheetSkeleton(T);
1998
1998
  if (!H)
1999
1999
  return;
2000
- const { transform: L, drawingType: X, data: K } = b;
2001
- if (X !== B.DRAWING_DOM && X !== B.DRAWING_CHART)
2000
+ const { transform: L, drawingType: G, data: K } = b;
2001
+ if (G !== B.DRAWING_DOM && G !== B.DRAWING_CHART)
2002
2002
  return;
2003
2003
  const k = this._getSceneAndTransformerByDrawingSearch(D);
2004
2004
  if (k == null)
@@ -2018,15 +2018,15 @@ let tt = class extends ne {
2018
2018
  width: ct,
2019
2019
  height: dt,
2020
2020
  zIndex: this._drawingManagerService.getDrawingOrder(D, T).length - 1
2021
- }, ye = X === B.DRAWING_CHART;
2021
+ }, ye = G === B.DRAWING_CHART;
2022
2022
  if (ye) {
2023
2023
  const W = K ? K.backgroundColor : "white";
2024
2024
  Q.fill = W, Q.rotateEnabled = !1, K && K.border && (Q.stroke = K.border), Q.paintFirst = "stroke", Q.strokeWidth = 1, Q.borderEnabled = !1, Q.radius = 8;
2025
2025
  }
2026
2026
  const le = new Ue(ht, Q);
2027
2027
  ye && le.setObjectType(mn.CHART), ae.addObject(le, Ft), b.allowTransform !== !1 && ae.attachTransformerTo(le);
2028
- const ue = new _t(), gt = ae.getMainViewport(), { rowHeaderWidth: Te, columnHeaderHeight: Ge } = H.skeleton, ft = {
2029
- top: Ge,
2028
+ const ue = new _t(), gt = ae.getMainViewport(), { rowHeaderWidth: Te, columnHeaderHeight: Xe } = H.skeleton, ft = {
2029
+ top: Xe,
2030
2030
  left: Te,
2031
2031
  bottom: gt.bottom,
2032
2032
  right: gt.right
@@ -2163,10 +2163,10 @@ let tt = class extends ne {
2163
2163
  const { transform: q, data: H } = E, L = this._getSceneAndTransformerByDrawingSearch(w);
2164
2164
  if (L == null)
2165
2165
  return;
2166
- const { scene: X, canvas: K } = L;
2166
+ const { scene: G, canvas: K } = L;
2167
2167
  if (q == null || b !== y)
2168
2168
  return;
2169
- const { left: k, top: ae, width: be, height: ot, angle: at, flipX: ct, flipY: dt, skewX: jt, skewY: $t } = q, lt = Ie({ unitId: w, subUnitId: y, drawingId: D }), ut = X.getObject(lt);
2169
+ const { left: k, top: ae, width: be, height: ot, angle: at, flipX: ct, flipY: dt, skewX: jt, skewY: $t } = q, lt = Ie({ unitId: w, subUnitId: y, drawingId: D }), ut = G.getObject(lt);
2170
2170
  if (ut != null) {
2171
2171
  ut.transformByState({ left: k, top: ae, width: be, height: ot, angle: at, flipX: ct, flipY: dt, skewX: jt, skewY: $t });
2172
2172
  return;
@@ -2189,8 +2189,8 @@ let tt = class extends ne {
2189
2189
  height: Me.height,
2190
2190
  zIndex: this._drawingManagerService.getDrawingOrder(w, y).length - 1
2191
2191
  }, de = new Ue(lt, ht);
2192
- X.addObject(de, Ft), E.allowTransform !== !1 && X.attachTransformerTo(de);
2193
- const Q = new _t(), ye = X.getMainViewport(), le = {
2192
+ G.addObject(de, Ft), E.allowTransform !== !1 && G.attachTransformerTo(de);
2193
+ const Q = new _t(), ye = G.getMainViewport(), le = {
2194
2194
  top: 0,
2195
2195
  //viewMain.top,
2196
2196
  left: ye.left,
@@ -2208,7 +2208,7 @@ let tt = class extends ne {
2208
2208
  /* HORIZONTAL */
2209
2209
  }, gt = ge(de, L.renderUnit.scene, x.skeleton, T.worksheet, ue), Te = new ke(gt);
2210
2210
  ue.position$ = Te;
2211
- let Ge = {
2211
+ let Xe = {
2212
2212
  position$: Te,
2213
2213
  id: D,
2214
2214
  componentKey: E.componentKey,
@@ -2224,8 +2224,8 @@ let tt = class extends ne {
2224
2224
  data: H,
2225
2225
  unitId: w
2226
2226
  };
2227
- e.eventPassThrough && (Ge = {
2228
- ...Ge,
2227
+ e.eventPassThrough && (Xe = {
2228
+ ...Xe,
2229
2229
  onPointerDown: (j) => {
2230
2230
  K.dispatchEvent(new PointerEvent(j.type, j));
2231
2231
  },
@@ -2235,7 +2235,7 @@ let tt = class extends ne {
2235
2235
  onPointerUp: (j) => {
2236
2236
  K.dispatchEvent(new PointerEvent(j.type, j));
2237
2237
  }
2238
- }), this._canvasFloatDomService.addFloatDom(Ge);
2238
+ }), this._canvasFloatDomService.addFloatDom(Xe);
2239
2239
  const ft = de.onTransformChange$.subscribeEvent(() => {
2240
2240
  const j = ge(de, L.renderUnit.scene, x.skeleton, T.worksheet, ue);
2241
2241
  Te.next(
@@ -2346,7 +2346,7 @@ let tt = class extends ne {
2346
2346
  tt = ys([
2347
2347
  Ce(0, A(J)),
2348
2348
  Ce(1, Se),
2349
- Ce(2, A(G)),
2349
+ Ce(2, A(X)),
2350
2350
  Ce(3, ie),
2351
2351
  Ce(4, A(Wi)),
2352
2352
  Ce(5, re),
@@ -2534,7 +2534,7 @@ Ot = Os([
2534
2534
  De(3, J),
2535
2535
  De(4, A(tt)),
2536
2536
  De(5, A(dr)),
2537
- De(6, A(Xe))
2537
+ De(6, A(Ge))
2538
2538
  ], Ot);
2539
2539
  var Us = Object.getOwnPropertyDescriptor, Ps = (i, t, e, n) => {
2540
2540
  for (var r = n > 1 ? void 0 : n ? Us(t, e) : t, s = i.length - 1, o; s >= 0; s--)
@@ -3315,7 +3315,7 @@ let rn = class extends ne {
3315
3315
  };
3316
3316
  rn = Ps([
3317
3317
  me(1, J),
3318
- me(2, G),
3318
+ me(2, X),
3319
3319
  me(3, xe),
3320
3320
  me(4, A(V)),
3321
3321
  me(5, A(At)),
@@ -3325,7 +3325,7 @@ rn = Ps([
3325
3325
  ], rn);
3326
3326
  const ks = (i) => {
3327
3327
  var v;
3328
- const t = qe(G), e = qe(nt), n = qe(ie), r = qe(J), { drawings: s } = i, o = s[0];
3328
+ const t = qe(X), e = qe(nt), n = qe(ie), r = qe(J), { drawings: s } = i, o = s[0];
3329
3329
  if (o == null)
3330
3330
  return;
3331
3331
  const { unitId: a } = o, d = r.getRenderById(a), u = d == null ? void 0 : d.scene;
@@ -3484,7 +3484,7 @@ const xs = {
3484
3484
  staticParameters: {
3485
3485
  direction: _e.UP
3486
3486
  }
3487
- }, Xs = {
3487
+ }, Gs = {
3488
3488
  id: it.id,
3489
3489
  description: "shortcut.drawing-move-left",
3490
3490
  group: "4_drawing-view",
@@ -3494,7 +3494,7 @@ const xs = {
3494
3494
  staticParameters: {
3495
3495
  direction: _e.LEFT
3496
3496
  }
3497
- }, Gs = {
3497
+ }, Xs = {
3498
3498
  id: it.id,
3499
3499
  description: "shortcut.drawing-move-right",
3500
3500
  group: "4_drawing-view",
@@ -3551,8 +3551,8 @@ let Ut = class extends ne {
3551
3551
  // sheet drawing shortcuts
3552
3552
  xs,
3553
3553
  Ys,
3554
- Xs,
3555
3554
  Gs,
3555
+ Xs,
3556
3556
  Ls
3557
3557
  ].forEach((i) => {
3558
3558
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
@@ -3565,7 +3565,7 @@ let Ut = class extends ne {
3565
3565
  Ut = Hs([
3566
3566
  Ne(0, A(dr)),
3567
3567
  Ne(1, Fi),
3568
- Ne(2, G),
3568
+ Ne(2, X),
3569
3569
  Ne(3, xi),
3570
3570
  Ne(4, ie),
3571
3571
  Ne(5, A(on))
@@ -3633,8 +3633,8 @@ let Pt = class extends oi {
3633
3633
  Dr(Pt, "type", F.UNIVER_SHEET);
3634
3634
  Dr(Pt, "pluginName", qs);
3635
3635
  Pt = Zs([
3636
- ii(Ui, Xi, Ki, di),
3637
- Lt(1, A(Xe)),
3636
+ ii(Ui, Gi, Ki, di),
3637
+ Lt(1, A(Ge)),
3638
3638
  Lt(2, J),
3639
3639
  Lt(3, si)
3640
3640
  ], Pt);