@univerjs/slides-ui 0.7.0-nightly.202505071607 → 0.7.0-nightly.202505091607
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/cjs/index.js +13 -25
- package/lib/es/index.js +552 -564
- package/lib/index.css +1 -1
- package/lib/index.js +552 -564
- package/lib/umd/index.js +13 -25
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (n, e, t) =>
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { IRenderManagerService as
|
|
6
|
-
import { ObjectProvider as
|
|
7
|
-
import { useDependency as
|
|
1
|
+
var ai = Object.defineProperty;
|
|
2
|
+
var ci = (n, e, t) => e in n ? ai(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var S = (n, e, t) => ci(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Inject as X, Injector as ze, IUniverInstanceService as y, RxDisposable as ve, UniverInstanceType as E, debounce as li, getColorStyle as di, CommandType as D, Tools as ui, LocaleService as Q, ICommandService as U, generateRandomId as Ct, BasicShapes as hi, PageElementType as ke, Disposable as De, DisposableCollection as Ke, IContextService as fe, toDisposable as St, FOCUSING_COMMON_DRAWINGS as gi, createInternalEditorID as vi, createIdentifier as It, EDITOR_ACTIVATED as Re, FOCUSING_EDITOR_STANDALONE as bt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Et, DocumentDataModel as fi, HorizontalAlign as Ot, VerticalAlign as xe, IUndoRedoService as mi, WrapStrategy as et, FOCUSING_EDITOR_BUT_HIDDEN as pi, DEFAULT_EMPTY_DOCUMENT_VALUE as _i, Direction as j, DocumentFlavor as Ci, FOCUSING_UNIVER_EDITOR as Rt, FORMULA_EDITOR_ACTIVATED as Si, Plugin as Ii, merge as bi, mergeOverrideWithDependencies as tt, IConfigService as Ei } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as G, Viewport as it, ScrollBar as xt, getCurrentTypeOfRenderer as Ae, Slide as Oi, Rect as yt, Scene as Ri, ObjectType as le, pxToNum as xi, DeviceInputEventType as q, convertTextRotation as nt, FIX_ONE_PIXEL_BLUR_OFFSET as ne, fixLineWidthByScale as rt } from "@univerjs/engine-render";
|
|
6
|
+
import { ObjectProvider as yi, SLIDE_KEY as re } from "@univerjs/slides";
|
|
7
|
+
import { useDependency as x, ISidebarService as Pt, ICanvasPopupService as Pi, ILayoutService as wi, KeyCode as P, ILocalFileService as Ti, useObservable as Mi, DISABLE_AUTO_FOCUS_KEY as st, getMenuHiddenObservable as me, MenuItemType as pe, RibbonStartGroup as Ni, MetaKeys as Di, IMenuManagerService as Ui, ComponentManager as Vi, IUIPartsService as ji, IShortcutService as Li, BuiltInUIPart as ot, connectInjector as at } from "@univerjs/ui";
|
|
8
8
|
import { jsxs as O, jsx as u } from "react/jsx-runtime";
|
|
9
|
-
import { Button as
|
|
10
|
-
import
|
|
11
|
-
import { BehaviorSubject as
|
|
12
|
-
import { DocSelectionManagerService as
|
|
13
|
-
import { IEditorService as
|
|
14
|
-
import { DRAWING_IMAGE_ALLOW_IMAGE_LIST as
|
|
15
|
-
var
|
|
16
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
9
|
+
import { Button as Se, clsx as K, Dropdown as wt, ColorPicker as Ai, borderTopClassName as Tt, InputNumber as ce, borderClassName as ue, scrollbarClassName as Bi } from "@univerjs/design";
|
|
10
|
+
import $i, { forwardRef as A, useRef as Mt, createElement as B, useState as k, useEffect as he, useMemo as Hi, createRef as Fi, useCallback as ct } from "react";
|
|
11
|
+
import { BehaviorSubject as J, Subject as Nt, filter as Wi, takeUntil as lt } from "rxjs";
|
|
12
|
+
import { DocSelectionManagerService as zi, DocSkeletonManagerService as dt, RichTextEditingMutation as ki } from "@univerjs/docs";
|
|
13
|
+
import { IEditorService as Xe, DocSelectionRenderService as ut, VIEWPORT_KEY as ht, DOCS_COMPONENT_MAIN_LAYER_INDEX as Ki, MoveSelectionOperation as Xi, MoveCursorOperation as Gi, DOCS_VIEW_KEY as Yi, DeleteLeftCommand as Zi } from "@univerjs/docs-ui";
|
|
14
|
+
import { DRAWING_IMAGE_ALLOW_IMAGE_LIST as qi, IImageIoService as Ji, getImageSize as Qi } from "@univerjs/drawing";
|
|
15
|
+
var en = Object.getOwnPropertyDescriptor, tn = (n, e, t, i) => {
|
|
16
|
+
for (var r = i > 1 ? void 0 : i ? en(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
17
17
|
(o = n[s]) && (r = o(r) || r);
|
|
18
18
|
return r;
|
|
19
|
-
},
|
|
20
|
-
let
|
|
19
|
+
}, Ue = (n, e) => (t, i) => e(t, i, n);
|
|
20
|
+
let ge = class extends ve {
|
|
21
21
|
constructor(e, t, i, r) {
|
|
22
22
|
super();
|
|
23
23
|
S(this, "_objectProvider", null);
|
|
24
|
-
S(this, "_refreshThumb",
|
|
24
|
+
S(this, "_refreshThumb", li(() => {
|
|
25
25
|
this.createThumbs();
|
|
26
26
|
}, 300));
|
|
27
|
-
this._renderContext = e, this._injector = t, this._univerInstanceService = i, this._renderManagerService = r, this._objectProvider = this._injector.createInstance(
|
|
27
|
+
this._renderContext = e, this._injector = t, this._univerInstanceService = i, this._renderManagerService = r, this._objectProvider = this._injector.createInstance(yi), this._addNewRender();
|
|
28
28
|
}
|
|
29
29
|
_addNewRender() {
|
|
30
30
|
const { unitId: e, engine: t, scene: i } = this._renderContext, r = this._getCurrUnitModel();
|
|
@@ -37,7 +37,7 @@ let ue = class extends he {
|
|
|
37
37
|
this.createThumbs();
|
|
38
38
|
}, 300);
|
|
39
39
|
});
|
|
40
|
-
const o = new
|
|
40
|
+
const o = new it(re.VIEW, i, {
|
|
41
41
|
left: 0,
|
|
42
42
|
top: 0,
|
|
43
43
|
bottom: 0,
|
|
@@ -50,8 +50,8 @@ let ue = class extends he {
|
|
|
50
50
|
const l = c;
|
|
51
51
|
if (l.ctrlKey) {
|
|
52
52
|
const d = Math.abs(l.deltaX);
|
|
53
|
-
let
|
|
54
|
-
|
|
53
|
+
let v = d < 40 ? 0.2 : d < 80 ? 0.4 : 0.2;
|
|
54
|
+
v *= l.deltaY > 0 ? -1 : 1, i.scaleX < 1 && (v /= 2), i.scaleX + v > 4 ? i.scale(4, 4) : i.scaleX + v < 0.1 ? i.scale(0.1, 0.1) : (l.deltaY > 0, l.preventDefault());
|
|
55
55
|
} else
|
|
56
56
|
o.onMouseWheel(l, h);
|
|
57
57
|
}), i.onFileLoaded$.subscribeEvent(() => {
|
|
@@ -64,7 +64,7 @@ let ue = class extends he {
|
|
|
64
64
|
}
|
|
65
65
|
_scrollToCenter() {
|
|
66
66
|
var c;
|
|
67
|
-
const e = (c = this._currentRender()) == null ? void 0 : c.scene, t = e == null ? void 0 : e.getViewport(
|
|
67
|
+
const e = (c = this._currentRender()) == null ? void 0 : c.scene, t = e == null ? void 0 : e.getViewport(re.VIEW), i = this._getCenterPositionViewPort(e);
|
|
68
68
|
if (!t || !i) return;
|
|
69
69
|
const { left: r, top: s } = i, { x: o, y: a } = t.transViewportScroll2ScrollValue(r, s);
|
|
70
70
|
t.scrollToBarPos({
|
|
@@ -73,13 +73,13 @@ let ue = class extends he {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
_currentRender() {
|
|
76
|
-
return
|
|
76
|
+
return Ae(E.UNIVER_SLIDE, this._univerInstanceService, this._renderManagerService);
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* @param mainScene
|
|
80
80
|
*/
|
|
81
81
|
_createSlide(e) {
|
|
82
|
-
const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), { width: i, height: r } = e, s = t.getPageSize(), { width: o = 100, height: a = 100 } = s, c = new
|
|
82
|
+
const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), { width: i, height: r } = e, s = t.getPageSize(), { width: o = 100, height: a = 100 } = s, c = new Oi(re.COMPONENT, {
|
|
83
83
|
left: (i - o) / 2,
|
|
84
84
|
top: (r - a) / 2,
|
|
85
85
|
width: o,
|
|
@@ -89,14 +89,14 @@ let ue = class extends he {
|
|
|
89
89
|
return c.enableSelectedClipElement(), e.addObject(c), c;
|
|
90
90
|
}
|
|
91
91
|
_addBackgroundRect(e, t) {
|
|
92
|
-
const r = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: o = 0 } = r, a = new
|
|
92
|
+
const r = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: o = 0 } = r, a = new yt("canvas", {
|
|
93
93
|
left: 0,
|
|
94
94
|
top: 0,
|
|
95
95
|
width: s,
|
|
96
96
|
height: o,
|
|
97
97
|
strokeWidth: 1,
|
|
98
98
|
stroke: "rgba(198,198,198,1)",
|
|
99
|
-
fill:
|
|
99
|
+
fill: di(t) || "rgba(255,255,255,1)",
|
|
100
100
|
zIndex: 0,
|
|
101
101
|
evented: !1
|
|
102
102
|
});
|
|
@@ -183,11 +183,11 @@ let ue = class extends he {
|
|
|
183
183
|
const i = this._renderContext;
|
|
184
184
|
if (!i || !this._objectProvider)
|
|
185
185
|
return;
|
|
186
|
-
const { scene: r, mainComponent: s } = i, o = s, { width: a, height: c } = o, h = new
|
|
186
|
+
const { scene: r, mainComponent: s } = i, o = s, { width: a, height: c } = o, h = new Ri(e, o, {
|
|
187
187
|
width: a,
|
|
188
188
|
height: c
|
|
189
189
|
});
|
|
190
|
-
new
|
|
190
|
+
new it(`PageViewer_${e}`, h, {
|
|
191
191
|
left: 0,
|
|
192
192
|
top: 0,
|
|
193
193
|
bottom: 0,
|
|
@@ -195,9 +195,9 @@ let ue = class extends he {
|
|
|
195
195
|
explicitViewportWidthSet: !1,
|
|
196
196
|
explicitViewportHeightSet: !1
|
|
197
197
|
}).closeClip();
|
|
198
|
-
const { pageElements: d, pageBackgroundFill:
|
|
198
|
+
const { pageElements: d, pageBackgroundFill: v } = t, p = this._objectProvider.convertToRenderObjects(d, r);
|
|
199
199
|
if (!p || !o) return;
|
|
200
|
-
this._addBackgroundRect(h,
|
|
200
|
+
this._addBackgroundRect(h, v), h.addObjects(p), h.initTransformer(), p.forEach((f) => {
|
|
201
201
|
h.attachTransformerTo(f);
|
|
202
202
|
});
|
|
203
203
|
const m = h.getTransformer();
|
|
@@ -249,22 +249,22 @@ let ue = class extends he {
|
|
|
249
249
|
s && o && s.addPageScene(o), e.appendPage(t), e.setActivePage(t);
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
],
|
|
257
|
-
var
|
|
258
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
252
|
+
ge = tn([
|
|
253
|
+
Ue(1, X(ze)),
|
|
254
|
+
Ue(2, y),
|
|
255
|
+
Ue(3, G)
|
|
256
|
+
], ge);
|
|
257
|
+
var nn = Object.getOwnPropertyDescriptor, rn = (n, e, t, i) => {
|
|
258
|
+
for (var r = i > 1 ? void 0 : i ? nn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
259
259
|
(o = n[s]) && (r = o(r) || r);
|
|
260
260
|
return r;
|
|
261
|
-
},
|
|
262
|
-
let T = class extends
|
|
261
|
+
}, sn = (n, e) => (t, i) => e(t, i, n);
|
|
262
|
+
let T = class extends ve {
|
|
263
263
|
constructor(n) {
|
|
264
264
|
super(), this._renderManagerService = n;
|
|
265
265
|
}
|
|
266
266
|
_getSlideRenderControllerFromRenderUnit(n) {
|
|
267
|
-
return this._renderManagerService.getRenderById(n).with(
|
|
267
|
+
return this._renderManagerService.getRenderById(n).with(ge);
|
|
268
268
|
}
|
|
269
269
|
createThumbs(n) {
|
|
270
270
|
this._getSlideRenderControllerFromRenderUnit(n).createThumbs();
|
|
@@ -291,10 +291,10 @@ let T = class extends he {
|
|
|
291
291
|
this._getSlideRenderControllerFromRenderUnit(n).appendPage();
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
T =
|
|
295
|
-
|
|
294
|
+
T = rn([
|
|
295
|
+
sn(0, G)
|
|
296
296
|
], T);
|
|
297
|
-
const
|
|
297
|
+
const on = "slides-ui.config", gt = {}, Dt = {
|
|
298
298
|
id: "slide.operation.delete-element",
|
|
299
299
|
type: D.OPERATION,
|
|
300
300
|
handler: (n, e) => {
|
|
@@ -313,7 +313,7 @@ var N = function() {
|
|
|
313
313
|
}
|
|
314
314
|
return n;
|
|
315
315
|
}, N.apply(this, arguments);
|
|
316
|
-
},
|
|
316
|
+
}, an = function(n, e) {
|
|
317
317
|
var t = {};
|
|
318
318
|
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
319
319
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -321,15 +321,15 @@ var N = function() {
|
|
|
321
321
|
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
|
322
322
|
return t;
|
|
323
323
|
}, $ = A(function(n, e) {
|
|
324
|
-
var t = n.icon, i = n.id, r = n.className, s = n.extend, o =
|
|
325
|
-
return
|
|
324
|
+
var t = n.icon, i = n.id, r = n.className, s = n.extend, o = an(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), c = Mt("_".concat(dn()));
|
|
325
|
+
return Ut(t, "".concat(i), { defIds: t.defIds, idSuffix: c.current }, N({ ref: e, className: a }, o), s);
|
|
326
326
|
});
|
|
327
|
-
function
|
|
328
|
-
return B(n.tag, N(N({ key: e },
|
|
329
|
-
return
|
|
327
|
+
function Ut(n, e, t, i, r) {
|
|
328
|
+
return B(n.tag, N(N({ key: e }, cn(n, t, r)), i), (ln(n, t).children || []).map(function(s, o) {
|
|
329
|
+
return Ut(s, "".concat(e, "-").concat(n.tag, "-").concat(o), t, void 0, r);
|
|
330
330
|
}));
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function cn(n, e, t) {
|
|
333
333
|
var i = N({}, n.attrs);
|
|
334
334
|
t != null && t.colorChannel1 && i.fill === "colorChannel1" && (i.fill = t.colorChannel1), n.tag === "mask" && i.id && (i.id = i.id + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
335
335
|
var o = s[0], a = s[1];
|
|
@@ -341,96 +341,96 @@ function on(n, e, t) {
|
|
|
341
341
|
typeof a == "string" && (i[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
342
342
|
})), i;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function ln(n, e) {
|
|
345
345
|
var t, i = e.defIds;
|
|
346
346
|
return !i || i.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? N(N({}, n), { children: n.children.map(function(r) {
|
|
347
347
|
return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? N(N({}, r), { attrs: N(N({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
348
348
|
}) }) : n;
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function dn() {
|
|
351
351
|
return Math.random().toString(36).substring(2, 8);
|
|
352
352
|
}
|
|
353
353
|
$.displayName = "UniverIcon";
|
|
354
|
-
var
|
|
354
|
+
var un = { 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" } }] }, Vt = A(function(n, e) {
|
|
355
355
|
return B($, Object.assign({}, n, {
|
|
356
356
|
id: "add-image-single",
|
|
357
357
|
ref: e,
|
|
358
|
-
icon:
|
|
358
|
+
icon: un
|
|
359
359
|
}));
|
|
360
360
|
});
|
|
361
|
-
|
|
362
|
-
var
|
|
361
|
+
Vt.displayName = "AddImageSingle";
|
|
362
|
+
var hn = { 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" } }] }, jt = A(function(n, e) {
|
|
363
363
|
return B($, Object.assign({}, n, {
|
|
364
364
|
id: "autofill",
|
|
365
365
|
ref: e,
|
|
366
|
-
icon:
|
|
366
|
+
icon: hn
|
|
367
367
|
}));
|
|
368
368
|
});
|
|
369
|
-
|
|
370
|
-
var
|
|
369
|
+
jt.displayName = "Autofill";
|
|
370
|
+
var gn = { 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" } }] }, Lt = A(function(n, e) {
|
|
371
371
|
return B($, Object.assign({}, n, {
|
|
372
372
|
id: "bottom-single",
|
|
373
373
|
ref: e,
|
|
374
|
-
icon:
|
|
374
|
+
icon: gn
|
|
375
375
|
}));
|
|
376
376
|
});
|
|
377
|
-
|
|
378
|
-
var
|
|
377
|
+
Lt.displayName = "BottomSingle";
|
|
378
|
+
var vn = { 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"] }, At = A(function(n, e) {
|
|
379
379
|
return B($, Object.assign({}, n, {
|
|
380
380
|
id: "graph-single",
|
|
381
381
|
ref: e,
|
|
382
|
-
icon:
|
|
382
|
+
icon: vn
|
|
383
383
|
}));
|
|
384
384
|
});
|
|
385
|
-
|
|
386
|
-
var
|
|
385
|
+
At.displayName = "GraphSingle";
|
|
386
|
+
var fn = { 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" } }] }, Ge = A(function(n, e) {
|
|
387
387
|
return B($, Object.assign({}, n, {
|
|
388
388
|
id: "more-down-single",
|
|
389
389
|
ref: e,
|
|
390
|
-
icon:
|
|
390
|
+
icon: fn
|
|
391
391
|
}));
|
|
392
392
|
});
|
|
393
|
-
|
|
394
|
-
var
|
|
393
|
+
Ge.displayName = "MoreDownSingle";
|
|
394
|
+
var mn = { 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" } }] }, Bt = A(function(n, e) {
|
|
395
395
|
return B($, Object.assign({}, n, {
|
|
396
396
|
id: "move-down-single",
|
|
397
397
|
ref: e,
|
|
398
|
-
icon:
|
|
398
|
+
icon: mn
|
|
399
399
|
}));
|
|
400
400
|
});
|
|
401
|
-
|
|
402
|
-
var
|
|
401
|
+
Bt.displayName = "MoveDownSingle";
|
|
402
|
+
var pn = { 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" } }] }, $t = A(function(n, e) {
|
|
403
403
|
return B($, Object.assign({}, n, {
|
|
404
404
|
id: "move-up-single",
|
|
405
405
|
ref: e,
|
|
406
|
-
icon:
|
|
406
|
+
icon: pn
|
|
407
407
|
}));
|
|
408
408
|
});
|
|
409
|
-
|
|
410
|
-
var
|
|
409
|
+
$t.displayName = "MoveUpSingle";
|
|
410
|
+
var _n = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z" } }, { tag: "path", attrs: { fill: "colorChannel1", d: "M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z" } }] }, Ht = A(function(n, e) {
|
|
411
411
|
return B($, Object.assign({}, n, {
|
|
412
412
|
id: "paint-bucket",
|
|
413
413
|
ref: e,
|
|
414
|
-
icon:
|
|
414
|
+
icon: _n
|
|
415
415
|
}));
|
|
416
416
|
});
|
|
417
|
-
|
|
418
|
-
var
|
|
417
|
+
Ht.displayName = "PaintBucket";
|
|
418
|
+
var Cn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.66695 1.33496C2.29968 1.33496 2.00195 1.63269 2.00195 1.99996V3.64439C2.00195 4.01166 2.29968 4.30939 2.66695 4.30939C3.03422 4.30939 3.33195 4.01166 3.33195 3.64439V2.66496H7.33521V13.335H5.3337C4.96643 13.335 4.6687 13.6327 4.6687 14C4.6687 14.3672 4.96643 14.665 5.3337 14.665H10.667C11.0343 14.665 11.332 14.3672 11.332 14C11.332 13.6327 11.0343 13.335 10.667 13.335H8.66521V2.66496H12.6686V3.64439C12.6686 4.01166 12.9664 4.30939 13.3336 4.30939C13.7009 4.30939 13.9986 4.01166 13.9986 3.64439V1.99996C13.9986 1.63269 13.7009 1.33496 13.3336 1.33496H2.66695Z" } }] }, Ft = A(function(n, e) {
|
|
419
419
|
return B($, Object.assign({}, n, {
|
|
420
420
|
id: "text-single",
|
|
421
421
|
ref: e,
|
|
422
|
-
icon:
|
|
422
|
+
icon: Cn
|
|
423
423
|
}));
|
|
424
424
|
});
|
|
425
|
-
|
|
426
|
-
var
|
|
425
|
+
Ft.displayName = "TextSingle";
|
|
426
|
+
var Sn = { 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" } }] }, Wt = A(function(n, e) {
|
|
427
427
|
return B($, Object.assign({}, n, {
|
|
428
428
|
id: "topmost-single",
|
|
429
429
|
ref: e,
|
|
430
|
-
icon:
|
|
430
|
+
icon: Sn
|
|
431
431
|
}));
|
|
432
432
|
});
|
|
433
|
-
|
|
433
|
+
Wt.displayName = "TopmostSingle";
|
|
434
434
|
const W = {
|
|
435
435
|
id: "slide.operation.update-element",
|
|
436
436
|
type: D.OPERATION,
|
|
@@ -438,88 +438,88 @@ const W = {
|
|
|
438
438
|
const { oKey: t, props: i } = e, r = n.get(y), s = e == null ? void 0 : e.unitId, o = r.getUnit(s);
|
|
439
439
|
if (!o) return !1;
|
|
440
440
|
const a = o.getActivePage();
|
|
441
|
-
return a.pageElements[t] =
|
|
441
|
+
return a.pageElements[t] = ui.deepMerge(a.pageElements[t], i), o.updatePage(a.id, a), !0;
|
|
442
442
|
}
|
|
443
443
|
};
|
|
444
|
-
function
|
|
445
|
-
const { pageId: e, unitId: t } = n, i =
|
|
444
|
+
function In(n) {
|
|
445
|
+
const { pageId: e, unitId: t } = n, i = x(Q), r = x(T), s = x(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
446
446
|
if (!a) return null;
|
|
447
447
|
const c = a.getTransformer();
|
|
448
448
|
if (!c) return null;
|
|
449
449
|
const l = c.getSelectedObjectMap().values().next().value;
|
|
450
450
|
if (!l) return null;
|
|
451
|
-
const d = (
|
|
451
|
+
const d = (v) => {
|
|
452
452
|
const p = a.getAllObjects(), [m, f] = p.reduce(([_, I], b) => {
|
|
453
453
|
const w = b.zIndex, M = w < _ ? w : _, V = w > I ? w : I;
|
|
454
454
|
return [M, V];
|
|
455
455
|
}, [0, 0]);
|
|
456
|
-
let
|
|
457
|
-
|
|
458
|
-
zIndex:
|
|
456
|
+
let g = l.zIndex;
|
|
457
|
+
v === 3 ? g = m - 1 : v === 2 ? g = f + 1 : v === 0 ? g = l.zIndex + 1 : v === 1 && (g = l.zIndex - 1), l.setProps({
|
|
458
|
+
zIndex: g
|
|
459
459
|
}), s.executeCommand(W.id, {
|
|
460
460
|
unitId: t,
|
|
461
461
|
oKey: l == null ? void 0 : l.oKey,
|
|
462
462
|
props: {
|
|
463
|
-
zIndex:
|
|
463
|
+
zIndex: g
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
};
|
|
467
467
|
return /* @__PURE__ */ O("div", { className: "univer-relative univer-w-full", children: [
|
|
468
468
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full univer-text-left univer-text-gray-600", children: /* @__PURE__ */ u("div", { children: i.t("image-panel.arrange.title") }) }) }),
|
|
469
469
|
/* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: [
|
|
470
|
-
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(
|
|
470
|
+
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(Se, { onClick: () => {
|
|
471
471
|
d(
|
|
472
472
|
0
|
|
473
473
|
/* forward */
|
|
474
474
|
);
|
|
475
475
|
}, children: /* @__PURE__ */ O("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
476
|
-
/* @__PURE__ */ u(
|
|
476
|
+
/* @__PURE__ */ u($t, {}),
|
|
477
477
|
i.t("image-panel.arrange.forward")
|
|
478
478
|
] }) }) }),
|
|
479
|
-
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(
|
|
479
|
+
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(Se, { onClick: () => {
|
|
480
480
|
d(
|
|
481
481
|
1
|
|
482
482
|
/* backward */
|
|
483
483
|
);
|
|
484
484
|
}, children: /* @__PURE__ */ O("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
485
|
-
/* @__PURE__ */ u(
|
|
485
|
+
/* @__PURE__ */ u(Bt, {}),
|
|
486
486
|
i.t("image-panel.arrange.backward")
|
|
487
487
|
] }) }) })
|
|
488
488
|
] }),
|
|
489
489
|
/* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: [
|
|
490
|
-
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(
|
|
490
|
+
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(Se, { onClick: () => {
|
|
491
491
|
d(
|
|
492
492
|
2
|
|
493
493
|
/* front */
|
|
494
494
|
);
|
|
495
495
|
}, children: /* @__PURE__ */ O("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
496
|
-
/* @__PURE__ */ u(
|
|
496
|
+
/* @__PURE__ */ u(Wt, {}),
|
|
497
497
|
i.t("image-panel.arrange.front")
|
|
498
498
|
] }) }) }),
|
|
499
|
-
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(
|
|
499
|
+
/* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(Se, { onClick: () => {
|
|
500
500
|
d(
|
|
501
501
|
3
|
|
502
502
|
/* back */
|
|
503
503
|
);
|
|
504
504
|
}, children: /* @__PURE__ */ O("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
505
|
-
/* @__PURE__ */ u(
|
|
505
|
+
/* @__PURE__ */ u(Lt, {}),
|
|
506
506
|
i.t("image-panel.arrange.back")
|
|
507
507
|
] }) }) })
|
|
508
508
|
] })
|
|
509
509
|
] });
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function bn(n) {
|
|
512
512
|
var m, f;
|
|
513
|
-
const { pageId: e, unitId: t } = n, i =
|
|
513
|
+
const { pageId: e, unitId: t } = n, i = x(Q), r = x(T), s = x(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
514
514
|
if (!a) return null;
|
|
515
515
|
const c = a.getTransformer();
|
|
516
516
|
if (!c) return null;
|
|
517
517
|
const l = c.getSelectedObjectMap().values().next().value;
|
|
518
518
|
if (!l) return null;
|
|
519
|
-
const [d,
|
|
520
|
-
function p(
|
|
519
|
+
const [d, v] = $i.useState((f = (m = l.fill) == null ? void 0 : m.toString()) != null ? f : "");
|
|
520
|
+
function p(g) {
|
|
521
521
|
l == null || l.setProps({
|
|
522
|
-
fill:
|
|
522
|
+
fill: g
|
|
523
523
|
}), s.executeCommand(W.id, {
|
|
524
524
|
unitId: t,
|
|
525
525
|
oKey: l == null ? void 0 : l.oKey,
|
|
@@ -527,35 +527,32 @@ function Sn(n) {
|
|
|
527
527
|
shape: {
|
|
528
528
|
shapeProperties: {
|
|
529
529
|
shapeBackgroundFill: {
|
|
530
|
-
rgb:
|
|
530
|
+
rgb: g
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
}), g
|
|
535
|
+
}), v(g);
|
|
536
536
|
}
|
|
537
537
|
return /* @__PURE__ */ u(
|
|
538
538
|
"div",
|
|
539
539
|
{
|
|
540
|
-
className:
|
|
541
|
-
univer-relative univer-bottom-0 univer-mt-5 univer-w-full univer-border-t univer-border-solid
|
|
542
|
-
univer-border-t-gray-200
|
|
543
|
-
`,
|
|
540
|
+
className: K("univer-relative univer-bottom-0 univer-mt-5 univer-w-full", Tt),
|
|
544
541
|
children: /* @__PURE__ */ O("div", { className: "univer-relative univer-w-full", children: [
|
|
545
542
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full univer-text-left univer-text-gray-600", children: /* @__PURE__ */ u("div", { children: i.t("slide.panel.fill.title") }) }) }),
|
|
546
543
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-1/2", children: /* @__PURE__ */ u(
|
|
547
|
-
|
|
544
|
+
wt,
|
|
548
545
|
{
|
|
549
546
|
overlay: /* @__PURE__ */ u("div", { className: "univer-rounded-lg univer-p-4", children: /* @__PURE__ */ u(
|
|
550
|
-
|
|
547
|
+
Ai,
|
|
551
548
|
{
|
|
552
549
|
value: "#fff",
|
|
553
550
|
onChange: p
|
|
554
551
|
}
|
|
555
552
|
) }),
|
|
556
553
|
children: /* @__PURE__ */ O("a", { className: "univer-flex univer-cursor-pointer univer-items-center univer-gap-1", children: [
|
|
557
|
-
/* @__PURE__ */ u(
|
|
558
|
-
/* @__PURE__ */ u(
|
|
554
|
+
/* @__PURE__ */ u(Ht, { className: "univer-fill-primary-600" }),
|
|
555
|
+
/* @__PURE__ */ u(Ge, {})
|
|
559
556
|
] })
|
|
560
557
|
}
|
|
561
558
|
) }) })
|
|
@@ -563,8 +560,8 @@ function Sn(n) {
|
|
|
563
560
|
}
|
|
564
561
|
);
|
|
565
562
|
}
|
|
566
|
-
function
|
|
567
|
-
const { pageId: e, unitId: t } = n, i =
|
|
563
|
+
function En(n) {
|
|
564
|
+
const { pageId: e, unitId: t } = n, i = x(Q), r = x(T), s = x(U), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
568
565
|
if (!a) return null;
|
|
569
566
|
const c = a.getTransformer();
|
|
570
567
|
if (!c) return null;
|
|
@@ -572,28 +569,28 @@ function In(n) {
|
|
|
572
569
|
if (!l) return null;
|
|
573
570
|
const {
|
|
574
571
|
width: d = 0,
|
|
575
|
-
height:
|
|
572
|
+
height: v = 0,
|
|
576
573
|
left: p = 0,
|
|
577
574
|
top: m = 0,
|
|
578
575
|
angle: f = 0
|
|
579
|
-
} = l, [
|
|
580
|
-
const { objects:
|
|
581
|
-
width:
|
|
582
|
-
height:
|
|
583
|
-
left:
|
|
584
|
-
top:
|
|
585
|
-
angle:
|
|
586
|
-
} =
|
|
587
|
-
_(
|
|
576
|
+
} = l, [g, _] = k(d), [I, b] = k(v), [w, M] = k(p), [V, R] = k(m), [z, se] = k(f), H = (C) => {
|
|
577
|
+
const { objects: oe } = C, ae = oe.values().next().value, {
|
|
578
|
+
width: ii = 0,
|
|
579
|
+
height: ni = 0,
|
|
580
|
+
left: ri = 0,
|
|
581
|
+
top: si = 0,
|
|
582
|
+
angle: oi = 0
|
|
583
|
+
} = ae;
|
|
584
|
+
_(ii), b(ni), M(ri), R(si), se(oi);
|
|
588
585
|
};
|
|
589
|
-
|
|
590
|
-
const C = c.changeStart$.subscribe((
|
|
591
|
-
H(
|
|
592
|
-
}),
|
|
593
|
-
H(
|
|
586
|
+
he(() => {
|
|
587
|
+
const C = c.changeStart$.subscribe((ae) => {
|
|
588
|
+
H(ae);
|
|
589
|
+
}), oe = c.changing$.subscribe((ae) => {
|
|
590
|
+
H(ae);
|
|
594
591
|
});
|
|
595
592
|
return () => {
|
|
596
|
-
|
|
593
|
+
oe.unsubscribe(), C.unsubscribe();
|
|
597
594
|
};
|
|
598
595
|
}, []);
|
|
599
596
|
function F(C) {
|
|
@@ -605,7 +602,7 @@ function In(n) {
|
|
|
605
602
|
}
|
|
606
603
|
}), l == null || l.resize(C, l.height), _(C), c == null || c.refreshControls());
|
|
607
604
|
}
|
|
608
|
-
function
|
|
605
|
+
function ee(C) {
|
|
609
606
|
!C || !l || (s.executeCommand(W.id, {
|
|
610
607
|
pageId: e,
|
|
611
608
|
oKey: l.oKey,
|
|
@@ -614,7 +611,7 @@ function In(n) {
|
|
|
614
611
|
}
|
|
615
612
|
}), l == null || l.resize(l.width, C), b(C), c == null || c.refreshControls());
|
|
616
613
|
}
|
|
617
|
-
function
|
|
614
|
+
function te(C) {
|
|
618
615
|
!C || !l || (s.executeCommand(W.id, {
|
|
619
616
|
pageId: e,
|
|
620
617
|
oKey: l.oKey,
|
|
@@ -623,16 +620,16 @@ function In(n) {
|
|
|
623
620
|
}
|
|
624
621
|
}), l == null || l.translate(C, l.top), M(C), c == null || c.refreshControls());
|
|
625
622
|
}
|
|
626
|
-
function
|
|
623
|
+
function _e(C) {
|
|
627
624
|
!C || !l || (s.executeCommand(W.id, {
|
|
628
625
|
pageId: e,
|
|
629
626
|
oKey: l.oKey,
|
|
630
627
|
props: {
|
|
631
628
|
right: C
|
|
632
629
|
}
|
|
633
|
-
}), l == null || l.translate(l.left, C),
|
|
630
|
+
}), l == null || l.translate(l.left, C), R(C), c == null || c.refreshControls());
|
|
634
631
|
}
|
|
635
|
-
function
|
|
632
|
+
function Ce(C) {
|
|
636
633
|
!C || !l || (s.executeCommand(W.id, {
|
|
637
634
|
pageId: e,
|
|
638
635
|
oKey: l.oKey,
|
|
@@ -641,26 +638,23 @@ function In(n) {
|
|
|
641
638
|
}
|
|
642
639
|
}), l == null || l.transformByState({
|
|
643
640
|
angle: C
|
|
644
|
-
}),
|
|
641
|
+
}), se(C), c == null || c.refreshControls());
|
|
645
642
|
}
|
|
646
643
|
return /* @__PURE__ */ O(
|
|
647
644
|
"div",
|
|
648
645
|
{
|
|
649
|
-
className:
|
|
650
|
-
univer-relative univer-bottom-0 univer-mt-5 univer-w-full univer-border-t univer-border-solid
|
|
651
|
-
univer-border-t-gray-200
|
|
652
|
-
`,
|
|
646
|
+
className: K("univer-relative univer-bottom-0 univer-mt-5 univer-w-full", Tt),
|
|
653
647
|
children: [
|
|
654
648
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full univer-text-left univer-text-gray-600", children: /* @__PURE__ */ u("div", { children: i.t("image-panel.transform.title") }) }) }),
|
|
655
649
|
/* @__PURE__ */ O("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: [
|
|
656
650
|
/* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
|
|
657
651
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.width") }) }),
|
|
658
652
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
|
|
659
|
-
|
|
653
|
+
ce,
|
|
660
654
|
{
|
|
661
655
|
className: "univer-w-11/12",
|
|
662
656
|
min: 1,
|
|
663
|
-
value:
|
|
657
|
+
value: g,
|
|
664
658
|
onChange: (C) => {
|
|
665
659
|
F(C);
|
|
666
660
|
}
|
|
@@ -670,13 +664,13 @@ function In(n) {
|
|
|
670
664
|
/* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
|
|
671
665
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.height") }) }),
|
|
672
666
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
|
|
673
|
-
|
|
667
|
+
ce,
|
|
674
668
|
{
|
|
675
669
|
className: "univer-w-11/12",
|
|
676
670
|
min: 1,
|
|
677
671
|
value: I,
|
|
678
672
|
onChange: (C) => {
|
|
679
|
-
|
|
673
|
+
ee(C);
|
|
680
674
|
}
|
|
681
675
|
}
|
|
682
676
|
) }) })
|
|
@@ -686,14 +680,14 @@ function In(n) {
|
|
|
686
680
|
/* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
|
|
687
681
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.x") }) }),
|
|
688
682
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
|
|
689
|
-
|
|
683
|
+
ce,
|
|
690
684
|
{
|
|
691
685
|
className: "univer-w-11/12",
|
|
692
686
|
precision: 1,
|
|
693
687
|
min: 0,
|
|
694
688
|
value: w,
|
|
695
689
|
onChange: (C) => {
|
|
696
|
-
|
|
690
|
+
te(C);
|
|
697
691
|
}
|
|
698
692
|
}
|
|
699
693
|
) }) })
|
|
@@ -701,14 +695,14 @@ function In(n) {
|
|
|
701
695
|
/* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
|
|
702
696
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.y") }) }),
|
|
703
697
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
|
|
704
|
-
|
|
698
|
+
ce,
|
|
705
699
|
{
|
|
706
700
|
className: "univer-w-11/12",
|
|
707
701
|
precision: 1,
|
|
708
702
|
min: 0,
|
|
709
703
|
value: V,
|
|
710
704
|
onChange: (C) => {
|
|
711
|
-
|
|
705
|
+
_e(C);
|
|
712
706
|
}
|
|
713
707
|
}
|
|
714
708
|
) }) })
|
|
@@ -716,12 +710,12 @@ function In(n) {
|
|
|
716
710
|
/* @__PURE__ */ u("div", { className: "univer-w-1/3", children: /* @__PURE__ */ O("label", { children: [
|
|
717
711
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: i.t("image-panel.transform.rotate") }) }),
|
|
718
712
|
/* @__PURE__ */ u("div", { className: "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start", children: /* @__PURE__ */ u("div", { className: "univer-w-full", children: /* @__PURE__ */ u(
|
|
719
|
-
|
|
713
|
+
ce,
|
|
720
714
|
{
|
|
721
715
|
className: "univer-w-11/12",
|
|
722
716
|
precision: 1,
|
|
723
717
|
value: z,
|
|
724
|
-
onChange:
|
|
718
|
+
onChange: Ce
|
|
725
719
|
}
|
|
726
720
|
) }) })
|
|
727
721
|
] }) })
|
|
@@ -730,10 +724,10 @@ function In(n) {
|
|
|
730
724
|
}
|
|
731
725
|
);
|
|
732
726
|
}
|
|
733
|
-
const
|
|
734
|
-
function
|
|
727
|
+
const Oe = "COMPONENT_SLIDE_SIDEBAR";
|
|
728
|
+
function On() {
|
|
735
729
|
var h, l, d;
|
|
736
|
-
const n =
|
|
730
|
+
const n = x(y), e = x(T), t = n.getCurrentUnitForType(E.UNIVER_SLIDE), i = (h = t == null ? void 0 : t.getActivePage()) == null ? void 0 : h.id;
|
|
737
731
|
if (!i) return null;
|
|
738
732
|
const s = (l = e.getRenderUnitByPageId(i, i).scene) == null ? void 0 : l.getTransformer();
|
|
739
733
|
if (!s) return null;
|
|
@@ -742,26 +736,26 @@ function bn() {
|
|
|
742
736
|
return null;
|
|
743
737
|
const c = ((d = n.getFocusedUnit()) == null ? void 0 : d.getUnitId()) || "";
|
|
744
738
|
return /* @__PURE__ */ O("section", { className: "univer-p-2 univer-text-center univer-text-sm", children: [
|
|
745
|
-
/* @__PURE__ */ u(Cn, { pageId: i, unitId: c }),
|
|
746
739
|
/* @__PURE__ */ u(In, { pageId: i, unitId: c }),
|
|
747
|
-
|
|
740
|
+
/* @__PURE__ */ u(En, { pageId: i, unitId: c }),
|
|
741
|
+
a.objectType === le.RECT && /* @__PURE__ */ u(bn, { pageId: i, unitId: c })
|
|
748
742
|
] });
|
|
749
743
|
}
|
|
750
|
-
const
|
|
744
|
+
const Ye = {
|
|
751
745
|
id: "slide.command.insert-float-shape",
|
|
752
746
|
type: D.COMMAND,
|
|
753
747
|
handler: async (n) => {
|
|
754
748
|
var r;
|
|
755
749
|
const e = n.get(U), i = (r = n.get(y).getFocusedUnit()) == null ? void 0 : r.getUnitId();
|
|
756
|
-
return e.executeCommand(
|
|
750
|
+
return e.executeCommand(zt.id, { unitId: i });
|
|
757
751
|
}
|
|
758
|
-
},
|
|
752
|
+
}, zt = {
|
|
759
753
|
id: "slide.operation.insert-float-shape",
|
|
760
754
|
type: D.OPERATION,
|
|
761
755
|
handler: async (n, e) => {
|
|
762
|
-
const t =
|
|
756
|
+
const t = Ct(6), i = n.get(y), r = e.unitId, s = i.getUnit(r);
|
|
763
757
|
if (!s) return !1;
|
|
764
|
-
const o = s.getActivePage(), a = Object.values(o.pageElements), c = a != null && a.length ? Math.max(...a.map((
|
|
758
|
+
const o = s.getActivePage(), a = Object.values(o.pageElements), c = a != null && a.length ? Math.max(...a.map((v) => v.zIndex)) : 20, h = {
|
|
765
759
|
id: t,
|
|
766
760
|
zIndex: c + 1,
|
|
767
761
|
left: 378,
|
|
@@ -770,9 +764,9 @@ const Ge = {
|
|
|
770
764
|
height: 250,
|
|
771
765
|
title: t,
|
|
772
766
|
description: "",
|
|
773
|
-
type:
|
|
767
|
+
type: ke.SHAPE,
|
|
774
768
|
shape: {
|
|
775
|
-
shapeType:
|
|
769
|
+
shapeType: hi.Rect,
|
|
776
770
|
text: "",
|
|
777
771
|
shapeProperties: {
|
|
778
772
|
shapeBackgroundFill: {
|
|
@@ -785,13 +779,13 @@ const Ge = {
|
|
|
785
779
|
const l = n.get(T), d = l.createObjectToPage(h, o.id, r);
|
|
786
780
|
return d && l.setObjectActiveByPage(d, o.id, r), !0;
|
|
787
781
|
}
|
|
788
|
-
},
|
|
782
|
+
}, Be = {
|
|
789
783
|
id: "sidebar.operation.slide-shape",
|
|
790
784
|
type: D.COMMAND,
|
|
791
785
|
handler: async (n, e) => {
|
|
792
|
-
const { visible: t, objectType: i } = e, r = n.get(
|
|
786
|
+
const { visible: t, objectType: i } = e, r = n.get(Pt), s = n.get(Q);
|
|
793
787
|
let o = "", a = "";
|
|
794
|
-
return i ===
|
|
788
|
+
return i === le.RECT ? (o = "slide.sidebar.shape", a = Oe) : i === le.IMAGE ? (o = "slide.sidebar.image", a = Oe) : i === le.RICH_TEXT && (o = "slide.sidebar.text", a = Oe), t ? r.open({
|
|
795
789
|
header: { title: s.t(o) },
|
|
796
790
|
children: { label: a },
|
|
797
791
|
onClose: () => {
|
|
@@ -799,13 +793,13 @@ const Ge = {
|
|
|
799
793
|
width: 360
|
|
800
794
|
}) : r.close(), !0;
|
|
801
795
|
}
|
|
802
|
-
},
|
|
803
|
-
var
|
|
804
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
796
|
+
}, kt = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
|
|
797
|
+
var Rn = Object.getOwnPropertyDescriptor, xn = (n, e, t, i) => {
|
|
798
|
+
for (var r = i > 1 ? void 0 : i ? Rn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
805
799
|
(o = n[s]) && (r = o(r) || r);
|
|
806
800
|
return r;
|
|
807
|
-
},
|
|
808
|
-
function
|
|
801
|
+
}, Ie = (n, e) => (t, i) => e(t, i, n);
|
|
802
|
+
function yn(n, e) {
|
|
809
803
|
const t = vt(n.left, n.top, e), i = vt(n.right, n.bottom, e);
|
|
810
804
|
return {
|
|
811
805
|
left: t.x,
|
|
@@ -815,7 +809,7 @@ function xn(n, e) {
|
|
|
815
809
|
};
|
|
816
810
|
}
|
|
817
811
|
function vt(n, e, t) {
|
|
818
|
-
const { scaleX: i, scaleY: r } = t.getAncestorScale(), s = t.getViewport(
|
|
812
|
+
const { scaleX: i, scaleY: r } = t.getAncestorScale(), s = t.getViewport(re.VIEW);
|
|
819
813
|
if (!s)
|
|
820
814
|
return {
|
|
821
815
|
x: n,
|
|
@@ -827,26 +821,26 @@ function vt(n, e, t) {
|
|
|
827
821
|
y: h
|
|
828
822
|
};
|
|
829
823
|
}
|
|
830
|
-
let
|
|
824
|
+
let ye = class extends De {
|
|
831
825
|
constructor(n, e, t, i) {
|
|
832
826
|
super(), this._globalPopupManagerService = n, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = i;
|
|
833
827
|
}
|
|
834
828
|
_createObjectPositionObserver(n, e) {
|
|
835
829
|
const i = (() => {
|
|
836
|
-
var H, F,
|
|
837
|
-
const { scene: o, engine: a } = e, { left: c, top: h, width: l, height: d } = n,
|
|
830
|
+
var H, F, ee, te;
|
|
831
|
+
const { scene: o, engine: a } = e, { left: c, top: h, width: l, height: d } = n, v = (o.width - ((F = (H = e.mainComponent) == null ? void 0 : H.width) != null ? F : 0)) / 2, p = (o.height - ((te = (ee = e.mainComponent) == null ? void 0 : ee.height) != null ? te : 0)) / 2, m = {
|
|
838
832
|
left: c,
|
|
839
833
|
right: c + l,
|
|
840
834
|
top: h,
|
|
841
835
|
bottom: h + d
|
|
842
|
-
}, f = a.getCanvasElement(),
|
|
836
|
+
}, f = a.getCanvasElement(), g = f.getBoundingClientRect(), _ = xi(f.style.width), { scaleX: I, scaleY: b } = o.getAncestorScale(), w = yn(m, o), { top: M, left: V, width: R } = g, z = R / _;
|
|
843
837
|
return {
|
|
844
|
-
left: w.left * z * I + V +
|
|
845
|
-
right: w.right * z * I + V +
|
|
838
|
+
left: w.left * z * I + V + v,
|
|
839
|
+
right: w.right * z * I + V + v,
|
|
846
840
|
top: w.top * z * b + M + p,
|
|
847
841
|
bottom: w.bottom * z * b + M + p
|
|
848
842
|
};
|
|
849
|
-
})(), r = new
|
|
843
|
+
})(), r = new J(i), s = new Ke();
|
|
850
844
|
return {
|
|
851
845
|
position: i,
|
|
852
846
|
position$: r,
|
|
@@ -875,18 +869,18 @@ let xe = class extends Me {
|
|
|
875
869
|
};
|
|
876
870
|
}
|
|
877
871
|
};
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
],
|
|
884
|
-
var
|
|
885
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
872
|
+
ye = xn([
|
|
873
|
+
Ie(0, X(Pi)),
|
|
874
|
+
Ie(1, G),
|
|
875
|
+
Ie(2, y),
|
|
876
|
+
Ie(3, U)
|
|
877
|
+
], ye);
|
|
878
|
+
var Pn = Object.getOwnPropertyDescriptor, wn = (n, e, t, i) => {
|
|
879
|
+
for (var r = i > 1 ? void 0 : i ? Pn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
886
880
|
(o = n[s]) && (r = o(r) || r);
|
|
887
881
|
return r;
|
|
888
|
-
},
|
|
889
|
-
let
|
|
882
|
+
}, Z = (n, e) => (t, i) => e(t, i, n);
|
|
883
|
+
let Pe = class extends ve {
|
|
890
884
|
constructor(e, t, i, r, s, o, a) {
|
|
891
885
|
super();
|
|
892
886
|
S(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
@@ -913,7 +907,7 @@ let Re = class extends he {
|
|
|
913
907
|
if (!a) return;
|
|
914
908
|
let c;
|
|
915
909
|
this.disposeWithMe(
|
|
916
|
-
|
|
910
|
+
St(
|
|
917
911
|
a.createControl$.subscribe(() => {
|
|
918
912
|
const l = a.getSelectedObjectMap();
|
|
919
913
|
if (l.size > 1) {
|
|
@@ -923,15 +917,15 @@ let Re = class extends he {
|
|
|
923
917
|
const d = l.values().next().value;
|
|
924
918
|
if (!d)
|
|
925
919
|
return;
|
|
926
|
-
const
|
|
920
|
+
const v = d.oKey;
|
|
927
921
|
c == null || c.dispose(), c = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
|
|
928
|
-
componentKey:
|
|
922
|
+
componentKey: kt,
|
|
929
923
|
direction: "horizontal",
|
|
930
924
|
offset: [2, 0],
|
|
931
925
|
extraProps: {
|
|
932
|
-
menuItems: this._getMenuItemsByObjectType(d.objectType,
|
|
926
|
+
menuItems: this._getMenuItemsByObjectType(d.objectType, v, e)
|
|
933
927
|
}
|
|
934
|
-
})), this._sidebarService.visible && this._commandService.executeCommand(
|
|
928
|
+
})), this._sidebarService.visible && this._commandService.executeCommand(Be.id, {
|
|
935
929
|
visible: !0,
|
|
936
930
|
objectType: d.objectType
|
|
937
931
|
});
|
|
@@ -939,7 +933,7 @@ let Re = class extends he {
|
|
|
939
933
|
)
|
|
940
934
|
), this.disposeWithMe(
|
|
941
935
|
a.clearControl$.subscribe(() => {
|
|
942
|
-
c == null || c.dispose(), this._contextService.setContextValue(
|
|
936
|
+
c == null || c.dispose(), this._contextService.setContextValue(gi, !1);
|
|
943
937
|
})
|
|
944
938
|
), this.disposeWithMe(
|
|
945
939
|
a.changing$.subscribe(() => {
|
|
@@ -968,7 +962,7 @@ let Re = class extends he {
|
|
|
968
962
|
return [{
|
|
969
963
|
label: "slide.popup.edit",
|
|
970
964
|
index: 0,
|
|
971
|
-
commandId:
|
|
965
|
+
commandId: Be.id,
|
|
972
966
|
commandParams: {
|
|
973
967
|
visible: !0,
|
|
974
968
|
objectType: e
|
|
@@ -977,7 +971,7 @@ let Re = class extends he {
|
|
|
977
971
|
}, {
|
|
978
972
|
label: "slide.popup.delete",
|
|
979
973
|
index: 5,
|
|
980
|
-
commandId:
|
|
974
|
+
commandId: Dt.id,
|
|
981
975
|
commandParams: {
|
|
982
976
|
id: t,
|
|
983
977
|
unitId: i
|
|
@@ -986,45 +980,45 @@ let Re = class extends he {
|
|
|
986
980
|
}];
|
|
987
981
|
}
|
|
988
982
|
};
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
],
|
|
998
|
-
const
|
|
983
|
+
Pe = wn([
|
|
984
|
+
Z(0, X(ye)),
|
|
985
|
+
Z(1, G),
|
|
986
|
+
Z(2, y),
|
|
987
|
+
Z(3, fe),
|
|
988
|
+
Z(4, X(T)),
|
|
989
|
+
Z(5, Pt),
|
|
990
|
+
Z(6, U)
|
|
991
|
+
], Pe);
|
|
992
|
+
const we = {
|
|
999
993
|
id: "slide.operation.edit-arrow",
|
|
1000
994
|
type: D.OPERATION,
|
|
1001
995
|
handler: () => !0
|
|
1002
|
-
},
|
|
1003
|
-
var
|
|
1004
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
996
|
+
}, de = vi("SLIDE_EDITOR");
|
|
997
|
+
var Tn = Object.getOwnPropertyDescriptor, Mn = (n, e, t, i) => {
|
|
998
|
+
for (var r = i > 1 ? void 0 : i ? Tn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
1005
999
|
(o = n[s]) && (r = o(r) || r);
|
|
1006
1000
|
return r;
|
|
1007
|
-
},
|
|
1008
|
-
const
|
|
1009
|
-
let
|
|
1001
|
+
}, Ve = (n, e) => (t, i) => e(t, i, n);
|
|
1002
|
+
const Ze = It("univer.slide-editor-bridge.service");
|
|
1003
|
+
let $e = class extends De {
|
|
1010
1004
|
constructor(e, t, i) {
|
|
1011
1005
|
super();
|
|
1012
|
-
S(this, "_editorUnitId",
|
|
1006
|
+
S(this, "_editorUnitId", de);
|
|
1013
1007
|
S(this, "_isForceKeepVisible", !1);
|
|
1014
1008
|
S(this, "_editorIsDirty", !1);
|
|
1015
1009
|
S(this, "_currentEditRectState", null);
|
|
1016
|
-
S(this, "_currentEditRectState$", new
|
|
1010
|
+
S(this, "_currentEditRectState$", new J(null));
|
|
1017
1011
|
S(this, "currentEditRectState$", this._currentEditRectState$.asObservable());
|
|
1018
1012
|
S(this, "_visibleParam", {
|
|
1019
1013
|
visible: !1,
|
|
1020
|
-
eventType:
|
|
1014
|
+
eventType: q.Dblclick,
|
|
1021
1015
|
unitId: ""
|
|
1022
1016
|
});
|
|
1023
|
-
S(this, "_visible$", new
|
|
1017
|
+
S(this, "_visible$", new J(this._visibleParam));
|
|
1024
1018
|
S(this, "visible$", this._visible$.asObservable());
|
|
1025
|
-
S(this, "_afterVisible$", new
|
|
1019
|
+
S(this, "_afterVisible$", new J(this._visibleParam));
|
|
1026
1020
|
S(this, "afterVisible$", this._afterVisible$.asObservable());
|
|
1027
|
-
S(this, "endEditing$", new
|
|
1021
|
+
S(this, "endEditing$", new Nt());
|
|
1028
1022
|
S(this, "_currentEditRectInfo");
|
|
1029
1023
|
this._editorService = e, this._contextService = t, this._renderManagerService = i;
|
|
1030
1024
|
}
|
|
@@ -1039,7 +1033,7 @@ let Be = class extends Me {
|
|
|
1039
1033
|
* @editorInfo editorInfo
|
|
1040
1034
|
*/
|
|
1041
1035
|
setEditorRect(e) {
|
|
1042
|
-
this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(
|
|
1036
|
+
this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(de), this._contextService.setContextValue(Re, !1), this._contextService.setContextValue(bt, !1), this._contextService.setContextValue(Et, !1));
|
|
1043
1037
|
const t = this.getEditRectState();
|
|
1044
1038
|
this._currentEditRectState = t, this._currentEditRectState$.next(t);
|
|
1045
1039
|
}
|
|
@@ -1053,27 +1047,27 @@ let Be = class extends Me {
|
|
|
1053
1047
|
* && this@setEditorRect
|
|
1054
1048
|
*/
|
|
1055
1049
|
getEditRectState() {
|
|
1056
|
-
const e =
|
|
1050
|
+
const e = de, t = this._currentEditRectInfo, i = t.unitId, r = t.richTextObj.documentData;
|
|
1057
1051
|
r.id = e, r.documentStyle = {
|
|
1058
1052
|
...r.documentStyle,
|
|
1059
1053
|
pageSize: { width: t.richTextObj.width, height: 1 / 0 }
|
|
1060
1054
|
};
|
|
1061
1055
|
const o = {
|
|
1062
|
-
documentModel: new
|
|
1056
|
+
documentModel: new fi(r),
|
|
1063
1057
|
fontString: "document",
|
|
1064
1058
|
textRotation: { a: 0, v: 0 },
|
|
1065
1059
|
wrapStrategy: 0,
|
|
1066
|
-
verticalAlign:
|
|
1067
|
-
horizontalAlign:
|
|
1060
|
+
verticalAlign: xe.TOP,
|
|
1061
|
+
horizontalAlign: Ot.LEFT,
|
|
1068
1062
|
paddingData: { t: 0, b: 1, l: 2, r: 2 }
|
|
1069
1063
|
}, a = t.richTextObj.width, c = t.richTextObj.height, h = t.richTextObj.left, l = t.richTextObj.top, d = {
|
|
1070
1064
|
left: 0,
|
|
1071
1065
|
top: 0
|
|
1072
|
-
},
|
|
1066
|
+
}, v = this._renderManagerService.getRenderById(i), p = v == null ? void 0 : v.scene, m = p == null ? void 0 : p.getViewport(re.VIEW), f = p == null ? void 0 : p.getObject(re.COMPONENT), g = {
|
|
1073
1067
|
x: (f == null ? void 0 : f.left) || 0,
|
|
1074
1068
|
y: (f == null ? void 0 : f.top) || 0
|
|
1075
1069
|
}, _ = (m == null ? void 0 : m.viewportScrollX) || 0, I = (m == null ? void 0 : m.viewportScrollY) || 0;
|
|
1076
|
-
return d.left =
|
|
1070
|
+
return d.left = g.x - _, d.top = g.y - I, {
|
|
1077
1071
|
position: {
|
|
1078
1072
|
startX: h,
|
|
1079
1073
|
startY: l,
|
|
@@ -1131,7 +1125,7 @@ let Be = class extends Me {
|
|
|
1131
1125
|
textStyle: { fs: r },
|
|
1132
1126
|
renderConfig: {
|
|
1133
1127
|
// horizontalAlign: HorizontalAlign.CENTER,
|
|
1134
|
-
verticalAlign:
|
|
1128
|
+
verticalAlign: xe.MIDDLE,
|
|
1135
1129
|
centerAngle: 0,
|
|
1136
1130
|
vertexAngle: 0,
|
|
1137
1131
|
wrapStrategy: 0
|
|
@@ -1143,21 +1137,21 @@ let Be = class extends Me {
|
|
|
1143
1137
|
};
|
|
1144
1138
|
}
|
|
1145
1139
|
};
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
],
|
|
1151
|
-
class
|
|
1140
|
+
$e = Mn([
|
|
1141
|
+
Ve(0, Xe),
|
|
1142
|
+
Ve(1, fe),
|
|
1143
|
+
Ve(2, G)
|
|
1144
|
+
], $e);
|
|
1145
|
+
class Nn {
|
|
1152
1146
|
constructor() {
|
|
1153
1147
|
S(this, "_state", null);
|
|
1154
1148
|
S(this, "_rect", null);
|
|
1155
|
-
S(this, "_state$", new
|
|
1149
|
+
S(this, "_state$", new J(null));
|
|
1156
1150
|
S(this, "state$", this._state$.asObservable());
|
|
1157
|
-
S(this, "_rect$", new
|
|
1151
|
+
S(this, "_rect$", new J(null));
|
|
1158
1152
|
S(this, "rect$", this._rect$.asObservable());
|
|
1159
1153
|
S(this, "_focus", !1);
|
|
1160
|
-
S(this, "_focus$", new
|
|
1154
|
+
S(this, "_focus$", new J(this._focus));
|
|
1161
1155
|
S(this, "focus$", this._focus$.asObservable());
|
|
1162
1156
|
}
|
|
1163
1157
|
dispose() {
|
|
@@ -1182,29 +1176,29 @@ class Tn {
|
|
|
1182
1176
|
this._state$.next(e);
|
|
1183
1177
|
}
|
|
1184
1178
|
}
|
|
1185
|
-
const
|
|
1179
|
+
const qe = It(
|
|
1186
1180
|
"univer.slide-editor-manager.service"
|
|
1187
1181
|
);
|
|
1188
|
-
var
|
|
1189
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1182
|
+
var Y = /* @__PURE__ */ ((n) => (n[n.InitialState = 0] = "InitialState", n[n.StartEditor = 1] = "StartEditor", n[n.CursorChange = 2] = "CursorChange", n))(Y || {}), Dn = Object.getOwnPropertyDescriptor, Un = (n, e, t, i) => {
|
|
1183
|
+
for (var r = i > 1 ? void 0 : i ? Dn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
1190
1184
|
(o = n[s]) && (r = o(r) || r);
|
|
1191
1185
|
return r;
|
|
1192
1186
|
}, L = (n, e) => (t, i) => e(t, i, n);
|
|
1193
|
-
const
|
|
1194
|
-
let
|
|
1195
|
-
constructor(e, t, i, r, s, o, a, c, h, l, d,
|
|
1187
|
+
const ft = -1e3, mt = 5, Vn = 2;
|
|
1188
|
+
let He = class extends De {
|
|
1189
|
+
constructor(e, t, i, r, s, o, a, c, h, l, d, v) {
|
|
1196
1190
|
super();
|
|
1197
1191
|
/**
|
|
1198
1192
|
* It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
|
|
1199
1193
|
*/
|
|
1200
|
-
S(this, "_cursorChange",
|
|
1194
|
+
S(this, "_cursorChange", Y.InitialState);
|
|
1201
1195
|
/** If the corresponding unit is active and prepared for editing. */
|
|
1202
1196
|
S(this, "_isUnitEditing", !1);
|
|
1203
1197
|
S(this, "_d");
|
|
1204
|
-
this._renderContext = e, this._layoutService = t, this._undoRedoService = i, this._contextService = r, this._instanceSrv = s, this._renderManagerService = o, this._editorBridgeService = a, this._cellEditorManagerService = c, this._textSelectionManagerService = h, this._commandService = l, this._localService = d, this._editorService =
|
|
1198
|
+
this._renderContext = e, this._layoutService = t, this._undoRedoService = i, this._contextService = r, this._instanceSrv = s, this._renderManagerService = o, this._editorBridgeService = a, this._cellEditorManagerService = c, this._textSelectionManagerService = h, this._commandService = l, this._localService = d, this._editorService = v, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(E.UNIVER_SLIDE).subscribe((p) => {
|
|
1205
1199
|
p && p.getUnitId() === this._renderContext.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({
|
|
1206
1200
|
visible: !1,
|
|
1207
|
-
eventType:
|
|
1201
|
+
eventType: q.Keyboard,
|
|
1208
1202
|
keycode: P.ESC,
|
|
1209
1203
|
unitId: this._renderContext.unitId
|
|
1210
1204
|
}), this._isUnitEditing = !1));
|
|
@@ -1218,7 +1212,7 @@ let $e = class extends Me {
|
|
|
1218
1212
|
(e = this._d) == null || e.dispose(), this._d = null;
|
|
1219
1213
|
}
|
|
1220
1214
|
_init() {
|
|
1221
|
-
const e = new
|
|
1215
|
+
const e = new Ke();
|
|
1222
1216
|
return this._subscribeToCurrentCell(e), this._initialKeyboardListener(e), this._initialCursorSync(e), this._listenEditorFocus(e), this._commandExecutedListener(e), setTimeout(() => {
|
|
1223
1217
|
this._cursorStateListener(e);
|
|
1224
1218
|
}, 1e3), e;
|
|
@@ -1235,16 +1229,16 @@ let $e = class extends Me {
|
|
|
1235
1229
|
}
|
|
1236
1230
|
_getEditorSkeleton(e) {
|
|
1237
1231
|
var t;
|
|
1238
|
-
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(
|
|
1232
|
+
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(dt).getSkeleton();
|
|
1239
1233
|
}
|
|
1240
1234
|
_getEditorViewModel(e) {
|
|
1241
1235
|
var t;
|
|
1242
|
-
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(
|
|
1236
|
+
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(dt).getViewModel();
|
|
1243
1237
|
}
|
|
1244
1238
|
_initialCursorSync(e) {
|
|
1245
|
-
e.add(this._cellEditorManagerService.focus$.pipe(
|
|
1239
|
+
e.add(this._cellEditorManagerService.focus$.pipe(Wi((t) => !!t)).subscribe(() => {
|
|
1246
1240
|
var t;
|
|
1247
|
-
(t =
|
|
1241
|
+
(t = Ae(E.UNIVER_DOC, this._instanceSrv, this._renderManagerService)) == null || t.with(ut).sync();
|
|
1248
1242
|
}));
|
|
1249
1243
|
}
|
|
1250
1244
|
/**
|
|
@@ -1254,18 +1248,18 @@ let $e = class extends Me {
|
|
|
1254
1248
|
_subscribeToCurrentCell(e) {
|
|
1255
1249
|
e.add(this._editorBridgeService.currentEditRectState$.subscribe((t) => {
|
|
1256
1250
|
var d;
|
|
1257
|
-
if (t == null || this._contextService.getContextValue(
|
|
1251
|
+
if (t == null || this._contextService.getContextValue(bt) || this._contextService.getContextValue(Et))
|
|
1258
1252
|
return;
|
|
1259
1253
|
const {
|
|
1260
1254
|
position: { startX: i, endX: r },
|
|
1261
1255
|
documentLayoutObject: { textRotation: s, wrapStrategy: o, documentModel: a },
|
|
1262
1256
|
scaleX: c,
|
|
1263
1257
|
editorUnitId: h
|
|
1264
|
-
} = t, { vertexAngle: l } =
|
|
1265
|
-
a.updateDocumentId(h), o ===
|
|
1258
|
+
} = t, { vertexAngle: l } = nt(s);
|
|
1259
|
+
a.updateDocumentId(h), o === et.WRAP && l === 0 && a.updateDocumentDataPageSize((r - i) / c), this._instanceSrv.changeDoc(h, a), this._contextService.setContextValue(pi, !0), this._textSelectionManagerService.replaceTextRanges([{
|
|
1266
1260
|
startOffset: 0,
|
|
1267
1261
|
endOffset: 0
|
|
1268
|
-
}]), (d =
|
|
1262
|
+
}]), (d = Ae(E.UNIVER_DOC, this._instanceSrv, this._renderManagerService)) == null || d.with(ut).activate(ft, ft);
|
|
1269
1263
|
}));
|
|
1270
1264
|
}
|
|
1271
1265
|
/**
|
|
@@ -1281,43 +1275,43 @@ let $e = class extends Me {
|
|
|
1281
1275
|
const { startX: a, startY: c, endX: h, endY: l } = e, d = r.documentModel;
|
|
1282
1276
|
if (d == null)
|
|
1283
1277
|
return;
|
|
1284
|
-
const { actualWidth:
|
|
1278
|
+
const { actualWidth: v, actualHeight: p } = this._predictingSize(
|
|
1285
1279
|
e,
|
|
1286
1280
|
t,
|
|
1287
1281
|
i,
|
|
1288
1282
|
r,
|
|
1289
1283
|
s,
|
|
1290
1284
|
o
|
|
1291
|
-
), { verticalAlign: m, paddingData: f, fill:
|
|
1285
|
+
), { verticalAlign: m, paddingData: f, fill: g } = r;
|
|
1292
1286
|
let _ = h - a, I = l - c;
|
|
1293
|
-
if (_ <
|
|
1287
|
+
if (_ < v && (_ = v), I < p)
|
|
1294
1288
|
I = p, d.updateDocumentDataMargin(f);
|
|
1295
1289
|
else {
|
|
1296
1290
|
let b = 0;
|
|
1297
|
-
m ===
|
|
1291
|
+
m === xe.MIDDLE ? b = (I - p) / 2 / o : m === xe.TOP ? b = f.t || 0 : b = (I - p) / o - (f.b || 0), b = b < (f.t || 0) ? f.t || 0 : b, d.updateDocumentDataMargin({
|
|
1298
1292
|
t: b
|
|
1299
1293
|
});
|
|
1300
1294
|
}
|
|
1301
|
-
i.calculate(), this._editAreaProcessing(_, I, e, t,
|
|
1295
|
+
i.calculate(), this._editAreaProcessing(_, I, e, t, g, s, o);
|
|
1302
1296
|
}
|
|
1303
1297
|
/**
|
|
1304
1298
|
* Mainly used to pre-calculate the width of the editor,
|
|
1305
1299
|
* to determine whether it needs to be automatically widened.
|
|
1306
1300
|
*/
|
|
1307
1301
|
_predictingSize(e, t, i, r, s = 1, o = 1) {
|
|
1308
|
-
const { startX: a, endX: c } = e, { textRotation: h, wrapStrategy: l } = r, d = r.documentModel, { vertexAngle:
|
|
1309
|
-
if (l ===
|
|
1310
|
-
const { actualWidth:
|
|
1302
|
+
const { startX: a, endX: c } = e, { textRotation: h, wrapStrategy: l } = r, d = r.documentModel, { vertexAngle: v } = nt(h), p = document.body.clientWidth;
|
|
1303
|
+
if (l === et.WRAP && v === 0) {
|
|
1304
|
+
const { actualWidth: g, actualHeight: _ } = i.getActualSize();
|
|
1311
1305
|
return {
|
|
1312
|
-
actualWidth:
|
|
1306
|
+
actualWidth: g * s,
|
|
1313
1307
|
actualHeight: _ * o
|
|
1314
1308
|
};
|
|
1315
1309
|
}
|
|
1316
1310
|
d == null || d.updateDocumentDataPageSize((p - a - t.left) / s), i.calculate();
|
|
1317
1311
|
const m = i.getActualSize();
|
|
1318
1312
|
let f = c - a;
|
|
1319
|
-
return f < m.actualWidth * s +
|
|
1320
|
-
horizontalAlign:
|
|
1313
|
+
return f < m.actualWidth * s + mt * s && (f = m.actualWidth * s + mt * s), d == null || d.updateDocumentDataPageSize(f / s), d == null || d.updateDocumentRenderConfig({
|
|
1314
|
+
horizontalAlign: Ot.UNSPECIFIED,
|
|
1321
1315
|
cellValueType: void 0
|
|
1322
1316
|
}), {
|
|
1323
1317
|
actualWidth: f,
|
|
@@ -1333,16 +1327,16 @@ let $e = class extends Me {
|
|
|
1333
1327
|
const c = this._getEditorObject();
|
|
1334
1328
|
if (c == null)
|
|
1335
1329
|
return;
|
|
1336
|
-
function h(
|
|
1337
|
-
return Number.parseInt(
|
|
1330
|
+
function h(oe) {
|
|
1331
|
+
return Number.parseInt(oe.replace("px", ""));
|
|
1338
1332
|
}
|
|
1339
|
-
const d = this._renderContext.engine.getCanvasElement(),
|
|
1333
|
+
const d = this._renderContext.engine.getCanvasElement(), v = d.getBoundingClientRect(), p = h(d.style.width), { top: m, left: f, width: g } = v, _ = g / p;
|
|
1340
1334
|
let { startX: I, startY: b } = i;
|
|
1341
1335
|
I += r.left, b += r.top;
|
|
1342
|
-
const { document: w, scene: M, engine: V } = c,
|
|
1343
|
-
let H = t, F =
|
|
1344
|
-
H > z ? (H = z, F == null ?
|
|
1345
|
-
const { scaleX:
|
|
1336
|
+
const { document: w, scene: M, engine: V } = c, R = M.getViewport(ht.VIEW_MAIN), z = document.body.clientHeight - b - r.top - Vn * 2, se = document.body.clientWidth - I - r.left;
|
|
1337
|
+
let H = t, F = R == null ? void 0 : R.getScrollBar();
|
|
1338
|
+
H > z ? (H = z, F == null ? R && new xt(R, { enableHorizontal: !1, barSize: 8 }) : R == null || R.resetCanvasSizeAndUpdateScroll()) : (F = null, (C = R == null ? void 0 : R.getScrollBar()) == null || C.dispose()), e += (F == null ? void 0 : F.barSize) || 0, e = Math.min(e, se), I -= ne, b -= ne, this._addBackground(M, e / o, t / a, s);
|
|
1339
|
+
const { scaleX: ee, scaleY: te } = M.getPrecisionScale();
|
|
1346
1340
|
M.transformByState({
|
|
1347
1341
|
width: e * _ / o,
|
|
1348
1342
|
height: t * _ / a,
|
|
@@ -1350,12 +1344,12 @@ let $e = class extends Me {
|
|
|
1350
1344
|
scaleY: a * _
|
|
1351
1345
|
}), w.resize(e / o, t / a), setTimeout(() => {
|
|
1352
1346
|
V.resizeBySize(
|
|
1353
|
-
|
|
1354
|
-
|
|
1347
|
+
rt(e, ee),
|
|
1348
|
+
rt(H, te)
|
|
1355
1349
|
);
|
|
1356
1350
|
}, 0);
|
|
1357
|
-
const
|
|
1358
|
-
I = I * _ + (
|
|
1351
|
+
const _e = this._layoutService.getContentElement().getBoundingClientRect(), Ce = d.getBoundingClientRect();
|
|
1352
|
+
I = I * _ + (Ce.left - _e.left), b = b * _ + (Ce.top - _e.top), this._cellEditorManagerService.setState({
|
|
1359
1353
|
startX: I,
|
|
1360
1354
|
startY: b,
|
|
1361
1355
|
endX: e * _ + I,
|
|
@@ -1370,14 +1364,14 @@ let $e = class extends Me {
|
|
|
1370
1364
|
const s = "_backgroundRectHelperColor_", o = e.getObject(s);
|
|
1371
1365
|
o == null && r == null || (o == null ? e.addObjects(
|
|
1372
1366
|
[
|
|
1373
|
-
new
|
|
1367
|
+
new yt(s, {
|
|
1374
1368
|
width: t,
|
|
1375
1369
|
height: i,
|
|
1376
1370
|
fill: r,
|
|
1377
1371
|
evented: !1
|
|
1378
1372
|
})
|
|
1379
1373
|
],
|
|
1380
|
-
|
|
1374
|
+
Ki
|
|
1381
1375
|
) : r == null ? o.dispose() : (o.setProps({
|
|
1382
1376
|
fill: r
|
|
1383
1377
|
}), o.transformByState({
|
|
@@ -1394,9 +1388,9 @@ let $e = class extends Me {
|
|
|
1394
1388
|
// first part: startEditing --> _updateEditor
|
|
1395
1389
|
// 2nd part: startEditing --> changeVisible --> slide-editor-bridge.render-controller.ts@changeVisible --> _editorBridgeService.changeVisible
|
|
1396
1390
|
_handleEditorVisible(e) {
|
|
1397
|
-
var
|
|
1391
|
+
var g, _;
|
|
1398
1392
|
const { eventType: t } = e;
|
|
1399
|
-
this._cursorChange = [
|
|
1393
|
+
this._cursorChange = [q.PointerDown, q.Dblclick].includes(t) ? Y.CursorChange : Y.StartEditor;
|
|
1400
1394
|
const i = this._editorBridgeService.getEditRectState();
|
|
1401
1395
|
if (i == null)
|
|
1402
1396
|
return;
|
|
@@ -1411,14 +1405,14 @@ let $e = class extends Me {
|
|
|
1411
1405
|
} = i, d = this._getEditorObject();
|
|
1412
1406
|
if (d == null)
|
|
1413
1407
|
return;
|
|
1414
|
-
const { scene:
|
|
1415
|
-
this._contextService.setContextValue(
|
|
1408
|
+
const { scene: v } = d;
|
|
1409
|
+
this._contextService.setContextValue(Re, !0);
|
|
1416
1410
|
const { documentModel: p } = s, m = this._getEditorSkeleton(h);
|
|
1417
1411
|
if (!m || !p)
|
|
1418
1412
|
return;
|
|
1419
1413
|
this._fitTextSize(r, o, m, s, a, c);
|
|
1420
1414
|
const f = p.getBody().dataStream.length - 2 || 0;
|
|
1421
|
-
(
|
|
1415
|
+
(g = v.getViewport(ht.VIEW_MAIN)) == null || g.scrollToViewportPos({
|
|
1422
1416
|
viewportScrollX: Number.POSITIVE_INFINITY
|
|
1423
1417
|
}), this._textSelectionManagerService.replaceTextRanges([
|
|
1424
1418
|
{
|
|
@@ -1428,7 +1422,7 @@ let $e = class extends Me {
|
|
|
1428
1422
|
]), (_ = this._renderManagerService.getRenderById(l)) == null || _.scene.resetCursor();
|
|
1429
1423
|
}
|
|
1430
1424
|
_resetBodyStyle(e, t = !1) {
|
|
1431
|
-
e.dataStream =
|
|
1425
|
+
e.dataStream = _i, 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 = [
|
|
1432
1426
|
{
|
|
1433
1427
|
startIndex: 0
|
|
1434
1428
|
}
|
|
@@ -1443,14 +1437,14 @@ let $e = class extends Me {
|
|
|
1443
1437
|
_showEditorByKeyboard(e) {
|
|
1444
1438
|
}
|
|
1445
1439
|
_commandExecutedListener(e) {
|
|
1446
|
-
const t = [
|
|
1440
|
+
const t = [we.id], i = [ki.id];
|
|
1447
1441
|
e.add(this._commandService.onCommandExecuted((r) => {
|
|
1448
|
-
this._editorService.getFocusId() ===
|
|
1442
|
+
this._editorService.getFocusId() === de && (t.includes(r.id) && this._moveCursorCmdHandler(r), i.includes(r.id) && this._editorBridgeService.isVisible() && this._editingChangedHandler());
|
|
1449
1443
|
}));
|
|
1450
1444
|
}
|
|
1451
1445
|
_moveCursorCmdHandler(e) {
|
|
1452
1446
|
const t = e.params, { keycode: i, isShift: r } = t;
|
|
1453
|
-
i != null && this._cursorChange ===
|
|
1447
|
+
i != null && this._cursorChange === Y.CursorChange ? this._moveInEditor(i, r) : this._editorBridgeService.changeVisible(t);
|
|
1454
1448
|
}
|
|
1455
1449
|
_editingChangedHandler() {
|
|
1456
1450
|
const e = this._editorBridgeService.getEditorRect();
|
|
@@ -1462,11 +1456,11 @@ let $e = class extends Me {
|
|
|
1462
1456
|
this._handleEditorVisible({ visible: !0, eventType: 3, unitId: i });
|
|
1463
1457
|
}
|
|
1464
1458
|
_getEditorObject() {
|
|
1465
|
-
return
|
|
1459
|
+
return jn(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
|
|
1466
1460
|
}
|
|
1467
1461
|
async _handleEditorInvisible(e) {
|
|
1468
1462
|
const { keycode: t } = e;
|
|
1469
|
-
if (this._cursorChange =
|
|
1463
|
+
if (this._cursorChange = Y.InitialState, this._exitInput(e), this._editorBridgeService.getEditRectState() == null)
|
|
1470
1464
|
return;
|
|
1471
1465
|
if (this._editorBridgeService.getEditorDirty() === !1) {
|
|
1472
1466
|
this._moveCursor(t);
|
|
@@ -1475,7 +1469,7 @@ let $e = class extends Me {
|
|
|
1475
1469
|
this._moveCursor(t);
|
|
1476
1470
|
}
|
|
1477
1471
|
_exitInput(e) {
|
|
1478
|
-
this._contextService.setContextValue(
|
|
1472
|
+
this._contextService.setContextValue(Re, !1), this._cellEditorManagerService.setState({
|
|
1479
1473
|
show: e.visible
|
|
1480
1474
|
});
|
|
1481
1475
|
const t = this._editorBridgeService.getCurrentEditorId();
|
|
@@ -1513,40 +1507,40 @@ let $e = class extends Me {
|
|
|
1513
1507
|
if (!t)
|
|
1514
1508
|
return;
|
|
1515
1509
|
const { document: i } = t;
|
|
1516
|
-
e.add(
|
|
1517
|
-
this._cursorChange ===
|
|
1510
|
+
e.add(St(i.onPointerDown$.subscribeEvent(() => {
|
|
1511
|
+
this._cursorChange === Y.StartEditor && (this._cursorChange = Y.CursorChange);
|
|
1518
1512
|
})));
|
|
1519
1513
|
}
|
|
1520
1514
|
// TODO: @JOCS, is it necessary to move these commands MoveSelectionOperation\MoveCursorOperation to shortcut? and use multi-commands?
|
|
1521
1515
|
_moveInEditor(e, t) {
|
|
1522
1516
|
let i = j.LEFT;
|
|
1523
|
-
e === P.ARROW_DOWN ? i = j.DOWN : e === P.ARROW_UP ? i = j.UP : e === P.ARROW_RIGHT && (i = j.RIGHT), t ? this._commandService.executeCommand(
|
|
1517
|
+
e === P.ARROW_DOWN ? i = j.DOWN : e === P.ARROW_UP ? i = j.UP : e === P.ARROW_RIGHT && (i = j.RIGHT), t ? this._commandService.executeCommand(Xi.id, {
|
|
1524
1518
|
direction: i
|
|
1525
|
-
}) : this._commandService.executeCommand(
|
|
1519
|
+
}) : this._commandService.executeCommand(Gi.id, {
|
|
1526
1520
|
direction: i
|
|
1527
1521
|
});
|
|
1528
1522
|
}
|
|
1529
1523
|
};
|
|
1530
|
-
|
|
1531
|
-
L(1,
|
|
1532
|
-
L(2,
|
|
1533
|
-
L(3,
|
|
1524
|
+
He = Un([
|
|
1525
|
+
L(1, wi),
|
|
1526
|
+
L(2, mi),
|
|
1527
|
+
L(3, fe),
|
|
1534
1528
|
L(4, y),
|
|
1535
|
-
L(5,
|
|
1536
|
-
L(6,
|
|
1537
|
-
L(7,
|
|
1538
|
-
L(8,
|
|
1529
|
+
L(5, G),
|
|
1530
|
+
L(6, Ze),
|
|
1531
|
+
L(7, qe),
|
|
1532
|
+
L(8, X(zi)),
|
|
1539
1533
|
L(9, U),
|
|
1540
|
-
L(10,
|
|
1541
|
-
L(11,
|
|
1542
|
-
],
|
|
1543
|
-
function
|
|
1534
|
+
L(10, X(Q)),
|
|
1535
|
+
L(11, Xe)
|
|
1536
|
+
], He);
|
|
1537
|
+
function jn(n, e) {
|
|
1544
1538
|
if (n == null)
|
|
1545
1539
|
return;
|
|
1546
1540
|
const t = e.getRenderById(n);
|
|
1547
1541
|
if (t == null)
|
|
1548
1542
|
return;
|
|
1549
|
-
const { mainComponent: i, scene: r, engine: s, components: o } = t, a = i, c = o.get(
|
|
1543
|
+
const { mainComponent: i, scene: r, engine: s, components: o } = t, a = i, c = o.get(Yi.BACKGROUND);
|
|
1550
1544
|
return {
|
|
1551
1545
|
document: a,
|
|
1552
1546
|
docBackground: c,
|
|
@@ -1554,12 +1548,12 @@ function Un(n, e) {
|
|
|
1554
1548
|
engine: s
|
|
1555
1549
|
};
|
|
1556
1550
|
}
|
|
1557
|
-
var
|
|
1558
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1551
|
+
var Ln = Object.getOwnPropertyDescriptor, An = (n, e, t, i) => {
|
|
1552
|
+
for (var r = i > 1 ? void 0 : i ? Ln(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
1559
1553
|
(o = n[s]) && (r = o(r) || r);
|
|
1560
1554
|
return r;
|
|
1561
|
-
},
|
|
1562
|
-
let
|
|
1555
|
+
}, je = (n, e) => (t, i) => e(t, i, n);
|
|
1556
|
+
let Fe = class extends ve {
|
|
1563
1557
|
constructor(e, t, i, r) {
|
|
1564
1558
|
super();
|
|
1565
1559
|
/**
|
|
@@ -1568,7 +1562,7 @@ let He = class extends he {
|
|
|
1568
1562
|
// private _cursorChange: CursorChange = CursorChange.InitialState;
|
|
1569
1563
|
/** If the corresponding unit is active and prepared for editing. */
|
|
1570
1564
|
// private _isUnitEditing = false;
|
|
1571
|
-
S(this, "setSlideTextEditor$", new
|
|
1565
|
+
S(this, "setSlideTextEditor$", new Nt());
|
|
1572
1566
|
S(this, "_curRichText", null);
|
|
1573
1567
|
S(this, "_d");
|
|
1574
1568
|
this._renderContext = e, this._instanceSrv = t, this._commandService = i, this._editorBridgeService = r, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(E.UNIVER_SLIDE).subscribe((s) => {
|
|
@@ -1576,7 +1570,7 @@ let He = class extends he {
|
|
|
1576
1570
|
}));
|
|
1577
1571
|
}
|
|
1578
1572
|
_init() {
|
|
1579
|
-
const e = new
|
|
1573
|
+
const e = new Ke();
|
|
1580
1574
|
return this._initEventListener(e), e;
|
|
1581
1575
|
}
|
|
1582
1576
|
_disposeCurrent() {
|
|
@@ -1604,7 +1598,7 @@ let He = class extends he {
|
|
|
1604
1598
|
})), e.add(o.onDblclick$.subscribeEvent(() => {
|
|
1605
1599
|
a.clearControls();
|
|
1606
1600
|
const h = a.getSelectedObjectMap().values().next().value;
|
|
1607
|
-
h && (h.objectType !==
|
|
1601
|
+
h && (h.objectType !== le.RICH_TEXT ? this.pickOtherObjects() : this.startEditing(o.sceneKey, h));
|
|
1608
1602
|
})), e.add(this._instanceSrv.focused$.subscribe((c) => {
|
|
1609
1603
|
this.endEditing();
|
|
1610
1604
|
})));
|
|
@@ -1664,15 +1658,15 @@ let He = class extends he {
|
|
|
1664
1658
|
var i, r;
|
|
1665
1659
|
e ? (i = this._curRichText) == null || i.hide() : (r = this._curRichText) == null || r.show();
|
|
1666
1660
|
const { unitId: t } = this._renderContext;
|
|
1667
|
-
this._editorBridgeService.changeVisible({ visible: e, eventType:
|
|
1661
|
+
this._editorBridgeService.changeVisible({ visible: e, eventType: q.PointerDown, unitId: t });
|
|
1668
1662
|
}
|
|
1669
1663
|
};
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
],
|
|
1675
|
-
const
|
|
1664
|
+
Fe = An([
|
|
1665
|
+
je(1, y),
|
|
1666
|
+
je(2, U),
|
|
1667
|
+
je(3, Ze)
|
|
1668
|
+
], Fe);
|
|
1669
|
+
const Kt = {
|
|
1676
1670
|
id: "slide.operation.activate-slide",
|
|
1677
1671
|
type: D.OPERATION,
|
|
1678
1672
|
handler: (n, e) => {
|
|
@@ -1684,39 +1678,39 @@ const zt = {
|
|
|
1684
1678
|
const c = (l = a.scene) == null ? void 0 : l.getTransformer();
|
|
1685
1679
|
return c && c.clearControls(), i.activePage(e.id, t), !0;
|
|
1686
1680
|
}
|
|
1687
|
-
},
|
|
1681
|
+
}, Xt = {
|
|
1688
1682
|
id: "slide.operation.append-slide",
|
|
1689
1683
|
type: D.OPERATION,
|
|
1690
1684
|
handler: (n, e) => {
|
|
1691
1685
|
const t = e.unitId;
|
|
1692
1686
|
return n.get(y).getUnit(t) ? (n.get(T).appendPage(t), !0) : !1;
|
|
1693
1687
|
}
|
|
1694
|
-
},
|
|
1688
|
+
}, Je = {
|
|
1695
1689
|
id: "slide.command.insert-float-image",
|
|
1696
1690
|
type: D.COMMAND,
|
|
1697
1691
|
handler: async (n, e) => {
|
|
1698
1692
|
var V;
|
|
1699
1693
|
const t = n.get(y), i = (V = t.getCurrentUnitForType(E.UNIVER_SLIDE)) == null ? void 0 : V.getUnitId();
|
|
1700
1694
|
if (!i) return !1;
|
|
1701
|
-
const s = await n.get(
|
|
1695
|
+
const s = await n.get(Ti).openFile({
|
|
1702
1696
|
multiple: !0,
|
|
1703
|
-
accept:
|
|
1697
|
+
accept: qi.map((R) => `.${R.replace("image/", "")}`).join(",")
|
|
1704
1698
|
});
|
|
1705
1699
|
if (s.length !== 1) return !1;
|
|
1706
|
-
const a = await n.get(
|
|
1700
|
+
const a = await n.get(Ji).saveImage(s[0]);
|
|
1707
1701
|
if (!a) return !1;
|
|
1708
|
-
const { imageId: c, imageSourceType: h, source: l, base64Cache: d } = a, { width:
|
|
1702
|
+
const { imageId: c, imageSourceType: h, source: l, base64Cache: d } = a, { width: v, height: p, image: m } = await Qi(d || ""), f = t.getUnit(i);
|
|
1709
1703
|
if (!f) return !1;
|
|
1710
|
-
const
|
|
1704
|
+
const g = f.getActivePage(), _ = Object.values(g.pageElements), I = _ != null && _.length ? Math.max(..._.map((R) => R.zIndex)) : 20, b = {
|
|
1711
1705
|
id: c,
|
|
1712
1706
|
zIndex: I + 1,
|
|
1713
1707
|
left: 0,
|
|
1714
1708
|
top: 0,
|
|
1715
|
-
width:
|
|
1709
|
+
width: v,
|
|
1716
1710
|
height: p,
|
|
1717
1711
|
title: "",
|
|
1718
1712
|
description: "",
|
|
1719
|
-
type:
|
|
1713
|
+
type: ke.IMAGE,
|
|
1720
1714
|
image: {
|
|
1721
1715
|
imageProperties: {
|
|
1722
1716
|
contentUrl: d,
|
|
@@ -1727,25 +1721,25 @@ const zt = {
|
|
|
1727
1721
|
}
|
|
1728
1722
|
}
|
|
1729
1723
|
};
|
|
1730
|
-
|
|
1731
|
-
const w = n.get(T), M = w.createObjectToPage(b,
|
|
1732
|
-
return M && w.setObjectActiveByPage(M,
|
|
1724
|
+
g.pageElements[c] = b, f.updatePage(g.id, g);
|
|
1725
|
+
const w = n.get(T), M = w.createObjectToPage(b, g.id, i);
|
|
1726
|
+
return M && w.setObjectActiveByPage(M, g.id, i), !0;
|
|
1733
1727
|
}
|
|
1734
|
-
},
|
|
1728
|
+
}, Qe = {
|
|
1735
1729
|
id: "slide.command.add-text",
|
|
1736
1730
|
type: D.COMMAND,
|
|
1737
1731
|
handler: async (n) => {
|
|
1738
1732
|
var r;
|
|
1739
1733
|
const e = n.get(U), i = (r = n.get(y).getFocusedUnit()) == null ? void 0 : r.getUnitId();
|
|
1740
|
-
return await e.executeCommand(
|
|
1734
|
+
return await e.executeCommand(Gt.id, { unitId: i });
|
|
1741
1735
|
}
|
|
1742
|
-
},
|
|
1736
|
+
}, Gt = {
|
|
1743
1737
|
id: "slide.operation.add-text",
|
|
1744
1738
|
type: D.OPERATION,
|
|
1745
1739
|
handler: async (n, e) => {
|
|
1746
|
-
const t = e.unitId, i =
|
|
1740
|
+
const t = e.unitId, i = Ct(6), r = 220, s = 40, o = 230, a = 142, c = (e == null ? void 0 : e.text) || "A New Text", l = n.get(y).getUnit(t);
|
|
1747
1741
|
if (!l) return !1;
|
|
1748
|
-
const d = l.getActivePage(),
|
|
1742
|
+
const d = l.getActivePage(), v = Object.values(d.pageElements), p = v != null && v.length ? Math.max(...v.map((_) => _.zIndex)) : 21, m = {
|
|
1749
1743
|
id: i,
|
|
1750
1744
|
zIndex: p + 1,
|
|
1751
1745
|
left: o,
|
|
@@ -1754,7 +1748,7 @@ const zt = {
|
|
|
1754
1748
|
height: s,
|
|
1755
1749
|
title: "text",
|
|
1756
1750
|
description: "",
|
|
1757
|
-
type:
|
|
1751
|
+
type: ke.TEXT,
|
|
1758
1752
|
richText: {
|
|
1759
1753
|
text: c,
|
|
1760
1754
|
fs: 30,
|
|
@@ -1765,46 +1759,45 @@ const zt = {
|
|
|
1765
1759
|
}
|
|
1766
1760
|
};
|
|
1767
1761
|
d.pageElements[i] = m, l.updatePage(d.id, d);
|
|
1768
|
-
const f = n.get(T),
|
|
1769
|
-
return
|
|
1762
|
+
const f = n.get(T), g = f.createObjectToPage(m, d.id, t);
|
|
1763
|
+
return g && f.setObjectActiveByPage(g, d.id, t), !0;
|
|
1770
1764
|
}
|
|
1771
|
-
},
|
|
1765
|
+
}, Yt = {
|
|
1772
1766
|
id: "slide.operation.set-slide-page-thumb",
|
|
1773
1767
|
type: D.OPERATION,
|
|
1774
1768
|
handler: (n, e) => (n.get(T).createThumbs(e.unitId), !0)
|
|
1775
1769
|
};
|
|
1776
|
-
function
|
|
1770
|
+
function Bn(n) {
|
|
1777
1771
|
var m, f;
|
|
1778
1772
|
const e = (f = (m = n.popup) == null ? void 0 : m.extraProps) == null ? void 0 : f.menuItems;
|
|
1779
1773
|
if (!e)
|
|
1780
1774
|
return null;
|
|
1781
|
-
const t =
|
|
1775
|
+
const t = x(U), i = x(Q), [r, s] = k(!1), [o, a] = k(!1), c = () => {
|
|
1782
1776
|
a(!0);
|
|
1783
1777
|
}, h = () => {
|
|
1784
1778
|
a(!1);
|
|
1785
|
-
}, l = (
|
|
1786
|
-
s(
|
|
1787
|
-
}, d = (
|
|
1788
|
-
t.executeCommand(
|
|
1789
|
-
},
|
|
1779
|
+
}, l = (g) => {
|
|
1780
|
+
s(g);
|
|
1781
|
+
}, d = (g) => {
|
|
1782
|
+
t.executeCommand(g.commandId, g.commandParams), s(!1);
|
|
1783
|
+
}, v = r || o, p = e.filter((g) => !g.disable);
|
|
1790
1784
|
return /* @__PURE__ */ u(
|
|
1791
1785
|
"div",
|
|
1792
1786
|
{
|
|
1793
1787
|
onMouseEnter: c,
|
|
1794
1788
|
onMouseLeave: h,
|
|
1795
1789
|
children: /* @__PURE__ */ u(
|
|
1796
|
-
|
|
1790
|
+
wt,
|
|
1797
1791
|
{
|
|
1798
1792
|
align: "start",
|
|
1799
1793
|
overlay: /* @__PURE__ */ u(
|
|
1800
1794
|
"ul",
|
|
1801
1795
|
{
|
|
1802
|
-
className: `
|
|
1796
|
+
className: K(`
|
|
1803
1797
|
univer-m-0 univer-box-border univer-grid univer-list-none univer-items-center univer-gap-1
|
|
1804
|
-
univer-rounded-lg univer-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
children: p.map((v) => /* @__PURE__ */ u(
|
|
1798
|
+
univer-rounded-lg univer-bg-white univer-p-1.5 univer-text-sm univer-shadow-lg
|
|
1799
|
+
`, ue),
|
|
1800
|
+
children: p.map((g) => /* @__PURE__ */ u(
|
|
1808
1801
|
"li",
|
|
1809
1802
|
{
|
|
1810
1803
|
className: `
|
|
@@ -1812,10 +1805,10 @@ function Ln(n) {
|
|
|
1812
1805
|
univer-items-center univer-rounded univer-text-sm univer-transition-colors
|
|
1813
1806
|
hover:univer-bg-gray-100
|
|
1814
1807
|
`,
|
|
1815
|
-
onClick: () => d(
|
|
1816
|
-
children: /* @__PURE__ */ u("span", { className: "univer-px-2 univer-py-1.5 univer-align-middle", children: i.t(
|
|
1808
|
+
onClick: () => d(g),
|
|
1809
|
+
children: /* @__PURE__ */ u("span", { className: "univer-px-2 univer-py-1.5 univer-align-middle", children: i.t(g.label) })
|
|
1817
1810
|
},
|
|
1818
|
-
|
|
1811
|
+
g.index
|
|
1819
1812
|
))
|
|
1820
1813
|
}
|
|
1821
1814
|
),
|
|
@@ -1824,15 +1817,14 @@ function Ln(n) {
|
|
|
1824
1817
|
children: /* @__PURE__ */ O(
|
|
1825
1818
|
"div",
|
|
1826
1819
|
{
|
|
1827
|
-
className:
|
|
1828
|
-
univer-flex univer-items-center univer-justify-center univer-rounded univer-
|
|
1829
|
-
|
|
1830
|
-
`, {
|
|
1820
|
+
className: K(`
|
|
1821
|
+
univer-flex univer-items-center univer-justify-center univer-rounded univer-bg-white univer-p-1
|
|
1822
|
+
`, ue, {
|
|
1831
1823
|
"univer-bg-gray-100": r
|
|
1832
1824
|
}),
|
|
1833
1825
|
children: [
|
|
1834
|
-
/* @__PURE__ */ u(
|
|
1835
|
-
|
|
1826
|
+
/* @__PURE__ */ u(jt, { className: "univer-fill-primary-600 univer-text-gray-900" }),
|
|
1827
|
+
v && /* @__PURE__ */ u(Ge, {})
|
|
1836
1828
|
]
|
|
1837
1829
|
}
|
|
1838
1830
|
)
|
|
@@ -1841,135 +1833,131 @@ function Ln(n) {
|
|
|
1841
1833
|
}
|
|
1842
1834
|
);
|
|
1843
1835
|
}
|
|
1844
|
-
function
|
|
1836
|
+
function $n() {
|
|
1845
1837
|
var m, f;
|
|
1846
|
-
const n =
|
|
1838
|
+
const n = x(y), e = x(U), t = x(G), i = x(Q), r = Mt(null), s = n.getCurrentUnitForType(E.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), a = s == null ? void 0 : s.getPageOrder();
|
|
1847
1839
|
if (!o || !a)
|
|
1848
1840
|
return null;
|
|
1849
|
-
const c = a.map((
|
|
1850
|
-
|
|
1851
|
-
const
|
|
1841
|
+
const c = a.map((g) => o[g]), [h, l] = k((f = (m = s == null ? void 0 : s.getActivePage()) == null ? void 0 : m.id) != null ? f : null), d = Hi(() => c.map(() => Fi()), [c]);
|
|
1842
|
+
he(() => {
|
|
1843
|
+
const g = s == null ? void 0 : s.activePage$.subscribe((_) => {
|
|
1852
1844
|
var b;
|
|
1853
1845
|
const I = (b = _ == null ? void 0 : _.id) != null ? b : null;
|
|
1854
1846
|
I && l(I);
|
|
1855
1847
|
});
|
|
1856
1848
|
return () => {
|
|
1857
|
-
|
|
1849
|
+
g == null || g.unsubscribe();
|
|
1858
1850
|
};
|
|
1859
|
-
}, []),
|
|
1860
|
-
d.forEach((
|
|
1851
|
+
}, []), he(() => {
|
|
1852
|
+
d.forEach((g, _) => {
|
|
1861
1853
|
var I;
|
|
1862
|
-
if (
|
|
1854
|
+
if (g.current) {
|
|
1863
1855
|
const b = c[_];
|
|
1864
|
-
(I = t.getRenderById(b.id)) == null || I.engine.setContainer(
|
|
1856
|
+
(I = t.getRenderById(b.id)) == null || I.engine.setContainer(g.current);
|
|
1865
1857
|
}
|
|
1866
|
-
}), d.length > 0 && e.syncExecuteCommand(
|
|
1858
|
+
}), d.length > 0 && e.syncExecuteCommand(Yt.id, { unitId: s == null ? void 0 : s.getUnitId() });
|
|
1867
1859
|
}, [d, c, t, e, s]);
|
|
1868
|
-
const
|
|
1869
|
-
e.syncExecuteCommand(
|
|
1870
|
-
}, [e, s]), p =
|
|
1871
|
-
e.syncExecuteCommand(
|
|
1860
|
+
const v = ct((g) => {
|
|
1861
|
+
e.syncExecuteCommand(Kt.id, { id: g, unitId: s == null ? void 0 : s.getUnitId() });
|
|
1862
|
+
}, [e, s]), p = ct(() => {
|
|
1863
|
+
e.syncExecuteCommand(Xt.id, { unitId: s == null ? void 0 : s.getUnitId() });
|
|
1872
1864
|
}, [e, s]);
|
|
1873
1865
|
return /* @__PURE__ */ u(
|
|
1874
1866
|
"aside",
|
|
1875
1867
|
{
|
|
1876
1868
|
ref: r,
|
|
1877
|
-
className:
|
|
1869
|
+
className: K(`
|
|
1878
1870
|
univer-flex univer-h-full univer-w-64 univer-flex-col univer-overflow-y-auto univer-overflow-x-hidden
|
|
1879
|
-
`,
|
|
1871
|
+
`, Bi),
|
|
1880
1872
|
children: /* @__PURE__ */ O("div", { className: "univer-px-4", children: [
|
|
1881
1873
|
/* @__PURE__ */ u("header", { className: "univer-flex univer-justify-center univer-pt-4", children: /* @__PURE__ */ u(
|
|
1882
1874
|
"a",
|
|
1883
1875
|
{
|
|
1884
|
-
className: `
|
|
1876
|
+
className: K(`
|
|
1885
1877
|
univer-box-border univer-block univer-h-8 univer-w-full univer-cursor-pointer
|
|
1886
|
-
univer-rounded-md univer-
|
|
1887
|
-
univer-
|
|
1888
|
-
`,
|
|
1878
|
+
univer-rounded-md univer-bg-white univer-text-center univer-text-sm univer-leading-8
|
|
1879
|
+
univer-transition-colors
|
|
1880
|
+
`, ue),
|
|
1889
1881
|
onClick: p,
|
|
1890
1882
|
children: i.t("slide.append")
|
|
1891
1883
|
}
|
|
1892
1884
|
) }),
|
|
1893
|
-
c.map((
|
|
1885
|
+
c.map((g, _) => /* @__PURE__ */ O(
|
|
1894
1886
|
"div",
|
|
1895
1887
|
{
|
|
1896
|
-
className:
|
|
1897
|
-
"[&>div]:univer-border-primary-600 [&>span]:univer-text-primary-600":
|
|
1888
|
+
className: K("univer-my-4 univer-flex univer-gap-2", {
|
|
1889
|
+
"[&>div]:univer-border-primary-600 [&>span]:univer-text-primary-600": g.id === h
|
|
1898
1890
|
}),
|
|
1899
|
-
onClick: () => g
|
|
1891
|
+
onClick: () => v(g.id),
|
|
1900
1892
|
children: [
|
|
1901
1893
|
/* @__PURE__ */ u("span", { children: _ + 1 }),
|
|
1902
1894
|
/* @__PURE__ */ u(
|
|
1903
1895
|
"div",
|
|
1904
1896
|
{
|
|
1905
1897
|
ref: d[_],
|
|
1906
|
-
className: `
|
|
1907
|
-
univer-relative univer-box-border univer-h-32 univer-w-52 univer-
|
|
1908
|
-
univer-border-solid univer-border-gray-200 univer-bg-white
|
|
1898
|
+
className: K(`
|
|
1899
|
+
univer-relative univer-box-border univer-h-32 univer-w-52 univer-bg-white
|
|
1909
1900
|
hover:univer-border-primary-600
|
|
1910
|
-
|
|
1901
|
+
`, ue)
|
|
1911
1902
|
}
|
|
1912
1903
|
)
|
|
1913
1904
|
]
|
|
1914
1905
|
},
|
|
1915
|
-
|
|
1906
|
+
g.id
|
|
1916
1907
|
))
|
|
1917
1908
|
] })
|
|
1918
1909
|
}
|
|
1919
1910
|
);
|
|
1920
1911
|
}
|
|
1921
|
-
const
|
|
1912
|
+
const Te = -1e3, pt = {
|
|
1922
1913
|
width: 0,
|
|
1923
1914
|
height: 0,
|
|
1924
|
-
top:
|
|
1925
|
-
left:
|
|
1926
|
-
},
|
|
1915
|
+
top: Te,
|
|
1916
|
+
left: Te
|
|
1917
|
+
}, Hn = () => {
|
|
1927
1918
|
const [n, e] = k({
|
|
1928
|
-
...
|
|
1929
|
-
}), t =
|
|
1930
|
-
() => r.subscribeContextValue$(
|
|
1919
|
+
...pt
|
|
1920
|
+
}), t = x(qe), i = x(Xe), r = x(fe), s = Mi(
|
|
1921
|
+
() => r.subscribeContextValue$(st),
|
|
1931
1922
|
!1,
|
|
1932
1923
|
void 0,
|
|
1933
|
-
[r,
|
|
1924
|
+
[r, st]
|
|
1934
1925
|
);
|
|
1935
|
-
return
|
|
1926
|
+
return Ci.UNSPECIFIED, he(() => {
|
|
1936
1927
|
t.state$.subscribe((o) => {
|
|
1937
1928
|
if (o == null)
|
|
1938
1929
|
return;
|
|
1939
1930
|
const {
|
|
1940
|
-
startX: a =
|
|
1941
|
-
startY: c =
|
|
1931
|
+
startX: a = Te,
|
|
1932
|
+
startY: c = Te,
|
|
1942
1933
|
endX: h = 0,
|
|
1943
1934
|
endY: l = 0,
|
|
1944
1935
|
show: d = !1
|
|
1945
1936
|
} = o;
|
|
1946
1937
|
if (!d)
|
|
1947
1938
|
e({
|
|
1948
|
-
...
|
|
1939
|
+
...pt
|
|
1949
1940
|
});
|
|
1950
1941
|
else {
|
|
1951
1942
|
e({
|
|
1952
|
-
width: h - a -
|
|
1953
|
-
height: l - c -
|
|
1954
|
-
left: a +
|
|
1955
|
-
top: c +
|
|
1943
|
+
width: h - a - ne + 2,
|
|
1944
|
+
height: l - c - ne + 2,
|
|
1945
|
+
left: a + ne,
|
|
1946
|
+
top: c + ne
|
|
1956
1947
|
});
|
|
1957
|
-
const
|
|
1958
|
-
if (
|
|
1948
|
+
const v = i.getEditor(de);
|
|
1949
|
+
if (v == null)
|
|
1959
1950
|
return;
|
|
1960
|
-
const { left: p, top: m, width: f, height:
|
|
1961
|
-
t.setRect({ left: p, top: m, width: f, height:
|
|
1951
|
+
const { left: p, top: m, width: f, height: g } = v.getBoundingClientRect();
|
|
1952
|
+
t.setRect({ left: p, top: m, width: f, height: g });
|
|
1962
1953
|
}
|
|
1963
1954
|
});
|
|
1964
|
-
}, []),
|
|
1955
|
+
}, []), he(() => {
|
|
1965
1956
|
s || t.setFocus(!0);
|
|
1966
1957
|
}, [s, n]), /* @__PURE__ */ u(
|
|
1967
1958
|
"div",
|
|
1968
1959
|
{
|
|
1969
|
-
className:
|
|
1970
|
-
univer-absolute univer-z-10 univer-box-border univer-flex univer-border univer-border-solid
|
|
1971
|
-
univer-border-gray-200
|
|
1972
|
-
`,
|
|
1960
|
+
className: K("univer-absolute univer-z-10 univer-box-border univer-flex", ue),
|
|
1973
1961
|
style: {
|
|
1974
1962
|
left: n.left,
|
|
1975
1963
|
top: n.top,
|
|
@@ -1978,184 +1966,184 @@ const Pe = -1e3, mt = {
|
|
|
1978
1966
|
}
|
|
1979
1967
|
}
|
|
1980
1968
|
);
|
|
1981
|
-
},
|
|
1982
|
-
function
|
|
1969
|
+
}, Zt = "addition-and-subtraction-single", qt = "slide.menu.image";
|
|
1970
|
+
function Fn(n) {
|
|
1983
1971
|
return {
|
|
1984
|
-
id:
|
|
1985
|
-
type:
|
|
1986
|
-
icon:
|
|
1972
|
+
id: qt,
|
|
1973
|
+
type: pe.SUBITEMS,
|
|
1974
|
+
icon: Zt,
|
|
1987
1975
|
tooltip: "slide.image.insert.title",
|
|
1988
|
-
hidden$:
|
|
1976
|
+
hidden$: me(n, E.UNIVER_SLIDE)
|
|
1989
1977
|
};
|
|
1990
1978
|
}
|
|
1991
|
-
function
|
|
1979
|
+
function Wn(n) {
|
|
1992
1980
|
return {
|
|
1993
|
-
id:
|
|
1981
|
+
id: Je.id,
|
|
1994
1982
|
title: "slide.image.insert.float",
|
|
1995
|
-
type:
|
|
1996
|
-
hidden$:
|
|
1983
|
+
type: pe.BUTTON,
|
|
1984
|
+
hidden$: me(n, E.UNIVER_SLIDE)
|
|
1997
1985
|
};
|
|
1998
1986
|
}
|
|
1999
|
-
const
|
|
2000
|
-
function
|
|
1987
|
+
const Jt = "graph-single", Qt = "slide.menu.shape";
|
|
1988
|
+
function zn(n) {
|
|
2001
1989
|
return {
|
|
2002
|
-
id:
|
|
2003
|
-
type:
|
|
2004
|
-
icon:
|
|
1990
|
+
id: Qt,
|
|
1991
|
+
type: pe.SUBITEMS,
|
|
1992
|
+
icon: Jt,
|
|
2005
1993
|
tooltip: "slide.shape.insert.title",
|
|
2006
|
-
hidden$:
|
|
1994
|
+
hidden$: me(n, E.UNIVER_SLIDE)
|
|
2007
1995
|
// disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
|
|
2008
1996
|
};
|
|
2009
1997
|
}
|
|
2010
|
-
function
|
|
1998
|
+
function kn(n) {
|
|
2011
1999
|
return {
|
|
2012
|
-
id:
|
|
2000
|
+
id: Ye.id,
|
|
2013
2001
|
title: "slide.shape.insert.rectangle",
|
|
2014
|
-
type:
|
|
2015
|
-
hidden$:
|
|
2002
|
+
type: pe.BUTTON,
|
|
2003
|
+
hidden$: me(n, E.UNIVER_SLIDE)
|
|
2016
2004
|
};
|
|
2017
2005
|
}
|
|
2018
|
-
const
|
|
2019
|
-
function
|
|
2006
|
+
const ei = "text-single";
|
|
2007
|
+
function Kn(n) {
|
|
2020
2008
|
return {
|
|
2021
|
-
id:
|
|
2022
|
-
type:
|
|
2023
|
-
icon:
|
|
2009
|
+
id: Qe.id,
|
|
2010
|
+
type: pe.BUTTON,
|
|
2011
|
+
icon: ei,
|
|
2024
2012
|
tooltip: "slide.text.insert.title",
|
|
2025
|
-
hidden$:
|
|
2013
|
+
hidden$: me(n, E.UNIVER_SLIDE)
|
|
2026
2014
|
};
|
|
2027
2015
|
}
|
|
2028
|
-
const
|
|
2029
|
-
[
|
|
2030
|
-
[
|
|
2016
|
+
const Xn = {
|
|
2017
|
+
[Ni.FORMAT]: {
|
|
2018
|
+
[Qe.id]: {
|
|
2031
2019
|
order: 0,
|
|
2032
|
-
menuItemFactory:
|
|
2020
|
+
menuItemFactory: Kn
|
|
2033
2021
|
},
|
|
2034
|
-
[
|
|
2022
|
+
[qt]: {
|
|
2035
2023
|
order: 0,
|
|
2036
|
-
menuItemFactory:
|
|
2037
|
-
[
|
|
2024
|
+
menuItemFactory: Fn,
|
|
2025
|
+
[Je.id]: {
|
|
2038
2026
|
order: 0,
|
|
2039
|
-
menuItemFactory:
|
|
2027
|
+
menuItemFactory: Wn
|
|
2040
2028
|
}
|
|
2041
2029
|
},
|
|
2042
|
-
[
|
|
2030
|
+
[Qt]: {
|
|
2043
2031
|
order: 0,
|
|
2044
|
-
menuItemFactory:
|
|
2045
|
-
[
|
|
2032
|
+
menuItemFactory: zn,
|
|
2033
|
+
[Ye.id]: {
|
|
2046
2034
|
order: 0,
|
|
2047
|
-
menuItemFactory:
|
|
2035
|
+
menuItemFactory: kn
|
|
2048
2036
|
}
|
|
2049
2037
|
}
|
|
2050
2038
|
}
|
|
2051
2039
|
};
|
|
2052
|
-
function
|
|
2053
|
-
return n.getContextValue(
|
|
2040
|
+
function We(n) {
|
|
2041
|
+
return n.getContextValue(Rt) && n.getContextValue(Re);
|
|
2054
2042
|
}
|
|
2055
|
-
function
|
|
2056
|
-
return n.getContextValue(
|
|
2043
|
+
function Gn(n) {
|
|
2044
|
+
return n.getContextValue(Si) && n.getContextValue(Rt);
|
|
2057
2045
|
}
|
|
2058
|
-
const
|
|
2046
|
+
const ti = [
|
|
2059
2047
|
P.ARROW_DOWN,
|
|
2060
2048
|
P.ARROW_UP,
|
|
2061
2049
|
P.ARROW_LEFT,
|
|
2062
2050
|
P.ARROW_RIGHT
|
|
2063
2051
|
];
|
|
2064
|
-
[P.ENTER, P.TAB, ...
|
|
2065
|
-
function
|
|
2052
|
+
[P.ENTER, P.TAB, ...ti];
|
|
2053
|
+
function Yn() {
|
|
2066
2054
|
const n = [];
|
|
2067
|
-
for (const e of
|
|
2055
|
+
for (const e of ti)
|
|
2068
2056
|
n.push({
|
|
2069
|
-
id:
|
|
2057
|
+
id: we.id,
|
|
2070
2058
|
binding: e,
|
|
2071
|
-
preconditions: (t) =>
|
|
2059
|
+
preconditions: (t) => We(t),
|
|
2072
2060
|
staticParameters: {
|
|
2073
2061
|
visible: !1,
|
|
2074
|
-
eventType:
|
|
2062
|
+
eventType: q.Keyboard,
|
|
2075
2063
|
keycode: e,
|
|
2076
2064
|
isShift: !1
|
|
2077
2065
|
}
|
|
2078
2066
|
}), n.push({
|
|
2079
|
-
id:
|
|
2080
|
-
binding: e |
|
|
2081
|
-
preconditions: (t) =>
|
|
2067
|
+
id: we.id,
|
|
2068
|
+
binding: e | Di.SHIFT,
|
|
2069
|
+
preconditions: (t) => We(t),
|
|
2082
2070
|
staticParameters: {
|
|
2083
2071
|
visible: !1,
|
|
2084
|
-
eventType:
|
|
2072
|
+
eventType: q.Keyboard,
|
|
2085
2073
|
keycode: e,
|
|
2086
2074
|
isShift: !0
|
|
2087
2075
|
}
|
|
2088
2076
|
});
|
|
2089
2077
|
return n;
|
|
2090
2078
|
}
|
|
2091
|
-
const
|
|
2092
|
-
id:
|
|
2093
|
-
preconditions: (n) =>
|
|
2079
|
+
const Zn = {
|
|
2080
|
+
id: Zi.id,
|
|
2081
|
+
preconditions: (n) => We(n) || Gn(n),
|
|
2094
2082
|
binding: P.BACKSPACE
|
|
2095
2083
|
};
|
|
2096
|
-
var
|
|
2097
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
2084
|
+
var qn = Object.getOwnPropertyDescriptor, Jn = (n, e, t, i) => {
|
|
2085
|
+
for (var r = i > 1 ? void 0 : i ? qn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
2098
2086
|
(o = n[s]) && (r = o(r) || r);
|
|
2099
2087
|
return r;
|
|
2100
|
-
},
|
|
2101
|
-
let
|
|
2088
|
+
}, ie = (n, e) => (t, i) => e(t, i, n);
|
|
2089
|
+
let Me = class extends De {
|
|
2102
2090
|
constructor(n, e, t, i, r, s) {
|
|
2103
2091
|
super(), this._injector = n, this._menuManagerService = e, this._componentManager = t, this._uiPartsService = i, this._commandService = r, this._shortcutService = s, this._initCommands(), this._initCustomComponents(), this._initUIComponents(), this._initMenus(), this._initShortcuts();
|
|
2104
2092
|
}
|
|
2105
2093
|
_initMenus() {
|
|
2106
|
-
this._menuManagerService.mergeMenu(
|
|
2094
|
+
this._menuManagerService.mergeMenu(Xn);
|
|
2107
2095
|
}
|
|
2108
2096
|
_initCustomComponents() {
|
|
2109
2097
|
const n = this._componentManager;
|
|
2110
|
-
this.disposeWithMe(n.register(
|
|
2098
|
+
this.disposeWithMe(n.register(Zt, Vt)), this.disposeWithMe(n.register(ei, Ft)), this.disposeWithMe(n.register(Jt, At)), this.disposeWithMe(n.register(kt, Bn)), this.disposeWithMe(n.register(Oe, On));
|
|
2111
2099
|
}
|
|
2112
2100
|
_initCommands() {
|
|
2113
2101
|
[
|
|
2114
|
-
kt,
|
|
2115
|
-
zt,
|
|
2116
2102
|
Xt,
|
|
2117
|
-
qe,
|
|
2118
2103
|
Kt,
|
|
2104
|
+
Yt,
|
|
2119
2105
|
Je,
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2106
|
+
Gt,
|
|
2107
|
+
Qe,
|
|
2108
|
+
zt,
|
|
2109
|
+
Ye,
|
|
2110
|
+
Be,
|
|
2111
|
+
Dt,
|
|
2124
2112
|
W,
|
|
2125
2113
|
// commands for editor
|
|
2126
|
-
|
|
2114
|
+
we
|
|
2127
2115
|
].forEach((n) => this.disposeWithMe(this._commandService.registerCommand(n)));
|
|
2128
2116
|
}
|
|
2129
2117
|
_initUIComponents() {
|
|
2130
2118
|
this.disposeWithMe(
|
|
2131
|
-
this._uiPartsService.registerComponent(
|
|
2119
|
+
this._uiPartsService.registerComponent(ot.LEFT_SIDEBAR, () => at($n, this._injector))
|
|
2132
2120
|
), this.disposeWithMe(
|
|
2133
|
-
this._uiPartsService.registerComponent(
|
|
2121
|
+
this._uiPartsService.registerComponent(ot.CONTENT, () => at(Hn, this._injector))
|
|
2134
2122
|
);
|
|
2135
2123
|
}
|
|
2136
2124
|
_initShortcuts() {
|
|
2137
2125
|
[
|
|
2138
|
-
|
|
2139
|
-
...
|
|
2126
|
+
Zn,
|
|
2127
|
+
...Yn()
|
|
2140
2128
|
].forEach((n) => {
|
|
2141
2129
|
this.disposeWithMe(this._shortcutService.registerShortcut(n));
|
|
2142
2130
|
});
|
|
2143
2131
|
}
|
|
2144
2132
|
};
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
],
|
|
2153
|
-
var
|
|
2154
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
2133
|
+
Me = Jn([
|
|
2134
|
+
ie(0, X(ze)),
|
|
2135
|
+
ie(1, Ui),
|
|
2136
|
+
ie(2, X(Vi)),
|
|
2137
|
+
ie(3, ji),
|
|
2138
|
+
ie(4, U),
|
|
2139
|
+
ie(5, Li)
|
|
2140
|
+
], Me);
|
|
2141
|
+
var Qn = Object.getOwnPropertyDescriptor, er = (n, e, t, i) => {
|
|
2142
|
+
for (var r = i > 1 ? void 0 : i ? Qn(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
2155
2143
|
(o = n[s]) && (r = o(r) || r);
|
|
2156
2144
|
return r;
|
|
2157
|
-
},
|
|
2158
|
-
let
|
|
2145
|
+
}, Le = (n, e) => (t, i) => e(t, i, n);
|
|
2146
|
+
let Ne = class extends ve {
|
|
2159
2147
|
// private _skeletonChangeMutations = new Set<string>();
|
|
2160
2148
|
constructor(n, e, t) {
|
|
2161
2149
|
super(), this._contextService = n, this._instanceSrv = e, this._renderManagerService = t, Promise.resolve().then(() => this._init());
|
|
@@ -2164,11 +2152,11 @@ let Te = class extends he {
|
|
|
2164
2152
|
this._initSlideDataListener(), this._initContextListener();
|
|
2165
2153
|
}
|
|
2166
2154
|
_initSlideDataListener() {
|
|
2167
|
-
this._instanceSrv.getTypeOfUnitAdded$(E.UNIVER_SLIDE).pipe(
|
|
2155
|
+
this._instanceSrv.getTypeOfUnitAdded$(E.UNIVER_SLIDE).pipe(lt(this.dispose$)).subscribe((n) => {
|
|
2168
2156
|
this._createRenderer(n == null ? void 0 : n.getUnitId());
|
|
2169
2157
|
}), this._instanceSrv.getAllUnitsForType(E.UNIVER_SLIDE).forEach((n) => {
|
|
2170
2158
|
this._createRenderer(n.getUnitId());
|
|
2171
|
-
}), this._instanceSrv.getTypeOfUnitDisposed$(E.UNIVER_SLIDE).pipe(
|
|
2159
|
+
}), this._instanceSrv.getTypeOfUnitDisposed$(E.UNIVER_SLIDE).pipe(lt(this.dispose$)).subscribe((n) => this._disposeRenderer(n));
|
|
2172
2160
|
}
|
|
2173
2161
|
_createRenderer(n) {
|
|
2174
2162
|
n == null || this._instanceSrv.getUnit(n, E.UNIVER_SLIDE) == null || this._renderManagerService.createRender(n);
|
|
@@ -2180,44 +2168,44 @@ let Te = class extends he {
|
|
|
2180
2168
|
_initContextListener() {
|
|
2181
2169
|
}
|
|
2182
2170
|
};
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
],
|
|
2188
|
-
var
|
|
2189
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
2171
|
+
Ne = er([
|
|
2172
|
+
Le(0, fe),
|
|
2173
|
+
Le(1, y),
|
|
2174
|
+
Le(2, G)
|
|
2175
|
+
], Ne);
|
|
2176
|
+
var tr = Object.getOwnPropertyDescriptor, ir = (n, e, t, i) => {
|
|
2177
|
+
for (var r = i > 1 ? void 0 : i ? tr(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
2190
2178
|
(o = n[s]) && (r = o(r) || r);
|
|
2191
2179
|
return r;
|
|
2192
|
-
},
|
|
2193
|
-
const
|
|
2194
|
-
var
|
|
2195
|
-
let
|
|
2196
|
-
constructor(n =
|
|
2180
|
+
}, be = (n, e) => (t, i) => e(t, i, n);
|
|
2181
|
+
const nr = "SLIDE_UI";
|
|
2182
|
+
var Ee;
|
|
2183
|
+
let _t = (Ee = class extends Ii {
|
|
2184
|
+
constructor(n = gt, e, t, i, r) {
|
|
2197
2185
|
super(), this._config = n, this._injector = e, this._renderManagerService = t, this._univerInstanceService = i, this._configService = r;
|
|
2198
|
-
const { menu: s, ...o } =
|
|
2186
|
+
const { menu: s, ...o } = bi(
|
|
2199
2187
|
{},
|
|
2200
|
-
|
|
2188
|
+
gt,
|
|
2201
2189
|
this._config
|
|
2202
2190
|
);
|
|
2203
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
2191
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(on, o);
|
|
2204
2192
|
}
|
|
2205
2193
|
onStarting() {
|
|
2206
|
-
|
|
2207
|
-
[
|
|
2208
|
-
[
|
|
2194
|
+
tt([
|
|
2195
|
+
[Ne],
|
|
2196
|
+
[Ze, { useClass: $e }],
|
|
2209
2197
|
// used by SlideUIController --> EditorContainer
|
|
2210
|
-
[
|
|
2211
|
-
[
|
|
2198
|
+
[qe, { useClass: Nn }],
|
|
2199
|
+
[ye]
|
|
2212
2200
|
], this._config.override).forEach((n) => this._injector.add(n));
|
|
2213
2201
|
}
|
|
2214
2202
|
onReady() {
|
|
2215
2203
|
[
|
|
2216
2204
|
// SlideRenderService will be init in ready stage, and then calling RenderManagerService@createRender --> init all deps in this rendering register block.
|
|
2217
|
-
[
|
|
2205
|
+
[ge]
|
|
2218
2206
|
].forEach((n) => {
|
|
2219
2207
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(E.UNIVER_SLIDE, n));
|
|
2220
|
-
}),
|
|
2208
|
+
}), tt([
|
|
2221
2209
|
[T],
|
|
2222
2210
|
// cannot register in _renderManagerService now.
|
|
2223
2211
|
// [ISlideEditorBridgeService, { useClass: SlideEditorBridgeService }],
|
|
@@ -2225,26 +2213,26 @@ let pt = (Ie = class extends Ci {
|
|
|
2225
2213
|
// [ISlideEditorManagerService, { useClass: SlideEditorManagerService }],
|
|
2226
2214
|
// SlidesUIController controller should be registered in Ready stage.
|
|
2227
2215
|
// SlidesUIController controller would add a new RenderUnit (__INTERNAL_EDITOR__DOCS_NORMAL)
|
|
2228
|
-
[
|
|
2216
|
+
[Me],
|
|
2229
2217
|
// editor service was create in renderManagerService
|
|
2230
|
-
[
|
|
2231
|
-
[
|
|
2218
|
+
[ge],
|
|
2219
|
+
[Pe]
|
|
2232
2220
|
], this._config.override).forEach((n) => {
|
|
2233
2221
|
this._injector.add(n);
|
|
2234
|
-
}), this._injector.get(T), this._injector.get(
|
|
2222
|
+
}), this._injector.get(T), this._injector.get(Ne);
|
|
2235
2223
|
}
|
|
2236
2224
|
onRendered() {
|
|
2237
2225
|
[
|
|
2238
2226
|
// need slideEditorBridgeService
|
|
2239
2227
|
// need TextSelectionRenderService which init by EditorContainer
|
|
2240
|
-
[
|
|
2241
|
-
[
|
|
2228
|
+
[Fe],
|
|
2229
|
+
[He]
|
|
2242
2230
|
].forEach((n) => {
|
|
2243
2231
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(E.UNIVER_SLIDE, n));
|
|
2244
|
-
}), this._markSlideAsFocused(), this._injector.get(
|
|
2232
|
+
}), this._markSlideAsFocused(), this._injector.get(Me);
|
|
2245
2233
|
}
|
|
2246
2234
|
onSteady() {
|
|
2247
|
-
this._injector.get(
|
|
2235
|
+
this._injector.get(Pe);
|
|
2248
2236
|
}
|
|
2249
2237
|
_markSlideAsFocused() {
|
|
2250
2238
|
const n = this._univerInstanceService;
|
|
@@ -2254,33 +2242,33 @@ let pt = (Ie = class extends Ci {
|
|
|
2254
2242
|
} catch {
|
|
2255
2243
|
}
|
|
2256
2244
|
}
|
|
2257
|
-
}, S(
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
],
|
|
2245
|
+
}, S(Ee, "pluginName", nr), S(Ee, "type", E.UNIVER_SLIDE), Ee);
|
|
2246
|
+
_t = ir([
|
|
2247
|
+
be(1, X(ze)),
|
|
2248
|
+
be(2, G),
|
|
2249
|
+
be(3, y),
|
|
2250
|
+
be(4, Ei)
|
|
2251
|
+
], _t);
|
|
2264
2252
|
export {
|
|
2265
|
-
|
|
2266
|
-
|
|
2253
|
+
Kt as ActivateSlidePageOperation,
|
|
2254
|
+
Xt as AppendSlideOperation,
|
|
2267
2255
|
T as CanvasView,
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2256
|
+
Dt as DeleteSlideElementOperation,
|
|
2257
|
+
Ze as ISlideEditorBridgeService,
|
|
2258
|
+
Je as InsertSlideFloatImageCommand,
|
|
2259
|
+
Ye as InsertSlideShapeRectangleCommand,
|
|
2260
|
+
zt as InsertSlideShapeRectangleOperation,
|
|
2261
|
+
Qt as SHAPE_MENU_ID,
|
|
2262
|
+
qt as SLIDES_IMAGE_MENU_ID,
|
|
2263
|
+
de as SLIDE_EDITOR_ID,
|
|
2264
|
+
Yt as SetSlidePageThumbOperation,
|
|
2265
|
+
Qe as SlideAddTextCommand,
|
|
2266
|
+
Gt as SlideAddTextOperation,
|
|
2267
|
+
ye as SlideCanvasPopMangerService,
|
|
2268
|
+
Hn as SlideEditorContainer,
|
|
2269
|
+
$n as SlideSideBar,
|
|
2270
|
+
Me as SlidesUIController,
|
|
2271
|
+
Xn as SlidesUIMenuSchema,
|
|
2272
|
+
_t as UniverSlidesUIPlugin,
|
|
2285
2273
|
W as UpdateSlideElementOperation
|
|
2286
2274
|
};
|