@univerjs/docs-drawing-ui 0.6.1-nightly.202502251606 → 0.6.1-nightly.202502261607
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 +286 -300
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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, IImageIoService as
|
|
7
|
-
import { DrawingCommonPanel as
|
|
8
|
-
import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as
|
|
9
|
-
import { IMessageService as
|
|
1
|
+
var St = Object.defineProperty;
|
|
2
|
+
var Ct = (i, e, n) => e in i ? St(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var Ce = (i, e, n) => Ct(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Disposable as Xe, UndoCommand as Dt, RedoCommand as Ot, 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 Tt, MemoryCursor as Pt, IUndoRedoService as Gn, BuildTextUtils as yt, ArrangeTypeEnum as Ze, Inject as ve, IContextService as Vn, LocaleService as ln, WrapTextType as $e, DrawingTypeEnum as bt, FOCUSING_COMMON_DRAWINGS as tn, UniverInstanceType as be, Direction as fe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as Mt, RxDisposable as Rt, SHEET_EDITOR_UNITS as Nt, LifecycleService as Et, DOCS_ZEN_EDITOR_UNIT_ID_KEY as At, fromEventSubject as xt, LifecycleStages as Tn, DependentOn as Lt, Injector as Bt, IConfigService as Ut, Plugin as kt, merge as Ft } from "@univerjs/core";
|
|
5
|
+
import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Ht } from "@univerjs/docs-drawing";
|
|
6
|
+
import { IDrawingManagerService as Ie, IImageIoService as Wt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Gt, DRAWING_IMAGE_COUNT_LIMIT as Pn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as Vt, getImageSize as jt, getDrawingShapeKeyByDrawingSearch as $t, DRAWING_IMAGE_WIDTH_LIMIT as yn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, UniverDrawingPlugin as zt } from "@univerjs/drawing";
|
|
7
|
+
import { DrawingCommonPanel as qt, ImageCropperObject as Xt, COMPONENT_IMAGE_POPUP_MENU as Kt, OpenImageCropOperation as Yt, ImageResetSizeOperation as Zt, UniverDrawingUIPlugin as Qt } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as Jt, Rect as ei, getColor as ni, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ti } from "@univerjs/engine-render";
|
|
9
|
+
import { IMessageService as ii, ILocalFileService as ri, ISidebarService as oi, useDependency as we, getMenuHiddenObservable as $n, MenuItemType as zn, RibbonStartGroup as si, KeyCode as He, ComponentManager as ai, IMenuManagerService as ci, IShortcutService as di, UniverUIPlugin as li } 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
|
|
12
|
-
import { BehaviorSubject as
|
|
13
|
-
import { MessageType as Ln, InputNumber as ke, Select as Bn, Checkbox as
|
|
11
|
+
import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as En, getAnchorBounding as gi, TEXT_RANGE_LAYER_INDEX as mi, getDocObject as ui, getCustomBlockIdsInSelections as fi, docDrawingPositionToTransform as hi, DocCanvasPopManagerService as pi, IEditorService as wi, SetDocZoomRatioOperation as vi } from "@univerjs/docs-ui";
|
|
12
|
+
import { BehaviorSubject as Ii, debounceTime as qn, Observable as _i, takeUntil as An, filter as xn } from "rxjs";
|
|
13
|
+
import { MessageType as Ln, clsx as j, InputNumber as ke, Select as Bn, Checkbox as Si, 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
|
|
18
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
15
|
+
import { forwardRef as Xn, useRef as Ci, createElement as Kn, useState as re, useEffect as _n } from "react";
|
|
16
|
+
const Di = "docs-drawing-ui.config", kn = {};
|
|
17
|
+
var Oi = Object.getOwnPropertyDescriptor, Ti = (i, e, n, t) => {
|
|
18
|
+
for (var r = t > 1 ? void 0 : t ? Oi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
19
19
|
(s = i[o]) && (r = s(r) || r);
|
|
20
20
|
return r;
|
|
21
21
|
}, Ve = (i, e) => (n, t) => e(n, t, i);
|
|
@@ -42,7 +42,7 @@ function Pi(i) {
|
|
|
42
42
|
});
|
|
43
43
|
return n;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function yi(i) {
|
|
46
46
|
if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
|
|
47
47
|
return [];
|
|
48
48
|
const e = [];
|
|
@@ -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
|
+
yi(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 !== Dt.id && i.id !== Ot.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 = Ti([
|
|
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 Ii(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 bi = {
|
|
146
146
|
inline: H.INLINE,
|
|
147
147
|
wrapSquare: H.WRAP_SQUARE,
|
|
148
148
|
wrapTopAndBottom: H.WRAP_TOP_AND_BOTTOM,
|
|
@@ -231,7 +231,7 @@ const Zn = {
|
|
|
231
231
|
type: K.COMMAND,
|
|
232
232
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
233
233
|
handler: (i, e) => {
|
|
234
|
-
var
|
|
234
|
+
var E, U;
|
|
235
235
|
if (e == null)
|
|
236
236
|
return !1;
|
|
237
237
|
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(Q), d = i.get(ee).getRenderById(r), c = 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();
|
|
@@ -239,7 +239,7 @@ const Zn = {
|
|
|
239
239
|
return !1;
|
|
240
240
|
const p = l.getEditArea(), h = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = c, O = q.getInstance(), D = [], { drawings: T = {} } = g.getSnapshot();
|
|
241
241
|
for (const N of n) {
|
|
242
|
-
const { drawingId: I } = N, L = T[I].layoutType, W =
|
|
242
|
+
const { drawingId: I } = N, L = T[I].layoutType, W = bi[t];
|
|
243
243
|
if (L !== W) {
|
|
244
244
|
const C = O.replaceOp(["drawings", I, "layoutType"], L, W);
|
|
245
245
|
D.push(C);
|
|
@@ -247,23 +247,23 @@ const Zn = {
|
|
|
247
247
|
if (t === "behindText" || t === "inFrontOfText") {
|
|
248
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: A, pageHeight: $ } = C;
|
|
259
259
|
switch (p) {
|
|
260
260
|
case Fe.HEADER: {
|
|
261
|
-
const F = (
|
|
261
|
+
const F = (E = w.get(R)) == null ? void 0 : E.get(A);
|
|
262
262
|
F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = F.marginTop, _ = k);
|
|
263
263
|
break;
|
|
264
264
|
}
|
|
265
265
|
case Fe.FOOTER: {
|
|
266
|
-
const F = (U = S.get(
|
|
266
|
+
const F = (U = S.get(P)) == null ? void 0 : U.get(A);
|
|
267
267
|
F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = $ - b + F.marginTop, _ = k);
|
|
268
268
|
break;
|
|
269
269
|
}
|
|
@@ -276,23 +276,23 @@ 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
|
-
|
|
281
|
+
P.relativeFrom === ne.MARGIN ? B -= _ : P.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
|
|
282
282
|
const k = {
|
|
283
|
-
relativeFrom:
|
|
283
|
+
relativeFrom: P.relativeFrom,
|
|
284
284
|
posOffset: B
|
|
285
285
|
};
|
|
286
|
-
if (
|
|
287
|
-
const F = O.replaceOp(["drawings", I, "docTransform", "positionH"],
|
|
286
|
+
if (P.posOffset !== k.posOffset) {
|
|
287
|
+
const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], P, k);
|
|
288
288
|
D.push(F);
|
|
289
289
|
}
|
|
290
290
|
const b = T[I].docTransform.positionV;
|
|
291
|
-
let
|
|
292
|
-
b.relativeFrom === V.PAGE ?
|
|
291
|
+
let A = C;
|
|
292
|
+
b.relativeFrom === V.PAGE ? A += G : b.relativeFrom === V.LINE ? A -= x.lineTop : b.relativeFrom === V.PARAGRAPH && (A -= x.blockAnchorTop);
|
|
293
293
|
const $ = {
|
|
294
294
|
relativeFrom: b.relativeFrom,
|
|
295
|
-
posOffset:
|
|
295
|
+
posOffset: A
|
|
296
296
|
};
|
|
297
297
|
if (b.posOffset !== $.posOffset) {
|
|
298
298
|
const F = O.replaceOp(["drawings", I, "docTransform", "positionV"], b, $);
|
|
@@ -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",
|
|
@@ -384,7 +384,7 @@ const Zn = {
|
|
|
384
384
|
const { drawings: c, unitId: l } = e, m = q.getInstance(), g = [], { drawings: p = {} } = d.getSnapshot();
|
|
385
385
|
for (const w of c) {
|
|
386
386
|
const { drawingId: S, key: O, value: D } = w, T = p[S].docTransform[O];
|
|
387
|
-
if (!
|
|
387
|
+
if (!ye.diffValue(T, D)) {
|
|
388
388
|
const M = m.replaceOp(["drawings", S, "docTransform", O], T, D);
|
|
389
389
|
g.push(M);
|
|
390
390
|
}
|
|
@@ -430,7 +430,7 @@ const Zn = {
|
|
|
430
430
|
if (M == null || M.length === 0)
|
|
431
431
|
return r.refreshDrawings(a), 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,9 +438,9 @@ const Zn = {
|
|
|
438
438
|
textRanges: null
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
|
-
|
|
442
|
-
const
|
|
443
|
-
return d.refreshControls(), !!
|
|
441
|
+
y.params.actions = O.reduce((I, L) => q.compose(I, L), null);
|
|
442
|
+
const E = c.syncExecuteCommand(y.id, y.params);
|
|
443
|
+
return d.refreshControls(), !!E;
|
|
444
444
|
}
|
|
445
445
|
}, nt = {
|
|
446
446
|
id: "doc.command.transform-non-inline-drawing",
|
|
@@ -468,20 +468,20 @@ const Zn = {
|
|
|
468
468
|
if (D == null)
|
|
469
469
|
return !1;
|
|
470
470
|
D.length > 0 && w.push(...D);
|
|
471
|
-
const T = q.getInstance(), { drawings: M = {} } = c.getSnapshot(),
|
|
472
|
-
if (!
|
|
473
|
-
const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"],
|
|
471
|
+
const T = q.getInstance(), { drawings: M = {} } = c.getSnapshot(), y = M[S].docTransform, { positionH: E, positionV: U, size: N, angle: I } = y;
|
|
472
|
+
if (!ye.diffValue(E, p.positionH)) {
|
|
473
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"], E, p.positionH);
|
|
474
474
|
w.push(_);
|
|
475
475
|
}
|
|
476
|
-
if (!
|
|
476
|
+
if (!ye.diffValue(U, p.positionV)) {
|
|
477
477
|
const _ = T.replaceOp(["drawings", S, "docTransform", "positionV"], U, p.positionV);
|
|
478
478
|
w.push(_);
|
|
479
479
|
}
|
|
480
|
-
if (!
|
|
480
|
+
if (!ye.diffValue(N, p.size)) {
|
|
481
481
|
const _ = T.replaceOp(["drawings", S, "docTransform", "size"], N, p.size);
|
|
482
482
|
w.push(_);
|
|
483
483
|
}
|
|
484
|
-
if (!
|
|
484
|
+
if (!ye.diffValue(I, p.angle)) {
|
|
485
485
|
const _ = T.replaceOp(["drawings", S, "docTransform", "angle"], I, p.angle);
|
|
486
486
|
w.push(_);
|
|
487
487
|
}
|
|
@@ -499,12 +499,12 @@ const Zn = {
|
|
|
499
499
|
return s.refreshControls(), !!W;
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
|
-
var
|
|
503
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
502
|
+
var Mi = Object.getOwnPropertyDescriptor, Ri = (i, e, n, t) => {
|
|
503
|
+
for (var r = t > 1 ? void 0 : t ? Mi(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
504
504
|
(s = i[o]) && (r = s(r) || r);
|
|
505
505
|
return r;
|
|
506
506
|
}, Qe = (i, e) => (n, t) => e(n, t, i);
|
|
507
|
-
const
|
|
507
|
+
const Ni = "__InlineDrawingAnchor__";
|
|
508
508
|
function Fn(i) {
|
|
509
509
|
const { path: e } = i;
|
|
510
510
|
return e.some((n) => n === "cells");
|
|
@@ -632,20 +632,20 @@ let on = class extends Xe {
|
|
|
632
632
|
key: "angle",
|
|
633
633
|
value: c
|
|
634
634
|
}), v !== d || w !== a) {
|
|
635
|
-
const
|
|
636
|
-
|
|
635
|
+
const y = d - v, E = a - 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
|
+
}), E !== 0 && n.push({
|
|
644
644
|
drawingId: g.drawingId,
|
|
645
645
|
key: "positionH",
|
|
646
646
|
value: {
|
|
647
647
|
relativeFrom: h.docTransform.positionH.relativeFrom,
|
|
648
|
-
posOffset: h.docTransform.positionH.posOffset +
|
|
648
|
+
posOffset: h.docTransform.positionH.posOffset + E
|
|
649
649
|
}
|
|
650
650
|
});
|
|
651
651
|
}
|
|
@@ -699,46 +699,46 @@ let on = class extends Xe {
|
|
|
699
699
|
}
|
|
700
700
|
);
|
|
701
701
|
if (T) {
|
|
702
|
-
const { node: _, ratioX: C, segmentPage: R, segmentId:
|
|
703
|
-
h = C < S, p = _, v = R, w =
|
|
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
|
-
const
|
|
710
|
+
const E = {
|
|
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(E, E), { startOffset: W } = (G = En(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,
|
|
719
|
+
var _e, Se, de, De, Oe, Ne, Ee, Te, le, ge, Ae;
|
|
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
723
|
const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: l } = t, m = c, 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:
|
|
725
|
-
const { positionV:
|
|
726
|
-
M = Math.min(M, N),
|
|
724
|
+
let { width: M, height: y } = n;
|
|
725
|
+
const { positionV: E, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
|
|
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
734
|
angle: T
|
|
735
|
-
}, { x: C, y: R } = l.getViewportScrollXY(g),
|
|
736
|
-
if (
|
|
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 k = r == null ? void 0 : r.findNodeByCoord(
|
|
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()
|
|
@@ -749,14 +749,14 @@ let on = class extends Xe {
|
|
|
749
749
|
}
|
|
750
750
|
if (L == null)
|
|
751
751
|
return;
|
|
752
|
-
const b = (Se = L.parent) == null ? void 0 : Se.parent,
|
|
753
|
-
if (b == null ||
|
|
752
|
+
const b = (Se = L.parent) == null ? void 0 : Se.parent, A = b == null ? void 0 : b.parent, $ = (de = A == null ? void 0 : A.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : A == null ? void 0 : A.lines[0], F = (De = A == null ? void 0 : A.parent) == null ? void 0 : De.parent;
|
|
753
|
+
if (b == null || A == null || $ == null || F == null)
|
|
754
754
|
return;
|
|
755
755
|
this._liquid.reset();
|
|
756
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: vt, pageWidth: Cn, marginLeft: Dn, marginBottom: It } = pe, _t = s.indexOf(pe);
|
|
759
|
+
if (x > -1 && _t === x) {
|
|
760
760
|
switch (Y) {
|
|
761
761
|
case Rn.HEADER: {
|
|
762
762
|
const Ge = (Oe = a.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: vt - It + Ge.marginTop,
|
|
777
777
|
marginLeft: Dn
|
|
778
778
|
});
|
|
779
779
|
else
|
|
@@ -787,7 +787,7 @@ let on = class extends Xe {
|
|
|
787
787
|
break;
|
|
788
788
|
this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, p, h, v);
|
|
789
789
|
}
|
|
790
|
-
switch (
|
|
790
|
+
switch (E.relativeFrom === V.LINE ? L = b.divides[0].glyphGroup[0] : L = (ge = (le = (Te = (Ee = $.divides) == null ? void 0 : Ee[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) {
|
|
@@ -796,14 +796,14 @@ let on = class extends Xe {
|
|
|
796
796
|
break;
|
|
797
797
|
}
|
|
798
798
|
case ne.COLUMN: {
|
|
799
|
-
_.positionH.posOffset = O - this._liquid.x - w -
|
|
799
|
+
_.positionH.posOffset = O - this._liquid.x - w - A.left;
|
|
800
800
|
break;
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
803
|
switch (_.positionV = {
|
|
804
|
-
relativeFrom:
|
|
804
|
+
relativeFrom: E.relativeFrom,
|
|
805
805
|
posOffset: D - this._liquid.y - S
|
|
806
|
-
},
|
|
806
|
+
}, E.relativeFrom) {
|
|
807
807
|
case V.PAGE: {
|
|
808
808
|
_.positionV.posOffset = D - this._liquid.y - S - F.marginTop;
|
|
809
809
|
break;
|
|
@@ -825,7 +825,7 @@ let on = class extends Xe {
|
|
|
825
825
|
const Re = {
|
|
826
826
|
...ae,
|
|
827
827
|
isBack: G
|
|
828
|
-
}, We = Ue.document.getOffsetConfig(), ce = new Nn(We, r), { cursorList: te } = ce.getRangePointData(Re, Re), { startOffset: ie } = (
|
|
828
|
+
}, We = Ue.document.getOffsetConfig(), ce = new Nn(We, r), { cursorList: te } = ce.getRangePointData(Re, Re), { startOffset: ie } = (Ae = En(te)) != null ? Ae : {};
|
|
829
829
|
if (ie != null)
|
|
830
830
|
return { offset: ie, docTransform: _, segmentId: W, segmentPage: x };
|
|
831
831
|
}
|
|
@@ -880,17 +880,17 @@ let on = class extends Xe {
|
|
|
880
880
|
let O = o;
|
|
881
881
|
this._liquid.reset();
|
|
882
882
|
for (const D of m) {
|
|
883
|
-
const { marginBottom: T, pageHeight: M } = D,
|
|
884
|
-
if (
|
|
883
|
+
const { marginBottom: T, pageHeight: M } = D, y = m.indexOf(D), E = m[y + 1];
|
|
884
|
+
if (E == null)
|
|
885
885
|
continue;
|
|
886
|
-
if (
|
|
886
|
+
if (ye.hasIntersectionBetweenTwoRanges(
|
|
887
887
|
o,
|
|
888
888
|
o + a,
|
|
889
889
|
this._liquid.y + h + M - T,
|
|
890
|
-
this._liquid.y + h + M + S +
|
|
890
|
+
this._liquid.y + h + M + S + E.marginTop
|
|
891
891
|
)) {
|
|
892
892
|
const N = o + a / 2, I = this._liquid.y + h + M + S / 2;
|
|
893
|
-
N < I ? O = Math.min(o, this._liquid.y + h + M - T - a) : O = Math.max(o, this._liquid.y + h + M + S +
|
|
893
|
+
N < I ? O = Math.min(o, this._liquid.y + h + M - T - a) : O = Math.max(o, this._liquid.y + h + M + S + E.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(Jt.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: a,
|
|
940
940
|
docsTop: d
|
|
941
|
-
} = s.getOffsetConfig(), c =
|
|
941
|
+
} = s.getOffsetConfig(), c = gi(n), { left: l, top: m, height: g } = c, p = l + a, 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 ei(Ni + ye.generateRandomId(v), {
|
|
947
947
|
left: p,
|
|
948
948
|
top: h,
|
|
949
949
|
height: g,
|
|
950
950
|
strokeWidth: 2,
|
|
951
|
-
stroke:
|
|
951
|
+
stroke: ni(Tt.darkGray, 1),
|
|
952
952
|
evented: !1
|
|
953
953
|
});
|
|
954
|
-
this._anchorShape = w, o.addObject(w,
|
|
954
|
+
this._anchorShape = w, o.addObject(w, mi);
|
|
955
955
|
}
|
|
956
956
|
_getDocObject() {
|
|
957
|
-
return
|
|
957
|
+
return ui(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();
|
|
@@ -985,7 +985,7 @@ let on = class extends Xe {
|
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
987
|
};
|
|
988
|
-
on =
|
|
988
|
+
on = Ri([
|
|
989
989
|
Qe(0, z),
|
|
990
990
|
Qe(1, Q),
|
|
991
991
|
Qe(2, Ie),
|
|
@@ -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 = Ei(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d =
|
|
1010
|
+
var n = i.icon, t = i.id, r = i.className, o = i.extend, s = Ei(i, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), d = Ci("_".concat(Li()));
|
|
1011
1011
|
return it(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className: a }, 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 }, Ai(i, n, r)), t), (xi(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 Ai(i, e, n) {
|
|
1019
1019
|
var t = he({}, i.attrs);
|
|
1020
1020
|
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1), i.tag === "mask" && t.id && (t.id = t.id + e.idSuffix), Object.entries(t).forEach(function(o) {
|
|
1021
1021
|
var s = o[0], a = o[1];
|
|
@@ -1027,21 +1027,21 @@ function xi(i, e, n) {
|
|
|
1027
1027
|
typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1028
1028
|
})), t;
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function xi(i, e) {
|
|
1031
1031
|
var n, t = e.defIds;
|
|
1032
1032
|
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) {
|
|
1033
1033
|
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;
|
|
1034
1034
|
}) }) : i;
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function Li() {
|
|
1037
1037
|
return Math.random().toString(36).substring(2, 8);
|
|
1038
1038
|
}
|
|
1039
1039
|
tt.displayName = "UniverIcon";
|
|
1040
|
-
var
|
|
1040
|
+
var Bi = { 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) {
|
|
1041
1041
|
return Kn(tt, Object.assign({}, i, {
|
|
1042
1042
|
id: "add-image-single",
|
|
1043
1043
|
ref: e,
|
|
1044
|
-
icon:
|
|
1044
|
+
icon: Bi
|
|
1045
1045
|
}));
|
|
1046
1046
|
});
|
|
1047
1047
|
rt.displayName = "AddImageSingle";
|
|
@@ -1050,11 +1050,11 @@ const Sn = {
|
|
|
1050
1050
|
type: K.COMMAND,
|
|
1051
1051
|
// eslint-disable-next-line max-lines-per-function
|
|
1052
1052
|
handler: (i, e) => {
|
|
1053
|
-
var M,
|
|
1053
|
+
var M, y, E, U;
|
|
1054
1054
|
const n = i.get(z), t = i.get(Q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
|
|
1055
1055
|
if (e == null || o == null)
|
|
1056
1056
|
return !1;
|
|
1057
|
-
const s = r.getRenderById(e.unitId).with(Me), { drawings: a } = e, d = (M = s.getSegment()) != null ? M : "", c = new vn(), l = q.getInstance(), m = (
|
|
1057
|
+
const s = r.getRenderById(e.unitId).with(Me), { drawings: a } = e, d = (M = s.getSegment()) != null ? M : "", c = new vn(), l = q.getInstance(), m = (E = (y = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? E : [], g = a.map((N) => m.find((I) => I.blockId === N.drawingId)).filter((N) => !!N).sort((N, I) => N.startIndex > I.startIndex ? 1 : -1), p = a[0].unitId, h = new Pt();
|
|
1058
1058
|
h.reset();
|
|
1059
1059
|
const v = g[0].startIndex, w = [
|
|
1060
1060
|
{
|
|
@@ -1129,7 +1129,7 @@ const Sn = {
|
|
|
1129
1129
|
type: K.COMMAND,
|
|
1130
1130
|
// eslint-disable-next-line max-lines-per-function
|
|
1131
1131
|
handler: (i, e) => {
|
|
1132
|
-
var
|
|
1132
|
+
var y, E, U, N;
|
|
1133
1133
|
if (e == null)
|
|
1134
1134
|
return !1;
|
|
1135
1135
|
const n = i.get(z), t = i.get(In), r = i.get(Q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
|
|
@@ -1138,7 +1138,7 @@ const Sn = {
|
|
|
1138
1138
|
const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset: l, segmentId: m } = o, g = s.getSelfOrHeaderFooterModel(m).getBody();
|
|
1139
1139
|
if (g == null)
|
|
1140
1140
|
return !1;
|
|
1141
|
-
const p = new vn(), h = q.getInstance(), v = [], w = (
|
|
1141
|
+
const p = new vn(), h = q.getInstance(), v = [], w = (E = (y = s.getSnapshot().drawingsOrder) == null ? void 0 : y.length) != null ? E : 0;
|
|
1142
1142
|
let S = 0;
|
|
1143
1143
|
if (c)
|
|
1144
1144
|
l > 0 && p.push({
|
|
@@ -1146,16 +1146,16 @@ const Sn = {
|
|
|
1146
1146
|
len: l
|
|
1147
1147
|
});
|
|
1148
1148
|
else {
|
|
1149
|
-
const I =
|
|
1149
|
+
const I = yt.selection.delete([o], g, 0, null, !1);
|
|
1150
1150
|
p.push(...I);
|
|
1151
|
-
const L =
|
|
1151
|
+
const L = fi(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);
|
|
1152
1152
|
if (G.length > 0)
|
|
1153
1153
|
for (const _ of G) {
|
|
1154
1154
|
const C = W[_], R = x.indexOf(_);
|
|
1155
1155
|
if (C == null || R < 0)
|
|
1156
1156
|
continue;
|
|
1157
|
-
const
|
|
1158
|
-
v.push(
|
|
1157
|
+
const P = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
|
|
1158
|
+
v.push(P), v.push(B), S++;
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
1161
|
p.push({
|
|
@@ -1200,7 +1200,7 @@ const Sn = {
|
|
|
1200
1200
|
if (l == null)
|
|
1201
1201
|
return !1;
|
|
1202
1202
|
const m = [];
|
|
1203
|
-
let g =
|
|
1203
|
+
let g = ye.deepClone(l);
|
|
1204
1204
|
g = g.slice(3), g.unshift("drawingsOrder"), m.push(g);
|
|
1205
1205
|
const p = {
|
|
1206
1206
|
id: J.id,
|
|
@@ -1229,8 +1229,8 @@ const Sn = {
|
|
|
1229
1229
|
return !1;
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
|
-
var
|
|
1233
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1232
|
+
var Ui = Object.getOwnPropertyDescriptor, ki = (i, e, n, t) => {
|
|
1233
|
+
for (var r = t > 1 ? void 0 : t ? Ui(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1234
1234
|
(s = i[o]) && (r = s(r) || r);
|
|
1235
1235
|
return r;
|
|
1236
1236
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
@@ -1241,11 +1241,11 @@ let sn = class extends Xe {
|
|
|
1241
1241
|
async insertDocImage() {
|
|
1242
1242
|
const i = await this._fileOpenerService.openFile({
|
|
1243
1243
|
multiple: !0,
|
|
1244
|
-
accept:
|
|
1244
|
+
accept: Gt.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
1245
1245
|
}), e = i.length;
|
|
1246
|
-
return e >
|
|
1246
|
+
return e > Pn ? (this._messageService.show({
|
|
1247
1247
|
type: Ln.Error,
|
|
1248
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
1248
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(Pn))
|
|
1249
1249
|
}), !1) : e === 0 ? !1 : (await this._insertFloatImages(i), !0);
|
|
1250
1250
|
}
|
|
1251
1251
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1258,7 +1258,7 @@ let sn = class extends Xe {
|
|
|
1258
1258
|
let s = "";
|
|
1259
1259
|
switch (o) {
|
|
1260
1260
|
case hn.ERROR_EXCEED_SIZE:
|
|
1261
|
-
s = this._localeService.t("update-status.exceedMaxSize", String(
|
|
1261
|
+
s = this._localeService.t("update-status.exceedMaxSize", String(Vt / (1024 * 1024)));
|
|
1262
1262
|
break;
|
|
1263
1263
|
case hn.ERROR_IMAGE_TYPE:
|
|
1264
1264
|
s = this._localeService.t("update-status.invalidImageType");
|
|
@@ -1278,11 +1278,11 @@ let sn = class extends Xe {
|
|
|
1278
1278
|
for (const r of e) {
|
|
1279
1279
|
if (r == null)
|
|
1280
1280
|
continue;
|
|
1281
|
-
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: m } = await
|
|
1281
|
+
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: m } = await jt(d || "");
|
|
1282
1282
|
this._imageIoService.addImageSourceCache(o, s, m);
|
|
1283
1283
|
let g = 1;
|
|
1284
|
-
if (c >
|
|
1285
|
-
const w =
|
|
1284
|
+
if (c > yn || l > bn) {
|
|
1285
|
+
const w = yn / c, S = bn / l;
|
|
1286
1286
|
g = Math.min(w, S);
|
|
1287
1287
|
}
|
|
1288
1288
|
const p = this._getImagePosition(c * g, l * g);
|
|
@@ -1292,10 +1292,10 @@ let sn = class extends Xe {
|
|
|
1292
1292
|
unitId: n,
|
|
1293
1293
|
subUnitId: n,
|
|
1294
1294
|
drawingId: o,
|
|
1295
|
-
drawingType:
|
|
1295
|
+
drawingType: bt.DRAWING_IMAGE,
|
|
1296
1296
|
imageSourceType: s,
|
|
1297
1297
|
source: a,
|
|
1298
|
-
transform:
|
|
1298
|
+
transform: hi(p),
|
|
1299
1299
|
docTransform: p,
|
|
1300
1300
|
behindDoc: oe.FALSE,
|
|
1301
1301
|
title: "",
|
|
@@ -1416,7 +1416,7 @@ let sn = class extends Xe {
|
|
|
1416
1416
|
return;
|
|
1417
1417
|
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Fe.BODY;
|
|
1418
1418
|
for (const d of Object.keys(o)) {
|
|
1419
|
-
const c = o[d], l =
|
|
1419
|
+
const c = o[d], l = $t({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
|
|
1420
1420
|
if (m.length)
|
|
1421
1421
|
for (const g of m)
|
|
1422
1422
|
e.detachTransformerFrom(g), g.setOpacity(0.5), (s && c.isMultiTransform !== oe.TRUE || !s && c.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(g), g.setOpacity(1));
|
|
@@ -1450,19 +1450,19 @@ let sn = class extends Xe {
|
|
|
1450
1450
|
this._docSelectionManagerService.replaceDocRanges(t);
|
|
1451
1451
|
}
|
|
1452
1452
|
};
|
|
1453
|
-
sn =
|
|
1453
|
+
sn = ki([
|
|
1454
1454
|
me(1, z),
|
|
1455
1455
|
me(2, ve(In)),
|
|
1456
1456
|
me(3, ee),
|
|
1457
|
-
me(4,
|
|
1457
|
+
me(4, Wt),
|
|
1458
1458
|
me(5, Be),
|
|
1459
1459
|
me(6, Ie),
|
|
1460
1460
|
me(7, Vn),
|
|
1461
|
-
me(8,
|
|
1461
|
+
me(8, ii),
|
|
1462
1462
|
me(9, ve(ln)),
|
|
1463
1463
|
me(10, ve(Me)),
|
|
1464
1464
|
me(11, ve(gn)),
|
|
1465
|
-
me(12,
|
|
1465
|
+
me(12, ri)
|
|
1466
1466
|
], sn);
|
|
1467
1467
|
const lt = {
|
|
1468
1468
|
id: "doc.command.insert-float-image",
|
|
@@ -1482,12 +1482,12 @@ const lt = {
|
|
|
1482
1482
|
if (l == null)
|
|
1483
1483
|
return !1;
|
|
1484
1484
|
const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), p = a.map((v) => {
|
|
1485
|
-
var
|
|
1486
|
-
const { drawingId: w } = v, S = (
|
|
1485
|
+
var y, E, U, N, I;
|
|
1486
|
+
const { drawingId: w } = v, S = (y = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : y[w];
|
|
1487
1487
|
if (S == null || S.layoutType === H.INLINE)
|
|
1488
1488
|
return null;
|
|
1489
1489
|
const { positionH: O, positionV: D } = S.docTransform, T = { ...O }, M = { ...D };
|
|
1490
|
-
return s === fe.UP ? M.posOffset = ((
|
|
1490
|
+
return s === fe.UP ? M.posOffset = ((E = M.posOffset) != null ? E : 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), {
|
|
1491
1491
|
drawingId: w,
|
|
1492
1492
|
key: s === fe.UP || s === fe.DOWN ? "positionV" : "positionH",
|
|
1493
1493
|
value: s === fe.UP || s === fe.DOWN ? M : T
|
|
@@ -1502,7 +1502,7 @@ const lt = {
|
|
|
1502
1502
|
});
|
|
1503
1503
|
return m.refreshControls(), !!h;
|
|
1504
1504
|
}
|
|
1505
|
-
},
|
|
1505
|
+
}, Fi = {
|
|
1506
1506
|
id: "doc.operation.clear-drawing-transformer",
|
|
1507
1507
|
type: K.MUTATION,
|
|
1508
1508
|
handler: (i, e) => {
|
|
@@ -1516,7 +1516,7 @@ const lt = {
|
|
|
1516
1516
|
id: "sidebar.operation.doc-image",
|
|
1517
1517
|
type: K.COMMAND,
|
|
1518
1518
|
handler: async (i, e) => {
|
|
1519
|
-
const n = i.get(
|
|
1519
|
+
const n = i.get(oi), t = i.get(ln), r = i.get(Ie);
|
|
1520
1520
|
switch (e.value) {
|
|
1521
1521
|
case "open":
|
|
1522
1522
|
n.open({
|
|
@@ -1542,31 +1542,17 @@ const lt = {
|
|
|
1542
1542
|
const n = i.get(Ie), t = i.get(z);
|
|
1543
1543
|
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(mt.id, { value: "open" }), !0);
|
|
1544
1544
|
}
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = ft(i)) && (t && (t += " "), t += e);
|
|
1557
|
-
return t;
|
|
1558
|
-
}
|
|
1559
|
-
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 = {
|
|
1560
|
-
imageCommonPanel: Wi,
|
|
1561
|
-
imageCommonPanelGrid: Gi,
|
|
1562
|
-
imageCommonPanelBorder: Vi,
|
|
1563
|
-
imageCommonPanelTitle: ji,
|
|
1564
|
-
imageCommonPanelSubtitle: $i,
|
|
1565
|
-
imageCommonPanelRow: zi,
|
|
1566
|
-
imageCommonPanelColumn: qi,
|
|
1567
|
-
imageCommonPanelSpan2: Xi,
|
|
1568
|
-
imageCommonPanelInput: Ki
|
|
1569
|
-
}, Hn = -1e3, Wn = 1e3, Yi = (i) => {
|
|
1545
|
+
}, Hi = "univer-image-common-panel", Wi = "univer-image-common-panel-grid", Gi = "univer-image-common-panel-border", Vi = "univer-image-common-panel-title", ji = "univer-image-common-panel-subtitle", $i = "univer-image-common-panel-row", zi = "univer-image-common-panel-column", qi = "univer-image-common-panel-span2", Xi = "univer-image-common-panel-input", u = {
|
|
1546
|
+
imageCommonPanel: Hi,
|
|
1547
|
+
imageCommonPanelGrid: Wi,
|
|
1548
|
+
imageCommonPanelBorder: Gi,
|
|
1549
|
+
imageCommonPanelTitle: Vi,
|
|
1550
|
+
imageCommonPanelSubtitle: ji,
|
|
1551
|
+
imageCommonPanelRow: $i,
|
|
1552
|
+
imageCommonPanelColumn: zi,
|
|
1553
|
+
imageCommonPanelSpan2: qi,
|
|
1554
|
+
imageCommonPanelInput: Xi
|
|
1555
|
+
}, Hn = -1e3, Wn = 1e3, Ki = (i) => {
|
|
1570
1556
|
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
|
|
1571
1557
|
if (a == null)
|
|
1572
1558
|
return;
|
|
@@ -1603,23 +1589,23 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1603
1589
|
}), [T, M] = re({
|
|
1604
1590
|
relativeFrom: V.PAGE,
|
|
1605
1591
|
posOffset: 0
|
|
1606
|
-
}), [
|
|
1592
|
+
}), [y, E] = re(!0), [U, N] = re(!0);
|
|
1607
1593
|
function I(C, R) {
|
|
1608
1594
|
var b;
|
|
1609
1595
|
C === "positionH" ? D(R) : M(R);
|
|
1610
|
-
const
|
|
1611
|
-
if (
|
|
1596
|
+
const P = t.getFocusDrawings();
|
|
1597
|
+
if (P.length === 0)
|
|
1612
1598
|
return;
|
|
1613
|
-
const B =
|
|
1614
|
-
unitId:
|
|
1615
|
-
subUnitId:
|
|
1616
|
-
drawingId:
|
|
1599
|
+
const B = P.map((A) => ({
|
|
1600
|
+
unitId: A.unitId,
|
|
1601
|
+
subUnitId: A.subUnitId,
|
|
1602
|
+
drawingId: A.drawingId
|
|
1617
1603
|
}));
|
|
1618
1604
|
e.executeCommand(qe.id, {
|
|
1619
|
-
unitId:
|
|
1620
|
-
subUnitId:
|
|
1621
|
-
drawings: B.map((
|
|
1622
|
-
drawingId:
|
|
1605
|
+
unitId: P[0].unitId,
|
|
1606
|
+
subUnitId: P[0].unitId,
|
|
1607
|
+
drawings: B.map((A) => ({
|
|
1608
|
+
drawingId: A.drawingId,
|
|
1623
1609
|
key: C,
|
|
1624
1610
|
value: R
|
|
1625
1611
|
}))
|
|
@@ -1629,20 +1615,20 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1629
1615
|
}
|
|
1630
1616
|
function L(C) {
|
|
1631
1617
|
var ie, _e, Se;
|
|
1632
|
-
const R = O.relativeFrom,
|
|
1618
|
+
const R = O.relativeFrom, P = O.posOffset, B = Number(C);
|
|
1633
1619
|
if (R === B)
|
|
1634
1620
|
return;
|
|
1635
1621
|
const k = t.getFocusDrawings();
|
|
1636
1622
|
if (k.length === 0)
|
|
1637
1623
|
return;
|
|
1638
|
-
const b = k[0].drawingId,
|
|
1624
|
+
const b = k[0].drawingId, A = k[0].unitId;
|
|
1639
1625
|
let $ = null, F = 0;
|
|
1640
|
-
const Y = (ie = r.getRenderById(
|
|
1626
|
+
const Y = (ie = r.getRenderById(A)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Y == null ? void 0 : Y.getSkeletonData();
|
|
1641
1627
|
if (ae == null)
|
|
1642
1628
|
return;
|
|
1643
1629
|
const { pages: Ue, skeHeaders: Re, skeFooters: We } = ae;
|
|
1644
1630
|
for (const de of Ue) {
|
|
1645
|
-
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId:
|
|
1631
|
+
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ee, pageWidth: Te } = de;
|
|
1646
1632
|
if (Oe.has(b)) {
|
|
1647
1633
|
$ = Oe.get(b), F = De;
|
|
1648
1634
|
break;
|
|
@@ -1652,7 +1638,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1652
1638
|
$ = le == null ? void 0 : le.skeDrawings.get(b), F = De;
|
|
1653
1639
|
break;
|
|
1654
1640
|
}
|
|
1655
|
-
const ge = (Se = We.get(
|
|
1641
|
+
const ge = (Se = We.get(Ee)) == null ? void 0 : Se.get(Te);
|
|
1656
1642
|
if (ge != null && ge.skeDrawings.has(b)) {
|
|
1657
1643
|
$ = ge == null ? void 0 : ge.skeDrawings.get(b), F = De;
|
|
1658
1644
|
break;
|
|
@@ -1664,60 +1650,60 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1664
1650
|
R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -= F), B === ne.COLUMN ? ce += $.columnLeft : B === ne.MARGIN ? ce += F : ne.PAGE;
|
|
1665
1651
|
const te = {
|
|
1666
1652
|
relativeFrom: B,
|
|
1667
|
-
posOffset: (
|
|
1653
|
+
posOffset: (P != null ? P : 0) - ce
|
|
1668
1654
|
};
|
|
1669
1655
|
I("positionH", te);
|
|
1670
1656
|
}
|
|
1671
1657
|
function W(C) {
|
|
1672
|
-
var Oe, Ne,
|
|
1673
|
-
const R = T.relativeFrom,
|
|
1658
|
+
var Oe, Ne, Ee, Te, le, ge;
|
|
1659
|
+
const R = T.relativeFrom, P = T.posOffset, B = Number(C);
|
|
1674
1660
|
if (R === B)
|
|
1675
1661
|
return;
|
|
1676
1662
|
const k = t.getFocusDrawings();
|
|
1677
1663
|
if (k.length === 0)
|
|
1678
1664
|
return;
|
|
1679
|
-
const { drawingId: b, unitId:
|
|
1665
|
+
const { drawingId: b, unitId: A } = k[0], $ = o.getUniverDocInstance(A), F = (Oe = r.getRenderById(A)) == null ? void 0 : Oe.with(se).getSkeleton(), Y = (Ne = r.getRenderById(A)) == null ? void 0 : Ne.with(Me), ae = Y == null ? void 0 : Y.getSegment(), Ue = Y == null ? void 0 : Y.getSegmentPage(), Re = (Te = (Ee = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ee.customBlocks) == null ? void 0 : Te.find((Ae) => Ae.blockId === b);
|
|
1680
1666
|
if (Re == null || F == null || Y == null)
|
|
1681
1667
|
return;
|
|
1682
|
-
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((
|
|
1668
|
+
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((Ae) => Ae.paragraphIndex === (te == null ? void 0 : te.paragraphIndex) && Ae.paragraphStart), Se = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
|
|
1683
1669
|
if (ce == null || te == null || _e == null || ie == null || Se == null)
|
|
1684
1670
|
return;
|
|
1685
1671
|
let de = 0;
|
|
1686
1672
|
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
1673
|
const De = {
|
|
1688
1674
|
relativeFrom: B,
|
|
1689
|
-
posOffset: (
|
|
1675
|
+
posOffset: (P != null ? P : 0) - de
|
|
1690
1676
|
};
|
|
1691
1677
|
I("positionV", De);
|
|
1692
1678
|
}
|
|
1693
1679
|
function x(C) {
|
|
1694
|
-
var
|
|
1695
|
-
const R = c == null ? void 0 : c.getSnapshot(),
|
|
1696
|
-
if (
|
|
1680
|
+
var A;
|
|
1681
|
+
const R = c == null ? void 0 : c.getSnapshot(), P = (A = R == null ? void 0 : R.drawings) == null ? void 0 : A[C.drawingId];
|
|
1682
|
+
if (P == null)
|
|
1697
1683
|
return;
|
|
1698
|
-
const { layoutType: B } =
|
|
1684
|
+
const { layoutType: B } = P, {
|
|
1699
1685
|
positionH: k,
|
|
1700
1686
|
positionV: b
|
|
1701
|
-
} =
|
|
1702
|
-
D(k), M(b), S(B === H.INLINE),
|
|
1687
|
+
} = P.docTransform;
|
|
1688
|
+
D(k), M(b), S(B === H.INLINE), E(b.relativeFrom === V.PARAGRAPH || b.relativeFrom === V.LINE);
|
|
1703
1689
|
}
|
|
1704
1690
|
function G() {
|
|
1705
1691
|
const C = t.getFocusDrawings();
|
|
1706
1692
|
C.length !== 0 && x(C[0]);
|
|
1707
1693
|
}
|
|
1708
1694
|
function _(C) {
|
|
1709
|
-
|
|
1695
|
+
E(C), W(String(C ? V.PARAGRAPH : V.PAGE));
|
|
1710
1696
|
}
|
|
1711
1697
|
return _n(() => {
|
|
1712
1698
|
G();
|
|
1713
|
-
const C = t.focus$.subscribe((
|
|
1714
|
-
if (
|
|
1699
|
+
const C = t.focus$.subscribe((P) => {
|
|
1700
|
+
if (P.length === 0) {
|
|
1715
1701
|
N(!1);
|
|
1716
1702
|
return;
|
|
1717
1703
|
}
|
|
1718
|
-
N(!0), x(
|
|
1719
|
-
}), R = e.onCommandExecuted(async (
|
|
1720
|
-
|
|
1704
|
+
N(!0), x(P[0]);
|
|
1705
|
+
}), R = e.onCommandExecuted(async (P) => {
|
|
1706
|
+
P.id === J.id && G();
|
|
1721
1707
|
});
|
|
1722
1708
|
return () => {
|
|
1723
1709
|
C.unsubscribe(), R.dispose();
|
|
@@ -1795,16 +1781,16 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1795
1781
|
] }) })
|
|
1796
1782
|
] }),
|
|
1797
1783
|
/* @__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") }) }) }),
|
|
1798
|
-
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1784
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(Si, { disabled: w, checked: y, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1799
1785
|
] });
|
|
1800
|
-
}, Je = 0, en = 100,
|
|
1786
|
+
}, Je = 0, en = 100, Yi = (i) => {
|
|
1801
1787
|
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
|
|
1802
1788
|
if (a == null)
|
|
1803
1789
|
return null;
|
|
1804
1790
|
const { unitId: d } = a, c = o.getUniverDocInstance(d), l = r.getRenderById(d);
|
|
1805
1791
|
if ((l == null ? void 0 : l.scene) == null)
|
|
1806
1792
|
return null;
|
|
1807
|
-
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [
|
|
1793
|
+
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [y, E] = re({
|
|
1808
1794
|
distT: 0,
|
|
1809
1795
|
distL: 0,
|
|
1810
1796
|
distB: 0,
|
|
@@ -1815,14 +1801,14 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1815
1801
|
const C = t.getFocusDrawings();
|
|
1816
1802
|
if (C.length === 0)
|
|
1817
1803
|
return;
|
|
1818
|
-
const { unitId: R, subUnitId:
|
|
1804
|
+
const { unitId: R, subUnitId: P } = C[0], B = C.map(({ unitId: k, subUnitId: b, drawingId: A }) => ({
|
|
1819
1805
|
unitId: k,
|
|
1820
1806
|
subUnitId: b,
|
|
1821
|
-
drawingId:
|
|
1807
|
+
drawingId: A
|
|
1822
1808
|
}));
|
|
1823
1809
|
e.executeCommand(Zn.id, {
|
|
1824
1810
|
unitId: R,
|
|
1825
|
-
subUnitId:
|
|
1811
|
+
subUnitId: P,
|
|
1826
1812
|
drawings: B,
|
|
1827
1813
|
wrappingStyle: _
|
|
1828
1814
|
});
|
|
@@ -1832,10 +1818,10 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1832
1818
|
const C = t.getFocusDrawings();
|
|
1833
1819
|
if (C.length === 0)
|
|
1834
1820
|
return;
|
|
1835
|
-
const R = C.map((
|
|
1836
|
-
unitId:
|
|
1837
|
-
subUnitId:
|
|
1838
|
-
drawingId:
|
|
1821
|
+
const R = C.map((P) => ({
|
|
1822
|
+
unitId: P.unitId,
|
|
1823
|
+
subUnitId: P.subUnitId,
|
|
1824
|
+
drawingId: P.drawingId
|
|
1839
1825
|
}));
|
|
1840
1826
|
e.executeCommand(Jn.id, {
|
|
1841
1827
|
unitId: C[0].unitId,
|
|
@@ -1847,19 +1833,19 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1847
1833
|
function W(_, C) {
|
|
1848
1834
|
if (_ == null)
|
|
1849
1835
|
return;
|
|
1850
|
-
const R = { ...
|
|
1851
|
-
|
|
1852
|
-
const
|
|
1853
|
-
if (
|
|
1836
|
+
const R = { ...y, [C]: _ };
|
|
1837
|
+
E(R);
|
|
1838
|
+
const P = t.getFocusDrawings();
|
|
1839
|
+
if (P.length === 0)
|
|
1854
1840
|
return;
|
|
1855
|
-
const B =
|
|
1841
|
+
const B = P.map((k) => ({
|
|
1856
1842
|
unitId: k.unitId,
|
|
1857
1843
|
subUnitId: k.subUnitId,
|
|
1858
1844
|
drawingId: k.drawingId
|
|
1859
1845
|
}));
|
|
1860
1846
|
e.executeCommand(Qn.id, {
|
|
1861
|
-
unitId:
|
|
1862
|
-
subUnitId:
|
|
1847
|
+
unitId: P[0].unitId,
|
|
1848
|
+
subUnitId: P[0].unitId,
|
|
1863
1849
|
drawings: B,
|
|
1864
1850
|
dist: {
|
|
1865
1851
|
[C]: _
|
|
@@ -1877,20 +1863,20 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1877
1863
|
return;
|
|
1878
1864
|
const {
|
|
1879
1865
|
distT: R = 0,
|
|
1880
|
-
distL:
|
|
1866
|
+
distL: P = 0,
|
|
1881
1867
|
distB: B = 0,
|
|
1882
1868
|
distR: k = 0,
|
|
1883
1869
|
layoutType: b = H.INLINE,
|
|
1884
|
-
behindDoc:
|
|
1870
|
+
behindDoc: A = oe.FALSE,
|
|
1885
1871
|
wrapText: $ = $e.BOTH_SIDES
|
|
1886
1872
|
} = C;
|
|
1887
|
-
if (
|
|
1873
|
+
if (E({
|
|
1888
1874
|
distT: R,
|
|
1889
|
-
distL:
|
|
1875
|
+
distL: P,
|
|
1890
1876
|
distB: B,
|
|
1891
1877
|
distR: k
|
|
1892
1878
|
}), 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
|
-
|
|
1879
|
+
A === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
|
|
1894
1880
|
else
|
|
1895
1881
|
switch (b) {
|
|
1896
1882
|
case H.INLINE:
|
|
@@ -1924,17 +1910,17 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1924
1910
|
/* @__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") }) }) }),
|
|
1925
1911
|
/* @__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") }) }) }),
|
|
1926
1912
|
/* @__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: [
|
|
1927
|
-
/* @__PURE__ */ f(
|
|
1928
|
-
/* @__PURE__ */ f(
|
|
1929
|
-
/* @__PURE__ */ f(
|
|
1930
|
-
/* @__PURE__ */ f(
|
|
1931
|
-
/* @__PURE__ */ f(
|
|
1913
|
+
/* @__PURE__ */ f(Pe, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
|
|
1914
|
+
/* @__PURE__ */ f(Pe, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
|
|
1915
|
+
/* @__PURE__ */ f(Pe, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
|
|
1916
|
+
/* @__PURE__ */ f(Pe, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
|
|
1917
|
+
/* @__PURE__ */ f(Pe, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1932
1918
|
] }) }) }),
|
|
1933
1919
|
/* @__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") }) }) }),
|
|
1934
1920
|
/* @__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: [
|
|
1935
|
-
/* @__PURE__ */ f(
|
|
1936
|
-
/* @__PURE__ */ f(
|
|
1937
|
-
/* @__PURE__ */ f(
|
|
1921
|
+
/* @__PURE__ */ f(Pe, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1922
|
+
/* @__PURE__ */ f(Pe, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1923
|
+
/* @__PURE__ */ f(Pe, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
1938
1924
|
] }) }) }),
|
|
1939
1925
|
/* @__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") }) }) }),
|
|
1940
1926
|
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
@@ -1947,7 +1933,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1947
1933
|
max: en,
|
|
1948
1934
|
disabled: h,
|
|
1949
1935
|
precision: 1,
|
|
1950
|
-
value:
|
|
1936
|
+
value: y.distT,
|
|
1951
1937
|
onChange: (_) => {
|
|
1952
1938
|
W(_, "distT");
|
|
1953
1939
|
},
|
|
@@ -1964,7 +1950,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1964
1950
|
max: en,
|
|
1965
1951
|
disabled: w,
|
|
1966
1952
|
precision: 1,
|
|
1967
|
-
value:
|
|
1953
|
+
value: y.distL,
|
|
1968
1954
|
onChange: (_) => {
|
|
1969
1955
|
W(_, "distL");
|
|
1970
1956
|
},
|
|
@@ -1983,7 +1969,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
1983
1969
|
max: en,
|
|
1984
1970
|
disabled: h,
|
|
1985
1971
|
precision: 1,
|
|
1986
|
-
value:
|
|
1972
|
+
value: y.distB,
|
|
1987
1973
|
onChange: (_) => {
|
|
1988
1974
|
W(_, "distB");
|
|
1989
1975
|
},
|
|
@@ -2000,7 +1986,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
2000
1986
|
max: en,
|
|
2001
1987
|
disabled: w,
|
|
2002
1988
|
precision: 1,
|
|
2003
|
-
value:
|
|
1989
|
+
value: y.distR,
|
|
2004
1990
|
onChange: (_) => {
|
|
2005
1991
|
W(_, "distR");
|
|
2006
1992
|
},
|
|
@@ -2010,7 +1996,7 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
2010
1996
|
] }) })
|
|
2011
1997
|
] })
|
|
2012
1998
|
] });
|
|
2013
|
-
},
|
|
1999
|
+
}, Zi = () => {
|
|
2014
2000
|
const i = we(Ie), e = i.getFocusDrawings(), [n, t] = re(e);
|
|
2015
2001
|
return _n(() => {
|
|
2016
2002
|
const r = i.focus$.subscribe((o) => {
|
|
@@ -2020,13 +2006,13 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
2020
2006
|
r.unsubscribe();
|
|
2021
2007
|
};
|
|
2022
2008
|
}, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className: u.imageCommonPanel, children: [
|
|
2023
|
-
/* @__PURE__ */ f(
|
|
2024
|
-
/* @__PURE__ */ f(
|
|
2025
|
-
/* @__PURE__ */ f(
|
|
2009
|
+
/* @__PURE__ */ f(qt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
2010
|
+
/* @__PURE__ */ f(Yi, { drawings: n }),
|
|
2011
|
+
/* @__PURE__ */ f(Ki, { drawings: n })
|
|
2026
2012
|
] });
|
|
2027
|
-
},
|
|
2013
|
+
}, ft = "addition-and-subtraction-single", ht = "doc.menu.image", pt = lt.id, Qi = (i) => {
|
|
2028
2014
|
const e = i.get(In), n = i.get(Q);
|
|
2029
|
-
return new
|
|
2015
|
+
return new _i((t) => {
|
|
2030
2016
|
const r = e.textSelection$.subscribe(() => {
|
|
2031
2017
|
var s;
|
|
2032
2018
|
const o = e.getActiveTextRange();
|
|
@@ -2048,40 +2034,40 @@ const Wi = "univer-image-common-panel", Gi = "univer-image-common-panel-grid", V
|
|
|
2048
2034
|
return () => r.unsubscribe();
|
|
2049
2035
|
});
|
|
2050
2036
|
};
|
|
2051
|
-
function
|
|
2037
|
+
function Ji(i) {
|
|
2052
2038
|
return {
|
|
2053
|
-
id:
|
|
2039
|
+
id: ht,
|
|
2054
2040
|
type: zn.SUBITEMS,
|
|
2055
|
-
icon:
|
|
2041
|
+
icon: ft,
|
|
2056
2042
|
tooltip: "docImage.title",
|
|
2057
|
-
disabled$:
|
|
2043
|
+
disabled$: Qi(i),
|
|
2058
2044
|
hidden$: $n(i, be.UNIVER_DOC)
|
|
2059
2045
|
};
|
|
2060
2046
|
}
|
|
2061
|
-
function
|
|
2047
|
+
function er(i) {
|
|
2062
2048
|
return {
|
|
2063
|
-
id:
|
|
2049
|
+
id: pt,
|
|
2064
2050
|
title: "docImage.upload.float",
|
|
2065
2051
|
type: zn.BUTTON,
|
|
2066
2052
|
hidden$: $n(i, be.UNIVER_DOC)
|
|
2067
2053
|
};
|
|
2068
2054
|
}
|
|
2069
|
-
const
|
|
2070
|
-
[
|
|
2071
|
-
[
|
|
2055
|
+
const nr = {
|
|
2056
|
+
[si.LAYOUT]: {
|
|
2057
|
+
[ht]: {
|
|
2072
2058
|
order: 0,
|
|
2073
|
-
menuItemFactory:
|
|
2074
|
-
[
|
|
2059
|
+
menuItemFactory: Ji,
|
|
2060
|
+
[pt]: {
|
|
2075
2061
|
order: 0,
|
|
2076
|
-
menuItemFactory:
|
|
2062
|
+
menuItemFactory: er
|
|
2077
2063
|
}
|
|
2078
2064
|
}
|
|
2079
2065
|
}
|
|
2080
2066
|
};
|
|
2081
2067
|
function Ye(i) {
|
|
2082
|
-
return i.getContextValue(
|
|
2068
|
+
return i.getContextValue(Mt) && i.getContextValue(tn);
|
|
2083
2069
|
}
|
|
2084
|
-
const
|
|
2070
|
+
const tr = {
|
|
2085
2071
|
id: Ke.id,
|
|
2086
2072
|
description: "shortcut.doc.drawing-move-down",
|
|
2087
2073
|
group: "4_doc-drawing-view",
|
|
@@ -2091,7 +2077,7 @@ const ir = {
|
|
|
2091
2077
|
staticParameters: {
|
|
2092
2078
|
direction: fe.DOWN
|
|
2093
2079
|
}
|
|
2094
|
-
},
|
|
2080
|
+
}, ir = {
|
|
2095
2081
|
id: Ke.id,
|
|
2096
2082
|
description: "shortcut.doc.drawing-move-up",
|
|
2097
2083
|
group: "4_doc-drawing-view",
|
|
@@ -2101,7 +2087,7 @@ const ir = {
|
|
|
2101
2087
|
staticParameters: {
|
|
2102
2088
|
direction: fe.UP
|
|
2103
2089
|
}
|
|
2104
|
-
},
|
|
2090
|
+
}, rr = {
|
|
2105
2091
|
id: Ke.id,
|
|
2106
2092
|
description: "shortcut.doc.drawing-move-left",
|
|
2107
2093
|
group: "4_doc-drawing-view",
|
|
@@ -2111,7 +2097,7 @@ const ir = {
|
|
|
2111
2097
|
staticParameters: {
|
|
2112
2098
|
direction: fe.LEFT
|
|
2113
2099
|
}
|
|
2114
|
-
},
|
|
2100
|
+
}, or = {
|
|
2115
2101
|
id: Ke.id,
|
|
2116
2102
|
description: "shortcut.doc.drawing-move-right",
|
|
2117
2103
|
group: "4_doc-drawing-view",
|
|
@@ -2121,7 +2107,7 @@ const ir = {
|
|
|
2121
2107
|
staticParameters: {
|
|
2122
2108
|
direction: fe.RIGHT
|
|
2123
2109
|
}
|
|
2124
|
-
},
|
|
2110
|
+
}, sr = {
|
|
2125
2111
|
id: ot.id,
|
|
2126
2112
|
description: "shortcut.doc.drawing-delete",
|
|
2127
2113
|
group: "4_doc-drawing-view",
|
|
@@ -2130,8 +2116,8 @@ const ir = {
|
|
|
2130
2116
|
binding: He.DELETE,
|
|
2131
2117
|
mac: He.BACKSPACE
|
|
2132
2118
|
};
|
|
2133
|
-
var
|
|
2134
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2119
|
+
var ar = Object.getOwnPropertyDescriptor, cr = (i, e, n, t) => {
|
|
2120
|
+
for (var r = t > 1 ? void 0 : t ? ar(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2135
2121
|
(s = i[o]) && (r = s(r) || r);
|
|
2136
2122
|
return r;
|
|
2137
2123
|
}, nn = (i, e) => (n, t) => e(n, t, i);
|
|
@@ -2141,10 +2127,10 @@ let an = class extends Xe {
|
|
|
2141
2127
|
}
|
|
2142
2128
|
_initCustomComponents() {
|
|
2143
2129
|
const i = this._componentManager;
|
|
2144
|
-
this.disposeWithMe(i.register(
|
|
2130
|
+
this.disposeWithMe(i.register(ft, rt)), this.disposeWithMe(i.register(gt, Zi));
|
|
2145
2131
|
}
|
|
2146
2132
|
_initMenus() {
|
|
2147
|
-
this._menuManagerService.mergeMenu(
|
|
2133
|
+
this._menuManagerService.mergeMenu(nr);
|
|
2148
2134
|
}
|
|
2149
2135
|
_initCommands() {
|
|
2150
2136
|
[
|
|
@@ -2158,7 +2144,7 @@ let an = class extends Xe {
|
|
|
2158
2144
|
nt,
|
|
2159
2145
|
Sn,
|
|
2160
2146
|
mt,
|
|
2161
|
-
|
|
2147
|
+
Fi,
|
|
2162
2148
|
ut,
|
|
2163
2149
|
st,
|
|
2164
2150
|
dt,
|
|
@@ -2170,11 +2156,11 @@ let an = class extends Xe {
|
|
|
2170
2156
|
_initShortcuts() {
|
|
2171
2157
|
[
|
|
2172
2158
|
// sheet drawing shortcuts
|
|
2159
|
+
tr,
|
|
2173
2160
|
ir,
|
|
2174
2161
|
rr,
|
|
2175
2162
|
or,
|
|
2176
|
-
sr
|
|
2177
|
-
ar
|
|
2163
|
+
sr
|
|
2178
2164
|
].forEach((i) => {
|
|
2179
2165
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2180
2166
|
});
|
|
@@ -2183,25 +2169,25 @@ let an = class extends Xe {
|
|
|
2183
2169
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2184
2170
|
}
|
|
2185
2171
|
};
|
|
2186
|
-
an =
|
|
2187
|
-
nn(0, ve(
|
|
2188
|
-
nn(1,
|
|
2172
|
+
an = cr([
|
|
2173
|
+
nn(0, ve(ai)),
|
|
2174
|
+
nn(1, ci),
|
|
2189
2175
|
nn(2, z),
|
|
2190
|
-
nn(3,
|
|
2176
|
+
nn(3, di)
|
|
2191
2177
|
], an);
|
|
2192
|
-
var
|
|
2193
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2178
|
+
var dr = Object.getOwnPropertyDescriptor, lr = (i, e, n, t) => {
|
|
2179
|
+
for (var r = t > 1 ? void 0 : t ? dr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2194
2180
|
(s = i[o]) && (r = s(r) || r);
|
|
2195
2181
|
return r;
|
|
2196
2182
|
}, je = (i, e) => (n, t) => e(n, t, i);
|
|
2197
|
-
let cn = class extends
|
|
2183
|
+
let cn = class extends Rt {
|
|
2198
2184
|
constructor(e, n, t, r, o) {
|
|
2199
2185
|
super();
|
|
2200
2186
|
Ce(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
2201
2187
|
this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = t, this._univerInstanceService = r, this._contextService = o, this._init();
|
|
2202
2188
|
}
|
|
2203
2189
|
_init() {
|
|
2204
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(
|
|
2190
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(An(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(An(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
|
|
2205
2191
|
}
|
|
2206
2192
|
_dispose(e) {
|
|
2207
2193
|
const n = e.getUnitId();
|
|
@@ -2216,7 +2202,7 @@ let cn = class extends Nt {
|
|
|
2216
2202
|
_hasCropObject(e) {
|
|
2217
2203
|
const n = e.getAllObjects();
|
|
2218
2204
|
for (const t of n)
|
|
2219
|
-
if (t instanceof
|
|
2205
|
+
if (t instanceof Xt)
|
|
2220
2206
|
return !0;
|
|
2221
2207
|
return !1;
|
|
2222
2208
|
}
|
|
@@ -2247,7 +2233,7 @@ let cn = class extends Nt {
|
|
|
2247
2233
|
const { unitId: l, subUnitId: m, drawingId: g } = c, p = this._canvasPopManagerService.attachPopupToObject(
|
|
2248
2234
|
a,
|
|
2249
2235
|
{
|
|
2250
|
-
componentKey:
|
|
2236
|
+
componentKey: Kt,
|
|
2251
2237
|
direction: "horizontal",
|
|
2252
2238
|
offset: [2, 0],
|
|
2253
2239
|
extraProps: {
|
|
@@ -2290,7 +2276,7 @@ let cn = class extends Nt {
|
|
|
2290
2276
|
index: 0,
|
|
2291
2277
|
commandId: ut.id,
|
|
2292
2278
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2293
|
-
disable: !!
|
|
2279
|
+
disable: !!Nt.includes(e)
|
|
2294
2280
|
},
|
|
2295
2281
|
{
|
|
2296
2282
|
label: "image-popup.delete",
|
|
@@ -2302,7 +2288,7 @@ let cn = class extends Nt {
|
|
|
2302
2288
|
{
|
|
2303
2289
|
label: "image-popup.crop",
|
|
2304
2290
|
index: 2,
|
|
2305
|
-
commandId:
|
|
2291
|
+
commandId: Yt.id,
|
|
2306
2292
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2307
2293
|
disable: !0
|
|
2308
2294
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2310,7 +2296,7 @@ let cn = class extends Nt {
|
|
|
2310
2296
|
{
|
|
2311
2297
|
label: "image-popup.reset",
|
|
2312
2298
|
index: 3,
|
|
2313
|
-
commandId:
|
|
2299
|
+
commandId: Zt.id,
|
|
2314
2300
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
2315
2301
|
disable: !0
|
|
2316
2302
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2318,15 +2304,15 @@ let cn = class extends Nt {
|
|
|
2318
2304
|
];
|
|
2319
2305
|
}
|
|
2320
2306
|
};
|
|
2321
|
-
cn =
|
|
2307
|
+
cn = lr([
|
|
2322
2308
|
je(0, Ie),
|
|
2323
|
-
je(1, ve(
|
|
2309
|
+
je(1, ve(pi)),
|
|
2324
2310
|
je(2, ee),
|
|
2325
2311
|
je(3, Q),
|
|
2326
2312
|
je(4, Vn)
|
|
2327
2313
|
], cn);
|
|
2328
|
-
var
|
|
2329
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2314
|
+
var gr = Object.getOwnPropertyDescriptor, mr = (i, e, n, t) => {
|
|
2315
|
+
for (var r = t > 1 ? void 0 : t ? gr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2330
2316
|
(s = i[o]) && (r = s(r) || r);
|
|
2331
2317
|
return r;
|
|
2332
2318
|
}, xe = (i, e) => (n, t) => e(n, t, i);
|
|
@@ -2347,7 +2333,7 @@ let wn = class extends Xe {
|
|
|
2347
2333
|
});
|
|
2348
2334
|
}
|
|
2349
2335
|
_commandExecutedListener() {
|
|
2350
|
-
const e = [J.id,
|
|
2336
|
+
const e = [J.id, vi.id];
|
|
2351
2337
|
this.disposeWithMe(
|
|
2352
2338
|
this._commandService.onCommandExecuted((n) => {
|
|
2353
2339
|
if (e.includes(n.id)) {
|
|
@@ -2357,7 +2343,7 @@ let wn = class extends Xe {
|
|
|
2357
2343
|
const a = this._docSkeletonManagerService.getSkeleton();
|
|
2358
2344
|
if (a == null)
|
|
2359
2345
|
return;
|
|
2360
|
-
if (this._editorService.isEditor(o) && o !==
|
|
2346
|
+
if (this._editorService.isEditor(o) && o !== At) {
|
|
2361
2347
|
s == null || s.makeDirty();
|
|
2362
2348
|
return;
|
|
2363
2349
|
}
|
|
@@ -2368,8 +2354,8 @@ let wn = class extends Xe {
|
|
|
2368
2354
|
}
|
|
2369
2355
|
_initResize() {
|
|
2370
2356
|
this.disposeWithMe(
|
|
2371
|
-
|
|
2372
|
-
xn((e) => e.type ===
|
|
2357
|
+
xt(this._context.engine.onTransformChange$).pipe(
|
|
2358
|
+
xn((e) => e.type === ti.resize),
|
|
2373
2359
|
qn(16)
|
|
2374
2360
|
).subscribe(() => {
|
|
2375
2361
|
var t;
|
|
@@ -2386,9 +2372,9 @@ let wn = class extends Xe {
|
|
|
2386
2372
|
const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters: p } = n, h = {};
|
|
2387
2373
|
this._liquid.reset();
|
|
2388
2374
|
for (let T = 0, M = m.length; T < M; T++) {
|
|
2389
|
-
const
|
|
2390
|
-
if (
|
|
2391
|
-
const I = (O = g.get(
|
|
2375
|
+
const y = m[T], { headerId: E, footerId: U, pageWidth: N } = y;
|
|
2376
|
+
if (E) {
|
|
2377
|
+
const I = (O = g.get(E)) == null ? void 0 : O.get(N);
|
|
2392
2378
|
I && this._calculateDrawingPosition(
|
|
2393
2379
|
r,
|
|
2394
2380
|
I,
|
|
@@ -2396,7 +2382,7 @@ let wn = class extends Xe {
|
|
|
2396
2382
|
a,
|
|
2397
2383
|
h,
|
|
2398
2384
|
I.marginTop,
|
|
2399
|
-
|
|
2385
|
+
y.marginLeft
|
|
2400
2386
|
);
|
|
2401
2387
|
}
|
|
2402
2388
|
if (U) {
|
|
@@ -2407,11 +2393,11 @@ let wn = class extends Xe {
|
|
|
2407
2393
|
s,
|
|
2408
2394
|
a,
|
|
2409
2395
|
h,
|
|
2410
|
-
|
|
2411
|
-
|
|
2396
|
+
y.pageHeight - y.marginBottom + I.marginTop,
|
|
2397
|
+
y.marginLeft
|
|
2412
2398
|
);
|
|
2413
2399
|
}
|
|
2414
|
-
this._calculateDrawingPosition(r,
|
|
2400
|
+
this._calculateDrawingPosition(r, y, s, a, h, y.marginTop, y.marginLeft), this._liquid.translatePage(y, d, c, l);
|
|
2415
2401
|
}
|
|
2416
2402
|
const v = Object.values(h), w = v.filter((T) => !T.isMultiTransform), S = v.filter((T) => T.isMultiTransform);
|
|
2417
2403
|
w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(S);
|
|
@@ -2466,30 +2452,30 @@ let wn = class extends Xe {
|
|
|
2466
2452
|
}, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n === Tn.Steady)).subscribe(e);
|
|
2467
2453
|
}
|
|
2468
2454
|
};
|
|
2469
|
-
wn =
|
|
2455
|
+
wn = mr([
|
|
2470
2456
|
xe(1, ve(se)),
|
|
2471
2457
|
xe(2, z),
|
|
2472
|
-
xe(3,
|
|
2458
|
+
xe(3, wi),
|
|
2473
2459
|
xe(4, Ie),
|
|
2474
2460
|
xe(5, ve(gn)),
|
|
2475
2461
|
xe(6, Q),
|
|
2476
2462
|
xe(7, ve(Et))
|
|
2477
2463
|
], wn);
|
|
2478
|
-
var
|
|
2479
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2464
|
+
var ur = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, hr = (i, e, n) => e in i ? ur(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, pr = (i, e, n, t) => {
|
|
2465
|
+
for (var r = t > 1 ? void 0 : t ? fr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2480
2466
|
(s = i[o]) && (r = s(r) || r);
|
|
2481
2467
|
return r;
|
|
2482
|
-
}, pn = (i, e) => (n, t) => e(n, t, i),
|
|
2483
|
-
const
|
|
2484
|
-
let dn = class extends
|
|
2468
|
+
}, pn = (i, e) => (n, t) => e(n, t, i), wt = (i, e, n) => hr(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2469
|
+
const wr = "DOC_DRAWING_UI_PLUGIN";
|
|
2470
|
+
let dn = class extends kt {
|
|
2485
2471
|
constructor(i = kn, e, n, t) {
|
|
2486
2472
|
super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
|
|
2487
|
-
const { ...r } =
|
|
2473
|
+
const { ...r } = Ft(
|
|
2488
2474
|
{},
|
|
2489
2475
|
kn,
|
|
2490
2476
|
this._config
|
|
2491
2477
|
);
|
|
2492
|
-
this._configService.setConfig(
|
|
2478
|
+
this._configService.setConfig(Di, r);
|
|
2493
2479
|
}
|
|
2494
2480
|
onStarting() {
|
|
2495
2481
|
[
|
|
@@ -2510,17 +2496,17 @@ let dn = class extends Ft {
|
|
|
2510
2496
|
this._injector.get(cn);
|
|
2511
2497
|
}
|
|
2512
2498
|
};
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
dn =
|
|
2516
|
-
|
|
2517
|
-
pn(1, ve(
|
|
2499
|
+
wt(dn, "type", be.UNIVER_DOC);
|
|
2500
|
+
wt(dn, "pluginName", wr);
|
|
2501
|
+
dn = pr([
|
|
2502
|
+
Lt(Qt, zt, Ht, li),
|
|
2503
|
+
pn(1, ve(Bt)),
|
|
2518
2504
|
pn(2, ee),
|
|
2519
|
-
pn(3,
|
|
2505
|
+
pn(3, Ut)
|
|
2520
2506
|
], dn);
|
|
2521
2507
|
export {
|
|
2522
|
-
|
|
2523
|
-
|
|
2508
|
+
Fi as ClearDocDrawingTransformerOperation,
|
|
2509
|
+
ht as DOCS_IMAGE_MENU_ID,
|
|
2524
2510
|
ot as DeleteDocDrawingsCommand,
|
|
2525
2511
|
ut as EditDocDrawingOperation,
|
|
2526
2512
|
st as GroupDocDrawingCommand,
|