@univerjs/docs-drawing-ui 0.2.3 → 0.2.4
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 +1504 -1463
- package/lib/types/commands/commands/update-doc-drawing.command.d.ts +4 -0
- package/lib/types/controllers/doc-drawing-transformer-update.controller.d.ts +3 -2
- package/lib/types/controllers/render-controllers/doc-drawing-transform-update.controller.d.ts +4 -1
- package/lib/types/controllers/render-controllers/doc-drawing-update.render-controller.d.ts +8 -3
- package/lib/types/index.d.ts +0 -1
- package/lib/types/services/doc-refresh-drawings.service.d.ts +8 -0
- package/lib/umd/index.js +1 -1
- package/package.json +25 -25
- package/lib/types/commands/commands/set-doc-drawing.command.d.ts +0 -6
- package/lib/types/views/doc-image-panel/DocDrawingAnchor.d.ts +0 -7
package/lib/es/index.js
CHANGED
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { Inject as
|
|
6
|
-
import { ImageCropperObject as
|
|
7
|
-
import { IDrawingManagerService as
|
|
8
|
-
import { IDocDrawingService as
|
|
9
|
-
import { ITextSelectionRenderManager as
|
|
10
|
-
import { takeUntil as
|
|
11
|
-
import { DocCanvasPopManagerService as
|
|
12
|
-
import { RichTextEditingMutation as
|
|
13
|
-
import { ISidebarService as
|
|
14
|
-
import { useDependency as
|
|
15
|
-
import d, { forwardRef as
|
|
16
|
-
import
|
|
17
|
-
import { RadioGroup as
|
|
18
|
-
const
|
|
1
|
+
var vn = Object.defineProperty;
|
|
2
|
+
var In = (i, e, t) => e in i ? vn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var _e = (i, e, t) => In(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommandType as Y, ICommandService as $, IUniverInstanceService as te, TextX as pt, JSONX as X, MemoryCursor as _n, TextXActionType as Z, LocaleService as ot, RxDisposable as Cn, UniverInstanceType as be, toDisposable as ye, FOCUSING_COMMON_DRAWINGS as it, OnLifecycle as at, LifecycleStages as st, IContextService as Bt, PositionedObjectLayoutType as k, BooleanNumber as oe, ObjectRelativeFromH as ee, ObjectRelativeFromV as V, Tools as Pe, WrapTextType as je, Direction as ge, IUndoRedoService as Ft, FOCUSING_UNIVER_EDITOR as Sn, Disposable as qe, UndoCommand as Dn, RedoCommand as En, throttle as Ct, COLORS as Pn, Plugin as On, DependentOn as Tn } from "@univerjs/core";
|
|
5
|
+
import { Inject as pe, Injector as kt } from "@wendellhu/redi";
|
|
6
|
+
import { ImageCropperObject as Mn, COMPONENT_IMAGE_POPUP_MENU as yn, OpenImageCropOperation as bn, ImageResetSizeOperation as Rn, DrawingCommonPanel as Nn, UniverDrawingUIPlugin as An } from "@univerjs/drawing-ui";
|
|
7
|
+
import { IDrawingManagerService as he, DRAWING_IMAGE_ALLOW_IMAGE_LIST as xn, ArrangeTypeEnum as Ye, DRAWING_IMAGE_COUNT_LIMIT as St, ImageUploadStatusType as mt, DRAWING_IMAGE_ALLOW_SIZE as Ln, getImageSize as Un, DrawingTypeEnum as Bn, getDrawingShapeKeyByDrawingSearch as Fn, DRAWING_IMAGE_WIDTH_LIMIT as Dt, DRAWING_IMAGE_HEIGHT_LIMIT as Et, IImageIoService as kn, UniverDrawingPlugin as Hn } from "@univerjs/drawing";
|
|
8
|
+
import { IDocDrawingService as Re, UniverDocsDrawingPlugin as Wn } from "@univerjs/docs-drawing";
|
|
9
|
+
import { ITextSelectionRenderManager as Ue, IRenderManagerService as se, DocumentEditArea as xe, Liquid as Ht, PageLayoutType as Pt, NodePositionConvertToCursor as Ot, getOneTextSelectionRange as Tt, DocumentSkeletonPageType as Mt, Vector2 as Gn, getAnchorBounding as Vn, Rect as jn, getColor as $n, TEXT_RANGE_LAYER_INDEX as zn } from "@univerjs/engine-render";
|
|
10
|
+
import { takeUntil as yt, BehaviorSubject as qn } from "rxjs";
|
|
11
|
+
import { DocCanvasPopManagerService as Xn, docDrawingPositionToTransform as Kn } from "@univerjs/docs-ui";
|
|
12
|
+
import { RichTextEditingMutation as Q, getRichTextEditPath as $e, DocSkeletonManagerService as ae, TextSelectionManagerService as gt, getRetainAndDeleteFromReplace as Yn, SetDocZoomRatioOperation as Zn, getDocObject as Qn } from "@univerjs/docs";
|
|
13
|
+
import { ISidebarService as Jn, MenuItemType as Wt, MenuPosition as ei, MenuGroup as ti, getMenuHiddenObservable as Gt, KeyCode as Le, ComponentManager as ni, IMenuService as ii, IShortcutService as ri, IMessageService as oi, IEditorService as ai } from "@univerjs/ui";
|
|
14
|
+
import { useDependency as re } from "@wendellhu/redi/react-bindings";
|
|
15
|
+
import d, { forwardRef as Vt, useRef as jt, createElement as $t, useState as ie, useEffect as ht } from "react";
|
|
16
|
+
import j from "clsx";
|
|
17
|
+
import { RadioGroup as bt, Radio as Ee, InputNumber as Ae, Select as Rt, Checkbox as si, MessageType as Nt } from "@univerjs/design";
|
|
18
|
+
const wt = {
|
|
19
19
|
id: "doc.command.remove-doc-image",
|
|
20
|
-
type:
|
|
20
|
+
type: Y.COMMAND,
|
|
21
21
|
// eslint-disable-next-line max-lines-per-function
|
|
22
22
|
handler: (i, e) => {
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
if (e == null ||
|
|
23
|
+
var C, O, y, T;
|
|
24
|
+
const t = i.get($), n = i.get(te), r = i.get(Ue), o = n.getCurrentUniverDocInstance();
|
|
25
|
+
if (e == null || o == null)
|
|
26
26
|
return !1;
|
|
27
|
-
const { drawings: a } = e, s = (
|
|
28
|
-
|
|
29
|
-
const
|
|
27
|
+
const { drawings: a } = e, s = (C = r.getSegment()) != null ? C : "", l = new pt(), c = X.getInstance(), m = (y = (O = o.getSelfOrHeaderFooterModel(s).getBody()) == null ? void 0 : O.customBlocks) != null ? y : [], u = a.map((N) => m.find((R) => R.blockId === N.drawingId)).filter((N) => !!N).sort((N, R) => N.startIndex > R.startIndex ? 1 : -1), f = a[0].unitId, h = new _n();
|
|
28
|
+
h.reset();
|
|
29
|
+
const p = u[0].startIndex, w = [
|
|
30
30
|
{
|
|
31
|
-
startOffset:
|
|
32
|
-
endOffset:
|
|
31
|
+
startOffset: p,
|
|
32
|
+
endOffset: p
|
|
33
33
|
}
|
|
34
34
|
], v = {
|
|
35
|
-
id:
|
|
35
|
+
id: Q.id,
|
|
36
36
|
params: {
|
|
37
|
-
unitId:
|
|
37
|
+
unitId: f,
|
|
38
38
|
actions: [],
|
|
39
39
|
textRanges: w
|
|
40
40
|
}
|
|
41
41
|
}, I = [];
|
|
42
|
-
for (const
|
|
43
|
-
const { startIndex:
|
|
44
|
-
|
|
45
|
-
t:
|
|
46
|
-
len:
|
|
42
|
+
for (const N of u) {
|
|
43
|
+
const { startIndex: R } = N;
|
|
44
|
+
R > h.cursor && l.push({
|
|
45
|
+
t: Z.RETAIN,
|
|
46
|
+
len: R - h.cursor,
|
|
47
47
|
segmentId: ""
|
|
48
48
|
}), l.push({
|
|
49
|
-
t:
|
|
49
|
+
t: Z.DELETE,
|
|
50
50
|
len: 1,
|
|
51
51
|
line: 0,
|
|
52
52
|
segmentId: ""
|
|
53
|
-
}),
|
|
53
|
+
}), h.moveCursorTo(R + 1);
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
I.push(c.editOp(l.serialize(),
|
|
57
|
-
for (const
|
|
58
|
-
const { blockId:
|
|
59
|
-
I.push(
|
|
55
|
+
const D = $e(o, s);
|
|
56
|
+
I.push(c.editOp(l.serialize(), D));
|
|
57
|
+
for (const N of u) {
|
|
58
|
+
const { blockId: R } = N, E = ((T = o.getDrawings()) != null ? T : {})[R], z = o.getDrawingsOrder().indexOf(R), U = c.removeOp(["drawings", R], E), B = c.removeOp(["drawingsOrder", z], R);
|
|
59
|
+
I.push(U), I.push(B);
|
|
60
60
|
}
|
|
61
|
-
return v.params.actions = I.reduce((
|
|
61
|
+
return v.params.actions = I.reduce((N, R) => X.compose(N, R), null), !!t.syncExecuteCommand(v.id, v.params);
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, zt = "COMPONENT_DOC_DRAWING_PANEL", qt = {
|
|
64
64
|
id: "sidebar.operation.doc-image",
|
|
65
|
-
type:
|
|
65
|
+
type: Y.COMMAND,
|
|
66
66
|
handler: async (i, e) => {
|
|
67
|
-
const
|
|
67
|
+
const t = i.get(Jn), n = i.get(ot), r = i.get(he);
|
|
68
68
|
switch (e.value) {
|
|
69
69
|
case "open":
|
|
70
|
-
|
|
71
|
-
header: { title:
|
|
72
|
-
children: { label:
|
|
70
|
+
t.open({
|
|
71
|
+
header: { title: n.t("docImage.panel.title") },
|
|
72
|
+
children: { label: zt },
|
|
73
73
|
onClose: () => {
|
|
74
|
-
|
|
74
|
+
r.focusDrawing(null);
|
|
75
75
|
},
|
|
76
76
|
width: 360
|
|
77
77
|
});
|
|
78
78
|
break;
|
|
79
79
|
case "close":
|
|
80
80
|
default:
|
|
81
|
-
|
|
81
|
+
t.close();
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
return !0;
|
|
85
85
|
}
|
|
86
|
-
},
|
|
86
|
+
}, Xt = {
|
|
87
87
|
id: "doc.operation.edit-doc-image",
|
|
88
|
-
type:
|
|
88
|
+
type: Y.OPERATION,
|
|
89
89
|
handler: (i, e) => {
|
|
90
|
-
const
|
|
91
|
-
return e == null ? !1 : (
|
|
90
|
+
const t = i.get(he), n = i.get($);
|
|
91
|
+
return e == null ? !1 : (t.focusDrawing([e]), n.executeCommand(qt.id, { value: "open" }), !0);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
var
|
|
95
|
-
for (var
|
|
96
|
-
(a = i[
|
|
97
|
-
return
|
|
98
|
-
},
|
|
99
|
-
let
|
|
100
|
-
constructor(e, n,
|
|
94
|
+
var ci = Object.defineProperty, li = Object.getOwnPropertyDescriptor, di = (i, e, t, n) => {
|
|
95
|
+
for (var r = n > 1 ? void 0 : n ? li(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
96
|
+
(a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
|
|
97
|
+
return n && r && ci(e, t, r), r;
|
|
98
|
+
}, ke = (i, e) => (t, n) => e(t, n, i);
|
|
99
|
+
let Je = class extends Cn {
|
|
100
|
+
constructor(e, t, n, r, o) {
|
|
101
101
|
super();
|
|
102
|
-
|
|
103
|
-
this._drawingManagerService = e, this._canvasPopManagerService =
|
|
102
|
+
_e(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
103
|
+
this._drawingManagerService = e, this._canvasPopManagerService = t, this._renderManagerService = n, this._univerInstanceService = r, this._contextService = o, this._init();
|
|
104
104
|
}
|
|
105
105
|
_init() {
|
|
106
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
106
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(be.UNIVER_DOC).pipe(yt(this.dispose$)).subscribe((e) => this._create(e)), this._univerInstanceService.getTypeOfUnitDisposed$(be.UNIVER_DOC).pipe(yt(this.dispose$)).subscribe((e) => this._dispose(e)), this._univerInstanceService.getAllUnitsForType(be.UNIVER_DOC).forEach((e) => this._create(e));
|
|
107
107
|
}
|
|
108
108
|
_dispose(e) {
|
|
109
|
-
const
|
|
110
|
-
this._renderManagerService.removeRender(
|
|
109
|
+
const t = e.getUnitId();
|
|
110
|
+
this._renderManagerService.removeRender(t);
|
|
111
111
|
}
|
|
112
112
|
_create(e) {
|
|
113
113
|
if (!e)
|
|
114
114
|
return;
|
|
115
|
-
const
|
|
116
|
-
this._renderManagerService.has(
|
|
115
|
+
const t = e.getUnitId();
|
|
116
|
+
this._renderManagerService.has(t) && !this._initImagePopupMenu.has(t) && (this._popupMenuListener(t), this._initImagePopupMenu.add(t));
|
|
117
117
|
}
|
|
118
118
|
_hasCropObject(e) {
|
|
119
|
-
const
|
|
120
|
-
for (const
|
|
121
|
-
if (
|
|
119
|
+
const t = e.getAllObjects();
|
|
120
|
+
for (const n of t)
|
|
121
|
+
if (n instanceof Mn)
|
|
122
122
|
return !0;
|
|
123
123
|
return !1;
|
|
124
124
|
}
|
|
125
125
|
// eslint-disable-next-line max-lines-per-function
|
|
126
126
|
_popupMenuListener(e) {
|
|
127
|
-
var
|
|
128
|
-
const
|
|
129
|
-
if (!n)
|
|
130
|
-
return;
|
|
131
|
-
const t = n.getTransformerByCreate();
|
|
127
|
+
var o;
|
|
128
|
+
const t = (o = this._renderManagerService.getRenderById(e)) == null ? void 0 : o.scene;
|
|
132
129
|
if (!t)
|
|
133
130
|
return;
|
|
134
|
-
const
|
|
131
|
+
const n = t.getTransformerByCreate();
|
|
132
|
+
if (!n)
|
|
133
|
+
return;
|
|
134
|
+
const r = [];
|
|
135
135
|
this.disposeWithMe(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (this._hasCropObject(
|
|
136
|
+
ye(
|
|
137
|
+
n.createControl$.subscribe(() => {
|
|
138
|
+
if (this._hasCropObject(t))
|
|
139
139
|
return;
|
|
140
|
-
const a =
|
|
141
|
-
if (
|
|
140
|
+
const a = n.getSelectedObjectMap();
|
|
141
|
+
if (r.forEach((w) => w.dispose()), r.length = 0, a.size > 1)
|
|
142
142
|
return;
|
|
143
143
|
const s = a.values().next().value;
|
|
144
144
|
if (!s)
|
|
@@ -146,379 +146,482 @@ let Xe = class extends gt {
|
|
|
146
146
|
const l = s.oKey, c = this._drawingManagerService.getDrawingOKey(l);
|
|
147
147
|
if (!c)
|
|
148
148
|
return;
|
|
149
|
-
const { unitId: m, subUnitId: u, drawingId:
|
|
150
|
-
|
|
151
|
-
componentKey:
|
|
149
|
+
const { unitId: m, subUnitId: u, drawingId: f } = c;
|
|
150
|
+
r.push(this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(s, {
|
|
151
|
+
componentKey: yn,
|
|
152
152
|
direction: "horizontal",
|
|
153
153
|
offset: [2, 0],
|
|
154
154
|
extraProps: {
|
|
155
|
-
menuItems: this._getImageMenuItems(m, u,
|
|
155
|
+
menuItems: this._getImageMenuItems(m, u, f)
|
|
156
156
|
}
|
|
157
|
-
}))), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === m && w.subUnitId === u && w.drawingId ===
|
|
157
|
+
}))), !this._drawingManagerService.getFocusDrawings().find((w) => w.unitId === m && w.subUnitId === u && w.drawingId === f) && this._drawingManagerService.focusDrawing([{
|
|
158
158
|
unitId: m,
|
|
159
159
|
subUnitId: u,
|
|
160
|
-
drawingId:
|
|
160
|
+
drawingId: f
|
|
161
161
|
}]);
|
|
162
162
|
})
|
|
163
163
|
)
|
|
164
164
|
), this.disposeWithMe(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
ye(
|
|
166
|
+
n.clearControl$.subscribe(() => {
|
|
167
|
+
r.forEach((a) => a.dispose()), r.length = 0, this._contextService.setContextValue(it, !1), this._drawingManagerService.focusDrawing(null);
|
|
168
168
|
})
|
|
169
169
|
)
|
|
170
170
|
), this.disposeWithMe(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
ye(
|
|
172
|
+
n.changing$.subscribe(() => {
|
|
173
|
+
r.forEach((a) => a.dispose()), r.length = 0;
|
|
174
174
|
})
|
|
175
175
|
)
|
|
176
176
|
), this.disposeWithMe(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
ye(
|
|
178
|
+
n.changeStart$.subscribe(() => {
|
|
179
|
+
r.forEach((a) => a.dispose()), r.length = 0;
|
|
180
180
|
})
|
|
181
181
|
)
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
|
-
_getImageMenuItems(e,
|
|
184
|
+
_getImageMenuItems(e, t, n) {
|
|
185
185
|
return [
|
|
186
186
|
{
|
|
187
187
|
label: "image-popup.edit",
|
|
188
188
|
index: 0,
|
|
189
|
-
commandId:
|
|
190
|
-
commandParams: { unitId: e, subUnitId:
|
|
189
|
+
commandId: Xt.id,
|
|
190
|
+
commandParams: { unitId: e, subUnitId: t, drawingId: n },
|
|
191
191
|
disable: !1
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
label: "image-popup.delete",
|
|
195
195
|
index: 1,
|
|
196
|
-
commandId:
|
|
197
|
-
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId:
|
|
196
|
+
commandId: wt.id,
|
|
197
|
+
commandParams: { unitId: e, drawings: [{ unitId: e, subUnitId: t, drawingId: n }] },
|
|
198
198
|
disable: !1
|
|
199
199
|
},
|
|
200
200
|
{
|
|
201
201
|
label: "image-popup.crop",
|
|
202
202
|
index: 2,
|
|
203
|
-
commandId:
|
|
204
|
-
commandParams: { unitId: e, subUnitId:
|
|
203
|
+
commandId: bn.id,
|
|
204
|
+
commandParams: { unitId: e, subUnitId: t, drawingId: n },
|
|
205
205
|
disable: !0
|
|
206
206
|
// TODO: @JOCS, feature is not ready.
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
label: "image-popup.reset",
|
|
210
210
|
index: 3,
|
|
211
|
-
commandId:
|
|
212
|
-
commandParams: [{ unitId: e, subUnitId:
|
|
211
|
+
commandId: Rn.id,
|
|
212
|
+
commandParams: [{ unitId: e, subUnitId: t, drawingId: n }],
|
|
213
213
|
disable: !0
|
|
214
214
|
// TODO: @JOCS, feature is not ready.
|
|
215
215
|
}
|
|
216
216
|
];
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
],
|
|
227
|
-
var
|
|
228
|
-
return
|
|
229
|
-
for (var e,
|
|
230
|
-
e = arguments[
|
|
231
|
-
for (var
|
|
219
|
+
Je = di([
|
|
220
|
+
at(st.Rendered, Je),
|
|
221
|
+
ke(0, he),
|
|
222
|
+
ke(1, pe(Xn)),
|
|
223
|
+
ke(2, se),
|
|
224
|
+
ke(3, te),
|
|
225
|
+
ke(4, Bt)
|
|
226
|
+
], Je);
|
|
227
|
+
var ue = function() {
|
|
228
|
+
return ue = Object.assign || function(i) {
|
|
229
|
+
for (var e, t = 1, n = arguments.length; t < n; t++) {
|
|
230
|
+
e = arguments[t];
|
|
231
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (i[r] = e[r]);
|
|
232
232
|
}
|
|
233
233
|
return i;
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
var
|
|
237
|
-
for (var
|
|
234
|
+
}, ue.apply(this, arguments);
|
|
235
|
+
}, mi = function(i, e) {
|
|
236
|
+
var t = {};
|
|
237
|
+
for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.indexOf(n) < 0 && (t[n] = i[n]);
|
|
238
238
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
239
|
-
for (var
|
|
240
|
-
e.indexOf(
|
|
241
|
-
return
|
|
242
|
-
},
|
|
243
|
-
var
|
|
244
|
-
return
|
|
239
|
+
for (var r = 0, n = Object.getOwnPropertySymbols(i); r < n.length; r++)
|
|
240
|
+
e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(i, n[r]) && (t[n[r]] = i[n[r]]);
|
|
241
|
+
return t;
|
|
242
|
+
}, Kt = Vt(function(i, e) {
|
|
243
|
+
var t = i.icon, n = i.id, r = i.className, o = i.extend, a = mi(i, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), l = jt("_".concat(fi()));
|
|
244
|
+
return Yt(t, "".concat(n), { defIds: t.defIds, idSuffix: l.current }, ue({ ref: e, className: s }, a), o);
|
|
245
245
|
});
|
|
246
|
-
function
|
|
247
|
-
return
|
|
248
|
-
return
|
|
246
|
+
function Yt(i, e, t, n, r) {
|
|
247
|
+
return $t(i.tag, ue(ue({ key: e }, gi(i, t, r)), n), (ui(i, t).children || []).map(function(o, a) {
|
|
248
|
+
return Yt(o, "".concat(e, "-").concat(i.tag, "-").concat(a), t, void 0, r);
|
|
249
249
|
}));
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
return !
|
|
256
|
-
var a =
|
|
257
|
-
typeof s == "string" && (
|
|
258
|
-
})),
|
|
251
|
+
function gi(i, e, t) {
|
|
252
|
+
var n = ue({}, i.attrs);
|
|
253
|
+
t != null && t.colorChannel1 && n.fill === "colorChannel1" && (n.fill = t.colorChannel1);
|
|
254
|
+
var r = e.defIds;
|
|
255
|
+
return !r || r.length === 0 || (i.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(o) {
|
|
256
|
+
var a = o[0], s = o[1];
|
|
257
|
+
typeof s == "string" && (n[a] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
258
|
+
})), n;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
var
|
|
262
|
-
return !
|
|
263
|
-
return typeof
|
|
260
|
+
function ui(i, e) {
|
|
261
|
+
var t, n = e.defIds;
|
|
262
|
+
return !n || n.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? ue(ue({}, i), { children: i.children.map(function(r) {
|
|
263
|
+
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? ue(ue({}, r), { attrs: ue(ue({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
264
264
|
}) }) : i;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function fi() {
|
|
267
267
|
return Math.random().toString(36).substring(2, 8);
|
|
268
268
|
}
|
|
269
|
-
|
|
270
|
-
var
|
|
271
|
-
return
|
|
269
|
+
Kt.displayName = "UniverIcon";
|
|
270
|
+
var pi = { 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" } }] }, Zt = Vt(function(i, e) {
|
|
271
|
+
return $t(Kt, Object.assign({}, i, {
|
|
272
272
|
id: "add-image-single",
|
|
273
273
|
ref: e,
|
|
274
|
-
icon:
|
|
274
|
+
icon: pi
|
|
275
275
|
}));
|
|
276
276
|
});
|
|
277
|
-
|
|
278
|
-
const
|
|
277
|
+
Zt.displayName = "AddImageSingle";
|
|
278
|
+
const vt = {
|
|
279
279
|
id: "doc.operation.insert-float-image",
|
|
280
|
-
type:
|
|
280
|
+
type: Y.OPERATION,
|
|
281
281
|
handler: () => !0
|
|
282
|
-
},
|
|
283
|
-
uploadFileMenu:
|
|
284
|
-
uploadFileMenuInput:
|
|
285
|
-
},
|
|
286
|
-
const i =
|
|
287
|
-
var
|
|
288
|
-
(
|
|
289
|
-
},
|
|
290
|
-
const a =
|
|
282
|
+
}, hi = "univer-upload-file-menu", wi = "univer-upload-file-menu-input", At = {
|
|
283
|
+
uploadFileMenu: hi,
|
|
284
|
+
uploadFileMenuInput: wi
|
|
285
|
+
}, vi = () => {
|
|
286
|
+
const i = re($), e = jt(null), t = () => {
|
|
287
|
+
var o;
|
|
288
|
+
(o = e.current) == null || o.click();
|
|
289
|
+
}, n = xn.map((o) => `.${o.replace("image/", "")}`).join(","), r = (o) => {
|
|
290
|
+
const a = o.target.files;
|
|
291
291
|
if (a == null)
|
|
292
292
|
return;
|
|
293
293
|
const s = Array.from(a);
|
|
294
|
-
i.executeCommand(
|
|
294
|
+
i.executeCommand(vt.id, { files: s }), e.current && (e.current.value = "");
|
|
295
295
|
};
|
|
296
|
-
return /* @__PURE__ */ d.createElement("div", { onClick:
|
|
296
|
+
return /* @__PURE__ */ d.createElement("div", { onClick: t, className: At.uploadFileMenu }, /* @__PURE__ */ d.createElement(
|
|
297
297
|
"input",
|
|
298
298
|
{
|
|
299
299
|
type: "file",
|
|
300
|
-
className:
|
|
300
|
+
className: At.uploadFileMenuInput,
|
|
301
301
|
ref: e,
|
|
302
|
-
onChange:
|
|
303
|
-
accept:
|
|
302
|
+
onChange: r,
|
|
303
|
+
accept: n,
|
|
304
304
|
multiple: !0
|
|
305
305
|
}
|
|
306
306
|
));
|
|
307
|
-
},
|
|
308
|
-
function
|
|
309
|
-
const e = i.get(X), n = i.get(Q);
|
|
310
|
-
return new Wt((t) => {
|
|
311
|
-
const o = e.focused$.subscribe((s) => {
|
|
312
|
-
if (s == null)
|
|
313
|
-
return t.next(!0);
|
|
314
|
-
const l = n.getRenderById(s);
|
|
315
|
-
if (l == null)
|
|
316
|
-
return t.next(!0);
|
|
317
|
-
l.with(me).getViewModel().editAreaChange$.subscribe((m) => {
|
|
318
|
-
t.next(m === sn.HEADER || m === sn.FOOTER);
|
|
319
|
-
});
|
|
320
|
-
}), r = n.getCurrentTypeOfRenderer(Ce.UNIVER_DOC);
|
|
321
|
-
if (r == null)
|
|
322
|
-
return t.next(!0);
|
|
323
|
-
const a = r.with(me).getViewModel();
|
|
324
|
-
return t.next(a.getEditArea() !== sn.BODY), () => o.unsubscribe();
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
function gi(i) {
|
|
307
|
+
}, Qt = "COMPONENT_DOC_UPLOAD_FILE_MENU", Jt = "addition-and-subtraction-single", en = "doc.menu.image", Ii = "doc.menu.image.upload.float";
|
|
308
|
+
function _i(i) {
|
|
328
309
|
return {
|
|
329
|
-
id:
|
|
330
|
-
type:
|
|
331
|
-
positions: [
|
|
332
|
-
group:
|
|
333
|
-
icon:
|
|
310
|
+
id: en,
|
|
311
|
+
type: Wt.SUBITEMS,
|
|
312
|
+
positions: [ei.TOOLBAR_START],
|
|
313
|
+
group: ti.TOOLBAR_LAYOUT,
|
|
314
|
+
icon: Jt,
|
|
334
315
|
tooltip: "docImage.title",
|
|
335
|
-
hidden$: Gt(
|
|
316
|
+
hidden$: Gt(i, be.UNIVER_DOC)
|
|
336
317
|
};
|
|
337
318
|
}
|
|
338
|
-
function
|
|
319
|
+
function Ci(i) {
|
|
339
320
|
return {
|
|
340
|
-
id:
|
|
321
|
+
id: Ii,
|
|
341
322
|
title: "docImage.upload.float",
|
|
342
|
-
type:
|
|
323
|
+
type: Wt.SELECTOR,
|
|
343
324
|
label: {
|
|
344
|
-
name:
|
|
325
|
+
name: Qt
|
|
345
326
|
},
|
|
346
|
-
positions: [
|
|
347
|
-
hidden$:
|
|
327
|
+
positions: [en],
|
|
328
|
+
hidden$: Gt(i, be.UNIVER_DOC)
|
|
348
329
|
};
|
|
349
330
|
}
|
|
350
|
-
const
|
|
351
|
-
imageCommonPanel:
|
|
352
|
-
imageCommonPanelGrid:
|
|
353
|
-
imageCommonPanelBorder:
|
|
354
|
-
imageCommonPanelTitle:
|
|
355
|
-
imageCommonPanelSubtitle:
|
|
356
|
-
imageCommonPanelRow:
|
|
357
|
-
imageCommonPanelRowVertical:
|
|
358
|
-
imageCommonPanelColumn:
|
|
359
|
-
imageCommonPanelColumnCenter:
|
|
360
|
-
imageCommonPanelInline:
|
|
361
|
-
imageCommonPanelSpan2:
|
|
362
|
-
imageCommonPanelSpan3:
|
|
363
|
-
imageCommonPanelInput:
|
|
364
|
-
sheetImageMenu:
|
|
365
|
-
sheetImageMenuInput:
|
|
331
|
+
const Si = "univer-image-common-panel", Di = "univer-image-common-panel-grid", Ei = "univer-image-common-panel-border", Pi = "univer-image-common-panel-title", Oi = "univer-image-common-panel-subtitle", Ti = "univer-image-common-panel-row", Mi = "univer-image-common-panel-row-vertical", yi = "univer-image-common-panel-column", bi = "univer-image-common-panel-column-center", Ri = "univer-image-common-panel-inline", Ni = "univer-image-common-panel-span2", Ai = "univer-image-common-panel-span3", xi = "univer-image-common-panel-input", Li = "univer-sheet-image-menu", Ui = "univer-sheet-image-menu-input", g = {
|
|
332
|
+
imageCommonPanel: Si,
|
|
333
|
+
imageCommonPanelGrid: Di,
|
|
334
|
+
imageCommonPanelBorder: Ei,
|
|
335
|
+
imageCommonPanelTitle: Pi,
|
|
336
|
+
imageCommonPanelSubtitle: Oi,
|
|
337
|
+
imageCommonPanelRow: Ti,
|
|
338
|
+
imageCommonPanelRowVertical: Mi,
|
|
339
|
+
imageCommonPanelColumn: yi,
|
|
340
|
+
imageCommonPanelColumnCenter: bi,
|
|
341
|
+
imageCommonPanelInline: Ri,
|
|
342
|
+
imageCommonPanelSpan2: Ni,
|
|
343
|
+
imageCommonPanelSpan3: Ai,
|
|
344
|
+
imageCommonPanelInput: xi,
|
|
345
|
+
sheetImageMenu: Li,
|
|
346
|
+
sheetImageMenuInput: Ui
|
|
366
347
|
};
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}
|
|
348
|
+
class ct {
|
|
349
|
+
constructor() {
|
|
350
|
+
_e(this, "_refreshDrawings$", new qn(null));
|
|
351
|
+
_e(this, "refreshDrawings$", this._refreshDrawings$.asObservable());
|
|
352
|
+
}
|
|
353
|
+
refreshDrawings(e) {
|
|
354
|
+
this._refreshDrawings$.next(e);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
var me = /* @__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))(me || {});
|
|
358
|
+
const Bi = {
|
|
359
|
+
inline: k.INLINE,
|
|
360
|
+
wrapSquare: k.WRAP_SQUARE,
|
|
361
|
+
wrapTopAndBottom: k.WRAP_TOP_AND_BOTTOM,
|
|
362
|
+
inFrontOfText: k.WRAP_NONE,
|
|
363
|
+
behindText: k.WRAP_NONE
|
|
364
|
+
};
|
|
365
|
+
function tn(i, e, t, n, r, o, a) {
|
|
366
|
+
var h, p;
|
|
367
|
+
const s = new pt(), l = X.getInstance(), c = [], m = o.getSelfOrHeaderFooterModel(e).getBody(), u = o.getSelfOrHeaderFooterModel(i).getBody();
|
|
368
|
+
if (m == null || u == null)
|
|
369
|
+
return;
|
|
370
|
+
const f = (p = (h = m.customBlocks) == null ? void 0 : h.find((w) => w.blockId === r)) == null ? void 0 : p.startIndex;
|
|
371
|
+
if (f != null) {
|
|
372
|
+
if (n = Math.min(u.dataStream.length - 2, n), i === e) {
|
|
373
|
+
if (n < f ? (n > 0 && s.push({
|
|
374
|
+
t: Z.RETAIN,
|
|
375
|
+
len: n,
|
|
376
|
+
segmentId: e
|
|
377
|
+
}), s.push({
|
|
378
|
+
t: Z.INSERT,
|
|
379
|
+
body: {
|
|
380
|
+
dataStream: "\b",
|
|
381
|
+
customBlocks: [{
|
|
382
|
+
startIndex: 0,
|
|
383
|
+
blockId: r
|
|
384
|
+
}]
|
|
385
|
+
},
|
|
386
|
+
len: 1,
|
|
387
|
+
line: 0,
|
|
388
|
+
segmentId: e
|
|
389
|
+
}), s.push({
|
|
390
|
+
t: Z.RETAIN,
|
|
391
|
+
len: f - n,
|
|
392
|
+
segmentId: e
|
|
393
|
+
}), s.push({
|
|
394
|
+
t: Z.DELETE,
|
|
395
|
+
len: 1,
|
|
396
|
+
line: 0,
|
|
397
|
+
segmentId: ""
|
|
398
|
+
})) : (f > 0 && s.push({
|
|
399
|
+
t: Z.RETAIN,
|
|
400
|
+
len: f,
|
|
401
|
+
segmentId: e
|
|
402
|
+
}), s.push({
|
|
403
|
+
t: Z.DELETE,
|
|
404
|
+
len: 1,
|
|
405
|
+
line: 0,
|
|
406
|
+
segmentId: ""
|
|
407
|
+
}), n - f - 1 > 0 && s.push({
|
|
408
|
+
t: Z.RETAIN,
|
|
409
|
+
len: n - f - 1,
|
|
410
|
+
segmentId: e
|
|
411
|
+
}), s.push({
|
|
412
|
+
t: Z.INSERT,
|
|
413
|
+
body: {
|
|
414
|
+
dataStream: "\b",
|
|
415
|
+
customBlocks: [{
|
|
416
|
+
startIndex: 0,
|
|
417
|
+
blockId: r
|
|
418
|
+
}]
|
|
419
|
+
},
|
|
420
|
+
len: 1,
|
|
421
|
+
line: 0,
|
|
422
|
+
segmentId: e
|
|
423
|
+
})), n !== f) {
|
|
424
|
+
const w = $e(o, e), v = l.editOp(s.serialize(), w);
|
|
425
|
+
c.push(v);
|
|
426
|
+
}
|
|
427
|
+
} else {
|
|
428
|
+
f > 0 && s.push({
|
|
429
|
+
t: Z.RETAIN,
|
|
430
|
+
len: f,
|
|
431
|
+
segmentId: e
|
|
432
|
+
}), s.push({
|
|
433
|
+
t: Z.DELETE,
|
|
434
|
+
len: 1,
|
|
435
|
+
line: 0,
|
|
436
|
+
segmentId: ""
|
|
437
|
+
});
|
|
438
|
+
let w = $e(o, e), v = l.editOp(s.serialize(), w);
|
|
439
|
+
c.push(v), s.empty(), n > 0 && s.push({
|
|
440
|
+
t: Z.RETAIN,
|
|
441
|
+
len: n,
|
|
442
|
+
segmentId: i
|
|
443
|
+
}), s.push({
|
|
444
|
+
t: Z.INSERT,
|
|
445
|
+
body: {
|
|
446
|
+
dataStream: "\b",
|
|
447
|
+
customBlocks: [{
|
|
448
|
+
startIndex: 0,
|
|
449
|
+
blockId: r
|
|
450
|
+
}]
|
|
451
|
+
},
|
|
452
|
+
len: 1,
|
|
453
|
+
line: 0,
|
|
454
|
+
segmentId: i
|
|
455
|
+
}), w = $e(o, i), v = l.editOp(s.serialize(), w), c.push(v), a.setSegment(i), a.setSegmentPage(t);
|
|
456
|
+
}
|
|
457
|
+
return c;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
const nn = {
|
|
375
461
|
id: "doc.command.update-doc-drawing-wrapping-style",
|
|
376
|
-
type:
|
|
462
|
+
type: Y.COMMAND,
|
|
377
463
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
378
464
|
handler: (i, e) => {
|
|
465
|
+
var T, N;
|
|
379
466
|
if (e == null)
|
|
380
467
|
return !1;
|
|
381
|
-
const { drawings:
|
|
382
|
-
if (
|
|
468
|
+
const { drawings: t, wrappingStyle: n, unitId: r } = e, o = i.get($), a = i.get(te), l = i.get(se).getRenderById(r), c = l == null ? void 0 : l.with(ae).getSkeleton().getSkeletonData(), m = l == null ? void 0 : l.with(ae).getViewModel(), u = l == null ? void 0 : l.scene, f = a.getCurrentUniverDocInstance();
|
|
469
|
+
if (f == null || c == null || u == null || m == null)
|
|
383
470
|
return !1;
|
|
384
|
-
const
|
|
385
|
-
for (const
|
|
386
|
-
const { drawingId:
|
|
387
|
-
if (
|
|
388
|
-
const
|
|
389
|
-
|
|
471
|
+
const h = m.getEditArea(), p = u.getTransformerByCreate(), { pages: w, skeHeaders: v, skeFooters: I } = c, D = X.getInstance(), _ = [], { drawings: C = {} } = f.getSnapshot();
|
|
472
|
+
for (const R of t) {
|
|
473
|
+
const { drawingId: E } = R, H = C[E].layoutType, z = Bi[n];
|
|
474
|
+
if (H !== z) {
|
|
475
|
+
const S = D.replaceOp(["drawings", E, "layoutType"], H, z);
|
|
476
|
+
_.push(S);
|
|
390
477
|
}
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
const
|
|
395
|
-
|
|
478
|
+
if (n === "behindText" || n === "inFrontOfText") {
|
|
479
|
+
const S = C[E].behindDoc, A = n === "behindText" ? oe.TRUE : oe.FALSE;
|
|
480
|
+
if (S !== A) {
|
|
481
|
+
const P = D.replaceOp(["drawings", E, "behindDoc"], S, A);
|
|
482
|
+
_.push(P);
|
|
396
483
|
}
|
|
397
484
|
}
|
|
398
|
-
if (
|
|
485
|
+
if (n === "inline")
|
|
399
486
|
continue;
|
|
400
|
-
let
|
|
401
|
-
for (const
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
487
|
+
let U = null, B = 0, b = 0;
|
|
488
|
+
for (const S of w) {
|
|
489
|
+
const { headerId: A, footerId: P, marginTop: L, marginLeft: x, marginBottom: M, pageWidth: W, pageHeight: G } = S;
|
|
490
|
+
switch (h) {
|
|
491
|
+
case xe.HEADER: {
|
|
492
|
+
const F = (T = v.get(A)) == null ? void 0 : T.get(W);
|
|
493
|
+
F != null && F.skeDrawings.has(E) && (U = F.skeDrawings.get(E), B = F.marginTop, b = x);
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
case xe.FOOTER: {
|
|
497
|
+
const F = (N = I.get(P)) == null ? void 0 : N.get(W);
|
|
498
|
+
F != null && F.skeDrawings.has(E) && (U = F.skeDrawings.get(E), B = G - M + F.marginTop, b = x);
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
case xe.BODY: {
|
|
502
|
+
S.skeDrawings.has(E) && (U = S.skeDrawings.get(E), B = L, b = x);
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
405
505
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
|
|
506
|
+
if (U != null)
|
|
507
|
+
break;
|
|
508
|
+
}
|
|
509
|
+
if (U != null) {
|
|
510
|
+
const { aTop: S, aLeft: A } = U, P = C[E].docTransform.positionH;
|
|
511
|
+
let L = A;
|
|
512
|
+
P.relativeFrom === ee.MARGIN ? L -= b : P.relativeFrom === ee.COLUMN && (L -= U.columnLeft);
|
|
513
|
+
const x = {
|
|
514
|
+
relativeFrom: P.relativeFrom,
|
|
412
515
|
posOffset: L
|
|
413
516
|
};
|
|
414
|
-
if (
|
|
415
|
-
const
|
|
416
|
-
|
|
517
|
+
if (P.posOffset !== x.posOffset) {
|
|
518
|
+
const F = D.replaceOp(["drawings", E, "docTransform", "positionH"], P, x);
|
|
519
|
+
_.push(F);
|
|
417
520
|
}
|
|
418
|
-
const
|
|
419
|
-
let
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
relativeFrom:
|
|
423
|
-
posOffset:
|
|
521
|
+
const M = C[E].docTransform.positionV;
|
|
522
|
+
let W = S;
|
|
523
|
+
M.relativeFrom === V.PAGE ? W += B : M.relativeFrom === V.LINE ? W -= U.lineTop : M.relativeFrom === V.PARAGRAPH && (W -= U.blockAnchorTop);
|
|
524
|
+
const G = {
|
|
525
|
+
relativeFrom: M.relativeFrom,
|
|
526
|
+
posOffset: W
|
|
424
527
|
};
|
|
425
|
-
if (
|
|
426
|
-
const
|
|
427
|
-
|
|
528
|
+
if (M.posOffset !== G.posOffset) {
|
|
529
|
+
const F = D.replaceOp(["drawings", E, "docTransform", "positionV"], M, G);
|
|
530
|
+
_.push(F);
|
|
428
531
|
}
|
|
429
532
|
}
|
|
430
533
|
}
|
|
431
|
-
const
|
|
432
|
-
id:
|
|
534
|
+
const O = {
|
|
535
|
+
id: Q.id,
|
|
433
536
|
params: {
|
|
434
|
-
unitId:
|
|
537
|
+
unitId: r,
|
|
435
538
|
actions: [],
|
|
436
539
|
textRanges: null
|
|
437
540
|
}
|
|
438
541
|
};
|
|
439
|
-
|
|
440
|
-
const
|
|
441
|
-
return p.refreshControls(), !!
|
|
542
|
+
O.params.actions = _.reduce((R, E) => X.compose(R, E), null);
|
|
543
|
+
const y = o.syncExecuteCommand(O.id, O.params);
|
|
544
|
+
return p.refreshControls(), !!y;
|
|
442
545
|
}
|
|
443
|
-
},
|
|
546
|
+
}, rn = {
|
|
444
547
|
id: "doc.command.update-doc-drawing-distance",
|
|
445
|
-
type:
|
|
548
|
+
type: Y.COMMAND,
|
|
446
549
|
handler: (i, e) => {
|
|
447
550
|
if (e == null)
|
|
448
551
|
return !1;
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
552
|
+
const t = i.get($), r = i.get(te).getCurrentUniverDocInstance();
|
|
553
|
+
if (r == null)
|
|
451
554
|
return !1;
|
|
452
|
-
const { drawings:
|
|
453
|
-
for (const
|
|
454
|
-
const { drawingId:
|
|
555
|
+
const { drawings: o, dist: a, unitId: s } = e, l = X.getInstance(), c = [], { drawings: m = {} } = r.getSnapshot();
|
|
556
|
+
for (const h of o) {
|
|
557
|
+
const { drawingId: p } = h;
|
|
455
558
|
for (const [w, v] of Object.entries(a)) {
|
|
456
|
-
const I = m[
|
|
559
|
+
const I = m[p][w];
|
|
457
560
|
if (I !== v) {
|
|
458
|
-
const
|
|
459
|
-
c.push(
|
|
561
|
+
const D = l.replaceOp(["drawings", p, w], I, v);
|
|
562
|
+
c.push(D);
|
|
460
563
|
}
|
|
461
564
|
}
|
|
462
565
|
}
|
|
463
566
|
const u = {
|
|
464
|
-
id:
|
|
567
|
+
id: Q.id,
|
|
465
568
|
params: {
|
|
466
569
|
unitId: s,
|
|
467
570
|
actions: [],
|
|
468
571
|
textRanges: null
|
|
469
572
|
}
|
|
470
573
|
};
|
|
471
|
-
return u.params.actions = c.reduce((
|
|
574
|
+
return u.params.actions = c.reduce((h, p) => X.compose(h, p), null), !!t.syncExecuteCommand(u.id, u.params);
|
|
472
575
|
}
|
|
473
|
-
},
|
|
576
|
+
}, on = {
|
|
474
577
|
id: "doc.command.update-doc-drawing-wrap-text",
|
|
475
|
-
type:
|
|
578
|
+
type: Y.COMMAND,
|
|
476
579
|
handler: (i, e) => {
|
|
477
580
|
if (e == null)
|
|
478
581
|
return !1;
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
582
|
+
const t = i.get($), r = i.get(te).getCurrentUniverDocInstance();
|
|
583
|
+
if (r == null)
|
|
481
584
|
return !1;
|
|
482
|
-
const { drawings:
|
|
483
|
-
for (const
|
|
484
|
-
const { drawingId:
|
|
585
|
+
const { drawings: o, wrapText: a, unitId: s } = e, l = X.getInstance(), c = [], { drawings: m = {} } = r.getSnapshot();
|
|
586
|
+
for (const h of o) {
|
|
587
|
+
const { drawingId: p } = h, w = m[p].wrapText;
|
|
485
588
|
if (w !== a) {
|
|
486
|
-
const v = l.replaceOp(["drawings",
|
|
589
|
+
const v = l.replaceOp(["drawings", p, "wrapText"], w, a);
|
|
487
590
|
c.push(v);
|
|
488
591
|
}
|
|
489
592
|
}
|
|
490
593
|
const u = {
|
|
491
|
-
id:
|
|
594
|
+
id: Q.id,
|
|
492
595
|
params: {
|
|
493
596
|
unitId: s,
|
|
494
597
|
actions: [],
|
|
495
598
|
textRanges: null
|
|
496
599
|
}
|
|
497
600
|
};
|
|
498
|
-
return u.params.actions = c.reduce((
|
|
601
|
+
return u.params.actions = c.reduce((h, p) => X.compose(h, p), null), !!t.syncExecuteCommand(u.id, u.params);
|
|
499
602
|
}
|
|
500
|
-
},
|
|
603
|
+
}, ze = {
|
|
501
604
|
id: "doc.command.update-drawing-doc-transform",
|
|
502
|
-
type:
|
|
605
|
+
type: Y.COMMAND,
|
|
503
606
|
handler: (i, e) => {
|
|
504
607
|
if (e == null)
|
|
505
608
|
return !1;
|
|
506
|
-
const
|
|
609
|
+
const t = i.get($), n = i.get(te), o = i.get(se).getRenderById(e.unitId), a = o == null ? void 0 : o.scene;
|
|
507
610
|
if (a == null)
|
|
508
611
|
return !1;
|
|
509
|
-
const s = a.getTransformerByCreate(), l =
|
|
612
|
+
const s = a.getTransformerByCreate(), l = n.getCurrentUniverDocInstance();
|
|
510
613
|
if (l == null)
|
|
511
614
|
return !1;
|
|
512
|
-
const { drawings: c, unitId: m } = e, u =
|
|
615
|
+
const { drawings: c, unitId: m } = e, u = X.getInstance(), f = [], { drawings: h = {} } = l.getSnapshot();
|
|
513
616
|
for (const v of c) {
|
|
514
|
-
const { drawingId: I, key:
|
|
515
|
-
if (!
|
|
516
|
-
const O = u.replaceOp(["drawings", I, "docTransform",
|
|
517
|
-
|
|
617
|
+
const { drawingId: I, key: D, value: _ } = v, C = h[I].docTransform[D];
|
|
618
|
+
if (!Pe.diffValue(C, _)) {
|
|
619
|
+
const O = u.replaceOp(["drawings", I, "docTransform", D], C, _);
|
|
620
|
+
f.push(O);
|
|
518
621
|
}
|
|
519
622
|
}
|
|
520
|
-
const
|
|
521
|
-
id:
|
|
623
|
+
const p = {
|
|
624
|
+
id: Q.id,
|
|
522
625
|
params: {
|
|
523
626
|
unitId: m,
|
|
524
627
|
actions: [],
|
|
@@ -526,182 +629,92 @@ const bi = {
|
|
|
526
629
|
debounce: !0
|
|
527
630
|
}
|
|
528
631
|
};
|
|
529
|
-
|
|
530
|
-
const w =
|
|
632
|
+
p.params.actions = f.reduce((v, I) => X.compose(v, I), null);
|
|
633
|
+
const w = t.syncExecuteCommand(p.id, p.params);
|
|
531
634
|
return s.refreshControls(), !!w;
|
|
532
635
|
}
|
|
533
|
-
},
|
|
636
|
+
}, an = {
|
|
534
637
|
id: "doc.command.move-inline-drawing",
|
|
535
|
-
type:
|
|
536
|
-
// eslint-disable-next-line max-lines-per-function
|
|
638
|
+
type: Y.COMMAND,
|
|
537
639
|
handler: (i, e) => {
|
|
538
|
-
var
|
|
640
|
+
var T;
|
|
539
641
|
if (e == null)
|
|
540
642
|
return !1;
|
|
541
|
-
const n = i.get(
|
|
542
|
-
if (
|
|
543
|
-
return !1;
|
|
544
|
-
const a = r.getTransformerByCreate(), s = i.get(W), c = i.get(X).getCurrentUniverDocInstance();
|
|
545
|
-
if (c == null)
|
|
643
|
+
const t = i.get(se), n = i.get(Ue), r = i.get(ct), o = t.getRenderById(e.unitId), a = o == null ? void 0 : o.scene, s = o == null ? void 0 : o.with(ae).getSkeleton();
|
|
644
|
+
if (a == null)
|
|
546
645
|
return !1;
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
646
|
+
const l = a.getTransformerByCreate(), c = i.get($), u = i.get(te).getCurrentUniverDocInstance();
|
|
647
|
+
if (u == null)
|
|
549
648
|
return !1;
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
},
|
|
563
|
-
len: 1,
|
|
564
|
-
line: 0,
|
|
565
|
-
segmentId: I
|
|
566
|
-
}), f.push({
|
|
567
|
-
t: j.RETAIN,
|
|
568
|
-
len: C - p,
|
|
569
|
-
segmentId: I
|
|
570
|
-
}), f.push({
|
|
571
|
-
t: j.DELETE,
|
|
572
|
-
len: 1,
|
|
573
|
-
line: 0,
|
|
574
|
-
segmentId: ""
|
|
575
|
-
})) : (C > 0 && f.push({
|
|
576
|
-
t: j.RETAIN,
|
|
577
|
-
len: C,
|
|
578
|
-
segmentId: I
|
|
579
|
-
}), f.push({
|
|
580
|
-
t: j.DELETE,
|
|
581
|
-
len: 1,
|
|
582
|
-
line: 0,
|
|
583
|
-
segmentId: ""
|
|
584
|
-
}), p - C - 1 > 0 && f.push({
|
|
585
|
-
t: j.RETAIN,
|
|
586
|
-
len: p - C - 1,
|
|
587
|
-
segmentId: I
|
|
588
|
-
}), f.push({
|
|
589
|
-
t: j.INSERT,
|
|
590
|
-
body: {
|
|
591
|
-
dataStream: "\b",
|
|
592
|
-
customBlocks: [{
|
|
593
|
-
startIndex: 0,
|
|
594
|
-
blockId: m.drawingId
|
|
595
|
-
}]
|
|
596
|
-
},
|
|
597
|
-
len: 1,
|
|
598
|
-
line: 0,
|
|
599
|
-
segmentId: I
|
|
600
|
-
}));
|
|
601
|
-
const P = on(c, I), S = g.editOp(f.serialize(), P);
|
|
602
|
-
w.push(S);
|
|
649
|
+
const { drawing: f, unitId: h, offset: p, segmentId: w, segmentPage: v } = e, I = [], { drawingId: D } = f, _ = (T = n.getSegment()) != null ? T : "", C = tn(
|
|
650
|
+
w,
|
|
651
|
+
_,
|
|
652
|
+
v,
|
|
653
|
+
p,
|
|
654
|
+
D,
|
|
655
|
+
u,
|
|
656
|
+
n
|
|
657
|
+
);
|
|
658
|
+
if (C == null || C.length === 0)
|
|
659
|
+
return r.refreshDrawings(s), l.refreshControls(), !1;
|
|
660
|
+
I.push(...C);
|
|
603
661
|
const O = {
|
|
604
|
-
id:
|
|
662
|
+
id: Q.id,
|
|
605
663
|
params: {
|
|
606
|
-
unitId:
|
|
664
|
+
unitId: h,
|
|
607
665
|
actions: [],
|
|
608
666
|
textRanges: null
|
|
609
667
|
}
|
|
610
668
|
};
|
|
611
|
-
O.params.actions =
|
|
612
|
-
const
|
|
613
|
-
return
|
|
669
|
+
O.params.actions = I.reduce((N, R) => X.compose(N, R), null);
|
|
670
|
+
const y = c.syncExecuteCommand(O.id, O.params);
|
|
671
|
+
return l.refreshControls(), !!y;
|
|
614
672
|
}
|
|
615
|
-
},
|
|
673
|
+
}, sn = {
|
|
616
674
|
id: "doc.command.transform-non-inline-drawing",
|
|
617
|
-
type:
|
|
675
|
+
type: Y.COMMAND,
|
|
618
676
|
// eslint-disable-next-line max-lines-per-function
|
|
619
677
|
handler: (i, e) => {
|
|
620
|
-
var
|
|
678
|
+
var U;
|
|
621
679
|
if (e == null)
|
|
622
680
|
return !1;
|
|
623
|
-
const
|
|
624
|
-
if (
|
|
681
|
+
const t = i.get(Ue), r = i.get(se).getRenderById(e.unitId), o = r == null ? void 0 : r.scene;
|
|
682
|
+
if (o == null)
|
|
625
683
|
return !1;
|
|
626
|
-
const a =
|
|
684
|
+
const a = o.getTransformerByCreate(), s = i.get($), c = i.get(te).getCurrentUniverDocInstance();
|
|
627
685
|
if (c == null)
|
|
628
686
|
return !1;
|
|
629
|
-
const { drawing: m, unitId: u, offset:
|
|
630
|
-
|
|
687
|
+
const { drawing: m, unitId: u, offset: f, docTransform: h, segmentId: p, segmentPage: w } = e, v = [], { drawingId: I } = m, D = (U = t.getSegment()) != null ? U : "", _ = tn(
|
|
688
|
+
p,
|
|
689
|
+
D,
|
|
690
|
+
w,
|
|
691
|
+
f,
|
|
692
|
+
I,
|
|
693
|
+
c,
|
|
694
|
+
t
|
|
695
|
+
);
|
|
696
|
+
if (_ == null)
|
|
631
697
|
return !1;
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
t: j.INSERT,
|
|
638
|
-
body: {
|
|
639
|
-
dataStream: "\b",
|
|
640
|
-
customBlocks: [{
|
|
641
|
-
startIndex: 0,
|
|
642
|
-
blockId: m.drawingId
|
|
643
|
-
}]
|
|
644
|
-
},
|
|
645
|
-
len: 1,
|
|
646
|
-
line: 0,
|
|
647
|
-
segmentId: C
|
|
648
|
-
}), g.push({
|
|
649
|
-
t: j.RETAIN,
|
|
650
|
-
len: P - p,
|
|
651
|
-
segmentId: C
|
|
652
|
-
}), g.push({
|
|
653
|
-
t: j.DELETE,
|
|
654
|
-
len: 1,
|
|
655
|
-
line: 0,
|
|
656
|
-
segmentId: ""
|
|
657
|
-
})) : p > P && (P > 0 && g.push({
|
|
658
|
-
t: j.RETAIN,
|
|
659
|
-
len: P,
|
|
660
|
-
segmentId: C
|
|
661
|
-
}), g.push({
|
|
662
|
-
t: j.DELETE,
|
|
663
|
-
len: 1,
|
|
664
|
-
line: 0,
|
|
665
|
-
segmentId: ""
|
|
666
|
-
}), p - P - 1 > 0 && g.push({
|
|
667
|
-
t: j.RETAIN,
|
|
668
|
-
len: p - P - 1,
|
|
669
|
-
segmentId: C
|
|
670
|
-
}), g.push({
|
|
671
|
-
t: j.INSERT,
|
|
672
|
-
body: {
|
|
673
|
-
dataStream: "\b",
|
|
674
|
-
customBlocks: [{
|
|
675
|
-
startIndex: 0,
|
|
676
|
-
blockId: m.drawingId
|
|
677
|
-
}]
|
|
678
|
-
},
|
|
679
|
-
len: 1,
|
|
680
|
-
line: 0,
|
|
681
|
-
segmentId: C
|
|
682
|
-
})), p !== P) {
|
|
683
|
-
const _ = on(c, C), M = w.editOp(g.serialize(), _);
|
|
684
|
-
v.push(M);
|
|
685
|
-
}
|
|
686
|
-
const { drawings: S = {} } = c.getSnapshot(), O = S[I].docTransform, { positionH: R, positionV: D, size: b, angle: y } = O;
|
|
687
|
-
if (!_e.diffValue(R, f.positionH)) {
|
|
688
|
-
const _ = w.replaceOp(["drawings", I, "docTransform", "positionH"], R, f.positionH);
|
|
689
|
-
v.push(_);
|
|
698
|
+
_.length > 0 && v.push(..._);
|
|
699
|
+
const C = X.getInstance(), { drawings: O = {} } = c.getSnapshot(), y = O[I].docTransform, { positionH: T, positionV: N, size: R, angle: E } = y;
|
|
700
|
+
if (!Pe.diffValue(T, h.positionH)) {
|
|
701
|
+
const B = C.replaceOp(["drawings", I, "docTransform", "positionH"], T, h.positionH);
|
|
702
|
+
v.push(B);
|
|
690
703
|
}
|
|
691
|
-
if (!
|
|
692
|
-
const
|
|
693
|
-
v.push(
|
|
704
|
+
if (!Pe.diffValue(N, h.positionV)) {
|
|
705
|
+
const B = C.replaceOp(["drawings", I, "docTransform", "positionV"], N, h.positionV);
|
|
706
|
+
v.push(B);
|
|
694
707
|
}
|
|
695
|
-
if (!
|
|
696
|
-
const
|
|
697
|
-
v.push(
|
|
708
|
+
if (!Pe.diffValue(R, h.size)) {
|
|
709
|
+
const B = C.replaceOp(["drawings", I, "docTransform", "size"], R, h.size);
|
|
710
|
+
v.push(B);
|
|
698
711
|
}
|
|
699
|
-
if (!
|
|
700
|
-
const
|
|
701
|
-
v.push(
|
|
712
|
+
if (!Pe.diffValue(E, h.angle)) {
|
|
713
|
+
const B = C.replaceOp(["drawings", I, "docTransform", "angle"], E, h.angle);
|
|
714
|
+
v.push(B);
|
|
702
715
|
}
|
|
703
|
-
const
|
|
704
|
-
id:
|
|
716
|
+
const H = {
|
|
717
|
+
id: Q.id,
|
|
705
718
|
params: {
|
|
706
719
|
unitId: u,
|
|
707
720
|
actions: [],
|
|
@@ -709,433 +722,444 @@ const bi = {
|
|
|
709
722
|
debounce: !0
|
|
710
723
|
}
|
|
711
724
|
};
|
|
712
|
-
|
|
713
|
-
const
|
|
714
|
-
return a.refreshControls(), !!
|
|
725
|
+
H.params.actions = v.reduce((B, b) => X.compose(B, b), null);
|
|
726
|
+
const z = s.syncExecuteCommand(H.id, H.params);
|
|
727
|
+
return a.refreshControls(), !!z;
|
|
715
728
|
}
|
|
716
|
-
},
|
|
717
|
-
const e =
|
|
729
|
+
}, Ze = 0, Qe = 100, Fi = (i) => {
|
|
730
|
+
const e = re($), t = re(ot), n = re(he), r = re(se), o = re(te), { drawings: a } = i, s = a[0];
|
|
718
731
|
if (s == null)
|
|
719
732
|
return null;
|
|
720
|
-
const { unitId: l } = s, c =
|
|
733
|
+
const { unitId: l } = s, c = o.getUniverDocInstance(l), m = r.getRenderById(l);
|
|
721
734
|
if ((m == null ? void 0 : m.scene) == null)
|
|
722
735
|
return null;
|
|
723
|
-
const [
|
|
736
|
+
const [f, h] = ie(!0), [p, w] = ie(!0), [v, I] = ie(!0), [D, _] = ie(me.INLINE), [C, O] = ie(""), [y, T] = ie({
|
|
724
737
|
distT: 0,
|
|
725
738
|
distL: 0,
|
|
726
739
|
distB: 0,
|
|
727
740
|
distR: 0
|
|
728
|
-
}), [
|
|
729
|
-
function
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
741
|
+
}), [N, R] = ie(!0);
|
|
742
|
+
function E(b) {
|
|
743
|
+
_(b);
|
|
744
|
+
const S = n.getFocusDrawings();
|
|
745
|
+
if (S.length === 0)
|
|
733
746
|
return;
|
|
734
|
-
const { unitId:
|
|
735
|
-
unitId:
|
|
736
|
-
subUnitId:
|
|
737
|
-
drawingId:
|
|
747
|
+
const { unitId: A, subUnitId: P } = S[0], L = S.map(({ unitId: x, subUnitId: M, drawingId: W }) => ({
|
|
748
|
+
unitId: x,
|
|
749
|
+
subUnitId: M,
|
|
750
|
+
drawingId: W
|
|
738
751
|
}));
|
|
739
|
-
e.executeCommand(
|
|
740
|
-
unitId:
|
|
741
|
-
subUnitId:
|
|
742
|
-
drawings:
|
|
743
|
-
wrappingStyle:
|
|
752
|
+
e.executeCommand(nn.id, {
|
|
753
|
+
unitId: A,
|
|
754
|
+
subUnitId: P,
|
|
755
|
+
drawings: L,
|
|
756
|
+
wrappingStyle: b
|
|
744
757
|
});
|
|
745
758
|
}
|
|
746
|
-
function
|
|
747
|
-
O(
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
759
|
+
function H(b) {
|
|
760
|
+
O(b);
|
|
761
|
+
const S = n.getFocusDrawings();
|
|
762
|
+
if (S.length === 0)
|
|
750
763
|
return;
|
|
751
|
-
const
|
|
752
|
-
unitId:
|
|
753
|
-
subUnitId:
|
|
754
|
-
drawingId:
|
|
764
|
+
const A = S.map((P) => ({
|
|
765
|
+
unitId: P.unitId,
|
|
766
|
+
subUnitId: P.subUnitId,
|
|
767
|
+
drawingId: P.drawingId
|
|
755
768
|
}));
|
|
756
|
-
e.executeCommand(
|
|
757
|
-
unitId:
|
|
758
|
-
subUnitId:
|
|
759
|
-
drawings:
|
|
760
|
-
wrapText:
|
|
769
|
+
e.executeCommand(on.id, {
|
|
770
|
+
unitId: S[0].unitId,
|
|
771
|
+
subUnitId: S[0].unitId,
|
|
772
|
+
drawings: A,
|
|
773
|
+
wrapText: b
|
|
761
774
|
});
|
|
762
775
|
}
|
|
763
|
-
function
|
|
764
|
-
if (
|
|
776
|
+
function z(b, S) {
|
|
777
|
+
if (b == null)
|
|
765
778
|
return;
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
if (
|
|
779
|
+
const A = { ...y, [S]: b };
|
|
780
|
+
T(A);
|
|
781
|
+
const P = n.getFocusDrawings();
|
|
782
|
+
if (P.length === 0)
|
|
770
783
|
return;
|
|
771
|
-
const
|
|
772
|
-
unitId:
|
|
773
|
-
subUnitId:
|
|
774
|
-
drawingId:
|
|
784
|
+
const L = P.map((x) => ({
|
|
785
|
+
unitId: x.unitId,
|
|
786
|
+
subUnitId: x.subUnitId,
|
|
787
|
+
drawingId: x.drawingId
|
|
775
788
|
}));
|
|
776
|
-
e.executeCommand(
|
|
777
|
-
unitId:
|
|
778
|
-
subUnitId:
|
|
779
|
-
drawings:
|
|
789
|
+
e.executeCommand(rn.id, {
|
|
790
|
+
unitId: P[0].unitId,
|
|
791
|
+
subUnitId: P[0].unitId,
|
|
792
|
+
drawings: L,
|
|
780
793
|
dist: {
|
|
781
|
-
[
|
|
794
|
+
[S]: b
|
|
782
795
|
}
|
|
783
796
|
});
|
|
784
797
|
}
|
|
785
|
-
function
|
|
786
|
-
const
|
|
787
|
-
|
|
798
|
+
function U() {
|
|
799
|
+
const b = n.getFocusDrawings();
|
|
800
|
+
b.length !== 0 && B(b[0]);
|
|
788
801
|
}
|
|
789
|
-
function
|
|
790
|
-
var ce,
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
802
|
+
function B(b) {
|
|
803
|
+
var ce, fe;
|
|
804
|
+
const S = (fe = (ce = c == null ? void 0 : c.getSnapshot()) == null ? void 0 : ce.drawings) == null ? void 0 : fe[b.drawingId];
|
|
805
|
+
if (S == null)
|
|
793
806
|
return;
|
|
794
807
|
const {
|
|
795
|
-
distT:
|
|
796
|
-
distL:
|
|
797
|
-
distB:
|
|
798
|
-
distR:
|
|
799
|
-
layoutType:
|
|
800
|
-
behindDoc:
|
|
801
|
-
wrapText:
|
|
802
|
-
} =
|
|
803
|
-
if (
|
|
804
|
-
distT:
|
|
805
|
-
distL:
|
|
806
|
-
distB:
|
|
807
|
-
distR:
|
|
808
|
-
}), O(
|
|
809
|
-
|
|
808
|
+
distT: A = 0,
|
|
809
|
+
distL: P = 0,
|
|
810
|
+
distB: L = 0,
|
|
811
|
+
distR: x = 0,
|
|
812
|
+
layoutType: M = k.INLINE,
|
|
813
|
+
behindDoc: W = oe.FALSE,
|
|
814
|
+
wrapText: G = je.BOTH_SIDES
|
|
815
|
+
} = S;
|
|
816
|
+
if (T({
|
|
817
|
+
distT: A,
|
|
818
|
+
distL: P,
|
|
819
|
+
distB: L,
|
|
820
|
+
distR: x
|
|
821
|
+
}), O(G), h(M !== k.WRAP_SQUARE), M === k.WRAP_NONE || M === k.INLINE ? w(!0) : w(!1), M === k.WRAP_NONE || M === k.INLINE || M === k.WRAP_TOP_AND_BOTTOM ? I(!0) : I(!1), M === k.WRAP_NONE)
|
|
822
|
+
W === oe.TRUE ? _(me.BEHIND_TEXT) : _(me.IN_FRONT_OF_TEXT);
|
|
810
823
|
else
|
|
811
|
-
switch (
|
|
812
|
-
case
|
|
813
|
-
|
|
824
|
+
switch (M) {
|
|
825
|
+
case k.INLINE:
|
|
826
|
+
_(me.INLINE);
|
|
814
827
|
break;
|
|
815
|
-
case
|
|
816
|
-
|
|
828
|
+
case k.WRAP_SQUARE:
|
|
829
|
+
_(me.WRAP_SQUARE);
|
|
817
830
|
break;
|
|
818
|
-
case
|
|
819
|
-
|
|
831
|
+
case k.WRAP_TOP_AND_BOTTOM:
|
|
832
|
+
_(me.WRAP_TOP_AND_BOTTOM);
|
|
820
833
|
break;
|
|
821
834
|
default:
|
|
822
|
-
throw new Error(`Unsupported layout type: ${
|
|
835
|
+
throw new Error(`Unsupported layout type: ${M}`);
|
|
823
836
|
}
|
|
824
837
|
}
|
|
825
|
-
return
|
|
826
|
-
|
|
827
|
-
const
|
|
828
|
-
if (
|
|
829
|
-
|
|
838
|
+
return ht(() => {
|
|
839
|
+
U();
|
|
840
|
+
const b = n.focus$.subscribe((A) => {
|
|
841
|
+
if (A.length === 0) {
|
|
842
|
+
R(!1);
|
|
830
843
|
return;
|
|
831
844
|
}
|
|
832
|
-
|
|
833
|
-
}),
|
|
834
|
-
|
|
845
|
+
R(!0), B(A[0]);
|
|
846
|
+
}), S = e.onCommandExecuted(async (A) => {
|
|
847
|
+
A.id === Q.id && U();
|
|
835
848
|
});
|
|
836
849
|
return () => {
|
|
837
|
-
|
|
850
|
+
b.unsubscribe(), S.dispose();
|
|
838
851
|
};
|
|
839
|
-
}, []), /* @__PURE__ */ d.createElement("div", { className:
|
|
840
|
-
|
|
852
|
+
}, []), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: N ? "block" : "none" } }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelTitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-text-wrap.title")))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSubtitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-text-wrap.wrappingStyle")))), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelRow) }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn) }, /* @__PURE__ */ d.createElement(bt, { value: D, onChange: E, direction: "vertical" }, /* @__PURE__ */ d.createElement(Ee, { value: me.INLINE }, t.t("image-text-wrap.inline")), /* @__PURE__ */ d.createElement(Ee, { value: me.WRAP_SQUARE }, t.t("image-text-wrap.square")), /* @__PURE__ */ d.createElement(Ee, { value: me.WRAP_TOP_AND_BOTTOM }, t.t("image-text-wrap.topAndBottom")), /* @__PURE__ */ d.createElement(Ee, { value: me.BEHIND_TEXT }, t.t("image-text-wrap.behindText")), /* @__PURE__ */ d.createElement(Ee, { value: me.IN_FRONT_OF_TEXT }, t.t("image-text-wrap.inFrontText"))))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSubtitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-text-wrap.wrapText")))), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelRow) }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn) }, /* @__PURE__ */ d.createElement(bt, { disabled: f, value: C, onChange: H, direction: "horizontal" }, /* @__PURE__ */ d.createElement(Ee, { value: je.BOTH_SIDES }, t.t("image-text-wrap.bothSide")), /* @__PURE__ */ d.createElement(Ee, { value: je.LEFT }, t.t("image-text-wrap.leftOnly")), /* @__PURE__ */ d.createElement(Ee, { value: je.RIGHT }, t.t("image-text-wrap.rightOnly"))))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSubtitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-text-wrap.distanceFromText")))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-text-wrap.top"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
853
|
+
Ae,
|
|
841
854
|
{
|
|
842
|
-
min:
|
|
843
|
-
max:
|
|
844
|
-
disabled:
|
|
855
|
+
min: Ze,
|
|
856
|
+
max: Qe,
|
|
857
|
+
disabled: p,
|
|
845
858
|
precision: 1,
|
|
846
|
-
value:
|
|
847
|
-
onChange: (
|
|
848
|
-
|
|
859
|
+
value: y.distT,
|
|
860
|
+
onChange: (b) => {
|
|
861
|
+
z(b, "distT");
|
|
849
862
|
},
|
|
850
|
-
className:
|
|
863
|
+
className: g.imageCommonPanelInput
|
|
851
864
|
}
|
|
852
|
-
))))), /* @__PURE__ */ d.createElement("div", { className:
|
|
853
|
-
|
|
865
|
+
))))), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-text-wrap.left"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
866
|
+
Ae,
|
|
854
867
|
{
|
|
855
|
-
min:
|
|
856
|
-
max:
|
|
868
|
+
min: Ze,
|
|
869
|
+
max: Qe,
|
|
857
870
|
disabled: v,
|
|
858
871
|
precision: 1,
|
|
859
|
-
value:
|
|
860
|
-
onChange: (
|
|
861
|
-
|
|
872
|
+
value: y.distL,
|
|
873
|
+
onChange: (b) => {
|
|
874
|
+
z(b, "distL");
|
|
862
875
|
},
|
|
863
|
-
className:
|
|
876
|
+
className: g.imageCommonPanelInput
|
|
864
877
|
}
|
|
865
|
-
)))))), /* @__PURE__ */ d.createElement("div", { className:
|
|
866
|
-
|
|
878
|
+
)))))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-text-wrap.bottom"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
879
|
+
Ae,
|
|
867
880
|
{
|
|
868
|
-
min:
|
|
869
|
-
max:
|
|
870
|
-
disabled:
|
|
881
|
+
min: Ze,
|
|
882
|
+
max: Qe,
|
|
883
|
+
disabled: p,
|
|
871
884
|
precision: 1,
|
|
872
|
-
value:
|
|
873
|
-
onChange: (
|
|
874
|
-
|
|
885
|
+
value: y.distB,
|
|
886
|
+
onChange: (b) => {
|
|
887
|
+
z(b, "distB");
|
|
875
888
|
},
|
|
876
|
-
className:
|
|
889
|
+
className: g.imageCommonPanelInput
|
|
877
890
|
}
|
|
878
|
-
))))), /* @__PURE__ */ d.createElement("div", { className:
|
|
879
|
-
|
|
891
|
+
))))), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-text-wrap.right"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
892
|
+
Ae,
|
|
880
893
|
{
|
|
881
|
-
min:
|
|
882
|
-
max:
|
|
894
|
+
min: Ze,
|
|
895
|
+
max: Qe,
|
|
883
896
|
disabled: v,
|
|
884
897
|
precision: 1,
|
|
885
|
-
value:
|
|
886
|
-
onChange: (
|
|
887
|
-
|
|
898
|
+
value: y.distR,
|
|
899
|
+
onChange: (b) => {
|
|
900
|
+
z(b, "distR");
|
|
888
901
|
},
|
|
889
|
-
className:
|
|
902
|
+
className: g.imageCommonPanelInput
|
|
890
903
|
}
|
|
891
904
|
)))))));
|
|
892
|
-
},
|
|
893
|
-
const e =
|
|
905
|
+
}, xt = -1e3, Lt = 1e3, ki = (i) => {
|
|
906
|
+
const e = re($), t = re(ot), n = re(he), r = re(se), o = re(te), a = re(Ue), { drawings: s } = i, l = s[0];
|
|
894
907
|
if (l == null)
|
|
895
908
|
return;
|
|
896
|
-
const { unitId: c } = l, m =
|
|
897
|
-
if (
|
|
909
|
+
const { unitId: c } = l, m = o.getUniverDocInstance(c), u = r.getRenderById(c), f = u == null ? void 0 : u.scene;
|
|
910
|
+
if (f == null)
|
|
898
911
|
return;
|
|
899
|
-
const
|
|
900
|
-
label:
|
|
901
|
-
value: String(
|
|
912
|
+
const h = f.getTransformerByCreate(), p = [{
|
|
913
|
+
label: t.t("image-position.column"),
|
|
914
|
+
value: String(ee.COLUMN)
|
|
902
915
|
}, {
|
|
903
|
-
label:
|
|
904
|
-
value: String(
|
|
916
|
+
label: t.t("image-position.page"),
|
|
917
|
+
value: String(ee.PAGE)
|
|
905
918
|
}, {
|
|
906
|
-
label:
|
|
907
|
-
value: String(
|
|
919
|
+
label: t.t("image-position.margin"),
|
|
920
|
+
value: String(ee.MARGIN)
|
|
908
921
|
}], w = [{
|
|
909
|
-
label:
|
|
910
|
-
value: String(
|
|
922
|
+
label: t.t("image-position.line"),
|
|
923
|
+
value: String(V.LINE)
|
|
911
924
|
}, {
|
|
912
|
-
label:
|
|
913
|
-
value: String(
|
|
925
|
+
label: t.t("image-position.page"),
|
|
926
|
+
value: String(V.PAGE)
|
|
914
927
|
}, {
|
|
915
|
-
label:
|
|
916
|
-
value: String(
|
|
928
|
+
label: t.t("image-position.margin"),
|
|
929
|
+
value: String(V.MARGIN)
|
|
917
930
|
}, {
|
|
918
|
-
label:
|
|
919
|
-
value: String(
|
|
920
|
-
}], [v, I] =
|
|
921
|
-
relativeFrom:
|
|
931
|
+
label: t.t("image-position.paragraph"),
|
|
932
|
+
value: String(V.PARAGRAPH)
|
|
933
|
+
}], [v, I] = ie(!0), [D, _] = ie({
|
|
934
|
+
relativeFrom: ee.PAGE,
|
|
922
935
|
posOffset: 0
|
|
923
|
-
}), [
|
|
924
|
-
relativeFrom:
|
|
936
|
+
}), [C, O] = ie({
|
|
937
|
+
relativeFrom: V.PAGE,
|
|
925
938
|
posOffset: 0
|
|
926
|
-
}), [
|
|
927
|
-
function
|
|
928
|
-
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
939
|
+
}), [y, T] = ie(!0), [N, R] = ie(!0);
|
|
940
|
+
function E(S, A) {
|
|
941
|
+
S === "positionH" ? _(A) : O(A);
|
|
942
|
+
const P = n.getFocusDrawings();
|
|
943
|
+
if (P.length === 0)
|
|
931
944
|
return;
|
|
932
|
-
const
|
|
933
|
-
unitId:
|
|
934
|
-
subUnitId:
|
|
935
|
-
drawingId:
|
|
945
|
+
const L = P.map((x) => ({
|
|
946
|
+
unitId: x.unitId,
|
|
947
|
+
subUnitId: x.subUnitId,
|
|
948
|
+
drawingId: x.drawingId
|
|
936
949
|
}));
|
|
937
|
-
e.executeCommand(
|
|
938
|
-
unitId:
|
|
939
|
-
subUnitId:
|
|
940
|
-
drawings:
|
|
941
|
-
drawingId:
|
|
942
|
-
key:
|
|
943
|
-
value:
|
|
950
|
+
e.executeCommand(ze.id, {
|
|
951
|
+
unitId: P[0].unitId,
|
|
952
|
+
subUnitId: P[0].unitId,
|
|
953
|
+
drawings: L.map((x) => ({
|
|
954
|
+
drawingId: x.drawingId,
|
|
955
|
+
key: S,
|
|
956
|
+
value: A
|
|
944
957
|
}))
|
|
945
|
-
}), a.blur(),
|
|
958
|
+
}), a.blur(), h.refreshControls();
|
|
946
959
|
}
|
|
947
|
-
function
|
|
948
|
-
var
|
|
949
|
-
const
|
|
950
|
-
if (
|
|
960
|
+
function H(S) {
|
|
961
|
+
var we, ve, ne;
|
|
962
|
+
const A = D.relativeFrom, P = D.posOffset, L = Number(S);
|
|
963
|
+
if (A === L)
|
|
951
964
|
return;
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
965
|
+
const x = n.getFocusDrawings();
|
|
966
|
+
if (x.length === 0)
|
|
954
967
|
return;
|
|
955
|
-
const
|
|
956
|
-
let
|
|
957
|
-
const ce = (
|
|
958
|
-
if (
|
|
968
|
+
const M = x[0].drawingId, W = x[0].unitId;
|
|
969
|
+
let G = null, F = 0;
|
|
970
|
+
const ce = (we = r.getRenderById(W)) == null ? void 0 : we.with(ae).getSkeleton(), fe = ce == null ? void 0 : ce.getSkeletonData();
|
|
971
|
+
if (fe == null)
|
|
959
972
|
return;
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
973
|
+
const { pages: Oe, skeHeaders: Be, skeFooters: Ce } = fe;
|
|
974
|
+
for (const Ne of Oe) {
|
|
975
|
+
const { marginLeft: Ie, skeDrawings: Se, headerId: Te, footerId: Me, pageWidth: De } = Ne;
|
|
976
|
+
if (Se.has(M)) {
|
|
977
|
+
G = Se.get(M), F = Ie;
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
const J = (ve = Be.get(Te)) == null ? void 0 : ve.get(De);
|
|
981
|
+
if (J != null && J.skeDrawings.has(M)) {
|
|
982
|
+
G = J == null ? void 0 : J.skeDrawings.get(M), F = Ie;
|
|
983
|
+
break;
|
|
984
|
+
}
|
|
985
|
+
const q = (ne = Ce.get(Me)) == null ? void 0 : ne.get(De);
|
|
986
|
+
if (q != null && q.skeDrawings.has(M)) {
|
|
987
|
+
G = q == null ? void 0 : q.skeDrawings.get(M), F = Ie;
|
|
964
988
|
break;
|
|
965
989
|
}
|
|
966
990
|
}
|
|
967
|
-
if (
|
|
991
|
+
if (G == null)
|
|
968
992
|
return;
|
|
969
|
-
let
|
|
970
|
-
|
|
971
|
-
const
|
|
972
|
-
relativeFrom:
|
|
973
|
-
posOffset: (
|
|
993
|
+
let K = 0;
|
|
994
|
+
A === ee.COLUMN ? K -= G.columnLeft : A === ee.MARGIN && (K -= F), L === ee.COLUMN ? K += G.columnLeft : L === ee.MARGIN ? K += F : ee.PAGE;
|
|
995
|
+
const le = {
|
|
996
|
+
relativeFrom: L,
|
|
997
|
+
posOffset: (P != null ? P : 0) - K
|
|
974
998
|
};
|
|
975
|
-
|
|
999
|
+
E("positionH", le);
|
|
976
1000
|
}
|
|
977
|
-
function
|
|
978
|
-
var
|
|
979
|
-
const
|
|
980
|
-
if (
|
|
1001
|
+
function z(S) {
|
|
1002
|
+
var Ie, Se, Te, Me, De;
|
|
1003
|
+
const A = C.relativeFrom, P = C.posOffset, L = Number(S);
|
|
1004
|
+
if (A === L)
|
|
981
1005
|
return;
|
|
982
|
-
const
|
|
983
|
-
if (
|
|
1006
|
+
const x = n.getFocusDrawings();
|
|
1007
|
+
if (x.length === 0)
|
|
984
1008
|
return;
|
|
985
|
-
const { drawingId:
|
|
986
|
-
if (
|
|
1009
|
+
const { drawingId: M, unitId: W } = x[0], G = o.getUniverDocInstance(W), F = (Ie = r.getRenderById(W)) == null ? void 0 : Ie.with(ae).getSkeleton(), ce = a.getSegment(), fe = a.getSegmentPage(), Oe = (Te = (Se = G == null ? void 0 : G.getSelfOrHeaderFooterModel(ce).getBody()) == null ? void 0 : Se.customBlocks) == null ? void 0 : Te.find((J) => J.blockId === M);
|
|
1010
|
+
if (Oe == null || F == null)
|
|
987
1011
|
return;
|
|
988
|
-
const { startIndex:
|
|
989
|
-
if (
|
|
1012
|
+
const { startIndex: Be } = Oe, Ce = F.findNodeByCharIndex(Be, ce, fe), K = (Me = Ce == null ? void 0 : Ce.parent) == null ? void 0 : Me.parent, le = K == null ? void 0 : K.parent, we = le == null ? void 0 : le.lines.find((J) => J.paragraphIndex === (K == null ? void 0 : K.paragraphIndex) && J.paragraphStart), ve = (De = le == null ? void 0 : le.parent) == null ? void 0 : De.parent;
|
|
1013
|
+
if (Ce == null || K == null || we == null || le == null || ve == null)
|
|
990
1014
|
return;
|
|
991
1015
|
let ne = 0;
|
|
992
|
-
|
|
993
|
-
const
|
|
994
|
-
relativeFrom:
|
|
995
|
-
posOffset: (
|
|
1016
|
+
A === V.PARAGRAPH ? ne -= we.top : A === V.LINE ? ne -= K.top : A === V.PAGE && (ne += ve.marginTop), L === V.PARAGRAPH ? ne += we.top : L === V.LINE ? ne += K.top : L === V.PAGE && (ne -= ve.marginTop);
|
|
1017
|
+
const Ne = {
|
|
1018
|
+
relativeFrom: L,
|
|
1019
|
+
posOffset: (P != null ? P : 0) - ne
|
|
996
1020
|
};
|
|
997
|
-
|
|
1021
|
+
E("positionV", Ne);
|
|
998
1022
|
}
|
|
999
|
-
function
|
|
1000
|
-
var
|
|
1001
|
-
const
|
|
1002
|
-
if (
|
|
1023
|
+
function U(S) {
|
|
1024
|
+
var W;
|
|
1025
|
+
const A = m == null ? void 0 : m.getSnapshot(), P = (W = A == null ? void 0 : A.drawings) == null ? void 0 : W[S.drawingId];
|
|
1026
|
+
if (P == null)
|
|
1003
1027
|
return;
|
|
1004
|
-
const { layoutType:
|
|
1005
|
-
positionH:
|
|
1006
|
-
positionV:
|
|
1007
|
-
} =
|
|
1008
|
-
|
|
1009
|
-
}
|
|
1010
|
-
function
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
}
|
|
1014
|
-
function
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
return
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
1021
|
-
|
|
1028
|
+
const { layoutType: L } = P, {
|
|
1029
|
+
positionH: x,
|
|
1030
|
+
positionV: M
|
|
1031
|
+
} = P.docTransform;
|
|
1032
|
+
_(x), O(M), I(L === k.INLINE), T(M.relativeFrom === V.PARAGRAPH || M.relativeFrom === V.LINE);
|
|
1033
|
+
}
|
|
1034
|
+
function B() {
|
|
1035
|
+
const S = n.getFocusDrawings();
|
|
1036
|
+
S.length !== 0 && U(S[0]);
|
|
1037
|
+
}
|
|
1038
|
+
function b(S) {
|
|
1039
|
+
T(S), z(String(S ? V.PARAGRAPH : V.PAGE));
|
|
1040
|
+
}
|
|
1041
|
+
return ht(() => {
|
|
1042
|
+
B();
|
|
1043
|
+
const S = n.focus$.subscribe((P) => {
|
|
1044
|
+
if (P.length === 0) {
|
|
1045
|
+
R(!1);
|
|
1022
1046
|
return;
|
|
1023
1047
|
}
|
|
1024
|
-
|
|
1025
|
-
}),
|
|
1026
|
-
|
|
1048
|
+
R(!0), U(P[0]);
|
|
1049
|
+
}), A = e.onCommandExecuted(async (P) => {
|
|
1050
|
+
P.id === Q.id && B();
|
|
1027
1051
|
});
|
|
1028
1052
|
return () => {
|
|
1029
|
-
|
|
1053
|
+
S.unsubscribe(), A.dispose();
|
|
1030
1054
|
};
|
|
1031
|
-
}, []), /* @__PURE__ */ d.createElement("div", { className:
|
|
1032
|
-
|
|
1055
|
+
}, []), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelGrid, g.imageCommonPanelBorder), style: { display: N ? "block" : "none" } }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelTitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-position.title")))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSubtitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-position.horizontal")))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-position.absolutePosition"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
1056
|
+
Ae,
|
|
1033
1057
|
{
|
|
1034
|
-
min:
|
|
1035
|
-
max:
|
|
1058
|
+
min: xt,
|
|
1059
|
+
max: Lt,
|
|
1036
1060
|
precision: 1,
|
|
1037
1061
|
disabled: v,
|
|
1038
|
-
value:
|
|
1039
|
-
onChange: (
|
|
1040
|
-
|
|
1041
|
-
relativeFrom:
|
|
1042
|
-
posOffset:
|
|
1062
|
+
value: D.posOffset,
|
|
1063
|
+
onChange: (S) => {
|
|
1064
|
+
E("positionH", {
|
|
1065
|
+
relativeFrom: D.relativeFrom,
|
|
1066
|
+
posOffset: S
|
|
1043
1067
|
});
|
|
1044
1068
|
},
|
|
1045
|
-
className:
|
|
1069
|
+
className: g.imageCommonPanelInput
|
|
1046
1070
|
}
|
|
1047
|
-
))))), /* @__PURE__ */ d.createElement("div", { className:
|
|
1048
|
-
|
|
1071
|
+
))))), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-position.toTheRightOf"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
1072
|
+
Rt,
|
|
1049
1073
|
{
|
|
1050
|
-
value: String(
|
|
1074
|
+
value: String(D.relativeFrom),
|
|
1051
1075
|
disabled: v,
|
|
1052
|
-
options:
|
|
1053
|
-
onChange:
|
|
1076
|
+
options: p,
|
|
1077
|
+
onChange: H
|
|
1054
1078
|
}
|
|
1055
|
-
)))))), /* @__PURE__ */ d.createElement("div", { className:
|
|
1056
|
-
|
|
1079
|
+
)))))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSubtitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-position.vertical")))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-position.absolutePosition"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
1080
|
+
Ae,
|
|
1057
1081
|
{
|
|
1058
|
-
min:
|
|
1059
|
-
max:
|
|
1082
|
+
min: xt,
|
|
1083
|
+
max: Lt,
|
|
1060
1084
|
precision: 1,
|
|
1061
1085
|
disabled: v,
|
|
1062
|
-
value:
|
|
1063
|
-
onChange: (
|
|
1064
|
-
|
|
1065
|
-
relativeFrom:
|
|
1066
|
-
posOffset:
|
|
1086
|
+
value: C.posOffset,
|
|
1087
|
+
onChange: (S) => {
|
|
1088
|
+
E("positionV", {
|
|
1089
|
+
relativeFrom: C.relativeFrom,
|
|
1090
|
+
posOffset: S
|
|
1067
1091
|
});
|
|
1068
1092
|
},
|
|
1069
|
-
className:
|
|
1093
|
+
className: g.imageCommonPanelInput
|
|
1070
1094
|
}
|
|
1071
|
-
))))), /* @__PURE__ */ d.createElement("div", { className:
|
|
1072
|
-
|
|
1095
|
+
))))), /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSpan2) }, /* @__PURE__ */ d.createElement("label", null, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, t.t("image-position.bellow"))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(
|
|
1096
|
+
Rt,
|
|
1073
1097
|
{
|
|
1074
1098
|
disabled: v,
|
|
1075
|
-
value: String(
|
|
1099
|
+
value: String(C.relativeFrom),
|
|
1076
1100
|
options: w,
|
|
1077
|
-
onChange:
|
|
1101
|
+
onChange: z
|
|
1078
1102
|
}
|
|
1079
|
-
)))))), /* @__PURE__ */ d.createElement("div", { className:
|
|
1080
|
-
},
|
|
1081
|
-
const i =
|
|
1082
|
-
return
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1103
|
+
)))))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow }, /* @__PURE__ */ d.createElement("div", { className: j(g.imageCommonPanelColumn, g.imageCommonPanelSubtitle) }, /* @__PURE__ */ d.createElement("div", null, t.t("image-position.options")))), /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelRow, style: { marginBottom: "50px" } }, /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanelColumn }, /* @__PURE__ */ d.createElement(si, { disabled: v, checked: y, onChange: b }, t.t("image-position.moveObjectWithText")))));
|
|
1104
|
+
}, Hi = () => {
|
|
1105
|
+
const i = re(he), e = i.getFocusDrawings(), [t, n] = ie(e);
|
|
1106
|
+
return ht(() => {
|
|
1107
|
+
const r = i.focus$.subscribe((o) => {
|
|
1108
|
+
n(o);
|
|
1085
1109
|
});
|
|
1086
1110
|
return () => {
|
|
1087
|
-
|
|
1111
|
+
r.unsubscribe();
|
|
1088
1112
|
};
|
|
1089
|
-
}, []), !!(
|
|
1090
|
-
},
|
|
1113
|
+
}, []), !!(t != null && t.length) && /* @__PURE__ */ d.createElement("div", { className: g.imageCommonPanel }, /* @__PURE__ */ d.createElement(Nn, { drawings: t, hasAlign: !1, hasCropper: !1, hasGroup: !1, hasTransform: !1 }), /* @__PURE__ */ d.createElement(Fi, { drawings: t }), /* @__PURE__ */ d.createElement(ki, { drawings: t }));
|
|
1114
|
+
}, Wi = {
|
|
1091
1115
|
id: "doc.operation.clear-drawing-transformer",
|
|
1092
|
-
type:
|
|
1116
|
+
type: Y.MUTATION,
|
|
1093
1117
|
handler: (i, e) => {
|
|
1094
|
-
const
|
|
1095
|
-
return e.forEach((
|
|
1096
|
-
var
|
|
1097
|
-
(
|
|
1118
|
+
const t = i.get(se);
|
|
1119
|
+
return e.forEach((n) => {
|
|
1120
|
+
var r, o;
|
|
1121
|
+
(o = (r = t.getRenderById(n)) == null ? void 0 : r.scene.getTransformer()) == null || o.debounceRefreshControls();
|
|
1098
1122
|
}), !0;
|
|
1099
1123
|
}
|
|
1100
|
-
},
|
|
1124
|
+
}, Xe = {
|
|
1101
1125
|
id: "doc.command.move-drawing",
|
|
1102
|
-
type:
|
|
1126
|
+
type: Y.COMMAND,
|
|
1103
1127
|
handler: (i, e) => {
|
|
1104
|
-
const
|
|
1128
|
+
const t = i.get($), n = i.get(Re), r = i.get(te), o = i.get(se), { direction: a } = e, s = n.getFocusDrawings();
|
|
1105
1129
|
if (s.length === 0)
|
|
1106
1130
|
return !1;
|
|
1107
|
-
const l = s[0].unitId, c =
|
|
1131
|
+
const l = s[0].unitId, c = o.getRenderById(l), m = c == null ? void 0 : c.scene;
|
|
1108
1132
|
if (m == null)
|
|
1109
1133
|
return !1;
|
|
1110
|
-
const u = m.getTransformerByCreate(),
|
|
1111
|
-
var
|
|
1112
|
-
const { drawingId: v } = w, I = (
|
|
1113
|
-
if (I == null || I.layoutType ===
|
|
1134
|
+
const u = m.getTransformerByCreate(), f = r.getUniverDocInstance(l), h = s.map((w) => {
|
|
1135
|
+
var y, T, N, R, E;
|
|
1136
|
+
const { drawingId: v } = w, I = (y = f == null ? void 0 : f.getSnapshot().drawings) == null ? void 0 : y[v];
|
|
1137
|
+
if (I == null || I.layoutType === k.INLINE)
|
|
1114
1138
|
return null;
|
|
1115
|
-
const { positionH:
|
|
1116
|
-
return a ===
|
|
1139
|
+
const { positionH: D, positionV: _ } = I.docTransform, C = { ...D }, O = { ..._ };
|
|
1140
|
+
return a === ge.UP ? O.posOffset = ((T = O.posOffset) != null ? T : 0) - 2 : a === ge.DOWN ? O.posOffset = ((N = O.posOffset) != null ? N : 0) + 2 : a === ge.LEFT ? C.posOffset = ((R = C.posOffset) != null ? R : 0) - 2 : a === ge.RIGHT && (C.posOffset = ((E = C.posOffset) != null ? E : 0) + 2), {
|
|
1117
1141
|
drawingId: v,
|
|
1118
|
-
key: a ===
|
|
1119
|
-
value: a ===
|
|
1142
|
+
key: a === ge.UP || a === ge.DOWN ? "positionV" : "positionH",
|
|
1143
|
+
value: a === ge.UP || a === ge.DOWN ? O : C
|
|
1120
1144
|
};
|
|
1121
1145
|
}).filter((w) => w != null);
|
|
1122
|
-
if (
|
|
1146
|
+
if (h.length === 0)
|
|
1123
1147
|
return !1;
|
|
1124
|
-
const
|
|
1148
|
+
const p = t.syncExecuteCommand(ze.id, {
|
|
1125
1149
|
unitId: l,
|
|
1126
1150
|
subUnitId: l,
|
|
1127
|
-
drawings:
|
|
1151
|
+
drawings: h
|
|
1128
1152
|
});
|
|
1129
|
-
return u.refreshControls(), !!
|
|
1153
|
+
return u.refreshControls(), !!p;
|
|
1130
1154
|
}
|
|
1131
|
-
},
|
|
1155
|
+
}, cn = {
|
|
1132
1156
|
id: "doc.command.delete-drawing",
|
|
1133
|
-
type:
|
|
1157
|
+
type: Y.COMMAND,
|
|
1134
1158
|
handler: (i) => {
|
|
1135
|
-
const e = i.get(
|
|
1136
|
-
if (
|
|
1159
|
+
const e = i.get($), n = i.get(Re).getFocusDrawings();
|
|
1160
|
+
if (n.length === 0)
|
|
1137
1161
|
return !1;
|
|
1138
|
-
const { unitId:
|
|
1162
|
+
const { unitId: r } = n[0], o = n.map((a) => {
|
|
1139
1163
|
const { unitId: s, subUnitId: l, drawingId: c, drawingType: m } = a;
|
|
1140
1164
|
return {
|
|
1141
1165
|
unitId: s,
|
|
@@ -1144,326 +1168,223 @@ const bi = {
|
|
|
1144
1168
|
drawingType: m
|
|
1145
1169
|
};
|
|
1146
1170
|
});
|
|
1147
|
-
return e.executeCommand(
|
|
1148
|
-
unitId:
|
|
1149
|
-
drawings:
|
|
1171
|
+
return e.executeCommand(wt.id, {
|
|
1172
|
+
unitId: r,
|
|
1173
|
+
drawings: o
|
|
1150
1174
|
});
|
|
1151
1175
|
}
|
|
1152
|
-
},
|
|
1176
|
+
}, ln = {
|
|
1153
1177
|
id: "doc.command.set-drawing-arrange",
|
|
1154
|
-
type:
|
|
1178
|
+
type: Y.COMMAND,
|
|
1155
1179
|
handler: (i, e) => {
|
|
1156
|
-
const
|
|
1180
|
+
const t = i.get($), n = i.get(Re);
|
|
1157
1181
|
if (e == null)
|
|
1158
1182
|
return !1;
|
|
1159
|
-
const { unitId:
|
|
1183
|
+
const { unitId: r, subUnitId: o, drawingIds: a, arrangeType: s } = e, l = { unitId: r, subUnitId: o, drawingIds: a };
|
|
1160
1184
|
let c;
|
|
1161
|
-
if (s ===
|
|
1185
|
+
if (s === Ye.forward ? c = n.getForwardDrawingsOp(l) : s === Ye.backward ? c = n.getBackwardDrawingOp(l) : s === Ye.front ? c = n.getFrontDrawingsOp(l) : s === Ye.back && (c = n.getBackDrawingsOp(l)), c == null)
|
|
1162
1186
|
return !1;
|
|
1163
1187
|
const { redo: m } = c;
|
|
1164
1188
|
if (m == null)
|
|
1165
1189
|
return !1;
|
|
1166
1190
|
const u = [];
|
|
1167
|
-
let
|
|
1168
|
-
|
|
1169
|
-
const
|
|
1170
|
-
id:
|
|
1191
|
+
let f = Pe.deepClone(m);
|
|
1192
|
+
f = f.slice(3), f.unshift("drawingsOrder"), u.push(f);
|
|
1193
|
+
const h = {
|
|
1194
|
+
id: Q.id,
|
|
1171
1195
|
params: {
|
|
1172
|
-
unitId:
|
|
1196
|
+
unitId: r,
|
|
1173
1197
|
actions: [],
|
|
1174
1198
|
textRanges: null
|
|
1175
1199
|
}
|
|
1176
1200
|
};
|
|
1177
|
-
return
|
|
1178
|
-
}
|
|
1179
|
-
}, ot = {
|
|
1180
|
-
id: "doc.command.set-doc-image",
|
|
1181
|
-
type: $.COMMAND,
|
|
1182
|
-
handler: (i, e) => {
|
|
1183
|
-
const n = i.get(W), t = i.get(mn), o = i.get(De);
|
|
1184
|
-
if (!e) return !1;
|
|
1185
|
-
const { drawings: r } = e, a = o.getBatchUpdateOp(r), { unitId: s, subUnitId: l, undo: c, redo: m, objects: u } = a;
|
|
1186
|
-
return n.syncExecuteCommand(fe.id, { unitId: s, subUnitId: l, op: m, objects: u, type: he.UPDATE }) ? (t.pushUndoRedo({
|
|
1187
|
-
unitID: s,
|
|
1188
|
-
undoMutations: [
|
|
1189
|
-
{ id: fe.id, params: { unitId: s, subUnitId: l, op: c, objects: u, type: he.UPDATE } },
|
|
1190
|
-
{ id: Oe.id, params: [s] }
|
|
1191
|
-
],
|
|
1192
|
-
redoMutations: [
|
|
1193
|
-
{ id: fe.id, params: { unitId: s, subUnitId: l, op: m, objects: u, type: he.UPDATE } },
|
|
1194
|
-
{ id: Oe.id, params: [s] }
|
|
1195
|
-
]
|
|
1196
|
-
}), !0) : !1;
|
|
1201
|
+
return h.params.actions = u.reduce((w, v) => X.compose(w, v), null), !!t.syncExecuteCommand(h.id, h.params);
|
|
1197
1202
|
}
|
|
1198
|
-
}
|
|
1199
|
-
function xi(i) {
|
|
1200
|
-
const e = [];
|
|
1201
|
-
return i.forEach((n) => {
|
|
1202
|
-
const { parent: t, children: o } = n, { unitId: r, subUnitId: a, drawingId: s } = t, l = Nt(0, 0, o.map((u) => u.transform || {})), c = o.map((u) => {
|
|
1203
|
-
const p = u.transform || { left: 0, top: 0 }, { unitId: f, subUnitId: g, drawingId: w } = u;
|
|
1204
|
-
return {
|
|
1205
|
-
unitId: f,
|
|
1206
|
-
subUnitId: g,
|
|
1207
|
-
drawingId: w,
|
|
1208
|
-
transform: {
|
|
1209
|
-
...p,
|
|
1210
|
-
left: p.left - l.left,
|
|
1211
|
-
top: p.top - l.top
|
|
1212
|
-
},
|
|
1213
|
-
groupId: s
|
|
1214
|
-
};
|
|
1215
|
-
}), m = {
|
|
1216
|
-
unitId: r,
|
|
1217
|
-
subUnitId: a,
|
|
1218
|
-
drawingId: s,
|
|
1219
|
-
drawingType: un.DRAWING_GROUP,
|
|
1220
|
-
transform: l
|
|
1221
|
-
};
|
|
1222
|
-
e.push({
|
|
1223
|
-
parent: m,
|
|
1224
|
-
children: c
|
|
1225
|
-
});
|
|
1226
|
-
}), e;
|
|
1227
|
-
}
|
|
1228
|
-
function Ui(i) {
|
|
1229
|
-
const e = [];
|
|
1230
|
-
return i.forEach((n) => {
|
|
1231
|
-
const { parent: t, children: o } = n, { unitId: r, subUnitId: a, drawingId: s, transform: l = { width: 0, height: 0 } } = t;
|
|
1232
|
-
if (l == null)
|
|
1233
|
-
return;
|
|
1234
|
-
const c = o.map((u) => {
|
|
1235
|
-
const { transform: p } = u, { unitId: f, subUnitId: g, drawingId: w } = u, v = At(p || {}, l, l.width || 0, l.height || 0);
|
|
1236
|
-
return {
|
|
1237
|
-
unitId: f,
|
|
1238
|
-
subUnitId: g,
|
|
1239
|
-
drawingId: w,
|
|
1240
|
-
transform: v,
|
|
1241
|
-
groupId: void 0
|
|
1242
|
-
};
|
|
1243
|
-
}), m = {
|
|
1244
|
-
unitId: r,
|
|
1245
|
-
subUnitId: a,
|
|
1246
|
-
drawingId: s,
|
|
1247
|
-
drawingType: un.DRAWING_GROUP,
|
|
1248
|
-
transform: {
|
|
1249
|
-
left: 0,
|
|
1250
|
-
top: 0
|
|
1251
|
-
}
|
|
1252
|
-
};
|
|
1253
|
-
e.push({
|
|
1254
|
-
parent: m,
|
|
1255
|
-
children: c
|
|
1256
|
-
});
|
|
1257
|
-
}), e;
|
|
1258
|
-
}
|
|
1259
|
-
const rt = {
|
|
1203
|
+
}, dn = {
|
|
1260
1204
|
id: "doc.command.ungroup-doc-image",
|
|
1261
|
-
type:
|
|
1205
|
+
type: Y.COMMAND,
|
|
1262
1206
|
handler: (i, e) => {
|
|
1263
|
-
|
|
1207
|
+
i.get($), i.get(Ft);
|
|
1208
|
+
const t = i.get(Re);
|
|
1264
1209
|
if (!e) return !1;
|
|
1265
|
-
const
|
|
1266
|
-
e.forEach(({ parent:
|
|
1267
|
-
|
|
1268
|
-
|
|
1210
|
+
const n = [];
|
|
1211
|
+
return e.forEach(({ parent: r, children: o }) => {
|
|
1212
|
+
n.push(r.unitId), o.forEach((a) => {
|
|
1213
|
+
n.push(a.unitId);
|
|
1269
1214
|
});
|
|
1270
|
-
});
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
unitID: s,
|
|
1274
|
-
undoMutations: [
|
|
1275
|
-
{ id: fe.id, params: { op: c, unitId: s, subUnitId: l, objects: xi(u), type: he.GROUP } },
|
|
1276
|
-
{ id: Oe.id, params: r }
|
|
1277
|
-
],
|
|
1278
|
-
redoMutations: [
|
|
1279
|
-
{ id: fe.id, params: { op: m, unitId: s, subUnitId: l, objects: u, type: he.UNGROUP } },
|
|
1280
|
-
{ id: Oe.id, params: r }
|
|
1281
|
-
]
|
|
1282
|
-
}), !0) : !1;
|
|
1283
|
-
}
|
|
1284
|
-
}, at = {
|
|
1215
|
+
}), t.getUngroupDrawingOp(e), !1;
|
|
1216
|
+
}
|
|
1217
|
+
}, mn = {
|
|
1285
1218
|
id: "doc.command.group-doc-image",
|
|
1286
|
-
type:
|
|
1219
|
+
type: Y.COMMAND,
|
|
1287
1220
|
handler: (i, e) => {
|
|
1288
|
-
|
|
1221
|
+
i.get($), i.get(Ft);
|
|
1222
|
+
const t = i.get(Re);
|
|
1289
1223
|
if (!e) return !1;
|
|
1290
|
-
const
|
|
1291
|
-
e.forEach(({ parent:
|
|
1292
|
-
|
|
1293
|
-
|
|
1224
|
+
const n = [];
|
|
1225
|
+
return e.forEach(({ parent: r, children: o }) => {
|
|
1226
|
+
n.push(r.unitId), o.forEach((a) => {
|
|
1227
|
+
n.push(a.unitId);
|
|
1294
1228
|
});
|
|
1295
|
-
});
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
unitID: s,
|
|
1299
|
-
undoMutations: [
|
|
1300
|
-
{ id: fe.id, params: { op: c, unitId: s, subUnitId: l, objects: Ui(u), type: he.UNGROUP } },
|
|
1301
|
-
{ id: Oe.id, params: r }
|
|
1302
|
-
],
|
|
1303
|
-
redoMutations: [
|
|
1304
|
-
{ id: fe.id, params: { op: m, unitId: s, subUnitId: l, objects: u, type: he.GROUP } },
|
|
1305
|
-
{ id: Oe.id, params: r }
|
|
1306
|
-
]
|
|
1307
|
-
}), !0) : !1;
|
|
1308
|
-
}
|
|
1309
|
-
}, st = {
|
|
1229
|
+
}), t.getGroupDrawingOp(e), !1;
|
|
1230
|
+
}
|
|
1231
|
+
}, gn = {
|
|
1310
1232
|
id: "doc.command.insert-doc-image",
|
|
1311
|
-
type:
|
|
1233
|
+
type: Y.COMMAND,
|
|
1312
1234
|
// eslint-disable-next-line max-lines-per-function
|
|
1313
1235
|
handler: (i, e) => {
|
|
1314
|
-
var O,
|
|
1236
|
+
var O, y;
|
|
1315
1237
|
if (e == null)
|
|
1316
1238
|
return !1;
|
|
1317
|
-
const
|
|
1318
|
-
if (
|
|
1239
|
+
const t = i.get($), n = i.get(gt), r = i.get(te), o = n.getActiveRange(), a = r.getCurrentUniverDocInstance();
|
|
1240
|
+
if (o == null || a == null)
|
|
1319
1241
|
return !1;
|
|
1320
|
-
const s = a.getUnitId(), { drawings: l } = e, { collapsed: c, startOffset: m, segmentId: u } =
|
|
1321
|
-
if (
|
|
1242
|
+
const s = a.getUnitId(), { drawings: l } = e, { collapsed: c, startOffset: m, segmentId: u } = o, f = a.getSelfOrHeaderFooterModel(u).getBody();
|
|
1243
|
+
if (f == null)
|
|
1322
1244
|
return !1;
|
|
1323
|
-
const
|
|
1245
|
+
const h = new pt(), p = X.getInstance(), w = [], v = (y = (O = a.getSnapshot().drawingsOrder) == null ? void 0 : O.length) != null ? y : 0;
|
|
1324
1246
|
if (c)
|
|
1325
|
-
m > 0 &&
|
|
1326
|
-
t:
|
|
1247
|
+
m > 0 && h.push({
|
|
1248
|
+
t: Z.RETAIN,
|
|
1327
1249
|
len: m,
|
|
1328
1250
|
segmentId: u
|
|
1329
1251
|
});
|
|
1330
1252
|
else {
|
|
1331
|
-
const { dos:
|
|
1332
|
-
|
|
1253
|
+
const { dos: T } = Yn(o, u, 0, f);
|
|
1254
|
+
h.push(...T);
|
|
1333
1255
|
}
|
|
1334
|
-
|
|
1335
|
-
t:
|
|
1256
|
+
h.push({
|
|
1257
|
+
t: Z.INSERT,
|
|
1336
1258
|
body: {
|
|
1337
1259
|
dataStream: "\b".repeat(l.length),
|
|
1338
|
-
customBlocks: l.map((
|
|
1339
|
-
startIndex:
|
|
1340
|
-
blockId:
|
|
1260
|
+
customBlocks: l.map((T, N) => ({
|
|
1261
|
+
startIndex: N,
|
|
1262
|
+
blockId: T.drawingId
|
|
1341
1263
|
}))
|
|
1342
1264
|
},
|
|
1343
1265
|
len: l.length,
|
|
1344
1266
|
line: 0,
|
|
1345
1267
|
segmentId: u
|
|
1346
1268
|
});
|
|
1347
|
-
const I =
|
|
1348
|
-
w.push(
|
|
1349
|
-
for (const
|
|
1350
|
-
const { drawingId:
|
|
1351
|
-
w.push(
|
|
1269
|
+
const I = $e(a, u), D = p.editOp(h.serialize(), I);
|
|
1270
|
+
w.push(D);
|
|
1271
|
+
for (const T of l) {
|
|
1272
|
+
const { drawingId: N } = T, R = p.insertOp(["drawings", N], T), E = p.insertOp(["drawingsOrder", v], N);
|
|
1273
|
+
w.push(R), w.push(E);
|
|
1352
1274
|
}
|
|
1353
|
-
const
|
|
1354
|
-
id:
|
|
1275
|
+
const _ = {
|
|
1276
|
+
id: Q.id,
|
|
1355
1277
|
params: {
|
|
1356
1278
|
unitId: s,
|
|
1357
1279
|
actions: [],
|
|
1358
1280
|
textRanges: []
|
|
1359
1281
|
}
|
|
1360
1282
|
};
|
|
1361
|
-
return
|
|
1283
|
+
return _.params.actions = w.reduce((T, N) => X.compose(T, N), null), !!t.syncExecuteCommand(_.id, _.params);
|
|
1362
1284
|
}
|
|
1363
1285
|
};
|
|
1364
|
-
function
|
|
1365
|
-
return i.getContextValue(
|
|
1286
|
+
function Ke(i) {
|
|
1287
|
+
return i.getContextValue(Sn) && i.getContextValue(it);
|
|
1366
1288
|
}
|
|
1367
|
-
const
|
|
1368
|
-
id:
|
|
1289
|
+
const Gi = {
|
|
1290
|
+
id: Xe.id,
|
|
1369
1291
|
description: "shortcut.doc.drawing-move-down",
|
|
1370
1292
|
group: "4_doc-drawing-view",
|
|
1371
|
-
binding:
|
|
1293
|
+
binding: Le.ARROW_DOWN,
|
|
1372
1294
|
priority: 100,
|
|
1373
|
-
preconditions:
|
|
1295
|
+
preconditions: Ke,
|
|
1374
1296
|
staticParameters: {
|
|
1375
|
-
direction:
|
|
1297
|
+
direction: ge.DOWN
|
|
1376
1298
|
}
|
|
1377
|
-
},
|
|
1378
|
-
id:
|
|
1299
|
+
}, Vi = {
|
|
1300
|
+
id: Xe.id,
|
|
1379
1301
|
description: "shortcut.doc.drawing-move-up",
|
|
1380
1302
|
group: "4_doc-drawing-view",
|
|
1381
|
-
binding:
|
|
1303
|
+
binding: Le.ARROW_UP,
|
|
1382
1304
|
priority: 100,
|
|
1383
|
-
preconditions:
|
|
1305
|
+
preconditions: Ke,
|
|
1384
1306
|
staticParameters: {
|
|
1385
|
-
direction:
|
|
1307
|
+
direction: ge.UP
|
|
1386
1308
|
}
|
|
1387
|
-
},
|
|
1388
|
-
id:
|
|
1309
|
+
}, ji = {
|
|
1310
|
+
id: Xe.id,
|
|
1389
1311
|
description: "shortcut.doc.drawing-move-left",
|
|
1390
1312
|
group: "4_doc-drawing-view",
|
|
1391
|
-
binding:
|
|
1313
|
+
binding: Le.ARROW_LEFT,
|
|
1392
1314
|
priority: 100,
|
|
1393
|
-
preconditions:
|
|
1315
|
+
preconditions: Ke,
|
|
1394
1316
|
staticParameters: {
|
|
1395
|
-
direction:
|
|
1317
|
+
direction: ge.LEFT
|
|
1396
1318
|
}
|
|
1397
|
-
},
|
|
1398
|
-
id:
|
|
1319
|
+
}, $i = {
|
|
1320
|
+
id: Xe.id,
|
|
1399
1321
|
description: "shortcut.doc.drawing-move-right",
|
|
1400
1322
|
group: "4_doc-drawing-view",
|
|
1401
|
-
binding:
|
|
1323
|
+
binding: Le.ARROW_RIGHT,
|
|
1402
1324
|
priority: 100,
|
|
1403
|
-
preconditions:
|
|
1325
|
+
preconditions: Ke,
|
|
1404
1326
|
staticParameters: {
|
|
1405
|
-
direction:
|
|
1327
|
+
direction: ge.RIGHT
|
|
1406
1328
|
}
|
|
1407
|
-
},
|
|
1408
|
-
id:
|
|
1329
|
+
}, zi = {
|
|
1330
|
+
id: cn.id,
|
|
1409
1331
|
description: "shortcut.doc.drawing-delete",
|
|
1410
1332
|
group: "4_doc-drawing-view",
|
|
1411
1333
|
// when focusing on any other input tag do not trigger this shortcut
|
|
1412
|
-
preconditions:
|
|
1413
|
-
binding:
|
|
1414
|
-
mac:
|
|
1334
|
+
preconditions: Ke,
|
|
1335
|
+
binding: Le.DELETE,
|
|
1336
|
+
mac: Le.BACKSPACE
|
|
1415
1337
|
};
|
|
1416
|
-
var
|
|
1417
|
-
for (var
|
|
1418
|
-
(a = i[
|
|
1419
|
-
return
|
|
1420
|
-
},
|
|
1421
|
-
let
|
|
1422
|
-
constructor(i, e,
|
|
1423
|
-
super(), this._injector = i, this._componentManager = e, this._menuService =
|
|
1338
|
+
var qi = Object.defineProperty, Xi = Object.getOwnPropertyDescriptor, Ki = (i, e, t, n) => {
|
|
1339
|
+
for (var r = n > 1 ? void 0 : n ? Xi(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
1340
|
+
(a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
|
|
1341
|
+
return n && r && qi(e, t, r), r;
|
|
1342
|
+
}, He = (i, e) => (t, n) => e(t, n, i);
|
|
1343
|
+
let et = class extends qe {
|
|
1344
|
+
constructor(i, e, t, n, r) {
|
|
1345
|
+
super(), this._injector = i, this._componentManager = e, this._menuService = t, this._commandService = n, this._shortcutService = r, this._init();
|
|
1424
1346
|
}
|
|
1425
1347
|
_initCustomComponents() {
|
|
1426
1348
|
const i = this._componentManager;
|
|
1427
|
-
this.disposeWithMe(i.register(
|
|
1349
|
+
this.disposeWithMe(i.register(Jt, Zt)), this.disposeWithMe(i.register(Qt, vi)), this.disposeWithMe(i.register(zt, Hi));
|
|
1428
1350
|
}
|
|
1429
1351
|
_initMenus() {
|
|
1430
1352
|
[
|
|
1431
|
-
|
|
1432
|
-
|
|
1353
|
+
_i,
|
|
1354
|
+
Ci
|
|
1433
1355
|
].forEach((i) => {
|
|
1434
1356
|
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(i), {}));
|
|
1435
1357
|
});
|
|
1436
1358
|
}
|
|
1437
1359
|
_initCommands() {
|
|
1438
1360
|
[
|
|
1361
|
+
vt,
|
|
1362
|
+
gn,
|
|
1363
|
+
nn,
|
|
1439
1364
|
rn,
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
rt,
|
|
1454
|
-
Fe,
|
|
1455
|
-
tt,
|
|
1456
|
-
it
|
|
1365
|
+
on,
|
|
1366
|
+
ze,
|
|
1367
|
+
an,
|
|
1368
|
+
sn,
|
|
1369
|
+
wt,
|
|
1370
|
+
qt,
|
|
1371
|
+
Wi,
|
|
1372
|
+
Xt,
|
|
1373
|
+
mn,
|
|
1374
|
+
dn,
|
|
1375
|
+
Xe,
|
|
1376
|
+
cn,
|
|
1377
|
+
ln
|
|
1457
1378
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
1458
1379
|
}
|
|
1459
1380
|
_initShortcuts() {
|
|
1460
1381
|
[
|
|
1461
1382
|
// sheet drawing shortcuts
|
|
1462
|
-
Li,
|
|
1463
|
-
Fi,
|
|
1464
|
-
Bi,
|
|
1465
1383
|
Gi,
|
|
1466
|
-
|
|
1384
|
+
Vi,
|
|
1385
|
+
ji,
|
|
1386
|
+
$i,
|
|
1387
|
+
zi
|
|
1467
1388
|
].forEach((i) => {
|
|
1468
1389
|
this.disposeWithMe(this._shortcutService.registerShortcut(i));
|
|
1469
1390
|
});
|
|
@@ -1472,22 +1393,22 @@ let qe = class extends Ue {
|
|
|
1472
1393
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
1473
1394
|
}
|
|
1474
1395
|
};
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
],
|
|
1483
|
-
var
|
|
1484
|
-
for (var
|
|
1485
|
-
(a = i[
|
|
1486
|
-
return
|
|
1487
|
-
}, de = (i, e) => (
|
|
1488
|
-
let
|
|
1489
|
-
constructor(i, e, n,
|
|
1490
|
-
super(), this._context = i, this._commandService = e, this._textSelectionManagerService =
|
|
1396
|
+
et = Ki([
|
|
1397
|
+
at(st.Ready, et),
|
|
1398
|
+
He(0, pe(kt)),
|
|
1399
|
+
He(1, pe(ni)),
|
|
1400
|
+
He(2, ii),
|
|
1401
|
+
He(3, $),
|
|
1402
|
+
He(4, ri)
|
|
1403
|
+
], et);
|
|
1404
|
+
var Yi = Object.defineProperty, Zi = Object.getOwnPropertyDescriptor, Qi = (i, e, t, n) => {
|
|
1405
|
+
for (var r = n > 1 ? void 0 : n ? Zi(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
1406
|
+
(a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
|
|
1407
|
+
return n && r && Yi(e, t, r), r;
|
|
1408
|
+
}, de = (i, e) => (t, n) => e(t, n, i);
|
|
1409
|
+
let ut = class extends qe {
|
|
1410
|
+
constructor(i, e, t, n, r, o, a, s, l, c, m, u, f) {
|
|
1411
|
+
super(), this._context = i, this._commandService = e, this._textSelectionManagerService = t, this._renderManagerSrv = n, this._imageIoService = r, this._docDrawingService = o, this._drawingManagerService = a, this._contextService = s, this._messageService = l, this._localeService = c, this._textSelectionManager = m, this._textSelectionRenderManager = u, this._docRefreshDrawingsService = f, this._initCommandListeners(), this._updateDrawingListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener(), this._editAreaChangeListener();
|
|
1491
1412
|
}
|
|
1492
1413
|
/**
|
|
1493
1414
|
* Upload image to cell or float image
|
|
@@ -1495,19 +1416,19 @@ let ln = class extends Ue {
|
|
|
1495
1416
|
_initCommandListeners() {
|
|
1496
1417
|
this.disposeWithMe(
|
|
1497
1418
|
this._commandService.onCommandExecuted(async (i) => {
|
|
1498
|
-
if (i.id ===
|
|
1419
|
+
if (i.id === vt.id) {
|
|
1499
1420
|
const e = i.params;
|
|
1500
1421
|
if (e.files == null)
|
|
1501
1422
|
return;
|
|
1502
|
-
const
|
|
1503
|
-
if (
|
|
1423
|
+
const t = e.files.length;
|
|
1424
|
+
if (t > St) {
|
|
1504
1425
|
this._messageService.show({
|
|
1505
|
-
type:
|
|
1506
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(
|
|
1426
|
+
type: Nt.Error,
|
|
1427
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(St))
|
|
1507
1428
|
});
|
|
1508
1429
|
return;
|
|
1509
1430
|
}
|
|
1510
|
-
this._imageIoService.setWaitCount(
|
|
1431
|
+
this._imageIoService.setWaitCount(t), await this._insertFloatImages(e.files);
|
|
1511
1432
|
}
|
|
1512
1433
|
})
|
|
1513
1434
|
);
|
|
@@ -1516,64 +1437,76 @@ let ln = class extends Ue {
|
|
|
1516
1437
|
async _insertFloatImages(i) {
|
|
1517
1438
|
let e = [];
|
|
1518
1439
|
try {
|
|
1519
|
-
e = await Promise.all(i.map((
|
|
1520
|
-
} catch (
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1440
|
+
e = await Promise.all(i.map((r) => this._imageIoService.saveImage(r)));
|
|
1441
|
+
} catch (r) {
|
|
1442
|
+
const o = r.message;
|
|
1443
|
+
let a = "";
|
|
1444
|
+
switch (o) {
|
|
1445
|
+
case mt.ERROR_EXCEED_SIZE:
|
|
1446
|
+
a = this._localeService.t("update-status.exceedMaxSize", String(Ln / (1024 * 1024)));
|
|
1447
|
+
break;
|
|
1448
|
+
case mt.ERROR_IMAGE_TYPE:
|
|
1449
|
+
a = this._localeService.t("update-status.invalidImageType");
|
|
1450
|
+
break;
|
|
1451
|
+
case mt.ERROR_IMAGE:
|
|
1452
|
+
a = this._localeService.t("update-status.invalidImage");
|
|
1453
|
+
break;
|
|
1454
|
+
}
|
|
1455
|
+
this._messageService.show({
|
|
1456
|
+
type: Nt.Error,
|
|
1457
|
+
content: a
|
|
1531
1458
|
});
|
|
1532
1459
|
}
|
|
1533
1460
|
if (e.length === 0)
|
|
1534
1461
|
return;
|
|
1535
|
-
const { unitId:
|
|
1536
|
-
for (const
|
|
1537
|
-
if (
|
|
1462
|
+
const { unitId: t } = this._context, n = [];
|
|
1463
|
+
for (const r of e) {
|
|
1464
|
+
if (r == null)
|
|
1538
1465
|
continue;
|
|
1539
|
-
const { imageId:
|
|
1540
|
-
this._imageIoService.addImageSourceCache(
|
|
1541
|
-
let
|
|
1542
|
-
if (c >
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1466
|
+
const { imageId: o, imageSourceType: a, source: s, base64Cache: l } = r, { width: c, height: m, image: u } = await Un(l || "");
|
|
1467
|
+
this._imageIoService.addImageSourceCache(o, a, u);
|
|
1468
|
+
let f = 1;
|
|
1469
|
+
if (c > Dt || m > Et) {
|
|
1470
|
+
const v = Dt / c, I = Et / m;
|
|
1471
|
+
f = Math.min(v, I);
|
|
1545
1472
|
}
|
|
1546
|
-
const
|
|
1547
|
-
if (
|
|
1473
|
+
const h = this._getImagePosition(c * f, m * f);
|
|
1474
|
+
if (h == null)
|
|
1548
1475
|
return;
|
|
1549
|
-
const
|
|
1550
|
-
unitId:
|
|
1551
|
-
subUnitId:
|
|
1552
|
-
drawingId:
|
|
1553
|
-
drawingType:
|
|
1476
|
+
const p = {
|
|
1477
|
+
unitId: t,
|
|
1478
|
+
subUnitId: t,
|
|
1479
|
+
drawingId: o,
|
|
1480
|
+
drawingType: Bn.DRAWING_IMAGE,
|
|
1554
1481
|
imageSourceType: a,
|
|
1555
1482
|
source: s,
|
|
1556
|
-
transform:
|
|
1557
|
-
docTransform:
|
|
1558
|
-
behindDoc:
|
|
1483
|
+
transform: Kn(h),
|
|
1484
|
+
docTransform: h,
|
|
1485
|
+
behindDoc: oe.FALSE,
|
|
1559
1486
|
title: "",
|
|
1560
1487
|
description: "",
|
|
1561
|
-
layoutType:
|
|
1562
|
-
|
|
1488
|
+
layoutType: k.INLINE,
|
|
1489
|
+
// Insert inline drawing by default.
|
|
1490
|
+
wrapText: je.BOTH_SIDES,
|
|
1563
1491
|
distB: 0,
|
|
1564
1492
|
distL: 0,
|
|
1565
1493
|
distR: 0,
|
|
1566
1494
|
distT: 0
|
|
1567
1495
|
};
|
|
1568
|
-
|
|
1496
|
+
this._isInsertInHeaderFooter() && (p.isMultiTransform = oe.TRUE, p.transforms = p.transform ? [p.transform] : null), n.push(p);
|
|
1569
1497
|
}
|
|
1570
|
-
this._commandService.executeCommand(
|
|
1571
|
-
unitId:
|
|
1572
|
-
drawings:
|
|
1498
|
+
this._commandService.executeCommand(gn.id, {
|
|
1499
|
+
unitId: t,
|
|
1500
|
+
drawings: n
|
|
1573
1501
|
});
|
|
1574
1502
|
}
|
|
1503
|
+
_isInsertInHeaderFooter() {
|
|
1504
|
+
var n;
|
|
1505
|
+
const { unitId: i } = this._context, e = (n = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : n.with(ae).getViewModel(), t = e == null ? void 0 : e.getEditArea();
|
|
1506
|
+
return t === xe.HEADER || t === xe.FOOTER;
|
|
1507
|
+
}
|
|
1575
1508
|
_getImagePosition(i, e) {
|
|
1576
|
-
const
|
|
1509
|
+
const t = this._textSelectionManagerService.getActiveTextRange(), n = (t == null ? void 0 : t.getAbsolutePosition()) || {
|
|
1577
1510
|
left: 0,
|
|
1578
1511
|
top: 0
|
|
1579
1512
|
};
|
|
@@ -1583,139 +1516,160 @@ let ln = class extends Ue {
|
|
|
1583
1516
|
height: e
|
|
1584
1517
|
},
|
|
1585
1518
|
positionH: {
|
|
1586
|
-
relativeFrom:
|
|
1587
|
-
posOffset:
|
|
1519
|
+
relativeFrom: ee.PAGE,
|
|
1520
|
+
posOffset: n.left
|
|
1588
1521
|
},
|
|
1589
1522
|
positionV: {
|
|
1590
|
-
relativeFrom:
|
|
1591
|
-
posOffset:
|
|
1523
|
+
relativeFrom: V.MARGIN,
|
|
1524
|
+
posOffset: n.top
|
|
1592
1525
|
},
|
|
1593
1526
|
angle: 0
|
|
1594
1527
|
};
|
|
1595
1528
|
}
|
|
1596
1529
|
_updateOrderListener() {
|
|
1597
1530
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((i) => {
|
|
1598
|
-
const { unitId: e, subUnitId:
|
|
1599
|
-
this._commandService.executeCommand(
|
|
1531
|
+
const { unitId: e, subUnitId: t, drawingIds: n, arrangeType: r } = i;
|
|
1532
|
+
this._commandService.executeCommand(ln.id, {
|
|
1600
1533
|
unitId: e,
|
|
1601
|
-
subUnitId:
|
|
1602
|
-
drawingIds:
|
|
1603
|
-
arrangeType:
|
|
1534
|
+
subUnitId: t,
|
|
1535
|
+
drawingIds: n,
|
|
1536
|
+
arrangeType: r
|
|
1604
1537
|
});
|
|
1605
1538
|
});
|
|
1606
1539
|
}
|
|
1607
1540
|
_updateDrawingListener() {
|
|
1608
1541
|
this._drawingManagerService.featurePluginUpdate$.subscribe((i) => {
|
|
1609
|
-
if (i.length === 0)
|
|
1610
|
-
return;
|
|
1611
|
-
const e = [];
|
|
1612
|
-
if (i.forEach((n) => {
|
|
1613
|
-
const { unitId: t, subUnitId: o, drawingId: r, transform: a } = n;
|
|
1614
|
-
if (a == null)
|
|
1615
|
-
return;
|
|
1616
|
-
const s = this._docDrawingService.getDrawingByParam({ unitId: t, subUnitId: o, drawingId: r });
|
|
1617
|
-
if (s == null)
|
|
1618
|
-
return;
|
|
1619
|
-
const l = Vt({ ...s.transform, ...a });
|
|
1620
|
-
if (l == null)
|
|
1621
|
-
return;
|
|
1622
|
-
const c = {
|
|
1623
|
-
...n,
|
|
1624
|
-
transform: { ...a, ...Tn(l) },
|
|
1625
|
-
docTransform: { ...l }
|
|
1626
|
-
};
|
|
1627
|
-
e.push(c);
|
|
1628
|
-
}), e.length > 0) {
|
|
1629
|
-
const n = i[0].unitId;
|
|
1630
|
-
this._commandService.syncExecuteCommand(ot.id, {
|
|
1631
|
-
unitId: n,
|
|
1632
|
-
drawings: e
|
|
1633
|
-
}), this._refreshDocSkeleton();
|
|
1634
|
-
}
|
|
1635
1542
|
});
|
|
1636
1543
|
}
|
|
1637
|
-
_refreshDocSkeleton() {
|
|
1638
|
-
var t;
|
|
1639
|
-
const { mainComponent: i, unitId: e } = this._context, n = (t = this._renderManagerSrv.getRenderById(e)) == null ? void 0 : t.with(me).getSkeleton();
|
|
1640
|
-
n == null || n.calculate(), i == null || i.makeDirty();
|
|
1641
|
-
}
|
|
1642
1544
|
_groupDrawingListener() {
|
|
1643
1545
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((i) => {
|
|
1644
|
-
this._commandService.executeCommand(
|
|
1546
|
+
this._commandService.executeCommand(mn.id, i);
|
|
1645
1547
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((i) => {
|
|
1646
|
-
this._commandService.executeCommand(
|
|
1548
|
+
this._commandService.executeCommand(dn.id, i);
|
|
1647
1549
|
});
|
|
1648
1550
|
}
|
|
1649
1551
|
_getCurrentSceneAndTransformer() {
|
|
1650
1552
|
const { scene: i, mainComponent: e } = this._context;
|
|
1651
1553
|
if (i == null || e == null)
|
|
1652
1554
|
return;
|
|
1653
|
-
const
|
|
1654
|
-
return { scene: i, transformer:
|
|
1555
|
+
const t = i.getTransformerByCreate(), { docsLeft: n, docsTop: r } = e.getOffsetConfig();
|
|
1556
|
+
return { scene: i, transformer: t, docsLeft: n, docsTop: r };
|
|
1655
1557
|
}
|
|
1656
1558
|
_focusDrawingListener() {
|
|
1657
1559
|
this.disposeWithMe(
|
|
1658
1560
|
this._drawingManagerService.focus$.subscribe((i) => {
|
|
1659
|
-
var
|
|
1660
|
-
const { transformer: e, docsLeft:
|
|
1661
|
-
i == null || i.length === 0
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1561
|
+
var r;
|
|
1562
|
+
const { transformer: e, docsLeft: t, docsTop: n } = (r = this._getCurrentSceneAndTransformer()) != null ? r : {};
|
|
1563
|
+
if (i == null || i.length === 0)
|
|
1564
|
+
this._contextService.setContextValue(it, !1), this._docDrawingService.focusDrawing([]), e && e.resetProps({
|
|
1565
|
+
zeroTop: 0,
|
|
1566
|
+
zeroLeft: 0
|
|
1567
|
+
});
|
|
1568
|
+
else {
|
|
1569
|
+
this._contextService.setContextValue(it, !0), this._docDrawingService.focusDrawing(i), this._textSelectionManager.getActiveTextRange() && this._textSelectionManager.replaceTextRanges([]);
|
|
1570
|
+
const a = this._textSelectionRenderManager.getSegment(), s = this._findSegmentIdByDrawingId(i[0].drawingId);
|
|
1571
|
+
a !== s && this._textSelectionRenderManager.setSegment(s), e && e.resetProps({
|
|
1572
|
+
zeroTop: n,
|
|
1573
|
+
zeroLeft: t
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1668
1576
|
})
|
|
1669
1577
|
);
|
|
1670
1578
|
}
|
|
1579
|
+
_findSegmentIdByDrawingId(i) {
|
|
1580
|
+
var a, s, l;
|
|
1581
|
+
const { unit: e } = this._context, { body: t, headers: n = {}, footers: r = {} } = e.getSnapshot();
|
|
1582
|
+
if (((a = t == null ? void 0 : t.customBlocks) != null ? a : []).some((c) => c.blockId === i))
|
|
1583
|
+
return "";
|
|
1584
|
+
for (const c of Object.keys(n))
|
|
1585
|
+
if ((s = n[c].body.customBlocks) != null && s.some((m) => m.blockId === i))
|
|
1586
|
+
return c;
|
|
1587
|
+
for (const c of Object.keys(r))
|
|
1588
|
+
if ((l = r[c].body.customBlocks) != null && l.some((m) => m.blockId === i))
|
|
1589
|
+
return c;
|
|
1590
|
+
return "";
|
|
1591
|
+
}
|
|
1592
|
+
// Update drawings edit status and opacity. You can not edit header footer images when you are editing body. and vice verse.
|
|
1593
|
+
_updateDrawingsEditStatus() {
|
|
1594
|
+
var s;
|
|
1595
|
+
const { unit: i, scene: e, unitId: t } = this._context, n = (s = this._renderManagerSrv.getRenderById(t)) == null ? void 0 : s.with(ae).getViewModel();
|
|
1596
|
+
if (n == null || i == null)
|
|
1597
|
+
return;
|
|
1598
|
+
const r = i.getSnapshot(), { drawings: o = {} } = r, a = n.getEditArea() === xe.BODY;
|
|
1599
|
+
for (const l of Object.keys(o)) {
|
|
1600
|
+
const c = o[l], m = Fn({ unitId: t, drawingId: c.drawingId, subUnitId: t }), u = e.fuzzyMathObjects(m, !0);
|
|
1601
|
+
if (u.length)
|
|
1602
|
+
for (const f of u)
|
|
1603
|
+
e.detachTransformerFrom(f), f.setOpacity(0.5), (a && c.isMultiTransform !== oe.TRUE || !a && c.isMultiTransform === oe.TRUE) && (e.attachTransformerTo(f), f.setOpacity(1));
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
_editAreaChangeListener() {
|
|
1607
|
+
var t;
|
|
1608
|
+
const { unitId: i } = this._context, e = (t = this._renderManagerSrv.getRenderById(i)) == null ? void 0 : t.with(ae).getViewModel();
|
|
1609
|
+
e != null && (this._updateDrawingsEditStatus(), this.disposeWithMe(
|
|
1610
|
+
e.editAreaChange$.subscribe(() => {
|
|
1611
|
+
this._updateDrawingsEditStatus();
|
|
1612
|
+
})
|
|
1613
|
+
), this._docRefreshDrawingsService.refreshDrawings$.subscribe((n) => {
|
|
1614
|
+
n != null && queueMicrotask(() => {
|
|
1615
|
+
this._updateDrawingsEditStatus();
|
|
1616
|
+
});
|
|
1617
|
+
}), this.disposeWithMe(
|
|
1618
|
+
this._commandService.onCommandExecuted(async (n) => {
|
|
1619
|
+
n.id === Q.id && queueMicrotask(() => {
|
|
1620
|
+
this._updateDrawingsEditStatus();
|
|
1621
|
+
});
|
|
1622
|
+
})
|
|
1623
|
+
));
|
|
1624
|
+
}
|
|
1671
1625
|
};
|
|
1672
|
-
|
|
1673
|
-
de(1,
|
|
1674
|
-
de(2,
|
|
1675
|
-
de(3,
|
|
1676
|
-
de(4,
|
|
1677
|
-
de(5,
|
|
1678
|
-
de(6,
|
|
1679
|
-
de(7,
|
|
1680
|
-
de(8,
|
|
1681
|
-
de(9,
|
|
1682
|
-
de(10,
|
|
1683
|
-
de(11,
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1626
|
+
ut = Qi([
|
|
1627
|
+
de(1, $),
|
|
1628
|
+
de(2, pe(gt)),
|
|
1629
|
+
de(3, se),
|
|
1630
|
+
de(4, kn),
|
|
1631
|
+
de(5, Re),
|
|
1632
|
+
de(6, he),
|
|
1633
|
+
de(7, Bt),
|
|
1634
|
+
de(8, oi),
|
|
1635
|
+
de(9, pe(ot)),
|
|
1636
|
+
de(10, pe(gt)),
|
|
1637
|
+
de(11, Ue),
|
|
1638
|
+
de(12, pe(ct))
|
|
1639
|
+
], ut);
|
|
1640
|
+
var Ji = Object.defineProperty, er = Object.getOwnPropertyDescriptor, tr = (i, e, t, n) => {
|
|
1641
|
+
for (var r = n > 1 ? void 0 : n ? er(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
1642
|
+
(a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
|
|
1643
|
+
return n && r && Ji(e, t, r), r;
|
|
1644
|
+
}, We = (i, e) => (t, n) => e(t, n, i);
|
|
1645
|
+
let ft = class extends qe {
|
|
1646
|
+
constructor(e, t, n, r, o, a) {
|
|
1692
1647
|
super();
|
|
1693
|
-
|
|
1694
|
-
this._context = e, this._docSkeletonManagerService =
|
|
1648
|
+
_e(this, "_liquid", new Ht());
|
|
1649
|
+
this._context = e, this._docSkeletonManagerService = t, this._commandService = n, this._editorService = r, this._drawingManagerService = o, this._docRefreshDrawingsService = a, this._initialize(), this._commandExecutedListener();
|
|
1695
1650
|
}
|
|
1696
1651
|
_initialize() {
|
|
1697
1652
|
this._initialRenderRefresh();
|
|
1698
1653
|
}
|
|
1699
1654
|
_initialRenderRefresh() {
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
e.changeSkeleton(n), this._refreshDrawing(n);
|
|
1655
|
+
this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
|
|
1656
|
+
e != null && this._refreshDrawing(e);
|
|
1657
|
+
}), this._docRefreshDrawingsService.refreshDrawings$.subscribe((e) => {
|
|
1658
|
+
e != null && this._refreshDrawing(e);
|
|
1705
1659
|
});
|
|
1706
1660
|
}
|
|
1707
1661
|
_commandExecutedListener() {
|
|
1708
|
-
const e = [
|
|
1662
|
+
const e = [Q.id, Zn.id];
|
|
1709
1663
|
this.disposeWithMe(
|
|
1710
|
-
this._commandService.onCommandExecuted((
|
|
1711
|
-
if (e.includes(
|
|
1712
|
-
const
|
|
1713
|
-
if (
|
|
1664
|
+
this._commandService.onCommandExecuted((t) => {
|
|
1665
|
+
if (e.includes(t.id)) {
|
|
1666
|
+
const n = t.params, { unitId: r } = n, { unitId: o, mainComponent: a } = this._context;
|
|
1667
|
+
if (r !== o)
|
|
1714
1668
|
return;
|
|
1715
1669
|
const s = this._docSkeletonManagerService.getSkeleton();
|
|
1716
1670
|
if (s == null)
|
|
1717
1671
|
return;
|
|
1718
|
-
if (this._editorService.isEditor(
|
|
1672
|
+
if (this._editorService.isEditor(o)) {
|
|
1719
1673
|
a == null || a.makeDirty();
|
|
1720
1674
|
return;
|
|
1721
1675
|
}
|
|
@@ -1725,88 +1679,127 @@ let dn = class extends Ue {
|
|
|
1725
1679
|
);
|
|
1726
1680
|
}
|
|
1727
1681
|
_refreshDrawing(e) {
|
|
1728
|
-
var
|
|
1729
|
-
const
|
|
1730
|
-
if (!
|
|
1682
|
+
var D, _;
|
|
1683
|
+
const t = e == null ? void 0 : e.getSkeletonData(), { mainComponent: n, unitId: r } = this._context, o = n;
|
|
1684
|
+
if (!t)
|
|
1731
1685
|
return;
|
|
1732
|
-
const { left: a, top: s, pageLayoutType: l, pageMarginLeft: c, pageMarginTop: m } =
|
|
1686
|
+
const { left: a, top: s, pageLayoutType: l, pageMarginLeft: c, pageMarginTop: m } = o, { pages: u, skeHeaders: f, skeFooters: h } = t, p = {};
|
|
1733
1687
|
this._liquid.reset();
|
|
1734
|
-
for (let
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1737
|
-
const
|
|
1738
|
-
|
|
1688
|
+
for (let C = 0, O = u.length; C < O; C++) {
|
|
1689
|
+
const y = u[C], { headerId: T, footerId: N, pageWidth: R } = y;
|
|
1690
|
+
if (T) {
|
|
1691
|
+
const E = (D = f.get(T)) == null ? void 0 : D.get(R);
|
|
1692
|
+
E && this._calculateDrawingPosition(
|
|
1693
|
+
r,
|
|
1694
|
+
E,
|
|
1695
|
+
a,
|
|
1696
|
+
s,
|
|
1697
|
+
p,
|
|
1698
|
+
E.marginTop,
|
|
1699
|
+
y.marginLeft
|
|
1700
|
+
);
|
|
1739
1701
|
}
|
|
1740
|
-
if (
|
|
1741
|
-
const
|
|
1742
|
-
|
|
1702
|
+
if (N) {
|
|
1703
|
+
const E = (_ = h.get(N)) == null ? void 0 : _.get(R);
|
|
1704
|
+
E && this._calculateDrawingPosition(
|
|
1705
|
+
r,
|
|
1706
|
+
E,
|
|
1707
|
+
a,
|
|
1708
|
+
s,
|
|
1709
|
+
p,
|
|
1710
|
+
y.pageHeight - y.marginBottom + E.marginTop,
|
|
1711
|
+
y.marginLeft
|
|
1712
|
+
);
|
|
1743
1713
|
}
|
|
1744
|
-
this._calculateDrawingPosition(
|
|
1714
|
+
this._calculateDrawingPosition(r, y, a, s, p, y.marginTop, y.marginLeft), this._liquid.translatePage(y, l, c, m);
|
|
1715
|
+
}
|
|
1716
|
+
const w = Object.values(p), v = w.filter((C) => !C.isMultiTransform), I = w.filter((C) => C.isMultiTransform);
|
|
1717
|
+
v.length > 0 && this._drawingManagerService.refreshTransform(v), I.length > 0 && this._handleMultiDrawingsTransform(I);
|
|
1718
|
+
}
|
|
1719
|
+
_handleMultiDrawingsTransform(e) {
|
|
1720
|
+
const { scene: t, unitId: n } = this._context, r = t.getTransformerByCreate();
|
|
1721
|
+
e.forEach((l) => {
|
|
1722
|
+
const c = this._drawingManagerService.getDrawingByParam(l);
|
|
1723
|
+
c != null && (c.transform = l.transform, c.transforms = l.transforms, c.isMultiTransform = l.isMultiTransform);
|
|
1724
|
+
});
|
|
1725
|
+
const a = [...r.getSelectedObjectMap().keys()], s = Object.values(this._drawingManagerService.getDrawingData(n, n)).filter((l) => l.isMultiTransform === oe.TRUE);
|
|
1726
|
+
this._drawingManagerService.removeNotification(s), this._drawingManagerService.addNotification(e);
|
|
1727
|
+
for (const l of a) {
|
|
1728
|
+
const c = t.getObject(l);
|
|
1729
|
+
c && r.setSelectedControl(c);
|
|
1745
1730
|
}
|
|
1746
|
-
g.length > 0 && this._drawingManagerService.refreshTransform(g);
|
|
1747
1731
|
}
|
|
1748
|
-
_calculateDrawingPosition(e, n,
|
|
1749
|
-
const { skeDrawings:
|
|
1750
|
-
this._liquid.translatePagePadding(
|
|
1751
|
-
|
|
1752
|
-
|
|
1732
|
+
_calculateDrawingPosition(e, t, n, r, o, a, s) {
|
|
1733
|
+
const { skeDrawings: l } = t;
|
|
1734
|
+
this._liquid.translatePagePadding({
|
|
1735
|
+
marginTop: a,
|
|
1736
|
+
marginLeft: s
|
|
1737
|
+
}), l.forEach((c) => {
|
|
1738
|
+
const { aLeft: m, aTop: u, height: f, width: h, angle: p, drawingId: w, drawingOrigin: v } = c, I = v.layoutType === k.WRAP_NONE && v.behindDoc === oe.TRUE, { isMultiTransform: D = oe.FALSE } = v, _ = {
|
|
1739
|
+
left: m + n + this._liquid.x,
|
|
1740
|
+
top: u + r + this._liquid.y,
|
|
1741
|
+
width: h,
|
|
1742
|
+
height: f,
|
|
1743
|
+
angle: p
|
|
1744
|
+
};
|
|
1745
|
+
o[w] == null ? o[w] = {
|
|
1753
1746
|
unitId: e,
|
|
1754
1747
|
subUnitId: e,
|
|
1755
|
-
drawingId:
|
|
1756
|
-
behindText:
|
|
1757
|
-
transform:
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
}), this._liquid.restorePagePadding(n);
|
|
1748
|
+
drawingId: w,
|
|
1749
|
+
behindText: I,
|
|
1750
|
+
transform: _,
|
|
1751
|
+
transforms: [_],
|
|
1752
|
+
isMultiTransform: D
|
|
1753
|
+
} : D === oe.TRUE && o[w].transforms.push(_);
|
|
1754
|
+
}), this._liquid.restorePagePadding({
|
|
1755
|
+
marginTop: a,
|
|
1756
|
+
marginLeft: s
|
|
1757
|
+
});
|
|
1766
1758
|
}
|
|
1767
1759
|
};
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1760
|
+
ft = tr([
|
|
1761
|
+
We(1, pe(ae)),
|
|
1762
|
+
We(2, $),
|
|
1763
|
+
We(3, ai),
|
|
1764
|
+
We(4, he),
|
|
1765
|
+
We(5, pe(ct))
|
|
1766
|
+
], ft);
|
|
1767
|
+
var nr = Object.defineProperty, ir = Object.getOwnPropertyDescriptor, rr = (i, e, t, n) => {
|
|
1768
|
+
for (var r = n > 1 ? void 0 : n ? ir(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
1769
|
+
(a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
|
|
1770
|
+
return n && r && nr(e, t, r), r;
|
|
1771
|
+
}, Ge = (i, e) => (t, n) => e(t, n, i);
|
|
1772
|
+
function or(i) {
|
|
1773
|
+
var n, r, o, a;
|
|
1774
|
+
if (X.isNoop(i) || !Array.isArray(i))
|
|
1782
1775
|
return null;
|
|
1783
1776
|
const e = i.find((s) => Array.isArray(s) && (s == null ? void 0 : s[0]) === "drawings");
|
|
1784
1777
|
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")
|
|
1785
1778
|
return null;
|
|
1786
|
-
const
|
|
1779
|
+
const t = [];
|
|
1787
1780
|
if (Array.isArray(e == null ? void 0 : e[1]))
|
|
1788
1781
|
for (const s of e)
|
|
1789
|
-
Array.isArray(s) &&
|
|
1790
|
-
type: (
|
|
1782
|
+
Array.isArray(s) && t.push({
|
|
1783
|
+
type: (n = s == null ? void 0 : s[1]) != null && n.i ? "add" : "remove",
|
|
1791
1784
|
drawingId: s == null ? void 0 : s[0],
|
|
1792
|
-
drawing: (
|
|
1785
|
+
drawing: (r = s == null ? void 0 : s[1]) == null ? void 0 : r.i
|
|
1793
1786
|
});
|
|
1794
1787
|
else
|
|
1795
|
-
|
|
1796
|
-
type: (
|
|
1788
|
+
t.push({
|
|
1789
|
+
type: (o = e[2]) != null && o.i ? "add" : "remove",
|
|
1797
1790
|
drawingId: e[1],
|
|
1798
1791
|
drawing: (a = e[2]) == null ? void 0 : a.i
|
|
1799
1792
|
});
|
|
1800
|
-
return
|
|
1793
|
+
return t;
|
|
1801
1794
|
}
|
|
1802
|
-
function
|
|
1795
|
+
function ar(i) {
|
|
1803
1796
|
if (!Array.isArray(i) || i.length < 3 || i[0] !== "drawingsOrder")
|
|
1804
1797
|
return [];
|
|
1805
1798
|
const e = [];
|
|
1806
|
-
for (let
|
|
1807
|
-
const
|
|
1808
|
-
if (Array.isArray(
|
|
1809
|
-
e.push(
|
|
1799
|
+
for (let t = 1; t < i.length; t++) {
|
|
1800
|
+
const n = i[t];
|
|
1801
|
+
if (Array.isArray(n) && typeof n[0] == "number" && typeof n[1] == "object")
|
|
1802
|
+
e.push(n[0]);
|
|
1810
1803
|
else {
|
|
1811
1804
|
e.length = 0;
|
|
1812
1805
|
break;
|
|
@@ -1814,9 +1807,9 @@ function eo(i) {
|
|
|
1814
1807
|
}
|
|
1815
1808
|
return e;
|
|
1816
1809
|
}
|
|
1817
|
-
let
|
|
1818
|
-
constructor(i, e,
|
|
1819
|
-
super(), this._univerInstanceService = i, this._commandService = e, this._drawingManagerService =
|
|
1810
|
+
let tt = class extends qe {
|
|
1811
|
+
constructor(i, e, t, n, r) {
|
|
1812
|
+
super(), this._univerInstanceService = i, this._commandService = e, this._drawingManagerService = t, this._docDrawingService = n, this._renderManagerService = r, this._initialize();
|
|
1820
1813
|
}
|
|
1821
1814
|
_initialize() {
|
|
1822
1815
|
this._commandExecutedListener();
|
|
@@ -1824,87 +1817,87 @@ let Ke = class extends Ue {
|
|
|
1824
1817
|
_commandExecutedListener() {
|
|
1825
1818
|
this.disposeWithMe(
|
|
1826
1819
|
this._commandService.beforeCommandExecuted((i) => {
|
|
1827
|
-
if (i.id !==
|
|
1820
|
+
if (i.id !== Q.id)
|
|
1828
1821
|
return;
|
|
1829
|
-
const e = i.params, { unitId:
|
|
1830
|
-
if (
|
|
1831
|
-
for (const { type:
|
|
1832
|
-
|
|
1822
|
+
const e = i.params, { unitId: t, actions: n } = e, r = or(n);
|
|
1823
|
+
if (r != null)
|
|
1824
|
+
for (const { type: o, drawingId: a, drawing: s } of r)
|
|
1825
|
+
o === "add" ? this._addDrawings(t, [s]) : this._removeDrawings(t, [a]);
|
|
1833
1826
|
})
|
|
1834
1827
|
), this.disposeWithMe(
|
|
1835
1828
|
this._commandService.onCommandExecuted((i) => {
|
|
1836
|
-
if (i.id !==
|
|
1829
|
+
if (i.id !== Q.id)
|
|
1837
1830
|
return;
|
|
1838
|
-
const e = i.params, { unitId:
|
|
1839
|
-
|
|
1831
|
+
const e = i.params, { unitId: t, actions: n } = e;
|
|
1832
|
+
ar(n).length > 0 && this._updateDrawingsOrder(t);
|
|
1840
1833
|
})
|
|
1841
1834
|
), this.disposeWithMe(
|
|
1842
1835
|
this._commandService.onCommandExecuted((i) => {
|
|
1843
1836
|
var a;
|
|
1844
|
-
if (i.id !==
|
|
1837
|
+
if (i.id !== Dn.id && i.id !== En.id)
|
|
1845
1838
|
return;
|
|
1846
|
-
const e = (a = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : a.getUnitId(),
|
|
1847
|
-
if (e == null ||
|
|
1839
|
+
const e = (a = this._univerInstanceService.getCurrentUniverDocInstance()) == null ? void 0 : a.getUnitId(), t = this._drawingManagerService.getFocusDrawings();
|
|
1840
|
+
if (e == null || t.length === 0)
|
|
1848
1841
|
return;
|
|
1849
|
-
const
|
|
1850
|
-
if (
|
|
1842
|
+
const n = this._renderManagerService.getRenderById(e), r = n == null ? void 0 : n.scene;
|
|
1843
|
+
if (r == null)
|
|
1851
1844
|
return !1;
|
|
1852
|
-
|
|
1845
|
+
r.getTransformerByCreate().refreshControls();
|
|
1853
1846
|
})
|
|
1854
1847
|
);
|
|
1855
1848
|
}
|
|
1856
1849
|
_addDrawings(i, e) {
|
|
1857
|
-
const
|
|
1858
|
-
|
|
1850
|
+
const t = this._drawingManagerService, n = this._docDrawingService, r = this._docDrawingService.getBatchAddOp(e), { subUnitId: o, redo: a, objects: s } = r;
|
|
1851
|
+
t.applyJson1(i, o, a), n.applyJson1(i, o, a), t.addNotification(s), n.addNotification(s);
|
|
1859
1852
|
}
|
|
1860
1853
|
_removeDrawings(i, e) {
|
|
1861
|
-
const
|
|
1854
|
+
const t = this._drawingManagerService, n = this._docDrawingService, r = this._docDrawingService.getBatchRemoveOp(e.map((l) => ({
|
|
1862
1855
|
unitId: i,
|
|
1863
1856
|
subUnitId: i,
|
|
1864
1857
|
drawingId: l
|
|
1865
|
-
}))), { subUnitId:
|
|
1866
|
-
|
|
1858
|
+
}))), { subUnitId: o, redo: a, objects: s } = r;
|
|
1859
|
+
t.applyJson1(i, o, a), n.applyJson1(i, o, a), t.removeNotification(s), n.removeNotification(s);
|
|
1867
1860
|
}
|
|
1868
1861
|
_updateDrawingsOrder(i) {
|
|
1869
1862
|
const e = this._univerInstanceService.getUniverDocInstance(i);
|
|
1870
1863
|
if (e == null)
|
|
1871
1864
|
return;
|
|
1872
|
-
const
|
|
1873
|
-
if (
|
|
1865
|
+
const t = e.getSnapshot().drawingsOrder;
|
|
1866
|
+
if (t == null)
|
|
1874
1867
|
return;
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1877
|
-
const
|
|
1868
|
+
const n = this._drawingManagerService, r = this._docDrawingService;
|
|
1869
|
+
n.setDrawingOrder(i, i, t), r.setDrawingOrder(i, i, t);
|
|
1870
|
+
const o = {
|
|
1878
1871
|
unitId: i,
|
|
1879
1872
|
subUnitId: i,
|
|
1880
|
-
drawingIds:
|
|
1873
|
+
drawingIds: t
|
|
1881
1874
|
};
|
|
1882
|
-
|
|
1875
|
+
n.orderNotification(o), r.orderNotification(o);
|
|
1883
1876
|
}
|
|
1884
1877
|
};
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
],
|
|
1893
|
-
var
|
|
1894
|
-
for (var
|
|
1895
|
-
(a = i[
|
|
1896
|
-
return
|
|
1897
|
-
},
|
|
1898
|
-
const
|
|
1899
|
-
let
|
|
1900
|
-
constructor(e, n,
|
|
1878
|
+
tt = rr([
|
|
1879
|
+
at(st.Steady, tt),
|
|
1880
|
+
Ge(0, te),
|
|
1881
|
+
Ge(1, $),
|
|
1882
|
+
Ge(2, he),
|
|
1883
|
+
Ge(3, Re),
|
|
1884
|
+
Ge(4, se)
|
|
1885
|
+
], tt);
|
|
1886
|
+
var sr = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, lr = (i, e, t, n) => {
|
|
1887
|
+
for (var r = n > 1 ? void 0 : n ? cr(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
1888
|
+
(a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
|
|
1889
|
+
return n && r && sr(e, t, r), r;
|
|
1890
|
+
}, Ve = (i, e) => (t, n) => e(t, n, i);
|
|
1891
|
+
const dr = "__InlineDrawingAnchor__";
|
|
1892
|
+
let nt = class extends qe {
|
|
1893
|
+
constructor(e, t, n, r, o) {
|
|
1901
1894
|
super();
|
|
1902
|
-
|
|
1903
|
-
|
|
1895
|
+
_e(this, "_liquid", new Ht());
|
|
1896
|
+
_e(this, "_listenerOnImageMap", /* @__PURE__ */ new Set());
|
|
1904
1897
|
// Use to cache the drawings is under transforming or scaling.
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
this._commandService = e, this._univerInstanceService =
|
|
1898
|
+
_e(this, "_transformerCache", /* @__PURE__ */ new Map());
|
|
1899
|
+
_e(this, "_anchorShape");
|
|
1900
|
+
this._commandService = e, this._univerInstanceService = t, this._drawingManagerService = n, this._renderManagerService = r, this._textSelectionRenderManager = o, this._init();
|
|
1908
1901
|
}
|
|
1909
1902
|
_init() {
|
|
1910
1903
|
this._listenDrawingFocus();
|
|
@@ -1913,9 +1906,9 @@ let Ye = class extends Ue {
|
|
|
1913
1906
|
this.disposeWithMe(
|
|
1914
1907
|
this._drawingManagerService.add$.subscribe((e) => {
|
|
1915
1908
|
if (e.length !== 0)
|
|
1916
|
-
for (const
|
|
1917
|
-
const { unitId:
|
|
1918
|
-
this._listenerOnImageMap.has(
|
|
1909
|
+
for (const t of e) {
|
|
1910
|
+
const { unitId: n } = t;
|
|
1911
|
+
this._listenerOnImageMap.has(n) || (this._listenTransformerChange(n), this._listenerOnImageMap.add(n));
|
|
1919
1912
|
}
|
|
1920
1913
|
})
|
|
1921
1914
|
);
|
|
@@ -1923,66 +1916,66 @@ let Ye = class extends Ue {
|
|
|
1923
1916
|
// Only handle one drawing transformer change.
|
|
1924
1917
|
// eslint-disable-next-line max-lines-per-function
|
|
1925
1918
|
_listenTransformerChange(e) {
|
|
1926
|
-
var
|
|
1927
|
-
const
|
|
1928
|
-
if (
|
|
1919
|
+
var r;
|
|
1920
|
+
const t = (r = this._getSceneAndTransformerByDrawingSearch(e)) == null ? void 0 : r.transformer;
|
|
1921
|
+
if (t == null)
|
|
1929
1922
|
return;
|
|
1930
1923
|
this.disposeWithMe(
|
|
1931
|
-
|
|
1932
|
-
|
|
1924
|
+
ye(
|
|
1925
|
+
t.changeStart$.subscribe((o) => {
|
|
1933
1926
|
var s;
|
|
1934
1927
|
this._transformerCache.clear();
|
|
1935
|
-
const { objects: a } =
|
|
1928
|
+
const { objects: a } = o;
|
|
1936
1929
|
for (const l of a.values()) {
|
|
1937
|
-
const { oKey: c, width: m, height: u, left:
|
|
1930
|
+
const { oKey: c, width: m, height: u, left: f, top: h, angle: p } = l, w = this._drawingManagerService.getDrawingOKey(c);
|
|
1938
1931
|
if (w == null)
|
|
1939
1932
|
continue;
|
|
1940
1933
|
const v = this._univerInstanceService.getUniverDocInstance(w.unitId), I = (s = v == null ? void 0 : v.getSnapshot().drawings) == null ? void 0 : s[w.drawingId];
|
|
1941
|
-
(I == null ? void 0 : I.layoutType) ===
|
|
1934
|
+
(I == null ? void 0 : I.layoutType) === k.INLINE && l.setOpacity(0.2), I != null && this._transformerCache.set(w.drawingId, {
|
|
1942
1935
|
drawing: I,
|
|
1943
|
-
top:
|
|
1944
|
-
left:
|
|
1936
|
+
top: h,
|
|
1937
|
+
left: f,
|
|
1945
1938
|
width: m,
|
|
1946
1939
|
height: u,
|
|
1947
|
-
angle:
|
|
1940
|
+
angle: p
|
|
1948
1941
|
});
|
|
1949
1942
|
}
|
|
1950
1943
|
})
|
|
1951
1944
|
)
|
|
1952
1945
|
);
|
|
1953
|
-
const
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
const { objects: a, offsetX: s, offsetY: l } =
|
|
1946
|
+
const n = Ct(this._updateMultipleDrawingDocTransform.bind(this), 50);
|
|
1947
|
+
Ct(this._nonInlineDrawingTransform.bind(this), 50), this.disposeWithMe(
|
|
1948
|
+
ye(
|
|
1949
|
+
t.changing$.subscribe((o) => {
|
|
1950
|
+
const { objects: a, offsetX: s, offsetY: l } = o;
|
|
1958
1951
|
if (a.size > 1)
|
|
1959
|
-
|
|
1952
|
+
n(a);
|
|
1960
1953
|
else if (a.size === 1) {
|
|
1961
|
-
const c = this._transformerCache.values().next().value, m = a.values().next().value, { width: u, height:
|
|
1962
|
-
if (u === c.width &&
|
|
1954
|
+
const c = this._transformerCache.values().next().value, m = a.values().next().value, { width: u, height: f, top: h, left: p, angle: w } = m;
|
|
1955
|
+
if (u === c.width && f === c.height && h === c.top && p === c.left && w === c.angle)
|
|
1963
1956
|
return;
|
|
1964
|
-
c && (c.drawing.layoutType,
|
|
1957
|
+
c && (c.drawing.layoutType, k.INLINE), c && c.drawing.layoutType === k.INLINE && s != null && l != null && this._updateInlineDrawingAnchor(c.drawing, s, l);
|
|
1965
1958
|
}
|
|
1966
1959
|
})
|
|
1967
1960
|
)
|
|
1968
1961
|
), this.disposeWithMe(
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
const { objects: a, offsetX: s, offsetY: l } =
|
|
1962
|
+
ye(
|
|
1963
|
+
t.changeEnd$.subscribe((o) => {
|
|
1964
|
+
const { objects: a, offsetX: s, offsetY: l } = o;
|
|
1972
1965
|
for (const c of a.values()) {
|
|
1973
1966
|
const m = this._drawingManagerService.getDrawingOKey(c.oKey);
|
|
1974
1967
|
if (m == null)
|
|
1975
1968
|
continue;
|
|
1976
1969
|
const u = this._transformerCache.get(m == null ? void 0 : m.drawingId);
|
|
1977
|
-
(u == null ? void 0 : u.drawing.layoutType) ===
|
|
1970
|
+
(u == null ? void 0 : u.drawing.layoutType) === k.INLINE && c.setOpacity(1);
|
|
1978
1971
|
}
|
|
1979
1972
|
if (this._anchorShape && this._anchorShape.hide(), a.size > 1)
|
|
1980
1973
|
this._updateMultipleDrawingDocTransform(a);
|
|
1981
1974
|
else if (a.size === 1) {
|
|
1982
|
-
const c = this._transformerCache.values().next().value, m = a.values().next().value, { width: u, height:
|
|
1983
|
-
if (u === c.width &&
|
|
1975
|
+
const c = this._transformerCache.values().next().value, m = a.values().next().value, { width: u, height: f, top: h, left: p, angle: w } = m;
|
|
1976
|
+
if (u === c.width && f === c.height && h === c.top && p === c.left && w === c.angle)
|
|
1984
1977
|
return;
|
|
1985
|
-
c && c.drawing.layoutType ===
|
|
1978
|
+
c && c.drawing.layoutType === k.INLINE ? u !== c.width || f !== c.height || w !== c.angle ? this._updateDrawingSize(c, m) : s != null && l != null && this._moveInlineDrawing(c.drawing, s, l) : c && this._nonInlineDrawingTransform(c.drawing, m);
|
|
1986
1979
|
}
|
|
1987
1980
|
this._transformerCache.clear();
|
|
1988
1981
|
})
|
|
@@ -1993,308 +1986,355 @@ let Ye = class extends Ue {
|
|
|
1993
1986
|
_updateMultipleDrawingDocTransform(e) {
|
|
1994
1987
|
if (e.size < 1)
|
|
1995
1988
|
return;
|
|
1996
|
-
const
|
|
1997
|
-
let
|
|
1998
|
-
for (const
|
|
1999
|
-
const { oKey: a, left: s, top: l, angle: c } =
|
|
2000
|
-
let { width: m, height: u } =
|
|
2001
|
-
const
|
|
2002
|
-
if (p == null)
|
|
2003
|
-
continue;
|
|
2004
|
-
t == null && (t = p.unitId), o == null && (o = p.subUnitId);
|
|
2005
|
-
const f = this._transformerCache.get(p.drawingId);
|
|
1989
|
+
const t = [];
|
|
1990
|
+
let n, r;
|
|
1991
|
+
for (const o of e.values()) {
|
|
1992
|
+
const { oKey: a, left: s, top: l, angle: c } = o;
|
|
1993
|
+
let { width: m, height: u } = o;
|
|
1994
|
+
const f = this._drawingManagerService.getDrawingOKey(a);
|
|
2006
1995
|
if (f == null)
|
|
2007
1996
|
continue;
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
1997
|
+
n == null && (n = f.unitId), r == null && (r = f.subUnitId);
|
|
1998
|
+
const h = this._transformerCache.get(f.drawingId);
|
|
1999
|
+
if (h == null)
|
|
2000
|
+
continue;
|
|
2001
|
+
const { drawing: p, top: w, left: v, width: I, height: D, angle: _ } = h, { width: C, height: O } = this._getPageContentSize(p);
|
|
2002
|
+
if (m = Math.min(m, C), u = Math.min(u, O), (I !== m || D !== u) && t.push({
|
|
2003
|
+
drawingId: f.drawingId,
|
|
2011
2004
|
key: "size",
|
|
2012
2005
|
value: {
|
|
2013
2006
|
width: m,
|
|
2014
2007
|
height: u
|
|
2015
2008
|
}
|
|
2016
|
-
}),
|
|
2017
|
-
drawingId:
|
|
2009
|
+
}), _ !== c && t.push({
|
|
2010
|
+
drawingId: f.drawingId,
|
|
2018
2011
|
key: "angle",
|
|
2019
2012
|
value: c
|
|
2020
2013
|
}), w !== l || v !== s) {
|
|
2021
|
-
const
|
|
2022
|
-
|
|
2023
|
-
drawingId:
|
|
2014
|
+
const y = l - w, T = s - v;
|
|
2015
|
+
y !== 0 && t.push({
|
|
2016
|
+
drawingId: f.drawingId,
|
|
2024
2017
|
key: "positionV",
|
|
2025
2018
|
value: {
|
|
2026
|
-
relativeFrom:
|
|
2027
|
-
posOffset:
|
|
2019
|
+
relativeFrom: p.docTransform.positionV.relativeFrom,
|
|
2020
|
+
posOffset: p.docTransform.positionV.posOffset + y
|
|
2028
2021
|
}
|
|
2029
|
-
}),
|
|
2030
|
-
drawingId:
|
|
2022
|
+
}), T !== 0 && t.push({
|
|
2023
|
+
drawingId: f.drawingId,
|
|
2031
2024
|
key: "positionH",
|
|
2032
2025
|
value: {
|
|
2033
|
-
relativeFrom:
|
|
2034
|
-
posOffset:
|
|
2026
|
+
relativeFrom: p.docTransform.positionH.relativeFrom,
|
|
2027
|
+
posOffset: p.docTransform.positionH.posOffset + T
|
|
2035
2028
|
}
|
|
2036
2029
|
});
|
|
2037
2030
|
}
|
|
2038
2031
|
}
|
|
2039
|
-
|
|
2040
|
-
unitId:
|
|
2041
|
-
subUnitId:
|
|
2042
|
-
drawings:
|
|
2032
|
+
t.length > 0 && n && r && this._commandService.executeCommand(ze.id, {
|
|
2033
|
+
unitId: n,
|
|
2034
|
+
subUnitId: r,
|
|
2035
|
+
drawings: t
|
|
2043
2036
|
});
|
|
2044
2037
|
}
|
|
2045
2038
|
// TODO: @JOCS, Use to draw and update the drawing anchor.
|
|
2046
2039
|
_updateDrawingAnchor(e) {
|
|
2047
2040
|
if (this._transformerCache.size !== 1)
|
|
2048
2041
|
return;
|
|
2049
|
-
const
|
|
2050
|
-
this._getDrawingAnchor(
|
|
2042
|
+
const t = this._transformerCache.values().next().value, n = e.values().next().value;
|
|
2043
|
+
this._getDrawingAnchor(t.drawing, n);
|
|
2051
2044
|
}
|
|
2052
|
-
_updateInlineDrawingAnchor(e,
|
|
2053
|
-
var
|
|
2045
|
+
_updateInlineDrawingAnchor(e, t, n) {
|
|
2046
|
+
var o;
|
|
2054
2047
|
if (this._transformerCache.size !== 1)
|
|
2055
2048
|
return;
|
|
2056
|
-
const { contentBoxPointGroup:
|
|
2057
|
-
|
|
2049
|
+
const { contentBoxPointGroup: r } = (o = this._getInlineDrawingAnchor(e, t, n)) != null ? o : {};
|
|
2050
|
+
r != null && this._createOrUpdateInlineAnchor(e.unitId, r);
|
|
2058
2051
|
}
|
|
2059
|
-
_getInlineDrawingAnchor(e,
|
|
2060
|
-
var
|
|
2061
|
-
const
|
|
2062
|
-
if (
|
|
2052
|
+
_getInlineDrawingAnchor(e, t, n) {
|
|
2053
|
+
var z;
|
|
2054
|
+
const r = this._renderManagerService.getRenderById(e.unitId), o = r == null ? void 0 : r.with(ae).getSkeleton();
|
|
2055
|
+
if (r == null)
|
|
2063
2056
|
return;
|
|
2064
|
-
const { mainComponent: a, scene: s } =
|
|
2065
|
-
pageLayoutType: m =
|
|
2057
|
+
const { mainComponent: a, scene: s } = r, l = a, c = s.getViewports()[0], {
|
|
2058
|
+
pageLayoutType: m = Pt.VERTICAL,
|
|
2066
2059
|
pageMarginLeft: u,
|
|
2067
|
-
pageMarginTop:
|
|
2060
|
+
pageMarginTop: f
|
|
2068
2061
|
} = l.getOffsetConfig();
|
|
2069
|
-
let
|
|
2070
|
-
const
|
|
2071
|
-
if (
|
|
2062
|
+
let h = null, p = !1, w = -1, v = "";
|
|
2063
|
+
const I = 0.5, D = this._getTransformCoordForDocumentOffset(l, c, t, n);
|
|
2064
|
+
if (D == null)
|
|
2072
2065
|
return;
|
|
2073
|
-
const
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2066
|
+
const _ = o == null ? void 0 : o.findNodeByCoord(
|
|
2067
|
+
D,
|
|
2068
|
+
m,
|
|
2069
|
+
u,
|
|
2070
|
+
f,
|
|
2071
|
+
{
|
|
2072
|
+
strict: !1,
|
|
2073
|
+
segmentId: this._textSelectionRenderManager.getSegment(),
|
|
2074
|
+
segmentPage: this._textSelectionRenderManager.getSegmentPage()
|
|
2075
|
+
}
|
|
2076
|
+
);
|
|
2077
|
+
if (_) {
|
|
2078
|
+
const { node: U, ratioX: B, segmentPage: b, segmentId: S } = _;
|
|
2079
|
+
p = B < I, h = U, w = b, v = S;
|
|
2077
2080
|
}
|
|
2078
|
-
if (
|
|
2081
|
+
if (h == null)
|
|
2079
2082
|
return;
|
|
2080
|
-
const
|
|
2081
|
-
if (
|
|
2083
|
+
const C = o == null ? void 0 : o.findPositionByGlyph(h, w), O = this._getDocObject();
|
|
2084
|
+
if (C == null || o == null || O == null)
|
|
2082
2085
|
return;
|
|
2083
|
-
const
|
|
2084
|
-
...
|
|
2085
|
-
isBack:
|
|
2086
|
-
},
|
|
2087
|
-
if (
|
|
2088
|
-
return { offset:
|
|
2086
|
+
const y = {
|
|
2087
|
+
...C,
|
|
2088
|
+
isBack: p
|
|
2089
|
+
}, T = O.document.getOffsetConfig(), N = new Ot(T, o), { cursorList: R, contentBoxPointGroup: E } = N.getRangePointData(y, y), { startOffset: H } = (z = Tt(R)) != null ? z : {};
|
|
2090
|
+
if (H != null)
|
|
2091
|
+
return { offset: H, contentBoxPointGroup: E, segmentId: v, segmentPage: w };
|
|
2089
2092
|
}
|
|
2090
2093
|
// eslint-disable-next-line max-lines-per-function, complexity
|
|
2091
|
-
_getDrawingAnchor(e,
|
|
2092
|
-
var
|
|
2093
|
-
const
|
|
2094
|
-
if (
|
|
2094
|
+
_getDrawingAnchor(e, t) {
|
|
2095
|
+
var we, ve, ne, Ne, Ie, Se, Te, Me, De, J;
|
|
2096
|
+
const n = this._renderManagerService.getRenderById(e.unitId), r = n == null ? void 0 : n.with(ae).getSkeleton(), o = r == null ? void 0 : r.getSkeletonData();
|
|
2097
|
+
if (o == null || n == null)
|
|
2095
2098
|
return;
|
|
2096
|
-
const { pages: s } =
|
|
2097
|
-
let { width:
|
|
2098
|
-
const { positionV:
|
|
2099
|
-
|
|
2100
|
-
let
|
|
2101
|
-
const
|
|
2099
|
+
const { pages: a, skeHeaders: s, skeFooters: l } = o, { mainComponent: c, scene: m } = n, u = c, f = m.getViewports()[0], { pageLayoutType: h = Pt.VERTICAL, pageMarginLeft: p, pageMarginTop: w, docsLeft: v, docsTop: I } = u.getOffsetConfig(), { left: D, top: _, angle: C } = t;
|
|
2100
|
+
let { width: O, height: y } = t;
|
|
2101
|
+
const { positionV: T, positionH: N } = e.docTransform, { width: R, height: E } = this._getPageContentSize(e);
|
|
2102
|
+
O = Math.min(O, R), y = Math.min(y, E);
|
|
2103
|
+
let H = null, z = "", U = -1;
|
|
2104
|
+
const B = !1, b = {
|
|
2102
2105
|
...e.docTransform,
|
|
2103
2106
|
size: {
|
|
2104
|
-
width:
|
|
2105
|
-
height:
|
|
2107
|
+
width: O,
|
|
2108
|
+
height: y
|
|
2106
2109
|
},
|
|
2107
|
-
angle:
|
|
2108
|
-
}, { x:
|
|
2109
|
-
if (
|
|
2110
|
+
angle: C
|
|
2111
|
+
}, { x: S, y: A } = m.getViewportScrollXY(f), P = this._getTransformCoordForDocumentOffset(u, f, D - S, _ - A);
|
|
2112
|
+
if (P == null)
|
|
2110
2113
|
return;
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2114
|
+
const L = r == null ? void 0 : r.findNodeByCoord(P, h, p, w, {
|
|
2115
|
+
strict: !1,
|
|
2116
|
+
segmentId: this._textSelectionRenderManager.getSegment(),
|
|
2117
|
+
segmentPage: this._textSelectionRenderManager.getSegmentPage()
|
|
2118
|
+
});
|
|
2119
|
+
if (L) {
|
|
2120
|
+
const { node: q, segmentPage: lt, segmentId: dt } = L;
|
|
2121
|
+
H = q, U = lt, z = dt;
|
|
2115
2122
|
}
|
|
2116
|
-
if (
|
|
2123
|
+
if (H == null)
|
|
2124
|
+
return;
|
|
2125
|
+
const x = (we = H.parent) == null ? void 0 : we.parent, M = x == null ? void 0 : x.parent, W = (ve = M == null ? void 0 : M.lines.find((q) => q.paragraphIndex === (x == null ? void 0 : x.paragraphIndex) && q.paragraphStart)) != null ? ve : M == null ? void 0 : M.lines[0], G = (ne = M == null ? void 0 : M.parent) == null ? void 0 : ne.parent;
|
|
2126
|
+
if (x == null || M == null || W == null || G == null)
|
|
2117
2127
|
return;
|
|
2118
|
-
const E = (ee = T.parent) == null ? void 0 : ee.parent, A = E == null ? void 0 : E.parent, U = (we = A == null ? void 0 : A.lines.find((le) => le.paragraphIndex === (E == null ? void 0 : E.paragraphIndex) && le.paragraphStart)) != null ? we : A == null ? void 0 : A.lines[0], F = (ve = A == null ? void 0 : A.parent) == null ? void 0 : ve.parent;
|
|
2119
2128
|
this._liquid.reset();
|
|
2120
|
-
|
|
2121
|
-
|
|
2129
|
+
const F = G.type;
|
|
2130
|
+
for (const q of a) {
|
|
2131
|
+
const { headerId: lt, footerId: dt, pageHeight: pn, pageWidth: It, marginLeft: _t, marginBottom: hn } = q, wn = a.indexOf(q);
|
|
2132
|
+
if (U > -1 && wn === U) {
|
|
2133
|
+
switch (F) {
|
|
2134
|
+
case Mt.HEADER: {
|
|
2135
|
+
const Fe = (Ne = s.get(lt)) == null ? void 0 : Ne.get(It);
|
|
2136
|
+
if (Fe)
|
|
2137
|
+
this._liquid.translatePagePadding({
|
|
2138
|
+
marginTop: Fe.marginTop,
|
|
2139
|
+
marginLeft: _t
|
|
2140
|
+
});
|
|
2141
|
+
else
|
|
2142
|
+
throw new Error("header skeleton not found");
|
|
2143
|
+
break;
|
|
2144
|
+
}
|
|
2145
|
+
case Mt.FOOTER: {
|
|
2146
|
+
const Fe = (Ie = l.get(dt)) == null ? void 0 : Ie.get(It);
|
|
2147
|
+
if (Fe)
|
|
2148
|
+
this._liquid.translatePagePadding({
|
|
2149
|
+
marginTop: pn - hn + Fe.marginTop,
|
|
2150
|
+
marginLeft: _t
|
|
2151
|
+
});
|
|
2152
|
+
else
|
|
2153
|
+
throw new Error("footer skeleton not found");
|
|
2154
|
+
break;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2122
2157
|
break;
|
|
2123
|
-
|
|
2158
|
+
}
|
|
2159
|
+
if (this._liquid.translatePagePadding(q), q === G)
|
|
2160
|
+
break;
|
|
2161
|
+
this._liquid.restorePagePadding(q), this._liquid.translatePage(q, h, p, w);
|
|
2124
2162
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
case Y.MARGIN: {
|
|
2132
|
-
L.positionH.posOffset = I - this._liquid.x - w - F.marginLeft;
|
|
2163
|
+
switch (T.relativeFrom === V.LINE ? H = x.divides[0].glyphGroup[0] : H = (De = (Me = (Te = (Se = W.divides) == null ? void 0 : Se[0]) == null ? void 0 : Te.glyphGroup) == null ? void 0 : Me[0]) != null ? De : H, b.positionH = {
|
|
2164
|
+
relativeFrom: N.relativeFrom,
|
|
2165
|
+
posOffset: D - this._liquid.x - v
|
|
2166
|
+
}, N.relativeFrom) {
|
|
2167
|
+
case ee.MARGIN: {
|
|
2168
|
+
b.positionH.posOffset = D - this._liquid.x - v - G.marginLeft;
|
|
2133
2169
|
break;
|
|
2134
2170
|
}
|
|
2135
|
-
case
|
|
2136
|
-
|
|
2171
|
+
case ee.COLUMN: {
|
|
2172
|
+
b.positionH.posOffset = D - this._liquid.x - v - M.left;
|
|
2137
2173
|
break;
|
|
2138
2174
|
}
|
|
2139
2175
|
}
|
|
2140
|
-
switch (
|
|
2141
|
-
relativeFrom:
|
|
2142
|
-
posOffset:
|
|
2143
|
-
},
|
|
2144
|
-
case
|
|
2145
|
-
|
|
2176
|
+
switch (b.positionV = {
|
|
2177
|
+
relativeFrom: T.relativeFrom,
|
|
2178
|
+
posOffset: _ - this._liquid.y - I
|
|
2179
|
+
}, T.relativeFrom) {
|
|
2180
|
+
case V.PAGE: {
|
|
2181
|
+
b.positionV.posOffset = _ - this._liquid.y - I - G.marginTop;
|
|
2146
2182
|
break;
|
|
2147
2183
|
}
|
|
2148
|
-
case
|
|
2149
|
-
|
|
2184
|
+
case V.LINE: {
|
|
2185
|
+
b.positionV.posOffset = _ - this._liquid.y - I - x.top;
|
|
2150
2186
|
break;
|
|
2151
2187
|
}
|
|
2152
|
-
case
|
|
2153
|
-
|
|
2188
|
+
case V.PARAGRAPH: {
|
|
2189
|
+
b.positionV.posOffset = _ - this._liquid.y - I - W.top;
|
|
2154
2190
|
break;
|
|
2155
2191
|
}
|
|
2156
2192
|
}
|
|
2157
|
-
if (
|
|
2193
|
+
if (H == null)
|
|
2158
2194
|
return;
|
|
2159
|
-
const
|
|
2160
|
-
if (
|
|
2195
|
+
const ce = r == null ? void 0 : r.findPositionByGlyph(H, U), fe = this._getDocObject();
|
|
2196
|
+
if (ce == null || r == null || fe == null)
|
|
2161
2197
|
return;
|
|
2162
|
-
const
|
|
2163
|
-
...
|
|
2164
|
-
isBack:
|
|
2165
|
-
},
|
|
2166
|
-
if (
|
|
2167
|
-
return { offset:
|
|
2198
|
+
const Oe = {
|
|
2199
|
+
...ce,
|
|
2200
|
+
isBack: B
|
|
2201
|
+
}, Be = fe.document.getOffsetConfig(), Ce = new Ot(Be, r), { cursorList: K } = Ce.getRangePointData(Oe, Oe), { startOffset: le } = (J = Tt(K)) != null ? J : {};
|
|
2202
|
+
if (le != null)
|
|
2203
|
+
return { offset: le, docTransform: b, segmentId: z, segmentPage: U };
|
|
2168
2204
|
}
|
|
2169
2205
|
// Update drawing when use transformer to resize it.
|
|
2170
|
-
_updateDrawingSize(e,
|
|
2171
|
-
const
|
|
2172
|
-
let { width: m, height: u, angle:
|
|
2173
|
-
const { width:
|
|
2174
|
-
m = Math.min(
|
|
2175
|
-
drawingId:
|
|
2206
|
+
_updateDrawingSize(e, t) {
|
|
2207
|
+
const n = [], { drawing: r, width: o, height: a, angle: s } = e, { unitId: l, subUnitId: c } = r;
|
|
2208
|
+
let { width: m, height: u, angle: f } = t;
|
|
2209
|
+
const { width: h, height: p } = this._getPageContentSize(r);
|
|
2210
|
+
m = Math.min(h, m), u = Math.min(p, u), (m !== o || u !== a) && n.push({
|
|
2211
|
+
drawingId: r.drawingId,
|
|
2176
2212
|
key: "size",
|
|
2177
2213
|
value: {
|
|
2178
2214
|
width: m,
|
|
2179
2215
|
height: u
|
|
2180
2216
|
}
|
|
2181
|
-
}),
|
|
2182
|
-
drawingId:
|
|
2217
|
+
}), f !== s && n.push({
|
|
2218
|
+
drawingId: r.drawingId,
|
|
2183
2219
|
key: "angle",
|
|
2184
|
-
value:
|
|
2185
|
-
}),
|
|
2220
|
+
value: f
|
|
2221
|
+
}), n.length > 0 && l && c && this._commandService.executeCommand(ze.id, {
|
|
2186
2222
|
unitId: l,
|
|
2187
2223
|
subUnitId: c,
|
|
2188
|
-
drawings:
|
|
2224
|
+
drawings: n
|
|
2189
2225
|
});
|
|
2190
2226
|
}
|
|
2191
2227
|
// Update inline drawing when use transformer to move it.
|
|
2192
|
-
_moveInlineDrawing(e,
|
|
2193
|
-
const
|
|
2194
|
-
if (
|
|
2195
|
-
return this._commandService.executeCommand(
|
|
2228
|
+
_moveInlineDrawing(e, t, n) {
|
|
2229
|
+
const r = this._getInlineDrawingAnchor(e, t, n), { offset: o, segmentId: a, segmentPage: s } = r != null ? r : {};
|
|
2230
|
+
if (o != null)
|
|
2231
|
+
return this._commandService.executeCommand(an.id, {
|
|
2196
2232
|
unitId: e.unitId,
|
|
2197
2233
|
subUnitId: e.unitId,
|
|
2198
2234
|
drawing: e,
|
|
2199
|
-
offset:
|
|
2235
|
+
offset: o,
|
|
2236
|
+
segmentId: a,
|
|
2237
|
+
segmentPage: s
|
|
2200
2238
|
});
|
|
2201
2239
|
}
|
|
2202
2240
|
// Limit the drawing to the page area, mainly in the vertical direction,
|
|
2203
2241
|
// and the upper and lower limits cannot exceed the page margin area.
|
|
2204
|
-
_limitDrawingInPage(e,
|
|
2205
|
-
const
|
|
2206
|
-
if (m == null ||
|
|
2242
|
+
_limitDrawingInPage(e, t) {
|
|
2243
|
+
const n = this._renderManagerService.getRenderById(e.unitId), { left: r, top: o, width: a, height: s, angle: l } = t, c = n == null ? void 0 : n.with(ae).getSkeleton(), m = c == null ? void 0 : c.getSkeletonData(), { pages: u } = m != null ? m : {};
|
|
2244
|
+
if (m == null || n == null || u == null)
|
|
2207
2245
|
return {
|
|
2208
|
-
left:
|
|
2209
|
-
top:
|
|
2246
|
+
left: r,
|
|
2247
|
+
top: o,
|
|
2210
2248
|
width: a,
|
|
2211
2249
|
height: s,
|
|
2212
2250
|
angle: l
|
|
2213
2251
|
};
|
|
2214
|
-
const { mainComponent:
|
|
2215
|
-
let
|
|
2252
|
+
const { mainComponent: f } = n, h = f, { top: p, pageLayoutType: w, pageMarginLeft: v, pageMarginTop: I } = h;
|
|
2253
|
+
let D = o;
|
|
2216
2254
|
this._liquid.reset();
|
|
2217
|
-
for (const
|
|
2218
|
-
const { marginBottom:
|
|
2219
|
-
if (
|
|
2255
|
+
for (const _ of u) {
|
|
2256
|
+
const { marginBottom: C, pageHeight: O } = _, y = u.indexOf(_), T = u[y + 1];
|
|
2257
|
+
if (T == null)
|
|
2220
2258
|
continue;
|
|
2221
|
-
if (
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
this._liquid.y +
|
|
2225
|
-
this._liquid.y +
|
|
2259
|
+
if (Pe.hasIntersectionBetweenTwoRanges(
|
|
2260
|
+
o,
|
|
2261
|
+
o + s,
|
|
2262
|
+
this._liquid.y + p + O - C,
|
|
2263
|
+
this._liquid.y + p + O + I + T.marginTop
|
|
2226
2264
|
)) {
|
|
2227
|
-
const
|
|
2228
|
-
|
|
2265
|
+
const R = o + s / 2, E = this._liquid.y + p + O + I / 2;
|
|
2266
|
+
R < E ? D = Math.min(o, this._liquid.y + p + O - C - s) : D = Math.max(o, this._liquid.y + p + O + I + T.marginTop);
|
|
2229
2267
|
}
|
|
2230
|
-
this._liquid.translatePage(
|
|
2268
|
+
this._liquid.translatePage(_, w, v, I);
|
|
2231
2269
|
}
|
|
2232
2270
|
return {
|
|
2233
|
-
left:
|
|
2234
|
-
top:
|
|
2271
|
+
left: r,
|
|
2272
|
+
top: D,
|
|
2235
2273
|
width: a,
|
|
2236
2274
|
height: s,
|
|
2237
2275
|
angle: l
|
|
2238
2276
|
};
|
|
2239
2277
|
}
|
|
2240
|
-
_nonInlineDrawingTransform(e,
|
|
2241
|
-
const
|
|
2242
|
-
if (
|
|
2278
|
+
_nonInlineDrawingTransform(e, t, n = !1) {
|
|
2279
|
+
const r = e.isMultiTransform === oe.TRUE ? t : this._limitDrawingInPage(e, t);
|
|
2280
|
+
if (n && r.top !== t.top)
|
|
2243
2281
|
return;
|
|
2244
|
-
const
|
|
2245
|
-
return a == null || s == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId,
|
|
2282
|
+
const o = this._getDrawingAnchor(e, r), { offset: a, docTransform: s, segmentId: l, segmentPage: c } = o != null ? o : {};
|
|
2283
|
+
return a == null || s == null ? this._updateMultipleDrawingDocTransform(/* @__PURE__ */ new Map([[e.drawingId, t]])) : this._commandService.executeCommand(sn.id, {
|
|
2246
2284
|
unitId: e.unitId,
|
|
2247
2285
|
subUnitId: e.unitId,
|
|
2248
2286
|
drawing: e,
|
|
2249
2287
|
offset: a,
|
|
2250
|
-
docTransform: s
|
|
2288
|
+
docTransform: s,
|
|
2289
|
+
segmentId: l,
|
|
2290
|
+
segmentPage: c
|
|
2251
2291
|
});
|
|
2252
2292
|
}
|
|
2253
2293
|
_getSceneAndTransformerByDrawingSearch(e) {
|
|
2254
2294
|
if (e == null)
|
|
2255
2295
|
return;
|
|
2256
|
-
const
|
|
2257
|
-
if (
|
|
2296
|
+
const t = this._renderManagerService.getRenderById(e), n = t == null ? void 0 : t.scene;
|
|
2297
|
+
if (n == null)
|
|
2258
2298
|
return;
|
|
2259
|
-
const
|
|
2260
|
-
return { scene:
|
|
2299
|
+
const r = n.getTransformerByCreate();
|
|
2300
|
+
return { scene: n, transformer: r };
|
|
2261
2301
|
}
|
|
2262
|
-
_getTransformCoordForDocumentOffset(e,
|
|
2263
|
-
const { documentTransform:
|
|
2302
|
+
_getTransformCoordForDocumentOffset(e, t, n, r) {
|
|
2303
|
+
const { documentTransform: o } = e.getOffsetConfig(), a = t.transformVector2SceneCoord(Gn.FromArray([n, r]));
|
|
2264
2304
|
if (a)
|
|
2265
|
-
return
|
|
2305
|
+
return o.clone().invert().applyPoint(a);
|
|
2266
2306
|
}
|
|
2267
|
-
_createOrUpdateInlineAnchor(e,
|
|
2268
|
-
const
|
|
2269
|
-
if (
|
|
2307
|
+
_createOrUpdateInlineAnchor(e, t) {
|
|
2308
|
+
const n = this._renderManagerService.getRenderById(e);
|
|
2309
|
+
if (n == null)
|
|
2270
2310
|
return;
|
|
2271
|
-
const { mainComponent:
|
|
2311
|
+
const { mainComponent: r, scene: o } = n, a = r, {
|
|
2272
2312
|
docsLeft: s,
|
|
2273
2313
|
docsTop: l
|
|
2274
|
-
} = a.getOffsetConfig(), c =
|
|
2314
|
+
} = a.getOffsetConfig(), c = Vn(t), { left: m, top: u, height: f } = c, h = m + s, p = u + l;
|
|
2275
2315
|
if (this._anchorShape) {
|
|
2276
|
-
this._anchorShape.transformByState({ left:
|
|
2316
|
+
this._anchorShape.transformByState({ left: h, top: p, height: f }), this._anchorShape.show();
|
|
2277
2317
|
return;
|
|
2278
2318
|
}
|
|
2279
|
-
const w = 6, v = new
|
|
2280
|
-
left:
|
|
2281
|
-
top:
|
|
2282
|
-
height:
|
|
2319
|
+
const w = 6, v = new jn(dr + Pe.generateRandomId(w), {
|
|
2320
|
+
left: h,
|
|
2321
|
+
top: p,
|
|
2322
|
+
height: f,
|
|
2283
2323
|
strokeWidth: 2,
|
|
2284
|
-
stroke:
|
|
2324
|
+
stroke: $n(Pn.darkGray, 1),
|
|
2285
2325
|
evented: !1
|
|
2286
2326
|
});
|
|
2287
|
-
this._anchorShape = v,
|
|
2327
|
+
this._anchorShape = v, o.addObject(v, zn);
|
|
2288
2328
|
}
|
|
2289
2329
|
_getDocObject() {
|
|
2290
|
-
return
|
|
2330
|
+
return Qn(this._univerInstanceService, this._renderManagerService);
|
|
2291
2331
|
}
|
|
2292
2332
|
_getPageContentSize(e) {
|
|
2293
|
-
const
|
|
2294
|
-
if (a == null ||
|
|
2333
|
+
const t = this._renderManagerService.getRenderById(e.unitId), n = t == null ? void 0 : t.with(ae).getSkeleton(), r = 500, o = 500, a = n == null ? void 0 : n.getSkeletonData();
|
|
2334
|
+
if (a == null || t == null)
|
|
2295
2335
|
return {
|
|
2296
|
-
width:
|
|
2297
|
-
height:
|
|
2336
|
+
width: r,
|
|
2337
|
+
height: o
|
|
2298
2338
|
};
|
|
2299
2339
|
const { pages: s } = a;
|
|
2300
2340
|
let l = null;
|
|
@@ -2306,69 +2346,70 @@ let Ye = class extends Ue {
|
|
|
2306
2346
|
}
|
|
2307
2347
|
}
|
|
2308
2348
|
if (l) {
|
|
2309
|
-
const { pageWidth: c, pageHeight: m, marginLeft: u, marginBottom:
|
|
2349
|
+
const { pageWidth: c, pageHeight: m, marginLeft: u, marginBottom: f, marginRight: h, marginTop: p } = l;
|
|
2310
2350
|
return {
|
|
2311
|
-
width: Math.max(
|
|
2312
|
-
height: Math.max(
|
|
2351
|
+
width: Math.max(r, c - u - h),
|
|
2352
|
+
height: Math.max(o, m - p - f)
|
|
2313
2353
|
};
|
|
2314
2354
|
} else
|
|
2315
2355
|
return {
|
|
2316
|
-
width:
|
|
2317
|
-
height:
|
|
2356
|
+
width: r,
|
|
2357
|
+
height: o
|
|
2318
2358
|
};
|
|
2319
2359
|
}
|
|
2320
2360
|
};
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2361
|
+
nt = lr([
|
|
2362
|
+
at(st.Rendered, nt),
|
|
2363
|
+
Ve(0, $),
|
|
2364
|
+
Ve(1, te),
|
|
2365
|
+
Ve(2, he),
|
|
2366
|
+
Ve(3, se),
|
|
2367
|
+
Ve(4, Ue)
|
|
2368
|
+
], nt);
|
|
2369
|
+
var un = Object.defineProperty, mr = Object.getOwnPropertyDescriptor, gr = (i, e, t) => e in i ? un(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, ur = (i, e, t, n) => {
|
|
2370
|
+
for (var r = n > 1 ? void 0 : n ? mr(e, t) : e, o = i.length - 1, a; o >= 0; o--)
|
|
2371
|
+
(a = i[o]) && (r = (n ? a(e, t, r) : a(r)) || r);
|
|
2372
|
+
return n && r && un(e, t, r), r;
|
|
2373
|
+
}, Ut = (i, e) => (t, n) => e(t, n, i), fn = (i, e, t) => gr(i, typeof e != "symbol" ? e + "" : e, t);
|
|
2374
|
+
const fr = "DOCS_DRAWING_UI_PLUGIN";
|
|
2375
|
+
let rt = class extends On {
|
|
2376
|
+
constructor(i, e, t) {
|
|
2377
|
+
super(), this._injector = e, this._renderManagerSrv = t;
|
|
2337
2378
|
}
|
|
2338
2379
|
onStarting(i) {
|
|
2339
2380
|
[
|
|
2340
|
-
[
|
|
2341
|
-
[
|
|
2342
|
-
[
|
|
2343
|
-
[
|
|
2344
|
-
|
|
2381
|
+
[et],
|
|
2382
|
+
[Je],
|
|
2383
|
+
[nt],
|
|
2384
|
+
[tt],
|
|
2385
|
+
[ct]
|
|
2386
|
+
].forEach((t) => i.add(t));
|
|
2345
2387
|
}
|
|
2346
2388
|
onReady() {
|
|
2347
2389
|
[
|
|
2348
|
-
[
|
|
2349
|
-
[
|
|
2350
|
-
].forEach((i) => this._renderManagerSrv.registerRenderModule(
|
|
2390
|
+
[ut],
|
|
2391
|
+
[ft]
|
|
2392
|
+
].forEach((i) => this._renderManagerSrv.registerRenderModule(be.UNIVER_DOC, i));
|
|
2351
2393
|
}
|
|
2352
2394
|
};
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
],
|
|
2395
|
+
fn(rt, "type", be.UNIVER_DOC);
|
|
2396
|
+
fn(rt, "pluginName", fr);
|
|
2397
|
+
rt = ur([
|
|
2398
|
+
Tn(An, Hn, Wn),
|
|
2399
|
+
Ut(1, pe(kt)),
|
|
2400
|
+
Ut(2, se)
|
|
2401
|
+
], rt);
|
|
2360
2402
|
export {
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
rt as
|
|
2373
|
-
Qe as UniverDocsDrawingUIPlugin
|
|
2403
|
+
Wi as ClearDocDrawingTransformerOperation,
|
|
2404
|
+
cn as DeleteDocDrawingsCommand,
|
|
2405
|
+
Xt as EditDocDrawingOperation,
|
|
2406
|
+
mn as GroupDocDrawingCommand,
|
|
2407
|
+
gn as InsertDocDrawingCommand,
|
|
2408
|
+
vt as InsertDocImageOperation,
|
|
2409
|
+
Xe as MoveDocDrawingsCommand,
|
|
2410
|
+
wt as RemoveDocDrawingCommand,
|
|
2411
|
+
ln as SetDocDrawingArrangeCommand,
|
|
2412
|
+
qt as SidebarDocDrawingOperation,
|
|
2413
|
+
dn as UngroupDocDrawingCommand,
|
|
2414
|
+
rt as UniverDocsDrawingUIPlugin
|
|
2374
2415
|
};
|