@univerjs/docs-drawing-ui 0.15.0 → 0.15.1-insiders.20260117-8ce4a01

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,25 +1,25 @@
1
1
  var Pn = Object.defineProperty;
2
2
  var xn = (r, e, t) => e in r ? Pn(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var me = (r, e, t) => xn(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommandType as q, ICommandService as j, IUniverInstanceService as z, TextX as _t, JSONX as $, MemoryCursor as Nn, TextXActionType as Y, IUndoRedoService as Kt, BuildTextUtils as Un, ArrangeTypeEnum as Ze, Tools as Ae, Inject as Z, IContextService as Yt, LocaleService as lt, Disposable as xe, WrapTextType as $e, PositionedObjectLayoutType as k, BooleanNumber as se, DrawingTypeEnum as Pe, ObjectRelativeFromV as W, ObjectRelativeFromH as J, FOCUSING_COMMON_DRAWINGS as nt, UniverInstanceType as ve, Direction as he, DisposableCollection as Ln, toDisposable as ze, fromEventSubject as Zt, generateRandomId as Qt, DocumentFlavor as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as St, FOCUSING_UNIVER_EDITOR as Bn, UndoCommand as Fn, RedoCommand as kn, Injector as Jt, DOC_DRAWING_PRINTING_COMPONENT_KEY as Wn, throttle as Et, COLORS as Hn, RxDisposable as Gn, LifecycleService as jn, LifecycleStages as Rt, DependentOn as Vn, IConfigService as $n, Plugin as zn, merge as Xn } from "@univerjs/core";
5
- import { IDocDrawingService as Ne, UniverDocsDrawingPlugin as qn } from "@univerjs/docs-drawing";
4
+ import { CommandType as q, ICommandService as V, IUniverInstanceService as z, TextX as _t, JSONX as $, MemoryCursor as Nn, TextXActionType as Y, IUndoRedoService as Kt, BuildTextUtils as Un, ArrangeTypeEnum as Ze, Tools as Ae, Inject as Z, IContextService as Yt, LocaleService as lt, Disposable as xe, WrapTextType as $e, PositionedObjectLayoutType as k, BooleanNumber as se, DrawingTypeEnum as Pe, ObjectRelativeFromV as W, ObjectRelativeFromH as J, FOCUSING_COMMON_DRAWINGS as nt, UniverInstanceType as ve, Direction as he, DisposableCollection as Ln, toDisposable as ze, fromEventSubject as Zt, generateRandomId as Qt, DocumentFlavor as pt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as St, FOCUSING_DOC as Bn, FOCUSING_UNIVER_EDITOR as Fn, UndoCommand as kn, RedoCommand as Wn, Injector as Jt, DOC_DRAWING_PRINTING_COMPONENT_KEY as Gn, throttle as Et, COLORS as Hn, RxDisposable as Vn, LifecycleService as jn, LifecycleStages as Rt, DependentOn as $n, IConfigService as zn, Plugin as Xn, merge as qn } from "@univerjs/core";
5
+ import { IDocDrawingService as Ne, UniverDocsDrawingPlugin as Kn } from "@univerjs/docs-drawing";
6
6
  import { RichTextEditingMutation as ee, DocSelectionManagerService as Dt, DocSkeletonManagerService as te } from "@univerjs/docs";
7
- import { DocSelectionRenderService as Me, getRichTextEditPath as Xe, getCustomBlockIdsInSelections as Kn, docDrawingPositionToTransform as en, VIEWPORT_KEY as tn, SetDocZoomRatioOperation as nn, DocPrintInterceptorService as Yn, NodePositionConvertToCursor as At, getOneTextSelectionRange as Pt, getAnchorBounding as Zn, TEXT_RANGE_LAYER_INDEX as Qn, getDocObject as Jn, DocCanvasPopManagerService as ei, IEditorService as ti } from "@univerjs/docs-ui";
8
- import { IRenderManagerService as Q, DocumentEditArea as Fe, getCurrentTypeOfRenderer as ni, CURSOR_TYPE as xt, Liquid as rn, PageLayoutType as Nt, DocumentSkeletonPageType as Ut, Vector2 as ii, Rect as ri, getColor as si, TRANSFORM_CHANGE_OBSERVABLE_TYPE as oi } from "@univerjs/engine-render";
9
- import { MessageType as Lt, clsx as sn, InputNumber as Be, Select as Bt, Checkbox as ai, RadioGroup as Ft, Radio as Te, render as ci, unmount as di } from "@univerjs/design";
10
- import { IImageIoService as gi, IDrawingManagerService as fe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as li, DRAWING_IMAGE_COUNT_LIMIT as kt, ImageUploadStatusType as mt, DRAWING_IMAGE_ALLOW_SIZE as ui, getImageSize as hi, getDrawingShapeKeyByDrawingSearch as fi, DRAWING_IMAGE_WIDTH_LIMIT as Wt, DRAWING_IMAGE_HEIGHT_LIMIT as Ht, UniverDrawingPlugin as pi } from "@univerjs/drawing";
11
- import { IMessageService as mi, ILocalFileService as wi, ISidebarService as vi, CanvasFloatDomService as Ii, useDependency as we, getMenuHiddenObservable as on, MenuItemType as an, RibbonInsertGroup as _i, KeyCode as ke, ComponentManager as cn, IMenuManagerService as Si, IShortcutService as Di, PrintFloatDomSingle as Oi, connectInjector as Ti, UniverUIPlugin as Mi } from "@univerjs/ui";
12
- import { BehaviorSubject as Ot, debounceTime as dn, map as Gt, switchMap as yi, of as bi, Observable as Ci, takeUntil as jt, filter as Vt } from "rxjs";
13
- import { DrawingRenderService as gn, DrawingCommonPanel as Ei, ImageCropperObject as Ri, COMPONENT_IMAGE_POPUP_MENU as Ai, OpenImageCropOperation as Pi, ImageResetSizeOperation as xi, UniverDrawingUIPlugin as Ni } from "@univerjs/drawing-ui";
7
+ import { DocSelectionRenderService as Me, getRichTextEditPath as Xe, getCustomBlockIdsInSelections as Yn, docDrawingPositionToTransform as en, VIEWPORT_KEY as tn, SetDocZoomRatioOperation as nn, DocPrintInterceptorService as Zn, NodePositionConvertToCursor as At, getOneTextSelectionRange as Pt, getAnchorBounding as Qn, TEXT_RANGE_LAYER_INDEX as Jn, getDocObject as ei, DocCanvasPopManagerService as ti, IEditorService as ni } from "@univerjs/docs-ui";
8
+ import { IRenderManagerService as Q, DocumentEditArea as Fe, getCurrentTypeOfRenderer as ii, CURSOR_TYPE as xt, Liquid as rn, PageLayoutType as Nt, DocumentSkeletonPageType as Ut, Vector2 as ri, Rect as si, getColor as oi, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ai } from "@univerjs/engine-render";
9
+ import { MessageType as Lt, clsx as sn, InputNumber as Be, Select as Bt, Checkbox as ci, RadioGroup as Ft, Radio as Te, render as di, unmount as gi } from "@univerjs/design";
10
+ import { IImageIoService as li, IDrawingManagerService as fe, DRAWING_IMAGE_ALLOW_IMAGE_LIST as ui, DRAWING_IMAGE_COUNT_LIMIT as kt, ImageUploadStatusType as mt, DRAWING_IMAGE_ALLOW_SIZE as hi, getImageSize as fi, getDrawingShapeKeyByDrawingSearch as pi, DRAWING_IMAGE_WIDTH_LIMIT as Wt, DRAWING_IMAGE_HEIGHT_LIMIT as Gt, UniverDrawingPlugin as mi } from "@univerjs/drawing";
11
+ import { IMessageService as wi, ILocalFileService as vi, ISidebarService as Ii, CanvasFloatDomService as _i, useDependency as we, getMenuHiddenObservable as on, MenuItemType as an, RibbonInsertGroup as Si, KeyCode as ke, ComponentManager as cn, IMenuManagerService as Di, IShortcutService as Oi, PrintFloatDomSingle as Ti, connectInjector as Mi, UniverUIPlugin as yi } from "@univerjs/ui";
12
+ import { BehaviorSubject as Ot, debounceTime as dn, map as Ht, switchMap as bi, of as Ci, Observable as Ei, takeUntil as Vt, filter as jt } from "rxjs";
13
+ import { DrawingRenderService as gn, DrawingCommonPanel as Ri, ImageCropperObject as Ai, COMPONENT_IMAGE_POPUP_MENU as Pi, OpenImageCropOperation as xi, ImageResetSizeOperation as Ni, UniverDrawingUIPlugin as Ui } from "@univerjs/drawing-ui";
14
14
  import { jsxs as X, jsx as M } from "react/jsx-runtime";
15
- import { useState as re, useEffect as Tt, useMemo as Ui } from "react";
15
+ import { useState as re, useEffect as Tt, useMemo as Li } from "react";
16
16
  const Mt = {
17
17
  id: "doc.command.remove-doc-image",
18
18
  type: q.COMMAND,
19
19
  // eslint-disable-next-line max-lines-per-function
20
20
  handler: (r, e) => {
21
21
  var C, y, A, L;
22
- const t = r.get(j), n = r.get(z), i = r.get(Q), s = n.getCurrentUniverDocInstance();
22
+ const t = r.get(V), n = r.get(z), i = r.get(Q), s = n.getCurrentUniverDocInstance();
23
23
  if (e == null || s == null)
24
24
  return !1;
25
25
  const o = i.getRenderById(e.unitId).with(Me), { drawings: c } = e, d = (C = o.getSegment()) != null ? C : "", a = new _t(), g = $.getInstance(), u = (A = (y = s.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? A : [], l = c.map((R) => u.find((v) => v.blockId === R.drawingId)).filter((R) => !!R).sort((R, v) => R.startIndex > v.startIndex ? 1 : -1), f = c[0].unitId, h = new Nn();
@@ -50,8 +50,8 @@ const Mt = {
50
50
  const S = Xe(s, d);
51
51
  D.push(g.editOp(a.serialize(), S));
52
52
  for (const R of l) {
53
- const { blockId: v } = R, N = ((L = s.getDrawings()) != null ? L : {})[v], x = s.getDrawingsOrder().indexOf(v), G = g.removeOp(["drawings", v], N), I = g.removeOp(["drawingsOrder", x], v);
54
- D.push(G), D.push(I);
53
+ const { blockId: v } = R, N = ((L = s.getDrawings()) != null ? L : {})[v], x = s.getDrawingsOrder().indexOf(v), H = g.removeOp(["drawings", v], N), I = g.removeOp(["drawingsOrder", x], v);
54
+ D.push(H), D.push(I);
55
55
  }
56
56
  return w.params.actions = D.reduce((R, v) => $.compose(R, v), null), !!t.syncExecuteCommand(w.id, w.params);
57
57
  }
@@ -59,7 +59,7 @@ const Mt = {
59
59
  id: "doc.command.delete-drawing",
60
60
  type: q.COMMAND,
61
61
  handler: (r) => {
62
- const e = r.get(j), n = r.get(Ne).getFocusDrawings();
62
+ const e = r.get(V), n = r.get(Ne).getFocusDrawings();
63
63
  if (n.length === 0)
64
64
  return !1;
65
65
  const { unitId: i } = n[0], s = n.map((o) => {
@@ -80,7 +80,7 @@ const Mt = {
80
80
  id: "doc.command.group-doc-image",
81
81
  type: q.COMMAND,
82
82
  handler: (r, e) => {
83
- r.get(j), r.get(Kt);
83
+ r.get(V), r.get(Kt);
84
84
  const t = r.get(Ne);
85
85
  if (!e) return !1;
86
86
  const n = [];
@@ -100,7 +100,7 @@ const Mt = {
100
100
  var y, A, L, R;
101
101
  if (e == null)
102
102
  return !1;
103
- const t = r.get(j), n = r.get(Dt), i = r.get(z), s = n.getActiveTextRange(), o = i.getCurrentUniverDocInstance();
103
+ const t = r.get(V), n = r.get(Dt), i = r.get(z), s = n.getActiveTextRange(), o = i.getCurrentUniverDocInstance();
104
104
  if (s == null || o == null)
105
105
  return !1;
106
106
  const c = o.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: g, segmentId: u } = s, l = o.getSelfOrHeaderFooterModel(u).getBody();
@@ -116,10 +116,10 @@ const Mt = {
116
116
  else {
117
117
  const v = Un.selection.delete([s], l, 0, null, !1);
118
118
  f.push(...v);
119
- const N = Kn(l, [s]), H = (L = o.getDrawings()) != null ? L : {}, x = (R = o.getDrawingsOrder()) != null ? R : [], G = N.sort((I, _) => x.indexOf(I) > x.indexOf(_) ? -1 : x.indexOf(I) < x.indexOf(_) ? 1 : 0);
120
- if (G.length > 0)
121
- for (const I of G) {
122
- const _ = H[I], E = x.indexOf(I);
119
+ const N = Yn(l, [s]), G = (L = o.getDrawings()) != null ? L : {}, x = (R = o.getDrawingsOrder()) != null ? R : [], H = N.sort((I, _) => x.indexOf(I) > x.indexOf(_) ? -1 : x.indexOf(I) < x.indexOf(_) ? 1 : 0);
120
+ if (H.length > 0)
121
+ for (const I of H) {
122
+ const _ = G[I], E = x.indexOf(I);
123
123
  if (_ == null || E < 0)
124
124
  continue;
125
125
  const T = h.removeOp(["drawings", I], _), U = h.removeOp(["drawingsOrder", E], I);
@@ -140,8 +140,8 @@ const Mt = {
140
140
  const D = Xe(o, u), S = h.editOp(f.serialize(), D);
141
141
  m.push(S);
142
142
  for (const v of d) {
143
- const { drawingId: N } = v, H = h.insertOp(["drawings", N], v), x = h.insertOp(["drawingsOrder", p - w], N);
144
- m.push(H), m.push(x);
143
+ const { drawingId: N } = v, G = h.insertOp(["drawings", N], v), x = h.insertOp(["drawingsOrder", p - w], N);
144
+ m.push(G), m.push(x);
145
145
  }
146
146
  const O = {
147
147
  id: ee.id,
@@ -157,7 +157,7 @@ const Mt = {
157
157
  id: "doc.command.set-drawing-arrange",
158
158
  type: q.COMMAND,
159
159
  handler: (r, e) => {
160
- const t = r.get(j), n = r.get(Ne);
160
+ const t = r.get(V), n = r.get(Ne);
161
161
  if (e == null)
162
162
  return !1;
163
163
  const { unitId: i, subUnitId: s, drawingIds: o, arrangeType: c } = e, d = { unitId: i, subUnitId: s, drawingIds: o };
@@ -184,7 +184,7 @@ const Mt = {
184
184
  id: "doc.command.ungroup-doc-image",
185
185
  type: q.COMMAND,
186
186
  handler: (r, e) => {
187
- r.get(j), r.get(Kt);
187
+ r.get(V), r.get(Kt);
188
188
  const t = r.get(Ne);
189
189
  if (!e) return !1;
190
190
  const n = [];
@@ -206,8 +206,8 @@ class ut {
206
206
  this._refreshDrawings$.next(e);
207
207
  }
208
208
  }
209
- var Li = Object.getOwnPropertyDescriptor, Bi = (r, e, t, n) => {
210
- for (var i = n > 1 ? void 0 : n ? Li(e, t) : e, s = r.length - 1, o; s >= 0; s--)
209
+ var Bi = Object.getOwnPropertyDescriptor, Fi = (r, e, t, n) => {
210
+ for (var i = n > 1 ? void 0 : n ? Bi(e, t) : e, s = r.length - 1, o; s >= 0; s--)
211
211
  (o = r[s]) && (i = o(i) || i);
212
212
  return i;
213
213
  }, le = (r, e) => (t, n) => e(t, n, r);
@@ -221,7 +221,7 @@ let it = class extends xe {
221
221
  async insertDocImage() {
222
222
  const r = await this._fileOpenerService.openFile({
223
223
  multiple: !0,
224
- accept: li.map((t) => `.${t.replace("image/", "")}`).join(",")
224
+ accept: ui.map((t) => `.${t.replace("image/", "")}`).join(",")
225
225
  }), e = r.length;
226
226
  return e > kt ? (this._messageService.show({
227
227
  type: Lt.Error,
@@ -238,7 +238,7 @@ let it = class extends xe {
238
238
  let o = "";
239
239
  switch (s) {
240
240
  case mt.ERROR_EXCEED_SIZE:
241
- o = this._localeService.t("update-status.exceedMaxSize", String(ui / (1024 * 1024)));
241
+ o = this._localeService.t("update-status.exceedMaxSize", String(hi / (1024 * 1024)));
242
242
  break;
243
243
  case mt.ERROR_IMAGE_TYPE:
244
244
  o = this._localeService.t("update-status.invalidImageType");
@@ -258,11 +258,11 @@ let it = class extends xe {
258
258
  for (const i of e) {
259
259
  if (i == null)
260
260
  continue;
261
- const { imageId: s, imageSourceType: o, source: c, base64Cache: d } = i, { width: a, height: g, image: u } = await hi(d || "");
261
+ const { imageId: s, imageSourceType: o, source: c, base64Cache: d } = i, { width: a, height: g, image: u } = await fi(d || "");
262
262
  this._imageIoService.addImageSourceCache(s, o, u);
263
263
  let l = 1;
264
- if (a > Wt || g > Ht) {
265
- const p = Wt / a, w = Ht / g;
264
+ if (a > Wt || g > Gt) {
265
+ const p = Wt / a, w = Gt / g;
266
266
  l = Math.min(p, w);
267
267
  }
268
268
  const f = this._getImagePosition(a * l, g * l);
@@ -402,7 +402,7 @@ let it = class extends xe {
402
402
  return;
403
403
  const i = r.getSnapshot(), { drawings: s = {} } = i, o = n.getEditArea() === Fe.BODY;
404
404
  for (const d of Object.keys(s)) {
405
- const a = s[d], g = fi({ unitId: t, drawingId: a.drawingId, subUnitId: t }), u = e.fuzzyMathObjects(g, !0);
405
+ const a = s[d], g = pi({ unitId: t, drawingId: a.drawingId, subUnitId: t }), u = e.fuzzyMathObjects(g, !0);
406
406
  if (u.length)
407
407
  for (const l of u) {
408
408
  e.detachTransformerFrom(l);
@@ -450,19 +450,19 @@ let it = class extends xe {
450
450
  this._docSelectionManagerService.replaceDocRanges(n);
451
451
  }
452
452
  };
453
- it = Bi([
454
- le(1, j),
453
+ it = Fi([
454
+ le(1, V),
455
455
  le(2, Z(Dt)),
456
456
  le(3, Q),
457
- le(4, gi),
457
+ le(4, li),
458
458
  le(5, Ne),
459
459
  le(6, fe),
460
460
  le(7, Yt),
461
- le(8, mi),
461
+ le(8, wi),
462
462
  le(9, Z(lt)),
463
463
  le(10, Z(Me)),
464
464
  le(11, Z(ut)),
465
- le(12, wi)
465
+ le(12, vi)
466
466
  ], it);
467
467
  const pn = {
468
468
  id: "doc.command.insert-float-image",
@@ -470,11 +470,11 @@ const pn = {
470
470
  handler: (r) => {
471
471
  var n, i;
472
472
  const e = r.get(z), t = r.get(Q);
473
- return (i = (n = ni(ve.UNIVER_DOC, e, t)) == null ? void 0 : n.with(it).insertDocImage()) != null ? i : !1;
473
+ return (i = (n = ii(ve.UNIVER_DOC, e, t)) == null ? void 0 : n.with(it).insertDocImage()) != null ? i : !1;
474
474
  }
475
475
  };
476
476
  var ue = /* @__PURE__ */ ((r) => (r.INLINE = "inline", r.BEHIND_TEXT = "behindText", r.IN_FRONT_OF_TEXT = "inFrontOfText", r.WRAP_SQUARE = "wrapSquare", r.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", r))(ue || {});
477
- const Fi = {
477
+ const ki = {
478
478
  inline: k.INLINE,
479
479
  wrapSquare: k.WRAP_SQUARE,
480
480
  wrapTopAndBottom: k.WRAP_TOP_AND_BOTTOM,
@@ -566,14 +566,14 @@ const wn = {
566
566
  var A, L;
567
567
  if (e == null)
568
568
  return !1;
569
- const { drawings: t, wrappingStyle: n, unitId: i } = e, s = r.get(j), o = r.get(z), d = r.get(Q).getRenderById(i), a = d == null ? void 0 : d.with(te).getSkeleton().getSkeletonData(), g = d == null ? void 0 : d.with(te).getViewModel(), u = d == null ? void 0 : d.scene, l = o.getCurrentUniverDocInstance();
569
+ const { drawings: t, wrappingStyle: n, unitId: i } = e, s = r.get(V), o = r.get(z), d = r.get(Q).getRenderById(i), a = d == null ? void 0 : d.with(te).getSkeleton().getSkeletonData(), g = d == null ? void 0 : d.with(te).getViewModel(), u = d == null ? void 0 : d.scene, l = o.getCurrentUniverDocInstance();
570
570
  if (l == null || a == null || u == null || g == null)
571
571
  return !1;
572
572
  const f = g.getEditArea(), h = u.getTransformerByCreate(), { pages: m, skeHeaders: p, skeFooters: w } = a, D = $.getInstance(), S = [], { drawings: O = {} } = l.getSnapshot();
573
573
  for (const R of t) {
574
- const { drawingId: v } = R, N = O[v].layoutType, H = Fi[n];
575
- if (N !== H) {
576
- const _ = D.replaceOp(["drawings", v, "layoutType"], N, H);
574
+ const { drawingId: v } = R, N = O[v].layoutType, G = ki[n];
575
+ if (N !== G) {
576
+ const _ = D.replaceOp(["drawings", v, "layoutType"], N, G);
577
577
  S.push(_);
578
578
  }
579
579
  if (n === "behindText" || n === "inFrontOfText") {
@@ -585,22 +585,22 @@ const wn = {
585
585
  }
586
586
  if (n === "inline")
587
587
  continue;
588
- let x = null, G = 0, I = 0;
588
+ let x = null, H = 0, I = 0;
589
589
  for (const _ of m) {
590
- const { headerId: E, footerId: T, marginTop: U, marginLeft: B, marginBottom: b, pageWidth: P, pageHeight: V } = _;
590
+ const { headerId: E, footerId: T, marginTop: U, marginLeft: B, marginBottom: b, pageWidth: P, pageHeight: j } = _;
591
591
  switch (f) {
592
592
  case Fe.HEADER: {
593
593
  const F = (A = p.get(E)) == null ? void 0 : A.get(P);
594
- F != null && F.skeDrawings.has(v) && (x = F.skeDrawings.get(v), G = F.marginTop, I = B);
594
+ F != null && F.skeDrawings.has(v) && (x = F.skeDrawings.get(v), H = F.marginTop, I = B);
595
595
  break;
596
596
  }
597
597
  case Fe.FOOTER: {
598
598
  const F = (L = w.get(T)) == null ? void 0 : L.get(P);
599
- F != null && F.skeDrawings.has(v) && (x = F.skeDrawings.get(v), G = V - b + F.marginTop, I = B);
599
+ F != null && F.skeDrawings.has(v) && (x = F.skeDrawings.get(v), H = j - b + F.marginTop, I = B);
600
600
  break;
601
601
  }
602
602
  case Fe.BODY: {
603
- _.skeDrawings.has(v) && (x = _.skeDrawings.get(v), G = U, I = B);
603
+ _.skeDrawings.has(v) && (x = _.skeDrawings.get(v), H = U, I = B);
604
604
  break;
605
605
  }
606
606
  }
@@ -621,13 +621,13 @@ const wn = {
621
621
  }
622
622
  const b = O[v].docTransform.positionV;
623
623
  let P = _;
624
- b.relativeFrom === W.PAGE ? P += G : b.relativeFrom === W.LINE ? P -= x.lineTop : b.relativeFrom === W.PARAGRAPH && (P -= x.blockAnchorTop);
625
- const V = {
624
+ b.relativeFrom === W.PAGE ? P += H : b.relativeFrom === W.LINE ? P -= x.lineTop : b.relativeFrom === W.PARAGRAPH && (P -= x.blockAnchorTop);
625
+ const j = {
626
626
  relativeFrom: b.relativeFrom,
627
627
  posOffset: P
628
628
  };
629
- if (b.posOffset !== V.posOffset) {
630
- const F = D.replaceOp(["drawings", v, "docTransform", "positionV"], b, V);
629
+ if (b.posOffset !== j.posOffset) {
630
+ const F = D.replaceOp(["drawings", v, "docTransform", "positionV"], b, j);
631
631
  S.push(F);
632
632
  }
633
633
  }
@@ -650,7 +650,7 @@ const wn = {
650
650
  handler: (r, e) => {
651
651
  if (e == null)
652
652
  return !1;
653
- const t = r.get(j), i = r.get(z).getCurrentUniverDocInstance();
653
+ const t = r.get(V), i = r.get(z).getCurrentUniverDocInstance();
654
654
  if (i == null)
655
655
  return !1;
656
656
  const { drawings: s, dist: o, unitId: c } = e, d = $.getInstance(), a = [], { drawings: g = {} } = i.getSnapshot();
@@ -680,7 +680,7 @@ const wn = {
680
680
  handler: (r, e) => {
681
681
  if (e == null)
682
682
  return !1;
683
- const t = r.get(j), i = r.get(z).getCurrentUniverDocInstance();
683
+ const t = r.get(V), i = r.get(z).getCurrentUniverDocInstance();
684
684
  if (i == null)
685
685
  return !1;
686
686
  const { drawings: s, wrapText: o, unitId: c } = e, d = $.getInstance(), a = [], { drawings: g = {} } = i.getSnapshot();
@@ -707,7 +707,7 @@ const wn = {
707
707
  handler: (r, e) => {
708
708
  if (e == null)
709
709
  return !1;
710
- const t = r.get(j), n = r.get(z), s = r.get(Q).getRenderById(e.unitId), o = s == null ? void 0 : s.scene;
710
+ const t = r.get(V), n = r.get(z), s = r.get(Q).getRenderById(e.unitId), o = s == null ? void 0 : s.scene;
711
711
  if (o == null)
712
712
  return !1;
713
713
  const c = o.getTransformerByCreate(), d = n.getCurrentUniverDocInstance();
@@ -744,7 +744,7 @@ const wn = {
744
744
  const t = r.get(Q), n = (L = t.getRenderById(e.unitId)) == null ? void 0 : L.with(Me), i = r.get(ut), s = t.getRenderById(e.unitId), o = s == null ? void 0 : s.scene, c = s == null ? void 0 : s.with(te).getSkeleton();
745
745
  if (o == null || n == null)
746
746
  return !1;
747
- const d = o.getTransformerByCreate(), a = r.get(j), u = r.get(z).getCurrentUniverDocInstance();
747
+ const d = o.getTransformerByCreate(), a = r.get(V), u = r.get(z).getCurrentUniverDocInstance();
748
748
  if (u == null)
749
749
  return !1;
750
750
  const { drawing: l, unitId: f, offset: h, segmentId: m, segmentPage: p, needRefreshDrawings: w } = e;
@@ -779,16 +779,16 @@ const wn = {
779
779
  type: q.COMMAND,
780
780
  // eslint-disable-next-line max-lines-per-function
781
781
  handler: (r, e) => {
782
- var x, G;
782
+ var x, H;
783
783
  if (e == null)
784
784
  return !1;
785
785
  const t = r.get(Q), n = (x = t.getRenderById(e.unitId)) == null ? void 0 : x.with(Me), i = t.getRenderById(e.unitId), s = i == null ? void 0 : i.scene;
786
786
  if (s == null || n == null)
787
787
  return !1;
788
- const o = s.getTransformerByCreate(), c = r.get(j), a = r.get(z).getCurrentUniverDocInstance();
788
+ const o = s.getTransformerByCreate(), c = r.get(V), a = r.get(z).getCurrentUniverDocInstance();
789
789
  if (a == null)
790
790
  return !1;
791
- const { drawing: g, unitId: u, offset: l, docTransform: f, segmentId: h, segmentPage: m } = e, p = [], { drawingId: w } = g, D = (G = n.getSegment()) != null ? G : "", S = mn(
791
+ const { drawing: g, unitId: u, offset: l, docTransform: f, segmentId: h, segmentPage: m } = e, p = [], { drawingId: w } = g, D = (H = n.getSegment()) != null ? H : "", S = mn(
792
792
  h,
793
793
  D,
794
794
  m,
@@ -827,14 +827,14 @@ const wn = {
827
827
  }
828
828
  };
829
829
  N.params.actions = p.reduce((I, _) => $.compose(I, _), null);
830
- const H = c.syncExecuteCommand(N.id, N.params);
831
- return o.refreshControls(), !!H;
830
+ const G = c.syncExecuteCommand(N.id, N.params);
831
+ return o.refreshControls(), !!G;
832
832
  }
833
833
  }, Ke = {
834
834
  id: "doc.command.move-drawing",
835
835
  type: q.COMMAND,
836
836
  handler: (r, e) => {
837
- const t = r.get(j), n = r.get(Ne), i = r.get(z), s = r.get(Q), { direction: o } = e, c = n.getFocusDrawings();
837
+ const t = r.get(V), n = r.get(Ne), i = r.get(z), s = r.get(Q), { direction: o } = e, c = n.getFocusDrawings();
838
838
  if (c.length === 0)
839
839
  return !1;
840
840
  const d = c[0].unitId, a = s.getRenderById(d), g = a == null ? void 0 : a.scene;
@@ -861,7 +861,7 @@ const wn = {
861
861
  });
862
862
  return u.refreshControls(), !!h;
863
863
  }
864
- }, ki = {
864
+ }, Wi = {
865
865
  id: "doc.operation.clear-drawing-transformer",
866
866
  type: q.MUTATION,
867
867
  handler: (r, e) => {
@@ -875,7 +875,7 @@ const wn = {
875
875
  id: "sidebar.operation.doc-image",
876
876
  type: q.COMMAND,
877
877
  handler: async (r, e) => {
878
- const t = r.get(vi), n = r.get(lt), i = r.get(fe);
878
+ const t = r.get(Ii), n = r.get(lt), i = r.get(fe);
879
879
  return e.value === "open" ? t.open({
880
880
  header: { title: n.t("docImage.panel.title") },
881
881
  children: { label: Dn },
@@ -889,12 +889,12 @@ const wn = {
889
889
  id: "doc.operation.edit-doc-image",
890
890
  type: q.OPERATION,
891
891
  handler: (r, e) => {
892
- const t = r.get(fe), n = r.get(j);
892
+ const t = r.get(fe), n = r.get(V);
893
893
  return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(On.id, { value: "open" }), !0);
894
894
  }
895
895
  };
896
- var Wi = Object.getOwnPropertyDescriptor, Hi = (r, e, t, n) => {
897
- for (var i = n > 1 ? void 0 : n ? Wi(e, t) : e, s = r.length - 1, o; s >= 0; s--)
896
+ var Gi = Object.getOwnPropertyDescriptor, Hi = (r, e, t, n) => {
897
+ for (var i = n > 1 ? void 0 : n ? Gi(e, t) : e, s = r.length - 1, o; s >= 0; s--)
898
898
  (o = r[s]) && (i = o(i) || i);
899
899
  return i;
900
900
  }, Le = (r, e) => (t, n) => e(t, n, r);
@@ -1040,13 +1040,13 @@ let rt = class extends xe {
1040
1040
  };
1041
1041
  this.disposeWithMe(
1042
1042
  this._univerInstanceService.getCurrentTypeOfUnit$(ve.UNIVER_DOC).pipe(
1043
- Gt((t) => {
1043
+ Ht((t) => {
1044
1044
  if (!t) return null;
1045
1045
  const n = t.getUnitId(), i = this._renderManagerService.getRenderById(n);
1046
1046
  return i ? { render: i, unitId: n } : null;
1047
1047
  }),
1048
- yi(
1049
- (t) => t ? Zt(t.render.scene.getViewport(tn.VIEW_MAIN).onScrollAfter$).pipe(Gt(() => ({ unitId: t.unitId }))) : bi(null)
1048
+ bi(
1049
+ (t) => t ? Zt(t.render.scene.getViewport(tn.VIEW_MAIN).onScrollAfter$).pipe(Ht(() => ({ unitId: t.unitId }))) : Ci(null)
1050
1050
  )
1051
1051
  ).subscribe((t) => {
1052
1052
  if (!t) return;
@@ -1106,12 +1106,12 @@ rt = Hi([
1106
1106
  Le(0, Q),
1107
1107
  Le(1, fe),
1108
1108
  Le(2, Z(gn)),
1109
- Le(3, Z(Ii)),
1109
+ Le(3, Z(_i)),
1110
1110
  Le(4, z),
1111
- Le(5, j)
1111
+ Le(5, V)
1112
1112
  ], rt);
1113
- const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1114
- const e = we(j), t = we(lt), n = we(fe), i = we(Q), s = we(z), { drawings: o } = r, c = o[0];
1113
+ const Vi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1114
+ const e = we(V), t = we(lt), n = we(fe), i = we(Q), s = we(z), { drawings: o } = r, c = o[0];
1115
1115
  if (c == null)
1116
1116
  return;
1117
1117
  const { unitId: d } = c, a = s.getUniverDocInstance(d), g = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor, u = i.getRenderById(d), l = u == null ? void 0 : u.scene;
@@ -1180,7 +1180,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1180
1180
  if (B.length === 0)
1181
1181
  return;
1182
1182
  const b = B[0].drawingId, P = B[0].unitId;
1183
- let V = null, F = 0;
1183
+ let j = null, F = 0;
1184
1184
  const K = (ie = i.getRenderById(P)) == null ? void 0 : ie.with(te).getSkeleton(), oe = K == null ? void 0 : K.getSkeletonData();
1185
1185
  if (oe == null)
1186
1186
  return;
@@ -1188,31 +1188,31 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1188
1188
  for (const ce of Ue) {
1189
1189
  const { marginLeft: Se, skeDrawings: De, headerId: be, footerId: Ce, pageWidth: Oe } = ce;
1190
1190
  if (De.has(b)) {
1191
- V = De.get(b), F = Se;
1191
+ j = De.get(b), F = Se;
1192
1192
  break;
1193
1193
  }
1194
1194
  const de = (Ie = ye.get(be)) == null ? void 0 : Ie.get(Oe);
1195
1195
  if (de != null && de.skeDrawings.has(b)) {
1196
- V = de == null ? void 0 : de.skeDrawings.get(b), F = Se;
1196
+ j = de == null ? void 0 : de.skeDrawings.get(b), F = Se;
1197
1197
  break;
1198
1198
  }
1199
1199
  const ge = (_e = We.get(Ce)) == null ? void 0 : _e.get(Oe);
1200
1200
  if (ge != null && ge.skeDrawings.has(b)) {
1201
- V = ge == null ? void 0 : ge.skeDrawings.get(b), F = Se;
1201
+ j = ge == null ? void 0 : ge.skeDrawings.get(b), F = Se;
1202
1202
  break;
1203
1203
  }
1204
1204
  }
1205
- if (V == null)
1205
+ if (j == null)
1206
1206
  return;
1207
1207
  let ae = 0;
1208
- E === J.COLUMN ? ae -= V.columnLeft : E === J.MARGIN && (ae -= F), U === J.COLUMN ? ae += V.columnLeft : U === J.MARGIN ? ae += F : J.PAGE;
1208
+ E === J.COLUMN ? ae -= j.columnLeft : E === J.MARGIN && (ae -= F), U === J.COLUMN ? ae += j.columnLeft : U === J.MARGIN ? ae += F : J.PAGE;
1209
1209
  const ne = {
1210
1210
  relativeFrom: U,
1211
1211
  posOffset: (T != null ? T : 0) - ae
1212
1212
  };
1213
1213
  v("positionH", ne);
1214
1214
  }
1215
- function H(_) {
1215
+ function G(_) {
1216
1216
  var De, be, Ce, Oe, de, ge;
1217
1217
  const E = O.relativeFrom, T = O.posOffset, U = Number(_);
1218
1218
  if (E === U)
@@ -1220,7 +1220,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1220
1220
  const B = n.getFocusDrawings();
1221
1221
  if (B.length === 0)
1222
1222
  return;
1223
- const { drawingId: b, unitId: P } = B[0], V = s.getUniverDocInstance(P), F = (De = i.getRenderById(P)) == null ? void 0 : De.with(te).getSkeleton(), K = (be = i.getRenderById(P)) == null ? void 0 : be.with(Me), oe = K == null ? void 0 : K.getSegment(), Ue = K == null ? void 0 : K.getSegmentPage(), ye = (Oe = (Ce = V == null ? void 0 : V.getSelfOrHeaderFooterModel(oe).getBody()) == null ? void 0 : Ce.customBlocks) == null ? void 0 : Oe.find((Ee) => Ee.blockId === b);
1223
+ const { drawingId: b, unitId: P } = B[0], j = s.getUniverDocInstance(P), F = (De = i.getRenderById(P)) == null ? void 0 : De.with(te).getSkeleton(), K = (be = i.getRenderById(P)) == null ? void 0 : be.with(Me), oe = K == null ? void 0 : K.getSegment(), Ue = K == null ? void 0 : K.getSegmentPage(), ye = (Oe = (Ce = j == null ? void 0 : j.getSelfOrHeaderFooterModel(oe).getBody()) == null ? void 0 : Ce.customBlocks) == null ? void 0 : Oe.find((Ee) => Ee.blockId === b);
1224
1224
  if (ye == null || F == null || K == null)
1225
1225
  return;
1226
1226
  const { startIndex: We } = ye, ae = F.findNodeByCharIndex(We, oe, Ue), ne = (de = ae == null ? void 0 : ae.parent) == null ? void 0 : de.parent, ie = ne == null ? void 0 : ne.parent, Ie = ie == null ? void 0 : ie.lines.find((Ee) => Ee.paragraphIndex === (ne == null ? void 0 : ne.paragraphIndex) && Ee.paragraphStart), _e = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
@@ -1245,15 +1245,15 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1245
1245
  } = T.docTransform;
1246
1246
  S(B), C(b), w(U === k.INLINE), A(b.relativeFrom === W.PARAGRAPH || b.relativeFrom === W.LINE);
1247
1247
  }
1248
- function G() {
1248
+ function H() {
1249
1249
  const _ = n.getFocusDrawings();
1250
1250
  _.length !== 0 && x(_[0]);
1251
1251
  }
1252
1252
  function I(_) {
1253
- A(_), H(String(_ ? W.PARAGRAPH : W.PAGE));
1253
+ A(_), G(String(_ ? W.PARAGRAPH : W.PAGE));
1254
1254
  }
1255
1255
  return Tt(() => {
1256
- G();
1256
+ H();
1257
1257
  const _ = n.focus$.subscribe((T) => {
1258
1258
  if (T.length === 0) {
1259
1259
  R(!1);
@@ -1261,7 +1261,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1261
1261
  }
1262
1262
  R(!0), x(T[0]);
1263
1263
  }), E = e.onCommandExecuted(async (T) => {
1264
- T.id === ee.id && G();
1264
+ T.id === ee.id && H();
1265
1265
  });
1266
1266
  return () => {
1267
1267
  _.unsubscribe(), E.dispose();
@@ -1365,7 +1365,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1365
1365
  disabled: p,
1366
1366
  value: String(O.relativeFrom),
1367
1367
  options: m,
1368
- onChange: H
1368
+ onChange: G
1369
1369
  }
1370
1370
  )
1371
1371
  ] })
@@ -1380,7 +1380,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1380
1380
  }
1381
1381
  ),
1382
1382
  /* @__PURE__ */ M("div", { children: /* @__PURE__ */ M(
1383
- ai,
1383
+ ci,
1384
1384
  {
1385
1385
  disabled: p,
1386
1386
  checked: y,
@@ -1391,8 +1391,8 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1391
1391
  ]
1392
1392
  }
1393
1393
  );
1394
- }, Qe = 0, Je = 100, Vi = (r) => {
1395
- const e = we(j), t = we(lt), n = we(fe), i = we(Q), s = we(z), { drawings: o } = r, c = o[0];
1394
+ }, Qe = 0, Je = 100, $i = (r) => {
1395
+ const e = we(V), t = we(lt), n = we(fe), i = we(Q), s = we(z), { drawings: o } = r, c = o[0];
1396
1396
  if (c == null)
1397
1397
  return null;
1398
1398
  const { unitId: d } = c, a = s.getUniverDocInstance(d), g = i.getRenderById(d);
@@ -1438,7 +1438,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1438
1438
  wrapText: I
1439
1439
  });
1440
1440
  }
1441
- function H(I, _) {
1441
+ function G(I, _) {
1442
1442
  if (I == null)
1443
1443
  return;
1444
1444
  const E = { ...y, [_]: I };
@@ -1462,9 +1462,9 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1462
1462
  }
1463
1463
  function x() {
1464
1464
  const I = n.getFocusDrawings();
1465
- I.length !== 0 && G(I[0]);
1465
+ I.length !== 0 && H(I[0]);
1466
1466
  }
1467
- function G(I) {
1467
+ function H(I) {
1468
1468
  var K, oe;
1469
1469
  const _ = (oe = (K = a == null ? void 0 : a.getSnapshot()) == null ? void 0 : K.drawings) == null ? void 0 : oe[I.drawingId];
1470
1470
  if (_ == null)
@@ -1476,14 +1476,14 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1476
1476
  distR: B = 0,
1477
1477
  layoutType: b = k.INLINE,
1478
1478
  behindDoc: P = se.FALSE,
1479
- wrapText: V = $e.BOTH_SIDES
1479
+ wrapText: j = $e.BOTH_SIDES
1480
1480
  } = _;
1481
1481
  if (A({
1482
1482
  distT: E,
1483
1483
  distL: T,
1484
1484
  distB: U,
1485
1485
  distR: B
1486
- }), C(V), f(b !== k.WRAP_SQUARE), b === k.WRAP_NONE || b === k.INLINE ? m(!0) : m(!1), b === k.WRAP_NONE || b === k.INLINE || b === k.WRAP_TOP_AND_BOTTOM ? w(!0) : w(!1), b === k.WRAP_NONE)
1486
+ }), C(j), f(b !== k.WRAP_SQUARE), b === k.WRAP_NONE || b === k.INLINE ? m(!0) : m(!1), b === k.WRAP_NONE || b === k.INLINE || b === k.WRAP_TOP_AND_BOTTOM ? w(!0) : w(!1), b === k.WRAP_NONE)
1487
1487
  P === se.TRUE ? S(ue.BEHIND_TEXT) : S(ue.IN_FRONT_OF_TEXT);
1488
1488
  else
1489
1489
  switch (b) {
@@ -1507,7 +1507,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1507
1507
  R(!1);
1508
1508
  return;
1509
1509
  }
1510
- R(!0), G(E[0]);
1510
+ R(!0), H(E[0]);
1511
1511
  }), _ = e.onCommandExecuted(async (E) => {
1512
1512
  E.id === ee.id && x();
1513
1513
  });
@@ -1577,7 +1577,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1577
1577
  precision: 1,
1578
1578
  value: y.distT,
1579
1579
  onChange: (I) => {
1580
- H(I, "distT");
1580
+ G(I, "distT");
1581
1581
  }
1582
1582
  }
1583
1583
  )
@@ -1593,7 +1593,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1593
1593
  precision: 1,
1594
1594
  value: y.distL,
1595
1595
  onChange: (I) => {
1596
- H(I, "distL");
1596
+ G(I, "distL");
1597
1597
  }
1598
1598
  }
1599
1599
  )
@@ -1617,7 +1617,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1617
1617
  precision: 1,
1618
1618
  value: y.distB,
1619
1619
  onChange: (I) => {
1620
- H(I, "distB");
1620
+ G(I, "distB");
1621
1621
  }
1622
1622
  }
1623
1623
  )
@@ -1633,7 +1633,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1633
1633
  precision: 1,
1634
1634
  value: y.distR,
1635
1635
  onChange: (I) => {
1636
- H(I, "distR");
1636
+ G(I, "distR");
1637
1637
  }
1638
1638
  }
1639
1639
  )
@@ -1644,7 +1644,7 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1644
1644
  ]
1645
1645
  }
1646
1646
  );
1647
- }, $i = () => {
1647
+ }, zi = () => {
1648
1648
  const r = we(fe), e = r.getFocusDrawings(), [t, n] = re(e);
1649
1649
  return Tt(() => {
1650
1650
  const i = r.focus$.subscribe((s) => {
@@ -1654,13 +1654,13 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1654
1654
  i.unsubscribe();
1655
1655
  };
1656
1656
  }, []), !!(t != null && t.length) && /* @__PURE__ */ X("div", { className: "univer-text-sm", children: [
1657
- /* @__PURE__ */ M(Ei, { drawings: t, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
1658
- /* @__PURE__ */ M(Vi, { drawings: t }),
1657
+ /* @__PURE__ */ M(Ri, { drawings: t, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
1658
+ /* @__PURE__ */ M($i, { drawings: t }),
1659
1659
  /* @__PURE__ */ M(ji, { drawings: t })
1660
1660
  ] });
1661
- }, yn = "doc.menu.image", bn = pn.id, zi = (r) => {
1661
+ }, yn = "doc.menu.image", bn = pn.id, Xi = (r) => {
1662
1662
  const e = r.get(Dt), t = r.get(z);
1663
- return new Ci((n) => {
1663
+ return new Ei((n) => {
1664
1664
  const i = e.textSelection$.subscribe(() => {
1665
1665
  var o;
1666
1666
  const s = e.getActiveTextRange();
@@ -1682,17 +1682,17 @@ const Gi = "docs-drawing-ui.config", $t = {}, zt = -1e3, Xt = 1e3, ji = (r) => {
1682
1682
  return () => i.unsubscribe();
1683
1683
  });
1684
1684
  };
1685
- function Xi(r) {
1685
+ function qi(r) {
1686
1686
  return {
1687
1687
  id: yn,
1688
1688
  type: an.SUBITEMS,
1689
1689
  icon: "AddImageIcon",
1690
1690
  tooltip: "docImage.title",
1691
- disabled$: zi(r),
1691
+ disabled$: Xi(r),
1692
1692
  hidden$: on(r, ve.UNIVER_DOC, void 0, St)
1693
1693
  };
1694
1694
  }
1695
- function qi(r) {
1695
+ function Ki(r) {
1696
1696
  return {
1697
1697
  id: bn,
1698
1698
  title: "docImage.upload.float",
@@ -1700,22 +1700,22 @@ function qi(r) {
1700
1700
  hidden$: on(r, ve.UNIVER_DOC, void 0, St)
1701
1701
  };
1702
1702
  }
1703
- const Ki = {
1704
- [_i.MEDIA]: {
1703
+ const Yi = {
1704
+ [Si.MEDIA]: {
1705
1705
  [yn]: {
1706
1706
  order: 0,
1707
- menuItemFactory: Xi,
1707
+ menuItemFactory: qi,
1708
1708
  [bn]: {
1709
1709
  order: 0,
1710
- menuItemFactory: qi
1710
+ menuItemFactory: Ki
1711
1711
  }
1712
1712
  }
1713
1713
  }
1714
1714
  };
1715
1715
  function Ye(r) {
1716
- return r.getContextValue(Bn) && r.getContextValue(nt);
1716
+ return r.getContextValue(Bn) && r.getContextValue(Fn) && r.getContextValue(nt);
1717
1717
  }
1718
- const Yi = {
1718
+ const Zi = {
1719
1719
  id: Ke.id,
1720
1720
  description: "shortcut.drawing-move-down",
1721
1721
  group: "4_drawing-view",
@@ -1725,7 +1725,7 @@ const Yi = {
1725
1725
  staticParameters: {
1726
1726
  direction: he.DOWN
1727
1727
  }
1728
- }, Zi = {
1728
+ }, Qi = {
1729
1729
  id: Ke.id,
1730
1730
  description: "shortcut.drawing-move-up",
1731
1731
  group: "4_drawing-view",
@@ -1735,7 +1735,7 @@ const Yi = {
1735
1735
  staticParameters: {
1736
1736
  direction: he.UP
1737
1737
  }
1738
- }, Qi = {
1738
+ }, Ji = {
1739
1739
  id: Ke.id,
1740
1740
  description: "shortcut.drawing-move-left",
1741
1741
  group: "4_drawing-view",
@@ -1745,7 +1745,7 @@ const Yi = {
1745
1745
  staticParameters: {
1746
1746
  direction: he.LEFT
1747
1747
  }
1748
- }, Ji = {
1748
+ }, er = {
1749
1749
  id: Ke.id,
1750
1750
  description: "shortcut.drawing-move-right",
1751
1751
  group: "4_drawing-view",
@@ -1755,7 +1755,7 @@ const Yi = {
1755
1755
  staticParameters: {
1756
1756
  direction: he.RIGHT
1757
1757
  }
1758
- }, er = {
1758
+ }, tr = {
1759
1759
  id: ln.id,
1760
1760
  description: "shortcut.drawing-delete",
1761
1761
  group: "4_drawing-view",
@@ -1764,8 +1764,8 @@ const Yi = {
1764
1764
  binding: ke.DELETE,
1765
1765
  mac: ke.BACKSPACE
1766
1766
  };
1767
- var tr = Object.getOwnPropertyDescriptor, nr = (r, e, t, n) => {
1768
- for (var i = n > 1 ? void 0 : n ? tr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
1767
+ var nr = Object.getOwnPropertyDescriptor, ir = (r, e, t, n) => {
1768
+ for (var i = n > 1 ? void 0 : n ? nr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
1769
1769
  (o = r[s]) && (i = o(i) || i);
1770
1770
  return i;
1771
1771
  }, et = (r, e) => (t, n) => e(t, n, r);
@@ -1775,10 +1775,10 @@ let st = class extends xe {
1775
1775
  }
1776
1776
  _initCustomComponents() {
1777
1777
  const r = this._componentManager;
1778
- this.disposeWithMe(r.register(Dn, $i));
1778
+ this.disposeWithMe(r.register(Dn, zi));
1779
1779
  }
1780
1780
  _initMenus() {
1781
- this._menuManagerService.mergeMenu(Ki);
1781
+ this._menuManagerService.mergeMenu(Yi);
1782
1782
  }
1783
1783
  _initCommands() {
1784
1784
  [
@@ -1792,7 +1792,7 @@ let st = class extends xe {
1792
1792
  Sn,
1793
1793
  Mt,
1794
1794
  On,
1795
- ki,
1795
+ Wi,
1796
1796
  Tn,
1797
1797
  un,
1798
1798
  fn,
@@ -1804,11 +1804,11 @@ let st = class extends xe {
1804
1804
  _initShortcuts() {
1805
1805
  [
1806
1806
  // sheet drawing shortcuts
1807
- Yi,
1808
1807
  Zi,
1809
1808
  Qi,
1810
1809
  Ji,
1811
- er
1810
+ er,
1811
+ tr
1812
1812
  ].forEach((r) => {
1813
1813
  this.disposeWithMe(this._shortcutService.registerShortcut(r));
1814
1814
  });
@@ -1817,18 +1817,18 @@ let st = class extends xe {
1817
1817
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
1818
1818
  }
1819
1819
  };
1820
- st = nr([
1820
+ st = ir([
1821
1821
  et(0, Z(cn)),
1822
- et(1, Si),
1823
- et(2, j),
1824
- et(3, Di)
1822
+ et(1, Di),
1823
+ et(2, V),
1824
+ et(3, Oi)
1825
1825
  ], st);
1826
- var ir = Object.getOwnPropertyDescriptor, rr = (r, e, t, n) => {
1827
- for (var i = n > 1 ? void 0 : n ? ir(e, t) : e, s = r.length - 1, o; s >= 0; s--)
1826
+ var rr = Object.getOwnPropertyDescriptor, sr = (r, e, t, n) => {
1827
+ for (var i = n > 1 ? void 0 : n ? rr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
1828
1828
  (o = r[s]) && (i = o(i) || i);
1829
1829
  return i;
1830
- }, Ge = (r, e) => (t, n) => e(t, n, r);
1831
- function sr(r) {
1830
+ }, He = (r, e) => (t, n) => e(t, n, r);
1831
+ function or(r) {
1832
1832
  var n, i, s, o;
1833
1833
  if ($.isNoop(r) || !Array.isArray(r))
1834
1834
  return null;
@@ -1851,7 +1851,7 @@ function sr(r) {
1851
1851
  });
1852
1852
  return t;
1853
1853
  }
1854
- function or(r) {
1854
+ function ar(r) {
1855
1855
  if (!Array.isArray(r) || r.length < 3 || r[0] !== "drawingsOrder")
1856
1856
  return [];
1857
1857
  const e = [];
@@ -1878,7 +1878,7 @@ let ot = class extends xe {
1878
1878
  this._commandService.beforeCommandExecuted((r) => {
1879
1879
  if (r.id !== ee.id)
1880
1880
  return;
1881
- const e = r.params, { unitId: t, actions: n } = e, i = sr(n);
1881
+ const e = r.params, { unitId: t, actions: n } = e, i = or(n);
1882
1882
  if (i != null)
1883
1883
  for (const { type: s, drawingId: o, drawing: c } of i)
1884
1884
  s === "add" ? this._addDrawings(t, [c]) : this._removeDrawings(t, [o]);
@@ -1888,12 +1888,12 @@ let ot = class extends xe {
1888
1888
  if (r.id !== ee.id)
1889
1889
  return;
1890
1890
  const e = r.params, { unitId: t, actions: n } = e;
1891
- or(n).length > 0 && this._updateDrawingsOrder(t);
1891
+ ar(n).length > 0 && this._updateDrawingsOrder(t);
1892
1892
  })
1893
1893
  ), this.disposeWithMe(
1894
1894
  this._commandService.onCommandExecuted((r) => {
1895
1895
  var o;
1896
- if (r.id !== Fn.id && r.id !== kn.id)
1896
+ if (r.id !== kn.id && r.id !== Wn.id)
1897
1897
  return;
1898
1898
  const e = (o = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : o.getUnitId(), t = this._drawingManagerService.getFocusDrawings();
1899
1899
  if (e == null || t.length === 0)
@@ -1934,15 +1934,15 @@ let ot = class extends xe {
1934
1934
  n.orderNotification(s), i.orderNotification(s);
1935
1935
  }
1936
1936
  };
1937
- ot = rr([
1938
- Ge(0, z),
1939
- Ge(1, j),
1940
- Ge(2, fe),
1941
- Ge(3, Ne),
1942
- Ge(4, Q)
1937
+ ot = sr([
1938
+ He(0, z),
1939
+ He(1, V),
1940
+ He(2, fe),
1941
+ He(3, Ne),
1942
+ He(4, Q)
1943
1943
  ], ot);
1944
- const ar = (r) => {
1945
- const { floatDomInfos: e, scene: t, offset: n, bound: i } = r, s = i.right - i.left, o = i.bottom - i.top, c = Ui(() => e.map((d) => {
1944
+ const cr = (r) => {
1945
+ const { floatDomInfos: e, scene: t, offset: n, bound: i } = r, s = i.right - i.left, o = i.bottom - i.top, c = Li(() => e.map((d) => {
1946
1946
  const { width: a = 0, height: g = 0, left: u = 0, top: l = 0 } = d.transform, h = Mn(
1947
1947
  {
1948
1948
  left: u,
@@ -1969,13 +1969,13 @@ const ar = (r) => {
1969
1969
  };
1970
1970
  return [d.drawingId, m];
1971
1971
  }).filter(([d, a]) => !(a.position.endX < 0 || a.position.endY < 0 || a.position.startX > s || a.position.startY > o)), [e, t, n, s, o]);
1972
- return /* @__PURE__ */ M("div", { className: "univer-absolute univer-left-0 univer-top-0", children: c.map(([d, a]) => /* @__PURE__ */ M(Oi, { layer: a, id: d, position: a.position }, d)) });
1972
+ return /* @__PURE__ */ M("div", { className: "univer-absolute univer-left-0 univer-top-0", children: c.map(([d, a]) => /* @__PURE__ */ M(Ti, { layer: a, id: d, position: a.position }, d)) });
1973
1973
  };
1974
- var cr = Object.getOwnPropertyDescriptor, dr = (r, e, t, n) => {
1975
- for (var i = n > 1 ? void 0 : n ? cr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
1974
+ var dr = Object.getOwnPropertyDescriptor, gr = (r, e, t, n) => {
1975
+ for (var i = n > 1 ? void 0 : n ? dr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
1976
1976
  (o = r[s]) && (i = o(i) || i);
1977
1977
  return i;
1978
- }, je = (r, e) => (t, n) => e(t, n, r);
1978
+ }, Ve = (r, e) => (t, n) => e(t, n, r);
1979
1979
  let at = class extends xe {
1980
1980
  constructor(r, e, t, n, i) {
1981
1981
  super(), this._docPrintInterceptorService = r, this._drawingRenderService = e, this._drawingManagerService = t, this._componetManager = n, this._injector = i, this._initPrinting(), this._initPrintingDom();
@@ -2009,7 +2009,7 @@ let at = class extends xe {
2009
2009
  if (a.drawingType === Pe.DRAWING_CHART)
2010
2010
  return {
2011
2011
  ...a,
2012
- componentKey: this._componetManager.get(Wn)
2012
+ componentKey: this._componetManager.get(Gn)
2013
2013
  };
2014
2014
  if (a.drawingType === Pe.DRAWING_DOM) {
2015
2015
  const g = this._docPrintInterceptorService.getPrintComponent(a.componentKey);
@@ -2019,8 +2019,8 @@ let at = class extends xe {
2019
2019
  };
2020
2020
  }
2021
2021
  return null;
2022
- }).filter(Boolean), c = Ti(ar, this._injector);
2023
- return ci(
2022
+ }).filter(Boolean), c = Mi(cr, this._injector);
2023
+ return di(
2024
2024
  /* @__PURE__ */ M(
2025
2025
  c,
2026
2026
  {
@@ -2034,7 +2034,7 @@ let at = class extends xe {
2034
2034
  ),
2035
2035
  e.root
2036
2036
  ), r == null || r.add(() => {
2037
- di(e.root);
2037
+ gi(e.root);
2038
2038
  }), t(r);
2039
2039
  }
2040
2040
  }
@@ -2043,19 +2043,19 @@ let at = class extends xe {
2043
2043
  );
2044
2044
  }
2045
2045
  };
2046
- at = dr([
2047
- je(0, Z(Yn)),
2048
- je(1, Z(gn)),
2049
- je(2, fe),
2050
- je(3, Z(cn)),
2051
- je(4, Z(Jt))
2046
+ at = gr([
2047
+ Ve(0, Z(Zn)),
2048
+ Ve(1, Z(gn)),
2049
+ Ve(2, fe),
2050
+ Ve(3, Z(cn)),
2051
+ Ve(4, Z(Jt))
2052
2052
  ], at);
2053
- var gr = Object.getOwnPropertyDescriptor, lr = (r, e, t, n) => {
2054
- for (var i = n > 1 ? void 0 : n ? gr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2053
+ var lr = Object.getOwnPropertyDescriptor, ur = (r, e, t, n) => {
2054
+ for (var i = n > 1 ? void 0 : n ? lr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2055
2055
  (o = r[s]) && (i = o(i) || i);
2056
2056
  return i;
2057
2057
  }, tt = (r, e) => (t, n) => e(t, n, r);
2058
- const ur = "__InlineDrawingAnchor__";
2058
+ const hr = "__InlineDrawingAnchor__";
2059
2059
  function qt(r) {
2060
2060
  const { path: e } = r;
2061
2061
  return e.some((t) => t === "cells");
@@ -2231,7 +2231,7 @@ let ct = class extends xe {
2231
2231
  i != null && this._createOrUpdateInlineAnchor(e.unitId, i);
2232
2232
  }
2233
2233
  _getInlineDrawingAnchor(e, t, n) {
2234
- var x, G;
2234
+ var x, H;
2235
2235
  const i = this._renderManagerService.getRenderById(e.unitId), s = i == null ? void 0 : i.with(te).getSkeleton();
2236
2236
  if (i == null)
2237
2237
  return;
@@ -2264,9 +2264,9 @@ let ct = class extends xe {
2264
2264
  const A = {
2265
2265
  ...C,
2266
2266
  isBack: h
2267
- }, L = y.document.getOffsetConfig(), R = new At(L, s), { cursorList: v, contentBoxPointGroup: N } = R.getRangePointData(A, A), { startOffset: H } = (G = Pt(v)) != null ? G : {};
2268
- if (H != null)
2269
- return { offset: H, contentBoxPointGroup: N, segmentId: p, segmentPage: m };
2267
+ }, L = y.document.getOffsetConfig(), R = new At(L, s), { cursorList: v, contentBoxPointGroup: N } = R.getRangePointData(A, A), { startOffset: G } = (H = Pt(v)) != null ? H : {};
2268
+ if (G != null)
2269
+ return { offset: G, contentBoxPointGroup: N, segmentId: p, segmentPage: m };
2270
2270
  }
2271
2271
  // eslint-disable-next-line max-lines-per-function, complexity
2272
2272
  _getDrawingAnchor(e, t) {
@@ -2278,8 +2278,8 @@ let ct = class extends xe {
2278
2278
  let { width: C, height: y } = t;
2279
2279
  const { positionV: A, positionH: L } = e.docTransform, { width: R, height: v } = this._getPageContentSize(e);
2280
2280
  C = Math.min(C, R), y = Math.min(y, v);
2281
- let N = null, H = "", x = -1;
2282
- const G = !1, I = {
2281
+ let N = null, G = "", x = -1;
2282
+ const H = !1, I = {
2283
2283
  ...e.docTransform,
2284
2284
  size: {
2285
2285
  width: C,
@@ -2299,12 +2299,12 @@ let ct = class extends xe {
2299
2299
  });
2300
2300
  if (B) {
2301
2301
  const { node: pe, segmentPage: ht, segmentId: ft } = B;
2302
- N = pe, x = ht, H = ft;
2302
+ N = pe, x = ht, G = ft;
2303
2303
  }
2304
2304
  if (N == null)
2305
2305
  return;
2306
- const b = (_e = N.parent) == null ? void 0 : _e.parent, P = b == null ? void 0 : b.parent, V = (ce = P == null ? void 0 : P.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? ce : P == null ? void 0 : P.lines[0], F = (Se = P == null ? void 0 : P.parent) == null ? void 0 : Se.parent;
2307
- if (b == null || P == null || V == null || F == null)
2306
+ const b = (_e = N.parent) == null ? void 0 : _e.parent, P = b == null ? void 0 : b.parent, j = (ce = P == null ? void 0 : P.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? ce : P == null ? void 0 : P.lines[0], F = (Se = P == null ? void 0 : P.parent) == null ? void 0 : Se.parent;
2307
+ if (b == null || P == null || j == null || F == null)
2308
2308
  return;
2309
2309
  this._liquid.reset();
2310
2310
  const K = F.type;
@@ -2313,10 +2313,10 @@ let ct = class extends xe {
2313
2313
  if (x > -1 && An === x) {
2314
2314
  switch (K) {
2315
2315
  case Ut.HEADER: {
2316
- const He = (De = c.get(ht)) == null ? void 0 : De.get(bt);
2317
- if (He)
2316
+ const Ge = (De = c.get(ht)) == null ? void 0 : De.get(bt);
2317
+ if (Ge)
2318
2318
  this._liquid.translatePagePadding({
2319
- marginTop: He.marginTop,
2319
+ marginTop: Ge.marginTop,
2320
2320
  marginLeft: Ct
2321
2321
  });
2322
2322
  else
@@ -2324,10 +2324,10 @@ let ct = class extends xe {
2324
2324
  break;
2325
2325
  }
2326
2326
  case Ut.FOOTER: {
2327
- const He = (be = d.get(ft)) == null ? void 0 : be.get(bt);
2328
- if (He)
2327
+ const Ge = (be = d.get(ft)) == null ? void 0 : be.get(bt);
2328
+ if (Ge)
2329
2329
  this._liquid.translatePagePadding({
2330
- marginTop: En - Rn + He.marginTop,
2330
+ marginTop: En - Rn + Ge.marginTop,
2331
2331
  marginLeft: Ct
2332
2332
  });
2333
2333
  else
@@ -2341,7 +2341,7 @@ let ct = class extends xe {
2341
2341
  break;
2342
2342
  this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, f, h, m);
2343
2343
  }
2344
- switch (A.relativeFrom === W.LINE ? N = b.divides[0].glyphGroup[0] : N = (ge = (de = (Oe = (Ce = V.divides) == null ? void 0 : Ce[0]) == null ? void 0 : Oe.glyphGroup) == null ? void 0 : de[0]) != null ? ge : N, I.positionH = {
2344
+ switch (A.relativeFrom === W.LINE ? N = b.divides[0].glyphGroup[0] : N = (ge = (de = (Oe = (Ce = j.divides) == null ? void 0 : Ce[0]) == null ? void 0 : Oe.glyphGroup) == null ? void 0 : de[0]) != null ? ge : N, I.positionH = {
2345
2345
  relativeFrom: L.relativeFrom,
2346
2346
  posOffset: D - this._liquid.x - p
2347
2347
  }, L.relativeFrom) {
@@ -2367,7 +2367,7 @@ let ct = class extends xe {
2367
2367
  break;
2368
2368
  }
2369
2369
  case W.PARAGRAPH: {
2370
- I.positionV.posOffset = S - this._liquid.y - w - V.top;
2370
+ I.positionV.posOffset = S - this._liquid.y - w - j.top;
2371
2371
  break;
2372
2372
  }
2373
2373
  }
@@ -2378,10 +2378,10 @@ let ct = class extends xe {
2378
2378
  return;
2379
2379
  const ye = {
2380
2380
  ...oe,
2381
- isBack: G
2381
+ isBack: H
2382
2382
  }, We = Ue.document.getOffsetConfig(), ae = new At(We, i), { cursorList: ne } = ae.getRangePointData(ye, ye), { startOffset: ie } = (Ee = Pt(ne)) != null ? Ee : {};
2383
2383
  if (ie != null)
2384
- return { offset: ie, docTransform: I, segmentId: H, segmentPage: x };
2384
+ return { offset: ie, docTransform: I, segmentId: G, segmentPage: x };
2385
2385
  }
2386
2386
  // Update drawing when use transformer to resize it.
2387
2387
  _updateDrawingSize(e, t) {
@@ -2481,7 +2481,7 @@ let ct = class extends xe {
2481
2481
  return { scene: n, transformer: i };
2482
2482
  }
2483
2483
  _getTransformCoordForDocumentOffset(e, t, n, i) {
2484
- const { documentTransform: s } = e.getOffsetConfig(), o = t.transformVector2SceneCoord(ii.FromArray([n, i]));
2484
+ const { documentTransform: s } = e.getOffsetConfig(), o = t.transformVector2SceneCoord(ri.FromArray([n, i]));
2485
2485
  if (o)
2486
2486
  return s.clone().invert().applyPoint(o);
2487
2487
  }
@@ -2492,23 +2492,23 @@ let ct = class extends xe {
2492
2492
  const { mainComponent: i, scene: s } = n, o = i, {
2493
2493
  docsLeft: c,
2494
2494
  docsTop: d
2495
- } = o.getOffsetConfig(), a = Zn(t), { left: g, top: u, height: l } = a, f = g + c, h = u + d;
2495
+ } = o.getOffsetConfig(), a = Qn(t), { left: g, top: u, height: l } = a, f = g + c, h = u + d;
2496
2496
  if (this._anchorShape) {
2497
2497
  this._anchorShape.transformByState({ left: f, top: h, height: l }), this._anchorShape.show();
2498
2498
  return;
2499
2499
  }
2500
- const m = 6, p = new ri(ur + Qt(m), {
2500
+ const m = 6, p = new si(hr + Qt(m), {
2501
2501
  left: f,
2502
2502
  top: h,
2503
2503
  height: l,
2504
2504
  strokeWidth: 2,
2505
- stroke: si(Hn.darkgray, 1),
2505
+ stroke: oi(Hn.darkgray, 1),
2506
2506
  evented: !1
2507
2507
  });
2508
- this._anchorShape = p, s.addObject(p, Qn);
2508
+ this._anchorShape = p, s.addObject(p, Jn);
2509
2509
  }
2510
2510
  _getDocObject() {
2511
- return Jn(this._univerInstanceService, this._renderManagerService);
2511
+ return ei(this._univerInstanceService, this._renderManagerService);
2512
2512
  }
2513
2513
  _getPageContentSize(e) {
2514
2514
  const t = this._renderManagerService.getRenderById(e.unitId), n = t == null ? void 0 : t.with(te).getSkeleton(), i = 500, s = 500, o = n == null ? void 0 : n.getSkeletonData();
@@ -2539,18 +2539,18 @@ let ct = class extends xe {
2539
2539
  };
2540
2540
  }
2541
2541
  };
2542
- ct = lr([
2543
- tt(0, j),
2542
+ ct = ur([
2543
+ tt(0, V),
2544
2544
  tt(1, z),
2545
2545
  tt(2, fe),
2546
2546
  tt(3, Q)
2547
2547
  ], ct);
2548
- var hr = Object.getOwnPropertyDescriptor, fr = (r, e, t, n) => {
2549
- for (var i = n > 1 ? void 0 : n ? hr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2548
+ var fr = Object.getOwnPropertyDescriptor, pr = (r, e, t, n) => {
2549
+ for (var i = n > 1 ? void 0 : n ? fr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2550
2550
  (o = r[s]) && (i = o(i) || i);
2551
2551
  return i;
2552
- }, Ve = (r, e) => (t, n) => e(t, n, r);
2553
- let dt = class extends Gn {
2552
+ }, je = (r, e) => (t, n) => e(t, n, r);
2553
+ let dt = class extends Vn {
2554
2554
  constructor(e, t, n, i, s) {
2555
2555
  super();
2556
2556
  me(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
@@ -2559,9 +2559,9 @@ let dt = class extends Gn {
2559
2559
  }
2560
2560
  _init() {
2561
2561
  this.disposeWithMe(
2562
- this._univerInstanceService.getCurrentTypeOfUnit$(ve.UNIVER_DOC).pipe(jt(this.dispose$)).subscribe((e) => this._create(e))
2562
+ this._univerInstanceService.getCurrentTypeOfUnit$(ve.UNIVER_DOC).pipe(Vt(this.dispose$)).subscribe((e) => this._create(e))
2563
2563
  ), this.disposeWithMe(
2564
- this._univerInstanceService.getTypeOfUnitDisposed$(ve.UNIVER_DOC).pipe(jt(this.dispose$)).subscribe((e) => this._dispose(e))
2564
+ this._univerInstanceService.getTypeOfUnitDisposed$(ve.UNIVER_DOC).pipe(Vt(this.dispose$)).subscribe((e) => this._dispose(e))
2565
2565
  ), this._univerInstanceService.getAllUnitsForType(ve.UNIVER_DOC).forEach((e) => this._create(e));
2566
2566
  }
2567
2567
  _dispose(e) {
@@ -2577,7 +2577,7 @@ let dt = class extends Gn {
2577
2577
  _hasCropObject(e) {
2578
2578
  const t = e.getAllObjects();
2579
2579
  for (const n of t)
2580
- if (n instanceof Ri)
2580
+ if (n instanceof Ai)
2581
2581
  return !0;
2582
2582
  return !1;
2583
2583
  }
@@ -2608,7 +2608,7 @@ let dt = class extends Gn {
2608
2608
  const { unitId: g, subUnitId: u, drawingId: l, drawingType: f } = a, h = this._canvasPopManagerService.attachPopupToObject(
2609
2609
  c,
2610
2610
  {
2611
- componentKey: Ai,
2611
+ componentKey: Pi,
2612
2612
  direction: "horizontal",
2613
2613
  offset: [2, 0],
2614
2614
  extraProps: {
@@ -2662,7 +2662,7 @@ let dt = class extends Gn {
2662
2662
  {
2663
2663
  label: "image-popup.crop",
2664
2664
  index: 2,
2665
- commandId: Pi.id,
2665
+ commandId: xi.id,
2666
2666
  commandParams: { unitId: e, subUnitId: t, drawingId: n },
2667
2667
  disable: !0
2668
2668
  // TODO: @JOCS, feature is not ready.
@@ -2670,7 +2670,7 @@ let dt = class extends Gn {
2670
2670
  {
2671
2671
  label: "image-popup.reset",
2672
2672
  index: 3,
2673
- commandId: xi.id,
2673
+ commandId: Ni.id,
2674
2674
  commandParams: [{ unitId: e, subUnitId: t, drawingId: n }],
2675
2675
  disable: !0
2676
2676
  // TODO: @JOCS, feature is not ready.
@@ -2678,15 +2678,15 @@ let dt = class extends Gn {
2678
2678
  ];
2679
2679
  }
2680
2680
  };
2681
- dt = fr([
2682
- Ve(0, fe),
2683
- Ve(1, Z(ei)),
2684
- Ve(2, Q),
2685
- Ve(3, z),
2686
- Ve(4, Yt)
2681
+ dt = pr([
2682
+ je(0, fe),
2683
+ je(1, Z(ti)),
2684
+ je(2, Q),
2685
+ je(3, z),
2686
+ je(4, Yt)
2687
2687
  ], dt);
2688
- var pr = Object.getOwnPropertyDescriptor, mr = (r, e, t, n) => {
2689
- for (var i = n > 1 ? void 0 : n ? pr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2688
+ var mr = Object.getOwnPropertyDescriptor, wr = (r, e, t, n) => {
2689
+ for (var i = n > 1 ? void 0 : n ? mr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2690
2690
  (o = r[s]) && (i = o(i) || i);
2691
2691
  return i;
2692
2692
  }, Re = (r, e) => (t, n) => e(t, n, r);
@@ -2733,7 +2733,7 @@ let It = class extends xe {
2733
2733
  _initResize() {
2734
2734
  this.disposeWithMe(
2735
2735
  Zt(this._context.engine.onTransformChange$).pipe(
2736
- Vt((e) => e.type === oi.resize),
2736
+ jt((e) => e.type === ai.resize),
2737
2737
  dn(16)
2738
2738
  ).subscribe(() => {
2739
2739
  var n;
@@ -2825,33 +2825,33 @@ let It = class extends xe {
2825
2825
  const t = this._docSkeletonManagerService.getSkeleton();
2826
2826
  t != null && (this._refreshDrawing(t), this._drawingManagerService.initializeNotification(this._context.unitId));
2827
2827
  };
2828
- this._lifecycleService.stage >= Rt.Rendered ? this._docSkeletonManagerService.getSkeleton() ? e() : setTimeout(e, 500) : this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Vt((t) => t === Rt.Rendered)).subscribe(e));
2828
+ this._lifecycleService.stage >= Rt.Rendered ? this._docSkeletonManagerService.getSkeleton() ? e() : setTimeout(e, 500) : this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(jt((t) => t === Rt.Rendered)).subscribe(e));
2829
2829
  }
2830
2830
  };
2831
- It = mr([
2831
+ It = wr([
2832
2832
  Re(1, Z(te)),
2833
- Re(2, j),
2834
- Re(3, ti),
2833
+ Re(2, V),
2834
+ Re(3, ni),
2835
2835
  Re(4, fe),
2836
2836
  Re(5, Z(ut)),
2837
2837
  Re(6, z),
2838
2838
  Re(7, Z(jn))
2839
2839
  ], It);
2840
- var wr = Object.defineProperty, vr = Object.getOwnPropertyDescriptor, Ir = (r, e, t) => e in r ? wr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, _r = (r, e, t, n) => {
2841
- for (var i = n > 1 ? void 0 : n ? vr(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2840
+ var vr = Object.defineProperty, Ir = Object.getOwnPropertyDescriptor, _r = (r, e, t) => e in r ? vr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Sr = (r, e, t, n) => {
2841
+ for (var i = n > 1 ? void 0 : n ? Ir(e, t) : e, s = r.length - 1, o; s >= 0; s--)
2842
2842
  (o = r[s]) && (i = o(i) || i);
2843
2843
  return i;
2844
- }, vt = (r, e) => (t, n) => e(t, n, r), Cn = (r, e, t) => Ir(r, typeof e != "symbol" ? e + "" : e, t);
2845
- const Sr = "DOC_DRAWING_UI_PLUGIN";
2846
- let gt = class extends zn {
2844
+ }, vt = (r, e) => (t, n) => e(t, n, r), Cn = (r, e, t) => _r(r, typeof e != "symbol" ? e + "" : e, t);
2845
+ const Dr = "DOC_DRAWING_UI_PLUGIN";
2846
+ let gt = class extends Xn {
2847
2847
  constructor(r = $t, e, t, n) {
2848
2848
  super(), this._config = r, this._injector = e, this._renderManagerSrv = t, this._configService = n;
2849
- const { ...i } = Xn(
2849
+ const { ...i } = qn(
2850
2850
  {},
2851
2851
  $t,
2852
2852
  this._config
2853
2853
  );
2854
- this._configService.setConfig(Gi, i);
2854
+ this._configService.setConfig(Vi, i);
2855
2855
  }
2856
2856
  onStarting() {
2857
2857
  [
@@ -2875,15 +2875,15 @@ let gt = class extends zn {
2875
2875
  }
2876
2876
  };
2877
2877
  Cn(gt, "type", ve.UNIVER_DOC);
2878
- Cn(gt, "pluginName", Sr);
2879
- gt = _r([
2880
- Vn(Ni, pi, qn, Mi),
2878
+ Cn(gt, "pluginName", Dr);
2879
+ gt = Sr([
2880
+ $n(Ui, mi, Kn, yi),
2881
2881
  vt(1, Z(Jt)),
2882
2882
  vt(2, Q),
2883
- vt(3, $n)
2883
+ vt(3, zn)
2884
2884
  ], gt);
2885
2885
  export {
2886
- ki as ClearDocDrawingTransformerOperation,
2886
+ Wi as ClearDocDrawingTransformerOperation,
2887
2887
  yn as DOCS_IMAGE_MENU_ID,
2888
2888
  ln as DeleteDocDrawingsCommand,
2889
2889
  rt as DocFloatDomController,