@univerjs/slides-ui 0.5.5-nightly.202501211606 → 0.5.5

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,43 +1,42 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
- var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { Inject, Injector, RxDisposable, UniverInstanceType, debounce, getColorStyle, IUniverInstanceService, CommandType, Tools, useDependency, LocaleService, ICommandService, generateRandomId, PageElementType, BasicShapes, Disposable, DisposableCollection, toDisposable, FOCUSING_COMMON_DRAWINGS, IContextService, createInternalEditorID, createIdentifier, EDITOR_ACTIVATED, FOCUSING_EDITOR_STANDALONE, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, DocumentDataModel, VerticalAlign, HorizontalAlign, WrapStrategy, FOCUSING_EDITOR_BUT_HIDDEN, DEFAULT_EMPTY_DOCUMENT_VALUE, Direction, IUndoRedoService, DocumentFlavor, FOCUSING_UNIVER_EDITOR, FORMULA_EDITOR_ACTIVATED, connectInjector, Plugin, merge, mergeOverrideWithDependencies, IConfigService } from "@univerjs/core";
6
- import { Viewport, ScrollBar, Slide, Rect, Scene, IRenderManagerService, ObjectType, pxToNum, DeviceInputEventType, convertTextRotation, FIX_ONE_PIXEL_BLUR_OFFSET, fixLineWidthByScale } from "@univerjs/engine-render";
7
- import { ObjectProvider, SLIDE_KEY } from "@univerjs/slides";
8
- import { ISidebarService, ICanvasPopupService, KeyCode, ILayoutService, ILocalFileService, useObservable, DISABLE_AUTO_FOCUS_KEY, MenuItemType, getMenuHiddenObservable, RibbonStartGroup, MetaKeys, ComponentManager, BuiltInUIPart, IMenuManagerService, IUIPartsService, IShortcutService } from "@univerjs/ui";
9
- import React, { forwardRef, useRef, createElement, useState, useEffect, useCallback } from "react";
10
- import { Button, InputNumber, DropdownLegacy, ColorPicker, Scrollbar } from "@univerjs/design";
11
- import { BehaviorSubject, Subject, filter, takeUntil } from "rxjs";
12
- import { DocSelectionManagerService, DocSkeletonManagerService, RichTextEditingMutation } from "@univerjs/docs";
13
- import { IEditorService, DocSelectionRenderService, VIEWPORT_KEY, DOCS_COMPONENT_MAIN_LAYER_INDEX, MoveSelectionOperation, MoveCursorOperation, DOCS_VIEW_KEY, DeleteLeftCommand } from "@univerjs/docs-ui";
14
- import { DRAWING_IMAGE_ALLOW_IMAGE_LIST, IImageIoService, getImageSize } from "@univerjs/drawing";
15
- var __defProp$9 = Object.defineProperty, __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor, __decorateClass$9 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
16
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
17
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
18
- return kind && result && __defProp$9(target, key, result), result;
19
- }, "__decorateClass$9"), __decorateParam$9 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$9"), _a;
20
- let SlideRenderController = (_a = class extends RxDisposable {
21
- constructor(_renderContext, _injector, _univerInstanceService, _renderManagerService) {
1
+ var hn = Object.defineProperty;
2
+ var pn = (i, e, t) => e in i ? hn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var P = (i, e, t) => pn(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Inject as X, Injector as Ge, RxDisposable as fe, UniverInstanceType as x, debounce as fn, getColorStyle as Cn, IUniverInstanceService as j, CommandType as D, Tools as vn, useDependency as O, LocaleService as Q, ICommandService as U, generateRandomId as xt, PageElementType as Xe, BasicShapes as _n, Disposable as Ue, DisposableCollection as Ye, toDisposable as Et, FOCUSING_COMMON_DRAWINGS as Sn, IContextService as Ce, createInternalEditorID as In, createIdentifier as Rt, EDITOR_ACTIVATED as Oe, FOCUSING_EDITOR_STANDALONE as Ot, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as jt, DocumentDataModel as Pn, VerticalAlign as je, HorizontalAlign as yt, WrapStrategy as it, FOCUSING_EDITOR_BUT_HIDDEN as bn, DEFAULT_EMPTY_DOCUMENT_VALUE as Tt, Direction as B, IUndoRedoService as xn, DocumentFlavor as En, FOCUSING_UNIVER_EDITOR as Mt, FORMULA_EDITOR_ACTIVATED as Rn, connectInjector as rt, Plugin as On, merge as jn, mergeOverrideWithDependencies as st, IConfigService as yn } from "@univerjs/core";
5
+ import { Viewport as ot, ScrollBar as wt, Slide as Tn, Rect as Nt, Scene as Mn, IRenderManagerService as Y, ObjectType as he, pxToNum as wn, DeviceInputEventType as q, convertTextRotation as at, FIX_ONE_PIXEL_BLUR_OFFSET as re, fixLineWidthByScale as ct } from "@univerjs/engine-render";
6
+ import { ObjectProvider as Nn, SLIDE_KEY as se } from "@univerjs/slides";
7
+ import { ISidebarService as Dt, ICanvasPopupService as Dn, KeyCode as y, ILayoutService as Un, ILocalFileService as Vn, useObservable as Bn, DISABLE_AUTO_FOCUS_KEY as lt, MenuItemType as ve, getMenuHiddenObservable as _e, RibbonStartGroup as Ln, MetaKeys as An, ComponentManager as $n, BuiltInUIPart as dt, IMenuManagerService as Hn, IUIPartsService as Fn, IShortcutService as zn } from "@univerjs/ui";
8
+ import ke, { forwardRef as A, useRef as Ut, createElement as $, useState as W, useEffect as oe, useCallback as ut } from "react";
9
+ import { Button as Pe, InputNumber as ue, DropdownLegacy as Vt, ColorPicker as Wn, Scrollbar as Kn } from "@univerjs/design";
10
+ import { BehaviorSubject as J, Subject as Bt, filter as Gn, takeUntil as mt } from "rxjs";
11
+ import { DocSelectionManagerService as Xn, DocSkeletonManagerService as gt, RichTextEditingMutation as Yn } from "@univerjs/docs";
12
+ import { IEditorService as Ze, DocSelectionRenderService as ht, VIEWPORT_KEY as pt, DOCS_COMPONENT_MAIN_LAYER_INDEX as kn, MoveSelectionOperation as Zn, MoveCursorOperation as qn, DOCS_VIEW_KEY as Jn, DeleteLeftCommand as Qn } from "@univerjs/docs-ui";
13
+ import { DRAWING_IMAGE_ALLOW_IMAGE_LIST as ei, IImageIoService as ti, getImageSize as ni } from "@univerjs/drawing";
14
+ var ii = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, si = (i, e, t, n) => {
15
+ for (var r = n > 1 ? void 0 : n ? ri(e, t) : e, s = i.length - 1, o; s >= 0; s--)
16
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
17
+ return n && r && ii(e, t, r), r;
18
+ }, Ve = (i, e) => (t, n) => e(t, n, i);
19
+ let pe = class extends fe {
20
+ constructor(e, t, n, r) {
22
21
  super();
23
- __publicField(this, "_objectProvider", null);
24
- __publicField(this, "_refreshThumb", debounce(() => {
22
+ P(this, "_objectProvider", null);
23
+ P(this, "_refreshThumb", fn(() => {
25
24
  this.createThumbs();
26
25
  }, 300));
27
- this._renderContext = _renderContext, this._injector = _injector, this._univerInstanceService = _univerInstanceService, this._renderManagerService = _renderManagerService, this._objectProvider = this._injector.createInstance(ObjectProvider), this._addNewRender();
26
+ this._renderContext = e, this._injector = t, this._univerInstanceService = n, this._renderManagerService = r, this._objectProvider = this._injector.createInstance(Nn), this._addNewRender();
28
27
  }
29
28
  _addNewRender() {
30
- const { unitId, engine, scene } = this._renderContext, slideDataModel = this._getCurrUnitModel();
31
- if (!slideDataModel) return;
32
- const observer = engine.onTransformChange$.subscribeEvent(() => {
33
- this._scrollToCenter(), observer == null || observer.unsubscribe();
29
+ const { unitId: e, engine: t, scene: n } = this._renderContext, r = this._getCurrUnitModel();
30
+ if (!r) return;
31
+ const s = t.onTransformChange$.subscribeEvent(() => {
32
+ this._scrollToCenter(), s == null || s.unsubscribe();
34
33
  });
35
- engine.onTransformChange$.subscribeEvent(() => {
34
+ t.onTransformChange$.subscribeEvent(() => {
36
35
  setTimeout(() => {
37
36
  this.createThumbs();
38
37
  }, 300);
39
38
  });
40
- const viewMain = new Viewport(SLIDE_KEY.VIEW, scene, {
39
+ const o = new ot(se.VIEW, n, {
41
40
  left: 0,
42
41
  top: 0,
43
42
  bottom: 0,
@@ -46,97 +45,97 @@ let SlideRenderController = (_a = class extends RxDisposable {
46
45
  explicitViewportHeightSet: !1,
47
46
  isWheelPreventDefaultX: !0
48
47
  });
49
- scene.attachControl(), scene.onMouseWheel$.subscribeEvent((evt, state) => {
50
- const e = evt;
51
- if (e.ctrlKey) {
52
- const deltaFactor = Math.abs(e.deltaX);
53
- let scrollNum = deltaFactor < 40 ? 0.2 : deltaFactor < 80 ? 0.4 : 0.2;
54
- scrollNum *= e.deltaY > 0 ? -1 : 1, scene.scaleX < 1 && (scrollNum /= 2), scene.scaleX + scrollNum > 4 ? scene.scale(4, 4) : scene.scaleX + scrollNum < 0.1 ? scene.scale(0.1, 0.1) : (e.deltaY > 0, e.preventDefault());
48
+ n.attachControl(), n.onMouseWheel$.subscribeEvent((c, g) => {
49
+ const l = c;
50
+ if (l.ctrlKey) {
51
+ const u = Math.abs(l.deltaX);
52
+ let h = u < 40 ? 0.2 : u < 80 ? 0.4 : 0.2;
53
+ h *= l.deltaY > 0 ? -1 : 1, n.scaleX < 1 && (h /= 2), n.scaleX + h > 4 ? n.scale(4, 4) : n.scaleX + h < 0.1 ? n.scale(0.1, 0.1) : (l.deltaY > 0, l.preventDefault());
55
54
  } else
56
- viewMain.onMouseWheel(e, state);
57
- }), scene.onFileLoaded$.subscribeEvent(() => {
55
+ o.onMouseWheel(l, g);
56
+ }), n.onFileLoaded$.subscribeEvent(() => {
58
57
  this._refreshThumb();
59
- }), ScrollBar.attachTo(viewMain), this._renderManagerService.setCurrent(unitId);
60
- const slide = this._createSlide(scene);
61
- this._renderContext.mainComponent = slide, this._createSlidePages(slideDataModel, slide), this.createThumbs(), engine.runRenderLoop(() => {
62
- scene.render();
58
+ }), wt.attachTo(o), this._renderManagerService.setCurrent(e);
59
+ const a = this._createSlide(n);
60
+ this._renderContext.mainComponent = a, this._createSlidePages(r, a), this.createThumbs(), t.runRenderLoop(() => {
61
+ n.render();
63
62
  });
64
63
  }
65
64
  _scrollToCenter() {
66
- var _a11;
67
- const mainScene = (_a11 = this._currentRender()) == null ? void 0 : _a11.scene, viewMain = mainScene == null ? void 0 : mainScene.getViewport(SLIDE_KEY.VIEW), getCenterPositionViewPort = this._getCenterPositionViewPort(mainScene);
68
- if (!viewMain || !getCenterPositionViewPort) return;
69
- const { left: viewPortLeft, top: viewPortTop } = getCenterPositionViewPort, { x, y } = viewMain.transViewportScroll2ScrollValue(viewPortLeft, viewPortTop);
70
- viewMain.scrollToBarPos({
71
- x,
72
- y
65
+ var c;
66
+ const e = (c = this._currentRender()) == null ? void 0 : c.scene, t = e == null ? void 0 : e.getViewport(se.VIEW), n = this._getCenterPositionViewPort(e);
67
+ if (!t || !n) return;
68
+ const { left: r, top: s } = n, { x: o, y: a } = t.transViewportScroll2ScrollValue(r, s);
69
+ t.scrollToBarPos({
70
+ x: o,
71
+ y: a
73
72
  });
74
73
  }
75
74
  _currentRender() {
76
- return this._renderManagerService.getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_SLIDE);
75
+ return this._renderManagerService.getCurrentTypeOfRenderer(x.UNIVER_SLIDE);
77
76
  }
78
77
  /**
79
78
  * @param mainScene
80
79
  */
81
- _createSlide(mainScene) {
82
- const model = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE), { width: sceneWidth, height: sceneHeight } = mainScene, pageSize = model.getPageSize(), { width = 100, height = 100 } = pageSize, slideComponent = new Slide(SLIDE_KEY.COMPONENT, {
83
- left: (sceneWidth - width) / 2,
84
- top: (sceneHeight - height) / 2,
85
- width,
86
- height,
80
+ _createSlide(e) {
81
+ const t = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SLIDE), { width: n, height: r } = e, s = t.getPageSize(), { width: o = 100, height: a = 100 } = s, c = new Tn(se.COMPONENT, {
82
+ left: (n - o) / 2,
83
+ top: (r - a) / 2,
84
+ width: o,
85
+ height: a,
87
86
  zIndex: 10
88
87
  });
89
- return slideComponent.enableSelectedClipElement(), mainScene.addObject(slideComponent), slideComponent;
88
+ return c.enableSelectedClipElement(), e.addObject(c), c;
90
89
  }
91
- _addBackgroundRect(scene, fill) {
92
- const pageSize = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE).getPageSize(), { width: pageWidth = 0, height: pageHeight = 0 } = pageSize, page = new Rect("canvas", {
90
+ _addBackgroundRect(e, t) {
91
+ const r = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: o = 0 } = r, a = new Nt("canvas", {
93
92
  left: 0,
94
93
  top: 0,
95
- width: pageWidth,
96
- height: pageHeight,
94
+ width: s,
95
+ height: o,
97
96
  strokeWidth: 1,
98
97
  stroke: "rgba(198,198,198,1)",
99
- fill: getColorStyle(fill) || "rgba(255,255,255,1)",
98
+ fill: Cn(t) || "rgba(255,255,255,1)",
100
99
  zIndex: 0,
101
100
  evented: !1
102
101
  });
103
- scene.addObject(page, 0);
102
+ e.addObject(a, 0);
104
103
  }
105
- _getCenterPositionViewPort(mainScene) {
106
- if (!mainScene) return { left: 0, top: 0 };
107
- const { width, height } = mainScene, engine = mainScene.getEngine(), canvasWidth = (engine == null ? void 0 : engine.width) || 0, canvasHeight = (engine == null ? void 0 : engine.height) || 0;
104
+ _getCenterPositionViewPort(e) {
105
+ if (!e) return { left: 0, top: 0 };
106
+ const { width: t, height: n } = e, r = e.getEngine(), s = (r == null ? void 0 : r.width) || 0, o = (r == null ? void 0 : r.height) || 0;
108
107
  return {
109
- left: (width - canvasWidth) / 2,
110
- top: (height - canvasHeight) / 2
108
+ left: (t - s) / 2,
109
+ top: (n - o) / 2
111
110
  };
112
111
  }
113
- _thumbSceneRender(pageId, slide) {
114
- const render2 = this._renderManagerService.getRenderById(pageId);
115
- if (render2 == null)
112
+ _thumbSceneRender(e, t) {
113
+ const n = this._renderManagerService.getRenderById(e);
114
+ if (n == null)
116
115
  return;
117
- const { engine: thumbEngine } = render2;
118
- if (thumbEngine == null)
116
+ const { engine: r } = n;
117
+ if (r == null)
119
118
  return;
120
- const { width, height } = slide, { width: pageWidth = width, height: pageHeight = height } = thumbEngine, thumbContext = thumbEngine.getCanvas().getContext();
121
- slide.renderToThumb(thumbContext, pageId, pageWidth / width, pageHeight / height);
119
+ const { width: s, height: o } = t, { width: a = s, height: c = o } = r, g = r.getCanvas().getContext();
120
+ t.renderToThumb(g, e, a / s, c / o);
122
121
  }
123
122
  /**
124
123
  * CreateScene by pages, and activate first one.
125
124
  * @param slideDataModel
126
125
  * @param slide
127
126
  */
128
- _createSlidePages(slideDataModel, slide) {
129
- const pages = slideDataModel.getPages(), pageOrder = slideDataModel.getPageOrder();
130
- if (!(!pages || !pageOrder) && pageOrder.length !== 0) {
131
- for (let i = 0, len = pageOrder.length; i < len; i++) {
132
- const pageId = pageOrder[i];
133
- this.createPageScene(pageId, pages[pageId]), this._createThumb(pageId);
127
+ _createSlidePages(e, t) {
128
+ const n = e.getPages(), r = e.getPageOrder();
129
+ if (!(!n || !r) && r.length !== 0) {
130
+ for (let s = 0, o = r.length; s < o; s++) {
131
+ const a = r[s];
132
+ this.createPageScene(a, n[a]), this._createThumb(a);
134
133
  }
135
- slide.activeFirstPage();
134
+ t.activeFirstPage();
136
135
  }
137
136
  }
138
- _createThumb(pageId) {
139
- this._renderManagerService.createRender(pageId);
137
+ _createThumb(e) {
138
+ this._renderManagerService.createRender(e);
140
139
  }
141
140
  /**
142
141
  * SlideDataModel is UnitModel
@@ -144,34 +143,34 @@ let SlideRenderController = (_a = class extends RxDisposable {
144
143
  _getCurrUnitModel() {
145
144
  return this._renderContext.unit;
146
145
  }
147
- activePage(_pageId) {
148
- let pageId = _pageId;
149
- const model = this._getCurrUnitModel();
150
- let page;
151
- if (pageId)
152
- page = model.getPage(pageId);
146
+ activePage(e) {
147
+ let t = e;
148
+ const n = this._getCurrUnitModel();
149
+ let r;
150
+ if (t)
151
+ r = n.getPage(t);
153
152
  else {
154
- const pageElements = model.getPages(), pageOrder = model.getPageOrder();
155
- if (pageOrder == null || pageElements == null)
153
+ const c = n.getPages(), g = n.getPageOrder();
154
+ if (g == null || c == null)
156
155
  return;
157
- page = pageElements[pageOrder[0]], pageId = page.id;
156
+ r = c[g[0]], t = r.id;
158
157
  }
159
- const render2 = this._currentRender();
160
- if (page == null || render2 == null || render2.mainComponent == null)
158
+ const s = this._currentRender();
159
+ if (r == null || s == null || s.mainComponent == null)
161
160
  return;
162
- const { id } = page, slide = render2.mainComponent;
163
- if (model.setActivePage(page), slide != null && slide.hasPage(id)) {
164
- slide.changePage(id);
161
+ const { id: o } = r, a = s.mainComponent;
162
+ if (n.setActivePage(r), a != null && a.hasPage(o)) {
163
+ a.changePage(o);
165
164
  return;
166
165
  }
167
- this.createPageScene(id, page);
166
+ this.createPageScene(o, r);
168
167
  }
169
168
  createThumbs() {
170
- const pageOrder = this._getCurrUnitModel().getPageOrder(), render2 = this._currentRender();
171
- if (!(!pageOrder || !render2) && pageOrder.length !== 0)
172
- for (let i = 0, len = pageOrder.length; i < len; i++) {
173
- const pageId = pageOrder[i];
174
- this._thumbSceneRender(pageId, render2.mainComponent);
169
+ const t = this._getCurrUnitModel().getPageOrder(), n = this._currentRender();
170
+ if (!(!t || !n) && t.length !== 0)
171
+ for (let r = 0, s = t.length; r < s; r++) {
172
+ const o = t[r];
173
+ this._thumbSceneRender(o, n.mainComponent);
175
174
  }
176
175
  }
177
176
  /**
@@ -179,15 +178,15 @@ let SlideRenderController = (_a = class extends RxDisposable {
179
178
  * @param pageId
180
179
  * @param page
181
180
  */
182
- createPageScene(pageId, page) {
183
- const render2 = this._renderContext;
184
- if (!render2 || !this._objectProvider)
181
+ createPageScene(e, t) {
182
+ const n = this._renderContext;
183
+ if (!n || !this._objectProvider)
185
184
  return;
186
- const { scene: mainScene, mainComponent } = render2, slide = mainComponent, { width, height } = slide, pageScene = new Scene(pageId, slide, {
187
- width,
188
- height
185
+ const { scene: r, mainComponent: s } = n, o = s, { width: a, height: c } = o, g = new Mn(e, o, {
186
+ width: a,
187
+ height: c
189
188
  });
190
- new Viewport(`PageViewer_${pageId}`, pageScene, {
189
+ new ot(`PageViewer_${e}`, g, {
191
190
  left: 0,
192
191
  top: 0,
193
192
  bottom: 0,
@@ -195,117 +194,117 @@ let SlideRenderController = (_a = class extends RxDisposable {
195
194
  explicitViewportWidthSet: !1,
196
195
  explicitViewportHeightSet: !1
197
196
  }).closeClip();
198
- const { pageElements, pageBackgroundFill } = page, objects = this._objectProvider.convertToRenderObjects(pageElements, mainScene);
199
- if (!objects || !slide) return;
200
- this._addBackgroundRect(pageScene, pageBackgroundFill), pageScene.addObjects(objects), pageScene.initTransformer(), objects.forEach((object) => {
201
- pageScene.attachTransformerTo(object);
197
+ const { pageElements: u, pageBackgroundFill: h } = t, v = this._objectProvider.convertToRenderObjects(u, r);
198
+ if (!v || !o) return;
199
+ this._addBackgroundRect(g, h), g.addObjects(v), g.initTransformer(), v.forEach((C) => {
200
+ g.attachTransformerTo(C);
202
201
  });
203
- const transformer = pageScene.getTransformer();
204
- return transformer == null || transformer.changeEnd$.subscribe(() => {
205
- this._thumbSceneRender(pageId, slide);
206
- }), transformer == null || transformer.clearControl$.subscribe(() => {
207
- this._thumbSceneRender(pageId, slide);
208
- }), slide.addPageScene(pageScene), pageScene;
202
+ const _ = g.getTransformer();
203
+ return _ == null || _.changeEnd$.subscribe(() => {
204
+ this._thumbSceneRender(e, o);
205
+ }), _ == null || _.clearControl$.subscribe(() => {
206
+ this._thumbSceneRender(e, o);
207
+ }), o.addPageScene(g), g;
209
208
  }
210
209
  /**
211
210
  * Get pageScene from Slide.
212
211
  * @param pageId
213
212
  * @returns {Scene, Engine, UnitModel} scene & engine & unit from renderContext
214
213
  */
215
- getPageRenderUnit(pageId) {
216
- const pageScene = this._renderContext.mainComponent.getSubScenes().get(pageId), { engine, unit } = this._renderContext;
214
+ getPageRenderUnit(e) {
215
+ const n = this._renderContext.mainComponent.getSubScenes().get(e), { engine: r, unit: s } = this._renderContext;
217
216
  return {
218
- scene: pageScene,
219
- engine,
220
- unit
217
+ scene: n,
218
+ engine: r,
219
+ unit: s
221
220
  };
222
221
  }
223
- createObjectToPage(element2, pageID) {
224
- const { scene } = this.getPageRenderUnit(pageID);
225
- if (!scene || !this._objectProvider)
222
+ createObjectToPage(e, t) {
223
+ const { scene: n } = this.getPageRenderUnit(t);
224
+ if (!n || !this._objectProvider)
226
225
  return;
227
- const object = this._objectProvider.convertToRenderObject(element2, scene);
228
- if (object)
229
- return scene.addObject(object), scene.attachTransformerTo(object), scene.getLayer().makeDirty(), object;
230
- }
231
- setObjectActiveByPage(obj, pageID) {
232
- const { scene } = this.getPageRenderUnit(pageID);
233
- if (!scene) return;
234
- const transformer = scene.getTransformer();
235
- transformer == null || transformer.activeAnObject(obj);
236
- }
237
- removeObjectById(id, pageID) {
238
- const { scene } = this.getPageRenderUnit(pageID);
239
- if (!scene) return;
240
- scene.removeObject(id);
241
- const transformer = scene.getTransformer();
242
- transformer == null || transformer.clearControls();
226
+ const r = this._objectProvider.convertToRenderObject(e, n);
227
+ if (r)
228
+ return n.addObject(r), n.attachTransformerTo(r), n.getLayer().makeDirty(), r;
229
+ }
230
+ setObjectActiveByPage(e, t) {
231
+ const { scene: n } = this.getPageRenderUnit(t);
232
+ if (!n) return;
233
+ const r = n.getTransformer();
234
+ r == null || r.activeAnObject(e);
235
+ }
236
+ removeObjectById(e, t) {
237
+ const { scene: n } = this.getPageRenderUnit(t);
238
+ if (!n) return;
239
+ n.removeObject(e);
240
+ const r = n.getTransformer();
241
+ r == null || r.clearControls();
243
242
  }
244
243
  appendPage() {
245
- const model = this._getCurrUnitModel(), page = model.getBlankPage(), render2 = this._currentRender();
246
- if (page == null || render2 == null || render2.mainComponent == null)
244
+ const e = this._getCurrUnitModel(), t = e.getBlankPage(), n = this._currentRender();
245
+ if (t == null || n == null || n.mainComponent == null)
247
246
  return;
248
- const { id: pageId } = page, slide = render2.mainComponent, scene = this.createPageScene(pageId, page);
249
- slide && scene && slide.addPageScene(scene), model.appendPage(page), model.setActivePage(page);
247
+ const { id: r } = t, s = n.mainComponent, o = this.createPageScene(r, t);
248
+ s && o && s.addPageScene(o), e.appendPage(t), e.setActivePage(t);
250
249
  }
251
- }, __name(_a, "SlideRenderController"), _a);
252
- SlideRenderController = __decorateClass$9([
253
- __decorateParam$9(1, Inject(Injector)),
254
- __decorateParam$9(2, IUniverInstanceService),
255
- __decorateParam$9(3, IRenderManagerService)
256
- ], SlideRenderController);
257
- var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
258
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
259
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
260
- return kind && result && __defProp$8(target, key, result), result;
261
- }, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$8"), _a2;
262
- let CanvasView = (_a2 = class extends RxDisposable {
263
- constructor(_renderManagerService) {
264
- super(), this._renderManagerService = _renderManagerService;
250
+ };
251
+ pe = si([
252
+ Ve(1, X(Ge)),
253
+ Ve(2, j),
254
+ Ve(3, Y)
255
+ ], pe);
256
+ var oi = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, ci = (i, e, t, n) => {
257
+ for (var r = n > 1 ? void 0 : n ? ai(e, t) : e, s = i.length - 1, o; s >= 0; s--)
258
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
259
+ return n && r && oi(e, t, r), r;
260
+ }, li = (i, e) => (t, n) => e(t, n, i);
261
+ let M = class extends fe {
262
+ constructor(i) {
263
+ super(), this._renderManagerService = i;
265
264
  }
266
- _getSlideRenderControllerFromRenderUnit(unitId) {
267
- return this._renderManagerService.getRenderById(unitId).with(SlideRenderController);
265
+ _getSlideRenderControllerFromRenderUnit(i) {
266
+ return this._renderManagerService.getRenderById(i).with(pe);
268
267
  }
269
- createThumbs(unitId) {
270
- this._getSlideRenderControllerFromRenderUnit(unitId).createThumbs();
268
+ createThumbs(i) {
269
+ this._getSlideRenderControllerFromRenderUnit(i).createThumbs();
271
270
  }
272
- activePage(pageId, unitId) {
273
- this._getSlideRenderControllerFromRenderUnit(unitId).activePage(pageId);
271
+ activePage(i, e) {
272
+ this._getSlideRenderControllerFromRenderUnit(e).activePage(i);
274
273
  }
275
- getRenderUnitByPageId(pageId, unitId) {
276
- return this._getSlideRenderControllerFromRenderUnit(unitId).getPageRenderUnit(pageId);
274
+ getRenderUnitByPageId(i, e) {
275
+ return this._getSlideRenderControllerFromRenderUnit(e).getPageRenderUnit(i);
277
276
  }
278
- createObjectToPage(element2, pageID, unitId) {
279
- return this._getSlideRenderControllerFromRenderUnit(unitId).createObjectToPage(element2, pageID);
277
+ createObjectToPage(i, e, t) {
278
+ return this._getSlideRenderControllerFromRenderUnit(t).createObjectToPage(i, e);
280
279
  }
281
- setObjectActiveByPage(obj, pageID, unitId) {
282
- return this._getSlideRenderControllerFromRenderUnit(unitId).setObjectActiveByPage(obj, pageID);
280
+ setObjectActiveByPage(i, e, t) {
281
+ return this._getSlideRenderControllerFromRenderUnit(t).setObjectActiveByPage(i, e);
283
282
  }
284
- removeObjectById(id, pageID, unitId) {
285
- this._getSlideRenderControllerFromRenderUnit(unitId).removeObjectById(id, pageID);
283
+ removeObjectById(i, e, t) {
284
+ this._getSlideRenderControllerFromRenderUnit(t).removeObjectById(i, e);
286
285
  }
287
286
  /**
288
287
  * append blank page
289
288
  */
290
- appendPage(unitId) {
291
- this._getSlideRenderControllerFromRenderUnit(unitId).appendPage();
292
- }
293
- }, __name(_a2, "CanvasView"), _a2);
294
- CanvasView = __decorateClass$8([
295
- __decorateParam$8(0, IRenderManagerService)
296
- ], CanvasView);
297
- const SLIDES_UI_PLUGIN_CONFIG_KEY = "slides-ui.config", defaultPluginConfig = {}, DeleteSlideElementOperation = {
289
+ appendPage(i) {
290
+ this._getSlideRenderControllerFromRenderUnit(i).appendPage();
291
+ }
292
+ };
293
+ M = ci([
294
+ li(0, Y)
295
+ ], M);
296
+ const di = "slides-ui.config", ft = {}, Lt = {
298
297
  id: "slide.operation.delete-element",
299
- type: CommandType.OPERATION,
300
- handler: /* @__PURE__ */ __name((accessor, params) => {
301
- if (!(params != null && params.id)) return !1;
302
- const unitId = params.unitId, slideData = accessor.get(IUniverInstanceService).getUnit(unitId);
303
- if (!slideData) return !1;
304
- const activePage = slideData.getActivePage();
305
- return delete activePage.pageElements[params.id], slideData.updatePage(activePage.id, activePage), accessor.get(CanvasView).removeObjectById(params.id, activePage.id, unitId), !0;
306
- }, "handler")
298
+ type: D.OPERATION,
299
+ handler: (i, e) => {
300
+ if (!(e != null && e.id)) return !1;
301
+ const t = e.unitId, r = i.get(j).getUnit(t);
302
+ if (!r) return !1;
303
+ const s = r.getActivePage();
304
+ return delete s.pageElements[e.id], r.updatePage(s.id, s), i.get(M).removeObjectById(e.id, s.id, t), !0;
305
+ }
307
306
  };
308
- var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
307
+ var Be = { exports: {} }, me = {};
309
308
  /**
310
309
  * @license React
311
310
  * react-jsx-runtime.production.min.js
@@ -315,422 +314,409 @@ var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
315
314
  * This source code is licensed under the MIT license found in the
316
315
  * LICENSE file in the root directory of this source tree.
317
316
  */
318
- var hasRequiredReactJsxRuntime_production_min;
319
- function requireReactJsxRuntime_production_min() {
320
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
321
- hasRequiredReactJsxRuntime_production_min = 1;
322
- var f = React, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
323
- function q(c, a, g) {
324
- var b, d = {}, e = null, h = null;
325
- g !== void 0 && (e = "" + g), a.key !== void 0 && (e = "" + a.key), a.ref !== void 0 && (h = a.ref);
326
- for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
327
- if (c && c.defaultProps) for (b in a = c.defaultProps, a) d[b] === void 0 && (d[b] = a[b]);
328
- return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
329
- }
330
- return __name(q, "q"), reactJsxRuntime_production_min.Fragment = l, reactJsxRuntime_production_min.jsx = q, reactJsxRuntime_production_min.jsxs = q, reactJsxRuntime_production_min;
317
+ var Ct;
318
+ function ui() {
319
+ if (Ct) return me;
320
+ Ct = 1;
321
+ var i = ke, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
322
+ function o(a, c, g) {
323
+ var l, u = {}, h = null, v = null;
324
+ g !== void 0 && (h = "" + g), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (v = c.ref);
325
+ for (l in c) n.call(c, l) && !s.hasOwnProperty(l) && (u[l] = c[l]);
326
+ if (a && a.defaultProps) for (l in c = a.defaultProps, c) u[l] === void 0 && (u[l] = c[l]);
327
+ return { $$typeof: e, type: a, key: h, ref: v, props: u, _owner: r.current };
328
+ }
329
+ return me.Fragment = t, me.jsx = o, me.jsxs = o, me;
331
330
  }
332
- __name(requireReactJsxRuntime_production_min, "requireReactJsxRuntime_production_min");
333
- var hasRequiredJsxRuntime;
334
- function requireJsxRuntime() {
335
- return hasRequiredJsxRuntime || (hasRequiredJsxRuntime = 1, jsxRuntime.exports = requireReactJsxRuntime_production_min()), jsxRuntime.exports;
331
+ var vt;
332
+ function mi() {
333
+ return vt || (vt = 1, Be.exports = ui()), Be.exports;
336
334
  }
337
- __name(requireJsxRuntime, "requireJsxRuntime");
338
- var jsxRuntimeExports = requireJsxRuntime();
339
- function r(e) {
340
- var t, f, n = "";
341
- if (typeof e == "string" || typeof e == "number") n += e;
342
- else if (typeof e == "object") if (Array.isArray(e)) {
343
- var o = e.length;
344
- for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
345
- } else for (f in e) e[f] && (n && (n += " "), n += f);
335
+ var d = mi();
336
+ function At(i) {
337
+ var e, t, n = "";
338
+ if (typeof i == "string" || typeof i == "number") n += i;
339
+ else if (typeof i == "object") if (Array.isArray(i)) {
340
+ var r = i.length;
341
+ for (e = 0; e < r; e++) i[e] && (t = At(i[e])) && (n && (n += " "), n += t);
342
+ } else for (t in i) i[t] && (n && (n += " "), n += t);
346
343
  return n;
347
344
  }
348
- __name(r, "r");
349
- function clsx() {
350
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
345
+ function T() {
346
+ for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e = At(i)) && (n && (n += " "), n += e);
351
347
  return n;
352
348
  }
353
- __name(clsx, "clsx");
354
- var __assign = function() {
355
- return __assign = Object.assign || function(t) {
356
- for (var s, i = 1, n = arguments.length; i < n; i++) {
357
- s = arguments[i];
358
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
349
+ var N = function() {
350
+ return N = Object.assign || function(i) {
351
+ for (var e, t = 1, n = arguments.length; t < n; t++) {
352
+ e = arguments[t];
353
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
359
354
  }
360
- return t;
361
- }, __assign.apply(this, arguments);
362
- }, __rest = function(s, e) {
355
+ return i;
356
+ }, N.apply(this, arguments);
357
+ }, gi = function(i, e) {
363
358
  var t = {};
364
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
365
- if (s != null && typeof Object.getOwnPropertySymbols == "function")
366
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
367
- e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
359
+ for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
360
+ if (i != null && typeof Object.getOwnPropertySymbols == "function")
361
+ for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
362
+ e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (t[n[r]] = i[n[r]]);
368
363
  return t;
369
- }, IconBase = forwardRef(function(props, ref) {
370
- var icon = props.icon, id = props.id, className = props.className, extend = props.extend, restProps = __rest(props, ["icon", "id", "className", "extend"]), cls = "univerjs-icon univerjs-icon-".concat(id, " ").concat(className || "").trim(), idSuffix = useRef("_".concat(generateShortUuid()));
371
- return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
364
+ }, H = A(function(i, e) {
365
+ var t = i.icon, n = i.id, r = i.className, s = i.extend, o = gi(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), c = Ut("_".concat(fi()));
366
+ return $t(t, "".concat(n), { defIds: t.defIds, idSuffix: c.current }, N({ ref: e, className: a }, o), s);
372
367
  });
373
- function render(node, id, runtimeProps, rootProps, extend) {
374
- return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
375
- return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
368
+ function $t(i, e, t, n, r) {
369
+ return $(i.tag, N(N({ key: e }, hi(i, t, r)), n), (pi(i, t).children || []).map(function(s, o) {
370
+ return $t(s, "".concat(e, "-").concat(i.tag, "-").concat(o), t, void 0, r);
376
371
  }));
377
372
  }
378
- __name(render, "render");
379
- function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
380
- var attrs = __assign({}, node.attrs);
381
- extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
382
- var defIds = runtimeProps.defIds;
383
- return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a11) {
384
- var key = _a11[0], value = _a11[1];
385
- typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
386
- })), attrs;
373
+ function hi(i, e, t) {
374
+ var n = N({}, i.attrs);
375
+ t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
376
+ var r = e.defIds;
377
+ return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(s) {
378
+ var o = s[0], a = s[1];
379
+ typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
380
+ })), n;
387
381
  }
388
- __name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
389
- function replaceRuntimeIdsInDefs(node, runtimeProps) {
390
- var _a11, defIds = runtimeProps.defIds;
391
- return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a11 = node.children) === null || _a11 === void 0) && _a11.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
392
- return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
393
- }) }) : node;
382
+ function pi(i, e) {
383
+ var t, n = e.defIds;
384
+ return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? N(N({}, i), { children: i.children.map(function(r) {
385
+ return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? N(N({}, r), { attrs: N(N({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
386
+ }) }) : i;
394
387
  }
395
- __name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
396
- function generateShortUuid() {
388
+ function fi() {
397
389
  return Math.random().toString(36).substring(2, 8);
398
390
  }
399
- __name(generateShortUuid, "generateShortUuid");
400
- IconBase.displayName = "UniverIcon";
401
- var element$9 = { 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" } }] }, AddImageSingle = forwardRef(function(props, ref) {
402
- return createElement(IconBase, Object.assign({}, props, {
391
+ H.displayName = "UniverIcon";
392
+ var Ci = { 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" } }] }, Ht = A(function(i, e) {
393
+ return $(H, Object.assign({}, i, {
403
394
  id: "add-image-single",
404
- ref,
405
- icon: element$9
395
+ ref: e,
396
+ icon: Ci
406
397
  }));
407
398
  });
408
- AddImageSingle.displayName = "AddImageSingle";
409
- var element$8 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Autofill = forwardRef(function(props, ref) {
410
- return createElement(IconBase, Object.assign({}, props, {
399
+ Ht.displayName = "AddImageSingle";
400
+ var vi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ft = A(function(i, e) {
401
+ return $(H, Object.assign({}, i, {
411
402
  id: "autofill",
412
- ref,
413
- icon: element$8
403
+ ref: e,
404
+ icon: vi
414
405
  }));
415
406
  });
416
- Autofill.displayName = "Autofill";
417
- var element$7 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, BottomSingle = forwardRef(function(props, ref) {
418
- return createElement(IconBase, Object.assign({}, props, {
407
+ Ft.displayName = "Autofill";
408
+ var _i = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, zt = A(function(i, e) {
409
+ return $(H, Object.assign({}, i, {
419
410
  id: "bottom-single",
420
- ref,
421
- icon: element$7
411
+ ref: e,
412
+ icon: _i
422
413
  }));
423
414
  });
424
- BottomSingle.displayName = "BottomSingle";
425
- var element$6 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { clipPath: "url(#graph-single_clip0_1293_28)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M6.29541 11.1896C3.83208 10.7489 1.9624 8.59552 1.9624 6.00544C1.9624 3.09673 4.32036 0.73877 7.22907 0.73877C9.93483 0.73877 12.164 2.77918 12.4619 5.40527H13.5621C14.998 5.40527 16.1621 6.56933 16.1621 8.00527V12.6719C16.1621 14.1079 14.998 15.2719 13.5621 15.2719H8.89541C7.45947 15.2719 6.29541 14.1079 6.29541 12.6719V11.1896ZM3.1624 6.00544C3.1624 3.75947 4.98311 1.93877 7.22907 1.93877C9.27112 1.93877 10.9616 3.44388 11.2518 5.40527H8.89541C7.45947 5.40527 6.29541 6.56933 6.29541 8.00527V9.96442C4.49946 9.5425 3.1624 7.93012 3.1624 6.00544ZM7.49541 8.00527C7.49541 7.23207 8.12221 6.60527 8.89541 6.60527H13.5621C14.3353 6.60527 14.9621 7.23207 14.9621 8.00527V12.6719C14.9621 13.4451 14.3353 14.0719 13.5621 14.0719H8.89541C8.12221 14.0719 7.49541 13.4451 7.49541 12.6719V8.00527Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "graph-single_clip0_1293_28" }, children: [{ tag: "path", attrs: { fill: "#fff", d: "M0 0H16V16H0z", transform: "translate(.9)" } }] }] }], defIds: ["graph-single_clip0_1293_28"] }, GraphSingle = forwardRef(function(props, ref) {
426
- return createElement(IconBase, Object.assign({}, props, {
415
+ zt.displayName = "BottomSingle";
416
+ var Si = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { clipPath: "url(#graph-single_clip0_1293_28)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M6.29541 11.1896C3.83208 10.7489 1.9624 8.59552 1.9624 6.00544C1.9624 3.09673 4.32036 0.73877 7.22907 0.73877C9.93483 0.73877 12.164 2.77918 12.4619 5.40527H13.5621C14.998 5.40527 16.1621 6.56933 16.1621 8.00527V12.6719C16.1621 14.1079 14.998 15.2719 13.5621 15.2719H8.89541C7.45947 15.2719 6.29541 14.1079 6.29541 12.6719V11.1896ZM3.1624 6.00544C3.1624 3.75947 4.98311 1.93877 7.22907 1.93877C9.27112 1.93877 10.9616 3.44388 11.2518 5.40527H8.89541C7.45947 5.40527 6.29541 6.56933 6.29541 8.00527V9.96442C4.49946 9.5425 3.1624 7.93012 3.1624 6.00544ZM7.49541 8.00527C7.49541 7.23207 8.12221 6.60527 8.89541 6.60527H13.5621C14.3353 6.60527 14.9621 7.23207 14.9621 8.00527V12.6719C14.9621 13.4451 14.3353 14.0719 13.5621 14.0719H8.89541C8.12221 14.0719 7.49541 13.4451 7.49541 12.6719V8.00527Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "graph-single_clip0_1293_28" }, children: [{ tag: "path", attrs: { fill: "#fff", d: "M0 0H16V16H0z", transform: "translate(.9)" } }] }] }], defIds: ["graph-single_clip0_1293_28"] }, Wt = A(function(i, e) {
417
+ return $(H, Object.assign({}, i, {
427
418
  id: "graph-single",
428
- ref,
429
- icon: element$6
419
+ ref: e,
420
+ icon: Si
430
421
  }));
431
422
  });
432
- GraphSingle.displayName = "GraphSingle";
433
- var element$5 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, MoreDownSingle = forwardRef(function(props, ref) {
434
- return createElement(IconBase, Object.assign({}, props, {
423
+ Wt.displayName = "GraphSingle";
424
+ var Ii = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, qe = A(function(i, e) {
425
+ return $(H, Object.assign({}, i, {
435
426
  id: "more-down-single",
436
- ref,
437
- icon: element$5
427
+ ref: e,
428
+ icon: Ii
438
429
  }));
439
430
  });
440
- MoreDownSingle.displayName = "MoreDownSingle";
441
- var element$4 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, MoveDownSingle = forwardRef(function(props, ref) {
442
- return createElement(IconBase, Object.assign({}, props, {
431
+ qe.displayName = "MoreDownSingle";
432
+ var Pi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, Kt = A(function(i, e) {
433
+ return $(H, Object.assign({}, i, {
443
434
  id: "move-down-single",
444
- ref,
445
- icon: element$4
435
+ ref: e,
436
+ icon: Pi
446
437
  }));
447
438
  });
448
- MoveDownSingle.displayName = "MoveDownSingle";
449
- var element$3 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, MoveUpSingle = forwardRef(function(props, ref) {
450
- return createElement(IconBase, Object.assign({}, props, {
439
+ Kt.displayName = "MoveDownSingle";
440
+ var bi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", 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" } }] }, Gt = A(function(i, e) {
441
+ return $(H, Object.assign({}, i, {
451
442
  id: "move-up-single",
452
- ref,
453
- icon: element$3
443
+ ref: e,
444
+ icon: bi
454
445
  }));
455
446
  });
456
- MoveUpSingle.displayName = "MoveUpSingle";
457
- var element$2 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_1204", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_102_1204)" }, children: [{ tag: "rect", attrs: { width: 12.62, height: 2.79, x: 1.69, y: 12.25, fill: "colorChannel1", rx: 1.4 } }, { tag: "path", attrs: { fill: "currentColor", d: "M7.74646 2.1642C7.34284 1.65121 6.85947 1.28205 6.38447 1.09593C5.86863 0.893787 5.15166 0.852126 4.70047 1.42917C4.29842 1.94344 4.33082 2.70249 4.57691 3.50395C4.68808 3.8661 4.86846 4.22254 5.12522 4.56617C5.13695 4.58185 5.14927 4.5968 5.16211 4.61102C5.17152 4.6214 5.18122 4.63139 5.19115 4.64096C5.20459 4.65393 5.21855 4.66618 5.23296 4.6777L3.5064 6.40422C3.26756 6.64306 3.26756 7.03033 3.5064 7.26919L7.23756 11.0004C7.47648 11.2392 7.86375 11.2392 8.1026 11.0004L12.8329 6.27001C13.0717 6.03117 13.0717 5.6439 12.8329 5.40505L9.10172 1.67387C8.86288 1.43503 8.47561 1.43503 8.23676 1.67387L7.74646 2.1642ZM7.46162 4.50638C7.47252 4.57574 7.48163 4.64652 7.4888 4.71868C7.52232 5.05481 7.82194 5.30013 8.15807 5.26661C8.4942 5.23311 8.73954 4.93345 8.70601 4.59732C8.65786 4.11463 8.54251 3.6666 8.37892 3.26169L8.66928 2.97135L11.5354 5.83753L10.6106 6.76237H4.87824L7.40802 4.2326C7.42885 4.32128 7.44684 4.41255 7.46162 4.50638ZM6.87284 3.03784C6.57441 2.62008 6.22261 2.34634 5.93815 2.23487C5.80233 2.18165 5.71528 2.17827 5.67638 2.18335C5.6725 2.18387 5.66929 2.18443 5.6666 2.18497L5.6619 2.18607C5.64166 2.21954 5.53594 2.45979 5.74626 3.1449C5.81241 3.36036 5.92262 3.58602 6.09307 3.81761L6.87284 3.03784Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.1932 11.5463C12.6454 11.5463 13.012 11.1797 13.012 10.7275C13.012 10.4475 12.6981 9.92821 12.459 9.5733C12.3299 9.38173 12.0564 9.38174 11.9274 9.57331C11.6883 9.92822 11.3744 10.4475 11.3744 10.7275C11.3744 11.1797 11.741 11.5463 12.1932 11.5463Z" } }] }] }, PaintBucket = forwardRef(function(props, ref) {
458
- return createElement(IconBase, Object.assign({}, props, {
447
+ Gt.displayName = "MoveUpSingle";
448
+ var xi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_1204", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_102_1204)" }, children: [{ tag: "rect", attrs: { width: 12.62, height: 2.79, x: 1.69, y: 12.25, fill: "colorChannel1", rx: 1.4 } }, { tag: "path", attrs: { fill: "currentColor", d: "M7.74646 2.1642C7.34284 1.65121 6.85947 1.28205 6.38447 1.09593C5.86863 0.893787 5.15166 0.852126 4.70047 1.42917C4.29842 1.94344 4.33082 2.70249 4.57691 3.50395C4.68808 3.8661 4.86846 4.22254 5.12522 4.56617C5.13695 4.58185 5.14927 4.5968 5.16211 4.61102C5.17152 4.6214 5.18122 4.63139 5.19115 4.64096C5.20459 4.65393 5.21855 4.66618 5.23296 4.6777L3.5064 6.40422C3.26756 6.64306 3.26756 7.03033 3.5064 7.26919L7.23756 11.0004C7.47648 11.2392 7.86375 11.2392 8.1026 11.0004L12.8329 6.27001C13.0717 6.03117 13.0717 5.6439 12.8329 5.40505L9.10172 1.67387C8.86288 1.43503 8.47561 1.43503 8.23676 1.67387L7.74646 2.1642ZM7.46162 4.50638C7.47252 4.57574 7.48163 4.64652 7.4888 4.71868C7.52232 5.05481 7.82194 5.30013 8.15807 5.26661C8.4942 5.23311 8.73954 4.93345 8.70601 4.59732C8.65786 4.11463 8.54251 3.6666 8.37892 3.26169L8.66928 2.97135L11.5354 5.83753L10.6106 6.76237H4.87824L7.40802 4.2326C7.42885 4.32128 7.44684 4.41255 7.46162 4.50638ZM6.87284 3.03784C6.57441 2.62008 6.22261 2.34634 5.93815 2.23487C5.80233 2.18165 5.71528 2.17827 5.67638 2.18335C5.6725 2.18387 5.66929 2.18443 5.6666 2.18497L5.6619 2.18607C5.64166 2.21954 5.53594 2.45979 5.74626 3.1449C5.81241 3.36036 5.92262 3.58602 6.09307 3.81761L6.87284 3.03784Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.1932 11.5463C12.6454 11.5463 13.012 11.1797 13.012 10.7275C13.012 10.4475 12.6981 9.92821 12.459 9.5733C12.3299 9.38173 12.0564 9.38174 11.9274 9.57331C11.6883 9.92822 11.3744 10.4475 11.3744 10.7275C11.3744 11.1797 11.741 11.5463 12.1932 11.5463Z" } }] }] }, Xt = A(function(i, e) {
449
+ return $(H, Object.assign({}, i, {
459
450
  id: "paint-bucket",
460
- ref,
461
- icon: element$2
451
+ ref: e,
452
+ icon: xi
462
453
  }));
463
454
  });
464
- PaintBucket.displayName = "PaintBucket";
465
- var element$1 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { fill: "currentColor", clipPath: "url(#text-single_clip0_1293_26)" }, children: [{ tag: "path", attrs: { d: "M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z" } }, { tag: "path", attrs: { d: "M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "text-single_clip0_1293_26" }, children: [{ tag: "path", attrs: { fill: "#fff", d: "M0 0H16V16H0z", transform: "translate(.9)" } }] }] }], defIds: ["text-single_clip0_1293_26"] }, TextSingle = forwardRef(function(props, ref) {
466
- return createElement(IconBase, Object.assign({}, props, {
455
+ Xt.displayName = "PaintBucket";
456
+ var Ei = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { fill: "currentColor", clipPath: "url(#text-single_clip0_1293_26)" }, children: [{ tag: "path", attrs: { d: "M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z" } }, { tag: "path", attrs: { d: "M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "text-single_clip0_1293_26" }, children: [{ tag: "path", attrs: { fill: "#fff", d: "M0 0H16V16H0z", transform: "translate(.9)" } }] }] }], defIds: ["text-single_clip0_1293_26"] }, Yt = A(function(i, e) {
457
+ return $(H, Object.assign({}, i, {
467
458
  id: "text-single",
468
- ref,
469
- icon: element$1
459
+ ref: e,
460
+ icon: Ei
470
461
  }));
471
462
  });
472
- TextSingle.displayName = "TextSingle";
473
- var element = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, TopmostSingle = forwardRef(function(props, ref) {
474
- return createElement(IconBase, Object.assign({}, props, {
463
+ Yt.displayName = "TextSingle";
464
+ var Ri = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, kt = A(function(i, e) {
465
+ return $(H, Object.assign({}, i, {
475
466
  id: "topmost-single",
476
- ref,
477
- icon: element
467
+ ref: e,
468
+ icon: Ri
478
469
  }));
479
470
  });
480
- TopmostSingle.displayName = "TopmostSingle";
481
- const UpdateSlideElementOperation = {
471
+ kt.displayName = "TopmostSingle";
472
+ const K = {
482
473
  id: "slide.operation.update-element",
483
- type: CommandType.OPERATION,
484
- handler: /* @__PURE__ */ __name((accessor, params) => {
485
- const { oKey, props } = params, univerInstanceService = accessor.get(IUniverInstanceService), unitId = params == null ? void 0 : params.unitId, slideData = univerInstanceService.getUnit(unitId);
486
- if (!slideData) return !1;
487
- const activePage = slideData.getActivePage();
488
- return activePage.pageElements[oKey] = Tools.deepMerge(activePage.pageElements[oKey], props), slideData.updatePage(activePage.id, activePage), !0;
489
- }, "handler")
490
- }, imageCommonPanel$1 = "univer-image-common-panel", imageCommonPanelGrid$1 = "univer-image-common-panel-grid", imageCommonPanelBorder$1 = "univer-image-common-panel-border", imageCommonPanelTitle$1 = "univer-image-common-panel-title", imageCommonPanelSubtitle$1 = "univer-image-common-panel-subtitle", imageCommonPanelRow$1 = "univer-image-common-panel-row", imageCommonPanelRowVertical$1 = "univer-image-common-panel-row-vertical", imageCommonPanelColumn$1 = "univer-image-common-panel-column", imageCommonPanelColumnCenter$1 = "univer-image-common-panel-column-center", imageCommonPanelInline$1 = "univer-image-common-panel-inline", imageCommonPanelSpan2$1 = "univer-image-common-panel-span2", imageCommonPanelSpan3$1 = "univer-image-common-panel-span3", imageCommonPanelInput$1 = "univer-image-common-panel-input", slidePanelColorPicker = "univer-slide-panel-color-picker", styles$4 = {
491
- imageCommonPanel: imageCommonPanel$1,
492
- imageCommonPanelGrid: imageCommonPanelGrid$1,
493
- imageCommonPanelBorder: imageCommonPanelBorder$1,
494
- imageCommonPanelTitle: imageCommonPanelTitle$1,
495
- imageCommonPanelSubtitle: imageCommonPanelSubtitle$1,
496
- imageCommonPanelRow: imageCommonPanelRow$1,
497
- imageCommonPanelRowVertical: imageCommonPanelRowVertical$1,
498
- imageCommonPanelColumn: imageCommonPanelColumn$1,
499
- imageCommonPanelColumnCenter: imageCommonPanelColumnCenter$1,
500
- imageCommonPanelInline: imageCommonPanelInline$1,
501
- imageCommonPanelSpan2: imageCommonPanelSpan2$1,
502
- imageCommonPanelSpan3: imageCommonPanelSpan3$1,
503
- imageCommonPanelInput: imageCommonPanelInput$1,
504
- slidePanelColorPicker
474
+ type: D.OPERATION,
475
+ handler: (i, e) => {
476
+ const { oKey: t, props: n } = e, r = i.get(j), s = e == null ? void 0 : e.unitId, o = r.getUnit(s);
477
+ if (!o) return !1;
478
+ const a = o.getActivePage();
479
+ return a.pageElements[t] = vn.deepMerge(a.pageElements[t], n), o.updatePage(a.id, a), !0;
480
+ }
481
+ }, Oi = "univer-image-common-panel", ji = "univer-image-common-panel-grid", yi = "univer-image-common-panel-border", Ti = "univer-image-common-panel-title", Mi = "univer-image-common-panel-subtitle", wi = "univer-image-common-panel-row", Ni = "univer-image-common-panel-row-vertical", Di = "univer-image-common-panel-column", Ui = "univer-image-common-panel-column-center", Vi = "univer-image-common-panel-inline", Bi = "univer-image-common-panel-span2", Li = "univer-image-common-panel-span3", Ai = "univer-image-common-panel-input", $i = "univer-slide-panel-color-picker", m = {
482
+ imageCommonPanel: Oi,
483
+ imageCommonPanelGrid: ji,
484
+ imageCommonPanelBorder: yi,
485
+ imageCommonPanelTitle: Ti,
486
+ imageCommonPanelSubtitle: Mi,
487
+ imageCommonPanelRow: wi,
488
+ imageCommonPanelRowVertical: Ni,
489
+ imageCommonPanelColumn: Di,
490
+ imageCommonPanelColumnCenter: Ui,
491
+ imageCommonPanelInline: Vi,
492
+ imageCommonPanelSpan2: Bi,
493
+ imageCommonPanelSpan3: Li,
494
+ imageCommonPanelInput: Ai,
495
+ slidePanelColorPicker: $i
505
496
  };
506
- function ArrangePanel$1(props) {
507
- const { pageId, unitId } = props, localeService = useDependency(LocaleService), canvasView = useDependency(CanvasView), commandService = useDependency(ICommandService), page = canvasView.getRenderUnitByPageId(pageId, unitId), scene = page == null ? void 0 : page.scene;
508
- if (!scene) return null;
509
- const transformer = scene.getTransformer();
510
- if (!transformer) return null;
511
- const object = transformer.getSelectedObjectMap().values().next().value;
512
- if (!object) return null;
513
- const onArrangeBtnClick = /* @__PURE__ */ __name((arrangeType) => {
514
- const allObjects = scene.getAllObjects(), [minZIndex, maxZIndex] = allObjects.reduce(([min, max], obj) => {
515
- const zIndex2 = obj.zIndex, minZIndex2 = zIndex2 < min ? zIndex2 : min, maxZIndex2 = zIndex2 > max ? zIndex2 : max;
516
- return [minZIndex2, maxZIndex2];
497
+ function Hi(i) {
498
+ const { pageId: e, unitId: t } = i, n = O(Q), r = O(M), s = O(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
499
+ if (!a) return null;
500
+ const c = a.getTransformer();
501
+ if (!c) return null;
502
+ const l = c.getSelectedObjectMap().values().next().value;
503
+ if (!l) return null;
504
+ const u = (h) => {
505
+ const v = a.getAllObjects(), [_, C] = v.reduce(([f, I], b) => {
506
+ const E = b.zIndex, w = E < f ? E : f, V = E > I ? E : I;
507
+ return [w, V];
517
508
  }, [0, 0]);
518
- let zIndex = object.zIndex;
519
- arrangeType === 3 ? zIndex = minZIndex - 1 : arrangeType === 2 ? zIndex = maxZIndex + 1 : arrangeType === 0 ? zIndex = object.zIndex + 1 : arrangeType === 1 && (zIndex = object.zIndex - 1), object.setProps({
520
- zIndex
521
- }), commandService.executeCommand(UpdateSlideElementOperation.id, {
522
- unitId,
523
- oKey: object == null ? void 0 : object.oKey,
509
+ let p = l.zIndex;
510
+ h === 3 ? p = _ - 1 : h === 2 ? p = C + 1 : h === 0 ? p = l.zIndex + 1 : h === 1 && (p = l.zIndex - 1), l.setProps({
511
+ zIndex: p
512
+ }), s.executeCommand(K.id, {
513
+ unitId: t,
514
+ oKey: l == null ? void 0 : l.oKey,
524
515
  props: {
525
- zIndex
516
+ zIndex: p
526
517
  }
527
518
  });
528
- }, "onArrangeBtnClick");
529
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelGrid, children: [
530
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("image-panel.arrange.title") }) }) }),
531
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
532
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
533
- onArrangeBtnClick(
519
+ };
520
+ return /* @__PURE__ */ d.jsxs("div", { className: m.imageCommonPanelGrid, children: [
521
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle), children: /* @__PURE__ */ d.jsx("div", { children: n.t("image-panel.arrange.title") }) }) }),
522
+ /* @__PURE__ */ d.jsxs("div", { className: m.imageCommonPanelRow, children: [
523
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ d.jsx(Pe, { size: "small", onClick: () => {
524
+ u(
534
525
  0
535
526
  /* forward */
536
527
  );
537
- }, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
538
- /* @__PURE__ */ jsxRuntimeExports.jsx(MoveUpSingle, {}),
539
- localeService.t("image-panel.arrange.forward")
528
+ }, children: /* @__PURE__ */ d.jsxs("span", { className: m.imageCommonPanelInline, children: [
529
+ /* @__PURE__ */ d.jsx(Gt, {}),
530
+ n.t("image-panel.arrange.forward")
540
531
  ] }) }) }),
541
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
542
- onArrangeBtnClick(
532
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ d.jsx(Pe, { size: "small", onClick: () => {
533
+ u(
543
534
  1
544
535
  /* backward */
545
536
  );
546
- }, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
547
- /* @__PURE__ */ jsxRuntimeExports.jsx(MoveDownSingle, {}),
548
- localeService.t("image-panel.arrange.backward")
537
+ }, children: /* @__PURE__ */ d.jsxs("span", { className: m.imageCommonPanelInline, children: [
538
+ /* @__PURE__ */ d.jsx(Kt, {}),
539
+ n.t("image-panel.arrange.backward")
549
540
  ] }) }) })
550
541
  ] }),
551
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
552
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
553
- onArrangeBtnClick(
542
+ /* @__PURE__ */ d.jsxs("div", { className: m.imageCommonPanelRow, children: [
543
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ d.jsx(Pe, { size: "small", onClick: () => {
544
+ u(
554
545
  2
555
546
  /* front */
556
547
  );
557
- }, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
558
- /* @__PURE__ */ jsxRuntimeExports.jsx(TopmostSingle, {}),
559
- localeService.t("image-panel.arrange.front")
548
+ }, children: /* @__PURE__ */ d.jsxs("span", { className: m.imageCommonPanelInline, children: [
549
+ /* @__PURE__ */ d.jsx(kt, {}),
550
+ n.t("image-panel.arrange.front")
560
551
  ] }) }) }),
561
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", onClick: /* @__PURE__ */ __name(() => {
562
- onArrangeBtnClick(
552
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ d.jsx(Pe, { size: "small", onClick: () => {
553
+ u(
563
554
  3
564
555
  /* back */
565
556
  );
566
- }, "onClick"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$4.imageCommonPanelInline, children: [
567
- /* @__PURE__ */ jsxRuntimeExports.jsx(BottomSingle, {}),
568
- localeService.t("image-panel.arrange.back")
557
+ }, children: /* @__PURE__ */ d.jsxs("span", { className: m.imageCommonPanelInline, children: [
558
+ /* @__PURE__ */ d.jsx(zt, {}),
559
+ n.t("image-panel.arrange.back")
569
560
  ] }) }) })
570
561
  ] })
571
562
  ] });
572
563
  }
573
- __name(ArrangePanel$1, "ArrangePanel$1");
574
- function TransformPanel(props) {
575
- const { pageId, unitId } = props, localeService = useDependency(LocaleService), canvasView = useDependency(CanvasView), commandService = useDependency(ICommandService), page = canvasView.getRenderUnitByPageId(pageId, unitId), scene = page == null ? void 0 : page.scene;
576
- if (!scene) return null;
577
- const transformer = scene.getTransformer();
578
- if (!transformer) return null;
579
- const object = transformer.getSelectedObjectMap().values().next().value;
580
- if (!object) return null;
564
+ function Fi(i) {
565
+ const { pageId: e, unitId: t } = i, n = O(Q), r = O(M), s = O(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
566
+ if (!a) return null;
567
+ const c = a.getTransformer();
568
+ if (!c) return null;
569
+ const l = c.getSelectedObjectMap().values().next().value;
570
+ if (!l) return null;
581
571
  const {
582
- width: originWidth = 0,
583
- height: originHeight = 0,
584
- left: originX = 0,
585
- top: originY = 0,
586
- angle: originRotation = 0
587
- } = object, [width, setWidth] = useState(originWidth), [height, setHeight] = useState(originHeight), [xPosition, setXPosition] = useState(originX), [yPosition, setYPosition] = useState(originY), [rotation, setRotation] = useState(originRotation), changeObs = /* @__PURE__ */ __name((state) => {
588
- const { objects } = state, object2 = objects.values().next().value, {
589
- width: originWidth2 = 0,
590
- height: originHeight2 = 0,
591
- left: originX2 = 0,
592
- top: originY2 = 0,
593
- angle: originRotation2 = 0
594
- } = object2;
595
- setWidth(originWidth2), setHeight(originHeight2), setXPosition(originX2), setYPosition(originY2), setRotation(originRotation2);
596
- }, "changeObs");
597
- useEffect(() => {
598
- const changeStartSub = transformer.changeStart$.subscribe((state) => {
599
- changeObs(state);
600
- }), changingSub = transformer.changing$.subscribe((state) => {
601
- changeObs(state);
572
+ width: u = 0,
573
+ height: h = 0,
574
+ left: v = 0,
575
+ top: _ = 0,
576
+ angle: C = 0
577
+ } = l, [p, f] = W(u), [I, b] = W(h), [E, w] = W(v), [V, R] = W(_), [G, ce] = W(C), F = (S) => {
578
+ const { objects: le } = S, de = le.values().next().value, {
579
+ width: ln = 0,
580
+ height: dn = 0,
581
+ left: un = 0,
582
+ top: mn = 0,
583
+ angle: gn = 0
584
+ } = de;
585
+ f(ln), b(dn), w(un), R(mn), ce(gn);
586
+ };
587
+ oe(() => {
588
+ const S = c.changeStart$.subscribe((de) => {
589
+ F(de);
590
+ }), le = c.changing$.subscribe((de) => {
591
+ F(de);
602
592
  });
603
593
  return () => {
604
- changingSub.unsubscribe(), changeStartSub.unsubscribe();
594
+ le.unsubscribe(), S.unsubscribe();
605
595
  };
606
596
  }, []);
607
- function handleWidthChange(val) {
608
- !val || !object || (commandService.executeCommand(UpdateSlideElementOperation.id, {
609
- pageId,
610
- oKey: object.oKey,
597
+ function z(S) {
598
+ !S || !l || (s.executeCommand(K.id, {
599
+ pageId: e,
600
+ oKey: l.oKey,
611
601
  props: {
612
- width: val
602
+ width: S
613
603
  }
614
- }), object == null || object.resize(val, object.height), setWidth(val), transformer == null || transformer.refreshControls());
604
+ }), l == null || l.resize(S, l.height), f(S), c == null || c.refreshControls());
615
605
  }
616
- __name(handleWidthChange, "handleWidthChange");
617
- function handleHeightChange(val) {
618
- !val || !object || (commandService.executeCommand(UpdateSlideElementOperation.id, {
619
- pageId,
620
- oKey: object.oKey,
606
+ function ee(S) {
607
+ !S || !l || (s.executeCommand(K.id, {
608
+ pageId: e,
609
+ oKey: l.oKey,
621
610
  props: {
622
- height: val
611
+ height: S
623
612
  }
624
- }), object == null || object.resize(object.width, val), setHeight(val), transformer == null || transformer.refreshControls());
613
+ }), l == null || l.resize(l.width, S), b(S), c == null || c.refreshControls());
625
614
  }
626
- __name(handleHeightChange, "handleHeightChange");
627
- function handleXChange(val) {
628
- !val || !object || (commandService.executeCommand(UpdateSlideElementOperation.id, {
629
- pageId,
630
- oKey: object.oKey,
615
+ function te(S) {
616
+ !S || !l || (s.executeCommand(K.id, {
617
+ pageId: e,
618
+ oKey: l.oKey,
631
619
  props: {
632
- left: val
620
+ left: S
633
621
  }
634
- }), object == null || object.translate(val, object.top), setXPosition(val), transformer == null || transformer.refreshControls());
622
+ }), l == null || l.translate(S, l.top), w(S), c == null || c.refreshControls());
635
623
  }
636
- __name(handleXChange, "handleXChange");
637
- function handleYChange(val) {
638
- !val || !object || (commandService.executeCommand(UpdateSlideElementOperation.id, {
639
- pageId,
640
- oKey: object.oKey,
624
+ function Se(S) {
625
+ !S || !l || (s.executeCommand(K.id, {
626
+ pageId: e,
627
+ oKey: l.oKey,
641
628
  props: {
642
- right: val
629
+ right: S
643
630
  }
644
- }), object == null || object.translate(object.left, val), setYPosition(val), transformer == null || transformer.refreshControls());
631
+ }), l == null || l.translate(l.left, S), R(S), c == null || c.refreshControls());
645
632
  }
646
- __name(handleYChange, "handleYChange");
647
- function handleChangeRotation(val) {
648
- !val || !object || (commandService.executeCommand(UpdateSlideElementOperation.id, {
649
- pageId,
650
- oKey: object.oKey,
633
+ function Ie(S) {
634
+ !S || !l || (s.executeCommand(K.id, {
635
+ pageId: e,
636
+ oKey: l.oKey,
651
637
  props: {
652
- angle: val
638
+ angle: S
653
639
  }
654
- }), object == null || object.transformByState({
655
- angle: val
656
- }), setRotation(val), transformer == null || transformer.refreshControls());
640
+ }), l == null || l.transformByState({
641
+ angle: S
642
+ }), ce(S), c == null || c.refreshControls());
657
643
  }
658
- return __name(handleChangeRotation, "handleChangeRotation"), /* @__PURE__ */ jsxRuntimeExports.jsxs(
644
+ return /* @__PURE__ */ d.jsxs(
659
645
  "div",
660
646
  {
661
- className: clsx(styles$4.imageCommonPanelGrid, styles$4.imageCommonPanelBorder),
647
+ className: T(m.imageCommonPanelGrid, m.imageCommonPanelBorder),
662
648
  children: [
663
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("image-panel.transform.title") }) }) }),
664
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
665
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
666
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.width") }) }),
667
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
668
- InputNumber,
649
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle), children: /* @__PURE__ */ d.jsx("div", { children: n.t("image-panel.transform.title") }) }) }),
650
+ /* @__PURE__ */ d.jsxs("div", { className: m.imageCommonPanelRow, children: [
651
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3), children: /* @__PURE__ */ d.jsxs("label", { children: [
652
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: n.t("image-panel.transform.width") }) }),
653
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ d.jsx(
654
+ ue,
669
655
  {
670
- className: styles$4.imageCommonPanelInput,
656
+ className: m.imageCommonPanelInput,
671
657
  min: 1,
672
- value: width,
673
- onChange: /* @__PURE__ */ __name((val) => {
674
- handleWidthChange(val);
675
- }, "onChange")
658
+ value: p,
659
+ onChange: (S) => {
660
+ z(S);
661
+ }
676
662
  }
677
663
  ) }) })
678
664
  ] }) }),
679
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
680
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.height") }) }),
681
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
682
- InputNumber,
665
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3), children: /* @__PURE__ */ d.jsxs("label", { children: [
666
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: n.t("image-panel.transform.height") }) }),
667
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ d.jsx(
668
+ ue,
683
669
  {
684
- className: styles$4.imageCommonPanelInput,
670
+ className: m.imageCommonPanelInput,
685
671
  min: 1,
686
- value: height,
687
- onChange: /* @__PURE__ */ __name((val) => {
688
- handleHeightChange(val);
689
- }, "onChange")
672
+ value: I,
673
+ onChange: (S) => {
674
+ ee(S);
675
+ }
690
676
  }
691
677
  ) }) })
692
678
  ] }) })
693
679
  ] }),
694
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelRow, children: [
695
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
696
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.x") }) }),
697
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
698
- InputNumber,
680
+ /* @__PURE__ */ d.jsxs("div", { className: m.imageCommonPanelRow, children: [
681
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3), children: /* @__PURE__ */ d.jsxs("label", { children: [
682
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: n.t("image-panel.transform.x") }) }),
683
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ d.jsx(
684
+ ue,
699
685
  {
700
- className: styles$4.imageCommonPanelInput,
686
+ className: m.imageCommonPanelInput,
701
687
  precision: 1,
702
688
  min: 0,
703
- value: xPosition,
704
- onChange: /* @__PURE__ */ __name((val) => {
705
- handleXChange(val);
706
- }, "onChange")
689
+ value: E,
690
+ onChange: (S) => {
691
+ te(S);
692
+ }
707
693
  }
708
694
  ) }) })
709
695
  ] }) }),
710
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
711
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.y") }) }),
712
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
713
- InputNumber,
696
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3), children: /* @__PURE__ */ d.jsxs("label", { children: [
697
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: n.t("image-panel.transform.y") }) }),
698
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ d.jsx(
699
+ ue,
714
700
  {
715
- className: styles$4.imageCommonPanelInput,
701
+ className: m.imageCommonPanelInput,
716
702
  precision: 1,
717
703
  min: 0,
718
- value: yPosition,
719
- onChange: /* @__PURE__ */ __name((val) => {
720
- handleYChange(val);
721
- }, "onChange")
704
+ value: V,
705
+ onChange: (S) => {
706
+ Se(S);
707
+ }
722
708
  }
723
709
  ) }) })
724
710
  ] }) }),
725
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan3), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { children: [
726
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: localeService.t("image-panel.transform.rotate") }) }),
727
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelColumn, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
728
- InputNumber,
711
+ /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3), children: /* @__PURE__ */ d.jsxs("label", { children: [
712
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: n.t("image-panel.transform.rotate") }) }),
713
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ d.jsx(
714
+ ue,
729
715
  {
730
- className: styles$4.imageCommonPanelInput,
716
+ className: m.imageCommonPanelInput,
731
717
  precision: 1,
732
- value: rotation,
733
- onChange: handleChangeRotation
718
+ value: G,
719
+ onChange: Ie
734
720
  }
735
721
  ) }) })
736
722
  ] }) })
@@ -739,55 +725,54 @@ function TransformPanel(props) {
739
725
  }
740
726
  );
741
727
  }
742
- __name(TransformPanel, "TransformPanel");
743
- function ArrangePanel(props) {
744
- var _a11, _b;
745
- const { pageId, unitId } = props, localeService = useDependency(LocaleService), canvasView = useDependency(CanvasView), commandService = useDependency(ICommandService), page = canvasView.getRenderUnitByPageId(pageId, unitId), scene = page == null ? void 0 : page.scene;
746
- if (!scene) return null;
747
- const transformer = scene.getTransformer();
748
- if (!transformer) return null;
749
- const object = transformer.getSelectedObjectMap().values().next().value;
750
- if (!object) return null;
751
- const [color, setColor] = React.useState((_b = (_a11 = object.fill) == null ? void 0 : _a11.toString()) != null ? _b : "");
752
- function handleChangeColor(color2) {
753
- object == null || object.setProps({
754
- fill: color2
755
- }), commandService.executeCommand(UpdateSlideElementOperation.id, {
756
- unitId,
757
- oKey: object == null ? void 0 : object.oKey,
728
+ function zi(i) {
729
+ var _, C;
730
+ const { pageId: e, unitId: t } = i, n = O(Q), r = O(M), s = O(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
731
+ if (!a) return null;
732
+ const c = a.getTransformer();
733
+ if (!c) return null;
734
+ const l = c.getSelectedObjectMap().values().next().value;
735
+ if (!l) return null;
736
+ const [u, h] = ke.useState((C = (_ = l.fill) == null ? void 0 : _.toString()) != null ? C : "");
737
+ function v(p) {
738
+ l == null || l.setProps({
739
+ fill: p
740
+ }), s.executeCommand(K.id, {
741
+ unitId: t,
742
+ oKey: l == null ? void 0 : l.oKey,
758
743
  props: {
759
744
  shape: {
760
745
  shapeProperties: {
761
746
  shapeBackgroundFill: {
762
- rgb: color2
747
+ rgb: p
763
748
  }
764
749
  }
765
750
  }
766
751
  }
767
- }), setColor(color2);
752
+ }), h(p);
768
753
  }
769
- return __name(handleChangeColor, "handleChangeColor"), /* @__PURE__ */ jsxRuntimeExports.jsx(
754
+ return /* @__PURE__ */ d.jsx(
770
755
  "div",
771
756
  {
772
- className: clsx(styles$4.imageCommonPanelGrid, styles$4.imageCommonPanelBorder),
773
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.imageCommonPanelGrid, children: [
774
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelTitle), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: localeService.t("slide.panel.fill.title") }) }) }),
775
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.imageCommonPanelRow, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$4.imageCommonPanelColumn, styles$4.imageCommonPanelSpan2), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
776
- DropdownLegacy,
757
+ className: T(m.imageCommonPanelGrid, m.imageCommonPanelBorder),
758
+ children: /* @__PURE__ */ d.jsxs("div", { className: m.imageCommonPanelGrid, children: [
759
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle), children: /* @__PURE__ */ d.jsx("div", { children: n.t("slide.panel.fill.title") }) }) }),
760
+ /* @__PURE__ */ d.jsx("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ d.jsx("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ d.jsx(
761
+ Vt,
777
762
  {
778
763
  align: {
779
764
  offset: [0, 18]
780
765
  },
781
- overlay: /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: styles$4.slidePanelColorPicker, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
782
- ColorPicker,
766
+ overlay: /* @__PURE__ */ d.jsx("section", { className: m.slidePanelColorPicker, children: /* @__PURE__ */ d.jsx(
767
+ Wn,
783
768
  {
784
769
  value: "#fff",
785
- onChange: handleChangeColor
770
+ onChange: v
786
771
  }
787
772
  ) }),
788
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("a", { className: styles$4.uiPluginSheetsBorderPanelButton, children: [
789
- /* @__PURE__ */ jsxRuntimeExports.jsx(PaintBucket, { extend: { colorChannel1: color != null ? color : "rgb(var(--primary-color))" } }),
790
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$4.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MoreDownSingle, {}) })
773
+ children: /* @__PURE__ */ d.jsxs("a", { className: m.uiPluginSheetsBorderPanelButton, children: [
774
+ /* @__PURE__ */ d.jsx(Xt, { extend: { colorChannel1: u != null ? u : "rgb(var(--primary-color))" } }),
775
+ /* @__PURE__ */ d.jsx("span", { className: m.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ d.jsx(qe, {}) })
791
776
  ] })
792
777
  }
793
778
  ) }) })
@@ -795,65 +780,63 @@ function ArrangePanel(props) {
795
780
  }
796
781
  );
797
782
  }
798
- __name(ArrangePanel, "ArrangePanel");
799
- const imageCommonPanel = "univer-image-common-panel", imageCommonPanelGrid = "univer-image-common-panel-grid", imageCommonPanelBorder = "univer-image-common-panel-border", imageCommonPanelTitle = "univer-image-common-panel-title", imageCommonPanelSubtitle = "univer-image-common-panel-subtitle", imageCommonPanelRow = "univer-image-common-panel-row", imageCommonPanelRowVertical = "univer-image-common-panel-row-vertical", imageCommonPanelColumn = "univer-image-common-panel-column", imageCommonPanelColumnCenter = "univer-image-common-panel-column-center", imageCommonPanelInline = "univer-image-common-panel-inline", imageCommonPanelSpan2 = "univer-image-common-panel-span2", imageCommonPanelSpan3 = "univer-image-common-panel-span3", imageCommonPanelInput = "univer-image-common-panel-input", styles$3 = {
800
- imageCommonPanel,
801
- imageCommonPanelGrid,
802
- imageCommonPanelBorder,
803
- imageCommonPanelTitle,
804
- imageCommonPanelSubtitle,
805
- imageCommonPanelRow,
806
- imageCommonPanelRowVertical,
807
- imageCommonPanelColumn,
808
- imageCommonPanelColumnCenter,
809
- imageCommonPanelInline,
810
- imageCommonPanelSpan2,
811
- imageCommonPanelSpan3,
812
- imageCommonPanelInput
813
- }, COMPONENT_SLIDE_SIDEBAR = "COMPONENT_SLIDE_SIDEBAR";
814
- function RectSidebar() {
815
- var _a11, _b, _c;
816
- const univerInstanceService = useDependency(IUniverInstanceService), canvasView = useDependency(CanvasView), currentSlide = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE), pageId = (_a11 = currentSlide == null ? void 0 : currentSlide.getActivePage()) == null ? void 0 : _a11.id;
817
- if (!pageId) return null;
818
- const transformer = (_b = canvasView.getRenderUnitByPageId(pageId, pageId).scene) == null ? void 0 : _b.getTransformer();
819
- if (!transformer) return null;
820
- const object = transformer.getSelectedObjectMap().values().next().value;
821
- if (!object)
783
+ const Wi = "univer-image-common-panel", Ki = "univer-image-common-panel-grid", Gi = "univer-image-common-panel-border", Xi = "univer-image-common-panel-title", Yi = "univer-image-common-panel-subtitle", ki = "univer-image-common-panel-row", Zi = "univer-image-common-panel-row-vertical", qi = "univer-image-common-panel-column", Ji = "univer-image-common-panel-column-center", Qi = "univer-image-common-panel-inline", er = "univer-image-common-panel-span2", tr = "univer-image-common-panel-span3", nr = "univer-image-common-panel-input", ir = {
784
+ imageCommonPanel: Wi,
785
+ imageCommonPanelGrid: Ki,
786
+ imageCommonPanelBorder: Gi,
787
+ imageCommonPanelTitle: Xi,
788
+ imageCommonPanelSubtitle: Yi,
789
+ imageCommonPanelRow: ki,
790
+ imageCommonPanelRowVertical: Zi,
791
+ imageCommonPanelColumn: qi,
792
+ imageCommonPanelColumnCenter: Ji,
793
+ imageCommonPanelInline: Qi,
794
+ imageCommonPanelSpan2: er,
795
+ imageCommonPanelSpan3: tr,
796
+ imageCommonPanelInput: nr
797
+ }, Re = "COMPONENT_SLIDE_SIDEBAR";
798
+ function rr() {
799
+ var g, l, u;
800
+ const i = O(j), e = O(M), t = i.getCurrentUnitForType(x.UNIVER_SLIDE), n = (g = t == null ? void 0 : t.getActivePage()) == null ? void 0 : g.id;
801
+ if (!n) return null;
802
+ const s = (l = e.getRenderUnitByPageId(n, n).scene) == null ? void 0 : l.getTransformer();
803
+ if (!s) return null;
804
+ const a = s.getSelectedObjectMap().values().next().value;
805
+ if (!a)
822
806
  return null;
823
- const unitId = ((_c = univerInstanceService.getFocusedUnit()) == null ? void 0 : _c.getUnitId()) || "";
824
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: styles$3.imageCommonPanel, children: [
825
- /* @__PURE__ */ jsxRuntimeExports.jsx(ArrangePanel$1, { pageId, unitId }),
826
- /* @__PURE__ */ jsxRuntimeExports.jsx(TransformPanel, { pageId, unitId }),
827
- object.objectType === ObjectType.RECT && /* @__PURE__ */ jsxRuntimeExports.jsx(ArrangePanel, { pageId, unitId })
807
+ const c = ((u = i.getFocusedUnit()) == null ? void 0 : u.getUnitId()) || "";
808
+ return /* @__PURE__ */ d.jsxs("section", { className: ir.imageCommonPanel, children: [
809
+ /* @__PURE__ */ d.jsx(Hi, { pageId: n, unitId: c }),
810
+ /* @__PURE__ */ d.jsx(Fi, { pageId: n, unitId: c }),
811
+ a.objectType === he.RECT && /* @__PURE__ */ d.jsx(zi, { pageId: n, unitId: c })
828
812
  ] });
829
813
  }
830
- __name(RectSidebar, "RectSidebar");
831
- const InsertSlideShapeRectangleCommand = {
814
+ const Je = {
832
815
  id: "slide.command.insert-float-shape",
833
- type: CommandType.COMMAND,
834
- handler: /* @__PURE__ */ __name(async (accessor) => {
835
- var _a11;
836
- const commandService = accessor.get(ICommandService), unitId = (_a11 = accessor.get(IUniverInstanceService).getFocusedUnit()) == null ? void 0 : _a11.getUnitId();
837
- return commandService.executeCommand(InsertSlideShapeRectangleOperation.id, { unitId });
838
- }, "handler")
839
- }, InsertSlideShapeRectangleOperation = {
816
+ type: D.COMMAND,
817
+ handler: async (i) => {
818
+ var r;
819
+ const e = i.get(U), n = (r = i.get(j).getFocusedUnit()) == null ? void 0 : r.getUnitId();
820
+ return e.executeCommand(Zt.id, { unitId: n });
821
+ }
822
+ }, Zt = {
840
823
  id: "slide.operation.insert-float-shape",
841
- type: CommandType.OPERATION,
842
- handler: /* @__PURE__ */ __name(async (accessor, params) => {
843
- const id = generateRandomId(6), univerInstanceService = accessor.get(IUniverInstanceService), unitId = params.unitId, slideData = univerInstanceService.getUnit(unitId);
844
- if (!slideData) return !1;
845
- const activePage = slideData.getActivePage(), elements = Object.values(activePage.pageElements), maxIndex = elements != null && elements.length ? Math.max(...elements.map((element2) => element2.zIndex)) : 20, data = {
846
- id,
847
- zIndex: maxIndex + 1,
824
+ type: D.OPERATION,
825
+ handler: async (i, e) => {
826
+ const t = xt(6), n = i.get(j), r = e.unitId, s = n.getUnit(r);
827
+ if (!s) return !1;
828
+ const o = s.getActivePage(), a = Object.values(o.pageElements), c = a != null && a.length ? Math.max(...a.map((h) => h.zIndex)) : 20, g = {
829
+ id: t,
830
+ zIndex: c + 1,
848
831
  left: 378,
849
832
  top: 142,
850
833
  width: 250,
851
834
  height: 250,
852
- title: id,
835
+ title: t,
853
836
  description: "",
854
- type: PageElementType.SHAPE,
837
+ type: Xe.SHAPE,
855
838
  shape: {
856
- shapeType: BasicShapes.Rect,
839
+ shapeType: _n.Rect,
857
840
  text: "",
858
841
  shapeProperties: {
859
842
  shapeBackgroundFill: {
@@ -862,256 +845,252 @@ const InsertSlideShapeRectangleCommand = {
862
845
  }
863
846
  }
864
847
  };
865
- activePage.pageElements[id] = data, slideData.updatePage(activePage.id, activePage);
866
- const canvasview = accessor.get(CanvasView), sceneObject = canvasview.createObjectToPage(data, activePage.id, unitId);
867
- return sceneObject && canvasview.setObjectActiveByPage(sceneObject, activePage.id, unitId), !0;
868
- }, "handler")
869
- }, ToggleSlideEditSidebarOperation = {
848
+ o.pageElements[t] = g, s.updatePage(o.id, o);
849
+ const l = i.get(M), u = l.createObjectToPage(g, o.id, r);
850
+ return u && l.setObjectActiveByPage(u, o.id, r), !0;
851
+ }
852
+ }, He = {
870
853
  id: "sidebar.operation.slide-shape",
871
- type: CommandType.COMMAND,
872
- handler: /* @__PURE__ */ __name(async (accessor, params) => {
873
- const { visible, objectType } = params, sidebarService = accessor.get(ISidebarService), localeService = accessor.get(LocaleService);
874
- let title = "", children = "";
875
- return objectType === ObjectType.RECT ? (title = "slide.sidebar.shape", children = COMPONENT_SLIDE_SIDEBAR) : objectType === ObjectType.IMAGE ? (title = "slide.sidebar.image", children = COMPONENT_SLIDE_SIDEBAR) : objectType === ObjectType.RICH_TEXT && (title = "slide.sidebar.text", children = COMPONENT_SLIDE_SIDEBAR), visible ? sidebarService.open({
876
- header: { title: localeService.t(title) },
877
- children: { label: children },
878
- onClose: /* @__PURE__ */ __name(() => {
879
- }, "onClose"),
854
+ type: D.COMMAND,
855
+ handler: async (i, e) => {
856
+ const { visible: t, objectType: n } = e, r = i.get(Dt), s = i.get(Q);
857
+ let o = "", a = "";
858
+ return n === he.RECT ? (o = "slide.sidebar.shape", a = Re) : n === he.IMAGE ? (o = "slide.sidebar.image", a = Re) : n === he.RICH_TEXT && (o = "slide.sidebar.text", a = Re), t ? r.open({
859
+ header: { title: s.t(o) },
860
+ children: { label: a },
861
+ onClose: () => {
862
+ },
880
863
  width: 360
881
- }) : sidebarService.close(), !0;
882
- }, "handler")
883
- }, COMPONENT_SLIDE_IMAGE_POPUP_MENU = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
884
- var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
885
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
886
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
887
- return kind && result && __defProp$7(target, key, result), result;
888
- }, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$7");
889
- function transformBound2OffsetBound(originBound, scene) {
890
- const topLeft = transformPosition2Offset(originBound.left, originBound.top, scene), bottomRight = transformPosition2Offset(originBound.right, originBound.bottom, scene);
864
+ }) : r.close(), !0;
865
+ }
866
+ }, qt = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
867
+ var sr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, ar = (i, e, t, n) => {
868
+ for (var r = n > 1 ? void 0 : n ? or(e, t) : e, s = i.length - 1, o; s >= 0; s--)
869
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
870
+ return n && r && sr(e, t, r), r;
871
+ }, be = (i, e) => (t, n) => e(t, n, i);
872
+ function cr(i, e) {
873
+ const t = _t(i.left, i.top, e), n = _t(i.right, i.bottom, e);
891
874
  return {
892
- left: topLeft.x,
893
- top: topLeft.y,
894
- right: bottomRight.x,
895
- bottom: bottomRight.y
875
+ left: t.x,
876
+ top: t.y,
877
+ right: n.x,
878
+ bottom: n.y
896
879
  };
897
880
  }
898
- __name(transformBound2OffsetBound, "transformBound2OffsetBound");
899
- function transformPosition2Offset(x, y, scene) {
900
- const { scaleX, scaleY } = scene.getAncestorScale(), viewMain = scene.getViewport(SLIDE_KEY.VIEW);
901
- if (!viewMain)
881
+ function _t(i, e, t) {
882
+ const { scaleX: n, scaleY: r } = t.getAncestorScale(), s = t.getViewport(se.VIEW);
883
+ if (!s)
902
884
  return {
903
- x,
904
- y
885
+ x: i,
886
+ y: e
905
887
  };
906
- const { viewportScrollX: actualScrollX, viewportScrollY: actualScrollY } = viewMain, offsetX = (x - actualScrollX) * scaleX, offsetY = (y - actualScrollY) * scaleY;
888
+ const { viewportScrollX: o, viewportScrollY: a } = s, c = (i - o) * n, g = (e - a) * r;
907
889
  return {
908
- x: offsetX,
909
- y: offsetY
890
+ x: c,
891
+ y: g
910
892
  };
911
893
  }
912
- __name(transformPosition2Offset, "transformPosition2Offset");
913
- var _a3;
914
- let SlideCanvasPopMangerService = (_a3 = class extends Disposable {
915
- constructor(_globalPopupManagerService, _renderManagerService, _univerInstanceService, _commandService) {
916
- super(), this._globalPopupManagerService = _globalPopupManagerService, this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService, this._commandService = _commandService;
917
- }
918
- _createObjectPositionObserver(targetObject, currentRender) {
919
- const position = (/* @__PURE__ */ __name(() => {
920
- var _a11, _b, _c, _d;
921
- const { scene, engine } = currentRender, { left, top, width, height } = targetObject, horizontalOffset = (scene.width - ((_b = (_a11 = currentRender.mainComponent) == null ? void 0 : _a11.width) != null ? _b : 0)) / 2, verticalOffset = (scene.height - ((_d = (_c = currentRender.mainComponent) == null ? void 0 : _c.height) != null ? _d : 0)) / 2, bound = {
922
- left,
923
- right: left + width,
924
- top,
925
- bottom: top + height
926
- }, canvasElement = engine.getCanvasElement(), canvasClientRect = canvasElement.getBoundingClientRect(), widthOfCanvas = pxToNum(canvasElement.style.width), { scaleX, scaleY } = scene.getAncestorScale(), offsetBound = transformBound2OffsetBound(bound, scene), { top: topOffset, left: leftOffset, width: domWidth } = canvasClientRect, scaleAdjust = domWidth / widthOfCanvas;
894
+ let ye = class extends Ue {
895
+ constructor(i, e, t, n) {
896
+ super(), this._globalPopupManagerService = i, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = n;
897
+ }
898
+ _createObjectPositionObserver(i, e) {
899
+ const n = (() => {
900
+ var F, z, ee, te;
901
+ const { scene: o, engine: a } = e, { left: c, top: g, width: l, height: u } = i, h = (o.width - ((z = (F = e.mainComponent) == null ? void 0 : F.width) != null ? z : 0)) / 2, v = (o.height - ((te = (ee = e.mainComponent) == null ? void 0 : ee.height) != null ? te : 0)) / 2, _ = {
902
+ left: c,
903
+ right: c + l,
904
+ top: g,
905
+ bottom: g + u
906
+ }, C = a.getCanvasElement(), p = C.getBoundingClientRect(), f = wn(C.style.width), { scaleX: I, scaleY: b } = o.getAncestorScale(), E = cr(_, o), { top: w, left: V, width: R } = p, G = R / f;
927
907
  return {
928
- left: offsetBound.left * scaleAdjust * scaleX + leftOffset + horizontalOffset,
929
- right: offsetBound.right * scaleAdjust * scaleX + leftOffset + horizontalOffset,
930
- top: offsetBound.top * scaleAdjust * scaleY + topOffset + verticalOffset,
931
- bottom: offsetBound.bottom * scaleAdjust * scaleY + topOffset + verticalOffset
908
+ left: E.left * G * I + V + h,
909
+ right: E.right * G * I + V + h,
910
+ top: E.top * G * b + w + v,
911
+ bottom: E.bottom * G * b + w + v
932
912
  };
933
- }, "calc"))(), position$ = new BehaviorSubject(position), disposable = new DisposableCollection();
913
+ })(), r = new J(n), s = new Ye();
934
914
  return {
935
- position,
936
- position$,
937
- disposable
915
+ position: n,
916
+ position$: r,
917
+ disposable: s
938
918
  };
939
919
  }
940
- attachPopupToObject(targetObject, popup) {
941
- const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE).getUnitId(), currentRender = this._renderManagerService.getRenderById(unitId);
942
- if (!currentRender)
920
+ attachPopupToObject(i, e) {
921
+ const n = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SLIDE).getUnitId(), r = this._renderManagerService.getRenderById(n);
922
+ if (!r)
943
923
  return {
944
- dispose: /* @__PURE__ */ __name(() => {
945
- }, "dispose")
924
+ dispose: () => {
925
+ }
946
926
  };
947
- const { position, position$, disposable } = this._createObjectPositionObserver(targetObject, currentRender), id = this._globalPopupManagerService.addPopup({
948
- ...popup,
949
- unitId,
927
+ const { position: s, position$: o, disposable: a } = this._createObjectPositionObserver(i, r), c = this._globalPopupManagerService.addPopup({
928
+ ...e,
929
+ unitId: n,
950
930
  subUnitId: "default",
951
- anchorRect: position,
952
- anchorRect$: position$,
953
- canvasElement: currentRender.engine.getCanvasElement()
931
+ anchorRect: s,
932
+ anchorRect$: o,
933
+ canvasElement: r.engine.getCanvasElement()
954
934
  });
955
935
  return {
956
- dispose: /* @__PURE__ */ __name(() => {
957
- this._globalPopupManagerService.removePopup(id), position$.complete(), disposable.dispose();
958
- }, "dispose")
936
+ dispose: () => {
937
+ this._globalPopupManagerService.removePopup(c), o.complete(), a.dispose();
938
+ }
959
939
  };
960
940
  }
961
- }, __name(_a3, "SlideCanvasPopMangerService"), _a3);
962
- SlideCanvasPopMangerService = __decorateClass$7([
963
- __decorateParam$7(0, Inject(ICanvasPopupService)),
964
- __decorateParam$7(1, IRenderManagerService),
965
- __decorateParam$7(2, IUniverInstanceService),
966
- __decorateParam$7(3, ICommandService)
967
- ], SlideCanvasPopMangerService);
968
- var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
969
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
970
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
971
- return kind && result && __defProp$6(target, key, result), result;
972
- }, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$6"), _a4;
973
- let SlidePopupMenuController = (_a4 = class extends RxDisposable {
974
- constructor(_canvasPopManagerService, _renderManagerService, _univerInstanceService, _contextService, _canvasView, _sidebarService, _commandService) {
941
+ };
942
+ ye = ar([
943
+ be(0, X(Dn)),
944
+ be(1, Y),
945
+ be(2, j),
946
+ be(3, U)
947
+ ], ye);
948
+ var lr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, ur = (i, e, t, n) => {
949
+ for (var r = n > 1 ? void 0 : n ? dr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
950
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
951
+ return n && r && lr(e, t, r), r;
952
+ }, Z = (i, e) => (t, n) => e(t, n, i);
953
+ let Te = class extends fe {
954
+ constructor(e, t, n, r, s, o, a) {
975
955
  super();
976
- __publicField(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
977
- this._canvasPopManagerService = _canvasPopManagerService, this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService, this._contextService = _contextService, this._canvasView = _canvasView, this._sidebarService = _sidebarService, this._commandService = _commandService, this._init();
956
+ P(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
957
+ this._canvasPopManagerService = e, this._renderManagerService = t, this._univerInstanceService = n, this._contextService = r, this._canvasView = s, this._sidebarService = o, this._commandService = a, this._init();
978
958
  }
979
959
  _init() {
980
- this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SLIDE).forEach((slide) => this._create(slide));
960
+ this._univerInstanceService.getAllUnitsForType(x.UNIVER_SLIDE).forEach((e) => this._create(e));
981
961
  }
982
- _create(slide) {
983
- if (!slide)
962
+ _create(e) {
963
+ if (!e)
984
964
  return;
985
- const unitId = slide.getUnitId();
986
- this._renderManagerService.has(unitId) && !this._initImagePopupMenu.has(unitId) && (this._popupMenuListener(unitId), this._initImagePopupMenu.add(unitId));
965
+ const t = e.getUnitId();
966
+ this._renderManagerService.has(t) && !this._initImagePopupMenu.has(t) && (this._popupMenuListener(t), this._initImagePopupMenu.add(t));
987
967
  }
988
- _hasCropObject(scene) {
968
+ _hasCropObject(e) {
989
969
  }
990
970
  // eslint-disable-next-line max-lines-per-function
991
- _popupMenuListener(unitId) {
992
- var _a11;
993
- const model = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE), pages = (_a11 = model == null ? void 0 : model.getPages()) != null ? _a11 : {};
994
- Object.keys(pages).forEach((pageId) => {
995
- var _a12;
996
- const transformer = (_a12 = this._canvasView.getRenderUnitByPageId(pageId, unitId).scene) == null ? void 0 : _a12.getTransformer();
997
- if (!transformer) return;
998
- let singletonPopupDisposer;
971
+ _popupMenuListener(e) {
972
+ var r;
973
+ const t = this._univerInstanceService.getCurrentUnitForType(x.UNIVER_SLIDE), n = (r = t == null ? void 0 : t.getPages()) != null ? r : {};
974
+ Object.keys(n).forEach((s) => {
975
+ var g;
976
+ const a = (g = this._canvasView.getRenderUnitByPageId(s, e).scene) == null ? void 0 : g.getTransformer();
977
+ if (!a) return;
978
+ let c;
999
979
  this.disposeWithMe(
1000
- toDisposable(
1001
- transformer.createControl$.subscribe(() => {
1002
- const selectedObjects = transformer.getSelectedObjectMap();
1003
- if (selectedObjects.size > 1) {
1004
- singletonPopupDisposer == null || singletonPopupDisposer.dispose();
980
+ Et(
981
+ a.createControl$.subscribe(() => {
982
+ const l = a.getSelectedObjectMap();
983
+ if (l.size > 1) {
984
+ c == null || c.dispose();
1005
985
  return;
1006
986
  }
1007
- const object = selectedObjects.values().next().value;
1008
- if (!object)
987
+ const u = l.values().next().value;
988
+ if (!u)
1009
989
  return;
1010
- const oKey = object.oKey;
1011
- singletonPopupDisposer == null || singletonPopupDisposer.dispose(), singletonPopupDisposer = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(object, {
1012
- componentKey: COMPONENT_SLIDE_IMAGE_POPUP_MENU,
990
+ const h = u.oKey;
991
+ c == null || c.dispose(), c = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(u, {
992
+ componentKey: qt,
1013
993
  direction: "horizontal",
1014
994
  offset: [2, 0],
1015
995
  extraProps: {
1016
- menuItems: this._getMenuItemsByObjectType(object.objectType, oKey, unitId)
996
+ menuItems: this._getMenuItemsByObjectType(u.objectType, h, e)
1017
997
  }
1018
- })), this._sidebarService.visible && this._commandService.executeCommand(ToggleSlideEditSidebarOperation.id, {
998
+ })), this._sidebarService.visible && this._commandService.executeCommand(He.id, {
1019
999
  visible: !0,
1020
- objectType: object.objectType
1000
+ objectType: u.objectType
1021
1001
  });
1022
1002
  })
1023
1003
  )
1024
1004
  ), this.disposeWithMe(
1025
- transformer.clearControl$.subscribe(() => {
1026
- singletonPopupDisposer == null || singletonPopupDisposer.dispose(), this._contextService.setContextValue(FOCUSING_COMMON_DRAWINGS, !1);
1005
+ a.clearControl$.subscribe(() => {
1006
+ c == null || c.dispose(), this._contextService.setContextValue(Sn, !1);
1027
1007
  })
1028
1008
  ), this.disposeWithMe(
1029
- transformer.changing$.subscribe(() => {
1030
- singletonPopupDisposer == null || singletonPopupDisposer.dispose();
1031
- const selectedObjects = transformer.getSelectedObjectMap();
1032
- if (selectedObjects.size > 1) {
1033
- singletonPopupDisposer == null || singletonPopupDisposer.dispose();
1009
+ a.changing$.subscribe(() => {
1010
+ c == null || c.dispose();
1011
+ const l = a.getSelectedObjectMap();
1012
+ if (l.size > 1) {
1013
+ c == null || c.dispose();
1034
1014
  return;
1035
1015
  }
1036
- const object = selectedObjects.values().next().value;
1037
- object && this._commandService.executeCommand(UpdateSlideElementOperation.id, {
1038
- unitId,
1039
- oKey: object.oKey,
1016
+ const u = l.values().next().value;
1017
+ u && this._commandService.executeCommand(K.id, {
1018
+ unitId: e,
1019
+ oKey: u.oKey,
1040
1020
  props: {
1041
- width: object.width,
1042
- height: object.height,
1043
- left: object.left,
1044
- top: object.top
1021
+ width: u.width,
1022
+ height: u.height,
1023
+ left: u.left,
1024
+ top: u.top
1045
1025
  }
1046
1026
  });
1047
1027
  })
1048
1028
  );
1049
1029
  });
1050
1030
  }
1051
- _getMenuItemsByObjectType(objectType, oKey, unitId) {
1031
+ _getMenuItemsByObjectType(e, t, n) {
1052
1032
  return [{
1053
1033
  label: "slide.popup.edit",
1054
1034
  index: 0,
1055
- commandId: ToggleSlideEditSidebarOperation.id,
1035
+ commandId: He.id,
1056
1036
  commandParams: {
1057
1037
  visible: !0,
1058
- objectType
1038
+ objectType: e
1059
1039
  },
1060
1040
  disable: !1
1061
1041
  }, {
1062
1042
  label: "slide.popup.delete",
1063
1043
  index: 5,
1064
- commandId: DeleteSlideElementOperation.id,
1044
+ commandId: Lt.id,
1065
1045
  commandParams: {
1066
- id: oKey,
1067
- unitId
1046
+ id: t,
1047
+ unitId: n
1068
1048
  },
1069
1049
  disable: !1
1070
1050
  }];
1071
1051
  }
1072
- }, __name(_a4, "SlidePopupMenuController"), _a4);
1073
- SlidePopupMenuController = __decorateClass$6([
1074
- __decorateParam$6(0, Inject(SlideCanvasPopMangerService)),
1075
- __decorateParam$6(1, IRenderManagerService),
1076
- __decorateParam$6(2, IUniverInstanceService),
1077
- __decorateParam$6(3, IContextService),
1078
- __decorateParam$6(4, Inject(CanvasView)),
1079
- __decorateParam$6(5, ISidebarService),
1080
- __decorateParam$6(6, ICommandService)
1081
- ], SlidePopupMenuController);
1082
- const SetTextEditArrowOperation = {
1052
+ };
1053
+ Te = ur([
1054
+ Z(0, X(ye)),
1055
+ Z(1, Y),
1056
+ Z(2, j),
1057
+ Z(3, Ce),
1058
+ Z(4, X(M)),
1059
+ Z(5, Dt),
1060
+ Z(6, U)
1061
+ ], Te);
1062
+ const Me = {
1083
1063
  id: "slide.operation.edit-arrow",
1084
- type: CommandType.OPERATION,
1085
- handler: /* @__PURE__ */ __name(() => !0, "handler")
1086
- }, SLIDE_EDITOR_ID = createInternalEditorID("SLIDE_EDITOR");
1087
- var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
1088
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
1089
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
1090
- return kind && result && __defProp$5(target, key, result), result;
1091
- }, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$5");
1092
- const ISlideEditorBridgeService = createIdentifier("univer.slide-editor-bridge.service");
1093
- var _a5;
1094
- let SlideEditorBridgeService = (_a5 = class extends Disposable {
1095
- constructor(_editorService, _contextService, _renderManagerService) {
1064
+ type: D.OPERATION,
1065
+ handler: () => !0
1066
+ }, ae = In("SLIDE_EDITOR");
1067
+ var mr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, hr = (i, e, t, n) => {
1068
+ for (var r = n > 1 ? void 0 : n ? gr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1069
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1070
+ return n && r && mr(e, t, r), r;
1071
+ }, Le = (i, e) => (t, n) => e(t, n, i);
1072
+ const Qe = Rt("univer.slide-editor-bridge.service");
1073
+ let Fe = class extends Ue {
1074
+ constructor(e, t, n) {
1096
1075
  super();
1097
- __publicField(this, "_editorUnitId", SLIDE_EDITOR_ID);
1098
- __publicField(this, "_isForceKeepVisible", !1);
1099
- __publicField(this, "_editorIsDirty", !1);
1100
- __publicField(this, "_currentEditRectState", null);
1101
- __publicField(this, "_currentEditRectState$", new BehaviorSubject(null));
1102
- __publicField(this, "currentEditRectState$", this._currentEditRectState$.asObservable());
1103
- __publicField(this, "_visibleParam", {
1076
+ P(this, "_editorUnitId", ae);
1077
+ P(this, "_isForceKeepVisible", !1);
1078
+ P(this, "_editorIsDirty", !1);
1079
+ P(this, "_currentEditRectState", null);
1080
+ P(this, "_currentEditRectState$", new J(null));
1081
+ P(this, "currentEditRectState$", this._currentEditRectState$.asObservable());
1082
+ P(this, "_visibleParam", {
1104
1083
  visible: !1,
1105
- eventType: DeviceInputEventType.Dblclick,
1084
+ eventType: q.Dblclick,
1106
1085
  unitId: ""
1107
1086
  });
1108
- __publicField(this, "_visible$", new BehaviorSubject(this._visibleParam));
1109
- __publicField(this, "visible$", this._visible$.asObservable());
1110
- __publicField(this, "_afterVisible$", new BehaviorSubject(this._visibleParam));
1111
- __publicField(this, "afterVisible$", this._afterVisible$.asObservable());
1112
- __publicField(this, "endEditing$", new Subject());
1113
- __publicField(this, "_currentEditRectInfo");
1114
- this._editorService = _editorService, this._contextService = _contextService, this._renderManagerService = _renderManagerService;
1087
+ P(this, "_visible$", new J(this._visibleParam));
1088
+ P(this, "visible$", this._visible$.asObservable());
1089
+ P(this, "_afterVisible$", new J(this._visibleParam));
1090
+ P(this, "afterVisible$", this._afterVisible$.asObservable());
1091
+ P(this, "endEditing$", new Bt());
1092
+ P(this, "_currentEditRectInfo");
1093
+ this._editorService = e, this._contextService = t, this._renderManagerService = n;
1115
1094
  }
1116
1095
  dispose() {
1117
1096
  super.dispose();
@@ -1123,13 +1102,13 @@ let SlideEditorBridgeService = (_a5 = class extends Disposable {
1123
1102
  * 1st part of startEditing.
1124
1103
  * @editorInfo editorInfo
1125
1104
  */
1126
- setEditorRect(editorInfo) {
1127
- this._currentEditRectInfo = editorInfo, this._editorService.getFocusEditor() || (this._editorService.focus(SLIDE_EDITOR_ID), this._contextService.setContextValue(EDITOR_ACTIVATED, !1), this._contextService.setContextValue(FOCUSING_EDITOR_STANDALONE, !1), this._contextService.setContextValue(FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE, !1));
1128
- const editRectState = this.getEditRectState();
1129
- this._currentEditRectState = editRectState, this._currentEditRectState$.next(editRectState);
1105
+ setEditorRect(e) {
1106
+ this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(ae), this._contextService.setContextValue(Oe, !1), this._contextService.setContextValue(Ot, !1), this._contextService.setContextValue(jt, !1));
1107
+ const t = this.getEditRectState();
1108
+ this._currentEditRectState = t, this._currentEditRectState$.next(t);
1130
1109
  }
1131
- changeVisible(param) {
1132
- this._visibleParam = param, param.visible && (this._editorIsDirty = !1), this._visible$.next(this._visibleParam), this._afterVisible$.next(this._visibleParam);
1110
+ changeVisible(e) {
1111
+ this._visibleParam = e, e.visible && (this._editorIsDirty = !1), this._visible$.next(this._visibleParam), this._afterVisible$.next(this._visibleParam);
1133
1112
  }
1134
1113
  /**
1135
1114
  * get info from _currentEditRectInfo
@@ -1138,43 +1117,43 @@ let SlideEditorBridgeService = (_a5 = class extends Disposable {
1138
1117
  * && this@setEditorRect
1139
1118
  */
1140
1119
  getEditRectState() {
1141
- const editorUnitId = SLIDE_EDITOR_ID, editorRectInfo = this._currentEditRectInfo, unitId = editorRectInfo.unitId, docData = editorRectInfo.richTextObj.documentData;
1142
- docData.id = editorUnitId, docData.documentStyle = {
1143
- ...docData.documentStyle,
1144
- pageSize: { width: editorRectInfo.richTextObj.width, height: 1 / 0 }
1120
+ const e = ae, t = this._currentEditRectInfo, n = t.unitId, r = t.richTextObj.documentData;
1121
+ r.id = e, r.documentStyle = {
1122
+ ...r.documentStyle,
1123
+ pageSize: { width: t.richTextObj.width, height: 1 / 0 }
1145
1124
  };
1146
- const documentLayoutObject = {
1147
- documentModel: new DocumentDataModel(docData),
1125
+ const o = {
1126
+ documentModel: new Pn(r),
1148
1127
  fontString: "document",
1149
1128
  textRotation: { a: 0, v: 0 },
1150
1129
  wrapStrategy: 0,
1151
- verticalAlign: VerticalAlign.TOP,
1152
- horizontalAlign: HorizontalAlign.LEFT,
1130
+ verticalAlign: je.TOP,
1131
+ horizontalAlign: yt.LEFT,
1153
1132
  paddingData: { t: 0, b: 1, l: 2, r: 2 }
1154
- }, editorWidth = editorRectInfo.richTextObj.width, editorHeight = editorRectInfo.richTextObj.height, left = editorRectInfo.richTextObj.left, top = editorRectInfo.richTextObj.top, canvasOffset = {
1133
+ }, a = t.richTextObj.width, c = t.richTextObj.height, g = t.richTextObj.left, l = t.richTextObj.top, u = {
1155
1134
  left: 0,
1156
1135
  top: 0
1157
- }, renderUnit = this._renderManagerService.getRenderById(unitId), mainScene = renderUnit == null ? void 0 : renderUnit.scene, mainViewport = mainScene == null ? void 0 : mainScene.getViewport(SLIDE_KEY.VIEW), slideMainRect = mainScene == null ? void 0 : mainScene.getObject(SLIDE_KEY.COMPONENT), slidePos = {
1158
- x: (slideMainRect == null ? void 0 : slideMainRect.left) || 0,
1159
- y: (slideMainRect == null ? void 0 : slideMainRect.top) || 0
1160
- }, scrollX = (mainViewport == null ? void 0 : mainViewport.viewportScrollX) || 0, scrollY = (mainViewport == null ? void 0 : mainViewport.viewportScrollY) || 0;
1161
- return canvasOffset.left = slidePos.x - scrollX, canvasOffset.top = slidePos.y - scrollY, {
1136
+ }, h = this._renderManagerService.getRenderById(n), v = h == null ? void 0 : h.scene, _ = v == null ? void 0 : v.getViewport(se.VIEW), C = v == null ? void 0 : v.getObject(se.COMPONENT), p = {
1137
+ x: (C == null ? void 0 : C.left) || 0,
1138
+ y: (C == null ? void 0 : C.top) || 0
1139
+ }, f = (_ == null ? void 0 : _.viewportScrollX) || 0, I = (_ == null ? void 0 : _.viewportScrollY) || 0;
1140
+ return u.left = p.x - f, u.top = p.y - I, {
1162
1141
  position: {
1163
- startX: left,
1164
- startY: top,
1165
- endX: left + editorWidth,
1166
- endY: top + editorHeight
1142
+ startX: g,
1143
+ startY: l,
1144
+ endX: g + a,
1145
+ endY: l + c
1167
1146
  },
1168
1147
  scaleX: 1,
1169
1148
  scaleY: 1,
1170
- slideCardOffset: canvasOffset,
1171
- unitId,
1172
- editorUnitId,
1173
- documentLayoutObject
1149
+ slideCardOffset: u,
1150
+ unitId: n,
1151
+ editorUnitId: e,
1152
+ documentLayoutObject: o
1174
1153
  };
1175
1154
  }
1176
- changeEditorDirty(dirtyStatus) {
1177
- this._editorIsDirty = dirtyStatus;
1155
+ changeEditorDirty(e) {
1156
+ this._editorIsDirty = e;
1178
1157
  }
1179
1158
  isVisible() {
1180
1159
  return this._visibleParam.visible;
@@ -1188,14 +1167,14 @@ let SlideEditorBridgeService = (_a5 = class extends Disposable {
1188
1167
  /**
1189
1168
  * @deprecated
1190
1169
  */
1191
- genDocData(target) {
1192
- const editorUnitId = this.getCurrentEditorId(), content = target.text, fontSize = target.fs;
1170
+ genDocData(e) {
1171
+ const t = this.getCurrentEditorId(), n = e.text, r = e.fs;
1193
1172
  return {
1194
- id: editorUnitId,
1173
+ id: t,
1195
1174
  body: {
1196
- dataStream: `${content}\r
1175
+ dataStream: `${n}\r
1197
1176
  `,
1198
- textRuns: [{ st: 0, ed: content.length }],
1177
+ textRuns: [{ st: 0, ed: n.length }],
1199
1178
  paragraphs: [{
1200
1179
  paragraphStyle: {
1201
1180
  // no use
@@ -1203,9 +1182,9 @@ let SlideEditorBridgeService = (_a5 = class extends Disposable {
1203
1182
  // horizontalAlign: HorizontalAlign.CENTER,
1204
1183
  // verticalAlign: VerticalAlign.MIDDLE,
1205
1184
  },
1206
- startIndex: content.length + 1
1185
+ startIndex: n.length + 1
1207
1186
  }],
1208
- sectionBreaks: [{ startIndex: content.length + 2 }]
1187
+ sectionBreaks: [{ startIndex: n.length + 2 }]
1209
1188
  },
1210
1189
  documentStyle: {
1211
1190
  marginBottom: 0,
@@ -1213,10 +1192,10 @@ let SlideEditorBridgeService = (_a5 = class extends Disposable {
1213
1192
  marginRight: 0,
1214
1193
  marginTop: 0,
1215
1194
  pageSize: { width: 1 / 0, height: 1 / 0 },
1216
- textStyle: { fs: fontSize },
1195
+ textStyle: { fs: r },
1217
1196
  renderConfig: {
1218
1197
  // horizontalAlign: HorizontalAlign.CENTER,
1219
- verticalAlign: VerticalAlign.MIDDLE,
1198
+ verticalAlign: je.MIDDLE,
1220
1199
  centerAngle: 0,
1221
1200
  vertexAngle: 0,
1222
1201
  wrapStrategy: 0
@@ -1227,73 +1206,70 @@ let SlideEditorBridgeService = (_a5 = class extends Disposable {
1227
1206
  settings: { zoomRatio: 1 }
1228
1207
  };
1229
1208
  }
1230
- }, __name(_a5, "SlideEditorBridgeService"), _a5);
1231
- SlideEditorBridgeService = __decorateClass$5([
1232
- __decorateParam$5(0, IEditorService),
1233
- __decorateParam$5(1, IContextService),
1234
- __decorateParam$5(2, IRenderManagerService)
1235
- ], SlideEditorBridgeService);
1236
- const _SlideEditorManagerService = class _SlideEditorManagerService {
1209
+ };
1210
+ Fe = hr([
1211
+ Le(0, Ze),
1212
+ Le(1, Ce),
1213
+ Le(2, Y)
1214
+ ], Fe);
1215
+ class pr {
1237
1216
  constructor() {
1238
- __publicField(this, "_state", null);
1239
- __publicField(this, "_rect", null);
1240
- __publicField(this, "_state$", new BehaviorSubject(null));
1241
- __publicField(this, "state$", this._state$.asObservable());
1242
- __publicField(this, "_rect$", new BehaviorSubject(null));
1243
- __publicField(this, "rect$", this._rect$.asObservable());
1244
- __publicField(this, "_focus", !1);
1245
- __publicField(this, "_focus$", new BehaviorSubject(this._focus));
1246
- __publicField(this, "focus$", this._focus$.asObservable());
1217
+ P(this, "_state", null);
1218
+ P(this, "_rect", null);
1219
+ P(this, "_state$", new J(null));
1220
+ P(this, "state$", this._state$.asObservable());
1221
+ P(this, "_rect$", new J(null));
1222
+ P(this, "rect$", this._rect$.asObservable());
1223
+ P(this, "_focus", !1);
1224
+ P(this, "_focus$", new J(this._focus));
1225
+ P(this, "focus$", this._focus$.asObservable());
1247
1226
  }
1248
1227
  dispose() {
1249
1228
  this._state$.complete(), this._state = null, this._rect$.complete(), this._rect = null;
1250
1229
  }
1251
- setState(param) {
1252
- this._state = param, this._refresh(param);
1230
+ setState(e) {
1231
+ this._state = e, this._refresh(e);
1253
1232
  }
1254
1233
  getRect() {
1255
1234
  return this._rect;
1256
1235
  }
1257
- setRect(param) {
1258
- this._rect = param, this._rect$.next(param);
1236
+ setRect(e) {
1237
+ this._rect = e, this._rect$.next(e);
1259
1238
  }
1260
1239
  getState() {
1261
1240
  return this._state;
1262
1241
  }
1263
- setFocus(param = !1) {
1264
- this._focus = param, this._focus$.next(param);
1242
+ setFocus(e = !1) {
1243
+ this._focus = e, this._focus$.next(e);
1265
1244
  }
1266
- _refresh(param) {
1267
- this._state$.next(param);
1245
+ _refresh(e) {
1246
+ this._state$.next(e);
1268
1247
  }
1269
- };
1270
- __name(_SlideEditorManagerService, "SlideEditorManagerService");
1271
- let SlideEditorManagerService = _SlideEditorManagerService;
1272
- const ISlideEditorManagerService = createIdentifier(
1248
+ }
1249
+ const et = Rt(
1273
1250
  "univer.slide-editor-manager.service"
1274
1251
  );
1275
- var CursorChange = /* @__PURE__ */ ((_CursorChange) => (_CursorChange[_CursorChange.InitialState = 0] = "InitialState", _CursorChange[_CursorChange.StartEditor = 1] = "StartEditor", _CursorChange[_CursorChange.CursorChange = 2] = "CursorChange", _CursorChange))(CursorChange || {}), __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
1276
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
1277
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
1278
- return kind && result && __defProp$4(target, key, result), result;
1279
- }, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$4");
1280
- const HIDDEN_EDITOR_POSITION$1 = -1e3, EDITOR_INPUT_SELF_EXTEND_GAP = 5, EDITOR_BORDER_SIZE = 2;
1281
- var _a6;
1282
- let SlideEditingRenderController = (_a6 = class extends Disposable {
1283
- constructor(_renderContext, _layoutService, _undoRedoService, _contextService, _instanceSrv, _renderManagerService, _editorBridgeService, _cellEditorManagerService, _textSelectionManagerService, _commandService, _localService, _editorService) {
1252
+ var k = /* @__PURE__ */ ((i) => (i[i.InitialState = 0] = "InitialState", i[i.StartEditor = 1] = "StartEditor", i[i.CursorChange = 2] = "CursorChange", i))(k || {}), fr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, vr = (i, e, t, n) => {
1253
+ for (var r = n > 1 ? void 0 : n ? Cr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1254
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1255
+ return n && r && fr(e, t, r), r;
1256
+ }, L = (i, e) => (t, n) => e(t, n, i);
1257
+ const St = -1e3, It = 5, _r = 2;
1258
+ let ze = class extends Ue {
1259
+ constructor(e, t, n, r, s, o, a, c, g, l, u, h) {
1284
1260
  super();
1285
1261
  /**
1286
1262
  * It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
1287
1263
  */
1288
- __publicField(this, "_cursorChange", CursorChange.InitialState);
1264
+ P(this, "_cursorChange", k.InitialState);
1289
1265
  /** If the corresponding unit is active and prepared for editing. */
1290
- __publicField(this, "_isUnitEditing", !1);
1291
- __publicField(this, "_d");
1292
- this._renderContext = _renderContext, this._layoutService = _layoutService, this._undoRedoService = _undoRedoService, this._contextService = _contextService, this._instanceSrv = _instanceSrv, this._renderManagerService = _renderManagerService, this._editorBridgeService = _editorBridgeService, this._cellEditorManagerService = _cellEditorManagerService, this._textSelectionManagerService = _textSelectionManagerService, this._commandService = _commandService, this._localService = _localService, this._editorService = _editorService, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SLIDE).subscribe((slideDataModel) => {
1293
- slideDataModel && slideDataModel.getUnitId() === this._renderContext.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({
1266
+ P(this, "_isUnitEditing", !1);
1267
+ P(this, "_d");
1268
+ this._renderContext = e, this._layoutService = t, this._undoRedoService = n, this._contextService = r, this._instanceSrv = s, this._renderManagerService = o, this._editorBridgeService = a, this._cellEditorManagerService = c, this._textSelectionManagerService = g, this._commandService = l, this._localService = u, this._editorService = h, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(x.UNIVER_SLIDE).subscribe((v) => {
1269
+ v && v.getUnitId() === this._renderContext.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({
1294
1270
  visible: !1,
1295
- eventType: DeviceInputEventType.Keyboard,
1296
- keycode: KeyCode.ESC,
1271
+ eventType: q.Keyboard,
1272
+ keycode: y.ESC,
1297
1273
  unitId: this._renderContext.unitId
1298
1274
  }), this._isUnitEditing = !1));
1299
1275
  })), this._initEditorVisibilityListener();
@@ -1302,61 +1278,61 @@ let SlideEditingRenderController = (_a6 = class extends Disposable {
1302
1278
  super.dispose(), this._disposeCurrent();
1303
1279
  }
1304
1280
  _disposeCurrent() {
1305
- var _a11;
1306
- (_a11 = this._d) == null || _a11.dispose(), this._d = null;
1281
+ var e;
1282
+ (e = this._d) == null || e.dispose(), this._d = null;
1307
1283
  }
1308
1284
  _init() {
1309
- const d = new DisposableCollection();
1310
- return this._subscribeToCurrentCell(d), this._initialKeyboardListener(d), this._initialCursorSync(d), this._listenEditorFocus(d), this._commandExecutedListener(d), setTimeout(() => {
1311
- this._cursorStateListener(d);
1312
- }, 1e3), d;
1285
+ const e = new Ye();
1286
+ return this._subscribeToCurrentCell(e), this._initialKeyboardListener(e), this._initialCursorSync(e), this._listenEditorFocus(e), this._commandExecutedListener(e), setTimeout(() => {
1287
+ this._cursorStateListener(e);
1288
+ }, 1e3), e;
1313
1289
  }
1314
1290
  _initEditorVisibilityListener() {
1315
- this.disposeWithMe(this._editorBridgeService.visible$.subscribe((param) => {
1316
- param.visible ? (this._isUnitEditing = !0, this._handleEditorVisible(param)) : this._isUnitEditing && (this._handleEditorInvisible(param), this._isUnitEditing = !1);
1291
+ this.disposeWithMe(this._editorBridgeService.visible$.subscribe((e) => {
1292
+ e.visible ? (this._isUnitEditing = !0, this._handleEditorVisible(e)) : this._isUnitEditing && (this._handleEditorInvisible(e), this._isUnitEditing = !1);
1317
1293
  }));
1318
1294
  }
1319
- _listenEditorFocus(d) {
1320
- const renderConfig = this._getEditorObject();
1321
- renderConfig && d.add(renderConfig.document.onPointerDown$.subscribeEvent(() => {
1295
+ _listenEditorFocus(e) {
1296
+ const t = this._getEditorObject();
1297
+ t && e.add(t.document.onPointerDown$.subscribeEvent(() => {
1322
1298
  }));
1323
1299
  }
1324
- _getEditorSkeleton(editorId) {
1325
- var _a11;
1326
- return (_a11 = this._renderManagerService.getRenderById(editorId)) == null ? void 0 : _a11.with(DocSkeletonManagerService).getSkeleton();
1300
+ _getEditorSkeleton(e) {
1301
+ var t;
1302
+ return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(gt).getSkeleton();
1327
1303
  }
1328
- _getEditorViewModel(editorId) {
1329
- var _a11;
1330
- return (_a11 = this._renderManagerService.getRenderById(editorId)) == null ? void 0 : _a11.with(DocSkeletonManagerService).getViewModel();
1304
+ _getEditorViewModel(e) {
1305
+ var t;
1306
+ return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(gt).getViewModel();
1331
1307
  }
1332
- _initialCursorSync(d) {
1333
- d.add(this._cellEditorManagerService.focus$.pipe(filter((f) => !!f)).subscribe(() => {
1334
- var _a11;
1335
- const docSelectionRenderManager = (_a11 = this._renderManagerService.getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_DOC)) == null ? void 0 : _a11.with(DocSelectionRenderService);
1336
- docSelectionRenderManager && docSelectionRenderManager.sync();
1308
+ _initialCursorSync(e) {
1309
+ e.add(this._cellEditorManagerService.focus$.pipe(Gn((t) => !!t)).subscribe(() => {
1310
+ var n;
1311
+ const t = (n = this._renderManagerService.getCurrentTypeOfRenderer(x.UNIVER_DOC)) == null ? void 0 : n.with(ht);
1312
+ t && t.sync();
1337
1313
  }));
1338
1314
  }
1339
1315
  /**
1340
1316
  * Set editorUnitId to curr doc.
1341
1317
  * @param d DisposableCollection
1342
1318
  */
1343
- _subscribeToCurrentCell(d) {
1344
- d.add(this._editorBridgeService.currentEditRectState$.subscribe((editCellState) => {
1345
- var _a11;
1346
- if (editCellState == null || this._contextService.getContextValue(FOCUSING_EDITOR_STANDALONE) || this._contextService.getContextValue(FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE))
1319
+ _subscribeToCurrentCell(e) {
1320
+ e.add(this._editorBridgeService.currentEditRectState$.subscribe((t) => {
1321
+ var h;
1322
+ if (t == null || this._contextService.getContextValue(Ot) || this._contextService.getContextValue(jt))
1347
1323
  return;
1348
1324
  const {
1349
- position: { startX, endX },
1350
- documentLayoutObject: { textRotation, wrapStrategy, documentModel },
1351
- scaleX,
1352
- editorUnitId
1353
- } = editCellState, { vertexAngle: angle } = convertTextRotation(textRotation);
1354
- documentModel.updateDocumentId(editorUnitId), wrapStrategy === WrapStrategy.WRAP && angle === 0 && documentModel.updateDocumentDataPageSize((endX - startX) / scaleX), this._instanceSrv.changeDoc(editorUnitId, documentModel), this._contextService.setContextValue(FOCUSING_EDITOR_BUT_HIDDEN, !0), this._textSelectionManagerService.replaceTextRanges([{
1325
+ position: { startX: n, endX: r },
1326
+ documentLayoutObject: { textRotation: s, wrapStrategy: o, documentModel: a },
1327
+ scaleX: c,
1328
+ editorUnitId: g
1329
+ } = t, { vertexAngle: l } = at(s);
1330
+ a.updateDocumentId(g), o === it.WRAP && l === 0 && a.updateDocumentDataPageSize((r - n) / c), this._instanceSrv.changeDoc(g, a), this._contextService.setContextValue(bn, !0), this._textSelectionManagerService.replaceTextRanges([{
1355
1331
  startOffset: 0,
1356
1332
  endOffset: 0
1357
1333
  }]);
1358
- const docSelectionRenderManager = (_a11 = this._renderManagerService.getCurrentTypeOfRenderer(UniverInstanceType.UNIVER_DOC)) == null ? void 0 : _a11.with(DocSelectionRenderService);
1359
- docSelectionRenderManager && docSelectionRenderManager.activate(HIDDEN_EDITOR_POSITION$1, HIDDEN_EDITOR_POSITION$1);
1334
+ const u = (h = this._renderManagerService.getCurrentTypeOfRenderer(x.UNIVER_DOC)) == null ? void 0 : h.with(ht);
1335
+ u && u.activate(St, St);
1360
1336
  }));
1361
1337
  }
1362
1338
  /**
@@ -1368,113 +1344,112 @@ let SlideEditingRenderController = (_a6 = class extends Disposable {
1368
1344
  * @param scaleX
1369
1345
  * @param scaleY
1370
1346
  */
1371
- _fitTextSize(positionFromEditRectState, canvasOffset, documentSkeleton, documentLayoutObject, scaleX = 1, scaleY = 1) {
1372
- const { startX, startY, endX, endY } = positionFromEditRectState, documentDataModel = documentLayoutObject.documentModel;
1373
- if (documentDataModel == null)
1347
+ _fitTextSize(e, t, n, r, s = 1, o = 1) {
1348
+ const { startX: a, startY: c, endX: g, endY: l } = e, u = r.documentModel;
1349
+ if (u == null)
1374
1350
  return;
1375
- const { actualWidth, actualHeight } = this._predictingSize(
1376
- positionFromEditRectState,
1377
- canvasOffset,
1378
- documentSkeleton,
1379
- documentLayoutObject,
1380
- scaleX,
1381
- scaleY
1382
- ), { verticalAlign, paddingData, fill } = documentLayoutObject;
1383
- let editorWidth = endX - startX, editorHeight = endY - startY;
1384
- if (editorWidth < actualWidth && (editorWidth = actualWidth), editorHeight < actualHeight)
1385
- editorHeight = actualHeight, documentDataModel.updateDocumentDataMargin(paddingData);
1351
+ const { actualWidth: h, actualHeight: v } = this._predictingSize(
1352
+ e,
1353
+ t,
1354
+ n,
1355
+ r,
1356
+ s,
1357
+ o
1358
+ ), { verticalAlign: _, paddingData: C, fill: p } = r;
1359
+ let f = g - a, I = l - c;
1360
+ if (f < h && (f = h), I < v)
1361
+ I = v, u.updateDocumentDataMargin(C);
1386
1362
  else {
1387
- let offsetTop = 0;
1388
- verticalAlign === VerticalAlign.MIDDLE ? offsetTop = (editorHeight - actualHeight) / 2 / scaleY : verticalAlign === VerticalAlign.TOP ? offsetTop = paddingData.t || 0 : offsetTop = (editorHeight - actualHeight) / scaleY - (paddingData.b || 0), offsetTop = offsetTop < (paddingData.t || 0) ? paddingData.t || 0 : offsetTop, documentDataModel.updateDocumentDataMargin({
1389
- t: offsetTop
1363
+ let b = 0;
1364
+ _ === je.MIDDLE ? b = (I - v) / 2 / o : _ === je.TOP ? b = C.t || 0 : b = (I - v) / o - (C.b || 0), b = b < (C.t || 0) ? C.t || 0 : b, u.updateDocumentDataMargin({
1365
+ t: b
1390
1366
  });
1391
1367
  }
1392
- documentSkeleton.calculate(), this._editAreaProcessing(editorWidth, editorHeight, positionFromEditRectState, canvasOffset, fill, scaleX, scaleY);
1368
+ n.calculate(), this._editAreaProcessing(f, I, e, t, p, s, o);
1393
1369
  }
1394
1370
  /**
1395
1371
  * Mainly used to pre-calculate the width of the editor,
1396
1372
  * to determine whether it needs to be automatically widened.
1397
1373
  */
1398
- _predictingSize(actualRangeWithCoord, canvasOffset, documentSkeleton, documentLayoutObject, scaleX = 1, scaleY = 1) {
1399
- const { startX, endX } = actualRangeWithCoord, { textRotation, wrapStrategy } = documentLayoutObject, documentDataModel = documentLayoutObject.documentModel, { vertexAngle: angle } = convertTextRotation(textRotation), clientWidth = document.body.clientWidth;
1400
- if (wrapStrategy === WrapStrategy.WRAP && angle === 0) {
1401
- const { actualWidth, actualHeight } = documentSkeleton.getActualSize();
1374
+ _predictingSize(e, t, n, r, s = 1, o = 1) {
1375
+ const { startX: a, endX: c } = e, { textRotation: g, wrapStrategy: l } = r, u = r.documentModel, { vertexAngle: h } = at(g), v = document.body.clientWidth;
1376
+ if (l === it.WRAP && h === 0) {
1377
+ const { actualWidth: p, actualHeight: f } = n.getActualSize();
1402
1378
  return {
1403
- actualWidth: actualWidth * scaleX,
1404
- actualHeight: actualHeight * scaleY
1379
+ actualWidth: p * s,
1380
+ actualHeight: f * o
1405
1381
  };
1406
1382
  }
1407
- documentDataModel == null || documentDataModel.updateDocumentDataPageSize((clientWidth - startX - canvasOffset.left) / scaleX), documentSkeleton.calculate();
1408
- const size = documentSkeleton.getActualSize();
1409
- let editorWidth = endX - startX;
1410
- return editorWidth < size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX && (editorWidth = size.actualWidth * scaleX + EDITOR_INPUT_SELF_EXTEND_GAP * scaleX), documentDataModel == null || documentDataModel.updateDocumentDataPageSize(editorWidth / scaleX), documentDataModel == null || documentDataModel.updateDocumentRenderConfig({
1411
- horizontalAlign: HorizontalAlign.UNSPECIFIED,
1383
+ u == null || u.updateDocumentDataPageSize((v - a - t.left) / s), n.calculate();
1384
+ const _ = n.getActualSize();
1385
+ let C = c - a;
1386
+ return C < _.actualWidth * s + It * s && (C = _.actualWidth * s + It * s), u == null || u.updateDocumentDataPageSize(C / s), u == null || u.updateDocumentRenderConfig({
1387
+ horizontalAlign: yt.UNSPECIFIED,
1412
1388
  cellValueType: void 0
1413
1389
  }), {
1414
- actualWidth: editorWidth,
1415
- actualHeight: size.actualHeight * scaleY
1390
+ actualWidth: C,
1391
+ actualHeight: _.actualHeight * o
1416
1392
  };
1417
1393
  }
1418
1394
  /**
1419
1395
  * control the size of editing area
1420
1396
  */
1421
1397
  // eslint-disable-next-line max-lines-per-function
1422
- _editAreaProcessing(editorWidth, editorHeight, positionFromEditRectState, canvasOffset, fill, scaleX = 1, scaleY = 1) {
1423
- var _a11;
1424
- const editorObject = this._getEditorObject();
1425
- if (editorObject == null)
1398
+ _editAreaProcessing(e, t, n, r, s, o = 1, a = 1) {
1399
+ var S;
1400
+ const c = this._getEditorObject();
1401
+ if (c == null)
1426
1402
  return;
1427
- function pxToNum2(width2) {
1428
- return Number.parseInt(width2.replace("px", ""));
1403
+ function g(le) {
1404
+ return Number.parseInt(le.replace("px", ""));
1429
1405
  }
1430
- __name(pxToNum2, "pxToNum");
1431
- const canvasElement = this._renderContext.engine.getCanvasElement(), canvasClientRect = canvasElement.getBoundingClientRect(), widthOfCanvas = pxToNum2(canvasElement.style.width), { top, left, width } = canvasClientRect, scaleAdjust = width / widthOfCanvas;
1432
- let { startX, startY } = positionFromEditRectState;
1433
- startX += canvasOffset.left, startY += canvasOffset.top;
1434
- const { document: documentComponent, scene: editorScene, engine: docEngine } = editorObject, viewportMain = editorScene.getViewport(VIEWPORT_KEY.VIEW_MAIN), clientHeight = document.body.clientHeight - startY - canvasOffset.top - EDITOR_BORDER_SIZE * 2, clientWidth = document.body.clientWidth - startX - canvasOffset.left;
1435
- let physicHeight = editorHeight, scrollBar = viewportMain == null ? void 0 : viewportMain.getScrollBar();
1436
- physicHeight > clientHeight ? (physicHeight = clientHeight, scrollBar == null ? viewportMain && new ScrollBar(viewportMain, { enableHorizontal: !1, barSize: 8 }) : viewportMain == null || viewportMain.resetCanvasSizeAndUpdateScroll()) : (scrollBar = null, (_a11 = viewportMain == null ? void 0 : viewportMain.getScrollBar()) == null || _a11.dispose()), editorWidth += (scrollBar == null ? void 0 : scrollBar.barSize) || 0, editorWidth = Math.min(editorWidth, clientWidth), startX -= FIX_ONE_PIXEL_BLUR_OFFSET, startY -= FIX_ONE_PIXEL_BLUR_OFFSET, this._addBackground(editorScene, editorWidth / scaleX, editorHeight / scaleY, fill);
1437
- const { scaleX: precisionScaleX, scaleY: precisionScaleY } = editorScene.getPrecisionScale();
1438
- editorScene.transformByState({
1439
- width: editorWidth * scaleAdjust / scaleX,
1440
- height: editorHeight * scaleAdjust / scaleY,
1441
- scaleX: scaleX * scaleAdjust,
1442
- scaleY: scaleY * scaleAdjust
1443
- }), documentComponent.resize(editorWidth / scaleX, editorHeight / scaleY), setTimeout(() => {
1444
- docEngine.resizeBySize(
1445
- fixLineWidthByScale(editorWidth, precisionScaleX),
1446
- fixLineWidthByScale(physicHeight, precisionScaleY)
1406
+ const u = this._renderContext.engine.getCanvasElement(), h = u.getBoundingClientRect(), v = g(u.style.width), { top: _, left: C, width: p } = h, f = p / v;
1407
+ let { startX: I, startY: b } = n;
1408
+ I += r.left, b += r.top;
1409
+ const { document: E, scene: w, engine: V } = c, R = w.getViewport(pt.VIEW_MAIN), G = document.body.clientHeight - b - r.top - _r * 2, ce = document.body.clientWidth - I - r.left;
1410
+ let F = t, z = R == null ? void 0 : R.getScrollBar();
1411
+ F > G ? (F = G, z == null ? R && new wt(R, { enableHorizontal: !1, barSize: 8 }) : R == null || R.resetCanvasSizeAndUpdateScroll()) : (z = null, (S = R == null ? void 0 : R.getScrollBar()) == null || S.dispose()), e += (z == null ? void 0 : z.barSize) || 0, e = Math.min(e, ce), I -= re, b -= re, this._addBackground(w, e / o, t / a, s);
1412
+ const { scaleX: ee, scaleY: te } = w.getPrecisionScale();
1413
+ w.transformByState({
1414
+ width: e * f / o,
1415
+ height: t * f / a,
1416
+ scaleX: o * f,
1417
+ scaleY: a * f
1418
+ }), E.resize(e / o, t / a), setTimeout(() => {
1419
+ V.resizeBySize(
1420
+ ct(e, ee),
1421
+ ct(F, te)
1447
1422
  );
1448
1423
  }, 0);
1449
- const contentBoundingRect = this._layoutService.getContentElement().getBoundingClientRect(), canvasBoundingRect = canvasElement.getBoundingClientRect();
1450
- startX = startX * scaleAdjust + (canvasBoundingRect.left - contentBoundingRect.left), startY = startY * scaleAdjust + (canvasBoundingRect.top - contentBoundingRect.top), this._cellEditorManagerService.setState({
1451
- startX,
1452
- startY,
1453
- endX: editorWidth * scaleAdjust + startX,
1454
- endY: physicHeight * scaleAdjust + startY,
1424
+ const Se = this._layoutService.getContentElement().getBoundingClientRect(), Ie = u.getBoundingClientRect();
1425
+ I = I * f + (Ie.left - Se.left), b = b * f + (Ie.top - Se.top), this._cellEditorManagerService.setState({
1426
+ startX: I,
1427
+ startY: b,
1428
+ endX: e * f + I,
1429
+ endY: F * f + b,
1455
1430
  show: !0
1456
1431
  });
1457
1432
  }
1458
1433
  /**
1459
1434
  * Since the document does not support cell background color, an additional rect needs to be added.
1460
1435
  */
1461
- _addBackground(scene, editorWidth, editorHeight, fill) {
1462
- const fillRectKey = "_backgroundRectHelperColor_", rect = scene.getObject(fillRectKey);
1463
- rect == null && fill == null || (rect == null ? scene.addObjects(
1436
+ _addBackground(e, t, n, r) {
1437
+ const s = "_backgroundRectHelperColor_", o = e.getObject(s);
1438
+ o == null && r == null || (o == null ? e.addObjects(
1464
1439
  [
1465
- new Rect(fillRectKey, {
1466
- width: editorWidth,
1467
- height: editorHeight,
1468
- fill,
1440
+ new Nt(s, {
1441
+ width: t,
1442
+ height: n,
1443
+ fill: r,
1469
1444
  evented: !1
1470
1445
  })
1471
1446
  ],
1472
- DOCS_COMPONENT_MAIN_LAYER_INDEX
1473
- ) : fill == null ? rect.dispose() : (rect.setProps({
1474
- fill
1475
- }), rect.transformByState({
1476
- width: editorWidth,
1477
- height: editorHeight
1447
+ kn
1448
+ ) : r == null ? o.dispose() : (o.setProps({
1449
+ fill: r
1450
+ }), o.transformByState({
1451
+ width: t,
1452
+ height: n
1478
1453
  })));
1479
1454
  }
1480
1455
  /**
@@ -1485,114 +1460,114 @@ let SlideEditingRenderController = (_a6 = class extends Disposable {
1485
1460
  // handleVisible is the 2nd part of editing.
1486
1461
  // first part: startEditing --> _updateEditor
1487
1462
  // 2nd part: startEditing --> changeVisible --> slide-editor-bridge.render-controller.ts@changeVisible --> _editorBridgeService.changeVisible
1488
- _handleEditorVisible(param) {
1489
- var _a11, _b;
1490
- const { eventType } = param;
1491
- this._cursorChange = [DeviceInputEventType.PointerDown, DeviceInputEventType.Dblclick].includes(eventType) ? CursorChange.CursorChange : CursorChange.StartEditor;
1492
- const editCellState = this._editorBridgeService.getEditRectState();
1493
- if (editCellState == null)
1463
+ _handleEditorVisible(e) {
1464
+ var p, f;
1465
+ const { eventType: t } = e;
1466
+ this._cursorChange = [q.PointerDown, q.Dblclick].includes(t) ? k.CursorChange : k.StartEditor;
1467
+ const n = this._editorBridgeService.getEditRectState();
1468
+ if (n == null)
1494
1469
  return;
1495
1470
  const {
1496
- position,
1497
- documentLayoutObject,
1498
- slideCardOffset: canvasOffset,
1499
- scaleX,
1500
- scaleY,
1501
- editorUnitId,
1502
- unitId
1503
- } = editCellState, editorObject = this._getEditorObject();
1504
- if (editorObject == null)
1471
+ position: r,
1472
+ documentLayoutObject: s,
1473
+ slideCardOffset: o,
1474
+ scaleX: a,
1475
+ scaleY: c,
1476
+ editorUnitId: g,
1477
+ unitId: l
1478
+ } = n, u = this._getEditorObject();
1479
+ if (u == null)
1505
1480
  return;
1506
- const { scene } = editorObject;
1507
- this._contextService.setContextValue(EDITOR_ACTIVATED, !0);
1508
- const { documentModel: documentDataModel } = documentLayoutObject, skeleton = this._getEditorSkeleton(editorUnitId);
1509
- if (!skeleton || !documentDataModel)
1481
+ const { scene: h } = u;
1482
+ this._contextService.setContextValue(Oe, !0);
1483
+ const { documentModel: v } = s, _ = this._getEditorSkeleton(g);
1484
+ if (!_ || !v)
1510
1485
  return;
1511
- this._fitTextSize(position, canvasOffset, skeleton, documentLayoutObject, scaleX, scaleY);
1512
- const cursor = documentDataModel.getBody().dataStream.length - 2 || 0;
1513
- (_a11 = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN)) == null || _a11.scrollToViewportPos({
1486
+ this._fitTextSize(r, o, _, s, a, c);
1487
+ const C = v.getBody().dataStream.length - 2 || 0;
1488
+ (p = h.getViewport(pt.VIEW_MAIN)) == null || p.scrollToViewportPos({
1514
1489
  viewportScrollX: Number.POSITIVE_INFINITY
1515
1490
  }), this._textSelectionManagerService.replaceTextRanges([
1516
1491
  {
1517
- startOffset: cursor,
1518
- endOffset: cursor
1492
+ startOffset: C,
1493
+ endOffset: C
1519
1494
  }
1520
- ]), (_b = this._renderManagerService.getRenderById(unitId)) == null || _b.scene.resetCursor();
1495
+ ]), (f = this._renderManagerService.getRenderById(l)) == null || f.scene.resetCursor();
1521
1496
  }
1522
- _resetBodyStyle(body, removeStyle = !1) {
1523
- body.dataStream = DEFAULT_EMPTY_DOCUMENT_VALUE, body.textRuns != null && (body.textRuns.length === 1 && !removeStyle ? (body.textRuns[0].st = 0, body.textRuns[0].ed = 1) : body.textRuns = void 0), body.paragraphs != null && (body.paragraphs.length === 1 ? body.paragraphs[0].startIndex = 0 : body.paragraphs = [
1497
+ _resetBodyStyle(e, t = !1) {
1498
+ e.dataStream = Tt, e.textRuns != null && (e.textRuns.length === 1 && !t ? (e.textRuns[0].st = 0, e.textRuns[0].ed = 1) : e.textRuns = void 0), e.paragraphs != null && (e.paragraphs.length === 1 ? e.paragraphs[0].startIndex = 0 : e.paragraphs = [
1524
1499
  {
1525
1500
  startIndex: 0
1526
1501
  }
1527
- ]), body.sectionBreaks != null && (body.sectionBreaks = void 0), body.tables != null && (body.tables = void 0), body.customRanges != null && (body.customRanges = void 0), body.customBlocks != null && (body.customBlocks = void 0);
1502
+ ]), e.sectionBreaks != null && (e.sectionBreaks = void 0), e.tables != null && (e.tables = void 0), e.customRanges != null && (e.customRanges = void 0), e.customBlocks != null && (e.customBlocks = void 0);
1528
1503
  }
1529
1504
  /**
1530
1505
  * Should activate the editor when the user inputs text.
1531
1506
  * @param d DisposableCollection
1532
1507
  */
1533
- _initialKeyboardListener(d) {
1508
+ _initialKeyboardListener(e) {
1534
1509
  }
1535
- _showEditorByKeyboard(config) {
1510
+ _showEditorByKeyboard(e) {
1536
1511
  }
1537
- _commandExecutedListener(d) {
1538
- const moveCursorOP = [SetTextEditArrowOperation.id], editedMutations = [RichTextEditingMutation.id];
1539
- d.add(this._commandService.onCommandExecuted((command) => {
1540
- this._editorService.getFocusId() === SLIDE_EDITOR_ID && (moveCursorOP.includes(command.id) && this._moveCursorCmdHandler(command), editedMutations.includes(command.id) && this._editorBridgeService.isVisible() && this._editingChangedHandler());
1512
+ _commandExecutedListener(e) {
1513
+ const t = [Me.id], n = [Yn.id];
1514
+ e.add(this._commandService.onCommandExecuted((r) => {
1515
+ this._editorService.getFocusId() === ae && (t.includes(r.id) && this._moveCursorCmdHandler(r), n.includes(r.id) && this._editorBridgeService.isVisible() && this._editingChangedHandler());
1541
1516
  }));
1542
1517
  }
1543
- _moveCursorCmdHandler(command) {
1544
- const params = command.params, { keycode, isShift } = params;
1545
- keycode != null && this._cursorChange === CursorChange.CursorChange ? this._moveInEditor(keycode, isShift) : this._editorBridgeService.changeVisible(params);
1518
+ _moveCursorCmdHandler(e) {
1519
+ const t = e.params, { keycode: n, isShift: r } = t;
1520
+ n != null && this._cursorChange === k.CursorChange ? this._moveInEditor(n, r) : this._editorBridgeService.changeVisible(t);
1546
1521
  }
1547
1522
  _editingChangedHandler() {
1548
- const editRect = this._editorBridgeService.getEditorRect();
1549
- if (!editRect)
1523
+ const e = this._editorBridgeService.getEditorRect();
1524
+ if (!e)
1550
1525
  return;
1551
- const editingRichText = editRect.richTextObj;
1552
- editingRichText.refreshDocumentByDocData(), editingRichText.resizeToContentSize();
1553
- const { unitId } = this._renderContext;
1554
- this._handleEditorVisible({ visible: !0, eventType: 3, unitId });
1526
+ const t = e.richTextObj;
1527
+ t.refreshDocumentByDocData(), t.resizeToContentSize();
1528
+ const { unitId: n } = this._renderContext;
1529
+ this._handleEditorVisible({ visible: !0, eventType: 3, unitId: n });
1555
1530
  }
1556
1531
  _getEditorObject() {
1557
- return getEditorObject(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
1532
+ return Sr(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
1558
1533
  }
1559
- async _handleEditorInvisible(param) {
1560
- const { keycode } = param;
1561
- if (this._cursorChange = CursorChange.InitialState, this._exitInput(param), this._editorBridgeService.getEditRectState() == null)
1534
+ async _handleEditorInvisible(e) {
1535
+ const { keycode: t } = e;
1536
+ if (this._cursorChange = k.InitialState, this._exitInput(e), this._editorBridgeService.getEditRectState() == null)
1562
1537
  return;
1563
1538
  if (this._editorBridgeService.getEditorDirty() === !1) {
1564
- this._moveCursor(keycode);
1539
+ this._moveCursor(t);
1565
1540
  return;
1566
1541
  }
1567
- this._moveCursor(keycode);
1542
+ this._moveCursor(t);
1568
1543
  }
1569
- _exitInput(param) {
1570
- this._contextService.setContextValue(EDITOR_ACTIVATED, !1), this._cellEditorManagerService.setState({
1571
- show: param.visible
1544
+ _exitInput(e) {
1545
+ this._contextService.setContextValue(Oe, !1), this._cellEditorManagerService.setState({
1546
+ show: e.visible
1572
1547
  });
1573
- const editorUnitId = this._editorBridgeService.getCurrentEditorId();
1574
- editorUnitId != null && this._undoRedoService.clearUndoRedo(editorUnitId);
1575
- }
1576
- _moveCursor(keycode) {
1577
- if (keycode != null)
1578
- switch (Direction.LEFT, keycode) {
1579
- case KeyCode.ENTER:
1580
- Direction.DOWN;
1548
+ const t = this._editorBridgeService.getCurrentEditorId();
1549
+ t != null && this._undoRedoService.clearUndoRedo(t);
1550
+ }
1551
+ _moveCursor(e) {
1552
+ if (e != null)
1553
+ switch (B.LEFT, e) {
1554
+ case y.ENTER:
1555
+ B.DOWN;
1581
1556
  break;
1582
- case KeyCode.TAB:
1583
- Direction.RIGHT;
1557
+ case y.TAB:
1558
+ B.RIGHT;
1584
1559
  break;
1585
- case KeyCode.ARROW_DOWN:
1586
- Direction.DOWN;
1560
+ case y.ARROW_DOWN:
1561
+ B.DOWN;
1587
1562
  break;
1588
- case KeyCode.ARROW_UP:
1589
- Direction.UP;
1563
+ case y.ARROW_UP:
1564
+ B.UP;
1590
1565
  break;
1591
- case KeyCode.ARROW_LEFT:
1592
- Direction.LEFT;
1566
+ case y.ARROW_LEFT:
1567
+ B.LEFT;
1593
1568
  break;
1594
- case KeyCode.ARROW_RIGHT:
1595
- Direction.RIGHT;
1569
+ case y.ARROW_RIGHT:
1570
+ B.RIGHT;
1596
1571
  break;
1597
1572
  }
1598
1573
  }
@@ -1600,60 +1575,59 @@ let SlideEditingRenderController = (_a6 = class extends Disposable {
1600
1575
  * The user's operations follow the sequence of opening the editor and then moving the cursor.
1601
1576
  * The logic here predicts the user's first cursor movement behavior based on this rule
1602
1577
  */
1603
- _cursorStateListener(d) {
1604
- const editorObject = this._getEditorObject();
1605
- if (!editorObject)
1578
+ _cursorStateListener(e) {
1579
+ const t = this._getEditorObject();
1580
+ if (!t)
1606
1581
  return;
1607
- const { document: documentComponent } = editorObject;
1608
- d.add(toDisposable(documentComponent.onPointerDown$.subscribeEvent(() => {
1609
- this._cursorChange === CursorChange.StartEditor && (this._cursorChange = CursorChange.CursorChange);
1582
+ const { document: n } = t;
1583
+ e.add(Et(n.onPointerDown$.subscribeEvent(() => {
1584
+ this._cursorChange === k.StartEditor && (this._cursorChange = k.CursorChange);
1610
1585
  })));
1611
1586
  }
1612
1587
  // TODO: @JOCS, is it necessary to move these commands MoveSelectionOperation\MoveCursorOperation to shortcut? and use multi-commands?
1613
- _moveInEditor(keycode, isShift) {
1614
- let direction = Direction.LEFT;
1615
- keycode === KeyCode.ARROW_DOWN ? direction = Direction.DOWN : keycode === KeyCode.ARROW_UP ? direction = Direction.UP : keycode === KeyCode.ARROW_RIGHT && (direction = Direction.RIGHT), isShift ? this._commandService.executeCommand(MoveSelectionOperation.id, {
1616
- direction
1617
- }) : this._commandService.executeCommand(MoveCursorOperation.id, {
1618
- direction
1588
+ _moveInEditor(e, t) {
1589
+ let n = B.LEFT;
1590
+ e === y.ARROW_DOWN ? n = B.DOWN : e === y.ARROW_UP ? n = B.UP : e === y.ARROW_RIGHT && (n = B.RIGHT), t ? this._commandService.executeCommand(Zn.id, {
1591
+ direction: n
1592
+ }) : this._commandService.executeCommand(qn.id, {
1593
+ direction: n
1619
1594
  });
1620
1595
  }
1621
- }, __name(_a6, "SlideEditingRenderController"), _a6);
1622
- SlideEditingRenderController = __decorateClass$4([
1623
- __decorateParam$4(1, ILayoutService),
1624
- __decorateParam$4(2, IUndoRedoService),
1625
- __decorateParam$4(3, IContextService),
1626
- __decorateParam$4(4, IUniverInstanceService),
1627
- __decorateParam$4(5, IRenderManagerService),
1628
- __decorateParam$4(6, ISlideEditorBridgeService),
1629
- __decorateParam$4(7, ISlideEditorManagerService),
1630
- __decorateParam$4(8, Inject(DocSelectionManagerService)),
1631
- __decorateParam$4(9, ICommandService),
1632
- __decorateParam$4(10, Inject(LocaleService)),
1633
- __decorateParam$4(11, IEditorService)
1634
- ], SlideEditingRenderController);
1635
- function getEditorObject(unitId, renderManagerService) {
1636
- if (unitId == null)
1596
+ };
1597
+ ze = vr([
1598
+ L(1, Un),
1599
+ L(2, xn),
1600
+ L(3, Ce),
1601
+ L(4, j),
1602
+ L(5, Y),
1603
+ L(6, Qe),
1604
+ L(7, et),
1605
+ L(8, X(Xn)),
1606
+ L(9, U),
1607
+ L(10, X(Q)),
1608
+ L(11, Ze)
1609
+ ], ze);
1610
+ function Sr(i, e) {
1611
+ if (i == null)
1637
1612
  return;
1638
- const currentRender = renderManagerService.getRenderById(unitId);
1639
- if (currentRender == null)
1613
+ const t = e.getRenderById(i);
1614
+ if (t == null)
1640
1615
  return;
1641
- const { mainComponent, scene, engine, components } = currentRender, document2 = mainComponent, docBackground = components.get(DOCS_VIEW_KEY.BACKGROUND);
1616
+ const { mainComponent: n, scene: r, engine: s, components: o } = t, a = n, c = o.get(Jn.BACKGROUND);
1642
1617
  return {
1643
- document: document2,
1644
- docBackground,
1645
- scene,
1646
- engine
1618
+ document: a,
1619
+ docBackground: c,
1620
+ scene: r,
1621
+ engine: s
1647
1622
  };
1648
1623
  }
1649
- __name(getEditorObject, "getEditorObject");
1650
- var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
1651
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
1652
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
1653
- return kind && result && __defProp$3(target, key, result), result;
1654
- }, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$3"), _a7;
1655
- let SlideEditorBridgeRenderController = (_a7 = class extends RxDisposable {
1656
- constructor(_renderContext, _instanceSrv, _commandService, _editorBridgeService) {
1624
+ var Ir = Object.defineProperty, Pr = Object.getOwnPropertyDescriptor, br = (i, e, t, n) => {
1625
+ for (var r = n > 1 ? void 0 : n ? Pr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
1626
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
1627
+ return n && r && Ir(e, t, r), r;
1628
+ }, Ae = (i, e) => (t, n) => e(t, n, i);
1629
+ let We = class extends fe {
1630
+ constructor(e, t, n, r) {
1657
1631
  super();
1658
1632
  /**
1659
1633
  * It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
@@ -1661,54 +1635,54 @@ let SlideEditorBridgeRenderController = (_a7 = class extends RxDisposable {
1661
1635
  // private _cursorChange: CursorChange = CursorChange.InitialState;
1662
1636
  /** If the corresponding unit is active and prepared for editing. */
1663
1637
  // private _isUnitEditing = false;
1664
- __publicField(this, "setSlideTextEditor$", new Subject());
1665
- __publicField(this, "_curRichText", null);
1666
- __publicField(this, "_d");
1667
- this._renderContext = _renderContext, this._instanceSrv = _instanceSrv, this._commandService = _commandService, this._editorBridgeService = _editorBridgeService, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SLIDE).subscribe((slideDataModel) => {
1668
- slideDataModel && slideDataModel.getUnitId() === this._renderContext.unitId ? this._d = this._init() : this._disposeCurrent();
1638
+ P(this, "setSlideTextEditor$", new Bt());
1639
+ P(this, "_curRichText", null);
1640
+ P(this, "_d");
1641
+ this._renderContext = e, this._instanceSrv = t, this._commandService = n, this._editorBridgeService = r, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(x.UNIVER_SLIDE).subscribe((s) => {
1642
+ s && s.getUnitId() === this._renderContext.unitId ? this._d = this._init() : this._disposeCurrent();
1669
1643
  }));
1670
1644
  }
1671
1645
  _init() {
1672
- const d = new DisposableCollection();
1673
- return this._initEventListener(d), d;
1646
+ const e = new Ye();
1647
+ return this._initEventListener(e), e;
1674
1648
  }
1675
1649
  _disposeCurrent() {
1676
- var _a11;
1677
- (_a11 = this._d) == null || _a11.dispose(), this._d = null;
1678
- }
1679
- _setEditorRect(pageId, targetObject) {
1680
- this._curRichText = targetObject;
1681
- const { scene, engine } = this._renderContext, unitId = this._renderContext.unitId, setEditorRect = {
1682
- scene,
1683
- engine,
1684
- unitId,
1685
- pageId,
1686
- richTextObj: targetObject
1650
+ var e;
1651
+ (e = this._d) == null || e.dispose(), this._d = null;
1652
+ }
1653
+ _setEditorRect(e, t) {
1654
+ this._curRichText = t;
1655
+ const { scene: n, engine: r } = this._renderContext, s = this._renderContext.unitId, o = {
1656
+ scene: n,
1657
+ engine: r,
1658
+ unitId: s,
1659
+ pageId: e,
1660
+ richTextObj: t
1687
1661
  };
1688
- this._editorBridgeService.setEditorRect(setEditorRect);
1662
+ this._editorBridgeService.setEditorRect(o);
1689
1663
  }
1690
- _initEventListener(d) {
1691
- const listenersForPageScene = /* @__PURE__ */ __name((scene) => {
1692
- const transformer = scene.getTransformer();
1693
- transformer && (d.add(transformer.clearControl$.subscribe(() => {
1664
+ _initEventListener(e) {
1665
+ const t = (o) => {
1666
+ const a = o.getTransformer();
1667
+ a && (e.add(a.clearControl$.subscribe(() => {
1694
1668
  this.setEditorVisible(!1), this.pickOtherObjects();
1695
- })), d.add(transformer.createControl$.subscribe(() => {
1669
+ })), e.add(a.createControl$.subscribe(() => {
1696
1670
  this.setEditorVisible(!1);
1697
- })), d.add(scene.onDblclick$.subscribeEvent(() => {
1698
- transformer.clearControls();
1699
- const object = transformer.getSelectedObjectMap().values().next().value;
1700
- object && (object.objectType !== ObjectType.RICH_TEXT ? this.pickOtherObjects() : this.startEditing(scene.sceneKey, object));
1701
- })), d.add(this._instanceSrv.focused$.subscribe((fc) => {
1671
+ })), e.add(o.onDblclick$.subscribeEvent(() => {
1672
+ a.clearControls();
1673
+ const g = a.getSelectedObjectMap().values().next().value;
1674
+ g && (g.objectType !== he.RICH_TEXT ? this.pickOtherObjects() : this.startEditing(o.sceneKey, g));
1675
+ })), e.add(this._instanceSrv.focused$.subscribe((c) => {
1702
1676
  this.endEditing();
1703
1677
  })));
1704
- }, "listenersForPageScene"), { mainComponent } = this._renderContext;
1705
- mainComponent.subSceneChanged$.subscribeEvent((pageScene) => {
1706
- listenersForPageScene(pageScene);
1678
+ }, { mainComponent: n } = this._renderContext;
1679
+ n.subSceneChanged$.subscribeEvent((o) => {
1680
+ t(o);
1707
1681
  });
1708
- const pageSceneList = Array.from(mainComponent.getSubScenes().values());
1709
- for (let i = 0; i < pageSceneList.length; i++) {
1710
- const pageScene = pageSceneList[i];
1711
- listenersForPageScene(pageScene);
1682
+ const s = Array.from(n.getSubScenes().values());
1683
+ for (let o = 0; o < s.length; o++) {
1684
+ const a = s[o];
1685
+ t(a);
1712
1686
  }
1713
1687
  }
1714
1688
  pickOtherObjects() {
@@ -1720,26 +1694,26 @@ let SlideEditorBridgeRenderController = (_a7 = class extends RxDisposable {
1720
1694
  * save editing state to curr richText.
1721
1695
  */
1722
1696
  endEditing() {
1723
- var _a11;
1697
+ var s;
1724
1698
  if (!this._curRichText) return;
1725
1699
  this.setEditorVisible(!1);
1726
- const curRichText = this._curRichText;
1727
- if (!this._instanceSrv.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE)) return !1;
1728
- curRichText.refreshDocumentByDocData(), curRichText.resizeToContentSize(), this._editorBridgeService.endEditing$.next(curRichText);
1729
- const richText = {
1700
+ const e = this._curRichText;
1701
+ if (!this._instanceSrv.getCurrentUnitForType(x.UNIVER_SLIDE)) return !1;
1702
+ e.refreshDocumentByDocData(), e.resizeToContentSize(), this._editorBridgeService.endEditing$.next(e);
1703
+ const n = {
1730
1704
  bl: 1,
1731
- fs: curRichText.fs,
1732
- text: curRichText.text
1733
- }, textRuns = (_a11 = curRichText.documentData.body) == null ? void 0 : _a11.textRuns;
1734
- if (textRuns && textRuns.length) {
1735
- const ts = textRuns[0].ts;
1736
- richText.cl = ts == null ? void 0 : ts.cl;
1705
+ fs: e.fs,
1706
+ text: e.text
1707
+ }, r = (s = e.documentData.body) == null ? void 0 : s.textRuns;
1708
+ if (r && r.length) {
1709
+ const a = r[0].ts;
1710
+ n.cl = a == null ? void 0 : a.cl;
1737
1711
  }
1738
- this._commandService.executeCommand(UpdateSlideElementOperation.id, {
1712
+ this._commandService.executeCommand(K.id, {
1739
1713
  unitId: this._renderContext.unitId,
1740
- oKey: curRichText == null ? void 0 : curRichText.oKey,
1714
+ oKey: e == null ? void 0 : e.oKey,
1741
1715
  props: {
1742
- richText
1716
+ richText: n
1743
1717
  }
1744
1718
  }), this._curRichText = null;
1745
1719
  }
@@ -1750,106 +1724,106 @@ let SlideEditorBridgeRenderController = (_a7 = class extends RxDisposable {
1750
1724
  * TODO @lumixraku need scale param
1751
1725
  * @param target
1752
1726
  */
1753
- startEditing(pageId, target) {
1754
- this._setEditorRect(pageId, target), this.setEditorVisible(!0);
1755
- }
1756
- setEditorVisible(visible) {
1757
- var _a11, _b;
1758
- visible ? (_a11 = this._curRichText) == null || _a11.hide() : (_b = this._curRichText) == null || _b.show();
1759
- const { unitId } = this._renderContext;
1760
- this._editorBridgeService.changeVisible({ visible, eventType: DeviceInputEventType.PointerDown, unitId });
1761
- }
1762
- }, __name(_a7, "SlideEditorBridgeRenderController"), _a7);
1763
- SlideEditorBridgeRenderController = __decorateClass$3([
1764
- __decorateParam$3(1, IUniverInstanceService),
1765
- __decorateParam$3(2, ICommandService),
1766
- __decorateParam$3(3, ISlideEditorBridgeService)
1767
- ], SlideEditorBridgeRenderController);
1768
- const ActivateSlidePageOperation = {
1727
+ startEditing(e, t) {
1728
+ this._setEditorRect(e, t), this.setEditorVisible(!0);
1729
+ }
1730
+ setEditorVisible(e) {
1731
+ var n, r;
1732
+ e ? (n = this._curRichText) == null || n.hide() : (r = this._curRichText) == null || r.show();
1733
+ const { unitId: t } = this._renderContext;
1734
+ this._editorBridgeService.changeVisible({ visible: e, eventType: q.PointerDown, unitId: t });
1735
+ }
1736
+ };
1737
+ We = br([
1738
+ Ae(1, j),
1739
+ Ae(2, U),
1740
+ Ae(3, Qe)
1741
+ ], We);
1742
+ const Jt = {
1769
1743
  id: "slide.operation.activate-slide",
1770
- type: CommandType.OPERATION,
1771
- handler: /* @__PURE__ */ __name((accessor, params) => {
1772
- var _a11, _b;
1773
- const unitId = params.unitId, canvasView = accessor.get(CanvasView), model = accessor.get(IUniverInstanceService).getUnit(unitId), pageId = (_a11 = model == null ? void 0 : model.getActivePage()) == null ? void 0 : _a11.id;
1774
- if (!pageId) return !1;
1775
- const page = canvasView.getRenderUnitByPageId(pageId, unitId);
1776
- if (!page) return !1;
1777
- const transformer = (_b = page.scene) == null ? void 0 : _b.getTransformer();
1778
- return transformer && transformer.clearControls(), canvasView.activePage(params.id, unitId), !0;
1779
- }, "handler")
1780
- }, AppendSlideOperation = {
1744
+ type: D.OPERATION,
1745
+ handler: (i, e) => {
1746
+ var g, l;
1747
+ const t = e.unitId, n = i.get(M), s = i.get(j).getUnit(t), o = (g = s == null ? void 0 : s.getActivePage()) == null ? void 0 : g.id;
1748
+ if (!o) return !1;
1749
+ const a = n.getRenderUnitByPageId(o, t);
1750
+ if (!a) return !1;
1751
+ const c = (l = a.scene) == null ? void 0 : l.getTransformer();
1752
+ return c && c.clearControls(), n.activePage(e.id, t), !0;
1753
+ }
1754
+ }, Qt = {
1781
1755
  id: "slide.operation.append-slide",
1782
- type: CommandType.OPERATION,
1783
- handler: /* @__PURE__ */ __name((accessor, params) => {
1784
- const unitId = params.unitId;
1785
- return accessor.get(IUniverInstanceService).getUnit(unitId) ? (accessor.get(CanvasView).appendPage(unitId), !0) : !1;
1786
- }, "handler")
1787
- }, InsertSlideFloatImageCommand = {
1756
+ type: D.OPERATION,
1757
+ handler: (i, e) => {
1758
+ const t = e.unitId;
1759
+ return i.get(j).getUnit(t) ? (i.get(M).appendPage(t), !0) : !1;
1760
+ }
1761
+ }, tt = {
1788
1762
  id: "slide.command.insert-float-image",
1789
- type: CommandType.COMMAND,
1790
- handler: /* @__PURE__ */ __name(async (accessor, params) => {
1791
- var _a11;
1792
- const univerInstanceService = accessor.get(IUniverInstanceService), unitId = (_a11 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE)) == null ? void 0 : _a11.getUnitId();
1793
- if (!unitId) return !1;
1794
- const files = await accessor.get(ILocalFileService).openFile({
1763
+ type: D.COMMAND,
1764
+ handler: async (i, e) => {
1765
+ var V;
1766
+ const t = i.get(j), n = (V = t.getCurrentUnitForType(x.UNIVER_SLIDE)) == null ? void 0 : V.getUnitId();
1767
+ if (!n) return !1;
1768
+ const s = await i.get(Vn).openFile({
1795
1769
  multiple: !0,
1796
- accept: DRAWING_IMAGE_ALLOW_IMAGE_LIST.map((image2) => `.${image2.replace("image/", "")}`).join(",")
1770
+ accept: ei.map((R) => `.${R.replace("image/", "")}`).join(",")
1797
1771
  });
1798
- if (files.length !== 1) return !1;
1799
- const imageParam = await accessor.get(IImageIoService).saveImage(files[0]);
1800
- if (!imageParam) return !1;
1801
- const { imageId, imageSourceType, source, base64Cache } = imageParam, { width, height, image } = await getImageSize(base64Cache || ""), slideData = univerInstanceService.getUnit(unitId);
1802
- if (!slideData) return !1;
1803
- const activePage = slideData.getActivePage(), elements = Object.values(activePage.pageElements), maxIndex = elements != null && elements.length ? Math.max(...elements.map((element2) => element2.zIndex)) : 20, data = {
1804
- id: imageId,
1805
- zIndex: maxIndex + 1,
1772
+ if (s.length !== 1) return !1;
1773
+ const a = await i.get(ti).saveImage(s[0]);
1774
+ if (!a) return !1;
1775
+ const { imageId: c, imageSourceType: g, source: l, base64Cache: u } = a, { width: h, height: v, image: _ } = await ni(u || ""), C = t.getUnit(n);
1776
+ if (!C) return !1;
1777
+ const p = C.getActivePage(), f = Object.values(p.pageElements), I = f != null && f.length ? Math.max(...f.map((R) => R.zIndex)) : 20, b = {
1778
+ id: c,
1779
+ zIndex: I + 1,
1806
1780
  left: 0,
1807
1781
  top: 0,
1808
- width,
1809
- height,
1782
+ width: h,
1783
+ height: v,
1810
1784
  title: "",
1811
1785
  description: "",
1812
- type: PageElementType.IMAGE,
1786
+ type: Xe.IMAGE,
1813
1787
  image: {
1814
1788
  imageProperties: {
1815
- contentUrl: base64Cache,
1816
- imageSourceType,
1817
- source,
1818
- base64Cache,
1819
- image
1789
+ contentUrl: u,
1790
+ imageSourceType: g,
1791
+ source: l,
1792
+ base64Cache: u,
1793
+ image: _
1820
1794
  }
1821
1795
  }
1822
1796
  };
1823
- activePage.pageElements[imageId] = data, slideData.updatePage(activePage.id, activePage);
1824
- const canvasView = accessor.get(CanvasView), sceneObject = canvasView.createObjectToPage(data, activePage.id, unitId);
1825
- return sceneObject && canvasView.setObjectActiveByPage(sceneObject, activePage.id, unitId), !0;
1826
- }, "handler")
1827
- }, SlideAddTextCommand = {
1797
+ p.pageElements[c] = b, C.updatePage(p.id, p);
1798
+ const E = i.get(M), w = E.createObjectToPage(b, p.id, n);
1799
+ return w && E.setObjectActiveByPage(w, p.id, n), !0;
1800
+ }
1801
+ }, nt = {
1828
1802
  id: "slide.command.add-text",
1829
- type: CommandType.COMMAND,
1830
- handler: /* @__PURE__ */ __name(async (accessor) => {
1831
- var _a11;
1832
- const commandService = accessor.get(ICommandService), unitId = (_a11 = accessor.get(IUniverInstanceService).getFocusedUnit()) == null ? void 0 : _a11.getUnitId();
1833
- return await commandService.executeCommand(SlideAddTextOperation.id, { unitId });
1834
- }, "handler")
1835
- }, SlideAddTextOperation = {
1803
+ type: D.COMMAND,
1804
+ handler: async (i) => {
1805
+ var r;
1806
+ const e = i.get(U), n = (r = i.get(j).getFocusedUnit()) == null ? void 0 : r.getUnitId();
1807
+ return await e.executeCommand(en.id, { unitId: n });
1808
+ }
1809
+ }, en = {
1836
1810
  id: "slide.operation.add-text",
1837
- type: CommandType.OPERATION,
1838
- handler: /* @__PURE__ */ __name(async (accessor, params) => {
1839
- const unitId = params.unitId, elementId = generateRandomId(6), defaultWidth = 220, defaultheight = 40, left = 230, top = 142, textContent = (params == null ? void 0 : params.text) || "A New Text", slideData = accessor.get(IUniverInstanceService).getUnit(unitId);
1840
- if (!slideData) return !1;
1841
- const activePage = slideData.getActivePage(), elements = Object.values(activePage.pageElements), maxIndex = elements != null && elements.length ? Math.max(...elements.map((element2) => element2.zIndex)) : 21, elementData = {
1842
- id: elementId,
1843
- zIndex: maxIndex + 1,
1844
- left,
1845
- top,
1846
- width: defaultWidth,
1847
- height: defaultheight,
1811
+ type: D.OPERATION,
1812
+ handler: async (i, e) => {
1813
+ const t = e.unitId, n = xt(6), r = 220, s = 40, o = 230, a = 142, c = (e == null ? void 0 : e.text) || "A New Text", l = i.get(j).getUnit(t);
1814
+ if (!l) return !1;
1815
+ const u = l.getActivePage(), h = Object.values(u.pageElements), v = h != null && h.length ? Math.max(...h.map((f) => f.zIndex)) : 21, _ = {
1816
+ id: n,
1817
+ zIndex: v + 1,
1818
+ left: o,
1819
+ top: a,
1820
+ width: r,
1821
+ height: s,
1848
1822
  title: "text",
1849
1823
  description: "",
1850
- type: PageElementType.TEXT,
1824
+ type: Xe.TEXT,
1851
1825
  richText: {
1852
- text: textContent,
1826
+ text: c,
1853
1827
  fs: 30,
1854
1828
  cl: {
1855
1829
  rgb: "rgb(51, 51, 51)"
@@ -1857,72 +1831,72 @@ const ActivateSlidePageOperation = {
1857
1831
  bl: 1
1858
1832
  }
1859
1833
  };
1860
- activePage.pageElements[elementId] = elementData, slideData.updatePage(activePage.id, activePage);
1861
- const canvasview = accessor.get(CanvasView), sceneObject = canvasview.createObjectToPage(elementData, activePage.id, unitId);
1862
- return sceneObject && canvasview.setObjectActiveByPage(sceneObject, activePage.id, unitId), !0;
1863
- }, "handler")
1864
- }, SetSlidePageThumbOperation = {
1834
+ u.pageElements[n] = _, l.updatePage(u.id, u);
1835
+ const C = i.get(M), p = C.createObjectToPage(_, u.id, t);
1836
+ return p && C.setObjectActiveByPage(p, u.id, t), !0;
1837
+ }
1838
+ }, tn = {
1865
1839
  id: "slide.operation.set-slide-page-thumb",
1866
- type: CommandType.OPERATION,
1867
- handler: /* @__PURE__ */ __name((accessor, params) => (accessor.get(CanvasView).createThumbs(params.unitId), !0), "handler")
1868
- }, imagePopupMenu = "univer-image-popup-menu", imagePopupMenuItem = "univer-image-popup-menu-item", imagePopupMenuItemIcon = "univer-image-popup-menu-item-icon", imagePopupMenuItemTitle = "univer-image-popup-menu-item-title", imagePopupMenuItemHide = "univer-image-popup-menu-item-hide", btnContainer = "univer-btn-container", btnContainerExpand = "univer-btn-container-expand", styles$2 = {
1869
- imagePopupMenu,
1870
- imagePopupMenuItem,
1871
- imagePopupMenuItemIcon,
1872
- imagePopupMenuItemTitle,
1873
- imagePopupMenuItemHide,
1874
- btnContainer,
1875
- btnContainerExpand
1876
- }, SlideImagePopupMenu = /* @__PURE__ */ __name((props) => {
1877
- var _a11, _b;
1878
- const menuItems = (_b = (_a11 = props.popup) == null ? void 0 : _a11.extraProps) == null ? void 0 : _b.menuItems;
1879
- if (!menuItems)
1840
+ type: D.OPERATION,
1841
+ handler: (i, e) => (i.get(M).createThumbs(e.unitId), !0)
1842
+ }, xr = "univer-image-popup-menu", Er = "univer-image-popup-menu-item", Rr = "univer-image-popup-menu-item-icon", Or = "univer-image-popup-menu-item-title", jr = "univer-image-popup-menu-item-hide", yr = "univer-btn-container", Tr = "univer-btn-container-expand", ge = {
1843
+ imagePopupMenu: xr,
1844
+ imagePopupMenuItem: Er,
1845
+ imagePopupMenuItemIcon: Rr,
1846
+ imagePopupMenuItemTitle: Or,
1847
+ imagePopupMenuItemHide: jr,
1848
+ btnContainer: yr,
1849
+ btnContainerExpand: Tr
1850
+ }, Mr = (i) => {
1851
+ var _, C;
1852
+ const e = (C = (_ = i.popup) == null ? void 0 : _.extraProps) == null ? void 0 : C.menuItems;
1853
+ if (!e)
1880
1854
  return null;
1881
- const commandService = useDependency(ICommandService), localeService = useDependency(LocaleService), [visible, setVisible] = useState(!1), [isHovered, setHovered] = useState(!1), handleMouseEnter = /* @__PURE__ */ __name(() => {
1882
- setHovered(!0);
1883
- }, "handleMouseEnter"), handleMouseLeave = /* @__PURE__ */ __name(() => {
1884
- setHovered(!1);
1885
- }, "handleMouseLeave"), onVisibleChange = /* @__PURE__ */ __name((visible2) => {
1886
- setVisible(visible2);
1887
- }, "onVisibleChange"), handleClick = /* @__PURE__ */ __name((item) => {
1888
- commandService.executeCommand(item.commandId, item.commandParams), setVisible(!1);
1889
- }, "handleClick"), showMore = visible || isHovered, availableMenu = menuItems.filter((item) => !item.disable);
1890
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
1855
+ const t = O(U), n = O(Q), [r, s] = W(!1), [o, a] = W(!1), c = () => {
1856
+ a(!0);
1857
+ }, g = () => {
1858
+ a(!1);
1859
+ }, l = (p) => {
1860
+ s(p);
1861
+ }, u = (p) => {
1862
+ t.executeCommand(p.commandId, p.commandParams), s(!1);
1863
+ }, h = r || o, v = e.filter((p) => !p.disable);
1864
+ return /* @__PURE__ */ d.jsx(
1891
1865
  "div",
1892
1866
  {
1893
- onMouseEnter: handleMouseEnter,
1894
- onMouseLeave: handleMouseLeave,
1895
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1896
- DropdownLegacy,
1867
+ onMouseEnter: c,
1868
+ onMouseLeave: g,
1869
+ children: /* @__PURE__ */ d.jsx(
1870
+ Vt,
1897
1871
  {
1898
1872
  placement: "bottomLeft",
1899
1873
  trigger: ["click"],
1900
- overlay: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$2.imagePopupMenu, children: availableMenu.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(
1874
+ overlay: /* @__PURE__ */ d.jsx("ul", { className: ge.imagePopupMenu, children: v.map((p) => /* @__PURE__ */ d.jsx(
1901
1875
  "li",
1902
1876
  {
1903
- onClick: /* @__PURE__ */ __name(() => handleClick(item), "onClick"),
1904
- className: styles$2.imagePopupMenuItem,
1905
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$2.imagePopupMenuItemTitle, children: localeService.t(item.label) })
1877
+ onClick: () => u(p),
1878
+ className: ge.imagePopupMenuItem,
1879
+ children: /* @__PURE__ */ d.jsx("span", { className: ge.imagePopupMenuItemTitle, children: n.t(p.label) })
1906
1880
  },
1907
- item.index
1881
+ p.index
1908
1882
  )) }),
1909
- visible,
1910
- onVisibleChange,
1911
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1883
+ visible: r,
1884
+ onVisibleChange: l,
1885
+ children: /* @__PURE__ */ d.jsxs(
1912
1886
  "div",
1913
1887
  {
1914
- className: clsx(styles$2.btnContainer, {
1915
- [styles$2.btnContainerExpand]: visible
1888
+ className: T(ge.btnContainer, {
1889
+ [ge.btnContainerExpand]: r
1916
1890
  }),
1917
1891
  children: [
1918
- /* @__PURE__ */ jsxRuntimeExports.jsx(
1919
- Autofill,
1892
+ /* @__PURE__ */ d.jsx(
1893
+ Ft,
1920
1894
  {
1921
1895
  style: { color: "#35322B" },
1922
1896
  extend: { colorChannel1: "rgb(var(--green-700, #409f11))" }
1923
1897
  }
1924
1898
  ),
1925
- showMore && /* @__PURE__ */ jsxRuntimeExports.jsx(MoreDownSingle, { style: { color: "#CCCCCC", fontSize: "8px", marginLeft: "8px" } })
1899
+ h && /* @__PURE__ */ d.jsx(qe, { style: { color: "#CCCCCC", fontSize: "8px", marginLeft: "8px" } })
1926
1900
  ]
1927
1901
  }
1928
1902
  )
@@ -1930,436 +1904,427 @@ const ActivateSlidePageOperation = {
1930
1904
  )
1931
1905
  }
1932
1906
  );
1933
- }, "SlideImagePopupMenu"), slideBar = "univer-slide-bar", slideBarContent = "univer-slide-bar-content", slideBarContentHeader = "univer-slide-bar-content-header", slideBarItem = "univer-slide-bar-item", slideBarBox = "univer-slide-bar-box", slideBarItemActive = "univer-slide-bar-item-active", slideAddButton = "univer-slide-add-button", styles$1 = {
1934
- slideBar,
1935
- slideBarContent,
1936
- slideBarContentHeader,
1937
- slideBarItem,
1938
- slideBarBox,
1939
- slideBarItemActive,
1940
- slideAddButton
1907
+ }, wr = "univer-slide-bar", Nr = "univer-slide-bar-content", Dr = "univer-slide-bar-content-header", Ur = "univer-slide-bar-item", Vr = "univer-slide-bar-box", Br = "univer-slide-bar-item-active", Lr = "univer-slide-add-button", ne = {
1908
+ slideBar: wr,
1909
+ slideBarContent: Nr,
1910
+ slideBarContentHeader: Dr,
1911
+ slideBarItem: Ur,
1912
+ slideBarBox: Vr,
1913
+ slideBarItemActive: Br,
1914
+ slideAddButton: Lr
1941
1915
  };
1942
- function SlideSideBar() {
1943
- var _a11, _b;
1944
- const univerInstanceService = useDependency(IUniverInstanceService), commandService = useDependency(ICommandService), renderManagerService = useDependency(IRenderManagerService), localeService = useDependency(LocaleService), slideBarRef = useRef(null), currentSlide = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE), pages = currentSlide == null ? void 0 : currentSlide.getPages(), pageOrder = currentSlide == null ? void 0 : currentSlide.getPageOrder();
1945
- if (!pages || !pageOrder)
1916
+ function Ar() {
1917
+ var C, p;
1918
+ const i = O(j), e = O(U), t = O(Y), n = O(Q), r = Ut(null), s = i.getCurrentUnitForType(x.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), a = s == null ? void 0 : s.getPageOrder();
1919
+ if (!o || !a)
1946
1920
  return null;
1947
- const slideList = pageOrder.map((id) => pages[id]), [divRefs, setDivRefs] = useState([]), [activatePageId, setActivatePageId] = useState((_b = (_a11 = currentSlide == null ? void 0 : currentSlide.getActivePage()) == null ? void 0 : _a11.id) != null ? _b : null);
1948
- useEffect(() => {
1949
- setDivRefs(slideList.map((_) => React.createRef()));
1950
- }, [slideList.length]), useEffect(() => {
1951
- const subscriber = currentSlide == null ? void 0 : currentSlide.activePage$.subscribe((page) => {
1952
- var _a12;
1953
- const id = (_a12 = page == null ? void 0 : page.id) != null ? _a12 : null;
1954
- id && setActivatePageId(id);
1921
+ const c = a.map((f) => o[f]), [g, l] = W([]), [u, h] = W((p = (C = s == null ? void 0 : s.getActivePage()) == null ? void 0 : C.id) != null ? p : null);
1922
+ oe(() => {
1923
+ l(c.map((f) => ke.createRef()));
1924
+ }, [c.length]), oe(() => {
1925
+ const f = s == null ? void 0 : s.activePage$.subscribe((I) => {
1926
+ var E;
1927
+ const b = (E = I == null ? void 0 : I.id) != null ? E : null;
1928
+ b && h(b);
1955
1929
  });
1956
1930
  return () => {
1957
- subscriber == null || subscriber.unsubscribe();
1931
+ f == null || f.unsubscribe();
1958
1932
  };
1959
- }, []), useEffect(() => {
1960
- divRefs.forEach((ref, index) => {
1961
- var _a12;
1962
- if (ref.current) {
1963
- const slide = slideList[index];
1964
- (_a12 = renderManagerService.getRenderById(slide.id)) == null || _a12.engine.setContainer(ref.current);
1933
+ }, []), oe(() => {
1934
+ g.forEach((f, I) => {
1935
+ var b;
1936
+ if (f.current) {
1937
+ const E = c[I];
1938
+ (b = t.getRenderById(E.id)) == null || b.engine.setContainer(f.current);
1965
1939
  }
1966
- }), divRefs.length > 0 && commandService.syncExecuteCommand(SetSlidePageThumbOperation.id, { unitId: currentSlide == null ? void 0 : currentSlide.getUnitId() });
1967
- }, [divRefs, slideList, renderManagerService, commandService, currentSlide]);
1968
- const activatePage = useCallback((page) => {
1969
- commandService.syncExecuteCommand(ActivateSlidePageOperation.id, { id: page, unitId: currentSlide == null ? void 0 : currentSlide.getUnitId() });
1970
- }, [commandService, currentSlide]), handleAppendSlide = useCallback(() => {
1971
- commandService.syncExecuteCommand(AppendSlideOperation.id, { unitId: currentSlide == null ? void 0 : currentSlide.getUnitId() });
1972
- }, [commandService, currentSlide]);
1973
- return /* @__PURE__ */ jsxRuntimeExports.jsx("aside", { className: styles$1.slideBar, ref: slideBarRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Scrollbar, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.slideBarContent, children: [
1974
- /* @__PURE__ */ jsxRuntimeExports.jsx("header", { className: styles$1.slideBarContentHeader, children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { onClick: handleAppendSlide, children: localeService.t("slide.append") }) }),
1975
- slideList.map((item, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
1940
+ }), g.length > 0 && e.syncExecuteCommand(tn.id, { unitId: s == null ? void 0 : s.getUnitId() });
1941
+ }, [g, c, t, e, s]);
1942
+ const v = ut((f) => {
1943
+ e.syncExecuteCommand(Jt.id, { id: f, unitId: s == null ? void 0 : s.getUnitId() });
1944
+ }, [e, s]), _ = ut(() => {
1945
+ e.syncExecuteCommand(Qt.id, { unitId: s == null ? void 0 : s.getUnitId() });
1946
+ }, [e, s]);
1947
+ return /* @__PURE__ */ d.jsx("aside", { className: ne.slideBar, ref: r, children: /* @__PURE__ */ d.jsx(Kn, { children: /* @__PURE__ */ d.jsxs("div", { className: ne.slideBarContent, children: [
1948
+ /* @__PURE__ */ d.jsx("header", { className: ne.slideBarContentHeader, children: /* @__PURE__ */ d.jsx("a", { onClick: _, children: n.t("slide.append") }) }),
1949
+ c.map((f, I) => /* @__PURE__ */ d.jsxs(
1976
1950
  "div",
1977
1951
  {
1978
- className: clsx(styles$1.slideBarItem, {
1979
- [styles$1.slideBarItemActive]: item.id === activatePageId
1952
+ className: T(ne.slideBarItem, {
1953
+ [ne.slideBarItemActive]: f.id === u
1980
1954
  }),
1981
- onClick: /* @__PURE__ */ __name(() => activatePage(item.id), "onClick"),
1955
+ onClick: () => v(f.id),
1982
1956
  children: [
1983
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: index + 1 }),
1984
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: divRefs[index], className: styles$1.slideBarBox })
1957
+ /* @__PURE__ */ d.jsx("span", { children: I + 1 }),
1958
+ /* @__PURE__ */ d.jsx("div", { ref: g[I], className: ne.slideBarBox })
1985
1959
  ]
1986
1960
  },
1987
- item.id
1961
+ f.id
1988
1962
  ))
1989
1963
  ] }) }) });
1990
1964
  }
1991
- __name(SlideSideBar, "SlideSideBar");
1992
- const slideEditorContainer = "univer-slide-editor-container", editorInput = "univer-editor-input", styles = {
1993
- slideEditorContainer,
1994
- editorInput
1995
- }, HIDDEN_EDITOR_POSITION = -1e3, EDITOR_DEFAULT_POSITION = {
1965
+ const $r = "univer-slide-editor-container", Hr = "univer-editor-input", Fr = {
1966
+ slideEditorContainer: $r,
1967
+ editorInput: Hr
1968
+ }, we = -1e3, Pt = {
1996
1969
  width: 0,
1997
1970
  height: 0,
1998
- top: HIDDEN_EDITOR_POSITION,
1999
- left: HIDDEN_EDITOR_POSITION
2000
- }, SlideEditorContainer = /* @__PURE__ */ __name(() => {
2001
- const [state, setState] = useState({
2002
- ...EDITOR_DEFAULT_POSITION
2003
- }), slideEditorManagerService = useDependency(ISlideEditorManagerService), editorService = useDependency(IEditorService), contextService = useDependency(IContextService), disableAutoFocus = useObservable(
2004
- () => contextService.subscribeContextValue$(DISABLE_AUTO_FOCUS_KEY),
1971
+ top: we,
1972
+ left: we
1973
+ }, zr = () => {
1974
+ const [i, e] = W({
1975
+ ...Pt
1976
+ }), t = O(et), n = O(Ze), r = O(Ce), s = Bn(
1977
+ () => r.subscribeContextValue$(lt),
2005
1978
  !1,
2006
1979
  void 0,
2007
- [contextService, DISABLE_AUTO_FOCUS_KEY]
1980
+ [r, lt]
2008
1981
  );
2009
- return `${DEFAULT_EMPTY_DOCUMENT_VALUE}`, DocumentFlavor.UNSPECIFIED, useEffect(() => {
2010
- slideEditorManagerService.state$.subscribe((param) => {
2011
- if (param == null)
1982
+ return `${Tt}`, En.UNSPECIFIED, oe(() => {
1983
+ t.state$.subscribe((o) => {
1984
+ if (o == null)
2012
1985
  return;
2013
1986
  const {
2014
- startX = HIDDEN_EDITOR_POSITION,
2015
- startY = HIDDEN_EDITOR_POSITION,
2016
- endX = 0,
2017
- endY = 0,
2018
- show = !1
2019
- } = param;
2020
- if (!show)
2021
- setState({
2022
- ...EDITOR_DEFAULT_POSITION
1987
+ startX: a = we,
1988
+ startY: c = we,
1989
+ endX: g = 0,
1990
+ endY: l = 0,
1991
+ show: u = !1
1992
+ } = o;
1993
+ if (!u)
1994
+ e({
1995
+ ...Pt
2023
1996
  });
2024
1997
  else {
2025
- setState({
2026
- width: endX - startX - FIX_ONE_PIXEL_BLUR_OFFSET + 2,
2027
- height: endY - startY - FIX_ONE_PIXEL_BLUR_OFFSET + 2,
2028
- left: startX + FIX_ONE_PIXEL_BLUR_OFFSET,
2029
- top: startY + FIX_ONE_PIXEL_BLUR_OFFSET
1998
+ e({
1999
+ width: g - a - re + 2,
2000
+ height: l - c - re + 2,
2001
+ left: a + re,
2002
+ top: c + re
2030
2003
  });
2031
- const editor = editorService.getEditor(SLIDE_EDITOR_ID);
2032
- if (editor == null)
2004
+ const h = n.getEditor(ae);
2005
+ if (h == null)
2033
2006
  return;
2034
- const { left, top, width, height } = editor.getBoundingClientRect();
2035
- slideEditorManagerService.setRect({ left, top, width, height });
2007
+ const { left: v, top: _, width: C, height: p } = h.getBoundingClientRect();
2008
+ t.setRect({ left: v, top: _, width: C, height: p });
2036
2009
  }
2037
2010
  });
2038
- }, []), useEffect(() => {
2039
- disableAutoFocus || slideEditorManagerService.setFocus(!0);
2040
- }, [disableAutoFocus, state]), /* @__PURE__ */ jsxRuntimeExports.jsx(
2011
+ }, []), oe(() => {
2012
+ s || t.setFocus(!0);
2013
+ }, [s, i]), /* @__PURE__ */ d.jsx(
2041
2014
  "div",
2042
2015
  {
2043
- className: styles.slideEditorContainer,
2016
+ className: Fr.slideEditorContainer,
2044
2017
  style: {
2045
- left: state.left,
2046
- top: state.top,
2047
- width: state.width,
2048
- height: state.height
2018
+ left: i.left,
2019
+ top: i.top,
2020
+ width: i.width,
2021
+ height: i.height
2049
2022
  }
2050
2023
  }
2051
2024
  );
2052
- }, "SlideEditorContainer"), IMAGE_UPLOAD_ICON = "addition-and-subtraction-single", SLIDES_IMAGE_MENU_ID = "slide.menu.image";
2053
- function SlideImageMenuFactory(accessor) {
2025
+ }, nn = "addition-and-subtraction-single", rn = "slide.menu.image";
2026
+ function Wr(i) {
2054
2027
  return {
2055
- id: SLIDES_IMAGE_MENU_ID,
2056
- type: MenuItemType.SUBITEMS,
2057
- icon: IMAGE_UPLOAD_ICON,
2028
+ id: rn,
2029
+ type: ve.SUBITEMS,
2030
+ icon: nn,
2058
2031
  tooltip: "slide.image.insert.title",
2059
- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SLIDE)
2032
+ hidden$: _e(i, x.UNIVER_SLIDE)
2060
2033
  };
2061
2034
  }
2062
- __name(SlideImageMenuFactory, "SlideImageMenuFactory");
2063
- function UploadSlideFloatImageMenuFactory(_accessor) {
2035
+ function Kr(i) {
2064
2036
  return {
2065
- id: InsertSlideFloatImageCommand.id,
2037
+ id: tt.id,
2066
2038
  title: "slide.image.insert.float",
2067
- type: MenuItemType.BUTTON,
2068
- hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SLIDE)
2039
+ type: ve.BUTTON,
2040
+ hidden$: _e(i, x.UNIVER_SLIDE)
2069
2041
  };
2070
2042
  }
2071
- __name(UploadSlideFloatImageMenuFactory, "UploadSlideFloatImageMenuFactory");
2072
- const GRAPH_SINGLE_ICON = "graph-single", SHAPE_MENU_ID = "slide.menu.shape";
2073
- function SlideShapeMenuFactory(accessor) {
2043
+ const sn = "graph-single", on = "slide.menu.shape";
2044
+ function Gr(i) {
2074
2045
  return {
2075
- id: SHAPE_MENU_ID,
2076
- type: MenuItemType.SUBITEMS,
2077
- icon: GRAPH_SINGLE_ICON,
2046
+ id: on,
2047
+ type: ve.SUBITEMS,
2048
+ icon: sn,
2078
2049
  tooltip: "slide.shape.insert.title",
2079
- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SLIDE)
2050
+ hidden$: _e(i, x.UNIVER_SLIDE)
2080
2051
  // disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
2081
2052
  };
2082
2053
  }
2083
- __name(SlideShapeMenuFactory, "SlideShapeMenuFactory");
2084
- function UploadSlideFloatShapeMenuFactory(_accessor) {
2054
+ function Xr(i) {
2085
2055
  return {
2086
- id: InsertSlideShapeRectangleCommand.id,
2056
+ id: Je.id,
2087
2057
  title: "slide.shape.insert.rectangle",
2088
- type: MenuItemType.BUTTON,
2089
- hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SLIDE)
2058
+ type: ve.BUTTON,
2059
+ hidden$: _e(i, x.UNIVER_SLIDE)
2090
2060
  };
2091
2061
  }
2092
- __name(UploadSlideFloatShapeMenuFactory, "UploadSlideFloatShapeMenuFactory");
2093
- const TEXT_ICON_ID = "text-single";
2094
- function SlideAddTextMenuItemFactory(_accessor) {
2062
+ const an = "text-single";
2063
+ function Yr(i) {
2095
2064
  return {
2096
- id: SlideAddTextCommand.id,
2097
- type: MenuItemType.BUTTON,
2098
- icon: TEXT_ICON_ID,
2065
+ id: nt.id,
2066
+ type: ve.BUTTON,
2067
+ icon: an,
2099
2068
  tooltip: "slide.text.insert.title",
2100
- hidden$: getMenuHiddenObservable(_accessor, UniverInstanceType.UNIVER_SLIDE)
2069
+ hidden$: _e(i, x.UNIVER_SLIDE)
2101
2070
  };
2102
2071
  }
2103
- __name(SlideAddTextMenuItemFactory, "SlideAddTextMenuItemFactory");
2104
- const menuSchema = {
2105
- [RibbonStartGroup.FORMAT]: {
2106
- [SlideAddTextCommand.id]: {
2072
+ const kr = {
2073
+ [Ln.FORMAT]: {
2074
+ [nt.id]: {
2107
2075
  order: 0,
2108
- menuItemFactory: SlideAddTextMenuItemFactory
2076
+ menuItemFactory: Yr
2109
2077
  },
2110
- [SLIDES_IMAGE_MENU_ID]: {
2078
+ [rn]: {
2111
2079
  order: 0,
2112
- menuItemFactory: SlideImageMenuFactory,
2113
- [InsertSlideFloatImageCommand.id]: {
2080
+ menuItemFactory: Wr,
2081
+ [tt.id]: {
2114
2082
  order: 0,
2115
- menuItemFactory: UploadSlideFloatImageMenuFactory
2083
+ menuItemFactory: Kr
2116
2084
  }
2117
2085
  },
2118
- [SHAPE_MENU_ID]: {
2086
+ [on]: {
2119
2087
  order: 0,
2120
- menuItemFactory: SlideShapeMenuFactory,
2121
- [InsertSlideShapeRectangleCommand.id]: {
2088
+ menuItemFactory: Gr,
2089
+ [Je.id]: {
2122
2090
  order: 0,
2123
- menuItemFactory: UploadSlideFloatShapeMenuFactory
2091
+ menuItemFactory: Xr
2124
2092
  }
2125
2093
  }
2126
2094
  }
2127
2095
  };
2128
- function whenEditorActivated(contextService) {
2129
- return contextService.getContextValue(FOCUSING_UNIVER_EDITOR) && contextService.getContextValue(EDITOR_ACTIVATED);
2096
+ function Ke(i) {
2097
+ return i.getContextValue(Mt) && i.getContextValue(Oe);
2130
2098
  }
2131
- __name(whenEditorActivated, "whenEditorActivated");
2132
- function whenFormulaEditorFocused(contextService) {
2133
- return contextService.getContextValue(FORMULA_EDITOR_ACTIVATED) && contextService.getContextValue(FOCUSING_UNIVER_EDITOR);
2099
+ function Zr(i) {
2100
+ return i.getContextValue(Rn) && i.getContextValue(Mt);
2134
2101
  }
2135
- __name(whenFormulaEditorFocused, "whenFormulaEditorFocused");
2136
- const ARROW_SELECTION_KEYCODE_LIST = [
2137
- KeyCode.ARROW_DOWN,
2138
- KeyCode.ARROW_UP,
2139
- KeyCode.ARROW_LEFT,
2140
- KeyCode.ARROW_RIGHT
2102
+ const cn = [
2103
+ y.ARROW_DOWN,
2104
+ y.ARROW_UP,
2105
+ y.ARROW_LEFT,
2106
+ y.ARROW_RIGHT
2141
2107
  ];
2142
- [KeyCode.ENTER, KeyCode.TAB, ...ARROW_SELECTION_KEYCODE_LIST];
2143
- function generateArrowSelectionShortCutItem() {
2144
- const shortcutList = [];
2145
- for (const keycode of ARROW_SELECTION_KEYCODE_LIST)
2146
- shortcutList.push({
2147
- id: SetTextEditArrowOperation.id,
2148
- binding: keycode,
2149
- preconditions: /* @__PURE__ */ __name((contextService) => whenEditorActivated(contextService), "preconditions"),
2108
+ [y.ENTER, y.TAB, ...cn];
2109
+ function qr() {
2110
+ const i = [];
2111
+ for (const e of cn)
2112
+ i.push({
2113
+ id: Me.id,
2114
+ binding: e,
2115
+ preconditions: (t) => Ke(t),
2150
2116
  staticParameters: {
2151
2117
  visible: !1,
2152
- eventType: DeviceInputEventType.Keyboard,
2153
- keycode,
2118
+ eventType: q.Keyboard,
2119
+ keycode: e,
2154
2120
  isShift: !1
2155
2121
  }
2156
- }), shortcutList.push({
2157
- id: SetTextEditArrowOperation.id,
2158
- binding: keycode | MetaKeys.SHIFT,
2159
- preconditions: /* @__PURE__ */ __name((contextService) => whenEditorActivated(contextService), "preconditions"),
2122
+ }), i.push({
2123
+ id: Me.id,
2124
+ binding: e | An.SHIFT,
2125
+ preconditions: (t) => Ke(t),
2160
2126
  staticParameters: {
2161
2127
  visible: !1,
2162
- eventType: DeviceInputEventType.Keyboard,
2163
- keycode,
2128
+ eventType: q.Keyboard,
2129
+ keycode: e,
2164
2130
  isShift: !0
2165
2131
  }
2166
2132
  });
2167
- return shortcutList;
2133
+ return i;
2168
2134
  }
2169
- __name(generateArrowSelectionShortCutItem, "generateArrowSelectionShortCutItem");
2170
- const EditorDeleteLeftShortcut = {
2171
- id: DeleteLeftCommand.id,
2172
- preconditions: /* @__PURE__ */ __name((contextService) => whenEditorActivated(contextService) || whenFormulaEditorFocused(contextService), "preconditions"),
2173
- binding: KeyCode.BACKSPACE
2135
+ const Jr = {
2136
+ id: Qn.id,
2137
+ preconditions: (i) => Ke(i) || Zr(i),
2138
+ binding: y.BACKSPACE
2174
2139
  };
2175
- var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2176
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2177
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2178
- return kind && result && __defProp$2(target, key, result), result;
2179
- }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a8;
2180
- let SlidesUIController = (_a8 = class extends Disposable {
2181
- constructor(_injector, _menuManagerService, _componentManager, _uiPartsService, _commandService, _shortcutService) {
2182
- super(), this._injector = _injector, this._menuManagerService = _menuManagerService, this._componentManager = _componentManager, this._uiPartsService = _uiPartsService, this._commandService = _commandService, this._shortcutService = _shortcutService, this._initCommands(), this._initCustomComponents(), this._initUIComponents(), this._initMenus(), this._initShortcuts();
2140
+ var Qr = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (i, e, t, n) => {
2141
+ for (var r = n > 1 ? void 0 : n ? es(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2142
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
2143
+ return n && r && Qr(e, t, r), r;
2144
+ }, ie = (i, e) => (t, n) => e(t, n, i);
2145
+ let Ne = class extends Ue {
2146
+ constructor(i, e, t, n, r, s) {
2147
+ 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();
2183
2148
  }
2184
2149
  _initMenus() {
2185
- this._menuManagerService.mergeMenu(menuSchema);
2150
+ this._menuManagerService.mergeMenu(kr);
2186
2151
  }
2187
2152
  _initCustomComponents() {
2188
- const componentManager = this._componentManager;
2189
- this.disposeWithMe(componentManager.register(IMAGE_UPLOAD_ICON, AddImageSingle)), this.disposeWithMe(componentManager.register(TEXT_ICON_ID, TextSingle)), this.disposeWithMe(componentManager.register(GRAPH_SINGLE_ICON, GraphSingle)), this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_IMAGE_POPUP_MENU, SlideImagePopupMenu)), this.disposeWithMe(componentManager.register(COMPONENT_SLIDE_SIDEBAR, RectSidebar));
2153
+ const i = this._componentManager;
2154
+ this.disposeWithMe(i.register(nn, Ht)), this.disposeWithMe(i.register(an, Yt)), this.disposeWithMe(i.register(sn, Wt)), this.disposeWithMe(i.register(qt, Mr)), this.disposeWithMe(i.register(Re, rr));
2190
2155
  }
2191
2156
  _initCommands() {
2192
2157
  [
2193
- AppendSlideOperation,
2194
- ActivateSlidePageOperation,
2195
- SetSlidePageThumbOperation,
2196
- InsertSlideFloatImageCommand,
2197
- SlideAddTextOperation,
2198
- SlideAddTextCommand,
2199
- InsertSlideShapeRectangleOperation,
2200
- InsertSlideShapeRectangleCommand,
2201
- ToggleSlideEditSidebarOperation,
2202
- DeleteSlideElementOperation,
2203
- UpdateSlideElementOperation,
2158
+ Qt,
2159
+ Jt,
2160
+ tn,
2161
+ tt,
2162
+ en,
2163
+ nt,
2164
+ Zt,
2165
+ Je,
2166
+ He,
2167
+ Lt,
2168
+ K,
2204
2169
  // commands for editor
2205
- SetTextEditArrowOperation
2206
- ].forEach((command) => this.disposeWithMe(this._commandService.registerCommand(command)));
2170
+ Me
2171
+ ].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
2207
2172
  }
2208
2173
  _initUIComponents() {
2209
2174
  this.disposeWithMe(
2210
- this._uiPartsService.registerComponent(BuiltInUIPart.LEFT_SIDEBAR, () => connectInjector(SlideSideBar, this._injector))
2175
+ this._uiPartsService.registerComponent(dt.LEFT_SIDEBAR, () => rt(Ar, this._injector))
2211
2176
  ), this.disposeWithMe(
2212
- this._uiPartsService.registerComponent(BuiltInUIPart.CONTENT, () => connectInjector(SlideEditorContainer, this._injector))
2177
+ this._uiPartsService.registerComponent(dt.CONTENT, () => rt(zr, this._injector))
2213
2178
  );
2214
2179
  }
2215
2180
  _initShortcuts() {
2216
2181
  [
2217
- EditorDeleteLeftShortcut,
2218
- ...generateArrowSelectionShortCutItem()
2219
- ].forEach((item) => {
2220
- this.disposeWithMe(this._shortcutService.registerShortcut(item));
2182
+ Jr,
2183
+ ...qr()
2184
+ ].forEach((i) => {
2185
+ this.disposeWithMe(this._shortcutService.registerShortcut(i));
2221
2186
  });
2222
2187
  }
2223
- }, __name(_a8, "SlidesUIController"), _a8);
2224
- SlidesUIController = __decorateClass$2([
2225
- __decorateParam$2(0, Inject(Injector)),
2226
- __decorateParam$2(1, IMenuManagerService),
2227
- __decorateParam$2(2, Inject(ComponentManager)),
2228
- __decorateParam$2(3, IUIPartsService),
2229
- __decorateParam$2(4, ICommandService),
2230
- __decorateParam$2(5, IShortcutService)
2231
- ], SlidesUIController);
2232
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2233
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2234
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2235
- return kind && result && __defProp$1(target, key, result), result;
2236
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a9;
2237
- let SlideRenderService = (_a9 = class extends RxDisposable {
2188
+ };
2189
+ Ne = ts([
2190
+ ie(0, X(Ge)),
2191
+ ie(1, Hn),
2192
+ ie(2, X($n)),
2193
+ ie(3, Fn),
2194
+ ie(4, U),
2195
+ ie(5, zn)
2196
+ ], Ne);
2197
+ var ns = Object.defineProperty, is = Object.getOwnPropertyDescriptor, rs = (i, e, t, n) => {
2198
+ for (var r = n > 1 ? void 0 : n ? is(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2199
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
2200
+ return n && r && ns(e, t, r), r;
2201
+ }, $e = (i, e) => (t, n) => e(t, n, i);
2202
+ let De = class extends fe {
2238
2203
  // private _skeletonChangeMutations = new Set<string>();
2239
- constructor(_contextService, _instanceSrv, _renderManagerService) {
2240
- super(), this._contextService = _contextService, this._instanceSrv = _instanceSrv, this._renderManagerService = _renderManagerService, Promise.resolve().then(() => this._init());
2204
+ constructor(i, e, t) {
2205
+ super(), this._contextService = i, this._instanceSrv = e, this._renderManagerService = t, Promise.resolve().then(() => this._init());
2241
2206
  }
2242
2207
  _init() {
2243
2208
  this._initSlideDataListener(), this._initContextListener();
2244
2209
  }
2245
2210
  _initSlideDataListener() {
2246
- this._instanceSrv.getTypeOfUnitAdded$(UniverInstanceType.UNIVER_SLIDE).pipe(takeUntil(this.dispose$)).subscribe((slideModel) => {
2247
- this._createRenderer(slideModel == null ? void 0 : slideModel.getUnitId());
2248
- }), this._instanceSrv.getAllUnitsForType(UniverInstanceType.UNIVER_SLIDE).forEach((slideModel) => {
2249
- this._createRenderer(slideModel.getUnitId());
2250
- }), this._instanceSrv.getTypeOfUnitDisposed$(UniverInstanceType.UNIVER_SLIDE).pipe(takeUntil(this.dispose$)).subscribe((workbook) => this._disposeRenderer(workbook));
2211
+ this._instanceSrv.getTypeOfUnitAdded$(x.UNIVER_SLIDE).pipe(mt(this.dispose$)).subscribe((i) => {
2212
+ this._createRenderer(i == null ? void 0 : i.getUnitId());
2213
+ }), this._instanceSrv.getAllUnitsForType(x.UNIVER_SLIDE).forEach((i) => {
2214
+ this._createRenderer(i.getUnitId());
2215
+ }), this._instanceSrv.getTypeOfUnitDisposed$(x.UNIVER_SLIDE).pipe(mt(this.dispose$)).subscribe((i) => this._disposeRenderer(i));
2251
2216
  }
2252
- _createRenderer(unitId) {
2253
- unitId == null || this._instanceSrv.getUnit(unitId, UniverInstanceType.UNIVER_SLIDE) == null || (this._renderManagerService.createRender(unitId), this._renderManagerService.setCurrent(unitId));
2217
+ _createRenderer(i) {
2218
+ i == null || this._instanceSrv.getUnit(i, x.UNIVER_SLIDE) == null || (this._renderManagerService.createRender(i), this._renderManagerService.setCurrent(i));
2254
2219
  }
2255
- _disposeRenderer(workbook) {
2256
- const unitId = workbook.getUnitId();
2257
- this._renderManagerService.removeRender(unitId);
2220
+ _disposeRenderer(i) {
2221
+ const e = i.getUnitId();
2222
+ this._renderManagerService.removeRender(e);
2258
2223
  }
2259
2224
  _initContextListener() {
2260
2225
  }
2261
- }, __name(_a9, "SlideRenderService"), _a9);
2262
- SlideRenderService = __decorateClass$1([
2263
- __decorateParam$1(0, IContextService),
2264
- __decorateParam$1(1, IUniverInstanceService),
2265
- __decorateParam$1(2, IRenderManagerService)
2266
- ], SlideRenderService);
2267
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
2268
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
2269
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
2270
- return kind && result && __defProp2(target, key, result), result;
2271
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam");
2272
- const SLIDE_UI_PLUGIN_NAME = "SLIDE_UI";
2273
- var _a10;
2274
- let UniverSlidesUIPlugin = (_a10 = class extends Plugin {
2275
- constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _univerInstanceService, _configService) {
2276
- super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._univerInstanceService = _univerInstanceService, this._configService = _configService;
2277
- const { menu, ...rest } = merge(
2226
+ };
2227
+ De = rs([
2228
+ $e(0, Ce),
2229
+ $e(1, j),
2230
+ $e(2, Y)
2231
+ ], De);
2232
+ var ss = Object.defineProperty, os = Object.getOwnPropertyDescriptor, as = (i, e, t, n) => {
2233
+ for (var r = n > 1 ? void 0 : n ? os(e, t) : e, s = i.length - 1, o; s >= 0; s--)
2234
+ (o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
2235
+ return n && r && ss(e, t, r), r;
2236
+ }, xe = (i, e) => (t, n) => e(t, n, i);
2237
+ const cs = "SLIDE_UI";
2238
+ var Ee;
2239
+ let bt = (Ee = class extends On {
2240
+ constructor(i = ft, e, t, n, r) {
2241
+ super(), this._config = i, this._injector = e, this._renderManagerService = t, this._univerInstanceService = n, this._configService = r;
2242
+ const { menu: s, ...o } = jn(
2278
2243
  {},
2279
- defaultPluginConfig,
2244
+ ft,
2280
2245
  this._config
2281
2246
  );
2282
- menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(SLIDES_UI_PLUGIN_CONFIG_KEY, rest);
2247
+ s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(di, o);
2283
2248
  }
2284
2249
  onStarting() {
2285
- mergeOverrideWithDependencies([
2286
- [SlideRenderService],
2287
- [ISlideEditorBridgeService, { useClass: SlideEditorBridgeService }],
2250
+ st([
2251
+ [De],
2252
+ [Qe, { useClass: Fe }],
2288
2253
  // used by SlideUIController --> EditorContainer
2289
- [ISlideEditorManagerService, { useClass: SlideEditorManagerService }],
2290
- [SlideCanvasPopMangerService]
2291
- ], this._config.override).forEach((d) => this._injector.add(d));
2254
+ [et, { useClass: pr }],
2255
+ [ye]
2256
+ ], this._config.override).forEach((i) => this._injector.add(i));
2292
2257
  }
2293
2258
  onReady() {
2294
2259
  [
2295
2260
  // SlideRenderService will be init in ready stage, and then calling RenderManagerService@createRender --> init all deps in this rendering register block.
2296
- [SlideRenderController]
2297
- ].forEach((m) => {
2298
- this.disposeWithMe(this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SLIDE, m));
2299
- }), mergeOverrideWithDependencies([
2300
- [CanvasView],
2261
+ [pe]
2262
+ ].forEach((i) => {
2263
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(x.UNIVER_SLIDE, i));
2264
+ }), st([
2265
+ [M],
2301
2266
  // cannot register in _renderManagerService now.
2302
2267
  // [ISlideEditorBridgeService, { useClass: SlideEditorBridgeService }],
2303
2268
  // // used by SlideUIController --> EditorContainer
2304
2269
  // [ISlideEditorManagerService, { useClass: SlideEditorManagerService }],
2305
2270
  // SlidesUIController controller should be registered in Ready stage.
2306
2271
  // SlidesUIController controller would add a new RenderUnit (__INTERNAL_EDITOR__DOCS_NORMAL)
2307
- [SlidesUIController],
2272
+ [Ne],
2308
2273
  // editor service was create in renderManagerService
2309
- [SlideRenderController],
2310
- [SlidePopupMenuController]
2311
- ], this._config.override).forEach((m) => {
2312
- this._injector.add(m);
2313
- }), this._injector.get(CanvasView), this._injector.get(SlideRenderService);
2274
+ [pe],
2275
+ [Te]
2276
+ ], this._config.override).forEach((i) => {
2277
+ this._injector.add(i);
2278
+ }), this._injector.get(M), this._injector.get(De);
2314
2279
  }
2315
2280
  onRendered() {
2316
2281
  [
2317
2282
  // need slideEditorBridgeService
2318
2283
  // need TextSelectionRenderService which init by EditorContainer
2319
- [SlideEditorBridgeRenderController],
2320
- [SlideEditingRenderController]
2321
- ].forEach((m) => {
2322
- this.disposeWithMe(this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SLIDE, m));
2323
- }), this._markSlideAsFocused(), this._injector.get(SlidesUIController);
2284
+ [We],
2285
+ [ze]
2286
+ ].forEach((i) => {
2287
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(x.UNIVER_SLIDE, i));
2288
+ }), this._markSlideAsFocused(), this._injector.get(Ne);
2324
2289
  }
2325
2290
  onSteady() {
2326
- this._injector.get(SlidePopupMenuController);
2291
+ this._injector.get(Te);
2327
2292
  }
2328
2293
  _markSlideAsFocused() {
2329
- const currentService = this._univerInstanceService;
2294
+ const i = this._univerInstanceService;
2330
2295
  try {
2331
- const slideDataModel = currentService.getCurrentUnitForType(UniverInstanceType.UNIVER_SLIDE);
2332
- currentService.focusUnit(slideDataModel.getUnitId());
2296
+ const e = i.getCurrentUnitForType(x.UNIVER_SLIDE);
2297
+ i.focusUnit(e.getUnitId());
2333
2298
  } catch {
2334
2299
  }
2335
2300
  }
2336
- }, __name(_a10, "UniverSlidesUIPlugin"), __publicField(_a10, "pluginName", SLIDE_UI_PLUGIN_NAME), __publicField(_a10, "type", UniverInstanceType.UNIVER_SLIDE), _a10);
2337
- UniverSlidesUIPlugin = __decorateClass([
2338
- __decorateParam(1, Inject(Injector)),
2339
- __decorateParam(2, IRenderManagerService),
2340
- __decorateParam(3, IUniverInstanceService),
2341
- __decorateParam(4, IConfigService)
2342
- ], UniverSlidesUIPlugin);
2301
+ }, P(Ee, "pluginName", cs), P(Ee, "type", x.UNIVER_SLIDE), Ee);
2302
+ bt = as([
2303
+ xe(1, X(Ge)),
2304
+ xe(2, Y),
2305
+ xe(3, j),
2306
+ xe(4, yn)
2307
+ ], bt);
2343
2308
  export {
2344
- ActivateSlidePageOperation,
2345
- AppendSlideOperation,
2346
- CanvasView,
2347
- DeleteSlideElementOperation,
2348
- ISlideEditorBridgeService,
2349
- InsertSlideFloatImageCommand,
2350
- InsertSlideShapeRectangleCommand,
2351
- InsertSlideShapeRectangleOperation,
2352
- SHAPE_MENU_ID,
2353
- SLIDES_IMAGE_MENU_ID,
2354
- SLIDE_EDITOR_ID,
2355
- SetSlidePageThumbOperation,
2356
- SlideAddTextCommand,
2357
- SlideAddTextOperation,
2358
- SlideCanvasPopMangerService,
2359
- SlideEditorContainer,
2360
- SlideSideBar,
2361
- SlidesUIController,
2362
- menuSchema as SlidesUIMenuSchema,
2363
- UniverSlidesUIPlugin,
2364
- UpdateSlideElementOperation
2309
+ Jt as ActivateSlidePageOperation,
2310
+ Qt as AppendSlideOperation,
2311
+ M as CanvasView,
2312
+ Lt as DeleteSlideElementOperation,
2313
+ Qe as ISlideEditorBridgeService,
2314
+ tt as InsertSlideFloatImageCommand,
2315
+ Je as InsertSlideShapeRectangleCommand,
2316
+ Zt as InsertSlideShapeRectangleOperation,
2317
+ on as SHAPE_MENU_ID,
2318
+ rn as SLIDES_IMAGE_MENU_ID,
2319
+ ae as SLIDE_EDITOR_ID,
2320
+ tn as SetSlidePageThumbOperation,
2321
+ nt as SlideAddTextCommand,
2322
+ en as SlideAddTextOperation,
2323
+ ye as SlideCanvasPopMangerService,
2324
+ zr as SlideEditorContainer,
2325
+ Ar as SlideSideBar,
2326
+ Ne as SlidesUIController,
2327
+ kr as SlidesUIMenuSchema,
2328
+ bt as UniverSlidesUIPlugin,
2329
+ K as UpdateSlideElementOperation
2365
2330
  };