@univerjs/docs-drawing-ui 0.6.0-nightly.202502191606 → 0.6.0-nightly.202502201606
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 +625 -625
- package/lib/umd/index.js +1 -1
- package/package.json +14 -14
package/lib/es/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ce = (i, e, n) =>
|
|
4
|
-
import { Disposable as Xe, UndoCommand as
|
|
5
|
-
import { IDocDrawingService as Be, UniverDocsDrawingPlugin as
|
|
6
|
-
import { IDrawingManagerService as Ie, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as
|
|
7
|
-
import { DrawingCommonPanel as
|
|
8
|
-
import { IRenderManagerService as ee, DocumentEditArea as
|
|
9
|
-
import { IMessageService as
|
|
1
|
+
var Ct = Object.defineProperty;
|
|
2
|
+
var Dt = (i, e, n) => e in i ? Ct(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
|
+
var Ce = (i, e, n) => Dt(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Disposable as Xe, UndoCommand as Ot, RedoCommand as Tt, JSONX as q, IUniverInstanceService as Q, ICommandService as z, PositionedObjectLayoutType as H, CommandType as K, BooleanNumber as oe, ObjectRelativeFromH as ne, ObjectRelativeFromV as V, Tools as Pe, TextX as vn, TextXActionType as Z, toDisposable as Le, throttle as On, COLORS as yt, MemoryCursor as Pt, IUndoRedoService as Gn, BuildTextUtils as bt, ArrangeTypeEnum as Ze, Inject as ve, IContextService as Vn, LocaleService as ln, WrapTextType as $e, DrawingTypeEnum as Mt, FOCUSING_COMMON_DRAWINGS as tn, UniverInstanceType as be, Direction as fe, DocumentFlavor as fn, FOCUSING_UNIVER_EDITOR as Rt, RxDisposable as Nt, SHEET_EDITOR_UNITS as At, LifecycleService as Et, DOCS_ZEN_EDITOR_UNIT_ID_KEY as xt, fromEventSubject as Lt, LifecycleStages as Tn, DependentOn as Bt, Injector as Ut, IConfigService as kt, Plugin as Ft, merge as Ht } from "@univerjs/core";
|
|
5
|
+
import { IDocDrawingService as Be, UniverDocsDrawingPlugin as Wt } from "@univerjs/docs-drawing";
|
|
6
|
+
import { IDrawingManagerService as Ie, IImageIoService as Gt, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Vt, DRAWING_IMAGE_COUNT_LIMIT as yn, ImageUploadStatusType as hn, DRAWING_IMAGE_ALLOW_SIZE as jt, getImageSize as $t, getDrawingShapeKeyByDrawingSearch as zt, DRAWING_IMAGE_WIDTH_LIMIT as Pn, DRAWING_IMAGE_HEIGHT_LIMIT as bn, UniverDrawingPlugin as qt } from "@univerjs/drawing";
|
|
7
|
+
import { DrawingCommonPanel as Xt, ImageCropperObject as Kt, COMPONENT_IMAGE_POPUP_MENU as Yt, OpenImageCropOperation as Zt, ImageResetSizeOperation as Qt, UniverDrawingUIPlugin as Jt } from "@univerjs/drawing-ui";
|
|
8
|
+
import { IRenderManagerService as ee, DocumentEditArea as Fe, Liquid as jn, PageLayoutType as Mn, DocumentSkeletonPageType as Rn, Vector2 as ei, Rect as ni, getColor as ti, TRANSFORM_CHANGE_OBSERVABLE_TYPE as ii } from "@univerjs/engine-render";
|
|
9
|
+
import { IMessageService as ri, ILocalFileService as oi, ISidebarService as si, useDependency as we, getMenuHiddenObservable as $n, MenuItemType as zn, RibbonStartGroup as ai, KeyCode as He, ComponentManager as ci, IMenuManagerService as di, IShortcutService as li, UniverUIPlugin as gi } from "@univerjs/ui";
|
|
10
10
|
import { RichTextEditingMutation as J, DocSkeletonManagerService as se, DocSelectionManagerService as In } from "@univerjs/docs";
|
|
11
|
-
import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as An, getAnchorBounding as
|
|
12
|
-
import { BehaviorSubject as
|
|
13
|
-
import { MessageType as Ln, InputNumber as
|
|
11
|
+
import { DocSelectionRenderService as Me, getRichTextEditPath as ze, NodePositionConvertToCursor as Nn, getOneTextSelectionRange as An, getAnchorBounding as mi, TEXT_RANGE_LAYER_INDEX as ui, getDocObject as fi, getCustomBlockIdsInSelections as hi, docDrawingPositionToTransform as pi, DocCanvasPopManagerService as wi, IEditorService as vi, SetDocZoomRatioOperation as Ii } from "@univerjs/docs-ui";
|
|
12
|
+
import { BehaviorSubject as _i, debounceTime as qn, Observable as Si, takeUntil as En, filter as xn } from "rxjs";
|
|
13
|
+
import { MessageType as Ln, InputNumber as ke, Select as Bn, Checkbox as Ci, RadioGroup as Un, Radio as ye } from "@univerjs/design";
|
|
14
14
|
import { jsxs as X, jsx as f } from "react/jsx-runtime";
|
|
15
|
-
import { forwardRef as Xn, useRef as
|
|
16
|
-
const
|
|
17
|
-
var Ti = Object.
|
|
18
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
19
|
-
(s = i[o]) && (r =
|
|
20
|
-
return
|
|
15
|
+
import { forwardRef as Xn, useRef as Di, createElement as Kn, useState as re, useEffect as _n } from "react";
|
|
16
|
+
const Oi = "docs-drawing-ui.config", kn = {};
|
|
17
|
+
var Ti = Object.getOwnPropertyDescriptor, yi = (i, e, n, t) => {
|
|
18
|
+
for (var r = t > 1 ? void 0 : t ? Ti(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
19
|
+
(s = i[o]) && (r = s(r) || r);
|
|
20
|
+
return r;
|
|
21
21
|
}, Ve = (i, e) => (n, t) => e(n, t, i);
|
|
22
|
-
function
|
|
22
|
+
function Pi(i) {
|
|
23
23
|
var t, r, o, s;
|
|
24
24
|
if (q.isNoop(i) || !Array.isArray(i))
|
|
25
25
|
return null;
|
|
26
|
-
const e = i.find((
|
|
26
|
+
const e = i.find((a) => Array.isArray(a) && (a == null ? void 0 : a[0]) === "drawings");
|
|
27
27
|
if (e == null || !Array.isArray(e) || e.length < 3 || typeof e[1] == "string" && typeof e[2] != "object" || Array.isArray(e[1]) && typeof e[1][1] != "object")
|
|
28
28
|
return null;
|
|
29
29
|
const n = [];
|
|
30
30
|
if (Array.isArray(e == null ? void 0 : e[1]))
|
|
31
|
-
for (const
|
|
32
|
-
Array.isArray(
|
|
33
|
-
type: (t =
|
|
34
|
-
drawingId:
|
|
35
|
-
drawing: (r =
|
|
31
|
+
for (const a of e)
|
|
32
|
+
Array.isArray(a) && n.push({
|
|
33
|
+
type: (t = a == null ? void 0 : a[1]) != null && t.i ? "add" : "remove",
|
|
34
|
+
drawingId: a == null ? void 0 : a[0],
|
|
35
|
+
drawing: (r = a == null ? void 0 : a[1]) == null ? void 0 : r.i
|
|
36
36
|
});
|
|
37
37
|
else
|
|
38
38
|
n.push({
|
|
@@ -42,7 +42,7 @@ function Mi(i) {
|
|
|
42
42
|
});
|
|
43
43
|
return n;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function bi(i) {
|
|
46
46
|
if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
|
|
47
47
|
return [];
|
|
48
48
|
const e = [];
|
|
@@ -69,22 +69,22 @@ let rn = class extends Xe {
|
|
|
69
69
|
this._commandService.beforeCommandExecuted((i) => {
|
|
70
70
|
if (i.id !== J.id)
|
|
71
71
|
return;
|
|
72
|
-
const e = i.params, { unitId: n, actions: t } = e, r =
|
|
72
|
+
const e = i.params, { unitId: n, actions: t } = e, r = Pi(t);
|
|
73
73
|
if (r != null)
|
|
74
|
-
for (const { type: o, drawingId: s, drawing:
|
|
75
|
-
o === "add" ? this._addDrawings(n, [
|
|
74
|
+
for (const { type: o, drawingId: s, drawing: a } of r)
|
|
75
|
+
o === "add" ? this._addDrawings(n, [a]) : this._removeDrawings(n, [s]);
|
|
76
76
|
})
|
|
77
77
|
), this.disposeWithMe(
|
|
78
78
|
this._commandService.onCommandExecuted((i) => {
|
|
79
79
|
if (i.id !== J.id)
|
|
80
80
|
return;
|
|
81
81
|
const e = i.params, { unitId: n, actions: t } = e;
|
|
82
|
-
|
|
82
|
+
bi(t).length > 0 && this._updateDrawingsOrder(n);
|
|
83
83
|
})
|
|
84
84
|
), this.disposeWithMe(
|
|
85
85
|
this._commandService.onCommandExecuted((i) => {
|
|
86
86
|
var s;
|
|
87
|
-
if (i.id !==
|
|
87
|
+
if (i.id !== Ot.id && i.id !== Tt.id)
|
|
88
88
|
return;
|
|
89
89
|
const e = (s = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : s.getUnitId(), n = this._drawingManagerService.getFocusDrawings();
|
|
90
90
|
if (e == null || n.length === 0)
|
|
@@ -97,16 +97,16 @@ let rn = class extends Xe {
|
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
_addDrawings(i, e) {
|
|
100
|
-
const n = this._drawingManagerService, t = this._docDrawingService, r = this._docDrawingService.getBatchAddOp(e), { subUnitId: o, redo: s, objects:
|
|
101
|
-
n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.addNotification(
|
|
100
|
+
const n = this._drawingManagerService, t = this._docDrawingService, r = this._docDrawingService.getBatchAddOp(e), { subUnitId: o, redo: s, objects: a } = r;
|
|
101
|
+
n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.addNotification(a), t.addNotification(a);
|
|
102
102
|
}
|
|
103
103
|
_removeDrawings(i, e) {
|
|
104
104
|
const n = this._drawingManagerService, t = this._docDrawingService, r = this._docDrawingService.getBatchRemoveOp(e.map((d) => ({
|
|
105
105
|
unitId: i,
|
|
106
106
|
subUnitId: i,
|
|
107
107
|
drawingId: d
|
|
108
|
-
}))), { subUnitId: o, redo: s, objects:
|
|
109
|
-
n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.removeNotification(
|
|
108
|
+
}))), { subUnitId: o, redo: s, objects: a } = r;
|
|
109
|
+
n.applyJson1(i, o, s), t.applyJson1(i, o, s), n.removeNotification(a), t.removeNotification(a);
|
|
110
110
|
}
|
|
111
111
|
_updateDrawingsOrder(i) {
|
|
112
112
|
const e = this._univerInstanceService.getUniverDocInstance(i);
|
|
@@ -134,7 +134,7 @@ rn = yi([
|
|
|
134
134
|
], rn);
|
|
135
135
|
class gn {
|
|
136
136
|
constructor() {
|
|
137
|
-
Ce(this, "_refreshDrawings$", new
|
|
137
|
+
Ce(this, "_refreshDrawings$", new _i(null));
|
|
138
138
|
Ce(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
|
|
139
139
|
}
|
|
140
140
|
refreshDrawings(e) {
|
|
@@ -142,7 +142,7 @@ class gn {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
var ue = /* @__PURE__ */ ((i) => (i.INLINE = "inline", i.BEHIND_TEXT = "behindText", i.IN_FRONT_OF_TEXT = "inFrontOfText", i.WRAP_SQUARE = "wrapSquare", i.WRAP_TOP_AND_BOTTOM = "wrapTopAndBottom", i))(ue || {});
|
|
145
|
-
const
|
|
145
|
+
const Mi = {
|
|
146
146
|
inline: H.INLINE,
|
|
147
147
|
wrapSquare: H.WRAP_SQUARE,
|
|
148
148
|
wrapTopAndBottom: H.WRAP_TOP_AND_BOTTOM,
|
|
@@ -151,16 +151,16 @@ const Ni = {
|
|
|
151
151
|
};
|
|
152
152
|
function Yn(i, e, n, t, r, o, s) {
|
|
153
153
|
var p, h;
|
|
154
|
-
const
|
|
155
|
-
if (l == null ||
|
|
154
|
+
const a = new vn(), d = q.getInstance(), c = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
155
|
+
if (l == null || m == null)
|
|
156
156
|
return;
|
|
157
157
|
const g = (h = (p = l.customBlocks) == null ? void 0 : p.find((v) => v.blockId === r)) == null ? void 0 : h.startIndex;
|
|
158
158
|
if (g != null) {
|
|
159
|
-
if (t = Math.min(
|
|
160
|
-
if (t < g ? (t > 0 &&
|
|
159
|
+
if (t = Math.min(m.dataStream.length - 2, t), i === e) {
|
|
160
|
+
if (t < g ? (t > 0 && a.push({
|
|
161
161
|
t: Z.RETAIN,
|
|
162
162
|
len: t
|
|
163
|
-
}),
|
|
163
|
+
}), a.push({
|
|
164
164
|
t: Z.INSERT,
|
|
165
165
|
body: {
|
|
166
166
|
dataStream: "\b",
|
|
@@ -170,22 +170,22 @@ function Yn(i, e, n, t, r, o, s) {
|
|
|
170
170
|
}]
|
|
171
171
|
},
|
|
172
172
|
len: 1
|
|
173
|
-
}),
|
|
173
|
+
}), a.push({
|
|
174
174
|
t: Z.RETAIN,
|
|
175
175
|
len: g - t
|
|
176
|
-
}),
|
|
176
|
+
}), a.push({
|
|
177
177
|
t: Z.DELETE,
|
|
178
178
|
len: 1
|
|
179
|
-
})) : (g > 0 &&
|
|
179
|
+
})) : (g > 0 && a.push({
|
|
180
180
|
t: Z.RETAIN,
|
|
181
181
|
len: g
|
|
182
|
-
}),
|
|
182
|
+
}), a.push({
|
|
183
183
|
t: Z.DELETE,
|
|
184
184
|
len: 1
|
|
185
|
-
}), t - g - 1 > 0 &&
|
|
185
|
+
}), t - g - 1 > 0 && a.push({
|
|
186
186
|
t: Z.RETAIN,
|
|
187
187
|
len: t - g - 1
|
|
188
|
-
}),
|
|
188
|
+
}), a.push({
|
|
189
189
|
t: Z.INSERT,
|
|
190
190
|
body: {
|
|
191
191
|
dataStream: "\b",
|
|
@@ -196,22 +196,22 @@ function Yn(i, e, n, t, r, o, s) {
|
|
|
196
196
|
},
|
|
197
197
|
len: 1
|
|
198
198
|
})), t !== g) {
|
|
199
|
-
const v = ze(o, e), w = d.editOp(
|
|
200
|
-
|
|
199
|
+
const v = ze(o, e), w = d.editOp(a.serialize(), v);
|
|
200
|
+
c.push(w);
|
|
201
201
|
}
|
|
202
202
|
} else {
|
|
203
|
-
g > 0 &&
|
|
203
|
+
g > 0 && a.push({
|
|
204
204
|
t: Z.RETAIN,
|
|
205
205
|
len: g
|
|
206
|
-
}),
|
|
206
|
+
}), a.push({
|
|
207
207
|
t: Z.DELETE,
|
|
208
208
|
len: 1
|
|
209
209
|
});
|
|
210
|
-
let v = ze(o, e), w = d.editOp(
|
|
211
|
-
|
|
210
|
+
let v = ze(o, e), w = d.editOp(a.serialize(), v);
|
|
211
|
+
c.push(w), a.empty(), t > 0 && a.push({
|
|
212
212
|
t: Z.RETAIN,
|
|
213
213
|
len: t
|
|
214
|
-
}),
|
|
214
|
+
}), a.push({
|
|
215
215
|
t: Z.INSERT,
|
|
216
216
|
body: {
|
|
217
217
|
dataStream: "\b",
|
|
@@ -221,9 +221,9 @@ function Yn(i, e, n, t, r, o, s) {
|
|
|
221
221
|
}]
|
|
222
222
|
},
|
|
223
223
|
len: 1
|
|
224
|
-
}), v = ze(o, i), w = d.editOp(
|
|
224
|
+
}), v = ze(o, i), w = d.editOp(a.serialize(), v), c.push(w), s.setSegment(i), s.setSegmentPage(n);
|
|
225
225
|
}
|
|
226
|
-
return
|
|
226
|
+
return c;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
const Zn = {
|
|
@@ -234,41 +234,41 @@ const Zn = {
|
|
|
234
234
|
var A, U;
|
|
235
235
|
if (e == null)
|
|
236
236
|
return !1;
|
|
237
|
-
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get(z), s = i.get(Q), d = i.get(ee).getRenderById(r),
|
|
238
|
-
if (g == null ||
|
|
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();
|
|
238
|
+
if (g == null || c == null || m == null || l == null)
|
|
239
239
|
return !1;
|
|
240
|
-
const p = l.getEditArea(), h =
|
|
240
|
+
const p = l.getEditArea(), h = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: S } = c, O = q.getInstance(), D = [], { drawings: T = {} } = g.getSnapshot();
|
|
241
241
|
for (const N of n) {
|
|
242
|
-
const { drawingId: I } = N, L =
|
|
242
|
+
const { drawingId: I } = N, L = T[I].layoutType, W = Mi[t];
|
|
243
243
|
if (L !== W) {
|
|
244
244
|
const C = O.replaceOp(["drawings", I, "layoutType"], L, W);
|
|
245
245
|
D.push(C);
|
|
246
246
|
}
|
|
247
247
|
if (t === "behindText" || t === "inFrontOfText") {
|
|
248
|
-
const C =
|
|
248
|
+
const C = T[I].behindDoc, R = t === "behindText" ? oe.TRUE : oe.FALSE;
|
|
249
249
|
if (C !== R) {
|
|
250
|
-
const
|
|
251
|
-
D.push(
|
|
250
|
+
const y = O.replaceOp(["drawings", I, "behindDoc"], C, R);
|
|
251
|
+
D.push(y);
|
|
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: y, marginTop: B, marginLeft: k, marginBottom: b, pageWidth: E, pageHeight: $ } = C;
|
|
259
259
|
switch (p) {
|
|
260
|
-
case
|
|
261
|
-
const
|
|
262
|
-
|
|
260
|
+
case Fe.HEADER: {
|
|
261
|
+
const F = (A = w.get(R)) == null ? void 0 : A.get(E);
|
|
262
|
+
F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = F.marginTop, _ = k);
|
|
263
263
|
break;
|
|
264
264
|
}
|
|
265
|
-
case
|
|
266
|
-
const
|
|
267
|
-
|
|
265
|
+
case Fe.FOOTER: {
|
|
266
|
+
const F = (U = S.get(y)) == null ? void 0 : U.get(E);
|
|
267
|
+
F != null && F.skeDrawings.has(I) && (x = F.skeDrawings.get(I), G = $ - b + F.marginTop, _ = k);
|
|
268
268
|
break;
|
|
269
269
|
}
|
|
270
|
-
case
|
|
271
|
-
C.skeDrawings.has(I) && (x = C.skeDrawings.get(I), G = B, _ =
|
|
270
|
+
case Fe.BODY: {
|
|
271
|
+
C.skeDrawings.has(I) && (x = C.skeDrawings.get(I), G = B, _ = k);
|
|
272
272
|
break;
|
|
273
273
|
}
|
|
274
274
|
}
|
|
@@ -276,27 +276,27 @@ const Zn = {
|
|
|
276
276
|
break;
|
|
277
277
|
}
|
|
278
278
|
if (x != null) {
|
|
279
|
-
const { aTop: C, aLeft: R } = x,
|
|
279
|
+
const { aTop: C, aLeft: R } = x, y = T[I].docTransform.positionH;
|
|
280
280
|
let B = R;
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
relativeFrom:
|
|
281
|
+
y.relativeFrom === ne.MARGIN ? B -= _ : y.relativeFrom === ne.COLUMN && (B -= x.columnLeft);
|
|
282
|
+
const k = {
|
|
283
|
+
relativeFrom: y.relativeFrom,
|
|
284
284
|
posOffset: B
|
|
285
285
|
};
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
D.push(
|
|
286
|
+
if (y.posOffset !== k.posOffset) {
|
|
287
|
+
const F = O.replaceOp(["drawings", I, "docTransform", "positionH"], y, k);
|
|
288
|
+
D.push(F);
|
|
289
289
|
}
|
|
290
|
-
const
|
|
290
|
+
const b = T[I].docTransform.positionV;
|
|
291
291
|
let E = C;
|
|
292
|
-
|
|
292
|
+
b.relativeFrom === V.PAGE ? E += G : b.relativeFrom === V.LINE ? E -= x.lineTop : b.relativeFrom === V.PARAGRAPH && (E -= x.blockAnchorTop);
|
|
293
293
|
const $ = {
|
|
294
|
-
relativeFrom:
|
|
294
|
+
relativeFrom: b.relativeFrom,
|
|
295
295
|
posOffset: E
|
|
296
296
|
};
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
D.push(
|
|
297
|
+
if (b.posOffset !== $.posOffset) {
|
|
298
|
+
const F = O.replaceOp(["drawings", I, "docTransform", "positionV"], b, $);
|
|
299
|
+
D.push(F);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
@@ -309,8 +309,8 @@ const Zn = {
|
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
M.params.actions = D.reduce((N, I) => q.compose(N, I), null);
|
|
312
|
-
const
|
|
313
|
-
return h.refreshControls(), !!
|
|
312
|
+
const P = o.syncExecuteCommand(M.id, M.params);
|
|
313
|
+
return h.refreshControls(), !!P;
|
|
314
314
|
}
|
|
315
315
|
}, Qn = {
|
|
316
316
|
id: "doc.command.update-doc-drawing-distance",
|
|
@@ -321,26 +321,26 @@ const Zn = {
|
|
|
321
321
|
const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
|
|
322
322
|
if (r == null)
|
|
323
323
|
return !1;
|
|
324
|
-
const { drawings: o, dist: s, unitId:
|
|
324
|
+
const { drawings: o, dist: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
|
|
325
325
|
for (const p of o) {
|
|
326
326
|
const { drawingId: h } = p;
|
|
327
327
|
for (const [v, w] of Object.entries(s)) {
|
|
328
328
|
const S = l[h][v];
|
|
329
329
|
if (S !== w) {
|
|
330
330
|
const O = d.replaceOp(["drawings", h, v], S, w);
|
|
331
|
-
|
|
331
|
+
c.push(O);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
const
|
|
335
|
+
const m = {
|
|
336
336
|
id: J.id,
|
|
337
337
|
params: {
|
|
338
|
-
unitId:
|
|
338
|
+
unitId: a,
|
|
339
339
|
actions: [],
|
|
340
340
|
textRanges: null
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
-
return
|
|
343
|
+
return m.params.actions = c.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(m.id, m.params);
|
|
344
344
|
}
|
|
345
345
|
}, Jn = {
|
|
346
346
|
id: "doc.command.update-doc-drawing-wrap-text",
|
|
@@ -351,23 +351,23 @@ const Zn = {
|
|
|
351
351
|
const n = i.get(z), r = i.get(Q).getCurrentUniverDocInstance();
|
|
352
352
|
if (r == null)
|
|
353
353
|
return !1;
|
|
354
|
-
const { drawings: o, wrapText: s, unitId:
|
|
354
|
+
const { drawings: o, wrapText: s, unitId: a } = e, d = q.getInstance(), c = [], { drawings: l = {} } = r.getSnapshot();
|
|
355
355
|
for (const p of o) {
|
|
356
356
|
const { drawingId: h } = p, v = l[h].wrapText;
|
|
357
357
|
if (v !== s) {
|
|
358
358
|
const w = d.replaceOp(["drawings", h, "wrapText"], v, s);
|
|
359
|
-
|
|
359
|
+
c.push(w);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const m = {
|
|
363
363
|
id: J.id,
|
|
364
364
|
params: {
|
|
365
|
-
unitId:
|
|
365
|
+
unitId: a,
|
|
366
366
|
actions: [],
|
|
367
367
|
textRanges: null
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
|
-
return
|
|
370
|
+
return m.params.actions = c.reduce((p, h) => q.compose(p, h), null), !!n.syncExecuteCommand(m.id, m.params);
|
|
371
371
|
}
|
|
372
372
|
}, qe = {
|
|
373
373
|
id: "doc.command.update-drawing-doc-transform",
|
|
@@ -378,14 +378,14 @@ const Zn = {
|
|
|
378
378
|
const n = i.get(z), t = i.get(Q), o = i.get(ee).getRenderById(e.unitId), s = o == null ? void 0 : o.scene;
|
|
379
379
|
if (s == null)
|
|
380
380
|
return !1;
|
|
381
|
-
const
|
|
381
|
+
const a = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
|
|
382
382
|
if (d == null)
|
|
383
383
|
return !1;
|
|
384
|
-
const { drawings:
|
|
385
|
-
for (const w of
|
|
386
|
-
const { drawingId: S, key: O, value: D } = w,
|
|
387
|
-
if (!
|
|
388
|
-
const M =
|
|
384
|
+
const { drawings: c, unitId: l } = e, m = q.getInstance(), g = [], { drawings: p = {} } = d.getSnapshot();
|
|
385
|
+
for (const w of c) {
|
|
386
|
+
const { drawingId: S, key: O, value: D } = w, T = p[S].docTransform[O];
|
|
387
|
+
if (!Pe.diffValue(T, D)) {
|
|
388
|
+
const M = m.replaceOp(["drawings", S, "docTransform", O], T, D);
|
|
389
389
|
g.push(M);
|
|
390
390
|
}
|
|
391
391
|
}
|
|
@@ -400,7 +400,7 @@ const Zn = {
|
|
|
400
400
|
};
|
|
401
401
|
h.params.actions = g.reduce((w, S) => q.compose(w, S), null);
|
|
402
402
|
const v = n.syncExecuteCommand(h.id, h.params);
|
|
403
|
-
return
|
|
403
|
+
return a.refreshControls(), !!v;
|
|
404
404
|
}
|
|
405
405
|
}, et = {
|
|
406
406
|
id: "doc.command.move-inline-drawing",
|
|
@@ -409,28 +409,28 @@ const Zn = {
|
|
|
409
409
|
var U, N;
|
|
410
410
|
if (e == null)
|
|
411
411
|
return !1;
|
|
412
|
-
const n = i.get(ee), t = (U = n.getRenderById(e.unitId)) == null ? void 0 : U.with(Me), r = i.get(gn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene,
|
|
412
|
+
const n = i.get(ee), t = (U = n.getRenderById(e.unitId)) == null ? void 0 : U.with(Me), r = i.get(gn), o = n.getRenderById(e.unitId), s = o == null ? void 0 : o.scene, a = o == null ? void 0 : o.with(se).getSkeleton();
|
|
413
413
|
if (s == null || t == null)
|
|
414
414
|
return !1;
|
|
415
|
-
const d = s.getTransformerByCreate(),
|
|
416
|
-
if (
|
|
415
|
+
const d = s.getTransformerByCreate(), c = i.get(z), m = i.get(Q).getCurrentUniverDocInstance();
|
|
416
|
+
if (m == null)
|
|
417
417
|
return !1;
|
|
418
418
|
const { drawing: g, unitId: p, offset: h, segmentId: v, segmentPage: w, needRefreshDrawings: S } = e;
|
|
419
419
|
if (S)
|
|
420
|
-
return r.refreshDrawings(
|
|
421
|
-
const O = [], { drawingId: D } = g,
|
|
420
|
+
return r.refreshDrawings(a), d.refreshControls(), !0;
|
|
421
|
+
const O = [], { drawingId: D } = g, T = (N = t.getSegment()) != null ? N : "", M = Yn(
|
|
422
422
|
v,
|
|
423
|
-
|
|
423
|
+
T,
|
|
424
424
|
w,
|
|
425
425
|
h,
|
|
426
426
|
D,
|
|
427
|
-
|
|
427
|
+
m,
|
|
428
428
|
t
|
|
429
429
|
);
|
|
430
430
|
if (M == null || M.length === 0)
|
|
431
|
-
return r.refreshDrawings(
|
|
431
|
+
return r.refreshDrawings(a), d.refreshControls(), !1;
|
|
432
432
|
O.push(...M);
|
|
433
|
-
const
|
|
433
|
+
const P = {
|
|
434
434
|
id: J.id,
|
|
435
435
|
params: {
|
|
436
436
|
unitId: p,
|
|
@@ -438,8 +438,8 @@ const Zn = {
|
|
|
438
438
|
textRanges: null
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
|
-
|
|
442
|
-
const A =
|
|
441
|
+
P.params.actions = O.reduce((I, L) => q.compose(I, L), null);
|
|
442
|
+
const A = c.syncExecuteCommand(P.id, P.params);
|
|
443
443
|
return d.refreshControls(), !!A;
|
|
444
444
|
}
|
|
445
445
|
}, nt = {
|
|
@@ -453,59 +453,59 @@ const Zn = {
|
|
|
453
453
|
const n = i.get(ee), t = (x = n.getRenderById(e.unitId)) == null ? void 0 : x.with(Me), r = n.getRenderById(e.unitId), o = r == null ? void 0 : r.scene;
|
|
454
454
|
if (o == null || t == null)
|
|
455
455
|
return !1;
|
|
456
|
-
const s = o.getTransformerByCreate(),
|
|
457
|
-
if (
|
|
456
|
+
const s = o.getTransformerByCreate(), a = i.get(z), c = i.get(Q).getCurrentUniverDocInstance();
|
|
457
|
+
if (c == null)
|
|
458
458
|
return !1;
|
|
459
|
-
const { drawing: l, unitId:
|
|
459
|
+
const { drawing: l, unitId: m, offset: g, docTransform: p, segmentId: h, segmentPage: v } = e, w = [], { drawingId: S } = l, O = (G = t.getSegment()) != null ? G : "", D = Yn(
|
|
460
460
|
h,
|
|
461
461
|
O,
|
|
462
462
|
v,
|
|
463
463
|
g,
|
|
464
464
|
S,
|
|
465
|
-
|
|
465
|
+
c,
|
|
466
466
|
t
|
|
467
467
|
);
|
|
468
468
|
if (D == null)
|
|
469
469
|
return !1;
|
|
470
470
|
D.length > 0 && w.push(...D);
|
|
471
|
-
const
|
|
472
|
-
if (!
|
|
473
|
-
const _ =
|
|
471
|
+
const T = q.getInstance(), { drawings: M = {} } = c.getSnapshot(), P = M[S].docTransform, { positionH: A, positionV: U, size: N, angle: I } = P;
|
|
472
|
+
if (!Pe.diffValue(A, p.positionH)) {
|
|
473
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "positionH"], A, p.positionH);
|
|
474
474
|
w.push(_);
|
|
475
475
|
}
|
|
476
|
-
if (!
|
|
477
|
-
const _ =
|
|
476
|
+
if (!Pe.diffValue(U, p.positionV)) {
|
|
477
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "positionV"], U, p.positionV);
|
|
478
478
|
w.push(_);
|
|
479
479
|
}
|
|
480
|
-
if (!
|
|
481
|
-
const _ =
|
|
480
|
+
if (!Pe.diffValue(N, p.size)) {
|
|
481
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "size"], N, p.size);
|
|
482
482
|
w.push(_);
|
|
483
483
|
}
|
|
484
|
-
if (!
|
|
485
|
-
const _ =
|
|
484
|
+
if (!Pe.diffValue(I, p.angle)) {
|
|
485
|
+
const _ = T.replaceOp(["drawings", S, "docTransform", "angle"], I, p.angle);
|
|
486
486
|
w.push(_);
|
|
487
487
|
}
|
|
488
488
|
const L = {
|
|
489
489
|
id: J.id,
|
|
490
490
|
params: {
|
|
491
|
-
unitId:
|
|
491
|
+
unitId: m,
|
|
492
492
|
actions: [],
|
|
493
493
|
textRanges: null,
|
|
494
494
|
debounce: !0
|
|
495
495
|
}
|
|
496
496
|
};
|
|
497
497
|
L.params.actions = w.reduce((_, C) => q.compose(_, C), null);
|
|
498
|
-
const W =
|
|
498
|
+
const W = a.syncExecuteCommand(L.id, L.params);
|
|
499
499
|
return s.refreshControls(), !!W;
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
|
-
var
|
|
503
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
504
|
-
(s = i[o]) && (r =
|
|
505
|
-
return
|
|
502
|
+
var Ri = Object.getOwnPropertyDescriptor, Ni = (i, e, n, t) => {
|
|
503
|
+
for (var r = t > 1 ? void 0 : t ? Ri(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
504
|
+
(s = i[o]) && (r = s(r) || r);
|
|
505
|
+
return r;
|
|
506
506
|
}, Qe = (i, e) => (n, t) => e(n, t, i);
|
|
507
|
-
const
|
|
508
|
-
function
|
|
507
|
+
const Ai = "__InlineDrawingAnchor__";
|
|
508
|
+
function Fn(i) {
|
|
509
509
|
const { path: e } = i;
|
|
510
510
|
return e.some((n) => n === "cells");
|
|
511
511
|
}
|
|
@@ -543,20 +543,20 @@ let on = class extends Xe {
|
|
|
543
543
|
this.disposeWithMe(
|
|
544
544
|
Le(
|
|
545
545
|
n.changeStart$.subscribe((o) => {
|
|
546
|
-
var
|
|
546
|
+
var a;
|
|
547
547
|
this._transformerCache.clear();
|
|
548
548
|
const { objects: s } = o;
|
|
549
549
|
for (const d of s.values()) {
|
|
550
|
-
const { oKey:
|
|
550
|
+
const { oKey: c, width: l, height: m, left: g, top: p, angle: h } = d, v = this._drawingManagerService.getDrawingOKey(c);
|
|
551
551
|
if (v == null)
|
|
552
552
|
continue;
|
|
553
|
-
const w = this._univerInstanceService.getUniverDocInstance(v.unitId), S = (
|
|
553
|
+
const w = this._univerInstanceService.getUniverDocInstance(v.unitId), S = (a = w == null ? void 0 : w.getSnapshot().drawings) == null ? void 0 : a[v.drawingId];
|
|
554
554
|
(S == null ? void 0 : S.layoutType) === H.INLINE && d.setOpacity(0.2), S != null && this._transformerCache.set(v.drawingId, {
|
|
555
555
|
drawing: S,
|
|
556
556
|
top: p,
|
|
557
557
|
left: g,
|
|
558
558
|
width: l,
|
|
559
|
-
height:
|
|
559
|
+
height: m,
|
|
560
560
|
angle: h
|
|
561
561
|
});
|
|
562
562
|
}
|
|
@@ -567,14 +567,14 @@ let on = class extends Xe {
|
|
|
567
567
|
On(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
|
|
568
568
|
Le(
|
|
569
569
|
n.changing$.subscribe((o) => {
|
|
570
|
-
const { objects: s, offsetX:
|
|
570
|
+
const { objects: s, offsetX: a, offsetY: d } = o;
|
|
571
571
|
if (s.size > 1)
|
|
572
572
|
t(s);
|
|
573
573
|
else if (s.size === 1) {
|
|
574
|
-
const
|
|
575
|
-
if (
|
|
574
|
+
const c = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top: p, left: h, angle: v } = l;
|
|
575
|
+
if (c && m === c.width && g === c.height && p === c.top && h === c.left && v === c.angle)
|
|
576
576
|
return;
|
|
577
|
-
|
|
577
|
+
c && (c.drawing.layoutType, H.INLINE), c && c.drawing.layoutType === H.INLINE && a != null && d != null && this._updateInlineDrawingAnchor(c.drawing, a, d);
|
|
578
578
|
}
|
|
579
579
|
})
|
|
580
580
|
)
|
|
@@ -582,21 +582,21 @@ let on = class extends Xe {
|
|
|
582
582
|
Le(
|
|
583
583
|
// eslint-disable-next-line complexity
|
|
584
584
|
n.changeEnd$.subscribe((o) => {
|
|
585
|
-
const { objects: s, offsetX:
|
|
586
|
-
for (const
|
|
587
|
-
const l = this._drawingManagerService.getDrawingOKey(
|
|
585
|
+
const { objects: s, offsetX: a, offsetY: d } = o;
|
|
586
|
+
for (const c of s.values()) {
|
|
587
|
+
const l = this._drawingManagerService.getDrawingOKey(c.oKey);
|
|
588
588
|
if (l == null)
|
|
589
589
|
continue;
|
|
590
|
-
const
|
|
591
|
-
(
|
|
590
|
+
const m = this._transformerCache.get(l == null ? void 0 : l.drawingId);
|
|
591
|
+
(m == null ? void 0 : m.drawing.layoutType) === H.INLINE && c.setOpacity(1);
|
|
592
592
|
}
|
|
593
593
|
if (this._anchorShape && this._anchorShape.hide(), s.size > 1)
|
|
594
594
|
this._updateMultipleDrawingDocTransform(s);
|
|
595
595
|
else if (s.size === 1) {
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
596
|
+
const c = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top: p, left: h, angle: v } = l;
|
|
597
|
+
if (c && m === c.width && g === c.height && p === c.top && h === c.left && v === c.angle)
|
|
598
598
|
return;
|
|
599
|
-
|
|
599
|
+
c && c.drawing.layoutType === H.INLINE ? m !== c.width || g !== c.height || v !== c.angle ? this._updateDrawingSize(c, l) : a != null && d != null && this._moveInlineDrawing(c.drawing, a, d) : c && this._nonInlineDrawingTransform(c.drawing, l);
|
|
600
600
|
}
|
|
601
601
|
this._transformerCache.clear();
|
|
602
602
|
})
|
|
@@ -610,8 +610,8 @@ let on = class extends Xe {
|
|
|
610
610
|
const n = [];
|
|
611
611
|
let t, r;
|
|
612
612
|
for (const o of e.values()) {
|
|
613
|
-
const { oKey: s, left:
|
|
614
|
-
let { width: l, height:
|
|
613
|
+
const { oKey: s, left: a, top: d, angle: c } = o;
|
|
614
|
+
let { width: l, height: m } = o;
|
|
615
615
|
const g = this._drawingManagerService.getDrawingOKey(s);
|
|
616
616
|
if (g == null)
|
|
617
617
|
continue;
|
|
@@ -619,26 +619,26 @@ let on = class extends Xe {
|
|
|
619
619
|
const p = this._transformerCache.get(g.drawingId);
|
|
620
620
|
if (p == null)
|
|
621
621
|
continue;
|
|
622
|
-
const { drawing: h, top: v, left: w, width: S, height: O, angle: D } = p, { width:
|
|
623
|
-
if (l = Math.min(l,
|
|
622
|
+
const { drawing: h, top: v, left: w, width: S, height: O, angle: D } = p, { width: T, height: M } = this._getPageContentSize(h);
|
|
623
|
+
if (l = Math.min(l, T), m = Math.min(m, M), (S !== l || O !== m) && n.push({
|
|
624
624
|
drawingId: g.drawingId,
|
|
625
625
|
key: "size",
|
|
626
626
|
value: {
|
|
627
627
|
width: l,
|
|
628
|
-
height:
|
|
628
|
+
height: m
|
|
629
629
|
}
|
|
630
|
-
}), D !==
|
|
630
|
+
}), D !== c && n.push({
|
|
631
631
|
drawingId: g.drawingId,
|
|
632
632
|
key: "angle",
|
|
633
|
-
value:
|
|
634
|
-
}), v !== d || w !==
|
|
635
|
-
const
|
|
636
|
-
|
|
633
|
+
value: c
|
|
634
|
+
}), v !== d || w !== a) {
|
|
635
|
+
const P = d - v, A = a - w;
|
|
636
|
+
P !== 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 + P
|
|
642
642
|
}
|
|
643
643
|
}), A !== 0 && n.push({
|
|
644
644
|
drawingId: g.drawingId,
|
|
@@ -675,22 +675,22 @@ let on = class extends Xe {
|
|
|
675
675
|
const r = this._renderManagerService.getRenderById(e.unitId), o = r == null ? void 0 : r.with(se).getSkeleton();
|
|
676
676
|
if (r == null)
|
|
677
677
|
return;
|
|
678
|
-
const { mainComponent: s, scene:
|
|
678
|
+
const { mainComponent: s, scene: a } = r, d = s, c = a.getViewports()[0], {
|
|
679
679
|
pageLayoutType: l = Mn.VERTICAL,
|
|
680
|
-
pageMarginLeft:
|
|
680
|
+
pageMarginLeft: m,
|
|
681
681
|
pageMarginTop: g
|
|
682
682
|
} = d.getOffsetConfig();
|
|
683
683
|
let p = null, h = !1, v = -1, w = "";
|
|
684
|
-
const S = 0.5, O = this._getTransformCoordForDocumentOffset(d,
|
|
684
|
+
const S = 0.5, O = this._getTransformCoordForDocumentOffset(d, c, n, t);
|
|
685
685
|
if (O == null)
|
|
686
686
|
return;
|
|
687
687
|
const D = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(Me);
|
|
688
688
|
if (D == null)
|
|
689
689
|
return;
|
|
690
|
-
const
|
|
690
|
+
const T = o == null ? void 0 : o.findNodeByCoord(
|
|
691
691
|
O,
|
|
692
692
|
l,
|
|
693
|
-
|
|
693
|
+
m,
|
|
694
694
|
g,
|
|
695
695
|
{
|
|
696
696
|
strict: !1,
|
|
@@ -698,68 +698,68 @@ let on = class extends Xe {
|
|
|
698
698
|
segmentPage: D.getSegmentPage()
|
|
699
699
|
}
|
|
700
700
|
);
|
|
701
|
-
if (
|
|
702
|
-
const { node: _, ratioX: C, segmentPage: R, segmentId:
|
|
703
|
-
h = C < S, p = _, v = R, w =
|
|
701
|
+
if (T) {
|
|
702
|
+
const { node: _, ratioX: C, segmentPage: R, segmentId: y } = T;
|
|
703
|
+
h = C < S, p = _, v = R, w = y;
|
|
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), P = this._getDocObject();
|
|
708
|
+
if (M == null || o == null || P == null || Fn(M))
|
|
709
709
|
return;
|
|
710
710
|
const A = {
|
|
711
711
|
...M,
|
|
712
712
|
isBack: h
|
|
713
|
-
}, U =
|
|
713
|
+
}, U = P.document.getOffsetConfig(), N = new Nn(U, o), { cursorList: I, contentBoxPointGroup: L } = N.getRangePointData(A, A), { startOffset: W } = (G = An(I)) != null ? G : {};
|
|
714
714
|
if (W != null)
|
|
715
715
|
return { offset: W, contentBoxPointGroup: L, segmentId: w, segmentPage: v };
|
|
716
716
|
}
|
|
717
717
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
718
718
|
_getDrawingAnchor(e, n) {
|
|
719
|
-
var _e, Se, de, De, Oe, Ne, Ae,
|
|
719
|
+
var _e, Se, de, De, Oe, Ne, Ae, Te, le, ge, Ee;
|
|
720
720
|
const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(se).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
|
|
721
721
|
if (o == null || t == null)
|
|
722
722
|
return;
|
|
723
|
-
const { pages: s, skeHeaders:
|
|
724
|
-
let { width: M, height:
|
|
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: P } = n;
|
|
725
725
|
const { positionV: A, positionH: U } = e.docTransform, { width: N, height: I } = this._getPageContentSize(e);
|
|
726
|
-
M = Math.min(M, N),
|
|
726
|
+
M = Math.min(M, N), P = Math.min(P, 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: P
|
|
733
733
|
},
|
|
734
|
-
angle:
|
|
735
|
-
}, { x: C, y: R } = l.getViewportScrollXY(g),
|
|
736
|
-
if (
|
|
734
|
+
angle: T
|
|
735
|
+
}, { x: C, y: R } = l.getViewportScrollXY(g), y = this._getTransformCoordForDocumentOffset(m, g, O - C, D - R);
|
|
736
|
+
if (y == null)
|
|
737
737
|
return;
|
|
738
738
|
const B = (_e = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : _e.with(Me);
|
|
739
739
|
if (B == null)
|
|
740
740
|
return;
|
|
741
|
-
const
|
|
741
|
+
const k = r == null ? void 0 : r.findNodeByCoord(y, p, h, v, {
|
|
742
742
|
strict: !1,
|
|
743
743
|
segmentId: B.getSegment(),
|
|
744
744
|
segmentPage: B.getSegmentPage()
|
|
745
745
|
});
|
|
746
|
-
if (
|
|
747
|
-
const { node: pe, segmentPage: mn, segmentId: un } =
|
|
746
|
+
if (k) {
|
|
747
|
+
const { node: pe, segmentPage: mn, segmentId: un } = k;
|
|
748
748
|
L = pe, x = mn, W = un;
|
|
749
749
|
}
|
|
750
750
|
if (L == null)
|
|
751
751
|
return;
|
|
752
|
-
const
|
|
753
|
-
if (
|
|
752
|
+
const b = (Se = L.parent) == null ? void 0 : Se.parent, E = b == null ? void 0 : b.parent, $ = (de = E == null ? void 0 : E.lines.find((pe) => pe.paragraphIndex === (b == null ? void 0 : b.paragraphIndex) && pe.paragraphStart)) != null ? de : E == null ? void 0 : E.lines[0], F = (De = E == null ? void 0 : E.parent) == null ? void 0 : De.parent;
|
|
753
|
+
if (b == null || E == null || $ == null || F == null)
|
|
754
754
|
return;
|
|
755
755
|
this._liquid.reset();
|
|
756
|
-
const Y =
|
|
756
|
+
const Y = F.type;
|
|
757
757
|
for (const pe of s) {
|
|
758
|
-
const { headerId: mn, footerId: un, pageHeight:
|
|
759
|
-
if (x > -1 &&
|
|
758
|
+
const { headerId: mn, footerId: un, pageHeight: It, pageWidth: Cn, marginLeft: Dn, marginBottom: _t } = pe, St = s.indexOf(pe);
|
|
759
|
+
if (x > -1 && St === x) {
|
|
760
760
|
switch (Y) {
|
|
761
761
|
case Rn.HEADER: {
|
|
762
|
-
const Ge = (Oe =
|
|
762
|
+
const Ge = (Oe = a.get(mn)) == null ? void 0 : Oe.get(Cn);
|
|
763
763
|
if (Ge)
|
|
764
764
|
this._liquid.translatePagePadding({
|
|
765
765
|
marginTop: Ge.marginTop,
|
|
@@ -773,7 +773,7 @@ let on = class extends Xe {
|
|
|
773
773
|
const Ge = (Ne = d.get(un)) == null ? void 0 : Ne.get(Cn);
|
|
774
774
|
if (Ge)
|
|
775
775
|
this._liquid.translatePagePadding({
|
|
776
|
-
marginTop:
|
|
776
|
+
marginTop: It - _t + Ge.marginTop,
|
|
777
777
|
marginLeft: Dn
|
|
778
778
|
});
|
|
779
779
|
else
|
|
@@ -783,16 +783,16 @@ let on = class extends Xe {
|
|
|
783
783
|
}
|
|
784
784
|
break;
|
|
785
785
|
}
|
|
786
|
-
if (this._liquid.translatePagePadding(pe), pe ===
|
|
786
|
+
if (this._liquid.translatePagePadding(pe), pe === F)
|
|
787
787
|
break;
|
|
788
788
|
this._liquid.restorePagePadding(pe), this._liquid.translatePage(pe, p, h, v);
|
|
789
789
|
}
|
|
790
|
-
switch (A.relativeFrom === V.LINE ? L =
|
|
790
|
+
switch (A.relativeFrom === V.LINE ? L = b.divides[0].glyphGroup[0] : L = (ge = (le = (Te = (Ae = $.divides) == null ? void 0 : Ae[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : le[0]) != null ? ge : L, _.positionH = {
|
|
791
791
|
relativeFrom: U.relativeFrom,
|
|
792
792
|
posOffset: O - this._liquid.x - w
|
|
793
793
|
}, U.relativeFrom) {
|
|
794
794
|
case ne.MARGIN: {
|
|
795
|
-
_.positionH.posOffset = O - this._liquid.x - w -
|
|
795
|
+
_.positionH.posOffset = O - this._liquid.x - w - F.marginLeft;
|
|
796
796
|
break;
|
|
797
797
|
}
|
|
798
798
|
case ne.COLUMN: {
|
|
@@ -805,11 +805,11 @@ let on = class extends Xe {
|
|
|
805
805
|
posOffset: D - this._liquid.y - S
|
|
806
806
|
}, A.relativeFrom) {
|
|
807
807
|
case V.PAGE: {
|
|
808
|
-
_.positionV.posOffset = D - this._liquid.y - S -
|
|
808
|
+
_.positionV.posOffset = D - this._liquid.y - S - F.marginTop;
|
|
809
809
|
break;
|
|
810
810
|
}
|
|
811
811
|
case V.LINE: {
|
|
812
|
-
_.positionV.posOffset = D - this._liquid.y - S -
|
|
812
|
+
_.positionV.posOffset = D - this._liquid.y - S - b.top;
|
|
813
813
|
break;
|
|
814
814
|
}
|
|
815
815
|
case V.PARAGRAPH: {
|
|
@@ -820,7 +820,7 @@ let on = class extends Xe {
|
|
|
820
820
|
if (L == null)
|
|
821
821
|
return;
|
|
822
822
|
const ae = r == null ? void 0 : r.findPositionByGlyph(L, x), Ue = this._getDocObject();
|
|
823
|
-
if (ae == null || r == null || Ue == null ||
|
|
823
|
+
if (ae == null || r == null || Ue == null || Fn(ae))
|
|
824
824
|
return;
|
|
825
825
|
const Re = {
|
|
826
826
|
...ae,
|
|
@@ -831,66 +831,66 @@ let on = class extends Xe {
|
|
|
831
831
|
}
|
|
832
832
|
// Update drawing when use transformer to resize it.
|
|
833
833
|
_updateDrawingSize(e, n) {
|
|
834
|
-
const t = [], { drawing: r, width: o, height: s, angle:
|
|
835
|
-
let { width: l, height:
|
|
834
|
+
const t = [], { drawing: r, width: o, height: s, angle: a } = e, { unitId: d, subUnitId: c } = r;
|
|
835
|
+
let { width: l, height: m, angle: g } = n;
|
|
836
836
|
const { width: p, height: h } = this._getPageContentSize(r);
|
|
837
|
-
l = Math.min(p, l),
|
|
837
|
+
l = Math.min(p, l), m = Math.min(h, m), (l !== o || m !== s) && t.push({
|
|
838
838
|
drawingId: r.drawingId,
|
|
839
839
|
key: "size",
|
|
840
840
|
value: {
|
|
841
841
|
width: l,
|
|
842
|
-
height:
|
|
842
|
+
height: m
|
|
843
843
|
}
|
|
844
|
-
}), g !==
|
|
844
|
+
}), g !== a && t.push({
|
|
845
845
|
drawingId: r.drawingId,
|
|
846
846
|
key: "angle",
|
|
847
847
|
value: g
|
|
848
|
-
}), t.length > 0 && d &&
|
|
848
|
+
}), t.length > 0 && d && c && this._commandService.executeCommand(qe.id, {
|
|
849
849
|
unitId: d,
|
|
850
|
-
subUnitId:
|
|
850
|
+
subUnitId: c,
|
|
851
851
|
drawings: t
|
|
852
852
|
});
|
|
853
853
|
}
|
|
854
854
|
// Update inline drawing when use transformer to move it.
|
|
855
855
|
_moveInlineDrawing(e, n, t) {
|
|
856
|
-
const r = this._getInlineDrawingAnchor(e, n, t), { offset: o, segmentId: s, segmentPage:
|
|
856
|
+
const r = this._getInlineDrawingAnchor(e, n, t), { offset: o, segmentId: s, segmentPage: a } = r != null ? r : {};
|
|
857
857
|
return this._commandService.executeCommand(et.id, {
|
|
858
858
|
unitId: e.unitId,
|
|
859
859
|
subUnitId: e.unitId,
|
|
860
860
|
drawing: e,
|
|
861
861
|
offset: o,
|
|
862
862
|
segmentId: s,
|
|
863
|
-
segmentPage:
|
|
863
|
+
segmentPage: a,
|
|
864
864
|
needRefreshDrawings: o == null
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
// Limit the drawing to the page area, mainly in the vertical direction,
|
|
868
868
|
// and the upper and lower limits cannot exceed the page margin area.
|
|
869
869
|
_limitDrawingInPage(e, n) {
|
|
870
|
-
const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height:
|
|
871
|
-
if (l == null || t == null ||
|
|
870
|
+
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(se).getSkeleton(), l = c == null ? void 0 : c.getSkeletonData(), { pages: m } = l != null ? l : {};
|
|
871
|
+
if (l == null || t == null || m == null)
|
|
872
872
|
return {
|
|
873
873
|
left: r,
|
|
874
874
|
top: o,
|
|
875
875
|
width: s,
|
|
876
|
-
height:
|
|
876
|
+
height: a,
|
|
877
877
|
angle: d
|
|
878
878
|
};
|
|
879
879
|
const { mainComponent: g } = t, p = g, { top: h, pageLayoutType: v, pageMarginLeft: w, pageMarginTop: S } = p;
|
|
880
880
|
let O = o;
|
|
881
881
|
this._liquid.reset();
|
|
882
|
-
for (const D of
|
|
883
|
-
const { marginBottom:
|
|
882
|
+
for (const D of m) {
|
|
883
|
+
const { marginBottom: T, pageHeight: M } = D, P = m.indexOf(D), A = m[P + 1];
|
|
884
884
|
if (A == null)
|
|
885
885
|
continue;
|
|
886
|
-
if (
|
|
886
|
+
if (Pe.hasIntersectionBetweenTwoRanges(
|
|
887
887
|
o,
|
|
888
|
-
o +
|
|
889
|
-
this._liquid.y + h + M -
|
|
888
|
+
o + a,
|
|
889
|
+
this._liquid.y + h + M - T,
|
|
890
890
|
this._liquid.y + h + M + S + A.marginTop
|
|
891
891
|
)) {
|
|
892
|
-
const N = o +
|
|
893
|
-
N < I ? O = Math.min(o, this._liquid.y + h + M -
|
|
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 + A.marginTop);
|
|
894
894
|
}
|
|
895
895
|
this._liquid.translatePage(D, v, w, S);
|
|
896
896
|
}
|
|
@@ -898,7 +898,7 @@ let on = class extends Xe {
|
|
|
898
898
|
left: r,
|
|
899
899
|
top: O,
|
|
900
900
|
width: s,
|
|
901
|
-
height:
|
|
901
|
+
height: a,
|
|
902
902
|
angle: d
|
|
903
903
|
};
|
|
904
904
|
}
|
|
@@ -906,15 +906,15 @@ let on = class extends Xe {
|
|
|
906
906
|
const r = e.isMultiTransform === oe.TRUE ? n : this._limitDrawingInPage(e, n);
|
|
907
907
|
if (t && r.top !== n.top)
|
|
908
908
|
return;
|
|
909
|
-
const o = this._getDrawingAnchor(e, r), { offset: s, docTransform:
|
|
910
|
-
return s == null ||
|
|
909
|
+
const o = this._getDrawingAnchor(e, r), { offset: s, docTransform: a, segmentId: d, segmentPage: c } = o != null ? o : {};
|
|
910
|
+
return s == null || a == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, n]])) : this._commandService.executeCommand(nt.id, {
|
|
911
911
|
unitId: e.unitId,
|
|
912
912
|
subUnitId: e.unitId,
|
|
913
913
|
drawing: e,
|
|
914
914
|
offset: s,
|
|
915
|
-
docTransform:
|
|
915
|
+
docTransform: a,
|
|
916
916
|
segmentId: d,
|
|
917
|
-
segmentPage:
|
|
917
|
+
segmentPage: c
|
|
918
918
|
});
|
|
919
919
|
}
|
|
920
920
|
_getSceneAndTransformerByDrawingSearch(e) {
|
|
@@ -927,7 +927,7 @@ let on = class extends Xe {
|
|
|
927
927
|
return { scene: t, transformer: r };
|
|
928
928
|
}
|
|
929
929
|
_getTransformCoordForDocumentOffset(e, n, t, r) {
|
|
930
|
-
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(
|
|
930
|
+
const { documentTransform: o } = e.getOffsetConfig(), s = n.transformVector2SceneCoord(ei.FromArray([t, r]));
|
|
931
931
|
if (s)
|
|
932
932
|
return o.clone().invert().applyPoint(s);
|
|
933
933
|
}
|
|
@@ -936,25 +936,25 @@ let on = class extends Xe {
|
|
|
936
936
|
if (t == null)
|
|
937
937
|
return;
|
|
938
938
|
const { mainComponent: r, scene: o } = t, s = r, {
|
|
939
|
-
docsLeft:
|
|
939
|
+
docsLeft: a,
|
|
940
940
|
docsTop: d
|
|
941
|
-
} = s.getOffsetConfig(),
|
|
941
|
+
} = s.getOffsetConfig(), c = mi(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 ni(Ai + Pe.generateRandomId(v), {
|
|
947
947
|
left: p,
|
|
948
948
|
top: h,
|
|
949
949
|
height: g,
|
|
950
950
|
strokeWidth: 2,
|
|
951
|
-
stroke:
|
|
951
|
+
stroke: ti(yt.darkGray, 1),
|
|
952
952
|
evented: !1
|
|
953
953
|
});
|
|
954
|
-
this._anchorShape = w, o.addObject(w,
|
|
954
|
+
this._anchorShape = w, o.addObject(w, ui);
|
|
955
955
|
}
|
|
956
956
|
_getDocObject() {
|
|
957
|
-
return
|
|
957
|
+
return fi(this._univerInstanceService, this._renderManagerService);
|
|
958
958
|
}
|
|
959
959
|
_getPageContentSize(e) {
|
|
960
960
|
const n = this._renderManagerService.getRenderById(e.unitId), t = n == null ? void 0 : n.with(se).getSkeleton(), r = 500, o = 500, s = t == null ? void 0 : t.getSkeletonData();
|
|
@@ -963,19 +963,19 @@ let on = class extends Xe {
|
|
|
963
963
|
width: r,
|
|
964
964
|
height: o
|
|
965
965
|
};
|
|
966
|
-
const { pages:
|
|
966
|
+
const { pages: a } = s;
|
|
967
967
|
let d = null;
|
|
968
|
-
for (const
|
|
969
|
-
const { skeDrawings: l } =
|
|
968
|
+
for (const c of a) {
|
|
969
|
+
const { skeDrawings: l } = c;
|
|
970
970
|
if (l.has(e.drawingId)) {
|
|
971
|
-
d =
|
|
971
|
+
d = c;
|
|
972
972
|
break;
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
975
|
if (d) {
|
|
976
|
-
const { pageWidth:
|
|
976
|
+
const { pageWidth: c, pageHeight: l, marginLeft: m, marginBottom: g, marginRight: p, marginTop: h } = d;
|
|
977
977
|
return {
|
|
978
|
-
width: Math.max(r,
|
|
978
|
+
width: Math.max(r, c - m - p),
|
|
979
979
|
height: Math.max(o, l - h - g)
|
|
980
980
|
};
|
|
981
981
|
} else
|
|
@@ -985,7 +985,7 @@ let on = class extends Xe {
|
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
987
|
};
|
|
988
|
-
on =
|
|
988
|
+
on = Ni([
|
|
989
989
|
Qe(0, z),
|
|
990
990
|
Qe(1, Q),
|
|
991
991
|
Qe(2, Ie),
|
|
@@ -999,7 +999,7 @@ var he = function() {
|
|
|
999
999
|
}
|
|
1000
1000
|
return i;
|
|
1001
1001
|
}, he.apply(this, arguments);
|
|
1002
|
-
},
|
|
1002
|
+
}, Ei = function(i, e) {
|
|
1003
1003
|
var n = {};
|
|
1004
1004
|
for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && e.indexOf(t) < 0 && (n[t] = i[t]);
|
|
1005
1005
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -1007,38 +1007,41 @@ 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 =
|
|
1011
|
-
return it(n, "".concat(t), { defIds: n.defIds, idSuffix: d.current }, he({ ref: e, className:
|
|
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 = Di("_".concat(Bi()));
|
|
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 }, xi(i, n, r)), t), (Li(i, n).children || []).map(function(o, s) {
|
|
1015
1015
|
return it(o, "".concat(e, "-").concat(i.tag, "-").concat(s), n, void 0, r);
|
|
1016
1016
|
}));
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function xi(i, e, n) {
|
|
1019
1019
|
var t = he({}, i.attrs);
|
|
1020
|
-
n != null && n.colorChannel1 && t.fill === "colorChannel1" && (t.fill = n.colorChannel1)
|
|
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
|
+
var s = o[0], a = o[1];
|
|
1022
|
+
s === "mask" && typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1023
|
+
});
|
|
1021
1024
|
var r = e.defIds;
|
|
1022
1025
|
return !r || r.length === 0 || (i.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + e.idSuffix), Object.entries(t).forEach(function(o) {
|
|
1023
|
-
var s = o[0],
|
|
1024
|
-
typeof
|
|
1026
|
+
var s = o[0], a = o[1];
|
|
1027
|
+
typeof a == "string" && (t[s] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
1025
1028
|
})), t;
|
|
1026
1029
|
}
|
|
1027
|
-
function
|
|
1030
|
+
function Li(i, e) {
|
|
1028
1031
|
var n, t = e.defIds;
|
|
1029
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) {
|
|
1030
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;
|
|
1031
1034
|
}) }) : i;
|
|
1032
1035
|
}
|
|
1033
|
-
function
|
|
1036
|
+
function Bi() {
|
|
1034
1037
|
return Math.random().toString(36).substring(2, 8);
|
|
1035
1038
|
}
|
|
1036
1039
|
tt.displayName = "UniverIcon";
|
|
1037
|
-
var
|
|
1040
|
+
var Ui = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.2498 3.65005C2.2498 2.87685 2.87661 2.25005 3.64981 2.25005H7.9998C8.33118 2.25005 8.5998 1.98142 8.5998 1.65005C8.5998 1.31868 8.33118 1.05005 7.9998 1.05005H3.64981C2.21387 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V8.00005C14.9498 7.66868 14.6812 7.40005 14.3498 7.40005C14.0184 7.40005 13.7498 7.66868 13.7498 8.00005V9.23974L12.2385 8.1063C11.7252 7.72129 11.0068 7.7723 10.5531 8.22605L9.00869 9.77041L6.73916 7.8251C6.24387 7.40055 5.5095 7.41278 5.02864 7.85359L2.2498 10.4009V3.65005ZM2.2498 12.0287V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.7397L11.5186 9.06631C11.4829 9.03956 11.433 9.04314 11.4016 9.07458L9.92249 10.5537L11.1015 11.5642C11.3531 11.7799 11.3822 12.1587 11.1666 12.4103C10.9509 12.6619 10.5721 12.691 10.3205 12.4753L5.9582 8.7362C5.92384 8.70674 5.87288 8.70758 5.83952 8.73816L2.2498 12.0287Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M11.8097 1.14783C12.1411 1.14783 12.4097 1.41646 12.4097 1.74783V3.297H14.1541C14.4855 3.297 14.7541 3.56563 14.7541 3.897C14.7541 4.22837 14.4855 4.497 14.1541 4.497H12.4097V6.24167C12.4097 6.57304 12.1411 6.84167 11.8097 6.84167C11.4783 6.84167 11.2097 6.57304 11.2097 6.24167V4.497H9.6603C9.32893 4.497 9.0603 4.22837 9.0603 3.897C9.0603 3.56563 9.32893 3.297 9.6603 3.297H11.2097V1.74783C11.2097 1.41646 11.4783 1.14783 11.8097 1.14783Z" } }] }, rt = Xn(function(i, e) {
|
|
1038
1041
|
return Kn(tt, Object.assign({}, i, {
|
|
1039
1042
|
id: "add-image-single",
|
|
1040
1043
|
ref: e,
|
|
1041
|
-
icon:
|
|
1044
|
+
icon: Ui
|
|
1042
1045
|
}));
|
|
1043
1046
|
});
|
|
1044
1047
|
rt.displayName = "AddImageSingle";
|
|
@@ -1047,11 +1050,11 @@ const Sn = {
|
|
|
1047
1050
|
type: K.COMMAND,
|
|
1048
1051
|
// eslint-disable-next-line max-lines-per-function
|
|
1049
1052
|
handler: (i, e) => {
|
|
1050
|
-
var M,
|
|
1053
|
+
var M, P, A, U;
|
|
1051
1054
|
const n = i.get(z), t = i.get(Q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
|
|
1052
1055
|
if (e == null || o == null)
|
|
1053
1056
|
return !1;
|
|
1054
|
-
const s = r.getRenderById(e.unitId).with(Me), { drawings:
|
|
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 = (A = (P = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : P.customBlocks) != null ? A : [], 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();
|
|
1055
1058
|
h.reset();
|
|
1056
1059
|
const v = g[0].startIndex, w = [
|
|
1057
1060
|
{
|
|
@@ -1068,16 +1071,16 @@ const Sn = {
|
|
|
1068
1071
|
}, O = [];
|
|
1069
1072
|
for (const N of g) {
|
|
1070
1073
|
const { startIndex: I } = N;
|
|
1071
|
-
I > h.cursor &&
|
|
1074
|
+
I > h.cursor && c.push({
|
|
1072
1075
|
t: Z.RETAIN,
|
|
1073
1076
|
len: I - h.cursor
|
|
1074
|
-
}),
|
|
1077
|
+
}), c.push({
|
|
1075
1078
|
t: Z.DELETE,
|
|
1076
1079
|
len: 1
|
|
1077
1080
|
}), h.moveCursorTo(I + 1);
|
|
1078
1081
|
}
|
|
1079
1082
|
const D = ze(o, d);
|
|
1080
|
-
O.push(l.editOp(
|
|
1083
|
+
O.push(l.editOp(c.serialize(), D));
|
|
1081
1084
|
for (const N of g) {
|
|
1082
1085
|
const { blockId: I } = N, L = ((U = o.getDrawings()) != null ? U : {})[I], x = o.getDrawingsOrder().indexOf(I), G = l.removeOp(["drawings", I], L), _ = l.removeOp(["drawingsOrder", x], I);
|
|
1083
1086
|
O.push(G), O.push(_);
|
|
@@ -1092,11 +1095,11 @@ const Sn = {
|
|
|
1092
1095
|
if (t.length === 0)
|
|
1093
1096
|
return !1;
|
|
1094
1097
|
const { unitId: r } = t[0], o = t.map((s) => {
|
|
1095
|
-
const { unitId:
|
|
1098
|
+
const { unitId: a, subUnitId: d, drawingId: c, drawingType: l } = s;
|
|
1096
1099
|
return {
|
|
1097
|
-
unitId:
|
|
1100
|
+
unitId: a,
|
|
1098
1101
|
subUnitId: d,
|
|
1099
|
-
drawingId:
|
|
1102
|
+
drawingId: c,
|
|
1100
1103
|
drawingType: l
|
|
1101
1104
|
};
|
|
1102
1105
|
});
|
|
@@ -1113,44 +1116,46 @@ const Sn = {
|
|
|
1113
1116
|
const n = i.get(Be);
|
|
1114
1117
|
if (!e) return !1;
|
|
1115
1118
|
const t = [];
|
|
1116
|
-
|
|
1117
|
-
t.push(
|
|
1118
|
-
t.push(
|
|
1119
|
+
e.forEach(({ parent: l, children: m }) => {
|
|
1120
|
+
t.push(l.unitId), m.forEach((g) => {
|
|
1121
|
+
t.push(g.unitId);
|
|
1119
1122
|
});
|
|
1120
|
-
})
|
|
1123
|
+
});
|
|
1124
|
+
const r = n.getGroupDrawingOp(e), { unitId: o, subUnitId: s, undo: a, redo: d, objects: c } = r;
|
|
1125
|
+
return !1;
|
|
1121
1126
|
}
|
|
1122
1127
|
}, at = {
|
|
1123
1128
|
id: "doc.command.insert-doc-image",
|
|
1124
1129
|
type: K.COMMAND,
|
|
1125
1130
|
// eslint-disable-next-line max-lines-per-function
|
|
1126
1131
|
handler: (i, e) => {
|
|
1127
|
-
var
|
|
1132
|
+
var P, A, U, N;
|
|
1128
1133
|
if (e == null)
|
|
1129
1134
|
return !1;
|
|
1130
1135
|
const n = i.get(z), t = i.get(In), r = i.get(Q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
|
|
1131
1136
|
if (o == null || s == null)
|
|
1132
1137
|
return !1;
|
|
1133
|
-
const
|
|
1138
|
+
const a = s.getUnitId(), { drawings: d } = e, { collapsed: c, startOffset: l, segmentId: m } = o, g = s.getSelfOrHeaderFooterModel(m).getBody();
|
|
1134
1139
|
if (g == null)
|
|
1135
1140
|
return !1;
|
|
1136
|
-
const p = new vn(), h = q.getInstance(), v = [], w = (A = (
|
|
1141
|
+
const p = new vn(), h = q.getInstance(), v = [], w = (A = (P = s.getSnapshot().drawingsOrder) == null ? void 0 : P.length) != null ? A : 0;
|
|
1137
1142
|
let S = 0;
|
|
1138
|
-
if (
|
|
1143
|
+
if (c)
|
|
1139
1144
|
l > 0 && p.push({
|
|
1140
1145
|
t: Z.RETAIN,
|
|
1141
1146
|
len: l
|
|
1142
1147
|
});
|
|
1143
1148
|
else {
|
|
1144
|
-
const I =
|
|
1149
|
+
const I = bt.selection.delete([o], g, 0, null, !1);
|
|
1145
1150
|
p.push(...I);
|
|
1146
|
-
const L =
|
|
1151
|
+
const L = hi(g, [o]), W = (U = s.getDrawings()) != null ? U : {}, x = (N = s.getDrawingsOrder()) != null ? N : [], G = L.sort((_, C) => x.indexOf(_) > x.indexOf(C) ? -1 : x.indexOf(_) < x.indexOf(C) ? 1 : 0);
|
|
1147
1152
|
if (G.length > 0)
|
|
1148
1153
|
for (const _ of G) {
|
|
1149
1154
|
const C = W[_], R = x.indexOf(_);
|
|
1150
1155
|
if (C == null || R < 0)
|
|
1151
1156
|
continue;
|
|
1152
|
-
const
|
|
1153
|
-
v.push(
|
|
1157
|
+
const y = h.removeOp(["drawings", _], C), B = h.removeOp(["drawingsOrder", R], _);
|
|
1158
|
+
v.push(y), v.push(B), S++;
|
|
1154
1159
|
}
|
|
1155
1160
|
}
|
|
1156
1161
|
p.push({
|
|
@@ -1164,21 +1169,21 @@ const Sn = {
|
|
|
1164
1169
|
},
|
|
1165
1170
|
len: d.length
|
|
1166
1171
|
});
|
|
1167
|
-
const O = ze(s,
|
|
1172
|
+
const O = ze(s, m), D = h.editOp(p.serialize(), O);
|
|
1168
1173
|
v.push(D);
|
|
1169
1174
|
for (const I of d) {
|
|
1170
1175
|
const { drawingId: L } = I, W = h.insertOp(["drawings", L], I), x = h.insertOp(["drawingsOrder", w - S], L);
|
|
1171
1176
|
v.push(W), v.push(x);
|
|
1172
1177
|
}
|
|
1173
|
-
const
|
|
1178
|
+
const T = {
|
|
1174
1179
|
id: J.id,
|
|
1175
1180
|
params: {
|
|
1176
|
-
unitId:
|
|
1181
|
+
unitId: a,
|
|
1177
1182
|
actions: [],
|
|
1178
1183
|
textRanges: []
|
|
1179
1184
|
}
|
|
1180
1185
|
};
|
|
1181
|
-
return
|
|
1186
|
+
return T.params.actions = v.reduce((I, L) => q.compose(I, L), null), !!n.syncExecuteCommand(T.id, T.params);
|
|
1182
1187
|
}
|
|
1183
1188
|
}, ct = {
|
|
1184
1189
|
id: "doc.command.set-drawing-arrange",
|
|
@@ -1187,16 +1192,16 @@ const Sn = {
|
|
|
1187
1192
|
const n = i.get(z), t = i.get(Be);
|
|
1188
1193
|
if (e == null)
|
|
1189
1194
|
return !1;
|
|
1190
|
-
const { unitId: r, subUnitId: o, drawingIds: s, arrangeType:
|
|
1191
|
-
let
|
|
1192
|
-
if (
|
|
1195
|
+
const { unitId: r, subUnitId: o, drawingIds: s, arrangeType: a } = e, d = { unitId: r, subUnitId: o, drawingIds: s };
|
|
1196
|
+
let c;
|
|
1197
|
+
if (a === Ze.forward ? c = t.getForwardDrawingsOp(d) : a === Ze.backward ? c = t.getBackwardDrawingOp(d) : a === Ze.front ? c = t.getFrontDrawingsOp(d) : a === Ze.back && (c = t.getBackDrawingsOp(d)), c == null)
|
|
1193
1198
|
return !1;
|
|
1194
|
-
const { redo: l } =
|
|
1199
|
+
const { redo: l } = c;
|
|
1195
1200
|
if (l == null)
|
|
1196
1201
|
return !1;
|
|
1197
|
-
const
|
|
1198
|
-
let g =
|
|
1199
|
-
g = g.slice(3), g.unshift("drawingsOrder"),
|
|
1202
|
+
const m = [];
|
|
1203
|
+
let g = Pe.deepClone(l);
|
|
1204
|
+
g = g.slice(3), g.unshift("drawingsOrder"), m.push(g);
|
|
1200
1205
|
const p = {
|
|
1201
1206
|
id: J.id,
|
|
1202
1207
|
params: {
|
|
@@ -1205,7 +1210,7 @@ const Sn = {
|
|
|
1205
1210
|
textRanges: null
|
|
1206
1211
|
}
|
|
1207
1212
|
};
|
|
1208
|
-
return p.params.actions =
|
|
1213
|
+
return p.params.actions = m.reduce((v, w) => q.compose(v, w), null), !!n.syncExecuteCommand(p.id, p.params);
|
|
1209
1214
|
}
|
|
1210
1215
|
}, dt = {
|
|
1211
1216
|
id: "doc.command.ungroup-doc-image",
|
|
@@ -1215,30 +1220,32 @@ const Sn = {
|
|
|
1215
1220
|
const n = i.get(Be);
|
|
1216
1221
|
if (!e) return !1;
|
|
1217
1222
|
const t = [];
|
|
1218
|
-
|
|
1219
|
-
t.push(
|
|
1220
|
-
t.push(
|
|
1223
|
+
e.forEach(({ parent: l, children: m }) => {
|
|
1224
|
+
t.push(l.unitId), m.forEach((g) => {
|
|
1225
|
+
t.push(g.unitId);
|
|
1221
1226
|
});
|
|
1222
|
-
})
|
|
1227
|
+
});
|
|
1228
|
+
const r = n.getUngroupDrawingOp(e), { unitId: o, subUnitId: s, undo: a, redo: d, objects: c } = r;
|
|
1229
|
+
return !1;
|
|
1223
1230
|
}
|
|
1224
1231
|
};
|
|
1225
|
-
var
|
|
1226
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1227
|
-
(s = i[o]) && (r =
|
|
1228
|
-
return
|
|
1232
|
+
var ki = Object.getOwnPropertyDescriptor, Fi = (i, e, n, t) => {
|
|
1233
|
+
for (var r = t > 1 ? void 0 : t ? ki(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
1234
|
+
(s = i[o]) && (r = s(r) || r);
|
|
1235
|
+
return r;
|
|
1229
1236
|
}, me = (i, e) => (n, t) => e(n, t, i);
|
|
1230
1237
|
let sn = class extends Xe {
|
|
1231
|
-
constructor(i, e, n, t, r, o, s,
|
|
1232
|
-
super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService =
|
|
1238
|
+
constructor(i, e, n, t, r, o, s, a, d, c, l, m, g) {
|
|
1239
|
+
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 = l, this._docRefreshDrawingsService = m, this._fileOpenerService = g, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
|
|
1233
1240
|
}
|
|
1234
1241
|
async insertDocImage() {
|
|
1235
1242
|
const i = await this._fileOpenerService.openFile({
|
|
1236
1243
|
multiple: !0,
|
|
1237
1244
|
accept: Vt.map((n) => `.${n.replace("image/", "")}`).join(",")
|
|
1238
1245
|
}), e = i.length;
|
|
1239
|
-
return e >
|
|
1246
|
+
return e > yn ? (this._messageService.show({
|
|
1240
1247
|
type: Ln.Error,
|
|
1241
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
1248
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(yn))
|
|
1242
1249
|
}), !1) : e === 0 ? !1 : (await this._insertFloatImages(i), !0);
|
|
1243
1250
|
}
|
|
1244
1251
|
// eslint-disable-next-line max-lines-per-function
|
|
@@ -1271,24 +1278,24 @@ let sn = class extends Xe {
|
|
|
1271
1278
|
for (const r of e) {
|
|
1272
1279
|
if (r == null)
|
|
1273
1280
|
continue;
|
|
1274
|
-
const { imageId: o, imageSourceType: s, source:
|
|
1275
|
-
this._imageIoService.addImageSourceCache(o, s,
|
|
1281
|
+
const { imageId: o, imageSourceType: s, source: a, base64Cache: d } = r, { width: c, height: l, image: m } = await $t(d || "");
|
|
1282
|
+
this._imageIoService.addImageSourceCache(o, s, m);
|
|
1276
1283
|
let g = 1;
|
|
1277
|
-
if (
|
|
1278
|
-
const w =
|
|
1284
|
+
if (c > Pn || l > bn) {
|
|
1285
|
+
const w = Pn / c, S = bn / l;
|
|
1279
1286
|
g = Math.min(w, S);
|
|
1280
1287
|
}
|
|
1281
|
-
const p = this._getImagePosition(
|
|
1288
|
+
const p = this._getImagePosition(c * g, l * g);
|
|
1282
1289
|
if (p == null)
|
|
1283
1290
|
return;
|
|
1284
1291
|
const h = {
|
|
1285
1292
|
unitId: n,
|
|
1286
1293
|
subUnitId: n,
|
|
1287
1294
|
drawingId: o,
|
|
1288
|
-
drawingType:
|
|
1295
|
+
drawingType: Mt.DRAWING_IMAGE,
|
|
1289
1296
|
imageSourceType: s,
|
|
1290
|
-
source:
|
|
1291
|
-
transform:
|
|
1297
|
+
source: a,
|
|
1298
|
+
transform: pi(p),
|
|
1292
1299
|
docTransform: p,
|
|
1293
1300
|
behindDoc: oe.FALSE,
|
|
1294
1301
|
title: "",
|
|
@@ -1311,12 +1318,11 @@ let sn = class extends Xe {
|
|
|
1311
1318
|
_isInsertInHeaderFooter() {
|
|
1312
1319
|
var t;
|
|
1313
1320
|
const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(se).getViewModel(), n = e == null ? void 0 : e.getEditArea();
|
|
1314
|
-
return n ===
|
|
1321
|
+
return n === Fe.HEADER || n === Fe.FOOTER;
|
|
1315
1322
|
}
|
|
1316
1323
|
_getImagePosition(i, e) {
|
|
1317
1324
|
const n = this._docSelectionRenderService.getActiveTextRange(), t = (n == null ? void 0 : n.getAbsolutePosition()) || {
|
|
1318
|
-
left: 0
|
|
1319
|
-
top: 0
|
|
1325
|
+
left: 0
|
|
1320
1326
|
};
|
|
1321
1327
|
return {
|
|
1322
1328
|
size: {
|
|
@@ -1390,30 +1396,30 @@ let sn = class extends Xe {
|
|
|
1390
1396
|
);
|
|
1391
1397
|
}
|
|
1392
1398
|
_findSegmentIdByDrawingId(i) {
|
|
1393
|
-
var s,
|
|
1399
|
+
var s, a, d;
|
|
1394
1400
|
const { unit: e } = this._context, { body: n, headers: t = {}, footers: r = {} } = e.getSnapshot();
|
|
1395
|
-
if (((s = n == null ? void 0 : n.customBlocks) != null ? s : []).some((
|
|
1401
|
+
if (((s = n == null ? void 0 : n.customBlocks) != null ? s : []).some((c) => c.blockId === i))
|
|
1396
1402
|
return "";
|
|
1397
|
-
for (const
|
|
1398
|
-
if ((
|
|
1399
|
-
return
|
|
1400
|
-
for (const
|
|
1401
|
-
if ((d = r[
|
|
1402
|
-
return
|
|
1403
|
+
for (const c of Object.keys(t))
|
|
1404
|
+
if ((a = t[c].body.customBlocks) != null && a.some((l) => l.blockId === i))
|
|
1405
|
+
return c;
|
|
1406
|
+
for (const c of Object.keys(r))
|
|
1407
|
+
if ((d = r[c].body.customBlocks) != null && d.some((l) => l.blockId === i))
|
|
1408
|
+
return c;
|
|
1403
1409
|
return "";
|
|
1404
1410
|
}
|
|
1405
1411
|
// Update drawings edit status and opacity. You can not edit header footer images when you are editing body. and vice verse.
|
|
1406
1412
|
_updateDrawingsEditStatus() {
|
|
1407
|
-
var
|
|
1408
|
-
const { unit: i, scene: e, unitId: n } = this._context, t = (
|
|
1413
|
+
var a;
|
|
1414
|
+
const { unit: i, scene: e, unitId: n } = this._context, t = (a = this._renderManagerSrv.getRenderById(n)) == null ? void 0 : a.with(se).getViewModel();
|
|
1409
1415
|
if (t == null || i == null)
|
|
1410
1416
|
return;
|
|
1411
|
-
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() ===
|
|
1417
|
+
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Fe.BODY;
|
|
1412
1418
|
for (const d of Object.keys(o)) {
|
|
1413
|
-
const
|
|
1414
|
-
if (
|
|
1415
|
-
for (const g of
|
|
1416
|
-
e.detachTransformerFrom(g), g.setOpacity(0.5), (s &&
|
|
1419
|
+
const c = o[d], l = zt({ unitId: n, drawingId: c.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
|
|
1420
|
+
if (m.length)
|
|
1421
|
+
for (const g of m)
|
|
1422
|
+
e.detachTransformerFrom(g), g.setOpacity(0.5), (s && c.isMultiTransform !== oe.TRUE || !s && c.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(g), g.setOpacity(1));
|
|
1417
1423
|
}
|
|
1418
1424
|
}
|
|
1419
1425
|
_editAreaChangeListener() {
|
|
@@ -1438,53 +1444,53 @@ let sn = class extends Xe {
|
|
|
1438
1444
|
_setDrawingSelections(i) {
|
|
1439
1445
|
var r, o;
|
|
1440
1446
|
const { unit: e } = this._context, n = (o = (r = e.getSnapshot().body) == null ? void 0 : r.customBlocks) != null ? o : [], t = i.map((s) => {
|
|
1441
|
-
const
|
|
1447
|
+
const a = s.drawingId, d = n.find((c) => c.blockId === a);
|
|
1442
1448
|
return d ? d.startIndex : null;
|
|
1443
1449
|
}).filter((s) => s !== null).map((s) => ({ startOffset: s, endOffset: s + 1 }));
|
|
1444
1450
|
this._docSelectionManagerService.replaceDocRanges(t);
|
|
1445
1451
|
}
|
|
1446
1452
|
};
|
|
1447
|
-
sn =
|
|
1453
|
+
sn = Fi([
|
|
1448
1454
|
me(1, z),
|
|
1449
1455
|
me(2, ve(In)),
|
|
1450
1456
|
me(3, ee),
|
|
1451
|
-
me(4,
|
|
1457
|
+
me(4, Gt),
|
|
1452
1458
|
me(5, Be),
|
|
1453
1459
|
me(6, Ie),
|
|
1454
1460
|
me(7, Vn),
|
|
1455
|
-
me(8,
|
|
1461
|
+
me(8, ri),
|
|
1456
1462
|
me(9, ve(ln)),
|
|
1457
1463
|
me(10, ve(Me)),
|
|
1458
1464
|
me(11, ve(gn)),
|
|
1459
|
-
me(12,
|
|
1465
|
+
me(12, oi)
|
|
1460
1466
|
], sn);
|
|
1461
1467
|
const lt = {
|
|
1462
1468
|
id: "doc.command.insert-float-image",
|
|
1463
1469
|
type: K.COMMAND,
|
|
1464
1470
|
handler: (i) => {
|
|
1465
1471
|
var n, t;
|
|
1466
|
-
return (t = (n = i.get(ee).getCurrentTypeOfRenderer(
|
|
1472
|
+
return (t = (n = i.get(ee).getCurrentTypeOfRenderer(be.UNIVER_DOC)) == null ? void 0 : n.with(sn).insertDocImage()) != null ? t : !1;
|
|
1467
1473
|
}
|
|
1468
1474
|
}, Ke = {
|
|
1469
1475
|
id: "doc.command.move-drawing",
|
|
1470
1476
|
type: K.COMMAND,
|
|
1471
1477
|
handler: (i, e) => {
|
|
1472
|
-
const n = i.get(z), t = i.get(Be), r = i.get(Q), o = i.get(ee), { direction: s } = e,
|
|
1473
|
-
if (
|
|
1478
|
+
const n = i.get(z), t = i.get(Be), r = i.get(Q), o = i.get(ee), { direction: s } = e, a = t.getFocusDrawings();
|
|
1479
|
+
if (a.length === 0)
|
|
1474
1480
|
return !1;
|
|
1475
|
-
const d =
|
|
1481
|
+
const d = a[0].unitId, c = o.getRenderById(d), l = c == null ? void 0 : c.scene;
|
|
1476
1482
|
if (l == null)
|
|
1477
1483
|
return !1;
|
|
1478
|
-
const
|
|
1479
|
-
var
|
|
1480
|
-
const { drawingId: w } = v, S = (
|
|
1484
|
+
const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), p = a.map((v) => {
|
|
1485
|
+
var P, A, U, N, I;
|
|
1486
|
+
const { drawingId: w } = v, S = (P = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : P[w];
|
|
1481
1487
|
if (S == null || S.layoutType === H.INLINE)
|
|
1482
1488
|
return null;
|
|
1483
|
-
const { positionH: O, positionV: D } = S.docTransform,
|
|
1484
|
-
return s === fe.UP ? M.posOffset = ((A = M.posOffset) != null ? A : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ?
|
|
1489
|
+
const { positionH: O, positionV: D } = S.docTransform, T = { ...O }, M = { ...D };
|
|
1490
|
+
return s === fe.UP ? M.posOffset = ((A = M.posOffset) != null ? A : 0) - 2 : s === fe.DOWN ? M.posOffset = ((U = M.posOffset) != null ? U : 0) + 2 : s === fe.LEFT ? T.posOffset = ((N = T.posOffset) != null ? N : 0) - 2 : s === fe.RIGHT && (T.posOffset = ((I = T.posOffset) != null ? I : 0) + 2), {
|
|
1485
1491
|
drawingId: w,
|
|
1486
1492
|
key: s === fe.UP || s === fe.DOWN ? "positionV" : "positionH",
|
|
1487
|
-
value: s === fe.UP || s === fe.DOWN ? M :
|
|
1493
|
+
value: s === fe.UP || s === fe.DOWN ? M : T
|
|
1488
1494
|
};
|
|
1489
1495
|
}).filter((v) => v != null);
|
|
1490
1496
|
if (p.length === 0)
|
|
@@ -1494,9 +1500,9 @@ const lt = {
|
|
|
1494
1500
|
subUnitId: d,
|
|
1495
1501
|
drawings: p
|
|
1496
1502
|
});
|
|
1497
|
-
return
|
|
1503
|
+
return m.refreshControls(), !!h;
|
|
1498
1504
|
}
|
|
1499
|
-
},
|
|
1505
|
+
}, Hi = {
|
|
1500
1506
|
id: "doc.operation.clear-drawing-transformer",
|
|
1501
1507
|
type: K.MUTATION,
|
|
1502
1508
|
handler: (i, e) => {
|
|
@@ -1510,7 +1516,7 @@ const lt = {
|
|
|
1510
1516
|
id: "sidebar.operation.doc-image",
|
|
1511
1517
|
type: K.COMMAND,
|
|
1512
1518
|
handler: async (i, e) => {
|
|
1513
|
-
const n = i.get(
|
|
1519
|
+
const n = i.get(si), t = i.get(ln), r = i.get(Ie);
|
|
1514
1520
|
switch (e.value) {
|
|
1515
1521
|
case "open":
|
|
1516
1522
|
n.open({
|
|
@@ -1550,27 +1556,21 @@ function j() {
|
|
|
1550
1556
|
for (var i, e, n = 0, t = "", r = arguments.length; n < r; n++) (i = arguments[n]) && (e = ft(i)) && (t && (t += " "), t += e);
|
|
1551
1557
|
return t;
|
|
1552
1558
|
}
|
|
1553
|
-
const
|
|
1554
|
-
imageCommonPanel:
|
|
1555
|
-
imageCommonPanelGrid:
|
|
1556
|
-
imageCommonPanelBorder:
|
|
1557
|
-
imageCommonPanelTitle:
|
|
1558
|
-
imageCommonPanelSubtitle:
|
|
1559
|
-
imageCommonPanelRow:
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
imageCommonPanelInput: ir,
|
|
1567
|
-
sheetImageMenu: rr,
|
|
1568
|
-
sheetImageMenuInput: or
|
|
1569
|
-
}, Hn = -1e3, Wn = 1e3, sr = (i) => {
|
|
1570
|
-
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, c = s[0];
|
|
1571
|
-
if (c == null)
|
|
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) => {
|
|
1570
|
+
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
|
|
1571
|
+
if (a == null)
|
|
1572
1572
|
return;
|
|
1573
|
-
const { unitId: d } =
|
|
1573
|
+
const { unitId: d } = a, c = o.getUniverDocInstance(d), l = c == null ? void 0 : c.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), g = m == null ? void 0 : m.scene;
|
|
1574
1574
|
if (g == null)
|
|
1575
1575
|
return;
|
|
1576
1576
|
const p = g.getTransformerByCreate(), h = [{
|
|
@@ -1600,106 +1600,106 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1600
1600
|
}], [w, S] = re(!0), [O, D] = re({
|
|
1601
1601
|
relativeFrom: ne.PAGE,
|
|
1602
1602
|
posOffset: 0
|
|
1603
|
-
}), [
|
|
1603
|
+
}), [T, M] = re({
|
|
1604
1604
|
relativeFrom: V.PAGE,
|
|
1605
1605
|
posOffset: 0
|
|
1606
|
-
}), [
|
|
1606
|
+
}), [P, A] = re(!0), [U, N] = re(!0);
|
|
1607
1607
|
function I(C, R) {
|
|
1608
|
-
var
|
|
1608
|
+
var b;
|
|
1609
1609
|
C === "positionH" ? D(R) : M(R);
|
|
1610
|
-
const
|
|
1611
|
-
if (
|
|
1610
|
+
const y = t.getFocusDrawings();
|
|
1611
|
+
if (y.length === 0)
|
|
1612
1612
|
return;
|
|
1613
|
-
const B =
|
|
1613
|
+
const B = y.map((E) => ({
|
|
1614
1614
|
unitId: E.unitId,
|
|
1615
1615
|
subUnitId: E.subUnitId,
|
|
1616
1616
|
drawingId: E.drawingId
|
|
1617
1617
|
}));
|
|
1618
1618
|
e.executeCommand(qe.id, {
|
|
1619
|
-
unitId:
|
|
1620
|
-
subUnitId:
|
|
1619
|
+
unitId: y[0].unitId,
|
|
1620
|
+
subUnitId: y[0].unitId,
|
|
1621
1621
|
drawings: B.map((E) => ({
|
|
1622
1622
|
drawingId: E.drawingId,
|
|
1623
1623
|
key: C,
|
|
1624
1624
|
value: R
|
|
1625
1625
|
}))
|
|
1626
1626
|
});
|
|
1627
|
-
const
|
|
1628
|
-
|
|
1627
|
+
const k = (b = r.getRenderById(d)) == null ? void 0 : b.with(Me);
|
|
1628
|
+
k && k.blur(), p.refreshControls();
|
|
1629
1629
|
}
|
|
1630
1630
|
function L(C) {
|
|
1631
1631
|
var ie, _e, Se;
|
|
1632
|
-
const R = O.relativeFrom,
|
|
1632
|
+
const R = O.relativeFrom, y = O.posOffset, B = Number(C);
|
|
1633
1633
|
if (R === B)
|
|
1634
1634
|
return;
|
|
1635
|
-
const
|
|
1636
|
-
if (
|
|
1635
|
+
const k = t.getFocusDrawings();
|
|
1636
|
+
if (k.length === 0)
|
|
1637
1637
|
return;
|
|
1638
|
-
const
|
|
1639
|
-
let $ = null,
|
|
1638
|
+
const b = k[0].drawingId, E = k[0].unitId;
|
|
1639
|
+
let $ = null, F = 0;
|
|
1640
1640
|
const Y = (ie = r.getRenderById(E)) == null ? void 0 : ie.with(se).getSkeleton(), ae = Y == null ? void 0 : Y.getSkeletonData();
|
|
1641
1641
|
if (ae == null)
|
|
1642
1642
|
return;
|
|
1643
1643
|
const { pages: Ue, skeHeaders: Re, skeFooters: We } = ae;
|
|
1644
1644
|
for (const de of Ue) {
|
|
1645
|
-
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth:
|
|
1646
|
-
if (Oe.has(
|
|
1647
|
-
$ = Oe.get(
|
|
1645
|
+
const { marginLeft: De, skeDrawings: Oe, headerId: Ne, footerId: Ae, pageWidth: Te } = de;
|
|
1646
|
+
if (Oe.has(b)) {
|
|
1647
|
+
$ = Oe.get(b), F = De;
|
|
1648
1648
|
break;
|
|
1649
1649
|
}
|
|
1650
|
-
const le = (_e = Re.get(Ne)) == null ? void 0 : _e.get(
|
|
1651
|
-
if (le != null && le.skeDrawings.has(
|
|
1652
|
-
$ = le == null ? void 0 : le.skeDrawings.get(
|
|
1650
|
+
const le = (_e = Re.get(Ne)) == null ? void 0 : _e.get(Te);
|
|
1651
|
+
if (le != null && le.skeDrawings.has(b)) {
|
|
1652
|
+
$ = le == null ? void 0 : le.skeDrawings.get(b), F = De;
|
|
1653
1653
|
break;
|
|
1654
1654
|
}
|
|
1655
|
-
const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(
|
|
1656
|
-
if (ge != null && ge.skeDrawings.has(
|
|
1657
|
-
$ = ge == null ? void 0 : ge.skeDrawings.get(
|
|
1655
|
+
const ge = (Se = We.get(Ae)) == null ? void 0 : Se.get(Te);
|
|
1656
|
+
if (ge != null && ge.skeDrawings.has(b)) {
|
|
1657
|
+
$ = ge == null ? void 0 : ge.skeDrawings.get(b), F = De;
|
|
1658
1658
|
break;
|
|
1659
1659
|
}
|
|
1660
1660
|
}
|
|
1661
1661
|
if ($ == null)
|
|
1662
1662
|
return;
|
|
1663
1663
|
let ce = 0;
|
|
1664
|
-
R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -=
|
|
1664
|
+
R === ne.COLUMN ? ce -= $.columnLeft : R === ne.MARGIN && (ce -= F), B === ne.COLUMN ? ce += $.columnLeft : B === ne.MARGIN ? ce += F : ne.PAGE;
|
|
1665
1665
|
const te = {
|
|
1666
1666
|
relativeFrom: B,
|
|
1667
|
-
posOffset: (
|
|
1667
|
+
posOffset: (y != null ? y : 0) - ce
|
|
1668
1668
|
};
|
|
1669
1669
|
I("positionH", te);
|
|
1670
1670
|
}
|
|
1671
1671
|
function W(C) {
|
|
1672
|
-
var Oe, Ne, Ae,
|
|
1673
|
-
const R =
|
|
1672
|
+
var Oe, Ne, Ae, Te, le, ge;
|
|
1673
|
+
const R = T.relativeFrom, y = T.posOffset, B = Number(C);
|
|
1674
1674
|
if (R === B)
|
|
1675
1675
|
return;
|
|
1676
|
-
const
|
|
1677
|
-
if (
|
|
1676
|
+
const k = t.getFocusDrawings();
|
|
1677
|
+
if (k.length === 0)
|
|
1678
1678
|
return;
|
|
1679
|
-
const { drawingId:
|
|
1680
|
-
if (Re == null ||
|
|
1679
|
+
const { drawingId: b, unitId: E } = k[0], $ = o.getUniverDocInstance(E), F = (Oe = r.getRenderById(E)) == null ? void 0 : Oe.with(se).getSkeleton(), Y = (Ne = r.getRenderById(E)) == null ? void 0 : Ne.with(Me), ae = Y == null ? void 0 : Y.getSegment(), Ue = Y == null ? void 0 : Y.getSegmentPage(), Re = (Te = (Ae = $ == null ? void 0 : $.getSelfOrHeaderFooterModel(ae).getBody()) == null ? void 0 : Ae.customBlocks) == null ? void 0 : Te.find((Ee) => Ee.blockId === b);
|
|
1680
|
+
if (Re == null || F == null || Y == null)
|
|
1681
1681
|
return;
|
|
1682
|
-
const { startIndex: We } = Re, ce =
|
|
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((Ee) => Ee.paragraphIndex === (te == null ? void 0 : te.paragraphIndex) && Ee.paragraphStart), Se = (ge = ie == null ? void 0 : ie.parent) == null ? void 0 : ge.parent;
|
|
1683
1683
|
if (ce == null || te == null || _e == null || ie == null || Se == null)
|
|
1684
1684
|
return;
|
|
1685
1685
|
let de = 0;
|
|
1686
1686
|
R === V.PARAGRAPH ? de -= _e.top : R === V.LINE ? de -= te.top : R === V.PAGE && (de += Se.marginTop), B === V.PARAGRAPH ? de += _e.top : B === V.LINE ? de += te.top : B === V.PAGE && (de -= Se.marginTop);
|
|
1687
1687
|
const De = {
|
|
1688
1688
|
relativeFrom: B,
|
|
1689
|
-
posOffset: (
|
|
1689
|
+
posOffset: (y != null ? y : 0) - de
|
|
1690
1690
|
};
|
|
1691
1691
|
I("positionV", De);
|
|
1692
1692
|
}
|
|
1693
1693
|
function x(C) {
|
|
1694
1694
|
var E;
|
|
1695
|
-
const R =
|
|
1696
|
-
if (
|
|
1695
|
+
const R = c == null ? void 0 : c.getSnapshot(), y = (E = R == null ? void 0 : R.drawings) == null ? void 0 : E[C.drawingId];
|
|
1696
|
+
if (y == null)
|
|
1697
1697
|
return;
|
|
1698
|
-
const { layoutType: B } =
|
|
1699
|
-
positionH:
|
|
1700
|
-
positionV:
|
|
1701
|
-
} =
|
|
1702
|
-
D(
|
|
1698
|
+
const { layoutType: B } = y, {
|
|
1699
|
+
positionH: k,
|
|
1700
|
+
positionV: b
|
|
1701
|
+
} = y.docTransform;
|
|
1702
|
+
D(k), M(b), S(B === H.INLINE), A(b.relativeFrom === V.PARAGRAPH || b.relativeFrom === V.LINE);
|
|
1703
1703
|
}
|
|
1704
1704
|
function G() {
|
|
1705
1705
|
const C = t.getFocusDrawings();
|
|
@@ -1710,26 +1710,26 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1710
1710
|
}
|
|
1711
1711
|
return _n(() => {
|
|
1712
1712
|
G();
|
|
1713
|
-
const C = t.focus$.subscribe((
|
|
1714
|
-
if (
|
|
1713
|
+
const C = t.focus$.subscribe((y) => {
|
|
1714
|
+
if (y.length === 0) {
|
|
1715
1715
|
N(!1);
|
|
1716
1716
|
return;
|
|
1717
1717
|
}
|
|
1718
|
-
N(!0), x(
|
|
1719
|
-
}), R = e.onCommandExecuted(async (
|
|
1720
|
-
|
|
1718
|
+
N(!0), x(y[0]);
|
|
1719
|
+
}), R = e.onCommandExecuted(async (y) => {
|
|
1720
|
+
y.id === J.id && G();
|
|
1721
1721
|
});
|
|
1722
1722
|
return () => {
|
|
1723
1723
|
C.unsubscribe(), R.dispose();
|
|
1724
1724
|
};
|
|
1725
|
-
}, []), /* @__PURE__ */ X("div", { className: j(
|
|
1726
|
-
/* @__PURE__ */ f("div", { className:
|
|
1727
|
-
/* @__PURE__ */ f("div", { className:
|
|
1728
|
-
/* @__PURE__ */ X("div", { className:
|
|
1729
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1730
|
-
/* @__PURE__ */ f("div", { className:
|
|
1731
|
-
/* @__PURE__ */ f("div", { className:
|
|
1732
|
-
|
|
1725
|
+
}, []), /* @__PURE__ */ X("div", { className: j(u.imageCommonPanelGrid, u.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
|
|
1726
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.title") }) }) }),
|
|
1727
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.horizontal") }) }) }),
|
|
1728
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1729
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1730
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1731
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1732
|
+
ke,
|
|
1733
1733
|
{
|
|
1734
1734
|
min: Hn,
|
|
1735
1735
|
max: Wn,
|
|
@@ -1742,13 +1742,13 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1742
1742
|
posOffset: C
|
|
1743
1743
|
});
|
|
1744
1744
|
},
|
|
1745
|
-
className:
|
|
1745
|
+
className: u.imageCommonPanelInput
|
|
1746
1746
|
}
|
|
1747
1747
|
) }) })
|
|
1748
1748
|
] }) }),
|
|
1749
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1750
|
-
/* @__PURE__ */ f("div", { className:
|
|
1751
|
-
/* @__PURE__ */ f("div", { className:
|
|
1749
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1750
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
|
|
1751
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1752
1752
|
Bn,
|
|
1753
1753
|
{
|
|
1754
1754
|
value: String(O.relativeFrom),
|
|
@@ -1759,52 +1759,52 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1759
1759
|
) }) })
|
|
1760
1760
|
] }) })
|
|
1761
1761
|
] }),
|
|
1762
|
-
/* @__PURE__ */ f("div", { className:
|
|
1763
|
-
/* @__PURE__ */ X("div", { className:
|
|
1764
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1765
|
-
/* @__PURE__ */ f("div", { className:
|
|
1766
|
-
/* @__PURE__ */ f("div", { className:
|
|
1767
|
-
|
|
1762
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.vertical") }) }) }),
|
|
1763
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1764
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1765
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1766
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1767
|
+
ke,
|
|
1768
1768
|
{
|
|
1769
1769
|
min: Hn,
|
|
1770
1770
|
max: Wn,
|
|
1771
1771
|
precision: 1,
|
|
1772
1772
|
disabled: w,
|
|
1773
|
-
value:
|
|
1773
|
+
value: T.posOffset,
|
|
1774
1774
|
onChange: (C) => {
|
|
1775
1775
|
I("positionV", {
|
|
1776
|
-
relativeFrom:
|
|
1776
|
+
relativeFrom: T.relativeFrom,
|
|
1777
1777
|
posOffset: C
|
|
1778
1778
|
});
|
|
1779
1779
|
},
|
|
1780
|
-
className:
|
|
1780
|
+
className: u.imageCommonPanelInput
|
|
1781
1781
|
}
|
|
1782
1782
|
) }) })
|
|
1783
1783
|
] }) }),
|
|
1784
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1785
|
-
/* @__PURE__ */ f("div", { className:
|
|
1786
|
-
/* @__PURE__ */ f("div", { className:
|
|
1784
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1785
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
|
|
1786
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1787
1787
|
Bn,
|
|
1788
1788
|
{
|
|
1789
1789
|
disabled: w,
|
|
1790
|
-
value: String(
|
|
1790
|
+
value: String(T.relativeFrom),
|
|
1791
1791
|
options: v,
|
|
1792
1792
|
onChange: W
|
|
1793
1793
|
}
|
|
1794
1794
|
) }) })
|
|
1795
1795
|
] }) })
|
|
1796
1796
|
] }),
|
|
1797
|
-
/* @__PURE__ */ f("div", { className:
|
|
1798
|
-
/* @__PURE__ */ f("div", { className:
|
|
1797
|
+
/* @__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(Ci, { disabled: w, checked: P, onChange: _, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1799
1799
|
] });
|
|
1800
|
-
}, Je = 0, en = 100,
|
|
1801
|
-
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i,
|
|
1802
|
-
if (
|
|
1800
|
+
}, Je = 0, en = 100, Zi = (i) => {
|
|
1801
|
+
const e = we(z), n = we(ln), t = we(Ie), r = we(ee), o = we(Q), { drawings: s } = i, a = s[0];
|
|
1802
|
+
if (a == null)
|
|
1803
1803
|
return null;
|
|
1804
|
-
const { unitId: d } =
|
|
1804
|
+
const { unitId: d } = a, c = o.getUniverDocInstance(d), l = r.getRenderById(d);
|
|
1805
1805
|
if ((l == null ? void 0 : l.scene) == null)
|
|
1806
1806
|
return null;
|
|
1807
|
-
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [
|
|
1807
|
+
const [g, p] = re(!0), [h, v] = re(!0), [w, S] = re(!0), [O, D] = re(ue.INLINE), [T, M] = re(""), [P, A] = re({
|
|
1808
1808
|
distT: 0,
|
|
1809
1809
|
distL: 0,
|
|
1810
1810
|
distB: 0,
|
|
@@ -1815,14 +1815,14 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1815
1815
|
const C = t.getFocusDrawings();
|
|
1816
1816
|
if (C.length === 0)
|
|
1817
1817
|
return;
|
|
1818
|
-
const { unitId: R, subUnitId:
|
|
1819
|
-
unitId:
|
|
1820
|
-
subUnitId:
|
|
1818
|
+
const { unitId: R, subUnitId: y } = C[0], B = C.map(({ unitId: k, subUnitId: b, drawingId: E }) => ({
|
|
1819
|
+
unitId: k,
|
|
1820
|
+
subUnitId: b,
|
|
1821
1821
|
drawingId: E
|
|
1822
1822
|
}));
|
|
1823
1823
|
e.executeCommand(Zn.id, {
|
|
1824
1824
|
unitId: R,
|
|
1825
|
-
subUnitId:
|
|
1825
|
+
subUnitId: y,
|
|
1826
1826
|
drawings: B,
|
|
1827
1827
|
wrappingStyle: _
|
|
1828
1828
|
});
|
|
@@ -1832,10 +1832,10 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1832
1832
|
const C = t.getFocusDrawings();
|
|
1833
1833
|
if (C.length === 0)
|
|
1834
1834
|
return;
|
|
1835
|
-
const R = C.map((
|
|
1836
|
-
unitId:
|
|
1837
|
-
subUnitId:
|
|
1838
|
-
drawingId:
|
|
1835
|
+
const R = C.map((y) => ({
|
|
1836
|
+
unitId: y.unitId,
|
|
1837
|
+
subUnitId: y.subUnitId,
|
|
1838
|
+
drawingId: y.drawingId
|
|
1839
1839
|
}));
|
|
1840
1840
|
e.executeCommand(Jn.id, {
|
|
1841
1841
|
unitId: C[0].unitId,
|
|
@@ -1847,19 +1847,19 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1847
1847
|
function W(_, C) {
|
|
1848
1848
|
if (_ == null)
|
|
1849
1849
|
return;
|
|
1850
|
-
const R = { ...
|
|
1850
|
+
const R = { ...P, [C]: _ };
|
|
1851
1851
|
A(R);
|
|
1852
|
-
const
|
|
1853
|
-
if (
|
|
1852
|
+
const y = t.getFocusDrawings();
|
|
1853
|
+
if (y.length === 0)
|
|
1854
1854
|
return;
|
|
1855
|
-
const B =
|
|
1856
|
-
unitId:
|
|
1857
|
-
subUnitId:
|
|
1858
|
-
drawingId:
|
|
1855
|
+
const B = y.map((k) => ({
|
|
1856
|
+
unitId: k.unitId,
|
|
1857
|
+
subUnitId: k.subUnitId,
|
|
1858
|
+
drawingId: k.drawingId
|
|
1859
1859
|
}));
|
|
1860
1860
|
e.executeCommand(Qn.id, {
|
|
1861
|
-
unitId:
|
|
1862
|
-
subUnitId:
|
|
1861
|
+
unitId: y[0].unitId,
|
|
1862
|
+
subUnitId: y[0].unitId,
|
|
1863
1863
|
drawings: B,
|
|
1864
1864
|
dist: {
|
|
1865
1865
|
[C]: _
|
|
@@ -1872,27 +1872,27 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1872
1872
|
}
|
|
1873
1873
|
function G(_) {
|
|
1874
1874
|
var Y, ae;
|
|
1875
|
-
const C = (ae = (Y =
|
|
1875
|
+
const C = (ae = (Y = c == null ? void 0 : c.getSnapshot()) == null ? void 0 : Y.drawings) == null ? void 0 : ae[_.drawingId];
|
|
1876
1876
|
if (C == null)
|
|
1877
1877
|
return;
|
|
1878
1878
|
const {
|
|
1879
1879
|
distT: R = 0,
|
|
1880
|
-
distL:
|
|
1880
|
+
distL: y = 0,
|
|
1881
1881
|
distB: B = 0,
|
|
1882
|
-
distR:
|
|
1883
|
-
layoutType:
|
|
1882
|
+
distR: k = 0,
|
|
1883
|
+
layoutType: b = H.INLINE,
|
|
1884
1884
|
behindDoc: E = oe.FALSE,
|
|
1885
1885
|
wrapText: $ = $e.BOTH_SIDES
|
|
1886
1886
|
} = C;
|
|
1887
1887
|
if (A({
|
|
1888
1888
|
distT: R,
|
|
1889
|
-
distL:
|
|
1889
|
+
distL: y,
|
|
1890
1890
|
distB: B,
|
|
1891
|
-
distR:
|
|
1892
|
-
}), M($), p(
|
|
1891
|
+
distR: k
|
|
1892
|
+
}), 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
1893
|
E === oe.TRUE ? D(ue.BEHIND_TEXT) : D(ue.IN_FRONT_OF_TEXT);
|
|
1894
1894
|
else
|
|
1895
|
-
switch (
|
|
1895
|
+
switch (b) {
|
|
1896
1896
|
case H.INLINE:
|
|
1897
1897
|
D(ue.INLINE);
|
|
1898
1898
|
break;
|
|
@@ -1903,7 +1903,7 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1903
1903
|
D(ue.WRAP_TOP_AND_BOTTOM);
|
|
1904
1904
|
break;
|
|
1905
1905
|
default:
|
|
1906
|
-
throw new Error(`Unsupported layout type: ${
|
|
1906
|
+
throw new Error(`Unsupported layout type: ${b}`);
|
|
1907
1907
|
}
|
|
1908
1908
|
}
|
|
1909
1909
|
return _n(() => {
|
|
@@ -1920,97 +1920,97 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
1920
1920
|
return () => {
|
|
1921
1921
|
_.unsubscribe(), C.dispose();
|
|
1922
1922
|
};
|
|
1923
|
-
}, []), /* @__PURE__ */ X("div", { className: j(
|
|
1924
|
-
/* @__PURE__ */ f("div", { className:
|
|
1925
|
-
/* @__PURE__ */ f("div", { className:
|
|
1926
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1927
|
-
/* @__PURE__ */ f(
|
|
1928
|
-
/* @__PURE__ */ f(
|
|
1929
|
-
/* @__PURE__ */ f(
|
|
1930
|
-
/* @__PURE__ */ f(
|
|
1931
|
-
/* @__PURE__ */ f(
|
|
1923
|
+
}, []), /* @__PURE__ */ X("div", { className: j(u.imageCommonPanelGrid, u.imageCommonPanelBorder), style: { display: U ? "block" : "none" }, children: [
|
|
1924
|
+
/* @__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
|
+
/* @__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
|
+
/* @__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(ye, { value: ue.INLINE, children: n.t("image-text-wrap.inline") }),
|
|
1928
|
+
/* @__PURE__ */ f(ye, { value: ue.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
|
|
1929
|
+
/* @__PURE__ */ f(ye, { value: ue.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
|
|
1930
|
+
/* @__PURE__ */ f(ye, { value: ue.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
|
|
1931
|
+
/* @__PURE__ */ f(ye, { value: ue.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1932
1932
|
] }) }) }),
|
|
1933
|
-
/* @__PURE__ */ f("div", { className:
|
|
1934
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1935
|
-
/* @__PURE__ */ f(
|
|
1936
|
-
/* @__PURE__ */ f(
|
|
1937
|
-
/* @__PURE__ */ f(
|
|
1933
|
+
/* @__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
|
+
/* @__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(ye, { value: $e.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1936
|
+
/* @__PURE__ */ f(ye, { value: $e.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1937
|
+
/* @__PURE__ */ f(ye, { value: $e.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
1938
1938
|
] }) }) }),
|
|
1939
|
-
/* @__PURE__ */ f("div", { className:
|
|
1940
|
-
/* @__PURE__ */ X("div", { className:
|
|
1941
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1942
|
-
/* @__PURE__ */ f("div", { className:
|
|
1943
|
-
/* @__PURE__ */ f("div", { className:
|
|
1944
|
-
|
|
1939
|
+
/* @__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
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1941
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1942
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
|
|
1943
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1944
|
+
ke,
|
|
1945
1945
|
{
|
|
1946
1946
|
min: Je,
|
|
1947
1947
|
max: en,
|
|
1948
1948
|
disabled: h,
|
|
1949
1949
|
precision: 1,
|
|
1950
|
-
value:
|
|
1950
|
+
value: P.distT,
|
|
1951
1951
|
onChange: (_) => {
|
|
1952
1952
|
W(_, "distT");
|
|
1953
1953
|
},
|
|
1954
|
-
className:
|
|
1954
|
+
className: u.imageCommonPanelInput
|
|
1955
1955
|
}
|
|
1956
1956
|
) }) })
|
|
1957
1957
|
] }) }),
|
|
1958
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1959
|
-
/* @__PURE__ */ f("div", { className:
|
|
1960
|
-
/* @__PURE__ */ f("div", { className:
|
|
1961
|
-
|
|
1958
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1959
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
|
|
1960
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1961
|
+
ke,
|
|
1962
1962
|
{
|
|
1963
1963
|
min: Je,
|
|
1964
1964
|
max: en,
|
|
1965
1965
|
disabled: w,
|
|
1966
1966
|
precision: 1,
|
|
1967
|
-
value:
|
|
1967
|
+
value: P.distL,
|
|
1968
1968
|
onChange: (_) => {
|
|
1969
1969
|
W(_, "distL");
|
|
1970
1970
|
},
|
|
1971
|
-
className:
|
|
1971
|
+
className: u.imageCommonPanelInput
|
|
1972
1972
|
}
|
|
1973
1973
|
) }) })
|
|
1974
1974
|
] }) })
|
|
1975
1975
|
] }),
|
|
1976
|
-
/* @__PURE__ */ X("div", { className:
|
|
1977
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1978
|
-
/* @__PURE__ */ f("div", { className:
|
|
1979
|
-
/* @__PURE__ */ f("div", { className:
|
|
1980
|
-
|
|
1976
|
+
/* @__PURE__ */ X("div", { className: u.imageCommonPanelRow, children: [
|
|
1977
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1978
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
|
|
1979
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1980
|
+
ke,
|
|
1981
1981
|
{
|
|
1982
1982
|
min: Je,
|
|
1983
1983
|
max: en,
|
|
1984
1984
|
disabled: h,
|
|
1985
1985
|
precision: 1,
|
|
1986
|
-
value:
|
|
1986
|
+
value: P.distB,
|
|
1987
1987
|
onChange: (_) => {
|
|
1988
1988
|
W(_, "distB");
|
|
1989
1989
|
},
|
|
1990
|
-
className:
|
|
1990
|
+
className: u.imageCommonPanelInput
|
|
1991
1991
|
}
|
|
1992
1992
|
) }) })
|
|
1993
1993
|
] }) }),
|
|
1994
|
-
/* @__PURE__ */ f("div", { className: j(
|
|
1995
|
-
/* @__PURE__ */ f("div", { className:
|
|
1996
|
-
/* @__PURE__ */ f("div", { className:
|
|
1997
|
-
|
|
1994
|
+
/* @__PURE__ */ f("div", { className: j(u.imageCommonPanelColumn, u.imageCommonPanelSpan2), children: /* @__PURE__ */ X("label", { children: [
|
|
1995
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
|
|
1996
|
+
/* @__PURE__ */ f("div", { className: u.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: u.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1997
|
+
ke,
|
|
1998
1998
|
{
|
|
1999
1999
|
min: Je,
|
|
2000
2000
|
max: en,
|
|
2001
2001
|
disabled: w,
|
|
2002
2002
|
precision: 1,
|
|
2003
|
-
value:
|
|
2003
|
+
value: P.distR,
|
|
2004
2004
|
onChange: (_) => {
|
|
2005
2005
|
W(_, "distR");
|
|
2006
2006
|
},
|
|
2007
|
-
className:
|
|
2007
|
+
className: u.imageCommonPanelInput
|
|
2008
2008
|
}
|
|
2009
2009
|
) }) })
|
|
2010
2010
|
] }) })
|
|
2011
2011
|
] })
|
|
2012
2012
|
] });
|
|
2013
|
-
},
|
|
2013
|
+
}, Qi = () => {
|
|
2014
2014
|
const i = we(Ie), e = i.getFocusDrawings(), [n, t] = re(e);
|
|
2015
2015
|
return _n(() => {
|
|
2016
2016
|
const r = i.focus$.subscribe((o) => {
|
|
@@ -2019,22 +2019,22 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
2019
2019
|
return () => {
|
|
2020
2020
|
r.unsubscribe();
|
|
2021
2021
|
};
|
|
2022
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className:
|
|
2023
|
-
/* @__PURE__ */ f(
|
|
2024
|
-
/* @__PURE__ */ f(
|
|
2025
|
-
/* @__PURE__ */ f(
|
|
2022
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ X("div", { className: u.imageCommonPanel, children: [
|
|
2023
|
+
/* @__PURE__ */ f(Xt, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
2024
|
+
/* @__PURE__ */ f(Zi, { drawings: n }),
|
|
2025
|
+
/* @__PURE__ */ f(Yi, { drawings: n })
|
|
2026
2026
|
] });
|
|
2027
|
-
}, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id,
|
|
2027
|
+
}, ht = "addition-and-subtraction-single", pt = "doc.menu.image", wt = lt.id, Ji = (i) => {
|
|
2028
2028
|
const e = i.get(In), n = i.get(Q);
|
|
2029
|
-
return new
|
|
2029
|
+
return new Si((t) => {
|
|
2030
2030
|
const r = e.textSelection$.subscribe(() => {
|
|
2031
2031
|
var s;
|
|
2032
2032
|
const o = e.getActiveTextRange();
|
|
2033
2033
|
if (o) {
|
|
2034
|
-
const { segmentId:
|
|
2035
|
-
if (
|
|
2034
|
+
const { segmentId: a, startOffset: d, endOffset: c } = o, l = n.getCurrentUniverDocInstance(), m = (s = l == null ? void 0 : l.getSelfOrHeaderFooterModel(a).getBody()) == null ? void 0 : s.tables;
|
|
2035
|
+
if (m && m.length && m.some((g) => {
|
|
2036
2036
|
const { startIndex: p, endIndex: h } = g;
|
|
2037
|
-
return d >= p && d < h ||
|
|
2037
|
+
return d >= p && d < h || c >= p && c < h;
|
|
2038
2038
|
})) {
|
|
2039
2039
|
t.next(!0);
|
|
2040
2040
|
return;
|
|
@@ -2048,40 +2048,40 @@ const $i = "univer-image-common-panel", zi = "univer-image-common-panel-grid", q
|
|
|
2048
2048
|
return () => r.unsubscribe();
|
|
2049
2049
|
});
|
|
2050
2050
|
};
|
|
2051
|
-
function
|
|
2051
|
+
function er(i) {
|
|
2052
2052
|
return {
|
|
2053
2053
|
id: pt,
|
|
2054
|
-
type:
|
|
2054
|
+
type: zn.SUBITEMS,
|
|
2055
2055
|
icon: ht,
|
|
2056
2056
|
tooltip: "docImage.title",
|
|
2057
|
-
disabled$:
|
|
2058
|
-
hidden$:
|
|
2057
|
+
disabled$: Ji(i),
|
|
2058
|
+
hidden$: $n(i, be.UNIVER_DOC)
|
|
2059
2059
|
};
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2061
|
+
function nr(i) {
|
|
2062
2062
|
return {
|
|
2063
2063
|
id: wt,
|
|
2064
2064
|
title: "docImage.upload.float",
|
|
2065
|
-
type:
|
|
2066
|
-
hidden$:
|
|
2065
|
+
type: zn.BUTTON,
|
|
2066
|
+
hidden$: $n(i, be.UNIVER_DOC)
|
|
2067
2067
|
};
|
|
2068
2068
|
}
|
|
2069
|
-
const
|
|
2070
|
-
[
|
|
2069
|
+
const tr = {
|
|
2070
|
+
[ai.LAYOUT]: {
|
|
2071
2071
|
[pt]: {
|
|
2072
2072
|
order: 0,
|
|
2073
|
-
menuItemFactory:
|
|
2073
|
+
menuItemFactory: er,
|
|
2074
2074
|
[wt]: {
|
|
2075
2075
|
order: 0,
|
|
2076
|
-
menuItemFactory:
|
|
2076
|
+
menuItemFactory: nr
|
|
2077
2077
|
}
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
2080
|
};
|
|
2081
2081
|
function Ye(i) {
|
|
2082
|
-
return i.getContextValue(
|
|
2082
|
+
return i.getContextValue(Rt) && i.getContextValue(tn);
|
|
2083
2083
|
}
|
|
2084
|
-
const
|
|
2084
|
+
const ir = {
|
|
2085
2085
|
id: Ke.id,
|
|
2086
2086
|
description: "shortcut.doc.drawing-move-down",
|
|
2087
2087
|
group: "4_doc-drawing-view",
|
|
@@ -2091,7 +2091,7 @@ const ur = {
|
|
|
2091
2091
|
staticParameters: {
|
|
2092
2092
|
direction: fe.DOWN
|
|
2093
2093
|
}
|
|
2094
|
-
},
|
|
2094
|
+
}, rr = {
|
|
2095
2095
|
id: Ke.id,
|
|
2096
2096
|
description: "shortcut.doc.drawing-move-up",
|
|
2097
2097
|
group: "4_doc-drawing-view",
|
|
@@ -2101,7 +2101,7 @@ const ur = {
|
|
|
2101
2101
|
staticParameters: {
|
|
2102
2102
|
direction: fe.UP
|
|
2103
2103
|
}
|
|
2104
|
-
},
|
|
2104
|
+
}, or = {
|
|
2105
2105
|
id: Ke.id,
|
|
2106
2106
|
description: "shortcut.doc.drawing-move-left",
|
|
2107
2107
|
group: "4_doc-drawing-view",
|
|
@@ -2111,7 +2111,7 @@ const ur = {
|
|
|
2111
2111
|
staticParameters: {
|
|
2112
2112
|
direction: fe.LEFT
|
|
2113
2113
|
}
|
|
2114
|
-
},
|
|
2114
|
+
}, sr = {
|
|
2115
2115
|
id: Ke.id,
|
|
2116
2116
|
description: "shortcut.doc.drawing-move-right",
|
|
2117
2117
|
group: "4_doc-drawing-view",
|
|
@@ -2121,7 +2121,7 @@ const ur = {
|
|
|
2121
2121
|
staticParameters: {
|
|
2122
2122
|
direction: fe.RIGHT
|
|
2123
2123
|
}
|
|
2124
|
-
},
|
|
2124
|
+
}, ar = {
|
|
2125
2125
|
id: ot.id,
|
|
2126
2126
|
description: "shortcut.doc.drawing-delete",
|
|
2127
2127
|
group: "4_doc-drawing-view",
|
|
@@ -2130,10 +2130,10 @@ const ur = {
|
|
|
2130
2130
|
binding: He.DELETE,
|
|
2131
2131
|
mac: He.BACKSPACE
|
|
2132
2132
|
};
|
|
2133
|
-
var
|
|
2134
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2135
|
-
(s = i[o]) && (r =
|
|
2136
|
-
return
|
|
2133
|
+
var cr = Object.getOwnPropertyDescriptor, dr = (i, e, n, t) => {
|
|
2134
|
+
for (var r = t > 1 ? void 0 : t ? cr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2135
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2136
|
+
return r;
|
|
2137
2137
|
}, nn = (i, e) => (n, t) => e(n, t, i);
|
|
2138
2138
|
let an = class extends Xe {
|
|
2139
2139
|
constructor(i, e, n, t) {
|
|
@@ -2141,10 +2141,10 @@ let an = class extends Xe {
|
|
|
2141
2141
|
}
|
|
2142
2142
|
_initCustomComponents() {
|
|
2143
2143
|
const i = this._componentManager;
|
|
2144
|
-
this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt,
|
|
2144
|
+
this.disposeWithMe(i.register(ht, rt)), this.disposeWithMe(i.register(gt, Qi));
|
|
2145
2145
|
}
|
|
2146
2146
|
_initMenus() {
|
|
2147
|
-
this._menuManagerService.mergeMenu(
|
|
2147
|
+
this._menuManagerService.mergeMenu(tr);
|
|
2148
2148
|
}
|
|
2149
2149
|
_initCommands() {
|
|
2150
2150
|
[
|
|
@@ -2158,7 +2158,7 @@ let an = class extends Xe {
|
|
|
2158
2158
|
nt,
|
|
2159
2159
|
Sn,
|
|
2160
2160
|
mt,
|
|
2161
|
-
|
|
2161
|
+
Hi,
|
|
2162
2162
|
ut,
|
|
2163
2163
|
st,
|
|
2164
2164
|
dt,
|
|
@@ -2170,11 +2170,11 @@ let an = class extends Xe {
|
|
|
2170
2170
|
_initShortcuts() {
|
|
2171
2171
|
[
|
|
2172
2172
|
// sheet drawing shortcuts
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2173
|
+
ir,
|
|
2174
|
+
rr,
|
|
2175
|
+
or,
|
|
2176
|
+
sr,
|
|
2177
|
+
ar
|
|
2178
2178
|
].forEach((i) => {
|
|
2179
2179
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
2180
2180
|
});
|
|
@@ -2183,25 +2183,25 @@ let an = class extends Xe {
|
|
|
2183
2183
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
2184
2184
|
}
|
|
2185
2185
|
};
|
|
2186
|
-
an =
|
|
2187
|
-
nn(0, ve(
|
|
2188
|
-
nn(1,
|
|
2186
|
+
an = dr([
|
|
2187
|
+
nn(0, ve(ci)),
|
|
2188
|
+
nn(1, di),
|
|
2189
2189
|
nn(2, z),
|
|
2190
|
-
nn(3,
|
|
2190
|
+
nn(3, li)
|
|
2191
2191
|
], an);
|
|
2192
|
-
var
|
|
2193
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2194
|
-
(s = i[o]) && (r =
|
|
2195
|
-
return
|
|
2192
|
+
var lr = Object.getOwnPropertyDescriptor, gr = (i, e, n, t) => {
|
|
2193
|
+
for (var r = t > 1 ? void 0 : t ? lr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2194
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2195
|
+
return r;
|
|
2196
2196
|
}, je = (i, e) => (n, t) => e(n, t, i);
|
|
2197
|
-
let cn = class extends
|
|
2197
|
+
let cn = class extends Nt {
|
|
2198
2198
|
constructor(e, n, t, r, o) {
|
|
2199
2199
|
super();
|
|
2200
2200
|
Ce(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
2201
2201
|
this._drawingManagerService = e, this._canvasPopManagerService = n, this._renderManagerService = t, this._univerInstanceService = r, this._contextService = o, this._init();
|
|
2202
2202
|
}
|
|
2203
2203
|
_init() {
|
|
2204
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
2204
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(En(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
|
|
2205
2205
|
}
|
|
2206
2206
|
_dispose(e) {
|
|
2207
2207
|
const n = e.getUnitId();
|
|
@@ -2216,7 +2216,7 @@ let cn = class extends At {
|
|
|
2216
2216
|
_hasCropObject(e) {
|
|
2217
2217
|
const n = e.getAllObjects();
|
|
2218
2218
|
for (const t of n)
|
|
2219
|
-
if (t instanceof
|
|
2219
|
+
if (t instanceof Kt)
|
|
2220
2220
|
return !0;
|
|
2221
2221
|
return !1;
|
|
2222
2222
|
}
|
|
@@ -2238,27 +2238,27 @@ let cn = class extends At {
|
|
|
2238
2238
|
const s = t.getSelectedObjectMap();
|
|
2239
2239
|
if (r.forEach((w) => w.dispose()), r.length = 0, s.size > 1)
|
|
2240
2240
|
return;
|
|
2241
|
-
const
|
|
2242
|
-
if (!c)
|
|
2243
|
-
return;
|
|
2244
|
-
const d = c.oKey, a = this._drawingManagerService.getDrawingOKey(d);
|
|
2241
|
+
const a = s.values().next().value;
|
|
2245
2242
|
if (!a)
|
|
2246
2243
|
return;
|
|
2247
|
-
const
|
|
2248
|
-
|
|
2244
|
+
const d = a.oKey, c = this._drawingManagerService.getDrawingOKey(d);
|
|
2245
|
+
if (!c)
|
|
2246
|
+
return;
|
|
2247
|
+
const { unitId: l, subUnitId: m, drawingId: g } = c, p = this._canvasPopManagerService.attachPopupToObject(
|
|
2248
|
+
a,
|
|
2249
2249
|
{
|
|
2250
|
-
componentKey:
|
|
2250
|
+
componentKey: Yt,
|
|
2251
2251
|
direction: "horizontal",
|
|
2252
2252
|
offset: [2, 0],
|
|
2253
2253
|
extraProps: {
|
|
2254
|
-
menuItems: this._getImageMenuItems(l,
|
|
2254
|
+
menuItems: this._getImageMenuItems(l, m, g)
|
|
2255
2255
|
}
|
|
2256
2256
|
},
|
|
2257
2257
|
l
|
|
2258
2258
|
);
|
|
2259
|
-
r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId ===
|
|
2259
|
+
r.push(this.disposeWithMe(p)), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === l && w.subUnitId === m && w.drawingId === g) && this._drawingManagerService.focusDrawing([{
|
|
2260
2260
|
unitId: l,
|
|
2261
|
-
subUnitId:
|
|
2261
|
+
subUnitId: m,
|
|
2262
2262
|
drawingId: g
|
|
2263
2263
|
}]);
|
|
2264
2264
|
})
|
|
@@ -2290,7 +2290,7 @@ let cn = class extends At {
|
|
|
2290
2290
|
index: 0,
|
|
2291
2291
|
commandId: ut.id,
|
|
2292
2292
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2293
|
-
disable: !!
|
|
2293
|
+
disable: !!At.includes(e)
|
|
2294
2294
|
},
|
|
2295
2295
|
{
|
|
2296
2296
|
label: "image-popup.delete",
|
|
@@ -2302,7 +2302,7 @@ let cn = class extends At {
|
|
|
2302
2302
|
{
|
|
2303
2303
|
label: "image-popup.crop",
|
|
2304
2304
|
index: 2,
|
|
2305
|
-
commandId:
|
|
2305
|
+
commandId: Zt.id,
|
|
2306
2306
|
commandParams: { unitId: e, subUnitId: n, drawingId: t },
|
|
2307
2307
|
disable: !0
|
|
2308
2308
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2310,7 +2310,7 @@ let cn = class extends At {
|
|
|
2310
2310
|
{
|
|
2311
2311
|
label: "image-popup.reset",
|
|
2312
2312
|
index: 3,
|
|
2313
|
-
commandId:
|
|
2313
|
+
commandId: Qt.id,
|
|
2314
2314
|
commandParams: [{ unitId: e, subUnitId: n, drawingId: t }],
|
|
2315
2315
|
disable: !0
|
|
2316
2316
|
// TODO: @JOCS, feature is not ready.
|
|
@@ -2318,23 +2318,23 @@ let cn = class extends At {
|
|
|
2318
2318
|
];
|
|
2319
2319
|
}
|
|
2320
2320
|
};
|
|
2321
|
-
cn =
|
|
2321
|
+
cn = gr([
|
|
2322
2322
|
je(0, Ie),
|
|
2323
|
-
je(1, ve(
|
|
2323
|
+
je(1, ve(wi)),
|
|
2324
2324
|
je(2, ee),
|
|
2325
2325
|
je(3, Q),
|
|
2326
2326
|
je(4, Vn)
|
|
2327
2327
|
], cn);
|
|
2328
|
-
var
|
|
2329
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2330
|
-
(s = i[o]) && (r =
|
|
2331
|
-
return
|
|
2328
|
+
var mr = Object.getOwnPropertyDescriptor, ur = (i, e, n, t) => {
|
|
2329
|
+
for (var r = t > 1 ? void 0 : t ? mr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2330
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2331
|
+
return r;
|
|
2332
2332
|
}, xe = (i, e) => (n, t) => e(n, t, i);
|
|
2333
2333
|
let wn = class extends Xe {
|
|
2334
|
-
constructor(e, n, t, r, o, s,
|
|
2334
|
+
constructor(e, n, t, r, o, s, a, d) {
|
|
2335
2335
|
super();
|
|
2336
2336
|
Ce(this, "_liquid", new jn());
|
|
2337
|
-
this._context = e, this._docSkeletonManagerService = n, this._commandService = t, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = s, this._univerInstanceService =
|
|
2337
|
+
this._context = e, this._docSkeletonManagerService = n, this._commandService = t, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = s, this._univerInstanceService = a, this._lifecycleService = d, this._initialize(), this._commandExecutedListener();
|
|
2338
2338
|
}
|
|
2339
2339
|
_initialize() {
|
|
2340
2340
|
this._initialRenderRefresh(), this._drawingInitializeListener(), this._initResize();
|
|
@@ -2347,29 +2347,29 @@ let wn = class extends Xe {
|
|
|
2347
2347
|
});
|
|
2348
2348
|
}
|
|
2349
2349
|
_commandExecutedListener() {
|
|
2350
|
-
const e = [J.id,
|
|
2350
|
+
const e = [J.id, Ii.id];
|
|
2351
2351
|
this.disposeWithMe(
|
|
2352
2352
|
this._commandService.onCommandExecuted((n) => {
|
|
2353
2353
|
if (e.includes(n.id)) {
|
|
2354
2354
|
const t = n.params, { unitId: r } = t, { unitId: o, mainComponent: s } = this._context;
|
|
2355
2355
|
if (r !== o)
|
|
2356
2356
|
return;
|
|
2357
|
-
const
|
|
2358
|
-
if (
|
|
2357
|
+
const a = this._docSkeletonManagerService.getSkeleton();
|
|
2358
|
+
if (a == null)
|
|
2359
2359
|
return;
|
|
2360
|
-
if (this._editorService.isEditor(o) && o !==
|
|
2360
|
+
if (this._editorService.isEditor(o) && o !== xt) {
|
|
2361
2361
|
s == null || s.makeDirty();
|
|
2362
2362
|
return;
|
|
2363
2363
|
}
|
|
2364
|
-
this._refreshDrawing(
|
|
2364
|
+
this._refreshDrawing(a);
|
|
2365
2365
|
}
|
|
2366
2366
|
})
|
|
2367
2367
|
);
|
|
2368
2368
|
}
|
|
2369
2369
|
_initResize() {
|
|
2370
2370
|
this.disposeWithMe(
|
|
2371
|
-
|
|
2372
|
-
xn((e) => e.type ===
|
|
2371
|
+
Lt(this._context.engine.onTransformChange$).pipe(
|
|
2372
|
+
xn((e) => e.type === ii.resize),
|
|
2373
2373
|
qn(16)
|
|
2374
2374
|
).subscribe(() => {
|
|
2375
2375
|
var t;
|
|
@@ -2383,20 +2383,20 @@ let wn = class extends Xe {
|
|
|
2383
2383
|
const n = e == null ? void 0 : e.getSkeletonData(), { mainComponent: t, unitId: r } = this._context, o = t;
|
|
2384
2384
|
if (!n)
|
|
2385
2385
|
return;
|
|
2386
|
-
const { left: s, top:
|
|
2386
|
+
const { left: s, top: a, pageLayoutType: d, pageMarginLeft: c, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters: p } = n, h = {};
|
|
2387
2387
|
this._liquid.reset();
|
|
2388
|
-
for (let
|
|
2389
|
-
const
|
|
2388
|
+
for (let T = 0, M = m.length; T < M; T++) {
|
|
2389
|
+
const P = m[T], { headerId: A, footerId: U, pageWidth: N } = P;
|
|
2390
2390
|
if (A) {
|
|
2391
2391
|
const I = (O = g.get(A)) == null ? void 0 : O.get(N);
|
|
2392
2392
|
I && this._calculateDrawingPosition(
|
|
2393
2393
|
r,
|
|
2394
2394
|
I,
|
|
2395
2395
|
s,
|
|
2396
|
-
|
|
2396
|
+
a,
|
|
2397
2397
|
h,
|
|
2398
2398
|
I.marginTop,
|
|
2399
|
-
|
|
2399
|
+
P.marginLeft
|
|
2400
2400
|
);
|
|
2401
2401
|
}
|
|
2402
2402
|
if (U) {
|
|
@@ -2405,39 +2405,39 @@ let wn = class extends Xe {
|
|
|
2405
2405
|
r,
|
|
2406
2406
|
I,
|
|
2407
2407
|
s,
|
|
2408
|
-
|
|
2408
|
+
a,
|
|
2409
2409
|
h,
|
|
2410
|
-
|
|
2411
|
-
|
|
2410
|
+
P.pageHeight - P.marginBottom + I.marginTop,
|
|
2411
|
+
P.marginLeft
|
|
2412
2412
|
);
|
|
2413
2413
|
}
|
|
2414
|
-
this._calculateDrawingPosition(r,
|
|
2414
|
+
this._calculateDrawingPosition(r, P, s, a, h, P.marginTop, P.marginLeft), this._liquid.translatePage(P, d, c, l);
|
|
2415
2415
|
}
|
|
2416
|
-
const v = Object.values(h), w = v.filter((
|
|
2416
|
+
const v = Object.values(h), w = v.filter((T) => !T.isMultiTransform), S = v.filter((T) => T.isMultiTransform);
|
|
2417
2417
|
w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(S);
|
|
2418
2418
|
}
|
|
2419
2419
|
_handleMultiDrawingsTransform(e) {
|
|
2420
2420
|
const { scene: n, unitId: t } = this._context, r = n.getTransformerByCreate();
|
|
2421
2421
|
e.forEach((d) => {
|
|
2422
|
-
const
|
|
2423
|
-
|
|
2422
|
+
const c = this._drawingManagerService.getDrawingByParam(d);
|
|
2423
|
+
c != null && (c.transform = d.transform, c.transforms = d.transforms, c.isMultiTransform = d.isMultiTransform);
|
|
2424
2424
|
});
|
|
2425
|
-
const s = [...r.getSelectedObjectMap().keys()],
|
|
2426
|
-
this._drawingManagerService.removeNotification(
|
|
2425
|
+
const s = [...r.getSelectedObjectMap().keys()], a = Object.values(this._drawingManagerService.getDrawingData(t, t)).filter((d) => d.isMultiTransform === oe.TRUE);
|
|
2426
|
+
this._drawingManagerService.removeNotification(a), e.length > 0 && this._drawingManagerService.addNotification(e);
|
|
2427
2427
|
for (const d of s) {
|
|
2428
|
-
const
|
|
2429
|
-
|
|
2428
|
+
const c = n.getObject(d);
|
|
2429
|
+
c && r.setSelectedControl(c);
|
|
2430
2430
|
}
|
|
2431
2431
|
}
|
|
2432
|
-
_calculateDrawingPosition(e, n, t, r, o, s,
|
|
2432
|
+
_calculateDrawingPosition(e, n, t, r, o, s, a) {
|
|
2433
2433
|
const { skeDrawings: d } = n;
|
|
2434
2434
|
this._liquid.translatePagePadding({
|
|
2435
2435
|
marginTop: s,
|
|
2436
|
-
marginLeft:
|
|
2437
|
-
}), d.forEach((
|
|
2438
|
-
const { aLeft: l, aTop:
|
|
2436
|
+
marginLeft: a
|
|
2437
|
+
}), d.forEach((c) => {
|
|
2438
|
+
const { aLeft: l, aTop: m, height: g, width: p, angle: h, drawingId: v, drawingOrigin: w } = c, S = w.layoutType === H.WRAP_NONE && w.behindDoc === oe.TRUE, { isMultiTransform: O = oe.FALSE } = w, D = {
|
|
2439
2439
|
left: l + t + this._liquid.x,
|
|
2440
|
-
top:
|
|
2440
|
+
top: m + r + this._liquid.y,
|
|
2441
2441
|
width: p,
|
|
2442
2442
|
height: g,
|
|
2443
2443
|
angle: h
|
|
@@ -2453,7 +2453,7 @@ let wn = class extends Xe {
|
|
|
2453
2453
|
} : O === oe.TRUE && o[v].transforms.push(D);
|
|
2454
2454
|
}), this._liquid.restorePagePadding({
|
|
2455
2455
|
marginTop: s,
|
|
2456
|
-
marginLeft:
|
|
2456
|
+
marginLeft: a
|
|
2457
2457
|
});
|
|
2458
2458
|
}
|
|
2459
2459
|
_drawingInitializeListener() {
|
|
@@ -2461,35 +2461,35 @@ let wn = class extends Xe {
|
|
|
2461
2461
|
const n = this._docSkeletonManagerService.getSkeleton();
|
|
2462
2462
|
n != null && (this._refreshDrawing(n), this._drawingManagerService.initializeNotification(this._context.unitId));
|
|
2463
2463
|
};
|
|
2464
|
-
this._lifecycleService.stage ===
|
|
2464
|
+
this._lifecycleService.stage === Tn.Steady ? setTimeout(() => {
|
|
2465
2465
|
e();
|
|
2466
|
-
}, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n ===
|
|
2466
|
+
}, 1e3) : this._lifecycleService.lifecycle$.pipe(xn((n) => n === Tn.Steady)).subscribe(e);
|
|
2467
2467
|
}
|
|
2468
2468
|
};
|
|
2469
|
-
wn =
|
|
2469
|
+
wn = ur([
|
|
2470
2470
|
xe(1, ve(se)),
|
|
2471
2471
|
xe(2, z),
|
|
2472
|
-
xe(3,
|
|
2472
|
+
xe(3, vi),
|
|
2473
2473
|
xe(4, Ie),
|
|
2474
2474
|
xe(5, ve(gn)),
|
|
2475
2475
|
xe(6, Q),
|
|
2476
|
-
xe(7, ve(
|
|
2476
|
+
xe(7, ve(Et))
|
|
2477
2477
|
], wn);
|
|
2478
|
-
var
|
|
2479
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
2480
|
-
(s = i[o]) && (r =
|
|
2481
|
-
return
|
|
2482
|
-
}, pn = (i, e) => (n, t) => e(n, t, i),
|
|
2483
|
-
const
|
|
2484
|
-
let dn = class extends
|
|
2485
|
-
constructor(i =
|
|
2478
|
+
var fr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, pr = (i, e, n) => e in i ? fr(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n, wr = (i, e, n, t) => {
|
|
2479
|
+
for (var r = t > 1 ? void 0 : t ? hr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
2480
|
+
(s = i[o]) && (r = s(r) || r);
|
|
2481
|
+
return r;
|
|
2482
|
+
}, pn = (i, e) => (n, t) => e(n, t, i), vt = (i, e, n) => pr(i, typeof e != "symbol" ? e + "" : e, n);
|
|
2483
|
+
const vr = "DOC_DRAWING_UI_PLUGIN";
|
|
2484
|
+
let dn = class extends Ft {
|
|
2485
|
+
constructor(i = kn, e, n, t) {
|
|
2486
2486
|
super(), this._config = i, this._injector = e, this._renderManagerSrv = n, this._configService = t;
|
|
2487
2487
|
const { ...r } = Ht(
|
|
2488
2488
|
{},
|
|
2489
|
-
|
|
2489
|
+
kn,
|
|
2490
2490
|
this._config
|
|
2491
2491
|
);
|
|
2492
|
-
this._configService.setConfig(
|
|
2492
|
+
this._configService.setConfig(Oi, r);
|
|
2493
2493
|
}
|
|
2494
2494
|
onStarting() {
|
|
2495
2495
|
[
|
|
@@ -2504,22 +2504,22 @@ let dn = class extends kt {
|
|
|
2504
2504
|
[
|
|
2505
2505
|
[sn],
|
|
2506
2506
|
[wn]
|
|
2507
|
-
].forEach((i) => this._renderManagerSrv.registerRenderModule(
|
|
2507
|
+
].forEach((i) => this._renderManagerSrv.registerRenderModule(be.UNIVER_DOC, i)), this._injector.get(rn), this._injector.get(an), this._injector.get(on);
|
|
2508
2508
|
}
|
|
2509
2509
|
onRendered() {
|
|
2510
2510
|
this._injector.get(cn);
|
|
2511
2511
|
}
|
|
2512
2512
|
};
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
dn =
|
|
2516
|
-
|
|
2517
|
-
pn(1, ve(
|
|
2513
|
+
vt(dn, "type", be.UNIVER_DOC);
|
|
2514
|
+
vt(dn, "pluginName", vr);
|
|
2515
|
+
dn = wr([
|
|
2516
|
+
Bt(Jt, qt, Wt, gi),
|
|
2517
|
+
pn(1, ve(Ut)),
|
|
2518
2518
|
pn(2, ee),
|
|
2519
|
-
pn(3,
|
|
2519
|
+
pn(3, kt)
|
|
2520
2520
|
], dn);
|
|
2521
2521
|
export {
|
|
2522
|
-
|
|
2522
|
+
Hi as ClearDocDrawingTransformerOperation,
|
|
2523
2523
|
pt as DOCS_IMAGE_MENU_ID,
|
|
2524
2524
|
ot as DeleteDocDrawingsCommand,
|
|
2525
2525
|
ut as EditDocDrawingOperation,
|