@univerjs/slides-ui 0.6.0-nightly.202502191606 → 0.6.0-nightly.202502201606
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 +640 -657
- package/lib/umd/index.js +2 -2
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var un = (i, e, t) => e in i ?
|
|
1
|
+
var dn = Object.defineProperty;
|
|
2
|
+
var un = (i, e, t) => e in i ? dn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var I = (i, e, t) => un(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { Viewport as it, ScrollBar as
|
|
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
|
|
4
|
+
import { Inject as X, Injector as ke, IUniverInstanceService as y, RxDisposable as pe, UniverInstanceType as E, debounce as gn, getColorStyle as hn, CommandType as V, Tools as mn, LocaleService as ee, ICommandService as B, generateRandomId as St, BasicShapes as vn, PageElementType as Ke, Disposable as Ve, DisposableCollection as Ge, IContextService as Ce, toDisposable as It, FOCUSING_COMMON_DRAWINGS as pn, createInternalEditorID as Cn, createIdentifier as bt, EDITOR_ACTIVATED as xe, FOCUSING_EDITOR_STANDALONE as Pt, FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE as Et, DocumentDataModel as fn, HorizontalAlign as Rt, VerticalAlign as ye, IUndoRedoService as _n, WrapStrategy as tt, FOCUSING_EDITOR_BUT_HIDDEN as Sn, DEFAULT_EMPTY_DOCUMENT_VALUE as In, Direction as L, DocumentFlavor as bn, FOCUSING_UNIVER_EDITOR as Ot, FORMULA_EDITOR_ACTIVATED as Pn, Plugin as En, merge as Rn, mergeOverrideWithDependencies as nt, IConfigService as On } from "@univerjs/core";
|
|
5
|
+
import { IRenderManagerService as Y, Viewport as it, ScrollBar as xt, Slide as xn, Rect as yt, Scene as yn, ObjectType as ge, pxToNum as Tn, DeviceInputEventType as J, convertTextRotation as rt, FIX_ONE_PIXEL_BLUR_OFFSET as se, fixLineWidthByScale as st } from "@univerjs/engine-render";
|
|
6
|
+
import { ObjectProvider as Mn, SLIDE_KEY as oe } from "@univerjs/slides";
|
|
7
|
+
import { useDependency as x, ISidebarService as Tt, ICanvasPopupService as wn, ILayoutService as Nn, KeyCode as T, ILocalFileService as Dn, useObservable as Un, DISABLE_AUTO_FOCUS_KEY as ot, getMenuHiddenObservable as fe, MenuItemType as _e, RibbonStartGroup as Vn, MetaKeys as Bn, IMenuManagerService as jn, ComponentManager as Ln, IUIPartsService as An, IShortcutService as $n, BuiltInUIPart as at, connectInjector as ct } from "@univerjs/ui";
|
|
8
|
+
import { jsxs as R, jsx as u } from "react/jsx-runtime";
|
|
9
|
+
import { Button as be, DropdownLegacy as Mt, ColorPicker as Hn, InputNumber as de, Scrollbar as Fn } from "@univerjs/design";
|
|
10
|
+
import wt, { forwardRef as $, useRef as Nt, createElement as H, useState as G, useEffect as me, useMemo as zn, useCallback as lt } from "react";
|
|
11
|
+
import { BehaviorSubject as Q, Subject as Dt, filter as Wn, takeUntil as dt } from "rxjs";
|
|
12
|
+
import { DocSelectionManagerService as kn, DocSkeletonManagerService as ut, RichTextEditingMutation as Kn } from "@univerjs/docs";
|
|
13
|
+
import { IEditorService as Xe, DocSelectionRenderService as gt, VIEWPORT_KEY as ht, DOCS_COMPONENT_MAIN_LAYER_INDEX as Gn, MoveSelectionOperation as Xn, MoveCursorOperation as Yn, DOCS_VIEW_KEY as Zn, 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 =
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
let
|
|
15
|
+
var ti = Object.getOwnPropertyDescriptor, ni = (i, e, t, n) => {
|
|
16
|
+
for (var r = n > 1 ? void 0 : n ? ti(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
17
|
+
(o = i[s]) && (r = o(r) || r);
|
|
18
|
+
return r;
|
|
19
|
+
}, Be = (i, e) => (t, n) => e(t, n, i);
|
|
20
|
+
let ve = class extends pe {
|
|
21
21
|
constructor(e, t, n, r) {
|
|
22
22
|
super();
|
|
23
23
|
I(this, "_objectProvider", null);
|
|
24
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(Mn), 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 pe = class extends Ce {
|
|
|
46
46
|
explicitViewportHeightSet: !1,
|
|
47
47
|
isWheelPreventDefaultX: !0
|
|
48
48
|
});
|
|
49
|
-
n.attachControl(), n.onMouseWheel$.subscribeEvent((c,
|
|
49
|
+
n.attachControl(), n.onMouseWheel$.subscribeEvent((c, h) => {
|
|
50
50
|
const l = c;
|
|
51
51
|
if (l.ctrlKey) {
|
|
52
52
|
const d = Math.abs(l.deltaX);
|
|
53
|
-
let
|
|
54
|
-
|
|
53
|
+
let v = d < 40 ? 0.2 : d < 80 ? 0.4 : 0.2;
|
|
54
|
+
v *= l.deltaY > 0 ? -1 : 1, n.scaleX < 1 && (v /= 2), n.scaleX + v > 4 ? n.scale(4, 4) : n.scaleX + v < 0.1 ? n.scale(0.1, 0.1) : (l.deltaY > 0, l.preventDefault());
|
|
55
55
|
} else
|
|
56
|
-
o.onMouseWheel(l,
|
|
56
|
+
o.onMouseWheel(l, h);
|
|
57
57
|
}), n.onFileLoaded$.subscribeEvent(() => {
|
|
58
58
|
this._refreshThumb();
|
|
59
|
-
}),
|
|
59
|
+
}), xt.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 pe = class extends Ce {
|
|
|
89
89
|
return c.enableSelectedClipElement(), e.addObject(c), c;
|
|
90
90
|
}
|
|
91
91
|
_addBackgroundRect(e, t) {
|
|
92
|
-
const r = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: o = 0 } = r, a = new
|
|
92
|
+
const r = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE).getPageSize(), { width: s = 0, height: o = 0 } = r, a = new yt("canvas", {
|
|
93
93
|
left: 0,
|
|
94
94
|
top: 0,
|
|
95
95
|
width: s,
|
|
@@ -117,8 +117,8 @@ let pe = class extends Ce {
|
|
|
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, h = r.getCanvas().getContext();
|
|
121
|
+
t.renderToThumb(h, e, a / s, c / o);
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* CreateScene by pages, and activate first one.
|
|
@@ -151,10 +151,10 @@ let pe = class extends Ce {
|
|
|
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(), h = n.getPageOrder();
|
|
155
|
+
if (h == null || c == null)
|
|
156
156
|
return;
|
|
157
|
-
r = c[
|
|
157
|
+
r = c[h[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 pe = class extends Ce {
|
|
|
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, h = new yn(e, o, {
|
|
187
187
|
width: a,
|
|
188
188
|
height: c
|
|
189
189
|
});
|
|
190
|
-
new it(`PageViewer_${e}`,
|
|
190
|
+
new it(`PageViewer_${e}`, h, {
|
|
191
191
|
left: 0,
|
|
192
192
|
top: 0,
|
|
193
193
|
bottom: 0,
|
|
@@ -195,17 +195,17 @@ let pe = class extends Ce {
|
|
|
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: v } = t, f = this._objectProvider.convertToRenderObjects(d, r);
|
|
199
|
+
if (!f || !o) return;
|
|
200
|
+
this._addBackgroundRect(h, v), h.addObjects(f), h.initTransformer(), f.forEach((p) => {
|
|
201
|
+
h.attachTransformerTo(p);
|
|
202
202
|
});
|
|
203
|
-
const
|
|
204
|
-
return
|
|
203
|
+
const C = h.getTransformer();
|
|
204
|
+
return C == null || C.changeEnd$.subscribe(() => {
|
|
205
205
|
this._thumbSceneRender(e, o);
|
|
206
|
-
}),
|
|
206
|
+
}), C == null || C.clearControl$.subscribe(() => {
|
|
207
207
|
this._thumbSceneRender(e, o);
|
|
208
|
-
}), o.addPageScene(
|
|
208
|
+
}), o.addPageScene(h), h;
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Get pageScene from Slide.
|
|
@@ -249,22 +249,22 @@ let pe = class extends Ce {
|
|
|
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 =
|
|
260
|
-
return
|
|
261
|
-
},
|
|
262
|
-
let N = class extends
|
|
252
|
+
ve = ni([
|
|
253
|
+
Be(1, X(ke)),
|
|
254
|
+
Be(2, y),
|
|
255
|
+
Be(3, Y)
|
|
256
|
+
], ve);
|
|
257
|
+
var ii = Object.getOwnPropertyDescriptor, ri = (i, e, t, n) => {
|
|
258
|
+
for (var r = n > 1 ? void 0 : n ? ii(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
259
|
+
(o = i[s]) && (r = o(r) || r);
|
|
260
|
+
return r;
|
|
261
|
+
}, si = (i, e) => (t, n) => e(t, n, i);
|
|
262
|
+
let N = class extends pe {
|
|
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(ve);
|
|
268
268
|
}
|
|
269
269
|
createThumbs(i) {
|
|
270
270
|
this._getSlideRenderControllerFromRenderUnit(i).createThumbs();
|
|
@@ -291,10 +291,10 @@ let N = class extends Ce {
|
|
|
291
291
|
this._getSlideRenderControllerFromRenderUnit(i).appendPage();
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
N =
|
|
295
|
-
|
|
294
|
+
N = ri([
|
|
295
|
+
si(0, Y)
|
|
296
296
|
], N);
|
|
297
|
-
const
|
|
297
|
+
const oi = "slides-ui.config", mt = {}, Ut = {
|
|
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
|
+
}, ai = 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,266 +321,265 @@ 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 = ai(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), c = Nt("_".concat(di()));
|
|
325
|
+
return Vt(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 Vt(i, e, t, n, r) {
|
|
328
|
+
return H(i.tag, U(U({ key: e }, ci(i, t, r)), n), (li(i, t).children || []).map(function(s, o) {
|
|
329
|
+
return Vt(s, "".concat(e, "-").concat(i.tag, "-").concat(o), t, void 0, r);
|
|
330
330
|
}));
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function ci(i, e, t) {
|
|
333
333
|
var n = U({}, i.attrs);
|
|
334
|
-
t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1)
|
|
334
|
+
t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1), i.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(s) {
|
|
335
|
+
var o = s[0], a = s[1];
|
|
336
|
+
o === "mask" && typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
337
|
+
});
|
|
335
338
|
var r = e.defIds;
|
|
336
339
|
return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(s) {
|
|
337
340
|
var o = s[0], a = s[1];
|
|
338
341
|
typeof a == "string" && (n[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
339
342
|
})), n;
|
|
340
343
|
}
|
|
341
|
-
function
|
|
344
|
+
function li(i, e) {
|
|
342
345
|
var t, n = e.defIds;
|
|
343
346
|
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
347
|
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
348
|
}) }) : i;
|
|
346
349
|
}
|
|
347
|
-
function
|
|
350
|
+
function di() {
|
|
348
351
|
return Math.random().toString(36).substring(2, 8);
|
|
349
352
|
}
|
|
350
353
|
F.displayName = "UniverIcon";
|
|
351
|
-
var
|
|
354
|
+
var ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, Bt = $(function(i, e) {
|
|
352
355
|
return H(F, Object.assign({}, i, {
|
|
353
356
|
id: "add-image-single",
|
|
354
357
|
ref: e,
|
|
355
|
-
icon:
|
|
358
|
+
icon: ui
|
|
356
359
|
}));
|
|
357
360
|
});
|
|
358
361
|
Bt.displayName = "AddImageSingle";
|
|
359
|
-
var
|
|
362
|
+
var gi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, jt = $(function(i, e) {
|
|
360
363
|
return H(F, Object.assign({}, i, {
|
|
361
364
|
id: "autofill",
|
|
362
365
|
ref: e,
|
|
363
|
-
icon:
|
|
366
|
+
icon: gi
|
|
364
367
|
}));
|
|
365
368
|
});
|
|
366
|
-
|
|
367
|
-
var
|
|
369
|
+
jt.displayName = "Autofill";
|
|
370
|
+
var hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, Lt = $(function(i, e) {
|
|
368
371
|
return H(F, Object.assign({}, i, {
|
|
369
372
|
id: "bottom-single",
|
|
370
373
|
ref: e,
|
|
371
|
-
icon:
|
|
374
|
+
icon: hi
|
|
372
375
|
}));
|
|
373
376
|
});
|
|
374
|
-
|
|
375
|
-
var
|
|
377
|
+
Lt.displayName = "BottomSingle";
|
|
378
|
+
var mi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { clipPath: "url(#graph-single_clip0_1293_28)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M6.29541 11.1896C3.83208 10.7489 1.9624 8.59552 1.9624 6.00544C1.9624 3.09673 4.32036 0.73877 7.22907 0.73877C9.93483 0.73877 12.164 2.77918 12.4619 5.40527H13.5621C14.998 5.40527 16.1621 6.56933 16.1621 8.00527V12.6719C16.1621 14.1079 14.998 15.2719 13.5621 15.2719H8.89541C7.45947 15.2719 6.29541 14.1079 6.29541 12.6719V11.1896ZM3.1624 6.00544C3.1624 3.75947 4.98311 1.93877 7.22907 1.93877C9.27112 1.93877 10.9616 3.44388 11.2518 5.40527H8.89541C7.45947 5.40527 6.29541 6.56933 6.29541 8.00527V9.96442C4.49946 9.5425 3.1624 7.93012 3.1624 6.00544ZM7.49541 8.00527C7.49541 7.23207 8.12221 6.60527 8.89541 6.60527H13.5621C14.3353 6.60527 14.9621 7.23207 14.9621 8.00527V12.6719C14.9621 13.4451 14.3353 14.0719 13.5621 14.0719H8.89541C8.12221 14.0719 7.49541 13.4451 7.49541 12.6719V8.00527Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "graph-single_clip0_1293_28" }, children: [{ tag: "path", attrs: { fill: "#fff", d: "M0 0H16V16H0z", transform: "translate(.9)" } }] }] }], defIds: ["graph-single_clip0_1293_28"] }, At = $(function(i, e) {
|
|
376
379
|
return H(F, Object.assign({}, i, {
|
|
377
380
|
id: "graph-single",
|
|
378
381
|
ref: e,
|
|
379
|
-
icon:
|
|
382
|
+
icon: mi
|
|
380
383
|
}));
|
|
381
384
|
});
|
|
382
|
-
|
|
383
|
-
var
|
|
385
|
+
At.displayName = "GraphSingle";
|
|
386
|
+
var vi = { 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" } }] }, Ye = $(function(i, e) {
|
|
384
387
|
return H(F, Object.assign({}, i, {
|
|
385
388
|
id: "more-down-single",
|
|
386
389
|
ref: e,
|
|
387
|
-
icon:
|
|
390
|
+
icon: vi
|
|
388
391
|
}));
|
|
389
392
|
});
|
|
390
|
-
|
|
391
|
-
var
|
|
393
|
+
Ye.displayName = "MoreDownSingle";
|
|
394
|
+
var pi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z" } }] }, $t = $(function(i, e) {
|
|
392
395
|
return H(F, Object.assign({}, i, {
|
|
393
396
|
id: "move-down-single",
|
|
394
397
|
ref: e,
|
|
395
|
-
icon:
|
|
398
|
+
icon: pi
|
|
396
399
|
}));
|
|
397
400
|
});
|
|
398
|
-
|
|
399
|
-
var
|
|
401
|
+
$t.displayName = "MoveDownSingle";
|
|
402
|
+
var Ci = { 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" } }] }, Ht = $(function(i, e) {
|
|
400
403
|
return H(F, Object.assign({}, i, {
|
|
401
404
|
id: "move-up-single",
|
|
402
405
|
ref: e,
|
|
403
|
-
icon:
|
|
406
|
+
icon: Ci
|
|
404
407
|
}));
|
|
405
408
|
});
|
|
406
|
-
|
|
407
|
-
var
|
|
409
|
+
Ht.displayName = "MoveUpSingle";
|
|
410
|
+
var fi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.01281 1.36643C8.79386 0.585377 10.0602 0.585378 10.8412 1.36643L12.9223 3.44752C13.7034 4.22857 13.7034 5.4949 12.9223 6.27595L9.36445 9.83383C8.5834 10.6149 7.31707 10.6149 6.53602 9.83383L4.45493 7.75273C3.67388 6.97168 3.67388 5.70535 4.45493 4.9243L8.01281 1.36643ZM9.9927 2.21495C9.68028 1.90253 9.17375 1.90253 8.86133 2.21495L5.30346 5.77283L5.29671 5.77966L10.839 6.66224L12.0738 5.42742C12.3862 5.115 12.3862 4.60847 12.0738 4.29605L9.9927 2.21495Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M14.5179 9.48875C14.5179 9.99175 14.1101 10.3995 13.607 10.3995C13.1041 10.3995 12.6963 9.99175 12.6963 9.48875C12.6963 9.1773 13.0455 8.59966 13.3114 8.20487C13.4549 7.99177 13.7591 7.99177 13.9027 8.20486C14.1687 8.59965 14.5179 9.1773 14.5179 9.48875Z" } }, { tag: "path", attrs: { fill: "colorChannel1", d: "M1.98682 13.4992C1.98682 12.5603 2.74793 11.7992 3.68682 11.7992H14.2868C15.2257 11.7992 15.9868 12.5603 15.9868 13.4992V13.4992C15.9868 14.4381 15.2257 15.1992 14.2868 15.1992H3.68682C2.74793 15.1992 1.98682 14.4381 1.98682 13.4992V13.4992Z" } }] }, Ft = $(function(i, e) {
|
|
408
411
|
return H(F, Object.assign({}, i, {
|
|
409
412
|
id: "paint-bucket",
|
|
410
413
|
ref: e,
|
|
411
|
-
icon:
|
|
414
|
+
icon: fi
|
|
412
415
|
}));
|
|
413
416
|
});
|
|
414
|
-
|
|
415
|
-
var
|
|
417
|
+
Ft.displayName = "PaintBucket";
|
|
418
|
+
var _i = { 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"] }, zt = $(function(i, e) {
|
|
416
419
|
return H(F, Object.assign({}, i, {
|
|
417
420
|
id: "text-single",
|
|
418
421
|
ref: e,
|
|
419
|
-
icon:
|
|
422
|
+
icon: _i
|
|
420
423
|
}));
|
|
421
424
|
});
|
|
422
|
-
|
|
423
|
-
var
|
|
425
|
+
zt.displayName = "TextSingle";
|
|
426
|
+
var Si = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Wt = $(function(i, e) {
|
|
424
427
|
return H(F, Object.assign({}, i, {
|
|
425
428
|
id: "topmost-single",
|
|
426
429
|
ref: e,
|
|
427
|
-
icon:
|
|
430
|
+
icon: Si
|
|
428
431
|
}));
|
|
429
432
|
});
|
|
430
|
-
|
|
431
|
-
function
|
|
433
|
+
Wt.displayName = "TopmostSingle";
|
|
434
|
+
function kt(i) {
|
|
432
435
|
var e, t, n = "";
|
|
433
436
|
if (typeof i == "string" || typeof i == "number") n += i;
|
|
434
437
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
435
438
|
var r = i.length;
|
|
436
|
-
for (e = 0; e < r; e++) i[e] && (t =
|
|
439
|
+
for (e = 0; e < r; e++) i[e] && (t = kt(i[e])) && (n && (n += " "), n += t);
|
|
437
440
|
} else for (t in i) i[t] && (n && (n += " "), n += t);
|
|
438
441
|
return n;
|
|
439
442
|
}
|
|
440
|
-
function
|
|
441
|
-
for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e =
|
|
443
|
+
function M() {
|
|
444
|
+
for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e = kt(i)) && (n && (n += " "), n += e);
|
|
442
445
|
return n;
|
|
443
446
|
}
|
|
444
|
-
const
|
|
447
|
+
const k = {
|
|
445
448
|
id: "slide.operation.update-element",
|
|
446
449
|
type: V.OPERATION,
|
|
447
450
|
handler: (i, e) => {
|
|
448
451
|
const { oKey: t, props: n } = e, r = i.get(y), s = e == null ? void 0 : e.unitId, o = r.getUnit(s);
|
|
449
452
|
if (!o) return !1;
|
|
450
453
|
const a = o.getActivePage();
|
|
451
|
-
return a.pageElements[t] =
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
imageCommonPanelSpan2: Di,
|
|
465
|
-
imageCommonPanelSpan3: Ui,
|
|
466
|
-
imageCommonPanelInput: Vi,
|
|
467
|
-
slidePanelColorPicker: ji
|
|
454
|
+
return a.pageElements[t] = mn.deepMerge(a.pageElements[t], n), o.updatePage(a.id, a), !0;
|
|
455
|
+
}
|
|
456
|
+
}, Ii = "univer-image-common-panel-grid", bi = "univer-image-common-panel-border", Pi = "univer-image-common-panel-title", Ei = "univer-image-common-panel-row", Ri = "univer-image-common-panel-column", Oi = "univer-image-common-panel-inline", xi = "univer-image-common-panel-span2", yi = "univer-image-common-panel-span3", Ti = "univer-image-common-panel-input", Mi = "univer-slide-panel-color-picker", g = {
|
|
457
|
+
imageCommonPanelGrid: Ii,
|
|
458
|
+
imageCommonPanelBorder: bi,
|
|
459
|
+
imageCommonPanelTitle: Pi,
|
|
460
|
+
imageCommonPanelRow: Ei,
|
|
461
|
+
imageCommonPanelColumn: Ri,
|
|
462
|
+
imageCommonPanelInline: Oi,
|
|
463
|
+
imageCommonPanelSpan2: xi,
|
|
464
|
+
imageCommonPanelSpan3: yi,
|
|
465
|
+
imageCommonPanelInput: Ti,
|
|
466
|
+
slidePanelColorPicker: Mi
|
|
468
467
|
};
|
|
469
|
-
function
|
|
470
|
-
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(
|
|
468
|
+
function wi(i) {
|
|
469
|
+
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(B), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
471
470
|
if (!a) return null;
|
|
472
471
|
const c = a.getTransformer();
|
|
473
472
|
if (!c) return null;
|
|
474
473
|
const l = c.getSelectedObjectMap().values().next().value;
|
|
475
474
|
if (!l) return null;
|
|
476
|
-
const d = (
|
|
477
|
-
const
|
|
478
|
-
const w =
|
|
479
|
-
return [D,
|
|
475
|
+
const d = (v) => {
|
|
476
|
+
const f = a.getAllObjects(), [C, p] = f.reduce(([_, b], P) => {
|
|
477
|
+
const w = P.zIndex, D = w < _ ? w : _, j = w > b ? w : b;
|
|
478
|
+
return [D, j];
|
|
480
479
|
}, [0, 0]);
|
|
481
|
-
let
|
|
482
|
-
|
|
483
|
-
zIndex:
|
|
484
|
-
}), s.executeCommand(
|
|
480
|
+
let m = l.zIndex;
|
|
481
|
+
v === 3 ? m = C - 1 : v === 2 ? m = p + 1 : v === 0 ? m = l.zIndex + 1 : v === 1 && (m = l.zIndex - 1), l.setProps({
|
|
482
|
+
zIndex: m
|
|
483
|
+
}), s.executeCommand(k.id, {
|
|
485
484
|
unitId: t,
|
|
486
485
|
oKey: l == null ? void 0 : l.oKey,
|
|
487
486
|
props: {
|
|
488
|
-
zIndex:
|
|
487
|
+
zIndex: m
|
|
489
488
|
}
|
|
490
489
|
});
|
|
491
490
|
};
|
|
492
|
-
return /* @__PURE__ */ R("div", { className:
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */ R("div", { className:
|
|
495
|
-
/* @__PURE__ */
|
|
491
|
+
return /* @__PURE__ */ R("div", { className: g.imageCommonPanelGrid, children: [
|
|
492
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: n.t("image-panel.arrange.title") }) }) }),
|
|
493
|
+
/* @__PURE__ */ R("div", { className: g.imageCommonPanelRow, children: [
|
|
494
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(be, { size: "small", onClick: () => {
|
|
496
495
|
d(
|
|
497
496
|
0
|
|
498
497
|
/* forward */
|
|
499
498
|
);
|
|
500
|
-
}, children: /* @__PURE__ */ R("span", { className:
|
|
501
|
-
/* @__PURE__ */
|
|
499
|
+
}, children: /* @__PURE__ */ R("span", { className: g.imageCommonPanelInline, children: [
|
|
500
|
+
/* @__PURE__ */ u(Ht, {}),
|
|
502
501
|
n.t("image-panel.arrange.forward")
|
|
503
502
|
] }) }) }),
|
|
504
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(be, { size: "small", onClick: () => {
|
|
505
504
|
d(
|
|
506
505
|
1
|
|
507
506
|
/* backward */
|
|
508
507
|
);
|
|
509
|
-
}, children: /* @__PURE__ */ R("span", { className:
|
|
510
|
-
/* @__PURE__ */
|
|
508
|
+
}, children: /* @__PURE__ */ R("span", { className: g.imageCommonPanelInline, children: [
|
|
509
|
+
/* @__PURE__ */ u($t, {}),
|
|
511
510
|
n.t("image-panel.arrange.backward")
|
|
512
511
|
] }) }) })
|
|
513
512
|
] }),
|
|
514
|
-
/* @__PURE__ */ R("div", { className:
|
|
515
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ R("div", { className: g.imageCommonPanelRow, children: [
|
|
514
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(be, { size: "small", onClick: () => {
|
|
516
515
|
d(
|
|
517
516
|
2
|
|
518
517
|
/* front */
|
|
519
518
|
);
|
|
520
|
-
}, children: /* @__PURE__ */ R("span", { className:
|
|
521
|
-
/* @__PURE__ */
|
|
519
|
+
}, children: /* @__PURE__ */ R("span", { className: g.imageCommonPanelInline, children: [
|
|
520
|
+
/* @__PURE__ */ u(Wt, {}),
|
|
522
521
|
n.t("image-panel.arrange.front")
|
|
523
522
|
] }) }) }),
|
|
524
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(be, { size: "small", onClick: () => {
|
|
525
524
|
d(
|
|
526
525
|
3
|
|
527
526
|
/* back */
|
|
528
527
|
);
|
|
529
|
-
}, children: /* @__PURE__ */ R("span", { className:
|
|
530
|
-
/* @__PURE__ */
|
|
528
|
+
}, children: /* @__PURE__ */ R("span", { className: g.imageCommonPanelInline, children: [
|
|
529
|
+
/* @__PURE__ */ u(Lt, {}),
|
|
531
530
|
n.t("image-panel.arrange.back")
|
|
532
531
|
] }) }) })
|
|
533
532
|
] })
|
|
534
533
|
] });
|
|
535
534
|
}
|
|
536
|
-
function
|
|
537
|
-
var
|
|
538
|
-
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(
|
|
535
|
+
function Ni(i) {
|
|
536
|
+
var C, p;
|
|
537
|
+
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(B), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
539
538
|
if (!a) return null;
|
|
540
539
|
const c = a.getTransformer();
|
|
541
540
|
if (!c) return null;
|
|
542
541
|
const l = c.getSelectedObjectMap().values().next().value;
|
|
543
542
|
if (!l) return null;
|
|
544
|
-
const [d,
|
|
545
|
-
function
|
|
543
|
+
const [d, v] = wt.useState((p = (C = l.fill) == null ? void 0 : C.toString()) != null ? p : "");
|
|
544
|
+
function f(m) {
|
|
546
545
|
l == null || l.setProps({
|
|
547
|
-
fill:
|
|
548
|
-
}), s.executeCommand(
|
|
546
|
+
fill: m
|
|
547
|
+
}), s.executeCommand(k.id, {
|
|
549
548
|
unitId: t,
|
|
550
549
|
oKey: l == null ? void 0 : l.oKey,
|
|
551
550
|
props: {
|
|
552
551
|
shape: {
|
|
553
552
|
shapeProperties: {
|
|
554
553
|
shapeBackgroundFill: {
|
|
555
|
-
rgb:
|
|
554
|
+
rgb: m
|
|
556
555
|
}
|
|
557
556
|
}
|
|
558
557
|
}
|
|
559
558
|
}
|
|
560
|
-
}),
|
|
559
|
+
}), v(m);
|
|
561
560
|
}
|
|
562
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ u(
|
|
563
562
|
"div",
|
|
564
563
|
{
|
|
565
|
-
className:
|
|
566
|
-
children: /* @__PURE__ */ R("div", { className:
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
|
|
564
|
+
className: M(g.imageCommonPanelGrid, g.imageCommonPanelBorder),
|
|
565
|
+
children: /* @__PURE__ */ R("div", { className: g.imageCommonPanelGrid, children: [
|
|
566
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: n.t("slide.panel.fill.title") }) }) }),
|
|
567
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan2), children: /* @__PURE__ */ u(
|
|
568
|
+
Mt,
|
|
570
569
|
{
|
|
571
570
|
align: {
|
|
572
571
|
offset: [0, 18]
|
|
573
572
|
},
|
|
574
|
-
overlay: /* @__PURE__ */
|
|
573
|
+
overlay: /* @__PURE__ */ u("section", { className: g.slidePanelColorPicker, children: /* @__PURE__ */ u(
|
|
575
574
|
Hn,
|
|
576
575
|
{
|
|
577
576
|
value: "#fff",
|
|
578
|
-
onChange:
|
|
577
|
+
onChange: f
|
|
579
578
|
}
|
|
580
579
|
) }),
|
|
581
|
-
children: /* @__PURE__ */ R("a", { className:
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
580
|
+
children: /* @__PURE__ */ R("a", { className: g.uiPluginSheetsBorderPanelButton, children: [
|
|
581
|
+
/* @__PURE__ */ u(Ft, { extend: { colorChannel1: d != null ? d : "rgb(var(--primary-color))" } }),
|
|
582
|
+
/* @__PURE__ */ u("span", { className: g.uiPluginSheetsBorderPanelMoreIcon, children: /* @__PURE__ */ u(Ye, {}) })
|
|
584
583
|
] })
|
|
585
584
|
}
|
|
586
585
|
) }) })
|
|
@@ -588,8 +587,8 @@ function Li(i) {
|
|
|
588
587
|
}
|
|
589
588
|
);
|
|
590
589
|
}
|
|
591
|
-
function
|
|
592
|
-
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(
|
|
590
|
+
function Di(i) {
|
|
591
|
+
const { pageId: e, unitId: t } = i, n = x(ee), r = x(N), s = x(B), o = r.getRenderUnitByPageId(e, t), a = o == null ? void 0 : o.scene;
|
|
593
592
|
if (!a) return null;
|
|
594
593
|
const c = a.getTransformer();
|
|
595
594
|
if (!c) return null;
|
|
@@ -597,32 +596,32 @@ function Ai(i) {
|
|
|
597
596
|
if (!l) return null;
|
|
598
597
|
const {
|
|
599
598
|
width: d = 0,
|
|
600
|
-
height:
|
|
601
|
-
left:
|
|
602
|
-
top:
|
|
603
|
-
angle:
|
|
604
|
-
} = l, [
|
|
605
|
-
const { objects:
|
|
606
|
-
width:
|
|
607
|
-
height:
|
|
608
|
-
left:
|
|
609
|
-
top:
|
|
610
|
-
angle:
|
|
611
|
-
} =
|
|
612
|
-
_(
|
|
599
|
+
height: v = 0,
|
|
600
|
+
left: f = 0,
|
|
601
|
+
top: C = 0,
|
|
602
|
+
angle: p = 0
|
|
603
|
+
} = l, [m, _] = G(d), [b, P] = G(v), [w, D] = G(f), [j, O] = G(C), [K, ae] = G(p), z = (S) => {
|
|
604
|
+
const { objects: ce } = S, le = ce.values().next().value, {
|
|
605
|
+
width: sn = 0,
|
|
606
|
+
height: on = 0,
|
|
607
|
+
left: an = 0,
|
|
608
|
+
top: cn = 0,
|
|
609
|
+
angle: ln = 0
|
|
610
|
+
} = le;
|
|
611
|
+
_(sn), P(on), D(an), O(cn), ae(ln);
|
|
613
612
|
};
|
|
614
|
-
|
|
615
|
-
const S = c.changeStart$.subscribe((
|
|
616
|
-
z(
|
|
617
|
-
}),
|
|
618
|
-
z(
|
|
613
|
+
me(() => {
|
|
614
|
+
const S = c.changeStart$.subscribe((le) => {
|
|
615
|
+
z(le);
|
|
616
|
+
}), ce = c.changing$.subscribe((le) => {
|
|
617
|
+
z(le);
|
|
619
618
|
});
|
|
620
619
|
return () => {
|
|
621
|
-
|
|
620
|
+
ce.unsubscribe(), S.unsubscribe();
|
|
622
621
|
};
|
|
623
622
|
}, []);
|
|
624
623
|
function W(S) {
|
|
625
|
-
!S || !l || (s.executeCommand(
|
|
624
|
+
!S || !l || (s.executeCommand(k.id, {
|
|
626
625
|
pageId: e,
|
|
627
626
|
oKey: l.oKey,
|
|
628
627
|
props: {
|
|
@@ -631,16 +630,16 @@ function Ai(i) {
|
|
|
631
630
|
}), l == null || l.resize(S, l.height), _(S), c == null || c.refreshControls());
|
|
632
631
|
}
|
|
633
632
|
function te(S) {
|
|
634
|
-
!S || !l || (s.executeCommand(
|
|
633
|
+
!S || !l || (s.executeCommand(k.id, {
|
|
635
634
|
pageId: e,
|
|
636
635
|
oKey: l.oKey,
|
|
637
636
|
props: {
|
|
638
637
|
height: S
|
|
639
638
|
}
|
|
640
|
-
}), l == null || l.resize(l.width, S),
|
|
639
|
+
}), l == null || l.resize(l.width, S), P(S), c == null || c.refreshControls());
|
|
641
640
|
}
|
|
642
641
|
function ne(S) {
|
|
643
|
-
!S || !l || (s.executeCommand(
|
|
642
|
+
!S || !l || (s.executeCommand(k.id, {
|
|
644
643
|
pageId: e,
|
|
645
644
|
oKey: l.oKey,
|
|
646
645
|
props: {
|
|
@@ -649,7 +648,7 @@ function Ai(i) {
|
|
|
649
648
|
}), l == null || l.translate(S, l.top), D(S), c == null || c.refreshControls());
|
|
650
649
|
}
|
|
651
650
|
function Se(S) {
|
|
652
|
-
!S || !l || (s.executeCommand(
|
|
651
|
+
!S || !l || (s.executeCommand(k.id, {
|
|
653
652
|
pageId: e,
|
|
654
653
|
oKey: l.oKey,
|
|
655
654
|
props: {
|
|
@@ -658,7 +657,7 @@ function Ai(i) {
|
|
|
658
657
|
}), l == null || l.translate(l.left, S), O(S), c == null || c.refreshControls());
|
|
659
658
|
}
|
|
660
659
|
function Ie(S) {
|
|
661
|
-
!S || !l || (s.executeCommand(
|
|
660
|
+
!S || !l || (s.executeCommand(k.id, {
|
|
662
661
|
pageId: e,
|
|
663
662
|
oKey: l.oKey,
|
|
664
663
|
props: {
|
|
@@ -666,37 +665,37 @@ function Ai(i) {
|
|
|
666
665
|
}
|
|
667
666
|
}), l == null || l.transformByState({
|
|
668
667
|
angle: S
|
|
669
|
-
}),
|
|
668
|
+
}), ae(S), c == null || c.refreshControls());
|
|
670
669
|
}
|
|
671
670
|
return /* @__PURE__ */ R(
|
|
672
671
|
"div",
|
|
673
672
|
{
|
|
674
|
-
className:
|
|
673
|
+
className: M(g.imageCommonPanelGrid, g.imageCommonPanelBorder),
|
|
675
674
|
children: [
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */ R("div", { className:
|
|
678
|
-
/* @__PURE__ */
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
|
|
675
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelTitle), children: /* @__PURE__ */ u("div", { children: n.t("image-panel.transform.title") }) }) }),
|
|
676
|
+
/* @__PURE__ */ R("div", { className: g.imageCommonPanelRow, children: [
|
|
677
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
678
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: n.t("image-panel.transform.width") }) }),
|
|
679
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(
|
|
680
|
+
de,
|
|
682
681
|
{
|
|
683
|
-
className:
|
|
682
|
+
className: g.imageCommonPanelInput,
|
|
684
683
|
min: 1,
|
|
685
|
-
value:
|
|
684
|
+
value: m,
|
|
686
685
|
onChange: (S) => {
|
|
687
686
|
W(S);
|
|
688
687
|
}
|
|
689
688
|
}
|
|
690
689
|
) }) })
|
|
691
690
|
] }) }),
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
|
|
691
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
692
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: n.t("image-panel.transform.height") }) }),
|
|
693
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(
|
|
694
|
+
de,
|
|
696
695
|
{
|
|
697
|
-
className:
|
|
696
|
+
className: g.imageCommonPanelInput,
|
|
698
697
|
min: 1,
|
|
699
|
-
value:
|
|
698
|
+
value: b,
|
|
700
699
|
onChange: (S) => {
|
|
701
700
|
te(S);
|
|
702
701
|
}
|
|
@@ -704,13 +703,13 @@ function Ai(i) {
|
|
|
704
703
|
) }) })
|
|
705
704
|
] }) })
|
|
706
705
|
] }),
|
|
707
|
-
/* @__PURE__ */ R("div", { className:
|
|
708
|
-
/* @__PURE__ */
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
|
|
706
|
+
/* @__PURE__ */ R("div", { className: g.imageCommonPanelRow, children: [
|
|
707
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
708
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: n.t("image-panel.transform.x") }) }),
|
|
709
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(
|
|
710
|
+
de,
|
|
712
711
|
{
|
|
713
|
-
className:
|
|
712
|
+
className: g.imageCommonPanelInput,
|
|
714
713
|
precision: 1,
|
|
715
714
|
min: 0,
|
|
716
715
|
value: w,
|
|
@@ -720,29 +719,29 @@ function Ai(i) {
|
|
|
720
719
|
}
|
|
721
720
|
) }) })
|
|
722
721
|
] }) }),
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
|
|
722
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
723
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: n.t("image-panel.transform.y") }) }),
|
|
724
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(
|
|
725
|
+
de,
|
|
727
726
|
{
|
|
728
|
-
className:
|
|
727
|
+
className: g.imageCommonPanelInput,
|
|
729
728
|
precision: 1,
|
|
730
729
|
min: 0,
|
|
731
|
-
value:
|
|
730
|
+
value: j,
|
|
732
731
|
onChange: (S) => {
|
|
733
732
|
Se(S);
|
|
734
733
|
}
|
|
735
734
|
}
|
|
736
735
|
) }) })
|
|
737
736
|
] }) }),
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
|
|
737
|
+
/* @__PURE__ */ u("div", { className: M(g.imageCommonPanelColumn, g.imageCommonPanelSpan3), children: /* @__PURE__ */ R("label", { children: [
|
|
738
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: n.t("image-panel.transform.rotate") }) }),
|
|
739
|
+
/* @__PURE__ */ u("div", { className: g.imageCommonPanelRow, children: /* @__PURE__ */ u("div", { className: g.imageCommonPanelColumn, children: /* @__PURE__ */ u(
|
|
740
|
+
de,
|
|
742
741
|
{
|
|
743
|
-
className:
|
|
742
|
+
className: g.imageCommonPanelInput,
|
|
744
743
|
precision: 1,
|
|
745
|
-
value:
|
|
744
|
+
value: K,
|
|
746
745
|
onChange: Ie
|
|
747
746
|
}
|
|
748
747
|
) }) })
|
|
@@ -752,24 +751,12 @@ function Ai(i) {
|
|
|
752
751
|
}
|
|
753
752
|
);
|
|
754
753
|
}
|
|
755
|
-
const
|
|
756
|
-
imageCommonPanel:
|
|
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
|
|
754
|
+
const Ui = "univer-image-common-panel", Vi = {
|
|
755
|
+
imageCommonPanel: Ui
|
|
769
756
|
}, Oe = "COMPONENT_SLIDE_SIDEBAR";
|
|
770
|
-
function
|
|
771
|
-
var
|
|
772
|
-
const i = x(y), e = x(N), t = i.getCurrentUnitForType(E.UNIVER_SLIDE), n = (
|
|
757
|
+
function Bi() {
|
|
758
|
+
var h, l, d;
|
|
759
|
+
const i = x(y), e = x(N), t = i.getCurrentUnitForType(E.UNIVER_SLIDE), n = (h = t == null ? void 0 : t.getActivePage()) == null ? void 0 : h.id;
|
|
773
760
|
if (!n) return null;
|
|
774
761
|
const s = (l = e.getRenderUnitByPageId(n, n).scene) == null ? void 0 : l.getTransformer();
|
|
775
762
|
if (!s) return null;
|
|
@@ -777,27 +764,27 @@ function er() {
|
|
|
777
764
|
if (!a)
|
|
778
765
|
return null;
|
|
779
766
|
const c = ((d = i.getFocusedUnit()) == null ? void 0 : d.getUnitId()) || "";
|
|
780
|
-
return /* @__PURE__ */ R("section", { className:
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
a.objectType === ge.RECT && /* @__PURE__ */
|
|
767
|
+
return /* @__PURE__ */ R("section", { className: Vi.imageCommonPanel, children: [
|
|
768
|
+
/* @__PURE__ */ u(wi, { pageId: n, unitId: c }),
|
|
769
|
+
/* @__PURE__ */ u(Di, { pageId: n, unitId: c }),
|
|
770
|
+
a.objectType === ge.RECT && /* @__PURE__ */ u(Ni, { pageId: n, unitId: c })
|
|
784
771
|
] });
|
|
785
772
|
}
|
|
786
|
-
const
|
|
773
|
+
const Ze = {
|
|
787
774
|
id: "slide.command.insert-float-shape",
|
|
788
775
|
type: V.COMMAND,
|
|
789
776
|
handler: async (i) => {
|
|
790
777
|
var r;
|
|
791
|
-
const e = i.get(
|
|
792
|
-
return e.executeCommand(
|
|
778
|
+
const e = i.get(B), n = (r = i.get(y).getFocusedUnit()) == null ? void 0 : r.getUnitId();
|
|
779
|
+
return e.executeCommand(Kt.id, { unitId: n });
|
|
793
780
|
}
|
|
794
|
-
},
|
|
781
|
+
}, Kt = {
|
|
795
782
|
id: "slide.operation.insert-float-shape",
|
|
796
783
|
type: V.OPERATION,
|
|
797
784
|
handler: async (i, e) => {
|
|
798
785
|
const t = St(6), n = i.get(y), r = e.unitId, s = n.getUnit(r);
|
|
799
786
|
if (!s) return !1;
|
|
800
|
-
const o = s.getActivePage(), a = Object.values(o.pageElements), c = a != null && a.length ? Math.max(...a.map((
|
|
787
|
+
const o = s.getActivePage(), a = Object.values(o.pageElements), c = a != null && a.length ? Math.max(...a.map((v) => v.zIndex)) : 20, h = {
|
|
801
788
|
id: t,
|
|
802
789
|
zIndex: c + 1,
|
|
803
790
|
left: 378,
|
|
@@ -806,9 +793,9 @@ const ke = {
|
|
|
806
793
|
height: 250,
|
|
807
794
|
title: t,
|
|
808
795
|
description: "",
|
|
809
|
-
type:
|
|
796
|
+
type: Ke.SHAPE,
|
|
810
797
|
shape: {
|
|
811
|
-
shapeType:
|
|
798
|
+
shapeType: vn.Rect,
|
|
812
799
|
text: "",
|
|
813
800
|
shapeProperties: {
|
|
814
801
|
shapeBackgroundFill: {
|
|
@@ -817,8 +804,8 @@ const ke = {
|
|
|
817
804
|
}
|
|
818
805
|
}
|
|
819
806
|
};
|
|
820
|
-
o.pageElements[t] =
|
|
821
|
-
const l = i.get(N), d = l.createObjectToPage(
|
|
807
|
+
o.pageElements[t] = h, s.updatePage(o.id, o);
|
|
808
|
+
const l = i.get(N), d = l.createObjectToPage(h, o.id, r);
|
|
822
809
|
return d && l.setObjectActiveByPage(d, o.id, r), !0;
|
|
823
810
|
}
|
|
824
811
|
}, $e = {
|
|
@@ -835,14 +822,14 @@ const ke = {
|
|
|
835
822
|
width: 360
|
|
836
823
|
}) : r.close(), !0;
|
|
837
824
|
}
|
|
838
|
-
},
|
|
839
|
-
var
|
|
840
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
841
|
-
(o = i[s]) && (r =
|
|
842
|
-
return
|
|
843
|
-
},
|
|
844
|
-
function
|
|
845
|
-
const t =
|
|
825
|
+
}, Gt = "COMPONENT_SLIDE_IMAGE_POPUP_MENU";
|
|
826
|
+
var ji = Object.getOwnPropertyDescriptor, Li = (i, e, t, n) => {
|
|
827
|
+
for (var r = n > 1 ? void 0 : n ? ji(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
828
|
+
(o = i[s]) && (r = o(r) || r);
|
|
829
|
+
return r;
|
|
830
|
+
}, Pe = (i, e) => (t, n) => e(t, n, i);
|
|
831
|
+
function Ai(i, e) {
|
|
832
|
+
const t = vt(i.left, i.top, e), n = vt(i.right, i.bottom, e);
|
|
846
833
|
return {
|
|
847
834
|
left: t.x,
|
|
848
835
|
top: t.y,
|
|
@@ -850,39 +837,39 @@ function rr(i, e) {
|
|
|
850
837
|
bottom: n.y
|
|
851
838
|
};
|
|
852
839
|
}
|
|
853
|
-
function
|
|
840
|
+
function vt(i, e, t) {
|
|
854
841
|
const { scaleX: n, scaleY: r } = t.getAncestorScale(), s = t.getViewport(oe.VIEW);
|
|
855
842
|
if (!s)
|
|
856
843
|
return {
|
|
857
844
|
x: i,
|
|
858
845
|
y: e
|
|
859
846
|
};
|
|
860
|
-
const { viewportScrollX: o, viewportScrollY: a } = s, c = (i - o) * n,
|
|
847
|
+
const { viewportScrollX: o, viewportScrollY: a } = s, c = (i - o) * n, h = (e - a) * r;
|
|
861
848
|
return {
|
|
862
849
|
x: c,
|
|
863
|
-
y:
|
|
850
|
+
y: h
|
|
864
851
|
};
|
|
865
852
|
}
|
|
866
|
-
let
|
|
853
|
+
let Te = class extends Ve {
|
|
867
854
|
constructor(i, e, t, n) {
|
|
868
855
|
super(), this._globalPopupManagerService = i, this._renderManagerService = e, this._univerInstanceService = t, this._commandService = n;
|
|
869
856
|
}
|
|
870
857
|
_createObjectPositionObserver(i, e) {
|
|
871
858
|
const n = (() => {
|
|
872
859
|
var z, W, te, ne;
|
|
873
|
-
const { scene: o, engine: a } = e, { left: c, top:
|
|
860
|
+
const { scene: o, engine: a } = e, { left: c, top: h, width: l, height: d } = i, v = (o.width - ((W = (z = e.mainComponent) == null ? void 0 : z.width) != null ? W : 0)) / 2, f = (o.height - ((ne = (te = e.mainComponent) == null ? void 0 : te.height) != null ? ne : 0)) / 2, C = {
|
|
874
861
|
left: c,
|
|
875
862
|
right: c + l,
|
|
876
|
-
top:
|
|
877
|
-
bottom:
|
|
878
|
-
},
|
|
863
|
+
top: h,
|
|
864
|
+
bottom: h + d
|
|
865
|
+
}, p = a.getCanvasElement(), m = p.getBoundingClientRect(), _ = Tn(p.style.width), { scaleX: b, scaleY: P } = o.getAncestorScale(), w = Ai(C, o), { top: D, left: j, width: O } = m, K = O / _;
|
|
879
866
|
return {
|
|
880
|
-
left: w.left *
|
|
881
|
-
right: w.right *
|
|
882
|
-
top: w.top *
|
|
883
|
-
bottom: w.bottom *
|
|
867
|
+
left: w.left * K * b + j + v,
|
|
868
|
+
right: w.right * K * b + j + v,
|
|
869
|
+
top: w.top * K * P + D + f,
|
|
870
|
+
bottom: w.bottom * K * P + D + f
|
|
884
871
|
};
|
|
885
|
-
})(), r = new Q(n), s = new
|
|
872
|
+
})(), r = new Q(n), s = new Ge();
|
|
886
873
|
return {
|
|
887
874
|
position: n,
|
|
888
875
|
position$: r,
|
|
@@ -911,18 +898,18 @@ let Me = class extends Ve {
|
|
|
911
898
|
};
|
|
912
899
|
}
|
|
913
900
|
};
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
],
|
|
920
|
-
var
|
|
921
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
922
|
-
(o = i[s]) && (r =
|
|
923
|
-
return
|
|
901
|
+
Te = Li([
|
|
902
|
+
Pe(0, X(wn)),
|
|
903
|
+
Pe(1, Y),
|
|
904
|
+
Pe(2, y),
|
|
905
|
+
Pe(3, B)
|
|
906
|
+
], Te);
|
|
907
|
+
var $i = Object.getOwnPropertyDescriptor, Hi = (i, e, t, n) => {
|
|
908
|
+
for (var r = n > 1 ? void 0 : n ? $i(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
909
|
+
(o = i[s]) && (r = o(r) || r);
|
|
910
|
+
return r;
|
|
924
911
|
}, q = (i, e) => (t, n) => e(t, n, i);
|
|
925
|
-
let
|
|
912
|
+
let Me = class extends pe {
|
|
926
913
|
constructor(e, t, n, r, s, o, a) {
|
|
927
914
|
super();
|
|
928
915
|
I(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
@@ -944,8 +931,8 @@ let Te = class extends Ce {
|
|
|
944
931
|
var r;
|
|
945
932
|
const t = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SLIDE), n = (r = t == null ? void 0 : t.getPages()) != null ? r : {};
|
|
946
933
|
Object.keys(n).forEach((s) => {
|
|
947
|
-
var
|
|
948
|
-
const a = (
|
|
934
|
+
var h;
|
|
935
|
+
const a = (h = this._canvasView.getRenderUnitByPageId(s, e).scene) == null ? void 0 : h.getTransformer();
|
|
949
936
|
if (!a) return;
|
|
950
937
|
let c;
|
|
951
938
|
this.disposeWithMe(
|
|
@@ -959,13 +946,13 @@ let Te = class extends Ce {
|
|
|
959
946
|
const d = l.values().next().value;
|
|
960
947
|
if (!d)
|
|
961
948
|
return;
|
|
962
|
-
const
|
|
949
|
+
const v = d.oKey;
|
|
963
950
|
c == null || c.dispose(), c = this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(d, {
|
|
964
|
-
componentKey:
|
|
951
|
+
componentKey: Gt,
|
|
965
952
|
direction: "horizontal",
|
|
966
953
|
offset: [2, 0],
|
|
967
954
|
extraProps: {
|
|
968
|
-
menuItems: this._getMenuItemsByObjectType(d.objectType,
|
|
955
|
+
menuItems: this._getMenuItemsByObjectType(d.objectType, v, e)
|
|
969
956
|
}
|
|
970
957
|
})), this._sidebarService.visible && this._commandService.executeCommand($e.id, {
|
|
971
958
|
visible: !0,
|
|
@@ -975,7 +962,7 @@ let Te = class extends Ce {
|
|
|
975
962
|
)
|
|
976
963
|
), this.disposeWithMe(
|
|
977
964
|
a.clearControl$.subscribe(() => {
|
|
978
|
-
c == null || c.dispose(), this._contextService.setContextValue(
|
|
965
|
+
c == null || c.dispose(), this._contextService.setContextValue(pn, !1);
|
|
979
966
|
})
|
|
980
967
|
), this.disposeWithMe(
|
|
981
968
|
a.changing$.subscribe(() => {
|
|
@@ -986,7 +973,7 @@ let Te = class extends Ce {
|
|
|
986
973
|
return;
|
|
987
974
|
}
|
|
988
975
|
const d = l.values().next().value;
|
|
989
|
-
d && this._commandService.executeCommand(
|
|
976
|
+
d && this._commandService.executeCommand(k.id, {
|
|
990
977
|
unitId: e,
|
|
991
978
|
oKey: d.oKey,
|
|
992
979
|
props: {
|
|
@@ -1013,7 +1000,7 @@ let Te = class extends Ce {
|
|
|
1013
1000
|
}, {
|
|
1014
1001
|
label: "slide.popup.delete",
|
|
1015
1002
|
index: 5,
|
|
1016
|
-
commandId:
|
|
1003
|
+
commandId: Ut.id,
|
|
1017
1004
|
commandParams: {
|
|
1018
1005
|
id: t,
|
|
1019
1006
|
unitId: n
|
|
@@ -1022,30 +1009,30 @@ let Te = class extends Ce {
|
|
|
1022
1009
|
}];
|
|
1023
1010
|
}
|
|
1024
1011
|
};
|
|
1025
|
-
|
|
1026
|
-
q(0,
|
|
1027
|
-
q(1,
|
|
1012
|
+
Me = Hi([
|
|
1013
|
+
q(0, X(Te)),
|
|
1014
|
+
q(1, Y),
|
|
1028
1015
|
q(2, y),
|
|
1029
|
-
q(3,
|
|
1030
|
-
q(4,
|
|
1016
|
+
q(3, Ce),
|
|
1017
|
+
q(4, X(N)),
|
|
1031
1018
|
q(5, Tt),
|
|
1032
|
-
q(6,
|
|
1033
|
-
],
|
|
1019
|
+
q(6, B)
|
|
1020
|
+
], Me);
|
|
1034
1021
|
const we = {
|
|
1035
1022
|
id: "slide.operation.edit-arrow",
|
|
1036
1023
|
type: V.OPERATION,
|
|
1037
1024
|
handler: () => !0
|
|
1038
|
-
},
|
|
1039
|
-
var
|
|
1040
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1041
|
-
(o = i[s]) && (r =
|
|
1042
|
-
return
|
|
1043
|
-
},
|
|
1044
|
-
const qe =
|
|
1025
|
+
}, he = Cn("SLIDE_EDITOR");
|
|
1026
|
+
var Fi = Object.getOwnPropertyDescriptor, zi = (i, e, t, n) => {
|
|
1027
|
+
for (var r = n > 1 ? void 0 : n ? Fi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1028
|
+
(o = i[s]) && (r = o(r) || r);
|
|
1029
|
+
return r;
|
|
1030
|
+
}, je = (i, e) => (t, n) => e(t, n, i);
|
|
1031
|
+
const qe = bt("univer.slide-editor-bridge.service");
|
|
1045
1032
|
let He = class extends Ve {
|
|
1046
1033
|
constructor(e, t, n) {
|
|
1047
1034
|
super();
|
|
1048
|
-
I(this, "_editorUnitId",
|
|
1035
|
+
I(this, "_editorUnitId", he);
|
|
1049
1036
|
I(this, "_isForceKeepVisible", !1);
|
|
1050
1037
|
I(this, "_editorIsDirty", !1);
|
|
1051
1038
|
I(this, "_currentEditRectState", null);
|
|
@@ -1060,7 +1047,7 @@ let He = class extends Ve {
|
|
|
1060
1047
|
I(this, "visible$", this._visible$.asObservable());
|
|
1061
1048
|
I(this, "_afterVisible$", new Q(this._visibleParam));
|
|
1062
1049
|
I(this, "afterVisible$", this._afterVisible$.asObservable());
|
|
1063
|
-
I(this, "endEditing$", new
|
|
1050
|
+
I(this, "endEditing$", new Dt());
|
|
1064
1051
|
I(this, "_currentEditRectInfo");
|
|
1065
1052
|
this._editorService = e, this._contextService = t, this._renderManagerService = n;
|
|
1066
1053
|
}
|
|
@@ -1075,7 +1062,7 @@ let He = class extends Ve {
|
|
|
1075
1062
|
* @editorInfo editorInfo
|
|
1076
1063
|
*/
|
|
1077
1064
|
setEditorRect(e) {
|
|
1078
|
-
this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(
|
|
1065
|
+
this._currentEditRectInfo = e, this._editorService.getFocusEditor() || (this._editorService.focus(he), this._contextService.setContextValue(xe, !1), this._contextService.setContextValue(Pt, !1), this._contextService.setContextValue(Et, !1));
|
|
1079
1066
|
const t = this.getEditRectState();
|
|
1080
1067
|
this._currentEditRectState = t, this._currentEditRectState$.next(t);
|
|
1081
1068
|
}
|
|
@@ -1089,31 +1076,31 @@ let He = class extends Ve {
|
|
|
1089
1076
|
* && this@setEditorRect
|
|
1090
1077
|
*/
|
|
1091
1078
|
getEditRectState() {
|
|
1092
|
-
const e =
|
|
1079
|
+
const e = he, t = this._currentEditRectInfo, n = t.unitId, r = t.richTextObj.documentData;
|
|
1093
1080
|
r.id = e, r.documentStyle = {
|
|
1094
1081
|
...r.documentStyle,
|
|
1095
1082
|
pageSize: { width: t.richTextObj.width, height: 1 / 0 }
|
|
1096
1083
|
};
|
|
1097
1084
|
const o = {
|
|
1098
|
-
documentModel: new
|
|
1085
|
+
documentModel: new fn(r),
|
|
1099
1086
|
fontString: "document",
|
|
1100
1087
|
textRotation: { a: 0, v: 0 },
|
|
1101
1088
|
wrapStrategy: 0,
|
|
1102
1089
|
verticalAlign: ye.TOP,
|
|
1103
1090
|
horizontalAlign: Rt.LEFT,
|
|
1104
1091
|
paddingData: { t: 0, b: 1, l: 2, r: 2 }
|
|
1105
|
-
}, a = t.richTextObj.width, c = t.richTextObj.height,
|
|
1092
|
+
}, a = t.richTextObj.width, c = t.richTextObj.height, h = t.richTextObj.left, l = t.richTextObj.top, d = {
|
|
1106
1093
|
left: 0,
|
|
1107
1094
|
top: 0
|
|
1108
|
-
},
|
|
1109
|
-
x: (
|
|
1110
|
-
y: (
|
|
1111
|
-
}, _ = (
|
|
1112
|
-
return d.left =
|
|
1095
|
+
}, v = this._renderManagerService.getRenderById(n), f = v == null ? void 0 : v.scene, C = f == null ? void 0 : f.getViewport(oe.VIEW), p = f == null ? void 0 : f.getObject(oe.COMPONENT), m = {
|
|
1096
|
+
x: (p == null ? void 0 : p.left) || 0,
|
|
1097
|
+
y: (p == null ? void 0 : p.top) || 0
|
|
1098
|
+
}, _ = (C == null ? void 0 : C.viewportScrollX) || 0, b = (C == null ? void 0 : C.viewportScrollY) || 0;
|
|
1099
|
+
return d.left = m.x - _, d.top = m.y - b, {
|
|
1113
1100
|
position: {
|
|
1114
|
-
startX:
|
|
1101
|
+
startX: h,
|
|
1115
1102
|
startY: l,
|
|
1116
|
-
endX:
|
|
1103
|
+
endX: h + a,
|
|
1117
1104
|
endY: l + c
|
|
1118
1105
|
},
|
|
1119
1106
|
scaleX: 1,
|
|
@@ -1179,12 +1166,12 @@ let He = class extends Ve {
|
|
|
1179
1166
|
};
|
|
1180
1167
|
}
|
|
1181
1168
|
};
|
|
1182
|
-
He =
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1169
|
+
He = zi([
|
|
1170
|
+
je(0, Xe),
|
|
1171
|
+
je(1, Ce),
|
|
1172
|
+
je(2, Y)
|
|
1186
1173
|
], He);
|
|
1187
|
-
class
|
|
1174
|
+
class Wi {
|
|
1188
1175
|
constructor() {
|
|
1189
1176
|
I(this, "_state", null);
|
|
1190
1177
|
I(this, "_rect", null);
|
|
@@ -1218,30 +1205,30 @@ class mr {
|
|
|
1218
1205
|
this._state$.next(e);
|
|
1219
1206
|
}
|
|
1220
1207
|
}
|
|
1221
|
-
const Je =
|
|
1208
|
+
const Je = bt(
|
|
1222
1209
|
"univer.slide-editor-manager.service"
|
|
1223
1210
|
);
|
|
1224
|
-
var
|
|
1225
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1226
|
-
(o = i[s]) && (r =
|
|
1227
|
-
return
|
|
1211
|
+
var Z = /* @__PURE__ */ ((i) => (i[i.InitialState = 0] = "InitialState", i[i.StartEditor = 1] = "StartEditor", i[i.CursorChange = 2] = "CursorChange", i))(Z || {}), ki = Object.getOwnPropertyDescriptor, Ki = (i, e, t, n) => {
|
|
1212
|
+
for (var r = n > 1 ? void 0 : n ? ki(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1213
|
+
(o = i[s]) && (r = o(r) || r);
|
|
1214
|
+
return r;
|
|
1228
1215
|
}, A = (i, e) => (t, n) => e(t, n, i);
|
|
1229
|
-
const
|
|
1216
|
+
const pt = -1e3, Ct = 5, Gi = 2;
|
|
1230
1217
|
let Fe = class extends Ve {
|
|
1231
|
-
constructor(e, t, n, r, s, o, a, c,
|
|
1218
|
+
constructor(e, t, n, r, s, o, a, c, h, l, d, v) {
|
|
1232
1219
|
super();
|
|
1233
1220
|
/**
|
|
1234
1221
|
* It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
|
|
1235
1222
|
*/
|
|
1236
|
-
I(this, "_cursorChange",
|
|
1223
|
+
I(this, "_cursorChange", Z.InitialState);
|
|
1237
1224
|
/** If the corresponding unit is active and prepared for editing. */
|
|
1238
1225
|
I(this, "_isUnitEditing", !1);
|
|
1239
1226
|
I(this, "_d");
|
|
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 =
|
|
1241
|
-
|
|
1227
|
+
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 = h, this._commandService = l, this._localService = d, this._editorService = v, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(E.UNIVER_SLIDE).subscribe((f) => {
|
|
1228
|
+
f && f.getUnitId() === this._renderContext.unitId ? this._d = this._init() : (this._disposeCurrent(), this._isUnitEditing && (this._handleEditorInvisible({
|
|
1242
1229
|
visible: !1,
|
|
1243
1230
|
eventType: J.Keyboard,
|
|
1244
|
-
keycode:
|
|
1231
|
+
keycode: T.ESC,
|
|
1245
1232
|
unitId: this._renderContext.unitId
|
|
1246
1233
|
}), this._isUnitEditing = !1));
|
|
1247
1234
|
})), this._initEditorVisibilityListener();
|
|
@@ -1254,7 +1241,7 @@ let Fe = class extends Ve {
|
|
|
1254
1241
|
(e = this._d) == null || e.dispose(), this._d = null;
|
|
1255
1242
|
}
|
|
1256
1243
|
_init() {
|
|
1257
|
-
const e = new
|
|
1244
|
+
const e = new Ge();
|
|
1258
1245
|
return this._subscribeToCurrentCell(e), this._initialKeyboardListener(e), this._initialCursorSync(e), this._listenEditorFocus(e), this._commandExecutedListener(e), setTimeout(() => {
|
|
1259
1246
|
this._cursorStateListener(e);
|
|
1260
1247
|
}, 1e3), e;
|
|
@@ -1271,16 +1258,16 @@ let Fe = class extends Ve {
|
|
|
1271
1258
|
}
|
|
1272
1259
|
_getEditorSkeleton(e) {
|
|
1273
1260
|
var t;
|
|
1274
|
-
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(
|
|
1261
|
+
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(ut).getSkeleton();
|
|
1275
1262
|
}
|
|
1276
1263
|
_getEditorViewModel(e) {
|
|
1277
1264
|
var t;
|
|
1278
|
-
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(
|
|
1265
|
+
return (t = this._renderManagerService.getRenderById(e)) == null ? void 0 : t.with(ut).getViewModel();
|
|
1279
1266
|
}
|
|
1280
1267
|
_initialCursorSync(e) {
|
|
1281
1268
|
e.add(this._cellEditorManagerService.focus$.pipe(Wn((t) => !!t)).subscribe(() => {
|
|
1282
1269
|
var n;
|
|
1283
|
-
const t = (n = this._renderManagerService.getCurrentTypeOfRenderer(E.UNIVER_DOC)) == null ? void 0 : n.with(
|
|
1270
|
+
const t = (n = this._renderManagerService.getCurrentTypeOfRenderer(E.UNIVER_DOC)) == null ? void 0 : n.with(gt);
|
|
1284
1271
|
t && t.sync();
|
|
1285
1272
|
}));
|
|
1286
1273
|
}
|
|
@@ -1290,21 +1277,21 @@ let Fe = class extends Ve {
|
|
|
1290
1277
|
*/
|
|
1291
1278
|
_subscribeToCurrentCell(e) {
|
|
1292
1279
|
e.add(this._editorBridgeService.currentEditRectState$.subscribe((t) => {
|
|
1293
|
-
var
|
|
1294
|
-
if (t == null || this._contextService.getContextValue(
|
|
1280
|
+
var v;
|
|
1281
|
+
if (t == null || this._contextService.getContextValue(Pt) || this._contextService.getContextValue(Et))
|
|
1295
1282
|
return;
|
|
1296
1283
|
const {
|
|
1297
1284
|
position: { startX: n, endX: r },
|
|
1298
1285
|
documentLayoutObject: { textRotation: s, wrapStrategy: o, documentModel: a },
|
|
1299
1286
|
scaleX: c,
|
|
1300
|
-
editorUnitId:
|
|
1287
|
+
editorUnitId: h
|
|
1301
1288
|
} = t, { vertexAngle: l } = rt(s);
|
|
1302
|
-
a.updateDocumentId(
|
|
1289
|
+
a.updateDocumentId(h), o === tt.WRAP && l === 0 && a.updateDocumentDataPageSize((r - n) / c), this._instanceSrv.changeDoc(h, a), this._contextService.setContextValue(Sn, !0), this._textSelectionManagerService.replaceTextRanges([{
|
|
1303
1290
|
startOffset: 0,
|
|
1304
1291
|
endOffset: 0
|
|
1305
1292
|
}]);
|
|
1306
|
-
const d = (
|
|
1307
|
-
d && d.activate(
|
|
1293
|
+
const d = (v = this._renderManagerService.getCurrentTypeOfRenderer(E.UNIVER_DOC)) == null ? void 0 : v.with(gt);
|
|
1294
|
+
d && d.activate(pt, pt);
|
|
1308
1295
|
}));
|
|
1309
1296
|
}
|
|
1310
1297
|
/**
|
|
@@ -1317,50 +1304,50 @@ let Fe = class extends Ve {
|
|
|
1317
1304
|
* @param scaleY
|
|
1318
1305
|
*/
|
|
1319
1306
|
_fitTextSize(e, t, n, r, s = 1, o = 1) {
|
|
1320
|
-
const { startX: a, startY: c, endX:
|
|
1307
|
+
const { startX: a, startY: c, endX: h, endY: l } = e, d = r.documentModel;
|
|
1321
1308
|
if (d == null)
|
|
1322
1309
|
return;
|
|
1323
|
-
const { actualWidth:
|
|
1310
|
+
const { actualWidth: v, actualHeight: f } = this._predictingSize(
|
|
1324
1311
|
e,
|
|
1325
1312
|
t,
|
|
1326
1313
|
n,
|
|
1327
1314
|
r,
|
|
1328
1315
|
s,
|
|
1329
1316
|
o
|
|
1330
|
-
), { verticalAlign:
|
|
1331
|
-
let _ =
|
|
1332
|
-
if (_ <
|
|
1333
|
-
|
|
1317
|
+
), { verticalAlign: C, paddingData: p, fill: m } = r;
|
|
1318
|
+
let _ = h - a, b = l - c;
|
|
1319
|
+
if (_ < v && (_ = v), b < f)
|
|
1320
|
+
b = f, d.updateDocumentDataMargin(p);
|
|
1334
1321
|
else {
|
|
1335
|
-
let
|
|
1336
|
-
|
|
1337
|
-
t:
|
|
1322
|
+
let P = 0;
|
|
1323
|
+
C === ye.MIDDLE ? P = (b - f) / 2 / o : C === ye.TOP ? P = p.t || 0 : P = (b - f) / o - (p.b || 0), P = P < (p.t || 0) ? p.t || 0 : P, d.updateDocumentDataMargin({
|
|
1324
|
+
t: P
|
|
1338
1325
|
});
|
|
1339
1326
|
}
|
|
1340
|
-
n.calculate(), this._editAreaProcessing(_,
|
|
1327
|
+
n.calculate(), this._editAreaProcessing(_, b, e, t, m, s, o);
|
|
1341
1328
|
}
|
|
1342
1329
|
/**
|
|
1343
1330
|
* Mainly used to pre-calculate the width of the editor,
|
|
1344
1331
|
* to determine whether it needs to be automatically widened.
|
|
1345
1332
|
*/
|
|
1346
1333
|
_predictingSize(e, t, n, r, s = 1, o = 1) {
|
|
1347
|
-
const { startX: a, endX: c } = e, { textRotation:
|
|
1348
|
-
if (l === tt.WRAP &&
|
|
1349
|
-
const { actualWidth:
|
|
1334
|
+
const { startX: a, endX: c } = e, { textRotation: h, wrapStrategy: l } = r, d = r.documentModel, { vertexAngle: v } = rt(h), f = document.body.clientWidth;
|
|
1335
|
+
if (l === tt.WRAP && v === 0) {
|
|
1336
|
+
const { actualWidth: m, actualHeight: _ } = n.getActualSize();
|
|
1350
1337
|
return {
|
|
1351
|
-
actualWidth:
|
|
1338
|
+
actualWidth: m * s,
|
|
1352
1339
|
actualHeight: _ * o
|
|
1353
1340
|
};
|
|
1354
1341
|
}
|
|
1355
|
-
d == null || d.updateDocumentDataPageSize((
|
|
1356
|
-
const
|
|
1357
|
-
let
|
|
1358
|
-
return
|
|
1342
|
+
d == null || d.updateDocumentDataPageSize((f - a - t.left) / s), n.calculate();
|
|
1343
|
+
const C = n.getActualSize();
|
|
1344
|
+
let p = c - a;
|
|
1345
|
+
return p < C.actualWidth * s + Ct * s && (p = C.actualWidth * s + Ct * s), d == null || d.updateDocumentDataPageSize(p / s), d == null || d.updateDocumentRenderConfig({
|
|
1359
1346
|
horizontalAlign: Rt.UNSPECIFIED,
|
|
1360
1347
|
cellValueType: void 0
|
|
1361
1348
|
}), {
|
|
1362
|
-
actualWidth:
|
|
1363
|
-
actualHeight:
|
|
1349
|
+
actualWidth: p,
|
|
1350
|
+
actualHeight: C.actualHeight * o
|
|
1364
1351
|
};
|
|
1365
1352
|
}
|
|
1366
1353
|
/**
|
|
@@ -1372,15 +1359,15 @@ let Fe = class extends Ve {
|
|
|
1372
1359
|
const c = this._getEditorObject();
|
|
1373
1360
|
if (c == null)
|
|
1374
1361
|
return;
|
|
1375
|
-
function
|
|
1376
|
-
return Number.parseInt(
|
|
1362
|
+
function h(ce) {
|
|
1363
|
+
return Number.parseInt(ce.replace("px", ""));
|
|
1377
1364
|
}
|
|
1378
|
-
const d = this._renderContext.engine.getCanvasElement(),
|
|
1379
|
-
let { startX:
|
|
1380
|
-
|
|
1381
|
-
const { document: w, scene: D, engine:
|
|
1365
|
+
const d = this._renderContext.engine.getCanvasElement(), v = d.getBoundingClientRect(), f = h(d.style.width), { top: C, left: p, width: m } = v, _ = m / f;
|
|
1366
|
+
let { startX: b, startY: P } = n;
|
|
1367
|
+
b += r.left, P += r.top;
|
|
1368
|
+
const { document: w, scene: D, engine: j } = c, O = D.getViewport(ht.VIEW_MAIN), K = document.body.clientHeight - P - r.top - Gi * 2, ae = document.body.clientWidth - b - r.left;
|
|
1382
1369
|
let z = t, W = O == null ? void 0 : O.getScrollBar();
|
|
1383
|
-
z >
|
|
1370
|
+
z > K ? (z = K, W == null ? O && new xt(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, ae), b -= se, P -= se, this._addBackground(D, e / o, t / a, s);
|
|
1384
1371
|
const { scaleX: te, scaleY: ne } = D.getPrecisionScale();
|
|
1385
1372
|
D.transformByState({
|
|
1386
1373
|
width: e * _ / o,
|
|
@@ -1388,17 +1375,17 @@ let Fe = class extends Ve {
|
|
|
1388
1375
|
scaleX: o * _,
|
|
1389
1376
|
scaleY: a * _
|
|
1390
1377
|
}), w.resize(e / o, t / a), setTimeout(() => {
|
|
1391
|
-
|
|
1378
|
+
j.resizeBySize(
|
|
1392
1379
|
st(e, te),
|
|
1393
1380
|
st(z, ne)
|
|
1394
1381
|
);
|
|
1395
1382
|
}, 0);
|
|
1396
1383
|
const Se = this._layoutService.getContentElement().getBoundingClientRect(), Ie = d.getBoundingClientRect();
|
|
1397
|
-
|
|
1398
|
-
startX:
|
|
1399
|
-
startY:
|
|
1400
|
-
endX: e * _ +
|
|
1401
|
-
endY: z * _ +
|
|
1384
|
+
b = b * _ + (Ie.left - Se.left), P = P * _ + (Ie.top - Se.top), this._cellEditorManagerService.setState({
|
|
1385
|
+
startX: b,
|
|
1386
|
+
startY: P,
|
|
1387
|
+
endX: e * _ + b,
|
|
1388
|
+
endY: z * _ + P,
|
|
1402
1389
|
show: !0
|
|
1403
1390
|
});
|
|
1404
1391
|
}
|
|
@@ -1409,14 +1396,14 @@ let Fe = class extends Ve {
|
|
|
1409
1396
|
const s = "_backgroundRectHelperColor_", o = e.getObject(s);
|
|
1410
1397
|
o == null && r == null || (o == null ? e.addObjects(
|
|
1411
1398
|
[
|
|
1412
|
-
new
|
|
1399
|
+
new yt(s, {
|
|
1413
1400
|
width: t,
|
|
1414
1401
|
height: n,
|
|
1415
1402
|
fill: r,
|
|
1416
1403
|
evented: !1
|
|
1417
1404
|
})
|
|
1418
1405
|
],
|
|
1419
|
-
|
|
1406
|
+
Gn
|
|
1420
1407
|
) : r == null ? o.dispose() : (o.setProps({
|
|
1421
1408
|
fill: r
|
|
1422
1409
|
}), o.transformByState({
|
|
@@ -1433,9 +1420,9 @@ let Fe = class extends Ve {
|
|
|
1433
1420
|
// first part: startEditing --> _updateEditor
|
|
1434
1421
|
// 2nd part: startEditing --> changeVisible --> slide-editor-bridge.render-controller.ts@changeVisible --> _editorBridgeService.changeVisible
|
|
1435
1422
|
_handleEditorVisible(e) {
|
|
1436
|
-
var
|
|
1423
|
+
var m, _;
|
|
1437
1424
|
const { eventType: t } = e;
|
|
1438
|
-
this._cursorChange = [J.PointerDown, J.Dblclick].includes(t) ?
|
|
1425
|
+
this._cursorChange = [J.PointerDown, J.Dblclick].includes(t) ? Z.CursorChange : Z.StartEditor;
|
|
1439
1426
|
const n = this._editorBridgeService.getEditRectState();
|
|
1440
1427
|
if (n == null)
|
|
1441
1428
|
return;
|
|
@@ -1445,29 +1432,29 @@ let Fe = class extends Ve {
|
|
|
1445
1432
|
slideCardOffset: o,
|
|
1446
1433
|
scaleX: a,
|
|
1447
1434
|
scaleY: c,
|
|
1448
|
-
editorUnitId:
|
|
1435
|
+
editorUnitId: h,
|
|
1449
1436
|
unitId: l
|
|
1450
1437
|
} = n, d = this._getEditorObject();
|
|
1451
1438
|
if (d == null)
|
|
1452
1439
|
return;
|
|
1453
|
-
const { scene:
|
|
1440
|
+
const { scene: v } = d;
|
|
1454
1441
|
this._contextService.setContextValue(xe, !0);
|
|
1455
|
-
const { documentModel:
|
|
1456
|
-
if (!
|
|
1442
|
+
const { documentModel: f } = s, C = this._getEditorSkeleton(h);
|
|
1443
|
+
if (!C || !f)
|
|
1457
1444
|
return;
|
|
1458
|
-
this._fitTextSize(r, o,
|
|
1459
|
-
const
|
|
1460
|
-
(
|
|
1445
|
+
this._fitTextSize(r, o, C, s, a, c);
|
|
1446
|
+
const p = f.getBody().dataStream.length - 2 || 0;
|
|
1447
|
+
(m = v.getViewport(ht.VIEW_MAIN)) == null || m.scrollToViewportPos({
|
|
1461
1448
|
viewportScrollX: Number.POSITIVE_INFINITY
|
|
1462
1449
|
}), this._textSelectionManagerService.replaceTextRanges([
|
|
1463
1450
|
{
|
|
1464
|
-
startOffset:
|
|
1465
|
-
endOffset:
|
|
1451
|
+
startOffset: p,
|
|
1452
|
+
endOffset: p
|
|
1466
1453
|
}
|
|
1467
1454
|
]), (_ = this._renderManagerService.getRenderById(l)) == null || _.scene.resetCursor();
|
|
1468
1455
|
}
|
|
1469
1456
|
_resetBodyStyle(e, t = !1) {
|
|
1470
|
-
e.dataStream =
|
|
1457
|
+
e.dataStream = In, 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 = [
|
|
1471
1458
|
{
|
|
1472
1459
|
startIndex: 0
|
|
1473
1460
|
}
|
|
@@ -1482,14 +1469,14 @@ let Fe = class extends Ve {
|
|
|
1482
1469
|
_showEditorByKeyboard(e) {
|
|
1483
1470
|
}
|
|
1484
1471
|
_commandExecutedListener(e) {
|
|
1485
|
-
const t = [we.id], n = [
|
|
1472
|
+
const t = [we.id], n = [Kn.id];
|
|
1486
1473
|
e.add(this._commandService.onCommandExecuted((r) => {
|
|
1487
|
-
this._editorService.getFocusId() ===
|
|
1474
|
+
this._editorService.getFocusId() === he && (t.includes(r.id) && this._moveCursorCmdHandler(r), n.includes(r.id) && this._editorBridgeService.isVisible() && this._editingChangedHandler());
|
|
1488
1475
|
}));
|
|
1489
1476
|
}
|
|
1490
1477
|
_moveCursorCmdHandler(e) {
|
|
1491
1478
|
const t = e.params, { keycode: n, isShift: r } = t;
|
|
1492
|
-
n != null && this._cursorChange ===
|
|
1479
|
+
n != null && this._cursorChange === Z.CursorChange ? this._moveInEditor(n, r) : this._editorBridgeService.changeVisible(t);
|
|
1493
1480
|
}
|
|
1494
1481
|
_editingChangedHandler() {
|
|
1495
1482
|
const e = this._editorBridgeService.getEditorRect();
|
|
@@ -1501,11 +1488,11 @@ let Fe = class extends Ve {
|
|
|
1501
1488
|
this._handleEditorVisible({ visible: !0, eventType: 3, unitId: n });
|
|
1502
1489
|
}
|
|
1503
1490
|
_getEditorObject() {
|
|
1504
|
-
return
|
|
1491
|
+
return Xi(this._editorBridgeService.getCurrentEditorId(), this._renderManagerService);
|
|
1505
1492
|
}
|
|
1506
1493
|
async _handleEditorInvisible(e) {
|
|
1507
1494
|
const { keycode: t } = e;
|
|
1508
|
-
if (this._cursorChange =
|
|
1495
|
+
if (this._cursorChange = Z.InitialState, this._exitInput(e), this._editorBridgeService.getEditRectState() == null)
|
|
1509
1496
|
return;
|
|
1510
1497
|
if (this._editorBridgeService.getEditorDirty() === !1) {
|
|
1511
1498
|
this._moveCursor(t);
|
|
@@ -1523,22 +1510,22 @@ let Fe = class extends Ve {
|
|
|
1523
1510
|
_moveCursor(e) {
|
|
1524
1511
|
if (e != null)
|
|
1525
1512
|
switch (L.LEFT, e) {
|
|
1526
|
-
case
|
|
1513
|
+
case T.ENTER:
|
|
1527
1514
|
L.DOWN;
|
|
1528
1515
|
break;
|
|
1529
|
-
case
|
|
1516
|
+
case T.TAB:
|
|
1530
1517
|
L.RIGHT;
|
|
1531
1518
|
break;
|
|
1532
|
-
case
|
|
1519
|
+
case T.ARROW_DOWN:
|
|
1533
1520
|
L.DOWN;
|
|
1534
1521
|
break;
|
|
1535
|
-
case
|
|
1522
|
+
case T.ARROW_UP:
|
|
1536
1523
|
L.UP;
|
|
1537
1524
|
break;
|
|
1538
|
-
case
|
|
1525
|
+
case T.ARROW_LEFT:
|
|
1539
1526
|
L.LEFT;
|
|
1540
1527
|
break;
|
|
1541
|
-
case
|
|
1528
|
+
case T.ARROW_RIGHT:
|
|
1542
1529
|
L.RIGHT;
|
|
1543
1530
|
break;
|
|
1544
1531
|
}
|
|
@@ -1553,39 +1540,39 @@ let Fe = class extends Ve {
|
|
|
1553
1540
|
return;
|
|
1554
1541
|
const { document: n } = t;
|
|
1555
1542
|
e.add(It(n.onPointerDown$.subscribeEvent(() => {
|
|
1556
|
-
this._cursorChange ===
|
|
1543
|
+
this._cursorChange === Z.StartEditor && (this._cursorChange = Z.CursorChange);
|
|
1557
1544
|
})));
|
|
1558
1545
|
}
|
|
1559
1546
|
// TODO: @JOCS, is it necessary to move these commands MoveSelectionOperation\MoveCursorOperation to shortcut? and use multi-commands?
|
|
1560
1547
|
_moveInEditor(e, t) {
|
|
1561
1548
|
let n = L.LEFT;
|
|
1562
|
-
e ===
|
|
1549
|
+
e === T.ARROW_DOWN ? n = L.DOWN : e === T.ARROW_UP ? n = L.UP : e === T.ARROW_RIGHT && (n = L.RIGHT), t ? this._commandService.executeCommand(Xn.id, {
|
|
1563
1550
|
direction: n
|
|
1564
|
-
}) : this._commandService.executeCommand(
|
|
1551
|
+
}) : this._commandService.executeCommand(Yn.id, {
|
|
1565
1552
|
direction: n
|
|
1566
1553
|
});
|
|
1567
1554
|
}
|
|
1568
1555
|
};
|
|
1569
|
-
Fe =
|
|
1556
|
+
Fe = Ki([
|
|
1570
1557
|
A(1, Nn),
|
|
1571
|
-
A(2,
|
|
1572
|
-
A(3,
|
|
1558
|
+
A(2, _n),
|
|
1559
|
+
A(3, Ce),
|
|
1573
1560
|
A(4, y),
|
|
1574
|
-
A(5,
|
|
1561
|
+
A(5, Y),
|
|
1575
1562
|
A(6, qe),
|
|
1576
1563
|
A(7, Je),
|
|
1577
|
-
A(8,
|
|
1578
|
-
A(9,
|
|
1579
|
-
A(10,
|
|
1580
|
-
A(11,
|
|
1564
|
+
A(8, X(kn)),
|
|
1565
|
+
A(9, B),
|
|
1566
|
+
A(10, X(ee)),
|
|
1567
|
+
A(11, Xe)
|
|
1581
1568
|
], Fe);
|
|
1582
|
-
function
|
|
1569
|
+
function Xi(i, e) {
|
|
1583
1570
|
if (i == null)
|
|
1584
1571
|
return;
|
|
1585
1572
|
const t = e.getRenderById(i);
|
|
1586
1573
|
if (t == null)
|
|
1587
1574
|
return;
|
|
1588
|
-
const { mainComponent: n, scene: r, engine: s, components: o } = t, a = n, c = o.get(
|
|
1575
|
+
const { mainComponent: n, scene: r, engine: s, components: o } = t, a = n, c = o.get(Zn.BACKGROUND);
|
|
1589
1576
|
return {
|
|
1590
1577
|
document: a,
|
|
1591
1578
|
docBackground: c,
|
|
@@ -1593,12 +1580,12 @@ function Cr(i, e) {
|
|
|
1593
1580
|
engine: s
|
|
1594
1581
|
};
|
|
1595
1582
|
}
|
|
1596
|
-
var
|
|
1597
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
1598
|
-
(o = i[s]) && (r =
|
|
1599
|
-
return
|
|
1583
|
+
var Yi = Object.getOwnPropertyDescriptor, Zi = (i, e, t, n) => {
|
|
1584
|
+
for (var r = n > 1 ? void 0 : n ? Yi(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
1585
|
+
(o = i[s]) && (r = o(r) || r);
|
|
1586
|
+
return r;
|
|
1600
1587
|
}, Le = (i, e) => (t, n) => e(t, n, i);
|
|
1601
|
-
let ze = class extends
|
|
1588
|
+
let ze = class extends pe {
|
|
1602
1589
|
constructor(e, t, n, r) {
|
|
1603
1590
|
super();
|
|
1604
1591
|
/**
|
|
@@ -1607,7 +1594,7 @@ let ze = class extends Ce {
|
|
|
1607
1594
|
// private _cursorChange: CursorChange = CursorChange.InitialState;
|
|
1608
1595
|
/** If the corresponding unit is active and prepared for editing. */
|
|
1609
1596
|
// private _isUnitEditing = false;
|
|
1610
|
-
I(this, "setSlideTextEditor$", new
|
|
1597
|
+
I(this, "setSlideTextEditor$", new Dt());
|
|
1611
1598
|
I(this, "_curRichText", null);
|
|
1612
1599
|
I(this, "_d");
|
|
1613
1600
|
this._renderContext = e, this._instanceSrv = t, this._commandService = n, this._editorBridgeService = r, this.disposeWithMe(this._instanceSrv.getCurrentTypeOfUnit$(E.UNIVER_SLIDE).subscribe((s) => {
|
|
@@ -1615,7 +1602,7 @@ let ze = class extends Ce {
|
|
|
1615
1602
|
}));
|
|
1616
1603
|
}
|
|
1617
1604
|
_init() {
|
|
1618
|
-
const e = new
|
|
1605
|
+
const e = new Ge();
|
|
1619
1606
|
return this._initEventListener(e), e;
|
|
1620
1607
|
}
|
|
1621
1608
|
_disposeCurrent() {
|
|
@@ -1642,8 +1629,8 @@ let ze = class extends Ce {
|
|
|
1642
1629
|
this.setEditorVisible(!1);
|
|
1643
1630
|
})), e.add(o.onDblclick$.subscribeEvent(() => {
|
|
1644
1631
|
a.clearControls();
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1632
|
+
const h = a.getSelectedObjectMap().values().next().value;
|
|
1633
|
+
h && (h.objectType !== ge.RICH_TEXT ? this.pickOtherObjects() : this.startEditing(o.sceneKey, h));
|
|
1647
1634
|
})), e.add(this._instanceSrv.focused$.subscribe((c) => {
|
|
1648
1635
|
this.endEditing();
|
|
1649
1636
|
})));
|
|
@@ -1681,7 +1668,7 @@ let ze = class extends Ce {
|
|
|
1681
1668
|
const a = r[0].ts;
|
|
1682
1669
|
n.cl = a == null ? void 0 : a.cl;
|
|
1683
1670
|
}
|
|
1684
|
-
this._commandService.executeCommand(
|
|
1671
|
+
this._commandService.executeCommand(k.id, {
|
|
1685
1672
|
unitId: this._renderContext.unitId,
|
|
1686
1673
|
oKey: e == null ? void 0 : e.oKey,
|
|
1687
1674
|
props: {
|
|
@@ -1706,24 +1693,24 @@ let ze = class extends Ce {
|
|
|
1706
1693
|
this._editorBridgeService.changeVisible({ visible: e, eventType: J.PointerDown, unitId: t });
|
|
1707
1694
|
}
|
|
1708
1695
|
};
|
|
1709
|
-
ze =
|
|
1696
|
+
ze = Zi([
|
|
1710
1697
|
Le(1, y),
|
|
1711
|
-
Le(2,
|
|
1698
|
+
Le(2, B),
|
|
1712
1699
|
Le(3, qe)
|
|
1713
1700
|
], ze);
|
|
1714
|
-
const
|
|
1701
|
+
const Xt = {
|
|
1715
1702
|
id: "slide.operation.activate-slide",
|
|
1716
1703
|
type: V.OPERATION,
|
|
1717
1704
|
handler: (i, e) => {
|
|
1718
|
-
var
|
|
1719
|
-
const t = e.unitId, n = i.get(N), s = i.get(y).getUnit(t), o = (
|
|
1705
|
+
var h, l;
|
|
1706
|
+
const t = e.unitId, n = i.get(N), s = i.get(y).getUnit(t), o = (h = s == null ? void 0 : s.getActivePage()) == null ? void 0 : h.id;
|
|
1720
1707
|
if (!o) return !1;
|
|
1721
1708
|
const a = n.getRenderUnitByPageId(o, t);
|
|
1722
1709
|
if (!a) return !1;
|
|
1723
1710
|
const c = (l = a.scene) == null ? void 0 : l.getTransformer();
|
|
1724
1711
|
return c && c.clearControls(), n.activePage(e.id, t), !0;
|
|
1725
1712
|
}
|
|
1726
|
-
},
|
|
1713
|
+
}, Yt = {
|
|
1727
1714
|
id: "slide.operation.append-slide",
|
|
1728
1715
|
type: V.OPERATION,
|
|
1729
1716
|
handler: (i, e) => {
|
|
@@ -1734,8 +1721,8 @@ const Zt = {
|
|
|
1734
1721
|
id: "slide.command.insert-float-image",
|
|
1735
1722
|
type: V.COMMAND,
|
|
1736
1723
|
handler: async (i, e) => {
|
|
1737
|
-
var
|
|
1738
|
-
const t = i.get(y), n = (
|
|
1724
|
+
var j;
|
|
1725
|
+
const t = i.get(y), n = (j = t.getCurrentUnitForType(E.UNIVER_SLIDE)) == null ? void 0 : j.getUnitId();
|
|
1739
1726
|
if (!n) return !1;
|
|
1740
1727
|
const s = await i.get(Dn).openFile({
|
|
1741
1728
|
multiple: !0,
|
|
@@ -1744,56 +1731,56 @@ const Zt = {
|
|
|
1744
1731
|
if (s.length !== 1) return !1;
|
|
1745
1732
|
const a = await i.get(Qn).saveImage(s[0]);
|
|
1746
1733
|
if (!a) return !1;
|
|
1747
|
-
const { imageId: c, imageSourceType:
|
|
1748
|
-
if (!
|
|
1749
|
-
const
|
|
1734
|
+
const { imageId: c, imageSourceType: h, source: l, base64Cache: d } = a, { width: v, height: f, image: C } = await ei(d || ""), p = t.getUnit(n);
|
|
1735
|
+
if (!p) return !1;
|
|
1736
|
+
const m = p.getActivePage(), _ = Object.values(m.pageElements), b = _ != null && _.length ? Math.max(..._.map((O) => O.zIndex)) : 20, P = {
|
|
1750
1737
|
id: c,
|
|
1751
|
-
zIndex:
|
|
1738
|
+
zIndex: b + 1,
|
|
1752
1739
|
left: 0,
|
|
1753
1740
|
top: 0,
|
|
1754
|
-
width:
|
|
1755
|
-
height:
|
|
1741
|
+
width: v,
|
|
1742
|
+
height: f,
|
|
1756
1743
|
title: "",
|
|
1757
1744
|
description: "",
|
|
1758
|
-
type:
|
|
1745
|
+
type: Ke.IMAGE,
|
|
1759
1746
|
image: {
|
|
1760
1747
|
imageProperties: {
|
|
1761
1748
|
contentUrl: d,
|
|
1762
|
-
imageSourceType:
|
|
1749
|
+
imageSourceType: h,
|
|
1763
1750
|
source: l,
|
|
1764
1751
|
base64Cache: d,
|
|
1765
|
-
image:
|
|
1752
|
+
image: C
|
|
1766
1753
|
}
|
|
1767
1754
|
}
|
|
1768
1755
|
};
|
|
1769
|
-
|
|
1770
|
-
const w = i.get(N), D = w.createObjectToPage(
|
|
1771
|
-
return D && w.setObjectActiveByPage(D,
|
|
1756
|
+
m.pageElements[c] = P, p.updatePage(m.id, m);
|
|
1757
|
+
const w = i.get(N), D = w.createObjectToPage(P, m.id, n);
|
|
1758
|
+
return D && w.setObjectActiveByPage(D, m.id, n), !0;
|
|
1772
1759
|
}
|
|
1773
1760
|
}, et = {
|
|
1774
1761
|
id: "slide.command.add-text",
|
|
1775
1762
|
type: V.COMMAND,
|
|
1776
1763
|
handler: async (i) => {
|
|
1777
1764
|
var r;
|
|
1778
|
-
const e = i.get(
|
|
1779
|
-
return await e.executeCommand(
|
|
1765
|
+
const e = i.get(B), n = (r = i.get(y).getFocusedUnit()) == null ? void 0 : r.getUnitId();
|
|
1766
|
+
return await e.executeCommand(Zt.id, { unitId: n });
|
|
1780
1767
|
}
|
|
1781
|
-
},
|
|
1768
|
+
}, Zt = {
|
|
1782
1769
|
id: "slide.operation.add-text",
|
|
1783
1770
|
type: V.OPERATION,
|
|
1784
1771
|
handler: async (i, e) => {
|
|
1785
1772
|
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);
|
|
1786
1773
|
if (!l) return !1;
|
|
1787
|
-
const d = l.getActivePage(),
|
|
1774
|
+
const d = l.getActivePage(), v = Object.values(d.pageElements), f = v != null && v.length ? Math.max(...v.map((_) => _.zIndex)) : 21, C = {
|
|
1788
1775
|
id: n,
|
|
1789
|
-
zIndex:
|
|
1776
|
+
zIndex: f + 1,
|
|
1790
1777
|
left: o,
|
|
1791
1778
|
top: a,
|
|
1792
1779
|
width: r,
|
|
1793
1780
|
height: s,
|
|
1794
1781
|
title: "text",
|
|
1795
1782
|
description: "",
|
|
1796
|
-
type:
|
|
1783
|
+
type: Ke.TEXT,
|
|
1797
1784
|
richText: {
|
|
1798
1785
|
text: c,
|
|
1799
1786
|
fs: 30,
|
|
@@ -1803,72 +1790,70 @@ const Zt = {
|
|
|
1803
1790
|
bl: 1
|
|
1804
1791
|
}
|
|
1805
1792
|
};
|
|
1806
|
-
d.pageElements[n] =
|
|
1807
|
-
const
|
|
1808
|
-
return
|
|
1793
|
+
d.pageElements[n] = C, l.updatePage(d.id, d);
|
|
1794
|
+
const p = i.get(N), m = p.createObjectToPage(C, d.id, t);
|
|
1795
|
+
return m && p.setObjectActiveByPage(m, d.id, t), !0;
|
|
1809
1796
|
}
|
|
1810
|
-
},
|
|
1797
|
+
}, qt = {
|
|
1811
1798
|
id: "slide.operation.set-slide-page-thumb",
|
|
1812
1799
|
type: V.OPERATION,
|
|
1813
1800
|
handler: (i, e) => (i.get(N).createThumbs(e.unitId), !0)
|
|
1814
|
-
},
|
|
1815
|
-
imagePopupMenu:
|
|
1816
|
-
imagePopupMenuItem:
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
var f, C;
|
|
1824
|
-
const e = (C = (f = i.popup) == null ? void 0 : f.extraProps) == null ? void 0 : C.menuItems;
|
|
1801
|
+
}, qi = "univer-image-popup-menu", Ji = "univer-image-popup-menu-item", Qi = "univer-image-popup-menu-item-title", er = "univer-btn-container", tr = "univer-btn-container-expand", ue = {
|
|
1802
|
+
imagePopupMenu: qi,
|
|
1803
|
+
imagePopupMenuItem: Ji,
|
|
1804
|
+
imagePopupMenuItemTitle: Qi,
|
|
1805
|
+
btnContainer: er,
|
|
1806
|
+
btnContainerExpand: tr
|
|
1807
|
+
}, nr = (i) => {
|
|
1808
|
+
var C, p;
|
|
1809
|
+
const e = (p = (C = i.popup) == null ? void 0 : C.extraProps) == null ? void 0 : p.menuItems;
|
|
1825
1810
|
if (!e)
|
|
1826
1811
|
return null;
|
|
1827
|
-
const t = x(
|
|
1812
|
+
const t = x(B), n = x(ee), [r, s] = G(!1), [o, a] = G(!1), c = () => {
|
|
1828
1813
|
a(!0);
|
|
1829
|
-
},
|
|
1814
|
+
}, h = () => {
|
|
1830
1815
|
a(!1);
|
|
1831
|
-
}, l = (
|
|
1832
|
-
s(
|
|
1833
|
-
}, d = (
|
|
1834
|
-
t.executeCommand(
|
|
1835
|
-
},
|
|
1836
|
-
return /* @__PURE__ */
|
|
1816
|
+
}, l = (m) => {
|
|
1817
|
+
s(m);
|
|
1818
|
+
}, d = (m) => {
|
|
1819
|
+
t.executeCommand(m.commandId, m.commandParams), s(!1);
|
|
1820
|
+
}, v = r || o, f = e.filter((m) => !m.disable);
|
|
1821
|
+
return /* @__PURE__ */ u(
|
|
1837
1822
|
"div",
|
|
1838
1823
|
{
|
|
1839
1824
|
onMouseEnter: c,
|
|
1840
|
-
onMouseLeave:
|
|
1841
|
-
children: /* @__PURE__ */
|
|
1842
|
-
|
|
1825
|
+
onMouseLeave: h,
|
|
1826
|
+
children: /* @__PURE__ */ u(
|
|
1827
|
+
Mt,
|
|
1843
1828
|
{
|
|
1844
1829
|
placement: "bottomLeft",
|
|
1845
1830
|
trigger: ["click"],
|
|
1846
|
-
overlay: /* @__PURE__ */
|
|
1831
|
+
overlay: /* @__PURE__ */ u("ul", { className: ue.imagePopupMenu, children: f.map((m) => /* @__PURE__ */ u(
|
|
1847
1832
|
"li",
|
|
1848
1833
|
{
|
|
1849
|
-
onClick: () => d(
|
|
1834
|
+
onClick: () => d(m),
|
|
1850
1835
|
className: ue.imagePopupMenuItem,
|
|
1851
|
-
children: /* @__PURE__ */
|
|
1836
|
+
children: /* @__PURE__ */ u("span", { className: ue.imagePopupMenuItemTitle, children: n.t(m.label) })
|
|
1852
1837
|
},
|
|
1853
|
-
|
|
1838
|
+
m.index
|
|
1854
1839
|
)) }),
|
|
1855
1840
|
visible: r,
|
|
1856
1841
|
onVisibleChange: l,
|
|
1857
1842
|
children: /* @__PURE__ */ R(
|
|
1858
1843
|
"div",
|
|
1859
1844
|
{
|
|
1860
|
-
className:
|
|
1845
|
+
className: M(ue.btnContainer, {
|
|
1861
1846
|
[ue.btnContainerExpand]: r
|
|
1862
1847
|
}),
|
|
1863
1848
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
|
|
1849
|
+
/* @__PURE__ */ u(
|
|
1850
|
+
jt,
|
|
1866
1851
|
{
|
|
1867
1852
|
style: { color: "#35322B" },
|
|
1868
1853
|
extend: { colorChannel1: "rgb(var(--green-700, #409f11))" }
|
|
1869
1854
|
}
|
|
1870
1855
|
),
|
|
1871
|
-
|
|
1856
|
+
v && /* @__PURE__ */ u(Ye, { style: { color: "#CCCCCC", fontSize: "8px", marginLeft: "8px" } })
|
|
1872
1857
|
]
|
|
1873
1858
|
}
|
|
1874
1859
|
)
|
|
@@ -1876,114 +1861,112 @@ const Zt = {
|
|
|
1876
1861
|
)
|
|
1877
1862
|
}
|
|
1878
1863
|
);
|
|
1879
|
-
},
|
|
1880
|
-
slideBar:
|
|
1881
|
-
slideBarContent:
|
|
1882
|
-
slideBarContentHeader:
|
|
1883
|
-
slideBarItem:
|
|
1884
|
-
slideBarBox:
|
|
1885
|
-
slideBarItemActive:
|
|
1886
|
-
slideAddButton: Ur
|
|
1864
|
+
}, ir = "univer-slide-bar", rr = "univer-slide-bar-content", sr = "univer-slide-bar-content-header", or = "univer-slide-bar-item", ar = "univer-slide-bar-box", cr = "univer-slide-bar-item-active", ie = {
|
|
1865
|
+
slideBar: ir,
|
|
1866
|
+
slideBarContent: rr,
|
|
1867
|
+
slideBarContentHeader: sr,
|
|
1868
|
+
slideBarItem: or,
|
|
1869
|
+
slideBarBox: ar,
|
|
1870
|
+
slideBarItemActive: cr
|
|
1887
1871
|
};
|
|
1888
|
-
function
|
|
1889
|
-
var
|
|
1890
|
-
const i = x(y), e = x(
|
|
1872
|
+
function lr() {
|
|
1873
|
+
var C, p;
|
|
1874
|
+
const i = x(y), e = x(B), t = x(Y), n = x(ee), r = Nt(null), s = i.getCurrentUnitForType(E.UNIVER_SLIDE), o = s == null ? void 0 : s.getPages(), a = s == null ? void 0 : s.getPageOrder();
|
|
1891
1875
|
if (!o || !a)
|
|
1892
1876
|
return null;
|
|
1893
|
-
const c = a.map((
|
|
1894
|
-
|
|
1895
|
-
const
|
|
1896
|
-
var
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1877
|
+
const c = a.map((m) => o[m]), [h, l] = G((p = (C = s == null ? void 0 : s.getActivePage()) == null ? void 0 : C.id) != null ? p : null), d = zn(() => c.map(() => wt.createRef()), [c]);
|
|
1878
|
+
me(() => {
|
|
1879
|
+
const m = s == null ? void 0 : s.activePage$.subscribe((_) => {
|
|
1880
|
+
var P;
|
|
1881
|
+
const b = (P = _ == null ? void 0 : _.id) != null ? P : null;
|
|
1882
|
+
b && l(b);
|
|
1899
1883
|
});
|
|
1900
1884
|
return () => {
|
|
1901
|
-
|
|
1885
|
+
m == null || m.unsubscribe();
|
|
1902
1886
|
};
|
|
1903
|
-
}, []),
|
|
1904
|
-
d.forEach((
|
|
1905
|
-
var
|
|
1906
|
-
if (
|
|
1907
|
-
const
|
|
1908
|
-
(
|
|
1887
|
+
}, []), me(() => {
|
|
1888
|
+
d.forEach((m, _) => {
|
|
1889
|
+
var b;
|
|
1890
|
+
if (m.current) {
|
|
1891
|
+
const P = c[_];
|
|
1892
|
+
(b = t.getRenderById(P.id)) == null || b.engine.setContainer(m.current);
|
|
1909
1893
|
}
|
|
1910
|
-
}), d.length > 0 && e.syncExecuteCommand(
|
|
1894
|
+
}), d.length > 0 && e.syncExecuteCommand(qt.id, { unitId: s == null ? void 0 : s.getUnitId() });
|
|
1911
1895
|
}, [d, c, t, e, s]);
|
|
1912
|
-
const
|
|
1913
|
-
e.syncExecuteCommand(
|
|
1914
|
-
}, [e, s]),
|
|
1915
|
-
e.syncExecuteCommand(
|
|
1896
|
+
const v = lt((m) => {
|
|
1897
|
+
e.syncExecuteCommand(Xt.id, { id: m, unitId: s == null ? void 0 : s.getUnitId() });
|
|
1898
|
+
}, [e, s]), f = lt(() => {
|
|
1899
|
+
e.syncExecuteCommand(Yt.id, { unitId: s == null ? void 0 : s.getUnitId() });
|
|
1916
1900
|
}, [e, s]);
|
|
1917
|
-
return /* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
c.map((
|
|
1901
|
+
return /* @__PURE__ */ u("aside", { className: ie.slideBar, ref: r, children: /* @__PURE__ */ u(Fn, { children: /* @__PURE__ */ R("div", { className: ie.slideBarContent, children: [
|
|
1902
|
+
/* @__PURE__ */ u("header", { className: ie.slideBarContentHeader, children: /* @__PURE__ */ u("a", { onClick: f, children: n.t("slide.append") }) }),
|
|
1903
|
+
c.map((m, _) => /* @__PURE__ */ R(
|
|
1920
1904
|
"div",
|
|
1921
1905
|
{
|
|
1922
|
-
className:
|
|
1923
|
-
[ie.slideBarItemActive]:
|
|
1906
|
+
className: M(ie.slideBarItem, {
|
|
1907
|
+
[ie.slideBarItemActive]: m.id === h
|
|
1924
1908
|
}),
|
|
1925
|
-
onClick: () =>
|
|
1909
|
+
onClick: () => v(m.id),
|
|
1926
1910
|
children: [
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ u("span", { children: _ + 1 }),
|
|
1912
|
+
/* @__PURE__ */ u("div", { ref: d[_], className: ie.slideBarBox })
|
|
1929
1913
|
]
|
|
1930
1914
|
},
|
|
1931
|
-
|
|
1915
|
+
m.id
|
|
1932
1916
|
))
|
|
1933
1917
|
] }) }) });
|
|
1934
1918
|
}
|
|
1935
|
-
const
|
|
1936
|
-
slideEditorContainer:
|
|
1937
|
-
|
|
1938
|
-
}, Ne = -1e3, vt = {
|
|
1919
|
+
const dr = "univer-slide-editor-container", ur = {
|
|
1920
|
+
slideEditorContainer: dr
|
|
1921
|
+
}, Ne = -1e3, ft = {
|
|
1939
1922
|
width: 0,
|
|
1940
1923
|
height: 0,
|
|
1941
1924
|
top: Ne,
|
|
1942
1925
|
left: Ne
|
|
1943
|
-
},
|
|
1944
|
-
const [i, e] =
|
|
1945
|
-
...
|
|
1946
|
-
}), t = x(Je), n = x(
|
|
1926
|
+
}, gr = () => {
|
|
1927
|
+
const [i, e] = G({
|
|
1928
|
+
...ft
|
|
1929
|
+
}), t = x(Je), n = x(Xe), r = x(Ce), s = Un(
|
|
1947
1930
|
() => r.subscribeContextValue$(ot),
|
|
1948
1931
|
!1,
|
|
1949
1932
|
void 0,
|
|
1950
1933
|
[r, ot]
|
|
1951
1934
|
);
|
|
1952
|
-
return
|
|
1935
|
+
return bn.UNSPECIFIED, me(() => {
|
|
1953
1936
|
t.state$.subscribe((o) => {
|
|
1954
1937
|
if (o == null)
|
|
1955
1938
|
return;
|
|
1956
1939
|
const {
|
|
1957
1940
|
startX: a = Ne,
|
|
1958
1941
|
startY: c = Ne,
|
|
1959
|
-
endX:
|
|
1942
|
+
endX: h = 0,
|
|
1960
1943
|
endY: l = 0,
|
|
1961
1944
|
show: d = !1
|
|
1962
1945
|
} = o;
|
|
1963
1946
|
if (!d)
|
|
1964
1947
|
e({
|
|
1965
|
-
...
|
|
1948
|
+
...ft
|
|
1966
1949
|
});
|
|
1967
1950
|
else {
|
|
1968
1951
|
e({
|
|
1969
|
-
width:
|
|
1952
|
+
width: h - a - se + 2,
|
|
1970
1953
|
height: l - c - se + 2,
|
|
1971
1954
|
left: a + se,
|
|
1972
1955
|
top: c + se
|
|
1973
1956
|
});
|
|
1974
|
-
const
|
|
1975
|
-
if (
|
|
1957
|
+
const v = n.getEditor(he);
|
|
1958
|
+
if (v == null)
|
|
1976
1959
|
return;
|
|
1977
|
-
const { left:
|
|
1978
|
-
t.setRect({ left:
|
|
1960
|
+
const { left: f, top: C, width: p, height: m } = v.getBoundingClientRect();
|
|
1961
|
+
t.setRect({ left: f, top: C, width: p, height: m });
|
|
1979
1962
|
}
|
|
1980
1963
|
});
|
|
1981
|
-
}, []),
|
|
1964
|
+
}, []), me(() => {
|
|
1982
1965
|
s || t.setFocus(!0);
|
|
1983
|
-
}, [s, i]), /* @__PURE__ */
|
|
1966
|
+
}, [s, i]), /* @__PURE__ */ u(
|
|
1984
1967
|
"div",
|
|
1985
1968
|
{
|
|
1986
|
-
className:
|
|
1969
|
+
className: ur.slideEditorContainer,
|
|
1987
1970
|
style: {
|
|
1988
1971
|
left: i.left,
|
|
1989
1972
|
top: i.top,
|
|
@@ -1992,93 +1975,93 @@ const jr = "univer-slide-editor-container", Br = "univer-editor-input", Lr = {
|
|
|
1992
1975
|
}
|
|
1993
1976
|
}
|
|
1994
1977
|
);
|
|
1995
|
-
},
|
|
1996
|
-
function
|
|
1978
|
+
}, Jt = "addition-and-subtraction-single", Qt = "slide.menu.image";
|
|
1979
|
+
function hr(i) {
|
|
1997
1980
|
return {
|
|
1998
|
-
id:
|
|
1999
|
-
type:
|
|
2000
|
-
icon:
|
|
1981
|
+
id: Qt,
|
|
1982
|
+
type: _e.SUBITEMS,
|
|
1983
|
+
icon: Jt,
|
|
2001
1984
|
tooltip: "slide.image.insert.title",
|
|
2002
|
-
hidden$:
|
|
1985
|
+
hidden$: fe(i, E.UNIVER_SLIDE)
|
|
2003
1986
|
};
|
|
2004
1987
|
}
|
|
2005
|
-
function
|
|
1988
|
+
function mr(i) {
|
|
2006
1989
|
return {
|
|
2007
1990
|
id: Qe.id,
|
|
2008
1991
|
title: "slide.image.insert.float",
|
|
2009
|
-
type:
|
|
2010
|
-
hidden$:
|
|
1992
|
+
type: _e.BUTTON,
|
|
1993
|
+
hidden$: fe(i, E.UNIVER_SLIDE)
|
|
2011
1994
|
};
|
|
2012
1995
|
}
|
|
2013
|
-
const
|
|
2014
|
-
function
|
|
1996
|
+
const en = "graph-single", tn = "slide.menu.shape";
|
|
1997
|
+
function vr(i) {
|
|
2015
1998
|
return {
|
|
2016
|
-
id:
|
|
2017
|
-
type:
|
|
2018
|
-
icon:
|
|
1999
|
+
id: tn,
|
|
2000
|
+
type: _e.SUBITEMS,
|
|
2001
|
+
icon: en,
|
|
2019
2002
|
tooltip: "slide.shape.insert.title",
|
|
2020
|
-
hidden$:
|
|
2003
|
+
hidden$: fe(i, E.UNIVER_SLIDE)
|
|
2021
2004
|
// disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] }),
|
|
2022
2005
|
};
|
|
2023
2006
|
}
|
|
2024
|
-
function
|
|
2007
|
+
function pr(i) {
|
|
2025
2008
|
return {
|
|
2026
|
-
id:
|
|
2009
|
+
id: Ze.id,
|
|
2027
2010
|
title: "slide.shape.insert.rectangle",
|
|
2028
|
-
type:
|
|
2029
|
-
hidden$:
|
|
2011
|
+
type: _e.BUTTON,
|
|
2012
|
+
hidden$: fe(i, E.UNIVER_SLIDE)
|
|
2030
2013
|
};
|
|
2031
2014
|
}
|
|
2032
|
-
const
|
|
2033
|
-
function
|
|
2015
|
+
const nn = "text-single";
|
|
2016
|
+
function Cr(i) {
|
|
2034
2017
|
return {
|
|
2035
2018
|
id: et.id,
|
|
2036
|
-
type:
|
|
2037
|
-
icon:
|
|
2019
|
+
type: _e.BUTTON,
|
|
2020
|
+
icon: nn,
|
|
2038
2021
|
tooltip: "slide.text.insert.title",
|
|
2039
|
-
hidden$:
|
|
2022
|
+
hidden$: fe(i, E.UNIVER_SLIDE)
|
|
2040
2023
|
};
|
|
2041
2024
|
}
|
|
2042
|
-
const
|
|
2025
|
+
const fr = {
|
|
2043
2026
|
[Vn.FORMAT]: {
|
|
2044
2027
|
[et.id]: {
|
|
2045
2028
|
order: 0,
|
|
2046
|
-
menuItemFactory:
|
|
2029
|
+
menuItemFactory: Cr
|
|
2047
2030
|
},
|
|
2048
|
-
[
|
|
2031
|
+
[Qt]: {
|
|
2049
2032
|
order: 0,
|
|
2050
|
-
menuItemFactory:
|
|
2033
|
+
menuItemFactory: hr,
|
|
2051
2034
|
[Qe.id]: {
|
|
2052
2035
|
order: 0,
|
|
2053
|
-
menuItemFactory:
|
|
2036
|
+
menuItemFactory: mr
|
|
2054
2037
|
}
|
|
2055
2038
|
},
|
|
2056
|
-
[
|
|
2039
|
+
[tn]: {
|
|
2057
2040
|
order: 0,
|
|
2058
|
-
menuItemFactory:
|
|
2059
|
-
[
|
|
2041
|
+
menuItemFactory: vr,
|
|
2042
|
+
[Ze.id]: {
|
|
2060
2043
|
order: 0,
|
|
2061
|
-
menuItemFactory:
|
|
2044
|
+
menuItemFactory: pr
|
|
2062
2045
|
}
|
|
2063
2046
|
}
|
|
2064
2047
|
}
|
|
2065
2048
|
};
|
|
2066
2049
|
function We(i) {
|
|
2067
|
-
return i.getContextValue(
|
|
2050
|
+
return i.getContextValue(Ot) && i.getContextValue(xe);
|
|
2068
2051
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return i.getContextValue(
|
|
2052
|
+
function _r(i) {
|
|
2053
|
+
return i.getContextValue(Pn) && i.getContextValue(Ot);
|
|
2071
2054
|
}
|
|
2072
|
-
const
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2055
|
+
const rn = [
|
|
2056
|
+
T.ARROW_DOWN,
|
|
2057
|
+
T.ARROW_UP,
|
|
2058
|
+
T.ARROW_LEFT,
|
|
2059
|
+
T.ARROW_RIGHT
|
|
2077
2060
|
];
|
|
2078
|
-
[
|
|
2079
|
-
function
|
|
2061
|
+
[T.ENTER, T.TAB, ...rn];
|
|
2062
|
+
function Sr() {
|
|
2080
2063
|
const i = [];
|
|
2081
|
-
for (const e of
|
|
2064
|
+
for (const e of rn)
|
|
2082
2065
|
i.push({
|
|
2083
2066
|
id: we.id,
|
|
2084
2067
|
binding: e,
|
|
@@ -2091,7 +2074,7 @@ function Xr() {
|
|
|
2091
2074
|
}
|
|
2092
2075
|
}), i.push({
|
|
2093
2076
|
id: we.id,
|
|
2094
|
-
binding: e |
|
|
2077
|
+
binding: e | Bn.SHIFT,
|
|
2095
2078
|
preconditions: (t) => We(t),
|
|
2096
2079
|
staticParameters: {
|
|
2097
2080
|
visible: !1,
|
|
@@ -2102,74 +2085,74 @@ function Xr() {
|
|
|
2102
2085
|
});
|
|
2103
2086
|
return i;
|
|
2104
2087
|
}
|
|
2105
|
-
const
|
|
2088
|
+
const Ir = {
|
|
2106
2089
|
id: qn.id,
|
|
2107
|
-
preconditions: (i) => We(i) ||
|
|
2108
|
-
binding:
|
|
2090
|
+
preconditions: (i) => We(i) || _r(i),
|
|
2091
|
+
binding: T.BACKSPACE
|
|
2109
2092
|
};
|
|
2110
|
-
var
|
|
2111
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2112
|
-
(o = i[s]) && (r =
|
|
2113
|
-
return
|
|
2093
|
+
var br = Object.getOwnPropertyDescriptor, Pr = (i, e, t, n) => {
|
|
2094
|
+
for (var r = n > 1 ? void 0 : n ? br(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2095
|
+
(o = i[s]) && (r = o(r) || r);
|
|
2096
|
+
return r;
|
|
2114
2097
|
}, re = (i, e) => (t, n) => e(t, n, i);
|
|
2115
2098
|
let De = class extends Ve {
|
|
2116
2099
|
constructor(i, e, t, n, r, s) {
|
|
2117
2100
|
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();
|
|
2118
2101
|
}
|
|
2119
2102
|
_initMenus() {
|
|
2120
|
-
this._menuManagerService.mergeMenu(
|
|
2103
|
+
this._menuManagerService.mergeMenu(fr);
|
|
2121
2104
|
}
|
|
2122
2105
|
_initCustomComponents() {
|
|
2123
2106
|
const i = this._componentManager;
|
|
2124
|
-
this.disposeWithMe(i.register(
|
|
2107
|
+
this.disposeWithMe(i.register(Jt, Bt)), this.disposeWithMe(i.register(nn, zt)), this.disposeWithMe(i.register(en, At)), this.disposeWithMe(i.register(Gt, nr)), this.disposeWithMe(i.register(Oe, Bi));
|
|
2125
2108
|
}
|
|
2126
2109
|
_initCommands() {
|
|
2127
2110
|
[
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
Jt,
|
|
2131
|
-
Qe,
|
|
2111
|
+
Yt,
|
|
2112
|
+
Xt,
|
|
2132
2113
|
qt,
|
|
2114
|
+
Qe,
|
|
2115
|
+
Zt,
|
|
2133
2116
|
et,
|
|
2134
|
-
|
|
2135
|
-
|
|
2117
|
+
Kt,
|
|
2118
|
+
Ze,
|
|
2136
2119
|
$e,
|
|
2137
|
-
|
|
2138
|
-
|
|
2120
|
+
Ut,
|
|
2121
|
+
k,
|
|
2139
2122
|
// commands for editor
|
|
2140
2123
|
we
|
|
2141
2124
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
2142
2125
|
}
|
|
2143
2126
|
_initUIComponents() {
|
|
2144
2127
|
this.disposeWithMe(
|
|
2145
|
-
this._uiPartsService.registerComponent(at.LEFT_SIDEBAR, () => ct(
|
|
2128
|
+
this._uiPartsService.registerComponent(at.LEFT_SIDEBAR, () => ct(lr, this._injector))
|
|
2146
2129
|
), this.disposeWithMe(
|
|
2147
|
-
this._uiPartsService.registerComponent(at.CONTENT, () => ct(
|
|
2130
|
+
this._uiPartsService.registerComponent(at.CONTENT, () => ct(gr, this._injector))
|
|
2148
2131
|
);
|
|
2149
2132
|
}
|
|
2150
2133
|
_initShortcuts() {
|
|
2151
2134
|
[
|
|
2152
|
-
|
|
2153
|
-
...
|
|
2135
|
+
Ir,
|
|
2136
|
+
...Sr()
|
|
2154
2137
|
].forEach((i) => {
|
|
2155
2138
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2156
2139
|
});
|
|
2157
2140
|
}
|
|
2158
2141
|
};
|
|
2159
|
-
De =
|
|
2160
|
-
re(0,
|
|
2161
|
-
re(1,
|
|
2162
|
-
re(2,
|
|
2142
|
+
De = Pr([
|
|
2143
|
+
re(0, X(ke)),
|
|
2144
|
+
re(1, jn),
|
|
2145
|
+
re(2, X(Ln)),
|
|
2163
2146
|
re(3, An),
|
|
2164
|
-
re(4,
|
|
2147
|
+
re(4, B),
|
|
2165
2148
|
re(5, $n)
|
|
2166
2149
|
], De);
|
|
2167
|
-
var
|
|
2168
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2169
|
-
(o = i[s]) && (r =
|
|
2170
|
-
return
|
|
2150
|
+
var Er = Object.getOwnPropertyDescriptor, Rr = (i, e, t, n) => {
|
|
2151
|
+
for (var r = n > 1 ? void 0 : n ? Er(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2152
|
+
(o = i[s]) && (r = o(r) || r);
|
|
2153
|
+
return r;
|
|
2171
2154
|
}, Ae = (i, e) => (t, n) => e(t, n, i);
|
|
2172
|
-
let Ue = class extends
|
|
2155
|
+
let Ue = class extends pe {
|
|
2173
2156
|
// private _skeletonChangeMutations = new Set<string>();
|
|
2174
2157
|
constructor(i, e, t) {
|
|
2175
2158
|
super(), this._contextService = i, this._instanceSrv = e, this._renderManagerService = t, Promise.resolve().then(() => this._init());
|
|
@@ -2194,41 +2177,41 @@ let Ue = class extends Ce {
|
|
|
2194
2177
|
_initContextListener() {
|
|
2195
2178
|
}
|
|
2196
2179
|
};
|
|
2197
|
-
Ue =
|
|
2198
|
-
Ae(0,
|
|
2180
|
+
Ue = Rr([
|
|
2181
|
+
Ae(0, Ce),
|
|
2199
2182
|
Ae(1, y),
|
|
2200
|
-
Ae(2,
|
|
2183
|
+
Ae(2, Y)
|
|
2201
2184
|
], Ue);
|
|
2202
|
-
var
|
|
2203
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2204
|
-
(o = i[s]) && (r =
|
|
2205
|
-
return
|
|
2185
|
+
var Or = Object.getOwnPropertyDescriptor, xr = (i, e, t, n) => {
|
|
2186
|
+
for (var r = n > 1 ? void 0 : n ? Or(e, t) : e, s = i.length - 1, o; s >= 0; s--)
|
|
2187
|
+
(o = i[s]) && (r = o(r) || r);
|
|
2188
|
+
return r;
|
|
2206
2189
|
}, Ee = (i, e) => (t, n) => e(t, n, i);
|
|
2207
|
-
const
|
|
2190
|
+
const yr = "SLIDE_UI";
|
|
2208
2191
|
var Re;
|
|
2209
2192
|
let _t = (Re = class extends En {
|
|
2210
|
-
constructor(i =
|
|
2193
|
+
constructor(i = mt, e, t, n, r) {
|
|
2211
2194
|
super(), this._config = i, this._injector = e, this._renderManagerService = t, this._univerInstanceService = n, this._configService = r;
|
|
2212
2195
|
const { menu: s, ...o } = Rn(
|
|
2213
2196
|
{},
|
|
2214
|
-
|
|
2197
|
+
mt,
|
|
2215
2198
|
this._config
|
|
2216
2199
|
);
|
|
2217
|
-
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(
|
|
2200
|
+
s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(oi, o);
|
|
2218
2201
|
}
|
|
2219
2202
|
onStarting() {
|
|
2220
2203
|
nt([
|
|
2221
2204
|
[Ue],
|
|
2222
2205
|
[qe, { useClass: He }],
|
|
2223
2206
|
// used by SlideUIController --> EditorContainer
|
|
2224
|
-
[Je, { useClass:
|
|
2225
|
-
[
|
|
2207
|
+
[Je, { useClass: Wi }],
|
|
2208
|
+
[Te]
|
|
2226
2209
|
], this._config.override).forEach((i) => this._injector.add(i));
|
|
2227
2210
|
}
|
|
2228
2211
|
onReady() {
|
|
2229
2212
|
[
|
|
2230
2213
|
// SlideRenderService will be init in ready stage, and then calling RenderManagerService@createRender --> init all deps in this rendering register block.
|
|
2231
|
-
[
|
|
2214
|
+
[ve]
|
|
2232
2215
|
].forEach((i) => {
|
|
2233
2216
|
this.disposeWithMe(this._renderManagerService.registerRenderModule(E.UNIVER_SLIDE, i));
|
|
2234
2217
|
}), nt([
|
|
@@ -2241,8 +2224,8 @@ let _t = (Re = class extends En {
|
|
|
2241
2224
|
// SlidesUIController controller would add a new RenderUnit (__INTERNAL_EDITOR__DOCS_NORMAL)
|
|
2242
2225
|
[De],
|
|
2243
2226
|
// editor service was create in renderManagerService
|
|
2244
|
-
[
|
|
2245
|
-
[
|
|
2227
|
+
[ve],
|
|
2228
|
+
[Me]
|
|
2246
2229
|
], this._config.override).forEach((i) => {
|
|
2247
2230
|
this._injector.add(i);
|
|
2248
2231
|
}), this._injector.get(N), this._injector.get(Ue);
|
|
@@ -2258,7 +2241,7 @@ let _t = (Re = class extends En {
|
|
|
2258
2241
|
}), this._markSlideAsFocused(), this._injector.get(De);
|
|
2259
2242
|
}
|
|
2260
2243
|
onSteady() {
|
|
2261
|
-
this._injector.get(
|
|
2244
|
+
this._injector.get(Me);
|
|
2262
2245
|
}
|
|
2263
2246
|
_markSlideAsFocused() {
|
|
2264
2247
|
const i = this._univerInstanceService;
|
|
@@ -2268,33 +2251,33 @@ let _t = (Re = class extends En {
|
|
|
2268
2251
|
} catch {
|
|
2269
2252
|
}
|
|
2270
2253
|
}
|
|
2271
|
-
}, I(Re, "pluginName",
|
|
2272
|
-
_t =
|
|
2273
|
-
Ee(1,
|
|
2274
|
-
Ee(2,
|
|
2254
|
+
}, I(Re, "pluginName", yr), I(Re, "type", E.UNIVER_SLIDE), Re);
|
|
2255
|
+
_t = xr([
|
|
2256
|
+
Ee(1, X(ke)),
|
|
2257
|
+
Ee(2, Y),
|
|
2275
2258
|
Ee(3, y),
|
|
2276
2259
|
Ee(4, On)
|
|
2277
2260
|
], _t);
|
|
2278
2261
|
export {
|
|
2279
|
-
|
|
2280
|
-
|
|
2262
|
+
Xt as ActivateSlidePageOperation,
|
|
2263
|
+
Yt as AppendSlideOperation,
|
|
2281
2264
|
N as CanvasView,
|
|
2282
|
-
|
|
2265
|
+
Ut as DeleteSlideElementOperation,
|
|
2283
2266
|
qe as ISlideEditorBridgeService,
|
|
2284
2267
|
Qe as InsertSlideFloatImageCommand,
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2268
|
+
Ze as InsertSlideShapeRectangleCommand,
|
|
2269
|
+
Kt as InsertSlideShapeRectangleOperation,
|
|
2270
|
+
tn as SHAPE_MENU_ID,
|
|
2271
|
+
Qt as SLIDES_IMAGE_MENU_ID,
|
|
2272
|
+
he as SLIDE_EDITOR_ID,
|
|
2273
|
+
qt as SetSlidePageThumbOperation,
|
|
2291
2274
|
et as SlideAddTextCommand,
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2275
|
+
Zt as SlideAddTextOperation,
|
|
2276
|
+
Te as SlideCanvasPopMangerService,
|
|
2277
|
+
gr as SlideEditorContainer,
|
|
2278
|
+
lr as SlideSideBar,
|
|
2296
2279
|
De as SlidesUIController,
|
|
2297
|
-
|
|
2280
|
+
fr as SlidesUIMenuSchema,
|
|
2298
2281
|
_t as UniverSlidesUIPlugin,
|
|
2299
|
-
|
|
2282
|
+
k as UpdateSlideElementOperation
|
|
2300
2283
|
};
|