@univerjs/docs-drawing-ui 0.6.0-nightly.202502121606 → 0.6.0-nightly.202502131606
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 +483 -486
- package/lib/umd/index.js +1 -1
- package/package.json +14 -14
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, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as
|
|
7
|
-
import { DrawingCommonPanel as
|
|
8
|
-
import { IRenderManagerService as ee, DocumentEditArea as
|
|
9
|
-
import { IMessageService as
|
|
1
|
+
var Ct = Object.defineProperty;
|
|
2
|
+
var Dt = (i, e, n) => e in i ? Ct(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var Ce = (i, e, n) => Dt(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Disposable as Xe, UndoCommand as Ot, RedoCommand as Tt, JSONX as q, IUniverInstanceService as Q, ICommandService as z, PositionedObjectLayoutType as H, CommandType as K, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as ye, TextX as vn, TextXActionType as Z, toDisposable as Le, throttle as On, COLORS as Pt, MemoryCursor as yt, IUndoRedoService as Gn, BuildTextUtils as bt, ArrangeTypeEnum as Ze, Inject as ve, IContextService as Vn, LocaleService as ln, WrapTextType as $e, DrawingTypeEnum as Mt, FOCUSING_COMMON_DRAWINGS as tn, UniverInstanceType as be, Direction as fe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as Rt, RxDisposable as Nt, SHEET_EDITOR_UNITS as At, LifecycleService as Et, DOCS_ZEN_EDITOR_UNIT_ID_KEY as xt, fromEventSubject as Lt, LifecycleStages as Tn, DependentOn as Bt, Injector as Ut, IConfigService as kt, Plugin as Ft, merge as Ht } from "@univerjs/core";
|
|
5
|
+
import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Wt } from "@univerjs/docs-drawing";
|
|
6
|
+
import { IDrawingManagerService as Ie, IImageIoService as Gt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as Pn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as jt, getImageSize as $t, getDrawingShapeKeyByDrawingSearch as zt, DRAWING_IMAGE_WIDTH_LIMIT as yn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, UniverDrawingPlugin as qt } from "@univerjs/drawing";
|
|
7
|
+
import { DrawingCommonPanel as Xt, ImageCropperObject as Kt, COMPONENT_IMAGE_POPUP_MENU as Yt, OpenImageCropOperation as Zt, ImageResetSizeOperation as Qt, UniverDrawingUIPlugin as Jt } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ei, Rect as ni, getColor as ti, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ii } from "@univerjs/engine-render";
|
|
9
|
+
import { IMessageService as ri, ILocalFileService as oi, ISidebarService as si, useDependency as we, getMenuHiddenObservable as $n, MenuItemType as zn, RibbonStartGroup as ai, KeyCode as He, ComponentManager as ci, IMenuManagerService as di, IShortcutService as li, UniverUIPlugin as gi } 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 mi, TEXT_RANGE_LAYER_INDEX as ui, getDocObject as fi, getCustomBlockIdsInSelections as hi, docDrawingPositionToTransform as pi, DocCanvasPopManagerService as wi, IEditorService as vi, SetDocZoomRatioOperation as Ii } from "@univerjs/docs-ui";
|
|
12
|
+
import { BehaviorSubject as _i, debounceTime as qn, Observable as Si, takeUntil as En, filter as xn } from "rxjs";
|
|
13
|
+
import { MessageType as Ln, InputNumber as ke, Select as Bn, Checkbox as Ci, RadioGroup as Un, Radio as Pe } 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.
|
|
18
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
19
|
-
(s = i[o]) && (r =
|
|
20
|
-
return
|
|
15
|
+
import { forwardRef as Xn, useRef as Di, createElement as Kn, useState as re, useEffect as _n } from "react";
|
|
16
|
+
const Oi = "docs-drawing-ui.config", kn = {};
|
|
17
|
+
var Ti = Object.getOwnPropertyDescriptor, Pi = (i, e, n, t) => {
|
|
18
|
+
for (var r = t > 1 ? void 0 : t ? Ti(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
19
|
+
(s = i[o]) && (r = s(r) || r);
|
|
20
|
+
return r;
|
|
21
21
|
}, Ve = (i, e) => (n, t) => e(n, t, i);
|
|
22
|
-
function
|
|
22
|
+
function yi(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 Mi(i) {
|
|
|
42
42
|
});
|
|
43
43
|
return n;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function bi(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 = yi(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
|
+
bi(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 !== Ot.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 = Pi([
|
|
129
129
|
Ve(0, Q),
|
|
130
130
|
Ve(1, z),
|
|
131
131
|
Ve(2, Ie),
|
|
@@ -134,7 +134,7 @@ rn = yi([
|
|
|
134
134
|
], rn);
|
|
135
135
|
class gn {
|
|
136
136
|
constructor() {
|
|
137
|
-
Ce(this, "_refreshDrawings$", new
|
|
137
|
+
Ce(this, "_refreshDrawings$", new _i(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 Mi = {
|
|
146
146
|
inline: H.INLINE,
|
|
147
147
|
wrapSquare: H.WRAP_SQUARE,
|
|
148
148
|
wrapTopAndBottom: H.WRAP_TOP_AND_BOTTOM,
|
|
@@ -151,12 +151,12 @@ const Ni = {
|
|
|
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(), m = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
155
|
+
if (l == null || m == 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(m.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(), m = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
|
|
238
|
+
if (g == null || a == null || m == null || l == null)
|
|
239
239
|
return !1;
|
|
240
|
-
const p = l.getEditArea(), h =
|
|
240
|
+
const p = l.getEditArea(), h = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = a, O = q.getInstance(), D = [], { drawings: T = {} } = g.getSnapshot();
|
|
241
241
|
for (const N of n) {
|
|
242
|
-
const { drawingId: I } = N, L =
|
|
242
|
+
const { drawingId: I } = N, L = T[I].layoutType, W = Mi[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 = T[I].behindDoc, R = t === "behindText" ? oe.TRUE : oe.FALSE;
|
|
249
249
|
if (C !== R) {
|
|
250
|
-
const
|
|
251
|
-
D.push(
|
|
250
|
+
const P = O.replaceOp(["drawings", I, "behindDoc"], C, R);
|
|
251
|
+
D.push(P);
|
|
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: P, marginTop: B, marginLeft: k, marginBottom: b, pageWidth: E, pageHeight: $ } = C;
|
|
259
259
|
switch (p) {
|
|
260
|
-
case
|
|
261
|
-
const
|
|
262
|
-
|
|
260
|
+
case Fe.HEADER: {
|
|
261
|
+
const F = (A = w.get(R)) == null ? void 0 : A.get(E);
|
|
262
|
+
F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = F.marginTop, _ = k);
|
|
263
263
|
break;
|
|
264
264
|
}
|
|
265
|
-
case
|
|
266
|
-
const
|
|
267
|
-
|
|
265
|
+
case Fe.FOOTER: {
|
|
266
|
+
const F = (U = S.get(P)) == null ? void 0 : U.get(E);
|
|
267
|
+
F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = $ - b + F.marginTop, _ = k);
|
|
268
268
|
break;
|
|
269
269
|
}
|
|
270
|
-
case
|
|
271
|
-
C.skeDrawings.has(I) && (x = C.skeDrawings.get(I), G = B, _ =
|
|
270
|
+
case Fe.BODY: {
|
|
271
|
+
C.skeDrawings.has(I) && (x = C.skeDrawings.get(I), G = B, _ = k);
|
|
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, P = T[I].docTransform.positionH;
|
|
280
280
|
let B = R;
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
relativeFrom:
|
|
281
|
+
P.relativeFrom === ne.MARGIN ? B -= _ : P.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
|
|
282
|
+
const k = {
|
|
283
|
+
relativeFrom: P.relativeFrom,
|
|
284
284
|
posOffset: B
|
|
285
285
|
};
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
D.push(
|
|
286
|
+
if (P.posOffset !== k.posOffset) {
|
|
287
|
+
const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], P, k);
|
|
288
|
+
D.push(F);
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const b = T[I].docTransform.positionV;
|
|
291
291
|
let E = C;
|
|
292
|
-
|
|
292
|
+
b.relativeFrom === V.PAGE ? E += G : b.relativeFrom === V.LINE ? E -= x.lineTop : b.relativeFrom === V.PARAGRAPH && (E -= x.blockAnchorTop);
|
|
293
293
|
const $ = {
|
|
294
|
-
relativeFrom:
|
|
294
|
+
relativeFrom: b.relativeFrom,
|
|
295
295
|
posOffset: E
|
|
296
296
|
};
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
D.push(
|
|
297
|
+
if (b.posOffset !== $.posOffset) {
|
|
298
|
+
const F = O.replaceOp(["drawings", I, "docTransform", "positionV"], b, $);
|
|
299
|
+
D.push(F);
|
|
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 y = o.syncExecuteCommand(M.id, M.params);
|
|
313
|
+
return h.refreshControls(), !!y;
|
|
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 m = {
|
|
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 m.params.actions = a.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(m.id, m.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 m = {
|
|
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 m.params.actions = a.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(m.id, m.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, m = 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, T = p[S].docTransform[O];
|
|
387
|
+
if (!ye.diffValue(T, D)) {
|
|
388
|
+
const M = m.replaceOp(["drawings", S, "docTransform", O], T, 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), m = i.get(Q).getCurrentUniverDocInstance();
|
|
416
|
+
if (m == 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, T = (N = t.getSegment()) != null ? N : "", M = Yn(
|
|
422
422
|
v,
|
|
423
|
-
|
|
423
|
+
T,
|
|
424
424
|
w,
|
|
425
425
|
h,
|
|
426
426
|
D,
|
|
427
|
-
|
|
427
|
+
m,
|
|
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 y = {
|
|
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
|
+
y.params.actions = O.reduce((I, L) => q.compose(I, L), null);
|
|
442
|
+
const A = a.syncExecuteCommand(y.id, y.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: m, 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 T = q.getInstance(), { drawings: M = {} } = a.getSnapshot(), y = M[S].docTransform, { positionH: A, positionV: U, size: N, angle: I } = y;
|
|
472
|
+
if (!ye.diffValue(A, p.positionH)) {
|
|
473
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"], A, p.positionH);
|
|
474
474
|
w.push(_);
|
|
475
475
|
}
|
|
476
|
-
if (!
|
|
477
|
-
const _ =
|
|
476
|
+
if (!ye.diffValue(U, p.positionV)) {
|
|
477
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "positionV"], U, p.positionV);
|
|
478
478
|
w.push(_);
|
|
479
479
|
}
|
|
480
|
-
if (!
|
|
481
|
-
const _ =
|
|
480
|
+
if (!ye.diffValue(N, p.size)) {
|
|
481
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "size"], N, p.size);
|
|
482
482
|
w.push(_);
|
|
483
483
|
}
|
|
484
|
-
if (!
|
|
485
|
-
const _ =
|
|
484
|
+
if (!ye.diffValue(I, p.angle)) {
|
|
485
|
+
const _ = T.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: m,
|
|
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 =
|
|
505
|
-
return
|
|
502
|
+
var Ri = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
|
|
503
|
+
for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
504
|
+
(s = i[o]) && (r = s(r) || r);
|
|
505
|
+
return r;
|
|
506
506
|
}, Qe = (i, e) => (n, t) => e(n, t, i);
|
|
507
|
-
const
|
|
508
|
-
function
|
|
507
|
+
const Ai = "__InlineDrawingAnchor__";
|
|
508
|
+
function Fn(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: m, 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: m,
|
|
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: m, height: g, top: p, left: h, angle: v } = l;
|
|
575
|
+
if (a && m === 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 m = this._transformerCache.get(l == null ? void 0 : l.drawingId);
|
|
591
|
+
(m == null ? void 0 : m.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: m, height: g, top: p, left: h, angle: v } = l;
|
|
597
|
+
if (a && m === 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 ? m !== 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: m } = 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: T, height: M } = this._getPageContentSize(h);
|
|
623
|
+
if (l = Math.min(l, T), m = Math.min(m, M), (S !== l || O !== m) && n.push({
|
|
624
624
|
drawingId: g.drawingId,
|
|
625
625
|
key: "size",
|
|
626
626
|
value: {
|
|
627
627
|
width: l,
|
|
628
|
-
height:
|
|
628
|
+
height: m
|
|
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 y = d - v, A = c - w;
|
|
636
|
+
y !== 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 + y
|
|
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: m,
|
|
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 T = o == null ? void 0 : o.findNodeByCoord(
|
|
691
691
|
O,
|
|
692
692
|
l,
|
|
693
|
-
|
|
693
|
+
m,
|
|
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 (T) {
|
|
702
|
+
const { node: _, ratioX: C, segmentPage: R, segmentId: P } = T;
|
|
703
|
+
h = C < S, p = _, v = R, w = P;
|
|
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), y = this._getDocObject();
|
|
708
|
+
if (M == null || o == null || y == null || Fn(M))
|
|
709
709
|
return;
|
|
710
710
|
const A = {
|
|
711
711
|
...M,
|
|
712
712
|
isBack: h
|
|
713
|
-
}, U =
|
|
713
|
+
}, U = y.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, Te, 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, m = a, g = l.getViewports()[0], { pageLayoutType: p = Mn.VERTICAL, pageMarginLeft: h, pageMarginTop: v, docsLeft: w, docsTop: S } = m.getOffsetConfig(), { left: O, top: D, angle: T } = n;
|
|
724
|
+
let { width: M, height: y } = 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), y = Math.min(y, 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: y
|
|
733
733
|
},
|
|
734
|
-
angle:
|
|
735
|
-
}, { x: C, y: R } = l.getViewportScrollXY(g),
|
|
736
|
-
if (
|
|
734
|
+
angle: T
|
|
735
|
+
}, { x: C, y: R } = l.getViewportScrollXY(g), P = this._getTransformCoordForDocumentOffset(m, g, O - C, D - R);
|
|
736
|
+
if (P == 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 k = r == null ? void 0 : r.findNodeByCoord(P, 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 (k) {
|
|
747
|
+
const { node: pe, segmentPage: mn, segmentId: un } = k;
|
|
748
748
|
L = pe, x = mn, W = un;
|
|
749
749
|
}
|
|
750
750
|
if (L == null)
|
|
751
751
|
return;
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
752
|
+
const b = (Se = L.parent) == null ? void 0 : Se.parent, E = b == null ? void 0 : b.parent, $ = (de = E == null ? void 0 : E.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : E == null ? void 0 : E.lines[0], F = (De = E == null ? void 0 : E.parent) == null ? void 0 : De.parent;
|
|
753
|
+
if (b == null || E == null || $ == null || F == null)
|
|
754
754
|
return;
|
|
755
755
|
this._liquid.reset();
|
|
756
|
-
const Y =
|
|
756
|
+
const Y = F.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: It, pageWidth: Cn, marginLeft: Dn, marginBottom: _t } = pe, St = s.indexOf(pe);
|
|
759
|
+
if (x > -1 && St === 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: It - _t + 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 === F)
|
|
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 = b.divides[0].glyphGroup[0] : L = (ge = (le = (Te = (Ae = $.divides) == null ? void 0 : Ae[0]) == null ? void 0 : Te.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 - F.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 - F.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 - b.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 || Fn(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: m, 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), m = Math.min(h, m), (l !== o || m !== s) && t.push({
|
|
838
838
|
drawingId: r.drawingId,
|
|
839
839
|
key: "size",
|
|
840
840
|
value: {
|
|
841
841
|
width: l,
|
|
842
|
-
height:
|
|
842
|
+
height: m
|
|
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: m } = l != null ? l : {};
|
|
871
|
+
if (l == null || t == null || m == 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 m) {
|
|
883
|
+
const { marginBottom: T, pageHeight: M } = D, y = m.indexOf(D), A = m[y + 1];
|
|
884
884
|
if (A == null)
|
|
885
885
|
continue;
|
|
886
|
-
if (
|
|
886
|
+
if (ye.hasIntersectionBetweenTwoRanges(
|
|
887
887
|
o,
|
|
888
888
|
o + c,
|
|
889
|
-
this._liquid.y + h + M -
|
|
889
|
+
this._liquid.y + h + M - T,
|
|
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 - T - 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(ei.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 = mi(n), { left: l, top: m, height: g } = a, p = l + c, h = m + 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 ni(Ai + ye.generateRandomId(v), {
|
|
947
947
|
left: p,
|
|
948
948
|
top: h,
|
|
949
949
|
height: g,
|
|
950
950
|
strokeWidth: 2,
|
|
951
|
-
stroke:
|
|
951
|
+
stroke: ti(Pt.darkGray, 1),
|
|
952
952
|
evented: !1
|
|
953
953
|
});
|
|
954
|
-
this._anchorShape = w, o.addObject(w,
|
|
954
|
+
this._anchorShape = w, o.addObject(w, ui);
|
|
955
955
|
}
|
|
956
956
|
_getDocObject() {
|
|
957
|
-
return
|
|
957
|
+
return fi(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: m, marginBottom: g, marginRight: p, marginTop: h } = d;
|
|
977
977
|
return {
|
|
978
|
-
width: Math.max(r, a -
|
|
978
|
+
width: Math.max(r, a - m - 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 = Ni([
|
|
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
|
+
}, Ei = 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 = Ei(i, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Di("_".concat(Bi()));
|
|
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 }, xi(i, n, r)), t), (Li(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 xi(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 Ui(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 Li(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 Bi() {
|
|
1034
1034
|
return Math.random().toString(36).substring(2, 8);
|
|
1035
1035
|
}
|
|
1036
1036
|
tt.displayName = "UniverIcon";
|
|
1037
|
-
var
|
|
1037
|
+
var Ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, 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: Ui
|
|
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, y, 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(), m = (A = (y = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? A : [], g = c.map((N) => m.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,27 +1113,29 @@ const Sn = {
|
|
|
1113
1113
|
const n = i.get(Be);
|
|
1114
1114
|
if (!e) return !1;
|
|
1115
1115
|
const t = [];
|
|
1116
|
-
|
|
1117
|
-
t.push(
|
|
1118
|
-
t.push(
|
|
1116
|
+
e.forEach(({ parent: l, children: m }) => {
|
|
1117
|
+
t.push(l.unitId), m.forEach((g) => {
|
|
1118
|
+
t.push(g.unitId);
|
|
1119
1119
|
});
|
|
1120
|
-
})
|
|
1120
|
+
});
|
|
1121
|
+
const r = n.getGroupDrawingOp(e), { unitId: o, subUnitId: s, undo: c, redo: d, objects: a } = r;
|
|
1122
|
+
return !1;
|
|
1121
1123
|
}
|
|
1122
1124
|
}, at = {
|
|
1123
1125
|
id: "doc.command.insert-doc-image",
|
|
1124
1126
|
type: K.COMMAND,
|
|
1125
1127
|
// eslint-disable-next-line max-lines-per-function
|
|
1126
1128
|
handler: (i, e) => {
|
|
1127
|
-
var
|
|
1129
|
+
var y, A, U, N;
|
|
1128
1130
|
if (e == null)
|
|
1129
1131
|
return !1;
|
|
1130
1132
|
const n = i.get(z), t = i.get(In), r = i.get(Q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
|
|
1131
1133
|
if (o == null || s == null)
|
|
1132
1134
|
return !1;
|
|
1133
|
-
const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId:
|
|
1135
|
+
const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId: m } = o, g = s.getSelfOrHeaderFooterModel(m).getBody();
|
|
1134
1136
|
if (g == null)
|
|
1135
1137
|
return !1;
|
|
1136
|
-
const p = new vn(), h = q.getInstance(), v = [], w = (A = (
|
|
1138
|
+
const p = new vn(), h = q.getInstance(), v = [], w = (A = (y = s.getSnapshot().drawingsOrder) == null ? void 0 : y.length) != null ? A : 0;
|
|
1137
1139
|
let S = 0;
|
|
1138
1140
|
if (a)
|
|
1139
1141
|
l > 0 && p.push({
|
|
@@ -1141,16 +1143,16 @@ const Sn = {
|
|
|
1141
1143
|
len: l
|
|
1142
1144
|
});
|
|
1143
1145
|
else {
|
|
1144
|
-
const I =
|
|
1146
|
+
const I = bt.selection.delete([o], g, 0, null, !1);
|
|
1145
1147
|
p.push(...I);
|
|
1146
|
-
const L =
|
|
1148
|
+
const L = hi(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);
|
|
1147
1149
|
if (G.length > 0)
|
|
1148
1150
|
for (const _ of G) {
|
|
1149
1151
|
const C = W[_], R = x.indexOf(_);
|
|
1150
1152
|
if (C == null || R < 0)
|
|
1151
1153
|
continue;
|
|
1152
|
-
const
|
|
1153
|
-
v.push(
|
|
1154
|
+
const P = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
|
|
1155
|
+
v.push(P), v.push(B), S++;
|
|
1154
1156
|
}
|
|
1155
1157
|
}
|
|
1156
1158
|
p.push({
|
|
@@ -1164,13 +1166,13 @@ const Sn = {
|
|
|
1164
1166
|
},
|
|
1165
1167
|
len: d.length
|
|
1166
1168
|
});
|
|
1167
|
-
const O = ze(s,
|
|
1169
|
+
const O = ze(s, m), D = h.editOp(p.serialize(), O);
|
|
1168
1170
|
v.push(D);
|
|
1169
1171
|
for (const I of d) {
|
|
1170
1172
|
const { drawingId: L } = I, W = h.insertOp(["drawings", L], I), x = h.insertOp(["drawingsOrder", w - S], L);
|
|
1171
1173
|
v.push(W), v.push(x);
|
|
1172
1174
|
}
|
|
1173
|
-
const
|
|
1175
|
+
const T = {
|
|
1174
1176
|
id: J.id,
|
|
1175
1177
|
params: {
|
|
1176
1178
|
unitId: c,
|
|
@@ -1178,7 +1180,7 @@ const Sn = {
|
|
|
1178
1180
|
textRanges: []
|
|
1179
1181
|
}
|
|
1180
1182
|
};
|
|
1181
|
-
return
|
|
1183
|
+
return T.params.actions = v.reduce((I, L) => q.compose(I, L), null), !!n.syncExecuteCommand(T.id, T.params);
|
|
1182
1184
|
}
|
|
1183
1185
|
}, ct = {
|
|
1184
1186
|
id: "doc.command.set-drawing-arrange",
|
|
@@ -1194,9 +1196,9 @@ const Sn = {
|
|
|
1194
1196
|
const { redo: l } = a;
|
|
1195
1197
|
if (l == null)
|
|
1196
1198
|
return !1;
|
|
1197
|
-
const
|
|
1198
|
-
let g =
|
|
1199
|
-
g = g.slice(3), g.unshift("drawingsOrder"),
|
|
1199
|
+
const m = [];
|
|
1200
|
+
let g = ye.deepClone(l);
|
|
1201
|
+
g = g.slice(3), g.unshift("drawingsOrder"), m.push(g);
|
|
1200
1202
|
const p = {
|
|
1201
1203
|
id: J.id,
|
|
1202
1204
|
params: {
|
|
@@ -1205,7 +1207,7 @@ const Sn = {
|
|
|
1205
1207
|
textRanges: null
|
|
1206
1208
|
}
|
|
1207
1209
|
};
|
|
1208
|
-
return p.params.actions =
|
|
1210
|
+
return p.params.actions = m.reduce((v, w) => q.compose(v, w), null), !!n.syncExecuteCommand(p.id, p.params);
|
|
1209
1211
|
}
|
|
1210
1212
|
}, dt = {
|
|
1211
1213
|
id: "doc.command.ungroup-doc-image",
|
|
@@ -1215,30 +1217,32 @@ const Sn = {
|
|
|
1215
1217
|
const n = i.get(Be);
|
|
1216
1218
|
if (!e) return !1;
|
|
1217
1219
|
const t = [];
|
|
1218
|
-
|
|
1219
|
-
t.push(
|
|
1220
|
-
t.push(
|
|
1220
|
+
e.forEach(({ parent: l, children: m }) => {
|
|
1221
|
+
t.push(l.unitId), m.forEach((g) => {
|
|
1222
|
+
t.push(g.unitId);
|
|
1221
1223
|
});
|
|
1222
|
-
})
|
|
1224
|
+
});
|
|
1225
|
+
const r = n.getUngroupDrawingOp(e), { unitId: o, subUnitId: s, undo: c, redo: d, objects: a } = r;
|
|
1226
|
+
return !1;
|
|
1223
1227
|
}
|
|
1224
1228
|
};
|
|
1225
|
-
var
|
|
1226
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1227
|
-
(s = i[o]) && (r =
|
|
1228
|
-
return
|
|
1229
|
+
var ki = Object.getOwnPropertyDescriptor, Fi = (i, e, n, t) => {
|
|
1230
|
+
for (var r = t > 1 ? void 0 : t ? ki(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1231
|
+
(s = i[o]) && (r = s(r) || r);
|
|
1232
|
+
return r;
|
|
1229
1233
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
1230
1234
|
let sn = class extends Xe {
|
|
1231
|
-
constructor(i, e, n, t, r, o, s, c, d, a, l,
|
|
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 =
|
|
1235
|
+
constructor(i, e, n, t, r, o, s, c, d, a, l, m, g) {
|
|
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 = m, this._fileOpenerService = g, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
|
|
1233
1237
|
}
|
|
1234
1238
|
async insertDocImage() {
|
|
1235
1239
|
const i = await this._fileOpenerService.openFile({
|
|
1236
1240
|
multiple: !0,
|
|
1237
1241
|
accept: Vt.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
1238
1242
|
}), e = i.length;
|
|
1239
|
-
return e >
|
|
1243
|
+
return e > Pn ? (this._messageService.show({
|
|
1240
1244
|
type: Ln.Error,
|
|
1241
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
1245
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Pn))
|
|
1242
1246
|
}), !1) : e === 0 ? !1 : (await this._insertFloatImages(i), !0);
|
|
1243
1247
|
}
|
|
1244
1248
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1271,11 +1275,11 @@ let sn = class extends Xe {
|
|
|
1271
1275
|
for (const r of e) {
|
|
1272
1276
|
if (r == null)
|
|
1273
1277
|
continue;
|
|
1274
|
-
const { imageId: o, imageSourceType: s, source: c, base64Cache: d } = r, { width: a, height: l, image:
|
|
1275
|
-
this._imageIoService.addImageSourceCache(o, s,
|
|
1278
|
+
const { imageId: o, imageSourceType: s, source: c, base64Cache: d } = r, { width: a, height: l, image: m } = await $t(d || "");
|
|
1279
|
+
this._imageIoService.addImageSourceCache(o, s, m);
|
|
1276
1280
|
let g = 1;
|
|
1277
|
-
if (a >
|
|
1278
|
-
const w =
|
|
1281
|
+
if (a > yn || l > bn) {
|
|
1282
|
+
const w = yn / a, S = bn / l;
|
|
1279
1283
|
g = Math.min(w, S);
|
|
1280
1284
|
}
|
|
1281
1285
|
const p = this._getImagePosition(a * g, l * g);
|
|
@@ -1285,10 +1289,10 @@ let sn = class extends Xe {
|
|
|
1285
1289
|
unitId: n,
|
|
1286
1290
|
subUnitId: n,
|
|
1287
1291
|
drawingId: o,
|
|
1288
|
-
drawingType:
|
|
1292
|
+
drawingType: Mt.DRAWING_IMAGE,
|
|
1289
1293
|
imageSourceType: s,
|
|
1290
1294
|
source: c,
|
|
1291
|
-
transform:
|
|
1295
|
+
transform: pi(p),
|
|
1292
1296
|
docTransform: p,
|
|
1293
1297
|
behindDoc: oe.FALSE,
|
|
1294
1298
|
title: "",
|
|
@@ -1311,12 +1315,11 @@ let sn = class extends Xe {
|
|
|
1311
1315
|
_isInsertInHeaderFooter() {
|
|
1312
1316
|
var t;
|
|
1313
1317
|
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();
|
|
1314
|
-
return n ===
|
|
1318
|
+
return n === Fe.HEADER || n === Fe.FOOTER;
|
|
1315
1319
|
}
|
|
1316
1320
|
_getImagePosition(i, e) {
|
|
1317
1321
|
const n = this._docSelectionRenderService.getActiveTextRange(), t = (n == null ? void 0 : n.getAbsolutePosition()) || {
|
|
1318
|
-
left: 0
|
|
1319
|
-
top: 0
|
|
1322
|
+
left: 0
|
|
1320
1323
|
};
|
|
1321
1324
|
return {
|
|
1322
1325
|
size: {
|
|
@@ -1408,11 +1411,11 @@ let sn = class extends Xe {
|
|
|
1408
1411
|
const { unit: i, scene: e, unitId: n } = this._context, t = (c = this._renderManagerSrv.getRenderById(n)) == null ? void 0 : c.with(se).getViewModel();
|
|
1409
1412
|
if (t == null || i == null)
|
|
1410
1413
|
return;
|
|
1411
|
-
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() ===
|
|
1414
|
+
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Fe.BODY;
|
|
1412
1415
|
for (const d of Object.keys(o)) {
|
|
1413
|
-
const a = o[d], l = zt({ unitId: n, drawingId: a.drawingId, subUnitId: n }),
|
|
1414
|
-
if (
|
|
1415
|
-
for (const g of
|
|
1416
|
+
const a = o[d], l = zt({ unitId: n, drawingId: a.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
|
|
1417
|
+
if (m.length)
|
|
1418
|
+
for (const g of m)
|
|
1416
1419
|
e.detachTransformerFrom(g), g.setOpacity(0.5), (s && a.isMultiTransform !== oe.TRUE || !s && a.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(g), g.setOpacity(1));
|
|
1417
1420
|
}
|
|
1418
1421
|
}
|
|
@@ -1444,26 +1447,26 @@ let sn = class extends Xe {
|
|
|
1444
1447
|
this._docSelectionManagerService.replaceDocRanges(t);
|
|
1445
1448
|
}
|
|
1446
1449
|
};
|
|
1447
|
-
sn =
|
|
1450
|
+
sn = Fi([
|
|
1448
1451
|
me(1, z),
|
|
1449
1452
|
me(2, ve(In)),
|
|
1450
1453
|
me(3, ee),
|
|
1451
|
-
me(4,
|
|
1454
|
+
me(4, Gt),
|
|
1452
1455
|
me(5, Be),
|
|
1453
1456
|
me(6, Ie),
|
|
1454
1457
|
me(7, Vn),
|
|
1455
|
-
me(8,
|
|
1458
|
+
me(8, ri),
|
|
1456
1459
|
me(9, ve(ln)),
|
|
1457
1460
|
me(10, ve(Me)),
|
|
1458
1461
|
me(11, ve(gn)),
|
|
1459
|
-
me(12,
|
|
1462
|
+
me(12, oi)
|
|
1460
1463
|
], sn);
|
|
1461
1464
|
const lt = {
|
|
1462
1465
|
id: "doc.command.insert-float-image",
|
|
1463
1466
|
type: K.COMMAND,
|
|
1464
1467
|
handler: (i) => {
|
|
1465
1468
|
var n, t;
|
|
1466
|
-
return (t = (n = i.get(ee).getCurrentTypeOfRenderer(
|
|
1469
|
+
return (t = (n = i.get(ee).getCurrentTypeOfRenderer(be.UNIVER_DOC)) == null ? void 0 : n.with(sn).insertDocImage()) != null ? t : !1;
|
|
1467
1470
|
}
|
|
1468
1471
|
}, Ke = {
|
|
1469
1472
|
id: "doc.command.move-drawing",
|
|
@@ -1475,16 +1478,16 @@ const lt = {
|
|
|
1475
1478
|
const d = c[0].unitId, a = o.getRenderById(d), l = a == null ? void 0 : a.scene;
|
|
1476
1479
|
if (l == null)
|
|
1477
1480
|
return !1;
|
|
1478
|
-
const
|
|
1479
|
-
var
|
|
1480
|
-
const { drawingId: w } = v, S = (
|
|
1481
|
+
const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), p = c.map((v) => {
|
|
1482
|
+
var y, A, U, N, I;
|
|
1483
|
+
const { drawingId: w } = v, S = (y = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : y[w];
|
|
1481
1484
|
if (S == null || S.layoutType === H.INLINE)
|
|
1482
1485
|
return null;
|
|
1483
|
-
const { positionH: O, positionV: D } = S.docTransform,
|
|
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 ?
|
|
1486
|
+
const { positionH: O, positionV: D } = S.docTransform, T = { ...O }, M = { ...D };
|
|
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 ? T.posOffset = ((N = T.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (T.posOffset = ((I = T.posOffset) != null ? I : 0) + 2), {
|
|
1485
1488
|
drawingId: w,
|
|
1486
1489
|
key: s === fe.UP || s === fe.DOWN ? "positionV" : "positionH",
|
|
1487
|
-
value: s === fe.UP || s === fe.DOWN ? M :
|
|
1490
|
+
value: s === fe.UP || s === fe.DOWN ? M : T
|
|
1488
1491
|
};
|
|
1489
1492
|
}).filter((v) => v != null);
|
|
1490
1493
|
if (p.length === 0)
|
|
@@ -1494,9 +1497,9 @@ const lt = {
|
|
|
1494
1497
|
subUnitId: d,
|
|
1495
1498
|
drawings: p
|
|
1496
1499
|
});
|
|
1497
|
-
return
|
|
1500
|
+
return m.refreshControls(), !!h;
|
|
1498
1501
|
}
|
|
1499
|
-
},
|
|
1502
|
+
}, Hi = {
|
|
1500
1503
|
id: "doc.operation.clear-drawing-transformer",
|
|
1501
1504
|
type: K.MUTATION,
|
|
1502
1505
|
handler: (i, e) => {
|
|
@@ -1510,7 +1513,7 @@ const lt = {
|
|
|
1510
1513
|
id: "sidebar.operation.doc-image",
|
|
1511
1514
|
type: K.COMMAND,
|
|
1512
1515
|
handler: async (i, e) => {
|
|
1513
|
-
const n = i.get(
|
|
1516
|
+
const n = i.get(si), t = i.get(ln), r = i.get(Ie);
|
|
1514
1517
|
switch (e.value) {
|
|
1515
1518
|
case "open":
|
|
1516
1519
|
n.open({
|
|
@@ -1550,27 +1553,21 @@ function j() {
|
|
|
1550
1553
|
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = ft(i)) && (t && (t += " "), t += e);
|
|
1551
1554
|
return t;
|
|
1552
1555
|
}
|
|
1553
|
-
const
|
|
1554
|
-
imageCommonPanel:
|
|
1555
|
-
imageCommonPanelGrid:
|
|
1556
|
-
imageCommonPanelBorder:
|
|
1557
|
-
imageCommonPanelTitle:
|
|
1558
|
-
imageCommonPanelSubtitle:
|
|
1559
|
-
imageCommonPanelRow:
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
imageCommonPanelSpan2: nr,
|
|
1565
|
-
imageCommonPanelSpan3: tr,
|
|
1566
|
-
imageCommonPanelInput: ir,
|
|
1567
|
-
sheetImageMenu: rr,
|
|
1568
|
-
sheetImageMenuInput: or
|
|
1569
|
-
}, Hn = -1e3, Wn = 1e3, sr = (i) => {
|
|
1556
|
+
const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", Vi = "univer-image-common-panel-border", ji = "univer-image-common-panel-title", $i = "univer-image-common-panel-subtitle", zi = "univer-image-common-panel-row", qi = "univer-image-common-panel-column", Xi = "univer-image-common-panel-span2", Ki = "univer-image-common-panel-input", u = {
|
|
1557
|
+
imageCommonPanel: Wi,
|
|
1558
|
+
imageCommonPanelGrid: Gi,
|
|
1559
|
+
imageCommonPanelBorder: Vi,
|
|
1560
|
+
imageCommonPanelTitle: ji,
|
|
1561
|
+
imageCommonPanelSubtitle: $i,
|
|
1562
|
+
imageCommonPanelRow: zi,
|
|
1563
|
+
imageCommonPanelColumn: qi,
|
|
1564
|
+
imageCommonPanelSpan2: Xi,
|
|
1565
|
+
imageCommonPanelInput: Ki
|
|
1566
|
+
}, Hn = -1e3, Wn = 1e3, Yi = (i) => {
|
|
1570
1567
|
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, c = s[0];
|
|
1571
1568
|
if (c == null)
|
|
1572
1569
|
return;
|
|
1573
|
-
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor,
|
|
1570
|
+
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), g = m == null ? void 0 : m.scene;
|
|
1574
1571
|
if (g == null)
|
|
1575
1572
|
return;
|
|
1576
1573
|
const p = g.getTransformerByCreate(), h = [{
|
|
@@ -1600,106 +1597,106 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1600
1597
|
}], [w, S] = re(!0), [O, D] = re({
|
|
1601
1598
|
relativeFrom: ne.PAGE,
|
|
1602
1599
|
posOffset: 0
|
|
1603
|
-
}), [
|
|
1600
|
+
}), [T, M] = re({
|
|
1604
1601
|
relativeFrom: V.PAGE,
|
|
1605
1602
|
posOffset: 0
|
|
1606
|
-
}), [
|
|
1603
|
+
}), [y, A] = re(!0), [U, N] = re(!0);
|
|
1607
1604
|
function I(C, R) {
|
|
1608
|
-
var
|
|
1605
|
+
var b;
|
|
1609
1606
|
C === "positionH" ? D(R) : M(R);
|
|
1610
|
-
const
|
|
1611
|
-
if (
|
|
1607
|
+
const P = t.getFocusDrawings();
|
|
1608
|
+
if (P.length === 0)
|
|
1612
1609
|
return;
|
|
1613
|
-
const B =
|
|
1610
|
+
const B = P.map((E) => ({
|
|
1614
1611
|
unitId: E.unitId,
|
|
1615
1612
|
subUnitId: E.subUnitId,
|
|
1616
1613
|
drawingId: E.drawingId
|
|
1617
1614
|
}));
|
|
1618
1615
|
e.executeCommand(qe.id, {
|
|
1619
|
-
unitId:
|
|
1620
|
-
subUnitId:
|
|
1616
|
+
unitId: P[0].unitId,
|
|
1617
|
+
subUnitId: P[0].unitId,
|
|
1621
1618
|
drawings: B.map((E) => ({
|
|
1622
1619
|
drawingId: E.drawingId,
|
|
1623
1620
|
key: C,
|
|
1624
1621
|
value: R
|
|
1625
1622
|
}))
|
|
1626
1623
|
});
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1624
|
+
const k = (b = r.getRenderById(d)) == null ? void 0 : b.with(Me);
|
|
1625
|
+
k && k.blur(), p.refreshControls();
|
|
1629
1626
|
}
|
|
1630
1627
|
function L(C) {
|
|
1631
1628
|
var ie, _e, Se;
|
|
1632
|
-
const R = O.relativeFrom,
|
|
1629
|
+
const R = O.relativeFrom, P = O.posOffset, B = Number(C);
|
|
1633
1630
|
if (R === B)
|
|
1634
1631
|
return;
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1632
|
+
const k = t.getFocusDrawings();
|
|
1633
|
+
if (k.length === 0)
|
|
1637
1634
|
return;
|
|
1638
|
-
const
|
|
1639
|
-
let $ = null,
|
|
1635
|
+
const b = k[0].drawingId, E = k[0].unitId;
|
|
1636
|
+
let $ = null, F = 0;
|
|
1640
1637
|
const Y = (ie = r.getRenderById(E)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Y == null ? void 0 : Y.getSkeletonData();
|
|
1641
1638
|
if (ae == null)
|
|
1642
1639
|
return;
|
|
1643
1640
|
const { pages: Ue, skeHeaders: Re, skeFooters: We } = ae;
|
|
1644
1641
|
for (const de of Ue) {
|
|
1645
|
-
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth:
|
|
1646
|
-
if (Oe.has(
|
|
1647
|
-
$ = Oe.get(
|
|
1642
|
+
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth: Te } = de;
|
|
1643
|
+
if (Oe.has(b)) {
|
|
1644
|
+
$ = Oe.get(b), F = De;
|
|
1648
1645
|
break;
|
|
1649
1646
|
}
|
|
1650
|
-
const le = (_e = Re.get(Ne)) == null ? void 0 : _e.get(
|
|
1651
|
-
if (le != null && le.skeDrawings.has(
|
|
1652
|
-
$ = le == null ? void 0 : le.skeDrawings.get(
|
|
1647
|
+
const le = (_e = Re.get(Ne)) == null ? void 0 : _e.get(Te);
|
|
1648
|
+
if (le != null && le.skeDrawings.has(b)) {
|
|
1649
|
+
$ = le == null ? void 0 : le.skeDrawings.get(b), F = De;
|
|
1653
1650
|
break;
|
|
1654
1651
|
}
|
|
1655
|
-
const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(
|
|
1656
|
-
if (ge != null && ge.skeDrawings.has(
|
|
1657
|
-
$ = ge == null ? void 0 : ge.skeDrawings.get(
|
|
1652
|
+
const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(Te);
|
|
1653
|
+
if (ge != null && ge.skeDrawings.has(b)) {
|
|
1654
|
+
$ = ge == null ? void 0 : ge.skeDrawings.get(b), F = De;
|
|
1658
1655
|
break;
|
|
1659
1656
|
}
|
|
1660
1657
|
}
|
|
1661
1658
|
if ($ == null)
|
|
1662
1659
|
return;
|
|
1663
1660
|
let ce = 0;
|
|
1664
|
-
R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -=
|
|
1661
|
+
R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -= F), B === ne.COLUMN ? ce += $.columnLeft : B === ne.MARGIN ? ce += F : ne.PAGE;
|
|
1665
1662
|
const te = {
|
|
1666
1663
|
relativeFrom: B,
|
|
1667
|
-
posOffset: (
|
|
1664
|
+
posOffset: (P != null ? P : 0) - ce
|
|
1668
1665
|
};
|
|
1669
1666
|
I("positionH", te);
|
|
1670
1667
|
}
|
|
1671
1668
|
function W(C) {
|
|
1672
|
-
var Oe, Ne, Ae,
|
|
1673
|
-
const R =
|
|
1669
|
+
var Oe, Ne, Ae, Te, le, ge;
|
|
1670
|
+
const R = T.relativeFrom, P = T.posOffset, B = Number(C);
|
|
1674
1671
|
if (R === B)
|
|
1675
1672
|
return;
|
|
1676
|
-
const
|
|
1677
|
-
if (
|
|
1673
|
+
const k = t.getFocusDrawings();
|
|
1674
|
+
if (k.length === 0)
|
|
1678
1675
|
return;
|
|
1679
|
-
const { drawingId:
|
|
1680
|
-
if (Re == null ||
|
|
1676
|
+
const { drawingId: b, unitId: E } = k[0], $ = o.getUniverDocInstance(E), F = (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 = (Te = (Ae = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ae.customBlocks) == null ? void 0 : Te.find((Ee) => Ee.blockId === b);
|
|
1677
|
+
if (Re == null || F == null || Y == null)
|
|
1681
1678
|
return;
|
|
1682
|
-
const { startIndex: We } = Re, ce =
|
|
1679
|
+
const { startIndex: We } = Re, ce = F.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;
|
|
1683
1680
|
if (ce == null || te == null || _e == null || ie == null || Se == null)
|
|
1684
1681
|
return;
|
|
1685
1682
|
let de = 0;
|
|
1686
1683
|
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);
|
|
1687
1684
|
const De = {
|
|
1688
1685
|
relativeFrom: B,
|
|
1689
|
-
posOffset: (
|
|
1686
|
+
posOffset: (P != null ? P : 0) - de
|
|
1690
1687
|
};
|
|
1691
1688
|
I("positionV", De);
|
|
1692
1689
|
}
|
|
1693
1690
|
function x(C) {
|
|
1694
1691
|
var E;
|
|
1695
|
-
const R = a == null ? void 0 : a.getSnapshot(),
|
|
1696
|
-
if (
|
|
1692
|
+
const R = a == null ? void 0 : a.getSnapshot(), P = (E = R == null ? void 0 : R.drawings) == null ? void 0 : E[C.drawingId];
|
|
1693
|
+
if (P == null)
|
|
1697
1694
|
return;
|
|
1698
|
-
const { layoutType: B } =
|
|
1699
|
-
positionH:
|
|
1700
|
-
positionV:
|
|
1701
|
-
} =
|
|
1702
|
-
D(
|
|
1695
|
+
const { layoutType: B } = P, {
|
|
1696
|
+
positionH: k,
|
|
1697
|
+
positionV: b
|
|
1698
|
+
} = P.docTransform;
|
|
1699
|
+
D(k), M(b), S(B === H.INLINE), A(b.relativeFrom === V.PARAGRAPH || b.relativeFrom === V.LINE);
|
|
1703
1700
|
}
|
|
1704
1701
|
function G() {
|
|
1705
1702
|
const C = t.getFocusDrawings();
|
|
@@ -1710,26 +1707,26 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1710
1707
|
}
|
|
1711
1708
|
return _n(() => {
|
|
1712
1709
|
G();
|
|
1713
|
-
const C = t.focus$.subscribe((
|
|
1714
|
-
if (
|
|
1710
|
+
const C = t.focus$.subscribe((P) => {
|
|
1711
|
+
if (P.length === 0) {
|
|
1715
1712
|
N(!1);
|
|
1716
1713
|
return;
|
|
1717
1714
|
}
|
|
1718
|
-
N(!0), x(
|
|
1719
|
-
}), R = e.onCommandExecuted(async (
|
|
1720
|
-
|
|
1715
|
+
N(!0), x(P[0]);
|
|
1716
|
+
}), R = e.onCommandExecuted(async (P) => {
|
|
1717
|
+
P.id === J.id && G();
|
|
1721
1718
|
});
|
|
1722
1719
|
return () => {
|
|
1723
1720
|
C.unsubscribe(), R.dispose();
|
|
1724
1721
|
};
|
|
1725
|
-
}, []), /* @__PURE__ */ X("div", { className: j(
|
|
1726
|
-
/* @__PURE__ */ f("div", { className:
|
|
1727
|
-
/* @__PURE__ */ f("div", { className:
|
|
1728
|
-
/* @__PURE__ */ X("div", { className:
|
|
1729
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1730
|
-
/* @__PURE__ */ f("div", { className:
|
|
1731
|
-
/* @__PURE__ */ f("div", { className:
|
|
1732
|
-
|
|
1722
|
+
}, []), /* @__PURE__ */ X("div", { className: j(u.imageCommonPanelGrid, u.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
|
|
1723
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.title") }) }) }),
|
|
1724
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.horizontal") }) }) }),
|
|
1725
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1726
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1727
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1728
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1729
|
+
ke,
|
|
1733
1730
|
{
|
|
1734
1731
|
min: Hn,
|
|
1735
1732
|
max: Wn,
|
|
@@ -1742,13 +1739,13 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1742
1739
|
posOffset: C
|
|
1743
1740
|
});
|
|
1744
1741
|
},
|
|
1745
|
-
className:
|
|
1742
|
+
className: u.imageCommonPanelInput
|
|
1746
1743
|
}
|
|
1747
1744
|
) }) })
|
|
1748
1745
|
] }) }),
|
|
1749
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1750
|
-
/* @__PURE__ */ f("div", { className:
|
|
1751
|
-
/* @__PURE__ */ f("div", { className:
|
|
1746
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1747
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
|
|
1748
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1752
1749
|
Bn,
|
|
1753
1750
|
{
|
|
1754
1751
|
value: String(O.relativeFrom),
|
|
@@ -1759,52 +1756,52 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1759
1756
|
) }) })
|
|
1760
1757
|
] }) })
|
|
1761
1758
|
] }),
|
|
1762
|
-
/* @__PURE__ */ f("div", { className:
|
|
1763
|
-
/* @__PURE__ */ X("div", { className:
|
|
1764
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1765
|
-
/* @__PURE__ */ f("div", { className:
|
|
1766
|
-
/* @__PURE__ */ f("div", { className:
|
|
1767
|
-
|
|
1759
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.vertical") }) }) }),
|
|
1760
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1761
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1762
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1763
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1764
|
+
ke,
|
|
1768
1765
|
{
|
|
1769
1766
|
min: Hn,
|
|
1770
1767
|
max: Wn,
|
|
1771
1768
|
precision: 1,
|
|
1772
1769
|
disabled: w,
|
|
1773
|
-
value:
|
|
1770
|
+
value: T.posOffset,
|
|
1774
1771
|
onChange: (C) => {
|
|
1775
1772
|
I("positionV", {
|
|
1776
|
-
relativeFrom:
|
|
1773
|
+
relativeFrom: T.relativeFrom,
|
|
1777
1774
|
posOffset: C
|
|
1778
1775
|
});
|
|
1779
1776
|
},
|
|
1780
|
-
className:
|
|
1777
|
+
className: u.imageCommonPanelInput
|
|
1781
1778
|
}
|
|
1782
1779
|
) }) })
|
|
1783
1780
|
] }) }),
|
|
1784
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1785
|
-
/* @__PURE__ */ f("div", { className:
|
|
1786
|
-
/* @__PURE__ */ f("div", { className:
|
|
1781
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1782
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
|
|
1783
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1787
1784
|
Bn,
|
|
1788
1785
|
{
|
|
1789
1786
|
disabled: w,
|
|
1790
|
-
value: String(
|
|
1787
|
+
value: String(T.relativeFrom),
|
|
1791
1788
|
options: v,
|
|
1792
1789
|
onChange: W
|
|
1793
1790
|
}
|
|
1794
1791
|
) }) })
|
|
1795
1792
|
] }) })
|
|
1796
1793
|
] }),
|
|
1797
|
-
/* @__PURE__ */ f("div", { className:
|
|
1798
|
-
/* @__PURE__ */ f("div", { className:
|
|
1794
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.options") }) }) }),
|
|
1795
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(Ci, { disabled: w, checked: y, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1799
1796
|
] });
|
|
1800
|
-
}, Je = 0, en = 100,
|
|
1797
|
+
}, Je = 0, en = 100, Zi = (i) => {
|
|
1801
1798
|
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, c = s[0];
|
|
1802
1799
|
if (c == null)
|
|
1803
1800
|
return null;
|
|
1804
1801
|
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = r.getRenderById(d);
|
|
1805
1802
|
if ((l == null ? void 0 : l.scene) == null)
|
|
1806
1803
|
return null;
|
|
1807
|
-
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [
|
|
1804
|
+
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [y, A] = re({
|
|
1808
1805
|
distT: 0,
|
|
1809
1806
|
distL: 0,
|
|
1810
1807
|
distB: 0,
|
|
@@ -1815,14 +1812,14 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1815
1812
|
const C = t.getFocusDrawings();
|
|
1816
1813
|
if (C.length === 0)
|
|
1817
1814
|
return;
|
|
1818
|
-
const { unitId: R, subUnitId:
|
|
1819
|
-
unitId:
|
|
1820
|
-
subUnitId:
|
|
1815
|
+
const { unitId: R, subUnitId: P } = C[0], B = C.map(({ unitId: k, subUnitId: b, drawingId: E }) => ({
|
|
1816
|
+
unitId: k,
|
|
1817
|
+
subUnitId: b,
|
|
1821
1818
|
drawingId: E
|
|
1822
1819
|
}));
|
|
1823
1820
|
e.executeCommand(Zn.id, {
|
|
1824
1821
|
unitId: R,
|
|
1825
|
-
subUnitId:
|
|
1822
|
+
subUnitId: P,
|
|
1826
1823
|
drawings: B,
|
|
1827
1824
|
wrappingStyle: _
|
|
1828
1825
|
});
|
|
@@ -1832,10 +1829,10 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1832
1829
|
const C = t.getFocusDrawings();
|
|
1833
1830
|
if (C.length === 0)
|
|
1834
1831
|
return;
|
|
1835
|
-
const R = C.map((
|
|
1836
|
-
unitId:
|
|
1837
|
-
subUnitId:
|
|
1838
|
-
drawingId:
|
|
1832
|
+
const R = C.map((P) => ({
|
|
1833
|
+
unitId: P.unitId,
|
|
1834
|
+
subUnitId: P.subUnitId,
|
|
1835
|
+
drawingId: P.drawingId
|
|
1839
1836
|
}));
|
|
1840
1837
|
e.executeCommand(Jn.id, {
|
|
1841
1838
|
unitId: C[0].unitId,
|
|
@@ -1847,19 +1844,19 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1847
1844
|
function W(_, C) {
|
|
1848
1845
|
if (_ == null)
|
|
1849
1846
|
return;
|
|
1850
|
-
const R = { ...
|
|
1847
|
+
const R = { ...y, [C]: _ };
|
|
1851
1848
|
A(R);
|
|
1852
|
-
const
|
|
1853
|
-
if (
|
|
1849
|
+
const P = t.getFocusDrawings();
|
|
1850
|
+
if (P.length === 0)
|
|
1854
1851
|
return;
|
|
1855
|
-
const B =
|
|
1856
|
-
unitId:
|
|
1857
|
-
subUnitId:
|
|
1858
|
-
drawingId:
|
|
1852
|
+
const B = P.map((k) => ({
|
|
1853
|
+
unitId: k.unitId,
|
|
1854
|
+
subUnitId: k.subUnitId,
|
|
1855
|
+
drawingId: k.drawingId
|
|
1859
1856
|
}));
|
|
1860
1857
|
e.executeCommand(Qn.id, {
|
|
1861
|
-
unitId:
|
|
1862
|
-
subUnitId:
|
|
1858
|
+
unitId: P[0].unitId,
|
|
1859
|
+
subUnitId: P[0].unitId,
|
|
1863
1860
|
drawings: B,
|
|
1864
1861
|
dist: {
|
|
1865
1862
|
[C]: _
|
|
@@ -1877,22 +1874,22 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1877
1874
|
return;
|
|
1878
1875
|
const {
|
|
1879
1876
|
distT: R = 0,
|
|
1880
|
-
distL:
|
|
1877
|
+
distL: P = 0,
|
|
1881
1878
|
distB: B = 0,
|
|
1882
|
-
distR:
|
|
1883
|
-
layoutType:
|
|
1879
|
+
distR: k = 0,
|
|
1880
|
+
layoutType: b = H.INLINE,
|
|
1884
1881
|
behindDoc: E = oe.FALSE,
|
|
1885
1882
|
wrapText: $ = $e.BOTH_SIDES
|
|
1886
1883
|
} = C;
|
|
1887
1884
|
if (A({
|
|
1888
1885
|
distT: R,
|
|
1889
|
-
distL:
|
|
1886
|
+
distL: P,
|
|
1890
1887
|
distB: B,
|
|
1891
|
-
distR:
|
|
1892
|
-
}), M($), p(
|
|
1888
|
+
distR: k
|
|
1889
|
+
}), M($), p(b !== H.WRAP_SQUARE), b === H.WRAP_NONE || b === H.INLINE ? v(!0) : v(!1), b === H.WRAP_NONE || b === H.INLINE || b === H.WRAP_TOP_AND_BOTTOM ? S(!0) : S(!1), b === H.WRAP_NONE)
|
|
1893
1890
|
E === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
|
|
1894
1891
|
else
|
|
1895
|
-
switch (
|
|
1892
|
+
switch (b) {
|
|
1896
1893
|
case H.INLINE:
|
|
1897
1894
|
D(ue.INLINE);
|
|
1898
1895
|
break;
|
|
@@ -1903,7 +1900,7 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1903
1900
|
D(ue.WRAP_TOP_AND_BOTTOM);
|
|
1904
1901
|
break;
|
|
1905
1902
|
default:
|
|
1906
|
-
throw new Error(`Unsupported layout type: ${
|
|
1903
|
+
throw new Error(`Unsupported layout type: ${b}`);
|
|
1907
1904
|
}
|
|
1908
1905
|
}
|
|
1909
1906
|
return _n(() => {
|
|
@@ -1920,97 +1917,97 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1920
1917
|
return () => {
|
|
1921
1918
|
_.unsubscribe(), C.dispose();
|
|
1922
1919
|
};
|
|
1923
|
-
}, []), /* @__PURE__ */ X("div", { className: j(
|
|
1924
|
-
/* @__PURE__ */ f("div", { className:
|
|
1925
|
-
/* @__PURE__ */ f("div", { className:
|
|
1926
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1927
|
-
/* @__PURE__ */ f(
|
|
1928
|
-
/* @__PURE__ */ f(
|
|
1929
|
-
/* @__PURE__ */ f(
|
|
1930
|
-
/* @__PURE__ */ f(
|
|
1931
|
-
/* @__PURE__ */ f(
|
|
1920
|
+
}, []), /* @__PURE__ */ X("div", { className: j(u.imageCommonPanelGrid, u.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
|
|
1921
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.title") }) }) }),
|
|
1922
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
|
|
1923
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { value: O, onChange: I, direction: "vertical", children: [
|
|
1924
|
+
/* @__PURE__ */ f(Pe, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
|
|
1925
|
+
/* @__PURE__ */ f(Pe, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
|
|
1926
|
+
/* @__PURE__ */ f(Pe, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
|
|
1927
|
+
/* @__PURE__ */ f(Pe, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
|
|
1928
|
+
/* @__PURE__ */ f(Pe, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1932
1929
|
] }) }) }),
|
|
1933
|
-
/* @__PURE__ */ f("div", { className:
|
|
1934
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1935
|
-
/* @__PURE__ */ f(
|
|
1936
|
-
/* @__PURE__ */ f(
|
|
1937
|
-
/* @__PURE__ */ f(
|
|
1930
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
|
|
1931
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn), children: /* @__PURE__ */ X(Un, { disabled: g, value: T, onChange: L, direction: "horizontal", children: [
|
|
1932
|
+
/* @__PURE__ */ f(Pe, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1933
|
+
/* @__PURE__ */ f(Pe, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1934
|
+
/* @__PURE__ */ f(Pe, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
1938
1935
|
] }) }) }),
|
|
1939
|
-
/* @__PURE__ */ f("div", { className:
|
|
1940
|
-
/* @__PURE__ */ X("div", { className:
|
|
1941
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1942
|
-
/* @__PURE__ */ f("div", { className:
|
|
1943
|
-
/* @__PURE__ */ f("div", { className:
|
|
1944
|
-
|
|
1936
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
|
|
1937
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1938
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1939
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
|
|
1940
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1941
|
+
ke,
|
|
1945
1942
|
{
|
|
1946
1943
|
min: Je,
|
|
1947
1944
|
max: en,
|
|
1948
1945
|
disabled: h,
|
|
1949
1946
|
precision: 1,
|
|
1950
|
-
value:
|
|
1947
|
+
value: y.distT,
|
|
1951
1948
|
onChange: (_) => {
|
|
1952
1949
|
W(_, "distT");
|
|
1953
1950
|
},
|
|
1954
|
-
className:
|
|
1951
|
+
className: u.imageCommonPanelInput
|
|
1955
1952
|
}
|
|
1956
1953
|
) }) })
|
|
1957
1954
|
] }) }),
|
|
1958
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1959
|
-
/* @__PURE__ */ f("div", { className:
|
|
1960
|
-
/* @__PURE__ */ f("div", { className:
|
|
1961
|
-
|
|
1955
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1956
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
|
|
1957
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1958
|
+
ke,
|
|
1962
1959
|
{
|
|
1963
1960
|
min: Je,
|
|
1964
1961
|
max: en,
|
|
1965
1962
|
disabled: w,
|
|
1966
1963
|
precision: 1,
|
|
1967
|
-
value:
|
|
1964
|
+
value: y.distL,
|
|
1968
1965
|
onChange: (_) => {
|
|
1969
1966
|
W(_, "distL");
|
|
1970
1967
|
},
|
|
1971
|
-
className:
|
|
1968
|
+
className: u.imageCommonPanelInput
|
|
1972
1969
|
}
|
|
1973
1970
|
) }) })
|
|
1974
1971
|
] }) })
|
|
1975
1972
|
] }),
|
|
1976
|
-
/* @__PURE__ */ X("div", { className:
|
|
1977
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1978
|
-
/* @__PURE__ */ f("div", { className:
|
|
1979
|
-
/* @__PURE__ */ f("div", { className:
|
|
1980
|
-
|
|
1973
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1974
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1975
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
|
|
1976
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1977
|
+
ke,
|
|
1981
1978
|
{
|
|
1982
1979
|
min: Je,
|
|
1983
1980
|
max: en,
|
|
1984
1981
|
disabled: h,
|
|
1985
1982
|
precision: 1,
|
|
1986
|
-
value:
|
|
1983
|
+
value: y.distB,
|
|
1987
1984
|
onChange: (_) => {
|
|
1988
1985
|
W(_, "distB");
|
|
1989
1986
|
},
|
|
1990
|
-
className:
|
|
1987
|
+
className: u.imageCommonPanelInput
|
|
1991
1988
|
}
|
|
1992
1989
|
) }) })
|
|
1993
1990
|
] }) }),
|
|
1994
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1995
|
-
/* @__PURE__ */ f("div", { className:
|
|
1996
|
-
/* @__PURE__ */ f("div", { className:
|
|
1997
|
-
|
|
1991
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1992
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
|
|
1993
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1994
|
+
ke,
|
|
1998
1995
|
{
|
|
1999
1996
|
min: Je,
|
|
2000
1997
|
max: en,
|
|
2001
1998
|
disabled: w,
|
|
2002
1999
|
precision: 1,
|
|
2003
|
-
value:
|
|
2000
|
+
value: y.distR,
|
|
2004
2001
|
onChange: (_) => {
|
|
2005
2002
|
W(_, "distR");
|
|
2006
2003
|
},
|
|
2007
|
-
className:
|
|
2004
|
+
className: u.imageCommonPanelInput
|
|
2008
2005
|
}
|
|
2009
2006
|
) }) })
|
|
2010
2007
|
] }) })
|
|
2011
2008
|
] })
|
|
2012
2009
|
] });
|
|
2013
|
-
},
|
|
2010
|
+
}, Qi = () => {
|
|
2014
2011
|
const i = we(Ie), e = i.getFocusDrawings(), [n, t] = re(e);
|
|
2015
2012
|
return _n(() => {
|
|
2016
2013
|
const r = i.focus$.subscribe((o) => {
|
|
@@ -2019,20 +2016,20 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
2019
2016
|
return () => {
|
|
2020
2017
|
r.unsubscribe();
|
|
2021
2018
|
};
|
|
2022
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className:
|
|
2023
|
-
/* @__PURE__ */ f(
|
|
2024
|
-
/* @__PURE__ */ f(
|
|
2025
|
-
/* @__PURE__ */ f(
|
|
2019
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className: u.imageCommonPanel, children: [
|
|
2020
|
+
/* @__PURE__ */ f(Xt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
2021
|
+
/* @__PURE__ */ f(Zi, { drawings: n }),
|
|
2022
|
+
/* @__PURE__ */ f(Yi, { drawings: n })
|
|
2026
2023
|
] });
|
|
2027
|
-
}, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id,
|
|
2024
|
+
}, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id, Ji = (i) => {
|
|
2028
2025
|
const e = i.get(In), n = i.get(Q);
|
|
2029
|
-
return new
|
|
2026
|
+
return new Si((t) => {
|
|
2030
2027
|
const r = e.textSelection$.subscribe(() => {
|
|
2031
2028
|
var s;
|
|
2032
2029
|
const o = e.getActiveTextRange();
|
|
2033
2030
|
if (o) {
|
|
2034
|
-
const { segmentId: c, startOffset: d, endOffset: a } = o, l = n.getCurrentUniverDocInstance(),
|
|
2035
|
-
if (
|
|
2031
|
+
const { segmentId: c, startOffset: d, endOffset: a } = o, l = n.getCurrentUniverDocInstance(), m = (s = l == null ? void 0 : l.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : s.tables;
|
|
2032
|
+
if (m && m.length && m.some((g) => {
|
|
2036
2033
|
const { startIndex: p, endIndex: h } = g;
|
|
2037
2034
|
return d >= p && d < h || a >= p && a < h;
|
|
2038
2035
|
})) {
|
|
@@ -2048,40 +2045,40 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
2048
2045
|
return () => r.unsubscribe();
|
|
2049
2046
|
});
|
|
2050
2047
|
};
|
|
2051
|
-
function
|
|
2048
|
+
function er(i) {
|
|
2052
2049
|
return {
|
|
2053
2050
|
id: pt,
|
|
2054
|
-
type:
|
|
2051
|
+
type: zn.SUBITEMS,
|
|
2055
2052
|
icon: ht,
|
|
2056
2053
|
tooltip: "docImage.title",
|
|
2057
|
-
disabled$:
|
|
2058
|
-
hidden$:
|
|
2054
|
+
disabled$: Ji(i),
|
|
2055
|
+
hidden$: $n(i, be.UNIVER_DOC)
|
|
2059
2056
|
};
|
|
2060
2057
|
}
|
|
2061
|
-
function
|
|
2058
|
+
function nr(i) {
|
|
2062
2059
|
return {
|
|
2063
2060
|
id: wt,
|
|
2064
2061
|
title: "docImage.upload.float",
|
|
2065
|
-
type:
|
|
2066
|
-
hidden$:
|
|
2062
|
+
type: zn.BUTTON,
|
|
2063
|
+
hidden$: $n(i, be.UNIVER_DOC)
|
|
2067
2064
|
};
|
|
2068
2065
|
}
|
|
2069
|
-
const
|
|
2070
|
-
[
|
|
2066
|
+
const tr = {
|
|
2067
|
+
[ai.LAYOUT]: {
|
|
2071
2068
|
[pt]: {
|
|
2072
2069
|
order: 0,
|
|
2073
|
-
menuItemFactory:
|
|
2070
|
+
menuItemFactory: er,
|
|
2074
2071
|
[wt]: {
|
|
2075
2072
|
order: 0,
|
|
2076
|
-
menuItemFactory:
|
|
2073
|
+
menuItemFactory: nr
|
|
2077
2074
|
}
|
|
2078
2075
|
}
|
|
2079
2076
|
}
|
|
2080
2077
|
};
|
|
2081
2078
|
function Ye(i) {
|
|
2082
|
-
return i.getContextValue(
|
|
2079
|
+
return i.getContextValue(Rt) && i.getContextValue(tn);
|
|
2083
2080
|
}
|
|
2084
|
-
const
|
|
2081
|
+
const ir = {
|
|
2085
2082
|
id: Ke.id,
|
|
2086
2083
|
description: "shortcut.doc.drawing-move-down",
|
|
2087
2084
|
group: "4_doc-drawing-view",
|
|
@@ -2091,7 +2088,7 @@ const ur = {
|
|
|
2091
2088
|
staticParameters: {
|
|
2092
2089
|
direction: fe.DOWN
|
|
2093
2090
|
}
|
|
2094
|
-
},
|
|
2091
|
+
}, rr = {
|
|
2095
2092
|
id: Ke.id,
|
|
2096
2093
|
description: "shortcut.doc.drawing-move-up",
|
|
2097
2094
|
group: "4_doc-drawing-view",
|
|
@@ -2101,7 +2098,7 @@ const ur = {
|
|
|
2101
2098
|
staticParameters: {
|
|
2102
2099
|
direction: fe.UP
|
|
2103
2100
|
}
|
|
2104
|
-
},
|
|
2101
|
+
}, or = {
|
|
2105
2102
|
id: Ke.id,
|
|
2106
2103
|
description: "shortcut.doc.drawing-move-left",
|
|
2107
2104
|
group: "4_doc-drawing-view",
|
|
@@ -2111,7 +2108,7 @@ const ur = {
|
|
|
2111
2108
|
staticParameters: {
|
|
2112
2109
|
direction: fe.LEFT
|
|
2113
2110
|
}
|
|
2114
|
-
},
|
|
2111
|
+
}, sr = {
|
|
2115
2112
|
id: Ke.id,
|
|
2116
2113
|
description: "shortcut.doc.drawing-move-right",
|
|
2117
2114
|
group: "4_doc-drawing-view",
|
|
@@ -2121,7 +2118,7 @@ const ur = {
|
|
|
2121
2118
|
staticParameters: {
|
|
2122
2119
|
direction: fe.RIGHT
|
|
2123
2120
|
}
|
|
2124
|
-
},
|
|
2121
|
+
}, ar = {
|
|
2125
2122
|
id: ot.id,
|
|
2126
2123
|
description: "shortcut.doc.drawing-delete",
|
|
2127
2124
|
group: "4_doc-drawing-view",
|
|
@@ -2130,10 +2127,10 @@ const ur = {
|
|
|
2130
2127
|
binding: He.DELETE,
|
|
2131
2128
|
mac: He.BACKSPACE
|
|
2132
2129
|
};
|
|
2133
|
-
var
|
|
2134
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2135
|
-
(s = i[o]) && (r =
|
|
2136
|
-
return
|
|
2130
|
+
var cr = Object.getOwnPropertyDescriptor, dr = (i, e, n, t) => {
|
|
2131
|
+
for (var r = t > 1 ? void 0 : t ? cr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2132
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2133
|
+
return r;
|
|
2137
2134
|
}, nn = (i, e) => (n, t) => e(n, t, i);
|
|
2138
2135
|
let an = class extends Xe {
|
|
2139
2136
|
constructor(i, e, n, t) {
|
|
@@ -2141,10 +2138,10 @@ let an = class extends Xe {
|
|
|
2141
2138
|
}
|
|
2142
2139
|
_initCustomComponents() {
|
|
2143
2140
|
const i = this._componentManager;
|
|
2144
|
-
this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt,
|
|
2141
|
+
this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt, Qi));
|
|
2145
2142
|
}
|
|
2146
2143
|
_initMenus() {
|
|
2147
|
-
this._menuManagerService.mergeMenu(
|
|
2144
|
+
this._menuManagerService.mergeMenu(tr);
|
|
2148
2145
|
}
|
|
2149
2146
|
_initCommands() {
|
|
2150
2147
|
[
|
|
@@ -2158,7 +2155,7 @@ let an = class extends Xe {
|
|
|
2158
2155
|
nt,
|
|
2159
2156
|
Sn,
|
|
2160
2157
|
mt,
|
|
2161
|
-
|
|
2158
|
+
Hi,
|
|
2162
2159
|
ut,
|
|
2163
2160
|
st,
|
|
2164
2161
|
dt,
|
|
@@ -2170,11 +2167,11 @@ let an = class extends Xe {
|
|
|
2170
2167
|
_initShortcuts() {
|
|
2171
2168
|
[
|
|
2172
2169
|
// sheet drawing shortcuts
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2170
|
+
ir,
|
|
2171
|
+
rr,
|
|
2172
|
+
or,
|
|
2173
|
+
sr,
|
|
2174
|
+
ar
|
|
2178
2175
|
].forEach((i) => {
|
|
2179
2176
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2180
2177
|
});
|
|
@@ -2183,25 +2180,25 @@ let an = class extends Xe {
|
|
|
2183
2180
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2184
2181
|
}
|
|
2185
2182
|
};
|
|
2186
|
-
an =
|
|
2187
|
-
nn(0, ve(
|
|
2188
|
-
nn(1,
|
|
2183
|
+
an = dr([
|
|
2184
|
+
nn(0, ve(ci)),
|
|
2185
|
+
nn(1, di),
|
|
2189
2186
|
nn(2, z),
|
|
2190
|
-
nn(3,
|
|
2187
|
+
nn(3, li)
|
|
2191
2188
|
], an);
|
|
2192
|
-
var
|
|
2193
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2194
|
-
(s = i[o]) && (r =
|
|
2195
|
-
return
|
|
2189
|
+
var lr = Object.getOwnPropertyDescriptor, gr = (i, e, n, t) => {
|
|
2190
|
+
for (var r = t > 1 ? void 0 : t ? lr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2191
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2192
|
+
return r;
|
|
2196
2193
|
}, je = (i, e) => (n, t) => e(n, t, i);
|
|
2197
|
-
let cn = class extends
|
|
2194
|
+
let cn = class extends Nt {
|
|
2198
2195
|
constructor(e, n, t, r, o) {
|
|
2199
2196
|
super();
|
|
2200
2197
|
Ce(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
2201
2198
|
this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = t, this._univerInstanceService = r, this._contextService = o, this._init();
|
|
2202
2199
|
}
|
|
2203
2200
|
_init() {
|
|
2204
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2201
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
|
|
2205
2202
|
}
|
|
2206
2203
|
_dispose(e) {
|
|
2207
2204
|
const n = e.getUnitId();
|
|
@@ -2216,7 +2213,7 @@ let cn = class extends At {
|
|
|
2216
2213
|
_hasCropObject(e) {
|
|
2217
2214
|
const n = e.getAllObjects();
|
|
2218
2215
|
for (const t of n)
|
|
2219
|
-
if (t instanceof
|
|
2216
|
+
if (t instanceof Kt)
|
|
2220
2217
|
return !0;
|
|
2221
2218
|
return !1;
|
|
2222
2219
|
}
|
|
@@ -2244,21 +2241,21 @@ let cn = class extends At {
|
|
|
2244
2241
|
const d = c.oKey, a = this._drawingManagerService.getDrawingOKey(d);
|
|
2245
2242
|
if (!a)
|
|
2246
2243
|
return;
|
|
2247
|
-
const { unitId: l, subUnitId:
|
|
2244
|
+
const { unitId: l, subUnitId: m, drawingId: g } = a, p = this._canvasPopManagerService.attachPopupToObject(
|
|
2248
2245
|
c,
|
|
2249
2246
|
{
|
|
2250
|
-
componentKey:
|
|
2247
|
+
componentKey: Yt,
|
|
2251
2248
|
direction: "horizontal",
|
|
2252
2249
|
offset: [2, 0],
|
|
2253
2250
|
extraProps: {
|
|
2254
|
-
menuItems: this._getImageMenuItems(l,
|
|
2251
|
+
menuItems: this._getImageMenuItems(l, m, g)
|
|
2255
2252
|
}
|
|
2256
2253
|
},
|
|
2257
2254
|
l
|
|
2258
2255
|
);
|
|
2259
|
-
r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId ===
|
|
2256
|
+
r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId === m && w.drawingId === g) && this._drawingManagerService.focusDrawing([{
|
|
2260
2257
|
unitId: l,
|
|
2261
|
-
subUnitId:
|
|
2258
|
+
subUnitId: m,
|
|
2262
2259
|
drawingId: g
|
|
2263
2260
|
}]);
|
|
2264
2261
|
})
|
|
@@ -2290,7 +2287,7 @@ let cn = class extends At {
|
|
|
2290
2287
|
index: 0,
|
|
2291
2288
|
commandId: ut.id,
|
|
2292
2289
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2293
|
-
disable: !!
|
|
2290
|
+
disable: !!At.includes(e)
|
|
2294
2291
|
},
|
|
2295
2292
|
{
|
|
2296
2293
|
label: "image-popup.delete",
|
|
@@ -2302,7 +2299,7 @@ let cn = class extends At {
|
|
|
2302
2299
|
{
|
|
2303
2300
|
label: "image-popup.crop",
|
|
2304
2301
|
index: 2,
|
|
2305
|
-
commandId:
|
|
2302
|
+
commandId: Zt.id,
|
|
2306
2303
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2307
2304
|
disable: !0
|
|
2308
2305
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2310,7 +2307,7 @@ let cn = class extends At {
|
|
|
2310
2307
|
{
|
|
2311
2308
|
label: "image-popup.reset",
|
|
2312
2309
|
index: 3,
|
|
2313
|
-
commandId:
|
|
2310
|
+
commandId: Qt.id,
|
|
2314
2311
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
2315
2312
|
disable: !0
|
|
2316
2313
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2318,17 +2315,17 @@ let cn = class extends At {
|
|
|
2318
2315
|
];
|
|
2319
2316
|
}
|
|
2320
2317
|
};
|
|
2321
|
-
cn =
|
|
2318
|
+
cn = gr([
|
|
2322
2319
|
je(0, Ie),
|
|
2323
|
-
je(1, ve(
|
|
2320
|
+
je(1, ve(wi)),
|
|
2324
2321
|
je(2, ee),
|
|
2325
2322
|
je(3, Q),
|
|
2326
2323
|
je(4, Vn)
|
|
2327
2324
|
], cn);
|
|
2328
|
-
var
|
|
2329
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2330
|
-
(s = i[o]) && (r =
|
|
2331
|
-
return
|
|
2325
|
+
var mr = Object.getOwnPropertyDescriptor, ur = (i, e, n, t) => {
|
|
2326
|
+
for (var r = t > 1 ? void 0 : t ? mr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2327
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2328
|
+
return r;
|
|
2332
2329
|
}, xe = (i, e) => (n, t) => e(n, t, i);
|
|
2333
2330
|
let wn = class extends Xe {
|
|
2334
2331
|
constructor(e, n, t, r, o, s, c, d) {
|
|
@@ -2347,7 +2344,7 @@ let wn = class extends Xe {
|
|
|
2347
2344
|
});
|
|
2348
2345
|
}
|
|
2349
2346
|
_commandExecutedListener() {
|
|
2350
|
-
const e = [J.id,
|
|
2347
|
+
const e = [J.id, Ii.id];
|
|
2351
2348
|
this.disposeWithMe(
|
|
2352
2349
|
this._commandService.onCommandExecuted((n) => {
|
|
2353
2350
|
if (e.includes(n.id)) {
|
|
@@ -2357,7 +2354,7 @@ let wn = class extends Xe {
|
|
|
2357
2354
|
const c = this._docSkeletonManagerService.getSkeleton();
|
|
2358
2355
|
if (c == null)
|
|
2359
2356
|
return;
|
|
2360
|
-
if (this._editorService.isEditor(o) && o !==
|
|
2357
|
+
if (this._editorService.isEditor(o) && o !== xt) {
|
|
2361
2358
|
s == null || s.makeDirty();
|
|
2362
2359
|
return;
|
|
2363
2360
|
}
|
|
@@ -2368,8 +2365,8 @@ let wn = class extends Xe {
|
|
|
2368
2365
|
}
|
|
2369
2366
|
_initResize() {
|
|
2370
2367
|
this.disposeWithMe(
|
|
2371
|
-
|
|
2372
|
-
xn((e) => e.type ===
|
|
2368
|
+
Lt(this._context.engine.onTransformChange$).pipe(
|
|
2369
|
+
xn((e) => e.type === ii.resize),
|
|
2373
2370
|
qn(16)
|
|
2374
2371
|
).subscribe(() => {
|
|
2375
2372
|
var t;
|
|
@@ -2383,10 +2380,10 @@ let wn = class extends Xe {
|
|
|
2383
2380
|
const n = e == null ? void 0 : e.getSkeletonData(), { mainComponent: t, unitId: r } = this._context, o = t;
|
|
2384
2381
|
if (!n)
|
|
2385
2382
|
return;
|
|
2386
|
-
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages:
|
|
2383
|
+
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters: p } = n, h = {};
|
|
2387
2384
|
this._liquid.reset();
|
|
2388
|
-
for (let
|
|
2389
|
-
const
|
|
2385
|
+
for (let T = 0, M = m.length; T < M; T++) {
|
|
2386
|
+
const y = m[T], { headerId: A, footerId: U, pageWidth: N } = y;
|
|
2390
2387
|
if (A) {
|
|
2391
2388
|
const I = (O = g.get(A)) == null ? void 0 : O.get(N);
|
|
2392
2389
|
I && this._calculateDrawingPosition(
|
|
@@ -2396,7 +2393,7 @@ let wn = class extends Xe {
|
|
|
2396
2393
|
c,
|
|
2397
2394
|
h,
|
|
2398
2395
|
I.marginTop,
|
|
2399
|
-
|
|
2396
|
+
y.marginLeft
|
|
2400
2397
|
);
|
|
2401
2398
|
}
|
|
2402
2399
|
if (U) {
|
|
@@ -2407,13 +2404,13 @@ let wn = class extends Xe {
|
|
|
2407
2404
|
s,
|
|
2408
2405
|
c,
|
|
2409
2406
|
h,
|
|
2410
|
-
|
|
2411
|
-
|
|
2407
|
+
y.pageHeight - y.marginBottom + I.marginTop,
|
|
2408
|
+
y.marginLeft
|
|
2412
2409
|
);
|
|
2413
2410
|
}
|
|
2414
|
-
this._calculateDrawingPosition(r,
|
|
2411
|
+
this._calculateDrawingPosition(r, y, s, c, h, y.marginTop, y.marginLeft), this._liquid.translatePage(y, d, a, l);
|
|
2415
2412
|
}
|
|
2416
|
-
const v = Object.values(h), w = v.filter((
|
|
2413
|
+
const v = Object.values(h), w = v.filter((T) => !T.isMultiTransform), S = v.filter((T) => T.isMultiTransform);
|
|
2417
2414
|
w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(S);
|
|
2418
2415
|
}
|
|
2419
2416
|
_handleMultiDrawingsTransform(e) {
|
|
@@ -2435,9 +2432,9 @@ let wn = class extends Xe {
|
|
|
2435
2432
|
marginTop: s,
|
|
2436
2433
|
marginLeft: c
|
|
2437
2434
|
}), d.forEach((a) => {
|
|
2438
|
-
const { aLeft: l, aTop:
|
|
2435
|
+
const { aLeft: l, aTop: m, 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 = {
|
|
2439
2436
|
left: l + t + this._liquid.x,
|
|
2440
|
-
top:
|
|
2437
|
+
top: m + r + this._liquid.y,
|
|
2441
2438
|
width: p,
|
|
2442
2439
|
height: g,
|
|
2443
2440
|
angle: h
|
|
@@ -2461,35 +2458,35 @@ let wn = class extends Xe {
|
|
|
2461
2458
|
const n = this._docSkeletonManagerService.getSkeleton();
|
|
2462
2459
|
n != null && (this._refreshDrawing(n), this._drawingManagerService.initializeNotification(this._context.unitId));
|
|
2463
2460
|
};
|
|
2464
|
-
this._lifecycleService.stage ===
|
|
2461
|
+
this._lifecycleService.stage === Tn.Steady ? setTimeout(() => {
|
|
2465
2462
|
e();
|
|
2466
|
-
}, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n ===
|
|
2463
|
+
}, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n === Tn.Steady)).subscribe(e);
|
|
2467
2464
|
}
|
|
2468
2465
|
};
|
|
2469
|
-
wn =
|
|
2466
|
+
wn = ur([
|
|
2470
2467
|
xe(1, ve(se)),
|
|
2471
2468
|
xe(2, z),
|
|
2472
|
-
xe(3,
|
|
2469
|
+
xe(3, vi),
|
|
2473
2470
|
xe(4, Ie),
|
|
2474
2471
|
xe(5, ve(gn)),
|
|
2475
2472
|
xe(6, Q),
|
|
2476
|
-
xe(7, ve(
|
|
2473
|
+
xe(7, ve(Et))
|
|
2477
2474
|
], wn);
|
|
2478
|
-
var
|
|
2479
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2480
|
-
(s = i[o]) && (r =
|
|
2481
|
-
return
|
|
2482
|
-
}, pn = (i, e) => (n, t) => e(n, t, i),
|
|
2483
|
-
const
|
|
2484
|
-
let dn = class extends
|
|
2485
|
-
constructor(i =
|
|
2475
|
+
var fr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, pr = (i, e, n) => e in i ? fr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, wr = (i, e, n, t) => {
|
|
2476
|
+
for (var r = t > 1 ? void 0 : t ? hr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2477
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2478
|
+
return r;
|
|
2479
|
+
}, pn = (i, e) => (n, t) => e(n, t, i), vt = (i, e, n) => pr(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2480
|
+
const vr = "DOC_DRAWING_UI_PLUGIN";
|
|
2481
|
+
let dn = class extends Ft {
|
|
2482
|
+
constructor(i = kn, e, n, t) {
|
|
2486
2483
|
super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
|
|
2487
2484
|
const { ...r } = Ht(
|
|
2488
2485
|
{},
|
|
2489
|
-
|
|
2486
|
+
kn,
|
|
2490
2487
|
this._config
|
|
2491
2488
|
);
|
|
2492
|
-
this._configService.setConfig(
|
|
2489
|
+
this._configService.setConfig(Oi, r);
|
|
2493
2490
|
}
|
|
2494
2491
|
onStarting() {
|
|
2495
2492
|
[
|
|
@@ -2504,22 +2501,22 @@ let dn = class extends kt {
|
|
|
2504
2501
|
[
|
|
2505
2502
|
[sn],
|
|
2506
2503
|
[wn]
|
|
2507
|
-
].forEach((i) => this._renderManagerSrv.registerRenderModule(
|
|
2504
|
+
].forEach((i) => this._renderManagerSrv.registerRenderModule(be.UNIVER_DOC, i)), this._injector.get(rn), this._injector.get(an), this._injector.get(on);
|
|
2508
2505
|
}
|
|
2509
2506
|
onRendered() {
|
|
2510
2507
|
this._injector.get(cn);
|
|
2511
2508
|
}
|
|
2512
2509
|
};
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
dn =
|
|
2516
|
-
|
|
2517
|
-
pn(1, ve(
|
|
2510
|
+
vt(dn, "type", be.UNIVER_DOC);
|
|
2511
|
+
vt(dn, "pluginName", vr);
|
|
2512
|
+
dn = wr([
|
|
2513
|
+
Bt(Jt, qt, Wt, gi),
|
|
2514
|
+
pn(1, ve(Ut)),
|
|
2518
2515
|
pn(2, ee),
|
|
2519
|
-
pn(3,
|
|
2516
|
+
pn(3, kt)
|
|
2520
2517
|
], dn);
|
|
2521
2518
|
export {
|
|
2522
|
-
|
|
2519
|
+
Hi as ClearDocDrawingTransformerOperation,
|
|
2523
2520
|
pt as DOCS_IMAGE_MENU_ID,
|
|
2524
2521
|
ot as DeleteDocDrawingsCommand,
|
|
2525
2522
|
ut as EditDocDrawingOperation,
|