@univerjs/docs-drawing-ui 0.6.7-nightly.202503291606 → 0.6.7-nightly.202503301606
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 +152 -152
- package/lib/index.js +152 -152
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -151,13 +151,13 @@ const Hi = {
|
|
|
151
151
|
};
|
|
152
152
|
function dt(i, e, n, t, r, o, s) {
|
|
153
153
|
var f, u;
|
|
154
|
-
const a = new Dn(), d = X.getInstance(), c = [],
|
|
155
|
-
if (
|
|
154
|
+
const a = new Dn(), d = X.getInstance(), c = [], g = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
155
|
+
if (g == null || m == null)
|
|
156
156
|
return;
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
157
|
+
const l = (u = (f = g.customBlocks) == null ? void 0 : f.find((v) => v.blockId === r)) == null ? void 0 : u.startIndex;
|
|
158
|
+
if (l != null) {
|
|
159
159
|
if (t = Math.min(m.dataStream.length - 2, t), i === e) {
|
|
160
|
-
if (t <
|
|
160
|
+
if (t < l ? (t > 0 && a.push({
|
|
161
161
|
t: Q.RETAIN,
|
|
162
162
|
len: t
|
|
163
163
|
}), a.push({
|
|
@@ -172,19 +172,19 @@ function dt(i, e, n, t, r, o, s) {
|
|
|
172
172
|
len: 1
|
|
173
173
|
}), a.push({
|
|
174
174
|
t: Q.RETAIN,
|
|
175
|
-
len:
|
|
175
|
+
len: l - t
|
|
176
176
|
}), a.push({
|
|
177
177
|
t: Q.DELETE,
|
|
178
178
|
len: 1
|
|
179
|
-
})) : (
|
|
179
|
+
})) : (l > 0 && a.push({
|
|
180
180
|
t: Q.RETAIN,
|
|
181
|
-
len:
|
|
181
|
+
len: l
|
|
182
182
|
}), a.push({
|
|
183
183
|
t: Q.DELETE,
|
|
184
184
|
len: 1
|
|
185
|
-
}), t -
|
|
185
|
+
}), t - l - 1 > 0 && a.push({
|
|
186
186
|
t: Q.RETAIN,
|
|
187
|
-
len: t -
|
|
187
|
+
len: t - l - 1
|
|
188
188
|
}), a.push({
|
|
189
189
|
t: Q.INSERT,
|
|
190
190
|
body: {
|
|
@@ -195,14 +195,14 @@ function dt(i, e, n, t, r, o, s) {
|
|
|
195
195
|
}]
|
|
196
196
|
},
|
|
197
197
|
len: 1
|
|
198
|
-
})), t !==
|
|
198
|
+
})), t !== l) {
|
|
199
199
|
const v = qe(o, e), w = d.editOp(a.serialize(), v);
|
|
200
200
|
c.push(w);
|
|
201
201
|
}
|
|
202
202
|
} else {
|
|
203
|
-
|
|
203
|
+
l > 0 && a.push({
|
|
204
204
|
t: Q.RETAIN,
|
|
205
|
-
len:
|
|
205
|
+
len: l
|
|
206
206
|
}), a.push({
|
|
207
207
|
t: Q.DELETE,
|
|
208
208
|
len: 1
|
|
@@ -234,10 +234,10 @@ const lt = {
|
|
|
234
234
|
var N, B;
|
|
235
235
|
if (e == null)
|
|
236
236
|
return !1;
|
|
237
|
-
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get($), s = i.get(q), d = i.get(J).getRenderById(r), c = d == null ? void 0 : d.with(te).getSkeleton().getSkeletonData(),
|
|
238
|
-
if (
|
|
237
|
+
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get($), s = i.get(q), d = i.get(J).getRenderById(r), c = d == null ? void 0 : d.with(te).getSkeleton().getSkeletonData(), g = d == null ? void 0 : d.with(te).getViewModel(), m = d == null ? void 0 : d.scene, l = s.getCurrentUniverDocInstance();
|
|
238
|
+
if (l == null || c == null || m == null || g == null)
|
|
239
239
|
return !1;
|
|
240
|
-
const f =
|
|
240
|
+
const f = g.getEditArea(), u = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: I } = c, O = X.getInstance(), C = [], { drawings: T = {} } = l.getSnapshot();
|
|
241
241
|
for (const E of n) {
|
|
242
242
|
const { drawingId: _ } = E, L = T[_].layoutType, G = Hi[t];
|
|
243
243
|
if (L !== G) {
|
|
@@ -321,11 +321,11 @@ const lt = {
|
|
|
321
321
|
const n = i.get($), r = i.get(q).getCurrentUniverDocInstance();
|
|
322
322
|
if (r == null)
|
|
323
323
|
return !1;
|
|
324
|
-
const { drawings: o, dist: s, unitId: a } = e, d = X.getInstance(), c = [], { drawings:
|
|
324
|
+
const { drawings: o, dist: s, unitId: a } = e, d = X.getInstance(), c = [], { drawings: g = {} } = r.getSnapshot();
|
|
325
325
|
for (const f of o) {
|
|
326
326
|
const { drawingId: u } = f;
|
|
327
327
|
for (const [v, w] of Object.entries(s)) {
|
|
328
|
-
const I =
|
|
328
|
+
const I = g[u][v];
|
|
329
329
|
if (I !== w) {
|
|
330
330
|
const O = d.replaceOp(["drawings", u, v], I, w);
|
|
331
331
|
c.push(O);
|
|
@@ -351,9 +351,9 @@ const lt = {
|
|
|
351
351
|
const n = i.get($), r = i.get(q).getCurrentUniverDocInstance();
|
|
352
352
|
if (r == null)
|
|
353
353
|
return !1;
|
|
354
|
-
const { drawings: o, wrapText: s, unitId: a } = e, d = X.getInstance(), c = [], { drawings:
|
|
354
|
+
const { drawings: o, wrapText: s, unitId: a } = e, d = X.getInstance(), c = [], { drawings: g = {} } = r.getSnapshot();
|
|
355
355
|
for (const f of o) {
|
|
356
|
-
const { drawingId: u } = f, v =
|
|
356
|
+
const { drawingId: u } = f, v = g[u].wrapText;
|
|
357
357
|
if (v !== s) {
|
|
358
358
|
const w = d.replaceOp(["drawings", u, "wrapText"], v, s);
|
|
359
359
|
c.push(w);
|
|
@@ -381,24 +381,24 @@ const lt = {
|
|
|
381
381
|
const a = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
|
|
382
382
|
if (d == null)
|
|
383
383
|
return !1;
|
|
384
|
-
const { drawings: c, unitId:
|
|
384
|
+
const { drawings: c, unitId: g } = e, m = X.getInstance(), l = [], { drawings: f = {} } = d.getSnapshot();
|
|
385
385
|
for (const w of c) {
|
|
386
386
|
const { drawingId: I, key: O, value: C } = w, T = f[I].docTransform[O];
|
|
387
387
|
if (!be.diffValue(T, C)) {
|
|
388
388
|
const b = m.replaceOp(["drawings", I, "docTransform", O], T, C);
|
|
389
|
-
|
|
389
|
+
l.push(b);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
const u = {
|
|
393
393
|
id: ne.id,
|
|
394
394
|
params: {
|
|
395
|
-
unitId:
|
|
395
|
+
unitId: g,
|
|
396
396
|
actions: [],
|
|
397
397
|
textRanges: null,
|
|
398
398
|
debounce: !0
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
u.params.actions =
|
|
401
|
+
u.params.actions = l.reduce((w, I) => X.compose(w, I), null);
|
|
402
402
|
const v = n.syncExecuteCommand(u.id, u.params);
|
|
403
403
|
return a.refreshControls(), !!v;
|
|
404
404
|
}
|
|
@@ -415,10 +415,10 @@ const lt = {
|
|
|
415
415
|
const d = s.getTransformerByCreate(), c = i.get($), m = i.get(q).getCurrentUniverDocInstance();
|
|
416
416
|
if (m == null)
|
|
417
417
|
return !1;
|
|
418
|
-
const { drawing:
|
|
418
|
+
const { drawing: l, unitId: f, offset: u, segmentId: v, segmentPage: w, needRefreshDrawings: I } = e;
|
|
419
419
|
if (I)
|
|
420
420
|
return r.refreshDrawings(a), d.refreshControls(), !0;
|
|
421
|
-
const O = [], { drawingId: C } =
|
|
421
|
+
const O = [], { drawingId: C } = l, T = (E = t.getSegment()) != null ? E : "", b = dt(
|
|
422
422
|
v,
|
|
423
423
|
T,
|
|
424
424
|
w,
|
|
@@ -456,11 +456,11 @@ const lt = {
|
|
|
456
456
|
const s = o.getTransformerByCreate(), a = i.get($), c = i.get(q).getCurrentUniverDocInstance();
|
|
457
457
|
if (c == null)
|
|
458
458
|
return !1;
|
|
459
|
-
const { drawing:
|
|
459
|
+
const { drawing: g, unitId: m, offset: l, docTransform: f, segmentId: u, segmentPage: v } = e, w = [], { drawingId: I } = g, O = (V = t.getSegment()) != null ? V : "", C = dt(
|
|
460
460
|
u,
|
|
461
461
|
O,
|
|
462
462
|
v,
|
|
463
|
-
|
|
463
|
+
l,
|
|
464
464
|
I,
|
|
465
465
|
c,
|
|
466
466
|
t
|
|
@@ -547,7 +547,7 @@ let an = class extends Ge {
|
|
|
547
547
|
this._transformerCache.clear();
|
|
548
548
|
const { objects: s } = o;
|
|
549
549
|
for (const d of s.values()) {
|
|
550
|
-
const { oKey: c, width:
|
|
550
|
+
const { oKey: c, width: g, height: m, left: l, top: f, angle: u } = d, v = this._drawingManagerService.getDrawingOKey(c);
|
|
551
551
|
if (v == null)
|
|
552
552
|
continue;
|
|
553
553
|
const w = this._univerInstanceService.getUniverDocInstance(v.unitId), I = (a = w == null ? void 0 : w.getSnapshot().drawings) == null ? void 0 : a[v.drawingId];
|
|
@@ -559,8 +559,8 @@ let an = class extends Ge {
|
|
|
559
559
|
I != null && this._transformerCache.set(v.drawingId, {
|
|
560
560
|
drawing: I,
|
|
561
561
|
top: f,
|
|
562
|
-
left:
|
|
563
|
-
width:
|
|
562
|
+
left: l,
|
|
563
|
+
width: g,
|
|
564
564
|
height: m,
|
|
565
565
|
angle: u
|
|
566
566
|
});
|
|
@@ -576,8 +576,8 @@ let an = class extends Ge {
|
|
|
576
576
|
if (s.size > 1)
|
|
577
577
|
t(s);
|
|
578
578
|
else if (s.size === 1) {
|
|
579
|
-
const c = this._transformerCache.values().next().value,
|
|
580
|
-
if (c && m === c.width &&
|
|
579
|
+
const c = this._transformerCache.values().next().value, g = s.values().next().value, { width: m, height: l, top: f, left: u, angle: v } = g;
|
|
580
|
+
if (c && m === c.width && l === c.height && f === c.top && u === c.left && v === c.angle)
|
|
581
581
|
return;
|
|
582
582
|
c && (c.drawing.layoutType, W.INLINE), c && c.drawing.layoutType === W.INLINE && a != null && d != null && this._updateInlineDrawingAnchor(c.drawing, a, d);
|
|
583
583
|
}
|
|
@@ -589,10 +589,10 @@ let an = class extends Ge {
|
|
|
589
589
|
n.changeEnd$.subscribe((o) => {
|
|
590
590
|
const { objects: s, offsetX: a, offsetY: d } = o;
|
|
591
591
|
for (const c of s.values()) {
|
|
592
|
-
const
|
|
593
|
-
if (
|
|
592
|
+
const g = this._drawingManagerService.getDrawingOKey(c.oKey);
|
|
593
|
+
if (g == null)
|
|
594
594
|
continue;
|
|
595
|
-
const m = this._transformerCache.get(
|
|
595
|
+
const m = this._transformerCache.get(g == null ? void 0 : g.drawingId);
|
|
596
596
|
if ((m == null ? void 0 : m.drawing.layoutType) === W.INLINE)
|
|
597
597
|
try {
|
|
598
598
|
c.setOpacity(1);
|
|
@@ -602,10 +602,10 @@ let an = class extends Ge {
|
|
|
602
602
|
if (this._anchorShape && this._anchorShape.hide(), s.size > 1)
|
|
603
603
|
this._updateMultipleDrawingDocTransform(s);
|
|
604
604
|
else if (s.size === 1) {
|
|
605
|
-
const c = this._transformerCache.values().next().value,
|
|
606
|
-
if (c && m === c.width &&
|
|
605
|
+
const c = this._transformerCache.values().next().value, g = s.values().next().value, { width: m, height: l, top: f, left: u, angle: v } = g;
|
|
606
|
+
if (c && m === c.width && l === c.height && f === c.top && u === c.left && v === c.angle)
|
|
607
607
|
return;
|
|
608
|
-
c && c.drawing.layoutType === W.INLINE ? m !== c.width ||
|
|
608
|
+
c && c.drawing.layoutType === W.INLINE ? m !== c.width || l !== c.height || v !== c.angle ? this._updateDrawingSize(c, g) : a != null && d != null && this._moveInlineDrawing(c.drawing, a, d) : c && this._nonInlineDrawingTransform(c.drawing, g);
|
|
609
609
|
}
|
|
610
610
|
this._transformerCache.clear();
|
|
611
611
|
})
|
|
@@ -620,37 +620,37 @@ let an = class extends Ge {
|
|
|
620
620
|
let t, r;
|
|
621
621
|
for (const o of e.values()) {
|
|
622
622
|
const { oKey: s, left: a, top: d, angle: c } = o;
|
|
623
|
-
let { width:
|
|
624
|
-
const
|
|
625
|
-
if (
|
|
623
|
+
let { width: g, height: m } = o;
|
|
624
|
+
const l = this._drawingManagerService.getDrawingOKey(s);
|
|
625
|
+
if (l == null)
|
|
626
626
|
continue;
|
|
627
|
-
t == null && (t =
|
|
628
|
-
const f = this._transformerCache.get(
|
|
627
|
+
t == null && (t = l.unitId), r == null && (r = l.subUnitId);
|
|
628
|
+
const f = this._transformerCache.get(l.drawingId);
|
|
629
629
|
if (f == null)
|
|
630
630
|
continue;
|
|
631
631
|
const { drawing: u, top: v, left: w, width: I, height: O, angle: C } = f, { width: T, height: b } = this._getPageContentSize(u);
|
|
632
|
-
if (
|
|
633
|
-
drawingId:
|
|
632
|
+
if (g = Math.min(g, T), m = Math.min(m, b), (I !== g || O !== m) && n.push({
|
|
633
|
+
drawingId: l.drawingId,
|
|
634
634
|
key: "size",
|
|
635
635
|
value: {
|
|
636
|
-
width:
|
|
636
|
+
width: g,
|
|
637
637
|
height: m
|
|
638
638
|
}
|
|
639
639
|
}), C !== c && n.push({
|
|
640
|
-
drawingId:
|
|
640
|
+
drawingId: l.drawingId,
|
|
641
641
|
key: "angle",
|
|
642
642
|
value: c
|
|
643
643
|
}), v !== d || w !== a) {
|
|
644
644
|
const P = d - v, N = a - w;
|
|
645
645
|
P !== 0 && n.push({
|
|
646
|
-
drawingId:
|
|
646
|
+
drawingId: l.drawingId,
|
|
647
647
|
key: "positionV",
|
|
648
648
|
value: {
|
|
649
649
|
relativeFrom: u.docTransform.positionV.relativeFrom,
|
|
650
650
|
posOffset: u.docTransform.positionV.posOffset + P
|
|
651
651
|
}
|
|
652
652
|
}), N !== 0 && n.push({
|
|
653
|
-
drawingId:
|
|
653
|
+
drawingId: l.drawingId,
|
|
654
654
|
key: "positionH",
|
|
655
655
|
value: {
|
|
656
656
|
relativeFrom: u.docTransform.positionH.relativeFrom,
|
|
@@ -685,9 +685,9 @@ let an = class extends Ge {
|
|
|
685
685
|
if (r == null)
|
|
686
686
|
return;
|
|
687
687
|
const { mainComponent: s, scene: a } = r, d = s, c = a.getViewports()[0], {
|
|
688
|
-
pageLayoutType:
|
|
688
|
+
pageLayoutType: g = Ln.VERTICAL,
|
|
689
689
|
pageMarginLeft: m,
|
|
690
|
-
pageMarginTop:
|
|
690
|
+
pageMarginTop: l
|
|
691
691
|
} = d.getOffsetConfig();
|
|
692
692
|
let f = null, u = !1, v = -1, w = "";
|
|
693
693
|
const I = 0.5, O = this._getTransformCoordForDocumentOffset(d, c, n, t);
|
|
@@ -696,7 +696,7 @@ let an = class extends Ge {
|
|
|
696
696
|
const C = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(Re);
|
|
697
697
|
if (C == null)
|
|
698
698
|
return;
|
|
699
|
-
const T = o == null ? void 0 : o.findNodeByCoord(O,
|
|
699
|
+
const T = o == null ? void 0 : o.findNodeByCoord(O, g, m, l, {
|
|
700
700
|
strict: !1,
|
|
701
701
|
segmentId: C.getSegment(),
|
|
702
702
|
segmentPage: C.getSegmentPage()
|
|
@@ -723,7 +723,7 @@ let an = class extends Ge {
|
|
|
723
723
|
const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(te).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
|
|
724
724
|
if (o == null || t == null)
|
|
725
725
|
return;
|
|
726
|
-
const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene:
|
|
726
|
+
const { pages: s, skeHeaders: a, skeFooters: d } = o, { mainComponent: c, scene: g } = t, m = c, l = g.getViewports()[0], { pageLayoutType: f = Ln.VERTICAL, pageMarginLeft: u, pageMarginTop: v, docsLeft: w, docsTop: I } = m.getOffsetConfig(), { left: O, top: C, angle: T } = n;
|
|
727
727
|
let { width: b, height: P } = n;
|
|
728
728
|
const { positionV: N, positionH: B } = e.docTransform, { width: E, height: _ } = this._getPageContentSize(e);
|
|
729
729
|
b = Math.min(b, E), P = Math.min(P, _);
|
|
@@ -735,7 +735,7 @@ let an = class extends Ge {
|
|
|
735
735
|
height: P
|
|
736
736
|
},
|
|
737
737
|
angle: T
|
|
738
|
-
}, { x: D, y: R } =
|
|
738
|
+
}, { x: D, y: R } = g.getViewportScrollXY(l), y = this._getTransformCoordForDocumentOffset(m, l, O - D, C - R);
|
|
739
739
|
if (y == null)
|
|
740
740
|
return;
|
|
741
741
|
const U = (De = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : De.with(Re);
|
|
@@ -835,19 +835,19 @@ let an = class extends Ge {
|
|
|
835
835
|
// Update drawing when use transformer to resize it.
|
|
836
836
|
_updateDrawingSize(e, n) {
|
|
837
837
|
const t = [], { drawing: r, width: o, height: s, angle: a } = e, { unitId: d, subUnitId: c } = r;
|
|
838
|
-
let { width:
|
|
838
|
+
let { width: g, height: m, angle: l } = n;
|
|
839
839
|
const { width: f, height: u } = this._getPageContentSize(r);
|
|
840
|
-
|
|
840
|
+
g = Math.min(f, g), m = Math.min(u, m), (g !== o || m !== s) && t.push({
|
|
841
841
|
drawingId: r.drawingId,
|
|
842
842
|
key: "size",
|
|
843
843
|
value: {
|
|
844
|
-
width:
|
|
844
|
+
width: g,
|
|
845
845
|
height: m
|
|
846
846
|
}
|
|
847
|
-
}),
|
|
847
|
+
}), l !== a && t.push({
|
|
848
848
|
drawingId: r.drawingId,
|
|
849
849
|
key: "angle",
|
|
850
|
-
value:
|
|
850
|
+
value: l
|
|
851
851
|
}), t.length > 0 && d && c && this._commandService.executeCommand(Ke.id, {
|
|
852
852
|
unitId: d,
|
|
853
853
|
subUnitId: c,
|
|
@@ -870,8 +870,8 @@ let an = class extends Ge {
|
|
|
870
870
|
// Limit the drawing to the page area, mainly in the vertical direction,
|
|
871
871
|
// and the upper and lower limits cannot exceed the page margin area.
|
|
872
872
|
_limitDrawingInPage(e, n) {
|
|
873
|
-
const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: a, angle: d } = n, c = t == null ? void 0 : t.with(te).getSkeleton(),
|
|
874
|
-
if (
|
|
873
|
+
const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: a, angle: d } = n, c = t == null ? void 0 : t.with(te).getSkeleton(), g = c == null ? void 0 : c.getSkeletonData(), { pages: m } = g != null ? g : {};
|
|
874
|
+
if (g == null || t == null || m == null)
|
|
875
875
|
return {
|
|
876
876
|
left: r,
|
|
877
877
|
top: o,
|
|
@@ -879,7 +879,7 @@ let an = class extends Ge {
|
|
|
879
879
|
height: a,
|
|
880
880
|
angle: d
|
|
881
881
|
};
|
|
882
|
-
const { mainComponent:
|
|
882
|
+
const { mainComponent: l } = t, f = l, { top: u, pageLayoutType: v, pageMarginLeft: w, pageMarginTop: I } = f;
|
|
883
883
|
let O = o;
|
|
884
884
|
this._liquid.reset();
|
|
885
885
|
for (const C of m) {
|
|
@@ -941,15 +941,15 @@ let an = class extends Ge {
|
|
|
941
941
|
const { mainComponent: r, scene: o } = t, s = r, {
|
|
942
942
|
docsLeft: a,
|
|
943
943
|
docsTop: d
|
|
944
|
-
} = s.getOffsetConfig(), c = Ti(n), { left:
|
|
944
|
+
} = s.getOffsetConfig(), c = Ti(n), { left: g, top: m, height: l } = c, f = g + a, u = m + d;
|
|
945
945
|
if (this._anchorShape) {
|
|
946
|
-
this._anchorShape.transformByState({ left: f, top: u, height:
|
|
946
|
+
this._anchorShape.transformByState({ left: f, top: u, height: l }), this._anchorShape.show();
|
|
947
947
|
return;
|
|
948
948
|
}
|
|
949
949
|
const v = 6, w = new mi(ji + be.generateRandomId(v), {
|
|
950
950
|
left: f,
|
|
951
951
|
top: u,
|
|
952
|
-
height:
|
|
952
|
+
height: l,
|
|
953
953
|
strokeWidth: 2,
|
|
954
954
|
stroke: ui(Bt.darkGray, 1),
|
|
955
955
|
evented: !1
|
|
@@ -969,17 +969,17 @@ let an = class extends Ge {
|
|
|
969
969
|
const { pages: a } = s;
|
|
970
970
|
let d = null;
|
|
971
971
|
for (const c of a) {
|
|
972
|
-
const { skeDrawings:
|
|
973
|
-
if (
|
|
972
|
+
const { skeDrawings: g } = c;
|
|
973
|
+
if (g.has(e.drawingId)) {
|
|
974
974
|
d = c;
|
|
975
975
|
break;
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
if (d) {
|
|
979
|
-
const { pageWidth: c, pageHeight:
|
|
979
|
+
const { pageWidth: c, pageHeight: g, marginLeft: m, marginBottom: l, marginRight: f, marginTop: u } = d;
|
|
980
980
|
return {
|
|
981
981
|
width: Math.max(r, c - m - f),
|
|
982
|
-
height: Math.max(o,
|
|
982
|
+
height: Math.max(o, g - u - l)
|
|
983
983
|
};
|
|
984
984
|
} else
|
|
985
985
|
return {
|
|
@@ -1057,9 +1057,9 @@ const yn = {
|
|
|
1057
1057
|
const n = i.get($), t = i.get(q), r = i.get(J), o = t.getCurrentUniverDocInstance();
|
|
1058
1058
|
if (e == null || o == null)
|
|
1059
1059
|
return !1;
|
|
1060
|
-
const s = r.getRenderById(e.unitId).with(Re), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new Dn(),
|
|
1060
|
+
const s = r.getRenderById(e.unitId).with(Re), { drawings: a } = e, d = (b = s.getSegment()) != null ? b : "", c = new Dn(), g = X.getInstance(), m = (N = (P = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : P.customBlocks) != null ? N : [], l = a.map((E) => m.find((_) => _.blockId === E.drawingId)).filter((E) => !!E).sort((E, _) => E.startIndex > _.startIndex ? 1 : -1), f = a[0].unitId, u = new Ft();
|
|
1061
1061
|
u.reset();
|
|
1062
|
-
const v =
|
|
1062
|
+
const v = l[0].startIndex, w = [
|
|
1063
1063
|
{
|
|
1064
1064
|
startOffset: v,
|
|
1065
1065
|
endOffset: v
|
|
@@ -1072,7 +1072,7 @@ const yn = {
|
|
|
1072
1072
|
textRanges: w
|
|
1073
1073
|
}
|
|
1074
1074
|
}, O = [];
|
|
1075
|
-
for (const E of
|
|
1075
|
+
for (const E of l) {
|
|
1076
1076
|
const { startIndex: _ } = E;
|
|
1077
1077
|
_ > u.cursor && c.push({
|
|
1078
1078
|
t: Q.RETAIN,
|
|
@@ -1083,9 +1083,9 @@ const yn = {
|
|
|
1083
1083
|
}), u.moveCursorTo(_ + 1);
|
|
1084
1084
|
}
|
|
1085
1085
|
const C = qe(o, d);
|
|
1086
|
-
O.push(
|
|
1087
|
-
for (const E of
|
|
1088
|
-
const { blockId: _ } = E, L = ((B = o.getDrawings()) != null ? B : {})[_], x = o.getDrawingsOrder().indexOf(_), V =
|
|
1086
|
+
O.push(g.editOp(c.serialize(), C));
|
|
1087
|
+
for (const E of l) {
|
|
1088
|
+
const { blockId: _ } = E, L = ((B = o.getDrawings()) != null ? B : {})[_], x = o.getDrawingsOrder().indexOf(_), V = g.removeOp(["drawings", _], L), S = g.removeOp(["drawingsOrder", x], _);
|
|
1089
1089
|
O.push(V), O.push(S);
|
|
1090
1090
|
}
|
|
1091
1091
|
return I.params.actions = O.reduce((E, _) => X.compose(E, _), null), !!n.syncExecuteCommand(I.id, I.params);
|
|
@@ -1098,12 +1098,12 @@ const yn = {
|
|
|
1098
1098
|
if (t.length === 0)
|
|
1099
1099
|
return !1;
|
|
1100
1100
|
const { unitId: r } = t[0], o = t.map((s) => {
|
|
1101
|
-
const { unitId: a, subUnitId: d, drawingId: c, drawingType:
|
|
1101
|
+
const { unitId: a, subUnitId: d, drawingId: c, drawingType: g } = s;
|
|
1102
1102
|
return {
|
|
1103
1103
|
unitId: a,
|
|
1104
1104
|
subUnitId: d,
|
|
1105
1105
|
drawingId: c,
|
|
1106
|
-
drawingType:
|
|
1106
|
+
drawingType: g
|
|
1107
1107
|
};
|
|
1108
1108
|
});
|
|
1109
1109
|
return e.executeCommand(yn.id, {
|
|
@@ -1119,9 +1119,9 @@ const yn = {
|
|
|
1119
1119
|
const n = i.get(Ue);
|
|
1120
1120
|
if (!e) return !1;
|
|
1121
1121
|
const t = [];
|
|
1122
|
-
e.forEach(({ parent:
|
|
1123
|
-
t.push(
|
|
1124
|
-
t.push(
|
|
1122
|
+
e.forEach(({ parent: g, children: m }) => {
|
|
1123
|
+
t.push(g.unitId), m.forEach((l) => {
|
|
1124
|
+
t.push(l.unitId);
|
|
1125
1125
|
});
|
|
1126
1126
|
});
|
|
1127
1127
|
const r = n.getGroupDrawingOp(e), { unitId: o, subUnitId: s, undo: a, redo: d, objects: c } = r;
|
|
@@ -1138,20 +1138,20 @@ const yn = {
|
|
|
1138
1138
|
const n = i.get($), t = i.get(On), r = i.get(q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
|
|
1139
1139
|
if (o == null || s == null)
|
|
1140
1140
|
return !1;
|
|
1141
|
-
const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset:
|
|
1142
|
-
if (
|
|
1141
|
+
const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset: g, segmentId: m } = o, l = s.getSelfOrHeaderFooterModel(m).getBody();
|
|
1142
|
+
if (l == null)
|
|
1143
1143
|
return !1;
|
|
1144
1144
|
const f = new Dn(), u = X.getInstance(), v = [], w = (N = (P = s.getSnapshot().drawingsOrder) == null ? void 0 : P.length) != null ? N : 0;
|
|
1145
1145
|
let I = 0;
|
|
1146
1146
|
if (c)
|
|
1147
|
-
|
|
1147
|
+
g > 0 && f.push({
|
|
1148
1148
|
t: Q.RETAIN,
|
|
1149
|
-
len:
|
|
1149
|
+
len: g
|
|
1150
1150
|
});
|
|
1151
1151
|
else {
|
|
1152
|
-
const _ = kt.selection.delete([o],
|
|
1152
|
+
const _ = kt.selection.delete([o], l, 0, null, !1);
|
|
1153
1153
|
f.push(..._);
|
|
1154
|
-
const L = Mi(
|
|
1154
|
+
const L = Mi(l, [o]), G = (B = s.getDrawings()) != null ? B : {}, x = (E = s.getDrawingsOrder()) != null ? E : [], V = L.sort((S, D) => x.indexOf(S) > x.indexOf(D) ? -1 : x.indexOf(S) < x.indexOf(D) ? 1 : 0);
|
|
1155
1155
|
if (V.length > 0)
|
|
1156
1156
|
for (const S of V) {
|
|
1157
1157
|
const D = G[S], R = x.indexOf(S);
|
|
@@ -1199,12 +1199,12 @@ const yn = {
|
|
|
1199
1199
|
let c;
|
|
1200
1200
|
if (a === Qe.forward ? c = t.getForwardDrawingsOp(d) : a === Qe.backward ? c = t.getBackwardDrawingOp(d) : a === Qe.front ? c = t.getFrontDrawingsOp(d) : a === Qe.back && (c = t.getBackDrawingsOp(d)), c == null)
|
|
1201
1201
|
return !1;
|
|
1202
|
-
const { redo:
|
|
1203
|
-
if (
|
|
1202
|
+
const { redo: g } = c;
|
|
1203
|
+
if (g == null)
|
|
1204
1204
|
return !1;
|
|
1205
1205
|
const m = [];
|
|
1206
|
-
let
|
|
1207
|
-
|
|
1206
|
+
let l = be.deepClone(g);
|
|
1207
|
+
l = l.slice(3), l.unshift("drawingsOrder"), m.push(l);
|
|
1208
1208
|
const f = {
|
|
1209
1209
|
id: ne.id,
|
|
1210
1210
|
params: {
|
|
@@ -1223,9 +1223,9 @@ const yn = {
|
|
|
1223
1223
|
const n = i.get(Ue);
|
|
1224
1224
|
if (!e) return !1;
|
|
1225
1225
|
const t = [];
|
|
1226
|
-
e.forEach(({ parent:
|
|
1227
|
-
t.push(
|
|
1228
|
-
t.push(
|
|
1226
|
+
e.forEach(({ parent: g, children: m }) => {
|
|
1227
|
+
t.push(g.unitId), m.forEach((l) => {
|
|
1228
|
+
t.push(l.unitId);
|
|
1229
1229
|
});
|
|
1230
1230
|
});
|
|
1231
1231
|
const r = n.getUngroupDrawingOp(e), { unitId: o, subUnitId: s, undo: a, redo: d, objects: c } = r;
|
|
@@ -1238,8 +1238,8 @@ var Yi = Object.getOwnPropertyDescriptor, Zi = (i, e, n, t) => {
|
|
|
1238
1238
|
return r;
|
|
1239
1239
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
1240
1240
|
let cn = class extends Ge {
|
|
1241
|
-
constructor(i, e, n, t, r, o, s, a, d, c,
|
|
1242
|
-
super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = a, this._messageService = d, this._localeService = c, this._docSelectionRenderService =
|
|
1241
|
+
constructor(i, e, n, t, r, o, s, a, d, c, g, m, l) {
|
|
1242
|
+
super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = a, this._messageService = d, this._localeService = c, this._docSelectionRenderService = g, this._docRefreshDrawingsService = m, this._fileOpenerService = l, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
|
|
1243
1243
|
}
|
|
1244
1244
|
async insertDocImage() {
|
|
1245
1245
|
const i = await this._fileOpenerService.openFile({
|
|
@@ -1281,14 +1281,14 @@ let cn = class extends Ge {
|
|
|
1281
1281
|
for (const r of e) {
|
|
1282
1282
|
if (r == null)
|
|
1283
1283
|
continue;
|
|
1284
|
-
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height:
|
|
1284
|
+
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: g, image: m } = await ni(d || "");
|
|
1285
1285
|
this._imageIoService.addImageSourceCache(o, s, m);
|
|
1286
|
-
let
|
|
1287
|
-
if (c > An ||
|
|
1288
|
-
const w = An / c, I = xn /
|
|
1289
|
-
|
|
1286
|
+
let l = 1;
|
|
1287
|
+
if (c > An || g > xn) {
|
|
1288
|
+
const w = An / c, I = xn / g;
|
|
1289
|
+
l = Math.min(w, I);
|
|
1290
1290
|
}
|
|
1291
|
-
const f = this._getImagePosition(c *
|
|
1291
|
+
const f = this._getImagePosition(c * l, g * l);
|
|
1292
1292
|
if (f == null)
|
|
1293
1293
|
return;
|
|
1294
1294
|
const u = {
|
|
@@ -1404,10 +1404,10 @@ let cn = class extends Ge {
|
|
|
1404
1404
|
if (((s = n == null ? void 0 : n.customBlocks) != null ? s : []).some((c) => c.blockId === i))
|
|
1405
1405
|
return "";
|
|
1406
1406
|
for (const c of Object.keys(t))
|
|
1407
|
-
if ((a = t[c].body.customBlocks) != null && a.some((
|
|
1407
|
+
if ((a = t[c].body.customBlocks) != null && a.some((g) => g.blockId === i))
|
|
1408
1408
|
return c;
|
|
1409
1409
|
for (const c of Object.keys(r))
|
|
1410
|
-
if ((d = r[c].body.customBlocks) != null && d.some((
|
|
1410
|
+
if ((d = r[c].body.customBlocks) != null && d.some((g) => g.blockId === i))
|
|
1411
1411
|
return c;
|
|
1412
1412
|
return "";
|
|
1413
1413
|
}
|
|
@@ -1419,18 +1419,18 @@ let cn = class extends Ge {
|
|
|
1419
1419
|
return;
|
|
1420
1420
|
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === We.BODY;
|
|
1421
1421
|
for (const d of Object.keys(o)) {
|
|
1422
|
-
const c = o[d],
|
|
1422
|
+
const c = o[d], g = ti({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(g, !0);
|
|
1423
1423
|
if (m.length)
|
|
1424
|
-
for (const
|
|
1425
|
-
e.detachTransformerFrom(
|
|
1424
|
+
for (const l of m) {
|
|
1425
|
+
e.detachTransformerFrom(l);
|
|
1426
1426
|
try {
|
|
1427
|
-
|
|
1427
|
+
l.setOpacity(0.5);
|
|
1428
1428
|
} catch {
|
|
1429
1429
|
}
|
|
1430
1430
|
if (s && c.isMultiTransform !== se.TRUE || !s && c.isMultiTransform === se.TRUE) {
|
|
1431
|
-
c.allowTransform !== !1 && e.attachTransformerTo(
|
|
1431
|
+
c.allowTransform !== !1 && e.attachTransformerTo(l);
|
|
1432
1432
|
try {
|
|
1433
|
-
|
|
1433
|
+
l.setOpacity(1);
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
@@ -1494,12 +1494,12 @@ const Dt = {
|
|
|
1494
1494
|
const n = i.get($), t = i.get(Ue), r = i.get(q), o = i.get(J), { direction: s } = e, a = t.getFocusDrawings();
|
|
1495
1495
|
if (a.length === 0)
|
|
1496
1496
|
return !1;
|
|
1497
|
-
const d = a[0].unitId, c = o.getRenderById(d),
|
|
1498
|
-
if (
|
|
1497
|
+
const d = a[0].unitId, c = o.getRenderById(d), g = c == null ? void 0 : c.scene;
|
|
1498
|
+
if (g == null)
|
|
1499
1499
|
return !1;
|
|
1500
|
-
const m =
|
|
1500
|
+
const m = g.getTransformerByCreate(), l = r.getUniverDocInstance(d), f = a.map((v) => {
|
|
1501
1501
|
var P, N, B, E, _;
|
|
1502
|
-
const { drawingId: w } = v, I = (P =
|
|
1502
|
+
const { drawingId: w } = v, I = (P = l == null ? void 0 : l.getSnapshot().drawings) == null ? void 0 : P[w];
|
|
1503
1503
|
if (I == null || I.layoutType === W.INLINE)
|
|
1504
1504
|
return null;
|
|
1505
1505
|
const { positionH: O, positionV: C } = I.docTransform, T = { ...O }, b = { ...C };
|
|
@@ -1572,10 +1572,10 @@ const Dt = {
|
|
|
1572
1572
|
const e = ve($), n = ve(un), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
|
|
1573
1573
|
if (a == null)
|
|
1574
1574
|
return;
|
|
1575
|
-
const { unitId: d } = a, c = o.getUniverDocInstance(d),
|
|
1576
|
-
if (
|
|
1575
|
+
const { unitId: d } = a, c = o.getUniverDocInstance(d), g = c == null ? void 0 : c.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), l = m == null ? void 0 : m.scene;
|
|
1576
|
+
if (l == null)
|
|
1577
1577
|
return;
|
|
1578
|
-
const f =
|
|
1578
|
+
const f = l.getTransformerByCreate(), u = [{
|
|
1579
1579
|
label: n.t("image-position.column"),
|
|
1580
1580
|
value: String(ee.COLUMN)
|
|
1581
1581
|
}, {
|
|
@@ -1587,15 +1587,15 @@ const Dt = {
|
|
|
1587
1587
|
}], v = [{
|
|
1588
1588
|
label: n.t("image-position.line"),
|
|
1589
1589
|
value: String(H.LINE),
|
|
1590
|
-
disabled:
|
|
1590
|
+
disabled: g === wn.MODERN
|
|
1591
1591
|
}, {
|
|
1592
1592
|
label: n.t("image-position.page"),
|
|
1593
1593
|
value: String(H.PAGE),
|
|
1594
|
-
disabled:
|
|
1594
|
+
disabled: g === wn.MODERN
|
|
1595
1595
|
}, {
|
|
1596
1596
|
label: n.t("image-position.margin"),
|
|
1597
1597
|
value: String(H.MARGIN),
|
|
1598
|
-
disabled:
|
|
1598
|
+
disabled: g === wn.MODERN
|
|
1599
1599
|
}, {
|
|
1600
1600
|
label: n.t("image-position.paragraph"),
|
|
1601
1601
|
value: String(H.PARAGRAPH)
|
|
@@ -1803,10 +1803,10 @@ const Dt = {
|
|
|
1803
1803
|
const e = ve($), n = ve(un), t = ve(_e), r = ve(J), o = ve(q), { drawings: s } = i, a = s[0];
|
|
1804
1804
|
if (a == null)
|
|
1805
1805
|
return null;
|
|
1806
|
-
const { unitId: d } = a, c = o.getUniverDocInstance(d),
|
|
1807
|
-
if ((
|
|
1806
|
+
const { unitId: d } = a, c = o.getUniverDocInstance(d), g = r.getRenderById(d);
|
|
1807
|
+
if ((g == null ? void 0 : g.scene) == null)
|
|
1808
1808
|
return null;
|
|
1809
|
-
const [
|
|
1809
|
+
const [l, f] = oe(!0), [u, v] = oe(!0), [w, I] = oe(!0), [O, C] = oe(ue.INLINE), [T, b] = oe(""), [P, N] = oe({
|
|
1810
1810
|
distT: 0,
|
|
1811
1811
|
distL: 0,
|
|
1812
1812
|
distB: 0,
|
|
@@ -1933,7 +1933,7 @@ const Dt = {
|
|
|
1933
1933
|
/* @__PURE__ */ p(Me, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1934
1934
|
] }) }) }),
|
|
1935
1935
|
/* @__PURE__ */ p("div", { className: h.imageCommonPanelRow, children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn, h.imageCommonPanelSubtitle), children: /* @__PURE__ */ p("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
|
|
1936
|
-
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelRow), children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { disabled:
|
|
1936
|
+
/* @__PURE__ */ p("div", { className: j(h.imageCommonPanelRow), children: /* @__PURE__ */ p("div", { className: j(h.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { disabled: l, value: T, onChange: L, direction: "horizontal", children: [
|
|
1937
1937
|
/* @__PURE__ */ p(Me, { value: Xe.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1938
1938
|
/* @__PURE__ */ p(Me, { value: Xe.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1939
1939
|
/* @__PURE__ */ p(Me, { value: Xe.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
@@ -2033,9 +2033,9 @@ const Dt = {
|
|
|
2033
2033
|
var s;
|
|
2034
2034
|
const o = e.getActiveTextRange();
|
|
2035
2035
|
if (o) {
|
|
2036
|
-
const { segmentId: a, startOffset: d, endOffset: c } = o,
|
|
2037
|
-
if (m && m.length && m.some((
|
|
2038
|
-
const { startIndex: f, endIndex: u } =
|
|
2036
|
+
const { segmentId: a, startOffset: d, endOffset: c } = o, g = n.getCurrentUniverDocInstance(), m = (s = g == null ? void 0 : g.getSelfOrHeaderFooterModel(a).getBody()) == null ? void 0 : s.tables;
|
|
2037
|
+
if (m && m.length && m.some((l) => {
|
|
2038
|
+
const { startIndex: f, endIndex: u } = l;
|
|
2039
2039
|
return d >= f && d < u || c >= f && c < u;
|
|
2040
2040
|
})) {
|
|
2041
2041
|
t.next(!0);
|
|
@@ -2197,14 +2197,14 @@ var Dr = Object.getOwnPropertyDescriptor, Cr = (i, e, n, t) => {
|
|
|
2197
2197
|
return r;
|
|
2198
2198
|
}, Fe = (i, e) => (n, t) => e(n, t, i);
|
|
2199
2199
|
function In(i, e) {
|
|
2200
|
-
const { top: n, left: t, width: r, height: o, angle: s, opacity: a } = i, d = e.scene, c = d.getViewport(it.VIEW_MAIN), { viewportScrollX:
|
|
2200
|
+
const { top: n, left: t, width: r, height: o, angle: s, opacity: a } = i, d = e.scene, c = d.getViewport(it.VIEW_MAIN), { viewportScrollX: g, viewportScrollY: m } = c, { scaleX: l, scaleY: f } = d.getAncestorScale();
|
|
2201
2201
|
return {
|
|
2202
|
-
startX: (t -
|
|
2202
|
+
startX: (t - g) * l,
|
|
2203
2203
|
startY: (n - m) * f,
|
|
2204
|
-
endX: (t + r -
|
|
2204
|
+
endX: (t + r - g) * l,
|
|
2205
2205
|
endY: (n + o - m) * f,
|
|
2206
|
-
width: r,
|
|
2207
|
-
height: o,
|
|
2206
|
+
width: r * l,
|
|
2207
|
+
height: o * f,
|
|
2208
2208
|
rotate: s,
|
|
2209
2209
|
absolute: {
|
|
2210
2210
|
left: !1,
|
|
@@ -2262,7 +2262,7 @@ let ln = class extends Ge {
|
|
|
2262
2262
|
if (!(a == null || a.length === 0))
|
|
2263
2263
|
for (const d of a) {
|
|
2264
2264
|
this._addHoverForRect(d);
|
|
2265
|
-
const c = new Ht(),
|
|
2265
|
+
const c = new Ht(), g = In(d, o.renderUnit), m = new ot(g), l = o.canvas, f = s.data, u = {
|
|
2266
2266
|
dispose: c,
|
|
2267
2267
|
rect: d,
|
|
2268
2268
|
position$: m,
|
|
@@ -2273,16 +2273,16 @@ let ln = class extends Ge {
|
|
|
2273
2273
|
id: s.drawingId,
|
|
2274
2274
|
componentKey: s.componentKey,
|
|
2275
2275
|
onPointerDown: (w) => {
|
|
2276
|
-
|
|
2276
|
+
l.dispatchEvent(new PointerEvent(w.type, w));
|
|
2277
2277
|
},
|
|
2278
2278
|
onPointerMove: (w) => {
|
|
2279
|
-
|
|
2279
|
+
l.dispatchEvent(new PointerEvent(w.type, w));
|
|
2280
2280
|
},
|
|
2281
2281
|
onPointerUp: (w) => {
|
|
2282
|
-
|
|
2282
|
+
l.dispatchEvent(new PointerEvent(w.type, w));
|
|
2283
2283
|
},
|
|
2284
2284
|
onWheel: (w) => {
|
|
2285
|
-
|
|
2285
|
+
l.dispatchEvent(new WheelEvent(w.type, w));
|
|
2286
2286
|
},
|
|
2287
2287
|
data: f,
|
|
2288
2288
|
unitId: t
|
|
@@ -2362,7 +2362,7 @@ let ln = class extends Ge {
|
|
|
2362
2362
|
if (!r) return !1;
|
|
2363
2363
|
const a = (v = r.renderUnit.with(te).getSkeleton().getSkeletonData()) == null ? void 0 : v.pages[0];
|
|
2364
2364
|
if (!a) return !1;
|
|
2365
|
-
const { pageWidth: d, marginLeft: c, marginRight:
|
|
2365
|
+
const { pageWidth: d, marginLeft: c, marginRight: g } = a, m = d - c - g, l = {
|
|
2366
2366
|
size: {
|
|
2367
2367
|
width: (w = n.width) != null ? w : m,
|
|
2368
2368
|
height: n.height
|
|
@@ -2387,9 +2387,9 @@ let ln = class extends Ge {
|
|
|
2387
2387
|
...e,
|
|
2388
2388
|
title: "",
|
|
2389
2389
|
description: "",
|
|
2390
|
-
docTransform:
|
|
2390
|
+
docTransform: l,
|
|
2391
2391
|
layoutType: W.INLINE,
|
|
2392
|
-
transform: tt(
|
|
2392
|
+
transform: tt(l)
|
|
2393
2393
|
}
|
|
2394
2394
|
]
|
|
2395
2395
|
};
|
|
@@ -2459,22 +2459,22 @@ let gn = class extends Vt {
|
|
|
2459
2459
|
const d = a.oKey, c = this._drawingManagerService.getDrawingOKey(d);
|
|
2460
2460
|
if (!c || c.drawingType === rn.DRAWING_DOM)
|
|
2461
2461
|
return;
|
|
2462
|
-
const { unitId:
|
|
2462
|
+
const { unitId: g, subUnitId: m, drawingId: l, drawingType: f } = c, u = this._canvasPopManagerService.attachPopupToObject(
|
|
2463
2463
|
a,
|
|
2464
2464
|
{
|
|
2465
2465
|
componentKey: ai,
|
|
2466
2466
|
direction: "horizontal",
|
|
2467
2467
|
offset: [2, 0],
|
|
2468
2468
|
extraProps: {
|
|
2469
|
-
menuItems: this._getImageMenuItems(
|
|
2469
|
+
menuItems: this._getImageMenuItems(g, m, l, f)
|
|
2470
2470
|
}
|
|
2471
2471
|
},
|
|
2472
|
-
|
|
2472
|
+
g
|
|
2473
2473
|
);
|
|
2474
|
-
r.push(this.disposeWithMe(u)), !this._drawingManagerService.getFocusDrawings().find((I) => I.unitId ===
|
|
2475
|
-
unitId:
|
|
2474
|
+
r.push(this.disposeWithMe(u)), !this._drawingManagerService.getFocusDrawings().find((I) => I.unitId === g && I.subUnitId === m && I.drawingId === l) && this._drawingManagerService.focusDrawing([{
|
|
2475
|
+
unitId: g,
|
|
2476
2476
|
subUnitId: m,
|
|
2477
|
-
drawingId:
|
|
2477
|
+
drawingId: l
|
|
2478
2478
|
}]);
|
|
2479
2479
|
})
|
|
2480
2480
|
)
|
|
@@ -2598,12 +2598,12 @@ let Sn = class extends Ge {
|
|
|
2598
2598
|
const n = e == null ? void 0 : e.getSkeletonData(), { mainComponent: t, unitId: r } = this._context, o = t;
|
|
2599
2599
|
if (!n)
|
|
2600
2600
|
return;
|
|
2601
|
-
const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop:
|
|
2601
|
+
const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop: g } = o, { pages: m, skeHeaders: l, skeFooters: f } = n, u = {};
|
|
2602
2602
|
this._liquid.reset();
|
|
2603
2603
|
for (let T = 0, b = m.length; T < b; T++) {
|
|
2604
2604
|
const P = m[T], { headerId: N, footerId: B, pageWidth: E } = P;
|
|
2605
2605
|
if (N) {
|
|
2606
|
-
const _ = (O =
|
|
2606
|
+
const _ = (O = l.get(N)) == null ? void 0 : O.get(E);
|
|
2607
2607
|
_ && this._calculateDrawingPosition(
|
|
2608
2608
|
r,
|
|
2609
2609
|
_,
|
|
@@ -2626,7 +2626,7 @@ let Sn = class extends Ge {
|
|
|
2626
2626
|
P.marginLeft
|
|
2627
2627
|
);
|
|
2628
2628
|
}
|
|
2629
|
-
this._calculateDrawingPosition(r, P, s, a, u, P.marginTop, P.marginLeft), this._liquid.translatePage(P, d, c,
|
|
2629
|
+
this._calculateDrawingPosition(r, P, s, a, u, P.marginTop, P.marginLeft), this._liquid.translatePage(P, d, c, g);
|
|
2630
2630
|
}
|
|
2631
2631
|
const v = Object.values(u), w = v.filter((T) => !T.isMultiTransform), I = v.filter((T) => T.isMultiTransform);
|
|
2632
2632
|
w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(I);
|
|
@@ -2650,11 +2650,11 @@ let Sn = class extends Ge {
|
|
|
2650
2650
|
marginTop: s,
|
|
2651
2651
|
marginLeft: a
|
|
2652
2652
|
}), d.forEach((c) => {
|
|
2653
|
-
const { aLeft:
|
|
2654
|
-
left:
|
|
2653
|
+
const { aLeft: g, aTop: m, height: l, width: f, angle: u, drawingId: v, drawingOrigin: w } = c, I = w.layoutType === W.WRAP_NONE && w.behindDoc === se.TRUE, { isMultiTransform: O = se.FALSE } = w, C = {
|
|
2654
|
+
left: g + t + this._liquid.x,
|
|
2655
2655
|
top: m + r + this._liquid.y,
|
|
2656
2656
|
width: f,
|
|
2657
|
-
height:
|
|
2657
|
+
height: l,
|
|
2658
2658
|
angle: u
|
|
2659
2659
|
};
|
|
2660
2660
|
o[v] == null ? o[v] = {
|