@univerjs/slides-ui 0.6.0-nightly.202502141606 → 0.6.0-nightly.202502161605
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 +2 -2
- package/lib/es/index.js +650 -630
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
package/lib/es/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var I = (i, e, t) =>
|
|
4
|
-
import { Inject as
|
|
5
|
-
import {
|
|
6
|
-
import { ObjectProvider as
|
|
7
|
-
import { useDependency as x, ISidebarService as Tt, ICanvasPopupService as wn,
|
|
8
|
-
import { jsxs as R, jsx as
|
|
9
|
-
import { Button as
|
|
10
|
-
import
|
|
11
|
-
import { BehaviorSubject as Q, Subject as
|
|
12
|
-
import { DocSelectionManagerService as
|
|
13
|
-
import { IEditorService as
|
|
1
|
+
var mn = Object.defineProperty;
|
|
2
|
+
var un = (i, e, t) => e in i ? mn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var I = (i, e, t) => un(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Inject as Y, Injector as Ke, RxDisposable as Ce, UniverInstanceType as E, debounce as gn, getColorStyle as hn, IUniverInstanceService as y, CommandType as V, Tools as pn, LocaleService as ee, ICommandService as j, generateRandomId as St, PageElementType as Ge, BasicShapes as Cn, Disposable as Ve, DisposableCollection as Xe, toDisposable as It, FOCUSING_COMMON_DRAWINGS as fn, IContextService as fe, createInternalEditorID as vn, createIdentifier as Pt, EDITOR_ACTIVATED as xe, FOCUSING_EDITOR_STANDALONE as bt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Et, DocumentDataModel as _n, VerticalAlign as ye, HorizontalAlign as Rt, WrapStrategy as tt, FOCUSING_EDITOR_BUT_HIDDEN as Sn, DEFAULT_EMPTY_DOCUMENT_VALUE as Ot, Direction as L, IUndoRedoService as In, DocumentFlavor as Pn, FOCUSING_UNIVER_EDITOR as xt, FORMULA_EDITOR_ACTIVATED as bn, Plugin as En, merge as Rn, mergeOverrideWithDependencies as nt, IConfigService as On } from "@univerjs/core";
|
|
5
|
+
import { Viewport as it, ScrollBar as yt, Slide as xn, Rect as Mt, Scene as yn, IRenderManagerService as Z, ObjectType as ge, pxToNum as Mn, DeviceInputEventType as J, convertTextRotation as rt, FIX_ONE_PIXEL_BLUR_OFFSET as se, fixLineWidthByScale as st } from "@univerjs/engine-render";
|
|
6
|
+
import { ObjectProvider as Tn, SLIDE_KEY as oe } from "@univerjs/slides";
|
|
7
|
+
import { useDependency as x, ISidebarService as Tt, ICanvasPopupService as wn, KeyCode as M, ILayoutService as Nn, ILocalFileService as Dn, useObservable as Un, DISABLE_AUTO_FOCUS_KEY as ot, MenuItemType as ve, getMenuHiddenObservable as _e, RibbonStartGroup as Vn, MetaKeys as jn, ComponentManager as Bn, BuiltInUIPart as at, connectInjector as ct, IMenuManagerService as Ln, IUIPartsService as An, IShortcutService as $n } from "@univerjs/ui";
|
|
8
|
+
import { jsxs as R, jsx as m } from "react/jsx-runtime";
|
|
9
|
+
import { Button as Pe, DropdownLegacy as wt, ColorPicker as Hn, InputNumber as me, Scrollbar as Fn } from "@univerjs/design";
|
|
10
|
+
import Nt, { forwardRef as $, useRef as Dt, createElement as H, useState as X, useEffect as he, useMemo as zn, useCallback as lt } from "react";
|
|
11
|
+
import { BehaviorSubject as Q, Subject as Ut, filter as Wn, takeUntil as dt } from "rxjs";
|
|
12
|
+
import { DocSelectionManagerService as Kn, DocSkeletonManagerService as mt, RichTextEditingMutation as Gn } from "@univerjs/docs";
|
|
13
|
+
import { IEditorService as Ye, DocSelectionRenderService as ut, VIEWPORT_KEY as gt, DOCS_COMPONENT_MAIN_LAYER_INDEX as Xn, MoveSelectionOperation as Yn, MoveCursorOperation as Zn, DOCS_VIEW_KEY as kn, DeleteLeftCommand as qn } from "@univerjs/docs-ui";
|
|
14
14
|
import { DRAWING_IMAGE_ALLOW_IMAGE_LIST as Jn, IImageIoService as Qn, getImageSize as ei } from "@univerjs/drawing";
|
|
15
|
-
var ti = Object.
|
|
16
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
17
|
-
(o = i[s]) && (r = o(r) || r);
|
|
18
|
-
return r;
|
|
19
|
-
},
|
|
20
|
-
let
|
|
15
|
+
var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ii = (i, e, t, n) => {
|
|
16
|
+
for (var r = n > 1 ? void 0 : n ? ni(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
17
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
18
|
+
return n && r && ti(e, t, r), r;
|
|
19
|
+
}, je = (i, e) => (t, n) => e(t, n, i);
|
|
20
|
+
let pe = class extends Ce {
|
|
21
21
|
constructor(e, t, n, r) {
|
|
22
22
|
super();
|
|
23
23
|
I(this, "_objectProvider", null);
|
|
24
|
-
I(this, "_refreshThumb",
|
|
24
|
+
I(this, "_refreshThumb", gn(() => {
|
|
25
25
|
this.createThumbs();
|
|
26
26
|
}, 300));
|
|
27
|
-
this._renderContext = e, this._injector = t, this._univerInstanceService = n, this._renderManagerService = r, this._objectProvider = this._injector.createInstance(
|
|
27
|
+
this._renderContext = e, this._injector = t, this._univerInstanceService = n, this._renderManagerService = r, this._objectProvider = this._injector.createInstance(Tn), this._addNewRender();
|
|
28
28
|
}
|
|
29
29
|
_addNewRender() {
|
|
30
30
|
const { unitId: e, engine: t, scene: n } = this._renderContext, r = this._getCurrUnitModel();
|
|
@@ -46,17 +46,17 @@ let ve = class extends pe {
|
|
|
46
46
|
explicitViewportHeightSet: !1,
|
|
47
47
|
isWheelPreventDefaultX: !0
|
|
48
48
|
});
|
|
49
|
-
n.attachControl(), n.onMouseWheel$.subscribeEvent((c,
|
|
49
|
+
n.attachControl(), n.onMouseWheel$.subscribeEvent((c, g) => {
|
|
50
50
|
const l = c;
|
|
51
51
|
if (l.ctrlKey) {
|
|
52
52
|
const d = Math.abs(l.deltaX);
|
|
53
|
-
let
|
|
54
|
-
|
|
53
|
+
let p = d < 40 ? 0.2 : d < 80 ? 0.4 : 0.2;
|
|
54
|
+
p *= l.deltaY > 0 ? -1 : 1, n.scaleX < 1 && (p /= 2), n.scaleX + p > 4 ? n.scale(4, 4) : n.scaleX + p < 0.1 ? n.scale(0.1, 0.1) : (l.deltaY > 0, l.preventDefault());
|
|
55
55
|
} else
|
|
56
|
-
o.onMouseWheel(l,
|
|
56
|
+
o.onMouseWheel(l, g);
|
|
57
57
|
}), n.onFileLoaded$.subscribeEvent(() => {
|
|
58
58
|
this._refreshThumb();
|
|
59
|
-
}),
|
|
59
|
+
}), yt.attachTo(o), this._renderManagerService.setCurrent(e);
|
|
60
60
|
const a = this._createSlide(n);
|
|
61
61
|
this._renderContext.mainComponent = a, this._createSlidePages(r, a), this.createThumbs(), t.runRenderLoop(() => {
|
|
62
62
|
n.render();
|
|
@@ -89,7 +89,7 @@ let ve = class extends pe {
|
|
|
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 Mt("canvas", {
|
|
93
93
|
left: 0,
|
|
94
94
|
top: 0,
|
|
95
95
|
width: s,
|
|
@@ -117,8 +117,8 @@ let ve = class extends pe {
|
|
|
117
117
|
const { engine: r } = n;
|
|
118
118
|
if (r == null)
|
|
119
119
|
return;
|
|
120
|
-
const { width: s, height: o } = t, { width: a = s, height: c = o } = r,
|
|
121
|
-
t.renderToThumb(
|
|
120
|
+
const { width: s, height: o } = t, { width: a = s, height: c = o } = r, g = r.getCanvas().getContext();
|
|
121
|
+
t.renderToThumb(g, e, a / s, c / o);
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* CreateScene by pages, and activate first one.
|
|
@@ -151,10 +151,10 @@ let ve = class extends pe {
|
|
|
151
151
|
if (t)
|
|
152
152
|
r = n.getPage(t);
|
|
153
153
|
else {
|
|
154
|
-
const c = n.getPages(),
|
|
155
|
-
if (
|
|
154
|
+
const c = n.getPages(), g = n.getPageOrder();
|
|
155
|
+
if (g == null || c == null)
|
|
156
156
|
return;
|
|
157
|
-
r = c[
|
|
157
|
+
r = c[g[0]], t = r.id;
|
|
158
158
|
}
|
|
159
159
|
const s = this._currentRender();
|
|
160
160
|
if (r == null || s == null || s.mainComponent == null)
|
|
@@ -183,11 +183,11 @@ let ve = class extends pe {
|
|
|
183
183
|
const n = this._renderContext;
|
|
184
184
|
if (!n || !this._objectProvider)
|
|
185
185
|
return;
|
|
186
|
-
const { scene: r, mainComponent: s } = n, o = s, { width: a, height: c } = o,
|
|
186
|
+
const { scene: r, mainComponent: s } = n, o = s, { width: a, height: c } = o, g = new yn(e, o, {
|
|
187
187
|
width: a,
|
|
188
188
|
height: c
|
|
189
189
|
});
|
|
190
|
-
new it(`PageViewer_${e}`,
|
|
190
|
+
new it(`PageViewer_${e}`, g, {
|
|
191
191
|
left: 0,
|
|
192
192
|
top: 0,
|
|
193
193
|
bottom: 0,
|
|
@@ -195,17 +195,17 @@ let ve = class extends pe {
|
|
|
195
195
|
explicitViewportWidthSet: !1,
|
|
196
196
|
explicitViewportHeightSet: !1
|
|
197
197
|
}).closeClip();
|
|
198
|
-
const { pageElements: d, pageBackgroundFill:
|
|
199
|
-
if (!
|
|
200
|
-
this._addBackgroundRect(
|
|
201
|
-
|
|
198
|
+
const { pageElements: d, pageBackgroundFill: p } = t, v = this._objectProvider.convertToRenderObjects(d, r);
|
|
199
|
+
if (!v || !o) return;
|
|
200
|
+
this._addBackgroundRect(g, p), g.addObjects(v), g.initTransformer(), v.forEach((C) => {
|
|
201
|
+
g.attachTransformerTo(C);
|
|
202
202
|
});
|
|
203
|
-
const
|
|
204
|
-
return
|
|
203
|
+
const f = g.getTransformer();
|
|
204
|
+
return f == null || f.changeEnd$.subscribe(() => {
|
|
205
205
|
this._thumbSceneRender(e, o);
|
|
206
|
-
}),
|
|
206
|
+
}), f == null || f.clearControl$.subscribe(() => {
|
|
207
207
|
this._thumbSceneRender(e, o);
|
|
208
|
-
}), o.addPageScene(
|
|
208
|
+
}), o.addPageScene(g), g;
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Get pageScene from Slide.
|
|
@@ -249,22 +249,22 @@ let ve = class extends pe {
|
|
|
249
249
|
s && o && s.addPageScene(o), e.appendPage(t), e.setActivePage(t);
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
],
|
|
257
|
-
var
|
|
258
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
259
|
-
(o = i[s]) && (r = o(r) || r);
|
|
260
|
-
return r;
|
|
261
|
-
},
|
|
262
|
-
let N = class extends
|
|
252
|
+
pe = ii([
|
|
253
|
+
je(1, Y(Ke)),
|
|
254
|
+
je(2, y),
|
|
255
|
+
je(3, Z)
|
|
256
|
+
], pe);
|
|
257
|
+
var ri = Object.defineProperty, si = Object.getOwnPropertyDescriptor, oi = (i, e, t, n) => {
|
|
258
|
+
for (var r = n > 1 ? void 0 : n ? si(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
259
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
260
|
+
return n && r && ri(e, t, r), r;
|
|
261
|
+
}, ai = (i, e) => (t, n) => e(t, n, i);
|
|
262
|
+
let N = class extends Ce {
|
|
263
263
|
constructor(i) {
|
|
264
264
|
super(), this._renderManagerService = i;
|
|
265
265
|
}
|
|
266
266
|
_getSlideRenderControllerFromRenderUnit(i) {
|
|
267
|
-
return this._renderManagerService.getRenderById(i).with(
|
|
267
|
+
return this._renderManagerService.getRenderById(i).with(pe);
|
|
268
268
|
}
|
|
269
269
|
createThumbs(i) {
|
|
270
270
|
this._getSlideRenderControllerFromRenderUnit(i).createThumbs();
|
|
@@ -291,10 +291,10 @@ let N = class extends pe {
|
|
|
291
291
|
this._getSlideRenderControllerFromRenderUnit(i).appendPage();
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
N =
|
|
295
|
-
|
|
294
|
+
N = oi([
|
|
295
|
+
ai(0, Z)
|
|
296
296
|
], N);
|
|
297
|
-
const
|
|
297
|
+
const ci = "slides-ui.config", ht = {}, Vt = {
|
|
298
298
|
id: "slide.operation.delete-element",
|
|
299
299
|
type: V.OPERATION,
|
|
300
300
|
handler: (i, e) => {
|
|
@@ -313,7 +313,7 @@ var U = function() {
|
|
|
313
313
|
}
|
|
314
314
|
return i;
|
|
315
315
|
}, U.apply(this, arguments);
|
|
316
|
-
},
|
|
316
|
+
}, li = function(i, e) {
|
|
317
317
|
var t = {};
|
|
318
318
|
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
|
|
319
319
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -321,15 +321,15 @@ var U = function() {
|
|
|
321
321
|
e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (t[n[r]] = i[n[r]]);
|
|
322
322
|
return t;
|
|
323
323
|
}, F = $(function(i, e) {
|
|
324
|
-
var t = i.icon, n = i.id, r = i.className, s = i.extend, o =
|
|
325
|
-
return
|
|
324
|
+
var t = i.icon, n = i.id, r = i.className, s = i.extend, o = li(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), c = Dt("_".concat(ui()));
|
|
325
|
+
return jt(t, "".concat(n), { defIds: t.defIds, idSuffix: c.current }, U({ ref: e, className: a }, o), s);
|
|
326
326
|
});
|
|
327
|
-
function
|
|
328
|
-
return H(i.tag, U(U({ key: e },
|
|
329
|
-
return
|
|
327
|
+
function jt(i, e, t, n, r) {
|
|
328
|
+
return H(i.tag, U(U({ key: e }, di(i, t, r)), n), (mi(i, t).children || []).map(function(s, o) {
|
|
329
|
+
return jt(s, "".concat(e, "-").concat(i.tag, "-").concat(o), t, void 0, r);
|
|
330
330
|
}));
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function di(i, e, t) {
|
|
333
333
|
var n = U({}, i.attrs);
|
|
334
334
|
t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
|
|
335
335
|
var r = e.defIds;
|
|
@@ -338,13 +338,13 @@ function ci(i, e, t) {
|
|
|
338
338
|
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
339
339
|
})), n;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function mi(i, e) {
|
|
342
342
|
var t, n = e.defIds;
|
|
343
343
|
return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? U(U({}, i), { children: i.children.map(function(r) {
|
|
344
344
|
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? U(U({}, r), { attrs: U(U({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
345
345
|
}) }) : i;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function ui() {
|
|
348
348
|
return Math.random().toString(36).substring(2, 8);
|
|
349
349
|
}
|
|
350
350
|
F.displayName = "UniverIcon";
|
|
@@ -356,227 +356,231 @@ var gi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
|
|
|
356
356
|
}));
|
|
357
357
|
});
|
|
358
358
|
Bt.displayName = "AddImageSingle";
|
|
359
|
-
var
|
|
359
|
+
var hi = { 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" } }] }, Lt = $(function(i, e) {
|
|
360
360
|
return H(F, Object.assign({}, i, {
|
|
361
361
|
id: "autofill",
|
|
362
362
|
ref: e,
|
|
363
|
-
icon:
|
|
363
|
+
icon: hi
|
|
364
364
|
}));
|
|
365
365
|
});
|
|
366
366
|
Lt.displayName = "Autofill";
|
|
367
|
-
var
|
|
367
|
+
var pi = { 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" } }] }, At = $(function(i, e) {
|
|
368
368
|
return H(F, Object.assign({}, i, {
|
|
369
369
|
id: "bottom-single",
|
|
370
370
|
ref: e,
|
|
371
|
-
icon:
|
|
371
|
+
icon: pi
|
|
372
372
|
}));
|
|
373
373
|
});
|
|
374
|
-
|
|
375
|
-
var
|
|
374
|
+
At.displayName = "BottomSingle";
|
|
375
|
+
var Ci = { 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"] }, $t = $(function(i, e) {
|
|
376
376
|
return H(F, Object.assign({}, i, {
|
|
377
377
|
id: "graph-single",
|
|
378
378
|
ref: e,
|
|
379
|
-
icon:
|
|
379
|
+
icon: Ci
|
|
380
380
|
}));
|
|
381
381
|
});
|
|
382
|
-
|
|
383
|
-
var
|
|
382
|
+
$t.displayName = "GraphSingle";
|
|
383
|
+
var fi = { 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" } }] }, Ze = $(function(i, e) {
|
|
384
384
|
return H(F, Object.assign({}, i, {
|
|
385
385
|
id: "more-down-single",
|
|
386
386
|
ref: e,
|
|
387
|
-
icon:
|
|
387
|
+
icon: fi
|
|
388
388
|
}));
|
|
389
389
|
});
|
|
390
|
-
|
|
391
|
-
var
|
|
390
|
+
Ze.displayName = "MoreDownSingle";
|
|
391
|
+
var vi = { 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" } }] }, Ht = $(function(i, e) {
|
|
392
392
|
return H(F, Object.assign({}, i, {
|
|
393
393
|
id: "move-down-single",
|
|
394
394
|
ref: e,
|
|
395
|
-
icon:
|
|
395
|
+
icon: vi
|
|
396
396
|
}));
|
|
397
397
|
});
|
|
398
|
-
|
|
399
|
-
var
|
|
398
|
+
Ht.displayName = "MoveDownSingle";
|
|
399
|
+
var _i = { 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" } }] }, Ft = $(function(i, e) {
|
|
400
400
|
return H(F, Object.assign({}, i, {
|
|
401
401
|
id: "move-up-single",
|
|
402
402
|
ref: e,
|
|
403
|
-
icon:
|
|
403
|
+
icon: _i
|
|
404
404
|
}));
|
|
405
405
|
});
|
|
406
|
-
|
|
407
|
-
var
|
|
406
|
+
Ft.displayName = "MoveUpSingle";
|
|
407
|
+
var Si = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_1204", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_102_1204)" }, children: [{ tag: "rect", attrs: { width: 12.62, height: 2.79, x: 1.69, y: 12.25, fill: "colorChannel1", rx: 1.4 } }, { tag: "path", attrs: { fill: "currentColor", d: "M7.74646 2.1642C7.34284 1.65121 6.85947 1.28205 6.38447 1.09593C5.86863 0.893787 5.15166 0.852126 4.70047 1.42917C4.29842 1.94344 4.33082 2.70249 4.57691 3.50395C4.68808 3.8661 4.86846 4.22254 5.12522 4.56617C5.13695 4.58185 5.14927 4.5968 5.16211 4.61102C5.17152 4.6214 5.18122 4.63139 5.19115 4.64096C5.20459 4.65393 5.21855 4.66618 5.23296 4.6777L3.5064 6.40422C3.26756 6.64306 3.26756 7.03033 3.5064 7.26919L7.23756 11.0004C7.47648 11.2392 7.86375 11.2392 8.1026 11.0004L12.8329 6.27001C13.0717 6.03117 13.0717 5.6439 12.8329 5.40505L9.10172 1.67387C8.86288 1.43503 8.47561 1.43503 8.23676 1.67387L7.74646 2.1642ZM7.46162 4.50638C7.47252 4.57574 7.48163 4.64652 7.4888 4.71868C7.52232 5.05481 7.82194 5.30013 8.15807 5.26661C8.4942 5.23311 8.73954 4.93345 8.70601 4.59732C8.65786 4.11463 8.54251 3.6666 8.37892 3.26169L8.66928 2.97135L11.5354 5.83753L10.6106 6.76237H4.87824L7.40802 4.2326C7.42885 4.32128 7.44684 4.41255 7.46162 4.50638ZM6.87284 3.03784C6.57441 2.62008 6.22261 2.34634 5.93815 2.23487C5.80233 2.18165 5.71528 2.17827 5.67638 2.18335C5.6725 2.18387 5.66929 2.18443 5.6666 2.18497L5.6619 2.18607C5.64166 2.21954 5.53594 2.45979 5.74626 3.1449C5.81241 3.36036 5.92262 3.58602 6.09307 3.81761L6.87284 3.03784Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.1932 11.5463C12.6454 11.5463 13.012 11.1797 13.012 10.7275C13.012 10.4475 12.6981 9.92821 12.459 9.5733C12.3299 9.38173 12.0564 9.38174 11.9274 9.57331C11.6883 9.92822 11.3744 10.4475 11.3744 10.7275C11.3744 11.1797 11.741 11.5463 12.1932 11.5463Z" } }] }] }, zt = $(function(i, e) {
|
|
408
408
|
return H(F, Object.assign({}, i, {
|
|
409
409
|
id: "paint-bucket",
|
|
410
410
|
ref: e,
|
|
411
|
-
icon:
|
|
411
|
+
icon: Si
|
|
412
412
|
}));
|
|
413
413
|
});
|
|
414
|
-
|
|
415
|
-
var
|
|
414
|
+
zt.displayName = "PaintBucket";
|
|
415
|
+
var Ii = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { fill: "currentColor", clipPath: "url(#text-single_clip0_1293_26)" }, children: [{ tag: "path", attrs: { d: "M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z" } }, { tag: "path", attrs: { d: "M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "text-single_clip0_1293_26" }, children: [{ tag: "path", attrs: { fill: "#fff", d: "M0 0H16V16H0z", transform: "translate(.9)" } }] }] }], defIds: ["text-single_clip0_1293_26"] }, Wt = $(function(i, e) {
|
|
416
416
|
return H(F, Object.assign({}, i, {
|
|
417
417
|
id: "text-single",
|
|
418
418
|
ref: e,
|
|
419
|
-
icon:
|
|
419
|
+
icon: Ii
|
|
420
420
|
}));
|
|
421
421
|
});
|
|
422
|
-
|
|
423
|
-
var
|
|
422
|
+
Wt.displayName = "TextSingle";
|
|
423
|
+
var Pi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Kt = $(function(i, e) {
|
|
424
424
|
return H(F, Object.assign({}, i, {
|
|
425
425
|
id: "topmost-single",
|
|
426
426
|
ref: e,
|
|
427
|
-
icon:
|
|
427
|
+
icon: Pi
|
|
428
428
|
}));
|
|
429
429
|
});
|
|
430
|
-
|
|
431
|
-
function
|
|
430
|
+
Kt.displayName = "TopmostSingle";
|
|
431
|
+
function Gt(i) {
|
|
432
432
|
var e, t, n = "";
|
|
433
433
|
if (typeof i == "string" || typeof i == "number") n += i;
|
|
434
434
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
435
435
|
var r = i.length;
|
|
436
|
-
for (e = 0; e < r; e++) i[e] && (t =
|
|
436
|
+
for (e = 0; e < r; e++) i[e] && (t = Gt(i[e])) && (n && (n += " "), n += t);
|
|
437
437
|
} else for (t in i) i[t] && (n && (n += " "), n += t);
|
|
438
438
|
return n;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e =
|
|
440
|
+
function T() {
|
|
441
|
+
for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e = Gt(i)) && (n && (n += " "), n += e);
|
|
442
442
|
return n;
|
|
443
443
|
}
|
|
444
|
-
const
|
|
444
|
+
const K = {
|
|
445
445
|
id: "slide.operation.update-element",
|
|
446
446
|
type: V.OPERATION,
|
|
447
447
|
handler: (i, e) => {
|
|
448
448
|
const { oKey: t, props: n } = e, r = i.get(y), s = e == null ? void 0 : e.unitId, o = r.getUnit(s);
|
|
449
449
|
if (!o) return !1;
|
|
450
450
|
const a = o.getActivePage();
|
|
451
|
-
return a.pageElements[t] =
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
451
|
+
return a.pageElements[t] = pn.deepMerge(a.pageElements[t], n), o.updatePage(a.id, a), !0;
|
|
452
|
+
}
|
|
453
|
+
}, bi = "univer-image-common-panel", Ei = "univer-image-common-panel-grid", Ri = "univer-image-common-panel-border", Oi = "univer-image-common-panel-title", xi = "univer-image-common-panel-subtitle", yi = "univer-image-common-panel-row", Mi = "univer-image-common-panel-row-vertical", Ti = "univer-image-common-panel-column", wi = "univer-image-common-panel-column-center", Ni = "univer-image-common-panel-inline", Di = "univer-image-common-panel-span2", Ui = "univer-image-common-panel-span3", Vi = "univer-image-common-panel-input", ji = "univer-slide-panel-color-picker", u = {
|
|
454
|
+
imageCommonPanel: bi,
|
|
455
|
+
imageCommonPanelGrid: Ei,
|
|
456
|
+
imageCommonPanelBorder: Ri,
|
|
457
|
+
imageCommonPanelTitle: Oi,
|
|
458
|
+
imageCommonPanelSubtitle: xi,
|
|
459
|
+
imageCommonPanelRow: yi,
|
|
460
|
+
imageCommonPanelRowVertical: Mi,
|
|
461
|
+
imageCommonPanelColumn: Ti,
|
|
462
|
+
imageCommonPanelColumnCenter: wi,
|
|
463
|
+
imageCommonPanelInline: Ni,
|
|
464
|
+
imageCommonPanelSpan2: Di,
|
|
465
|
+
imageCommonPanelSpan3: Ui,
|
|
466
|
+
imageCommonPanelInput: Vi,
|
|
467
|
+
slidePanelColorPicker: ji
|
|
464
468
|
};
|
|
465
|
-
function
|
|
466
|
-
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(
|
|
469
|
+
function Bi(i) {
|
|
470
|
+
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(j), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
467
471
|
if (!a) return null;
|
|
468
472
|
const c = a.getTransformer();
|
|
469
473
|
if (!c) return null;
|
|
470
474
|
const l = c.getSelectedObjectMap().values().next().value;
|
|
471
475
|
if (!l) return null;
|
|
472
|
-
const d = (
|
|
473
|
-
const
|
|
474
|
-
const w =
|
|
475
|
-
return [D,
|
|
476
|
+
const d = (p) => {
|
|
477
|
+
const v = a.getAllObjects(), [f, C] = v.reduce(([_, P], b) => {
|
|
478
|
+
const w = b.zIndex, D = w < _ ? w : _, B = w > P ? w : P;
|
|
479
|
+
return [D, B];
|
|
476
480
|
}, [0, 0]);
|
|
477
|
-
let
|
|
478
|
-
|
|
479
|
-
zIndex:
|
|
480
|
-
}), s.executeCommand(
|
|
481
|
+
let h = l.zIndex;
|
|
482
|
+
p === 3 ? h = f - 1 : p === 2 ? h = C + 1 : p === 0 ? h = l.zIndex + 1 : p === 1 && (h = l.zIndex - 1), l.setProps({
|
|
483
|
+
zIndex: h
|
|
484
|
+
}), s.executeCommand(K.id, {
|
|
481
485
|
unitId: t,
|
|
482
486
|
oKey: l == null ? void 0 : l.oKey,
|
|
483
487
|
props: {
|
|
484
|
-
zIndex:
|
|
488
|
+
zIndex: h
|
|
485
489
|
}
|
|
486
490
|
});
|
|
487
491
|
};
|
|
488
492
|
return /* @__PURE__ */ R("div", { className: u.imageCommonPanelGrid, children: [
|
|
489
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ m("div", { children: n.t("image-panel.arrange.title") }) }) }),
|
|
490
494
|
/* @__PURE__ */ R("div", { className: u.imageCommonPanelRow, children: [
|
|
491
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ m(Pe, { size: "small", onClick: () => {
|
|
492
496
|
d(
|
|
493
497
|
0
|
|
494
498
|
/* forward */
|
|
495
499
|
);
|
|
496
500
|
}, children: /* @__PURE__ */ R("span", { className: u.imageCommonPanelInline, children: [
|
|
497
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ m(Ft, {}),
|
|
498
502
|
n.t("image-panel.arrange.forward")
|
|
499
503
|
] }) }) }),
|
|
500
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ m(Pe, { size: "small", onClick: () => {
|
|
501
505
|
d(
|
|
502
506
|
1
|
|
503
507
|
/* backward */
|
|
504
508
|
);
|
|
505
509
|
}, children: /* @__PURE__ */ R("span", { className: u.imageCommonPanelInline, children: [
|
|
506
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ m(Ht, {}),
|
|
507
511
|
n.t("image-panel.arrange.backward")
|
|
508
512
|
] }) }) })
|
|
509
513
|
] }),
|
|
510
514
|
/* @__PURE__ */ R("div", { className: u.imageCommonPanelRow, children: [
|
|
511
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ m(Pe, { size: "small", onClick: () => {
|
|
512
516
|
d(
|
|
513
517
|
2
|
|
514
518
|
/* front */
|
|
515
519
|
);
|
|
516
520
|
}, children: /* @__PURE__ */ R("span", { className: u.imageCommonPanelInline, children: [
|
|
517
|
-
/* @__PURE__ */
|
|
521
|
+
/* @__PURE__ */ m(Kt, {}),
|
|
518
522
|
n.t("image-panel.arrange.front")
|
|
519
523
|
] }) }) }),
|
|
520
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ m(Pe, { size: "small", onClick: () => {
|
|
521
525
|
d(
|
|
522
526
|
3
|
|
523
527
|
/* back */
|
|
524
528
|
);
|
|
525
529
|
}, children: /* @__PURE__ */ R("span", { className: u.imageCommonPanelInline, children: [
|
|
526
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ m(At, {}),
|
|
527
531
|
n.t("image-panel.arrange.back")
|
|
528
532
|
] }) }) })
|
|
529
533
|
] })
|
|
530
534
|
] });
|
|
531
535
|
}
|
|
532
|
-
function
|
|
533
|
-
var
|
|
534
|
-
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(
|
|
536
|
+
function Li(i) {
|
|
537
|
+
var f, C;
|
|
538
|
+
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(j), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
535
539
|
if (!a) return null;
|
|
536
540
|
const c = a.getTransformer();
|
|
537
541
|
if (!c) return null;
|
|
538
542
|
const l = c.getSelectedObjectMap().values().next().value;
|
|
539
543
|
if (!l) return null;
|
|
540
|
-
const [d,
|
|
541
|
-
function
|
|
544
|
+
const [d, p] = Nt.useState((C = (f = l.fill) == null ? void 0 : f.toString()) != null ? C : "");
|
|
545
|
+
function v(h) {
|
|
542
546
|
l == null || l.setProps({
|
|
543
|
-
fill:
|
|
544
|
-
}), s.executeCommand(
|
|
547
|
+
fill: h
|
|
548
|
+
}), s.executeCommand(K.id, {
|
|
545
549
|
unitId: t,
|
|
546
550
|
oKey: l == null ? void 0 : l.oKey,
|
|
547
551
|
props: {
|
|
548
552
|
shape: {
|
|
549
553
|
shapeProperties: {
|
|
550
554
|
shapeBackgroundFill: {
|
|
551
|
-
rgb:
|
|
555
|
+
rgb: h
|
|
552
556
|
}
|
|
553
557
|
}
|
|
554
558
|
}
|
|
555
559
|
}
|
|
556
|
-
}),
|
|
560
|
+
}), p(h);
|
|
557
561
|
}
|
|
558
|
-
return /* @__PURE__ */
|
|
562
|
+
return /* @__PURE__ */ m(
|
|
559
563
|
"div",
|
|
560
564
|
{
|
|
561
|
-
className:
|
|
565
|
+
className: T(u.imageCommonPanelGrid, u.imageCommonPanelBorder),
|
|
562
566
|
children: /* @__PURE__ */ R("div", { className: u.imageCommonPanelGrid, children: [
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
|
|
567
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ m("div", { children: n.t("slide.panel.fill.title") }) }) }),
|
|
568
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ m(
|
|
569
|
+
wt,
|
|
566
570
|
{
|
|
567
571
|
align: {
|
|
568
572
|
offset: [0, 18]
|
|
569
573
|
},
|
|
570
|
-
overlay: /* @__PURE__ */
|
|
574
|
+
overlay: /* @__PURE__ */ m("section", { className: u.slidePanelColorPicker, children: /* @__PURE__ */ m(
|
|
571
575
|
Hn,
|
|
572
576
|
{
|
|
573
577
|
value: "#fff",
|
|
574
|
-
onChange:
|
|
578
|
+
onChange: v
|
|
575
579
|
}
|
|
576
580
|
) }),
|
|
577
581
|
children: /* @__PURE__ */ R("a", { className: u.uiPluginSheetsBorderPanelButton, children: [
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ m(zt, { extend: { colorChannel1: d != null ? d : "rgb(var(--primary-color))" } }),
|
|
583
|
+
/* @__PURE__ */ m("span", { className: u.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ m(Ze, {}) })
|
|
580
584
|
] })
|
|
581
585
|
}
|
|
582
586
|
) }) })
|
|
@@ -584,8 +588,8 @@ function Ni(i) {
|
|
|
584
588
|
}
|
|
585
589
|
);
|
|
586
590
|
}
|
|
587
|
-
function
|
|
588
|
-
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(
|
|
591
|
+
function Ai(i) {
|
|
592
|
+
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(j), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
589
593
|
if (!a) return null;
|
|
590
594
|
const c = a.getTransformer();
|
|
591
595
|
if (!c) return null;
|
|
@@ -593,32 +597,32 @@ function Di(i) {
|
|
|
593
597
|
if (!l) return null;
|
|
594
598
|
const {
|
|
595
599
|
width: d = 0,
|
|
596
|
-
height:
|
|
597
|
-
left:
|
|
598
|
-
top:
|
|
599
|
-
angle:
|
|
600
|
-
} = l, [
|
|
601
|
-
const { objects:
|
|
602
|
-
width:
|
|
603
|
-
height:
|
|
604
|
-
left:
|
|
605
|
-
top:
|
|
606
|
-
angle:
|
|
607
|
-
} =
|
|
608
|
-
_(
|
|
600
|
+
height: p = 0,
|
|
601
|
+
left: v = 0,
|
|
602
|
+
top: f = 0,
|
|
603
|
+
angle: C = 0
|
|
604
|
+
} = l, [h, _] = X(d), [P, b] = X(p), [w, D] = X(v), [B, O] = X(f), [G, ce] = X(C), z = (S) => {
|
|
605
|
+
const { objects: le } = S, de = le.values().next().value, {
|
|
606
|
+
width: on = 0,
|
|
607
|
+
height: an = 0,
|
|
608
|
+
left: cn = 0,
|
|
609
|
+
top: ln = 0,
|
|
610
|
+
angle: dn = 0
|
|
611
|
+
} = de;
|
|
612
|
+
_(on), b(an), D(cn), O(ln), ce(dn);
|
|
609
613
|
};
|
|
610
|
-
|
|
611
|
-
const S = c.changeStart$.subscribe((
|
|
612
|
-
z(
|
|
613
|
-
}),
|
|
614
|
-
z(
|
|
614
|
+
he(() => {
|
|
615
|
+
const S = c.changeStart$.subscribe((de) => {
|
|
616
|
+
z(de);
|
|
617
|
+
}), le = c.changing$.subscribe((de) => {
|
|
618
|
+
z(de);
|
|
615
619
|
});
|
|
616
620
|
return () => {
|
|
617
|
-
|
|
621
|
+
le.unsubscribe(), S.unsubscribe();
|
|
618
622
|
};
|
|
619
623
|
}, []);
|
|
620
624
|
function W(S) {
|
|
621
|
-
!S || !l || (s.executeCommand(
|
|
625
|
+
!S || !l || (s.executeCommand(K.id, {
|
|
622
626
|
pageId: e,
|
|
623
627
|
oKey: l.oKey,
|
|
624
628
|
props: {
|
|
@@ -627,16 +631,16 @@ function Di(i) {
|
|
|
627
631
|
}), l == null || l.resize(S, l.height), _(S), c == null || c.refreshControls());
|
|
628
632
|
}
|
|
629
633
|
function te(S) {
|
|
630
|
-
!S || !l || (s.executeCommand(
|
|
634
|
+
!S || !l || (s.executeCommand(K.id, {
|
|
631
635
|
pageId: e,
|
|
632
636
|
oKey: l.oKey,
|
|
633
637
|
props: {
|
|
634
638
|
height: S
|
|
635
639
|
}
|
|
636
|
-
}), l == null || l.resize(l.width, S),
|
|
640
|
+
}), l == null || l.resize(l.width, S), b(S), c == null || c.refreshControls());
|
|
637
641
|
}
|
|
638
642
|
function ne(S) {
|
|
639
|
-
!S || !l || (s.executeCommand(
|
|
643
|
+
!S || !l || (s.executeCommand(K.id, {
|
|
640
644
|
pageId: e,
|
|
641
645
|
oKey: l.oKey,
|
|
642
646
|
props: {
|
|
@@ -645,7 +649,7 @@ function Di(i) {
|
|
|
645
649
|
}), l == null || l.translate(S, l.top), D(S), c == null || c.refreshControls());
|
|
646
650
|
}
|
|
647
651
|
function Se(S) {
|
|
648
|
-
!S || !l || (s.executeCommand(
|
|
652
|
+
!S || !l || (s.executeCommand(K.id, {
|
|
649
653
|
pageId: e,
|
|
650
654
|
oKey: l.oKey,
|
|
651
655
|
props: {
|
|
@@ -654,7 +658,7 @@ function Di(i) {
|
|
|
654
658
|
}), l == null || l.translate(l.left, S), O(S), c == null || c.refreshControls());
|
|
655
659
|
}
|
|
656
660
|
function Ie(S) {
|
|
657
|
-
!S || !l || (s.executeCommand(
|
|
661
|
+
!S || !l || (s.executeCommand(K.id, {
|
|
658
662
|
pageId: e,
|
|
659
663
|
oKey: l.oKey,
|
|
660
664
|
props: {
|
|
@@ -662,37 +666,37 @@ function Di(i) {
|
|
|
662
666
|
}
|
|
663
667
|
}), l == null || l.transformByState({
|
|
664
668
|
angle: S
|
|
665
|
-
}),
|
|
669
|
+
}), ce(S), c == null || c.refreshControls());
|
|
666
670
|
}
|
|
667
671
|
return /* @__PURE__ */ R(
|
|
668
672
|
"div",
|
|
669
673
|
{
|
|
670
|
-
className:
|
|
674
|
+
className: T(u.imageCommonPanelGrid, u.imageCommonPanelBorder),
|
|
671
675
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ m("div", { children: n.t("image-panel.transform.title") }) }) }),
|
|
673
677
|
/* @__PURE__ */ R("div", { className: u.imageCommonPanelRow, children: [
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
|
|
678
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
679
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: n.t("image-panel.transform.width") }) }),
|
|
680
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ m(
|
|
681
|
+
me,
|
|
678
682
|
{
|
|
679
683
|
className: u.imageCommonPanelInput,
|
|
680
684
|
min: 1,
|
|
681
|
-
value:
|
|
685
|
+
value: h,
|
|
682
686
|
onChange: (S) => {
|
|
683
687
|
W(S);
|
|
684
688
|
}
|
|
685
689
|
}
|
|
686
690
|
) }) })
|
|
687
691
|
] }) }),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
|
|
692
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
693
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: n.t("image-panel.transform.height") }) }),
|
|
694
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ m(
|
|
695
|
+
me,
|
|
692
696
|
{
|
|
693
697
|
className: u.imageCommonPanelInput,
|
|
694
698
|
min: 1,
|
|
695
|
-
value:
|
|
699
|
+
value: P,
|
|
696
700
|
onChange: (S) => {
|
|
697
701
|
te(S);
|
|
698
702
|
}
|
|
@@ -701,10 +705,10 @@ function Di(i) {
|
|
|
701
705
|
] }) })
|
|
702
706
|
] }),
|
|
703
707
|
/* @__PURE__ */ R("div", { className: u.imageCommonPanelRow, children: [
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
|
|
708
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
709
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: n.t("image-panel.transform.x") }) }),
|
|
710
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ m(
|
|
711
|
+
me,
|
|
708
712
|
{
|
|
709
713
|
className: u.imageCommonPanelInput,
|
|
710
714
|
precision: 1,
|
|
@@ -716,29 +720,29 @@ function Di(i) {
|
|
|
716
720
|
}
|
|
717
721
|
) }) })
|
|
718
722
|
] }) }),
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
|
|
723
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
724
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: n.t("image-panel.transform.y") }) }),
|
|
725
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ m(
|
|
726
|
+
me,
|
|
723
727
|
{
|
|
724
728
|
className: u.imageCommonPanelInput,
|
|
725
729
|
precision: 1,
|
|
726
730
|
min: 0,
|
|
727
|
-
value:
|
|
731
|
+
value: B,
|
|
728
732
|
onChange: (S) => {
|
|
729
733
|
Se(S);
|
|
730
734
|
}
|
|
731
735
|
}
|
|
732
736
|
) }) })
|
|
733
737
|
] }) }),
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
|
|
738
|
+
/* @__PURE__ */ m("div", { className: T(u.imageCommonPanelColumn, u.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
739
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: n.t("image-panel.transform.rotate") }) }),
|
|
740
|
+
/* @__PURE__ */ m("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ m("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ m(
|
|
741
|
+
me,
|
|
738
742
|
{
|
|
739
743
|
className: u.imageCommonPanelInput,
|
|
740
744
|
precision: 1,
|
|
741
|
-
value:
|
|
745
|
+
value: G,
|
|
742
746
|
onChange: Ie
|
|
743
747
|
}
|
|
744
748
|
) }) })
|
|
@@ -748,12 +752,24 @@ function Di(i) {
|
|
|
748
752
|
}
|
|
749
753
|
);
|
|
750
754
|
}
|
|
751
|
-
const
|
|
752
|
-
imageCommonPanel:
|
|
755
|
+
const $i = "univer-image-common-panel", Hi = "univer-image-common-panel-grid", Fi = "univer-image-common-panel-border", zi = "univer-image-common-panel-title", Wi = "univer-image-common-panel-subtitle", Ki = "univer-image-common-panel-row", Gi = "univer-image-common-panel-row-vertical", Xi = "univer-image-common-panel-column", Yi = "univer-image-common-panel-column-center", Zi = "univer-image-common-panel-inline", ki = "univer-image-common-panel-span2", qi = "univer-image-common-panel-span3", Ji = "univer-image-common-panel-input", Qi = {
|
|
756
|
+
imageCommonPanel: $i,
|
|
757
|
+
imageCommonPanelGrid: Hi,
|
|
758
|
+
imageCommonPanelBorder: Fi,
|
|
759
|
+
imageCommonPanelTitle: zi,
|
|
760
|
+
imageCommonPanelSubtitle: Wi,
|
|
761
|
+
imageCommonPanelRow: Ki,
|
|
762
|
+
imageCommonPanelRowVertical: Gi,
|
|
763
|
+
imageCommonPanelColumn: Xi,
|
|
764
|
+
imageCommonPanelColumnCenter: Yi,
|
|
765
|
+
imageCommonPanelInline: Zi,
|
|
766
|
+
imageCommonPanelSpan2: ki,
|
|
767
|
+
imageCommonPanelSpan3: qi,
|
|
768
|
+
imageCommonPanelInput: Ji
|
|
753
769
|
}, Oe = "COMPONENT_SLIDE_SIDEBAR";
|
|
754
|
-
function
|
|
755
|
-
var
|
|
756
|
-
const i = x(y), e = x(N), t = i.getCurrentUnitForType(E.UNIVER_SLIDE), n = (
|
|
770
|
+
function er() {
|
|
771
|
+
var g, l, d;
|
|
772
|
+
const i = x(y), e = x(N), t = i.getCurrentUnitForType(E.UNIVER_SLIDE), n = (g = t == null ? void 0 : t.getActivePage()) == null ? void 0 : g.id;
|
|
757
773
|
if (!n) return null;
|
|
758
774
|
const s = (l = e.getRenderUnitByPageId(n, n).scene) == null ? void 0 : l.getTransformer();
|
|
759
775
|
if (!s) return null;
|
|
@@ -761,27 +777,27 @@ function Bi() {
|
|
|
761
777
|
if (!a)
|
|
762
778
|
return null;
|
|
763
779
|
const c = ((d = i.getFocusedUnit()) == null ? void 0 : d.getUnitId()) || "";
|
|
764
|
-
return /* @__PURE__ */ R("section", { className:
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
a.objectType ===
|
|
780
|
+
return /* @__PURE__ */ R("section", { className: Qi.imageCommonPanel, children: [
|
|
781
|
+
/* @__PURE__ */ m(Bi, { pageId: n, unitId: c }),
|
|
782
|
+
/* @__PURE__ */ m(Ai, { pageId: n, unitId: c }),
|
|
783
|
+
a.objectType === ge.RECT && /* @__PURE__ */ m(Li, { pageId: n, unitId: c })
|
|
768
784
|
] });
|
|
769
785
|
}
|
|
770
|
-
const
|
|
786
|
+
const ke = {
|
|
771
787
|
id: "slide.command.insert-float-shape",
|
|
772
788
|
type: V.COMMAND,
|
|
773
789
|
handler: async (i) => {
|
|
774
790
|
var r;
|
|
775
|
-
const e = i.get(
|
|
776
|
-
return e.executeCommand(
|
|
791
|
+
const e = i.get(j), n = (r = i.get(y).getFocusedUnit()) == null ? void 0 : r.getUnitId();
|
|
792
|
+
return e.executeCommand(Xt.id, { unitId: n });
|
|
777
793
|
}
|
|
778
|
-
},
|
|
794
|
+
}, Xt = {
|
|
779
795
|
id: "slide.operation.insert-float-shape",
|
|
780
796
|
type: V.OPERATION,
|
|
781
797
|
handler: async (i, e) => {
|
|
782
798
|
const t = St(6), n = i.get(y), r = e.unitId, s = n.getUnit(r);
|
|
783
799
|
if (!s) return !1;
|
|
784
|
-
const o = s.getActivePage(), a = Object.values(o.pageElements), c = a != null && a.length ? Math.max(...a.map((
|
|
800
|
+
const o = s.getActivePage(), a = Object.values(o.pageElements), c = a != null && a.length ? Math.max(...a.map((p) => p.zIndex)) : 20, g = {
|
|
785
801
|
id: t,
|
|
786
802
|
zIndex: c + 1,
|
|
787
803
|
left: 378,
|
|
@@ -790,9 +806,9 @@ const Ze = {
|
|
|
790
806
|
height: 250,
|
|
791
807
|
title: t,
|
|
792
808
|
description: "",
|
|
793
|
-
type:
|
|
809
|
+
type: Ge.SHAPE,
|
|
794
810
|
shape: {
|
|
795
|
-
shapeType:
|
|
811
|
+
shapeType: Cn.Rect,
|
|
796
812
|
text: "",
|
|
797
813
|
shapeProperties: {
|
|
798
814
|
shapeBackgroundFill: {
|
|
@@ -801,8 +817,8 @@ const Ze = {
|
|
|
801
817
|
}
|
|
802
818
|
}
|
|
803
819
|
};
|
|
804
|
-
o.pageElements[t] =
|
|
805
|
-
const l = i.get(N), d = l.createObjectToPage(
|
|
820
|
+
o.pageElements[t] = g, s.updatePage(o.id, o);
|
|
821
|
+
const l = i.get(N), d = l.createObjectToPage(g, o.id, r);
|
|
806
822
|
return d && l.setObjectActiveByPage(d, o.id, r), !0;
|
|
807
823
|
}
|
|
808
824
|
}, $e = {
|
|
@@ -811,7 +827,7 @@ const Ze = {
|
|
|
811
827
|
handler: async (i, e) => {
|
|
812
828
|
const { visible: t, objectType: n } = e, r = i.get(Tt), s = i.get(ee);
|
|
813
829
|
let o = "", a = "";
|
|
814
|
-
return n ===
|
|
830
|
+
return n === ge.RECT ? (o = "slide.sidebar.shape", a = Oe) : n === ge.IMAGE ? (o = "slide.sidebar.image", a = Oe) : n === ge.RICH_TEXT && (o = "slide.sidebar.text", a = Oe), t ? r.open({
|
|
815
831
|
header: { title: s.t(o) },
|
|
816
832
|
children: { label: a },
|
|
817
833
|
onClose: () => {
|
|
@@ -819,14 +835,14 @@ const Ze = {
|
|
|
819
835
|
width: 360
|
|
820
836
|
}) : r.close(), !0;
|
|
821
837
|
}
|
|
822
|
-
},
|
|
823
|
-
var
|
|
824
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
825
|
-
(o = i[s]) && (r = o(r) || r);
|
|
826
|
-
return r;
|
|
827
|
-
},
|
|
828
|
-
function
|
|
829
|
-
const t =
|
|
838
|
+
}, Yt = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
|
|
839
|
+
var tr = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, ir = (i, e, t, n) => {
|
|
840
|
+
for (var r = n > 1 ? void 0 : n ? nr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
841
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
842
|
+
return n && r && tr(e, t, r), r;
|
|
843
|
+
}, be = (i, e) => (t, n) => e(t, n, i);
|
|
844
|
+
function rr(i, e) {
|
|
845
|
+
const t = pt(i.left, i.top, e), n = pt(i.right, i.bottom, e);
|
|
830
846
|
return {
|
|
831
847
|
left: t.x,
|
|
832
848
|
top: t.y,
|
|
@@ -834,39 +850,39 @@ function Ai(i, e) {
|
|
|
834
850
|
bottom: n.y
|
|
835
851
|
};
|
|
836
852
|
}
|
|
837
|
-
function
|
|
853
|
+
function pt(i, e, t) {
|
|
838
854
|
const { scaleX: n, scaleY: r } = t.getAncestorScale(), s = t.getViewport(oe.VIEW);
|
|
839
855
|
if (!s)
|
|
840
856
|
return {
|
|
841
857
|
x: i,
|
|
842
858
|
y: e
|
|
843
859
|
};
|
|
844
|
-
const { viewportScrollX: o, viewportScrollY: a } = s, c = (i - o) * n,
|
|
860
|
+
const { viewportScrollX: o, viewportScrollY: a } = s, c = (i - o) * n, g = (e - a) * r;
|
|
845
861
|
return {
|
|
846
862
|
x: c,
|
|
847
|
-
y:
|
|
863
|
+
y: g
|
|
848
864
|
};
|
|
849
865
|
}
|
|
850
|
-
let
|
|
866
|
+
let Me = class extends Ve {
|
|
851
867
|
constructor(i, e, t, n) {
|
|
852
868
|
super(), this._globalPopupManagerService = i, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = n;
|
|
853
869
|
}
|
|
854
870
|
_createObjectPositionObserver(i, e) {
|
|
855
871
|
const n = (() => {
|
|
856
872
|
var z, W, te, ne;
|
|
857
|
-
const { scene: o, engine: a } = e, { left: c, top:
|
|
873
|
+
const { scene: o, engine: a } = e, { left: c, top: g, width: l, height: d } = i, p = (o.width - ((W = (z = e.mainComponent) == null ? void 0 : z.width) != null ? W : 0)) / 2, v = (o.height - ((ne = (te = e.mainComponent) == null ? void 0 : te.height) != null ? ne : 0)) / 2, f = {
|
|
858
874
|
left: c,
|
|
859
875
|
right: c + l,
|
|
860
|
-
top:
|
|
861
|
-
bottom:
|
|
862
|
-
},
|
|
876
|
+
top: g,
|
|
877
|
+
bottom: g + d
|
|
878
|
+
}, C = a.getCanvasElement(), h = C.getBoundingClientRect(), _ = Mn(C.style.width), { scaleX: P, scaleY: b } = o.getAncestorScale(), w = rr(f, o), { top: D, left: B, width: O } = h, G = O / _;
|
|
863
879
|
return {
|
|
864
|
-
left: w.left *
|
|
865
|
-
right: w.right *
|
|
866
|
-
top: w.top *
|
|
867
|
-
bottom: w.bottom *
|
|
880
|
+
left: w.left * G * P + B + p,
|
|
881
|
+
right: w.right * G * P + B + p,
|
|
882
|
+
top: w.top * G * b + D + v,
|
|
883
|
+
bottom: w.bottom * G * b + D + v
|
|
868
884
|
};
|
|
869
|
-
})(), r = new Q(n), s = new
|
|
885
|
+
})(), r = new Q(n), s = new Xe();
|
|
870
886
|
return {
|
|
871
887
|
position: n,
|
|
872
888
|
position$: r,
|
|
@@ -895,18 +911,18 @@ let Te = class extends Ve {
|
|
|
895
911
|
};
|
|
896
912
|
}
|
|
897
913
|
};
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
],
|
|
904
|
-
var
|
|
905
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
906
|
-
(o = i[s]) && (r = o(r) || r);
|
|
907
|
-
return r;
|
|
914
|
+
Me = ir([
|
|
915
|
+
be(0, Y(wn)),
|
|
916
|
+
be(1, Z),
|
|
917
|
+
be(2, y),
|
|
918
|
+
be(3, j)
|
|
919
|
+
], Me);
|
|
920
|
+
var sr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, ar = (i, e, t, n) => {
|
|
921
|
+
for (var r = n > 1 ? void 0 : n ? or(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
922
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
923
|
+
return n && r && sr(e, t, r), r;
|
|
908
924
|
}, q = (i, e) => (t, n) => e(t, n, i);
|
|
909
|
-
let
|
|
925
|
+
let Te = class extends Ce {
|
|
910
926
|
constructor(e, t, n, r, s, o, a) {
|
|
911
927
|
super();
|
|
912
928
|
I(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
@@ -928,8 +944,8 @@ let Me = class extends pe {
|
|
|
928
944
|
var r;
|
|
929
945
|
const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), n = (r = t == null ? void 0 : t.getPages()) != null ? r : {};
|
|
930
946
|
Object.keys(n).forEach((s) => {
|
|
931
|
-
var
|
|
932
|
-
const a = (
|
|
947
|
+
var g;
|
|
948
|
+
const a = (g = this._canvasView.getRenderUnitByPageId(s, e).scene) == null ? void 0 : g.getTransformer();
|
|
933
949
|
if (!a) return;
|
|
934
950
|
let c;
|
|
935
951
|
this.disposeWithMe(
|
|
@@ -943,13 +959,13 @@ let Me = class extends pe {
|
|
|
943
959
|
const d = l.values().next().value;
|
|
944
960
|
if (!d)
|
|
945
961
|
return;
|
|
946
|
-
const
|
|
962
|
+
const p = d.oKey;
|
|
947
963
|
c == null || c.dispose(), c = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
|
|
948
|
-
componentKey:
|
|
964
|
+
componentKey: Yt,
|
|
949
965
|
direction: "horizontal",
|
|
950
966
|
offset: [2, 0],
|
|
951
967
|
extraProps: {
|
|
952
|
-
menuItems: this._getMenuItemsByObjectType(d.objectType,
|
|
968
|
+
menuItems: this._getMenuItemsByObjectType(d.objectType, p, e)
|
|
953
969
|
}
|
|
954
970
|
})), this._sidebarService.visible && this._commandService.executeCommand($e.id, {
|
|
955
971
|
visible: !0,
|
|
@@ -959,7 +975,7 @@ let Me = class extends pe {
|
|
|
959
975
|
)
|
|
960
976
|
), this.disposeWithMe(
|
|
961
977
|
a.clearControl$.subscribe(() => {
|
|
962
|
-
c == null || c.dispose(), this._contextService.setContextValue(
|
|
978
|
+
c == null || c.dispose(), this._contextService.setContextValue(fn, !1);
|
|
963
979
|
})
|
|
964
980
|
), this.disposeWithMe(
|
|
965
981
|
a.changing$.subscribe(() => {
|
|
@@ -970,7 +986,7 @@ let Me = class extends pe {
|
|
|
970
986
|
return;
|
|
971
987
|
}
|
|
972
988
|
const d = l.values().next().value;
|
|
973
|
-
d && this._commandService.executeCommand(
|
|
989
|
+
d && this._commandService.executeCommand(K.id, {
|
|
974
990
|
unitId: e,
|
|
975
991
|
oKey: d.oKey,
|
|
976
992
|
props: {
|
|
@@ -997,7 +1013,7 @@ let Me = class extends pe {
|
|
|
997
1013
|
}, {
|
|
998
1014
|
label: "slide.popup.delete",
|
|
999
1015
|
index: 5,
|
|
1000
|
-
commandId:
|
|
1016
|
+
commandId: Vt.id,
|
|
1001
1017
|
commandParams: {
|
|
1002
1018
|
id: t,
|
|
1003
1019
|
unitId: n
|
|
@@ -1006,30 +1022,30 @@ let Me = class extends pe {
|
|
|
1006
1022
|
}];
|
|
1007
1023
|
}
|
|
1008
1024
|
};
|
|
1009
|
-
|
|
1010
|
-
q(0,
|
|
1011
|
-
q(1,
|
|
1025
|
+
Te = ar([
|
|
1026
|
+
q(0, Y(Me)),
|
|
1027
|
+
q(1, Z),
|
|
1012
1028
|
q(2, y),
|
|
1013
|
-
q(3,
|
|
1014
|
-
q(4,
|
|
1029
|
+
q(3, fe),
|
|
1030
|
+
q(4, Y(N)),
|
|
1015
1031
|
q(5, Tt),
|
|
1016
|
-
q(6,
|
|
1017
|
-
],
|
|
1032
|
+
q(6, j)
|
|
1033
|
+
], Te);
|
|
1018
1034
|
const we = {
|
|
1019
1035
|
id: "slide.operation.edit-arrow",
|
|
1020
1036
|
type: V.OPERATION,
|
|
1021
1037
|
handler: () => !0
|
|
1022
|
-
},
|
|
1023
|
-
var
|
|
1024
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1025
|
-
(o = i[s]) && (r = o(r) || r);
|
|
1026
|
-
return r;
|
|
1027
|
-
},
|
|
1028
|
-
const qe =
|
|
1038
|
+
}, ae = vn("SLIDE_EDITOR");
|
|
1039
|
+
var cr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, dr = (i, e, t, n) => {
|
|
1040
|
+
for (var r = n > 1 ? void 0 : n ? lr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1041
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
1042
|
+
return n && r && cr(e, t, r), r;
|
|
1043
|
+
}, Be = (i, e) => (t, n) => e(t, n, i);
|
|
1044
|
+
const qe = Pt("univer.slide-editor-bridge.service");
|
|
1029
1045
|
let He = class extends Ve {
|
|
1030
1046
|
constructor(e, t, n) {
|
|
1031
1047
|
super();
|
|
1032
|
-
I(this, "_editorUnitId",
|
|
1048
|
+
I(this, "_editorUnitId", ae);
|
|
1033
1049
|
I(this, "_isForceKeepVisible", !1);
|
|
1034
1050
|
I(this, "_editorIsDirty", !1);
|
|
1035
1051
|
I(this, "_currentEditRectState", null);
|
|
@@ -1044,7 +1060,7 @@ let He = class extends Ve {
|
|
|
1044
1060
|
I(this, "visible$", this._visible$.asObservable());
|
|
1045
1061
|
I(this, "_afterVisible$", new Q(this._visibleParam));
|
|
1046
1062
|
I(this, "afterVisible$", this._afterVisible$.asObservable());
|
|
1047
|
-
I(this, "endEditing$", new
|
|
1063
|
+
I(this, "endEditing$", new Ut());
|
|
1048
1064
|
I(this, "_currentEditRectInfo");
|
|
1049
1065
|
this._editorService = e, this._contextService = t, this._renderManagerService = n;
|
|
1050
1066
|
}
|
|
@@ -1059,7 +1075,7 @@ let He = class extends Ve {
|
|
|
1059
1075
|
* @editorInfo editorInfo
|
|
1060
1076
|
*/
|
|
1061
1077
|
setEditorRect(e) {
|
|
1062
|
-
this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(
|
|
1078
|
+
this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(ae), this._contextService.setContextValue(xe, !1), this._contextService.setContextValue(bt, !1), this._contextService.setContextValue(Et, !1));
|
|
1063
1079
|
const t = this.getEditRectState();
|
|
1064
1080
|
this._currentEditRectState = t, this._currentEditRectState$.next(t);
|
|
1065
1081
|
}
|
|
@@ -1073,31 +1089,31 @@ let He = class extends Ve {
|
|
|
1073
1089
|
* && this@setEditorRect
|
|
1074
1090
|
*/
|
|
1075
1091
|
getEditRectState() {
|
|
1076
|
-
const e =
|
|
1092
|
+
const e = ae, t = this._currentEditRectInfo, n = t.unitId, r = t.richTextObj.documentData;
|
|
1077
1093
|
r.id = e, r.documentStyle = {
|
|
1078
1094
|
...r.documentStyle,
|
|
1079
1095
|
pageSize: { width: t.richTextObj.width, height: 1 / 0 }
|
|
1080
1096
|
};
|
|
1081
1097
|
const o = {
|
|
1082
|
-
documentModel: new
|
|
1098
|
+
documentModel: new _n(r),
|
|
1083
1099
|
fontString: "document",
|
|
1084
1100
|
textRotation: { a: 0, v: 0 },
|
|
1085
1101
|
wrapStrategy: 0,
|
|
1086
1102
|
verticalAlign: ye.TOP,
|
|
1087
1103
|
horizontalAlign: Rt.LEFT,
|
|
1088
1104
|
paddingData: { t: 0, b: 1, l: 2, r: 2 }
|
|
1089
|
-
}, a = t.richTextObj.width, c = t.richTextObj.height,
|
|
1105
|
+
}, a = t.richTextObj.width, c = t.richTextObj.height, g = t.richTextObj.left, l = t.richTextObj.top, d = {
|
|
1090
1106
|
left: 0,
|
|
1091
1107
|
top: 0
|
|
1092
|
-
},
|
|
1093
|
-
x: (
|
|
1094
|
-
y: (
|
|
1095
|
-
}, _ = (
|
|
1096
|
-
return d.left =
|
|
1108
|
+
}, p = this._renderManagerService.getRenderById(n), v = p == null ? void 0 : p.scene, f = v == null ? void 0 : v.getViewport(oe.VIEW), C = v == null ? void 0 : v.getObject(oe.COMPONENT), h = {
|
|
1109
|
+
x: (C == null ? void 0 : C.left) || 0,
|
|
1110
|
+
y: (C == null ? void 0 : C.top) || 0
|
|
1111
|
+
}, _ = (f == null ? void 0 : f.viewportScrollX) || 0, P = (f == null ? void 0 : f.viewportScrollY) || 0;
|
|
1112
|
+
return d.left = h.x - _, d.top = h.y - P, {
|
|
1097
1113
|
position: {
|
|
1098
|
-
startX:
|
|
1114
|
+
startX: g,
|
|
1099
1115
|
startY: l,
|
|
1100
|
-
endX:
|
|
1116
|
+
endX: g + a,
|
|
1101
1117
|
endY: l + c
|
|
1102
1118
|
},
|
|
1103
1119
|
scaleX: 1,
|
|
@@ -1163,12 +1179,12 @@ let He = class extends Ve {
|
|
|
1163
1179
|
};
|
|
1164
1180
|
}
|
|
1165
1181
|
};
|
|
1166
|
-
He =
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1182
|
+
He = dr([
|
|
1183
|
+
Be(0, Ye),
|
|
1184
|
+
Be(1, fe),
|
|
1185
|
+
Be(2, Z)
|
|
1170
1186
|
], He);
|
|
1171
|
-
class
|
|
1187
|
+
class mr {
|
|
1172
1188
|
constructor() {
|
|
1173
1189
|
I(this, "_state", null);
|
|
1174
1190
|
I(this, "_rect", null);
|
|
@@ -1202,30 +1218,30 @@ class Wi {
|
|
|
1202
1218
|
this._state$.next(e);
|
|
1203
1219
|
}
|
|
1204
1220
|
}
|
|
1205
|
-
const Je =
|
|
1221
|
+
const Je = Pt(
|
|
1206
1222
|
"univer.slide-editor-manager.service"
|
|
1207
1223
|
);
|
|
1208
|
-
var
|
|
1209
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1210
|
-
(o = i[s]) && (r = o(r) || r);
|
|
1211
|
-
return r;
|
|
1224
|
+
var k = /* @__PURE__ */ ((i) => (i[i.InitialState = 0] = "InitialState", i[i.StartEditor = 1] = "StartEditor", i[i.CursorChange = 2] = "CursorChange", i))(k || {}), ur = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, hr = (i, e, t, n) => {
|
|
1225
|
+
for (var r = n > 1 ? void 0 : n ? gr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1226
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
1227
|
+
return n && r && ur(e, t, r), r;
|
|
1212
1228
|
}, A = (i, e) => (t, n) => e(t, n, i);
|
|
1213
|
-
const
|
|
1229
|
+
const Ct = -1e3, ft = 5, pr = 2;
|
|
1214
1230
|
let Fe = class extends Ve {
|
|
1215
|
-
constructor(e, t, n, r, s, o, a, c,
|
|
1231
|
+
constructor(e, t, n, r, s, o, a, c, g, l, d, p) {
|
|
1216
1232
|
super();
|
|
1217
1233
|
/**
|
|
1218
1234
|
* It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
|
|
1219
1235
|
*/
|
|
1220
|
-
I(this, "_cursorChange",
|
|
1236
|
+
I(this, "_cursorChange", k.InitialState);
|
|
1221
1237
|
/** If the corresponding unit is active and prepared for editing. */
|
|
1222
1238
|
I(this, "_isUnitEditing", !1);
|
|
1223
1239
|
I(this, "_d");
|
|
1224
|
-
this._renderContext = e, this._layoutService = t, this._undoRedoService = n, this._contextService = r, this._instanceSrv = s, this._renderManagerService = o, this._editorBridgeService = a, this._cellEditorManagerService = c, this._textSelectionManagerService =
|
|
1225
|
-
|
|
1240
|
+
this._renderContext = e, this._layoutService = t, this._undoRedoService = n, this._contextService = r, this._instanceSrv = s, this._renderManagerService = o, this._editorBridgeService = a, this._cellEditorManagerService = c, this._textSelectionManagerService = g, this._commandService = l, this._localService = d, this._editorService = p, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(E.UNIVER_SLIDE).subscribe((v) => {
|
|
1241
|
+
v && v.getUnitId() === this._renderContext.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({
|
|
1226
1242
|
visible: !1,
|
|
1227
1243
|
eventType: J.Keyboard,
|
|
1228
|
-
keycode:
|
|
1244
|
+
keycode: M.ESC,
|
|
1229
1245
|
unitId: this._renderContext.unitId
|
|
1230
1246
|
}), this._isUnitEditing = !1));
|
|
1231
1247
|
})), this._initEditorVisibilityListener();
|
|
@@ -1238,7 +1254,7 @@ let Fe = class extends Ve {
|
|
|
1238
1254
|
(e = this._d) == null || e.dispose(), this._d = null;
|
|
1239
1255
|
}
|
|
1240
1256
|
_init() {
|
|
1241
|
-
const e = new
|
|
1257
|
+
const e = new Xe();
|
|
1242
1258
|
return this._subscribeToCurrentCell(e), this._initialKeyboardListener(e), this._initialCursorSync(e), this._listenEditorFocus(e), this._commandExecutedListener(e), setTimeout(() => {
|
|
1243
1259
|
this._cursorStateListener(e);
|
|
1244
1260
|
}, 1e3), e;
|
|
@@ -1255,11 +1271,11 @@ let Fe = class extends Ve {
|
|
|
1255
1271
|
}
|
|
1256
1272
|
_getEditorSkeleton(e) {
|
|
1257
1273
|
var t;
|
|
1258
|
-
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(
|
|
1274
|
+
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(mt).getSkeleton();
|
|
1259
1275
|
}
|
|
1260
1276
|
_getEditorViewModel(e) {
|
|
1261
1277
|
var t;
|
|
1262
|
-
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(
|
|
1278
|
+
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(mt).getViewModel();
|
|
1263
1279
|
}
|
|
1264
1280
|
_initialCursorSync(e) {
|
|
1265
1281
|
e.add(this._cellEditorManagerService.focus$.pipe(Wn((t) => !!t)).subscribe(() => {
|
|
@@ -1274,21 +1290,21 @@ let Fe = class extends Ve {
|
|
|
1274
1290
|
*/
|
|
1275
1291
|
_subscribeToCurrentCell(e) {
|
|
1276
1292
|
e.add(this._editorBridgeService.currentEditRectState$.subscribe((t) => {
|
|
1277
|
-
var
|
|
1278
|
-
if (t == null || this._contextService.getContextValue(
|
|
1293
|
+
var p;
|
|
1294
|
+
if (t == null || this._contextService.getContextValue(bt) || this._contextService.getContextValue(Et))
|
|
1279
1295
|
return;
|
|
1280
1296
|
const {
|
|
1281
1297
|
position: { startX: n, endX: r },
|
|
1282
1298
|
documentLayoutObject: { textRotation: s, wrapStrategy: o, documentModel: a },
|
|
1283
1299
|
scaleX: c,
|
|
1284
|
-
editorUnitId:
|
|
1300
|
+
editorUnitId: g
|
|
1285
1301
|
} = t, { vertexAngle: l } = rt(s);
|
|
1286
|
-
a.updateDocumentId(
|
|
1302
|
+
a.updateDocumentId(g), o === tt.WRAP && l === 0 && a.updateDocumentDataPageSize((r - n) / c), this._instanceSrv.changeDoc(g, a), this._contextService.setContextValue(Sn, !0), this._textSelectionManagerService.replaceTextRanges([{
|
|
1287
1303
|
startOffset: 0,
|
|
1288
1304
|
endOffset: 0
|
|
1289
1305
|
}]);
|
|
1290
|
-
const d = (
|
|
1291
|
-
d && d.activate(
|
|
1306
|
+
const d = (p = this._renderManagerService.getCurrentTypeOfRenderer(E.UNIVER_DOC)) == null ? void 0 : p.with(ut);
|
|
1307
|
+
d && d.activate(Ct, Ct);
|
|
1292
1308
|
}));
|
|
1293
1309
|
}
|
|
1294
1310
|
/**
|
|
@@ -1301,50 +1317,50 @@ let Fe = class extends Ve {
|
|
|
1301
1317
|
* @param scaleY
|
|
1302
1318
|
*/
|
|
1303
1319
|
_fitTextSize(e, t, n, r, s = 1, o = 1) {
|
|
1304
|
-
const { startX: a, startY: c, endX:
|
|
1320
|
+
const { startX: a, startY: c, endX: g, endY: l } = e, d = r.documentModel;
|
|
1305
1321
|
if (d == null)
|
|
1306
1322
|
return;
|
|
1307
|
-
const { actualWidth:
|
|
1323
|
+
const { actualWidth: p, actualHeight: v } = this._predictingSize(
|
|
1308
1324
|
e,
|
|
1309
1325
|
t,
|
|
1310
1326
|
n,
|
|
1311
1327
|
r,
|
|
1312
1328
|
s,
|
|
1313
1329
|
o
|
|
1314
|
-
), { verticalAlign:
|
|
1315
|
-
let _ =
|
|
1316
|
-
if (_ <
|
|
1317
|
-
|
|
1330
|
+
), { verticalAlign: f, paddingData: C, fill: h } = r;
|
|
1331
|
+
let _ = g - a, P = l - c;
|
|
1332
|
+
if (_ < p && (_ = p), P < v)
|
|
1333
|
+
P = v, d.updateDocumentDataMargin(C);
|
|
1318
1334
|
else {
|
|
1319
|
-
let
|
|
1320
|
-
|
|
1321
|
-
t:
|
|
1335
|
+
let b = 0;
|
|
1336
|
+
f === ye.MIDDLE ? b = (P - v) / 2 / o : f === ye.TOP ? b = C.t || 0 : b = (P - v) / o - (C.b || 0), b = b < (C.t || 0) ? C.t || 0 : b, d.updateDocumentDataMargin({
|
|
1337
|
+
t: b
|
|
1322
1338
|
});
|
|
1323
1339
|
}
|
|
1324
|
-
n.calculate(), this._editAreaProcessing(_,
|
|
1340
|
+
n.calculate(), this._editAreaProcessing(_, P, e, t, h, s, o);
|
|
1325
1341
|
}
|
|
1326
1342
|
/**
|
|
1327
1343
|
* Mainly used to pre-calculate the width of the editor,
|
|
1328
1344
|
* to determine whether it needs to be automatically widened.
|
|
1329
1345
|
*/
|
|
1330
1346
|
_predictingSize(e, t, n, r, s = 1, o = 1) {
|
|
1331
|
-
const { startX: a, endX: c } = e, { textRotation:
|
|
1332
|
-
if (l === tt.WRAP &&
|
|
1333
|
-
const { actualWidth:
|
|
1347
|
+
const { startX: a, endX: c } = e, { textRotation: g, wrapStrategy: l } = r, d = r.documentModel, { vertexAngle: p } = rt(g), v = document.body.clientWidth;
|
|
1348
|
+
if (l === tt.WRAP && p === 0) {
|
|
1349
|
+
const { actualWidth: h, actualHeight: _ } = n.getActualSize();
|
|
1334
1350
|
return {
|
|
1335
|
-
actualWidth:
|
|
1351
|
+
actualWidth: h * s,
|
|
1336
1352
|
actualHeight: _ * o
|
|
1337
1353
|
};
|
|
1338
1354
|
}
|
|
1339
|
-
d == null || d.updateDocumentDataPageSize((
|
|
1340
|
-
const
|
|
1341
|
-
let
|
|
1342
|
-
return
|
|
1355
|
+
d == null || d.updateDocumentDataPageSize((v - a - t.left) / s), n.calculate();
|
|
1356
|
+
const f = n.getActualSize();
|
|
1357
|
+
let C = c - a;
|
|
1358
|
+
return C < f.actualWidth * s + ft * s && (C = f.actualWidth * s + ft * s), d == null || d.updateDocumentDataPageSize(C / s), d == null || d.updateDocumentRenderConfig({
|
|
1343
1359
|
horizontalAlign: Rt.UNSPECIFIED,
|
|
1344
1360
|
cellValueType: void 0
|
|
1345
1361
|
}), {
|
|
1346
|
-
actualWidth:
|
|
1347
|
-
actualHeight:
|
|
1362
|
+
actualWidth: C,
|
|
1363
|
+
actualHeight: f.actualHeight * o
|
|
1348
1364
|
};
|
|
1349
1365
|
}
|
|
1350
1366
|
/**
|
|
@@ -1356,15 +1372,15 @@ let Fe = class extends Ve {
|
|
|
1356
1372
|
const c = this._getEditorObject();
|
|
1357
1373
|
if (c == null)
|
|
1358
1374
|
return;
|
|
1359
|
-
function
|
|
1360
|
-
return Number.parseInt(
|
|
1375
|
+
function g(le) {
|
|
1376
|
+
return Number.parseInt(le.replace("px", ""));
|
|
1361
1377
|
}
|
|
1362
|
-
const d = this._renderContext.engine.getCanvasElement(),
|
|
1363
|
-
let { startX:
|
|
1364
|
-
|
|
1365
|
-
const { document: w, scene: D, engine:
|
|
1378
|
+
const d = this._renderContext.engine.getCanvasElement(), p = d.getBoundingClientRect(), v = g(d.style.width), { top: f, left: C, width: h } = p, _ = h / v;
|
|
1379
|
+
let { startX: P, startY: b } = n;
|
|
1380
|
+
P += r.left, b += r.top;
|
|
1381
|
+
const { document: w, scene: D, engine: B } = c, O = D.getViewport(gt.VIEW_MAIN), G = document.body.clientHeight - b - r.top - pr * 2, ce = document.body.clientWidth - P - r.left;
|
|
1366
1382
|
let z = t, W = O == null ? void 0 : O.getScrollBar();
|
|
1367
|
-
z >
|
|
1383
|
+
z > G ? (z = G, W == null ? O && new yt(O, { enableHorizontal: !1, barSize: 8 }) : O == null || O.resetCanvasSizeAndUpdateScroll()) : (W = null, (S = O == null ? void 0 : O.getScrollBar()) == null || S.dispose()), e += (W == null ? void 0 : W.barSize) || 0, e = Math.min(e, ce), P -= se, b -= se, this._addBackground(D, e / o, t / a, s);
|
|
1368
1384
|
const { scaleX: te, scaleY: ne } = D.getPrecisionScale();
|
|
1369
1385
|
D.transformByState({
|
|
1370
1386
|
width: e * _ / o,
|
|
@@ -1372,17 +1388,17 @@ let Fe = class extends Ve {
|
|
|
1372
1388
|
scaleX: o * _,
|
|
1373
1389
|
scaleY: a * _
|
|
1374
1390
|
}), w.resize(e / o, t / a), setTimeout(() => {
|
|
1375
|
-
|
|
1391
|
+
B.resizeBySize(
|
|
1376
1392
|
st(e, te),
|
|
1377
1393
|
st(z, ne)
|
|
1378
1394
|
);
|
|
1379
1395
|
}, 0);
|
|
1380
1396
|
const Se = this._layoutService.getContentElement().getBoundingClientRect(), Ie = d.getBoundingClientRect();
|
|
1381
|
-
|
|
1382
|
-
startX:
|
|
1383
|
-
startY:
|
|
1384
|
-
endX: e * _ +
|
|
1385
|
-
endY: z * _ +
|
|
1397
|
+
P = P * _ + (Ie.left - Se.left), b = b * _ + (Ie.top - Se.top), this._cellEditorManagerService.setState({
|
|
1398
|
+
startX: P,
|
|
1399
|
+
startY: b,
|
|
1400
|
+
endX: e * _ + P,
|
|
1401
|
+
endY: z * _ + b,
|
|
1386
1402
|
show: !0
|
|
1387
1403
|
});
|
|
1388
1404
|
}
|
|
@@ -1393,14 +1409,14 @@ let Fe = class extends Ve {
|
|
|
1393
1409
|
const s = "_backgroundRectHelperColor_", o = e.getObject(s);
|
|
1394
1410
|
o == null && r == null || (o == null ? e.addObjects(
|
|
1395
1411
|
[
|
|
1396
|
-
new
|
|
1412
|
+
new Mt(s, {
|
|
1397
1413
|
width: t,
|
|
1398
1414
|
height: n,
|
|
1399
1415
|
fill: r,
|
|
1400
1416
|
evented: !1
|
|
1401
1417
|
})
|
|
1402
1418
|
],
|
|
1403
|
-
|
|
1419
|
+
Xn
|
|
1404
1420
|
) : r == null ? o.dispose() : (o.setProps({
|
|
1405
1421
|
fill: r
|
|
1406
1422
|
}), o.transformByState({
|
|
@@ -1417,9 +1433,9 @@ let Fe = class extends Ve {
|
|
|
1417
1433
|
// first part: startEditing --> _updateEditor
|
|
1418
1434
|
// 2nd part: startEditing --> changeVisible --> slide-editor-bridge.render-controller.ts@changeVisible --> _editorBridgeService.changeVisible
|
|
1419
1435
|
_handleEditorVisible(e) {
|
|
1420
|
-
var
|
|
1436
|
+
var h, _;
|
|
1421
1437
|
const { eventType: t } = e;
|
|
1422
|
-
this._cursorChange = [J.PointerDown, J.Dblclick].includes(t) ?
|
|
1438
|
+
this._cursorChange = [J.PointerDown, J.Dblclick].includes(t) ? k.CursorChange : k.StartEditor;
|
|
1423
1439
|
const n = this._editorBridgeService.getEditRectState();
|
|
1424
1440
|
if (n == null)
|
|
1425
1441
|
return;
|
|
@@ -1429,29 +1445,29 @@ let Fe = class extends Ve {
|
|
|
1429
1445
|
slideCardOffset: o,
|
|
1430
1446
|
scaleX: a,
|
|
1431
1447
|
scaleY: c,
|
|
1432
|
-
editorUnitId:
|
|
1448
|
+
editorUnitId: g,
|
|
1433
1449
|
unitId: l
|
|
1434
1450
|
} = n, d = this._getEditorObject();
|
|
1435
1451
|
if (d == null)
|
|
1436
1452
|
return;
|
|
1437
|
-
const { scene:
|
|
1453
|
+
const { scene: p } = d;
|
|
1438
1454
|
this._contextService.setContextValue(xe, !0);
|
|
1439
|
-
const { documentModel:
|
|
1440
|
-
if (!
|
|
1455
|
+
const { documentModel: v } = s, f = this._getEditorSkeleton(g);
|
|
1456
|
+
if (!f || !v)
|
|
1441
1457
|
return;
|
|
1442
|
-
this._fitTextSize(r, o,
|
|
1443
|
-
const
|
|
1444
|
-
(
|
|
1458
|
+
this._fitTextSize(r, o, f, s, a, c);
|
|
1459
|
+
const C = v.getBody().dataStream.length - 2 || 0;
|
|
1460
|
+
(h = p.getViewport(gt.VIEW_MAIN)) == null || h.scrollToViewportPos({
|
|
1445
1461
|
viewportScrollX: Number.POSITIVE_INFINITY
|
|
1446
1462
|
}), this._textSelectionManagerService.replaceTextRanges([
|
|
1447
1463
|
{
|
|
1448
|
-
startOffset:
|
|
1449
|
-
endOffset:
|
|
1464
|
+
startOffset: C,
|
|
1465
|
+
endOffset: C
|
|
1450
1466
|
}
|
|
1451
1467
|
]), (_ = this._renderManagerService.getRenderById(l)) == null || _.scene.resetCursor();
|
|
1452
1468
|
}
|
|
1453
1469
|
_resetBodyStyle(e, t = !1) {
|
|
1454
|
-
e.dataStream =
|
|
1470
|
+
e.dataStream = Ot, 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 = [
|
|
1455
1471
|
{
|
|
1456
1472
|
startIndex: 0
|
|
1457
1473
|
}
|
|
@@ -1466,14 +1482,14 @@ let Fe = class extends Ve {
|
|
|
1466
1482
|
_showEditorByKeyboard(e) {
|
|
1467
1483
|
}
|
|
1468
1484
|
_commandExecutedListener(e) {
|
|
1469
|
-
const t = [we.id], n = [
|
|
1485
|
+
const t = [we.id], n = [Gn.id];
|
|
1470
1486
|
e.add(this._commandService.onCommandExecuted((r) => {
|
|
1471
|
-
this._editorService.getFocusId() ===
|
|
1487
|
+
this._editorService.getFocusId() === ae && (t.includes(r.id) && this._moveCursorCmdHandler(r), n.includes(r.id) && this._editorBridgeService.isVisible() && this._editingChangedHandler());
|
|
1472
1488
|
}));
|
|
1473
1489
|
}
|
|
1474
1490
|
_moveCursorCmdHandler(e) {
|
|
1475
1491
|
const t = e.params, { keycode: n, isShift: r } = t;
|
|
1476
|
-
n != null && this._cursorChange ===
|
|
1492
|
+
n != null && this._cursorChange === k.CursorChange ? this._moveInEditor(n, r) : this._editorBridgeService.changeVisible(t);
|
|
1477
1493
|
}
|
|
1478
1494
|
_editingChangedHandler() {
|
|
1479
1495
|
const e = this._editorBridgeService.getEditorRect();
|
|
@@ -1485,11 +1501,11 @@ let Fe = class extends Ve {
|
|
|
1485
1501
|
this._handleEditorVisible({ visible: !0, eventType: 3, unitId: n });
|
|
1486
1502
|
}
|
|
1487
1503
|
_getEditorObject() {
|
|
1488
|
-
return
|
|
1504
|
+
return Cr(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
|
|
1489
1505
|
}
|
|
1490
1506
|
async _handleEditorInvisible(e) {
|
|
1491
1507
|
const { keycode: t } = e;
|
|
1492
|
-
if (this._cursorChange =
|
|
1508
|
+
if (this._cursorChange = k.InitialState, this._exitInput(e), this._editorBridgeService.getEditRectState() == null)
|
|
1493
1509
|
return;
|
|
1494
1510
|
if (this._editorBridgeService.getEditorDirty() === !1) {
|
|
1495
1511
|
this._moveCursor(t);
|
|
@@ -1506,24 +1522,24 @@ let Fe = class extends Ve {
|
|
|
1506
1522
|
}
|
|
1507
1523
|
_moveCursor(e) {
|
|
1508
1524
|
if (e != null)
|
|
1509
|
-
switch (
|
|
1510
|
-
case
|
|
1511
|
-
|
|
1525
|
+
switch (L.LEFT, e) {
|
|
1526
|
+
case M.ENTER:
|
|
1527
|
+
L.DOWN;
|
|
1512
1528
|
break;
|
|
1513
|
-
case
|
|
1514
|
-
|
|
1529
|
+
case M.TAB:
|
|
1530
|
+
L.RIGHT;
|
|
1515
1531
|
break;
|
|
1516
|
-
case
|
|
1517
|
-
|
|
1532
|
+
case M.ARROW_DOWN:
|
|
1533
|
+
L.DOWN;
|
|
1518
1534
|
break;
|
|
1519
|
-
case
|
|
1520
|
-
|
|
1535
|
+
case M.ARROW_UP:
|
|
1536
|
+
L.UP;
|
|
1521
1537
|
break;
|
|
1522
|
-
case
|
|
1523
|
-
|
|
1538
|
+
case M.ARROW_LEFT:
|
|
1539
|
+
L.LEFT;
|
|
1524
1540
|
break;
|
|
1525
|
-
case
|
|
1526
|
-
|
|
1541
|
+
case M.ARROW_RIGHT:
|
|
1542
|
+
L.RIGHT;
|
|
1527
1543
|
break;
|
|
1528
1544
|
}
|
|
1529
1545
|
}
|
|
@@ -1537,39 +1553,39 @@ let Fe = class extends Ve {
|
|
|
1537
1553
|
return;
|
|
1538
1554
|
const { document: n } = t;
|
|
1539
1555
|
e.add(It(n.onPointerDown$.subscribeEvent(() => {
|
|
1540
|
-
this._cursorChange ===
|
|
1556
|
+
this._cursorChange === k.StartEditor && (this._cursorChange = k.CursorChange);
|
|
1541
1557
|
})));
|
|
1542
1558
|
}
|
|
1543
1559
|
// TODO: @JOCS, is it necessary to move these commands MoveSelectionOperation\MoveCursorOperation to shortcut? and use multi-commands?
|
|
1544
1560
|
_moveInEditor(e, t) {
|
|
1545
|
-
let n =
|
|
1546
|
-
e ===
|
|
1561
|
+
let n = L.LEFT;
|
|
1562
|
+
e === M.ARROW_DOWN ? n = L.DOWN : e === M.ARROW_UP ? n = L.UP : e === M.ARROW_RIGHT && (n = L.RIGHT), t ? this._commandService.executeCommand(Yn.id, {
|
|
1547
1563
|
direction: n
|
|
1548
|
-
}) : this._commandService.executeCommand(
|
|
1564
|
+
}) : this._commandService.executeCommand(Zn.id, {
|
|
1549
1565
|
direction: n
|
|
1550
1566
|
});
|
|
1551
1567
|
}
|
|
1552
1568
|
};
|
|
1553
|
-
Fe =
|
|
1569
|
+
Fe = hr([
|
|
1554
1570
|
A(1, Nn),
|
|
1555
|
-
A(2,
|
|
1556
|
-
A(3,
|
|
1571
|
+
A(2, In),
|
|
1572
|
+
A(3, fe),
|
|
1557
1573
|
A(4, y),
|
|
1558
|
-
A(5,
|
|
1574
|
+
A(5, Z),
|
|
1559
1575
|
A(6, qe),
|
|
1560
1576
|
A(7, Je),
|
|
1561
|
-
A(8,
|
|
1562
|
-
A(9,
|
|
1563
|
-
A(10,
|
|
1564
|
-
A(11,
|
|
1577
|
+
A(8, Y(Kn)),
|
|
1578
|
+
A(9, j),
|
|
1579
|
+
A(10, Y(ee)),
|
|
1580
|
+
A(11, Ye)
|
|
1565
1581
|
], Fe);
|
|
1566
|
-
function
|
|
1582
|
+
function Cr(i, e) {
|
|
1567
1583
|
if (i == null)
|
|
1568
1584
|
return;
|
|
1569
1585
|
const t = e.getRenderById(i);
|
|
1570
1586
|
if (t == null)
|
|
1571
1587
|
return;
|
|
1572
|
-
const { mainComponent: n, scene: r, engine: s, components: o } = t, a = n, c = o.get(
|
|
1588
|
+
const { mainComponent: n, scene: r, engine: s, components: o } = t, a = n, c = o.get(kn.BACKGROUND);
|
|
1573
1589
|
return {
|
|
1574
1590
|
document: a,
|
|
1575
1591
|
docBackground: c,
|
|
@@ -1577,12 +1593,12 @@ function Xi(i, e) {
|
|
|
1577
1593
|
engine: s
|
|
1578
1594
|
};
|
|
1579
1595
|
}
|
|
1580
|
-
var
|
|
1581
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1582
|
-
(o = i[s]) && (r = o(r) || r);
|
|
1583
|
-
return r;
|
|
1584
|
-
},
|
|
1585
|
-
let ze = class extends
|
|
1596
|
+
var fr = Object.defineProperty, vr = Object.getOwnPropertyDescriptor, _r = (i, e, t, n) => {
|
|
1597
|
+
for (var r = n > 1 ? void 0 : n ? vr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1598
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
1599
|
+
return n && r && fr(e, t, r), r;
|
|
1600
|
+
}, Le = (i, e) => (t, n) => e(t, n, i);
|
|
1601
|
+
let ze = class extends Ce {
|
|
1586
1602
|
constructor(e, t, n, r) {
|
|
1587
1603
|
super();
|
|
1588
1604
|
/**
|
|
@@ -1591,7 +1607,7 @@ let ze = class extends pe {
|
|
|
1591
1607
|
// private _cursorChange: CursorChange = CursorChange.InitialState;
|
|
1592
1608
|
/** If the corresponding unit is active and prepared for editing. */
|
|
1593
1609
|
// private _isUnitEditing = false;
|
|
1594
|
-
I(this, "setSlideTextEditor$", new
|
|
1610
|
+
I(this, "setSlideTextEditor$", new Ut());
|
|
1595
1611
|
I(this, "_curRichText", null);
|
|
1596
1612
|
I(this, "_d");
|
|
1597
1613
|
this._renderContext = e, this._instanceSrv = t, this._commandService = n, this._editorBridgeService = r, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(E.UNIVER_SLIDE).subscribe((s) => {
|
|
@@ -1599,7 +1615,7 @@ let ze = class extends pe {
|
|
|
1599
1615
|
}));
|
|
1600
1616
|
}
|
|
1601
1617
|
_init() {
|
|
1602
|
-
const e = new
|
|
1618
|
+
const e = new Xe();
|
|
1603
1619
|
return this._initEventListener(e), e;
|
|
1604
1620
|
}
|
|
1605
1621
|
_disposeCurrent() {
|
|
@@ -1626,8 +1642,8 @@ let ze = class extends pe {
|
|
|
1626
1642
|
this.setEditorVisible(!1);
|
|
1627
1643
|
})), e.add(o.onDblclick$.subscribeEvent(() => {
|
|
1628
1644
|
a.clearControls();
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1645
|
+
const g = a.getSelectedObjectMap().values().next().value;
|
|
1646
|
+
g && (g.objectType !== ge.RICH_TEXT ? this.pickOtherObjects() : this.startEditing(o.sceneKey, g));
|
|
1631
1647
|
})), e.add(this._instanceSrv.focused$.subscribe((c) => {
|
|
1632
1648
|
this.endEditing();
|
|
1633
1649
|
})));
|
|
@@ -1665,7 +1681,7 @@ let ze = class extends pe {
|
|
|
1665
1681
|
const a = r[0].ts;
|
|
1666
1682
|
n.cl = a == null ? void 0 : a.cl;
|
|
1667
1683
|
}
|
|
1668
|
-
this._commandService.executeCommand(
|
|
1684
|
+
this._commandService.executeCommand(K.id, {
|
|
1669
1685
|
unitId: this._renderContext.unitId,
|
|
1670
1686
|
oKey: e == null ? void 0 : e.oKey,
|
|
1671
1687
|
props: {
|
|
@@ -1690,24 +1706,24 @@ let ze = class extends pe {
|
|
|
1690
1706
|
this._editorBridgeService.changeVisible({ visible: e, eventType: J.PointerDown, unitId: t });
|
|
1691
1707
|
}
|
|
1692
1708
|
};
|
|
1693
|
-
ze =
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1709
|
+
ze = _r([
|
|
1710
|
+
Le(1, y),
|
|
1711
|
+
Le(2, j),
|
|
1712
|
+
Le(3, qe)
|
|
1697
1713
|
], ze);
|
|
1698
|
-
const
|
|
1714
|
+
const Zt = {
|
|
1699
1715
|
id: "slide.operation.activate-slide",
|
|
1700
1716
|
type: V.OPERATION,
|
|
1701
1717
|
handler: (i, e) => {
|
|
1702
|
-
var
|
|
1703
|
-
const t = e.unitId, n = i.get(N), s = i.get(y).getUnit(t), o = (
|
|
1718
|
+
var g, l;
|
|
1719
|
+
const t = e.unitId, n = i.get(N), s = i.get(y).getUnit(t), o = (g = s == null ? void 0 : s.getActivePage()) == null ? void 0 : g.id;
|
|
1704
1720
|
if (!o) return !1;
|
|
1705
1721
|
const a = n.getRenderUnitByPageId(o, t);
|
|
1706
1722
|
if (!a) return !1;
|
|
1707
1723
|
const c = (l = a.scene) == null ? void 0 : l.getTransformer();
|
|
1708
1724
|
return c && c.clearControls(), n.activePage(e.id, t), !0;
|
|
1709
1725
|
}
|
|
1710
|
-
},
|
|
1726
|
+
}, kt = {
|
|
1711
1727
|
id: "slide.operation.append-slide",
|
|
1712
1728
|
type: V.OPERATION,
|
|
1713
1729
|
handler: (i, e) => {
|
|
@@ -1718,8 +1734,8 @@ const Xt = {
|
|
|
1718
1734
|
id: "slide.command.insert-float-image",
|
|
1719
1735
|
type: V.COMMAND,
|
|
1720
1736
|
handler: async (i, e) => {
|
|
1721
|
-
var
|
|
1722
|
-
const t = i.get(y), n = (
|
|
1737
|
+
var B;
|
|
1738
|
+
const t = i.get(y), n = (B = t.getCurrentUnitForType(E.UNIVER_SLIDE)) == null ? void 0 : B.getUnitId();
|
|
1723
1739
|
if (!n) return !1;
|
|
1724
1740
|
const s = await i.get(Dn).openFile({
|
|
1725
1741
|
multiple: !0,
|
|
@@ -1728,56 +1744,56 @@ const Xt = {
|
|
|
1728
1744
|
if (s.length !== 1) return !1;
|
|
1729
1745
|
const a = await i.get(Qn).saveImage(s[0]);
|
|
1730
1746
|
if (!a) return !1;
|
|
1731
|
-
const { imageId: c, imageSourceType:
|
|
1732
|
-
if (!
|
|
1733
|
-
const
|
|
1747
|
+
const { imageId: c, imageSourceType: g, source: l, base64Cache: d } = a, { width: p, height: v, image: f } = await ei(d || ""), C = t.getUnit(n);
|
|
1748
|
+
if (!C) return !1;
|
|
1749
|
+
const h = C.getActivePage(), _ = Object.values(h.pageElements), P = _ != null && _.length ? Math.max(..._.map((O) => O.zIndex)) : 20, b = {
|
|
1734
1750
|
id: c,
|
|
1735
|
-
zIndex:
|
|
1751
|
+
zIndex: P + 1,
|
|
1736
1752
|
left: 0,
|
|
1737
1753
|
top: 0,
|
|
1738
|
-
width:
|
|
1739
|
-
height:
|
|
1754
|
+
width: p,
|
|
1755
|
+
height: v,
|
|
1740
1756
|
title: "",
|
|
1741
1757
|
description: "",
|
|
1742
|
-
type:
|
|
1758
|
+
type: Ge.IMAGE,
|
|
1743
1759
|
image: {
|
|
1744
1760
|
imageProperties: {
|
|
1745
1761
|
contentUrl: d,
|
|
1746
|
-
imageSourceType:
|
|
1762
|
+
imageSourceType: g,
|
|
1747
1763
|
source: l,
|
|
1748
1764
|
base64Cache: d,
|
|
1749
|
-
image:
|
|
1765
|
+
image: f
|
|
1750
1766
|
}
|
|
1751
1767
|
}
|
|
1752
1768
|
};
|
|
1753
|
-
|
|
1754
|
-
const w = i.get(N), D = w.createObjectToPage(
|
|
1755
|
-
return D && w.setObjectActiveByPage(D,
|
|
1769
|
+
h.pageElements[c] = b, C.updatePage(h.id, h);
|
|
1770
|
+
const w = i.get(N), D = w.createObjectToPage(b, h.id, n);
|
|
1771
|
+
return D && w.setObjectActiveByPage(D, h.id, n), !0;
|
|
1756
1772
|
}
|
|
1757
1773
|
}, et = {
|
|
1758
1774
|
id: "slide.command.add-text",
|
|
1759
1775
|
type: V.COMMAND,
|
|
1760
1776
|
handler: async (i) => {
|
|
1761
1777
|
var r;
|
|
1762
|
-
const e = i.get(
|
|
1763
|
-
return await e.executeCommand(
|
|
1778
|
+
const e = i.get(j), n = (r = i.get(y).getFocusedUnit()) == null ? void 0 : r.getUnitId();
|
|
1779
|
+
return await e.executeCommand(qt.id, { unitId: n });
|
|
1764
1780
|
}
|
|
1765
|
-
},
|
|
1781
|
+
}, qt = {
|
|
1766
1782
|
id: "slide.operation.add-text",
|
|
1767
1783
|
type: V.OPERATION,
|
|
1768
1784
|
handler: async (i, e) => {
|
|
1769
1785
|
const t = e.unitId, n = St(6), r = 220, s = 40, o = 230, a = 142, c = (e == null ? void 0 : e.text) || "A New Text", l = i.get(y).getUnit(t);
|
|
1770
1786
|
if (!l) return !1;
|
|
1771
|
-
const d = l.getActivePage(),
|
|
1787
|
+
const d = l.getActivePage(), p = Object.values(d.pageElements), v = p != null && p.length ? Math.max(...p.map((_) => _.zIndex)) : 21, f = {
|
|
1772
1788
|
id: n,
|
|
1773
|
-
zIndex:
|
|
1789
|
+
zIndex: v + 1,
|
|
1774
1790
|
left: o,
|
|
1775
1791
|
top: a,
|
|
1776
1792
|
width: r,
|
|
1777
1793
|
height: s,
|
|
1778
1794
|
title: "text",
|
|
1779
1795
|
description: "",
|
|
1780
|
-
type:
|
|
1796
|
+
type: Ge.TEXT,
|
|
1781
1797
|
richText: {
|
|
1782
1798
|
text: c,
|
|
1783
1799
|
fs: 30,
|
|
@@ -1787,70 +1803,72 @@ const Xt = {
|
|
|
1787
1803
|
bl: 1
|
|
1788
1804
|
}
|
|
1789
1805
|
};
|
|
1790
|
-
d.pageElements[n] =
|
|
1791
|
-
const
|
|
1792
|
-
return
|
|
1806
|
+
d.pageElements[n] = f, l.updatePage(d.id, d);
|
|
1807
|
+
const C = i.get(N), h = C.createObjectToPage(f, d.id, t);
|
|
1808
|
+
return h && C.setObjectActiveByPage(h, d.id, t), !0;
|
|
1793
1809
|
}
|
|
1794
|
-
},
|
|
1810
|
+
}, Jt = {
|
|
1795
1811
|
id: "slide.operation.set-slide-page-thumb",
|
|
1796
1812
|
type: V.OPERATION,
|
|
1797
1813
|
handler: (i, e) => (i.get(N).createThumbs(e.unitId), !0)
|
|
1798
|
-
},
|
|
1799
|
-
imagePopupMenu:
|
|
1800
|
-
imagePopupMenuItem:
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1814
|
+
}, Sr = "univer-image-popup-menu", Ir = "univer-image-popup-menu-item", Pr = "univer-image-popup-menu-item-icon", br = "univer-image-popup-menu-item-title", Er = "univer-image-popup-menu-item-hide", Rr = "univer-btn-container", Or = "univer-btn-container-expand", ue = {
|
|
1815
|
+
imagePopupMenu: Sr,
|
|
1816
|
+
imagePopupMenuItem: Ir,
|
|
1817
|
+
imagePopupMenuItemIcon: Pr,
|
|
1818
|
+
imagePopupMenuItemTitle: br,
|
|
1819
|
+
imagePopupMenuItemHide: Er,
|
|
1820
|
+
btnContainer: Rr,
|
|
1821
|
+
btnContainerExpand: Or
|
|
1822
|
+
}, xr = (i) => {
|
|
1823
|
+
var f, C;
|
|
1824
|
+
const e = (C = (f = i.popup) == null ? void 0 : f.extraProps) == null ? void 0 : C.menuItems;
|
|
1807
1825
|
if (!e)
|
|
1808
1826
|
return null;
|
|
1809
|
-
const t = x(
|
|
1827
|
+
const t = x(j), n = x(ee), [r, s] = X(!1), [o, a] = X(!1), c = () => {
|
|
1810
1828
|
a(!0);
|
|
1811
|
-
},
|
|
1829
|
+
}, g = () => {
|
|
1812
1830
|
a(!1);
|
|
1813
|
-
}, l = (
|
|
1814
|
-
s(
|
|
1815
|
-
}, d = (
|
|
1816
|
-
t.executeCommand(
|
|
1817
|
-
},
|
|
1818
|
-
return /* @__PURE__ */
|
|
1831
|
+
}, l = (h) => {
|
|
1832
|
+
s(h);
|
|
1833
|
+
}, d = (h) => {
|
|
1834
|
+
t.executeCommand(h.commandId, h.commandParams), s(!1);
|
|
1835
|
+
}, p = r || o, v = e.filter((h) => !h.disable);
|
|
1836
|
+
return /* @__PURE__ */ m(
|
|
1819
1837
|
"div",
|
|
1820
1838
|
{
|
|
1821
1839
|
onMouseEnter: c,
|
|
1822
|
-
onMouseLeave:
|
|
1823
|
-
children: /* @__PURE__ */
|
|
1824
|
-
|
|
1840
|
+
onMouseLeave: g,
|
|
1841
|
+
children: /* @__PURE__ */ m(
|
|
1842
|
+
wt,
|
|
1825
1843
|
{
|
|
1826
1844
|
placement: "bottomLeft",
|
|
1827
1845
|
trigger: ["click"],
|
|
1828
|
-
overlay: /* @__PURE__ */
|
|
1846
|
+
overlay: /* @__PURE__ */ m("ul", { className: ue.imagePopupMenu, children: v.map((h) => /* @__PURE__ */ m(
|
|
1829
1847
|
"li",
|
|
1830
1848
|
{
|
|
1831
|
-
onClick: () => d(
|
|
1832
|
-
className:
|
|
1833
|
-
children: /* @__PURE__ */
|
|
1849
|
+
onClick: () => d(h),
|
|
1850
|
+
className: ue.imagePopupMenuItem,
|
|
1851
|
+
children: /* @__PURE__ */ m("span", { className: ue.imagePopupMenuItemTitle, children: n.t(h.label) })
|
|
1834
1852
|
},
|
|
1835
|
-
|
|
1853
|
+
h.index
|
|
1836
1854
|
)) }),
|
|
1837
1855
|
visible: r,
|
|
1838
1856
|
onVisibleChange: l,
|
|
1839
1857
|
children: /* @__PURE__ */ R(
|
|
1840
1858
|
"div",
|
|
1841
1859
|
{
|
|
1842
|
-
className:
|
|
1843
|
-
[
|
|
1860
|
+
className: T(ue.btnContainer, {
|
|
1861
|
+
[ue.btnContainerExpand]: r
|
|
1844
1862
|
}),
|
|
1845
1863
|
children: [
|
|
1846
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ m(
|
|
1847
1865
|
Lt,
|
|
1848
1866
|
{
|
|
1849
1867
|
style: { color: "#35322B" },
|
|
1850
1868
|
extend: { colorChannel1: "rgb(var(--green-700, #409f11))" }
|
|
1851
1869
|
}
|
|
1852
1870
|
),
|
|
1853
|
-
|
|
1871
|
+
p && /* @__PURE__ */ m(Ze, { style: { color: "#CCCCCC", fontSize: "8px", marginLeft: "8px" } })
|
|
1854
1872
|
]
|
|
1855
1873
|
}
|
|
1856
1874
|
)
|
|
@@ -1858,112 +1876,114 @@ const Xt = {
|
|
|
1858
1876
|
)
|
|
1859
1877
|
}
|
|
1860
1878
|
);
|
|
1861
|
-
},
|
|
1862
|
-
slideBar:
|
|
1863
|
-
slideBarContent:
|
|
1864
|
-
slideBarContentHeader:
|
|
1865
|
-
slideBarItem:
|
|
1866
|
-
slideBarBox:
|
|
1867
|
-
slideBarItemActive:
|
|
1879
|
+
}, yr = "univer-slide-bar", Mr = "univer-slide-bar-content", Tr = "univer-slide-bar-content-header", wr = "univer-slide-bar-item", Nr = "univer-slide-bar-box", Dr = "univer-slide-bar-item-active", Ur = "univer-slide-add-button", ie = {
|
|
1880
|
+
slideBar: yr,
|
|
1881
|
+
slideBarContent: Mr,
|
|
1882
|
+
slideBarContentHeader: Tr,
|
|
1883
|
+
slideBarItem: wr,
|
|
1884
|
+
slideBarBox: Nr,
|
|
1885
|
+
slideBarItemActive: Dr,
|
|
1886
|
+
slideAddButton: Ur
|
|
1868
1887
|
};
|
|
1869
|
-
function
|
|
1870
|
-
var
|
|
1871
|
-
const i = x(y), e = x(
|
|
1888
|
+
function Vr() {
|
|
1889
|
+
var f, C;
|
|
1890
|
+
const i = x(y), e = x(j), t = x(Z), n = x(ee), r = Dt(null), s = i.getCurrentUnitForType(E.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), a = s == null ? void 0 : s.getPageOrder();
|
|
1872
1891
|
if (!o || !a)
|
|
1873
1892
|
return null;
|
|
1874
|
-
const c = a.map((
|
|
1875
|
-
|
|
1876
|
-
const
|
|
1877
|
-
var
|
|
1878
|
-
const
|
|
1879
|
-
|
|
1893
|
+
const c = a.map((h) => o[h]), [g, l] = X((C = (f = s == null ? void 0 : s.getActivePage()) == null ? void 0 : f.id) != null ? C : null), d = zn(() => c.map(() => Nt.createRef()), [c]);
|
|
1894
|
+
he(() => {
|
|
1895
|
+
const h = s == null ? void 0 : s.activePage$.subscribe((_) => {
|
|
1896
|
+
var b;
|
|
1897
|
+
const P = (b = _ == null ? void 0 : _.id) != null ? b : null;
|
|
1898
|
+
P && l(P);
|
|
1880
1899
|
});
|
|
1881
1900
|
return () => {
|
|
1882
|
-
|
|
1901
|
+
h == null || h.unsubscribe();
|
|
1883
1902
|
};
|
|
1884
|
-
}, []),
|
|
1885
|
-
d.forEach((
|
|
1886
|
-
var
|
|
1887
|
-
if (
|
|
1888
|
-
const
|
|
1889
|
-
(
|
|
1903
|
+
}, []), he(() => {
|
|
1904
|
+
d.forEach((h, _) => {
|
|
1905
|
+
var P;
|
|
1906
|
+
if (h.current) {
|
|
1907
|
+
const b = c[_];
|
|
1908
|
+
(P = t.getRenderById(b.id)) == null || P.engine.setContainer(h.current);
|
|
1890
1909
|
}
|
|
1891
|
-
}), d.length > 0 && e.syncExecuteCommand(
|
|
1910
|
+
}), d.length > 0 && e.syncExecuteCommand(Jt.id, { unitId: s == null ? void 0 : s.getUnitId() });
|
|
1892
1911
|
}, [d, c, t, e, s]);
|
|
1893
|
-
const
|
|
1894
|
-
e.syncExecuteCommand(
|
|
1895
|
-
}, [e, s]),
|
|
1896
|
-
e.syncExecuteCommand(
|
|
1912
|
+
const p = lt((h) => {
|
|
1913
|
+
e.syncExecuteCommand(Zt.id, { id: h, unitId: s == null ? void 0 : s.getUnitId() });
|
|
1914
|
+
}, [e, s]), v = lt(() => {
|
|
1915
|
+
e.syncExecuteCommand(kt.id, { unitId: s == null ? void 0 : s.getUnitId() });
|
|
1897
1916
|
}, [e, s]);
|
|
1898
|
-
return /* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
c.map((
|
|
1917
|
+
return /* @__PURE__ */ m("aside", { className: ie.slideBar, ref: r, children: /* @__PURE__ */ m(Fn, { children: /* @__PURE__ */ R("div", { className: ie.slideBarContent, children: [
|
|
1918
|
+
/* @__PURE__ */ m("header", { className: ie.slideBarContentHeader, children: /* @__PURE__ */ m("a", { onClick: v, children: n.t("slide.append") }) }),
|
|
1919
|
+
c.map((h, _) => /* @__PURE__ */ R(
|
|
1901
1920
|
"div",
|
|
1902
1921
|
{
|
|
1903
|
-
className:
|
|
1904
|
-
[ie.slideBarItemActive]:
|
|
1922
|
+
className: T(ie.slideBarItem, {
|
|
1923
|
+
[ie.slideBarItemActive]: h.id === g
|
|
1905
1924
|
}),
|
|
1906
|
-
onClick: () =>
|
|
1925
|
+
onClick: () => p(h.id),
|
|
1907
1926
|
children: [
|
|
1908
|
-
/* @__PURE__ */
|
|
1909
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ m("span", { children: _ + 1 }),
|
|
1928
|
+
/* @__PURE__ */ m("div", { ref: d[_], className: ie.slideBarBox })
|
|
1910
1929
|
]
|
|
1911
1930
|
},
|
|
1912
|
-
|
|
1931
|
+
h.id
|
|
1913
1932
|
))
|
|
1914
1933
|
] }) }) });
|
|
1915
1934
|
}
|
|
1916
|
-
const
|
|
1917
|
-
slideEditorContainer:
|
|
1918
|
-
|
|
1935
|
+
const jr = "univer-slide-editor-container", Br = "univer-editor-input", Lr = {
|
|
1936
|
+
slideEditorContainer: jr,
|
|
1937
|
+
editorInput: Br
|
|
1938
|
+
}, Ne = -1e3, vt = {
|
|
1919
1939
|
width: 0,
|
|
1920
1940
|
height: 0,
|
|
1921
1941
|
top: Ne,
|
|
1922
1942
|
left: Ne
|
|
1923
|
-
},
|
|
1924
|
-
const [i, e] =
|
|
1925
|
-
...
|
|
1926
|
-
}), t = x(Je), n = x(
|
|
1943
|
+
}, Ar = () => {
|
|
1944
|
+
const [i, e] = X({
|
|
1945
|
+
...vt
|
|
1946
|
+
}), t = x(Je), n = x(Ye), r = x(fe), s = Un(
|
|
1927
1947
|
() => r.subscribeContextValue$(ot),
|
|
1928
1948
|
!1,
|
|
1929
1949
|
void 0,
|
|
1930
1950
|
[r, ot]
|
|
1931
1951
|
);
|
|
1932
|
-
return
|
|
1952
|
+
return `${Ot}`, Pn.UNSPECIFIED, he(() => {
|
|
1933
1953
|
t.state$.subscribe((o) => {
|
|
1934
1954
|
if (o == null)
|
|
1935
1955
|
return;
|
|
1936
1956
|
const {
|
|
1937
1957
|
startX: a = Ne,
|
|
1938
1958
|
startY: c = Ne,
|
|
1939
|
-
endX:
|
|
1959
|
+
endX: g = 0,
|
|
1940
1960
|
endY: l = 0,
|
|
1941
1961
|
show: d = !1
|
|
1942
1962
|
} = o;
|
|
1943
1963
|
if (!d)
|
|
1944
1964
|
e({
|
|
1945
|
-
...
|
|
1965
|
+
...vt
|
|
1946
1966
|
});
|
|
1947
1967
|
else {
|
|
1948
1968
|
e({
|
|
1949
|
-
width:
|
|
1969
|
+
width: g - a - se + 2,
|
|
1950
1970
|
height: l - c - se + 2,
|
|
1951
1971
|
left: a + se,
|
|
1952
1972
|
top: c + se
|
|
1953
1973
|
});
|
|
1954
|
-
const
|
|
1955
|
-
if (
|
|
1974
|
+
const p = n.getEditor(ae);
|
|
1975
|
+
if (p == null)
|
|
1956
1976
|
return;
|
|
1957
|
-
const { left:
|
|
1958
|
-
t.setRect({ left:
|
|
1977
|
+
const { left: v, top: f, width: C, height: h } = p.getBoundingClientRect();
|
|
1978
|
+
t.setRect({ left: v, top: f, width: C, height: h });
|
|
1959
1979
|
}
|
|
1960
1980
|
});
|
|
1961
|
-
}, []),
|
|
1981
|
+
}, []), he(() => {
|
|
1962
1982
|
s || t.setFocus(!0);
|
|
1963
|
-
}, [s, i]), /* @__PURE__ */
|
|
1983
|
+
}, [s, i]), /* @__PURE__ */ m(
|
|
1964
1984
|
"div",
|
|
1965
1985
|
{
|
|
1966
|
-
className:
|
|
1986
|
+
className: Lr.slideEditorContainer,
|
|
1967
1987
|
style: {
|
|
1968
1988
|
left: i.left,
|
|
1969
1989
|
top: i.top,
|
|
@@ -1972,93 +1992,93 @@ const dr = "univer-slide-editor-container", gr = {
|
|
|
1972
1992
|
}
|
|
1973
1993
|
}
|
|
1974
1994
|
);
|
|
1975
|
-
},
|
|
1976
|
-
function
|
|
1995
|
+
}, Qt = "addition-and-subtraction-single", en = "slide.menu.image";
|
|
1996
|
+
function $r(i) {
|
|
1977
1997
|
return {
|
|
1978
|
-
id:
|
|
1979
|
-
type:
|
|
1980
|
-
icon:
|
|
1998
|
+
id: en,
|
|
1999
|
+
type: ve.SUBITEMS,
|
|
2000
|
+
icon: Qt,
|
|
1981
2001
|
tooltip: "slide.image.insert.title",
|
|
1982
|
-
hidden$:
|
|
2002
|
+
hidden$: _e(i, E.UNIVER_SLIDE)
|
|
1983
2003
|
};
|
|
1984
2004
|
}
|
|
1985
|
-
function
|
|
2005
|
+
function Hr(i) {
|
|
1986
2006
|
return {
|
|
1987
2007
|
id: Qe.id,
|
|
1988
2008
|
title: "slide.image.insert.float",
|
|
1989
|
-
type:
|
|
1990
|
-
hidden$:
|
|
2009
|
+
type: ve.BUTTON,
|
|
2010
|
+
hidden$: _e(i, E.UNIVER_SLIDE)
|
|
1991
2011
|
};
|
|
1992
2012
|
}
|
|
1993
|
-
const
|
|
1994
|
-
function
|
|
2013
|
+
const tn = "graph-single", nn = "slide.menu.shape";
|
|
2014
|
+
function Fr(i) {
|
|
1995
2015
|
return {
|
|
1996
|
-
id:
|
|
1997
|
-
type:
|
|
1998
|
-
icon:
|
|
2016
|
+
id: nn,
|
|
2017
|
+
type: ve.SUBITEMS,
|
|
2018
|
+
icon: tn,
|
|
1999
2019
|
tooltip: "slide.shape.insert.title",
|
|
2000
|
-
hidden$:
|
|
2020
|
+
hidden$: _e(i, E.UNIVER_SLIDE)
|
|
2001
2021
|
// disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
|
|
2002
2022
|
};
|
|
2003
2023
|
}
|
|
2004
|
-
function
|
|
2024
|
+
function zr(i) {
|
|
2005
2025
|
return {
|
|
2006
|
-
id:
|
|
2026
|
+
id: ke.id,
|
|
2007
2027
|
title: "slide.shape.insert.rectangle",
|
|
2008
|
-
type:
|
|
2009
|
-
hidden$:
|
|
2028
|
+
type: ve.BUTTON,
|
|
2029
|
+
hidden$: _e(i, E.UNIVER_SLIDE)
|
|
2010
2030
|
};
|
|
2011
2031
|
}
|
|
2012
|
-
const
|
|
2013
|
-
function
|
|
2032
|
+
const rn = "text-single";
|
|
2033
|
+
function Wr(i) {
|
|
2014
2034
|
return {
|
|
2015
2035
|
id: et.id,
|
|
2016
|
-
type:
|
|
2017
|
-
icon:
|
|
2036
|
+
type: ve.BUTTON,
|
|
2037
|
+
icon: rn,
|
|
2018
2038
|
tooltip: "slide.text.insert.title",
|
|
2019
|
-
hidden$:
|
|
2039
|
+
hidden$: _e(i, E.UNIVER_SLIDE)
|
|
2020
2040
|
};
|
|
2021
2041
|
}
|
|
2022
|
-
const
|
|
2042
|
+
const Kr = {
|
|
2023
2043
|
[Vn.FORMAT]: {
|
|
2024
2044
|
[et.id]: {
|
|
2025
2045
|
order: 0,
|
|
2026
|
-
menuItemFactory:
|
|
2046
|
+
menuItemFactory: Wr
|
|
2027
2047
|
},
|
|
2028
|
-
[
|
|
2048
|
+
[en]: {
|
|
2029
2049
|
order: 0,
|
|
2030
|
-
menuItemFactory:
|
|
2050
|
+
menuItemFactory: $r,
|
|
2031
2051
|
[Qe.id]: {
|
|
2032
2052
|
order: 0,
|
|
2033
|
-
menuItemFactory:
|
|
2053
|
+
menuItemFactory: Hr
|
|
2034
2054
|
}
|
|
2035
2055
|
},
|
|
2036
|
-
[
|
|
2056
|
+
[nn]: {
|
|
2037
2057
|
order: 0,
|
|
2038
|
-
menuItemFactory:
|
|
2039
|
-
[
|
|
2058
|
+
menuItemFactory: Fr,
|
|
2059
|
+
[ke.id]: {
|
|
2040
2060
|
order: 0,
|
|
2041
|
-
menuItemFactory:
|
|
2061
|
+
menuItemFactory: zr
|
|
2042
2062
|
}
|
|
2043
2063
|
}
|
|
2044
2064
|
}
|
|
2045
2065
|
};
|
|
2046
2066
|
function We(i) {
|
|
2047
|
-
return i.getContextValue(
|
|
2067
|
+
return i.getContextValue(xt) && i.getContextValue(xe);
|
|
2048
2068
|
}
|
|
2049
|
-
function
|
|
2050
|
-
return i.getContextValue(
|
|
2069
|
+
function Gr(i) {
|
|
2070
|
+
return i.getContextValue(bn) && i.getContextValue(xt);
|
|
2051
2071
|
}
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2072
|
+
const sn = [
|
|
2073
|
+
M.ARROW_DOWN,
|
|
2074
|
+
M.ARROW_UP,
|
|
2075
|
+
M.ARROW_LEFT,
|
|
2076
|
+
M.ARROW_RIGHT
|
|
2057
2077
|
];
|
|
2058
|
-
[
|
|
2059
|
-
function
|
|
2078
|
+
[M.ENTER, M.TAB, ...sn];
|
|
2079
|
+
function Xr() {
|
|
2060
2080
|
const i = [];
|
|
2061
|
-
for (const e of
|
|
2081
|
+
for (const e of sn)
|
|
2062
2082
|
i.push({
|
|
2063
2083
|
id: we.id,
|
|
2064
2084
|
binding: e,
|
|
@@ -2071,7 +2091,7 @@ function Sr() {
|
|
|
2071
2091
|
}
|
|
2072
2092
|
}), i.push({
|
|
2073
2093
|
id: we.id,
|
|
2074
|
-
binding: e |
|
|
2094
|
+
binding: e | jn.SHIFT,
|
|
2075
2095
|
preconditions: (t) => We(t),
|
|
2076
2096
|
staticParameters: {
|
|
2077
2097
|
visible: !1,
|
|
@@ -2082,74 +2102,74 @@ function Sr() {
|
|
|
2082
2102
|
});
|
|
2083
2103
|
return i;
|
|
2084
2104
|
}
|
|
2085
|
-
const
|
|
2105
|
+
const Yr = {
|
|
2086
2106
|
id: qn.id,
|
|
2087
|
-
preconditions: (i) => We(i) ||
|
|
2088
|
-
binding:
|
|
2107
|
+
preconditions: (i) => We(i) || Gr(i),
|
|
2108
|
+
binding: M.BACKSPACE
|
|
2089
2109
|
};
|
|
2090
|
-
var
|
|
2091
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2092
|
-
(o = i[s]) && (r = o(r) || r);
|
|
2093
|
-
return r;
|
|
2110
|
+
var Zr = Object.defineProperty, kr = Object.getOwnPropertyDescriptor, qr = (i, e, t, n) => {
|
|
2111
|
+
for (var r = n > 1 ? void 0 : n ? kr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2112
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
2113
|
+
return n && r && Zr(e, t, r), r;
|
|
2094
2114
|
}, re = (i, e) => (t, n) => e(t, n, i);
|
|
2095
2115
|
let De = class extends Ve {
|
|
2096
2116
|
constructor(i, e, t, n, r, s) {
|
|
2097
2117
|
super(), this._injector = i, this._menuManagerService = e, this._componentManager = t, this._uiPartsService = n, this._commandService = r, this._shortcutService = s, this._initCommands(), this._initCustomComponents(), this._initUIComponents(), this._initMenus(), this._initShortcuts();
|
|
2098
2118
|
}
|
|
2099
2119
|
_initMenus() {
|
|
2100
|
-
this._menuManagerService.mergeMenu(
|
|
2120
|
+
this._menuManagerService.mergeMenu(Kr);
|
|
2101
2121
|
}
|
|
2102
2122
|
_initCustomComponents() {
|
|
2103
2123
|
const i = this._componentManager;
|
|
2104
|
-
this.disposeWithMe(i.register(
|
|
2124
|
+
this.disposeWithMe(i.register(Qt, Bt)), this.disposeWithMe(i.register(rn, Wt)), this.disposeWithMe(i.register(tn, $t)), this.disposeWithMe(i.register(Yt, xr)), this.disposeWithMe(i.register(Oe, er));
|
|
2105
2125
|
}
|
|
2106
2126
|
_initCommands() {
|
|
2107
2127
|
[
|
|
2108
|
-
|
|
2109
|
-
Xt,
|
|
2110
|
-
qt,
|
|
2111
|
-
Qe,
|
|
2128
|
+
kt,
|
|
2112
2129
|
Zt,
|
|
2130
|
+
Jt,
|
|
2131
|
+
Qe,
|
|
2132
|
+
qt,
|
|
2113
2133
|
et,
|
|
2114
|
-
|
|
2115
|
-
|
|
2134
|
+
Xt,
|
|
2135
|
+
ke,
|
|
2116
2136
|
$e,
|
|
2117
|
-
|
|
2118
|
-
|
|
2137
|
+
Vt,
|
|
2138
|
+
K,
|
|
2119
2139
|
// commands for editor
|
|
2120
2140
|
we
|
|
2121
2141
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
2122
2142
|
}
|
|
2123
2143
|
_initUIComponents() {
|
|
2124
2144
|
this.disposeWithMe(
|
|
2125
|
-
this._uiPartsService.registerComponent(at.LEFT_SIDEBAR, () => ct(
|
|
2145
|
+
this._uiPartsService.registerComponent(at.LEFT_SIDEBAR, () => ct(Vr, this._injector))
|
|
2126
2146
|
), this.disposeWithMe(
|
|
2127
|
-
this._uiPartsService.registerComponent(at.CONTENT, () => ct(
|
|
2147
|
+
this._uiPartsService.registerComponent(at.CONTENT, () => ct(Ar, this._injector))
|
|
2128
2148
|
);
|
|
2129
2149
|
}
|
|
2130
2150
|
_initShortcuts() {
|
|
2131
2151
|
[
|
|
2132
|
-
|
|
2133
|
-
...
|
|
2152
|
+
Yr,
|
|
2153
|
+
...Xr()
|
|
2134
2154
|
].forEach((i) => {
|
|
2135
2155
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2136
2156
|
});
|
|
2137
2157
|
}
|
|
2138
2158
|
};
|
|
2139
|
-
De =
|
|
2140
|
-
re(0,
|
|
2159
|
+
De = qr([
|
|
2160
|
+
re(0, Y(Ke)),
|
|
2141
2161
|
re(1, Ln),
|
|
2142
|
-
re(2,
|
|
2162
|
+
re(2, Y(Bn)),
|
|
2143
2163
|
re(3, An),
|
|
2144
|
-
re(4,
|
|
2164
|
+
re(4, j),
|
|
2145
2165
|
re(5, $n)
|
|
2146
2166
|
], De);
|
|
2147
|
-
var
|
|
2148
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2149
|
-
(o = i[s]) && (r = o(r) || r);
|
|
2150
|
-
return r;
|
|
2167
|
+
var Jr = Object.defineProperty, Qr = Object.getOwnPropertyDescriptor, es = (i, e, t, n) => {
|
|
2168
|
+
for (var r = n > 1 ? void 0 : n ? Qr(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2169
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
2170
|
+
return n && r && Jr(e, t, r), r;
|
|
2151
2171
|
}, Ae = (i, e) => (t, n) => e(t, n, i);
|
|
2152
|
-
let Ue = class extends
|
|
2172
|
+
let Ue = class extends Ce {
|
|
2153
2173
|
// private _skeletonChangeMutations = new Set<string>();
|
|
2154
2174
|
constructor(i, e, t) {
|
|
2155
2175
|
super(), this._contextService = i, this._instanceSrv = e, this._renderManagerService = t, Promise.resolve().then(() => this._init());
|
|
@@ -2174,41 +2194,41 @@ let Ue = class extends pe {
|
|
|
2174
2194
|
_initContextListener() {
|
|
2175
2195
|
}
|
|
2176
2196
|
};
|
|
2177
|
-
Ue =
|
|
2178
|
-
Ae(0,
|
|
2197
|
+
Ue = es([
|
|
2198
|
+
Ae(0, fe),
|
|
2179
2199
|
Ae(1, y),
|
|
2180
|
-
Ae(2,
|
|
2200
|
+
Ae(2, Z)
|
|
2181
2201
|
], Ue);
|
|
2182
|
-
var
|
|
2183
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2184
|
-
(o = i[s]) && (r = o(r) || r);
|
|
2185
|
-
return r;
|
|
2202
|
+
var ts = Object.defineProperty, ns = Object.getOwnPropertyDescriptor, is = (i, e, t, n) => {
|
|
2203
|
+
for (var r = n > 1 ? void 0 : n ? ns(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2204
|
+
(o = i[s]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
2205
|
+
return n && r && ts(e, t, r), r;
|
|
2186
2206
|
}, Ee = (i, e) => (t, n) => e(t, n, i);
|
|
2187
|
-
const
|
|
2207
|
+
const rs = "SLIDE_UI";
|
|
2188
2208
|
var Re;
|
|
2189
2209
|
let _t = (Re = class extends En {
|
|
2190
|
-
constructor(i =
|
|
2210
|
+
constructor(i = ht, e, t, n, r) {
|
|
2191
2211
|
super(), this._config = i, this._injector = e, this._renderManagerService = t, this._univerInstanceService = n, this._configService = r;
|
|
2192
2212
|
const { menu: s, ...o } = Rn(
|
|
2193
2213
|
{},
|
|
2194
|
-
|
|
2214
|
+
ht,
|
|
2195
2215
|
this._config
|
|
2196
2216
|
);
|
|
2197
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
2217
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(ci, o);
|
|
2198
2218
|
}
|
|
2199
2219
|
onStarting() {
|
|
2200
2220
|
nt([
|
|
2201
2221
|
[Ue],
|
|
2202
2222
|
[qe, { useClass: He }],
|
|
2203
2223
|
// used by SlideUIController --> EditorContainer
|
|
2204
|
-
[Je, { useClass:
|
|
2205
|
-
[
|
|
2224
|
+
[Je, { useClass: mr }],
|
|
2225
|
+
[Me]
|
|
2206
2226
|
], this._config.override).forEach((i) => this._injector.add(i));
|
|
2207
2227
|
}
|
|
2208
2228
|
onReady() {
|
|
2209
2229
|
[
|
|
2210
2230
|
// SlideRenderService will be init in ready stage, and then calling RenderManagerService@createRender --> init all deps in this rendering register block.
|
|
2211
|
-
[
|
|
2231
|
+
[pe]
|
|
2212
2232
|
].forEach((i) => {
|
|
2213
2233
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(E.UNIVER_SLIDE, i));
|
|
2214
2234
|
}), nt([
|
|
@@ -2221,8 +2241,8 @@ let _t = (Re = class extends En {
|
|
|
2221
2241
|
// SlidesUIController controller would add a new RenderUnit (__INTERNAL_EDITOR__DOCS_NORMAL)
|
|
2222
2242
|
[De],
|
|
2223
2243
|
// editor service was create in renderManagerService
|
|
2224
|
-
[
|
|
2225
|
-
[
|
|
2244
|
+
[pe],
|
|
2245
|
+
[Te]
|
|
2226
2246
|
], this._config.override).forEach((i) => {
|
|
2227
2247
|
this._injector.add(i);
|
|
2228
2248
|
}), this._injector.get(N), this._injector.get(Ue);
|
|
@@ -2238,7 +2258,7 @@ let _t = (Re = class extends En {
|
|
|
2238
2258
|
}), this._markSlideAsFocused(), this._injector.get(De);
|
|
2239
2259
|
}
|
|
2240
2260
|
onSteady() {
|
|
2241
|
-
this._injector.get(
|
|
2261
|
+
this._injector.get(Te);
|
|
2242
2262
|
}
|
|
2243
2263
|
_markSlideAsFocused() {
|
|
2244
2264
|
const i = this._univerInstanceService;
|
|
@@ -2248,33 +2268,33 @@ let _t = (Re = class extends En {
|
|
|
2248
2268
|
} catch {
|
|
2249
2269
|
}
|
|
2250
2270
|
}
|
|
2251
|
-
}, I(Re, "pluginName",
|
|
2252
|
-
_t =
|
|
2253
|
-
Ee(1,
|
|
2254
|
-
Ee(2,
|
|
2271
|
+
}, I(Re, "pluginName", rs), I(Re, "type", E.UNIVER_SLIDE), Re);
|
|
2272
|
+
_t = is([
|
|
2273
|
+
Ee(1, Y(Ke)),
|
|
2274
|
+
Ee(2, Z),
|
|
2255
2275
|
Ee(3, y),
|
|
2256
2276
|
Ee(4, On)
|
|
2257
2277
|
], _t);
|
|
2258
2278
|
export {
|
|
2259
|
-
|
|
2260
|
-
|
|
2279
|
+
Zt as ActivateSlidePageOperation,
|
|
2280
|
+
kt as AppendSlideOperation,
|
|
2261
2281
|
N as CanvasView,
|
|
2262
|
-
|
|
2282
|
+
Vt as DeleteSlideElementOperation,
|
|
2263
2283
|
qe as ISlideEditorBridgeService,
|
|
2264
2284
|
Qe as InsertSlideFloatImageCommand,
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2285
|
+
ke as InsertSlideShapeRectangleCommand,
|
|
2286
|
+
Xt as InsertSlideShapeRectangleOperation,
|
|
2287
|
+
nn as SHAPE_MENU_ID,
|
|
2288
|
+
en as SLIDES_IMAGE_MENU_ID,
|
|
2289
|
+
ae as SLIDE_EDITOR_ID,
|
|
2290
|
+
Jt as SetSlidePageThumbOperation,
|
|
2271
2291
|
et as SlideAddTextCommand,
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2292
|
+
qt as SlideAddTextOperation,
|
|
2293
|
+
Me as SlideCanvasPopMangerService,
|
|
2294
|
+
Ar as SlideEditorContainer,
|
|
2295
|
+
Vr as SlideSideBar,
|
|
2276
2296
|
De as SlidesUIController,
|
|
2277
|
-
|
|
2297
|
+
Kr as SlidesUIMenuSchema,
|
|
2278
2298
|
_t as UniverSlidesUIPlugin,
|
|
2279
|
-
|
|
2299
|
+
K as UpdateSlideElementOperation
|
|
2280
2300
|
};
|