@univerjs/docs-drawing-ui 0.6.10-experimental.20250428-63779a3 → 0.6.10-experimental.20250428-8c74c87
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 +164 -162
- package/lib/index.js +164 -162
- package/lib/types/views/printing-float-dom/index.d.ts +2 -1
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { RichTextEditingMutation as te, DocSelectionManagerService as Tn, DocSke
|
|
|
11
11
|
import { DocSelectionRenderService as Re, getRichTextEditPath as Ye, getCustomBlockIdsInSelections as Ri, docDrawingPositionToTransform as ct, VIEWPORT_KEY as dt, SetDocZoomRatioOperation as lt, DocPrintInterceptorService as Ni, NodePositionConvertToCursor as Hn, getOneTextSelectionRange as Gn, getAnchorBounding as Ei, TEXT_RANGE_LAYER_INDEX as Ai, getDocObject as xi, DocCanvasPopManagerService as Li, IEditorService as Ui } from "@univerjs/docs-ui";
|
|
12
12
|
import { MessageType as jn, clsx as V, InputNumber as He, Select as Vn, Checkbox as Bi, RadioGroup as $n, Radio as Me, render as Fi, unmount as ki } from "@univerjs/design";
|
|
13
13
|
import { BehaviorSubject as yn, debounceTime as gt, Observable as Wi, map as zn, switchMap as Hi, of as Gi, takeUntil as Xn, filter as qn } from "rxjs";
|
|
14
|
-
import { jsxs as K, jsx as
|
|
14
|
+
import { jsxs as K, jsx as f } from "react/jsx-runtime";
|
|
15
15
|
import { forwardRef as mt, useRef as ji, createElement as ut, useState as se, useEffect as Mn, useMemo as Vi } from "react";
|
|
16
16
|
const $i = "docs-drawing-ui.config", Kn = {};
|
|
17
17
|
var pe = function() {
|
|
@@ -77,7 +77,7 @@ const bn = {
|
|
|
77
77
|
const n = i.get($), t = i.get(q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
|
|
78
78
|
if (e == null || o == null)
|
|
79
79
|
return !1;
|
|
80
|
-
const s = r.getRenderById(e.unitId).with(Re), { drawings: c } = e, d = (b = s.getSegment()) != null ? b : "", a = new On(), l = X.getInstance(), m = (E = (y = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? E : [], g = c.map((N) => m.find((_) => _.blockId === N.drawingId)).filter((N) => !!N).sort((N, _) => N.startIndex > _.startIndex ? 1 : -1),
|
|
80
|
+
const s = r.getRenderById(e.unitId).with(Re), { drawings: c } = e, d = (b = s.getSegment()) != null ? b : "", a = new On(), l = X.getInstance(), m = (E = (y = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? E : [], g = c.map((N) => m.find((_) => _.blockId === N.drawingId)).filter((N) => !!N).sort((N, _) => N.startIndex > _.startIndex ? 1 : -1), h = c[0].unitId, u = new Ht();
|
|
81
81
|
u.reset();
|
|
82
82
|
const v = g[0].startIndex, w = [
|
|
83
83
|
{
|
|
@@ -87,7 +87,7 @@ const bn = {
|
|
|
87
87
|
], I = {
|
|
88
88
|
id: te.id,
|
|
89
89
|
params: {
|
|
90
|
-
unitId:
|
|
90
|
+
unitId: h,
|
|
91
91
|
actions: [],
|
|
92
92
|
textRanges: w
|
|
93
93
|
}
|
|
@@ -161,16 +161,16 @@ const bn = {
|
|
|
161
161
|
const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId: m } = o, g = s.getSelfOrHeaderFooterModel(m).getBody();
|
|
162
162
|
if (g == null)
|
|
163
163
|
return !1;
|
|
164
|
-
const
|
|
164
|
+
const h = new On(), u = X.getInstance(), v = [], w = (E = (y = s.getSnapshot().drawingsOrder) == null ? void 0 : y.length) != null ? E : 0;
|
|
165
165
|
let I = 0;
|
|
166
166
|
if (a)
|
|
167
|
-
l > 0 &&
|
|
167
|
+
l > 0 && h.push({
|
|
168
168
|
t: Q.RETAIN,
|
|
169
169
|
len: l
|
|
170
170
|
});
|
|
171
171
|
else {
|
|
172
172
|
const _ = Gt.selection.delete([o], g, 0, null, !1);
|
|
173
|
-
|
|
173
|
+
h.push(..._);
|
|
174
174
|
const L = Ri(g, [o]), G = (B = s.getDrawings()) != null ? B : {}, x = (N = s.getDrawingsOrder()) != null ? N : [], j = L.sort((S, D) => x.indexOf(S) > x.indexOf(D) ? -1 : x.indexOf(S) < x.indexOf(D) ? 1 : 0);
|
|
175
175
|
if (j.length > 0)
|
|
176
176
|
for (const S of j) {
|
|
@@ -181,7 +181,7 @@ const bn = {
|
|
|
181
181
|
v.push(T), v.push(U), I++;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
h.push({
|
|
185
185
|
t: Q.INSERT,
|
|
186
186
|
body: {
|
|
187
187
|
dataStream: "\b".repeat(d.length),
|
|
@@ -192,7 +192,7 @@ const bn = {
|
|
|
192
192
|
},
|
|
193
193
|
len: d.length
|
|
194
194
|
});
|
|
195
|
-
const O = Ye(s, m), C = u.editOp(
|
|
195
|
+
const O = Ye(s, m), C = u.editOp(h.serialize(), O);
|
|
196
196
|
v.push(C);
|
|
197
197
|
for (const _ of d) {
|
|
198
198
|
const { drawingId: L } = _, G = u.insertOp(["drawings", L], _), x = u.insertOp(["drawingsOrder", w - I], L);
|
|
@@ -225,7 +225,7 @@ const bn = {
|
|
|
225
225
|
const m = [];
|
|
226
226
|
let g = be.deepClone(l);
|
|
227
227
|
g = g.slice(3), g.unshift("drawingsOrder"), m.push(g);
|
|
228
|
-
const
|
|
228
|
+
const h = {
|
|
229
229
|
id: te.id,
|
|
230
230
|
params: {
|
|
231
231
|
unitId: r,
|
|
@@ -233,7 +233,7 @@ const bn = {
|
|
|
233
233
|
textRanges: null
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
return
|
|
236
|
+
return h.params.actions = m.reduce((v, w) => X.compose(v, w), null), !!n.syncExecuteCommand(h.id, h.params);
|
|
237
237
|
}
|
|
238
238
|
}, _t = {
|
|
239
239
|
id: "doc.command.ungroup-doc-image",
|
|
@@ -317,8 +317,8 @@ let an = class extends Be {
|
|
|
317
317
|
const w = Un / a, I = Bn / l;
|
|
318
318
|
g = Math.min(w, I);
|
|
319
319
|
}
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
320
|
+
const h = this._getImagePosition(a * g, l * g);
|
|
321
|
+
if (h == null)
|
|
322
322
|
return;
|
|
323
323
|
const u = {
|
|
324
324
|
unitId: n,
|
|
@@ -327,8 +327,8 @@ let an = class extends Be {
|
|
|
327
327
|
drawingType: Ue.DRAWING_IMAGE,
|
|
328
328
|
imageSourceType: s,
|
|
329
329
|
source: c,
|
|
330
|
-
transform: ct(
|
|
331
|
-
docTransform:
|
|
330
|
+
transform: ct(h),
|
|
331
|
+
docTransform: h,
|
|
332
332
|
behindDoc: ae.FALSE,
|
|
333
333
|
title: "",
|
|
334
334
|
description: "",
|
|
@@ -526,11 +526,11 @@ const Ji = {
|
|
|
526
526
|
behindText: W.WRAP_NONE
|
|
527
527
|
};
|
|
528
528
|
function Dt(i, e, n, t, r, o, s) {
|
|
529
|
-
var
|
|
529
|
+
var h, u;
|
|
530
530
|
const c = new On(), d = X.getInstance(), a = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
531
531
|
if (l == null || m == null)
|
|
532
532
|
return;
|
|
533
|
-
const g = (u = (
|
|
533
|
+
const g = (u = (h = l.customBlocks) == null ? void 0 : h.find((v) => v.blockId === r)) == null ? void 0 : u.startIndex;
|
|
534
534
|
if (g != null) {
|
|
535
535
|
if (t = Math.min(m.dataStream.length - 2, t), i === e) {
|
|
536
536
|
if (t < g ? (t > 0 && c.push({
|
|
@@ -613,7 +613,7 @@ const Ct = {
|
|
|
613
613
|
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get($), s = i.get(q), d = i.get(ee).getRenderById(r), a = d == null ? void 0 : d.with(ie).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(ie).getViewModel(), m = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
|
|
614
614
|
if (g == null || a == null || m == null || l == null)
|
|
615
615
|
return !1;
|
|
616
|
-
const
|
|
616
|
+
const h = l.getEditArea(), u = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: I } = a, O = X.getInstance(), C = [], { drawings: P = {} } = g.getSnapshot();
|
|
617
617
|
for (const N of n) {
|
|
618
618
|
const { drawingId: _ } = N, L = P[_].layoutType, G = Ji[t];
|
|
619
619
|
if (L !== G) {
|
|
@@ -632,7 +632,7 @@ const Ct = {
|
|
|
632
632
|
let x = null, j = 0, S = 0;
|
|
633
633
|
for (const D of v) {
|
|
634
634
|
const { headerId: R, footerId: T, marginTop: U, marginLeft: F, marginBottom: M, pageWidth: A, pageHeight: z } = D;
|
|
635
|
-
switch (
|
|
635
|
+
switch (h) {
|
|
636
636
|
case Ge.HEADER: {
|
|
637
637
|
const k = (E = w.get(R)) == null ? void 0 : E.get(A);
|
|
638
638
|
k != null && k.skeDrawings.has(_) && (x = k.skeDrawings.get(_), j = k.marginTop, S = F);
|
|
@@ -698,8 +698,8 @@ const Ct = {
|
|
|
698
698
|
if (r == null)
|
|
699
699
|
return !1;
|
|
700
700
|
const { drawings: o, dist: s, unitId: c } = e, d = X.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
|
|
701
|
-
for (const
|
|
702
|
-
const { drawingId: u } =
|
|
701
|
+
for (const h of o) {
|
|
702
|
+
const { drawingId: u } = h;
|
|
703
703
|
for (const [v, w] of Object.entries(s)) {
|
|
704
704
|
const I = l[u][v];
|
|
705
705
|
if (I !== w) {
|
|
@@ -716,7 +716,7 @@ const Ct = {
|
|
|
716
716
|
textRanges: null
|
|
717
717
|
}
|
|
718
718
|
};
|
|
719
|
-
return m.params.actions = a.reduce((
|
|
719
|
+
return m.params.actions = a.reduce((h, u) => X.compose(h, u), null), !!n.syncExecuteCommand(m.id, m.params);
|
|
720
720
|
}
|
|
721
721
|
}, Pt = {
|
|
722
722
|
id: "doc.command.update-doc-drawing-wrap-text",
|
|
@@ -728,8 +728,8 @@ const Ct = {
|
|
|
728
728
|
if (r == null)
|
|
729
729
|
return !1;
|
|
730
730
|
const { drawings: o, wrapText: s, unitId: c } = e, d = X.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
|
|
731
|
-
for (const
|
|
732
|
-
const { drawingId: u } =
|
|
731
|
+
for (const h of o) {
|
|
732
|
+
const { drawingId: u } = h, v = l[u].wrapText;
|
|
733
733
|
if (v !== s) {
|
|
734
734
|
const w = d.replaceOp(["drawings", u, "wrapText"], v, s);
|
|
735
735
|
a.push(w);
|
|
@@ -743,7 +743,7 @@ const Ct = {
|
|
|
743
743
|
textRanges: null
|
|
744
744
|
}
|
|
745
745
|
};
|
|
746
|
-
return m.params.actions = a.reduce((
|
|
746
|
+
return m.params.actions = a.reduce((h, u) => X.compose(h, u), null), !!n.syncExecuteCommand(m.id, m.params);
|
|
747
747
|
}
|
|
748
748
|
}, Ze = {
|
|
749
749
|
id: "doc.command.update-drawing-doc-transform",
|
|
@@ -757,9 +757,9 @@ const Ct = {
|
|
|
757
757
|
const c = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
|
|
758
758
|
if (d == null)
|
|
759
759
|
return !1;
|
|
760
|
-
const { drawings: a, unitId: l } = e, m = X.getInstance(), g = [], { drawings:
|
|
760
|
+
const { drawings: a, unitId: l } = e, m = X.getInstance(), g = [], { drawings: h = {} } = d.getSnapshot();
|
|
761
761
|
for (const w of a) {
|
|
762
|
-
const { drawingId: I, key: O, value: C } = w, P =
|
|
762
|
+
const { drawingId: I, key: O, value: C } = w, P = h[I].docTransform[O];
|
|
763
763
|
if (!be.diffValue(P, C)) {
|
|
764
764
|
const b = m.replaceOp(["drawings", I, "docTransform", O], P, C);
|
|
765
765
|
g.push(b);
|
|
@@ -791,7 +791,7 @@ const Ct = {
|
|
|
791
791
|
const d = s.getTransformerByCreate(), a = i.get($), m = i.get(q).getCurrentUniverDocInstance();
|
|
792
792
|
if (m == null)
|
|
793
793
|
return !1;
|
|
794
|
-
const { drawing: g, unitId:
|
|
794
|
+
const { drawing: g, unitId: h, offset: u, segmentId: v, segmentPage: w, needRefreshDrawings: I } = e;
|
|
795
795
|
if (I)
|
|
796
796
|
return r.refreshDrawings(c), d.refreshControls(), !0;
|
|
797
797
|
const O = [], { drawingId: C } = g, P = (N = t.getSegment()) != null ? N : "", b = Dt(
|
|
@@ -809,7 +809,7 @@ const Ct = {
|
|
|
809
809
|
const y = {
|
|
810
810
|
id: te.id,
|
|
811
811
|
params: {
|
|
812
|
-
unitId:
|
|
812
|
+
unitId: h,
|
|
813
813
|
actions: [],
|
|
814
814
|
textRanges: null
|
|
815
815
|
}
|
|
@@ -832,7 +832,7 @@ const Ct = {
|
|
|
832
832
|
const s = o.getTransformerByCreate(), c = i.get($), a = i.get(q).getCurrentUniverDocInstance();
|
|
833
833
|
if (a == null)
|
|
834
834
|
return !1;
|
|
835
|
-
const { drawing: l, unitId: m, offset: g, docTransform:
|
|
835
|
+
const { drawing: l, unitId: m, offset: g, docTransform: h, segmentId: u, segmentPage: v } = e, w = [], { drawingId: I } = l, O = (j = t.getSegment()) != null ? j : "", C = Dt(
|
|
836
836
|
u,
|
|
837
837
|
O,
|
|
838
838
|
v,
|
|
@@ -845,20 +845,20 @@ const Ct = {
|
|
|
845
845
|
return !1;
|
|
846
846
|
C.length > 0 && w.push(...C);
|
|
847
847
|
const P = X.getInstance(), { drawings: b = {} } = a.getSnapshot(), y = b[I].docTransform, { positionH: E, positionV: B, size: N, angle: _ } = y;
|
|
848
|
-
if (!be.diffValue(E,
|
|
849
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "positionH"], E,
|
|
848
|
+
if (!be.diffValue(E, h.positionH)) {
|
|
849
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "positionH"], E, h.positionH);
|
|
850
850
|
w.push(S);
|
|
851
851
|
}
|
|
852
|
-
if (!be.diffValue(B,
|
|
853
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "positionV"], B,
|
|
852
|
+
if (!be.diffValue(B, h.positionV)) {
|
|
853
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "positionV"], B, h.positionV);
|
|
854
854
|
w.push(S);
|
|
855
855
|
}
|
|
856
|
-
if (!be.diffValue(N,
|
|
857
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "size"], N,
|
|
856
|
+
if (!be.diffValue(N, h.size)) {
|
|
857
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "size"], N, h.size);
|
|
858
858
|
w.push(S);
|
|
859
859
|
}
|
|
860
|
-
if (!be.diffValue(_,
|
|
861
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "angle"], _,
|
|
860
|
+
if (!be.diffValue(_, h.angle)) {
|
|
861
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "angle"], _, h.angle);
|
|
862
862
|
w.push(S);
|
|
863
863
|
}
|
|
864
864
|
const L = {
|
|
@@ -884,7 +884,7 @@ const Ct = {
|
|
|
884
884
|
const d = c[0].unitId, a = o.getRenderById(d), l = a == null ? void 0 : a.scene;
|
|
885
885
|
if (l == null)
|
|
886
886
|
return !1;
|
|
887
|
-
const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d),
|
|
887
|
+
const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), h = c.map((v) => {
|
|
888
888
|
var y, E, B, N, _;
|
|
889
889
|
const { drawingId: w } = v, I = (y = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : y[w];
|
|
890
890
|
if (I == null || I.layoutType === W.INLINE)
|
|
@@ -896,12 +896,12 @@ const Ct = {
|
|
|
896
896
|
value: s === fe.UP || s === fe.DOWN ? b : P
|
|
897
897
|
};
|
|
898
898
|
}).filter((v) => v != null);
|
|
899
|
-
if (
|
|
899
|
+
if (h.length === 0)
|
|
900
900
|
return !1;
|
|
901
901
|
const u = n.syncExecuteCommand(Ze.id, {
|
|
902
902
|
unitId: d,
|
|
903
903
|
subUnitId: d,
|
|
904
|
-
drawings:
|
|
904
|
+
drawings: h
|
|
905
905
|
});
|
|
906
906
|
return m.refreshControls(), !!u;
|
|
907
907
|
}
|
|
@@ -945,7 +945,7 @@ const Ct = {
|
|
|
945
945
|
const n = i.get(we), t = i.get($);
|
|
946
946
|
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(bt.id, { value: "open" }), !0);
|
|
947
947
|
}
|
|
948
|
-
}, nr = "univer-image-common-panel", tr = "univer-image-common-panel-grid", ir = "univer-image-common-panel-border", rr = "univer-image-common-panel-title", or = "univer-image-common-panel-subtitle", sr = "univer-image-common-panel-row", ar = "univer-image-common-panel-column", cr = "univer-image-common-panel-span2", dr = "univer-image-common-panel-input",
|
|
948
|
+
}, nr = "univer-image-common-panel", tr = "univer-image-common-panel-grid", ir = "univer-image-common-panel-border", rr = "univer-image-common-panel-title", or = "univer-image-common-panel-subtitle", sr = "univer-image-common-panel-row", ar = "univer-image-common-panel-column", cr = "univer-image-common-panel-span2", dr = "univer-image-common-panel-input", p = {
|
|
949
949
|
imageCommonPanel: nr,
|
|
950
950
|
imageCommonPanelGrid: tr,
|
|
951
951
|
imageCommonPanelBorder: ir,
|
|
@@ -962,7 +962,7 @@ const Ct = {
|
|
|
962
962
|
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), g = m == null ? void 0 : m.scene;
|
|
963
963
|
if (g == null)
|
|
964
964
|
return;
|
|
965
|
-
const
|
|
965
|
+
const h = g.getTransformerByCreate(), u = [{
|
|
966
966
|
label: n.t("image-position.column"),
|
|
967
967
|
value: String(ne.COLUMN)
|
|
968
968
|
}, {
|
|
@@ -1014,7 +1014,7 @@ const Ct = {
|
|
|
1014
1014
|
}))
|
|
1015
1015
|
});
|
|
1016
1016
|
const F = (M = r.getRenderById(d)) == null ? void 0 : M.with(Re);
|
|
1017
|
-
F && F.blur(),
|
|
1017
|
+
F && F.blur(), h.refreshControls();
|
|
1018
1018
|
}
|
|
1019
1019
|
function L(D) {
|
|
1020
1020
|
var oe, De, Ce;
|
|
@@ -1111,13 +1111,13 @@ const Ct = {
|
|
|
1111
1111
|
return () => {
|
|
1112
1112
|
D.unsubscribe(), R.dispose();
|
|
1113
1113
|
};
|
|
1114
|
-
}, []), /* @__PURE__ */ K("div", { className: V(
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */ K("div", { className:
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
1114
|
+
}, []), /* @__PURE__ */ K("div", { className: V(p.imageCommonPanelGrid, p.imageCommonPanelBorder), style: { display: B ? "block" : "none" }, children: [
|
|
1115
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.title") }) }) }),
|
|
1116
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.horizontal") }) }) }),
|
|
1117
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1118
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1119
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1120
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1121
1121
|
He,
|
|
1122
1122
|
{
|
|
1123
1123
|
min: Yn,
|
|
@@ -1131,13 +1131,13 @@ const Ct = {
|
|
|
1131
1131
|
posOffset: D
|
|
1132
1132
|
});
|
|
1133
1133
|
},
|
|
1134
|
-
className:
|
|
1134
|
+
className: p.imageCommonPanelInput
|
|
1135
1135
|
}
|
|
1136
1136
|
) }) })
|
|
1137
1137
|
] }) }),
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1139
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
|
|
1140
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1141
1141
|
Vn,
|
|
1142
1142
|
{
|
|
1143
1143
|
value: String(O.relativeFrom),
|
|
@@ -1148,11 +1148,11 @@ const Ct = {
|
|
|
1148
1148
|
) }) })
|
|
1149
1149
|
] }) })
|
|
1150
1150
|
] }),
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */ K("div", { className:
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.vertical") }) }) }),
|
|
1152
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1153
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1154
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1155
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1156
1156
|
He,
|
|
1157
1157
|
{
|
|
1158
1158
|
min: Yn,
|
|
@@ -1166,13 +1166,13 @@ const Ct = {
|
|
|
1166
1166
|
posOffset: D
|
|
1167
1167
|
});
|
|
1168
1168
|
},
|
|
1169
|
-
className:
|
|
1169
|
+
className: p.imageCommonPanelInput
|
|
1170
1170
|
}
|
|
1171
1171
|
) }) })
|
|
1172
1172
|
] }) }),
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1174
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
|
|
1175
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1176
1176
|
Vn,
|
|
1177
1177
|
{
|
|
1178
1178
|
disabled: w,
|
|
@@ -1183,8 +1183,8 @@ const Ct = {
|
|
|
1183
1183
|
) }) })
|
|
1184
1184
|
] }) })
|
|
1185
1185
|
] }),
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.options") }) }) }),
|
|
1187
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(Bi, { disabled: w, checked: y, onChange: S, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1188
1188
|
] });
|
|
1189
1189
|
}, nn = 0, tn = 100, gr = (i) => {
|
|
1190
1190
|
const e = Ie($), n = Ie(fn), t = Ie(we), r = Ie(ee), o = Ie(q), { drawings: s } = i, c = s[0];
|
|
@@ -1193,7 +1193,7 @@ const Ct = {
|
|
|
1193
1193
|
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = r.getRenderById(d);
|
|
1194
1194
|
if ((l == null ? void 0 : l.scene) == null)
|
|
1195
1195
|
return null;
|
|
1196
|
-
const [g,
|
|
1196
|
+
const [g, h] = se(!0), [u, v] = se(!0), [w, I] = se(!0), [O, C] = se(he.INLINE), [P, b] = se(""), [y, E] = se({
|
|
1197
1197
|
distT: 0,
|
|
1198
1198
|
distL: 0,
|
|
1199
1199
|
distB: 0,
|
|
@@ -1278,7 +1278,7 @@ const Ct = {
|
|
|
1278
1278
|
distL: T,
|
|
1279
1279
|
distB: U,
|
|
1280
1280
|
distR: F
|
|
1281
|
-
}), b(z),
|
|
1281
|
+
}), b(z), h(M !== W.WRAP_SQUARE), M === W.WRAP_NONE || M === W.INLINE ? v(!0) : v(!1), M === W.WRAP_NONE || M === W.INLINE || M === W.WRAP_TOP_AND_BOTTOM ? I(!0) : I(!1), M === W.WRAP_NONE)
|
|
1282
1282
|
A === ae.TRUE ? C(he.BEHIND_TEXT) : C(he.IN_FRONT_OF_TEXT);
|
|
1283
1283
|
else
|
|
1284
1284
|
switch (M) {
|
|
@@ -1309,27 +1309,27 @@ const Ct = {
|
|
|
1309
1309
|
return () => {
|
|
1310
1310
|
S.unsubscribe(), D.dispose();
|
|
1311
1311
|
};
|
|
1312
|
-
}, []), /* @__PURE__ */ K("div", { className: V(
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1312
|
+
}, []), /* @__PURE__ */ K("div", { className: V(p.imageCommonPanelGrid, p.imageCommonPanelBorder), style: { display: B ? "block" : "none" }, children: [
|
|
1313
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.title") }) }) }),
|
|
1314
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
|
|
1315
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { value: O, onChange: _, direction: "vertical", children: [
|
|
1316
|
+
/* @__PURE__ */ f(Me, { value: he.INLINE, children: n.t("image-text-wrap.inline") }),
|
|
1317
|
+
/* @__PURE__ */ f(Me, { value: he.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
|
|
1318
|
+
/* @__PURE__ */ f(Me, { value: he.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
|
|
1319
|
+
/* @__PURE__ */ f(Me, { value: he.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
|
|
1320
|
+
/* @__PURE__ */ f(Me, { value: he.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1321
1321
|
] }) }) }),
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
|
|
1323
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { disabled: g, value: P, onChange: L, direction: "horizontal", children: [
|
|
1324
|
+
/* @__PURE__ */ f(Me, { value: Ke.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1325
|
+
/* @__PURE__ */ f(Me, { value: Ke.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1326
|
+
/* @__PURE__ */ f(Me, { value: Ke.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
1327
1327
|
] }) }) }),
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */ K("div", { className:
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
|
|
1329
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1330
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1331
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
|
|
1332
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1333
1333
|
He,
|
|
1334
1334
|
{
|
|
1335
1335
|
min: nn,
|
|
@@ -1340,13 +1340,13 @@ const Ct = {
|
|
|
1340
1340
|
onChange: (S) => {
|
|
1341
1341
|
G(S, "distT");
|
|
1342
1342
|
},
|
|
1343
|
-
className:
|
|
1343
|
+
className: p.imageCommonPanelInput
|
|
1344
1344
|
}
|
|
1345
1345
|
) }) })
|
|
1346
1346
|
] }) }),
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1347
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1348
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
|
|
1349
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1350
1350
|
He,
|
|
1351
1351
|
{
|
|
1352
1352
|
min: nn,
|
|
@@ -1357,15 +1357,15 @@ const Ct = {
|
|
|
1357
1357
|
onChange: (S) => {
|
|
1358
1358
|
G(S, "distL");
|
|
1359
1359
|
},
|
|
1360
|
-
className:
|
|
1360
|
+
className: p.imageCommonPanelInput
|
|
1361
1361
|
}
|
|
1362
1362
|
) }) })
|
|
1363
1363
|
] }) })
|
|
1364
1364
|
] }),
|
|
1365
|
-
/* @__PURE__ */ K("div", { className:
|
|
1366
|
-
/* @__PURE__ */
|
|
1367
|
-
/* @__PURE__ */
|
|
1368
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1366
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1367
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
|
|
1368
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1369
1369
|
He,
|
|
1370
1370
|
{
|
|
1371
1371
|
min: nn,
|
|
@@ -1376,13 +1376,13 @@ const Ct = {
|
|
|
1376
1376
|
onChange: (S) => {
|
|
1377
1377
|
G(S, "distB");
|
|
1378
1378
|
},
|
|
1379
|
-
className:
|
|
1379
|
+
className: p.imageCommonPanelInput
|
|
1380
1380
|
}
|
|
1381
1381
|
) }) })
|
|
1382
1382
|
] }) }),
|
|
1383
|
-
/* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1384
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
|
|
1385
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1386
1386
|
He,
|
|
1387
1387
|
{
|
|
1388
1388
|
min: nn,
|
|
@@ -1393,7 +1393,7 @@ const Ct = {
|
|
|
1393
1393
|
onChange: (S) => {
|
|
1394
1394
|
G(S, "distR");
|
|
1395
1395
|
},
|
|
1396
|
-
className:
|
|
1396
|
+
className: p.imageCommonPanelInput
|
|
1397
1397
|
}
|
|
1398
1398
|
) }) })
|
|
1399
1399
|
] }) })
|
|
@@ -1408,10 +1408,10 @@ const Ct = {
|
|
|
1408
1408
|
return () => {
|
|
1409
1409
|
r.unsubscribe();
|
|
1410
1410
|
};
|
|
1411
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ K("div", { className:
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1411
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ K("div", { className: p.imageCommonPanel, children: [
|
|
1412
|
+
/* @__PURE__ */ f(di, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
1413
|
+
/* @__PURE__ */ f(gr, { drawings: n }),
|
|
1414
|
+
/* @__PURE__ */ f(lr, { drawings: n })
|
|
1415
1415
|
] });
|
|
1416
1416
|
}, Nt = "addition-and-subtraction-single", Et = "doc.menu.image", At = St.id, ur = (i) => {
|
|
1417
1417
|
const e = i.get(Tn), n = i.get(q);
|
|
@@ -1422,8 +1422,8 @@ const Ct = {
|
|
|
1422
1422
|
if (o) {
|
|
1423
1423
|
const { segmentId: c, startOffset: d, endOffset: a } = o, l = n.getCurrentUniverDocInstance(), m = (s = l == null ? void 0 : l.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : s.tables;
|
|
1424
1424
|
if (m && m.length && m.some((g) => {
|
|
1425
|
-
const { startIndex:
|
|
1426
|
-
return d >=
|
|
1425
|
+
const { startIndex: h, endIndex: u } = g;
|
|
1426
|
+
return d >= h && d < u || a >= h && a < u;
|
|
1427
1427
|
})) {
|
|
1428
1428
|
t.next(!0);
|
|
1429
1429
|
return;
|
|
@@ -1702,13 +1702,13 @@ var Mr = Object.getOwnPropertyDescriptor, br = (i, e, n, t) => {
|
|
|
1702
1702
|
return r;
|
|
1703
1703
|
}, We = (i, e) => (n, t) => e(n, t, i);
|
|
1704
1704
|
function xt(i, e, n = 1, t = 0) {
|
|
1705
|
-
const { top: r, left: o, bottom: s, right: c } = i, d = c - o, a = s - r, l = e.getViewport(dt.VIEW_MAIN), { viewportScrollX: m, viewportScrollY: g } = l, { scaleX:
|
|
1705
|
+
const { top: r, left: o, bottom: s, right: c } = i, d = c - o, a = s - r, l = e.getViewport(dt.VIEW_MAIN), { viewportScrollX: m, viewportScrollY: g } = l, { scaleX: h, scaleY: u } = e.getAncestorScale();
|
|
1706
1706
|
return {
|
|
1707
|
-
startX: (o - m) *
|
|
1707
|
+
startX: (o - m) * h,
|
|
1708
1708
|
startY: (r - g) * u,
|
|
1709
|
-
endX: (o + d - m) *
|
|
1709
|
+
endX: (o + d - m) * h,
|
|
1710
1710
|
endY: (r + a - g) * u,
|
|
1711
|
-
width: d *
|
|
1711
|
+
width: d * h,
|
|
1712
1712
|
height: a * u,
|
|
1713
1713
|
rotate: t,
|
|
1714
1714
|
absolute: {
|
|
@@ -1771,7 +1771,7 @@ let ln = class extends Be {
|
|
|
1771
1771
|
if (!(c == null || c.length === 0))
|
|
1772
1772
|
for (const d of c) {
|
|
1773
1773
|
this._addHoverForRect(d);
|
|
1774
|
-
const a = new zt(), l = Sn(d, o.renderUnit), m = new yn(l), g = o.canvas,
|
|
1774
|
+
const a = new zt(), l = Sn(d, o.renderUnit), m = new yn(l), g = o.canvas, h = s.data, u = {
|
|
1775
1775
|
dispose: a,
|
|
1776
1776
|
rect: d,
|
|
1777
1777
|
position$: m,
|
|
@@ -1793,7 +1793,7 @@ let ln = class extends Be {
|
|
|
1793
1793
|
onWheel: (w) => {
|
|
1794
1794
|
g.dispatchEvent(new WheelEvent(w.type, w));
|
|
1795
1795
|
},
|
|
1796
|
-
data:
|
|
1796
|
+
data: h,
|
|
1797
1797
|
unitId: t
|
|
1798
1798
|
});
|
|
1799
1799
|
const v = d.onTransformChange$.subscribeEvent(() => {
|
|
@@ -1885,11 +1885,11 @@ let ln = class extends Be {
|
|
|
1885
1885
|
posOffset: 0
|
|
1886
1886
|
},
|
|
1887
1887
|
angle: 0
|
|
1888
|
-
},
|
|
1888
|
+
}, h = (I = n.drawingId) != null ? I : Xt(), u = {
|
|
1889
1889
|
unitId: t.getUnitId(),
|
|
1890
1890
|
drawings: [
|
|
1891
1891
|
{
|
|
1892
|
-
drawingId:
|
|
1892
|
+
drawingId: h,
|
|
1893
1893
|
drawingType: Ue.DRAWING_DOM,
|
|
1894
1894
|
subUnitId: t.getUnitId(),
|
|
1895
1895
|
unitId: t.getUnitId(),
|
|
@@ -1902,7 +1902,7 @@ let ln = class extends Be {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
]
|
|
1904
1904
|
};
|
|
1905
|
-
return this._commandService.syncExecuteCommand(Rn.id, u),
|
|
1905
|
+
return this._commandService.syncExecuteCommand(Rn.id, u), h;
|
|
1906
1906
|
}
|
|
1907
1907
|
};
|
|
1908
1908
|
ln = br([
|
|
@@ -1914,20 +1914,20 @@ ln = br([
|
|
|
1914
1914
|
We(5, $)
|
|
1915
1915
|
], ln);
|
|
1916
1916
|
const Rr = (i) => {
|
|
1917
|
-
const { floatDomInfos: e, scene: n, offset: t } = i, r = Vi(() => e.map((
|
|
1918
|
-
const { width:
|
|
1917
|
+
const { floatDomInfos: e, scene: n, offset: t, bound: r } = i, o = r.right - r.left, s = r.bottom - r.top, c = Vi(() => e.map((d) => {
|
|
1918
|
+
const { width: a = 0, height: l = 0, left: m = 0, top: g = 0 } = d.transform, u = xt(
|
|
1919
1919
|
{
|
|
1920
|
-
left:
|
|
1921
|
-
right:
|
|
1922
|
-
top:
|
|
1923
|
-
bottom:
|
|
1920
|
+
left: m,
|
|
1921
|
+
right: m + a,
|
|
1922
|
+
top: g,
|
|
1923
|
+
bottom: g + l
|
|
1924
1924
|
},
|
|
1925
1925
|
n
|
|
1926
|
-
),
|
|
1927
|
-
position$: new yn(
|
|
1928
|
-
position:
|
|
1929
|
-
id:
|
|
1930
|
-
componentKey:
|
|
1926
|
+
), v = {
|
|
1927
|
+
position$: new yn(u),
|
|
1928
|
+
position: u,
|
|
1929
|
+
id: d.drawingId,
|
|
1930
|
+
componentKey: d.componentKey,
|
|
1931
1931
|
onPointerMove: () => {
|
|
1932
1932
|
},
|
|
1933
1933
|
onPointerDown: () => {
|
|
@@ -1936,11 +1936,12 @@ const Rr = (i) => {
|
|
|
1936
1936
|
},
|
|
1937
1937
|
onWheel: () => {
|
|
1938
1938
|
},
|
|
1939
|
-
unitId:
|
|
1939
|
+
unitId: d.unitId,
|
|
1940
|
+
data: d.data
|
|
1940
1941
|
};
|
|
1941
|
-
return [
|
|
1942
|
-
}), [e, n, t]);
|
|
1943
|
-
return /* @__PURE__ */
|
|
1942
|
+
return [d.drawingId, v];
|
|
1943
|
+
}).filter(([d, a]) => !(a.position.endX < 0 || a.position.endY < 0 || a.position.startX > o || a.position.startY > s)), [e, n, t, o, s]);
|
|
1944
|
+
return /* @__PURE__ */ f("div", { style: { position: "absolute", top: 0, left: 0 }, children: c.map(([d, a]) => /* @__PURE__ */ f(yi, { layer: a, id: d, position: a.position }, d)) });
|
|
1944
1945
|
};
|
|
1945
1946
|
var Nr = Object.getOwnPropertyDescriptor, Er = (i, e, n, t) => {
|
|
1946
1947
|
for (var r = t > 1 ? void 0 : t ? Nr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
@@ -1992,14 +1993,15 @@ let gn = class extends Be {
|
|
|
1992
1993
|
return null;
|
|
1993
1994
|
}).filter(Boolean), c = Mi(Rr, this._injector);
|
|
1994
1995
|
return Fi(
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ f(
|
|
1996
1997
|
c,
|
|
1997
1998
|
{
|
|
1998
1999
|
unitId: t,
|
|
1999
2000
|
floatDomInfos: s,
|
|
2000
2001
|
scene: e.scene,
|
|
2001
2002
|
skeleton: e.skeleton,
|
|
2002
|
-
offset: e.offset
|
|
2003
|
+
offset: e.offset,
|
|
2004
|
+
bound: e.bound
|
|
2003
2005
|
}
|
|
2004
2006
|
),
|
|
2005
2007
|
e.root
|
|
@@ -2068,7 +2070,7 @@ let mn = class extends Be {
|
|
|
2068
2070
|
this._transformerCache.clear();
|
|
2069
2071
|
const { objects: s } = o;
|
|
2070
2072
|
for (const d of s.values()) {
|
|
2071
|
-
const { oKey: a, width: l, height: m, left: g, top:
|
|
2073
|
+
const { oKey: a, width: l, height: m, left: g, top: h, angle: u } = d, v = this._drawingManagerService.getDrawingOKey(a);
|
|
2072
2074
|
if (v == null)
|
|
2073
2075
|
continue;
|
|
2074
2076
|
const w = this._univerInstanceService.getUniverDocInstance(v.unitId), I = (c = w == null ? void 0 : w.getSnapshot().drawings) == null ? void 0 : c[v.drawingId];
|
|
@@ -2079,7 +2081,7 @@ let mn = class extends Be {
|
|
|
2079
2081
|
}
|
|
2080
2082
|
I != null && this._transformerCache.set(v.drawingId, {
|
|
2081
2083
|
drawing: I,
|
|
2082
|
-
top:
|
|
2084
|
+
top: h,
|
|
2083
2085
|
left: g,
|
|
2084
2086
|
width: l,
|
|
2085
2087
|
height: m,
|
|
@@ -2097,8 +2099,8 @@ let mn = class extends Be {
|
|
|
2097
2099
|
if (s.size > 1)
|
|
2098
2100
|
t(s);
|
|
2099
2101
|
else if (s.size === 1) {
|
|
2100
|
-
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top:
|
|
2101
|
-
if (a && m === a.width && g === a.height &&
|
|
2102
|
+
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top: h, left: u, angle: v } = l;
|
|
2103
|
+
if (a && m === a.width && g === a.height && h === a.top && u === a.left && v === a.angle)
|
|
2102
2104
|
return;
|
|
2103
2105
|
a && (a.drawing.layoutType, W.INLINE), a && a.drawing.layoutType === W.INLINE && c != null && d != null && this._updateInlineDrawingAnchor(a.drawing, c, d);
|
|
2104
2106
|
}
|
|
@@ -2123,8 +2125,8 @@ let mn = class extends Be {
|
|
|
2123
2125
|
if (this._anchorShape && this._anchorShape.hide(), s.size > 1)
|
|
2124
2126
|
this._updateMultipleDrawingDocTransform(s);
|
|
2125
2127
|
else if (s.size === 1) {
|
|
2126
|
-
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top:
|
|
2127
|
-
if (a && m === a.width && g === a.height &&
|
|
2128
|
+
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top: h, left: u, angle: v } = l;
|
|
2129
|
+
if (a && m === a.width && g === a.height && h === a.top && u === a.left && v === a.angle)
|
|
2128
2130
|
return;
|
|
2129
2131
|
a && a.drawing.layoutType === W.INLINE ? m !== a.width || g !== a.height || v !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
|
|
2130
2132
|
}
|
|
@@ -2146,10 +2148,10 @@ let mn = class extends Be {
|
|
|
2146
2148
|
if (g == null)
|
|
2147
2149
|
continue;
|
|
2148
2150
|
t == null && (t = g.unitId), r == null && (r = g.subUnitId);
|
|
2149
|
-
const
|
|
2150
|
-
if (
|
|
2151
|
+
const h = this._transformerCache.get(g.drawingId);
|
|
2152
|
+
if (h == null)
|
|
2151
2153
|
continue;
|
|
2152
|
-
const { drawing: u, top: v, left: w, width: I, height: O, angle: C } =
|
|
2154
|
+
const { drawing: u, top: v, left: w, width: I, height: O, angle: C } = h, { width: P, height: b } = this._getPageContentSize(u);
|
|
2153
2155
|
if (l = Math.min(l, P), m = Math.min(m, b), (I !== l || O !== m) && n.push({
|
|
2154
2156
|
drawingId: g.drawingId,
|
|
2155
2157
|
key: "size",
|
|
@@ -2210,7 +2212,7 @@ let mn = class extends Be {
|
|
|
2210
2212
|
pageMarginLeft: m,
|
|
2211
2213
|
pageMarginTop: g
|
|
2212
2214
|
} = d.getOffsetConfig();
|
|
2213
|
-
let
|
|
2215
|
+
let h = null, u = !1, v = -1, w = "";
|
|
2214
2216
|
const I = 0.5, O = this._getTransformCoordForDocumentOffset(d, a, n, t);
|
|
2215
2217
|
if (O == null)
|
|
2216
2218
|
return;
|
|
@@ -2224,11 +2226,11 @@ let mn = class extends Be {
|
|
|
2224
2226
|
});
|
|
2225
2227
|
if (P) {
|
|
2226
2228
|
const { node: S, ratioX: D, segmentPage: R, segmentId: T } = P;
|
|
2227
|
-
u = D < I,
|
|
2229
|
+
u = D < I, h = S, v = R, w = T;
|
|
2228
2230
|
}
|
|
2229
|
-
if (
|
|
2231
|
+
if (h == null)
|
|
2230
2232
|
return;
|
|
2231
|
-
const b = o == null ? void 0 : o.findPositionByGlyph(
|
|
2233
|
+
const b = o == null ? void 0 : o.findPositionByGlyph(h, v), y = this._getDocObject();
|
|
2232
2234
|
if (b == null || o == null || y == null || Qn(b))
|
|
2233
2235
|
return;
|
|
2234
2236
|
const E = {
|
|
@@ -2244,7 +2246,7 @@ let mn = class extends Be {
|
|
|
2244
2246
|
const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(ie).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
|
|
2245
2247
|
if (o == null || t == null)
|
|
2246
2248
|
return;
|
|
2247
|
-
const { pages: s, skeHeaders: c, skeFooters: d } = o, { mainComponent: a, scene: l } = t, m = a, g = l.getViewports()[0], { pageLayoutType:
|
|
2249
|
+
const { pages: s, skeHeaders: c, skeFooters: d } = o, { mainComponent: a, scene: l } = t, m = a, g = l.getViewports()[0], { pageLayoutType: h = kn.VERTICAL, pageMarginLeft: u, pageMarginTop: v, docsLeft: w, docsTop: I } = m.getOffsetConfig(), { left: O, top: C, angle: P } = n;
|
|
2248
2250
|
let { width: b, height: y } = n;
|
|
2249
2251
|
const { positionV: E, positionH: B } = e.docTransform, { width: N, height: _ } = this._getPageContentSize(e);
|
|
2250
2252
|
b = Math.min(b, N), y = Math.min(y, _);
|
|
@@ -2262,7 +2264,7 @@ let mn = class extends Be {
|
|
|
2262
2264
|
const U = (De = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : De.with(Re);
|
|
2263
2265
|
if (U == null)
|
|
2264
2266
|
return;
|
|
2265
|
-
const F = r == null ? void 0 : r.findNodeByCoord(T,
|
|
2267
|
+
const F = r == null ? void 0 : r.findNodeByCoord(T, h, u, v, {
|
|
2266
2268
|
strict: !1,
|
|
2267
2269
|
segmentId: U.getSegment(),
|
|
2268
2270
|
segmentPage: U.getSegmentPage()
|
|
@@ -2309,7 +2311,7 @@ let mn = class extends Be {
|
|
|
2309
2311
|
}
|
|
2310
2312
|
if (this._liquid.translatePagePadding(ve), ve === k)
|
|
2311
2313
|
break;
|
|
2312
|
-
this._liquid.restorePagePadding(ve), this._liquid.translatePage(ve,
|
|
2314
|
+
this._liquid.restorePagePadding(ve), this._liquid.translatePage(ve, h, u, v);
|
|
2313
2315
|
}
|
|
2314
2316
|
switch (E.relativeFrom === H.LINE ? L = M.divides[0].glyphGroup[0] : L = (me = (ge = (ye = (Ae = z.divides) == null ? void 0 : Ae[0]) == null ? void 0 : ye.glyphGroup) == null ? void 0 : ge[0]) != null ? me : L, S.positionH = {
|
|
2315
2317
|
relativeFrom: B.relativeFrom,
|
|
@@ -2357,8 +2359,8 @@ let mn = class extends Be {
|
|
|
2357
2359
|
_updateDrawingSize(e, n) {
|
|
2358
2360
|
const t = [], { drawing: r, width: o, height: s, angle: c } = e, { unitId: d, subUnitId: a } = r;
|
|
2359
2361
|
let { width: l, height: m, angle: g } = n;
|
|
2360
|
-
const { width:
|
|
2361
|
-
l = Math.min(
|
|
2362
|
+
const { width: h, height: u } = this._getPageContentSize(r);
|
|
2363
|
+
l = Math.min(h, l), m = Math.min(u, m), (l !== o || m !== s) && t.push({
|
|
2362
2364
|
drawingId: r.drawingId,
|
|
2363
2365
|
key: "size",
|
|
2364
2366
|
value: {
|
|
@@ -2400,7 +2402,7 @@ let mn = class extends Be {
|
|
|
2400
2402
|
height: c,
|
|
2401
2403
|
angle: d
|
|
2402
2404
|
};
|
|
2403
|
-
const { mainComponent: g } = t,
|
|
2405
|
+
const { mainComponent: g } = t, h = g, { top: u, pageLayoutType: v, pageMarginLeft: w, pageMarginTop: I } = h;
|
|
2404
2406
|
let O = o;
|
|
2405
2407
|
this._liquid.reset();
|
|
2406
2408
|
for (const C of m) {
|
|
@@ -2462,13 +2464,13 @@ let mn = class extends Be {
|
|
|
2462
2464
|
const { mainComponent: r, scene: o } = t, s = r, {
|
|
2463
2465
|
docsLeft: c,
|
|
2464
2466
|
docsTop: d
|
|
2465
|
-
} = s.getOffsetConfig(), a = Ei(n), { left: l, top: m, height: g } = a,
|
|
2467
|
+
} = s.getOffsetConfig(), a = Ei(n), { left: l, top: m, height: g } = a, h = l + c, u = m + d;
|
|
2466
2468
|
if (this._anchorShape) {
|
|
2467
|
-
this._anchorShape.transformByState({ left:
|
|
2469
|
+
this._anchorShape.transformByState({ left: h, top: u, height: g }), this._anchorShape.show();
|
|
2468
2470
|
return;
|
|
2469
2471
|
}
|
|
2470
2472
|
const v = 6, w = new wi(Lr + be.generateRandomId(v), {
|
|
2471
|
-
left:
|
|
2473
|
+
left: h,
|
|
2472
2474
|
top: u,
|
|
2473
2475
|
height: g,
|
|
2474
2476
|
strokeWidth: 2,
|
|
@@ -2497,9 +2499,9 @@ let mn = class extends Be {
|
|
|
2497
2499
|
}
|
|
2498
2500
|
}
|
|
2499
2501
|
if (d) {
|
|
2500
|
-
const { pageWidth: a, pageHeight: l, marginLeft: m, marginBottom: g, marginRight:
|
|
2502
|
+
const { pageWidth: a, pageHeight: l, marginLeft: m, marginBottom: g, marginRight: h, marginTop: u } = d;
|
|
2501
2503
|
return {
|
|
2502
|
-
width: Math.max(r, a - m -
|
|
2504
|
+
width: Math.max(r, a - m - h),
|
|
2503
2505
|
height: Math.max(o, l - u - g)
|
|
2504
2506
|
};
|
|
2505
2507
|
} else
|
|
@@ -2570,14 +2572,14 @@ let un = class extends Yt {
|
|
|
2570
2572
|
const d = c.oKey, a = this._drawingManagerService.getDrawingOKey(d);
|
|
2571
2573
|
if (!a || a.drawingType === Ue.DRAWING_DOM)
|
|
2572
2574
|
return;
|
|
2573
|
-
const { unitId: l, subUnitId: m, drawingId: g, drawingType:
|
|
2575
|
+
const { unitId: l, subUnitId: m, drawingId: g, drawingType: h } = a, u = this._canvasPopManagerService.attachPopupToObject(
|
|
2574
2576
|
c,
|
|
2575
2577
|
{
|
|
2576
2578
|
componentKey: gi,
|
|
2577
2579
|
direction: "horizontal",
|
|
2578
2580
|
offset: [2, 0],
|
|
2579
2581
|
extraProps: {
|
|
2580
|
-
menuItems: this._getImageMenuItems(l, m, g,
|
|
2582
|
+
menuItems: this._getImageMenuItems(l, m, g, h)
|
|
2581
2583
|
}
|
|
2582
2584
|
},
|
|
2583
2585
|
l
|
|
@@ -2710,7 +2712,7 @@ let Cn = class extends Be {
|
|
|
2710
2712
|
const n = e == null ? void 0 : e.getSkeletonData(), { mainComponent: t, unitId: r } = this._context, o = t;
|
|
2711
2713
|
if (!n)
|
|
2712
2714
|
return;
|
|
2713
|
-
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters:
|
|
2715
|
+
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters: h } = n, u = {};
|
|
2714
2716
|
this._liquid.reset();
|
|
2715
2717
|
for (let P = 0, b = m.length; P < b; P++) {
|
|
2716
2718
|
const y = m[P], { headerId: E, footerId: B, pageWidth: N } = y;
|
|
@@ -2727,7 +2729,7 @@ let Cn = class extends Be {
|
|
|
2727
2729
|
);
|
|
2728
2730
|
}
|
|
2729
2731
|
if (B) {
|
|
2730
|
-
const _ = (C =
|
|
2732
|
+
const _ = (C = h.get(B)) == null ? void 0 : C.get(N);
|
|
2731
2733
|
_ && this._calculateDrawingPosition(
|
|
2732
2734
|
r,
|
|
2733
2735
|
_,
|
|
@@ -2762,10 +2764,10 @@ let Cn = class extends Be {
|
|
|
2762
2764
|
marginTop: s,
|
|
2763
2765
|
marginLeft: c
|
|
2764
2766
|
}), d.forEach((a) => {
|
|
2765
|
-
const { aLeft: l, aTop: m, height: g, width:
|
|
2767
|
+
const { aLeft: l, aTop: m, height: g, width: h, angle: u, drawingId: v, drawingOrigin: w } = a, I = w.layoutType === W.WRAP_NONE && w.behindDoc === ae.TRUE, { isMultiTransform: O = ae.FALSE } = w, C = {
|
|
2766
2768
|
left: l + t + this._liquid.x,
|
|
2767
2769
|
top: m + r + this._liquid.y,
|
|
2768
|
-
width:
|
|
2770
|
+
width: h,
|
|
2769
2771
|
height: g,
|
|
2770
2772
|
angle: u
|
|
2771
2773
|
};
|