@univerjs/docs-drawing-ui 0.6.9-experimental.20250407-5251826 → 0.6.9-experimental.20250408-786b00e

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 At = Object.defineProperty;
2
2
  var xt = (i, e, n) => e in i ? At(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
3
  var Se = (i, e, n) => xt(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { Disposable as Ge, UndoCommand as Lt, RedoCommand as Ut, JSONX as X, IUniverInstanceService as q, ICommandService as $, PositionedObjectLayoutType as W, CommandType as Y, BooleanNumber as se, ObjectRelativeFromH as ee, ObjectRelativeFromV as H, Tools as be, TextX as Dn, TextXActionType as Q, toDisposable as Oe, throttle as Rn, COLORS as Bt, MemoryCursor as Ft, IUndoRedoService as Yn, BuildTextUtils as kt, ArrangeTypeEnum as Qe, Inject as pe, IContextService as Zn, LocaleService as un, WrapTextType as Xe, DrawingTypeEnum as rn, FOCUSING_COMMON_DRAWINGS as on, UniverInstanceType as Ie, Direction as he, DocumentFlavor as wn, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Cn, FOCUSING_UNIVER_EDITOR as Wt, DisposableCollection as Ht, fromEventSubject as Qn, generateRandomId as Gt, RxDisposable as Vt, SHEET_EDITOR_UNITS as jt, LifecycleService as $t, LifecycleStages as En, DependentOn as zt, Injector as Xt, IConfigService as qt, Plugin as Kt, merge as Yt } from "@univerjs/core";
5
- import { IDocDrawingService as Ue, UniverDocsDrawingPlugin as Zt } from "@univerjs/docs-drawing";
6
- import { IDrawingManagerService as _e, IImageIoService as Qt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Jt, DRAWING_IMAGE_COUNT_LIMIT as Nn, ImageUploadStatusType as vn, DRAWING_IMAGE_ALLOW_SIZE as ei, getImageSize as ni, getDrawingShapeKeyByDrawingSearch as ti, DRAWING_IMAGE_WIDTH_LIMIT as An, DRAWING_IMAGE_HEIGHT_LIMIT as xn, UniverDrawingPlugin as ii } from "@univerjs/drawing";
7
- import { DrawingCommonPanel as ri, DrawingRenderService as oi, ImageCropperObject as si, COMPONENT_IMAGE_POPUP_MENU as ai, OpenImageCropOperation as ci, ImageResetSizeOperation as di, UniverDrawingUIPlugin as li } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as J, DocumentEditArea as We, Liquid as Jn, PageLayoutType as Ln, DocumentSkeletonPageType as Un, Vector2 as gi, Rect as mi, getColor as ui, getCurrentTypeOfRenderer as hi, CURSOR_TYPE as Bn, TRANSFORM_CHANGE_OBSERVABLE_TYPE as fi } from "@univerjs/engine-render";
9
- import { IMessageService as pi, ILocalFileService as wi, ISidebarService as vi, useDependency as ve, getMenuHiddenObservable as et, MenuItemType as nt, RibbonStartGroup as Ii, KeyCode as He, ComponentManager as _i, IMenuManagerService as Si, IShortcutService as Di, CanvasFloatDomService as Ci, UniverUIPlugin as Oi } from "@univerjs/ui";
4
+ import { Disposable as Ge, UndoCommand as Lt, RedoCommand as Ut, JSONX as X, IUniverInstanceService as q, ICommandService as $, PositionedObjectLayoutType as W, CommandType as Y, BooleanNumber as se, ObjectRelativeFromH as ee, ObjectRelativeFromV as H, Tools as be, TextX as Sn, TextXActionType as Q, toDisposable as Oe, throttle as Rn, COLORS as Bt, MemoryCursor as Ft, IUndoRedoService as Yn, BuildTextUtils as kt, ArrangeTypeEnum as Qe, Inject as pe, IContextService as Zn, LocaleService as mn, WrapTextType as Xe, DrawingTypeEnum as Dn, FOCUSING_COMMON_DRAWINGS as rn, UniverInstanceType as Ie, Direction as he, DocumentFlavor as pn, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Cn, FOCUSING_UNIVER_EDITOR as Wt, DisposableCollection as Ht, fromEventSubject as Qn, generateRandomId as Gt, RxDisposable as Vt, LifecycleService as jt, LifecycleStages as En, DependentOn as $t, Injector as zt, IConfigService as Xt, Plugin as qt, merge as Kt } from "@univerjs/core";
5
+ import { IDocDrawingService as Ue, UniverDocsDrawingPlugin as Yt } from "@univerjs/docs-drawing";
6
+ import { IDrawingManagerService as _e, IImageIoService as Zt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Qt, DRAWING_IMAGE_COUNT_LIMIT as Nn, ImageUploadStatusType as wn, DRAWING_IMAGE_ALLOW_SIZE as Jt, getImageSize as ei, getDrawingShapeKeyByDrawingSearch as ni, DRAWING_IMAGE_WIDTH_LIMIT as An, DRAWING_IMAGE_HEIGHT_LIMIT as xn, UniverDrawingPlugin as ti } from "@univerjs/drawing";
7
+ import { DrawingCommonPanel as ii, DrawingRenderService as ri, ImageCropperObject as oi, COMPONENT_IMAGE_POPUP_MENU as si, OpenImageCropOperation as ai, ImageResetSizeOperation as ci, UniverDrawingUIPlugin as di } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as J, DocumentEditArea as We, Liquid as Jn, PageLayoutType as Ln, DocumentSkeletonPageType as Un, Vector2 as li, Rect as gi, getColor as mi, getCurrentTypeOfRenderer as ui, CURSOR_TYPE as Bn, TRANSFORM_CHANGE_OBSERVABLE_TYPE as hi } from "@univerjs/engine-render";
9
+ import { IMessageService as fi, ILocalFileService as pi, ISidebarService as wi, useDependency as ve, getMenuHiddenObservable as et, MenuItemType as nt, RibbonStartGroup as vi, KeyCode as He, ComponentManager as Ii, IMenuManagerService as _i, IShortcutService as Si, CanvasFloatDomService as Di, UniverUIPlugin as Ci } from "@univerjs/ui";
10
10
  import { RichTextEditingMutation as ne, DocSkeletonManagerService as te, DocSelectionManagerService as On } from "@univerjs/docs";
11
- import { DocSelectionRenderService as Re, getRichTextEditPath as qe, NodePositionConvertToCursor as Fn, getOneTextSelectionRange as kn, getAnchorBounding as Ti, TEXT_RANGE_LAYER_INDEX as yi, getDocObject as Pi, getCustomBlockIdsInSelections as Mi, docDrawingPositionToTransform as tt, VIEWPORT_KEY as it, SetDocZoomRatioOperation as rt, DocCanvasPopManagerService as bi, IEditorService as Ri } from "@univerjs/docs-ui";
12
- import { BehaviorSubject as ot, debounceTime as st, Observable as Ei, map as Wn, switchMap as Ni, of as Ai, takeUntil as Hn, filter as Gn } from "rxjs";
13
- import { MessageType as Vn, clsx as j, InputNumber as ke, Select as jn, Checkbox as xi, RadioGroup as $n, Radio as Me } from "@univerjs/design";
11
+ import { DocSelectionRenderService as Re, getRichTextEditPath as qe, NodePositionConvertToCursor as Fn, getOneTextSelectionRange as kn, getAnchorBounding as Oi, TEXT_RANGE_LAYER_INDEX as Ti, getDocObject as yi, getCustomBlockIdsInSelections as Pi, docDrawingPositionToTransform as tt, VIEWPORT_KEY as it, SetDocZoomRatioOperation as rt, DocCanvasPopManagerService as Mi, IEditorService as bi } from "@univerjs/docs-ui";
12
+ import { BehaviorSubject as ot, debounceTime as st, Observable as Ri, map as Wn, switchMap as Ei, of as Ni, takeUntil as Hn, filter as Gn } from "rxjs";
13
+ import { MessageType as Vn, clsx as j, InputNumber as ke, Select as jn, Checkbox as Ai, RadioGroup as $n, Radio as Me } from "@univerjs/design";
14
14
  import { jsxs as K, jsx as p } from "react/jsx-runtime";
