@univerjs/docs-drawing-ui 0.6.0-nightly.202502141606 → 0.6.0-nightly.202502161605
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +486 -483
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ce = (i, e, n) =>
|
|
4
|
-
import { Disposable as Xe, UndoCommand as
|
|
5
|
-
import { IDocDrawingService as Be, UniverDocsDrawingPlugin as
|
|
6
|
-
import { IDrawingManagerService as Ie,
|
|
7
|
-
import { DrawingCommonPanel as
|
|
8
|
-
import { IRenderManagerService as ee, DocumentEditArea as
|
|
9
|
-
import { IMessageService as
|
|
1
|
+
var Dt = Object.defineProperty;
|
|
2
|
+
var Ot = (i, e, n) => e in i ? Dt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var Ce = (i, e, n) => Ot(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Disposable as Xe, UndoCommand as Pt, RedoCommand as Tt, IUniverInstanceService as Q, ICommandService as z, JSONX as q, PositionedObjectLayoutType as H, CommandType as K, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as be, TextX as vn, TextXActionType as Z, toDisposable as Le, throttle as On, COLORS as bt, MemoryCursor as yt, IUndoRedoService as Gn, BuildTextUtils as Mt, ArrangeTypeEnum as Ze, Inject as ve, LocaleService as ln, DrawingTypeEnum as Rt, WrapTextType as $e, FOCUSING_COMMON_DRAWINGS as tn, IContextService as Vn, UniverInstanceType as ye, Direction as fe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as Nt, RxDisposable as At, SHEET_EDITOR_UNITS as Et, LifecycleService as xt, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Lt, fromEventSubject as Bt, LifecycleStages as Pn, DependentOn as Ut, Injector as Ft, Plugin as kt, merge as Ht, IConfigService as Wt } from "@univerjs/core";
|
|
5
|
+
import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Gt } from "@univerjs/docs-drawing";
|
|
6
|
+
import { IDrawingManagerService as Ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as Tn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as jt, getImageSize as $t, getDrawingShapeKeyByDrawingSearch as zt, IImageIoService as qt, DRAWING_IMAGE_WIDTH_LIMIT as bn, DRAWING_IMAGE_HEIGHT_LIMIT as yn, UniverDrawingPlugin as Xt } from "@univerjs/drawing";
|
|
7
|
+
import { DrawingCommonPanel as Kt, ImageCropperObject as Yt, COMPONENT_IMAGE_POPUP_MENU as Zt, OpenImageCropOperation as Qt, ImageResetSizeOperation as Jt, UniverDrawingUIPlugin as ei } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as ee, DocumentEditArea as ke, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ni, Rect as ti, getColor as ii, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ri } from "@univerjs/engine-render";
|
|
9
|
+
import { IMessageService as oi, ILocalFileService as si, ISidebarService as ai, useDependency as we, MenuItemType as $n, getMenuHiddenObservable as zn, RibbonStartGroup as ci, KeyCode as He, ComponentManager as di, IMenuManagerService as li, IShortcutService as gi, UniverUIPlugin as mi } from "@univerjs/ui";
|
|
10
10
|
import { RichTextEditingMutation as J, DocSkeletonManagerService as se, DocSelectionManagerService as In } from "@univerjs/docs";
|
|
11
|
-
import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as An, getAnchorBounding as
|
|
12
|
-
import { BehaviorSubject as
|
|
13
|
-
import { MessageType as Ln, InputNumber as
|
|
11
|
+
import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as An, getAnchorBounding as ui, TEXT_RANGE_LAYER_INDEX as fi, getDocObject as hi, getCustomBlockIdsInSelections as pi, docDrawingPositionToTransform as wi, DocCanvasPopManagerService as vi, IEditorService as Ii, SetDocZoomRatioOperation as _i } from "@univerjs/docs-ui";
|
|
12
|
+
import { BehaviorSubject as Si, debounceTime as qn, Observable as Ci, takeUntil as En, filter as xn } from "rxjs";
|
|
13
|
+
import { MessageType as Ln, InputNumber as Fe, Select as Bn, Checkbox as Di, RadioGroup as Un, Radio as Te } from "@univerjs/design";
|
|
14
14
|
import { jsxs as X, jsx as f } from "react/jsx-runtime";
|
|
15
|
-
import { forwardRef as Xn, useRef as
|
|
16
|
-
const
|
|
17
|
-
var Ti = Object.getOwnPropertyDescriptor,
|
|
18
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
19
|
-
(s = i[o]) && (r = s(r) || r);
|
|
20
|
-
return r;
|
|
15
|
+
import { forwardRef as Xn, useRef as Oi, createElement as Kn, useState as re, useEffect as _n } from "react";
|
|
16
|
+
const Pi = "docs-drawing-ui.config", Fn = {};
|
|
17
|
+
var Ti = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, yi = (i, e, n, t) => {
|
|
18
|
+
for (var r = t > 1 ? void 0 : t ? bi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
19
|
+
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
20
|
+
return t && r && Ti(e, n, r), r;
|
|
21
21
|
}, Ve = (i, e) => (n, t) => e(n, t, i);
|
|
22
|
-
function
|
|
22
|
+
function Mi(i) {
|
|
23
23
|
var t, r, o, s;
|
|
24
24
|
if (q.isNoop(i) || !Array.isArray(i))
|
|
25
25
|
return null;
|
|
@@ -42,7 +42,7 @@ function yi(i) {
|
|
|
42
42
|
});
|
|
43
43
|
return n;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ri(i) {
|
|
46
46
|
if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
|
|
47
47
|
return [];
|
|
48
48
|
const e = [];
|
|
@@ -69,7 +69,7 @@ let rn = class extends Xe {
|
|
|
69
69
|
this._commandService.beforeCommandExecuted((i) => {
|
|
70
70
|
if (i.id !== J.id)
|
|
71
71
|
return;
|
|
72
|
-
const e = i.params, { unitId: n, actions: t } = e, r =
|
|
72
|
+
const e = i.params, { unitId: n, actions: t } = e, r = Mi(t);
|
|
73
73
|
if (r != null)
|
|
74
74
|
for (const { type: o, drawingId: s, drawing: c } of r)
|
|
75
75
|
o === "add" ? this._addDrawings(n, [c]) : this._removeDrawings(n, [s]);
|
|
@@ -79,12 +79,12 @@ let rn = class extends Xe {
|
|
|
79
79
|
if (i.id !== J.id)
|
|
80
80
|
return;
|
|
81
81
|
const e = i.params, { unitId: n, actions: t } = e;
|
|
82
|
-
|
|
82
|
+
Ri(t).length > 0 && this._updateDrawingsOrder(n);
|
|
83
83
|
})
|
|
84
84
|
), this.disposeWithMe(
|
|
85
85
|
this._commandService.onCommandExecuted((i) => {
|
|
86
86
|
var s;
|
|
87
|
-
if (i.id !==
|
|
87
|
+
if (i.id !== Pt.id && i.id !== Tt.id)
|
|
88
88
|
return;
|
|
89
89
|
const e = (s = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : s.getUnitId(), n = this._drawingManagerService.getFocusDrawings();
|
|
90
90
|
if (e == null || n.length === 0)
|
|
@@ -125,7 +125,7 @@ let rn = class extends Xe {
|
|
|
125
125
|
t.orderNotification(o), r.orderNotification(o);
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
rn =
|
|
128
|
+
rn = yi([
|
|
129
129
|
Ve(0, Q),
|
|
130
130
|
Ve(1, z),
|
|
131
131
|
Ve(2, Ie),
|
|
@@ -134,7 +134,7 @@ rn = Pi([
|
|
|
134
134
|
], rn);
|
|
135
135
|
class gn {
|
|
136
136
|
constructor() {
|
|
137
|
-
Ce(this, "_refreshDrawings$", new
|
|
137
|
+
Ce(this, "_refreshDrawings$", new Si(null));
|
|
138
138
|
Ce(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
|
|
139
139
|
}
|
|
140
140
|
refreshDrawings(e) {
|
|
@@ -142,7 +142,7 @@ class gn {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
var ue = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(ue || {});
|
|
145
|
-
const
|
|
145
|
+
const Ni = {
|
|
146
146
|
inline: H.INLINE,
|
|
147
147
|
wrapSquare: H.WRAP_SQUARE,
|
|
148
148
|
wrapTopAndBottom: H.WRAP_TOP_AND_BOTTOM,
|
|
@@ -151,12 +151,12 @@ const Mi = {
|
|
|
151
151
|
};
|
|
152
152
|
function Yn(i, e, n, t, r, o, s) {
|
|
153
153
|
var p, h;
|
|
154
|
-
const c = new vn(), d = q.getInstance(), a = [], l = o.getSelfOrHeaderFooterModel(e).getBody(),
|
|
155
|
-
if (l == null ||
|
|
154
|
+
const c = new vn(), d = q.getInstance(), a = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), u = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
155
|
+
if (l == null || u == null)
|
|
156
156
|
return;
|
|
157
157
|
const g = (h = (p = l.customBlocks) == null ? void 0 : p.find((v) => v.blockId === r)) == null ? void 0 : h.startIndex;
|
|
158
158
|
if (g != null) {
|
|
159
|
-
if (t = Math.min(
|
|
159
|
+
if (t = Math.min(u.dataStream.length - 2, t), i === e) {
|
|
160
160
|
if (t < g ? (t > 0 && c.push({
|
|
161
161
|
t: Z.RETAIN,
|
|
162
162
|
len: t
|
|
@@ -234,41 +234,41 @@ const Zn = {
|
|
|
234
234
|
var A, U;
|
|
235
235
|
if (e == null)
|
|
236
236
|
return !1;
|
|
237
|
-
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(Q), d = i.get(ee).getRenderById(r), a = d == null ? void 0 : d.with(se).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(se).getViewModel(),
|
|
238
|
-
if (g == null || a == null ||
|
|
237
|
+
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(Q), d = i.get(ee).getRenderById(r), a = d == null ? void 0 : d.with(se).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(se).getViewModel(), u = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
|
|
238
|
+
if (g == null || a == null || u == null || l == null)
|
|
239
239
|
return !1;
|
|
240
|
-
const p = l.getEditArea(), h =
|
|
240
|
+
const p = l.getEditArea(), h = u.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = a, O = q.getInstance(), D = [], { drawings: P = {} } = g.getSnapshot();
|
|
241
241
|
for (const N of n) {
|
|
242
|
-
const { drawingId: I } = N, L =
|
|
242
|
+
const { drawingId: I } = N, L = P[I].layoutType, W = Ni[t];
|
|
243
243
|
if (L !== W) {
|
|
244
244
|
const C = O.replaceOp(["drawings", I, "layoutType"], L, W);
|
|
245
245
|
D.push(C);
|
|
246
246
|
}
|
|
247
247
|
if (t === "behindText" || t === "inFrontOfText") {
|
|
248
|
-
const C =
|
|
248
|
+
const C = P[I].behindDoc, R = t === "behindText" ? oe.TRUE : oe.FALSE;
|
|
249
249
|
if (C !== R) {
|
|
250
|
-
const
|
|
251
|
-
D.push(
|
|
250
|
+
const T = O.replaceOp(["drawings", I, "behindDoc"], C, R);
|
|
251
|
+
D.push(T);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
if (t === "inline")
|
|
255
255
|
continue;
|
|
256
256
|
let x = null, G = 0, _ = 0;
|
|
257
257
|
for (const C of v) {
|
|
258
|
-
const { headerId: R, footerId:
|
|
258
|
+
const { headerId: R, footerId: T, marginTop: B, marginLeft: F, marginBottom: y, pageWidth: E, pageHeight: $ } = C;
|
|
259
259
|
switch (p) {
|
|
260
|
-
case
|
|
261
|
-
const
|
|
262
|
-
|
|
260
|
+
case ke.HEADER: {
|
|
261
|
+
const k = (A = w.get(R)) == null ? void 0 : A.get(E);
|
|
262
|
+
k != null && k.skeDrawings.has(I) && (x = k.skeDrawings.get(I), G = k.marginTop, _ = F);
|
|
263
263
|
break;
|
|
264
264
|
}
|
|
265
|
-
case
|
|
266
|
-
const
|
|
267
|
-
|
|
265
|
+
case ke.FOOTER: {
|
|
266
|
+
const k = (U = S.get(T)) == null ? void 0 : U.get(E);
|
|
267
|
+
k != null && k.skeDrawings.has(I) && (x = k.skeDrawings.get(I), G = $ - y + k.marginTop, _ = F);
|
|
268
268
|
break;
|
|
269
269
|
}
|
|
270
|
-
case
|
|
271
|
-
C.skeDrawings.has(I) && (x = C.skeDrawings.get(I), G = B, _ =
|
|
270
|
+
case ke.BODY: {
|
|
271
|
+
C.skeDrawings.has(I) && (x = C.skeDrawings.get(I), G = B, _ = F);
|
|
272
272
|
break;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
@@ -276,27 +276,27 @@ const Zn = {
|
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
278
|
if (x != null) {
|
|
279
|
-
const { aTop: C, aLeft: R } = x,
|
|
279
|
+
const { aTop: C, aLeft: R } = x, T = P[I].docTransform.positionH;
|
|
280
280
|
let B = R;
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
relativeFrom:
|
|
281
|
+
T.relativeFrom === ne.MARGIN ? B -= _ : T.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
|
|
282
|
+
const F = {
|
|
283
|
+
relativeFrom: T.relativeFrom,
|
|
284
284
|
posOffset: B
|
|
285
285
|
};
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
D.push(
|
|
286
|
+
if (T.posOffset !== F.posOffset) {
|
|
287
|
+
const k = O.replaceOp(["drawings", I, "docTransform", "positionH"], T, F);
|
|
288
|
+
D.push(k);
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const y = P[I].docTransform.positionV;
|
|
291
291
|
let E = C;
|
|
292
|
-
|
|
292
|
+
y.relativeFrom === V.PAGE ? E += G : y.relativeFrom === V.LINE ? E -= x.lineTop : y.relativeFrom === V.PARAGRAPH && (E -= x.blockAnchorTop);
|
|
293
293
|
const $ = {
|
|
294
|
-
relativeFrom:
|
|
294
|
+
relativeFrom: y.relativeFrom,
|
|
295
295
|
posOffset: E
|
|
296
296
|
};
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
D.push(
|
|
297
|
+
if (y.posOffset !== $.posOffset) {
|
|
298
|
+
const k = O.replaceOp(["drawings", I, "docTransform", "positionV"], y, $);
|
|
299
|
+
D.push(k);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
@@ -309,8 +309,8 @@ const Zn = {
|
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
M.params.actions = D.reduce((N, I) => q.compose(N, I), null);
|
|
312
|
-
const
|
|
313
|
-
return h.refreshControls(), !!
|
|
312
|
+
const b = o.syncExecuteCommand(M.id, M.params);
|
|
313
|
+
return h.refreshControls(), !!b;
|
|
314
314
|
}
|
|
315
315
|
}, Qn = {
|
|
316
316
|
id: "doc.command.update-doc-drawing-distance",
|
|
@@ -332,7 +332,7 @@ const Zn = {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
const
|
|
335
|
+
const u = {
|
|
336
336
|
id: J.id,
|
|
337
337
|
params: {
|
|
338
338
|
unitId: c,
|
|
@@ -340,7 +340,7 @@ const Zn = {
|
|
|
340
340
|
textRanges: null
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
-
return
|
|
343
|
+
return u.params.actions = a.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(u.id, u.params);
|
|
344
344
|
}
|
|
345
345
|
}, Jn = {
|
|
346
346
|
id: "doc.command.update-doc-drawing-wrap-text",
|
|
@@ -359,7 +359,7 @@ const Zn = {
|
|
|
359
359
|
a.push(w);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const u = {
|
|
363
363
|
id: J.id,
|
|
364
364
|
params: {
|
|
365
365
|
unitId: c,
|
|
@@ -367,7 +367,7 @@ const Zn = {
|
|
|
367
367
|
textRanges: null
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
|
-
return
|
|
370
|
+
return u.params.actions = a.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(u.id, u.params);
|
|
371
371
|
}
|
|
372
372
|
}, qe = {
|
|
373
373
|
id: "doc.command.update-drawing-doc-transform",
|
|
@@ -381,11 +381,11 @@ const Zn = {
|
|
|
381
381
|
const c = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
|
|
382
382
|
if (d == null)
|
|
383
383
|
return !1;
|
|
384
|
-
const { drawings: a, unitId: l } = e,
|
|
384
|
+
const { drawings: a, unitId: l } = e, u = q.getInstance(), g = [], { drawings: p = {} } = d.getSnapshot();
|
|
385
385
|
for (const w of a) {
|
|
386
|
-
const { drawingId: S, key: O, value: D } = w,
|
|
387
|
-
if (!
|
|
388
|
-
const M =
|
|
386
|
+
const { drawingId: S, key: O, value: D } = w, P = p[S].docTransform[O];
|
|
387
|
+
if (!be.diffValue(P, D)) {
|
|
388
|
+
const M = u.replaceOp(["drawings", S, "docTransform", O], P, D);
|
|
389
389
|
g.push(M);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
@@ -412,25 +412,25 @@ const Zn = {
|
|
|
412
412
|
const n = i.get(ee), t = (U = n.getRenderById(e.unitId)) == null ? void 0 : U.with(Me), r = i.get(gn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, c = o == null ? void 0 : o.with(se).getSkeleton();
|
|
413
413
|
if (s == null || t == null)
|
|
414
414
|
return !1;
|
|
415
|
-
const d = s.getTransformerByCreate(), a = i.get(z),
|
|
416
|
-
if (
|
|
415
|
+
const d = s.getTransformerByCreate(), a = i.get(z), u = i.get(Q).getCurrentUniverDocInstance();
|
|
416
|
+
if (u == null)
|
|
417
417
|
return !1;
|
|
418
418
|
const { drawing: g, unitId: p, offset: h, segmentId: v, segmentPage: w, needRefreshDrawings: S } = e;
|
|
419
419
|
if (S)
|
|
420
420
|
return r.refreshDrawings(c), d.refreshControls(), !0;
|
|
421
|
-
const O = [], { drawingId: D } = g,
|
|
421
|
+
const O = [], { drawingId: D } = g, P = (N = t.getSegment()) != null ? N : "", M = Yn(
|
|
422
422
|
v,
|
|
423
|
-
|
|
423
|
+
P,
|
|
424
424
|
w,
|
|
425
425
|
h,
|
|
426
426
|
D,
|
|
427
|
-
|
|
427
|
+
u,
|
|
428
428
|
t
|
|
429
429
|
);
|
|
430
430
|
if (M == null || M.length === 0)
|
|
431
431
|
return r.refreshDrawings(c), d.refreshControls(), !1;
|
|
432
432
|
O.push(...M);
|
|
433
|
-
const
|
|
433
|
+
const b = {
|
|
434
434
|
id: J.id,
|
|
435
435
|
params: {
|
|
436
436
|
unitId: p,
|
|
@@ -438,8 +438,8 @@ const Zn = {
|
|
|
438
438
|
textRanges: null
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
|
-
|
|
442
|
-
const A = a.syncExecuteCommand(
|
|
441
|
+
b.params.actions = O.reduce((I, L) => q.compose(I, L), null);
|
|
442
|
+
const A = a.syncExecuteCommand(b.id, b.params);
|
|
443
443
|
return d.refreshControls(), !!A;
|
|
444
444
|
}
|
|
445
445
|
}, nt = {
|
|
@@ -456,7 +456,7 @@ const Zn = {
|
|
|
456
456
|
const s = o.getTransformerByCreate(), c = i.get(z), a = i.get(Q).getCurrentUniverDocInstance();
|
|
457
457
|
if (a == null)
|
|
458
458
|
return !1;
|
|
459
|
-
const { drawing: l, unitId:
|
|
459
|
+
const { drawing: l, unitId: u, offset: g, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (G = t.getSegment()) != null ? G : "", D = Yn(
|
|
460
460
|
h,
|
|
461
461
|
O,
|
|
462
462
|
v,
|
|
@@ -468,27 +468,27 @@ const Zn = {
|
|
|
468
468
|
if (D == null)
|
|
469
469
|
return !1;
|
|
470
470
|
D.length > 0 && w.push(...D);
|
|
471
|
-
const
|
|
472
|
-
if (!
|
|
473
|
-
const _ =
|
|
471
|
+
const P = q.getInstance(), { drawings: M = {} } = a.getSnapshot(), b = M[S].docTransform, { positionH: A, positionV: U, size: N, angle: I } = b;
|
|
472
|
+
if (!be.diffValue(A, p.positionH)) {
|
|
473
|
+
const _ = P.replaceOp(["drawings", S, "docTransform", "positionH"], A, p.positionH);
|
|
474
474
|
w.push(_);
|
|
475
475
|
}
|
|
476
|
-
if (!
|
|
477
|
-
const _ =
|
|
476
|
+
if (!be.diffValue(U, p.positionV)) {
|
|
477
|
+
const _ = P.replaceOp(["drawings", S, "docTransform", "positionV"], U, p.positionV);
|
|
478
478
|
w.push(_);
|
|
479
479
|
}
|
|
480
|
-
if (!
|
|
481
|
-
const _ =
|
|
480
|
+
if (!be.diffValue(N, p.size)) {
|
|
481
|
+
const _ = P.replaceOp(["drawings", S, "docTransform", "size"], N, p.size);
|
|
482
482
|
w.push(_);
|
|
483
483
|
}
|
|
484
|
-
if (!
|
|
485
|
-
const _ =
|
|
484
|
+
if (!be.diffValue(I, p.angle)) {
|
|
485
|
+
const _ = P.replaceOp(["drawings", S, "docTransform", "angle"], I, p.angle);
|
|
486
486
|
w.push(_);
|
|
487
487
|
}
|
|
488
488
|
const L = {
|
|
489
489
|
id: J.id,
|
|
490
490
|
params: {
|
|
491
|
-
unitId:
|
|
491
|
+
unitId: u,
|
|
492
492
|
actions: [],
|
|
493
493
|
textRanges: null,
|
|
494
494
|
debounce: !0
|
|
@@ -499,13 +499,13 @@ const Zn = {
|
|
|
499
499
|
return s.refreshControls(), !!W;
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
|
-
var
|
|
503
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
504
|
-
(s = i[o]) && (r = s(r) || r);
|
|
505
|
-
return r;
|
|
502
|
+
var Ai = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, xi = (i, e, n, t) => {
|
|
503
|
+
for (var r = t > 1 ? void 0 : t ? Ei(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
504
|
+
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
505
|
+
return t && r && Ai(e, n, r), r;
|
|
506
506
|
}, Qe = (i, e) => (n, t) => e(n, t, i);
|
|
507
|
-
const
|
|
508
|
-
function
|
|
507
|
+
const Li = "__InlineDrawingAnchor__";
|
|
508
|
+
function kn(i) {
|
|
509
509
|
const { path: e } = i;
|
|
510
510
|
return e.some((n) => n === "cells");
|
|
511
511
|
}
|
|
@@ -547,7 +547,7 @@ let on = class extends Xe {
|
|
|
547
547
|
this._transformerCache.clear();
|
|
548
548
|
const { objects: s } = o;
|
|
549
549
|
for (const d of s.values()) {
|
|
550
|
-
const { oKey: a, width: l, height:
|
|
550
|
+
const { oKey: a, width: l, height: u, left: g, top: p, angle: h } = d, v = this._drawingManagerService.getDrawingOKey(a);
|
|
551
551
|
if (v == null)
|
|
552
552
|
continue;
|
|
553
553
|
const w = this._univerInstanceService.getUniverDocInstance(v.unitId), S = (c = w == null ? void 0 : w.getSnapshot().drawings) == null ? void 0 : c[v.drawingId];
|
|
@@ -556,7 +556,7 @@ let on = class extends Xe {
|
|
|
556
556
|
top: p,
|
|
557
557
|
left: g,
|
|
558
558
|
width: l,
|
|
559
|
-
height:
|
|
559
|
+
height: u,
|
|
560
560
|
angle: h
|
|
561
561
|
});
|
|
562
562
|
}
|
|
@@ -571,8 +571,8 @@ let on = class extends Xe {
|
|
|
571
571
|
if (s.size > 1)
|
|
572
572
|
t(s);
|
|
573
573
|
else if (s.size === 1) {
|
|
574
|
-
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width:
|
|
575
|
-
if (a &&
|
|
574
|
+
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: u, height: g, top: p, left: h, angle: v } = l;
|
|
575
|
+
if (a && u === a.width && g === a.height && p === a.top && h === a.left && v === a.angle)
|
|
576
576
|
return;
|
|
577
577
|
a && (a.drawing.layoutType, H.INLINE), a && a.drawing.layoutType === H.INLINE && c != null && d != null && this._updateInlineDrawingAnchor(a.drawing, c, d);
|
|
578
578
|
}
|
|
@@ -587,16 +587,16 @@ let on = class extends Xe {
|
|
|
587
587
|
const l = this._drawingManagerService.getDrawingOKey(a.oKey);
|
|
588
588
|
if (l == null)
|
|
589
589
|
continue;
|
|
590
|
-
const
|
|
591
|
-
(
|
|
590
|
+
const u = this._transformerCache.get(l == null ? void 0 : l.drawingId);
|
|
591
|
+
(u == null ? void 0 : u.drawing.layoutType) === H.INLINE && a.setOpacity(1);
|
|
592
592
|
}
|
|
593
593
|
if (this._anchorShape && this._anchorShape.hide(), s.size > 1)
|
|
594
594
|
this._updateMultipleDrawingDocTransform(s);
|
|
595
595
|
else if (s.size === 1) {
|
|
596
|
-
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width:
|
|
597
|
-
if (a &&
|
|
596
|
+
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: u, height: g, top: p, left: h, angle: v } = l;
|
|
597
|
+
if (a && u === a.width && g === a.height && p === a.top && h === a.left && v === a.angle)
|
|
598
598
|
return;
|
|
599
|
-
a && a.drawing.layoutType === H.INLINE ?
|
|
599
|
+
a && a.drawing.layoutType === H.INLINE ? u !== a.width || g !== a.height || v !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
|
|
600
600
|
}
|
|
601
601
|
this._transformerCache.clear();
|
|
602
602
|
})
|
|
@@ -611,7 +611,7 @@ let on = class extends Xe {
|
|
|
611
611
|
let t, r;
|
|
612
612
|
for (const o of e.values()) {
|
|
613
613
|
const { oKey: s, left: c, top: d, angle: a } = o;
|
|
614
|
-
let { width: l, height:
|
|
614
|
+
let { width: l, height: u } = o;
|
|
615
615
|
const g = this._drawingManagerService.getDrawingOKey(s);
|
|
616
616
|
if (g == null)
|
|
617
617
|
continue;
|
|
@@ -619,26 +619,26 @@ let on = class extends Xe {
|
|
|
619
619
|
const p = this._transformerCache.get(g.drawingId);
|
|
620
620
|
if (p == null)
|
|
621
621
|
continue;
|
|
622
|
-
const { drawing: h, top: v, left: w, width: S, height: O, angle: D } = p, { width:
|
|
623
|
-
if (l = Math.min(l,
|
|
622
|
+
const { drawing: h, top: v, left: w, width: S, height: O, angle: D } = p, { width: P, height: M } = this._getPageContentSize(h);
|
|
623
|
+
if (l = Math.min(l, P), u = Math.min(u, M), (S !== l || O !== u) && n.push({
|
|
624
624
|
drawingId: g.drawingId,
|
|
625
625
|
key: "size",
|
|
626
626
|
value: {
|
|
627
627
|
width: l,
|
|
628
|
-
height:
|
|
628
|
+
height: u
|
|
629
629
|
}
|
|
630
630
|
}), D !== a && n.push({
|
|
631
631
|
drawingId: g.drawingId,
|
|
632
632
|
key: "angle",
|
|
633
633
|
value: a
|
|
634
634
|
}), v !== d || w !== c) {
|
|
635
|
-
const
|
|
636
|
-
|
|
635
|
+
const b = d - v, A = c - w;
|
|
636
|
+
b !== 0 && n.push({
|
|
637
637
|
drawingId: g.drawingId,
|
|
638
638
|
key: "positionV",
|
|
639
639
|
value: {
|
|
640
640
|
relativeFrom: h.docTransform.positionV.relativeFrom,
|
|
641
|
-
posOffset: h.docTransform.positionV.posOffset +
|
|
641
|
+
posOffset: h.docTransform.positionV.posOffset + b
|
|
642
642
|
}
|
|
643
643
|
}), A !== 0 && n.push({
|
|
644
644
|
drawingId: g.drawingId,
|
|
@@ -677,7 +677,7 @@ let on = class extends Xe {
|
|
|
677
677
|
return;
|
|
678
678
|
const { mainComponent: s, scene: c } = r, d = s, a = c.getViewports()[0], {
|
|
679
679
|
pageLayoutType: l = Mn.VERTICAL,
|
|
680
|
-
pageMarginLeft:
|
|
680
|
+
pageMarginLeft: u,
|
|
681
681
|
pageMarginTop: g
|
|
682
682
|
} = d.getOffsetConfig();
|
|
683
683
|
let p = null, h = !1, v = -1, w = "";
|
|
@@ -687,10 +687,10 @@ let on = class extends Xe {
|
|
|
687
687
|
const D = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(Me);
|
|
688
688
|
if (D == null)
|
|
689
689
|
return;
|
|
690
|
-
const
|
|
690
|
+
const P = o == null ? void 0 : o.findNodeByCoord(
|
|
691
691
|
O,
|
|
692
692
|
l,
|
|
693
|
-
|
|
693
|
+
u,
|
|
694
694
|
g,
|
|
695
695
|
{
|
|
696
696
|
strict: !1,
|
|
@@ -698,65 +698,65 @@ let on = class extends Xe {
|
|
|
698
698
|
segmentPage: D.getSegmentPage()
|
|
699
699
|
}
|
|
700
700
|
);
|
|
701
|
-
if (
|
|
702
|
-
const { node: _, ratioX: C, segmentPage: R, segmentId:
|
|
703
|
-
h = C < S, p = _, v = R, w =
|
|
701
|
+
if (P) {
|
|
702
|
+
const { node: _, ratioX: C, segmentPage: R, segmentId: T } = P;
|
|
703
|
+
h = C < S, p = _, v = R, w = T;
|
|
704
704
|
}
|
|
705
705
|
if (p == null)
|
|
706
706
|
return;
|
|
707
|
-
const M = o == null ? void 0 : o.findPositionByGlyph(p, v),
|
|
708
|
-
if (M == null || o == null ||
|
|
707
|
+
const M = o == null ? void 0 : o.findPositionByGlyph(p, v), b = this._getDocObject();
|
|
708
|
+
if (M == null || o == null || b == null || kn(M))
|
|
709
709
|
return;
|
|
710
710
|
const A = {
|
|
711
711
|
...M,
|
|
712
712
|
isBack: h
|
|
713
|
-
}, U =
|
|
713
|
+
}, U = b.document.getOffsetConfig(), N = new Nn(U, o), { cursorList: I, contentBoxPointGroup: L } = N.getRangePointData(A, A), { startOffset: W } = (G = An(I)) != null ? G : {};
|
|
714
714
|
if (W != null)
|
|
715
715
|
return { offset: W, contentBoxPointGroup: L, segmentId: w, segmentPage: v };
|
|
716
716
|
}
|
|
717
717
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
718
718
|
_getDrawingAnchor(e, n) {
|
|
719
|
-
var _e, Se, de, De, Oe, Ne, Ae,
|
|
719
|
+
var _e, Se, de, De, Oe, Ne, Ae, Pe, le, ge, Ee;
|
|
720
720
|
const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(se).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
|
|
721
721
|
if (o == null || t == null)
|
|
722
722
|
return;
|
|
723
|
-
const { pages: s, skeHeaders: c, skeFooters: d } = o, { mainComponent: a, scene: l } = t,
|
|
724
|
-
let { width: M, height:
|
|
723
|
+
const { pages: s, skeHeaders: c, skeFooters: d } = o, { mainComponent: a, scene: l } = t, u = a, g = l.getViewports()[0], { pageLayoutType: p = Mn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = u.getOffsetConfig(), { left: O, top: D, angle: P } = n;
|
|
724
|
+
let { width: M, height: b } = n;
|
|
725
725
|
const { positionV: A, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
|
|
726
|
-
M = Math.min(M, N),
|
|
726
|
+
M = Math.min(M, N), b = Math.min(b, I);
|
|
727
727
|
let L = null, W = "", x = -1;
|
|
728
728
|
const G = !1, _ = {
|
|
729
729
|
...e.docTransform,
|
|
730
730
|
size: {
|
|
731
731
|
width: M,
|
|
732
|
-
height:
|
|
732
|
+
height: b
|
|
733
733
|
},
|
|
734
|
-
angle:
|
|
735
|
-
}, { x: C, y: R } = l.getViewportScrollXY(g),
|
|
736
|
-
if (
|
|
734
|
+
angle: P
|
|
735
|
+
}, { x: C, y: R } = l.getViewportScrollXY(g), T = this._getTransformCoordForDocumentOffset(u, g, O - C, D - R);
|
|
736
|
+
if (T == null)
|
|
737
737
|
return;
|
|
738
738
|
const B = (_e = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : _e.with(Me);
|
|
739
739
|
if (B == null)
|
|
740
740
|
return;
|
|
741
|
-
const
|
|
741
|
+
const F = r == null ? void 0 : r.findNodeByCoord(T, p, h, v, {
|
|
742
742
|
strict: !1,
|
|
743
743
|
segmentId: B.getSegment(),
|
|
744
744
|
segmentPage: B.getSegmentPage()
|
|
745
745
|
});
|
|
746
|
-
if (
|
|
747
|
-
const { node: pe, segmentPage: mn, segmentId: un } =
|
|
746
|
+
if (F) {
|
|
747
|
+
const { node: pe, segmentPage: mn, segmentId: un } = F;
|
|
748
748
|
L = pe, x = mn, W = un;
|
|
749
749
|
}
|
|
750
750
|
if (L == null)
|
|
751
751
|
return;
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
752
|
+
const y = (Se = L.parent) == null ? void 0 : Se.parent, E = y == null ? void 0 : y.parent, $ = (de = E == null ? void 0 : E.lines.find((pe) => pe.paragraphIndex === (y == null ? void 0 : y.paragraphIndex) && pe.paragraphStart)) != null ? de : E == null ? void 0 : E.lines[0], k = (De = E == null ? void 0 : E.parent) == null ? void 0 : De.parent;
|
|
753
|
+
if (y == null || E == null || $ == null || k == null)
|
|
754
754
|
return;
|
|
755
755
|
this._liquid.reset();
|
|
756
|
-
const Y =
|
|
756
|
+
const Y = k.type;
|
|
757
757
|
for (const pe of s) {
|
|
758
|
-
const { headerId: mn, footerId: un, pageHeight:
|
|
759
|
-
if (x > -1 &&
|
|
758
|
+
const { headerId: mn, footerId: un, pageHeight: _t, pageWidth: Cn, marginLeft: Dn, marginBottom: St } = pe, Ct = s.indexOf(pe);
|
|
759
|
+
if (x > -1 && Ct === x) {
|
|
760
760
|
switch (Y) {
|
|
761
761
|
case Rn.HEADER: {
|
|
762
762
|
const Ge = (Oe = c.get(mn)) == null ? void 0 : Oe.get(Cn);
|
|
@@ -773,7 +773,7 @@ let on = class extends Xe {
|
|
|
773
773
|
const Ge = (Ne = d.get(un)) == null ? void 0 : Ne.get(Cn);
|
|
774
774
|
if (Ge)
|
|
775
775
|
this._liquid.translatePagePadding({
|
|
776
|
-
marginTop:
|
|
776
|
+
marginTop: _t - St + Ge.marginTop,
|
|
777
777
|
marginLeft: Dn
|
|
778
778
|
});
|
|
779
779
|
else
|
|
@@ -783,16 +783,16 @@ let on = class extends Xe {
|
|
|
783
783
|
}
|
|
784
784
|
break;
|
|
785
785
|
}
|
|
786
|
-
if (this._liquid.translatePagePadding(pe), pe ===
|
|
786
|
+
if (this._liquid.translatePagePadding(pe), pe === k)
|
|
787
787
|
break;
|
|
788
788
|
this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, p, h, v);
|
|
789
789
|
}
|
|
790
|
-
switch (A.relativeFrom === V.LINE ? L =
|
|
790
|
+
switch (A.relativeFrom === V.LINE ? L = y.divides[0].glyphGroup[0] : L = (ge = (le = (Pe = (Ae = $.divides) == null ? void 0 : Ae[0]) == null ? void 0 : Pe.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, _.positionH = {
|
|
791
791
|
relativeFrom: U.relativeFrom,
|
|
792
792
|
posOffset: O - this._liquid.x - w
|
|
793
793
|
}, U.relativeFrom) {
|
|
794
794
|
case ne.MARGIN: {
|
|
795
|
-
_.positionH.posOffset = O - this._liquid.x - w -
|
|
795
|
+
_.positionH.posOffset = O - this._liquid.x - w - k.marginLeft;
|
|
796
796
|
break;
|
|
797
797
|
}
|
|
798
798
|
case ne.COLUMN: {
|
|
@@ -805,11 +805,11 @@ let on = class extends Xe {
|
|
|
805
805
|
posOffset: D - this._liquid.y - S
|
|
806
806
|
}, A.relativeFrom) {
|
|
807
807
|
case V.PAGE: {
|
|
808
|
-
_.positionV.posOffset = D - this._liquid.y - S -
|
|
808
|
+
_.positionV.posOffset = D - this._liquid.y - S - k.marginTop;
|
|
809
809
|
break;
|
|
810
810
|
}
|
|
811
811
|
case V.LINE: {
|
|
812
|
-
_.positionV.posOffset = D - this._liquid.y - S -
|
|
812
|
+
_.positionV.posOffset = D - this._liquid.y - S - y.top;
|
|
813
813
|
break;
|
|
814
814
|
}
|
|
815
815
|
case V.PARAGRAPH: {
|
|
@@ -820,7 +820,7 @@ let on = class extends Xe {
|
|
|
820
820
|
if (L == null)
|
|
821
821
|
return;
|
|
822
822
|
const ae = r == null ? void 0 : r.findPositionByGlyph(L, x), Ue = this._getDocObject();
|
|
823
|
-
if (ae == null || r == null || Ue == null ||
|
|
823
|
+
if (ae == null || r == null || Ue == null || kn(ae))
|
|
824
824
|
return;
|
|
825
825
|
const Re = {
|
|
826
826
|
...ae,
|
|
@@ -832,14 +832,14 @@ let on = class extends Xe {
|
|
|
832
832
|
// Update drawing when use transformer to resize it.
|
|
833
833
|
_updateDrawingSize(e, n) {
|
|
834
834
|
const t = [], { drawing: r, width: o, height: s, angle: c } = e, { unitId: d, subUnitId: a } = r;
|
|
835
|
-
let { width: l, height:
|
|
835
|
+
let { width: l, height: u, angle: g } = n;
|
|
836
836
|
const { width: p, height: h } = this._getPageContentSize(r);
|
|
837
|
-
l = Math.min(p, l),
|
|
837
|
+
l = Math.min(p, l), u = Math.min(h, u), (l !== o || u !== s) && t.push({
|
|
838
838
|
drawingId: r.drawingId,
|
|
839
839
|
key: "size",
|
|
840
840
|
value: {
|
|
841
841
|
width: l,
|
|
842
|
-
height:
|
|
842
|
+
height: u
|
|
843
843
|
}
|
|
844
844
|
}), g !== c && t.push({
|
|
845
845
|
drawingId: r.drawingId,
|
|
@@ -867,8 +867,8 @@ let on = class extends Xe {
|
|
|
867
867
|
// Limit the drawing to the page area, mainly in the vertical direction,
|
|
868
868
|
// and the upper and lower limits cannot exceed the page margin area.
|
|
869
869
|
_limitDrawingInPage(e, n) {
|
|
870
|
-
const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: c, angle: d } = n, a = t == null ? void 0 : t.with(se).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages:
|
|
871
|
-
if (l == null || t == null ||
|
|
870
|
+
const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: c, angle: d } = n, a = t == null ? void 0 : t.with(se).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages: u } = l != null ? l : {};
|
|
871
|
+
if (l == null || t == null || u == null)
|
|
872
872
|
return {
|
|
873
873
|
left: r,
|
|
874
874
|
top: o,
|
|
@@ -879,18 +879,18 @@ let on = class extends Xe {
|
|
|
879
879
|
const { mainComponent: g } = t, p = g, { top: h, pageLayoutType: v, pageMarginLeft: w, pageMarginTop: S } = p;
|
|
880
880
|
let O = o;
|
|
881
881
|
this._liquid.reset();
|
|
882
|
-
for (const D of
|
|
883
|
-
const { marginBottom:
|
|
882
|
+
for (const D of u) {
|
|
883
|
+
const { marginBottom: P, pageHeight: M } = D, b = u.indexOf(D), A = u[b + 1];
|
|
884
884
|
if (A == null)
|
|
885
885
|
continue;
|
|
886
|
-
if (
|
|
886
|
+
if (be.hasIntersectionBetweenTwoRanges(
|
|
887
887
|
o,
|
|
888
888
|
o + c,
|
|
889
|
-
this._liquid.y + h + M -
|
|
889
|
+
this._liquid.y + h + M - P,
|
|
890
890
|
this._liquid.y + h + M + S + A.marginTop
|
|
891
891
|
)) {
|
|
892
892
|
const N = o + c / 2, I = this._liquid.y + h + M + S / 2;
|
|
893
|
-
N < I ? O = Math.min(o, this._liquid.y + h + M -
|
|
893
|
+
N < I ? O = Math.min(o, this._liquid.y + h + M - P - c) : O = Math.max(o, this._liquid.y + h + M + S + A.marginTop);
|
|
894
894
|
}
|
|
895
895
|
this._liquid.translatePage(D, v, w, S);
|
|
896
896
|
}
|
|
@@ -927,7 +927,7 @@ let on = class extends Xe {
|
|
|
927
927
|
return { scene: t, transformer: r };
|
|
928
928
|
}
|
|
929
929
|
_getTransformCoordForDocumentOffset(e, n, t, r) {
|
|
930
|
-
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(
|
|
930
|
+
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(ni.FromArray([t, r]));
|
|
931
931
|
if (s)
|
|
932
932
|
return o.clone().invert().applyPoint(s);
|
|
933
933
|
}
|
|
@@ -938,23 +938,23 @@ let on = class extends Xe {
|
|
|
938
938
|
const { mainComponent: r, scene: o } = t, s = r, {
|
|
939
939
|
docsLeft: c,
|
|
940
940
|
docsTop: d
|
|
941
|
-
} = s.getOffsetConfig(), a =
|
|
941
|
+
} = s.getOffsetConfig(), a = ui(n), { left: l, top: u, height: g } = a, p = l + c, h = u + d;
|
|
942
942
|
if (this._anchorShape) {
|
|
943
943
|
this._anchorShape.transformByState({ left: p, top: h, height: g }), this._anchorShape.show();
|
|
944
944
|
return;
|
|
945
945
|
}
|
|
946
|
-
const v = 6, w = new
|
|
946
|
+
const v = 6, w = new ti(Li + be.generateRandomId(v), {
|
|
947
947
|
left: p,
|
|
948
948
|
top: h,
|
|
949
949
|
height: g,
|
|
950
950
|
strokeWidth: 2,
|
|
951
|
-
stroke:
|
|
951
|
+
stroke: ii(bt.darkGray, 1),
|
|
952
952
|
evented: !1
|
|
953
953
|
});
|
|
954
|
-
this._anchorShape = w, o.addObject(w,
|
|
954
|
+
this._anchorShape = w, o.addObject(w, fi);
|
|
955
955
|
}
|
|
956
956
|
_getDocObject() {
|
|
957
|
-
return
|
|
957
|
+
return hi(this._univerInstanceService, this._renderManagerService);
|
|
958
958
|
}
|
|
959
959
|
_getPageContentSize(e) {
|
|
960
960
|
const n = this._renderManagerService.getRenderById(e.unitId), t = n == null ? void 0 : n.with(se).getSkeleton(), r = 500, o = 500, s = t == null ? void 0 : t.getSkeletonData();
|
|
@@ -973,9 +973,9 @@ let on = class extends Xe {
|
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
975
|
if (d) {
|
|
976
|
-
const { pageWidth: a, pageHeight: l, marginLeft:
|
|
976
|
+
const { pageWidth: a, pageHeight: l, marginLeft: u, marginBottom: g, marginRight: p, marginTop: h } = d;
|
|
977
977
|
return {
|
|
978
|
-
width: Math.max(r, a -
|
|
978
|
+
width: Math.max(r, a - u - p),
|
|
979
979
|
height: Math.max(o, l - h - g)
|
|
980
980
|
};
|
|
981
981
|
} else
|
|
@@ -985,7 +985,7 @@ let on = class extends Xe {
|
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
987
|
};
|
|
988
|
-
on =
|
|
988
|
+
on = xi([
|
|
989
989
|
Qe(0, z),
|
|
990
990
|
Qe(1, Q),
|
|
991
991
|
Qe(2, Ie),
|
|
@@ -999,7 +999,7 @@ var he = function() {
|
|
|
999
999
|
}
|
|
1000
1000
|
return i;
|
|
1001
1001
|
}, he.apply(this, arguments);
|
|
1002
|
-
},
|
|
1002
|
+
}, Bi = function(i, e) {
|
|
1003
1003
|
var n = {};
|
|
1004
1004
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
1005
1005
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -1007,15 +1007,15 @@ var he = function() {
|
|
|
1007
1007
|
e.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, t[r]) && (n[t[r]] = i[t[r]]);
|
|
1008
1008
|
return n;
|
|
1009
1009
|
}, tt = Xn(function(i, e) {
|
|
1010
|
-
var n = i.icon, t = i.id, r = i.className, o = i.extend, s =
|
|
1010
|
+
var n = i.icon, t = i.id, r = i.className, o = i.extend, s = Bi(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Oi("_".concat(ki()));
|
|
1011
1011
|
return it(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className: c }, s), o);
|
|
1012
1012
|
});
|
|
1013
1013
|
function it(i, e, n, t, r) {
|
|
1014
|
-
return Kn(i.tag, he(he({ key: e },
|
|
1014
|
+
return Kn(i.tag, he(he({ key: e }, Ui(i, n, r)), t), (Fi(i, n).children || []).map(function(o, s) {
|
|
1015
1015
|
return it(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
|
|
1016
1016
|
}));
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function Ui(i, e, n) {
|
|
1019
1019
|
var t = he({}, i.attrs);
|
|
1020
1020
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1);
|
|
1021
1021
|
var r = e.defIds;
|
|
@@ -1024,21 +1024,21 @@ function xi(i, e, n) {
|
|
|
1024
1024
|
typeof c == "string" && (t[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1025
1025
|
})), t;
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function Fi(i, e) {
|
|
1028
1028
|
var n, t = e.defIds;
|
|
1029
1029
|
return !t || t.length === 0 ? i : i.tag === "defs" && (!((n = i.children) === null || n === void 0) && n.length) ? he(he({}, i), { children: i.children.map(function(r) {
|
|
1030
1030
|
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? he(he({}, r), { attrs: he(he({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
1031
1031
|
}) }) : i;
|
|
1032
1032
|
}
|
|
1033
|
-
function
|
|
1033
|
+
function ki() {
|
|
1034
1034
|
return Math.random().toString(36).substring(2, 8);
|
|
1035
1035
|
}
|
|
1036
1036
|
tt.displayName = "UniverIcon";
|
|
1037
|
-
var
|
|
1037
|
+
var Hi = { 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" } }] }, rt = Xn(function(i, e) {
|
|
1038
1038
|
return Kn(tt, Object.assign({}, i, {
|
|
1039
1039
|
id: "add-image-single",
|
|
1040
1040
|
ref: e,
|
|
1041
|
-
icon:
|
|
1041
|
+
icon: Hi
|
|
1042
1042
|
}));
|
|
1043
1043
|
});
|
|
1044
1044
|
rt.displayName = "AddImageSingle";
|
|
@@ -1047,11 +1047,11 @@ const Sn = {
|
|
|
1047
1047
|
type: K.COMMAND,
|
|
1048
1048
|
// eslint-disable-next-line max-lines-per-function
|
|
1049
1049
|
handler: (i, e) => {
|
|
1050
|
-
var M,
|
|
1050
|
+
var M, b, A, U;
|
|
1051
1051
|
const n = i.get(z), t = i.get(Q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
|
|
1052
1052
|
if (e == null || o == null)
|
|
1053
1053
|
return !1;
|
|
1054
|
-
const s = r.getRenderById(e.unitId).with(Me), { drawings: c } = e, d = (M = s.getSegment()) != null ? M : "", a = new vn(), l = q.getInstance(),
|
|
1054
|
+
const s = r.getRenderById(e.unitId).with(Me), { drawings: c } = e, d = (M = s.getSegment()) != null ? M : "", a = new vn(), l = q.getInstance(), u = (A = (b = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : b.customBlocks) != null ? A : [], g = c.map((N) => u.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), p = c[0].unitId, h = new yt();
|
|
1055
1055
|
h.reset();
|
|
1056
1056
|
const v = g[0].startIndex, w = [
|
|
1057
1057
|
{
|
|
@@ -1113,29 +1113,27 @@ const Sn = {
|
|
|
1113
1113
|
const n = i.get(Be);
|
|
1114
1114
|
if (!e) return !1;
|
|
1115
1115
|
const t = [];
|
|
1116
|
-
e.forEach(({ parent:
|
|
1117
|
-
t.push(
|
|
1118
|
-
t.push(
|
|
1116
|
+
return e.forEach(({ parent: r, children: o }) => {
|
|
1117
|
+
t.push(r.unitId), o.forEach((s) => {
|
|
1118
|
+
t.push(s.unitId);
|
|
1119
1119
|
});
|
|
1120
|
-
});
|
|
1121
|
-
const r = n.getGroupDrawingOp(e), { unitId: o, subUnitId: s, undo: c, redo: d, objects: a } = r;
|
|
1122
|
-
return !1;
|
|
1120
|
+
}), n.getGroupDrawingOp(e), !1;
|
|
1123
1121
|
}
|
|
1124
1122
|
}, at = {
|
|
1125
1123
|
id: "doc.command.insert-doc-image",
|
|
1126
1124
|
type: K.COMMAND,
|
|
1127
1125
|
// eslint-disable-next-line max-lines-per-function
|
|
1128
1126
|
handler: (i, e) => {
|
|
1129
|
-
var
|
|
1127
|
+
var b, A, U, N;
|
|
1130
1128
|
if (e == null)
|
|
1131
1129
|
return !1;
|
|
1132
1130
|
const n = i.get(z), t = i.get(In), r = i.get(Q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
|
|
1133
1131
|
if (o == null || s == null)
|
|
1134
1132
|
return !1;
|
|
1135
|
-
const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId:
|
|
1133
|
+
const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId: u } = o, g = s.getSelfOrHeaderFooterModel(u).getBody();
|
|
1136
1134
|
if (g == null)
|
|
1137
1135
|
return !1;
|
|
1138
|
-
const p = new vn(), h = q.getInstance(), v = [], w = (A = (
|
|
1136
|
+
const p = new vn(), h = q.getInstance(), v = [], w = (A = (b = s.getSnapshot().drawingsOrder) == null ? void 0 : b.length) != null ? A : 0;
|
|
1139
1137
|
let S = 0;
|
|
1140
1138
|
if (a)
|
|
1141
1139
|
l > 0 && p.push({
|
|
@@ -1143,16 +1141,16 @@ const Sn = {
|
|
|
1143
1141
|
len: l
|
|
1144
1142
|
});
|
|
1145
1143
|
else {
|
|
1146
|
-
const I =
|
|
1144
|
+
const I = Mt.selection.delete([o], g, 0, null, !1);
|
|
1147
1145
|
p.push(...I);
|
|
1148
|
-
const L =
|
|
1146
|
+
const L = pi(g, [o]), W = (U = s.getDrawings()) != null ? U : {}, x = (N = s.getDrawingsOrder()) != null ? N : [], G = L.sort((_, C) => x.indexOf(_) > x.indexOf(C) ? -1 : x.indexOf(_) < x.indexOf(C) ? 1 : 0);
|
|
1149
1147
|
if (G.length > 0)
|
|
1150
1148
|
for (const _ of G) {
|
|
1151
1149
|
const C = W[_], R = x.indexOf(_);
|
|
1152
1150
|
if (C == null || R < 0)
|
|
1153
1151
|
continue;
|
|
1154
|
-
const
|
|
1155
|
-
v.push(
|
|
1152
|
+
const T = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
|
|
1153
|
+
v.push(T), v.push(B), S++;
|
|
1156
1154
|
}
|
|
1157
1155
|
}
|
|
1158
1156
|
p.push({
|
|
@@ -1166,13 +1164,13 @@ const Sn = {
|
|
|
1166
1164
|
},
|
|
1167
1165
|
len: d.length
|
|
1168
1166
|
});
|
|
1169
|
-
const O = ze(s,
|
|
1167
|
+
const O = ze(s, u), D = h.editOp(p.serialize(), O);
|
|
1170
1168
|
v.push(D);
|
|
1171
1169
|
for (const I of d) {
|
|
1172
1170
|
const { drawingId: L } = I, W = h.insertOp(["drawings", L], I), x = h.insertOp(["drawingsOrder", w - S], L);
|
|
1173
1171
|
v.push(W), v.push(x);
|
|
1174
1172
|
}
|
|
1175
|
-
const
|
|
1173
|
+
const P = {
|
|
1176
1174
|
id: J.id,
|
|
1177
1175
|
params: {
|
|
1178
1176
|
unitId: c,
|
|
@@ -1180,7 +1178,7 @@ const Sn = {
|
|
|
1180
1178
|
textRanges: []
|
|
1181
1179
|
}
|
|
1182
1180
|
};
|
|
1183
|
-
return
|
|
1181
|
+
return P.params.actions = v.reduce((I, L) => q.compose(I, L), null), !!n.syncExecuteCommand(P.id, P.params);
|
|
1184
1182
|
}
|
|
1185
1183
|
}, ct = {
|
|
1186
1184
|
id: "doc.command.set-drawing-arrange",
|
|
@@ -1196,9 +1194,9 @@ const Sn = {
|
|
|
1196
1194
|
const { redo: l } = a;
|
|
1197
1195
|
if (l == null)
|
|
1198
1196
|
return !1;
|
|
1199
|
-
const
|
|
1200
|
-
let g =
|
|
1201
|
-
g = g.slice(3), g.unshift("drawingsOrder"),
|
|
1197
|
+
const u = [];
|
|
1198
|
+
let g = be.deepClone(l);
|
|
1199
|
+
g = g.slice(3), g.unshift("drawingsOrder"), u.push(g);
|
|
1202
1200
|
const p = {
|
|
1203
1201
|
id: J.id,
|
|
1204
1202
|
params: {
|
|
@@ -1207,7 +1205,7 @@ const Sn = {
|
|
|
1207
1205
|
textRanges: null
|
|
1208
1206
|
}
|
|
1209
1207
|
};
|
|
1210
|
-
return p.params.actions =
|
|
1208
|
+
return p.params.actions = u.reduce((v, w) => q.compose(v, w), null), !!n.syncExecuteCommand(p.id, p.params);
|
|
1211
1209
|
}
|
|
1212
1210
|
}, dt = {
|
|
1213
1211
|
id: "doc.command.ungroup-doc-image",
|
|
@@ -1217,32 +1215,30 @@ const Sn = {
|
|
|
1217
1215
|
const n = i.get(Be);
|
|
1218
1216
|
if (!e) return !1;
|
|
1219
1217
|
const t = [];
|
|
1220
|
-
e.forEach(({ parent:
|
|
1221
|
-
t.push(
|
|
1222
|
-
t.push(
|
|
1218
|
+
return e.forEach(({ parent: r, children: o }) => {
|
|
1219
|
+
t.push(r.unitId), o.forEach((s) => {
|
|
1220
|
+
t.push(s.unitId);
|
|
1223
1221
|
});
|
|
1224
|
-
});
|
|
1225
|
-
const r = n.getUngroupDrawingOp(e), { unitId: o, subUnitId: s, undo: c, redo: d, objects: a } = r;
|
|
1226
|
-
return !1;
|
|
1222
|
+
}), n.getUngroupDrawingOp(e), !1;
|
|
1227
1223
|
}
|
|
1228
1224
|
};
|
|
1229
|
-
var
|
|
1230
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1231
|
-
(s = i[o]) && (r = s(r) || r);
|
|
1232
|
-
return r;
|
|
1225
|
+
var Wi = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, Vi = (i, e, n, t) => {
|
|
1226
|
+
for (var r = t > 1 ? void 0 : t ? Gi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1227
|
+
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
1228
|
+
return t && r && Wi(e, n, r), r;
|
|
1233
1229
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
1234
1230
|
let sn = class extends Xe {
|
|
1235
|
-
constructor(i, e, n, t, r, o, s, c, d, a, l,
|
|
1236
|
-
super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = c, this._messageService = d, this._localeService = a, this._docSelectionRenderService = l, this._docRefreshDrawingsService =
|
|
1231
|
+
constructor(i, e, n, t, r, o, s, c, d, a, l, u, g) {
|
|
1232
|
+
super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = c, this._messageService = d, this._localeService = a, this._docSelectionRenderService = l, this._docRefreshDrawingsService = u, this._fileOpenerService = g, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
|
|
1237
1233
|
}
|
|
1238
1234
|
async insertDocImage() {
|
|
1239
1235
|
const i = await this._fileOpenerService.openFile({
|
|
1240
1236
|
multiple: !0,
|
|
1241
1237
|
accept: Vt.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
1242
1238
|
}), e = i.length;
|
|
1243
|
-
return e >
|
|
1239
|
+
return e > Tn ? (this._messageService.show({
|
|
1244
1240
|
type: Ln.Error,
|
|
1245
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
1241
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Tn))
|
|
1246
1242
|
}), !1) : e === 0 ? !1 : (await this._insertFloatImages(i), !0);
|
|
1247
1243
|
}
|
|
1248
1244
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1275,11 +1271,11 @@ let sn = class extends Xe {
|
|
|
1275
1271
|
for (const r of e) {
|
|
1276
1272
|
if (r == null)
|
|
1277
1273
|
continue;
|
|
1278
|
-
const { imageId: o, imageSourceType: s, source: c, base64Cache: d } = r, { width: a, height: l, image:
|
|
1279
|
-
this._imageIoService.addImageSourceCache(o, s,
|
|
1274
|
+
const { imageId: o, imageSourceType: s, source: c, base64Cache: d } = r, { width: a, height: l, image: u } = await $t(d || "");
|
|
1275
|
+
this._imageIoService.addImageSourceCache(o, s, u);
|
|
1280
1276
|
let g = 1;
|
|
1281
|
-
if (a >
|
|
1282
|
-
const w =
|
|
1277
|
+
if (a > bn || l > yn) {
|
|
1278
|
+
const w = bn / a, S = yn / l;
|
|
1283
1279
|
g = Math.min(w, S);
|
|
1284
1280
|
}
|
|
1285
1281
|
const p = this._getImagePosition(a * g, l * g);
|
|
@@ -1289,10 +1285,10 @@ let sn = class extends Xe {
|
|
|
1289
1285
|
unitId: n,
|
|
1290
1286
|
subUnitId: n,
|
|
1291
1287
|
drawingId: o,
|
|
1292
|
-
drawingType:
|
|
1288
|
+
drawingType: Rt.DRAWING_IMAGE,
|
|
1293
1289
|
imageSourceType: s,
|
|
1294
1290
|
source: c,
|
|
1295
|
-
transform:
|
|
1291
|
+
transform: wi(p),
|
|
1296
1292
|
docTransform: p,
|
|
1297
1293
|
behindDoc: oe.FALSE,
|
|
1298
1294
|
title: "",
|
|
@@ -1315,11 +1311,12 @@ let sn = class extends Xe {
|
|
|
1315
1311
|
_isInsertInHeaderFooter() {
|
|
1316
1312
|
var t;
|
|
1317
1313
|
const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(se).getViewModel(), n = e == null ? void 0 : e.getEditArea();
|
|
1318
|
-
return n ===
|
|
1314
|
+
return n === ke.HEADER || n === ke.FOOTER;
|
|
1319
1315
|
}
|
|
1320
1316
|
_getImagePosition(i, e) {
|
|
1321
1317
|
const n = this._docSelectionRenderService.getActiveTextRange(), t = (n == null ? void 0 : n.getAbsolutePosition()) || {
|
|
1322
|
-
left: 0
|
|
1318
|
+
left: 0,
|
|
1319
|
+
top: 0
|
|
1323
1320
|
};
|
|
1324
1321
|
return {
|
|
1325
1322
|
size: {
|
|
@@ -1411,11 +1408,11 @@ let sn = class extends Xe {
|
|
|
1411
1408
|
const { unit: i, scene: e, unitId: n } = this._context, t = (c = this._renderManagerSrv.getRenderById(n)) == null ? void 0 : c.with(se).getViewModel();
|
|
1412
1409
|
if (t == null || i == null)
|
|
1413
1410
|
return;
|
|
1414
|
-
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() ===
|
|
1411
|
+
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === ke.BODY;
|
|
1415
1412
|
for (const d of Object.keys(o)) {
|
|
1416
|
-
const a = o[d], l = zt({ unitId: n, drawingId: a.drawingId, subUnitId: n }),
|
|
1417
|
-
if (
|
|
1418
|
-
for (const g of
|
|
1413
|
+
const a = o[d], l = zt({ unitId: n, drawingId: a.drawingId, subUnitId: n }), u = e.fuzzyMathObjects(l, !0);
|
|
1414
|
+
if (u.length)
|
|
1415
|
+
for (const g of u)
|
|
1419
1416
|
e.detachTransformerFrom(g), g.setOpacity(0.5), (s && a.isMultiTransform !== oe.TRUE || !s && a.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(g), g.setOpacity(1));
|
|
1420
1417
|
}
|
|
1421
1418
|
}
|
|
@@ -1447,26 +1444,26 @@ let sn = class extends Xe {
|
|
|
1447
1444
|
this._docSelectionManagerService.replaceDocRanges(t);
|
|
1448
1445
|
}
|
|
1449
1446
|
};
|
|
1450
|
-
sn =
|
|
1447
|
+
sn = Vi([
|
|
1451
1448
|
me(1, z),
|
|
1452
1449
|
me(2, ve(In)),
|
|
1453
1450
|
me(3, ee),
|
|
1454
|
-
me(4,
|
|
1451
|
+
me(4, qt),
|
|
1455
1452
|
me(5, Be),
|
|
1456
1453
|
me(6, Ie),
|
|
1457
1454
|
me(7, Vn),
|
|
1458
|
-
me(8,
|
|
1455
|
+
me(8, oi),
|
|
1459
1456
|
me(9, ve(ln)),
|
|
1460
1457
|
me(10, ve(Me)),
|
|
1461
1458
|
me(11, ve(gn)),
|
|
1462
|
-
me(12,
|
|
1459
|
+
me(12, si)
|
|
1463
1460
|
], sn);
|
|
1464
1461
|
const lt = {
|
|
1465
1462
|
id: "doc.command.insert-float-image",
|
|
1466
1463
|
type: K.COMMAND,
|
|
1467
1464
|
handler: (i) => {
|
|
1468
1465
|
var n, t;
|
|
1469
|
-
return (t = (n = i.get(ee).getCurrentTypeOfRenderer(
|
|
1466
|
+
return (t = (n = i.get(ee).getCurrentTypeOfRenderer(ye.UNIVER_DOC)) == null ? void 0 : n.with(sn).insertDocImage()) != null ? t : !1;
|
|
1470
1467
|
}
|
|
1471
1468
|
}, Ke = {
|
|
1472
1469
|
id: "doc.command.move-drawing",
|
|
@@ -1478,16 +1475,16 @@ const lt = {
|
|
|
1478
1475
|
const d = c[0].unitId, a = o.getRenderById(d), l = a == null ? void 0 : a.scene;
|
|
1479
1476
|
if (l == null)
|
|
1480
1477
|
return !1;
|
|
1481
|
-
const
|
|
1482
|
-
var
|
|
1483
|
-
const { drawingId: w } = v, S = (
|
|
1478
|
+
const u = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), p = c.map((v) => {
|
|
1479
|
+
var b, A, U, N, I;
|
|
1480
|
+
const { drawingId: w } = v, S = (b = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : b[w];
|
|
1484
1481
|
if (S == null || S.layoutType === H.INLINE)
|
|
1485
1482
|
return null;
|
|
1486
|
-
const { positionH: O, positionV: D } = S.docTransform,
|
|
1487
|
-
return s === fe.UP ? M.posOffset = ((A = M.posOffset) != null ? A : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ?
|
|
1483
|
+
const { positionH: O, positionV: D } = S.docTransform, P = { ...O }, M = { ...D };
|
|
1484
|
+
return s === fe.UP ? M.posOffset = ((A = M.posOffset) != null ? A : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ? P.posOffset = ((N = P.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (P.posOffset = ((I = P.posOffset) != null ? I : 0) + 2), {
|
|
1488
1485
|
drawingId: w,
|
|
1489
1486
|
key: s === fe.UP || s === fe.DOWN ? "positionV" : "positionH",
|
|
1490
|
-
value: s === fe.UP || s === fe.DOWN ? M :
|
|
1487
|
+
value: s === fe.UP || s === fe.DOWN ? M : P
|
|
1491
1488
|
};
|
|
1492
1489
|
}).filter((v) => v != null);
|
|
1493
1490
|
if (p.length === 0)
|
|
@@ -1497,9 +1494,9 @@ const lt = {
|
|
|
1497
1494
|
subUnitId: d,
|
|
1498
1495
|
drawings: p
|
|
1499
1496
|
});
|
|
1500
|
-
return
|
|
1497
|
+
return u.refreshControls(), !!h;
|
|
1501
1498
|
}
|
|
1502
|
-
},
|
|
1499
|
+
}, ji = {
|
|
1503
1500
|
id: "doc.operation.clear-drawing-transformer",
|
|
1504
1501
|
type: K.MUTATION,
|
|
1505
1502
|
handler: (i, e) => {
|
|
@@ -1513,7 +1510,7 @@ const lt = {
|
|
|
1513
1510
|
id: "sidebar.operation.doc-image",
|
|
1514
1511
|
type: K.COMMAND,
|
|
1515
1512
|
handler: async (i, e) => {
|
|
1516
|
-
const n = i.get(
|
|
1513
|
+
const n = i.get(ai), t = i.get(ln), r = i.get(Ie);
|
|
1517
1514
|
switch (e.value) {
|
|
1518
1515
|
case "open":
|
|
1519
1516
|
n.open({
|
|
@@ -1553,21 +1550,27 @@ function j() {
|
|
|
1553
1550
|
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = ft(i)) && (t && (t += " "), t += e);
|
|
1554
1551
|
return t;
|
|
1555
1552
|
}
|
|
1556
|
-
const
|
|
1557
|
-
imageCommonPanel:
|
|
1558
|
-
imageCommonPanelGrid:
|
|
1559
|
-
imageCommonPanelBorder:
|
|
1560
|
-
imageCommonPanelTitle:
|
|
1561
|
-
imageCommonPanelSubtitle:
|
|
1562
|
-
imageCommonPanelRow:
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1553
|
+
const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", qi = "univer-image-common-panel-border", Xi = "univer-image-common-panel-title", Ki = "univer-image-common-panel-subtitle", Yi = "univer-image-common-panel-row", Zi = "univer-image-common-panel-row-vertical", Qi = "univer-image-common-panel-column", Ji = "univer-image-common-panel-column-center", er = "univer-image-common-panel-inline", nr = "univer-image-common-panel-span2", tr = "univer-image-common-panel-span3", ir = "univer-image-common-panel-input", rr = "univer-sheet-image-menu", or = "univer-sheet-image-menu-input", m = {
|
|
1554
|
+
imageCommonPanel: $i,
|
|
1555
|
+
imageCommonPanelGrid: zi,
|
|
1556
|
+
imageCommonPanelBorder: qi,
|
|
1557
|
+
imageCommonPanelTitle: Xi,
|
|
1558
|
+
imageCommonPanelSubtitle: Ki,
|
|
1559
|
+
imageCommonPanelRow: Yi,
|
|
1560
|
+
imageCommonPanelRowVertical: Zi,
|
|
1561
|
+
imageCommonPanelColumn: Qi,
|
|
1562
|
+
imageCommonPanelColumnCenter: Ji,
|
|
1563
|
+
imageCommonPanelInline: er,
|
|
1564
|
+
imageCommonPanelSpan2: nr,
|
|
1565
|
+
imageCommonPanelSpan3: tr,
|
|
1566
|
+
imageCommonPanelInput: ir,
|
|
1567
|
+
sheetImageMenu: rr,
|
|
1568
|
+
sheetImageMenuInput: or
|
|
1569
|
+
}, Hn = -1e3, Wn = 1e3, sr = (i) => {
|
|
1567
1570
|
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, c = s[0];
|
|
1568
1571
|
if (c == null)
|
|
1569
1572
|
return;
|
|
1570
|
-
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor,
|
|
1573
|
+
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor, u = r.getRenderById(d), g = u == null ? void 0 : u.scene;
|
|
1571
1574
|
if (g == null)
|
|
1572
1575
|
return;
|
|
1573
1576
|
const p = g.getTransformerByCreate(), h = [{
|
|
@@ -1597,106 +1600,106 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1597
1600
|
}], [w, S] = re(!0), [O, D] = re({
|
|
1598
1601
|
relativeFrom: ne.PAGE,
|
|
1599
1602
|
posOffset: 0
|
|
1600
|
-
}), [
|
|
1603
|
+
}), [P, M] = re({
|
|
1601
1604
|
relativeFrom: V.PAGE,
|
|
1602
1605
|
posOffset: 0
|
|
1603
|
-
}), [
|
|
1606
|
+
}), [b, A] = re(!0), [U, N] = re(!0);
|
|
1604
1607
|
function I(C, R) {
|
|
1605
|
-
var
|
|
1608
|
+
var y;
|
|
1606
1609
|
C === "positionH" ? D(R) : M(R);
|
|
1607
|
-
const
|
|
1608
|
-
if (
|
|
1610
|
+
const T = t.getFocusDrawings();
|
|
1611
|
+
if (T.length === 0)
|
|
1609
1612
|
return;
|
|
1610
|
-
const B =
|
|
1613
|
+
const B = T.map((E) => ({
|
|
1611
1614
|
unitId: E.unitId,
|
|
1612
1615
|
subUnitId: E.subUnitId,
|
|
1613
1616
|
drawingId: E.drawingId
|
|
1614
1617
|
}));
|
|
1615
1618
|
e.executeCommand(qe.id, {
|
|
1616
|
-
unitId:
|
|
1617
|
-
subUnitId:
|
|
1619
|
+
unitId: T[0].unitId,
|
|
1620
|
+
subUnitId: T[0].unitId,
|
|
1618
1621
|
drawings: B.map((E) => ({
|
|
1619
1622
|
drawingId: E.drawingId,
|
|
1620
1623
|
key: C,
|
|
1621
1624
|
value: R
|
|
1622
1625
|
}))
|
|
1623
1626
|
});
|
|
1624
|
-
const
|
|
1625
|
-
|
|
1627
|
+
const F = (y = r.getRenderById(d)) == null ? void 0 : y.with(Me);
|
|
1628
|
+
F && F.blur(), p.refreshControls();
|
|
1626
1629
|
}
|
|
1627
1630
|
function L(C) {
|
|
1628
1631
|
var ie, _e, Se;
|
|
1629
|
-
const R = O.relativeFrom,
|
|
1632
|
+
const R = O.relativeFrom, T = O.posOffset, B = Number(C);
|
|
1630
1633
|
if (R === B)
|
|
1631
1634
|
return;
|
|
1632
|
-
const
|
|
1633
|
-
if (
|
|
1635
|
+
const F = t.getFocusDrawings();
|
|
1636
|
+
if (F.length === 0)
|
|
1634
1637
|
return;
|
|
1635
|
-
const
|
|
1636
|
-
let $ = null,
|
|
1638
|
+
const y = F[0].drawingId, E = F[0].unitId;
|
|
1639
|
+
let $ = null, k = 0;
|
|
1637
1640
|
const Y = (ie = r.getRenderById(E)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Y == null ? void 0 : Y.getSkeletonData();
|
|
1638
1641
|
if (ae == null)
|
|
1639
1642
|
return;
|
|
1640
1643
|
const { pages: Ue, skeHeaders: Re, skeFooters: We } = ae;
|
|
1641
1644
|
for (const de of Ue) {
|
|
1642
|
-
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth:
|
|
1643
|
-
if (Oe.has(
|
|
1644
|
-
$ = Oe.get(
|
|
1645
|
+
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth: Pe } = de;
|
|
1646
|
+
if (Oe.has(y)) {
|
|
1647
|
+
$ = Oe.get(y), k = De;
|
|
1645
1648
|
break;
|
|
1646
1649
|
}
|
|
1647
|
-
const le = (_e = Re.get(Ne)) == null ? void 0 : _e.get(
|
|
1648
|
-
if (le != null && le.skeDrawings.has(
|
|
1649
|
-
$ = le == null ? void 0 : le.skeDrawings.get(
|
|
1650
|
+
const le = (_e = Re.get(Ne)) == null ? void 0 : _e.get(Pe);
|
|
1651
|
+
if (le != null && le.skeDrawings.has(y)) {
|
|
1652
|
+
$ = le == null ? void 0 : le.skeDrawings.get(y), k = De;
|
|
1650
1653
|
break;
|
|
1651
1654
|
}
|
|
1652
|
-
const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(
|
|
1653
|
-
if (ge != null && ge.skeDrawings.has(
|
|
1654
|
-
$ = ge == null ? void 0 : ge.skeDrawings.get(
|
|
1655
|
+
const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(Pe);
|
|
1656
|
+
if (ge != null && ge.skeDrawings.has(y)) {
|
|
1657
|
+
$ = ge == null ? void 0 : ge.skeDrawings.get(y), k = De;
|
|
1655
1658
|
break;
|
|
1656
1659
|
}
|
|
1657
1660
|
}
|
|
1658
1661
|
if ($ == null)
|
|
1659
1662
|
return;
|
|
1660
1663
|
let ce = 0;
|
|
1661
|
-
R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -=
|
|
1664
|
+
R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -= k), B === ne.COLUMN ? ce += $.columnLeft : B === ne.MARGIN ? ce += k : ne.PAGE;
|
|
1662
1665
|
const te = {
|
|
1663
1666
|
relativeFrom: B,
|
|
1664
|
-
posOffset: (
|
|
1667
|
+
posOffset: (T != null ? T : 0) - ce
|
|
1665
1668
|
};
|
|
1666
1669
|
I("positionH", te);
|
|
1667
1670
|
}
|
|
1668
1671
|
function W(C) {
|
|
1669
|
-
var Oe, Ne, Ae,
|
|
1670
|
-
const R =
|
|
1672
|
+
var Oe, Ne, Ae, Pe, le, ge;
|
|
1673
|
+
const R = P.relativeFrom, T = P.posOffset, B = Number(C);
|
|
1671
1674
|
if (R === B)
|
|
1672
1675
|
return;
|
|
1673
|
-
const
|
|
1674
|
-
if (
|
|
1676
|
+
const F = t.getFocusDrawings();
|
|
1677
|
+
if (F.length === 0)
|
|
1675
1678
|
return;
|
|
1676
|
-
const { drawingId:
|
|
1677
|
-
if (Re == null ||
|
|
1679
|
+
const { drawingId: y, unitId: E } = F[0], $ = o.getUniverDocInstance(E), k = (Oe = r.getRenderById(E)) == null ? void 0 : Oe.with(se).getSkeleton(), Y = (Ne = r.getRenderById(E)) == null ? void 0 : Ne.with(Me), ae = Y == null ? void 0 : Y.getSegment(), Ue = Y == null ? void 0 : Y.getSegmentPage(), Re = (Pe = (Ae = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ae.customBlocks) == null ? void 0 : Pe.find((Ee) => Ee.blockId === y);
|
|
1680
|
+
if (Re == null || k == null || Y == null)
|
|
1678
1681
|
return;
|
|
1679
|
-
const { startIndex: We } = Re, ce =
|
|
1682
|
+
const { startIndex: We } = Re, ce = k.findNodeByCharIndex(We, ae, Ue), te = (le = ce == null ? void 0 : ce.parent) == null ? void 0 : le.parent, ie = te == null ? void 0 : te.parent, _e = ie == null ? void 0 : ie.lines.find((Ee) => Ee.paragraphIndex === (te == null ? void 0 : te.paragraphIndex) && Ee.paragraphStart), Se = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
|
|
1680
1683
|
if (ce == null || te == null || _e == null || ie == null || Se == null)
|
|
1681
1684
|
return;
|
|
1682
1685
|
let de = 0;
|
|
1683
1686
|
R === V.PARAGRAPH ? de -= _e.top : R === V.LINE ? de -= te.top : R === V.PAGE && (de += Se.marginTop), B === V.PARAGRAPH ? de += _e.top : B === V.LINE ? de += te.top : B === V.PAGE && (de -= Se.marginTop);
|
|
1684
1687
|
const De = {
|
|
1685
1688
|
relativeFrom: B,
|
|
1686
|
-
posOffset: (
|
|
1689
|
+
posOffset: (T != null ? T : 0) - de
|
|
1687
1690
|
};
|
|
1688
1691
|
I("positionV", De);
|
|
1689
1692
|
}
|
|
1690
1693
|
function x(C) {
|
|
1691
1694
|
var E;
|
|
1692
|
-
const R = a == null ? void 0 : a.getSnapshot(),
|
|
1693
|
-
if (
|
|
1695
|
+
const R = a == null ? void 0 : a.getSnapshot(), T = (E = R == null ? void 0 : R.drawings) == null ? void 0 : E[C.drawingId];
|
|
1696
|
+
if (T == null)
|
|
1694
1697
|
return;
|
|
1695
|
-
const { layoutType: B } =
|
|
1696
|
-
positionH:
|
|
1697
|
-
positionV:
|
|
1698
|
-
} =
|
|
1699
|
-
D(
|
|
1698
|
+
const { layoutType: B } = T, {
|
|
1699
|
+
positionH: F,
|
|
1700
|
+
positionV: y
|
|
1701
|
+
} = T.docTransform;
|
|
1702
|
+
D(F), M(y), S(B === H.INLINE), A(y.relativeFrom === V.PARAGRAPH || y.relativeFrom === V.LINE);
|
|
1700
1703
|
}
|
|
1701
1704
|
function G() {
|
|
1702
1705
|
const C = t.getFocusDrawings();
|
|
@@ -1707,26 +1710,26 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1707
1710
|
}
|
|
1708
1711
|
return _n(() => {
|
|
1709
1712
|
G();
|
|
1710
|
-
const C = t.focus$.subscribe((
|
|
1711
|
-
if (
|
|
1713
|
+
const C = t.focus$.subscribe((T) => {
|
|
1714
|
+
if (T.length === 0) {
|
|
1712
1715
|
N(!1);
|
|
1713
1716
|
return;
|
|
1714
1717
|
}
|
|
1715
|
-
N(!0), x(
|
|
1716
|
-
}), R = e.onCommandExecuted(async (
|
|
1717
|
-
|
|
1718
|
+
N(!0), x(T[0]);
|
|
1719
|
+
}), R = e.onCommandExecuted(async (T) => {
|
|
1720
|
+
T.id === J.id && G();
|
|
1718
1721
|
});
|
|
1719
1722
|
return () => {
|
|
1720
1723
|
C.unsubscribe(), R.dispose();
|
|
1721
1724
|
};
|
|
1722
|
-
}, []), /* @__PURE__ */ X("div", { className: j(
|
|
1723
|
-
/* @__PURE__ */ f("div", { className:
|
|
1724
|
-
/* @__PURE__ */ f("div", { className:
|
|
1725
|
-
/* @__PURE__ */ X("div", { className:
|
|
1726
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1727
|
-
/* @__PURE__ */ f("div", { className:
|
|
1728
|
-
/* @__PURE__ */ f("div", { className:
|
|
1729
|
-
|
|
1725
|
+
}, []), /* @__PURE__ */ X("div", { className: j(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
|
|
1726
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.title") }) }) }),
|
|
1727
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.horizontal") }) }) }),
|
|
1728
|
+
/* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
|
|
1729
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1730
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1731
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1732
|
+
Fe,
|
|
1730
1733
|
{
|
|
1731
1734
|
min: Hn,
|
|
1732
1735
|
max: Wn,
|
|
@@ -1739,13 +1742,13 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1739
1742
|
posOffset: C
|
|
1740
1743
|
});
|
|
1741
1744
|
},
|
|
1742
|
-
className:
|
|
1745
|
+
className: m.imageCommonPanelInput
|
|
1743
1746
|
}
|
|
1744
1747
|
) }) })
|
|
1745
1748
|
] }) }),
|
|
1746
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1747
|
-
/* @__PURE__ */ f("div", { className:
|
|
1748
|
-
/* @__PURE__ */ f("div", { className:
|
|
1749
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1750
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
|
|
1751
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1749
1752
|
Bn,
|
|
1750
1753
|
{
|
|
1751
1754
|
value: String(O.relativeFrom),
|
|
@@ -1756,52 +1759,52 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1756
1759
|
) }) })
|
|
1757
1760
|
] }) })
|
|
1758
1761
|
] }),
|
|
1759
|
-
/* @__PURE__ */ f("div", { className:
|
|
1760
|
-
/* @__PURE__ */ X("div", { className:
|
|
1761
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1762
|
-
/* @__PURE__ */ f("div", { className:
|
|
1763
|
-
/* @__PURE__ */ f("div", { className:
|
|
1764
|
-
|
|
1762
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.vertical") }) }) }),
|
|
1763
|
+
/* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
|
|
1764
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1765
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1766
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1767
|
+
Fe,
|
|
1765
1768
|
{
|
|
1766
1769
|
min: Hn,
|
|
1767
1770
|
max: Wn,
|
|
1768
1771
|
precision: 1,
|
|
1769
1772
|
disabled: w,
|
|
1770
|
-
value:
|
|
1773
|
+
value: P.posOffset,
|
|
1771
1774
|
onChange: (C) => {
|
|
1772
1775
|
I("positionV", {
|
|
1773
|
-
relativeFrom:
|
|
1776
|
+
relativeFrom: P.relativeFrom,
|
|
1774
1777
|
posOffset: C
|
|
1775
1778
|
});
|
|
1776
1779
|
},
|
|
1777
|
-
className:
|
|
1780
|
+
className: m.imageCommonPanelInput
|
|
1778
1781
|
}
|
|
1779
1782
|
) }) })
|
|
1780
1783
|
] }) }),
|
|
1781
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1782
|
-
/* @__PURE__ */ f("div", { className:
|
|
1783
|
-
/* @__PURE__ */ f("div", { className:
|
|
1784
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1785
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
|
|
1786
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1784
1787
|
Bn,
|
|
1785
1788
|
{
|
|
1786
1789
|
disabled: w,
|
|
1787
|
-
value: String(
|
|
1790
|
+
value: String(P.relativeFrom),
|
|
1788
1791
|
options: v,
|
|
1789
1792
|
onChange: W
|
|
1790
1793
|
}
|
|
1791
1794
|
) }) })
|
|
1792
1795
|
] }) })
|
|
1793
1796
|
] }),
|
|
1794
|
-
/* @__PURE__ */ f("div", { className:
|
|
1795
|
-
/* @__PURE__ */ f("div", { className:
|
|
1797
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.options") }) }) }),
|
|
1798
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(Di, { disabled: w, checked: b, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1796
1799
|
] });
|
|
1797
|
-
}, Je = 0, en = 100,
|
|
1800
|
+
}, Je = 0, en = 100, ar = (i) => {
|
|
1798
1801
|
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, c = s[0];
|
|
1799
1802
|
if (c == null)
|
|
1800
1803
|
return null;
|
|
1801
1804
|
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = r.getRenderById(d);
|
|
1802
1805
|
if ((l == null ? void 0 : l.scene) == null)
|
|
1803
1806
|
return null;
|
|
1804
|
-
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [
|
|
1807
|
+
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [P, M] = re(""), [b, A] = re({
|
|
1805
1808
|
distT: 0,
|
|
1806
1809
|
distL: 0,
|
|
1807
1810
|
distB: 0,
|
|
@@ -1812,14 +1815,14 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1812
1815
|
const C = t.getFocusDrawings();
|
|
1813
1816
|
if (C.length === 0)
|
|
1814
1817
|
return;
|
|
1815
|
-
const { unitId: R, subUnitId:
|
|
1816
|
-
unitId:
|
|
1817
|
-
subUnitId:
|
|
1818
|
+
const { unitId: R, subUnitId: T } = C[0], B = C.map(({ unitId: F, subUnitId: y, drawingId: E }) => ({
|
|
1819
|
+
unitId: F,
|
|
1820
|
+
subUnitId: y,
|
|
1818
1821
|
drawingId: E
|
|
1819
1822
|
}));
|
|
1820
1823
|
e.executeCommand(Zn.id, {
|
|
1821
1824
|
unitId: R,
|
|
1822
|
-
subUnitId:
|
|
1825
|
+
subUnitId: T,
|
|
1823
1826
|
drawings: B,
|
|
1824
1827
|
wrappingStyle: _
|
|
1825
1828
|
});
|
|
@@ -1829,10 +1832,10 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1829
1832
|
const C = t.getFocusDrawings();
|
|
1830
1833
|
if (C.length === 0)
|
|
1831
1834
|
return;
|
|
1832
|
-
const R = C.map((
|
|
1833
|
-
unitId:
|
|
1834
|
-
subUnitId:
|
|
1835
|
-
drawingId:
|
|
1835
|
+
const R = C.map((T) => ({
|
|
1836
|
+
unitId: T.unitId,
|
|
1837
|
+
subUnitId: T.subUnitId,
|
|
1838
|
+
drawingId: T.drawingId
|
|
1836
1839
|
}));
|
|
1837
1840
|
e.executeCommand(Jn.id, {
|
|
1838
1841
|
unitId: C[0].unitId,
|
|
@@ -1844,19 +1847,19 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1844
1847
|
function W(_, C) {
|
|
1845
1848
|
if (_ == null)
|
|
1846
1849
|
return;
|
|
1847
|
-
const R = { ...
|
|
1850
|
+
const R = { ...b, [C]: _ };
|
|
1848
1851
|
A(R);
|
|
1849
|
-
const
|
|
1850
|
-
if (
|
|
1852
|
+
const T = t.getFocusDrawings();
|
|
1853
|
+
if (T.length === 0)
|
|
1851
1854
|
return;
|
|
1852
|
-
const B =
|
|
1853
|
-
unitId:
|
|
1854
|
-
subUnitId:
|
|
1855
|
-
drawingId:
|
|
1855
|
+
const B = T.map((F) => ({
|
|
1856
|
+
unitId: F.unitId,
|
|
1857
|
+
subUnitId: F.subUnitId,
|
|
1858
|
+
drawingId: F.drawingId
|
|
1856
1859
|
}));
|
|
1857
1860
|
e.executeCommand(Qn.id, {
|
|
1858
|
-
unitId:
|
|
1859
|
-
subUnitId:
|
|
1861
|
+
unitId: T[0].unitId,
|
|
1862
|
+
subUnitId: T[0].unitId,
|
|
1860
1863
|
drawings: B,
|
|
1861
1864
|
dist: {
|
|
1862
1865
|
[C]: _
|
|
@@ -1874,22 +1877,22 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1874
1877
|
return;
|
|
1875
1878
|
const {
|
|
1876
1879
|
distT: R = 0,
|
|
1877
|
-
distL:
|
|
1880
|
+
distL: T = 0,
|
|
1878
1881
|
distB: B = 0,
|
|
1879
|
-
distR:
|
|
1880
|
-
layoutType:
|
|
1882
|
+
distR: F = 0,
|
|
1883
|
+
layoutType: y = H.INLINE,
|
|
1881
1884
|
behindDoc: E = oe.FALSE,
|
|
1882
1885
|
wrapText: $ = $e.BOTH_SIDES
|
|
1883
1886
|
} = C;
|
|
1884
1887
|
if (A({
|
|
1885
1888
|
distT: R,
|
|
1886
|
-
distL:
|
|
1889
|
+
distL: T,
|
|
1887
1890
|
distB: B,
|
|
1888
|
-
distR:
|
|
1889
|
-
}), M($), p(
|
|
1891
|
+
distR: F
|
|
1892
|
+
}), M($), p(y !== H.WRAP_SQUARE), y === H.WRAP_NONE || y === H.INLINE ? v(!0) : v(!1), y === H.WRAP_NONE || y === H.INLINE || y === H.WRAP_TOP_AND_BOTTOM ? S(!0) : S(!1), y === H.WRAP_NONE)
|
|
1890
1893
|
E === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
|
|
1891
1894
|
else
|
|
1892
|
-
switch (
|
|
1895
|
+
switch (y) {
|
|
1893
1896
|
case H.INLINE:
|
|
1894
1897
|
D(ue.INLINE);
|
|
1895
1898
|
break;
|
|
@@ -1900,7 +1903,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1900
1903
|
D(ue.WRAP_TOP_AND_BOTTOM);
|
|
1901
1904
|
break;
|
|
1902
1905
|
default:
|
|
1903
|
-
throw new Error(`Unsupported layout type: ${
|
|
1906
|
+
throw new Error(`Unsupported layout type: ${y}`);
|
|
1904
1907
|
}
|
|
1905
1908
|
}
|
|
1906
1909
|
return _n(() => {
|
|
@@ -1917,97 +1920,97 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1917
1920
|
return () => {
|
|
1918
1921
|
_.unsubscribe(), C.dispose();
|
|
1919
1922
|
};
|
|
1920
|
-
}, []), /* @__PURE__ */ X("div", { className: j(
|
|
1921
|
-
/* @__PURE__ */ f("div", { className:
|
|
1922
|
-
/* @__PURE__ */ f("div", { className:
|
|
1923
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1924
|
-
/* @__PURE__ */ f(
|
|
1925
|
-
/* @__PURE__ */ f(
|
|
1926
|
-
/* @__PURE__ */ f(
|
|
1927
|
-
/* @__PURE__ */ f(
|
|
1928
|
-
/* @__PURE__ */ f(
|
|
1923
|
+
}, []), /* @__PURE__ */ X("div", { className: j(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
|
|
1924
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.title") }) }) }),
|
|
1925
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
|
|
1926
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { value: O, onChange: I, direction: "vertical", children: [
|
|
1927
|
+
/* @__PURE__ */ f(Te, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
|
|
1928
|
+
/* @__PURE__ */ f(Te, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
|
|
1929
|
+
/* @__PURE__ */ f(Te, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
|
|
1930
|
+
/* @__PURE__ */ f(Te, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
|
|
1931
|
+
/* @__PURE__ */ f(Te, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1929
1932
|
] }) }) }),
|
|
1930
|
-
/* @__PURE__ */ f("div", { className:
|
|
1931
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1932
|
-
/* @__PURE__ */ f(
|
|
1933
|
-
/* @__PURE__ */ f(
|
|
1934
|
-
/* @__PURE__ */ f(
|
|
1933
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
|
|
1934
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { disabled: g, value: P, onChange: L, direction: "horizontal", children: [
|
|
1935
|
+
/* @__PURE__ */ f(Te, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1936
|
+
/* @__PURE__ */ f(Te, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1937
|
+
/* @__PURE__ */ f(Te, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
1935
1938
|
] }) }) }),
|
|
1936
|
-
/* @__PURE__ */ f("div", { className:
|
|
1937
|
-
/* @__PURE__ */ X("div", { className:
|
|
1938
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1939
|
-
/* @__PURE__ */ f("div", { className:
|
|
1940
|
-
/* @__PURE__ */ f("div", { className:
|
|
1941
|
-
|
|
1939
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
|
|
1940
|
+
/* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
|
|
1941
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1942
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
|
|
1943
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1944
|
+
Fe,
|
|
1942
1945
|
{
|
|
1943
1946
|
min: Je,
|
|
1944
1947
|
max: en,
|
|
1945
1948
|
disabled: h,
|
|
1946
1949
|
precision: 1,
|
|
1947
|
-
value:
|
|
1950
|
+
value: b.distT,
|
|
1948
1951
|
onChange: (_) => {
|
|
1949
1952
|
W(_, "distT");
|
|
1950
1953
|
},
|
|
1951
|
-
className:
|
|
1954
|
+
className: m.imageCommonPanelInput
|
|
1952
1955
|
}
|
|
1953
1956
|
) }) })
|
|
1954
1957
|
] }) }),
|
|
1955
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1956
|
-
/* @__PURE__ */ f("div", { className:
|
|
1957
|
-
/* @__PURE__ */ f("div", { className:
|
|
1958
|
-
|
|
1958
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1959
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
|
|
1960
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1961
|
+
Fe,
|
|
1959
1962
|
{
|
|
1960
1963
|
min: Je,
|
|
1961
1964
|
max: en,
|
|
1962
1965
|
disabled: w,
|
|
1963
1966
|
precision: 1,
|
|
1964
|
-
value:
|
|
1967
|
+
value: b.distL,
|
|
1965
1968
|
onChange: (_) => {
|
|
1966
1969
|
W(_, "distL");
|
|
1967
1970
|
},
|
|
1968
|
-
className:
|
|
1971
|
+
className: m.imageCommonPanelInput
|
|
1969
1972
|
}
|
|
1970
1973
|
) }) })
|
|
1971
1974
|
] }) })
|
|
1972
1975
|
] }),
|
|
1973
|
-
/* @__PURE__ */ X("div", { className:
|
|
1974
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1975
|
-
/* @__PURE__ */ f("div", { className:
|
|
1976
|
-
/* @__PURE__ */ f("div", { className:
|
|
1977
|
-
|
|
1976
|
+
/* @__PURE__ */ X("div", { className: m.imageCommonPanelRow, children: [
|
|
1977
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1978
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
|
|
1979
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1980
|
+
Fe,
|
|
1978
1981
|
{
|
|
1979
1982
|
min: Je,
|
|
1980
1983
|
max: en,
|
|
1981
1984
|
disabled: h,
|
|
1982
1985
|
precision: 1,
|
|
1983
|
-
value:
|
|
1986
|
+
value: b.distB,
|
|
1984
1987
|
onChange: (_) => {
|
|
1985
1988
|
W(_, "distB");
|
|
1986
1989
|
},
|
|
1987
|
-
className:
|
|
1990
|
+
className: m.imageCommonPanelInput
|
|
1988
1991
|
}
|
|
1989
1992
|
) }) })
|
|
1990
1993
|
] }) }),
|
|
1991
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1992
|
-
/* @__PURE__ */ f("div", { className:
|
|
1993
|
-
/* @__PURE__ */ f("div", { className:
|
|
1994
|
-
|
|
1994
|
+
/* @__PURE__ */ f("div", { className: j(m.imageCommonPanelColumn, m.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1995
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
|
|
1996
|
+
/* @__PURE__ */ f("div", { className: m.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: m.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1997
|
+
Fe,
|
|
1995
1998
|
{
|
|
1996
1999
|
min: Je,
|
|
1997
2000
|
max: en,
|
|
1998
2001
|
disabled: w,
|
|
1999
2002
|
precision: 1,
|
|
2000
|
-
value:
|
|
2003
|
+
value: b.distR,
|
|
2001
2004
|
onChange: (_) => {
|
|
2002
2005
|
W(_, "distR");
|
|
2003
2006
|
},
|
|
2004
|
-
className:
|
|
2007
|
+
className: m.imageCommonPanelInput
|
|
2005
2008
|
}
|
|
2006
2009
|
) }) })
|
|
2007
2010
|
] }) })
|
|
2008
2011
|
] })
|
|
2009
2012
|
] });
|
|
2010
|
-
},
|
|
2013
|
+
}, cr = () => {
|
|
2011
2014
|
const i = we(Ie), e = i.getFocusDrawings(), [n, t] = re(e);
|
|
2012
2015
|
return _n(() => {
|
|
2013
2016
|
const r = i.focus$.subscribe((o) => {
|
|
@@ -2016,20 +2019,20 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
2016
2019
|
return () => {
|
|
2017
2020
|
r.unsubscribe();
|
|
2018
2021
|
};
|
|
2019
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className:
|
|
2020
|
-
/* @__PURE__ */ f(
|
|
2021
|
-
/* @__PURE__ */ f(
|
|
2022
|
-
/* @__PURE__ */ f(
|
|
2022
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className: m.imageCommonPanel, children: [
|
|
2023
|
+
/* @__PURE__ */ f(Kt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
2024
|
+
/* @__PURE__ */ f(ar, { drawings: n }),
|
|
2025
|
+
/* @__PURE__ */ f(sr, { drawings: n })
|
|
2023
2026
|
] });
|
|
2024
|
-
}, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id,
|
|
2027
|
+
}, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id, dr = (i) => {
|
|
2025
2028
|
const e = i.get(In), n = i.get(Q);
|
|
2026
|
-
return new
|
|
2029
|
+
return new Ci((t) => {
|
|
2027
2030
|
const r = e.textSelection$.subscribe(() => {
|
|
2028
2031
|
var s;
|
|
2029
2032
|
const o = e.getActiveTextRange();
|
|
2030
2033
|
if (o) {
|
|
2031
|
-
const { segmentId: c, startOffset: d, endOffset: a } = o, l = n.getCurrentUniverDocInstance(),
|
|
2032
|
-
if (
|
|
2034
|
+
const { segmentId: c, startOffset: d, endOffset: a } = o, l = n.getCurrentUniverDocInstance(), u = (s = l == null ? void 0 : l.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : s.tables;
|
|
2035
|
+
if (u && u.length && u.some((g) => {
|
|
2033
2036
|
const { startIndex: p, endIndex: h } = g;
|
|
2034
2037
|
return d >= p && d < h || a >= p && a < h;
|
|
2035
2038
|
})) {
|
|
@@ -2045,40 +2048,40 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
2045
2048
|
return () => r.unsubscribe();
|
|
2046
2049
|
});
|
|
2047
2050
|
};
|
|
2048
|
-
function
|
|
2051
|
+
function lr(i) {
|
|
2049
2052
|
return {
|
|
2050
2053
|
id: pt,
|
|
2051
|
-
type:
|
|
2054
|
+
type: $n.SUBITEMS,
|
|
2052
2055
|
icon: ht,
|
|
2053
2056
|
tooltip: "docImage.title",
|
|
2054
|
-
disabled$:
|
|
2055
|
-
hidden$:
|
|
2057
|
+
disabled$: dr(i),
|
|
2058
|
+
hidden$: zn(i, ye.UNIVER_DOC)
|
|
2056
2059
|
};
|
|
2057
2060
|
}
|
|
2058
|
-
function
|
|
2061
|
+
function gr(i) {
|
|
2059
2062
|
return {
|
|
2060
2063
|
id: wt,
|
|
2061
2064
|
title: "docImage.upload.float",
|
|
2062
|
-
type:
|
|
2063
|
-
hidden$:
|
|
2065
|
+
type: $n.BUTTON,
|
|
2066
|
+
hidden$: zn(i, ye.UNIVER_DOC)
|
|
2064
2067
|
};
|
|
2065
2068
|
}
|
|
2066
|
-
const
|
|
2067
|
-
[
|
|
2069
|
+
const mr = {
|
|
2070
|
+
[ci.LAYOUT]: {
|
|
2068
2071
|
[pt]: {
|
|
2069
2072
|
order: 0,
|
|
2070
|
-
menuItemFactory:
|
|
2073
|
+
menuItemFactory: lr,
|
|
2071
2074
|
[wt]: {
|
|
2072
2075
|
order: 0,
|
|
2073
|
-
menuItemFactory:
|
|
2076
|
+
menuItemFactory: gr
|
|
2074
2077
|
}
|
|
2075
2078
|
}
|
|
2076
2079
|
}
|
|
2077
2080
|
};
|
|
2078
2081
|
function Ye(i) {
|
|
2079
|
-
return i.getContextValue(
|
|
2082
|
+
return i.getContextValue(Nt) && i.getContextValue(tn);
|
|
2080
2083
|
}
|
|
2081
|
-
const
|
|
2084
|
+
const ur = {
|
|
2082
2085
|
id: Ke.id,
|
|
2083
2086
|
description: "shortcut.doc.drawing-move-down",
|
|
2084
2087
|
group: "4_doc-drawing-view",
|
|
@@ -2088,7 +2091,7 @@ const ir = {
|
|
|
2088
2091
|
staticParameters: {
|
|
2089
2092
|
direction: fe.DOWN
|
|
2090
2093
|
}
|
|
2091
|
-
},
|
|
2094
|
+
}, fr = {
|
|
2092
2095
|
id: Ke.id,
|
|
2093
2096
|
description: "shortcut.doc.drawing-move-up",
|
|
2094
2097
|
group: "4_doc-drawing-view",
|
|
@@ -2098,7 +2101,7 @@ const ir = {
|
|
|
2098
2101
|
staticParameters: {
|
|
2099
2102
|
direction: fe.UP
|
|
2100
2103
|
}
|
|
2101
|
-
},
|
|
2104
|
+
}, hr = {
|
|
2102
2105
|
id: Ke.id,
|
|
2103
2106
|
description: "shortcut.doc.drawing-move-left",
|
|
2104
2107
|
group: "4_doc-drawing-view",
|
|
@@ -2108,7 +2111,7 @@ const ir = {
|
|
|
2108
2111
|
staticParameters: {
|
|
2109
2112
|
direction: fe.LEFT
|
|
2110
2113
|
}
|
|
2111
|
-
},
|
|
2114
|
+
}, pr = {
|
|
2112
2115
|
id: Ke.id,
|
|
2113
2116
|
description: "shortcut.doc.drawing-move-right",
|
|
2114
2117
|
group: "4_doc-drawing-view",
|
|
@@ -2118,7 +2121,7 @@ const ir = {
|
|
|
2118
2121
|
staticParameters: {
|
|
2119
2122
|
direction: fe.RIGHT
|
|
2120
2123
|
}
|
|
2121
|
-
},
|
|
2124
|
+
}, wr = {
|
|
2122
2125
|
id: ot.id,
|
|
2123
2126
|
description: "shortcut.doc.drawing-delete",
|
|
2124
2127
|
group: "4_doc-drawing-view",
|
|
@@ -2127,10 +2130,10 @@ const ir = {
|
|
|
2127
2130
|
binding: He.DELETE,
|
|
2128
2131
|
mac: He.BACKSPACE
|
|
2129
2132
|
};
|
|
2130
|
-
var
|
|
2131
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2132
|
-
(s = i[o]) && (r = s(r) || r);
|
|
2133
|
-
return r;
|
|
2133
|
+
var vr = Object.defineProperty, Ir = Object.getOwnPropertyDescriptor, _r = (i, e, n, t) => {
|
|
2134
|
+
for (var r = t > 1 ? void 0 : t ? Ir(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2135
|
+
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2136
|
+
return t && r && vr(e, n, r), r;
|
|
2134
2137
|
}, nn = (i, e) => (n, t) => e(n, t, i);
|
|
2135
2138
|
let an = class extends Xe {
|
|
2136
2139
|
constructor(i, e, n, t) {
|
|
@@ -2138,10 +2141,10 @@ let an = class extends Xe {
|
|
|
2138
2141
|
}
|
|
2139
2142
|
_initCustomComponents() {
|
|
2140
2143
|
const i = this._componentManager;
|
|
2141
|
-
this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt,
|
|
2144
|
+
this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt, cr));
|
|
2142
2145
|
}
|
|
2143
2146
|
_initMenus() {
|
|
2144
|
-
this._menuManagerService.mergeMenu(
|
|
2147
|
+
this._menuManagerService.mergeMenu(mr);
|
|
2145
2148
|
}
|
|
2146
2149
|
_initCommands() {
|
|
2147
2150
|
[
|
|
@@ -2155,7 +2158,7 @@ let an = class extends Xe {
|
|
|
2155
2158
|
nt,
|
|
2156
2159
|
Sn,
|
|
2157
2160
|
mt,
|
|
2158
|
-
|
|
2161
|
+
ji,
|
|
2159
2162
|
ut,
|
|
2160
2163
|
st,
|
|
2161
2164
|
dt,
|
|
@@ -2167,11 +2170,11 @@ let an = class extends Xe {
|
|
|
2167
2170
|
_initShortcuts() {
|
|
2168
2171
|
[
|
|
2169
2172
|
// sheet drawing shortcuts
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2173
|
+
ur,
|
|
2174
|
+
fr,
|
|
2175
|
+
hr,
|
|
2176
|
+
pr,
|
|
2177
|
+
wr
|
|
2175
2178
|
].forEach((i) => {
|
|
2176
2179
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2177
2180
|
});
|
|
@@ -2180,25 +2183,25 @@ let an = class extends Xe {
|
|
|
2180
2183
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2181
2184
|
}
|
|
2182
2185
|
};
|
|
2183
|
-
an =
|
|
2184
|
-
nn(0, ve(
|
|
2185
|
-
nn(1,
|
|
2186
|
+
an = _r([
|
|
2187
|
+
nn(0, ve(di)),
|
|
2188
|
+
nn(1, li),
|
|
2186
2189
|
nn(2, z),
|
|
2187
|
-
nn(3,
|
|
2190
|
+
nn(3, gi)
|
|
2188
2191
|
], an);
|
|
2189
|
-
var
|
|
2190
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2191
|
-
(s = i[o]) && (r = s(r) || r);
|
|
2192
|
-
return r;
|
|
2192
|
+
var Sr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Dr = (i, e, n, t) => {
|
|
2193
|
+
for (var r = t > 1 ? void 0 : t ? Cr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2194
|
+
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2195
|
+
return t && r && Sr(e, n, r), r;
|
|
2193
2196
|
}, je = (i, e) => (n, t) => e(n, t, i);
|
|
2194
|
-
let cn = class extends
|
|
2197
|
+
let cn = class extends At {
|
|
2195
2198
|
constructor(e, n, t, r, o) {
|
|
2196
2199
|
super();
|
|
2197
2200
|
Ce(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
2198
2201
|
this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = t, this._univerInstanceService = r, this._contextService = o, this._init();
|
|
2199
2202
|
}
|
|
2200
2203
|
_init() {
|
|
2201
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2204
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(ye.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(ye.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(ye.UNIVER_DOC).forEach((e) => this._create(e));
|
|
2202
2205
|
}
|
|
2203
2206
|
_dispose(e) {
|
|
2204
2207
|
const n = e.getUnitId();
|
|
@@ -2213,7 +2216,7 @@ let cn = class extends Nt {
|
|
|
2213
2216
|
_hasCropObject(e) {
|
|
2214
2217
|
const n = e.getAllObjects();
|
|
2215
2218
|
for (const t of n)
|
|
2216
|
-
if (t instanceof
|
|
2219
|
+
if (t instanceof Yt)
|
|
2217
2220
|
return !0;
|
|
2218
2221
|
return !1;
|
|
2219
2222
|
}
|
|
@@ -2241,21 +2244,21 @@ let cn = class extends Nt {
|
|
|
2241
2244
|
const d = c.oKey, a = this._drawingManagerService.getDrawingOKey(d);
|
|
2242
2245
|
if (!a)
|
|
2243
2246
|
return;
|
|
2244
|
-
const { unitId: l, subUnitId:
|
|
2247
|
+
const { unitId: l, subUnitId: u, drawingId: g } = a, p = this._canvasPopManagerService.attachPopupToObject(
|
|
2245
2248
|
c,
|
|
2246
2249
|
{
|
|
2247
|
-
componentKey:
|
|
2250
|
+
componentKey: Zt,
|
|
2248
2251
|
direction: "horizontal",
|
|
2249
2252
|
offset: [2, 0],
|
|
2250
2253
|
extraProps: {
|
|
2251
|
-
menuItems: this._getImageMenuItems(l,
|
|
2254
|
+
menuItems: this._getImageMenuItems(l, u, g)
|
|
2252
2255
|
}
|
|
2253
2256
|
},
|
|
2254
2257
|
l
|
|
2255
2258
|
);
|
|
2256
|
-
r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId ===
|
|
2259
|
+
r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId === u && w.drawingId === g) && this._drawingManagerService.focusDrawing([{
|
|
2257
2260
|
unitId: l,
|
|
2258
|
-
subUnitId:
|
|
2261
|
+
subUnitId: u,
|
|
2259
2262
|
drawingId: g
|
|
2260
2263
|
}]);
|
|
2261
2264
|
})
|
|
@@ -2287,7 +2290,7 @@ let cn = class extends Nt {
|
|
|
2287
2290
|
index: 0,
|
|
2288
2291
|
commandId: ut.id,
|
|
2289
2292
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2290
|
-
disable: !!
|
|
2293
|
+
disable: !!Et.includes(e)
|
|
2291
2294
|
},
|
|
2292
2295
|
{
|
|
2293
2296
|
label: "image-popup.delete",
|
|
@@ -2299,7 +2302,7 @@ let cn = class extends Nt {
|
|
|
2299
2302
|
{
|
|
2300
2303
|
label: "image-popup.crop",
|
|
2301
2304
|
index: 2,
|
|
2302
|
-
commandId:
|
|
2305
|
+
commandId: Qt.id,
|
|
2303
2306
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2304
2307
|
disable: !0
|
|
2305
2308
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2307,7 +2310,7 @@ let cn = class extends Nt {
|
|
|
2307
2310
|
{
|
|
2308
2311
|
label: "image-popup.reset",
|
|
2309
2312
|
index: 3,
|
|
2310
|
-
commandId:
|
|
2313
|
+
commandId: Jt.id,
|
|
2311
2314
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
2312
2315
|
disable: !0
|
|
2313
2316
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2315,17 +2318,17 @@ let cn = class extends Nt {
|
|
|
2315
2318
|
];
|
|
2316
2319
|
}
|
|
2317
2320
|
};
|
|
2318
|
-
cn =
|
|
2321
|
+
cn = Dr([
|
|
2319
2322
|
je(0, Ie),
|
|
2320
|
-
je(1, ve(
|
|
2323
|
+
je(1, ve(vi)),
|
|
2321
2324
|
je(2, ee),
|
|
2322
2325
|
je(3, Q),
|
|
2323
2326
|
je(4, Vn)
|
|
2324
2327
|
], cn);
|
|
2325
|
-
var
|
|
2326
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2327
|
-
(s = i[o]) && (r = s(r) || r);
|
|
2328
|
-
return r;
|
|
2328
|
+
var Or = Object.defineProperty, Pr = Object.getOwnPropertyDescriptor, Tr = (i, e, n, t) => {
|
|
2329
|
+
for (var r = t > 1 ? void 0 : t ? Pr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2330
|
+
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2331
|
+
return t && r && Or(e, n, r), r;
|
|
2329
2332
|
}, xe = (i, e) => (n, t) => e(n, t, i);
|
|
2330
2333
|
let wn = class extends Xe {
|
|
2331
2334
|
constructor(e, n, t, r, o, s, c, d) {
|
|
@@ -2344,7 +2347,7 @@ let wn = class extends Xe {
|
|
|
2344
2347
|
});
|
|
2345
2348
|
}
|
|
2346
2349
|
_commandExecutedListener() {
|
|
2347
|
-
const e = [J.id,
|
|
2350
|
+
const e = [J.id, _i.id];
|
|
2348
2351
|
this.disposeWithMe(
|
|
2349
2352
|
this._commandService.onCommandExecuted((n) => {
|
|
2350
2353
|
if (e.includes(n.id)) {
|
|
@@ -2354,7 +2357,7 @@ let wn = class extends Xe {
|
|
|
2354
2357
|
const c = this._docSkeletonManagerService.getSkeleton();
|
|
2355
2358
|
if (c == null)
|
|
2356
2359
|
return;
|
|
2357
|
-
if (this._editorService.isEditor(o) && o !==
|
|
2360
|
+
if (this._editorService.isEditor(o) && o !== Lt) {
|
|
2358
2361
|
s == null || s.makeDirty();
|
|
2359
2362
|
return;
|
|
2360
2363
|
}
|
|
@@ -2365,8 +2368,8 @@ let wn = class extends Xe {
|
|
|
2365
2368
|
}
|
|
2366
2369
|
_initResize() {
|
|
2367
2370
|
this.disposeWithMe(
|
|
2368
|
-
|
|
2369
|
-
xn((e) => e.type ===
|
|
2371
|
+
Bt(this._context.engine.onTransformChange$).pipe(
|
|
2372
|
+
xn((e) => e.type === ri.resize),
|
|
2370
2373
|
qn(16)
|
|
2371
2374
|
).subscribe(() => {
|
|
2372
2375
|
var t;
|
|
@@ -2380,10 +2383,10 @@ let wn = class extends Xe {
|
|
|
2380
2383
|
const n = e == null ? void 0 : e.getSkeletonData(), { mainComponent: t, unitId: r } = this._context, o = t;
|
|
2381
2384
|
if (!n)
|
|
2382
2385
|
return;
|
|
2383
|
-
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages:
|
|
2386
|
+
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages: u, skeHeaders: g, skeFooters: p } = n, h = {};
|
|
2384
2387
|
this._liquid.reset();
|
|
2385
|
-
for (let
|
|
2386
|
-
const
|
|
2388
|
+
for (let P = 0, M = u.length; P < M; P++) {
|
|
2389
|
+
const b = u[P], { headerId: A, footerId: U, pageWidth: N } = b;
|
|
2387
2390
|
if (A) {
|
|
2388
2391
|
const I = (O = g.get(A)) == null ? void 0 : O.get(N);
|
|
2389
2392
|
I && this._calculateDrawingPosition(
|
|
@@ -2393,7 +2396,7 @@ let wn = class extends Xe {
|
|
|
2393
2396
|
c,
|
|
2394
2397
|
h,
|
|
2395
2398
|
I.marginTop,
|
|
2396
|
-
|
|
2399
|
+
b.marginLeft
|
|
2397
2400
|
);
|
|
2398
2401
|
}
|
|
2399
2402
|
if (U) {
|
|
@@ -2404,13 +2407,13 @@ let wn = class extends Xe {
|
|
|
2404
2407
|
s,
|
|
2405
2408
|
c,
|
|
2406
2409
|
h,
|
|
2407
|
-
|
|
2408
|
-
|
|
2410
|
+
b.pageHeight - b.marginBottom + I.marginTop,
|
|
2411
|
+
b.marginLeft
|
|
2409
2412
|
);
|
|
2410
2413
|
}
|
|
2411
|
-
this._calculateDrawingPosition(r,
|
|
2414
|
+
this._calculateDrawingPosition(r, b, s, c, h, b.marginTop, b.marginLeft), this._liquid.translatePage(b, d, a, l);
|
|
2412
2415
|
}
|
|
2413
|
-
const v = Object.values(h), w = v.filter((
|
|
2416
|
+
const v = Object.values(h), w = v.filter((P) => !P.isMultiTransform), S = v.filter((P) => P.isMultiTransform);
|
|
2414
2417
|
w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(S);
|
|
2415
2418
|
}
|
|
2416
2419
|
_handleMultiDrawingsTransform(e) {
|
|
@@ -2432,9 +2435,9 @@ let wn = class extends Xe {
|
|
|
2432
2435
|
marginTop: s,
|
|
2433
2436
|
marginLeft: c
|
|
2434
2437
|
}), d.forEach((a) => {
|
|
2435
|
-
const { aLeft: l, aTop:
|
|
2438
|
+
const { aLeft: l, aTop: u, height: g, width: p, angle: h, drawingId: v, drawingOrigin: w } = a, S = w.layoutType === H.WRAP_NONE && w.behindDoc === oe.TRUE, { isMultiTransform: O = oe.FALSE } = w, D = {
|
|
2436
2439
|
left: l + t + this._liquid.x,
|
|
2437
|
-
top:
|
|
2440
|
+
top: u + r + this._liquid.y,
|
|
2438
2441
|
width: p,
|
|
2439
2442
|
height: g,
|
|
2440
2443
|
angle: h
|
|
@@ -2458,35 +2461,35 @@ let wn = class extends Xe {
|
|
|
2458
2461
|
const n = this._docSkeletonManagerService.getSkeleton();
|
|
2459
2462
|
n != null && (this._refreshDrawing(n), this._drawingManagerService.initializeNotification(this._context.unitId));
|
|
2460
2463
|
};
|
|
2461
|
-
this._lifecycleService.stage ===
|
|
2464
|
+
this._lifecycleService.stage === Pn.Steady ? setTimeout(() => {
|
|
2462
2465
|
e();
|
|
2463
|
-
}, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n ===
|
|
2466
|
+
}, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n === Pn.Steady)).subscribe(e);
|
|
2464
2467
|
}
|
|
2465
2468
|
};
|
|
2466
|
-
wn =
|
|
2469
|
+
wn = Tr([
|
|
2467
2470
|
xe(1, ve(se)),
|
|
2468
2471
|
xe(2, z),
|
|
2469
|
-
xe(3,
|
|
2472
|
+
xe(3, Ii),
|
|
2470
2473
|
xe(4, Ie),
|
|
2471
2474
|
xe(5, ve(gn)),
|
|
2472
2475
|
xe(6, Q),
|
|
2473
|
-
xe(7, ve(
|
|
2476
|
+
xe(7, ve(xt))
|
|
2474
2477
|
], wn);
|
|
2475
|
-
var
|
|
2476
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2477
|
-
(s = i[o]) && (r = s(r) || r);
|
|
2478
|
-
return r;
|
|
2479
|
-
}, pn = (i, e) => (n, t) => e(n, t, i),
|
|
2480
|
-
const
|
|
2481
|
-
let dn = class extends
|
|
2482
|
-
constructor(i =
|
|
2478
|
+
var vt = Object.defineProperty, br = Object.getOwnPropertyDescriptor, yr = (i, e, n) => e in i ? vt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, Mr = (i, e, n, t) => {
|
|
2479
|
+
for (var r = t > 1 ? void 0 : t ? br(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2480
|
+
(s = i[o]) && (r = (t ? s(e, n, r) : s(r)) || r);
|
|
2481
|
+
return t && r && vt(e, n, r), r;
|
|
2482
|
+
}, pn = (i, e) => (n, t) => e(n, t, i), It = (i, e, n) => yr(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2483
|
+
const Rr = "DOC_DRAWING_UI_PLUGIN";
|
|
2484
|
+
let dn = class extends kt {
|
|
2485
|
+
constructor(i = Fn, e, n, t) {
|
|
2483
2486
|
super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
|
|
2484
2487
|
const { ...r } = Ht(
|
|
2485
2488
|
{},
|
|
2486
|
-
|
|
2489
|
+
Fn,
|
|
2487
2490
|
this._config
|
|
2488
2491
|
);
|
|
2489
|
-
this._configService.setConfig(
|
|
2492
|
+
this._configService.setConfig(Pi, r);
|
|
2490
2493
|
}
|
|
2491
2494
|
onStarting() {
|
|
2492
2495
|
[
|
|
@@ -2501,22 +2504,22 @@ let dn = class extends Ft {
|
|
|
2501
2504
|
[
|
|
2502
2505
|
[sn],
|
|
2503
2506
|
[wn]
|
|
2504
|
-
].forEach((i) => this._renderManagerSrv.registerRenderModule(
|
|
2507
|
+
].forEach((i) => this._renderManagerSrv.registerRenderModule(ye.UNIVER_DOC, i)), this._injector.get(rn), this._injector.get(an), this._injector.get(on);
|
|
2505
2508
|
}
|
|
2506
2509
|
onRendered() {
|
|
2507
2510
|
this._injector.get(cn);
|
|
2508
2511
|
}
|
|
2509
2512
|
};
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
dn =
|
|
2513
|
-
|
|
2514
|
-
pn(1, ve(
|
|
2513
|
+
It(dn, "type", ye.UNIVER_DOC);
|
|
2514
|
+
It(dn, "pluginName", Rr);
|
|
2515
|
+
dn = Mr([
|
|
2516
|
+
Ut(ei, Xt, Gt, mi),
|
|
2517
|
+
pn(1, ve(Ft)),
|
|
2515
2518
|
pn(2, ee),
|
|
2516
|
-
pn(3,
|
|
2519
|
+
pn(3, Wt)
|
|
2517
2520
|
], dn);
|
|
2518
2521
|
export {
|
|
2519
|
-
|
|
2522
|
+
ji as ClearDocDrawingTransformerOperation,
|
|
2520
2523
|
pt as DOCS_IMAGE_MENU_ID,
|
|
2521
2524
|
ot as DeleteDocDrawingsCommand,
|
|
2522
2525
|
ut as EditDocDrawingOperation,
|