@univerjs/docs-drawing-ui 0.6.1 → 0.6.2

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 Ct = Object.defineProperty;
2
2
  var Dt = (i, e, n) => e in i ? Ct(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
3
3
  var Ce = (i, e, n) => Dt(i, typeof e != "symbol" ? e + "" : e, n);
4
- import { Disposable as Xe, UndoCommand as Ot, RedoCommand as Tt, JSONX as q, IUniverInstanceService as Q, ICommandService as z, PositionedObjectLayoutType as H, CommandType as K, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as Pe, TextX as vn, TextXActionType as Z, toDisposable as Le, throttle as On, COLORS as yt, MemoryCursor as Pt, IUndoRedoService as Gn, BuildTextUtils as bt, ArrangeTypeEnum as Ze, Inject as ve, IContextService as Vn, LocaleService as ln, WrapTextType as $e, DrawingTypeEnum as Mt, FOCUSING_COMMON_DRAWINGS as tn, UniverInstanceType as be, Direction as fe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as Rt, RxDisposable as Nt, SHEET_EDITOR_UNITS as At, LifecycleService as Et, DOCS_ZEN_EDITOR_UNIT_ID_KEY as xt, fromEventSubject as Lt, LifecycleStages as Tn, DependentOn as Bt, Injector as Ut, IConfigService as kt, Plugin as Ft, merge as Ht } from "@univerjs/core";
5
- import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Wt } from "@univerjs/docs-drawing";
6
- import { IDrawingManagerService as Ie, IImageIoService as Gt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as yn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as jt, getImageSize as $t, getDrawingShapeKeyByDrawingSearch as zt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, UniverDrawingPlugin as qt } from "@univerjs/drawing";
7
- import { DrawingCommonPanel as Xt, ImageCropperObject as Kt, COMPONENT_IMAGE_POPUP_MENU as Yt, OpenImageCropOperation as Zt, ImageResetSizeOperation as Qt, UniverDrawingUIPlugin as Jt } from "@univerjs/drawing-ui";
8
- import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ei, Rect as ni, getColor as ti, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ii } from "@univerjs/engine-render";
9
- import { IMessageService as ri, ILocalFileService as oi, ISidebarService as si, useDependency as we, getMenuHiddenObservable as $n, MenuItemType as zn, RibbonStartGroup as ai, KeyCode as He, ComponentManager as ci, IMenuManagerService as di, IShortcutService as li, UniverUIPlugin as gi } from "@univerjs/ui";
10
- import { RichTextEditingMutation as J, DocSkeletonManagerService as se, DocSelectionManagerService as In } from "@univerjs/docs";
11
- import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as An, getAnchorBounding as mi, TEXT_RANGE_LAYER_INDEX as ui, getDocObject as fi, getCustomBlockIdsInSelections as hi, docDrawingPositionToTransform as pi, DocCanvasPopManagerService as wi, IEditorService as vi, SetDocZoomRatioOperation as Ii } from "@univerjs/docs-ui";
12
- import { BehaviorSubject as _i, debounceTime as qn, Observable as Si, takeUntil as En, filter as xn } from "rxjs";
13
- import { MessageType as Ln, InputNumber as ke, Select as Bn, Checkbox as Ci, RadioGroup as Un, Radio as ye } from "@univerjs/design";
4
+ import { Disposable as Xe, UndoCommand as Ot, RedoCommand as Tt, JSONX as q, IUniverInstanceService as K, ICommandService as z, PositionedObjectLayoutType as H, CommandType as Y, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as ye, TextX as vn, TextXActionType as Q, toDisposable as Le, throttle as Tn, COLORS as Pt, MemoryCursor as yt, IUndoRedoService as Vn, BuildTextUtils as bt, ArrangeTypeEnum as Ze, Inject as ve, IContextService as jn, LocaleService as ln, WrapTextType as $e, DrawingTypeEnum as Mt, FOCUSING_COMMON_DRAWINGS as tn, UniverInstanceType as be, Direction as fe, DocumentFlavor as fn, DOCS_ZEN_EDITOR_UNIT_ID_KEY as In, FOCUSING_UNIVER_EDITOR as Rt, RxDisposable as Nt, SHEET_EDITOR_UNITS as Et, LifecycleService as At, fromEventSubject as xt, LifecycleStages as Pn, DependentOn as Lt, Injector as Bt, IConfigService as Ut, Plugin as kt, merge as Ft } from "@univerjs/core";
5
+ import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Ht } from "@univerjs/docs-drawing";
6
+ import { IDrawingManagerService as Ie, IImageIoService as Wt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Gt, DRAWING_IMAGE_COUNT_LIMIT as yn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as Vt, getImageSize as jt, getDrawingShapeKeyByDrawingSearch as $t, DRAWING_IMAGE_WIDTH_LIMIT as bn, DRAWING_IMAGE_HEIGHT_LIMIT as Mn, UniverDrawingPlugin as zt } from "@univerjs/drawing";
7
+ import { DrawingCommonPanel as qt, ImageCropperObject as Xt, COMPONENT_IMAGE_POPUP_MENU as Kt, OpenImageCropOperation as Yt, ImageResetSizeOperation as Zt, UniverDrawingUIPlugin as Qt } from "@univerjs/drawing-ui";
8
+ import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as $n, PageLayoutType as Rn, DocumentSkeletonPageType as Nn, Vector2 as Jt, Rect as ei, getColor as ni, getCurrentTypeOfRenderer as ti, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ii } from "@univerjs/engine-render";
9
+ import { IMessageService as ri, ILocalFileService as oi, ISidebarService as si, useDependency as we, getMenuHiddenObservable as zn, MenuItemType as qn, RibbonStartGroup as ai, KeyCode as He, ComponentManager as ci, IMenuManagerService as di, IShortcutService as li, UniverUIPlugin as gi } from "@univerjs/ui";
10
+ import { RichTextEditingMutation as J, DocSkeletonManagerService as se, DocSelectionManagerService as _n } from "@univerjs/docs";
11
+ import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as En, getOneTextSelectionRange as An, getAnchorBounding as mi, TEXT_RANGE_LAYER_INDEX as ui, getDocObject as fi, getCustomBlockIdsInSelections as hi, docDrawingPositionToTransform as pi, DocCanvasPopManagerService as wi, IEditorService as vi, SetDocZoomRatioOperation as Ii } from "@univerjs/docs-ui";
12
+ import { BehaviorSubject as _i, debounceTime as Xn, Observable as Si, takeUntil as xn, filter as Ln } from "rxjs";
13
+ import { MessageType as Bn, clsx as j, InputNumber as ke, Select as Un, Checkbox as Ci, RadioGroup as kn, Radio as Pe } from "@univerjs/design";
14
14
  import { jsxs as X, jsx as f } from "react/jsx-runtime";
