@univerjs/docs-drawing-ui 0.1.16 → 0.2.0

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,64 +1,64 @@
1
- var Be = Object.defineProperty;
2
- var He = (e, n, t) => n in e ? Be(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
- var $ = (e, n, t) => He(e, typeof n != "symbol" ? n + "" : n, t);
4
- import { CommandType as C, ICommandService as _, IUndoRedoService as x, LocaleService as Q, RxDisposable as ke, UniverInstanceType as R, toDisposable as ee, FOCUSING_COMMON_DRAWINGS as Y, OnLifecycle as re, LifecycleStages as ie, IUniverInstanceService as he, IContextService as Ie, Direction as E, FOCUSING_UNIVER_EDITOR as Ke, Disposable as ve, PositionedObjectLayoutType as ze, ObjectRelativeFromH as Ze, ObjectRelativeFromV as qe, Plugin as Ye } from "@univerjs/core";
5
- import { Inject as b, Injector as _e } from "@wendellhu/redi";
6
- import { IRenderManagerService as X, getGroupState as Qe, transformObjectOutOfGroup as Xe, Liquid as Je } from "@univerjs/engine-render";
7
- import { ImageCropperObject as en, COMPONENT_IMAGE_POPUP_MENU as nn, OpenImageCropOperation as tn, ImageResetSizeOperation as rn, DrawingCommonPanel as on } from "@univerjs/drawing-ui";
8
- import { takeUntil as ce } from "rxjs";
9
- import { DocCanvasPopManagerService as an, transformToDocDrawingPosition as we, docDrawingPositionToTransform as de } from "@univerjs/docs-ui";
10
- import { IDrawingManagerService as L, DRAWING_IMAGE_ALLOW_IMAGE_LIST as sn, ArrangeTypeEnum as B, DrawingTypeEnum as oe, DRAWING_IMAGE_COUNT_LIMIT as ue, ImageUploadStatusType as ne, DRAWING_IMAGE_ALLOW_SIZE as cn, getImageSize as dn, DRAWING_IMAGE_WIDTH_LIMIT as me, DRAWING_IMAGE_HEIGHT_LIMIT as le, IImageIoService as un } from "@univerjs/drawing";
11
- import { IDocDrawingService as P, SetDocDrawingApplyMutation as h, DocDrawingApplyType as I } from "@univerjs/docs-drawing";
12
- import { ISidebarService as mn, MenuItemType as Se, MenuPosition as ln, MenuGroup as gn, getMenuHiddenObservable as Ce, KeyCode as A, ComponentManager as pn, IMenuService as fn, IShortcutService as hn, IMessageService as In } from "@univerjs/ui";
13
- import { useDependency as N } from "@wendellhu/redi/react-bindings";
14
- import M, { forwardRef as De, useRef as Me, createElement as Oe, useState as te, useEffect as Pe } from "react";
15
- import H from "clsx";
16
- import { MessageType as k } from "@univerjs/design";
17
- import { TextSelectionManagerService as vn, DocSkeletonManagerService as _n } from "@univerjs/docs";
18
- const S = {
1
+ var Ge = Object.defineProperty;
2
+ var Le = (e, n, t) => n in e ? Ge(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var J = (e, n, t) => Le(e, typeof n != "symbol" ? n + "" : n, t);
4
+ import { CommandType as S, ICommandService as I, IUndoRedoService as U, LocaleService as k, RxDisposable as je, UniverInstanceType as E, toDisposable as We, FOCUSING_COMMON_DRAWINGS as V, OnLifecycle as se, LifecycleStages as ce, IUniverInstanceService as Fe, IContextService as de, Direction as P, FOCUSING_UNIVER_EDITOR as $e, Disposable as ue, PositionedObjectLayoutType as Ve, ObjectRelativeFromH as Be, ObjectRelativeFromV as He, Plugin as ze, DependentOn as Ke } from "@univerjs/core";
5
+ import { Inject as y, Injector as me } from "@wendellhu/redi";
6
+ import { ImageCropperObject as Ze, COMPONENT_IMAGE_POPUP_MENU as Ye, OpenImageCropOperation as ke, ImageResetSizeOperation as Qe, DrawingCommonPanel as Xe, UniverDrawingUIPlugin as qe } from "@univerjs/drawing-ui";
7
+ import { IDrawingManagerService as N, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Je, ArrangeTypeEnum as L, DrawingTypeEnum as Q, DRAWING_IMAGE_COUNT_LIMIT as ee, ImageUploadStatusType as K, DRAWING_IMAGE_ALLOW_SIZE as en, getImageSize as nn, DRAWING_IMAGE_WIDTH_LIMIT as ne, DRAWING_IMAGE_HEIGHT_LIMIT as te, IImageIoService as tn, UniverDrawingPlugin as rn } from "@univerjs/drawing";
8
+ import { IDocDrawingService as M, SetDocDrawingApplyMutation as p, DocDrawingApplyType as f, UniverDocsDrawingPlugin as on } from "@univerjs/docs-drawing";
9
+ import { IRenderManagerService as H, getGroupState as an, transformObjectOutOfGroup as sn } from "@univerjs/engine-render";
10
+ import { takeUntil as re } from "rxjs";
11
+ import { DocCanvasPopManagerService as cn, transformToDocDrawingPosition as le, docDrawingPositionToTransform as ie } from "@univerjs/docs-ui";
12
+ import { ISidebarService as dn, MenuItemType as ge, MenuPosition as un, MenuGroup as mn, getMenuHiddenObservable as pe, KeyCode as R, ComponentManager as ln, IMenuService as gn, IShortcutService as pn, IMessageService as fn } from "@univerjs/ui";
13
+ import { useDependency as b } from "@wendellhu/redi/react-bindings";
14
+ import C, { forwardRef as fe, useRef as he, createElement as ve, useState as Z, useEffect as Ie } from "react";
15
+ import j from "clsx";
16
+ import { MessageType as W } from "@univerjs/design";
17
+ import { TextSelectionManagerService as hn, DocSkeletonManagerService as vn } from "@univerjs/docs";
18
+ const w = {
19
19
  id: "sheet.operation.clear-drawing-transformer",
20
- type: C.MUTATION,
20
+ type: S.MUTATION,
21
21
  handler: (e, n) => {
22
- const t = e.get(X);
22
+ const t = e.get(H);
23
23
  return n.forEach((r) => {
24
24
  var i, o;
25
25
  (o = (i = t.getRenderById(r)) == null ? void 0 : i.scene.getTransformer()) == null || o.debounceRefreshControls();
26
26
  }), !0;
27
27
  }
28
- }, ae = {
28
+ }, X = {
29
29
  id: "doc.command.remove-doc-image",
30
- type: C.COMMAND,
30
+ type: S.COMMAND,
31
31
  handler: (e, n) => {
32
- const t = e.get(_), r = e.get(x), i = e.get(P);
32
+ const t = e.get(I), r = e.get(U), i = e.get(M);
33
33
  if (!n) return !1;
34
34
  const { drawings: o } = n, a = [];
35
- o.forEach((p) => {
36
- const { unitId: f } = p;
37
- a.push(f);
35
+ o.forEach((h) => {
36
+ const { unitId: v } = h;
37
+ a.push(v);
38
38
  });
39
- const s = i.getBatchRemoveOp(o), { unitId: c, subUnitId: d, undo: m, redo: u, objects: l } = s;
40
- return t.syncExecuteCommand(h.id, { unitId: c, subUnitId: d, op: u, objects: l, type: I.REMOVE }) ? (r.pushUndoRedo({
39
+ const s = i.getBatchRemoveOp(o), { unitId: c, subUnitId: u, undo: m, redo: d, objects: l } = s;
40
+ return t.syncExecuteCommand(p.id, { unitId: c, subUnitId: u, op: d, objects: l, type: f.REMOVE }) ? (r.pushUndoRedo({
41
41
  unitID: c,
42
42
  undoMutations: [
43
- { id: h.id, params: { unitId: c, subUnitId: d, op: m, objects: l, type: I.INSERT } },
44
- { id: S.id, params: a }
43
+ { id: p.id, params: { unitId: c, subUnitId: u, op: m, objects: l, type: f.INSERT } },
44
+ { id: w.id, params: a }
45
45
  ],
46
46
  redoMutations: [
47
- { id: h.id, params: { unitId: c, subUnitId: d, op: u, objects: l, type: I.REMOVE } },
48
- { id: S.id, params: a }
47
+ { id: p.id, params: { unitId: c, subUnitId: u, op: d, objects: l, type: f.REMOVE } },
48
+ { id: w.id, params: a }
49
49
  ]
50
50
  }), !0) : !1;
51
51
  }
52
- }, ye = "COMPONENT_DOC_DRAWING_PANEL", Ee = {
52
+ }, _e = "COMPONENT_DOC_DRAWING_PANEL", we = {
53
53
  id: "sidebar.operation.doc-image",
54
- type: C.COMMAND,
54
+ type: S.COMMAND,
55
55
  handler: async (e, n) => {
56
- const t = e.get(mn), r = e.get(Q), i = e.get(L);
56
+ const t = e.get(dn), r = e.get(k), i = e.get(N);
57
57
  switch (n.value) {
58
58
  case "open":
59
59
  t.open({
60
60
  header: { title: r.t("docImage.panel.title") },
61
- children: { label: ye },
61
+ children: { label: _e },
62
62
  onClose: () => {
63
63
  i.focusDrawing(null);
64
64
  },
@@ -72,27 +72,27 @@ const S = {
72
72
  }
73
73
  return !0;
74
74
  }
75
- }, be = {
75
+ }, Se = {
76
76
  id: "sheet.operation.edit-sheet-image",
77
- type: C.OPERATION,
77
+ type: S.OPERATION,
78
78
  handler: (e, n) => {
79
- const t = e.get(L), r = e.get(_);
80
- return n == null ? !1 : (t.focusDrawing([n]), r.executeCommand(Ee.id, { value: "open" }), !0);
79
+ const t = e.get(N), r = e.get(I);
80
+ return n == null ? !1 : (t.focusDrawing([n]), r.executeCommand(we.id, { value: "open" }), !0);
81
81
  }
82
82
  };
83
- var wn = Object.defineProperty, Sn = Object.getOwnPropertyDescriptor, Cn = (e, n, t, r) => {
84
- for (var i = r > 1 ? void 0 : r ? Sn(n, t) : n, o = e.length - 1, a; o >= 0; o--)
83
+ var In = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, wn = (e, n, t, r) => {
84
+ for (var i = r > 1 ? void 0 : r ? _n(n, t) : n, o = e.length - 1, a; o >= 0; o--)
85
85
  (a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
86
- return r && i && wn(n, t, i), i;
87
- }, j = (e, n) => (t, r) => n(t, r, e);
88
- let z = class extends ke {
86
+ return r && i && In(n, t, i), i;
87
+ }, A = (e, n) => (t, r) => n(t, r, e);
88
+ let F = class extends je {
89
89
  constructor(n, t, r, i, o) {
90
90
  super();
91
- $(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
91
+ J(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
92
92
  this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = i, this._contextService = o, this._init();
93
93
  }
94
94
  _init() {
95
- this._univerInstanceService.getCurrentTypeOfUnit$(R.UNIVER_DOC).pipe(ce(this.dispose$)).subscribe((n) => this._create(n)), this._univerInstanceService.getTypeOfUnitDisposed$(R.UNIVER_DOC).pipe(ce(this.dispose$)).subscribe((n) => this._dispose(n)), this._univerInstanceService.getAllUnitsForType(R.UNIVER_DOC).forEach((n) => this._create(n));
95
+ this._univerInstanceService.getCurrentTypeOfUnit$(E.UNIVER_DOC).pipe(re(this.dispose$)).subscribe((n) => this._create(n)), this._univerInstanceService.getTypeOfUnitDisposed$(E.UNIVER_DOC).pipe(re(this.dispose$)).subscribe((n) => this._dispose(n)), this._univerInstanceService.getAllUnitsForType(E.UNIVER_DOC).forEach((n) => this._create(n));
96
96
  }
97
97
  _dispose(n) {
98
98
  const t = n.getUnitId();
@@ -107,7 +107,7 @@ let z = class extends ke {
107
107
  _hasCropObject(n) {
108
108
  const t = n.getAllObjects();
109
109
  for (const r of t)
110
- if (r instanceof en)
110
+ if (r instanceof Ze)
111
111
  return !0;
112
112
  return !1;
113
113
  }
@@ -121,8 +121,8 @@ let z = class extends ke {
121
121
  return;
122
122
  const i = [];
123
123
  this.disposeWithMe(
124
- ee(
125
- r.onCreateControlObservable.add(() => {
124
+ We(
125
+ r.createControl$.subscribe(() => {
126
126
  if (this._hasCropObject(t))
127
127
  return;
128
128
  const a = r.getSelectedObjectMap();
@@ -133,36 +133,32 @@ let z = class extends ke {
133
133
  const s = a.values().next().value;
134
134
  if (!s)
135
135
  return;
136
- const c = s.oKey, d = this._drawingManagerService.getDrawingOKey(c);
137
- if (!d)
136
+ const c = s.oKey, u = this._drawingManagerService.getDrawingOKey(c);
137
+ if (!u)
138
138
  return;
139
- const { unitId: m, subUnitId: u, drawingId: l } = d;
139
+ const { unitId: m, subUnitId: d, drawingId: l } = u;
140
140
  i.push(this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(s, {
141
- componentKey: nn,
141
+ componentKey: Ye,
142
142
  direction: "horizontal",
143
143
  offset: [2, 0],
144
144
  extraProps: {
145
- menuItems: this._getImageMenuItems(m, u, l)
145
+ menuItems: this._getImageMenuItems(m, d, l)
146
146
  }
147
147
  }))), this._drawingManagerService.focusDrawing([{
148
148
  unitId: m,
149
- subUnitId: u,
149
+ subUnitId: d,
150
150
  drawingId: l
151
151
  }]);
152
152
  })
153
153
  )
154
154
  ), this.disposeWithMe(
155
- ee(
156
- r.onClearControlObservable.add(() => {
157
- i.forEach((a) => a.dispose()), this._contextService.setContextValue(Y, !1), this._drawingManagerService.focusDrawing(null);
158
- })
159
- )
155
+ r.clearControl$.subscribe(() => {
156
+ i.forEach((a) => a.dispose()), this._contextService.setContextValue(V, !1), this._drawingManagerService.focusDrawing(null);
157
+ })
160
158
  ), this.disposeWithMe(
161
- ee(
162
- r.onChangingObservable.add(() => {
163
- i.forEach((a) => a.dispose());
164
- })
165
- )
159
+ r.changing$.subscribe(() => {
160
+ i.forEach((a) => a.dispose());
161
+ })
166
162
  );
167
163
  }
168
164
  _getImageMenuItems(n, t, r) {
@@ -170,68 +166,68 @@ let z = class extends ke {
170
166
  {
171
167
  label: "image-popup.edit",
172
168
  index: 0,
173
- commandId: be.id,
169
+ commandId: Se.id,
174
170
  commandParams: { unitId: n, subUnitId: t, drawingId: r },
175
171
  disable: !1
176
172
  },
177
173
  {
178
174
  label: "image-popup.delete",
179
175
  index: 1,
180
- commandId: ae.id,
176
+ commandId: X.id,
181
177
  commandParams: { unitId: n, drawings: [{ unitId: n, subUnitId: t, drawingId: r }] },
182
178
  disable: !1
183
179
  },
184
180
  {
185
181
  label: "image-popup.crop",
186
182
  index: 2,
187
- commandId: tn.id,
183
+ commandId: ke.id,
188
184
  commandParams: { unitId: n, subUnitId: t, drawingId: r },
189
185
  disable: !1
190
186
  },
191
187
  {
192
188
  label: "image-popup.reset",
193
189
  index: 3,
194
- commandId: rn.id,
190
+ commandId: Qe.id,
195
191
  commandParams: [{ unitId: n, subUnitId: t, drawingId: r }],
196
192
  disable: !1
197
193
  }
198
194
  ];
199
195
  }
200
196
  };
201
- z = Cn([
202
- re(ie.Rendered, z),
203
- j(0, L),
204
- j(1, b(an)),
205
- j(2, X),
206
- j(3, he),
207
- j(4, Ie)
208
- ], z);
209
- var w = function() {
210
- return w = Object.assign || function(e) {
197
+ F = wn([
198
+ se(ce.Rendered, F),
199
+ A(0, N),
200
+ A(1, y(cn)),
201
+ A(2, H),
202
+ A(3, Fe),
203
+ A(4, de)
204
+ ], F);
205
+ var _ = function() {
206
+ return _ = Object.assign || function(e) {
211
207
  for (var n, t = 1, r = arguments.length; t < r; t++) {
212
208
  n = arguments[t];
213
209
  for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
214
210
  }
215
211
  return e;
216
- }, w.apply(this, arguments);
217
- }, Dn = function(e, n) {
212
+ }, _.apply(this, arguments);
213
+ }, Sn = function(e, n) {
218
214
  var t = {};
219
215
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
220
216
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
221
217
  for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
222
218
  n.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (t[r[i]] = e[r[i]]);
223
219
  return t;
224
- }, Re = De(function(e, n) {
225
- var t = e.icon, r = e.id, i = e.className, o = e.extend, a = Dn(e, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), c = Me("_".concat(Pn()));
226
- return Ue(t, "".concat(r), { defIds: t.defIds, idSuffix: c.current }, w({ ref: n, className: s }, a), o);
220
+ }, Ce = fe(function(e, n) {
221
+ var t = e.icon, r = e.id, i = e.className, o = e.extend, a = Sn(e, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), c = he("_".concat(Mn()));
222
+ return De(t, "".concat(r), { defIds: t.defIds, idSuffix: c.current }, _({ ref: n, className: s }, a), o);
227
223
  });
228
- function Ue(e, n, t, r, i) {
229
- return Oe(e.tag, w(w({ key: n }, Mn(e, t, i)), r), (On(e, t).children || []).map(function(o, a) {
230
- return Ue(o, "".concat(n, "-").concat(e.tag, "-").concat(a), t, void 0, i);
224
+ function De(e, n, t, r, i) {
225
+ return ve(e.tag, _(_({ key: n }, Cn(e, t, i)), r), (Dn(e, t).children || []).map(function(o, a) {
226
+ return De(o, "".concat(n, "-").concat(e.tag, "-").concat(a), t, void 0, i);
231
227
  }));
232
228
  }
233
- function Mn(e, n, t) {
234
- var r = w({}, e.attrs);
229
+ function Cn(e, n, t) {
230
+ var r = _({}, e.attrs);
235
231
  t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1);
236
232
  var i = n.defIds;
237
233
  return !i || i.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + n.idSuffix), Object.entries(r).forEach(function(o) {
@@ -239,227 +235,217 @@ function Mn(e, n, t) {
239
235
  typeof s == "string" && (r[a] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
240
236
  })), r;
241
237
  }
242
- function On(e, n) {
238
+ function Dn(e, n) {
243
239
  var t, r = n.defIds;
244
- return !r || r.length === 0 ? e : e.tag === "defs" && (!((t = e.children) === null || t === void 0) && t.length) ? w(w({}, e), { children: e.children.map(function(i) {
245
- return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? w(w({}, i), { attrs: w(w({}, i.attrs), { id: i.attrs.id + n.idSuffix }) }) : i;
240
+ return !r || r.length === 0 ? e : e.tag === "defs" && (!((t = e.children) === null || t === void 0) && t.length) ? _(_({}, e), { children: e.children.map(function(i) {
241
+ return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? _(_({}, i), { attrs: _(_({}, i.attrs), { id: i.attrs.id + n.idSuffix }) }) : i;
246
242
  }) }) : e;
247
243
  }
248
- function Pn() {
244
+ function Mn() {
249
245
  return Math.random().toString(36).substring(2, 8);
250
246
  }
251
- Re.displayName = "UniverIcon";
252
- var yn = { 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" } }] }, Te = De(function(e, n) {
253
- return Oe(Re, Object.assign({}, e, {
247
+ Ce.displayName = "UniverIcon";
248
+ var On = { 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" } }] }, Me = fe(function(e, n) {
249
+ return ve(Ce, Object.assign({}, e, {
254
250
  id: "add-image-single",
255
251
  ref: n,
256
- icon: yn
252
+ icon: On
257
253
  }));
258
254
  });
259
- Te.displayName = "AddImageSingle";
260
- const J = {
255
+ Me.displayName = "AddImageSingle";
256
+ const z = {
261
257
  id: "doc.operation.insert-float-image",
262
- type: C.OPERATION,
263
- handler: (e, n) => !0
264
- }, En = "univer-upload-file-menu", bn = "univer-upload-file-menu-input", ge = {
265
- uploadFileMenu: En,
266
- uploadFileMenuInput: bn
267
- }, Rn = () => {
268
- const e = N(_), n = Me(null), t = () => {
258
+ type: S.OPERATION,
259
+ handler: () => !0
260
+ }, Pn = "univer-upload-file-menu", En = "univer-upload-file-menu-input", oe = {
261
+ uploadFileMenu: Pn,
262
+ uploadFileMenuInput: En
263
+ }, yn = () => {
264
+ const e = b(I), n = he(null), t = () => {
269
265
  var o;
270
266
  (o = n.current) == null || o.click();
271
- }, r = sn.map((o) => `.${o.replace("image/", "")}`).join(","), i = (o) => {
267
+ }, r = Je.map((o) => `.${o.replace("image/", "")}`).join(","), i = (o) => {
272
268
  const a = o.target.files;
273
269
  if (a == null)
274
270
  return;
275
271
  const s = Array.from(a);
276
- e.executeCommand(J.id, { files: s }), n.current && (n.current.value = "");
272
+ e.executeCommand(z.id, { files: s }), n.current && (n.current.value = "");
277
273
  };
278
- return /* @__PURE__ */ M.createElement("div", { onClick: t, className: ge.uploadFileMenu }, /* @__PURE__ */ M.createElement(
274
+ return /* @__PURE__ */ C.createElement("div", { onClick: t, className: oe.uploadFileMenu }, /* @__PURE__ */ C.createElement(
279
275
  "input",
280
276
  {
281
277
  type: "file",
282
- className: ge.uploadFileMenuInput,
278
+ className: oe.uploadFileMenuInput,
283
279
  ref: n,
284
280
  onChange: i,
285
281
  accept: r,
286
282
  multiple: !0
287
283
  }
288
284
  ));
289
- }, Ne = "COMPONENT_DOC_UPLOAD_FILE_MENU", Ae = "addition-and-subtraction-single", xe = "doc.menu.image";
290
- function Un(e) {
285
+ }, Oe = "COMPONENT_DOC_UPLOAD_FILE_MENU", Pe = "addition-and-subtraction-single", Ee = "doc.menu.image";
286
+ function bn(e) {
291
287
  return {
292
- id: xe,
293
- type: Se.SUBITEMS,
294
- positions: [ln.TOOLBAR_START],
295
- group: gn.TOOLBAR_LAYOUT,
296
- icon: Ae,
288
+ id: Ee,
289
+ type: ge.SUBITEMS,
290
+ positions: [un.TOOLBAR_START],
291
+ group: mn.TOOLBAR_LAYOUT,
292
+ icon: Pe,
297
293
  tooltip: "docImage.title",
298
- hidden$: Ce(e, R.UNIVER_DOC)
294
+ hidden$: pe(e, E.UNIVER_DOC)
299
295
  };
300
296
  }
301
- function Tn(e) {
297
+ function Rn(e) {
302
298
  return {
303
- id: J.id,
299
+ id: z.id,
304
300
  title: "docImage.upload.float",
305
- type: Se.SELECTOR,
301
+ type: ge.SELECTOR,
306
302
  label: {
307
- name: Ne
303
+ name: Oe
308
304
  },
309
- positions: [xe],
310
- hidden$: Ce(e, R.UNIVER_DOC)
305
+ positions: [Ee],
306
+ hidden$: pe(e, E.UNIVER_DOC)
311
307
  };
312
308
  }
313
- const Nn = "univer-image-common-panel", An = "univer-image-common-panel-grid", xn = "univer-image-common-panel-border", Ln = "univer-image-common-panel-title", Gn = "univer-image-common-panel-row", jn = "univer-image-common-panel-row-vertical", Wn = "univer-image-common-panel-column", Fn = "univer-image-common-panel-column-center", Vn = "univer-image-common-panel-inline", $n = "univer-image-common-panel-span2", Bn = "univer-image-common-panel-span3", Hn = "univer-image-common-panel-input", kn = "univer-sheet-image-menu", Kn = "univer-sheet-image-menu-input", y = {
314
- imageCommonPanel: Nn,
315
- imageCommonPanelGrid: An,
316
- imageCommonPanelBorder: xn,
317
- imageCommonPanelTitle: Ln,
318
- imageCommonPanelRow: Gn,
319
- imageCommonPanelRowVertical: jn,
320
- imageCommonPanelColumn: Wn,
321
- imageCommonPanelColumnCenter: Fn,
322
- imageCommonPanelInline: Vn,
323
- imageCommonPanelSpan2: $n,
324
- imageCommonPanelSpan3: Bn,
325
- imageCommonPanelInput: Hn,
326
- sheetImageMenu: kn,
327
- sheetImageMenuInput: Kn
328
- }, se = {
309
+ const Un = "univer-image-common-panel", Nn = "univer-image-common-panel-grid", An = "univer-image-common-panel-border", Tn = "univer-image-common-panel-title", xn = "univer-image-common-panel-row", Gn = "univer-image-common-panel-row-vertical", Ln = "univer-image-common-panel-column", jn = "univer-image-common-panel-column-center", Wn = "univer-image-common-panel-inline", Fn = "univer-image-common-panel-span2", $n = "univer-image-common-panel-span3", Vn = "univer-image-common-panel-input", Bn = "univer-sheet-image-menu", Hn = "univer-sheet-image-menu-input", O = {
310
+ imageCommonPanel: Un,
311
+ imageCommonPanelGrid: Nn,
312
+ imageCommonPanelBorder: An,
313
+ imageCommonPanelTitle: Tn,
314
+ imageCommonPanelRow: xn,
315
+ imageCommonPanelRowVertical: Gn,
316
+ imageCommonPanelColumn: Ln,
317
+ imageCommonPanelColumnCenter: jn,
318
+ imageCommonPanelInline: Wn,
319
+ imageCommonPanelSpan2: Fn,
320
+ imageCommonPanelSpan3: $n,
321
+ imageCommonPanelInput: Vn,
322
+ sheetImageMenu: Bn,
323
+ sheetImageMenuInput: Hn
324
+ }, q = {
329
325
  id: "doc.command.set-doc-image",
330
- type: C.COMMAND,
326
+ type: S.COMMAND,
331
327
  handler: (e, n) => {
332
- const t = e.get(_), r = e.get(x), i = e.get(P);
328
+ const t = e.get(I), r = e.get(U), i = e.get(M);
333
329
  if (!n) return !1;
334
- const { drawings: o } = n, a = i.getBatchUpdateOp(o), { unitId: s, subUnitId: c, undo: d, redo: m, objects: u } = a;
335
- return t.syncExecuteCommand(h.id, { unitId: s, subUnitId: c, op: m, objects: u, type: I.UPDATE }) ? (r.pushUndoRedo({
330
+ const { drawings: o } = n, a = i.getBatchUpdateOp(o), { unitId: s, subUnitId: c, undo: u, redo: m, objects: d } = a;
331
+ return t.syncExecuteCommand(p.id, { unitId: s, subUnitId: c, op: m, objects: d, type: f.UPDATE }) ? (r.pushUndoRedo({
336
332
  unitID: s,
337
333
  undoMutations: [
338
- { id: h.id, params: { unitId: s, subUnitId: c, op: d, objects: u, type: I.UPDATE } },
339
- { id: S.id, params: [s] }
334
+ { id: p.id, params: { unitId: s, subUnitId: c, op: u, objects: d, type: f.UPDATE } },
335
+ { id: w.id, params: [s] }
340
336
  ],
341
337
  redoMutations: [
342
- { id: h.id, params: { unitId: s, subUnitId: c, op: m, objects: u, type: I.UPDATE } },
343
- { id: S.id, params: [s] }
338
+ { id: p.id, params: { unitId: s, subUnitId: c, op: m, objects: d, type: f.UPDATE } },
339
+ { id: w.id, params: [s] }
344
340
  ]
345
341
  }), !0) : !1;
346
342
  }
347
343
  }, zn = (e) => {
348
- N(_);
349
- const n = N(Q), t = N(L), r = N(X), { drawings: i } = e, o = i[0];
350
- if (o == null)
344
+ b(I);
345
+ const n = b(k);
346
+ b(N);
347
+ const t = b(H), { drawings: r } = e, i = r[0];
348
+ if (i == null)
351
349
  return;
352
- const { unitId: a } = o, s = r.getRenderById(a), c = s == null ? void 0 : s.scene;
353
- if (c == null)
350
+ const { unitId: o } = i, a = t.getRenderById(o), s = a == null ? void 0 : a.scene;
351
+ if (s == null)
354
352
  return;
355
- const d = c.getTransformerByCreate(), [m, u] = te(!0);
356
- te("");
357
- function l(p, f) {
358
- const v = [];
359
- return p.forEach((O) => {
360
- const { oKey: U } = O;
361
- if (f.getDrawingOKey(U) == null)
362
- return v.push(null), !0;
363
- }), v;
364
- }
365
- Pe(() => {
366
- const p = d.onClearControlObservable.add((v) => {
367
- v === !0 && u(!1);
368
- }), f = d.onChangeStartObservable.add((v) => {
369
- const { objects: O } = v;
370
- l(O, t);
353
+ const c = s.getTransformerByCreate(), [u, m] = Z(!0);
354
+ Z(""), Ie(() => {
355
+ const l = c.clearControl$.subscribe((g) => {
356
+ g === !0 && m(!1);
371
357
  });
372
358
  return () => {
373
- f == null || f.dispose(), p == null || p.dispose();
359
+ l.unsubscribe();
374
360
  };
375
361
  }, []);
376
- const g = (p) => p ? "block" : "none";
377
- return /* @__PURE__ */ M.createElement("div", { className: H(y.imageCommonPanelGrid, y.imageCommonPanelBorder), style: { display: g(m) } }, /* @__PURE__ */ M.createElement("div", { className: y.imageCommonPanelRow }, /* @__PURE__ */ M.createElement("div", { className: H(y.imageCommonPanelColumn, y.imageCommonPanelTitle) }, /* @__PURE__ */ M.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ M.createElement("div", { className: H(y.imageCommonPanelRow) }, /* @__PURE__ */ M.createElement("div", { className: H(y.imageCommonPanelColumn) })));
378
- }, Zn = () => {
379
- const e = N(L), n = e.getFocusDrawings(), [t, r] = te(n);
380
- return Pe(() => {
362
+ const d = (l) => l ? "block" : "none";
363
+ return /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelGrid, O.imageCommonPanelBorder), style: { display: d(u) } }, /* @__PURE__ */ C.createElement("div", { className: O.imageCommonPanelRow }, /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelColumn, O.imageCommonPanelTitle) }, /* @__PURE__ */ C.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelRow) }, /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelColumn) })));
364
+ }, Kn = () => {
365
+ const e = b(N), n = e.getFocusDrawings(), [t, r] = Z(n);
366
+ return Ie(() => {
381
367
  const i = e.focus$.subscribe((o) => {
382
368
  r(o);
383
369
  });
384
370
  return () => {
385
371
  i.unsubscribe();
386
372
  };
387
- }, []), !!(t != null && t.length) && /* @__PURE__ */ M.createElement("div", { className: y.imageCommonPanel }, /* @__PURE__ */ M.createElement(on, { drawings: t }), /* @__PURE__ */ M.createElement(zn, { drawings: t }));
388
- }, F = {
373
+ }, []), !!(t != null && t.length) && /* @__PURE__ */ C.createElement("div", { className: O.imageCommonPanel }, /* @__PURE__ */ C.createElement(Xe, { drawings: t }), /* @__PURE__ */ C.createElement(zn, { drawings: t }));
374
+ }, x = {
389
375
  id: "doc.command.move-drawing",
390
- type: C.COMMAND,
376
+ type: S.COMMAND,
391
377
  handler: (e, n) => {
392
- const t = e.get(_), r = e.get(P), { direction: i } = n, o = r.getFocusDrawings();
378
+ const t = e.get(I), r = e.get(M), { direction: i } = n, o = r.getFocusDrawings();
393
379
  if (o.length === 0)
394
380
  return !1;
395
- const a = o[0].unitId, s = o.map((d) => {
396
- const { transform: m } = d;
381
+ const a = o[0].unitId, s = o.map((u) => {
382
+ const { transform: m } = u;
397
383
  if (m == null)
398
384
  return null;
399
- const u = { ...m }, { left: l = 0, top: g = 0 } = m;
400
- return i === E.UP ? u.top = g - 1 : i === E.DOWN ? u.top = g + 1 : i === E.LEFT ? u.left = l - 1 : i === E.RIGHT && (u.left = l + 1), {
401
- ...d,
402
- transform: u,
403
- docTransform: we(u)
385
+ const d = { ...m }, { left: l = 0, top: g = 0 } = m;
386
+ return i === P.UP ? d.top = g - 1 : i === P.DOWN ? d.top = g + 1 : i === P.LEFT ? d.left = l - 1 : i === P.RIGHT && (d.left = l + 1), {
387
+ ...u,
388
+ transform: d,
389
+ docTransform: le(d)
404
390
  };
405
- }).filter((d) => d != null);
406
- return t.syncExecuteCommand(se.id, {
391
+ }).filter((u) => u != null);
392
+ return t.syncExecuteCommand(q.id, {
407
393
  unitId: a,
408
394
  drawings: s
409
- }) ? (t.syncExecuteCommand(S.id, [a]), !0) : !1;
395
+ }) ? (t.syncExecuteCommand(w.id, [a]), !0) : !1;
410
396
  }
411
- }, Le = {
397
+ }, ye = {
412
398
  id: "doc.command.delete-drawing",
413
- type: C.COMMAND,
399
+ type: S.COMMAND,
414
400
  handler: (e) => {
415
- const n = e.get(_), r = e.get(P).getFocusDrawings();
401
+ const n = e.get(I), r = e.get(M).getFocusDrawings();
416
402
  if (r.length === 0)
417
403
  return !1;
418
404
  const i = r[0].unitId, o = r.map((a) => {
419
- const { unitId: s, subUnitId: c, drawingId: d, drawingType: m } = a;
405
+ const { unitId: s, subUnitId: c, drawingId: u, drawingType: m } = a;
420
406
  return {
421
407
  unitId: s,
422
408
  subUnitId: c,
423
- drawingId: d,
409
+ drawingId: u,
424
410
  drawingType: m
425
411
  };
426
412
  });
427
- return n.executeCommand(ae.id, {
413
+ return n.executeCommand(X.id, {
428
414
  unitId: i,
429
415
  drawings: o
430
416
  });
431
417
  }
432
- }, Ge = {
418
+ }, be = {
433
419
  id: "doc.command.set-drawing-arrange",
434
- type: C.COMMAND,
420
+ type: S.COMMAND,
435
421
  handler: (e, n) => {
436
- const t = e.get(_), r = e.get(x);
422
+ const t = e.get(I), r = e.get(U);
437
423
  if (!n) return !1;
438
- const i = e.get(P), { unitId: o, subUnitId: a, drawingIds: s, arrangeType: c } = n, d = { unitId: o, subUnitId: a, drawingIds: s };
424
+ const i = e.get(M), { unitId: o, subUnitId: a, drawingIds: s, arrangeType: c } = n, u = { unitId: o, subUnitId: a, drawingIds: s };
439
425
  let m;
440
- if (c === B.forward ? m = i.getForwardDrawingsOp(d) : c === B.backward ? m = i.getBackwardDrawingOp(d) : c === B.front ? m = i.getFrontDrawingsOp(d) : c === B.back && (m = i.getBackDrawingsOp(d)), m == null)
426
+ if (c === L.forward ? m = i.getForwardDrawingsOp(u) : c === L.backward ? m = i.getBackwardDrawingOp(u) : c === L.front ? m = i.getFrontDrawingsOp(u) : c === L.back && (m = i.getBackDrawingsOp(u)), m == null)
441
427
  return !1;
442
- const { objects: u, redo: l, undo: g } = m;
443
- return t.syncExecuteCommand(h.id, { op: l, unitId: o, subUnitId: a, objects: u, type: I.ARRANGE }) ? (r.pushUndoRedo({
428
+ const { objects: d, redo: l, undo: g } = m;
429
+ return t.syncExecuteCommand(p.id, { op: l, unitId: o, subUnitId: a, objects: d, type: f.ARRANGE }) ? (r.pushUndoRedo({
444
430
  unitID: o,
445
431
  undoMutations: [
446
- { id: h.id, params: { op: g, unitId: o, subUnitId: a, objects: u, type: I.ARRANGE } }
432
+ { id: p.id, params: { op: g, unitId: o, subUnitId: a, objects: d, type: f.ARRANGE } }
447
433
  ],
448
434
  redoMutations: [
449
- { id: h.id, params: { op: l, unitId: o, subUnitId: a, objects: u, type: I.ARRANGE } }
435
+ { id: p.id, params: { op: l, unitId: o, subUnitId: a, objects: d, type: f.ARRANGE } }
450
436
  ]
451
437
  }), !0) : !1;
452
438
  }
453
439
  };
454
- function qn(e) {
440
+ function Zn(e) {
455
441
  const n = [];
456
442
  return e.forEach((t) => {
457
- const { parent: r, children: i } = t, { unitId: o, subUnitId: a, drawingId: s } = r, c = Qe(0, 0, i.map((u) => u.transform || {})), d = i.map((u) => {
458
- const l = u.transform || { left: 0, top: 0 }, { unitId: g, subUnitId: p, drawingId: f } = u;
443
+ const { parent: r, children: i } = t, { unitId: o, subUnitId: a, drawingId: s } = r, c = an(0, 0, i.map((d) => d.transform || {})), u = i.map((d) => {
444
+ const l = d.transform || { left: 0, top: 0 }, { unitId: g, subUnitId: h, drawingId: v } = d;
459
445
  return {
460
446
  unitId: g,
461
- subUnitId: p,
462
- drawingId: f,
447
+ subUnitId: h,
448
+ drawingId: v,
463
449
  transform: {
464
450
  ...l,
465
451
  left: l.left - c.left,
@@ -471,12 +457,12 @@ function qn(e) {
471
457
  unitId: o,
472
458
  subUnitId: a,
473
459
  drawingId: s,
474
- drawingType: oe.DRAWING_GROUP,
460
+ drawingType: Q.DRAWING_GROUP,
475
461
  transform: c
476
462
  };
477
463
  n.push({
478
464
  parent: m,
479
- children: d
465
+ children: u
480
466
  });
481
467
  }), n;
482
468
  }
@@ -486,20 +472,20 @@ function Yn(e) {
486
472
  const { parent: r, children: i } = t, { unitId: o, subUnitId: a, drawingId: s, transform: c = { width: 0, height: 0 } } = r;
487
473
  if (c == null)
488
474
  return;
489
- const d = i.map((u) => {
490
- const { transform: l } = u, { unitId: g, subUnitId: p, drawingId: f } = u, v = Xe(l || {}, c, c.width || 0, c.height || 0);
475
+ const u = i.map((d) => {
476
+ const { transform: l } = d, { unitId: g, subUnitId: h, drawingId: v } = d, xe = sn(l || {}, c, c.width || 0, c.height || 0);
491
477
  return {
492
478
  unitId: g,
493
- subUnitId: p,
494
- drawingId: f,
495
- transform: v,
479
+ subUnitId: h,
480
+ drawingId: v,
481
+ transform: xe,
496
482
  groupId: void 0
497
483
  };
498
484
  }), m = {
499
485
  unitId: o,
500
486
  subUnitId: a,
501
487
  drawingId: s,
502
- drawingType: oe.DRAWING_GROUP,
488
+ drawingType: Q.DRAWING_GROUP,
503
489
  transform: {
504
490
  left: 0,
505
491
  top: 0
@@ -507,177 +493,177 @@ function Yn(e) {
507
493
  };
508
494
  n.push({
509
495
  parent: m,
510
- children: d
496
+ children: u
511
497
  });
512
498
  }), n;
513
499
  }
514
- const je = {
500
+ const Re = {
515
501
  id: "doc.command.ungroup-doc-image",
516
- type: C.COMMAND,
502
+ type: S.COMMAND,
517
503
  handler: (e, n) => {
518
- const t = e.get(_), r = e.get(x), i = e.get(P);
504
+ const t = e.get(I), r = e.get(U), i = e.get(M);
519
505
  if (!n) return !1;
520
506
  const o = [];
521
- n.forEach(({ parent: g, children: p }) => {
522
- o.push(g.unitId), p.forEach((f) => {
523
- o.push(f.unitId);
507
+ n.forEach(({ parent: g, children: h }) => {
508
+ o.push(g.unitId), h.forEach((v) => {
509
+ o.push(v.unitId);
524
510
  });
525
511
  });
526
- const a = i.getUngroupDrawingOp(n), { unitId: s, subUnitId: c, undo: d, redo: m, objects: u } = a;
527
- return t.syncExecuteCommand(h.id, { op: m, unitId: s, subUnitId: c, objects: u, type: I.UNGROUP }) ? (r.pushUndoRedo({
512
+ const a = i.getUngroupDrawingOp(n), { unitId: s, subUnitId: c, undo: u, redo: m, objects: d } = a;
513
+ return t.syncExecuteCommand(p.id, { op: m, unitId: s, subUnitId: c, objects: d, type: f.UNGROUP }) ? (r.pushUndoRedo({
528
514
  unitID: s,
529
515
  undoMutations: [
530
- { id: h.id, params: { op: d, unitId: s, subUnitId: c, objects: qn(u), type: I.GROUP } },
531
- { id: S.id, params: o }
516
+ { id: p.id, params: { op: u, unitId: s, subUnitId: c, objects: Zn(d), type: f.GROUP } },
517
+ { id: w.id, params: o }
532
518
  ],
533
519
  redoMutations: [
534
- { id: h.id, params: { op: m, unitId: s, subUnitId: c, objects: u, type: I.UNGROUP } },
535
- { id: S.id, params: o }
520
+ { id: p.id, params: { op: m, unitId: s, subUnitId: c, objects: d, type: f.UNGROUP } },
521
+ { id: w.id, params: o }
536
522
  ]
537
523
  }), !0) : !1;
538
524
  }
539
- }, We = {
525
+ }, Ue = {
540
526
  id: "doc.command.group-doc-image",
541
- type: C.COMMAND,
527
+ type: S.COMMAND,
542
528
  handler: (e, n) => {
543
- const t = e.get(_), r = e.get(x), i = e.get(P);
529
+ const t = e.get(I), r = e.get(U), i = e.get(M);
544
530
  if (!n) return !1;
545
531
  const o = [];
546
- n.forEach(({ parent: g, children: p }) => {
547
- o.push(g.unitId), p.forEach((f) => {
548
- o.push(f.unitId);
532
+ n.forEach(({ parent: g, children: h }) => {
533
+ o.push(g.unitId), h.forEach((v) => {
534
+ o.push(v.unitId);
549
535
  });
550
536
  });
551
- const a = i.getGroupDrawingOp(n), { unitId: s, subUnitId: c, undo: d, redo: m, objects: u } = a;
552
- return t.syncExecuteCommand(h.id, { op: m, unitId: s, subUnitId: c, objects: u, type: I.GROUP }) ? (r.pushUndoRedo({
537
+ const a = i.getGroupDrawingOp(n), { unitId: s, subUnitId: c, undo: u, redo: m, objects: d } = a;
538
+ return t.syncExecuteCommand(p.id, { op: m, unitId: s, subUnitId: c, objects: d, type: f.GROUP }) ? (r.pushUndoRedo({
553
539
  unitID: s,
554
540
  undoMutations: [
555
- { id: h.id, params: { op: d, unitId: s, subUnitId: c, objects: Yn(u), type: I.UNGROUP } },
556
- { id: S.id, params: o }
541
+ { id: p.id, params: { op: u, unitId: s, subUnitId: c, objects: Yn(d), type: f.UNGROUP } },
542
+ { id: w.id, params: o }
557
543
  ],
558
544
  redoMutations: [
559
- { id: h.id, params: { op: m, unitId: s, subUnitId: c, objects: u, type: I.GROUP } },
560
- { id: S.id, params: o }
545
+ { id: p.id, params: { op: m, unitId: s, subUnitId: c, objects: d, type: f.GROUP } },
546
+ { id: w.id, params: o }
561
547
  ]
562
548
  }), !0) : !1;
563
549
  }
564
- }, Fe = {
550
+ }, Ne = {
565
551
  id: "doc.command.insert-doc-image",
566
- type: C.COMMAND,
552
+ type: S.COMMAND,
567
553
  handler: (e, n) => {
568
- const t = e.get(_), r = e.get(x), i = e.get(P);
554
+ const t = e.get(I), r = e.get(U), i = e.get(M);
569
555
  if (!n) return !1;
570
- const o = n.drawings, a = o.map((p) => p.unitId), s = i.getBatchAddOp(o), { unitId: c, subUnitId: d, undo: m, redo: u, objects: l } = s;
571
- return t.syncExecuteCommand(h.id, { op: u, unitId: c, subUnitId: d, objects: l, type: I.INSERT }) ? (r.pushUndoRedo({
556
+ const o = n.drawings, a = o.map((h) => h.unitId), s = i.getBatchAddOp(o), { unitId: c, subUnitId: u, undo: m, redo: d, objects: l } = s;
557
+ return t.syncExecuteCommand(p.id, { op: d, unitId: c, subUnitId: u, objects: l, type: f.INSERT }) ? (r.pushUndoRedo({
572
558
  unitID: c,
573
559
  undoMutations: [
574
- { id: h.id, params: { op: m, unitId: c, subUnitId: d, objects: l, type: I.REMOVE } },
575
- { id: S.id, params: a }
560
+ { id: p.id, params: { op: m, unitId: c, subUnitId: u, objects: l, type: f.REMOVE } },
561
+ { id: w.id, params: a }
576
562
  ],
577
563
  redoMutations: [
578
- { id: h.id, params: { op: u, unitId: c, subUnitId: d, objects: l, type: I.INSERT } },
579
- { id: S.id, params: a }
564
+ { id: p.id, params: { op: d, unitId: c, subUnitId: u, objects: l, type: f.INSERT } },
565
+ { id: w.id, params: a }
580
566
  ]
581
567
  }), !0) : !1;
582
568
  }
583
569
  };
584
- function V(e) {
585
- return !e.getContextValue(Ke) && e.getContextValue(Y);
570
+ function G(e) {
571
+ return !e.getContextValue($e) && e.getContextValue(V);
586
572
  }
587
- const Qn = {
588
- id: F.id,
573
+ const kn = {
574
+ id: x.id,
589
575
  description: "shortcut.doc.drawing-move-down",
590
576
  group: "4_doc-drawing-view",
591
- binding: A.ARROW_DOWN,
577
+ binding: R.ARROW_DOWN,
592
578
  priority: 100,
593
- preconditions: V,
579
+ preconditions: G,
594
580
  staticParameters: {
595
- direction: E.DOWN
581
+ direction: P.DOWN
596
582
  }
597
- }, Xn = {
598
- id: F.id,
583
+ }, Qn = {
584
+ id: x.id,
599
585
  description: "shortcut.doc.drawing-move-up",
600
586
  group: "4_doc-drawing-view",
601
- binding: A.ARROW_UP,
587
+ binding: R.ARROW_UP,
602
588
  priority: 100,
603
- preconditions: V,
589
+ preconditions: G,
604
590
  staticParameters: {
605
- direction: E.UP
591
+ direction: P.UP
606
592
  }
607
- }, Jn = {
608
- id: F.id,
593
+ }, Xn = {
594
+ id: x.id,
609
595
  description: "shortcut.doc.drawing-move-left",
610
596
  group: "4_doc-drawing-view",
611
- binding: A.ARROW_LEFT,
597
+ binding: R.ARROW_LEFT,
612
598
  priority: 100,
613
- preconditions: V,
599
+ preconditions: G,
614
600
  staticParameters: {
615
- direction: E.LEFT
601
+ direction: P.LEFT
616
602
  }
617
- }, et = {
618
- id: F.id,
603
+ }, qn = {
604
+ id: x.id,
619
605
  description: "shortcut.doc.drawing-move-right",
620
606
  group: "4_doc-drawing-view",
621
- binding: A.ARROW_RIGHT,
607
+ binding: R.ARROW_RIGHT,
622
608
  priority: 100,
623
- preconditions: V,
609
+ preconditions: G,
624
610
  staticParameters: {
625
- direction: E.RIGHT
611
+ direction: P.RIGHT
626
612
  }
627
- }, nt = {
628
- id: Le.id,
613
+ }, Jn = {
614
+ id: ye.id,
629
615
  description: "shortcut.doc.drawing-delete",
630
616
  group: "4_doc-drawing-view",
631
617
  // when focusing on any other input tag do not trigger this shortcut
632
- preconditions: V,
633
- binding: A.DELETE,
634
- mac: A.BACKSPACE
618
+ preconditions: G,
619
+ binding: R.DELETE,
620
+ mac: R.BACKSPACE
635
621
  };
636
- var tt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, it = (e, n, t, r) => {
637
- for (var i = r > 1 ? void 0 : r ? rt(n, t) : n, o = e.length - 1, a; o >= 0; o--)
622
+ var et = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, tt = (e, n, t, r) => {
623
+ for (var i = r > 1 ? void 0 : r ? nt(n, t) : n, o = e.length - 1, a; o >= 0; o--)
638
624
  (a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
639
- return r && i && tt(n, t, i), i;
640
- }, W = (e, n) => (t, r) => n(t, r, e);
641
- let Z = class extends ve {
625
+ return r && i && et(n, t, i), i;
626
+ }, T = (e, n) => (t, r) => n(t, r, e);
627
+ let $ = class extends ue {
642
628
  constructor(e, n, t, r, i) {
643
629
  super(), this._injector = e, this._componentManager = n, this._menuService = t, this._commandService = r, this._shortcutService = i, this._init();
644
630
  }
645
631
  _initCustomComponents() {
646
632
  const e = this._componentManager;
647
- this.disposeWithMe(e.register(Ae, Te)), this.disposeWithMe(e.register(Ne, Rn)), this.disposeWithMe(e.register(ye, Zn));
633
+ this.disposeWithMe(e.register(Pe, Me)), this.disposeWithMe(e.register(Oe, yn)), this.disposeWithMe(e.register(_e, Kn));
648
634
  }
649
635
  _initMenus() {
650
636
  [
651
- Un,
652
- Tn
637
+ bn,
638
+ Rn
653
639
  ].forEach((e) => {
654
640
  this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(e), {}));
655
641
  });
656
642
  }
657
643
  _initCommands() {
658
644
  [
659
- J,
660
- Fe,
661
- ae,
662
- se,
663
- Ee,
664
- S,
665
- be,
666
- We,
667
- je,
668
- F,
669
- Le,
670
- Ge
645
+ z,
646
+ Ne,
647
+ X,
648
+ q,
649
+ we,
650
+ w,
651
+ Se,
652
+ Ue,
653
+ Re,
654
+ x,
655
+ ye,
656
+ be
671
657
  ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
672
658
  }
673
659
  _initShortcuts() {
674
660
  [
675
661
  // sheet drawing shortcuts
662
+ kn,
676
663
  Qn,
677
664
  Xn,
678
- Jn,
679
- et,
680
- nt
665
+ qn,
666
+ Jn
681
667
  ].forEach((e) => {
682
668
  this.disposeWithMe(this._shortcutService.registerShortcut(e));
683
669
  });
@@ -686,117 +672,96 @@ let Z = class extends ve {
686
672
  this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
687
673
  }
688
674
  };
689
- Z = it([
690
- re(ie.Ready, Z),
691
- W(0, b(_e)),
692
- W(1, b(pn)),
693
- W(2, fn),
694
- W(3, _),
695
- W(4, hn)
696
- ], Z);
697
- var ot = Object.defineProperty, at = Object.getOwnPropertyDescriptor, st = (e, n, t, r) => {
698
- for (var i = r > 1 ? void 0 : r ? at(n, t) : n, o = e.length - 1, a; o >= 0; o--)
675
+ $ = tt([
676
+ se(ce.Ready, $),
677
+ T(0, y(me)),
678
+ T(1, y(ln)),
679
+ T(2, gn),
680
+ T(3, I),
681
+ T(4, pn)
682
+ ], $);
683
+ var rt = Object.defineProperty, it = Object.getOwnPropertyDescriptor, ot = (e, n, t, r) => {
684
+ for (var i = r > 1 ? void 0 : r ? it(n, t) : n, o = e.length - 1, a; o >= 0; o--)
699
685
  (a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
700
- return r && i && ot(n, t, i), i;
686
+ return r && i && rt(n, t, i), i;
701
687
  }, D = (e, n) => (t, r) => n(t, r, e);
702
- let q = class extends ve {
703
- constructor(e, n, t, r, i, o, a, s, c, d, m) {
704
- super(), this._commandService = e, this._univerInstanceService = n, this._textSelectionManagerService = t, this._imageIoService = r, this._sheetDrawingService = i, this._drawingManagerService = o, this._contextService = a, this._messageService = s, this._localeService = c, this._docSkeletonManagerService = d, this._renderManagerService = m, this._init();
705
- }
706
- _init() {
707
- this._initCommandListeners(), this._updateDrawingListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
688
+ let Y = class extends ue {
689
+ constructor(e, n, t, r, i, o, a, s, c, u) {
690
+ super(), this._context = e, this._commandService = n, this._textSelectionManagerService = t, this._docSkeletonManagerService = r, this._sheetDrawingService = i, this._imageIoService = o, this._drawingManagerService = a, this._contextService = s, this._messageService = c, this._localeService = u, this._initCommandListeners(), this._updateDrawingListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
708
691
  }
709
692
  /**
710
693
  * Upload image to cell or float image
711
694
  */
712
695
  _initCommandListeners() {
713
- this.disposeWithMe(
714
- this._commandService.onCommandExecuted(async (e) => {
715
- if (e.id === J.id) {
716
- const n = e.params;
717
- if (n.files == null)
718
- return;
719
- const t = n.files.length;
720
- if (t > ue) {
721
- this._messageService.show({
722
- type: k.Error,
723
- content: this._localeService.t("update-status.exceedMaxCount", String(ue))
724
- });
725
- return;
726
- }
727
- this._imageIoService.setWaitCount(t), n.files.forEach(async (r) => {
728
- await this._insertFloatImage(r);
696
+ this.disposeWithMe(this._commandService.onCommandExecuted(async (e) => {
697
+ if (e.id === z.id) {
698
+ const n = e.params;
699
+ if (n.files == null)
700
+ return;
701
+ const t = n.files.length;
702
+ if (t > ee) {
703
+ this._messageService.show({
704
+ type: W.Error,
705
+ content: this._localeService.t("update-status.exceedMaxCount", String(ee))
729
706
  });
707
+ return;
730
708
  }
731
- })
732
- );
709
+ this._imageIoService.setWaitCount(t), n.files.forEach(async (r) => {
710
+ await this._insertFloatImage(r);
711
+ });
712
+ }
713
+ }));
733
714
  }
734
715
  async _insertFloatImage(e) {
735
- var U;
716
+ var g;
736
717
  let n;
737
718
  try {
738
719
  n = await this._imageIoService.saveImage(e);
739
- } catch (G) {
740
- const T = G.message;
741
- T === ne.ERROR_EXCEED_SIZE ? this._messageService.show({
742
- type: k.Error,
743
- content: this._localeService.t("update-status.exceedMaxSize", String(cn / (1024 * 1024)))
744
- }) : T === ne.ERROR_IMAGE_TYPE ? this._messageService.show({
745
- type: k.Error,
720
+ } catch (h) {
721
+ const v = h.message;
722
+ v === K.ERROR_EXCEED_SIZE ? this._messageService.show({
723
+ type: W.Error,
724
+ content: this._localeService.t("update-status.exceedMaxSize", String(en / (1024 * 1024)))
725
+ }) : v === K.ERROR_IMAGE_TYPE ? this._messageService.show({
726
+ type: W.Error,
746
727
  content: this._localeService.t("update-status.invalidImageType")
747
- }) : T === ne.ERROR_IMAGE && this._messageService.show({
748
- type: k.Error,
728
+ }) : v === K.ERROR_IMAGE && this._messageService.show({
729
+ type: W.Error,
749
730
  content: this._localeService.t("update-status.invalidImage")
750
731
  });
751
732
  }
752
733
  if (n == null)
753
734
  return;
754
- const t = this._getUnitInfo();
755
- if (t == null)
756
- return;
757
- const { unitId: r, subUnitId: i } = t, { imageId: o, imageSourceType: a, source: s, base64Cache: c } = n, { width: d, height: m, image: u } = await dn(c || ""), l = this._renderManagerService.getRenderById(r);
758
- if (l == null)
759
- return;
760
- const { width: g, height: p } = l.scene;
761
- this._imageIoService.addImageSourceCache(o, a, u);
762
- let f = 1;
763
- if (d > me || m > le) {
764
- const G = me / d, T = le / m;
765
- f = Math.max(G, T);
735
+ const { unitId: t } = this._context, { imageId: r, imageSourceType: i, source: o, base64Cache: a } = n, { width: s, height: c, image: u } = await nn(a || "");
736
+ this._imageIoService.addImageSourceCache(r, i, u);
737
+ let m = 1;
738
+ if (s > ne || c > te) {
739
+ const h = ne / s, v = te / c;
740
+ m = Math.max(h, v);
766
741
  }
767
- const v = this._getImagePosition(d * f, m * f, g, p);
768
- if (v == null)
742
+ const d = this._getImagePosition(s * m, c * m);
743
+ if (d == null)
769
744
  return;
770
- const O = {
771
- unitId: r,
772
- subUnitId: i,
773
- drawingId: o,
774
- drawingType: oe.DRAWING_IMAGE,
775
- imageSourceType: a,
776
- source: s,
777
- transform: de(v),
778
- docTransform: v,
745
+ const l = {
746
+ unitId: t,
747
+ subUnitId: t,
748
+ drawingId: r,
749
+ drawingType: Q.DRAWING_IMAGE,
750
+ imageSourceType: i,
751
+ source: o,
752
+ transform: ie(d),
753
+ docTransform: d,
779
754
  title: "",
780
755
  description: "",
781
- layoutType: ze.WRAP_SQUARE
782
- };
783
- this._commandService.executeCommand(Fe.id, {
784
- unitId: r,
785
- drawings: [O]
786
- }), (U = this._docSkeletonManagerService.getCurrent()) == null || U.skeleton.calculate();
787
- }
788
- _getUnitInfo() {
789
- const e = this._univerInstanceService.getCurrentUnitForType(R.UNIVER_DOC);
790
- if (e == null)
791
- return;
792
- const n = e.getUnitId();
793
- return {
794
- unitId: n,
795
- subUnitId: n
756
+ layoutType: Ve.WRAP_SQUARE
796
757
  };
758
+ this._commandService.executeCommand(Ne.id, {
759
+ unitId: t,
760
+ drawings: [l]
761
+ }), (g = this._docSkeletonManagerService.getSkeleton()) == null || g.calculate();
797
762
  }
798
- _getImagePosition(e, n, t, r) {
799
- const i = this._textSelectionManagerService.getActiveTextRange(), o = (i == null ? void 0 : i.getAbsolutePosition()) || {
763
+ _getImagePosition(e, n) {
764
+ const t = this._textSelectionManagerService.getActiveTextRange(), r = (t == null ? void 0 : t.getAbsolutePosition()) || {
800
765
  left: 0,
801
766
  top: 0
802
767
  };
@@ -806,12 +771,12 @@ let q = class extends ve {
806
771
  height: n
807
772
  },
808
773
  positionH: {
809
- relativeFrom: Ze.MARGIN,
810
- posOffset: o.left
774
+ relativeFrom: Be.MARGIN,
775
+ posOffset: r.left
811
776
  },
812
777
  positionV: {
813
- relativeFrom: qe.PAGE,
814
- posOffset: o.top
778
+ relativeFrom: He.PAGE,
779
+ posOffset: r.top
815
780
  },
816
781
  angle: 0
817
782
  };
@@ -819,7 +784,7 @@ let q = class extends ve {
819
784
  _updateOrderListener() {
820
785
  this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
821
786
  const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: i } = e;
822
- this._commandService.executeCommand(Ge.id, {
787
+ this._commandService.executeCommand(be.id, {
823
788
  unitId: n,
824
789
  subUnitId: t,
825
790
  drawingIds: r,
@@ -829,124 +794,105 @@ let q = class extends ve {
829
794
  }
830
795
  _updateDrawingListener() {
831
796
  this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
797
+ if (e.length === 0)
798
+ return;
832
799
  const n = [];
833
- e.length !== 0 && (e.forEach((t) => {
834
- const { unitId: r, subUnitId: i, drawingId: o, drawingType: a, transform: s } = t;
800
+ if (e.forEach((t) => {
801
+ const { unitId: r, subUnitId: i, drawingId: o, transform: a } = t;
802
+ if (a == null)
803
+ return;
804
+ const s = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: i, drawingId: o });
835
805
  if (s == null)
836
806
  return;
837
- const c = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: i, drawingId: o });
807
+ const c = le({ ...s.transform, ...a });
838
808
  if (c == null)
839
809
  return;
840
- const d = we({ ...c.transform, ...s });
841
- if (d == null)
842
- return;
843
- const m = {
810
+ const u = {
844
811
  ...t,
845
- transform: { ...s, ...de(d) },
846
- docTransform: { ...d }
812
+ transform: { ...a, ...ie(c) },
813
+ docTransform: { ...c }
847
814
  };
848
- n.push(m);
849
- }), n.length > 0 && (this._commandService.syncExecuteCommand(se.id, {
850
- unitId: e[0].unitId,
851
- drawings: n
852
- }), this._refreshDocSkeleton()));
815
+ n.push(u);
816
+ }), n.length > 0) {
817
+ const t = e[0].unitId;
818
+ this._commandService.syncExecuteCommand(q.id, {
819
+ unitId: t,
820
+ drawings: n
821
+ }), this._refreshDocSkeleton();
822
+ }
853
823
  });
854
824
  }
855
- _getDocsOffsetInfo() {
856
- const e = this._docSkeletonManagerService.getCurrent();
857
- if (e == null)
858
- return {
859
- pageMarginCache: /* @__PURE__ */ new Map(),
860
- docsLeft: 0,
861
- docsTop: 0
862
- };
863
- const { unitId: n, skeleton: t } = e, r = this._renderManagerService.getRenderById(n), i = t == null ? void 0 : t.getSkeletonData();
864
- if (r == null || !i)
865
- return {
866
- pageMarginCache: /* @__PURE__ */ new Map(),
867
- docsLeft: 0,
868
- docsTop: 0
869
- };
870
- const { mainComponent: o } = r, a = o, { left: s, top: c, pageLayoutType: d, pageMarginLeft: m, pageMarginTop: u } = a, { pages: l } = i, g = new Je(), p = /* @__PURE__ */ new Map();
871
- for (let f = 0, v = l.length; f < v; f++) {
872
- const O = l[f], { skeDrawings: U, marginLeft: G, marginTop: T } = O;
873
- g.translatePagePadding(O), U.forEach((Ve) => {
874
- const { aLeft: lt, aTop: gt, height: pt, width: ft, drawingId: $e, drawingOrigin: ht } = Ve;
875
- p.set($e, {
876
- marginLeft: g.x,
877
- marginTop: g.y
878
- });
879
- }), g.restorePagePadding(O), g.translatePage(O, d, m, u);
880
- }
881
- return { pageMarginCache: p, docsLeft: s, docsTop: c };
882
- }
883
825
  _refreshDocSkeleton() {
884
- const e = this._docSkeletonManagerService.getCurrent();
885
- if (e == null)
886
- return;
887
- const { unitId: n, skeleton: t } = e, r = this._renderManagerService.getRenderById(n);
888
- if (r == null)
889
- return;
890
- const { mainComponent: i } = r;
891
- t == null || t.calculate(), i == null || i.makeDirty();
826
+ const e = this._docSkeletonManagerService.getSkeleton(), { mainComponent: n } = this._context;
827
+ e == null || e.calculate(), n == null || n.makeDirty();
892
828
  }
893
829
  _groupDrawingListener() {
894
830
  this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
895
- this._commandService.executeCommand(We.id, e);
831
+ this._commandService.executeCommand(Ue.id, e);
896
832
  }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
897
- this._commandService.executeCommand(je.id, e);
833
+ this._commandService.executeCommand(Re.id, e);
898
834
  });
899
835
  }
900
836
  _focusDrawingListener() {
901
837
  this.disposeWithMe(
902
838
  this._drawingManagerService.focus$.subscribe((e) => {
903
- e == null || e.length === 0 ? (this._contextService.setContextValue(Y, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(Y, !0), this._sheetDrawingService.focusDrawing(e));
839
+ e == null || e.length === 0 ? (this._contextService.setContextValue(V, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(V, !0), this._sheetDrawingService.focusDrawing(e));
904
840
  })
905
841
  );
906
842
  }
907
843
  };
908
- q = st([
909
- re(ie.Rendered, q),
910
- D(0, _),
911
- D(1, he),
912
- D(2, b(vn)),
913
- D(3, un),
914
- D(4, P),
915
- D(5, L),
916
- D(6, Ie),
917
- D(7, In),
918
- D(8, b(Q)),
919
- D(9, b(_n)),
920
- D(10, X)
921
- ], q);
922
- var ct = Object.defineProperty, dt = Object.getOwnPropertyDescriptor, ut = (e, n, t, r) => {
923
- for (var i = r > 1 ? void 0 : r ? dt(n, t) : n, o = e.length - 1, a; o >= 0; o--)
844
+ Y = ot([
845
+ D(1, I),
846
+ D(2, y(hn)),
847
+ D(3, y(vn)),
848
+ D(4, M),
849
+ D(5, tn),
850
+ D(6, N),
851
+ D(7, de),
852
+ D(8, fn),
853
+ D(9, y(k))
854
+ ], Y);
855
+ var Ae = Object.defineProperty, at = Object.getOwnPropertyDescriptor, st = (e, n, t) => n in e ? Ae(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, ct = (e, n, t, r) => {
856
+ for (var i = r > 1 ? void 0 : r ? at(n, t) : n, o = e.length - 1, a; o >= 0; o--)
924
857
  (a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
925
- return r && i && ct(n, t, i), i;
926
- }, pe = (e, n) => (t, r) => n(t, r, e);
927
- const mt = "Docs_Drawing_UI_PLUGIN";
928
- var K;
929
- let fe = (K = class extends Ye {
858
+ return r && i && Ae(n, t, i), i;
859
+ }, ae = (e, n) => (t, r) => n(t, r, e), Te = (e, n, t) => st(e, typeof n != "symbol" ? n + "" : n, t);
860
+ const dt = "DOCS_DRAWING_UI_PLUGIN";
861
+ let B = class extends ze {
930
862
  constructor(e, n, t) {
931
- super(), this._injector = n, this._localeService = t;
863
+ super(), this._injector = n, this._renderManagerSrv = t;
932
864
  }
933
865
  onStarting(e) {
934
- this._initDependencies(e);
935
- }
936
- _initDependencies(e) {
937
866
  [
938
- // services
939
- // controllers
940
- [Z],
941
- [q],
942
- [z]
867
+ [$],
868
+ [F]
943
869
  ].forEach((t) => e.add(t));
944
870
  }
945
- }, $(K, "type", R.UNIVER_DOC), $(K, "pluginName", mt), K);
946
- fe = ut([
947
- pe(1, b(_e)),
948
- pe(2, b(Q))
949
- ], fe);
871
+ onReady() {
872
+ [
873
+ Y
874
+ ].forEach((e) => this._renderManagerSrv.registerRenderModule(E.UNIVER_DOC, e));
875
+ }
876
+ };
877
+ Te(B, "type", E.UNIVER_DOC);
878
+ Te(B, "pluginName", dt);
879
+ B = ct([
880
+ Ke(qe, rn, on),
881
+ ae(1, y(me)),
882
+ ae(2, H)
883
+ ], B);
950
884
  export {
951
- fe as UniverDocsDrawingUIPlugin
885
+ w as ClearDocDrawingTransformerOperation,
886
+ ye as DeleteDocDrawingsCommand,
887
+ Se as EditDocDrawingOperation,
888
+ Ue as GroupDocDrawingCommand,
889
+ Ne as InsertDocDrawingCommand,
890
+ z as InsertDocImageOperation,
891
+ x as MoveDocDrawingsCommand,
892
+ X as RemoveDocDrawingCommand,
893
+ be as SetDocDrawingArrangeCommand,
894
+ q as SetDocDrawingCommand,
895
+ we as SidebarDocDrawingOperation,
896
+ Re as UngroupDocDrawingCommand,
897
+ B as UniverDocsDrawingUIPlugin
952
898
  };