15
- import { forwardRef as at, useRef as Li, createElement as ct, useState as oe, useEffect as Tn } from "react";
16
- const Ui = "docs-drawing-ui.config", zn = {};
17
- var Bi = Object.getOwnPropertyDescriptor, Fi = (i, e, n, t) => {
18
- for (var r = t > 1 ? void 0 : t ? Bi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
15
+ import { forwardRef as at, useRef as xi, createElement as ct, useState as oe, useEffect as Tn } from "react";
16
+ const Li = "docs-drawing-ui.config", zn = {};
17
+ var Ui = Object.getOwnPropertyDescriptor, Bi = (i, e, n, t) => {
18
+ for (var r = t > 1 ? void 0 : t ? Ui(e, n) : e, o = i.length - 1, s; o >= 0; o--)
19
19
  (s = i[o]) && (r = s(r) || r);
20
20
  return r;
21
21
  }, $e = (i, e) => (n, t) => e(n, t, i);
22
- function ki(i) {
22
+ function Fi(i) {
23
23
  var t, r, o, s;
24
24
  if (X.isNoop(i) || !Array.isArray(i))
25
25
  return null;
@@ -42,7 +42,7 @@ function ki(i) {
42
42
  });
43
43
  return n;
44
44
  }
45
- function Wi(i) {
45
+ function ki(i) {
46
46
  if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
47
47
  return [];
48
48
  const e = [];
@@ -57,7 +57,7 @@ function Wi(i) {
57
57
  }
58
58
  return e;
59
59
  }
60
- let sn = class extends Ge {
60
+ let on = class extends Ge {
61
61
  constructor(i, e, n, t, r) {
62
62
  super(), this._univerInstanceService = i, this._commandService = e, this._drawingManagerService = n, this._docDrawingService = t, this._renderManagerService = r, this._initialize();
63
63
  }
@@ -69,7 +69,7 @@ let sn = class extends Ge {
69
69
  this._commandService.beforeCommandExecuted((i) => {
70
70
  if (i.id !== ne.id)
71
71
  return;
72
- const e = i.params, { unitId: n, actions: t } = e, r = ki(t);
72
+ const e = i.params, { unitId: n, actions: t } = e, r = Fi(t);
73
73
  if (r != null)
74
74
  for (const { type: o, drawingId: s, drawing: a } of r)
75
75
  o === "add" ? this._addDrawings(n, [a]) : this._removeDrawings(n, [s]);
@@ -79,7 +79,7 @@ let sn = class extends Ge {
79
79
  if (i.id !== ne.id)
80
80
  return;
81
81
  const e = i.params, { unitId: n, actions: t } = e;
82
- Wi(t).length > 0 && this._updateDrawingsOrder(n);
82
+ ki(t).length > 0 && this._updateDrawingsOrder(n);
83
83
  })
84
84
  ), this.disposeWithMe(
85
85
  this._commandService.onCommandExecuted((i) => {
@@ -125,14 +125,14 @@ let sn = class extends Ge {
125
125
  t.orderNotification(o), r.orderNotification(o);
126
126
  }
127
127
  };
128
- sn = Fi([
128
+ on = Bi([
129
129
  $e(0, q),
130
130
  $e(1, $),
131
131
  $e(2, _e),
132
132
  $e(3, Ue),
133
133
  $e(4, J)
134
- ], sn);
135
- class hn {
134
+ ], on);
135
+ class un {
136
136
  constructor() {
137
137
  Se(this, "_refreshDrawings$", new ot(null));
138
138
  Se(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
@@ -142,7 +142,7 @@ class hn {
142
142
  }
143
143
  }
144
144
  var ue = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(ue || {});
145
- const Hi = {
145
+ const Wi = {
146
146
  inline: W.INLINE,
147
147
  wrapSquare: W.WRAP_SQUARE,
148
148
  wrapTopAndBottom: W.WRAP_TOP_AND_BOTTOM,
@@ -151,7 +151,7 @@ const Hi = {
151
151
  };
152
152
  function dt(i, e, n, t, r, o, s) {
153
153
  var f, u;
154
- const a = new Dn(), d = X.getInstance(), c = [], g = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
154
+ const a = new Sn(), d = X.getInstance(), c = [], g = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
155
155
  if (g == null || m == null)
156
156
  return;
157
157
  const l = (u = (f = g.customBlocks) == null ? void 0 : f.find((v) => v.blockId === r)) == null ? void 0 : u.startIndex;
@@ -239,7 +239,7 @@ const lt = {
239
239
  return !1;
240
240
  const f = g.getEditArea(), u = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: I } = c, O = X.getInstance(), C = [], { drawings: T = {} } = l.getSnapshot();
241
241
  for (const E of n) {
242
- const { drawingId: _ } = E, L = T[_].layoutType, G = Hi[t];
242
+ const { drawingId: _ } = E, L = T[_].layoutType, G = Wi[t];
243
243
  if (L !== G) {
244
244
  const D = O.replaceOp(["drawings", _, "layoutType"], L, G);
245
245
  C.push(D);
@@ -409,7 +409,7 @@ const lt = {
409
409
  var B, E;
410
410
  if (e == null)
411
411
  return !1;
412
- const n = i.get(J), t = (B = n.getRenderById(e.unitId)) == null ? void 0 : B.with(Re), r = i.get(hn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, a = o == null ? void 0 : o.with(te).getSkeleton();
412
+ const n = i.get(J), t = (B = n.getRenderById(e.unitId)) == null ? void 0 : B.with(Re), r = i.get(un), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, a = o == null ? void 0 : o.with(te).getSkeleton();
413
413
  if (s == null || t == null)
414
414
  return !1;
415
415
  const d = s.getTransformerByCreate(), c = i.get($), m = i.get(q).getCurrentUniverDocInstance();
@@ -499,17 +499,17 @@ const lt = {
499
499
  return s.refreshControls(), !!G;
500
500
  }
501
501
  };
502
- var Gi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
503
- for (var r = t > 1 ? void 0 : t ? Gi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
502
+ var Hi = Object.getOwnPropertyDescriptor, Gi = (i, e, n, t) => {
503
+ for (var r = t > 1 ? void 0 : t ? Hi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
504
504
  (s = i[o]) && (r = s(r) || r);
505
505
  return r;
506
506
  }, Je = (i, e) => (n, t) => e(n, t, i);
507
- const ji = "__InlineDrawingAnchor__";
507
+ const Vi = "__InlineDrawingAnchor__";
508
508
  function Xn(i) {
509
509
  const { path: e } = i;
510
510
  return e.some((n) => n === "cells");
511
511
  }
512
- let an = class extends Ge {
512
+ let sn = class extends Ge {
513
513
  constructor(e, n, t, r) {
514
514
  super();
515
515
  Se(this, "_liquid", new Jn());
@@ -747,8 +747,8 @@ let an = class extends Ge {
747
747
  segmentPage: U.getSegmentPage()
748
748
  });
749
749
  if (F) {
750
- const { node: we, segmentPage: fn, segmentId: pn } = F;
751
- L = we, x = fn, G = pn;
750
+ const { node: we, segmentPage: hn, segmentId: fn } = F;
751
+ L = we, x = hn, G = fn;
752
752
  }
753
753
  if (L == null)
754
754
  return;
@@ -758,11 +758,11 @@ let an = class extends Ge {
758
758
  this._liquid.reset();
759
759
  const Z = k.type;
760
760
  for (const we of s) {
761
- const { headerId: fn, footerId: pn, pageHeight: Rt, pageWidth: Mn, marginLeft: bn, marginBottom: Et } = we, Nt = s.indexOf(we);
761
+ const { headerId: hn, footerId: fn, pageHeight: Rt, pageWidth: Mn, marginLeft: bn, marginBottom: Et } = we, Nt = s.indexOf(we);
762
762
  if (x > -1 && Nt === x) {
763
763
  switch (Z) {
764
764
  case Un.HEADER: {
765
- const je = (ye = a.get(fn)) == null ? void 0 : ye.get(Mn);
765
+ const je = (ye = a.get(hn)) == null ? void 0 : ye.get(Mn);
766
766
  if (je)
767
767
  this._liquid.translatePagePadding({
768
768
  marginTop: je.marginTop,
@@ -773,7 +773,7 @@ let an = class extends Ge {
773
773
  break;
774
774
  }
775
775
  case Un.FOOTER: {
776
- const je = (Ne = d.get(pn)) == null ? void 0 : Ne.get(Mn);
776
+ const je = (Ne = d.get(fn)) == null ? void 0 : Ne.get(Mn);
777
777
  if (je)
778
778
  this._liquid.translatePagePadding({
779
779
  marginTop: Rt - Et + je.marginTop,
@@ -930,7 +930,7 @@ let an = class extends Ge {
930
930
  return { scene: t, transformer: r };
931
931
  }
932
932
  _getTransformCoordForDocumentOffset(e, n, t, r) {
933
- const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(gi.FromArray([t, r]));
933
+ const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(li.FromArray([t, r]));
934
934
  if (s)
935
935
  return o.clone().invert().applyPoint(s);
936
936
  }
@@ -941,23 +941,23 @@ let an = class extends Ge {
941
941
  const { mainComponent: r, scene: o } = t, s = r, {
942
942
  docsLeft: a,
943
943
  docsTop: d
944
- } = s.getOffsetConfig(), c = Ti(n), { left: g, top: m, height: l } = c, f = g + a, u = m + d;
944
+ } = s.getOffsetConfig(), c = Oi(n), { left: g, top: m, height: l } = c, f = g + a, u = m + d;
945
945
  if (this._anchorShape) {
946
946
  this._anchorShape.transformByState({ left: f, top: u, height: l }), this._anchorShape.show();
947
947
  return;
948
948
  }
949
- const v = 6, w = new mi(ji + be.generateRandomId(v), {
949
+ const v = 6, w = new gi(Vi + be.generateRandomId(v), {
950
950
  left: f,
951
951
  top: u,
952
952
  height: l,
953
953
  strokeWidth: 2,
954
- stroke: ui(Bt.darkGray, 1),
954
+ stroke: mi(Bt.darkGray, 1),
955
955
  evented: !1
956
956
  });
957
- this._anchorShape = w, o.addObject(w, yi);
957
+ this._anchorShape = w, o.addObject(w, Ti);
958
958
  }
959
959
  _getDocObject() {
960
- return Pi(this._univerInstanceService, this._renderManagerService);
960
+ return yi(this._univerInstanceService, this._renderManagerService);
961
961
  }
962
962
  _getPageContentSize(e) {
963
963
  const n = this._renderManagerService.getRenderById(e.unitId), t = n == null ? void 0 : n.with(te).getSkeleton(), r = 500, o = 500, s = t == null ? void 0 : t.getSkeletonData();
@@ -988,12 +988,12 @@ let an = class extends Ge {
988
988
  };
989
989
  }
990
990
  };
991
- an = Vi([
991
+ sn = Gi([
992
992
  Je(0, $),
993
993
  Je(1, q),
994
994
  Je(2, _e),
995
995
  Je(3, J)
996
- ], an);
996
+ ], sn);
997
997
  var fe = function() {
998
998
  return fe = Object.assign || function(i) {
999
999
  for (var e, n = 1, t = arguments.length; n < t; n++) {
@@ -1002,7 +1002,7 @@ var fe = function() {
1002
1002
  }
1003
1003
  return i;
1004
1004
  }, fe.apply(this, arguments);
1005
- }, $i = function(i, e) {
1005
+ }, ji = function(i, e) {
1006
1006
  var n = {};
1007
1007
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
1008
1008
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
@@ -1010,15 +1010,15 @@ var fe = function() {
1010
1010
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
1011
1011
  return n;
1012
1012
  }, ft = at(function(i, e) {
1013
- var n = i.icon, t = i.id, r = i.className, o = i.extend, s = $i(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Li("_".concat(qi()));
1013
+ var n = i.icon, t = i.id, r = i.className, o = i.extend, s = ji(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = xi("_".concat(Xi()));
1014
1014
  return pt(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, fe({ ref: e, className: a }, s), o);
1015
1015
  });
1016
1016
  function pt(i, e, n, t, r) {
1017
- return ct(i.tag, fe(fe({ key: e }, zi(i, n, r)), t), (Xi(i, n).children || []).map(function(o, s) {
1017
+ return ct(i.tag, fe(fe({ key: e }, $i(i, n, r)), t), (zi(i, n).children || []).map(function(o, s) {
1018
1018
  return pt(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
1019
1019
  }));
1020
1020
  }
1021
- function zi(i, e, n) {
1021
+ function $i(i, e, n) {
1022
1022
  var t = fe({}, i.attrs);
1023
1023
  n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1), i.tag === "mask" && t.id && (t.id = t.id + e.idSuffix), Object.entries(t).forEach(function(o) {
1024
1024
  var s = o[0], a = o[1];
@@ -1030,21 +1030,21 @@ function zi(i, e, n) {
1030
1030
  typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
1031
1031
  })), t;
1032
1032
  }
1033
- function Xi(i, e) {
1033
+ function zi(i, e) {
1034
1034
  var n, t = e.defIds;
1035
1035
  return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? fe(fe({}, i), { children: i.children.map(function(r) {
1036
1036
  return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? fe(fe({}, r), { attrs: fe(fe({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
1037
1037
  }) }) : i;
1038
1038
  }
1039
- function qi() {
1039
+ function Xi() {
1040
1040
  return Math.random().toString(36).substring(2, 8);
1041
1041
  }
1042
1042
  ft.displayName = "UniverIcon";
1043
- var Ki = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, wt = at(function(i, e) {
1043
+ var qi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, wt = at(function(i, e) {
1044
1044
  return ct(ft, Object.assign({}, i, {
1045
1045
  id: "add-image-single",
1046
1046
  ref: e,
1047
- icon: Ki
1047
+ icon: qi
1048
1048
  }));
1049
1049
  });
1050
1050
  wt.displayName = "AddImageSingle";
@@ -1057,7 +1057,7 @@ const yn = {
1057
1057
  const n = i.get($), t = i.get(q), r = i.get(J), o = t.getCurrentUniverDocInstance();
1058
1058
  if (e == null || o == null)
1059
1059
  return !1;
1060
- const s = r.getRenderById(e.unitId).with(Re), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new Dn(), g = X.getInstance(), m = (N = (P = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : P.customBlocks) != null ? N : [], l = a.map((E) => m.find((_) => _.blockId === E.drawingId)).filter((E) => !!E).sort((E, _) => E.startIndex > _.startIndex ? 1 : -1), f = a[0].unitId, u = new Ft();
1060
+ const s = r.getRenderById(e.unitId).with(Re), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new Sn(), g = X.getInstance(), m = (N = (P = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : P.customBlocks) != null ? N : [], l = a.map((E) => m.find((_) => _.blockId === E.drawingId)).filter((E) => !!E).sort((E, _) => E.startIndex > _.startIndex ? 1 : -1), f = a[0].unitId, u = new Ft();
1061
1061
  u.reset();
1062
1062
  const v = l[0].startIndex, w = [
1063
1063
  {
@@ -1141,7 +1141,7 @@ const yn = {
1141
1141
  const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset: g, segmentId: m } = o, l = s.getSelfOrHeaderFooterModel(m).getBody();
1142
1142
  if (l == null)
1143
1143
  return !1;
1144
- const f = new Dn(), u = X.getInstance(), v = [], w = (N = (P = s.getSnapshot().drawingsOrder) == null ? void 0 : P.length) != null ? N : 0;
1144
+ const f = new Sn(), u = X.getInstance(), v = [], w = (N = (P = s.getSnapshot().drawingsOrder) == null ? void 0 : P.length) != null ? N : 0;
1145
1145
  let I = 0;
1146
1146
  if (c)
1147
1147
  g > 0 && f.push({
@@ -1151,7 +1151,7 @@ const yn = {
1151
1151
  else {
1152
1152
  const _ = kt.selection.delete([o], l, 0, null, !1);
1153
1153
  f.push(..._);
1154
- const L = Mi(l, [o]), G = (B = s.getDrawings()) != null ? B : {}, x = (E = s.getDrawingsOrder()) != null ? E : [], V = L.sort((S, D) => x.indexOf(S) > x.indexOf(D) ? -1 : x.indexOf(S) < x.indexOf(D) ? 1 : 0);
1154
+ const L = Pi(l, [o]), G = (B = s.getDrawings()) != null ? B : {}, x = (E = s.getDrawingsOrder()) != null ? E : [], V = L.sort((S, D) => x.indexOf(S) > x.indexOf(D) ? -1 : x.indexOf(S) < x.indexOf(D) ? 1 : 0);
1155
1155
  if (V.length > 0)
1156
1156
  for (const S of V) {
1157
1157
  const D = G[S], R = x.indexOf(S);
@@ -1232,19 +1232,19 @@ const yn = {
1232
1232
  return !1;
1233
1233
  }
1234
1234
  };
1235
- var Yi = Object.getOwnPropertyDescriptor, Zi = (i, e, n, t) => {
1236
- for (var r = t > 1 ? void 0 : t ? Yi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
1235
+ var Ki = Object.getOwnPropertyDescriptor, Yi = (i, e, n, t) => {
1236
+ for (var r = t > 1 ? void 0 : t ? Ki(e, n) : e, o = i.length - 1, s; o >= 0; o--)
1237
1237
  (s = i[o]) && (r = s(r) || r);
1238
1238
  return r;
1239
1239
  }, me = (i, e) => (n, t) => e(n, t, i);
1240
- let cn = class extends Ge {
1240
+ let an = class extends Ge {
1241
1241
  constructor(i, e, n, t, r, o, s, a, d, c, g, m, l) {
1242
1242
  super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = a, this._messageService = d, this._localeService = c, this._docSelectionRenderService = g, this._docRefreshDrawingsService = m, this._fileOpenerService = l, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
1243
1243
  }
1244
1244
  async insertDocImage() {
1245
1245
  const i = await this._fileOpenerService.openFile({
1246
1246
  multiple: !0,
1247
- accept: Jt.map((n) => `.${n.replace("image/", "")}`).join(",")
1247
+ accept: Qt.map((n) => `.${n.replace("image/", "")}`).join(",")
1248
1248
  }), e = i.length;
1249
1249
  return e > Nn ? (this._messageService.show({
1250
1250
  type: Vn.Error,
@@ -1260,13 +1260,13 @@ let cn = class extends Ge {
1260
1260
  const o = r.message;
1261
1261
  let s = "";
1262
1262
  switch (o) {
1263
- case vn.ERROR_EXCEED_SIZE:
1264
- s = this._localeService.t("update-status.exceedMaxSize", String(ei / (1024 * 1024)));
1263
+ case wn.ERROR_EXCEED_SIZE:
1264
+ s = this._localeService.t("update-status.exceedMaxSize", String(Jt / (1024 * 1024)));
1265
1265
  break;
1266
- case vn.ERROR_IMAGE_TYPE:
1266
+ case wn.ERROR_IMAGE_TYPE:
1267
1267
  s = this._localeService.t("update-status.invalidImageType");
1268
1268
  break;
1269
- case vn.ERROR_IMAGE:
1269
+ case wn.ERROR_IMAGE:
1270
1270
  s = this._localeService.t("update-status.invalidImage");
1271
1271
  break;
1272
1272
  }
@@ -1281,7 +1281,7 @@ let cn = class extends Ge {
1281
1281
  for (const r of e) {
1282
1282
  if (r == null)
1283
1283
  continue;
1284
- const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: g, image: m } = await ni(d || "");
1284
+ const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: g, image: m } = await ei(d || "");
1285
1285
  this._imageIoService.addImageSourceCache(o, s, m);
1286
1286
  let l = 1;
1287
1287
  if (c > An || g > xn) {
@@ -1295,7 +1295,7 @@ let cn = class extends Ge {
1295
1295
  unitId: n,
1296
1296
  subUnitId: n,
1297
1297
  drawingId: o,
1298
- drawingType: rn.DRAWING_IMAGE,
1298
+ drawingType: Dn.DRAWING_IMAGE,
1299
1299
  imageSourceType: s,
1300
1300
  source: a,
1301
1301
  transform: tt(f),
@@ -1383,12 +1383,12 @@ let cn = class extends Ge {
1383
1383
  var r;
1384
1384
  const { transformer: e, docsLeft: n, docsTop: t } = (r = this._getCurrentSceneAndTransformer()) != null ? r : {};
1385
1385
  if (i == null || i.length === 0)
1386
- this._contextService.setContextValue(on, !1), this._docDrawingService.focusDrawing([]), e && e.resetProps({
1386
+ this._contextService.setContextValue(rn, !1), this._docDrawingService.focusDrawing([]), e && e.resetProps({
1387
1387
  zeroTop: 0,
1388
1388
  zeroLeft: 0
1389
1389
  });
1390
1390
  else {
1391
- this._contextService.setContextValue(on, !0), this._docDrawingService.focusDrawing(i), this._setDrawingSelections(i);
1391
+ this._contextService.setContextValue(rn, !0), this._docDrawingService.focusDrawing(i), this._setDrawingSelections(i);
1392
1392
  const o = this._docSelectionRenderService.getSegment(), s = this._findSegmentIdByDrawingId(i[0].drawingId);
1393
1393
  o !== s && this._docSelectionRenderService.setSegment(s), e && e.resetProps({
1394
1394
  zeroTop: t,
@@ -1419,7 +1419,7 @@ let cn = class extends Ge {
1419
1419
  return;
1420
1420
  const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === We.BODY;
1421
1421
  for (const d of Object.keys(o)) {
1422
- const c = o[d], g = ti({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(g, !0);
1422
+ const c = o[d], g = ni({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(g, !0);
1423
1423
  if (m.length)
1424
1424
  for (const l of m) {
1425
1425
  e.detachTransformerFrom(l);
@@ -1465,27 +1465,27 @@ let cn = class extends Ge {
1465
1465
  this._docSelectionManagerService.replaceDocRanges(t);
1466
1466
  }
1467
1467
  };
1468
- cn = Zi([
1468
+ an = Yi([
1469
1469
  me(1, $),
1470
1470
  me(2, pe(On)),
1471
1471
  me(3, J),
1472
- me(4, Qt),
1472
+ me(4, Zt),
1473
1473
  me(5, Ue),
1474
1474
  me(6, _e),
1475
1475
  me(7, Zn),
1476
- me(8, pi),
1477
- me(9, pe(un)),
1476
+ me(8, fi),
1477
+ me(9, pe(mn)),
1478
1478
  me(10, pe(Re)),
1479
- me(11, pe(hn)),
1480
- me(12, wi)
1481
- ], cn);
1479
+ me(11, pe(un)),
1480
+ me(12, pi)
1481
+ ], an);
1482
1482
  const Dt = {
1483
1483
  id: "doc.command.insert-float-image",
1484
1484
  type: Y.COMMAND,
1485
1485
  handler: (i) => {
1486
1486
  var t, r;
1487
1487
  const e = i.get(q), n = i.get(J);
1488
- return (r = (t = hi(Ie.UNIVER_DOC, e, n)) == null ? void 0 : t.with(cn).insertDocImage()) != null ? r : !1;
1488
+ return (r = (t = ui(Ie.UNIVER_DOC, e, n)) == null ? void 0 : t.with(an).insertDocImage()) != null ? r : !1;
1489
1489
  }
1490
1490
  }, Ye = {
1491
1491
  id: "doc.command.move-drawing",
@@ -1518,7 +1518,7 @@ const Dt = {
1518
1518
  });
1519
1519
  return m.refreshControls(), !!u;
1520
1520
  }
1521
- }, Qi = {
1521
+ }, Zi = {
1522
1522
  id: "doc.operation.clear-drawing-transformer",
1523
1523
  type: Y.MUTATION,
1524
1524
  handler: (i, e) => {
@@ -1532,7 +1532,7 @@ const Dt = {
1532
1532
  id: "sidebar.operation.doc-image",
1533
1533
  type: Y.COMMAND,
1534
1534
  handler: async (i, e) => {
1535
- const n = i.get(vi), t = i.get(un), r = i.get(_e);
1535
+ const n = i.get(wi), t = i.get(mn), r = i.get(_e);
1536
1536
  switch (e.value) {
1537
1537
  case "open":
1538
1538
  n.open({
@@ -1558,18 +1558,18 @@ const Dt = {
1558
1558
  const n = i.get(_e), t = i.get($);
1559
1559
  return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(Ot.id, { value: "open" }), !0);
1560
1560
  }
1561
- }, Ji = "univer-image-common-panel", er = "univer-image-common-panel-grid", nr = "univer-image-common-panel-border", tr = "univer-image-common-panel-title", ir = "univer-image-common-panel-subtitle", rr = "univer-image-common-panel-row", or = "univer-image-common-panel-column", sr = "univer-image-common-panel-span2", ar = "univer-image-common-panel-input", h = {
1562
- imageCommonPanel: Ji,
1563
- imageCommonPanelGrid: er,
1564
- imageCommonPanelBorder: nr,
1565
- imageCommonPanelTitle: tr,
1566
- imageCommonPanelSubtitle: ir,
1567
- imageCommonPanelRow: rr,
1568
- imageCommonPanelColumn: or,
1569
- imageCommonPanelSpan2: sr,
1570
- imageCommonPanelInput: ar
1571
- }, qn = -1e3, Kn = 1e3, cr = (i) => {
1572
- const e = ve($), n = ve(un), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
1561
+ }, Qi = "univer-image-common-panel", Ji = "univer-image-common-panel-grid", er = "univer-image-common-panel-border", nr = "univer-image-common-panel-title", tr = "univer-image-common-panel-subtitle", ir = "univer-image-common-panel-row", rr = "univer-image-common-panel-column", or = "univer-image-common-panel-span2", sr = "univer-image-common-panel-input", h = {
1562
+ imageCommonPanel: Qi,
1563
+ imageCommonPanelGrid: Ji,
1564
+ imageCommonPanelBorder: er,
1565
+ imageCommonPanelTitle: nr,
1566
+ imageCommonPanelSubtitle: tr,
1567
+ imageCommonPanelRow: ir,
1568
+ imageCommonPanelColumn: rr,
1569
+ imageCommonPanelSpan2: or,
1570
+ imageCommonPanelInput: sr
1571
+ }, qn = -1e3, Kn = 1e3, ar = (i) => {
1572
+ const e = ve($), n = ve(mn), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
1573
1573
  if (a == null)
1574
1574
  return;
1575
1575
  const { unitId: d } = a, c = o.getUniverDocInstance(d), g = c == null ? void 0 : c.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), l = m == null ? void 0 : m.scene;
@@ -1587,15 +1587,15 @@ const Dt = {
1587
1587
  }], v = [{
1588
1588
  label: n.t("image-position.line"),
1589
1589
  value: String(H.LINE),
1590
- disabled: g === wn.MODERN
1590
+ disabled: g === pn.MODERN
1591
1591
  }, {
1592
1592
  label: n.t("image-position.page"),
1593
1593
  value: String(H.PAGE),
1594
- disabled: g === wn.MODERN
1594
+ disabled: g === pn.MODERN
1595
1595
  }, {
1596
1596
  label: n.t("image-position.margin"),
1597
1597
  value: String(H.MARGIN),
1598
- disabled: g === wn.MODERN
1598
+ disabled: g === pn.MODERN
1599
1599
  }, {
1600
1600
  label: n.t("image-position.paragraph"),
1601
1601
  value: String(H.PARAGRAPH)
@@ -1797,10 +1797,10 @@ const Dt = {
1797
1797
  ] }) })
1798
1798
  ] }),
1799
1799
  /* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSubtitle), children: /* @__PURE__ */ p("div", { children: n.t("image-position.options") }) }) }),
1800
- /* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(xi, { disabled: w, checked: P, onChange: S, children: n.t("image-position.moveObjectWithText") }) }) })
1800
+ /* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ p("div", { className: h.imageCommonPanelColumn, children: /* @__PURE__ */ p(Ai, { disabled: w, checked: P, onChange: S, children: n.t("image-position.moveObjectWithText") }) }) })
1801
1801
  ] });
1802
- }, en = 0, nn = 100, dr = (i) => {
1803
- const e = ve($), n = ve(un), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
1802
+ }, en = 0, nn = 100, cr = (i) => {
1803
+ const e = ve($), n = ve(mn), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
1804
1804
  if (a == null)
1805
1805
  return null;
1806
1806
  const { unitId: d } = a, c = o.getUniverDocInstance(d), g = r.getRenderById(d);
@@ -2012,7 +2012,7 @@ const Dt = {
2012
2012
  ] }) })
2013
2013
  ] })
2014
2014
  ] });
2015
- }, lr = () => {
2015
+ }, dr = () => {
2016
2016
  const i = ve(_e), e = i.getFocusDrawings(), [n, t] = oe(e);
2017
2017
  return Tn(() => {
2018
2018
  const r = i.focus$.subscribe((o) => {
@@ -2022,13 +2022,13 @@ const Dt = {
2022
2022
  r.unsubscribe();
2023
2023
  };
2024
2024
  }, []), !!(n != null && n.length) && /* @__PURE__ */ K("div", { className: h.imageCommonPanel, children: [
2025
- /* @__PURE__ */ p(ri, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2026
- /* @__PURE__ */ p(dr, { drawings: n }),
2027
- /* @__PURE__ */ p(cr, { drawings: n })
2025
+ /* @__PURE__ */ p(ii, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2026
+ /* @__PURE__ */ p(cr, { drawings: n }),
2027
+ /* @__PURE__ */ p(ar, { drawings: n })
2028
2028
  ] });
2029
- }, yt = "addition-and-subtraction-single", Pt = "doc.menu.image", Mt = Dt.id, gr = (i) => {
2029
+ }, yt = "addition-and-subtraction-single", Pt = "doc.menu.image", Mt = Dt.id, lr = (i) => {
2030
2030
  const e = i.get(On), n = i.get(q);
2031
- return new Ei((t) => {
2031
+ return new Ri((t) => {
2032
2032
  const r = e.textSelection$.subscribe(() => {
2033
2033
  var s;
2034
2034
  const o = e.getActiveTextRange();
@@ -2050,17 +2050,17 @@ const Dt = {
2050
2050
  return () => r.unsubscribe();
2051
2051
  });
2052
2052
  };
2053
- function mr(i) {
2053
+ function gr(i) {
2054
2054
  return {
2055
2055
  id: Pt,
2056
2056
  type: nt.SUBITEMS,
2057
2057
  icon: yt,
2058
2058
  tooltip: "docImage.title",
2059
- disabled$: gr(i),
2059
+ disabled$: lr(i),
2060
2060
  hidden$: et(i, Ie.UNIVER_DOC, void 0, Cn)
2061
2061
  };
2062
2062
  }
2063
- function ur(i) {
2063
+ function mr(i) {
2064
2064
  return {
2065
2065
  id: Mt,
2066
2066
  title: "docImage.upload.float",
@@ -2068,22 +2068,22 @@ function ur(i) {
2068
2068
  hidden$: et(i, Ie.UNIVER_DOC, void 0, Cn)
2069
2069
  };
2070
2070
  }
2071
- const hr = {
2072
- [Ii.LAYOUT]: {
2071
+ const ur = {
2072
+ [vi.LAYOUT]: {
2073
2073
  [Pt]: {
2074
2074
  order: 0,
2075
- menuItemFactory: mr,
2075
+ menuItemFactory: gr,
2076
2076
  [Mt]: {
2077
2077
  order: 0,
2078
- menuItemFactory: ur
2078
+ menuItemFactory: mr
2079
2079
  }
2080
2080
  }
2081
2081
  }
2082
2082
  };
2083
2083
  function Ze(i) {
2084
- return i.getContextValue(Wt) && i.getContextValue(on);
2084
+ return i.getContextValue(Wt) && i.getContextValue(rn);
2085
2085
  }
2086
- const fr = {
2086
+ const hr = {
2087
2087
  id: Ye.id,
2088
2088
  description: "shortcut.doc.drawing-move-down",
2089
2089
  group: "4_doc-drawing-view",
@@ -2093,7 +2093,7 @@ const fr = {
2093
2093
  staticParameters: {
2094
2094
  direction: he.DOWN
2095
2095
  }
2096
- }, pr = {
2096
+ }, fr = {
2097
2097
  id: Ye.id,
2098
2098
  description: "shortcut.doc.drawing-move-up",
2099
2099
  group: "4_doc-drawing-view",
@@ -2103,7 +2103,7 @@ const fr = {
2103
2103
  staticParameters: {
2104
2104
  direction: he.UP
2105
2105
  }
2106
- }, wr = {
2106
+ }, pr = {
2107
2107
  id: Ye.id,
2108
2108
  description: "shortcut.doc.drawing-move-left",
2109
2109
  group: "4_doc-drawing-view",
@@ -2113,7 +2113,7 @@ const fr = {
2113
2113
  staticParameters: {
2114
2114
  direction: he.LEFT
2115
2115
  }
2116
- }, vr = {
2116
+ }, wr = {
2117
2117
  id: Ye.id,
2118
2118
  description: "shortcut.doc.drawing-move-right",
2119
2119
  group: "4_doc-drawing-view",
@@ -2123,7 +2123,7 @@ const fr = {
2123
2123
  staticParameters: {
2124
2124
  direction: he.RIGHT
2125
2125
  }
2126
- }, Ir = {
2126
+ }, vr = {
2127
2127
  id: vt.id,
2128
2128
  description: "shortcut.doc.drawing-delete",
2129
2129
  group: "4_doc-drawing-view",
@@ -2132,21 +2132,21 @@ const fr = {
2132
2132
  binding: He.DELETE,
2133
2133
  mac: He.BACKSPACE
2134
2134
  };
2135
- var _r = Object.getOwnPropertyDescriptor, Sr = (i, e, n, t) => {
2136
- for (var r = t > 1 ? void 0 : t ? _r(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2135
+ var Ir = Object.getOwnPropertyDescriptor, _r = (i, e, n, t) => {
2136
+ for (var r = t > 1 ? void 0 : t ? Ir(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2137
2137
  (s = i[o]) && (r = s(r) || r);
2138
2138
  return r;
2139
2139
  }, tn = (i, e) => (n, t) => e(n, t, i);
2140
- let dn = class extends Ge {
2140
+ let cn = class extends Ge {
2141
2141
  constructor(i, e, n, t) {
2142
2142
  super(), this._componentManager = i, this._menuManagerService = e, this._commandService = n, this._shortcutService = t, this._init();
2143
2143
  }
2144
2144
  _initCustomComponents() {
2145
2145
  const i = this._componentManager;
2146
- this.disposeWithMe(i.register(yt, wt)), this.disposeWithMe(i.register(Ct, lr));
2146
+ this.disposeWithMe(i.register(yt, wt)), this.disposeWithMe(i.register(Ct, dr));
2147
2147
  }
2148
2148
  _initMenus() {
2149
- this._menuManagerService.mergeMenu(hr);
2149
+ this._menuManagerService.mergeMenu(ur);
2150
2150
  }
2151
2151
  _initCommands() {
2152
2152
  [
@@ -2160,7 +2160,7 @@ let dn = class extends Ge {
2160
2160
  ht,
2161
2161
  yn,
2162
2162
  Ot,
2163
- Qi,
2163
+ Zi,
2164
2164
  Tt,
2165
2165
  It,
2166
2166
  St,
@@ -2172,11 +2172,11 @@ let dn = class extends Ge {
2172
2172
  _initShortcuts() {
2173
2173
  [
2174
2174
  // sheet drawing shortcuts
2175
+ hr,
2175
2176
  fr,
2176
2177
  pr,
2177
2178
  wr,
2178
- vr,
2179
- Ir
2179
+ vr
2180
2180
  ].forEach((i) => {
2181
2181
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
2182
2182
  });
@@ -2185,18 +2185,18 @@ let dn = class extends Ge {
2185
2185
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
2186
2186
  }
2187
2187
  };
2188
- dn = Sr([
2189
- tn(0, pe(_i)),
2190
- tn(1, Si),
2188
+ cn = _r([
2189
+ tn(0, pe(Ii)),
2190
+ tn(1, _i),
2191
2191
  tn(2, $),
2192
- tn(3, Di)
2193
- ], dn);
2194
- var Dr = Object.getOwnPropertyDescriptor, Cr = (i, e, n, t) => {
2195
- for (var r = t > 1 ? void 0 : t ? Dr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2192
+ tn(3, Si)
2193
+ ], cn);
2194
+ var Sr = Object.getOwnPropertyDescriptor, Dr = (i, e, n, t) => {
2195
+ for (var r = t > 1 ? void 0 : t ? Sr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2196
2196
  (s = i[o]) && (r = s(r) || r);
2197
2197
  return r;
2198
2198
  }, Fe = (i, e) => (n, t) => e(n, t, i);
2199
- function In(i, e) {
2199
+ function vn(i, e) {
2200
2200
  const { top: n, left: t, width: r, height: o, angle: s, opacity: a } = i, d = e.scene, c = d.getViewport(it.VIEW_MAIN), { viewportScrollX: g, viewportScrollY: m } = c, { scaleX: l, scaleY: f } = d.getAncestorScale();
2201
2201
  return {
2202
2202
  startX: (t - g) * l,
@@ -2213,7 +2213,7 @@ function In(i, e) {
2213
2213
  opacity: a != null ? a : 1
2214
2214
  };
2215
2215
  }
2216
- let ln = class extends Ge {
2216
+ let dn = class extends Ge {
2217
2217
  constructor(e, n, t, r, o, s) {
2218
2218
  super();
2219
2219
  Se(this, "_domLayerInfoMap", /* @__PURE__ */ new Map());
@@ -2262,7 +2262,7 @@ let ln = class extends Ge {
2262
2262
  if (!(a == null || a.length === 0))
2263
2263
  for (const d of a) {
2264
2264
  this._addHoverForRect(d);
2265
- const c = new Ht(), g = In(d, o.renderUnit), m = new ot(g), l = o.canvas, f = s.data, u = {
2265
+ const c = new Ht(), g = vn(d, o.renderUnit), m = new ot(g), l = o.canvas, f = s.data, u = {
2266
2266
  dispose: c,
2267
2267
  rect: d,
2268
2268
  position$: m,
@@ -2288,7 +2288,7 @@ let ln = class extends Ge {
2288
2288
  unitId: t
2289
2289
  });
2290
2290
  const v = d.onTransformChange$.subscribeEvent(() => {
2291
- const w = In(d, o.renderUnit);
2291
+ const w = vn(d, o.renderUnit);
2292
2292
  m.next(
2293
2293
  w
2294
2294
  );
@@ -2328,7 +2328,7 @@ let ln = class extends Ge {
2328
2328
  const t = this._getSceneAndTransformerByDrawingSearch(n);
2329
2329
  t && this._domLayerInfoMap.forEach((r) => {
2330
2330
  if (r.unitId !== n) return;
2331
- const o = In(r.rect, t.renderUnit);
2331
+ const o = vn(r.rect, t.renderUnit);
2332
2332
  r.position$.next(o);
2333
2333
  });
2334
2334
  };
@@ -2339,8 +2339,8 @@ let ln = class extends Ge {
2339
2339
  const t = n.getUnitId(), r = this._renderManagerService.getRenderById(t);
2340
2340
  return r ? { render: r, unitId: t } : null;
2341
2341
  }),
2342
- Ni(
2343
- (n) => n ? Qn(n.render.scene.getViewport(it.VIEW_MAIN).onScrollAfter$).pipe(Wn(() => ({ unitId: n.unitId }))) : Ai(null)
2342
+ Ei(
2343
+ (n) => n ? Qn(n.render.scene.getViewport(it.VIEW_MAIN).onScrollAfter$).pipe(Wn(() => ({ unitId: n.unitId }))) : Ni(null)
2344
2344
  )
2345
2345
  ).subscribe((n) => {
2346
2346
  if (!n) return;
@@ -2381,7 +2381,7 @@ let ln = class extends Ge {
2381
2381
  drawings: [
2382
2382
  {
2383
2383
  drawingId: f,
2384
- drawingType: rn.DRAWING_DOM,
2384
+ drawingType: Dn.DRAWING_DOM,
2385
2385
  subUnitId: t.getUnitId(),
2386
2386
  unitId: t.getUnitId(),
2387
2387
  ...e,
@@ -2396,20 +2396,20 @@ let ln = class extends Ge {
2396
2396
  return this._commandService.syncExecuteCommand(Pn.id, u), f;
2397
2397
  }
2398
2398
  };
2399
- ln = Cr([
2399
+ dn = Dr([
2400
2400
  Fe(0, J),
2401
2401
  Fe(1, _e),
2402
- Fe(2, pe(oi)),
2403
- Fe(3, pe(Ci)),
2402
+ Fe(2, pe(ri)),
2403
+ Fe(3, pe(Di)),
2404
2404
  Fe(4, q),
2405
2405
  Fe(5, $)
2406
- ], ln);
2407
- var Or = Object.getOwnPropertyDescriptor, Tr = (i, e, n, t) => {
2408
- for (var r = t > 1 ? void 0 : t ? Or(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2406
+ ], dn);
2407
+ var Cr = Object.getOwnPropertyDescriptor, Or = (i, e, n, t) => {
2408
+ for (var r = t > 1 ? void 0 : t ? Cr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2409
2409
  (s = i[o]) && (r = s(r) || r);
2410
2410
  return r;
2411
2411
  }, ze = (i, e) => (n, t) => e(n, t, i);
2412
- let gn = class extends Vt {
2412
+ let ln = class extends Vt {
2413
2413
  constructor(e, n, t, r, o) {
2414
2414
  super();
2415
2415
  Se(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
@@ -2431,7 +2431,7 @@ let gn = class extends Vt {
2431
2431
  _hasCropObject(e) {
2432
2432
  const n = e.getAllObjects();
2433
2433
  for (const t of n)
2434
- if (t instanceof si)
2434
+ if (t instanceof oi)
2435
2435
  return !0;
2436
2436
  return !1;
2437
2437
  }
@@ -2457,12 +2457,12 @@ let gn = class extends Vt {
2457
2457
  if (!a)
2458
2458
  return;
2459
2459
  const d = a.oKey, c = this._drawingManagerService.getDrawingOKey(d);
2460
- if (!c || c.drawingType === rn.DRAWING_DOM)
2460
+ if (!c || c.drawingType === Dn.DRAWING_DOM)
2461
2461
  return;
2462
2462
  const { unitId: g, subUnitId: m, drawingId: l, drawingType: f } = c, u = this._canvasPopManagerService.attachPopupToObject(
2463
2463
  a,
2464
2464
  {
2465
- componentKey: ai,
2465
+ componentKey: si,
2466
2466
  direction: "horizontal",
2467
2467
  offset: [2, 0],
2468
2468
  extraProps: {
@@ -2481,7 +2481,7 @@ let gn = class extends Vt {
2481
2481
  ), this.disposeWithMe(
2482
2482
  Oe(
2483
2483
  t.clearControl$.subscribe(() => {
2484
- r.forEach((s) => s.dispose()), r.length = 0, this._contextService.setContextValue(on, !1), this._drawingManagerService.focusDrawing(null);
2484
+ r.forEach((s) => s.dispose()), r.length = 0, this._contextService.setContextValue(rn, !1), this._drawingManagerService.focusDrawing(null);
2485
2485
  })
2486
2486
  )
2487
2487
  ), this.disposeWithMe(
@@ -2505,7 +2505,8 @@ let gn = class extends Vt {
2505
2505
  index: 0,
2506
2506
  commandId: Tt.id,
2507
2507
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2508
- disable: !!jt.includes(e) || r === rn.DRAWING_DOM
2508
+ // disable: !!SHEET_EDITOR_UNITS.includes(unitId) || drawingType === DrawingTypeEnum.DRAWING_DOM,
2509
+ disable: !0
2509
2510
  },
2510
2511
  {
2511
2512
  label: "image-popup.delete",
@@ -2517,7 +2518,7 @@ let gn = class extends Vt {
2517
2518
  {
2518
2519
  label: "image-popup.crop",
2519
2520
  index: 2,
2520
- commandId: ci.id,
2521
+ commandId: ai.id,
2521
2522
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2522
2523
  disable: !0
2523
2524
  // TODO: @JOCS, feature is not ready.
@@ -2525,7 +2526,7 @@ let gn = class extends Vt {
2525
2526
  {
2526
2527
  label: "image-popup.reset",
2527
2528
  index: 3,
2528
- commandId: di.id,
2529
+ commandId: ci.id,
2529
2530
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
2530
2531
  disable: !0
2531
2532
  // TODO: @JOCS, feature is not ready.
@@ -2533,19 +2534,19 @@ let gn = class extends Vt {
2533
2534
  ];
2534
2535
  }
2535
2536
  };
2536
- gn = Tr([
2537
+ ln = Or([
2537
2538
  ze(0, _e),
2538
- ze(1, pe(bi)),
2539
+ ze(1, pe(Mi)),
2539
2540
  ze(2, J),
2540
2541
  ze(3, q),
2541
2542
  ze(4, Zn)
2542
- ], gn);
2543
- var yr = Object.getOwnPropertyDescriptor, Pr = (i, e, n, t) => {
2544
- for (var r = t > 1 ? void 0 : t ? yr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2543
+ ], ln);
2544
+ var Tr = Object.getOwnPropertyDescriptor, yr = (i, e, n, t) => {
2545
+ for (var r = t > 1 ? void 0 : t ? Tr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2545
2546
  (s = i[o]) && (r = s(r) || r);
2546
2547
  return r;
2547
2548
  }, Le = (i, e) => (n, t) => e(n, t, i);
2548
- let Sn = class extends Ge {
2549
+ let _n = class extends Ge {
2549
2550
  constructor(e, n, t, r, o, s, a, d) {
2550
2551
  super();
2551
2552
  Se(this, "_liquid", new Jn());
@@ -2584,7 +2585,7 @@ let Sn = class extends Ge {
2584
2585
  _initResize() {
2585
2586
  this.disposeWithMe(
2586
2587
  Qn(this._context.engine.onTransformChange$).pipe(
2587
- Gn((e) => e.type === fi.resize),
2588
+ Gn((e) => e.type === hi.resize),
2588
2589
  st(16)
2589
2590
  ).subscribe(() => {
2590
2591
  var t;
@@ -2679,64 +2680,64 @@ let Sn = class extends Ge {
2679
2680
  this._lifecycleService.stage >= En.Rendered ? this._docSkeletonManagerService.getSkeleton() ? e() : setTimeout(e, 500) : this._lifecycleService.lifecycle$.pipe(Gn((n) => n === En.Rendered)).subscribe(e);
2680
2681
  }
2681
2682
  };
2682
- Sn = Pr([
2683
+ _n = yr([
2683
2684
  Le(1, pe(te)),
2684
2685
  Le(2, $),
2685
- Le(3, Ri),
2686
+ Le(3, bi),
2686
2687
  Le(4, _e),
2687
- Le(5, pe(hn)),
2688
+ Le(5, pe(un)),
2688
2689
  Le(6, q),
2689
- Le(7, pe($t))
2690
- ], Sn);
2691
- var Mr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, Rr = (i, e, n) => e in i ? Mr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Er = (i, e, n, t) => {
2692
- for (var r = t > 1 ? void 0 : t ? br(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2690
+ Le(7, pe(jt))
2691
+ ], _n);
2692
+ var Pr = Object.defineProperty, Mr = Object.getOwnPropertyDescriptor, br = (i, e, n) => e in i ? Pr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Rr = (i, e, n, t) => {
2693
+ for (var r = t > 1 ? void 0 : t ? Mr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
2693
2694
  (s = i[o]) && (r = s(r) || r);
2694
2695
  return r;
2695
- }, _n = (i, e) => (n, t) => e(n, t, i), bt = (i, e, n) => Rr(i, typeof e != "symbol" ? e + "" : e, n);
2696
- const Nr = "DOC_DRAWING_UI_PLUGIN";
2697
- let mn = class extends Kt {
2696
+ }, In = (i, e) => (n, t) => e(n, t, i), bt = (i, e, n) => br(i, typeof e != "symbol" ? e + "" : e, n);
2697
+ const Er = "DOC_DRAWING_UI_PLUGIN";
2698
+ let gn = class extends qt {
2698
2699
  constructor(i = zn, e, n, t) {
2699
2700
  super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
2700
- const { ...r } = Yt(
2701
+ const { ...r } = Kt(
2701
2702
  {},
2702
2703
  zn,
2703
2704
  this._config
2704
2705
  );
2705
- this._configService.setConfig(Ui, r);
2706
+ this._configService.setConfig(Li, r);
2706
2707
  }
2707
2708
  onStarting() {
2708
2709
  [
2709
- [dn],
2710
- [gn],
2711
- [an],
2710
+ [cn],
2711
+ [ln],
2712
2712
  [sn],
2713
- [hn],
2714
- [ln]
2713
+ [on],
2714
+ [un],
2715
+ [dn]
2715
2716
  ].forEach((e) => this._injector.add(e));
2716
2717
  }
2717
2718
  onReady() {
2718
2719
  [
2719
- [cn],
2720
- [Sn]
2721
- ].forEach((i) => this._renderManagerSrv.registerRenderModule(Ie.UNIVER_DOC, i)), this._injector.get(sn), this._injector.get(dn), this._injector.get(an);
2720
+ [an],
2721
+ [_n]
2722
+ ].forEach((i) => this._renderManagerSrv.registerRenderModule(Ie.UNIVER_DOC, i)), this._injector.get(on), this._injector.get(cn), this._injector.get(sn);
2722
2723
  }
2723
2724
  onRendered() {
2724
- this._injector.get(gn), this._injector.get(ln);
2725
+ this._injector.get(ln), this._injector.get(dn);
2725
2726
  }
2726
2727
  };
2727
- bt(mn, "type", Ie.UNIVER_DOC);
2728
- bt(mn, "pluginName", Nr);
2729
- mn = Er([
2730
- zt(li, ii, Zt, Oi),
2731
- _n(1, pe(Xt)),
2732
- _n(2, J),
2733
- _n(3, qt)
2734
- ], mn);
2728
+ bt(gn, "type", Ie.UNIVER_DOC);
2729
+ bt(gn, "pluginName", Er);
2730
+ gn = Rr([
2731
+ $t(di, ti, Yt, Ci),
2732
+ In(1, pe(zt)),
2733
+ In(2, J),
2734
+ In(3, Xt)
2735
+ ], gn);
2735
2736
  export {
2736
- Qi as ClearDocDrawingTransformerOperation,
2737
+ Zi as ClearDocDrawingTransformerOperation,
2737
2738
  Pt as DOCS_IMAGE_MENU_ID,
2738
2739
  vt as DeleteDocDrawingsCommand,
2739
- ln as DocFloatDomController,
2740
+ dn as DocFloatDomController,
2740
2741
  Tt as EditDocDrawingOperation,
2741
2742
  It as GroupDocDrawingCommand,
2742
2743
  Pn as InsertDocDrawingCommand,
@@ -2746,5 +2747,5 @@ export {
2746
2747
  _t as SetDocDrawingArrangeCommand,
2747
2748
  Ot as SidebarDocDrawingOperation,
2748
2749
  St as UngroupDocDrawingCommand,
2749
- mn as UniverDocsDrawingUIPlugin
2750
+ gn as UniverDocsDrawingUIPlugin
2750
2751
  };