15
- import { forwardRef as Xn, useRef as Di, createElement as Kn, useState as re, useEffect as _n } from "react";
16
- const Oi = "docs-drawing-ui.config", kn = {};
17
- var Ti = Object.getOwnPropertyDescriptor, yi = (i, e, n, t) => {
15
+ import { forwardRef as Kn, useRef as Di, createElement as Yn, useState as re, useEffect as Sn } from "react";
16
+ const Oi = "docs-drawing-ui.config", Fn = {};
17
+ var Ti = Object.getOwnPropertyDescriptor, Pi = (i, e, n, t) => {
18
18
  for (var r = t > 1 ? void 0 : t ? Ti(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
  }, Ve = (i, e) => (n, t) => e(n, t, i);
22
- function Pi(i) {
22
+ function yi(i) {
23
23
  var t, r, o, s;
24
24
  if (q.isNoop(i) || !Array.isArray(i))
25
25
  return null;
@@ -69,7 +69,7 @@ let rn = class extends Xe {
69
69
  this._commandService.beforeCommandExecuted((i) => {
70
70
  if (i.id !== J.id)
71
71
  return;
72
- const e = i.params, { unitId: n, actions: t } = e, r = Pi(t);
72
+ const e = i.params, { unitId: n, actions: t } = e, r = yi(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]);
@@ -125,8 +125,8 @@ let rn = class extends Xe {
125
125
  t.orderNotification(o), r.orderNotification(o);
126
126
  }
127
127
  };
128
- rn = yi([
129
- Ve(0, Q),
128
+ rn = Pi([
129
+ Ve(0, K),
130
130
  Ve(1, z),
131
131
  Ve(2, Ie),
132
132
  Ve(3, Be),
@@ -149,7 +149,7 @@ const Mi = {
149
149
  inFrontOfText: H.WRAP_NONE,
150
150
  behindText: H.WRAP_NONE
151
151
  };
152
- function Yn(i, e, n, t, r, o, s) {
152
+ function Zn(i, e, n, t, r, o, s) {
153
153
  var p, h;
154
154
  const a = new vn(), d = q.getInstance(), c = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
155
155
  if (l == null || m == null)
@@ -158,10 +158,10 @@ function Yn(i, e, n, t, r, o, s) {
158
158
  if (g != null) {
159
159
  if (t = Math.min(m.dataStream.length - 2, t), i === e) {
160
160
  if (t < g ? (t > 0 && a.push({
161
- t: Z.RETAIN,
161
+ t: Q.RETAIN,
162
162
  len: t
163
163
  }), a.push({
164
- t: Z.INSERT,
164
+ t: Q.INSERT,
165
165
  body: {
166
166
  dataStream: "\b",
167
167
  customBlocks: [{
@@ -171,22 +171,22 @@ function Yn(i, e, n, t, r, o, s) {
171
171
  },
172
172
  len: 1
173
173
  }), a.push({
174
- t: Z.RETAIN,
174
+ t: Q.RETAIN,
175
175
  len: g - t
176
176
  }), a.push({
177
- t: Z.DELETE,
177
+ t: Q.DELETE,
178
178
  len: 1
179
179
  })) : (g > 0 && a.push({
180
- t: Z.RETAIN,
180
+ t: Q.RETAIN,
181
181
  len: g
182
182
  }), a.push({
183
- t: Z.DELETE,
183
+ t: Q.DELETE,
184
184
  len: 1
185
185
  }), t - g - 1 > 0 && a.push({
186
- t: Z.RETAIN,
186
+ t: Q.RETAIN,
187
187
  len: t - g - 1
188
188
  }), a.push({
189
- t: Z.INSERT,
189
+ t: Q.INSERT,
190
190
  body: {
191
191
  dataStream: "\b",
192
192
  customBlocks: [{
@@ -201,18 +201,18 @@ function Yn(i, e, n, t, r, o, s) {
201
201
  }
202
202
  } else {
203
203
  g > 0 && a.push({
204
- t: Z.RETAIN,
204
+ t: Q.RETAIN,
205
205
  len: g
206
206
  }), a.push({
207
- t: Z.DELETE,
207
+ t: Q.DELETE,
208
208
  len: 1
209
209
  });
210
210
  let v = ze(o, e), w = d.editOp(a.serialize(), v);
211
211
  c.push(w), a.empty(), t > 0 && a.push({
212
- t: Z.RETAIN,
212
+ t: Q.RETAIN,
213
213
  len: t
214
214
  }), a.push({
215
- t: Z.INSERT,
215
+ t: Q.INSERT,
216
216
  body: {
217
217
  dataStream: "\b",
218
218
  customBlocks: [{
@@ -226,15 +226,15 @@ function Yn(i, e, n, t, r, o, s) {
226
226
  return c;
227
227
  }
228
228
  }
229
- const Zn = {
229
+ const Qn = {
230
230
  id: "doc.command.update-doc-drawing-wrapping-style",
231
- type: K.COMMAND,
231
+ type: Y.COMMAND,
232
232
  // eslint-disable-next-line max-lines-per-function, complexity
233
233
  handler: (i, e) => {
234
- var A, U;
234
+ var E, U;
235
235
  if (e == null)
236
236
  return !1;
237
- const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(Q), d = i.get(ee).getRenderById(r), c = d == null ? void 0 : d.with(se).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(se).getViewModel(), m = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
237
+ const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(K), d = i.get(ee).getRenderById(r), c = d == null ? void 0 : d.with(se).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(se).getViewModel(), m = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
238
238
  if (g == null || c == null || m == null || l == null)
239
239
  return !1;
240
240
  const p = l.getEditArea(), h = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = c, O = q.getInstance(), D = [], { drawings: T = {} } = g.getSnapshot();
@@ -247,23 +247,23 @@ const Zn = {
247
247
  if (t === "behindText" || t === "inFrontOfText") {
248
248
  const C = T[I].behindDoc, R = t === "behindText" ? oe.TRUE : oe.FALSE;
249
249
  if (C !== R) {
250
- const y = O.replaceOp(["drawings", I, "behindDoc"], C, R);
251
- D.push(y);
250
+ const P = O.replaceOp(["drawings", I, "behindDoc"], C, R);
251
+ D.push(P);
252
252
  }
253
253
  }
254
254
  if (t === "inline")
255
255
  continue;
256
256
  let x = null, G = 0, _ = 0;
257
257
  for (const C of v) {
258
- const { headerId: R, footerId: y, marginTop: B, marginLeft: k, marginBottom: b, pageWidth: E, pageHeight: $ } = C;
258
+ const { headerId: R, footerId: P, marginTop: B, marginLeft: k, marginBottom: b, pageWidth: A, pageHeight: $ } = C;
259
259
  switch (p) {
260
260
  case Fe.HEADER: {
261
- const F = (A = w.get(R)) == null ? void 0 : A.get(E);
261
+ const F = (E = w.get(R)) == null ? void 0 : E.get(A);
262
262
  F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = F.marginTop, _ = k);
263
263
  break;
264
264
  }
265
265
  case Fe.FOOTER: {
266
- const F = (U = S.get(y)) == null ? void 0 : U.get(E);
266
+ const F = (U = S.get(P)) == null ? void 0 : U.get(A);
267
267
  F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = $ - b + F.marginTop, _ = k);
268
268
  break;
269
269
  }
@@ -276,23 +276,23 @@ const Zn = {
276
276
  break;
277
277
  }
278
278
  if (x != null) {
279
- const { aTop: C, aLeft: R } = x, y = T[I].docTransform.positionH;
279
+ const { aTop: C, aLeft: R } = x, P = T[I].docTransform.positionH;
280
280
  let B = R;
281
- y.relativeFrom === ne.MARGIN ? B -= _ : y.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
281
+ P.relativeFrom === ne.MARGIN ? B -= _ : P.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
282
282
  const k = {
283
- relativeFrom: y.relativeFrom,
283
+ relativeFrom: P.relativeFrom,
284
284
  posOffset: B
285
285
  };
286
- if (y.posOffset !== k.posOffset) {
287
- const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], y, k);
286
+ if (P.posOffset !== k.posOffset) {
287
+ const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], P, k);
288
288
  D.push(F);
289
289
  }
290
290
  const b = T[I].docTransform.positionV;
291
- let E = C;
292
- b.relativeFrom === V.PAGE ? E += G : b.relativeFrom === V.LINE ? E -= x.lineTop : b.relativeFrom === V.PARAGRAPH && (E -= x.blockAnchorTop);
291
+ let A = C;
292
+ b.relativeFrom === V.PAGE ? A += G : b.relativeFrom === V.LINE ? A -= x.lineTop : b.relativeFrom === V.PARAGRAPH && (A -= x.blockAnchorTop);
293
293
  const $ = {
294
294
  relativeFrom: b.relativeFrom,
295
- posOffset: E
295
+ posOffset: A
296
296
  };
297
297
  if (b.posOffset !== $.posOffset) {
298
298
  const F = O.replaceOp(["drawings", I, "docTransform", "positionV"], b, $);
@@ -309,16 +309,16 @@ const Zn = {
309
309
  }
310
310
  };
311
311
  M.params.actions = D.reduce((N, I) => q.compose(N, I), null);
312
- const P = o.syncExecuteCommand(M.id, M.params);
313
- return h.refreshControls(), !!P;
312
+ const y = o.syncExecuteCommand(M.id, M.params);
313
+ return h.refreshControls(), !!y;
314
314
  }
315
- }, Qn = {
315
+ }, Jn = {
316
316
  id: "doc.command.update-doc-drawing-distance",
317
- type: K.COMMAND,
317
+ type: Y.COMMAND,
318
318
  handler: (i, e) => {
319
319
  if (e == null)
320
320
  return !1;
321
- const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
321
+ const n = i.get(z), r = i.get(K).getCurrentUniverDocInstance();
322
322
  if (r == null)
323
323
  return !1;
324
324
  const { drawings: o, dist: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
@@ -342,13 +342,13 @@ const Zn = {
342
342
  };
343
343
  return m.params.actions = c.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(m.id, m.params);
344
344
  }
345
- }, Jn = {
345
+ }, et = {
346
346
  id: "doc.command.update-doc-drawing-wrap-text",
347
- type: K.COMMAND,
347
+ type: Y.COMMAND,
348
348
  handler: (i, e) => {
349
349
  if (e == null)
350
350
  return !1;
351
- const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
351
+ const n = i.get(z), r = i.get(K).getCurrentUniverDocInstance();
352
352
  if (r == null)
353
353
  return !1;
354
354
  const { drawings: o, wrapText: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
@@ -371,11 +371,11 @@ const Zn = {
371
371
  }
372
372
  }, qe = {
373
373
  id: "doc.command.update-drawing-doc-transform",
374
- type: K.COMMAND,
374
+ type: Y.COMMAND,
375
375
  handler: (i, e) => {
376
376
  if (e == null)
377
377
  return !1;
378
- const n = i.get(z), t = i.get(Q), o = i.get(ee).getRenderById(e.unitId), s = o == null ? void 0 : o.scene;
378
+ const n = i.get(z), t = i.get(K), o = i.get(ee).getRenderById(e.unitId), s = o == null ? void 0 : o.scene;
379
379
  if (s == null)
380
380
  return !1;
381
381
  const a = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
@@ -384,7 +384,7 @@ const Zn = {
384
384
  const { drawings: c, unitId: l } = e, m = q.getInstance(), g = [], { drawings: p = {} } = d.getSnapshot();
385
385
  for (const w of c) {
386
386
  const { drawingId: S, key: O, value: D } = w, T = p[S].docTransform[O];
387
- if (!Pe.diffValue(T, D)) {
387
+ if (!ye.diffValue(T, D)) {
388
388
  const M = m.replaceOp(["drawings", S, "docTransform", O], T, D);
389
389
  g.push(M);
390
390
  }
@@ -402,9 +402,9 @@ const Zn = {
402
402
  const v = n.syncExecuteCommand(h.id, h.params);
403
403
  return a.refreshControls(), !!v;
404
404
  }
405
- }, et = {
405
+ }, nt = {
406
406
  id: "doc.command.move-inline-drawing",
407
- type: K.COMMAND,
407
+ type: Y.COMMAND,
408
408
  handler: (i, e) => {
409
409
  var U, N;
410
410
  if (e == null)
@@ -412,13 +412,13 @@ const Zn = {
412
412
  const n = i.get(ee), t = (U = n.getRenderById(e.unitId)) == null ? void 0 : U.with(Me), r = i.get(gn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, a = o == null ? void 0 : o.with(se).getSkeleton();
413
413
  if (s == null || t == null)
414
414
  return !1;
415
- const d = s.getTransformerByCreate(), c = i.get(z), m = i.get(Q).getCurrentUniverDocInstance();
415
+ const d = s.getTransformerByCreate(), c = i.get(z), m = i.get(K).getCurrentUniverDocInstance();
416
416
  if (m == null)
417
417
  return !1;
418
418
  const { drawing: g, unitId: p, offset: h, segmentId: v, segmentPage: w, needRefreshDrawings: S } = e;
419
419
  if (S)
420
420
  return r.refreshDrawings(a), d.refreshControls(), !0;
421
- const O = [], { drawingId: D } = g, T = (N = t.getSegment()) != null ? N : "", M = Yn(
421
+ const O = [], { drawingId: D } = g, T = (N = t.getSegment()) != null ? N : "", M = Zn(
422
422
  v,
423
423
  T,
424
424
  w,
@@ -430,7 +430,7 @@ const Zn = {
430
430
  if (M == null || M.length === 0)
431
431
  return r.refreshDrawings(a), d.refreshControls(), !1;
432
432
  O.push(...M);
433
- const P = {
433
+ const y = {
434
434
  id: J.id,
435
435
  params: {
436
436
  unitId: p,
@@ -438,13 +438,13 @@ const Zn = {
438
438
  textRanges: null
439
439
  }
440
440
  };
441
- P.params.actions = O.reduce((I, L) => q.compose(I, L), null);
442
- const A = c.syncExecuteCommand(P.id, P.params);
443
- return d.refreshControls(), !!A;
441
+ y.params.actions = O.reduce((I, L) => q.compose(I, L), null);
442
+ const E = c.syncExecuteCommand(y.id, y.params);
443
+ return d.refreshControls(), !!E;
444
444
  }
445
- }, nt = {
445
+ }, tt = {
446
446
  id: "doc.command.transform-non-inline-drawing",
447
- type: K.COMMAND,
447
+ type: Y.COMMAND,
448
448
  // eslint-disable-next-line max-lines-per-function
449
449
  handler: (i, e) => {
450
450
  var x, G;
@@ -453,10 +453,10 @@ const Zn = {
453
453
  const n = i.get(ee), t = (x = n.getRenderById(e.unitId)) == null ? void 0 : x.with(Me), r = n.getRenderById(e.unitId), o = r == null ? void 0 : r.scene;
454
454
  if (o == null || t == null)
455
455
  return !1;
456
- const s = o.getTransformerByCreate(), a = i.get(z), c = i.get(Q).getCurrentUniverDocInstance();
456
+ const s = o.getTransformerByCreate(), a = i.get(z), c = i.get(K).getCurrentUniverDocInstance();
457
457
  if (c == null)
458
458
  return !1;
459
- const { drawing: l, unitId: m, offset: g, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (G = t.getSegment()) != null ? G : "", D = Yn(
459
+ const { drawing: l, unitId: m, offset: g, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (G = t.getSegment()) != null ? G : "", D = Zn(
460
460
  h,
461
461
  O,
462
462
  v,
@@ -468,20 +468,20 @@ const Zn = {
468
468
  if (D == null)
469
469
  return !1;
470
470
  D.length > 0 && w.push(...D);
471
- const T = q.getInstance(), { drawings: M = {} } = c.getSnapshot(), P = M[S].docTransform, { positionH: A, positionV: U, size: N, angle: I } = P;
472
- if (!Pe.diffValue(A, p.positionH)) {
473
- const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"], A, p.positionH);
471
+ const T = q.getInstance(), { drawings: M = {} } = c.getSnapshot(), y = M[S].docTransform, { positionH: E, positionV: U, size: N, angle: I } = y;
472
+ if (!ye.diffValue(E, p.positionH)) {
473
+ const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"], E, p.positionH);
474
474
  w.push(_);
475
475
  }
476
- if (!Pe.diffValue(U, p.positionV)) {
476
+ if (!ye.diffValue(U, p.positionV)) {
477
477
  const _ = T.replaceOp(["drawings", S, "docTransform", "positionV"], U, p.positionV);
478
478
  w.push(_);
479
479
  }
480
- if (!Pe.diffValue(N, p.size)) {
480
+ if (!ye.diffValue(N, p.size)) {
481
481
  const _ = T.replaceOp(["drawings", S, "docTransform", "size"], N, p.size);
482
482
  w.push(_);
483
483
  }
484
- if (!Pe.diffValue(I, p.angle)) {
484
+ if (!ye.diffValue(I, p.angle)) {
485
485
  const _ = T.replaceOp(["drawings", S, "docTransform", "angle"], I, p.angle);
486
486
  w.push(_);
487
487
  }
@@ -504,15 +504,15 @@ var Ri = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
504
504
  (s = i[o]) && (r = s(r) || r);
505
505
  return r;
506
506
  }, Qe = (i, e) => (n, t) => e(n, t, i);
507
- const Ai = "__InlineDrawingAnchor__";
508
- function Fn(i) {
507
+ const Ei = "__InlineDrawingAnchor__";
508
+ function Hn(i) {
509
509
  const { path: e } = i;
510
510
  return e.some((n) => n === "cells");
511
511
  }
512
512
  let on = class extends Xe {
513
513
  constructor(e, n, t, r) {
514
514
  super();
515
- Ce(this, "_liquid", new jn());
515
+ Ce(this, "_liquid", new $n());
516
516
  Ce(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
517
517
  // Use to cache the drawings is under transforming or scaling.
518
518
  Ce(this, "_transformerCache", /* @__PURE__ */ new Map());
@@ -563,8 +563,8 @@ let on = class extends Xe {
563
563
  })
564
564
  )
565
565
  );
566
- const t = On(this._updateMultipleDrawingDocTransform.bind(this), 50);
567
- On(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
566
+ const t = Tn(this._updateMultipleDrawingDocTransform.bind(this), 50);
567
+ Tn(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
568
568
  Le(
569
569
  n.changing$.subscribe((o) => {
570
570
  const { objects: s, offsetX: a, offsetY: d } = o;
@@ -632,20 +632,20 @@ let on = class extends Xe {
632
632
  key: "angle",
633
633
  value: c
634
634
  }), v !== d || w !== a) {
635
- const P = d - v, A = a - w;
636
- P !== 0 && n.push({
635
+ const y = d - v, E = a - w;
636
+ y !== 0 && n.push({
637
637
  drawingId: g.drawingId,
638
638
  key: "positionV",
639
639
  value: {
640
640
  relativeFrom: h.docTransform.positionV.relativeFrom,
641
- posOffset: h.docTransform.positionV.posOffset + P
641
+ posOffset: h.docTransform.positionV.posOffset + y
642
642
  }
643
- }), A !== 0 && n.push({
643
+ }), E !== 0 && n.push({
644
644
  drawingId: g.drawingId,
645
645
  key: "positionH",
646
646
  value: {
647
647
  relativeFrom: h.docTransform.positionH.relativeFrom,
648
- posOffset: h.docTransform.positionH.posOffset + A
648
+ posOffset: h.docTransform.positionH.posOffset + E
649
649
  }
650
650
  });
651
651
  }
@@ -676,7 +676,7 @@ let on = class extends Xe {
676
676
  if (r == null)
677
677
  return;
678
678
  const { mainComponent: s, scene: a } = r, d = s, c = a.getViewports()[0], {
679
- pageLayoutType: l = Mn.VERTICAL,
679
+ pageLayoutType: l = Rn.VERTICAL,
680
680
  pageMarginLeft: m,
681
681
  pageMarginTop: g
682
682
  } = d.getOffsetConfig();
@@ -699,46 +699,46 @@ let on = class extends Xe {
699
699
  }
700
700
  );
701
701
  if (T) {
702
- const { node: _, ratioX: C, segmentPage: R, segmentId: y } = T;
703
- h = C < S, p = _, v = R, w = y;
702
+ const { node: _, ratioX: C, segmentPage: R, segmentId: P } = T;
703
+ h = C < S, p = _, v = R, w = P;
704
704
  }
705
705
  if (p == null)
706
706
  return;
707
- const M = o == null ? void 0 : o.findPositionByGlyph(p, v), P = this._getDocObject();
708
- if (M == null || o == null || P == null || Fn(M))
707
+ const M = o == null ? void 0 : o.findPositionByGlyph(p, v), y = this._getDocObject();
708
+ if (M == null || o == null || y == null || Hn(M))
709
709
  return;
710
- const A = {
710
+ const E = {
711
711
  ...M,
712
712
  isBack: h
713
- }, U = P.document.getOffsetConfig(), N = new Nn(U, o), { cursorList: I, contentBoxPointGroup: L } = N.getRangePointData(A, A), { startOffset: W } = (G = An(I)) != null ? G : {};
713
+ }, U = y.document.getOffsetConfig(), N = new En(U, o), { cursorList: I, contentBoxPointGroup: L } = N.getRangePointData(E, E), { startOffset: W } = (G = An(I)) != null ? G : {};
714
714
  if (W != null)
715
715
  return { offset: W, contentBoxPointGroup: L, segmentId: w, segmentPage: v };
716
716
  }
717
717
  // eslint-disable-next-line max-lines-per-function, complexity
718
718
  _getDrawingAnchor(e, n) {
719
- var _e, Se, de, De, Oe, Ne, Ae, Te, le, ge, Ee;
719
+ var _e, Se, de, De, Oe, Ne, Ee, Te, le, ge, Ae;
720
720
  const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(se).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
721
721
  if (o == null || t == null)
722
722
  return;
723
- const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: l } = t, m = c, g = l.getViewports()[0], { pageLayoutType: p = Mn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = m.getOffsetConfig(), { left: O, top: D, angle: T } = n;
724
- let { width: M, height: P } = n;
725
- const { positionV: A, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
726
- M = Math.min(M, N), P = Math.min(P, I);
723
+ const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: l } = t, m = c, g = l.getViewports()[0], { pageLayoutType: p = Rn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = m.getOffsetConfig(), { left: O, top: D, angle: T } = n;
724
+ let { width: M, height: y } = n;
725
+ const { positionV: E, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
726
+ M = Math.min(M, N), y = Math.min(y, I);
727
727
  let L = null, W = "", x = -1;
728
728
  const G = !1, _ = {
729
729
  ...e.docTransform,
730
730
  size: {
731
731
  width: M,
732
- height: P
732
+ height: y
733
733
  },
734
734
  angle: T
735
- }, { x: C, y: R } = l.getViewportScrollXY(g), y = this._getTransformCoordForDocumentOffset(m, g, O - C, D - R);
736
- if (y == null)
735
+ }, { x: C, y: R } = l.getViewportScrollXY(g), P = this._getTransformCoordForDocumentOffset(m, g, O - C, D - R);
736
+ if (P == null)
737
737
  return;
738
738
  const B = (_e = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : _e.with(Me);
739
739
  if (B == null)
740
740
  return;
741
- const k = r == null ? void 0 : r.findNodeByCoord(y, p, h, v, {
741
+ const k = r == null ? void 0 : r.findNodeByCoord(P, p, h, v, {
742
742
  strict: !1,
743
743
  segmentId: B.getSegment(),
744
744
  segmentPage: B.getSegmentPage()
@@ -749,32 +749,32 @@ let on = class extends Xe {
749
749
  }
750
750
  if (L == null)
751
751
  return;
752
- const b = (Se = L.parent) == null ? void 0 : Se.parent, E = b == null ? void 0 : b.parent, $ = (de = E == null ? void 0 : E.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : E == null ? void 0 : E.lines[0], F = (De = E == null ? void 0 : E.parent) == null ? void 0 : De.parent;
753
- if (b == null || E == null || $ == null || F == null)
752
+ const b = (Se = L.parent) == null ? void 0 : Se.parent, A = b == null ? void 0 : b.parent, $ = (de = A == null ? void 0 : A.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : A == null ? void 0 : A.lines[0], F = (De = A == null ? void 0 : A.parent) == null ? void 0 : De.parent;
753
+ if (b == null || A == null || $ == null || F == null)
754
754
  return;
755
755
  this._liquid.reset();
756
- const Y = F.type;
756
+ const Z = F.type;
757
757
  for (const pe of s) {
758
- const { headerId: mn, footerId: un, pageHeight: It, pageWidth: Cn, marginLeft: Dn, marginBottom: _t } = pe, St = s.indexOf(pe);
758
+ const { headerId: mn, footerId: un, pageHeight: It, pageWidth: Dn, marginLeft: On, marginBottom: _t } = pe, St = s.indexOf(pe);
759
759
  if (x > -1 && St === x) {
760
- switch (Y) {
761
- case Rn.HEADER: {
762
- const Ge = (Oe = a.get(mn)) == null ? void 0 : Oe.get(Cn);
760
+ switch (Z) {
761
+ case Nn.HEADER: {
762
+ const Ge = (Oe = a.get(mn)) == null ? void 0 : Oe.get(Dn);
763
763
  if (Ge)
764
764
  this._liquid.translatePagePadding({
765
765
  marginTop: Ge.marginTop,
766
- marginLeft: Dn
766
+ marginLeft: On
767
767
  });
768
768
  else
769
769
  throw new Error("header skeleton not found");
770
770
  break;
771
771
  }
772
- case Rn.FOOTER: {
773
- const Ge = (Ne = d.get(un)) == null ? void 0 : Ne.get(Cn);
772
+ case Nn.FOOTER: {
773
+ const Ge = (Ne = d.get(un)) == null ? void 0 : Ne.get(Dn);
774
774
  if (Ge)
775
775
  this._liquid.translatePagePadding({
776
776
  marginTop: It - _t + Ge.marginTop,
777
- marginLeft: Dn
777
+ marginLeft: On
778
778
  });
779
779
  else
780
780
  throw new Error("footer skeleton not found");
@@ -787,7 +787,7 @@ let on = class extends Xe {
787
787
  break;
788
788
  this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, p, h, v);
789
789
  }
790
- switch (A.relativeFrom === V.LINE ? L = b.divides[0].glyphGroup[0] : L = (ge = (le = (Te = (Ae = $.divides) == null ? void 0 : Ae[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, _.positionH = {
790
+ switch (E.relativeFrom === V.LINE ? L = b.divides[0].glyphGroup[0] : L = (ge = (le = (Te = (Ee = $.divides) == null ? void 0 : Ee[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, _.positionH = {
791
791
  relativeFrom: U.relativeFrom,
792
792
  posOffset: O - this._liquid.x - w
793
793
  }, U.relativeFrom) {
@@ -796,14 +796,14 @@ let on = class extends Xe {
796
796
  break;
797
797
  }
798
798
  case ne.COLUMN: {
799
- _.positionH.posOffset = O - this._liquid.x - w - E.left;
799
+ _.positionH.posOffset = O - this._liquid.x - w - A.left;
800
800
  break;
801
801
  }
802
802
  }
803
803
  switch (_.positionV = {
804
- relativeFrom: A.relativeFrom,
804
+ relativeFrom: E.relativeFrom,
805
805
  posOffset: D - this._liquid.y - S
806
- }, A.relativeFrom) {
806
+ }, E.relativeFrom) {
807
807
  case V.PAGE: {
808
808
  _.positionV.posOffset = D - this._liquid.y - S - F.marginTop;
809
809
  break;
@@ -820,12 +820,12 @@ let on = class extends Xe {
820
820
  if (L == null)
821
821
  return;
822
822
  const ae = r == null ? void 0 : r.findPositionByGlyph(L, x), Ue = this._getDocObject();
823
- if (ae == null || r == null || Ue == null || Fn(ae))
823
+ if (ae == null || r == null || Ue == null || Hn(ae))
824
824
  return;
825
825
  const Re = {
826
826
  ...ae,
827
827
  isBack: G
828
- }, We = Ue.document.getOffsetConfig(), ce = new Nn(We, r), { cursorList: te } = ce.getRangePointData(Re, Re), { startOffset: ie } = (Ee = An(te)) != null ? Ee : {};
828
+ }, We = Ue.document.getOffsetConfig(), ce = new En(We, r), { cursorList: te } = ce.getRangePointData(Re, Re), { startOffset: ie } = (Ae = An(te)) != null ? Ae : {};
829
829
  if (ie != null)
830
830
  return { offset: ie, docTransform: _, segmentId: W, segmentPage: x };
831
831
  }
@@ -854,7 +854,7 @@ let on = class extends Xe {
854
854
  // Update inline drawing when use transformer to move it.
855
855
  _moveInlineDrawing(e, n, t) {
856
856
  const r = this._getInlineDrawingAnchor(e, n, t), { offset: o, segmentId: s, segmentPage: a } = r != null ? r : {};
857
- return this._commandService.executeCommand(et.id, {
857
+ return this._commandService.executeCommand(nt.id, {
858
858
  unitId: e.unitId,
859
859
  subUnitId: e.unitId,
860
860
  drawing: e,
@@ -880,17 +880,17 @@ let on = class extends Xe {
880
880
  let O = o;
881
881
  this._liquid.reset();
882
882
  for (const D of m) {
883
- const { marginBottom: T, pageHeight: M } = D, P = m.indexOf(D), A = m[P + 1];
884
- if (A == null)
883
+ const { marginBottom: T, pageHeight: M } = D, y = m.indexOf(D), E = m[y + 1];
884
+ if (E == null)
885
885
  continue;
886
- if (Pe.hasIntersectionBetweenTwoRanges(
886
+ if (ye.hasIntersectionBetweenTwoRanges(
887
887
  o,
888
888
  o + a,
889
889
  this._liquid.y + h + M - T,
890
- this._liquid.y + h + M + S + A.marginTop
890
+ this._liquid.y + h + M + S + E.marginTop
891
891
  )) {
892
892
  const N = o + a / 2, I = this._liquid.y + h + M + S / 2;
893
- N < I ? O = Math.min(o, this._liquid.y + h + M - T - a) : O = Math.max(o, this._liquid.y + h + M + S + A.marginTop);
893
+ N < I ? O = Math.min(o, this._liquid.y + h + M - T - a) : O = Math.max(o, this._liquid.y + h + M + S + E.marginTop);
894
894
  }
895
895
  this._liquid.translatePage(D, v, w, S);
896
896
  }
@@ -907,7 +907,7 @@ let on = class extends Xe {
907
907
  if (t && r.top !== n.top)
908
908
  return;
909
909
  const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: a, segmentId: d, segmentPage: c } = o != null ? o : {};
910
- return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(nt.id, {
910
+ return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(tt.id, {
911
911
  unitId: e.unitId,
912
912
  subUnitId: e.unitId,
913
913
  drawing: e,
@@ -927,7 +927,7 @@ let on = class extends Xe {
927
927
  return { scene: t, transformer: r };
928
928
  }
929
929
  _getTransformCoordForDocumentOffset(e, n, t, r) {
930
- const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(ei.FromArray([t, r]));
930
+ const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(Jt.FromArray([t, r]));
931
931
  if (s)
932
932
  return o.clone().invert().applyPoint(s);
933
933
  }
@@ -943,12 +943,12 @@ let on = class extends Xe {
943
943
  this._anchorShape.transformByState({ left: p, top: h, height: g }), this._anchorShape.show();
944
944
  return;
945
945
  }
946
- const v = 6, w = new ni(Ai + Pe.generateRandomId(v), {
946
+ const v = 6, w = new ei(Ei + ye.generateRandomId(v), {
947
947
  left: p,
948
948
  top: h,
949
949
  height: g,
950
950
  strokeWidth: 2,
951
- stroke: ti(yt.darkGray, 1),
951
+ stroke: ni(Pt.darkGray, 1),
952
952
  evented: !1
953
953
  });
954
954
  this._anchorShape = w, o.addObject(w, ui);
@@ -987,7 +987,7 @@ let on = class extends Xe {
987
987
  };
988
988
  on = Ni([
989
989
  Qe(0, z),
990
- Qe(1, Q),
990
+ Qe(1, K),
991
991
  Qe(2, Ie),
992
992
  Qe(3, ee)
993
993
  ], on);
@@ -999,20 +999,20 @@ var he = function() {
999
999
  }
1000
1000
  return i;
1001
1001
  }, he.apply(this, arguments);
1002
- }, Ei = function(i, e) {
1002
+ }, Ai = function(i, e) {
1003
1003
  var n = {};
1004
1004
  for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
1005
1005
  if (i != null && typeof Object.getOwnPropertySymbols == "function")
1006
1006
  for (var r = 0, t = Object.getOwnPropertySymbols(i); r < t.length; r++)
1007
1007
  e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
1008
1008
  return n;
1009
- }, tt = Xn(function(i, e) {
1010
- var n = i.icon, t = i.id, r = i.className, o = i.extend, s = Ei(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Di("_".concat(Bi()));
1011
- return it(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className: a }, s), o);
1009
+ }, it = Kn(function(i, e) {
1010
+ var n = i.icon, t = i.id, r = i.className, o = i.extend, s = Ai(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Di("_".concat(Bi()));
1011
+ return rt(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className: a }, s), o);
1012
1012
  });
1013
- function it(i, e, n, t, r) {
1014
- return Kn(i.tag, he(he({ key: e }, xi(i, n, r)), t), (Li(i, n).children || []).map(function(o, s) {
1015
- return it(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
1013
+ function rt(i, e, n, t, r) {
1014
+ return Yn(i.tag, he(he({ key: e }, xi(i, n, r)), t), (Li(i, n).children || []).map(function(o, s) {
1015
+ return rt(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
1016
1016
  }));
1017
1017
  }
1018
1018
  function xi(i, e, n) {
@@ -1036,25 +1036,25 @@ function Li(i, e) {
1036
1036
  function Bi() {
1037
1037
  return Math.random().toString(36).substring(2, 8);
1038
1038
  }
1039
- tt.displayName = "UniverIcon";
1040
- var Ui = { 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" } }] }, rt = Xn(function(i, e) {
1041
- return Kn(tt, Object.assign({}, i, {
1039
+ it.displayName = "UniverIcon";
1040
+ var Ui = { 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" } }] }, ot = Kn(function(i, e) {
1041
+ return Yn(it, Object.assign({}, i, {
1042
1042
  id: "add-image-single",
1043
1043
  ref: e,
1044
1044
  icon: Ui
1045
1045
  }));
1046
1046
  });
1047
- rt.displayName = "AddImageSingle";
1048
- const Sn = {
1047
+ ot.displayName = "AddImageSingle";
1048
+ const Cn = {
1049
1049
  id: "doc.command.remove-doc-image",
1050
- type: K.COMMAND,
1050
+ type: Y.COMMAND,
1051
1051
  // eslint-disable-next-line max-lines-per-function
1052
1052
  handler: (i, e) => {
1053
- var M, P, A, U;
1054
- const n = i.get(z), t = i.get(Q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
1053
+ var M, y, E, U;
1054
+ const n = i.get(z), t = i.get(K), r = i.get(ee), o = t.getCurrentUniverDocInstance();
1055
1055
  if (e == null || o == null)
1056
1056
  return !1;
1057
- const s = r.getRenderById(e.unitId).with(Me), { drawings: a } = e, d = (M = s.getSegment()) != null ? M : "", c = new vn(), l = q.getInstance(), m = (A = (P = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : P.customBlocks) != null ? A : [], g = a.map((N) => m.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new Pt();
1057
+ const s = r.getRenderById(e.unitId).with(Me), { drawings: a } = e, d = (M = s.getSegment()) != null ? M : "", c = new vn(), l = q.getInstance(), m = (E = (y = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? E : [], g = a.map((N) => m.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new yt();
1058
1058
  h.reset();
1059
1059
  const v = g[0].startIndex, w = [
1060
1060
  {
@@ -1072,10 +1072,10 @@ const Sn = {
1072
1072
  for (const N of g) {
1073
1073
  const { startIndex: I } = N;
1074
1074
  I > h.cursor && c.push({
1075
- t: Z.RETAIN,
1075
+ t: Q.RETAIN,
1076
1076
  len: I - h.cursor
1077
1077
  }), c.push({
1078
- t: Z.DELETE,
1078
+ t: Q.DELETE,
1079
1079
  len: 1
1080
1080
  }), h.moveCursorTo(I + 1);
1081
1081
  }
@@ -1087,9 +1087,9 @@ const Sn = {
1087
1087
  }
1088
1088
  return S.params.actions = O.reduce((N, I) => q.compose(N, I), null), !!n.syncExecuteCommand(S.id, S.params);
1089
1089
  }
1090
- }, ot = {
1090
+ }, st = {
1091
1091
  id: "doc.command.delete-drawing",
1092
- type: K.COMMAND,
1092
+ type: Y.COMMAND,
1093
1093
  handler: (i) => {
1094
1094
  const e = i.get(z), t = i.get(Be).getFocusDrawings();
1095
1095
  if (t.length === 0)
@@ -1103,16 +1103,16 @@ const Sn = {
1103
1103
  drawingType: l
1104
1104
  };
1105
1105
  });
1106
- return e.executeCommand(Sn.id, {
1106
+ return e.executeCommand(Cn.id, {
1107
1107
  unitId: r,
1108
1108
  drawings: o
1109
1109
  });
1110
1110
  }
1111
- }, st = {
1111
+ }, at = {
1112
1112
  id: "doc.command.group-doc-image",
1113
- type: K.COMMAND,
1113
+ type: Y.COMMAND,
1114
1114
  handler: (i, e) => {
1115
- i.get(z), i.get(Gn);
1115
+ i.get(z), i.get(Vn);
1116
1116
  const n = i.get(Be);
1117
1117
  if (!e) return !1;
1118
1118
  const t = [];
@@ -1124,25 +1124,25 @@ const Sn = {
1124
1124
  const r = n.getGroupDrawingOp(e), { unitId: o, subUnitId: s, undo: a, redo: d, objects: c } = r;
1125
1125
  return !1;
1126
1126
  }
1127
- }, at = {
1127
+ }, ct = {
1128
1128
  id: "doc.command.insert-doc-image",
1129
- type: K.COMMAND,
1129
+ type: Y.COMMAND,
1130
1130
  // eslint-disable-next-line max-lines-per-function
1131
1131
  handler: (i, e) => {
1132
- var P, A, U, N;
1132
+ var y, E, U, N;
1133
1133
  if (e == null)
1134
1134
  return !1;
1135
- const n = i.get(z), t = i.get(In), r = i.get(Q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
1135
+ const n = i.get(z), t = i.get(_n), r = i.get(K), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
1136
1136
  if (o == null || s == null)
1137
1137
  return !1;
1138
1138
  const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset: l, segmentId: m } = o, g = s.getSelfOrHeaderFooterModel(m).getBody();
1139
1139
  if (g == null)
1140
1140
  return !1;
1141
- const p = new vn(), h = q.getInstance(), v = [], w = (A = (P = s.getSnapshot().drawingsOrder) == null ? void 0 : P.length) != null ? A : 0;
1141
+ const p = new vn(), h = q.getInstance(), v = [], w = (E = (y = s.getSnapshot().drawingsOrder) == null ? void 0 : y.length) != null ? E : 0;
1142
1142
  let S = 0;
1143
1143
  if (c)
1144
1144
  l > 0 && p.push({
1145
- t: Z.RETAIN,
1145
+ t: Q.RETAIN,
1146
1146
  len: l
1147
1147
  });
1148
1148
  else {
@@ -1154,12 +1154,12 @@ const Sn = {
1154
1154
  const C = W[_], R = x.indexOf(_);
1155
1155
  if (C == null || R < 0)
1156
1156
  continue;
1157
- const y = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
1158
- v.push(y), v.push(B), S++;
1157
+ const P = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
1158
+ v.push(P), v.push(B), S++;
1159
1159
  }
1160
1160
  }
1161
1161
  p.push({
1162
- t: Z.INSERT,
1162
+ t: Q.INSERT,
1163
1163
  body: {
1164
1164
  dataStream: "\b".repeat(d.length),
1165
1165
  customBlocks: d.map((I, L) => ({
@@ -1185,9 +1185,9 @@ const Sn = {
1185
1185
  };
1186
1186
  return T.params.actions = v.reduce((I, L) => q.compose(I, L), null), !!n.syncExecuteCommand(T.id, T.params);
1187
1187
  }
1188
- }, ct = {
1188
+ }, dt = {
1189
1189
  id: "doc.command.set-drawing-arrange",
1190
- type: K.COMMAND,
1190
+ type: Y.COMMAND,
1191
1191
  handler: (i, e) => {
1192
1192
  const n = i.get(z), t = i.get(Be);
1193
1193
  if (e == null)
@@ -1200,7 +1200,7 @@ const Sn = {
1200
1200
  if (l == null)
1201
1201
  return !1;
1202
1202
  const m = [];
1203
- let g = Pe.deepClone(l);
1203
+ let g = ye.deepClone(l);
1204
1204
  g = g.slice(3), g.unshift("drawingsOrder"), m.push(g);
1205
1205
  const p = {
1206
1206
  id: J.id,
@@ -1212,11 +1212,11 @@ const Sn = {
1212
1212
  };
1213
1213
  return p.params.actions = m.reduce((v, w) => q.compose(v, w), null), !!n.syncExecuteCommand(p.id, p.params);
1214
1214
  }
1215
- }, dt = {
1215
+ }, lt = {
1216
1216
  id: "doc.command.ungroup-doc-image",
1217
- type: K.COMMAND,
1217
+ type: Y.COMMAND,
1218
1218
  handler: (i, e) => {
1219
- i.get(z), i.get(Gn);
1219
+ i.get(z), i.get(Vn);
1220
1220
  const n = i.get(Be);
1221
1221
  if (!e) return !1;
1222
1222
  const t = [];
@@ -1241,10 +1241,10 @@ let sn = class extends Xe {
1241
1241
  async insertDocImage() {
1242
1242
  const i = await this._fileOpenerService.openFile({
1243
1243
  multiple: !0,
1244
- accept: Vt.map((n) => `.${n.replace("image/", "")}`).join(",")
1244
+ accept: Gt.map((n) => `.${n.replace("image/", "")}`).join(",")
1245
1245
  }), e = i.length;
1246
1246
  return e > yn ? (this._messageService.show({
1247
- type: Ln.Error,
1247
+ type: Bn.Error,
1248
1248
  content: this._localeService.t("update-status.exceedMaxCount", String(yn))
1249
1249
  }), !1) : e === 0 ? !1 : (await this._insertFloatImages(i), !0);
1250
1250
  }
@@ -1258,7 +1258,7 @@ let sn = class extends Xe {
1258
1258
  let s = "";
1259
1259
  switch (o) {
1260
1260
  case hn.ERROR_EXCEED_SIZE:
1261
- s = this._localeService.t("update-status.exceedMaxSize", String(jt / (1024 * 1024)));
1261
+ s = this._localeService.t("update-status.exceedMaxSize", String(Vt / (1024 * 1024)));
1262
1262
  break;
1263
1263
  case hn.ERROR_IMAGE_TYPE:
1264
1264
  s = this._localeService.t("update-status.invalidImageType");
@@ -1268,7 +1268,7 @@ let sn = class extends Xe {
1268
1268
  break;
1269
1269
  }
1270
1270
  this._messageService.show({
1271
- type: Ln.Error,
1271
+ type: Bn.Error,
1272
1272
  content: s
1273
1273
  });
1274
1274
  }
@@ -1278,11 +1278,11 @@ let sn = class extends Xe {
1278
1278
  for (const r of e) {
1279
1279
  if (r == null)
1280
1280
  continue;
1281
- const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: m } = await $t(d || "");
1281
+ const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: m } = await jt(d || "");
1282
1282
  this._imageIoService.addImageSourceCache(o, s, m);
1283
1283
  let g = 1;
1284
- if (c > Pn || l > bn) {
1285
- const w = Pn / c, S = bn / l;
1284
+ if (c > bn || l > Mn) {
1285
+ const w = bn / c, S = Mn / l;
1286
1286
  g = Math.min(w, S);
1287
1287
  }
1288
1288
  const p = this._getImagePosition(c * g, l * g);
@@ -1310,7 +1310,7 @@ let sn = class extends Xe {
1310
1310
  };
1311
1311
  this._isInsertInHeaderFooter() && (h.isMultiTransform = oe.TRUE, h.transforms = h.transform ? [h.transform] : null), t.push(h);
1312
1312
  }
1313
- this._commandService.executeCommand(at.id, {
1313
+ this._commandService.executeCommand(ct.id, {
1314
1314
  unitId: n,
1315
1315
  drawings: t
1316
1316
  });
@@ -1343,7 +1343,7 @@ let sn = class extends Xe {
1343
1343
  _updateOrderListener() {
1344
1344
  this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
1345
1345
  const { unitId: e, subUnitId: n, drawingIds: t, arrangeType: r } = i;
1346
- this._commandService.executeCommand(ct.id, {
1346
+ this._commandService.executeCommand(dt.id, {
1347
1347
  unitId: e,
1348
1348
  subUnitId: n,
1349
1349
  drawingIds: t,
@@ -1353,9 +1353,9 @@ let sn = class extends Xe {
1353
1353
  }
1354
1354
  _groupDrawingListener() {
1355
1355
  this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
1356
- this._commandService.executeCommand(st.id, i);
1356
+ this._commandService.executeCommand(at.id, i);
1357
1357
  }), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
1358
- this._commandService.executeCommand(dt.id, i);
1358
+ this._commandService.executeCommand(lt.id, i);
1359
1359
  });
1360
1360
  }
1361
1361
  _getCurrentSceneAndTransformer() {
@@ -1368,7 +1368,7 @@ let sn = class extends Xe {
1368
1368
  _transformDrawingListener() {
1369
1369
  const i = this._getCurrentSceneAndTransformer();
1370
1370
  if (i && i.transformer)
1371
- this.disposeWithMe(i.transformer.changeEnd$.pipe(qn(30)).subscribe((e) => {
1371
+ this.disposeWithMe(i.transformer.changeEnd$.pipe(Xn(30)).subscribe((e) => {
1372
1372
  this._docSelectionManagerService.refreshSelection();
1373
1373
  }));
1374
1374
  else
@@ -1416,7 +1416,7 @@ let sn = class extends Xe {
1416
1416
  return;
1417
1417
  const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Fe.BODY;
1418
1418
  for (const d of Object.keys(o)) {
1419
- const c = o[d], l = zt({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
1419
+ const c = o[d], l = $t({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
1420
1420
  if (m.length)
1421
1421
  for (const g of m)
1422
1422
  e.detachTransformerFrom(g), g.setOpacity(0.5), (s && c.isMultiTransform !== oe.TRUE || !s && c.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(g), g.setOpacity(1));
@@ -1452,42 +1452,43 @@ let sn = class extends Xe {
1452
1452
  };
1453
1453
  sn = Fi([
1454
1454
  me(1, z),
1455
- me(2, ve(In)),
1455
+ me(2, ve(_n)),
1456
1456
  me(3, ee),
1457
- me(4, Gt),
1457
+ me(4, Wt),
1458
1458
  me(5, Be),
1459
1459
  me(6, Ie),
1460
- me(7, Vn),
1460
+ me(7, jn),
1461
1461
  me(8, ri),
1462
1462
  me(9, ve(ln)),
1463
1463
  me(10, ve(Me)),
1464
1464
  me(11, ve(gn)),
1465
1465
  me(12, oi)
1466
1466
  ], sn);
1467
- const lt = {
1467
+ const gt = {
1468
1468
  id: "doc.command.insert-float-image",
1469
- type: K.COMMAND,
1469
+ type: Y.COMMAND,
1470
1470
  handler: (i) => {
1471
- var n, t;
1472
- return (t = (n = i.get(ee).getCurrentTypeOfRenderer(be.UNIVER_DOC)) == null ? void 0 : n.with(sn).insertDocImage()) != null ? t : !1;
1471
+ var t, r;
1472
+ const e = i.get(K), n = i.get(ee);
1473
+ return (r = (t = ti(be.UNIVER_DOC, e, n)) == null ? void 0 : t.with(sn).insertDocImage()) != null ? r : !1;
1473
1474
  }
1474
1475
  }, Ke = {
1475
1476
  id: "doc.command.move-drawing",
1476
- type: K.COMMAND,
1477
+ type: Y.COMMAND,
1477
1478
  handler: (i, e) => {
1478
- const n = i.get(z), t = i.get(Be), r = i.get(Q), o = i.get(ee), { direction: s } = e, a = t.getFocusDrawings();
1479
+ const n = i.get(z), t = i.get(Be), r = i.get(K), o = i.get(ee), { direction: s } = e, a = t.getFocusDrawings();
1479
1480
  if (a.length === 0)
1480
1481
  return !1;
1481
1482
  const d = a[0].unitId, c = o.getRenderById(d), l = c == null ? void 0 : c.scene;
1482
1483
  if (l == null)
1483
1484
  return !1;
1484
1485
  const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), p = a.map((v) => {
1485
- var P, A, U, N, I;
1486
- const { drawingId: w } = v, S = (P = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : P[w];
1486
+ var y, E, U, N, I;
1487
+ const { drawingId: w } = v, S = (y = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : y[w];
1487
1488
  if (S == null || S.layoutType === H.INLINE)
1488
1489
  return null;
1489
1490
  const { positionH: O, positionV: D } = S.docTransform, T = { ...O }, M = { ...D };
1490
- return s === fe.UP ? M.posOffset = ((A = M.posOffset) != null ? A : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ? T.posOffset = ((N = T.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (T.posOffset = ((I = T.posOffset) != null ? I : 0) + 2), {
1491
+ return s === fe.UP ? M.posOffset = ((E = M.posOffset) != null ? E : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ? T.posOffset = ((N = T.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (T.posOffset = ((I = T.posOffset) != null ? I : 0) + 2), {
1491
1492
  drawingId: w,
1492
1493
  key: s === fe.UP || s === fe.DOWN ? "positionV" : "positionH",
1493
1494
  value: s === fe.UP || s === fe.DOWN ? M : T
@@ -1504,7 +1505,7 @@ const lt = {
1504
1505
  }
1505
1506
  }, Hi = {
1506
1507
  id: "doc.operation.clear-drawing-transformer",
1507
- type: K.MUTATION,
1508
+ type: Y.MUTATION,
1508
1509
  handler: (i, e) => {
1509
1510
  const n = i.get(ee);
1510
1511
  return e.forEach((t) => {
@@ -1512,16 +1513,16 @@ const lt = {
1512
1513
  (o = (r = n.getRenderById(t)) == null ? void 0 : r.scene.getTransformer()) == null || o.debounceRefreshControls();
1513
1514
  }), !0;
1514
1515
  }
1515
- }, gt = "COMPONENT_DOC_DRAWING_PANEL", mt = {
1516
+ }, mt = "COMPONENT_DOC_DRAWING_PANEL", ut = {
1516
1517
  id: "sidebar.operation.doc-image",
1517
- type: K.COMMAND,
1518
+ type: Y.COMMAND,
1518
1519
  handler: async (i, e) => {
1519
1520
  const n = i.get(si), t = i.get(ln), r = i.get(Ie);
1520
1521
  switch (e.value) {
1521
1522
  case "open":
1522
1523
  n.open({
1523
1524
  header: { title: t.t("docImage.panel.title") },
1524
- children: { label: gt },
1525
+ children: { label: mt },
1525
1526
  onClose: () => {
1526
1527
  r.focusDrawing(null);
1527
1528
  },
@@ -1535,28 +1536,14 @@ const lt = {
1535
1536
  }
1536
1537
  return !0;
1537
1538
  }
1538
- }, ut = {
1539
+ }, ft = {
1539
1540
  id: "doc.operation.edit-doc-image",
1540
- type: K.OPERATION,
1541
+ type: Y.OPERATION,
1541
1542
  handler: (i, e) => {
1542
1543
  const n = i.get(Ie), t = i.get(z);
1543
- return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(mt.id, { value: "open" }), !0);
1544
+ return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(ut.id, { value: "open" }), !0);
1544
1545
  }
1545
- };
1546
- function ft(i) {
1547
- var e, n, t = "";
1548
- if (typeof i == "string" || typeof i == "number") t += i;
1549
- else if (typeof i == "object") if (Array.isArray(i)) {
1550
- var r = i.length;
1551
- for (e = 0; e < r; e++) i[e] && (n = ft(i[e])) && (t && (t += " "), t += n);
1552
- } else for (n in i) i[n] && (t && (t += " "), t += n);
1553
- return t;
1554
- }
1555
- function j() {
1556
- for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = ft(i)) && (t && (t += " "), t += e);
1557
- return t;
1558
- }
1559
- const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", Vi = "univer-image-common-panel-border", ji = "univer-image-common-panel-title", $i = "univer-image-common-panel-subtitle", zi = "univer-image-common-panel-row", qi = "univer-image-common-panel-column", Xi = "univer-image-common-panel-span2", Ki = "univer-image-common-panel-input", u = {
1546
+ }, Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", Vi = "univer-image-common-panel-border", ji = "univer-image-common-panel-title", $i = "univer-image-common-panel-subtitle", zi = "univer-image-common-panel-row", qi = "univer-image-common-panel-column", Xi = "univer-image-common-panel-span2", Ki = "univer-image-common-panel-input", u = {
1560
1547
  imageCommonPanel: Wi,
1561
1548
  imageCommonPanelGrid: Gi,
1562
1549
  imageCommonPanelBorder: Vi,
@@ -1566,8 +1553,8 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1566
1553
  imageCommonPanelColumn: qi,
1567
1554
  imageCommonPanelSpan2: Xi,
1568
1555
  imageCommonPanelInput: Ki
1569
- }, Hn = -1e3, Wn = 1e3, Yi = (i) => {
1570
- const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
1556
+ }, Wn = -1e3, Gn = 1e3, Yi = (i) => {
1557
+ const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(K), { drawings: s } = i, a = s[0];
1571
1558
  if (a == null)
1572
1559
  return;
1573
1560
  const { unitId: d } = a, c = o.getUniverDocInstance(d), l = c == null ? void 0 : c.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), g = m == null ? void 0 : m.scene;
@@ -1603,23 +1590,23 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1603
1590
  }), [T, M] = re({
1604
1591
  relativeFrom: V.PAGE,
1605
1592
  posOffset: 0
1606
- }), [P, A] = re(!0), [U, N] = re(!0);
1593
+ }), [y, E] = re(!0), [U, N] = re(!0);
1607
1594
  function I(C, R) {
1608
1595
  var b;
1609
1596
  C === "positionH" ? D(R) : M(R);
1610
- const y = t.getFocusDrawings();
1611
- if (y.length === 0)
1597
+ const P = t.getFocusDrawings();
1598
+ if (P.length === 0)
1612
1599
  return;
1613
- const B = y.map((E) => ({
1614
- unitId: E.unitId,
1615
- subUnitId: E.subUnitId,
1616
- drawingId: E.drawingId
1600
+ const B = P.map((A) => ({
1601
+ unitId: A.unitId,
1602
+ subUnitId: A.subUnitId,
1603
+ drawingId: A.drawingId
1617
1604
  }));
1618
1605
  e.executeCommand(qe.id, {
1619
- unitId: y[0].unitId,
1620
- subUnitId: y[0].unitId,
1621
- drawings: B.map((E) => ({
1622
- drawingId: E.drawingId,
1606
+ unitId: P[0].unitId,
1607
+ subUnitId: P[0].unitId,
1608
+ drawings: B.map((A) => ({
1609
+ drawingId: A.drawingId,
1623
1610
  key: C,
1624
1611
  value: R
1625
1612
  }))
@@ -1629,20 +1616,20 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1629
1616
  }
1630
1617
  function L(C) {
1631
1618
  var ie, _e, Se;
1632
- const R = O.relativeFrom, y = O.posOffset, B = Number(C);
1619
+ const R = O.relativeFrom, P = O.posOffset, B = Number(C);
1633
1620
  if (R === B)
1634
1621
  return;
1635
1622
  const k = t.getFocusDrawings();
1636
1623
  if (k.length === 0)
1637
1624
  return;
1638
- const b = k[0].drawingId, E = k[0].unitId;
1625
+ const b = k[0].drawingId, A = k[0].unitId;
1639
1626
  let $ = null, F = 0;
1640
- const Y = (ie = r.getRenderById(E)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Y == null ? void 0 : Y.getSkeletonData();
1627
+ const Z = (ie = r.getRenderById(A)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Z == null ? void 0 : Z.getSkeletonData();
1641
1628
  if (ae == null)
1642
1629
  return;
1643
1630
  const { pages: Ue, skeHeaders: Re, skeFooters: We } = ae;
1644
1631
  for (const de of Ue) {
1645
- const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth: Te } = de;
1632
+ const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ee, pageWidth: Te } = de;
1646
1633
  if (Oe.has(b)) {
1647
1634
  $ = Oe.get(b), F = De;
1648
1635
  break;
@@ -1652,7 +1639,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1652
1639
  $ = le == null ? void 0 : le.skeDrawings.get(b), F = De;
1653
1640
  break;
1654
1641
  }
1655
- const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(Te);
1642
+ const ge = (Se = We.get(Ee)) == null ? void 0 : Se.get(Te);
1656
1643
  if (ge != null && ge.skeDrawings.has(b)) {
1657
1644
  $ = ge == null ? void 0 : ge.skeDrawings.get(b), F = De;
1658
1645
  break;
@@ -1664,60 +1651,60 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1664
1651
  R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -= F), B === ne.COLUMN ? ce += $.columnLeft : B === ne.MARGIN ? ce += F : ne.PAGE;
1665
1652
  const te = {
1666
1653
  relativeFrom: B,
1667
- posOffset: (y != null ? y : 0) - ce
1654
+ posOffset: (P != null ? P : 0) - ce
1668
1655
  };
1669
1656
  I("positionH", te);
1670
1657
  }
1671
1658
  function W(C) {
1672
- var Oe, Ne, Ae, Te, le, ge;
1673
- const R = T.relativeFrom, y = T.posOffset, B = Number(C);
1659
+ var Oe, Ne, Ee, Te, le, ge;
1660
+ const R = T.relativeFrom, P = T.posOffset, B = Number(C);
1674
1661
  if (R === B)
1675
1662
  return;
1676
1663
  const k = t.getFocusDrawings();
1677
1664
  if (k.length === 0)
1678
1665
  return;
1679
- const { drawingId: b, unitId: E } = k[0], $ = o.getUniverDocInstance(E), F = (Oe = r.getRenderById(E)) == null ? void 0 : Oe.with(se).getSkeleton(), Y = (Ne = r.getRenderById(E)) == null ? void 0 : Ne.with(Me), ae = Y == null ? void 0 : Y.getSegment(), Ue = Y == null ? void 0 : Y.getSegmentPage(), Re = (Te = (Ae = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ae.customBlocks) == null ? void 0 : Te.find((Ee) => Ee.blockId === b);
1680
- if (Re == null || F == null || Y == null)
1666
+ const { drawingId: b, unitId: A } = k[0], $ = o.getUniverDocInstance(A), F = (Oe = r.getRenderById(A)) == null ? void 0 : Oe.with(se).getSkeleton(), Z = (Ne = r.getRenderById(A)) == null ? void 0 : Ne.with(Me), ae = Z == null ? void 0 : Z.getSegment(), Ue = Z == null ? void 0 : Z.getSegmentPage(), Re = (Te = (Ee = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ee.customBlocks) == null ? void 0 : Te.find((Ae) => Ae.blockId === b);
1667
+ if (Re == null || F == null || Z == null)
1681
1668
  return;
1682
- const { startIndex: We } = Re, ce = F.findNodeByCharIndex(We, ae, Ue), te = (le = ce == null ? void 0 : ce.parent) == null ? void 0 : le.parent, ie = te == null ? void 0 : te.parent, _e = ie == null ? void 0 : ie.lines.find((Ee) => Ee.paragraphIndex === (te == null ? void 0 : te.paragraphIndex) && Ee.paragraphStart), Se = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
1669
+ const { startIndex: We } = Re, ce = F.findNodeByCharIndex(We, ae, Ue), te = (le = ce == null ? void 0 : ce.parent) == null ? void 0 : le.parent, ie = te == null ? void 0 : te.parent, _e = ie == null ? void 0 : ie.lines.find((Ae) => Ae.paragraphIndex === (te == null ? void 0 : te.paragraphIndex) && Ae.paragraphStart), Se = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
1683
1670
  if (ce == null || te == null || _e == null || ie == null || Se == null)
1684
1671
  return;
1685
1672
  let de = 0;
1686
1673
  R === V.PARAGRAPH ? de -= _e.top : R === V.LINE ? de -= te.top : R === V.PAGE && (de += Se.marginTop), B === V.PARAGRAPH ? de += _e.top : B === V.LINE ? de += te.top : B === V.PAGE && (de -= Se.marginTop);
1687
1674
  const De = {
1688
1675
  relativeFrom: B,
1689
- posOffset: (y != null ? y : 0) - de
1676
+ posOffset: (P != null ? P : 0) - de
1690
1677
  };
1691
1678
  I("positionV", De);
1692
1679
  }
1693
1680
  function x(C) {
1694
- var E;
1695
- const R = c == null ? void 0 : c.getSnapshot(), y = (E = R == null ? void 0 : R.drawings) == null ? void 0 : E[C.drawingId];
1696
- if (y == null)
1681
+ var A;
1682
+ const R = c == null ? void 0 : c.getSnapshot(), P = (A = R == null ? void 0 : R.drawings) == null ? void 0 : A[C.drawingId];
1683
+ if (P == null)
1697
1684
  return;
1698
- const { layoutType: B } = y, {
1685
+ const { layoutType: B } = P, {
1699
1686
  positionH: k,
1700
1687
  positionV: b
1701
- } = y.docTransform;
1702
- D(k), M(b), S(B === H.INLINE), A(b.relativeFrom === V.PARAGRAPH || b.relativeFrom === V.LINE);
1688
+ } = P.docTransform;
1689
+ D(k), M(b), S(B === H.INLINE), E(b.relativeFrom === V.PARAGRAPH || b.relativeFrom === V.LINE);
1703
1690
  }
1704
1691
  function G() {
1705
1692
  const C = t.getFocusDrawings();
1706
1693
  C.length !== 0 && x(C[0]);
1707
1694
  }
1708
1695
  function _(C) {
1709
- A(C), W(String(C ? V.PARAGRAPH : V.PAGE));
1696
+ E(C), W(String(C ? V.PARAGRAPH : V.PAGE));
1710
1697
  }
1711
- return _n(() => {
1698
+ return Sn(() => {
1712
1699
  G();
1713
- const C = t.focus$.subscribe((y) => {
1714
- if (y.length === 0) {
1700
+ const C = t.focus$.subscribe((P) => {
1701
+ if (P.length === 0) {
1715
1702
  N(!1);
1716
1703
  return;
1717
1704
  }
1718
- N(!0), x(y[0]);
1719
- }), R = e.onCommandExecuted(async (y) => {
1720
- y.id === J.id && G();
1705
+ N(!0), x(P[0]);
1706
+ }), R = e.onCommandExecuted(async (P) => {
1707
+ P.id === J.id && G();
1721
1708
  });
1722
1709
  return () => {
1723
1710
  C.unsubscribe(), R.dispose();
@@ -1731,8 +1718,8 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1731
1718
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1732
1719
  ke,
1733
1720
  {
1734
- min: Hn,
1735
- max: Wn,
1721
+ min: Wn,
1722
+ max: Gn,
1736
1723
  precision: 1,
1737
1724
  disabled: w,
1738
1725
  value: O.posOffset,
@@ -1749,7 +1736,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1749
1736
  /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1750
1737
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
1751
1738
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1752
- Bn,
1739
+ Un,
1753
1740
  {
1754
1741
  value: String(O.relativeFrom),
1755
1742
  disabled: w,
@@ -1766,8 +1753,8 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1766
1753
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1767
1754
  ke,
1768
1755
  {
1769
- min: Hn,
1770
- max: Wn,
1756
+ min: Wn,
1757
+ max: Gn,
1771
1758
  precision: 1,
1772
1759
  disabled: w,
1773
1760
  value: T.posOffset,
@@ -1784,7 +1771,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1784
1771
  /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
1785
1772
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
1786
1773
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
1787
- Bn,
1774
+ Un,
1788
1775
  {
1789
1776
  disabled: w,
1790
1777
  value: String(T.relativeFrom),
@@ -1795,16 +1782,16 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1795
1782
  ] }) })
1796
1783
  ] }),
1797
1784
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.options") }) }) }),
1798
- /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(Ci, { disabled: w, checked: P, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
1785
+ /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(Ci, { disabled: w, checked: y, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
1799
1786
  ] });
1800
1787
  }, Je = 0, en = 100, Zi = (i) => {
1801
- const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
1788
+ const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(K), { drawings: s } = i, a = s[0];
1802
1789
  if (a == null)
1803
1790
  return null;
1804
1791
  const { unitId: d } = a, c = o.getUniverDocInstance(d), l = r.getRenderById(d);
1805
1792
  if ((l == null ? void 0 : l.scene) == null)
1806
1793
  return null;
1807
- const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [P, A] = re({
1794
+ const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [y, E] = re({
1808
1795
  distT: 0,
1809
1796
  distL: 0,
1810
1797
  distB: 0,
@@ -1815,14 +1802,14 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1815
1802
  const C = t.getFocusDrawings();
1816
1803
  if (C.length === 0)
1817
1804
  return;
1818
- const { unitId: R, subUnitId: y } = C[0], B = C.map(({ unitId: k, subUnitId: b, drawingId: E }) => ({
1805
+ const { unitId: R, subUnitId: P } = C[0], B = C.map(({ unitId: k, subUnitId: b, drawingId: A }) => ({
1819
1806
  unitId: k,
1820
1807
  subUnitId: b,
1821
- drawingId: E
1808
+ drawingId: A
1822
1809
  }));
1823
- e.executeCommand(Zn.id, {
1810
+ e.executeCommand(Qn.id, {
1824
1811
  unitId: R,
1825
- subUnitId: y,
1812
+ subUnitId: P,
1826
1813
  drawings: B,
1827
1814
  wrappingStyle: _
1828
1815
  });
@@ -1832,12 +1819,12 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1832
1819
  const C = t.getFocusDrawings();
1833
1820
  if (C.length === 0)
1834
1821
  return;
1835
- const R = C.map((y) => ({
1836
- unitId: y.unitId,
1837
- subUnitId: y.subUnitId,
1838
- drawingId: y.drawingId
1822
+ const R = C.map((P) => ({
1823
+ unitId: P.unitId,
1824
+ subUnitId: P.subUnitId,
1825
+ drawingId: P.drawingId
1839
1826
  }));
1840
- e.executeCommand(Jn.id, {
1827
+ e.executeCommand(et.id, {
1841
1828
  unitId: C[0].unitId,
1842
1829
  subUnitId: C[0].unitId,
1843
1830
  drawings: R,
@@ -1847,19 +1834,19 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1847
1834
  function W(_, C) {
1848
1835
  if (_ == null)
1849
1836
  return;
1850
- const R = { ...P, [C]: _ };
1851
- A(R);
1852
- const y = t.getFocusDrawings();
1853
- if (y.length === 0)
1837
+ const R = { ...y, [C]: _ };
1838
+ E(R);
1839
+ const P = t.getFocusDrawings();
1840
+ if (P.length === 0)
1854
1841
  return;
1855
- const B = y.map((k) => ({
1842
+ const B = P.map((k) => ({
1856
1843
  unitId: k.unitId,
1857
1844
  subUnitId: k.subUnitId,
1858
1845
  drawingId: k.drawingId
1859
1846
  }));
1860
- e.executeCommand(Qn.id, {
1861
- unitId: y[0].unitId,
1862
- subUnitId: y[0].unitId,
1847
+ e.executeCommand(Jn.id, {
1848
+ unitId: P[0].unitId,
1849
+ subUnitId: P[0].unitId,
1863
1850
  drawings: B,
1864
1851
  dist: {
1865
1852
  [C]: _
@@ -1871,26 +1858,26 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1871
1858
  _.length !== 0 && G(_[0]);
1872
1859
  }
1873
1860
  function G(_) {
1874
- var Y, ae;
1875
- const C = (ae = (Y = c == null ? void 0 : c.getSnapshot()) == null ? void 0 : Y.drawings) == null ? void 0 : ae[_.drawingId];
1861
+ var Z, ae;
1862
+ const C = (ae = (Z = c == null ? void 0 : c.getSnapshot()) == null ? void 0 : Z.drawings) == null ? void 0 : ae[_.drawingId];
1876
1863
  if (C == null)
1877
1864
  return;
1878
1865
  const {
1879
1866
  distT: R = 0,
1880
- distL: y = 0,
1867
+ distL: P = 0,
1881
1868
  distB: B = 0,
1882
1869
  distR: k = 0,
1883
1870
  layoutType: b = H.INLINE,
1884
- behindDoc: E = oe.FALSE,
1871
+ behindDoc: A = oe.FALSE,
1885
1872
  wrapText: $ = $e.BOTH_SIDES
1886
1873
  } = C;
1887
- if (A({
1874
+ if (E({
1888
1875
  distT: R,
1889
- distL: y,
1876
+ distL: P,
1890
1877
  distB: B,
1891
1878
  distR: k
1892
1879
  }), M($), p(b !== H.WRAP_SQUARE), b === H.WRAP_NONE || b === H.INLINE ? v(!0) : v(!1), b === H.WRAP_NONE || b === H.INLINE || b === H.WRAP_TOP_AND_BOTTOM ? S(!0) : S(!1), b === H.WRAP_NONE)
1893
- E === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
1880
+ A === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
1894
1881
  else
1895
1882
  switch (b) {
1896
1883
  case H.INLINE:
@@ -1906,7 +1893,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1906
1893
  throw new Error(`Unsupported layout type: ${b}`);
1907
1894
  }
1908
1895
  }
1909
- return _n(() => {
1896
+ return Sn(() => {
1910
1897
  x();
1911
1898
  const _ = t.focus$.subscribe((R) => {
1912
1899
  if (R.length === 0) {
@@ -1923,18 +1910,18 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1923
1910
  }, []), /* @__PURE__ */ X("div", { className: j(u.imageCommonPanelGrid, u.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
1924
1911
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.title") }) }) }),
1925
1912
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
1926
- /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { value: O, onChange: I, direction: "vertical", children: [
1927
- /* @__PURE__ */ f(ye, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
1928
- /* @__PURE__ */ f(ye, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
1929
- /* @__PURE__ */ f(ye, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
1930
- /* @__PURE__ */ f(ye, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
1931
- /* @__PURE__ */ f(ye, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
1913
+ /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(kn, { value: O, onChange: I, direction: "vertical", children: [
1914
+ /* @__PURE__ */ f(Pe, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
1915
+ /* @__PURE__ */ f(Pe, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
1916
+ /* @__PURE__ */ f(Pe, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
1917
+ /* @__PURE__ */ f(Pe, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
1918
+ /* @__PURE__ */ f(Pe, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
1932
1919
  ] }) }) }),
1933
1920
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
1934
- /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { disabled: g, value: T, onChange: L, direction: "horizontal", children: [
1935
- /* @__PURE__ */ f(ye, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
1936
- /* @__PURE__ */ f(ye, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
1937
- /* @__PURE__ */ f(ye, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
1921
+ /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(kn, { disabled: g, value: T, onChange: L, direction: "horizontal", children: [
1922
+ /* @__PURE__ */ f(Pe, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
1923
+ /* @__PURE__ */ f(Pe, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
1924
+ /* @__PURE__ */ f(Pe, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
1938
1925
  ] }) }) }),
1939
1926
  /* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
1940
1927
  /* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
@@ -1947,7 +1934,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1947
1934
  max: en,
1948
1935
  disabled: h,
1949
1936
  precision: 1,
1950
- value: P.distT,
1937
+ value: y.distT,
1951
1938
  onChange: (_) => {
1952
1939
  W(_, "distT");
1953
1940
  },
@@ -1964,7 +1951,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1964
1951
  max: en,
1965
1952
  disabled: w,
1966
1953
  precision: 1,
1967
- value: P.distL,
1954
+ value: y.distL,
1968
1955
  onChange: (_) => {
1969
1956
  W(_, "distL");
1970
1957
  },
@@ -1983,7 +1970,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
1983
1970
  max: en,
1984
1971
  disabled: h,
1985
1972
  precision: 1,
1986
- value: P.distB,
1973
+ value: y.distB,
1987
1974
  onChange: (_) => {
1988
1975
  W(_, "distB");
1989
1976
  },
@@ -2000,7 +1987,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2000
1987
  max: en,
2001
1988
  disabled: w,
2002
1989
  precision: 1,
2003
- value: P.distR,
1990
+ value: y.distR,
2004
1991
  onChange: (_) => {
2005
1992
  W(_, "distR");
2006
1993
  },
@@ -2012,7 +1999,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2012
1999
  ] });
2013
2000
  }, Qi = () => {
2014
2001
  const i = we(Ie), e = i.getFocusDrawings(), [n, t] = re(e);
2015
- return _n(() => {
2002
+ return Sn(() => {
2016
2003
  const r = i.focus$.subscribe((o) => {
2017
2004
  t(o);
2018
2005
  });
@@ -2020,12 +2007,12 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2020
2007
  r.unsubscribe();
2021
2008
  };
2022
2009
  }, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className: u.imageCommonPanel, children: [
2023
- /* @__PURE__ */ f(Xt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2010
+ /* @__PURE__ */ f(qt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
2024
2011
  /* @__PURE__ */ f(Zi, { drawings: n }),
2025
2012
  /* @__PURE__ */ f(Yi, { drawings: n })
2026
2013
  ] });
2027
- }, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id, Ji = (i) => {
2028
- const e = i.get(In), n = i.get(Q);
2014
+ }, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = gt.id, Ji = (i) => {
2015
+ const e = i.get(_n), n = i.get(K);
2029
2016
  return new Si((t) => {
2030
2017
  const r = e.textSelection$.subscribe(() => {
2031
2018
  var s;
@@ -2051,19 +2038,19 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
2051
2038
  function er(i) {
2052
2039
  return {
2053
2040
  id: pt,
2054
- type: zn.SUBITEMS,
2041
+ type: qn.SUBITEMS,
2055
2042
  icon: ht,
2056
2043
  tooltip: "docImage.title",
2057
2044
  disabled$: Ji(i),
2058
- hidden$: $n(i, be.UNIVER_DOC)
2045
+ hidden$: zn(i, be.UNIVER_DOC, void 0, In)
2059
2046
  };
2060
2047
  }
2061
2048
  function nr(i) {
2062
2049
  return {
2063
2050
  id: wt,
2064
2051
  title: "docImage.upload.float",
2065
- type: zn.BUTTON,
2066
- hidden$: $n(i, be.UNIVER_DOC)
2052
+ type: qn.BUTTON,
2053
+ hidden$: zn(i, be.UNIVER_DOC, void 0, In)
2067
2054
  };
2068
2055
  }
2069
2056
  const tr = {
@@ -2122,7 +2109,7 @@ const ir = {
2122
2109
  direction: fe.RIGHT
2123
2110
  }
2124
2111
  }, ar = {
2125
- id: ot.id,
2112
+ id: st.id,
2126
2113
  description: "shortcut.doc.drawing-delete",
2127
2114
  group: "4_doc-drawing-view",
2128
2115
  // when focusing on any other input tag do not trigger this shortcut
@@ -2141,30 +2128,30 @@ let an = class extends Xe {
2141
2128
  }
2142
2129
  _initCustomComponents() {
2143
2130
  const i = this._componentManager;
2144
- this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt, Qi));
2131
+ this.disposeWithMe(i.register(ht, ot)), this.disposeWithMe(i.register(mt, Qi));
2145
2132
  }
2146
2133
  _initMenus() {
2147
2134
  this._menuManagerService.mergeMenu(tr);
2148
2135
  }
2149
2136
  _initCommands() {
2150
2137
  [
2151
- lt,
2152
- at,
2153
- Zn,
2138
+ gt,
2139
+ ct,
2154
2140
  Qn,
2155
2141
  Jn,
2156
- qe,
2157
2142
  et,
2143
+ qe,
2158
2144
  nt,
2159
- Sn,
2160
- mt,
2161
- Hi,
2145
+ tt,
2146
+ Cn,
2162
2147
  ut,
2163
- st,
2164
- dt,
2148
+ Hi,
2149
+ ft,
2150
+ at,
2151
+ lt,
2165
2152
  Ke,
2166
- ot,
2167
- ct
2153
+ st,
2154
+ dt
2168
2155
  ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2169
2156
  }
2170
2157
  _initShortcuts() {
@@ -2201,7 +2188,7 @@ let cn = class extends Nt {
2201
2188
  this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = t, this._univerInstanceService = r, this._contextService = o, this._init();
2202
2189
  }
2203
2190
  _init() {
2204
- this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
2191
+ this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(xn(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(xn(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
2205
2192
  }
2206
2193
  _dispose(e) {
2207
2194
  const n = e.getUnitId();
@@ -2216,7 +2203,7 @@ let cn = class extends Nt {
2216
2203
  _hasCropObject(e) {
2217
2204
  const n = e.getAllObjects();
2218
2205
  for (const t of n)
2219
- if (t instanceof Kt)
2206
+ if (t instanceof Xt)
2220
2207
  return !0;
2221
2208
  return !1;
2222
2209
  }
@@ -2247,7 +2234,7 @@ let cn = class extends Nt {
2247
2234
  const { unitId: l, subUnitId: m, drawingId: g } = c, p = this._canvasPopManagerService.attachPopupToObject(
2248
2235
  a,
2249
2236
  {
2250
- componentKey: Yt,
2237
+ componentKey: Kt,
2251
2238
  direction: "horizontal",
2252
2239
  offset: [2, 0],
2253
2240
  extraProps: {
@@ -2288,21 +2275,21 @@ let cn = class extends Nt {
2288
2275
  {
2289
2276
  label: "image-popup.edit",
2290
2277
  index: 0,
2291
- commandId: ut.id,
2278
+ commandId: ft.id,
2292
2279
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2293
- disable: !!At.includes(e)
2280
+ disable: !!Et.includes(e)
2294
2281
  },
2295
2282
  {
2296
2283
  label: "image-popup.delete",
2297
2284
  index: 1,
2298
- commandId: Sn.id,
2285
+ commandId: Cn.id,
2299
2286
  commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: n, drawingId: t }] },
2300
2287
  disable: !1
2301
2288
  },
2302
2289
  {
2303
2290
  label: "image-popup.crop",
2304
2291
  index: 2,
2305
- commandId: Zt.id,
2292
+ commandId: Yt.id,
2306
2293
  commandParams: { unitId: e, subUnitId: n, drawingId: t },
2307
2294
  disable: !0
2308
2295
  // TODO: @JOCS, feature is not ready.
@@ -2310,7 +2297,7 @@ let cn = class extends Nt {
2310
2297
  {
2311
2298
  label: "image-popup.reset",
2312
2299
  index: 3,
2313
- commandId: Qt.id,
2300
+ commandId: Zt.id,
2314
2301
  commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
2315
2302
  disable: !0
2316
2303
  // TODO: @JOCS, feature is not ready.
@@ -2322,8 +2309,8 @@ cn = gr([
2322
2309
  je(0, Ie),
2323
2310
  je(1, ve(wi)),
2324
2311
  je(2, ee),
2325
- je(3, Q),
2326
- je(4, Vn)
2312
+ je(3, K),
2313
+ je(4, jn)
2327
2314
  ], cn);
2328
2315
  var mr = Object.getOwnPropertyDescriptor, ur = (i, e, n, t) => {
2329
2316
  for (var r = t > 1 ? void 0 : t ? mr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
@@ -2333,7 +2320,7 @@ var mr = Object.getOwnPropertyDescriptor, ur = (i, e, n, t) => {
2333
2320
  let wn = class extends Xe {
2334
2321
  constructor(e, n, t, r, o, s, a, d) {
2335
2322
  super();
2336
- Ce(this, "_liquid", new jn());
2323
+ Ce(this, "_liquid", new $n());
2337
2324
  this._context = e, this._docSkeletonManagerService = n, this._commandService = t, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = s, this._univerInstanceService = a, this._lifecycleService = d, this._initialize(), this._commandExecutedListener();
2338
2325
  }
2339
2326
  _initialize() {
@@ -2357,7 +2344,7 @@ let wn = class extends Xe {
2357
2344
  const a = this._docSkeletonManagerService.getSkeleton();
2358
2345
  if (a == null)
2359
2346
  return;
2360
- if (this._editorService.isEditor(o) && o !== xt) {
2347
+ if (this._editorService.isEditor(o) && o !== In) {
2361
2348
  s == null || s.makeDirty();
2362
2349
  return;
2363
2350
  }
@@ -2368,9 +2355,9 @@ let wn = class extends Xe {
2368
2355
  }
2369
2356
  _initResize() {
2370
2357
  this.disposeWithMe(
2371
- Lt(this._context.engine.onTransformChange$).pipe(
2372
- xn((e) => e.type === ii.resize),
2373
- qn(16)
2358
+ xt(this._context.engine.onTransformChange$).pipe(
2359
+ Ln((e) => e.type === ii.resize),
2360
+ Xn(16)
2374
2361
  ).subscribe(() => {
2375
2362
  var t;
2376
2363
  const e = this._docSkeletonManagerService.getSkeleton(), { scene: n } = this._context;
@@ -2386,9 +2373,9 @@ let wn = class extends Xe {
2386
2373
  const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters: p } = n, h = {};
2387
2374
  this._liquid.reset();
2388
2375
  for (let T = 0, M = m.length; T < M; T++) {
2389
- const P = m[T], { headerId: A, footerId: U, pageWidth: N } = P;
2390
- if (A) {
2391
- const I = (O = g.get(A)) == null ? void 0 : O.get(N);
2376
+ const y = m[T], { headerId: E, footerId: U, pageWidth: N } = y;
2377
+ if (E) {
2378
+ const I = (O = g.get(E)) == null ? void 0 : O.get(N);
2392
2379
  I && this._calculateDrawingPosition(
2393
2380
  r,
2394
2381
  I,
@@ -2396,7 +2383,7 @@ let wn = class extends Xe {
2396
2383
  a,
2397
2384
  h,
2398
2385
  I.marginTop,
2399
- P.marginLeft
2386
+ y.marginLeft
2400
2387
  );
2401
2388
  }
2402
2389
  if (U) {
@@ -2407,11 +2394,11 @@ let wn = class extends Xe {
2407
2394
  s,
2408
2395
  a,
2409
2396
  h,
2410
- P.pageHeight - P.marginBottom + I.marginTop,
2411
- P.marginLeft
2397
+ y.pageHeight - y.marginBottom + I.marginTop,
2398
+ y.marginLeft
2412
2399
  );
2413
2400
  }
2414
- this._calculateDrawingPosition(r, P, s, a, h, P.marginTop, P.marginLeft), this._liquid.translatePage(P, d, c, l);
2401
+ this._calculateDrawingPosition(r, y, s, a, h, y.marginTop, y.marginLeft), this._liquid.translatePage(y, d, c, l);
2415
2402
  }
2416
2403
  const v = Object.values(h), w = v.filter((T) => !T.isMultiTransform), S = v.filter((T) => T.isMultiTransform);
2417
2404
  w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(S);
@@ -2461,9 +2448,9 @@ let wn = class extends Xe {
2461
2448
  const n = this._docSkeletonManagerService.getSkeleton();
2462
2449
  n != null && (this._refreshDrawing(n), this._drawingManagerService.initializeNotification(this._context.unitId));
2463
2450
  };
2464
- this._lifecycleService.stage === Tn.Steady ? setTimeout(() => {
2451
+ this._lifecycleService.stage === Pn.Steady ? setTimeout(() => {
2465
2452
  e();
2466
- }, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n === Tn.Steady)).subscribe(e);
2453
+ }, 1e3) : this._lifecycleService.lifecycle$.pipe(Ln((n) => n === Pn.Steady)).subscribe(e);
2467
2454
  }
2468
2455
  };
2469
2456
  wn = ur([
@@ -2472,8 +2459,8 @@ wn = ur([
2472
2459
  xe(3, vi),
2473
2460
  xe(4, Ie),
2474
2461
  xe(5, ve(gn)),
2475
- xe(6, Q),
2476
- xe(7, ve(Et))
2462
+ xe(6, K),
2463
+ xe(7, ve(At))
2477
2464
  ], wn);
2478
2465
  var fr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, pr = (i, e, n) => e in i ? fr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, wr = (i, e, n, t) => {
2479
2466
  for (var r = t > 1 ? void 0 : t ? hr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
@@ -2481,12 +2468,12 @@ var fr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, pr = (i, e
2481
2468
  return r;
2482
2469
  }, pn = (i, e) => (n, t) => e(n, t, i), vt = (i, e, n) => pr(i, typeof e != "symbol" ? e + "" : e, n);
2483
2470
  const vr = "DOC_DRAWING_UI_PLUGIN";
2484
- let dn = class extends Ft {
2485
- constructor(i = kn, e, n, t) {
2471
+ let dn = class extends kt {
2472
+ constructor(i = Fn, e, n, t) {
2486
2473
  super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
2487
- const { ...r } = Ht(
2474
+ const { ...r } = Ft(
2488
2475
  {},
2489
- kn,
2476
+ Fn,
2490
2477
  this._config
2491
2478
  );
2492
2479
  this._configService.setConfig(Oi, r);
@@ -2513,23 +2500,23 @@ let dn = class extends Ft {
2513
2500
  vt(dn, "type", be.UNIVER_DOC);
2514
2501
  vt(dn, "pluginName", vr);
2515
2502
  dn = wr([
2516
- Bt(Jt, qt, Wt, gi),
2517
- pn(1, ve(Ut)),
2503
+ Lt(Qt, zt, Ht, gi),
2504
+ pn(1, ve(Bt)),
2518
2505
  pn(2, ee),
2519
- pn(3, kt)
2506
+ pn(3, Ut)
2520
2507
  ], dn);
2521
2508
  export {
2522
2509
  Hi as ClearDocDrawingTransformerOperation,
2523
2510
  pt as DOCS_IMAGE_MENU_ID,
2524
- ot as DeleteDocDrawingsCommand,
2525
- ut as EditDocDrawingOperation,
2526
- st as GroupDocDrawingCommand,
2527
- at as InsertDocDrawingCommand,
2528
- lt as InsertDocImageCommand,
2511
+ st as DeleteDocDrawingsCommand,
2512
+ ft as EditDocDrawingOperation,
2513
+ at as GroupDocDrawingCommand,
2514
+ ct as InsertDocDrawingCommand,
2515
+ gt as InsertDocImageCommand,
2529
2516
  Ke as MoveDocDrawingsCommand,
2530
- Sn as RemoveDocDrawingCommand,
2531
- ct as SetDocDrawingArrangeCommand,
2532
- mt as SidebarDocDrawingOperation,
2533
- dt as UngroupDocDrawingCommand,
2517
+ Cn as RemoveDocDrawingCommand,
2518
+ dt as SetDocDrawingArrangeCommand,
2519
+ ut as SidebarDocDrawingOperation,
2520
+ lt as UngroupDocDrawingCommand,
2534
2521
  dn as UniverDocsDrawingUIPlugin
2535
2522
  };