@univerjs/docs-drawing-ui 0.6.10-nightly.202504271606 → 0.6.10-nightly.202504281607
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 +296 -288
- package/lib/index.js +296 -288
- package/lib/types/views/printing-float-dom/index.d.ts +2 -1
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var kt = Object.defineProperty;
|
|
2
2
|
var Wt = (i, e, n) => e in i ? kt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[e] = n;
|
|
3
3
|
var Se = (i, e, n) => Wt(i, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { CommandType as Y, ICommandService as $, IUniverInstanceService as q, TextX as On, JSONX as X, MemoryCursor as Ht, TextXActionType as Q, IUndoRedoService as Jn, BuildTextUtils as Gt, ArrangeTypeEnum as en, Tools as be, Inject as J, IContextService as et, LocaleService as fn, Disposable as Be, WrapTextType as Ke, PositionedObjectLayoutType as W, BooleanNumber as ae, DrawingTypeEnum as Ue, ObjectRelativeFromV as H, ObjectRelativeFromH as ne, FOCUSING_COMMON_DRAWINGS as sn, UniverInstanceType as _e, Direction as fe, DocumentFlavor as In, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Pn, FOCUSING_UNIVER_EDITOR as jt, UndoCommand as Vt, RedoCommand as $t, DisposableCollection as zt, toDisposable as Oe, fromEventSubject as nt, generateRandomId as Xt, Injector as tt,
|
|
4
|
+
import { CommandType as Y, ICommandService as $, IUniverInstanceService as q, TextX as On, JSONX as X, MemoryCursor as Ht, TextXActionType as Q, IUndoRedoService as Jn, BuildTextUtils as Gt, ArrangeTypeEnum as en, Tools as be, Inject as J, IContextService as et, LocaleService as fn, Disposable as Be, WrapTextType as Ke, PositionedObjectLayoutType as W, BooleanNumber as ae, DrawingTypeEnum as Ue, ObjectRelativeFromV as H, ObjectRelativeFromH as ne, FOCUSING_COMMON_DRAWINGS as sn, UniverInstanceType as _e, Direction as fe, DocumentFlavor as In, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Pn, FOCUSING_UNIVER_EDITOR as jt, UndoCommand as Vt, RedoCommand as $t, DisposableCollection as zt, toDisposable as Oe, fromEventSubject as nt, generateRandomId as Xt, Injector as tt, DOC_DRAWING_PRINTING_COMPONENT_KEY as qt, throttle as An, COLORS as Kt, RxDisposable as Yt, LifecycleService as Zt, LifecycleStages as xn, DependentOn as Qt, IConfigService as Jt, Plugin as ei, merge as ni } from "@univerjs/core";
|
|
5
5
|
import { IDocDrawingService as Fe, UniverDocsDrawingPlugin as ti } from "@univerjs/docs-drawing";
|
|
6
6
|
import { IImageIoService as ii, IDrawingManagerService as we, DRAWING_IMAGE_ALLOW_IMAGE_LIST as ri, DRAWING_IMAGE_COUNT_LIMIT as Ln, ImageUploadStatusType as _n, DRAWING_IMAGE_ALLOW_SIZE as oi, getImageSize as si, getDrawingShapeKeyByDrawingSearch as ai, DRAWING_IMAGE_WIDTH_LIMIT as Un, DRAWING_IMAGE_HEIGHT_LIMIT as Bn, UniverDrawingPlugin as ci } from "@univerjs/drawing";
|
|
7
7
|
import { DrawingCommonPanel as di, DrawingRenderService as it, ImageCropperObject as li, COMPONENT_IMAGE_POPUP_MENU as gi, OpenImageCropOperation as mi, ImageResetSizeOperation as ui, UniverDrawingUIPlugin as hi } from "@univerjs/drawing-ui";
|
|
@@ -11,7 +11,7 @@ import { RichTextEditingMutation as te, DocSelectionManagerService as Tn, DocSke
|
|
|
11
11
|
import { DocSelectionRenderService as Re, getRichTextEditPath as Ye, getCustomBlockIdsInSelections as Ri, docDrawingPositionToTransform as ct, VIEWPORT_KEY as dt, SetDocZoomRatioOperation as lt, DocPrintInterceptorService as Ni, NodePositionConvertToCursor as Hn, getOneTextSelectionRange as Gn, getAnchorBounding as Ei, TEXT_RANGE_LAYER_INDEX as Ai, getDocObject as xi, DocCanvasPopManagerService as Li, IEditorService as Ui } from "@univerjs/docs-ui";
|
|
12
12
|
import { MessageType as jn, clsx as V, InputNumber as He, Select as Vn, Checkbox as Bi, RadioGroup as $n, Radio as Me, render as Fi, unmount as ki } from "@univerjs/design";
|
|
13
13
|
import { BehaviorSubject as yn, debounceTime as gt, Observable as Wi, map as zn, switchMap as Hi, of as Gi, takeUntil as Xn, filter as qn } from "rxjs";
|
|
14
|
-
import { jsxs as K, jsx as
|
|
14
|
+
import { jsxs as K, jsx as f } from "react/jsx-runtime";
|
|
15
15
|
import { forwardRef as mt, useRef as ji, createElement as ut, useState as se, useEffect as Mn, useMemo as Vi } from "react";
|
|
16
16
|
const $i = "docs-drawing-ui.config", Kn = {};
|
|
17
17
|
var pe = function() {
|
|
@@ -77,9 +77,9 @@ const bn = {
|
|
|
77
77
|
const n = i.get($), t = i.get(q), r = i.get(ee), o = t.getCurrentUniverDocInstance();
|
|
78
78
|
if (e == null || o == null)
|
|
79
79
|
return !1;
|
|
80
|
-
const s = r.getRenderById(e.unitId).with(Re), { drawings: c } = e, d = (b = s.getSegment()) != null ? b : "", a = new On(),
|
|
80
|
+
const s = r.getRenderById(e.unitId).with(Re), { drawings: c } = e, d = (b = s.getSegment()) != null ? b : "", a = new On(), l = X.getInstance(), m = (E = (y = o.getSelfOrHeaderFooterModel(d).getBody()) == null ? void 0 : y.customBlocks) != null ? E : [], g = c.map((N) => m.find((_) => _.blockId === N.drawingId)).filter((N) => !!N).sort((N, _) => N.startIndex > _.startIndex ? 1 : -1), h = c[0].unitId, u = new Ht();
|
|
81
81
|
u.reset();
|
|
82
|
-
const v =
|
|
82
|
+
const v = g[0].startIndex, w = [
|
|
83
83
|
{
|
|
84
84
|
startOffset: v,
|
|
85
85
|
endOffset: v
|
|
@@ -87,12 +87,12 @@ const bn = {
|
|
|
87
87
|
], I = {
|
|
88
88
|
id: te.id,
|
|
89
89
|
params: {
|
|
90
|
-
unitId:
|
|
90
|
+
unitId: h,
|
|
91
91
|
actions: [],
|
|
92
92
|
textRanges: w
|
|
93
93
|
}
|
|
94
94
|
}, O = [];
|
|
95
|
-
for (const N of
|
|
95
|
+
for (const N of g) {
|
|
96
96
|
const { startIndex: _ } = N;
|
|
97
97
|
_ > u.cursor && a.push({
|
|
98
98
|
t: Q.RETAIN,
|
|
@@ -103,9 +103,9 @@ const bn = {
|
|
|
103
103
|
}), u.moveCursorTo(_ + 1);
|
|
104
104
|
}
|
|
105
105
|
const C = Ye(o, d);
|
|
106
|
-
O.push(
|
|
107
|
-
for (const N of
|
|
108
|
-
const { blockId: _ } = N, L = ((B = o.getDrawings()) != null ? B : {})[_], x = o.getDrawingsOrder().indexOf(_), j =
|
|
106
|
+
O.push(l.editOp(a.serialize(), C));
|
|
107
|
+
for (const N of g) {
|
|
108
|
+
const { blockId: _ } = N, L = ((B = o.getDrawings()) != null ? B : {})[_], x = o.getDrawingsOrder().indexOf(_), j = l.removeOp(["drawings", _], L), S = l.removeOp(["drawingsOrder", x], _);
|
|
109
109
|
O.push(j), O.push(S);
|
|
110
110
|
}
|
|
111
111
|
return I.params.actions = O.reduce((N, _) => X.compose(N, _), null), !!n.syncExecuteCommand(I.id, I.params);
|
|
@@ -118,12 +118,12 @@ const bn = {
|
|
|
118
118
|
if (t.length === 0)
|
|
119
119
|
return !1;
|
|
120
120
|
const { unitId: r } = t[0], o = t.map((s) => {
|
|
121
|
-
const { unitId: c, subUnitId: d, drawingId: a, drawingType:
|
|
121
|
+
const { unitId: c, subUnitId: d, drawingId: a, drawingType: l } = s;
|
|
122
122
|
return {
|
|
123
123
|
unitId: c,
|
|
124
124
|
subUnitId: d,
|
|
125
125
|
drawingId: a,
|
|
126
|
-
drawingType:
|
|
126
|
+
drawingType: l
|
|
127
127
|
};
|
|
128
128
|
});
|
|
129
129
|
return e.executeCommand(bn.id, {
|
|
@@ -139,9 +139,9 @@ const bn = {
|
|
|
139
139
|
const n = i.get(Fe);
|
|
140
140
|
if (!e) return !1;
|
|
141
141
|
const t = [];
|
|
142
|
-
e.forEach(({ parent:
|
|
143
|
-
t.push(
|
|
144
|
-
t.push(
|
|
142
|
+
e.forEach(({ parent: l, children: m }) => {
|
|
143
|
+
t.push(l.unitId), m.forEach((g) => {
|
|
144
|
+
t.push(g.unitId);
|
|
145
145
|
});
|
|
146
146
|
});
|
|
147
147
|
const r = n.getGroupDrawingOp(e), { unitId: o, subUnitId: s, undo: c, redo: d, objects: a } = r;
|
|
@@ -158,20 +158,20 @@ const bn = {
|
|
|
158
158
|
const n = i.get($), t = i.get(Tn), r = i.get(q), o = t.getActiveTextRange(), s = r.getCurrentUniverDocInstance();
|
|
159
159
|
if (o == null || s == null)
|
|
160
160
|
return !1;
|
|
161
|
-
const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset:
|
|
162
|
-
if (
|
|
161
|
+
const c = s.getUnitId(), { drawings: d } = e, { collapsed: a, startOffset: l, segmentId: m } = o, g = s.getSelfOrHeaderFooterModel(m).getBody();
|
|
162
|
+
if (g == null)
|
|
163
163
|
return !1;
|
|
164
|
-
const
|
|
164
|
+
const h = new On(), u = X.getInstance(), v = [], w = (E = (y = s.getSnapshot().drawingsOrder) == null ? void 0 : y.length) != null ? E : 0;
|
|
165
165
|
let I = 0;
|
|
166
166
|
if (a)
|
|
167
|
-
|
|
167
|
+
l > 0 && h.push({
|
|
168
168
|
t: Q.RETAIN,
|
|
169
|
-
len:
|
|
169
|
+
len: l
|
|
170
170
|
});
|
|
171
171
|
else {
|
|
172
|
-
const _ = Gt.selection.delete([o],
|
|
173
|
-
|
|
174
|
-
const L = Ri(
|
|
172
|
+
const _ = Gt.selection.delete([o], g, 0, null, !1);
|
|
173
|
+
h.push(..._);
|
|
174
|
+
const L = Ri(g, [o]), G = (B = s.getDrawings()) != null ? B : {}, x = (N = s.getDrawingsOrder()) != null ? N : [], j = L.sort((S, D) => x.indexOf(S) > x.indexOf(D) ? -1 : x.indexOf(S) < x.indexOf(D) ? 1 : 0);
|
|
175
175
|
if (j.length > 0)
|
|
176
176
|
for (const S of j) {
|
|
177
177
|
const D = G[S], R = x.indexOf(S);
|
|
@@ -181,7 +181,7 @@ const bn = {
|
|
|
181
181
|
v.push(T), v.push(U), I++;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
h.push({
|
|
185
185
|
t: Q.INSERT,
|
|
186
186
|
body: {
|
|
187
187
|
dataStream: "\b".repeat(d.length),
|
|
@@ -192,7 +192,7 @@ const bn = {
|
|
|
192
192
|
},
|
|
193
193
|
len: d.length
|
|
194
194
|
});
|
|
195
|
-
const O = Ye(s, m), C = u.editOp(
|
|
195
|
+
const O = Ye(s, m), C = u.editOp(h.serialize(), O);
|
|
196
196
|
v.push(C);
|
|
197
197
|
for (const _ of d) {
|
|
198
198
|
const { drawingId: L } = _, G = u.insertOp(["drawings", L], _), x = u.insertOp(["drawingsOrder", w - I], L);
|
|
@@ -219,13 +219,13 @@ const bn = {
|
|
|
219
219
|
let a;
|
|
220
220
|
if (c === en.forward ? a = t.getForwardDrawingsOp(d) : c === en.backward ? a = t.getBackwardDrawingOp(d) : c === en.front ? a = t.getFrontDrawingsOp(d) : c === en.back && (a = t.getBackDrawingsOp(d)), a == null)
|
|
221
221
|
return !1;
|
|
222
|
-
const { redo:
|
|
223
|
-
if (
|
|
222
|
+
const { redo: l } = a;
|
|
223
|
+
if (l == null)
|
|
224
224
|
return !1;
|
|
225
225
|
const m = [];
|
|
226
|
-
let
|
|
227
|
-
|
|
228
|
-
const
|
|
226
|
+
let g = be.deepClone(l);
|
|
227
|
+
g = g.slice(3), g.unshift("drawingsOrder"), m.push(g);
|
|
228
|
+
const h = {
|
|
229
229
|
id: te.id,
|
|
230
230
|
params: {
|
|
231
231
|
unitId: r,
|
|
@@ -233,7 +233,7 @@ const bn = {
|
|
|
233
233
|
textRanges: null
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
return
|
|
236
|
+
return h.params.actions = m.reduce((v, w) => X.compose(v, w), null), !!n.syncExecuteCommand(h.id, h.params);
|
|
237
237
|
}
|
|
238
238
|
}, _t = {
|
|
239
239
|
id: "doc.command.ungroup-doc-image",
|
|
@@ -243,9 +243,9 @@ const bn = {
|
|
|
243
243
|
const n = i.get(Fe);
|
|
244
244
|
if (!e) return !1;
|
|
245
245
|
const t = [];
|
|
246
|
-
e.forEach(({ parent:
|
|
247
|
-
t.push(
|
|
248
|
-
t.push(
|
|
246
|
+
e.forEach(({ parent: l, children: m }) => {
|
|
247
|
+
t.push(l.unitId), m.forEach((g) => {
|
|
248
|
+
t.push(g.unitId);
|
|
249
249
|
});
|
|
250
250
|
});
|
|
251
251
|
const r = n.getUngroupDrawingOp(e), { unitId: o, subUnitId: s, undo: c, redo: d, objects: a } = r;
|
|
@@ -267,8 +267,8 @@ var Zi = Object.getOwnPropertyDescriptor, Qi = (i, e, n, t) => {
|
|
|
267
267
|
return r;
|
|
268
268
|
}, ue = (i, e) => (n, t) => e(n, t, i);
|
|
269
269
|
let an = class extends Be {
|
|
270
|
-
constructor(i, e, n, t, r, o, s, c, d, a,
|
|
271
|
-
super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = c, this._messageService = d, this._localeService = a, this._docSelectionRenderService =
|
|
270
|
+
constructor(i, e, n, t, r, o, s, c, d, a, l, m, g) {
|
|
271
|
+
super(), this._context = i, this._commandService = e, this._docSelectionManagerService = n, this._renderManagerSrv = t, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = s, this._contextService = c, this._messageService = d, this._localeService = a, this._docSelectionRenderService = l, this._docRefreshDrawingsService = m, this._fileOpenerService = g, this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._transformDrawingListener(), this._editAreaChangeListener();
|
|
272
272
|
}
|
|
273
273
|
async insertDocImage() {
|
|
274
274
|
const i = await this._fileOpenerService.openFile({
|
|
@@ -310,15 +310,15 @@ let an = class extends Be {
|
|
|
310
310
|
for (const r of e) {
|
|
311
311
|
if (r == null)
|
|
312
312
|
continue;
|
|
313
|
-
const { imageId: o, imageSourceType: s, source: c, base64Cache: d } = r, { width: a, height:
|
|
313
|
+
const { imageId: o, imageSourceType: s, source: c, base64Cache: d } = r, { width: a, height: l, image: m } = await si(d || "");
|
|
314
314
|
this._imageIoService.addImageSourceCache(o, s, m);
|
|
315
|
-
let
|
|
316
|
-
if (a > Un ||
|
|
317
|
-
const w = Un / a, I = Bn /
|
|
318
|
-
|
|
315
|
+
let g = 1;
|
|
316
|
+
if (a > Un || l > Bn) {
|
|
317
|
+
const w = Un / a, I = Bn / l;
|
|
318
|
+
g = Math.min(w, I);
|
|
319
319
|
}
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
320
|
+
const h = this._getImagePosition(a * g, l * g);
|
|
321
|
+
if (h == null)
|
|
322
322
|
return;
|
|
323
323
|
const u = {
|
|
324
324
|
unitId: n,
|
|
@@ -327,8 +327,8 @@ let an = class extends Be {
|
|
|
327
327
|
drawingType: Ue.DRAWING_IMAGE,
|
|
328
328
|
imageSourceType: s,
|
|
329
329
|
source: c,
|
|
330
|
-
transform: ct(
|
|
331
|
-
docTransform:
|
|
330
|
+
transform: ct(h),
|
|
331
|
+
docTransform: h,
|
|
332
332
|
behindDoc: ae.FALSE,
|
|
333
333
|
title: "",
|
|
334
334
|
description: "",
|
|
@@ -433,10 +433,10 @@ let an = class extends Be {
|
|
|
433
433
|
if (((s = n == null ? void 0 : n.customBlocks) != null ? s : []).some((a) => a.blockId === i))
|
|
434
434
|
return "";
|
|
435
435
|
for (const a of Object.keys(t))
|
|
436
|
-
if ((c = t[a].body.customBlocks) != null && c.some((
|
|
436
|
+
if ((c = t[a].body.customBlocks) != null && c.some((l) => l.blockId === i))
|
|
437
437
|
return a;
|
|
438
438
|
for (const a of Object.keys(r))
|
|
439
|
-
if ((d = r[a].body.customBlocks) != null && d.some((
|
|
439
|
+
if ((d = r[a].body.customBlocks) != null && d.some((l) => l.blockId === i))
|
|
440
440
|
return a;
|
|
441
441
|
return "";
|
|
442
442
|
}
|
|
@@ -448,18 +448,18 @@ let an = class extends Be {
|
|
|
448
448
|
return;
|
|
449
449
|
const r = i.getSnapshot(), { drawings: o = {} } = r, s = t.getEditArea() === Ge.BODY;
|
|
450
450
|
for (const d of Object.keys(o)) {
|
|
451
|
-
const a = o[d],
|
|
451
|
+
const a = o[d], l = ai({ unitId: n, drawingId: a.drawingId, subUnitId: n }), m = e.fuzzyMathObjects(l, !0);
|
|
452
452
|
if (m.length)
|
|
453
|
-
for (const
|
|
454
|
-
e.detachTransformerFrom(
|
|
453
|
+
for (const g of m) {
|
|
454
|
+
e.detachTransformerFrom(g);
|
|
455
455
|
try {
|
|
456
|
-
|
|
456
|
+
g.setOpacity(0.5);
|
|
457
457
|
} catch {
|
|
458
458
|
}
|
|
459
459
|
if (s && a.isMultiTransform !== ae.TRUE || !s && a.isMultiTransform === ae.TRUE) {
|
|
460
|
-
a.allowTransform !== !1 && e.attachTransformerTo(
|
|
460
|
+
a.allowTransform !== !1 && e.attachTransformerTo(g);
|
|
461
461
|
try {
|
|
462
|
-
|
|
462
|
+
g.setOpacity(1);
|
|
463
463
|
} catch {
|
|
464
464
|
}
|
|
465
465
|
}
|
|
@@ -526,14 +526,14 @@ const Ji = {
|
|
|
526
526
|
behindText: W.WRAP_NONE
|
|
527
527
|
};
|
|
528
528
|
function Dt(i, e, n, t, r, o, s) {
|
|
529
|
-
var
|
|
530
|
-
const c = new On(), d = X.getInstance(), a = [],
|
|
531
|
-
if (
|
|
529
|
+
var h, u;
|
|
530
|
+
const c = new On(), d = X.getInstance(), a = [], l = o.getSelfOrHeaderFooterModel(e).getBody(), m = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
531
|
+
if (l == null || m == null)
|
|
532
532
|
return;
|
|
533
|
-
const
|
|
534
|
-
if (
|
|
533
|
+
const g = (u = (h = l.customBlocks) == null ? void 0 : h.find((v) => v.blockId === r)) == null ? void 0 : u.startIndex;
|
|
534
|
+
if (g != null) {
|
|
535
535
|
if (t = Math.min(m.dataStream.length - 2, t), i === e) {
|
|
536
|
-
if (t <
|
|
536
|
+
if (t < g ? (t > 0 && c.push({
|
|
537
537
|
t: Q.RETAIN,
|
|
538
538
|
len: t
|
|
539
539
|
}), c.push({
|
|
@@ -548,19 +548,19 @@ function Dt(i, e, n, t, r, o, s) {
|
|
|
548
548
|
len: 1
|
|
549
549
|
}), c.push({
|
|
550
550
|
t: Q.RETAIN,
|
|
551
|
-
len:
|
|
551
|
+
len: g - t
|
|
552
552
|
}), c.push({
|
|
553
553
|
t: Q.DELETE,
|
|
554
554
|
len: 1
|
|
555
|
-
})) : (
|
|
555
|
+
})) : (g > 0 && c.push({
|
|
556
556
|
t: Q.RETAIN,
|
|
557
|
-
len:
|
|
557
|
+
len: g
|
|
558
558
|
}), c.push({
|
|
559
559
|
t: Q.DELETE,
|
|
560
560
|
len: 1
|
|
561
|
-
}), t -
|
|
561
|
+
}), t - g - 1 > 0 && c.push({
|
|
562
562
|
t: Q.RETAIN,
|
|
563
|
-
len: t -
|
|
563
|
+
len: t - g - 1
|
|
564
564
|
}), c.push({
|
|
565
565
|
t: Q.INSERT,
|
|
566
566
|
body: {
|
|
@@ -571,14 +571,14 @@ function Dt(i, e, n, t, r, o, s) {
|
|
|
571
571
|
}]
|
|
572
572
|
},
|
|
573
573
|
len: 1
|
|
574
|
-
})), t !==
|
|
574
|
+
})), t !== g) {
|
|
575
575
|
const v = Ye(o, e), w = d.editOp(c.serialize(), v);
|
|
576
576
|
a.push(w);
|
|
577
577
|
}
|
|
578
578
|
} else {
|
|
579
|
-
|
|
579
|
+
g > 0 && c.push({
|
|
580
580
|
t: Q.RETAIN,
|
|
581
|
-
len:
|
|
581
|
+
len: g
|
|
582
582
|
}), c.push({
|
|
583
583
|
t: Q.DELETE,
|
|
584
584
|
len: 1
|
|
@@ -610,10 +610,10 @@ const Ct = {
|
|
|
610
610
|
var E, B;
|
|
611
611
|
if (e == null)
|
|
612
612
|
return !1;
|
|
613
|
-
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get($), s = i.get(q), d = i.get(ee).getRenderById(r), a = d == null ? void 0 : d.with(ie).getSkeleton().getSkeletonData(),
|
|
614
|
-
if (
|
|
613
|
+
const { drawings: n, wrappingStyle: t, unitId: r } = e, o = i.get($), s = i.get(q), d = i.get(ee).getRenderById(r), a = d == null ? void 0 : d.with(ie).getSkeleton().getSkeletonData(), l = d == null ? void 0 : d.with(ie).getViewModel(), m = d == null ? void 0 : d.scene, g = s.getCurrentUniverDocInstance();
|
|
614
|
+
if (g == null || a == null || m == null || l == null)
|
|
615
615
|
return !1;
|
|
616
|
-
const
|
|
616
|
+
const h = l.getEditArea(), u = m.getTransformerByCreate(), { pages: v, skeHeaders: w, skeFooters: I } = a, O = X.getInstance(), C = [], { drawings: P = {} } = g.getSnapshot();
|
|
617
617
|
for (const N of n) {
|
|
618
618
|
const { drawingId: _ } = N, L = P[_].layoutType, G = Ji[t];
|
|
619
619
|
if (L !== G) {
|
|
@@ -632,7 +632,7 @@ const Ct = {
|
|
|
632
632
|
let x = null, j = 0, S = 0;
|
|
633
633
|
for (const D of v) {
|
|
634
634
|
const { headerId: R, footerId: T, marginTop: U, marginLeft: F, marginBottom: M, pageWidth: A, pageHeight: z } = D;
|
|
635
|
-
switch (
|
|
635
|
+
switch (h) {
|
|
636
636
|
case Ge.HEADER: {
|
|
637
637
|
const k = (E = w.get(R)) == null ? void 0 : E.get(A);
|
|
638
638
|
k != null && k.skeDrawings.has(_) && (x = k.skeDrawings.get(_), j = k.marginTop, S = F);
|
|
@@ -697,11 +697,11 @@ const Ct = {
|
|
|
697
697
|
const n = i.get($), r = i.get(q).getCurrentUniverDocInstance();
|
|
698
698
|
if (r == null)
|
|
699
699
|
return !1;
|
|
700
|
-
const { drawings: o, dist: s, unitId: c } = e, d = X.getInstance(), a = [], { drawings:
|
|
701
|
-
for (const
|
|
702
|
-
const { drawingId: u } =
|
|
700
|
+
const { drawings: o, dist: s, unitId: c } = e, d = X.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
|
|
701
|
+
for (const h of o) {
|
|
702
|
+
const { drawingId: u } = h;
|
|
703
703
|
for (const [v, w] of Object.entries(s)) {
|
|
704
|
-
const I =
|
|
704
|
+
const I = l[u][v];
|
|
705
705
|
if (I !== w) {
|
|
706
706
|
const O = d.replaceOp(["drawings", u, v], I, w);
|
|
707
707
|
a.push(O);
|
|
@@ -716,7 +716,7 @@ const Ct = {
|
|
|
716
716
|
textRanges: null
|
|
717
717
|
}
|
|
718
718
|
};
|
|
719
|
-
return m.params.actions = a.reduce((
|
|
719
|
+
return m.params.actions = a.reduce((h, u) => X.compose(h, u), null), !!n.syncExecuteCommand(m.id, m.params);
|
|
720
720
|
}
|
|
721
721
|
}, Pt = {
|
|
722
722
|
id: "doc.command.update-doc-drawing-wrap-text",
|
|
@@ -727,9 +727,9 @@ const Ct = {
|
|
|
727
727
|
const n = i.get($), r = i.get(q).getCurrentUniverDocInstance();
|
|
728
728
|
if (r == null)
|
|
729
729
|
return !1;
|
|
730
|
-
const { drawings: o, wrapText: s, unitId: c } = e, d = X.getInstance(), a = [], { drawings:
|
|
731
|
-
for (const
|
|
732
|
-
const { drawingId: u } =
|
|
730
|
+
const { drawings: o, wrapText: s, unitId: c } = e, d = X.getInstance(), a = [], { drawings: l = {} } = r.getSnapshot();
|
|
731
|
+
for (const h of o) {
|
|
732
|
+
const { drawingId: u } = h, v = l[u].wrapText;
|
|
733
733
|
if (v !== s) {
|
|
734
734
|
const w = d.replaceOp(["drawings", u, "wrapText"], v, s);
|
|
735
735
|
a.push(w);
|
|
@@ -743,7 +743,7 @@ const Ct = {
|
|
|
743
743
|
textRanges: null
|
|
744
744
|
}
|
|
745
745
|
};
|
|
746
|
-
return m.params.actions = a.reduce((
|
|
746
|
+
return m.params.actions = a.reduce((h, u) => X.compose(h, u), null), !!n.syncExecuteCommand(m.id, m.params);
|
|
747
747
|
}
|
|
748
748
|
}, Ze = {
|
|
749
749
|
id: "doc.command.update-drawing-doc-transform",
|
|
@@ -757,24 +757,24 @@ const Ct = {
|
|
|
757
757
|
const c = s.getTransformerByCreate(), d = t.getCurrentUniverDocInstance();
|
|
758
758
|
if (d == null)
|
|
759
759
|
return !1;
|
|
760
|
-
const { drawings: a, unitId:
|
|
760
|
+
const { drawings: a, unitId: l } = e, m = X.getInstance(), g = [], { drawings: h = {} } = d.getSnapshot();
|
|
761
761
|
for (const w of a) {
|
|
762
|
-
const { drawingId: I, key: O, value: C } = w, P =
|
|
762
|
+
const { drawingId: I, key: O, value: C } = w, P = h[I].docTransform[O];
|
|
763
763
|
if (!be.diffValue(P, C)) {
|
|
764
764
|
const b = m.replaceOp(["drawings", I, "docTransform", O], P, C);
|
|
765
|
-
|
|
765
|
+
g.push(b);
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
768
|
const u = {
|
|
769
769
|
id: te.id,
|
|
770
770
|
params: {
|
|
771
|
-
unitId:
|
|
771
|
+
unitId: l,
|
|
772
772
|
actions: [],
|
|
773
773
|
textRanges: null,
|
|
774
774
|
debounce: !0
|
|
775
775
|
}
|
|
776
776
|
};
|
|
777
|
-
u.params.actions =
|
|
777
|
+
u.params.actions = g.reduce((w, I) => X.compose(w, I), null);
|
|
778
778
|
const v = n.syncExecuteCommand(u.id, u.params);
|
|
779
779
|
return c.refreshControls(), !!v;
|
|
780
780
|
}
|
|
@@ -791,10 +791,10 @@ const Ct = {
|
|
|
791
791
|
const d = s.getTransformerByCreate(), a = i.get($), m = i.get(q).getCurrentUniverDocInstance();
|
|
792
792
|
if (m == null)
|
|
793
793
|
return !1;
|
|
794
|
-
const { drawing:
|
|
794
|
+
const { drawing: g, unitId: h, offset: u, segmentId: v, segmentPage: w, needRefreshDrawings: I } = e;
|
|
795
795
|
if (I)
|
|
796
796
|
return r.refreshDrawings(c), d.refreshControls(), !0;
|
|
797
|
-
const O = [], { drawingId: C } =
|
|
797
|
+
const O = [], { drawingId: C } = g, P = (N = t.getSegment()) != null ? N : "", b = Dt(
|
|
798
798
|
v,
|
|
799
799
|
P,
|
|
800
800
|
w,
|
|
@@ -809,7 +809,7 @@ const Ct = {
|
|
|
809
809
|
const y = {
|
|
810
810
|
id: te.id,
|
|
811
811
|
params: {
|
|
812
|
-
unitId:
|
|
812
|
+
unitId: h,
|
|
813
813
|
actions: [],
|
|
814
814
|
textRanges: null
|
|
815
815
|
}
|
|
@@ -832,11 +832,11 @@ const Ct = {
|
|
|
832
832
|
const s = o.getTransformerByCreate(), c = i.get($), a = i.get(q).getCurrentUniverDocInstance();
|
|
833
833
|
if (a == null)
|
|
834
834
|
return !1;
|
|
835
|
-
const { drawing:
|
|
835
|
+
const { drawing: l, unitId: m, offset: g, docTransform: h, segmentId: u, segmentPage: v } = e, w = [], { drawingId: I } = l, O = (j = t.getSegment()) != null ? j : "", C = Dt(
|
|
836
836
|
u,
|
|
837
837
|
O,
|
|
838
838
|
v,
|
|
839
|
-
|
|
839
|
+
g,
|
|
840
840
|
I,
|
|
841
841
|
a,
|
|
842
842
|
t
|
|
@@ -845,20 +845,20 @@ const Ct = {
|
|
|
845
845
|
return !1;
|
|
846
846
|
C.length > 0 && w.push(...C);
|
|
847
847
|
const P = X.getInstance(), { drawings: b = {} } = a.getSnapshot(), y = b[I].docTransform, { positionH: E, positionV: B, size: N, angle: _ } = y;
|
|
848
|
-
if (!be.diffValue(E,
|
|
849
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "positionH"], E,
|
|
848
|
+
if (!be.diffValue(E, h.positionH)) {
|
|
849
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "positionH"], E, h.positionH);
|
|
850
850
|
w.push(S);
|
|
851
851
|
}
|
|
852
|
-
if (!be.diffValue(B,
|
|
853
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "positionV"], B,
|
|
852
|
+
if (!be.diffValue(B, h.positionV)) {
|
|
853
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "positionV"], B, h.positionV);
|
|
854
854
|
w.push(S);
|
|
855
855
|
}
|
|
856
|
-
if (!be.diffValue(N,
|
|
857
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "size"], N,
|
|
856
|
+
if (!be.diffValue(N, h.size)) {
|
|
857
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "size"], N, h.size);
|
|
858
858
|
w.push(S);
|
|
859
859
|
}
|
|
860
|
-
if (!be.diffValue(_,
|
|
861
|
-
const S = P.replaceOp(["drawings", I, "docTransform", "angle"], _,
|
|
860
|
+
if (!be.diffValue(_, h.angle)) {
|
|
861
|
+
const S = P.replaceOp(["drawings", I, "docTransform", "angle"], _, h.angle);
|
|
862
862
|
w.push(S);
|
|
863
863
|
}
|
|
864
864
|
const L = {
|
|
@@ -881,12 +881,12 @@ const Ct = {
|
|
|
881
881
|
const n = i.get($), t = i.get(Fe), r = i.get(q), o = i.get(ee), { direction: s } = e, c = t.getFocusDrawings();
|
|
882
882
|
if (c.length === 0)
|
|
883
883
|
return !1;
|
|
884
|
-
const d = c[0].unitId, a = o.getRenderById(d),
|
|
885
|
-
if (
|
|
884
|
+
const d = c[0].unitId, a = o.getRenderById(d), l = a == null ? void 0 : a.scene;
|
|
885
|
+
if (l == null)
|
|
886
886
|
return !1;
|
|
887
|
-
const m =
|
|
887
|
+
const m = l.getTransformerByCreate(), g = r.getUniverDocInstance(d), h = c.map((v) => {
|
|
888
888
|
var y, E, B, N, _;
|
|
889
|
-
const { drawingId: w } = v, I = (y =
|
|
889
|
+
const { drawingId: w } = v, I = (y = g == null ? void 0 : g.getSnapshot().drawings) == null ? void 0 : y[w];
|
|
890
890
|
if (I == null || I.layoutType === W.INLINE)
|
|
891
891
|
return null;
|
|
892
892
|
const { positionH: O, positionV: C } = I.docTransform, P = { ...O }, b = { ...C };
|
|
@@ -896,12 +896,12 @@ const Ct = {
|
|
|
896
896
|
value: s === fe.UP || s === fe.DOWN ? b : P
|
|
897
897
|
};
|
|
898
898
|
}).filter((v) => v != null);
|
|
899
|
-
if (
|
|
899
|
+
if (h.length === 0)
|
|
900
900
|
return !1;
|
|
901
901
|
const u = n.syncExecuteCommand(Ze.id, {
|
|
902
902
|
unitId: d,
|
|
903
903
|
subUnitId: d,
|
|
904
|
-
drawings:
|
|
904
|
+
drawings: h
|
|
905
905
|
});
|
|
906
906
|
return m.refreshControls(), !!u;
|
|
907
907
|
}
|
|
@@ -945,7 +945,7 @@ const Ct = {
|
|
|
945
945
|
const n = i.get(we), t = i.get($);
|
|
946
946
|
return e == null ? !1 : (n.focusDrawing([e]), t.executeCommand(bt.id, { value: "open" }), !0);
|
|
947
947
|
}
|
|
948
|
-
}, nr = "univer-image-common-panel", tr = "univer-image-common-panel-grid", ir = "univer-image-common-panel-border", rr = "univer-image-common-panel-title", or = "univer-image-common-panel-subtitle", sr = "univer-image-common-panel-row", ar = "univer-image-common-panel-column", cr = "univer-image-common-panel-span2", dr = "univer-image-common-panel-input",
|
|
948
|
+
}, nr = "univer-image-common-panel", tr = "univer-image-common-panel-grid", ir = "univer-image-common-panel-border", rr = "univer-image-common-panel-title", or = "univer-image-common-panel-subtitle", sr = "univer-image-common-panel-row", ar = "univer-image-common-panel-column", cr = "univer-image-common-panel-span2", dr = "univer-image-common-panel-input", p = {
|
|
949
949
|
imageCommonPanel: nr,
|
|
950
950
|
imageCommonPanelGrid: tr,
|
|
951
951
|
imageCommonPanelBorder: ir,
|
|
@@ -959,10 +959,10 @@ const Ct = {
|
|
|
959
959
|
const e = Ie($), n = Ie(fn), t = Ie(we), r = Ie(ee), o = Ie(q), { drawings: s } = i, c = s[0];
|
|
960
960
|
if (c == null)
|
|
961
961
|
return;
|
|
962
|
-
const { unitId: d } = c, a = o.getUniverDocInstance(d),
|
|
963
|
-
if (
|
|
962
|
+
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = a == null ? void 0 : a.getSnapshot().documentStyle.documentFlavor, m = r.getRenderById(d), g = m == null ? void 0 : m.scene;
|
|
963
|
+
if (g == null)
|
|
964
964
|
return;
|
|
965
|
-
const
|
|
965
|
+
const h = g.getTransformerByCreate(), u = [{
|
|
966
966
|
label: n.t("image-position.column"),
|
|
967
967
|
value: String(ne.COLUMN)
|
|
968
968
|
}, {
|
|
@@ -974,15 +974,15 @@ const Ct = {
|
|
|
974
974
|
}], v = [{
|
|
975
975
|
label: n.t("image-position.line"),
|
|
976
976
|
value: String(H.LINE),
|
|
977
|
-
disabled:
|
|
977
|
+
disabled: l === In.MODERN
|
|
978
978
|
}, {
|
|
979
979
|
label: n.t("image-position.page"),
|
|
980
980
|
value: String(H.PAGE),
|
|
981
|
-
disabled:
|
|
981
|
+
disabled: l === In.MODERN
|
|
982
982
|
}, {
|
|
983
983
|
label: n.t("image-position.margin"),
|
|
984
984
|
value: String(H.MARGIN),
|
|
985
|
-
disabled:
|
|
985
|
+
disabled: l === In.MODERN
|
|
986
986
|
}, {
|
|
987
987
|
label: n.t("image-position.paragraph"),
|
|
988
988
|
value: String(H.PARAGRAPH)
|
|
@@ -1014,7 +1014,7 @@ const Ct = {
|
|
|
1014
1014
|
}))
|
|
1015
1015
|
});
|
|
1016
1016
|
const F = (M = r.getRenderById(d)) == null ? void 0 : M.with(Re);
|
|
1017
|
-
F && F.blur(),
|
|
1017
|
+
F && F.blur(), h.refreshControls();
|
|
1018
1018
|
}
|
|
1019
1019
|
function L(D) {
|
|
1020
1020
|
var oe, De, Ce;
|
|
@@ -1111,13 +1111,13 @@ const Ct = {
|
|
|
1111
1111
|
return () => {
|
|
1112
1112
|
D.unsubscribe(), R.dispose();
|
|
1113
1113
|
};
|
|
1114
|
-
}, []), /* @__PURE__ */ K("div", { className: V(
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
/* @__PURE__ */ K("div", { className:
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
1114
|
+
}, []), /* @__PURE__ */ K("div", { className: V(p.imageCommonPanelGrid, p.imageCommonPanelBorder), style: { display: B ? "block" : "none" }, children: [
|
|
1115
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.title") }) }) }),
|
|
1116
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.horizontal") }) }) }),
|
|
1117
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1118
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1119
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1120
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1121
1121
|
He,
|
|
1122
1122
|
{
|
|
1123
1123
|
min: Yn,
|
|
@@ -1131,13 +1131,13 @@ const Ct = {
|
|
|
1131
1131
|
posOffset: D
|
|
1132
1132
|
});
|
|
1133
1133
|
},
|
|
1134
|
-
className:
|
|
1134
|
+
className: p.imageCommonPanelInput
|
|
1135
1135
|
}
|
|
1136
1136
|
) }) })
|
|
1137
1137
|
] }) }),
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
/* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1139
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.toTheRightOf") }) }),
|
|
1140
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1141
1141
|
Vn,
|
|
1142
1142
|
{
|
|
1143
1143
|
value: String(O.relativeFrom),
|
|
@@ -1148,11 +1148,11 @@ const Ct = {
|
|
|
1148
1148
|
) }) })
|
|
1149
1149
|
] }) })
|
|
1150
1150
|
] }),
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */ K("div", { className:
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.vertical") }) }) }),
|
|
1152
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1153
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1154
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.absolutePosition") }) }),
|
|
1155
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1156
1156
|
He,
|
|
1157
1157
|
{
|
|
1158
1158
|
min: Yn,
|
|
@@ -1166,13 +1166,13 @@ const Ct = {
|
|
|
1166
1166
|
posOffset: D
|
|
1167
1167
|
});
|
|
1168
1168
|
},
|
|
1169
|
-
className:
|
|
1169
|
+
className: p.imageCommonPanelInput
|
|
1170
1170
|
}
|
|
1171
1171
|
) }) })
|
|
1172
1172
|
] }) }),
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1174
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-position.bellow") }) }),
|
|
1175
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1176
1176
|
Vn,
|
|
1177
1177
|
{
|
|
1178
1178
|
disabled: w,
|
|
@@ -1183,17 +1183,17 @@ const Ct = {
|
|
|
1183
1183
|
) }) })
|
|
1184
1184
|
] }) })
|
|
1185
1185
|
] }),
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-position.options") }) }) }),
|
|
1187
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, style: { marginBottom: "50px" }, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(Bi, { disabled: w, checked: y, onChange: S, children: n.t("image-position.moveObjectWithText") }) }) })
|
|
1188
1188
|
] });
|
|
1189
1189
|
}, nn = 0, tn = 100, gr = (i) => {
|
|
1190
1190
|
const e = Ie($), n = Ie(fn), t = Ie(we), r = Ie(ee), o = Ie(q), { drawings: s } = i, c = s[0];
|
|
1191
1191
|
if (c == null)
|
|
1192
1192
|
return null;
|
|
1193
|
-
const { unitId: d } = c, a = o.getUniverDocInstance(d),
|
|
1194
|
-
if ((
|
|
1193
|
+
const { unitId: d } = c, a = o.getUniverDocInstance(d), l = r.getRenderById(d);
|
|
1194
|
+
if ((l == null ? void 0 : l.scene) == null)
|
|
1195
1195
|
return null;
|
|
1196
|
-
const [
|
|
1196
|
+
const [g, h] = se(!0), [u, v] = se(!0), [w, I] = se(!0), [O, C] = se(he.INLINE), [P, b] = se(""), [y, E] = se({
|
|
1197
1197
|
distT: 0,
|
|
1198
1198
|
distL: 0,
|
|
1199
1199
|
distB: 0,
|
|
@@ -1278,7 +1278,7 @@ const Ct = {
|
|
|
1278
1278
|
distL: T,
|
|
1279
1279
|
distB: U,
|
|
1280
1280
|
distR: F
|
|
1281
|
-
}), b(z),
|
|
1281
|
+
}), b(z), h(M !== W.WRAP_SQUARE), M === W.WRAP_NONE || M === W.INLINE ? v(!0) : v(!1), M === W.WRAP_NONE || M === W.INLINE || M === W.WRAP_TOP_AND_BOTTOM ? I(!0) : I(!1), M === W.WRAP_NONE)
|
|
1282
1282
|
A === ae.TRUE ? C(he.BEHIND_TEXT) : C(he.IN_FRONT_OF_TEXT);
|
|
1283
1283
|
else
|
|
1284
1284
|
switch (M) {
|
|
@@ -1309,27 +1309,27 @@ const Ct = {
|
|
|
1309
1309
|
return () => {
|
|
1310
1310
|
S.unsubscribe(), D.dispose();
|
|
1311
1311
|
};
|
|
1312
|
-
}, []), /* @__PURE__ */ K("div", { className: V(
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1312
|
+
}, []), /* @__PURE__ */ K("div", { className: V(p.imageCommonPanelGrid, p.imageCommonPanelBorder), style: { display: B ? "block" : "none" }, children: [
|
|
1313
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelTitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.title") }) }) }),
|
|
1314
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrappingStyle") }) }) }),
|
|
1315
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { value: O, onChange: _, direction: "vertical", children: [
|
|
1316
|
+
/* @__PURE__ */ f(Me, { value: he.INLINE, children: n.t("image-text-wrap.inline") }),
|
|
1317
|
+
/* @__PURE__ */ f(Me, { value: he.WRAP_SQUARE, children: n.t("image-text-wrap.square") }),
|
|
1318
|
+
/* @__PURE__ */ f(Me, { value: he.WRAP_TOP_AND_BOTTOM, children: n.t("image-text-wrap.topAndBottom") }),
|
|
1319
|
+
/* @__PURE__ */ f(Me, { value: he.BEHIND_TEXT, children: n.t("image-text-wrap.behindText") }),
|
|
1320
|
+
/* @__PURE__ */ f(Me, { value: he.IN_FRONT_OF_TEXT, children: n.t("image-text-wrap.inFrontText") })
|
|
1321
1321
|
] }) }) }),
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.wrapText") }) }) }),
|
|
1323
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelRow), children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn), children: /* @__PURE__ */ K($n, { disabled: g, value: P, onChange: L, direction: "horizontal", children: [
|
|
1324
|
+
/* @__PURE__ */ f(Me, { value: Ke.BOTH_SIDES, children: n.t("image-text-wrap.bothSide") }),
|
|
1325
|
+
/* @__PURE__ */ f(Me, { value: Ke.LEFT, children: n.t("image-text-wrap.leftOnly") }),
|
|
1326
|
+
/* @__PURE__ */ f(Me, { value: Ke.RIGHT, children: n.t("image-text-wrap.rightOnly") })
|
|
1327
1327
|
] }) }) }),
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */ K("div", { className:
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSubtitle), children: /* @__PURE__ */ f("div", { children: n.t("image-text-wrap.distanceFromText") }) }) }),
|
|
1329
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1330
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1331
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.top") }) }),
|
|
1332
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1333
1333
|
He,
|
|
1334
1334
|
{
|
|
1335
1335
|
min: nn,
|
|
@@ -1340,13 +1340,13 @@ const Ct = {
|
|
|
1340
1340
|
onChange: (S) => {
|
|
1341
1341
|
G(S, "distT");
|
|
1342
1342
|
},
|
|
1343
|
-
className:
|
|
1343
|
+
className: p.imageCommonPanelInput
|
|
1344
1344
|
}
|
|
1345
1345
|
) }) })
|
|
1346
1346
|
] }) }),
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1347
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1348
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.left") }) }),
|
|
1349
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1350
1350
|
He,
|
|
1351
1351
|
{
|
|
1352
1352
|
min: nn,
|
|
@@ -1357,15 +1357,15 @@ const Ct = {
|
|
|
1357
1357
|
onChange: (S) => {
|
|
1358
1358
|
G(S, "distL");
|
|
1359
1359
|
},
|
|
1360
|
-
className:
|
|
1360
|
+
className: p.imageCommonPanelInput
|
|
1361
1361
|
}
|
|
1362
1362
|
) }) })
|
|
1363
1363
|
] }) })
|
|
1364
1364
|
] }),
|
|
1365
|
-
/* @__PURE__ */ K("div", { className:
|
|
1366
|
-
/* @__PURE__ */
|
|
1367
|
-
/* @__PURE__ */
|
|
1368
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ K("div", { className: p.imageCommonPanelRow, children: [
|
|
1366
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1367
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.bottom") }) }),
|
|
1368
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1369
1369
|
He,
|
|
1370
1370
|
{
|
|
1371
1371
|
min: nn,
|
|
@@ -1376,13 +1376,13 @@ const Ct = {
|
|
|
1376
1376
|
onChange: (S) => {
|
|
1377
1377
|
G(S, "distB");
|
|
1378
1378
|
},
|
|
1379
|
-
className:
|
|
1379
|
+
className: p.imageCommonPanelInput
|
|
1380
1380
|
}
|
|
1381
1381
|
) }) })
|
|
1382
1382
|
] }) }),
|
|
1383
|
-
/* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ f("div", { className: V(p.imageCommonPanelColumn, p.imageCommonPanelSpan2), children: /* @__PURE__ */ K("label", { children: [
|
|
1384
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: n.t("image-text-wrap.right") }) }),
|
|
1385
|
+
/* @__PURE__ */ f("div", { className: p.imageCommonPanelRow, children: /* @__PURE__ */ f("div", { className: p.imageCommonPanelColumn, children: /* @__PURE__ */ f(
|
|
1386
1386
|
He,
|
|
1387
1387
|
{
|
|
1388
1388
|
min: nn,
|
|
@@ -1393,7 +1393,7 @@ const Ct = {
|
|
|
1393
1393
|
onChange: (S) => {
|
|
1394
1394
|
G(S, "distR");
|
|
1395
1395
|
},
|
|
1396
|
-
className:
|
|
1396
|
+
className: p.imageCommonPanelInput
|
|
1397
1397
|
}
|
|
1398
1398
|
) }) })
|
|
1399
1399
|
] }) })
|
|
@@ -1408,10 +1408,10 @@ const Ct = {
|
|
|
1408
1408
|
return () => {
|
|
1409
1409
|
r.unsubscribe();
|
|
1410
1410
|
};
|
|
1411
|
-
}, []), !!(n != null && n.length) && /* @__PURE__ */ K("div", { className:
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1411
|
+
}, []), !!(n != null && n.length) && /* @__PURE__ */ K("div", { className: p.imageCommonPanel, children: [
|
|
1412
|
+
/* @__PURE__ */ f(di, { drawings: n, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }),
|
|
1413
|
+
/* @__PURE__ */ f(gr, { drawings: n }),
|
|
1414
|
+
/* @__PURE__ */ f(lr, { drawings: n })
|
|
1415
1415
|
] });
|
|
1416
1416
|
}, Nt = "addition-and-subtraction-single", Et = "doc.menu.image", At = St.id, ur = (i) => {
|
|
1417
1417
|
const e = i.get(Tn), n = i.get(q);
|
|
@@ -1420,10 +1420,10 @@ const Ct = {
|
|
|
1420
1420
|
var s;
|
|
1421
1421
|
const o = e.getActiveTextRange();
|
|
1422
1422
|
if (o) {
|
|
1423
|
-
const { segmentId: c, startOffset: d, endOffset: a } = o,
|
|
1424
|
-
if (m && m.length && m.some((
|
|
1425
|
-
const { startIndex:
|
|
1426
|
-
return d >=
|
|
1423
|
+
const { segmentId: c, startOffset: d, endOffset: a } = o, l = n.getCurrentUniverDocInstance(), m = (s = l == null ? void 0 : l.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : s.tables;
|
|
1424
|
+
if (m && m.length && m.some((g) => {
|
|
1425
|
+
const { startIndex: h, endIndex: u } = g;
|
|
1426
|
+
return d >= h && d < u || a >= h && a < u;
|
|
1427
1427
|
})) {
|
|
1428
1428
|
t.next(!0);
|
|
1429
1429
|
return;
|
|
@@ -1702,13 +1702,13 @@ var Mr = Object.getOwnPropertyDescriptor, br = (i, e, n, t) => {
|
|
|
1702
1702
|
return r;
|
|
1703
1703
|
}, We = (i, e) => (n, t) => e(n, t, i);
|
|
1704
1704
|
function xt(i, e, n = 1, t = 0) {
|
|
1705
|
-
const { top: r, left: o, bottom: s, right: c } = i, d = c - o, a = s - r,
|
|
1705
|
+
const { top: r, left: o, bottom: s, right: c } = i, d = c - o, a = s - r, l = e.getViewport(dt.VIEW_MAIN), { viewportScrollX: m, viewportScrollY: g } = l, { scaleX: h, scaleY: u } = e.getAncestorScale();
|
|
1706
1706
|
return {
|
|
1707
|
-
startX: (o - m) *
|
|
1708
|
-
startY: (r -
|
|
1709
|
-
endX: (o + d - m) *
|
|
1710
|
-
endY: (r + a -
|
|
1711
|
-
width: d *
|
|
1707
|
+
startX: (o - m) * h,
|
|
1708
|
+
startY: (r - g) * u,
|
|
1709
|
+
endX: (o + d - m) * h,
|
|
1710
|
+
endY: (r + a - g) * u,
|
|
1711
|
+
width: d * h,
|
|
1712
1712
|
height: a * u,
|
|
1713
1713
|
rotate: t,
|
|
1714
1714
|
absolute: {
|
|
@@ -1771,7 +1771,7 @@ let ln = class extends Be {
|
|
|
1771
1771
|
if (!(c == null || c.length === 0))
|
|
1772
1772
|
for (const d of c) {
|
|
1773
1773
|
this._addHoverForRect(d);
|
|
1774
|
-
const a = new zt(),
|
|
1774
|
+
const a = new zt(), l = Sn(d, o.renderUnit), m = new yn(l), g = o.canvas, h = s.data, u = {
|
|
1775
1775
|
dispose: a,
|
|
1776
1776
|
rect: d,
|
|
1777
1777
|
position$: m,
|
|
@@ -1782,18 +1782,18 @@ let ln = class extends Be {
|
|
|
1782
1782
|
id: s.drawingId,
|
|
1783
1783
|
componentKey: s.componentKey,
|
|
1784
1784
|
onPointerDown: (w) => {
|
|
1785
|
-
|
|
1785
|
+
g.dispatchEvent(new PointerEvent(w.type, w));
|
|
1786
1786
|
},
|
|
1787
1787
|
onPointerMove: (w) => {
|
|
1788
|
-
|
|
1788
|
+
g.dispatchEvent(new PointerEvent(w.type, w));
|
|
1789
1789
|
},
|
|
1790
1790
|
onPointerUp: (w) => {
|
|
1791
|
-
|
|
1791
|
+
g.dispatchEvent(new PointerEvent(w.type, w));
|
|
1792
1792
|
},
|
|
1793
1793
|
onWheel: (w) => {
|
|
1794
|
-
|
|
1794
|
+
g.dispatchEvent(new WheelEvent(w.type, w));
|
|
1795
1795
|
},
|
|
1796
|
-
data:
|
|
1796
|
+
data: h,
|
|
1797
1797
|
unitId: t
|
|
1798
1798
|
});
|
|
1799
1799
|
const v = d.onTransformChange$.subscribeEvent(() => {
|
|
@@ -1871,7 +1871,7 @@ let ln = class extends Be {
|
|
|
1871
1871
|
if (!r) return !1;
|
|
1872
1872
|
const c = (v = r.renderUnit.with(ie).getSkeleton().getSkeletonData()) == null ? void 0 : v.pages[0];
|
|
1873
1873
|
if (!c) return !1;
|
|
1874
|
-
const { pageWidth: d, marginLeft: a, marginRight:
|
|
1874
|
+
const { pageWidth: d, marginLeft: a, marginRight: l } = c, m = d - a - l, g = {
|
|
1875
1875
|
size: {
|
|
1876
1876
|
width: (w = n.width) != null ? w : m,
|
|
1877
1877
|
height: n.height
|
|
@@ -1885,24 +1885,24 @@ let ln = class extends Be {
|
|
|
1885
1885
|
posOffset: 0
|
|
1886
1886
|
},
|
|
1887
1887
|
angle: 0
|
|
1888
|
-
},
|
|
1888
|
+
}, h = (I = n.drawingId) != null ? I : Xt(), u = {
|
|
1889
1889
|
unitId: t.getUnitId(),
|
|
1890
1890
|
drawings: [
|
|
1891
1891
|
{
|
|
1892
|
-
drawingId:
|
|
1892
|
+
drawingId: h,
|
|
1893
1893
|
drawingType: Ue.DRAWING_DOM,
|
|
1894
1894
|
subUnitId: t.getUnitId(),
|
|
1895
1895
|
unitId: t.getUnitId(),
|
|
1896
1896
|
...e,
|
|
1897
1897
|
title: "",
|
|
1898
1898
|
description: "",
|
|
1899
|
-
docTransform:
|
|
1899
|
+
docTransform: g,
|
|
1900
1900
|
layoutType: W.INLINE,
|
|
1901
|
-
transform: ct(
|
|
1901
|
+
transform: ct(g)
|
|
1902
1902
|
}
|
|
1903
1903
|
]
|
|
1904
1904
|
};
|
|
1905
|
-
return this._commandService.syncExecuteCommand(Rn.id, u),
|
|
1905
|
+
return this._commandService.syncExecuteCommand(Rn.id, u), h;
|
|
1906
1906
|
}
|
|
1907
1907
|
};
|
|
1908
1908
|
ln = br([
|
|
@@ -1914,20 +1914,20 @@ ln = br([
|
|
|
1914
1914
|
We(5, $)
|
|
1915
1915
|
], ln);
|
|
1916
1916
|
const Rr = (i) => {
|
|
1917
|
-
const { floatDomInfos: e, scene: n, offset: t } = i, r = Vi(() => e.map((
|
|
1918
|
-
const { width:
|
|
1917
|
+
const { floatDomInfos: e, scene: n, offset: t, bound: r } = i, o = r.right - r.left, s = r.bottom - r.top, c = Vi(() => e.map((d) => {
|
|
1918
|
+
const { width: a = 0, height: l = 0, left: m = 0, top: g = 0 } = d.transform, u = xt(
|
|
1919
1919
|
{
|
|
1920
|
-
left:
|
|
1921
|
-
right:
|
|
1922
|
-
top:
|
|
1923
|
-
bottom:
|
|
1920
|
+
left: m,
|
|
1921
|
+
right: m + a,
|
|
1922
|
+
top: g,
|
|
1923
|
+
bottom: g + l
|
|
1924
1924
|
},
|
|
1925
1925
|
n
|
|
1926
|
-
),
|
|
1927
|
-
position$: new yn(
|
|
1928
|
-
position:
|
|
1929
|
-
id:
|
|
1930
|
-
componentKey:
|
|
1926
|
+
), v = {
|
|
1927
|
+
position$: new yn(u),
|
|
1928
|
+
position: u,
|
|
1929
|
+
id: d.drawingId,
|
|
1930
|
+
componentKey: d.componentKey,
|
|
1931
1931
|
onPointerMove: () => {
|
|
1932
1932
|
},
|
|
1933
1933
|
onPointerDown: () => {
|
|
@@ -1936,11 +1936,12 @@ const Rr = (i) => {
|
|
|
1936
1936
|
},
|
|
1937
1937
|
onWheel: () => {
|
|
1938
1938
|
},
|
|
1939
|
-
unitId:
|
|
1939
|
+
unitId: d.unitId,
|
|
1940
|
+
data: d.data
|
|
1940
1941
|
};
|
|
1941
|
-
return [
|
|
1942
|
-
}), [e, n, t]);
|
|
1943
|
-
return /* @__PURE__ */
|
|
1942
|
+
return [d.drawingId, v];
|
|
1943
|
+
}).filter(([d, a]) => !(a.position.endX < 0 || a.position.endY < 0 || a.position.startX > o || a.position.startY > s)), [e, n, t, o, s]);
|
|
1944
|
+
return /* @__PURE__ */ f("div", { style: { position: "absolute", top: 0, left: 0 }, children: c.map(([d, a]) => /* @__PURE__ */ f(yi, { layer: a, id: d, position: a.position }, d)) });
|
|
1944
1945
|
};
|
|
1945
1946
|
var Nr = Object.getOwnPropertyDescriptor, Er = (i, e, n, t) => {
|
|
1946
1947
|
for (var r = t > 1 ? void 0 : t ? Nr(e, n) : e, o = i.length - 1, s; o >= 0; o--)
|
|
@@ -1977,23 +1978,30 @@ let gn = class extends Be {
|
|
|
1977
1978
|
if (o) {
|
|
1978
1979
|
const s = o.order.map((d) => {
|
|
1979
1980
|
const a = o.data[d];
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1981
|
+
if (a.drawingType === Ue.DRAWING_CHART)
|
|
1982
|
+
return {
|
|
1983
|
+
...a,
|
|
1984
|
+
componentKey: this._componetManager.get(qt)
|
|
1985
|
+
};
|
|
1986
|
+
if (a.drawingType === Ue.DRAWING_DOM) {
|
|
1987
|
+
const l = this._docPrintInterceptorService.getPrintComponent(a.componentKey);
|
|
1988
|
+
return {
|
|
1989
|
+
...a,
|
|
1990
|
+
componentKey: this._componetManager.get(l || a.componentKey)
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1993
|
+
return null;
|
|
1987
1994
|
}).filter(Boolean), c = Mi(Rr, this._injector);
|
|
1988
1995
|
return Fi(
|
|
1989
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ f(
|
|
1990
1997
|
c,
|
|
1991
1998
|
{
|
|
1992
1999
|
unitId: t,
|
|
1993
2000
|
floatDomInfos: s,
|
|
1994
2001
|
scene: e.scene,
|
|
1995
2002
|
skeleton: e.skeleton,
|
|
1996
|
-
offset: e.offset
|
|
2003
|
+
offset: e.offset,
|
|
2004
|
+
bound: e.bound
|
|
1997
2005
|
}
|
|
1998
2006
|
),
|
|
1999
2007
|
e.root
|
|
@@ -2062,7 +2070,7 @@ let mn = class extends Be {
|
|
|
2062
2070
|
this._transformerCache.clear();
|
|
2063
2071
|
const { objects: s } = o;
|
|
2064
2072
|
for (const d of s.values()) {
|
|
2065
|
-
const { oKey: a, width:
|
|
2073
|
+
const { oKey: a, width: l, height: m, left: g, top: h, angle: u } = d, v = this._drawingManagerService.getDrawingOKey(a);
|
|
2066
2074
|
if (v == null)
|
|
2067
2075
|
continue;
|
|
2068
2076
|
const w = this._univerInstanceService.getUniverDocInstance(v.unitId), I = (c = w == null ? void 0 : w.getSnapshot().drawings) == null ? void 0 : c[v.drawingId];
|
|
@@ -2073,9 +2081,9 @@ let mn = class extends Be {
|
|
|
2073
2081
|
}
|
|
2074
2082
|
I != null && this._transformerCache.set(v.drawingId, {
|
|
2075
2083
|
drawing: I,
|
|
2076
|
-
top:
|
|
2077
|
-
left:
|
|
2078
|
-
width:
|
|
2084
|
+
top: h,
|
|
2085
|
+
left: g,
|
|
2086
|
+
width: l,
|
|
2079
2087
|
height: m,
|
|
2080
2088
|
angle: u
|
|
2081
2089
|
});
|
|
@@ -2091,8 +2099,8 @@ let mn = class extends Be {
|
|
|
2091
2099
|
if (s.size > 1)
|
|
2092
2100
|
t(s);
|
|
2093
2101
|
else if (s.size === 1) {
|
|
2094
|
-
const a = this._transformerCache.values().next().value,
|
|
2095
|
-
if (a && m === a.width &&
|
|
2102
|
+
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top: h, left: u, angle: v } = l;
|
|
2103
|
+
if (a && m === a.width && g === a.height && h === a.top && u === a.left && v === a.angle)
|
|
2096
2104
|
return;
|
|
2097
2105
|
a && (a.drawing.layoutType, W.INLINE), a && a.drawing.layoutType === W.INLINE && c != null && d != null && this._updateInlineDrawingAnchor(a.drawing, c, d);
|
|
2098
2106
|
}
|
|
@@ -2104,10 +2112,10 @@ let mn = class extends Be {
|
|
|
2104
2112
|
n.changeEnd$.subscribe((o) => {
|
|
2105
2113
|
const { objects: s, offsetX: c, offsetY: d } = o;
|
|
2106
2114
|
for (const a of s.values()) {
|
|
2107
|
-
const
|
|
2108
|
-
if (
|
|
2115
|
+
const l = this._drawingManagerService.getDrawingOKey(a.oKey);
|
|
2116
|
+
if (l == null)
|
|
2109
2117
|
continue;
|
|
2110
|
-
const m = this._transformerCache.get(
|
|
2118
|
+
const m = this._transformerCache.get(l == null ? void 0 : l.drawingId);
|
|
2111
2119
|
if ((m == null ? void 0 : m.drawing.layoutType) === W.INLINE)
|
|
2112
2120
|
try {
|
|
2113
2121
|
a.setOpacity(1);
|
|
@@ -2117,10 +2125,10 @@ let mn = class extends Be {
|
|
|
2117
2125
|
if (this._anchorShape && this._anchorShape.hide(), s.size > 1)
|
|
2118
2126
|
this._updateMultipleDrawingDocTransform(s);
|
|
2119
2127
|
else if (s.size === 1) {
|
|
2120
|
-
const a = this._transformerCache.values().next().value,
|
|
2121
|
-
if (a && m === a.width &&
|
|
2128
|
+
const a = this._transformerCache.values().next().value, l = s.values().next().value, { width: m, height: g, top: h, left: u, angle: v } = l;
|
|
2129
|
+
if (a && m === a.width && g === a.height && h === a.top && u === a.left && v === a.angle)
|
|
2122
2130
|
return;
|
|
2123
|
-
a && a.drawing.layoutType === W.INLINE ? m !== a.width ||
|
|
2131
|
+
a && a.drawing.layoutType === W.INLINE ? m !== a.width || g !== a.height || v !== a.angle ? this._updateDrawingSize(a, l) : c != null && d != null && this._moveInlineDrawing(a.drawing, c, d) : a && this._nonInlineDrawingTransform(a.drawing, l);
|
|
2124
2132
|
}
|
|
2125
2133
|
this._transformerCache.clear();
|
|
2126
2134
|
})
|
|
@@ -2135,37 +2143,37 @@ let mn = class extends Be {
|
|
|
2135
2143
|
let t, r;
|
|
2136
2144
|
for (const o of e.values()) {
|
|
2137
2145
|
const { oKey: s, left: c, top: d, angle: a } = o;
|
|
2138
|
-
let { width:
|
|
2139
|
-
const
|
|
2140
|
-
if (
|
|
2146
|
+
let { width: l, height: m } = o;
|
|
2147
|
+
const g = this._drawingManagerService.getDrawingOKey(s);
|
|
2148
|
+
if (g == null)
|
|
2141
2149
|
continue;
|
|
2142
|
-
t == null && (t =
|
|
2143
|
-
const
|
|
2144
|
-
if (
|
|
2150
|
+
t == null && (t = g.unitId), r == null && (r = g.subUnitId);
|
|
2151
|
+
const h = this._transformerCache.get(g.drawingId);
|
|
2152
|
+
if (h == null)
|
|
2145
2153
|
continue;
|
|
2146
|
-
const { drawing: u, top: v, left: w, width: I, height: O, angle: C } =
|
|
2147
|
-
if (
|
|
2148
|
-
drawingId:
|
|
2154
|
+
const { drawing: u, top: v, left: w, width: I, height: O, angle: C } = h, { width: P, height: b } = this._getPageContentSize(u);
|
|
2155
|
+
if (l = Math.min(l, P), m = Math.min(m, b), (I !== l || O !== m) && n.push({
|
|
2156
|
+
drawingId: g.drawingId,
|
|
2149
2157
|
key: "size",
|
|
2150
2158
|
value: {
|
|
2151
|
-
width:
|
|
2159
|
+
width: l,
|
|
2152
2160
|
height: m
|
|
2153
2161
|
}
|
|
2154
2162
|
}), C !== a && n.push({
|
|
2155
|
-
drawingId:
|
|
2163
|
+
drawingId: g.drawingId,
|
|
2156
2164
|
key: "angle",
|
|
2157
2165
|
value: a
|
|
2158
2166
|
}), v !== d || w !== c) {
|
|
2159
2167
|
const y = d - v, E = c - w;
|
|
2160
2168
|
y !== 0 && n.push({
|
|
2161
|
-
drawingId:
|
|
2169
|
+
drawingId: g.drawingId,
|
|
2162
2170
|
key: "positionV",
|
|
2163
2171
|
value: {
|
|
2164
2172
|
relativeFrom: u.docTransform.positionV.relativeFrom,
|
|
2165
2173
|
posOffset: u.docTransform.positionV.posOffset + y
|
|
2166
2174
|
}
|
|
2167
2175
|
}), E !== 0 && n.push({
|
|
2168
|
-
drawingId:
|
|
2176
|
+
drawingId: g.drawingId,
|
|
2169
2177
|
key: "positionH",
|
|
2170
2178
|
value: {
|
|
2171
2179
|
relativeFrom: u.docTransform.positionH.relativeFrom,
|
|
@@ -2200,29 +2208,29 @@ let mn = class extends Be {
|
|
|
2200
2208
|
if (r == null)
|
|
2201
2209
|
return;
|
|
2202
2210
|
const { mainComponent: s, scene: c } = r, d = s, a = c.getViewports()[0], {
|
|
2203
|
-
pageLayoutType:
|
|
2211
|
+
pageLayoutType: l = kn.VERTICAL,
|
|
2204
2212
|
pageMarginLeft: m,
|
|
2205
|
-
pageMarginTop:
|
|
2213
|
+
pageMarginTop: g
|
|
2206
2214
|
} = d.getOffsetConfig();
|
|
2207
|
-
let
|
|
2215
|
+
let h = null, u = !1, v = -1, w = "";
|
|
2208
2216
|
const I = 0.5, O = this._getTransformCoordForDocumentOffset(d, a, n, t);
|
|
2209
2217
|
if (O == null)
|
|
2210
2218
|
return;
|
|
2211
2219
|
const C = (x = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : x.with(Re);
|
|
2212
2220
|
if (C == null)
|
|
2213
2221
|
return;
|
|
2214
|
-
const P = o == null ? void 0 : o.findNodeByCoord(O,
|
|
2222
|
+
const P = o == null ? void 0 : o.findNodeByCoord(O, l, m, g, {
|
|
2215
2223
|
strict: !1,
|
|
2216
2224
|
segmentId: C.getSegment(),
|
|
2217
2225
|
segmentPage: C.getSegmentPage()
|
|
2218
2226
|
});
|
|
2219
2227
|
if (P) {
|
|
2220
2228
|
const { node: S, ratioX: D, segmentPage: R, segmentId: T } = P;
|
|
2221
|
-
u = D < I,
|
|
2229
|
+
u = D < I, h = S, v = R, w = T;
|
|
2222
2230
|
}
|
|
2223
|
-
if (
|
|
2231
|
+
if (h == null)
|
|
2224
2232
|
return;
|
|
2225
|
-
const b = o == null ? void 0 : o.findPositionByGlyph(
|
|
2233
|
+
const b = o == null ? void 0 : o.findPositionByGlyph(h, v), y = this._getDocObject();
|
|
2226
2234
|
if (b == null || o == null || y == null || Qn(b))
|
|
2227
2235
|
return;
|
|
2228
2236
|
const E = {
|
|
@@ -2238,7 +2246,7 @@ let mn = class extends Be {
|
|
|
2238
2246
|
const t = this._renderManagerService.getRenderById(e.unitId), r = t == null ? void 0 : t.with(ie).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
|
|
2239
2247
|
if (o == null || t == null)
|
|
2240
2248
|
return;
|
|
2241
|
-
const { pages: s, skeHeaders: c, skeFooters: d } = o, { mainComponent: a, scene:
|
|
2249
|
+
const { pages: s, skeHeaders: c, skeFooters: d } = o, { mainComponent: a, scene: l } = t, m = a, g = l.getViewports()[0], { pageLayoutType: h = kn.VERTICAL, pageMarginLeft: u, pageMarginTop: v, docsLeft: w, docsTop: I } = m.getOffsetConfig(), { left: O, top: C, angle: P } = n;
|
|
2242
2250
|
let { width: b, height: y } = n;
|
|
2243
2251
|
const { positionV: E, positionH: B } = e.docTransform, { width: N, height: _ } = this._getPageContentSize(e);
|
|
2244
2252
|
b = Math.min(b, N), y = Math.min(y, _);
|
|
@@ -2250,13 +2258,13 @@ let mn = class extends Be {
|
|
|
2250
2258
|
height: y
|
|
2251
2259
|
},
|
|
2252
2260
|
angle: P
|
|
2253
|
-
}, { x: D, y: R } =
|
|
2261
|
+
}, { x: D, y: R } = l.getViewportScrollXY(g), T = this._getTransformCoordForDocumentOffset(m, g, O - D, C - R);
|
|
2254
2262
|
if (T == null)
|
|
2255
2263
|
return;
|
|
2256
2264
|
const U = (De = this._renderManagerService.getRenderById(e.unitId)) == null ? void 0 : De.with(Re);
|
|
2257
2265
|
if (U == null)
|
|
2258
2266
|
return;
|
|
2259
|
-
const F = r == null ? void 0 : r.findNodeByCoord(T,
|
|
2267
|
+
const F = r == null ? void 0 : r.findNodeByCoord(T, h, u, v, {
|
|
2260
2268
|
strict: !1,
|
|
2261
2269
|
segmentId: U.getSegment(),
|
|
2262
2270
|
segmentPage: U.getSegmentPage()
|
|
@@ -2303,7 +2311,7 @@ let mn = class extends Be {
|
|
|
2303
2311
|
}
|
|
2304
2312
|
if (this._liquid.translatePagePadding(ve), ve === k)
|
|
2305
2313
|
break;
|
|
2306
|
-
this._liquid.restorePagePadding(ve), this._liquid.translatePage(ve,
|
|
2314
|
+
this._liquid.restorePagePadding(ve), this._liquid.translatePage(ve, h, u, v);
|
|
2307
2315
|
}
|
|
2308
2316
|
switch (E.relativeFrom === H.LINE ? L = M.divides[0].glyphGroup[0] : L = (me = (ge = (ye = (Ae = z.divides) == null ? void 0 : Ae[0]) == null ? void 0 : ye.glyphGroup) == null ? void 0 : ge[0]) != null ? me : L, S.positionH = {
|
|
2309
2317
|
relativeFrom: B.relativeFrom,
|
|
@@ -2350,19 +2358,19 @@ let mn = class extends Be {
|
|
|
2350
2358
|
// Update drawing when use transformer to resize it.
|
|
2351
2359
|
_updateDrawingSize(e, n) {
|
|
2352
2360
|
const t = [], { drawing: r, width: o, height: s, angle: c } = e, { unitId: d, subUnitId: a } = r;
|
|
2353
|
-
let { width:
|
|
2354
|
-
const { width:
|
|
2355
|
-
|
|
2361
|
+
let { width: l, height: m, angle: g } = n;
|
|
2362
|
+
const { width: h, height: u } = this._getPageContentSize(r);
|
|
2363
|
+
l = Math.min(h, l), m = Math.min(u, m), (l !== o || m !== s) && t.push({
|
|
2356
2364
|
drawingId: r.drawingId,
|
|
2357
2365
|
key: "size",
|
|
2358
2366
|
value: {
|
|
2359
|
-
width:
|
|
2367
|
+
width: l,
|
|
2360
2368
|
height: m
|
|
2361
2369
|
}
|
|
2362
|
-
}),
|
|
2370
|
+
}), g !== c && t.push({
|
|
2363
2371
|
drawingId: r.drawingId,
|
|
2364
2372
|
key: "angle",
|
|
2365
|
-
value:
|
|
2373
|
+
value: g
|
|
2366
2374
|
}), t.length > 0 && d && a && this._commandService.executeCommand(Ze.id, {
|
|
2367
2375
|
unitId: d,
|
|
2368
2376
|
subUnitId: a,
|
|
@@ -2385,8 +2393,8 @@ let mn = class extends Be {
|
|
|
2385
2393
|
// Limit the drawing to the page area, mainly in the vertical direction,
|
|
2386
2394
|
// and the upper and lower limits cannot exceed the page margin area.
|
|
2387
2395
|
_limitDrawingInPage(e, n) {
|
|
2388
|
-
const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: c, angle: d } = n, a = t == null ? void 0 : t.with(ie).getSkeleton(),
|
|
2389
|
-
if (
|
|
2396
|
+
const t = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: s, height: c, angle: d } = n, a = t == null ? void 0 : t.with(ie).getSkeleton(), l = a == null ? void 0 : a.getSkeletonData(), { pages: m } = l != null ? l : {};
|
|
2397
|
+
if (l == null || t == null || m == null)
|
|
2390
2398
|
return {
|
|
2391
2399
|
left: r,
|
|
2392
2400
|
top: o,
|
|
@@ -2394,7 +2402,7 @@ let mn = class extends Be {
|
|
|
2394
2402
|
height: c,
|
|
2395
2403
|
angle: d
|
|
2396
2404
|
};
|
|
2397
|
-
const { mainComponent:
|
|
2405
|
+
const { mainComponent: g } = t, h = g, { top: u, pageLayoutType: v, pageMarginLeft: w, pageMarginTop: I } = h;
|
|
2398
2406
|
let O = o;
|
|
2399
2407
|
this._liquid.reset();
|
|
2400
2408
|
for (const C of m) {
|
|
@@ -2456,15 +2464,15 @@ let mn = class extends Be {
|
|
|
2456
2464
|
const { mainComponent: r, scene: o } = t, s = r, {
|
|
2457
2465
|
docsLeft: c,
|
|
2458
2466
|
docsTop: d
|
|
2459
|
-
} = s.getOffsetConfig(), a = Ei(n), { left:
|
|
2467
|
+
} = s.getOffsetConfig(), a = Ei(n), { left: l, top: m, height: g } = a, h = l + c, u = m + d;
|
|
2460
2468
|
if (this._anchorShape) {
|
|
2461
|
-
this._anchorShape.transformByState({ left:
|
|
2469
|
+
this._anchorShape.transformByState({ left: h, top: u, height: g }), this._anchorShape.show();
|
|
2462
2470
|
return;
|
|
2463
2471
|
}
|
|
2464
2472
|
const v = 6, w = new wi(Lr + be.generateRandomId(v), {
|
|
2465
|
-
left:
|
|
2473
|
+
left: h,
|
|
2466
2474
|
top: u,
|
|
2467
|
-
height:
|
|
2475
|
+
height: g,
|
|
2468
2476
|
strokeWidth: 2,
|
|
2469
2477
|
stroke: vi(Kt.darkGray, 1),
|
|
2470
2478
|
evented: !1
|
|
@@ -2484,17 +2492,17 @@ let mn = class extends Be {
|
|
|
2484
2492
|
const { pages: c } = s;
|
|
2485
2493
|
let d = null;
|
|
2486
2494
|
for (const a of c) {
|
|
2487
|
-
const { skeDrawings:
|
|
2488
|
-
if (
|
|
2495
|
+
const { skeDrawings: l } = a;
|
|
2496
|
+
if (l.has(e.drawingId)) {
|
|
2489
2497
|
d = a;
|
|
2490
2498
|
break;
|
|
2491
2499
|
}
|
|
2492
2500
|
}
|
|
2493
2501
|
if (d) {
|
|
2494
|
-
const { pageWidth: a, pageHeight:
|
|
2502
|
+
const { pageWidth: a, pageHeight: l, marginLeft: m, marginBottom: g, marginRight: h, marginTop: u } = d;
|
|
2495
2503
|
return {
|
|
2496
|
-
width: Math.max(r, a - m -
|
|
2497
|
-
height: Math.max(o,
|
|
2504
|
+
width: Math.max(r, a - m - h),
|
|
2505
|
+
height: Math.max(o, l - u - g)
|
|
2498
2506
|
};
|
|
2499
2507
|
} else
|
|
2500
2508
|
return {
|
|
@@ -2564,22 +2572,22 @@ let un = class extends Yt {
|
|
|
2564
2572
|
const d = c.oKey, a = this._drawingManagerService.getDrawingOKey(d);
|
|
2565
2573
|
if (!a || a.drawingType === Ue.DRAWING_DOM)
|
|
2566
2574
|
return;
|
|
2567
|
-
const { unitId:
|
|
2575
|
+
const { unitId: l, subUnitId: m, drawingId: g, drawingType: h } = a, u = this._canvasPopManagerService.attachPopupToObject(
|
|
2568
2576
|
c,
|
|
2569
2577
|
{
|
|
2570
2578
|
componentKey: gi,
|
|
2571
2579
|
direction: "horizontal",
|
|
2572
2580
|
offset: [2, 0],
|
|
2573
2581
|
extraProps: {
|
|
2574
|
-
menuItems: this._getImageMenuItems(
|
|
2582
|
+
menuItems: this._getImageMenuItems(l, m, g, h)
|
|
2575
2583
|
}
|
|
2576
2584
|
},
|
|
2577
|
-
|
|
2585
|
+
l
|
|
2578
2586
|
);
|
|
2579
|
-
r.push(this.disposeWithMe(u)), !this._drawingManagerService.getFocusDrawings().find((I) => I.unitId ===
|
|
2580
|
-
unitId:
|
|
2587
|
+
r.push(this.disposeWithMe(u)), !this._drawingManagerService.getFocusDrawings().find((I) => I.unitId === l && I.subUnitId === m && I.drawingId === g) && this._drawingManagerService.focusDrawing([{
|
|
2588
|
+
unitId: l,
|
|
2581
2589
|
subUnitId: m,
|
|
2582
|
-
drawingId:
|
|
2590
|
+
drawingId: g
|
|
2583
2591
|
}]);
|
|
2584
2592
|
})
|
|
2585
2593
|
)
|
|
@@ -2704,12 +2712,12 @@ let Cn = class extends Be {
|
|
|
2704
2712
|
const n = e == null ? void 0 : e.getSkeletonData(), { mainComponent: t, unitId: r } = this._context, o = t;
|
|
2705
2713
|
if (!n)
|
|
2706
2714
|
return;
|
|
2707
|
-
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop:
|
|
2715
|
+
const { left: s, top: c, pageLayoutType: d, pageMarginLeft: a, pageMarginTop: l } = o, { pages: m, skeHeaders: g, skeFooters: h } = n, u = {};
|
|
2708
2716
|
this._liquid.reset();
|
|
2709
2717
|
for (let P = 0, b = m.length; P < b; P++) {
|
|
2710
2718
|
const y = m[P], { headerId: E, footerId: B, pageWidth: N } = y;
|
|
2711
2719
|
if (E) {
|
|
2712
|
-
const _ = (O =
|
|
2720
|
+
const _ = (O = g.get(E)) == null ? void 0 : O.get(N);
|
|
2713
2721
|
_ && this._calculateDrawingPosition(
|
|
2714
2722
|
r,
|
|
2715
2723
|
_,
|
|
@@ -2721,7 +2729,7 @@ let Cn = class extends Be {
|
|
|
2721
2729
|
);
|
|
2722
2730
|
}
|
|
2723
2731
|
if (B) {
|
|
2724
|
-
const _ = (C =
|
|
2732
|
+
const _ = (C = h.get(B)) == null ? void 0 : C.get(N);
|
|
2725
2733
|
_ && this._calculateDrawingPosition(
|
|
2726
2734
|
r,
|
|
2727
2735
|
_,
|
|
@@ -2732,7 +2740,7 @@ let Cn = class extends Be {
|
|
|
2732
2740
|
y.marginLeft
|
|
2733
2741
|
);
|
|
2734
2742
|
}
|
|
2735
|
-
this._calculateDrawingPosition(r, y, s, c, u, y.marginTop, y.marginLeft), this._liquid.translatePage(y, d, a,
|
|
2743
|
+
this._calculateDrawingPosition(r, y, s, c, u, y.marginTop, y.marginLeft), this._liquid.translatePage(y, d, a, l);
|
|
2736
2744
|
}
|
|
2737
2745
|
const v = Object.values(u), w = v.filter((P) => !P.isMultiTransform), I = v.filter((P) => P.isMultiTransform);
|
|
2738
2746
|
w.length > 0 && this._drawingManagerService.refreshTransform(w), this._handleMultiDrawingsTransform(I);
|
|
@@ -2756,11 +2764,11 @@ let Cn = class extends Be {
|
|
|
2756
2764
|
marginTop: s,
|
|
2757
2765
|
marginLeft: c
|
|
2758
2766
|
}), d.forEach((a) => {
|
|
2759
|
-
const { aLeft:
|
|
2760
|
-
left:
|
|
2767
|
+
const { aLeft: l, aTop: m, height: g, width: h, angle: u, drawingId: v, drawingOrigin: w } = a, I = w.layoutType === W.WRAP_NONE && w.behindDoc === ae.TRUE, { isMultiTransform: O = ae.FALSE } = w, C = {
|
|
2768
|
+
left: l + t + this._liquid.x,
|
|
2761
2769
|
top: m + r + this._liquid.y,
|
|
2762
|
-
width:
|
|
2763
|
-
height:
|
|
2770
|
+
width: h,
|
|
2771
|
+
height: g,
|
|
2764
2772
|
angle: u
|
|
2765
2773
|
};
|
|
2766
2774
|
o[v] == null ? o[v] = {
|