@univerjs/slides-ui 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,30 +1,30 @@
1
- var cn = Object.defineProperty;
2
- var an = (i, e, t) => e in i ? cn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var S = (i, e, t) => an(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as z, Injector as ke, IUniverInstanceService as w, RxDisposable as pe, UniverInstanceType as E, debounce as ln, getColorStyle as dn, CommandType as D, PageElementType as De, merge as St, LocaleService as J, ICommandService as U, generateRandomId as ze, BasicShapes as It, createInternalEditorID as un, createIdentifier as bt, IContextService as fe, DocumentFlavor as hn, FOCUSING_UNIVER_EDITOR as Et, EDITOR_ACTIVATED as Re, FORMULA_EDITOR_ACTIVATED as gn, Disposable as Ue, DisposableCollection as Ke, toDisposable as Rt, FOCUSING_COMMON_DRAWINGS as vn, FOCUSING_EDITOR_STANDALONE as xt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Ot, DocumentDataModel as pn, HorizontalAlign as wt, VerticalAlign as xe, IUndoRedoService as fn, WrapStrategy as tt, FOCUSING_EDITOR_BUT_HIDDEN as _n, DEFAULT_EMPTY_DOCUMENT_VALUE as mn, Direction as V, Plugin as Cn, mergeOverrideWithDependencies as nt, IConfigService as Sn } from "@univerjs/core";
5
- import { IRenderManagerService as K, Viewport as it, ScrollBar as yt, getCurrentTypeOfRenderer as Le, Slide as In, Rect as Pt, Scene as bn, ObjectType as de, FIX_ONE_PIXEL_BLUR_OFFSET as ne, DeviceInputEventType as Y, pxToNum as En, convertTextRotation as rt, fixLineWidthByScale as st } from "@univerjs/engine-render";
6
- import { ObjectProvider as Rn, SLIDE_KEY as ie } from "@univerjs/slides";
7
- import { DRAWING_IMAGE_ALLOW_IMAGE_LIST as xn, IImageIoService as On, getImageSize as wn } from "@univerjs/drawing";
8
- import { ILocalFileService as yn, useDependency as O, ISidebarService as Tt, getMenuHiddenObservable as re, MenuItemType as se, RibbonStartGroup as Pn, useObservable as Tn, DISABLE_AUTO_FOCUS_KEY as ot, KeyCode as y, MetaKeys as Mn, IMenuManagerService as Dn, ComponentManager as Un, IUIPartsService as Nn, IShortcutService as Vn, BuiltInUIPart as ct, connectInjector as at, ICanvasPopupService as jn, ILayoutService as An } from "@univerjs/ui";
1
+ var an = Object.defineProperty;
2
+ var ln = (i, e, t) => e in i ? an(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var S = (i, e, t) => ln(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Inject as z, Injector as ke, IUniverInstanceService as w, RxDisposable as fe, UniverInstanceType as E, debounce as dn, getColorStyle as un, CommandType as D, PageElementType as De, merge as It, LocaleService as J, ICommandService as N, generateRandomId as ze, BasicShapes as bt, createInternalEditorID as hn, createIdentifier as Et, IContextService as _e, DocumentFlavor as gn, FOCUSING_UNIVER_EDITOR as Rt, EDITOR_ACTIVATED as Re, FORMULA_EDITOR_ACTIVATED as vn, Disposable as Ne, FOCUSING_EDITOR_STANDALONE as xt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Ot, DocumentDataModel as pn, HorizontalAlign as wt, VerticalAlign as xe, IUndoRedoService as fn, DisposableCollection as Ke, WrapStrategy as tt, FOCUSING_EDITOR_BUT_HIDDEN as _n, DEFAULT_EMPTY_DOCUMENT_VALUE as mn, Direction as V, toDisposable as yt, FOCUSING_COMMON_DRAWINGS as Cn, Plugin as Sn, mergeOverrideWithDependencies as nt, IConfigService as In } from "@univerjs/core";
5
+ import { IRenderManagerService as K, Viewport as it, ScrollBar as Pt, getCurrentTypeOfRenderer as Le, Slide as bn, Rect as Tt, Scene as En, ObjectType as ue, FIX_ONE_PIXEL_BLUR_OFFSET as ie, DeviceInputEventType as Y, convertTextRotation as rt, fixLineWidthByScale as st, pxToNum as Rn } from "@univerjs/engine-render";
6
+ import { ObjectProvider as xn, SLIDE_KEY as re } from "@univerjs/slides";
7
+ import { DRAWING_IMAGE_ALLOW_IMAGE_LIST as On, IImageIoService as wn, getImageSize as yn } from "@univerjs/drawing";
8
+ import { ILocalFileService as Pn, useDependency as O, ISidebarService as Mt, getMenuHiddenObservable as se, MenuItemType as oe, RibbonStartGroup as Tn, useObservable as Mn, DISABLE_AUTO_FOCUS_KEY as ot, KeyCode as y, MetaKeys as Dn, IMenuManagerService as Nn, ComponentManager as Un, IUIPartsService as Vn, IShortcutService as jn, BuiltInUIPart as ct, connectInjector as at, ILayoutService as An, ICanvasPopupService as Ln } from "@univerjs/ui";
9
9
  import { jsxs as R, jsx as g } from "react/jsx-runtime";
10
- import { Button as Ce, clsx as k, Dropdown as Mt, ColorPicker as Ln, borderTopClassName as Dt, InputNumber as le, borderClassName as he, scrollbarClassName as $n } from "@univerjs/design";
11
- import { useRef as Ut, createElement as H, forwardRef as Z, useState as $, useEffect as ge, useMemo as Bn, createRef as Hn, useCallback as lt } from "react";
12
- import { IEditorService as Ze, DeleteLeftCommand as Fn, DocSelectionRenderService as dt, VIEWPORT_KEY as ut, DOCS_COMPONENT_MAIN_LAYER_INDEX as Wn, MoveSelectionOperation as kn, MoveCursorOperation as zn, DOCS_VIEW_KEY as Kn } from "@univerjs/docs-ui";
13
- import { BehaviorSubject as q, Subject as Nt, filter as Zn, takeUntil as ht } from "rxjs";
14
- import { DocSelectionManagerService as Gn, DocSkeletonManagerService as gt, RichTextEditingMutation as Xn } from "@univerjs/docs";
15
- var Yn = Object.getOwnPropertyDescriptor, qn = (i, e, t, n) => {
16
- for (var r = n > 1 ? void 0 : n ? Yn(e, t) : e, s = i.length - 1, o; s >= 0; s--)
10
+ import { Button as Se, clsx as k, Dropdown as Dt, ColorPicker as $n, borderTopClassName as Nt, InputNumber as de, borderClassName as ge, scrollbarClassName as Bn } from "@univerjs/design";
11
+ import { useRef as Ut, createElement as H, forwardRef as Z, useState as $, useEffect as ve, useMemo as Hn, createRef as Fn, useCallback as lt } from "react";
12
+ import { IEditorService as Ze, DeleteLeftCommand as Wn, DocSelectionRenderService as dt, VIEWPORT_KEY as ut, DOCS_COMPONENT_MAIN_LAYER_INDEX as kn, MoveSelectionOperation as zn, MoveCursorOperation as Kn, DOCS_VIEW_KEY as Zn } from "@univerjs/docs-ui";
13
+ import { BehaviorSubject as q, Subject as Vt, filter as Gn, takeUntil as ht } from "rxjs";
14
+ import { DocSelectionManagerService as Xn, DocSkeletonManagerService as gt, RichTextEditingMutation as Yn } from "@univerjs/docs";
15
+ var qn = Object.getOwnPropertyDescriptor, Jn = (i, e, t, n) => {
16
+ for (var r = n > 1 ? void 0 : n ? qn(e, t) : e, s = i.length - 1, o; s >= 0; s--)
17
17
  (o = i[s]) && (r = o(r) || r);
18
18
  return r;
19
- }, Ne = (i, e) => (t, n) => e(t, n, i);
20
- let ve = class extends pe {
19
+ }, Ue = (i, e) => (t, n) => e(t, n, i);
20
+ let pe = class extends fe {
21
21
  constructor(e, t, n, r) {
22
22
  super();
23
23
  S(this, "_objectProvider", null);
24
- S(this, "_refreshThumb", ln(() => {
24
+ S(this, "_refreshThumb", dn(() => {
25
25
  this.createThumbs();
26
26
  }, 300));
27
- this._renderContext = e, this._injector = t, this._univerInstanceService = n, this._renderManagerService = r, this._objectProvider = this._injector.createInstance(Rn), this._addNewRender();
27
+ this._renderContext = e, this._injector = t, this._univerInstanceService = n, this._renderManagerService = r, this._objectProvider = this._injector.createInstance(xn), this._addNewRender();
28
28
  }
29
29
  _addNewRender() {
30
30
  const { unitId: e, engine: t, scene: n } = this._renderContext, r = this._getCurrUnitModel();
@@ -37,7 +37,7 @@ let ve = class extends pe {
37
37
  this.createThumbs();
38
38
  }, 300);
39
39
  });
40
- const o = new it(ie.VIEW, n, {
40
+ const o = new it(re.VIEW, n, {
41
41
  left: 0,
42
42
  top: 0,
43
43
  bottom: 0,
@@ -56,7 +56,7 @@ let ve = class extends pe {
56
56
  o.onMouseWheel(l, u);
57
57
  }), n.onFileLoaded$.subscribeEvent(() => {
58
58
  this._refreshThumb();
59
- }), yt.attachTo(o);
59
+ }), Pt.attachTo(o);
60
60
  const c = this._createSlide(n);
61
61
  this._renderContext.mainComponent = c, this._createSlidePages(r, c), this.createThumbs(), t.runRenderLoop(() => {
62
62
  n.render();
@@ -64,7 +64,7 @@ let ve = class extends pe {
64
64
  }
65
65
  _scrollToCenter() {
66
66
  var a;
67
- const e = (a = this._currentRender()) == null ? void 0 : a.scene, t = e == null ? void 0 : e.getViewport(ie.VIEW), n = this._getCenterPositionViewPort(e);
67
+ const e = (a = this._currentRender()) == null ? void 0 : a.scene, t = e == null ? void 0 : e.getViewport(re.VIEW), n = this._getCenterPositionViewPort(e);
68
68
  if (!t || !n) return;
69
69
  const { left: r, top: s } = n, { x: o, y: c } = t.transViewportScroll2ScrollValue(r, s);
70
70
  t.scrollToBarPos({
@@ -79,7 +79,7 @@ let ve = class extends pe {
79
79
  * @param mainScene
80
80
  */
81
81
  _createSlide(e) {
82
- const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), { width: n, height: r } = e, s = t.getPageSize(), { width: o = 100, height: c = 100 } = s, a = new In(ie.COMPONENT, {
82
+ const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), { width: n, height: r } = e, s = t.getPageSize(), { width: o = 100, height: c = 100 } = s, a = new bn(re.COMPONENT, {
83
83
  left: (n - o) / 2,
84
84
  top: (r - c) / 2,
85
85
  width: o,
@@ -89,14 +89,14 @@ let ve = class extends pe {
89
89
  return a.enableSelectedClipElement(), e.addObject(a), a;
90
90
  }
91
91
  _addBackgroundRect(e, t) {
92
- const r = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: o = 0 } = r, c = new Pt("canvas", {
92
+ const r = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: o = 0 } = r, c = new Tt("canvas", {
93
93
  left: 0,
94
94
  top: 0,
95
95
  width: s,
96
96
  height: o,
97
97
  strokeWidth: 1,
98
98
  stroke: "rgba(198,198,198,1)",
99
- fill: dn(t) || "rgba(255,255,255,1)",
99
+ fill: un(t) || "rgba(255,255,255,1)",
100
100
  zIndex: 0,
101
101
  evented: !1
102
102
  });
@@ -183,7 +183,7 @@ let ve = class extends pe {
183
183
  const n = this._renderContext;
184
184
  if (!n || !this._objectProvider)
185
185
  return;
186
- const { scene: r, mainComponent: s } = n, o = s, { width: c, height: a } = o, u = new bn(e, o, {
186
+ const { scene: r, mainComponent: s } = n, o = s, { width: c, height: a } = o, u = new En(e, o, {
187
187
  width: c,
188
188
  height: a
189
189
  });
@@ -249,22 +249,22 @@ let ve = class extends pe {
249
249
  s && o && s.addPageScene(o), e.appendPage(t), e.setActivePage(t);
250
250
  }
251
251
  };
252
- ve = qn([
253
- Ne(1, z(ke)),
254
- Ne(2, w),
255
- Ne(3, K)
256
- ], ve);
257
- var Jn = Object.getOwnPropertyDescriptor, Qn = (i, e, t, n) => {
258
- for (var r = n > 1 ? void 0 : n ? Jn(e, t) : e, s = i.length - 1, o; s >= 0; s--)
252
+ pe = Jn([
253
+ Ue(1, z(ke)),
254
+ Ue(2, w),
255
+ Ue(3, K)
256
+ ], pe);
257
+ var Qn = Object.getOwnPropertyDescriptor, ei = (i, e, t, n) => {
258
+ for (var r = n > 1 ? void 0 : n ? Qn(e, t) : e, s = i.length - 1, o; s >= 0; s--)
259
259
  (o = i[s]) && (r = o(r) || r);
260
260
  return r;
261
- }, ei = (i, e) => (t, n) => e(t, n, i);
262
- let P = class extends pe {
261
+ }, ti = (i, e) => (t, n) => e(t, n, i);
262
+ let P = class extends fe {
263
263
  constructor(i) {
264
264
  super(), this._renderManagerService = i;
265
265
  }
266
266
  _getSlideRenderControllerFromRenderUnit(i) {
267
- return this._renderManagerService.getRenderById(i).with(ve);
267
+ return this._renderManagerService.getRenderById(i).with(pe);
268
268
  }
269
269
  createThumbs(i) {
270
270
  this._getSlideRenderControllerFromRenderUnit(i).createThumbs();
@@ -291,10 +291,10 @@ let P = class extends pe {
291
291
  this._getSlideRenderControllerFromRenderUnit(i).appendPage();
292
292
  }
293
293
  };
294
- P = Qn([
295
- ei(0, K)
294
+ P = ei([
295
+ ti(0, K)
296
296
  ], P);
297
- const Vt = {
297
+ const jt = {
298
298
  id: "slide.operation.activate-slide",
299
299
  type: D.OPERATION,
300
300
  handler: (i, e) => {
@@ -306,14 +306,14 @@ const Vt = {
306
306
  const a = (l = c.scene) == null ? void 0 : l.getTransformer();
307
307
  return a && a.clearControls(), n.activePage(e.id, t), !0;
308
308
  }
309
- }, jt = {
309
+ }, At = {
310
310
  id: "slide.operation.append-slide",
311
311
  type: D.OPERATION,
312
312
  handler: (i, e) => {
313
313
  const t = e.unitId;
314
314
  return i.get(w).getUnit(t) ? (i.get(P).appendPage(t), !0) : !1;
315
315
  }
316
- }, At = {
316
+ }, Lt = {
317
317
  id: "slide.operation.delete-element",
318
318
  type: D.OPERATION,
319
319
  handler: (i, e) => {
@@ -327,17 +327,17 @@ const Vt = {
327
327
  id: "slide.command.insert-float-image",
328
328
  type: D.COMMAND,
329
329
  handler: async (i, e) => {
330
- var N;
331
- const t = i.get(w), n = (N = t.getCurrentUnitForType(E.UNIVER_SLIDE)) == null ? void 0 : N.getUnitId();
330
+ var U;
331
+ const t = i.get(w), n = (U = t.getCurrentUnitForType(E.UNIVER_SLIDE)) == null ? void 0 : U.getUnitId();
332
332
  if (!n) return !1;
333
- const s = await i.get(yn).openFile({
333
+ const s = await i.get(Pn).openFile({
334
334
  multiple: !0,
335
- accept: xn.map((x) => `.${x.replace("image/", "")}`).join(",")
335
+ accept: On.map((x) => `.${x.replace("image/", "")}`).join(",")
336
336
  });
337
337
  if (s.length !== 1) return !1;
338
- const c = await i.get(On).saveImage(s[0]);
338
+ const c = await i.get(wn).saveImage(s[0]);
339
339
  if (!c) return !1;
340
- const { imageId: a, imageSourceType: u, source: l, base64Cache: d } = c, { width: v, height: _, image: f } = await wn(d || ""), p = t.getUnit(n);
340
+ const { imageId: a, imageSourceType: u, source: l, base64Cache: d } = c, { width: v, height: _, image: f } = await yn(d || ""), p = t.getUnit(n);
341
341
  if (!p) return !1;
342
342
  const h = p.getActivePage(), m = Object.values(h.pageElements), I = m != null && m.length ? Math.max(...m.map((x) => x.zIndex)) : 20, b = {
343
343
  id: a,
@@ -365,8 +365,8 @@ const Vt = {
365
365
  }
366
366
  };
367
367
  function F({ ref: i, ...e }) {
368
- const { icon: t, id: n, className: r, extend: s, ...o } = e, c = `univerjs-icon univerjs-icon-${n} ${r || ""}`.trim(), a = Ut(`_${ii()}`);
369
- return Lt(t, `${n}`, {
368
+ const { icon: t, id: n, className: r, extend: s, ...o } = e, c = `univerjs-icon univerjs-icon-${n} ${r || ""}`.trim(), a = Ut(`_${ri()}`);
369
+ return $t(t, `${n}`, {
370
370
  defIds: t.defIds,
371
371
  idSuffix: a.current
372
372
  }, {
@@ -375,14 +375,14 @@ function F({ ref: i, ...e }) {
375
375
  ...o
376
376
  }, s);
377
377
  }
378
- function Lt(i, e, t, n, r) {
378
+ function $t(i, e, t, n, r) {
379
379
  return H(i.tag, {
380
380
  key: e,
381
- ...ti(i, t, r),
381
+ ...ni(i, t, r),
382
382
  ...n
383
- }, (ni(i, t).children || []).map((s, o) => Lt(s, `${e}-${i.tag}-${o}`, t, void 0, r)));
383
+ }, (ii(i, t).children || []).map((s, o) => $t(s, `${e}-${i.tag}-${o}`, t, void 0, r)));
384
384
  }
385
- function ti(i, e, t) {
385
+ function ni(i, e, t) {
386
386
  const n = { ...i.attrs };
387
387
  t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(([s, o]) => {
388
388
  s === "mask" && typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
@@ -392,7 +392,7 @@ function ti(i, e, t) {
392
392
  typeof o == "string" && (n[s] = o.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
393
393
  })), n;
394
394
  }
395
- function ni(i, e) {
395
+ function ii(i, e) {
396
396
  var n;
397
397
  const { defIds: t } = e;
398
398
  return !t || t.length === 0 ? i : i.tag === "defs" && ((n = i.children) != null && n.length) ? {
@@ -406,11 +406,11 @@ function ni(i, e) {
406
406
  } : r)
407
407
  } : i;
408
408
  }
409
- function ii() {
409
+ function ri() {
410
410
  return Math.random().toString(36).substring(2, 8);
411
411
  }
412
412
  F.displayName = "UniverIcon";
413
- const ri = {
413
+ const si = {
414
414
  tag: "svg",
415
415
  attrs: {
416
416
  xmlns: "http://www.w3.org/2000/svg",
@@ -453,15 +453,15 @@ const ri = {
453
453
  }
454
454
  }
455
455
  ]
456
- }, $t = Z(function(e, t) {
456
+ }, Bt = Z(function(e, t) {
457
457
  return H(F, Object.assign({}, e, {
458
458
  id: "bottom-icon",
459
459
  ref: t,
460
- icon: ri
460
+ icon: si
461
461
  }));
462
462
  });
463
- $t.displayName = "BottomIcon";
464
- const si = {
463
+ Bt.displayName = "BottomIcon";
464
+ const oi = {
465
465
  tag: "svg",
466
466
  attrs: {
467
467
  xmlns: "http://www.w3.org/2000/svg",
@@ -499,15 +499,15 @@ const si = {
499
499
  }]
500
500
  }],
501
501
  defIds: ["graph-icon_clip0_1293_28"]
502
- }, Bt = Z(function(e, t) {
502
+ }, Ht = Z(function(e, t) {
503
503
  return H(F, Object.assign({}, e, {
504
504
  id: "graph-icon",
505
505
  ref: t,
506
- icon: si
506
+ icon: oi
507
507
  }));
508
508
  });
509
- Bt.displayName = "GraphIcon";
510
- const oi = {
509
+ Ht.displayName = "GraphIcon";
510
+ const ci = {
511
511
  tag: "svg",
512
512
  attrs: {
513
513
  xmlns: "http://www.w3.org/2000/svg",
@@ -529,11 +529,11 @@ const oi = {
529
529
  return H(F, Object.assign({}, e, {
530
530
  id: "more-down-icon",
531
531
  ref: t,
532
- icon: oi
532
+ icon: ci
533
533
  }));
534
534
  });
535
535
  Xe.displayName = "MoreDownIcon";
536
- const ci = {
536
+ const ai = {
537
537
  tag: "svg",
538
538
  attrs: {
539
539
  xmlns: "http://www.w3.org/2000/svg",
@@ -557,15 +557,15 @@ const ci = {
557
557
  d: "M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z"
558
558
  }
559
559
  }]
560
- }, Ht = Z(function(e, t) {
560
+ }, Ft = Z(function(e, t) {
561
561
  return H(F, Object.assign({}, e, {
562
562
  id: "move-down-icon",
563
563
  ref: t,
564
- icon: ci
564
+ icon: ai
565
565
  }));
566
566
  });
567
- Ht.displayName = "MoveDownIcon";
568
- const ai = {
567
+ Ft.displayName = "MoveDownIcon";
568
+ const li = {
569
569
  tag: "svg",
570
570
  attrs: {
571
571
  xmlns: "http://www.w3.org/2000/svg",
@@ -589,15 +589,15 @@ const ai = {
589
589
  d: "M5.57564 4.38825C5.80995 4.62256 6.18985 4.62256 6.42417 4.38825L7.3999 3.41251V9.63049C7.3999 9.96186 7.66853 10.2305 7.9999 10.2305C8.33127 10.2305 8.5999 9.96186 8.5999 9.63049V3.41251L9.57564 4.38825C9.80995 4.62256 10.1899 4.62256 10.4242 4.38825C10.6585 4.15393 10.6585 3.77403 10.4242 3.53972L8.4324 1.54796C8.32324 1.43445 8.16982 1.36382 7.9999 1.36382C7.82998 1.36382 7.67655 1.43446 7.56739 1.54797L5.57564 3.53972C5.34132 3.77403 5.34132 4.15393 5.57564 4.38825Z"
590
590
  }
591
591
  }]
592
- }, Ft = Z(function(e, t) {
592
+ }, Wt = Z(function(e, t) {
593
593
  return H(F, Object.assign({}, e, {
594
594
  id: "move-up-icon",
595
595
  ref: t,
596
- icon: ai
596
+ icon: li
597
597
  }));
598
598
  });
599
- Ft.displayName = "MoveUpIcon";
600
- const li = {
599
+ Wt.displayName = "MoveUpIcon";
600
+ const di = {
601
601
  tag: "svg",
602
602
  attrs: {
603
603
  xmlns: "http://www.w3.org/2000/svg",
@@ -636,15 +636,15 @@ const li = {
636
636
  }]
637
637
  }],
638
638
  defIds: ["text-icon_clip0_1293_26"]
639
- }, Wt = Z(function(e, t) {
639
+ }, kt = Z(function(e, t) {
640
640
  return H(F, Object.assign({}, e, {
641
641
  id: "text-icon",
642
642
  ref: t,
643
- icon: li
643
+ icon: di
644
644
  }));
645
645
  });
646
- Wt.displayName = "TextIcon";
647
- const di = {
646
+ kt.displayName = "TextIcon";
647
+ const ui = {
648
648
  tag: "svg",
649
649
  attrs: {
650
650
  xmlns: "http://www.w3.org/2000/svg",
@@ -680,15 +680,15 @@ const di = {
680
680
  }
681
681
  }
682
682
  ]
683
- }, kt = Z(function(e, t) {
683
+ }, zt = Z(function(e, t) {
684
684
  return H(F, Object.assign({}, e, {
685
685
  id: "topmost-icon",
686
686
  ref: t,
687
- icon: di
687
+ icon: ui
688
688
  }));
689
689
  });
690
- kt.displayName = "TopmostIcon";
691
- const ui = {
690
+ zt.displayName = "TopmostIcon";
691
+ const hi = {
692
692
  tag: "svg",
693
693
  attrs: {
694
694
  xmlns: "http://www.w3.org/2000/svg",
@@ -733,15 +733,15 @@ const ui = {
733
733
  }
734
734
  }
735
735
  ]
736
- }, zt = Z(function(e, t) {
736
+ }, Kt = Z(function(e, t) {
737
737
  return H(F, Object.assign({}, e, {
738
738
  id: "autofill-double-icon",
739
739
  ref: t,
740
- icon: ui
740
+ icon: hi
741
741
  }));
742
742
  });
743
- zt.displayName = "AutofillDoubleIcon";
744
- const hi = {
743
+ Kt.displayName = "AutofillDoubleIcon";
744
+ const gi = {
745
745
  tag: "svg",
746
746
  attrs: {
747
747
  xmlns: "http://www.w3.org/2000/svg",
@@ -775,14 +775,14 @@ const hi = {
775
775
  }
776
776
  }
777
777
  ]
778
- }, Kt = Z(function(e, t) {
778
+ }, Zt = Z(function(e, t) {
779
779
  return H(F, Object.assign({}, e, {
780
780
  id: "paint-bucket-double-icon",
781
781
  ref: t,
782
- icon: hi
782
+ icon: gi
783
783
  }));
784
784
  });
785
- Kt.displayName = "PaintBucketDoubleIcon";
785
+ Zt.displayName = "PaintBucketDoubleIcon";
786
786
  const B = {
787
787
  id: "slide.operation.update-element",
788
788
  type: D.OPERATION,
@@ -790,11 +790,11 @@ const B = {
790
790
  const { oKey: t, props: n } = e, r = i.get(w), s = e == null ? void 0 : e.unitId, o = r.getUnit(s);
791
791
  if (!o) return !1;
792
792
  const c = o.getActivePage();
793
- return c.pageElements[t] = St(c.pageElements[t], n), o.updatePage(c.id, c), !0;
793
+ return c.pageElements[t] = It(c.pageElements[t], n), o.updatePage(c.id, c), !0;
794
794
  }
795
795
  };
796
- function gi(i) {
797
- const { pageId: e, unitId: t } = i, n = O(J), r = O(P), s = O(U), o = r.getRenderUnitByPageId(e, t), c = o == null ? void 0 : o.scene;
796
+ function vi(i) {
797
+ const { pageId: e, unitId: t } = i, n = O(J), r = O(P), s = O(N), o = r.getRenderUnitByPageId(e, t), c = o == null ? void 0 : o.scene;
798
798
  if (!c) return null;
799
799
  const a = c.getTransformer();
800
800
  if (!a) return null;
@@ -802,8 +802,8 @@ function gi(i) {
802
802
  if (!l) return null;
803
803
  const d = (v) => {
804
804
  const _ = c.getAllObjects(), [f, p] = _.reduce(([m, I], b) => {
805
- const T = b.zIndex, M = T < m ? T : m, N = T > I ? T : I;
806
- return [M, N];
805
+ const T = b.zIndex, M = T < m ? T : m, U = T > I ? T : I;
806
+ return [M, U];
807
807
  }, [0, 0]);
808
808
  let h = l.zIndex;
809
809
  v === 3 ? h = f - 1 : v === 2 ? h = p + 1 : v === 0 ? h = l.zIndex + 1 : v === 1 && (h = l.zIndex - 1), l.setProps({
@@ -825,50 +825,50 @@ function gi(i) {
825
825
  }
826
826
  ) }),
827
827
  /* @__PURE__ */ R("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
828
- /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Ce, { onClick: () => {
828
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Se, { onClick: () => {
829
829
  d(
830
830
  0
831
831
  /* forward */
832
832
  );
833
833
  }, children: /* @__PURE__ */ R("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
834
- /* @__PURE__ */ g(Ft, {}),
834
+ /* @__PURE__ */ g(Wt, {}),
835
835
  n.t("image-panel.arrange.forward")
836
836
  ] }) }) }),
837
- /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Ce, { onClick: () => {
837
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Se, { onClick: () => {
838
838
  d(
839
839
  1
840
840
  /* backward */
841
841
  );
842
842
  }, children: /* @__PURE__ */ R("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
843
- /* @__PURE__ */ g(Ht, {}),
843
+ /* @__PURE__ */ g(Ft, {}),
844
844
  n.t("image-panel.arrange.backward")
845
845
  ] }) }) })
846
846
  ] }),
847
847
  /* @__PURE__ */ R("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
848
- /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Ce, { onClick: () => {
848
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Se, { onClick: () => {
849
849
  d(
850
850
  2
851
851
  /* front */
852
852
  );
853
853
  }, children: /* @__PURE__ */ R("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
854
- /* @__PURE__ */ g(kt, {}),
854
+ /* @__PURE__ */ g(zt, {}),
855
855
  n.t("image-panel.arrange.front")
856
856
  ] }) }) }),
857
- /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Ce, { onClick: () => {
857
+ /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(Se, { onClick: () => {
858
858
  d(
859
859
  3
860
860
  /* back */
861
861
  );
862
862
  }, children: /* @__PURE__ */ R("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
863
- /* @__PURE__ */ g($t, {}),
863
+ /* @__PURE__ */ g(Bt, {}),
864
864
  n.t("image-panel.arrange.back")
865
865
  ] }) }) })
866
866
  ] })
867
867
  ] });
868
868
  }
869
- function vi(i) {
869
+ function pi(i) {
870
870
  var f, p;
871
- const { pageId: e, unitId: t } = i, n = O(J), r = O(P), s = O(U), o = r.getRenderUnitByPageId(e, t), c = o == null ? void 0 : o.scene;
871
+ const { pageId: e, unitId: t } = i, n = O(J), r = O(P), s = O(N), o = r.getRenderUnitByPageId(e, t), c = o == null ? void 0 : o.scene;
872
872
  if (!c) return null;
873
873
  const a = c.getTransformer();
874
874
  if (!a) return null;
@@ -895,7 +895,7 @@ function vi(i) {
895
895
  return /* @__PURE__ */ g(
896
896
  "div",
897
897
  {
898
- className: k("univer-relative univer-bottom-0 univer-mt-5 univer-w-full", Dt),
898
+ className: k("univer-relative univer-bottom-0 univer-mt-5 univer-w-full", Nt),
899
899
  children: /* @__PURE__ */ R("div", { className: "univer-relative univer-w-full", children: [
900
900
  /* @__PURE__ */ g("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ g(
901
901
  "div",
@@ -905,17 +905,17 @@ function vi(i) {
905
905
  }
906
906
  ) }),
907
907
  /* @__PURE__ */ g("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: /* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(
908
- Mt,
908
+ Dt,
909
909
  {
910
910
  overlay: /* @__PURE__ */ g("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ g(
911
- Ln,
911
+ $n,
912
912
  {
913
913
  value: "#fff",
914
914
  onChange: _
915
915
  }
916
916
  ) }),
917
917
  children: /* @__PURE__ */ R("a", { className: "univer-flex univer-cursor-pointer univer-items-center univer-gap-1", children: [
918
- /* @__PURE__ */ g(Kt, { className: "univer-fill-primary-600" }),
918
+ /* @__PURE__ */ g(Zt, { className: "univer-fill-primary-600" }),
919
919
  /* @__PURE__ */ g(Xe, {})
920
920
  ] })
921
921
  }
@@ -924,8 +924,8 @@ function vi(i) {
924
924
  }
925
925
  );
926
926
  }
927
- function pi(i) {
928
- const { pageId: e, unitId: t } = i, n = O(J), r = O(P), s = O(U), o = r.getRenderUnitByPageId(e, t), c = o == null ? void 0 : o.scene;
927
+ function fi(i) {
928
+ const { pageId: e, unitId: t } = i, n = O(J), r = O(P), s = O(N), o = r.getRenderUnitByPageId(e, t), c = o == null ? void 0 : o.scene;
929
929
  if (!c) return null;
930
930
  const a = c.getTransformer();
931
931
  if (!a) return null;
@@ -937,24 +937,24 @@ function pi(i) {
937
937
  left: _ = 0,
938
938
  top: f = 0,
939
939
  angle: p = 0
940
- } = l, [h, m] = $(d), [I, b] = $(v), [T, M] = $(_), [N, x] = $(f), [W, oe] = $(p), A = (C) => {
941
- const { objects: ce } = C, ae = ce.values().next().value, {
942
- width: tn = 0,
943
- height: nn = 0,
944
- left: rn = 0,
945
- top: sn = 0,
946
- angle: on = 0
947
- } = ae;
948
- m(tn), b(nn), M(rn), x(sn), oe(on);
940
+ } = l, [h, m] = $(d), [I, b] = $(v), [T, M] = $(_), [U, x] = $(f), [W, ce] = $(p), A = (C) => {
941
+ const { objects: ae } = C, le = ae.values().next().value, {
942
+ width: nn = 0,
943
+ height: rn = 0,
944
+ left: sn = 0,
945
+ top: on = 0,
946
+ angle: cn = 0
947
+ } = le;
948
+ m(nn), b(rn), M(sn), x(on), ce(cn);
949
949
  };
950
- ge(() => {
951
- const C = a.changeStart$.subscribe((ae) => {
952
- A(ae);
953
- }), ce = a.changing$.subscribe((ae) => {
954
- A(ae);
950
+ ve(() => {
951
+ const C = a.changeStart$.subscribe((le) => {
952
+ A(le);
953
+ }), ae = a.changing$.subscribe((le) => {
954
+ A(le);
955
955
  });
956
956
  return () => {
957
- ce.unsubscribe(), C.unsubscribe();
957
+ ae.unsubscribe(), C.unsubscribe();
958
958
  };
959
959
  }, []);
960
960
  function L(C) {
@@ -984,7 +984,7 @@ function pi(i) {
984
984
  }
985
985
  }), l == null || l.translate(C, l.top), M(C), a == null || a.refreshControls());
986
986
  }
987
- function _e(C) {
987
+ function me(C) {
988
988
  !C || !l || (s.executeCommand(B.id, {
989
989
  pageId: e,
990
990
  oKey: l.oKey,
@@ -993,7 +993,7 @@ function pi(i) {
993
993
  }
994
994
  }), l == null || l.translate(l.left, C), x(C), a == null || a.refreshControls());
995
995
  }
996
- function me(C) {
996
+ function Ce(C) {
997
997
  !C || !l || (s.executeCommand(B.id, {
998
998
  pageId: e,
999
999
  oKey: l.oKey,
@@ -1002,12 +1002,12 @@ function pi(i) {
1002
1002
  }
1003
1003
  }), l == null || l.transformByState({
1004
1004
  angle: C
1005
- }), oe(C), a == null || a.refreshControls());
1005
+ }), ce(C), a == null || a.refreshControls());
1006
1006
  }
1007
1007
  return /* @__PURE__ */ R(
1008
1008
  "div",
1009
1009
  {
1010
- className: k("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", Dt),
1010
+ className: k("univer-grid univer-gap-2 univer-py-2 univer-text-gray-400", Nt),
1011
1011
  children: [
1012
1012
  /* @__PURE__ */ g(
1013
1013
  "header",
@@ -1024,7 +1024,7 @@ function pi(i) {
1024
1024
  /* @__PURE__ */ R("div", { children: [
1025
1025
  /* @__PURE__ */ g("span", { children: n.t("image-panel.transform.width") }),
1026
1026
  /* @__PURE__ */ g(
1027
- le,
1027
+ de,
1028
1028
  {
1029
1029
  min: 1,
1030
1030
  value: h,
@@ -1037,7 +1037,7 @@ function pi(i) {
1037
1037
  /* @__PURE__ */ R("div", { children: [
1038
1038
  /* @__PURE__ */ g("span", { children: n.t("image-panel.transform.height") }),
1039
1039
  /* @__PURE__ */ g(
1040
- le,
1040
+ de,
1041
1041
  {
1042
1042
  min: 1,
1043
1043
  value: I,
@@ -1053,24 +1053,24 @@ function pi(i) {
1053
1053
  /* @__PURE__ */ R("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full", children: [
1054
1054
  /* @__PURE__ */ R("div", { children: [
1055
1055
  /* @__PURE__ */ g("span", { children: n.t("image-panel.transform.x") }),
1056
- /* @__PURE__ */ g(le, { min: 0, precision: 1, value: T, onChange: (C) => {
1056
+ /* @__PURE__ */ g(de, { min: 0, precision: 1, value: T, onChange: (C) => {
1057
1057
  ee(C);
1058
1058
  } })
1059
1059
  ] }),
1060
1060
  /* @__PURE__ */ R("div", { children: [
1061
1061
  /* @__PURE__ */ g("span", { children: n.t("image-panel.transform.y") }),
1062
- /* @__PURE__ */ g(le, { min: 0, precision: 1, value: N, onChange: (C) => {
1063
- _e(C);
1062
+ /* @__PURE__ */ g(de, { min: 0, precision: 1, value: U, onChange: (C) => {
1063
+ me(C);
1064
1064
  } })
1065
1065
  ] }),
1066
1066
  /* @__PURE__ */ R("div", { children: [
1067
1067
  /* @__PURE__ */ g("span", { children: n.t("image-panel.transform.rotate") }),
1068
1068
  /* @__PURE__ */ g(
1069
- le,
1069
+ de,
1070
1070
  {
1071
1071
  precision: 1,
1072
1072
  value: W,
1073
- onChange: me
1073
+ onChange: Ce
1074
1074
  }
1075
1075
  )
1076
1076
  ] })
@@ -1080,7 +1080,7 @@ function pi(i) {
1080
1080
  );
1081
1081
  }
1082
1082
  const Ee = "COMPONENT_SLIDE_SIDEBAR";
1083
- function fi() {
1083
+ function _i() {
1084
1084
  var u, l, d;
1085
1085
  const i = O(w), e = O(P), t = i.getCurrentUnitForType(E.UNIVER_SLIDE), n = (u = t == null ? void 0 : t.getActivePage()) == null ? void 0 : u.id, r = ((l = i.getFocusedUnit()) == null ? void 0 : l.getUnitId()) || "";
1086
1086
  if (!n || !r) return null;
@@ -1088,9 +1088,9 @@ function fi() {
1088
1088
  if (!o) return null;
1089
1089
  const a = o.getSelectedObjectMap().values().next().value;
1090
1090
  return a ? /* @__PURE__ */ R("section", { className: "univer-p-2 univer-text-center univer-text-sm", children: [
1091
- /* @__PURE__ */ g(gi, { pageId: n, unitId: r }),
1092
- /* @__PURE__ */ g(pi, { pageId: n, unitId: r }),
1093
- a.objectType === de.RECT && /* @__PURE__ */ g(vi, { pageId: n, unitId: r })
1091
+ /* @__PURE__ */ g(vi, { pageId: n, unitId: r }),
1092
+ /* @__PURE__ */ g(fi, { pageId: n, unitId: r }),
1093
+ a.objectType === ue.RECT && /* @__PURE__ */ g(pi, { pageId: n, unitId: r })
1094
1094
  ] }) : null;
1095
1095
  }
1096
1096
  const Ye = {
@@ -1098,10 +1098,10 @@ const Ye = {
1098
1098
  type: D.COMMAND,
1099
1099
  handler: async (i) => {
1100
1100
  var r;
1101
- const e = i.get(U), n = (r = i.get(w).getFocusedUnit()) == null ? void 0 : r.getUnitId();
1102
- return e.executeCommand(Zt.id, { unitId: n });
1101
+ const e = i.get(N), n = (r = i.get(w).getFocusedUnit()) == null ? void 0 : r.getUnitId();
1102
+ return e.executeCommand(Gt.id, { unitId: n });
1103
1103
  }
1104
- }, Zt = {
1104
+ }, Gt = {
1105
1105
  id: "slide.operation.insert-float-shape.rectangle",
1106
1106
  type: D.OPERATION,
1107
1107
  handler: async (i, e) => {
@@ -1118,7 +1118,7 @@ const Ye = {
1118
1118
  description: "",
1119
1119
  type: De.SHAPE,
1120
1120
  shape: {
1121
- shapeType: It.Rect,
1121
+ shapeType: bt.Rect,
1122
1122
  text: "",
1123
1123
  shapeProperties: {
1124
1124
  shapeBackgroundFill: {
@@ -1135,9 +1135,9 @@ const Ye = {
1135
1135
  id: "sidebar.operation.slide-shape",
1136
1136
  type: D.COMMAND,
1137
1137
  handler: async (i, e) => {
1138
- const { visible: t, objectType: n } = e, r = i.get(Tt), s = i.get(J);
1138
+ const { visible: t, objectType: n } = e, r = i.get(Mt), s = i.get(J);
1139
1139
  let o = "", c = "";
1140
- return n === de.RECT ? (o = "slide.sidebar.shape", c = Ee) : n === de.IMAGE ? (o = "slide.sidebar.image", c = Ee) : n === de.RICH_TEXT && (o = "slide.sidebar.text", c = Ee), t ? r.open({
1140
+ return n === ue.RECT ? (o = "slide.sidebar.shape", c = Ee) : n === ue.IMAGE ? (o = "slide.sidebar.image", c = Ee) : n === ue.RICH_TEXT && (o = "slide.sidebar.text", c = Ee), t ? r.open({
1141
1141
  header: { title: s.t(o) },
1142
1142
  children: { label: c },
1143
1143
  onClose: () => {
@@ -1150,10 +1150,10 @@ const Ye = {
1150
1150
  type: D.COMMAND,
1151
1151
  handler: async (i) => {
1152
1152
  var r;
1153
- const e = i.get(U), n = (r = i.get(w).getFocusedUnit()) == null ? void 0 : r.getUnitId();
1154
- return e.executeCommand(Gt.id, { unitId: n });
1153
+ const e = i.get(N), n = (r = i.get(w).getFocusedUnit()) == null ? void 0 : r.getUnitId();
1154
+ return e.executeCommand(Xt.id, { unitId: n });
1155
1155
  }
1156
- }, Gt = {
1156
+ }, Xt = {
1157
1157
  id: "slide.operation.insert-float-shape.ellipse",
1158
1158
  type: D.OPERATION,
1159
1159
  handler: async (i, e) => {
@@ -1170,7 +1170,7 @@ const Ye = {
1170
1170
  description: "",
1171
1171
  type: De.SHAPE,
1172
1172
  shape: {
1173
- shapeType: It.Ellipse,
1173
+ shapeType: bt.Ellipse,
1174
1174
  text: "",
1175
1175
  shapeProperties: {
1176
1176
  radius: 100,
@@ -1189,10 +1189,10 @@ const Ye = {
1189
1189
  type: D.COMMAND,
1190
1190
  handler: async (i) => {
1191
1191
  var r;
1192
- const e = i.get(U), n = (r = i.get(w).getFocusedUnit()) == null ? void 0 : r.getUnitId();
1193
- return await e.executeCommand(Xt.id, { unitId: n });
1192
+ const e = i.get(N), n = (r = i.get(w).getFocusedUnit()) == null ? void 0 : r.getUnitId();
1193
+ return await e.executeCommand(Yt.id, { unitId: n });
1194
1194
  }
1195
- }, Xt = {
1195
+ }, Yt = {
1196
1196
  id: "slide.operation.add-text",
1197
1197
  type: D.OPERATION,
1198
1198
  handler: async (i, e) => {
@@ -1221,18 +1221,18 @@ const Ye = {
1221
1221
  const p = i.get(P), h = p.createObjectToPage(f, d.id, t);
1222
1222
  return h && p.setObjectActiveByPage(h, d.id, t), !0;
1223
1223
  }
1224
- }, Yt = {
1224
+ }, qt = {
1225
1225
  id: "slide.operation.set-slide-page-thumb",
1226
1226
  type: D.OPERATION,
1227
1227
  handler: (i, e) => (i.get(P).createThumbs(e.unitId), !0)
1228
1228
  };
1229
- function _i() {
1229
+ function mi() {
1230
1230
  var f, p;
1231
- const i = O(w), e = O(U), t = O(K), n = O(J), r = Ut(null), s = i.getCurrentUnitForType(E.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), c = s == null ? void 0 : s.getPageOrder();
1231
+ const i = O(w), e = O(N), t = O(K), n = O(J), r = Ut(null), s = i.getCurrentUnitForType(E.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), c = s == null ? void 0 : s.getPageOrder();
1232
1232
  if (!o || !c)
1233
1233
  return null;
1234
- const a = c.map((h) => o[h]), [u, l] = $((p = (f = s == null ? void 0 : s.getActivePage()) == null ? void 0 : f.id) != null ? p : null), d = Bn(() => a.map(() => Hn()), [a]);
1235
- ge(() => {
1234
+ const a = c.map((h) => o[h]), [u, l] = $((p = (f = s == null ? void 0 : s.getActivePage()) == null ? void 0 : f.id) != null ? p : null), d = Hn(() => a.map(() => Fn()), [a]);
1235
+ ve(() => {
1236
1236
  const h = s == null ? void 0 : s.activePage$.subscribe((m) => {
1237
1237
  var b;
1238
1238
  const I = (b = m == null ? void 0 : m.id) != null ? b : null;
@@ -1241,30 +1241,30 @@ function _i() {
1241
1241
  return () => {
1242
1242
  h == null || h.unsubscribe();
1243
1243
  };
1244
- }, []), ge(() => {
1244
+ }, []), ve(() => {
1245
1245
  d.forEach((h, m) => {
1246
1246
  var I;
1247
1247
  if (h.current) {
1248
1248
  const b = a[m];
1249
1249
  (I = t.getRenderById(b.id)) == null || I.engine.setContainer(h.current);
1250
1250
  }
1251
- }), d.length > 0 && e.syncExecuteCommand(Yt.id, { unitId: s == null ? void 0 : s.getUnitId() });
1251
+ }), d.length > 0 && e.syncExecuteCommand(qt.id, { unitId: s == null ? void 0 : s.getUnitId() });
1252
1252
  }, [d, a, t, e, s]);
1253
1253
  const v = lt((h) => {
1254
- e.syncExecuteCommand(Vt.id, { id: h, unitId: s == null ? void 0 : s.getUnitId() });
1254
+ e.syncExecuteCommand(jt.id, { id: h, unitId: s == null ? void 0 : s.getUnitId() });
1255
1255
  }, [e, s]), _ = lt(() => {
1256
- e.syncExecuteCommand(jt.id, { unitId: s == null ? void 0 : s.getUnitId() });
1256
+ e.syncExecuteCommand(At.id, { unitId: s == null ? void 0 : s.getUnitId() });
1257
1257
  }, [e, s]);
1258
1258
  return /* @__PURE__ */ g(
1259
1259
  "aside",
1260
1260
  {
1261
1261
  ref: r,
1262
- className: k("univer-flex univer-h-full univer-w-64 univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden", $n),
1262
+ className: k("univer-flex univer-h-full univer-w-64 univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden", Bn),
1263
1263
  children: /* @__PURE__ */ R("div", { className: "univer-px-4", children: [
1264
1264
  /* @__PURE__ */ g("header", { className: "univer-flex univer-justify-center univer-pt-4", children: /* @__PURE__ */ g(
1265
1265
  "a",
1266
1266
  {
1267
- className: k("univer-box-border univer-block univer-h-8 univer-w-full univer-cursor-pointer univer-rounded-md univer-bg-white univer-text-center univer-text-sm univer-leading-8 univer-transition-colors", he),
1267
+ className: k("univer-box-border univer-block univer-h-8 univer-w-full univer-cursor-pointer univer-rounded-md univer-bg-white univer-text-center univer-text-sm univer-leading-8 univer-transition-colors", ge),
1268
1268
  onClick: _,
1269
1269
  children: n.t("slide.append")
1270
1270
  }
@@ -1282,7 +1282,7 @@ function _i() {
1282
1282
  "div",
1283
1283
  {
1284
1284
  ref: d[m],
1285
- className: k("univer-relative univer-box-border univer-h-32 univer-w-52 univer-bg-white hover:univer-border-primary-600", he)
1285
+ className: k("univer-relative univer-box-border univer-h-32 univer-w-52 univer-bg-white hover:univer-border-primary-600", ge)
1286
1286
  }
1287
1287
  )
1288
1288
  ]
@@ -1293,98 +1293,17 @@ function _i() {
1293
1293
  }
1294
1294
  );
1295
1295
  }
1296
- const ue = un("SLIDE_EDITOR"), qt = "slide.menu.image";
1297
- function mi(i) {
1298
- return {
1299
- id: qt,
1300
- type: se.SUBITEMS,
1301
- icon: "AddImageIcon",
1302
- tooltip: "slide.image.insert.title",
1303
- hidden$: re(i, E.UNIVER_SLIDE)
1304
- };
1305
- }
1306
- function Ci(i) {
1307
- return {
1308
- id: Ge.id,
1309
- title: "slide.image.insert.float",
1310
- type: se.BUTTON,
1311
- hidden$: re(i, E.UNIVER_SLIDE)
1312
- };
1313
- }
1314
- const Jt = "slide.menu.shape";
1315
- function Si(i) {
1316
- return {
1317
- id: Jt,
1318
- type: se.SUBITEMS,
1319
- icon: "GraphIcon",
1320
- tooltip: "slide.shape.insert.title",
1321
- hidden$: re(i, E.UNIVER_SLIDE)
1322
- // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
1323
- };
1324
- }
1325
- function Ii(i) {
1326
- return {
1327
- id: Ye.id,
1328
- title: "slide.shape.insert.rectangle",
1329
- type: se.BUTTON,
1330
- hidden$: re(i, E.UNIVER_SLIDE)
1331
- };
1332
- }
1333
- function bi(i) {
1334
- return {
1335
- id: qe.id,
1336
- title: "slide.shape.insert.ellipse",
1337
- type: se.BUTTON,
1338
- hidden$: re(i, E.UNIVER_SLIDE)
1339
- };
1340
- }
1341
- function Ei(i) {
1342
- return {
1343
- id: Je.id,
1344
- type: se.BUTTON,
1345
- icon: "TextIcon",
1346
- tooltip: "slide.text.insert.title",
1347
- hidden$: re(i, E.UNIVER_SLIDE)
1348
- };
1349
- }
1350
- const Ri = {
1351
- [Pn.FORMAT]: {
1352
- [Je.id]: {
1353
- order: 0,
1354
- menuItemFactory: Ei
1355
- },
1356
- [qt]: {
1357
- order: 0,
1358
- menuItemFactory: mi,
1359
- [Ge.id]: {
1360
- order: 0,
1361
- menuItemFactory: Ci
1362
- }
1363
- },
1364
- [Jt]: {
1365
- order: 0,
1366
- menuItemFactory: Si,
1367
- [Ye.id]: {
1368
- order: 0,
1369
- menuItemFactory: Ii
1370
- },
1371
- [qe.id]: {
1372
- order: 0,
1373
- menuItemFactory: bi
1374
- }
1375
- }
1376
- }
1377
- }, Oe = {
1296
+ const he = hn("SLIDE_EDITOR"), Oe = {
1378
1297
  id: "slide.operation.edit-arrow",
1379
1298
  type: D.OPERATION,
1380
1299
  handler: () => !0
1381
- }, Qt = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
1382
- function xi(i) {
1300
+ }, Jt = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
1301
+ function Ci(i) {
1383
1302
  var f, p;
1384
1303
  const e = (p = (f = i.popup) == null ? void 0 : f.extraProps) == null ? void 0 : p.menuItems;
1385
1304
  if (!e)
1386
1305
  return null;
1387
- const t = O(U), n = O(J), [r, s] = $(!1), [o, c] = $(!1), a = () => {
1306
+ const t = O(N), n = O(J), [r, s] = $(!1), [o, c] = $(!1), a = () => {
1388
1307
  c(!0);
1389
1308
  }, u = () => {
1390
1309
  c(!1);
@@ -1399,13 +1318,13 @@ function xi(i) {
1399
1318
  onMouseEnter: a,
1400
1319
  onMouseLeave: u,
1401
1320
  children: /* @__PURE__ */ g(
1402
- Mt,
1321
+ Dt,
1403
1322
  {
1404
1323
  align: "start",
1405
1324
  overlay: /* @__PURE__ */ g(
1406
1325
  "ul",
1407
1326
  {
1408
- className: k("univer-m-0 univer-box-border univer-grid univer-list-none univer-items-center univer-gap-1 univer-rounded-lg univer-bg-white univer-p-1.5 univer-text-sm univer-shadow-lg", he),
1327
+ className: k("univer-m-0 univer-box-border univer-grid univer-list-none univer-items-center univer-gap-1 univer-rounded-lg univer-bg-white univer-p-1.5 univer-text-sm univer-shadow-lg", ge),
1409
1328
  children: _.map((h) => /* @__PURE__ */ g(
1410
1329
  "li",
1411
1330
  {
@@ -1422,13 +1341,13 @@ function xi(i) {
1422
1341
  children: /* @__PURE__ */ R(
1423
1342
  "div",
1424
1343
  {
1425
- className: k("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", he, {
1344
+ className: k("univer-flex univer-items-center univer-gap-2 univer-rounded univer-p-1 hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-800", ge, {
1426
1345
  "univer-bg-gray-100 dark:!univer-bg-gray-800": r,
1427
1346
  "univer-bg-white dark:!univer-bg-gray-900": !r
1428
1347
  }),
1429
1348
  children: [
1430
1349
  /* @__PURE__ */ g(
1431
- zt,
1350
+ Kt,
1432
1351
  {
1433
1352
  className: "univer-fill-primary-600 univer-text-gray-900 dark:!univer-text-white"
1434
1353
  }
@@ -1442,7 +1361,89 @@ function xi(i) {
1442
1361
  }
1443
1362
  );
1444
1363
  }
1445
- class Oi {
1364
+ const Qt = "slide.menu.image";
1365
+ function Si(i) {
1366
+ return {
1367
+ id: Qt,
1368
+ type: oe.SUBITEMS,
1369
+ icon: "AddImageIcon",
1370
+ tooltip: "slide.image.insert.title",
1371
+ hidden$: se(i, E.UNIVER_SLIDE)
1372
+ };
1373
+ }
1374
+ function Ii(i) {
1375
+ return {
1376
+ id: Ge.id,
1377
+ title: "slide.image.insert.float",
1378
+ type: oe.BUTTON,
1379
+ hidden$: se(i, E.UNIVER_SLIDE)
1380
+ };
1381
+ }
1382
+ const en = "slide.menu.shape";
1383
+ function bi(i) {
1384
+ return {
1385
+ id: en,
1386
+ type: oe.SUBITEMS,
1387
+ icon: "GraphIcon",
1388
+ tooltip: "slide.shape.insert.title",
1389
+ hidden$: se(i, E.UNIVER_SLIDE)
1390
+ // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
1391
+ };
1392
+ }
1393
+ function Ei(i) {
1394
+ return {
1395
+ id: Ye.id,
1396
+ title: "slide.shape.insert.rectangle",
1397
+ type: oe.BUTTON,
1398
+ hidden$: se(i, E.UNIVER_SLIDE)
1399
+ };
1400
+ }
1401
+ function Ri(i) {
1402
+ return {
1403
+ id: qe.id,
1404
+ title: "slide.shape.insert.ellipse",
1405
+ type: oe.BUTTON,
1406
+ hidden$: se(i, E.UNIVER_SLIDE)
1407
+ };
1408
+ }
1409
+ function xi(i) {
1410
+ return {
1411
+ id: Je.id,
1412
+ type: oe.BUTTON,
1413
+ icon: "TextIcon",
1414
+ tooltip: "slide.text.insert.title",
1415
+ hidden$: se(i, E.UNIVER_SLIDE)
1416
+ };
1417
+ }
1418
+ const Oi = {
1419
+ [Tn.FORMAT]: {
1420
+ [Je.id]: {
1421
+ order: 0,
1422
+ menuItemFactory: xi
1423
+ },
1424
+ [Qt]: {
1425
+ order: 0,
1426
+ menuItemFactory: Si,
1427
+ [Ge.id]: {
1428
+ order: 0,
1429
+ menuItemFactory: Ii
1430
+ }
1431
+ },
1432
+ [en]: {
1433
+ order: 0,
1434
+ menuItemFactory: bi,
1435
+ [Ye.id]: {
1436
+ order: 0,
1437
+ menuItemFactory: Ei
1438
+ },
1439
+ [qe.id]: {
1440
+ order: 0,
1441
+ menuItemFactory: Ri
1442
+ }
1443
+ }
1444
+ }
1445
+ };
1446
+ class wi {
1446
1447
  constructor() {
1447
1448
  S(this, "_state", null);
1448
1449
  S(this, "_rect", null);
@@ -1476,7 +1477,7 @@ class Oi {
1476
1477
  this._state$.next(e);
1477
1478
  }
1478
1479
  }
1479
- const Qe = bt(
1480
+ const Qe = Et(
1480
1481
  "univer.slide-editor-manager.service"
1481
1482
  ), we = -1e3, vt = {
1482
1483
  width: 0,
@@ -1484,16 +1485,16 @@ const Qe = bt(
1484
1485
  top: we,
1485
1486
  left: we
1486
1487
  };
1487
- function wi() {
1488
+ function yi() {
1488
1489
  const [i, e] = $({
1489
1490
  ...vt
1490
- }), t = O(Qe), n = O(Ze), r = O(fe), s = Tn(
1491
+ }), t = O(Qe), n = O(Ze), r = O(_e), s = Mn(
1491
1492
  () => r.subscribeContextValue$(ot),
1492
1493
  !1,
1493
1494
  void 0,
1494
1495
  [r, ot]
1495
1496
  );
1496
- return hn.UNSPECIFIED, ge(() => {
1497
+ return gn.UNSPECIFIED, ve(() => {
1497
1498
  t.state$.subscribe((o) => {
1498
1499
  if (o == null)
1499
1500
  return;
@@ -1510,24 +1511,24 @@ function wi() {
1510
1511
  });
1511
1512
  else {
1512
1513
  e({
1513
- width: u - c - ne + 2,
1514
- height: l - a - ne + 2,
1515
- left: c + ne,
1516
- top: a + ne
1514
+ width: u - c - ie + 2,
1515
+ height: l - a - ie + 2,
1516
+ left: c + ie,
1517
+ top: a + ie
1517
1518
  });
1518
- const v = n.getEditor(ue);
1519
+ const v = n.getEditor(he);
1519
1520
  if (v == null)
1520
1521
  return;
1521
1522
  const { left: _, top: f, width: p, height: h } = v.getBoundingClientRect();
1522
1523
  t.setRect({ left: _, top: f, width: p, height: h });
1523
1524
  }
1524
1525
  });
1525
- }, []), ge(() => {
1526
+ }, []), ve(() => {
1526
1527
  s || t.setFocus(!0);
1527
1528
  }, [s, i]), /* @__PURE__ */ g(
1528
1529
  "div",
1529
1530
  {
1530
- className: k("univer-absolute univer-z-10 univer-box-border univer-flex", he),
1531
+ className: k("univer-absolute univer-z-10 univer-box-border univer-flex", ge),
1531
1532
  style: {
1532
1533
  left: i.left,
1533
1534
  top: i.top,
@@ -1538,21 +1539,21 @@ function wi() {
1538
1539
  );
1539
1540
  }
1540
1541
  function Be(i) {
1541
- return i.getContextValue(Et) && i.getContextValue(Re);
1542
+ return i.getContextValue(Rt) && i.getContextValue(Re);
1542
1543
  }
1543
- function yi(i) {
1544
- return i.getContextValue(gn) && i.getContextValue(Et);
1544
+ function Pi(i) {
1545
+ return i.getContextValue(vn) && i.getContextValue(Rt);
1545
1546
  }
1546
- const en = [
1547
+ const tn = [
1547
1548
  y.ARROW_DOWN,
1548
1549
  y.ARROW_UP,
1549
1550
  y.ARROW_LEFT,
1550
1551
  y.ARROW_RIGHT
1551
1552
  ];
1552
- [y.ENTER, y.TAB, ...en];
1553
- function Pi() {
1553
+ [y.ENTER, y.TAB, ...tn];
1554
+ function Ti() {
1554
1555
  const i = [];
1555
- for (const e of en)
1556
+ for (const e of tn)
1556
1557
  i.push({
1557
1558
  id: Oe.id,
1558
1559
  binding: e,
@@ -1565,7 +1566,7 @@ function Pi() {
1565
1566
  }
1566
1567
  }), i.push({
1567
1568
  id: Oe.id,
1568
- binding: e | Mn.SHIFT,
1569
+ binding: e | Dn.SHIFT,
1569
1570
  preconditions: (t) => Be(t),
1570
1571
  staticParameters: {
1571
1572
  visible: !1,
@@ -1576,41 +1577,41 @@ function Pi() {
1576
1577
  });
1577
1578
  return i;
1578
1579
  }
1579
- const Ti = {
1580
- id: Fn.id,
1581
- preconditions: (i) => Be(i) || yi(i),
1580
+ const Mi = {
1581
+ id: Wn.id,
1582
+ preconditions: (i) => Be(i) || Pi(i),
1582
1583
  binding: y.BACKSPACE
1583
1584
  };
1584
- var Mi = Object.getOwnPropertyDescriptor, Di = (i, e, t, n) => {
1585
- for (var r = n > 1 ? void 0 : n ? Mi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1585
+ var Di = Object.getOwnPropertyDescriptor, Ni = (i, e, t, n) => {
1586
+ for (var r = n > 1 ? void 0 : n ? Di(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1586
1587
  (o = i[s]) && (r = o(r) || r);
1587
1588
  return r;
1588
1589
  }, te = (i, e) => (t, n) => e(t, n, i);
1589
- let ye = class extends Ue {
1590
+ let ye = class extends Ne {
1590
1591
  constructor(i, e, t, n, r, s) {
1591
1592
  super(), this._injector = i, this._menuManagerService = e, this._componentManager = t, this._uiPartsService = n, this._commandService = r, this._shortcutService = s, this._initCommands(), this._initCustomComponents(), this._initUIComponents(), this._initMenus(), this._initShortcuts();
1592
1593
  }
1593
1594
  _initMenus() {
1594
- this._menuManagerService.mergeMenu(Ri);
1595
+ this._menuManagerService.mergeMenu(Oi);
1595
1596
  }
1596
1597
  _initCustomComponents() {
1597
1598
  const i = this._componentManager;
1598
- this.disposeWithMe(i.register("TextIcon", Wt)), this.disposeWithMe(i.register("GraphIcon", Bt)), this.disposeWithMe(i.register(Qt, xi)), this.disposeWithMe(i.register(Ee, fi));
1599
+ this.disposeWithMe(i.register("TextIcon", kt)), this.disposeWithMe(i.register("GraphIcon", Ht)), this.disposeWithMe(i.register(Jt, Ci)), this.disposeWithMe(i.register(Ee, _i));
1599
1600
  }
1600
1601
  _initCommands() {
1601
1602
  [
1603
+ At,
1602
1604
  jt,
1603
- Vt,
1604
- Yt,
1605
+ qt,
1605
1606
  Ge,
1606
- Xt,
1607
+ Yt,
1607
1608
  Je,
1608
1609
  qe,
1610
+ Xt,
1609
1611
  Gt,
1610
- Zt,
1611
1612
  Ye,
1612
1613
  $e,
1613
- At,
1614
+ Lt,
1614
1615
  B,
1615
1616
  // commands for editor
1616
1617
  Oe
@@ -1618,234 +1619,42 @@ let ye = class extends Ue {
1618
1619
  }
1619
1620
  _initUIComponents() {
1620
1621
  this.disposeWithMe(
1621
- this._uiPartsService.registerComponent(ct.LEFT_SIDEBAR, () => at(_i, this._injector))
1622
+ this._uiPartsService.registerComponent(ct.LEFT_SIDEBAR, () => at(mi, this._injector))
1622
1623
  ), this.disposeWithMe(
1623
- this._uiPartsService.registerComponent(ct.CONTENT, () => at(wi, this._injector))
1624
+ this._uiPartsService.registerComponent(ct.CONTENT, () => at(yi, this._injector))
1624
1625
  );
1625
1626
  }
1626
1627
  _initShortcuts() {
1627
1628
  [
1628
- Ti,
1629
- ...Pi()
1629
+ Mi,
1630
+ ...Ti()
1630
1631
  ].forEach((i) => {
1631
1632
  this.disposeWithMe(this._shortcutService.registerShortcut(i));
1632
1633
  });
1633
1634
  }
1634
1635
  };
1635
- ye = Di([
1636
+ ye = Ni([
1636
1637
  te(0, z(ke)),
1637
- te(1, Dn),
1638
+ te(1, Nn),
1638
1639
  te(2, z(Un)),
1639
- te(3, Nn),
1640
- te(4, U),
1641
- te(5, Vn)
1640
+ te(3, Vn),
1641
+ te(4, N),
1642
+ te(5, jn)
1642
1643
  ], ye);
1643
- const Ui = "slides-ui.config", pt = {};
1644
- var Ni = Object.getOwnPropertyDescriptor, Vi = (i, e, t, n) => {
1645
- for (var r = n > 1 ? void 0 : n ? Ni(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1646
- (o = i[s]) && (r = o(r) || r);
1647
- return r;
1648
- }, Se = (i, e) => (t, n) => e(t, n, i);
1649
- function ji(i, e) {
1650
- const t = ft(i.left, i.top, e), n = ft(i.right, i.bottom, e);
1651
- return {
1652
- left: t.x,
1653
- top: t.y,
1654
- right: n.x,
1655
- bottom: n.y
1656
- };
1657
- }
1658
- function ft(i, e, t) {
1659
- const { scaleX: n, scaleY: r } = t.getAncestorScale(), s = t.getViewport(ie.VIEW);
1660
- if (!s)
1661
- return {
1662
- x: i,
1663
- y: e
1664
- };
1665
- const { viewportScrollX: o, viewportScrollY: c } = s, a = (i - o) * n, u = (e - c) * r;
1666
- return {
1667
- x: a,
1668
- y: u
1669
- };
1670
- }
1671
- let Pe = class extends Ue {
1672
- constructor(i, e, t, n) {
1673
- super(), this._globalPopupManagerService = i, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = n;
1674
- }
1675
- _createObjectPositionObserver(i, e) {
1676
- const n = (() => {
1677
- var A, L, Q, ee;
1678
- const { scene: o, engine: c } = e, { left: a, top: u, width: l, height: d } = i, v = (o.width - ((L = (A = e.mainComponent) == null ? void 0 : A.width) != null ? L : 0)) / 2, _ = (o.height - ((ee = (Q = e.mainComponent) == null ? void 0 : Q.height) != null ? ee : 0)) / 2, f = {
1679
- left: a,
1680
- right: a + l,
1681
- top: u,
1682
- bottom: u + d
1683
- }, p = c.getCanvasElement(), h = p.getBoundingClientRect(), m = En(p.style.width), { scaleX: I, scaleY: b } = o.getAncestorScale(), T = ji(f, o), { top: M, left: N, width: x } = h, W = x / m;
1684
- return {
1685
- left: T.left * W * I + N + v,
1686
- right: T.right * W * I + N + v,
1687
- top: T.top * W * b + M + _,
1688
- bottom: T.bottom * W * b + M + _
1689
- };
1690
- })(), r = new q(n), s = new Ke();
1691
- return {
1692
- position: n,
1693
- position$: r,
1694
- disposable: s
1695
- };
1696
- }
1697
- attachPopupToObject(i, e) {
1698
- const n = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getUnitId(), r = this._renderManagerService.getRenderById(n);
1699
- if (!r)
1700
- return {
1701
- dispose: () => {
1702
- }
1703
- };
1704
- const { position: s, position$: o, disposable: c } = this._createObjectPositionObserver(i, r), a = this._globalPopupManagerService.addPopup({
1705
- ...e,
1706
- unitId: n,
1707
- subUnitId: "default",
1708
- anchorRect: s,
1709
- anchorRect$: o,
1710
- canvasElement: r.engine.getCanvasElement()
1711
- });
1712
- return {
1713
- dispose: () => {
1714
- this._globalPopupManagerService.removePopup(a), o.complete(), c.dispose();
1715
- }
1716
- };
1717
- }
1718
- };
1719
- Pe = Vi([
1720
- Se(0, z(jn)),
1721
- Se(1, K),
1722
- Se(2, w),
1723
- Se(3, U)
1724
- ], Pe);
1644
+ const Ui = "@univerjs/slides-ui", Vi = "0.17.0", pt = {
1645
+ name: Ui,
1646
+ version: Vi
1647
+ }, ji = "slides-ui.config", ft = {};
1725
1648
  var Ai = Object.getOwnPropertyDescriptor, Li = (i, e, t, n) => {
1726
1649
  for (var r = n > 1 ? void 0 : n ? Ai(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1727
1650
  (o = i[s]) && (r = o(r) || r);
1728
1651
  return r;
1729
- }, X = (i, e) => (t, n) => e(t, n, i);
1730
- let Te = class extends pe {
1731
- constructor(e, t, n, r, s, o, c) {
1652
+ }, Ve = (i, e) => (t, n) => e(t, n, i);
1653
+ const et = Et("univer.slide-editor-bridge.service");
1654
+ let He = class extends Ne {
1655
+ constructor(e, t, n) {
1732
1656
  super();
1733
- S(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
1734
- this._canvasPopManagerService = e, this._renderManagerService = t, this._univerInstanceService = n, this._contextService = r, this._canvasView = s, this._sidebarService = o, this._commandService = c, this._init();
1735
- }
1736
- _init() {
1737
- this._univerInstanceService.getAllUnitsForType(E.UNIVER_SLIDE).forEach((e) => this._create(e));
1738
- }
1739
- _create(e) {
1740
- if (!e)
1741
- return;
1742
- const t = e.getUnitId();
1743
- this._renderManagerService.has(t) && !this._initImagePopupMenu.has(t) && (this._popupMenuListener(t), this._initImagePopupMenu.add(t));
1744
- }
1745
- _hasCropObject(e) {
1746
- }
1747
- // eslint-disable-next-line max-lines-per-function
1748
- _popupMenuListener(e) {
1749
- var r;
1750
- const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), n = (r = t == null ? void 0 : t.getPages()) != null ? r : {};
1751
- Object.keys(n).forEach((s) => {
1752
- var u;
1753
- const c = (u = this._canvasView.getRenderUnitByPageId(s, e).scene) == null ? void 0 : u.getTransformer();
1754
- if (!c) return;
1755
- let a;
1756
- this.disposeWithMe(
1757
- Rt(
1758
- c.createControl$.subscribe(() => {
1759
- const l = c.getSelectedObjectMap();
1760
- if (l.size > 1) {
1761
- a == null || a.dispose();
1762
- return;
1763
- }
1764
- const d = l.values().next().value;
1765
- if (!d)
1766
- return;
1767
- const v = d.oKey;
1768
- a == null || a.dispose(), a = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
1769
- componentKey: Qt,
1770
- direction: "horizontal",
1771
- offset: [2, 0],
1772
- extraProps: {
1773
- menuItems: this._getMenuItemsByObjectType(d.objectType, v, e)
1774
- }
1775
- })), this._sidebarService.visible && this._commandService.executeCommand($e.id, {
1776
- visible: !0,
1777
- objectType: d.objectType
1778
- });
1779
- })
1780
- )
1781
- ), this.disposeWithMe(
1782
- c.clearControl$.subscribe(() => {
1783
- a == null || a.dispose(), this._contextService.setContextValue(vn, !1);
1784
- })
1785
- ), this.disposeWithMe(
1786
- c.changing$.subscribe(() => {
1787
- a == null || a.dispose();
1788
- const l = c.getSelectedObjectMap();
1789
- if (l.size > 1) {
1790
- a == null || a.dispose();
1791
- return;
1792
- }
1793
- const d = l.values().next().value;
1794
- d && this._commandService.executeCommand(B.id, {
1795
- unitId: e,
1796
- oKey: d.oKey,
1797
- props: {
1798
- width: d.width,
1799
- height: d.height,
1800
- left: d.left,
1801
- top: d.top
1802
- }
1803
- });
1804
- })
1805
- );
1806
- });
1807
- }
1808
- _getMenuItemsByObjectType(e, t, n) {
1809
- return [{
1810
- label: "slide.popup.edit",
1811
- index: 0,
1812
- commandId: $e.id,
1813
- commandParams: {
1814
- visible: !0,
1815
- objectType: e
1816
- },
1817
- disable: !1
1818
- }, {
1819
- label: "slide.popup.delete",
1820
- index: 5,
1821
- commandId: At.id,
1822
- commandParams: {
1823
- id: t,
1824
- unitId: n
1825
- },
1826
- disable: !1
1827
- }];
1828
- }
1829
- };
1830
- Te = Li([
1831
- X(0, z(Pe)),
1832
- X(1, K),
1833
- X(2, w),
1834
- X(3, fe),
1835
- X(4, z(P)),
1836
- X(5, Tt),
1837
- X(6, U)
1838
- ], Te);
1839
- var $i = Object.getOwnPropertyDescriptor, Bi = (i, e, t, n) => {
1840
- for (var r = n > 1 ? void 0 : n ? $i(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1841
- (o = i[s]) && (r = o(r) || r);
1842
- return r;
1843
- }, Ve = (i, e) => (t, n) => e(t, n, i);
1844
- const et = bt("univer.slide-editor-bridge.service");
1845
- let He = class extends Ue {
1846
- constructor(e, t, n) {
1847
- super();
1848
- S(this, "_editorUnitId", ue);
1657
+ S(this, "_editorUnitId", he);
1849
1658
  S(this, "_isForceKeepVisible", !1);
1850
1659
  S(this, "_editorIsDirty", !1);
1851
1660
  S(this, "_currentEditRectState", null);
@@ -1860,7 +1669,7 @@ let He = class extends Ue {
1860
1669
  S(this, "visible$", this._visible$.asObservable());
1861
1670
  S(this, "_afterVisible$", new q(this._visibleParam));
1862
1671
  S(this, "afterVisible$", this._afterVisible$.asObservable());
1863
- S(this, "endEditing$", new Nt());
1672
+ S(this, "endEditing$", new Vt());
1864
1673
  S(this, "_currentEditRectInfo");
1865
1674
  this._editorService = e, this._contextService = t, this._renderManagerService = n;
1866
1675
  }
@@ -1875,7 +1684,7 @@ let He = class extends Ue {
1875
1684
  * @editorInfo editorInfo
1876
1685
  */
1877
1686
  setEditorRect(e) {
1878
- this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(ue), this._contextService.setContextValue(Re, !1), this._contextService.setContextValue(xt, !1), this._contextService.setContextValue(Ot, !1));
1687
+ this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(he), this._contextService.setContextValue(Re, !1), this._contextService.setContextValue(xt, !1), this._contextService.setContextValue(Ot, !1));
1879
1688
  const t = this.getEditRectState();
1880
1689
  this._currentEditRectState = t, this._currentEditRectState$.next(t);
1881
1690
  }
@@ -1889,7 +1698,7 @@ let He = class extends Ue {
1889
1698
  * && this@setEditorRect
1890
1699
  */
1891
1700
  getEditRectState() {
1892
- const e = ue, t = this._currentEditRectInfo, n = t.unitId, r = t.richTextObj.documentData;
1701
+ const e = he, t = this._currentEditRectInfo, n = t.unitId, r = t.richTextObj.documentData;
1893
1702
  r.id = e, r.documentStyle = {
1894
1703
  ...r.documentStyle,
1895
1704
  pageSize: { width: t.richTextObj.width, height: 1 / 0 }
@@ -1905,7 +1714,7 @@ let He = class extends Ue {
1905
1714
  }, c = t.richTextObj.width, a = t.richTextObj.height, u = t.richTextObj.left, l = t.richTextObj.top, d = {
1906
1715
  left: 0,
1907
1716
  top: 0
1908
- }, v = this._renderManagerService.getRenderById(n), _ = v == null ? void 0 : v.scene, f = _ == null ? void 0 : _.getViewport(ie.VIEW), p = _ == null ? void 0 : _.getObject(ie.COMPONENT), h = {
1717
+ }, v = this._renderManagerService.getRenderById(n), _ = v == null ? void 0 : v.scene, f = _ == null ? void 0 : _.getViewport(re.VIEW), p = _ == null ? void 0 : _.getObject(re.COMPONENT), h = {
1909
1718
  x: (p == null ? void 0 : p.left) || 0,
1910
1719
  y: (p == null ? void 0 : p.top) || 0
1911
1720
  }, m = (f == null ? void 0 : f.viewportScrollX) || 0, I = (f == null ? void 0 : f.viewportScrollY) || 0;
@@ -1979,18 +1788,18 @@ let He = class extends Ue {
1979
1788
  };
1980
1789
  }
1981
1790
  };
1982
- He = Bi([
1791
+ He = Li([
1983
1792
  Ve(0, Ze),
1984
- Ve(1, fe),
1793
+ Ve(1, _e),
1985
1794
  Ve(2, K)
1986
1795
  ], He);
1987
- var G = /* @__PURE__ */ ((i) => (i[i.InitialState = 0] = "InitialState", i[i.StartEditor = 1] = "StartEditor", i[i.CursorChange = 2] = "CursorChange", i))(G || {}), Hi = Object.getOwnPropertyDescriptor, Fi = (i, e, t, n) => {
1988
- for (var r = n > 1 ? void 0 : n ? Hi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1796
+ var G = /* @__PURE__ */ ((i) => (i[i.InitialState = 0] = "InitialState", i[i.StartEditor = 1] = "StartEditor", i[i.CursorChange = 2] = "CursorChange", i))(G || {}), $i = Object.getOwnPropertyDescriptor, Bi = (i, e, t, n) => {
1797
+ for (var r = n > 1 ? void 0 : n ? $i(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1989
1798
  (o = i[s]) && (r = o(r) || r);
1990
1799
  return r;
1991
1800
  }, j = (i, e) => (t, n) => e(t, n, i);
1992
- const _t = -1e3, mt = 5, Wi = 2;
1993
- let Fe = class extends Ue {
1801
+ const _t = -1e3, mt = 5, Hi = 2;
1802
+ let Fe = class extends Ne {
1994
1803
  constructor(e, t, n, r, s, o, c, a, u, l, d, v) {
1995
1804
  super();
1996
1805
  /**
@@ -2041,7 +1850,7 @@ let Fe = class extends Ue {
2041
1850
  return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(gt).getViewModel();
2042
1851
  }
2043
1852
  _initialCursorSync(e) {
2044
- e.add(this._cellEditorManagerService.focus$.pipe(Zn((t) => !!t)).subscribe(() => {
1853
+ e.add(this._cellEditorManagerService.focus$.pipe(Gn((t) => !!t)).subscribe(() => {
2045
1854
  var t;
2046
1855
  (t = Le(E.UNIVER_DOC, this._instanceSrv, this._renderManagerService)) == null || t.with(dt).sync();
2047
1856
  }));
@@ -2132,15 +1941,15 @@ let Fe = class extends Ue {
2132
1941
  const a = this._getEditorObject();
2133
1942
  if (a == null)
2134
1943
  return;
2135
- function u(ce) {
2136
- return Number.parseInt(ce.replace("px", ""));
1944
+ function u(ae) {
1945
+ return Number.parseInt(ae.replace("px", ""));
2137
1946
  }
2138
1947
  const d = this._renderContext.engine.getCanvasElement(), v = d.getBoundingClientRect(), _ = u(d.style.width), { top: f, left: p, width: h } = v, m = h / _;
2139
1948
  let { startX: I, startY: b } = n;
2140
1949
  I += r.left, b += r.top;
2141
- const { document: T, scene: M, engine: N } = a, x = M.getViewport(ut.VIEW_MAIN), W = document.body.clientHeight - b - r.top - Wi * 2, oe = document.body.clientWidth - I - r.left;
1950
+ const { document: T, scene: M, engine: U } = a, x = M.getViewport(ut.VIEW_MAIN), W = document.body.clientHeight - b - r.top - Hi * 2, ce = document.body.clientWidth - I - r.left;
2142
1951
  let A = t, L = x == null ? void 0 : x.getScrollBar();
2143
- A > W ? (A = W, L == null ? x && new yt(x, { enableHorizontal: !1, barSize: 8 }) : x == null || x.resetCanvasSizeAndUpdateScroll()) : (L = null, (C = x == null ? void 0 : x.getScrollBar()) == null || C.dispose()), e += (L == null ? void 0 : L.barSize) || 0, e = Math.min(e, oe), I -= ne, b -= ne, this._addBackground(M, e / o, t / c, s);
1952
+ A > W ? (A = W, L == null ? x && new Pt(x, { enableHorizontal: !1, barSize: 8 }) : x == null || x.resetCanvasSizeAndUpdateScroll()) : (L = null, (C = x == null ? void 0 : x.getScrollBar()) == null || C.dispose()), e += (L == null ? void 0 : L.barSize) || 0, e = Math.min(e, ce), I -= ie, b -= ie, this._addBackground(M, e / o, t / c, s);
2144
1953
  const { scaleX: Q, scaleY: ee } = M.getPrecisionScale();
2145
1954
  M.transformByState({
2146
1955
  width: e * m / o,
@@ -2148,13 +1957,13 @@ let Fe = class extends Ue {
2148
1957
  scaleX: o * m,
2149
1958
  scaleY: c * m
2150
1959
  }), T.resize(e / o, t / c), setTimeout(() => {
2151
- N.resizeBySize(
1960
+ U.resizeBySize(
2152
1961
  st(e, Q),
2153
1962
  st(A, ee)
2154
1963
  );
2155
1964
  }, 0);
2156
- const _e = this._layoutService.getContentElement().getBoundingClientRect(), me = d.getBoundingClientRect();
2157
- I = I * m + (me.left - _e.left), b = b * m + (me.top - _e.top), this._cellEditorManagerService.setState({
1965
+ const me = this._layoutService.getContentElement().getBoundingClientRect(), Ce = d.getBoundingClientRect();
1966
+ I = I * m + (Ce.left - me.left), b = b * m + (Ce.top - me.top), this._cellEditorManagerService.setState({
2158
1967
  startX: I,
2159
1968
  startY: b,
2160
1969
  endX: e * m + I,
@@ -2169,14 +1978,14 @@ let Fe = class extends Ue {
2169
1978
  const s = "_backgroundRectHelperColor_", o = e.getObject(s);
2170
1979
  o == null && r == null || (o == null ? e.addObjects(
2171
1980
  [
2172
- new Pt(s, {
1981
+ new Tt(s, {
2173
1982
  width: t,
2174
1983
  height: n,
2175
1984
  fill: r,
2176
1985
  evented: !1
2177
1986
  })
2178
1987
  ],
2179
- Wn
1988
+ kn
2180
1989
  ) : r == null ? o.dispose() : (o.setProps({
2181
1990
  fill: r
2182
1991
  }), o.transformByState({
@@ -2242,9 +2051,9 @@ let Fe = class extends Ue {
2242
2051
  _showEditorByKeyboard(e) {
2243
2052
  }
2244
2053
  _commandExecutedListener(e) {
2245
- const t = [Oe.id], n = [Xn.id];
2054
+ const t = [Oe.id], n = [Yn.id];
2246
2055
  e.add(this._commandService.onCommandExecuted((r) => {
2247
- this._editorService.getFocusId() === ue && (t.includes(r.id) && this._moveCursorCmdHandler(r), n.includes(r.id) && this._editorBridgeService.isVisible() && this._editingChangedHandler());
2056
+ this._editorService.getFocusId() === he && (t.includes(r.id) && this._moveCursorCmdHandler(r), n.includes(r.id) && this._editorBridgeService.isVisible() && this._editingChangedHandler());
2248
2057
  }));
2249
2058
  }
2250
2059
  _moveCursorCmdHandler(e) {
@@ -2261,7 +2070,7 @@ let Fe = class extends Ue {
2261
2070
  this._handleEditorVisible({ visible: !0, eventType: 3, unitId: n });
2262
2071
  }
2263
2072
  _getEditorObject() {
2264
- return ki(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
2073
+ return Fi(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
2265
2074
  }
2266
2075
  async _handleEditorInvisible(e) {
2267
2076
  const { keycode: t } = e;
@@ -2312,40 +2121,40 @@ let Fe = class extends Ue {
2312
2121
  if (!t)
2313
2122
  return;
2314
2123
  const { document: n } = t;
2315
- e.add(Rt(n.onPointerDown$.subscribeEvent(() => {
2124
+ e.add(yt(n.onPointerDown$.subscribeEvent(() => {
2316
2125
  this._cursorChange === G.StartEditor && (this._cursorChange = G.CursorChange);
2317
2126
  })));
2318
2127
  }
2319
2128
  // TODO: @JOCS, is it necessary to move these commands MoveSelectionOperation\MoveCursorOperation to shortcut? and use multi-commands?
2320
2129
  _moveInEditor(e, t) {
2321
2130
  let n = V.LEFT;
2322
- e === y.ARROW_DOWN ? n = V.DOWN : e === y.ARROW_UP ? n = V.UP : e === y.ARROW_RIGHT && (n = V.RIGHT), t ? this._commandService.executeCommand(kn.id, {
2131
+ e === y.ARROW_DOWN ? n = V.DOWN : e === y.ARROW_UP ? n = V.UP : e === y.ARROW_RIGHT && (n = V.RIGHT), t ? this._commandService.executeCommand(zn.id, {
2323
2132
  direction: n
2324
- }) : this._commandService.executeCommand(zn.id, {
2133
+ }) : this._commandService.executeCommand(Kn.id, {
2325
2134
  direction: n
2326
2135
  });
2327
2136
  }
2328
2137
  };
2329
- Fe = Fi([
2138
+ Fe = Bi([
2330
2139
  j(1, An),
2331
2140
  j(2, fn),
2332
- j(3, fe),
2141
+ j(3, _e),
2333
2142
  j(4, w),
2334
2143
  j(5, K),
2335
2144
  j(6, et),
2336
2145
  j(7, Qe),
2337
- j(8, z(Gn)),
2338
- j(9, U),
2146
+ j(8, z(Xn)),
2147
+ j(9, N),
2339
2148
  j(10, z(J)),
2340
2149
  j(11, Ze)
2341
2150
  ], Fe);
2342
- function ki(i, e) {
2151
+ function Fi(i, e) {
2343
2152
  if (i == null)
2344
2153
  return;
2345
2154
  const t = e.getRenderById(i);
2346
2155
  if (t == null)
2347
2156
  return;
2348
- const { mainComponent: n, scene: r, engine: s, components: o } = t, c = n, a = o.get(Kn.BACKGROUND);
2157
+ const { mainComponent: n, scene: r, engine: s, components: o } = t, c = n, a = o.get(Zn.BACKGROUND);
2349
2158
  return {
2350
2159
  document: c,
2351
2160
  docBackground: a,
@@ -2353,12 +2162,12 @@ function ki(i, e) {
2353
2162
  engine: s
2354
2163
  };
2355
2164
  }
2356
- var zi = Object.getOwnPropertyDescriptor, Ki = (i, e, t, n) => {
2357
- for (var r = n > 1 ? void 0 : n ? zi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2165
+ var Wi = Object.getOwnPropertyDescriptor, ki = (i, e, t, n) => {
2166
+ for (var r = n > 1 ? void 0 : n ? Wi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2358
2167
  (o = i[s]) && (r = o(r) || r);
2359
2168
  return r;
2360
2169
  }, je = (i, e) => (t, n) => e(t, n, i);
2361
- let We = class extends pe {
2170
+ let We = class extends fe {
2362
2171
  constructor(e, t, n, r) {
2363
2172
  super();
2364
2173
  /**
@@ -2367,7 +2176,7 @@ let We = class extends pe {
2367
2176
  // private _cursorChange: CursorChange = CursorChange.InitialState;
2368
2177
  /** If the corresponding unit is active and prepared for editing. */
2369
2178
  // private _isUnitEditing = false;
2370
- S(this, "setSlideTextEditor$", new Nt());
2179
+ S(this, "setSlideTextEditor$", new Vt());
2371
2180
  S(this, "_curRichText", null);
2372
2181
  S(this, "_d");
2373
2182
  this._renderContext = e, this._instanceSrv = t, this._commandService = n, this._editorBridgeService = r, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(E.UNIVER_SLIDE).subscribe((s) => {
@@ -2403,7 +2212,7 @@ let We = class extends pe {
2403
2212
  })), e.add(o.onDblclick$.subscribeEvent(() => {
2404
2213
  c.clearControls();
2405
2214
  const u = c.getSelectedObjectMap().values().next().value;
2406
- u && (u.objectType !== de.RICH_TEXT ? this.pickOtherObjects() : this.startEditing(o.sceneKey, u));
2215
+ u && (u.objectType !== ue.RICH_TEXT ? this.pickOtherObjects() : this.startEditing(o.sceneKey, u));
2407
2216
  })), e.add(this._instanceSrv.focused$.subscribe((a) => {
2408
2217
  this.endEditing();
2409
2218
  })));
@@ -2466,17 +2275,212 @@ let We = class extends pe {
2466
2275
  this._editorBridgeService.changeVisible({ visible: e, eventType: Y.PointerDown, unitId: t });
2467
2276
  }
2468
2277
  };
2469
- We = Ki([
2278
+ We = ki([
2470
2279
  je(1, w),
2471
- je(2, U),
2280
+ je(2, N),
2472
2281
  je(3, et)
2473
2282
  ], We);
2474
- var Zi = Object.getOwnPropertyDescriptor, Gi = (i, e, t, n) => {
2475
- for (var r = n > 1 ? void 0 : n ? Zi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2283
+ var zi = Object.getOwnPropertyDescriptor, Ki = (i, e, t, n) => {
2284
+ for (var r = n > 1 ? void 0 : n ? zi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2285
+ (o = i[s]) && (r = o(r) || r);
2286
+ return r;
2287
+ }, Ie = (i, e) => (t, n) => e(t, n, i);
2288
+ function Zi(i, e) {
2289
+ const t = Ct(i.left, i.top, e), n = Ct(i.right, i.bottom, e);
2290
+ return {
2291
+ left: t.x,
2292
+ top: t.y,
2293
+ right: n.x,
2294
+ bottom: n.y
2295
+ };
2296
+ }
2297
+ function Ct(i, e, t) {
2298
+ const { scaleX: n, scaleY: r } = t.getAncestorScale(), s = t.getViewport(re.VIEW);
2299
+ if (!s)
2300
+ return {
2301
+ x: i,
2302
+ y: e
2303
+ };
2304
+ const { viewportScrollX: o, viewportScrollY: c } = s, a = (i - o) * n, u = (e - c) * r;
2305
+ return {
2306
+ x: a,
2307
+ y: u
2308
+ };
2309
+ }
2310
+ let Pe = class extends Ne {
2311
+ constructor(i, e, t, n) {
2312
+ super(), this._globalPopupManagerService = i, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = n;
2313
+ }
2314
+ _createObjectPositionObserver(i, e) {
2315
+ const n = (() => {
2316
+ var A, L, Q, ee;
2317
+ const { scene: o, engine: c } = e, { left: a, top: u, width: l, height: d } = i, v = (o.width - ((L = (A = e.mainComponent) == null ? void 0 : A.width) != null ? L : 0)) / 2, _ = (o.height - ((ee = (Q = e.mainComponent) == null ? void 0 : Q.height) != null ? ee : 0)) / 2, f = {
2318
+ left: a,
2319
+ right: a + l,
2320
+ top: u,
2321
+ bottom: u + d
2322
+ }, p = c.getCanvasElement(), h = p.getBoundingClientRect(), m = Rn(p.style.width), { scaleX: I, scaleY: b } = o.getAncestorScale(), T = Zi(f, o), { top: M, left: U, width: x } = h, W = x / m;
2323
+ return {
2324
+ left: T.left * W * I + U + v,
2325
+ right: T.right * W * I + U + v,
2326
+ top: T.top * W * b + M + _,
2327
+ bottom: T.bottom * W * b + M + _
2328
+ };
2329
+ })(), r = new q(n), s = new Ke();
2330
+ return {
2331
+ position: n,
2332
+ position$: r,
2333
+ disposable: s
2334
+ };
2335
+ }
2336
+ attachPopupToObject(i, e) {
2337
+ const n = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getUnitId(), r = this._renderManagerService.getRenderById(n);
2338
+ if (!r)
2339
+ return {
2340
+ dispose: () => {
2341
+ }
2342
+ };
2343
+ const { position: s, position$: o, disposable: c } = this._createObjectPositionObserver(i, r), a = this._globalPopupManagerService.addPopup({
2344
+ ...e,
2345
+ unitId: n,
2346
+ subUnitId: "default",
2347
+ anchorRect: s,
2348
+ anchorRect$: o,
2349
+ canvasElement: r.engine.getCanvasElement()
2350
+ });
2351
+ return {
2352
+ dispose: () => {
2353
+ this._globalPopupManagerService.removePopup(a), o.complete(), c.dispose();
2354
+ }
2355
+ };
2356
+ }
2357
+ };
2358
+ Pe = Ki([
2359
+ Ie(0, z(Ln)),
2360
+ Ie(1, K),
2361
+ Ie(2, w),
2362
+ Ie(3, N)
2363
+ ], Pe);
2364
+ var Gi = Object.getOwnPropertyDescriptor, Xi = (i, e, t, n) => {
2365
+ for (var r = n > 1 ? void 0 : n ? Gi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2366
+ (o = i[s]) && (r = o(r) || r);
2367
+ return r;
2368
+ }, X = (i, e) => (t, n) => e(t, n, i);
2369
+ let Te = class extends fe {
2370
+ constructor(e, t, n, r, s, o, c) {
2371
+ super();
2372
+ S(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
2373
+ this._canvasPopManagerService = e, this._renderManagerService = t, this._univerInstanceService = n, this._contextService = r, this._canvasView = s, this._sidebarService = o, this._commandService = c, this._init();
2374
+ }
2375
+ _init() {
2376
+ this._univerInstanceService.getAllUnitsForType(E.UNIVER_SLIDE).forEach((e) => this._create(e));
2377
+ }
2378
+ _create(e) {
2379
+ if (!e)
2380
+ return;
2381
+ const t = e.getUnitId();
2382
+ this._renderManagerService.has(t) && !this._initImagePopupMenu.has(t) && (this._popupMenuListener(t), this._initImagePopupMenu.add(t));
2383
+ }
2384
+ _hasCropObject(e) {
2385
+ }
2386
+ // eslint-disable-next-line max-lines-per-function
2387
+ _popupMenuListener(e) {
2388
+ var r;
2389
+ const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), n = (r = t == null ? void 0 : t.getPages()) != null ? r : {};
2390
+ Object.keys(n).forEach((s) => {
2391
+ var u;
2392
+ const c = (u = this._canvasView.getRenderUnitByPageId(s, e).scene) == null ? void 0 : u.getTransformer();
2393
+ if (!c) return;
2394
+ let a;
2395
+ this.disposeWithMe(
2396
+ yt(
2397
+ c.createControl$.subscribe(() => {
2398
+ const l = c.getSelectedObjectMap();
2399
+ if (l.size > 1) {
2400
+ a == null || a.dispose();
2401
+ return;
2402
+ }
2403
+ const d = l.values().next().value;
2404
+ if (!d)
2405
+ return;
2406
+ const v = d.oKey;
2407
+ a == null || a.dispose(), a = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
2408
+ componentKey: Jt,
2409
+ direction: "horizontal",
2410
+ offset: [2, 0],
2411
+ extraProps: {
2412
+ menuItems: this._getMenuItemsByObjectType(d.objectType, v, e)
2413
+ }
2414
+ })), this._sidebarService.visible && this._commandService.executeCommand($e.id, {
2415
+ visible: !0,
2416
+ objectType: d.objectType
2417
+ });
2418
+ })
2419
+ )
2420
+ ), this.disposeWithMe(
2421
+ c.clearControl$.subscribe(() => {
2422
+ a == null || a.dispose(), this._contextService.setContextValue(Cn, !1);
2423
+ })
2424
+ ), this.disposeWithMe(
2425
+ c.changing$.subscribe(() => {
2426
+ a == null || a.dispose();
2427
+ const l = c.getSelectedObjectMap();
2428
+ if (l.size > 1) {
2429
+ a == null || a.dispose();
2430
+ return;
2431
+ }
2432
+ const d = l.values().next().value;
2433
+ d && this._commandService.executeCommand(B.id, {
2434
+ unitId: e,
2435
+ oKey: d.oKey,
2436
+ props: {
2437
+ width: d.width,
2438
+ height: d.height,
2439
+ left: d.left,
2440
+ top: d.top
2441
+ }
2442
+ });
2443
+ })
2444
+ );
2445
+ });
2446
+ }
2447
+ _getMenuItemsByObjectType(e, t, n) {
2448
+ return [{
2449
+ label: "slide.popup.edit",
2450
+ index: 0,
2451
+ commandId: $e.id,
2452
+ commandParams: {
2453
+ visible: !0,
2454
+ objectType: e
2455
+ },
2456
+ disable: !1
2457
+ }, {
2458
+ label: "slide.popup.delete",
2459
+ index: 5,
2460
+ commandId: Lt.id,
2461
+ commandParams: {
2462
+ id: t,
2463
+ unitId: n
2464
+ },
2465
+ disable: !1
2466
+ }];
2467
+ }
2468
+ };
2469
+ Te = Xi([
2470
+ X(0, z(Pe)),
2471
+ X(1, K),
2472
+ X(2, w),
2473
+ X(3, _e),
2474
+ X(4, z(P)),
2475
+ X(5, Mt),
2476
+ X(6, N)
2477
+ ], Te);
2478
+ var Yi = Object.getOwnPropertyDescriptor, qi = (i, e, t, n) => {
2479
+ for (var r = n > 1 ? void 0 : n ? Yi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2476
2480
  (o = i[s]) && (r = o(r) || r);
2477
2481
  return r;
2478
2482
  }, Ae = (i, e) => (t, n) => e(t, n, i);
2479
- let Me = class extends pe {
2483
+ let Me = class extends fe {
2480
2484
  // private _skeletonChangeMutations = new Set<string>();
2481
2485
  constructor(i, e, t) {
2482
2486
  super(), this._contextService = i, this._instanceSrv = e, this._renderManagerService = t, Promise.resolve().then(() => this._init());
@@ -2501,41 +2505,39 @@ let Me = class extends pe {
2501
2505
  _initContextListener() {
2502
2506
  }
2503
2507
  };
2504
- Me = Gi([
2505
- Ae(0, fe),
2508
+ Me = qi([
2509
+ Ae(0, _e),
2506
2510
  Ae(1, w),
2507
2511
  Ae(2, K)
2508
2512
  ], Me);
2509
- var Xi = Object.getOwnPropertyDescriptor, Yi = (i, e, t, n) => {
2510
- for (var r = n > 1 ? void 0 : n ? Xi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2513
+ var Ji = Object.getOwnPropertyDescriptor, Qi = (i, e, t, n) => {
2514
+ for (var r = n > 1 ? void 0 : n ? Ji(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2511
2515
  (o = i[s]) && (r = o(r) || r);
2512
2516
  return r;
2513
- }, Ie = (i, e) => (t, n) => e(t, n, i);
2514
- const qi = "SLIDE_UI";
2515
- var be;
2516
- let Ct = (be = class extends Cn {
2517
- constructor(i = pt, e, t, n, r) {
2517
+ }, be = (i, e) => (t, n) => e(t, n, i), ne;
2518
+ let St = (ne = class extends Sn {
2519
+ constructor(i = ft, e, t, n, r) {
2518
2520
  super(), this._config = i, this._injector = e, this._renderManagerService = t, this._univerInstanceService = n, this._configService = r;
2519
- const { menu: s, ...o } = St(
2521
+ const { menu: s, ...o } = It(
2520
2522
  {},
2521
- pt,
2523
+ ft,
2522
2524
  this._config
2523
2525
  );
2524
- s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(Ui, o);
2526
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(ji, o);
2525
2527
  }
2526
2528
  onStarting() {
2527
2529
  nt([
2528
2530
  [Me],
2529
2531
  [et, { useClass: He }],
2530
2532
  // used by SlideUIController --> EditorContainer
2531
- [Qe, { useClass: Oi }],
2533
+ [Qe, { useClass: wi }],
2532
2534
  [Pe]
2533
2535
  ], this._config.override).forEach((i) => this._injector.add(i));
2534
2536
  }
2535
2537
  onReady() {
2536
2538
  [
2537
2539
  // SlideRenderService will be init in ready stage, and then calling RenderManagerService@createRender --> init all deps in this rendering register block.
2538
- [ve]
2540
+ [pe]
2539
2541
  ].forEach((i) => {
2540
2542
  this.disposeWithMe(this._renderManagerService.registerRenderModule(E.UNIVER_SLIDE, i));
2541
2543
  }), nt([
@@ -2548,7 +2550,7 @@ let Ct = (be = class extends Cn {
2548
2550
  // SlidesUIController controller would add a new RenderUnit (__INTERNAL_EDITOR__DOCS_NORMAL)
2549
2551
  [ye],
2550
2552
  // editor service was create in renderManagerService
2551
- [ve],
2553
+ [pe],
2552
2554
  [Te]
2553
2555
  ], this._config.override).forEach((i) => {
2554
2556
  this._injector.add(i);
@@ -2575,35 +2577,35 @@ let Ct = (be = class extends Cn {
2575
2577
  } catch {
2576
2578
  }
2577
2579
  }
2578
- }, S(be, "pluginName", qi), S(be, "type", E.UNIVER_SLIDE), be);
2579
- Ct = Yi([
2580
- Ie(1, z(ke)),
2581
- Ie(2, K),
2582
- Ie(3, w),
2583
- Ie(4, Sn)
2584
- ], Ct);
2580
+ }, S(ne, "pluginName", "UNIVER_SLIDES_UI_PLUGIN"), S(ne, "packageName", pt.name), S(ne, "version", pt.version), S(ne, "type", E.UNIVER_SLIDE), ne);
2581
+ St = Qi([
2582
+ be(1, z(ke)),
2583
+ be(2, K),
2584
+ be(3, w),
2585
+ be(4, In)
2586
+ ], St);
2585
2587
  export {
2586
- Vt as ActivateSlidePageOperation,
2587
- jt as AppendSlideOperation,
2588
+ jt as ActivateSlidePageOperation,
2589
+ At as AppendSlideOperation,
2588
2590
  P as CanvasView,
2589
- At as DeleteSlideElementOperation,
2591
+ Lt as DeleteSlideElementOperation,
2590
2592
  et as ISlideEditorBridgeService,
2591
2593
  Ge as InsertSlideFloatImageCommand,
2592
2594
  qe as InsertSlideShapeEllipseCommand,
2593
- Gt as InsertSlideShapeEllipseOperation,
2595
+ Xt as InsertSlideShapeEllipseOperation,
2594
2596
  Ye as InsertSlideShapeRectangleCommand,
2595
- Zt as InsertSlideShapeRectangleOperation,
2596
- Jt as SHAPE_MENU_ID,
2597
- qt as SLIDES_IMAGE_MENU_ID,
2598
- ue as SLIDE_EDITOR_ID,
2599
- Yt as SetSlidePageThumbOperation,
2597
+ Gt as InsertSlideShapeRectangleOperation,
2598
+ en as SHAPE_MENU_ID,
2599
+ Qt as SLIDES_IMAGE_MENU_ID,
2600
+ he as SLIDE_EDITOR_ID,
2601
+ qt as SetSlidePageThumbOperation,
2600
2602
  Je as SlideAddTextCommand,
2601
- Xt as SlideAddTextOperation,
2603
+ Yt as SlideAddTextOperation,
2602
2604
  Pe as SlideCanvasPopMangerService,
2603
- wi as SlideEditorContainer,
2604
- _i as SlideSideBar,
2605
+ yi as SlideEditorContainer,
2606
+ mi as SlideSideBar,
2605
2607
  ye as SlidesUIController,
2606
- Ri as SlidesUIMenuSchema,
2607
- Ct as UniverSlidesUIPlugin,
2608
+ Oi as SlidesUIMenuSchema,
2609
+ St as UniverSlidesUIPlugin,
2608
2610
  B as UpdateSlideElementOperation
2609
2611
  };