@univerjs/docs-drawing-ui 0.1.16 → 0.2.0
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 +427 -481
- package/lib/types/commands/operations/insert-image.operation.d.ts +3 -0
- package/lib/types/controllers/{doc-drawing-update.controller.d.ts → render-controllers/doc-drawing-update.render-controller.d.ts} +7 -11
- package/lib/types/index.d.ts +12 -0
- package/lib/types/plugin.d.ts +6 -5
- package/lib/umd/index.js +1 -1
- package/package.json +25 -25
package/lib/es/index.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { Inject as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { ISidebarService as
|
|
13
|
-
import { useDependency as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { MessageType as
|
|
17
|
-
import { TextSelectionManagerService as
|
|
18
|
-
const
|
|
1
|
+
var Ge = Object.defineProperty;
|
|
2
|
+
var Le = (e, n, t) => n in e ? Ge(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var J = (e, n, t) => Le(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { CommandType as S, ICommandService as I, IUndoRedoService as U, LocaleService as k, RxDisposable as je, UniverInstanceType as E, toDisposable as We, FOCUSING_COMMON_DRAWINGS as V, OnLifecycle as se, LifecycleStages as ce, IUniverInstanceService as Fe, IContextService as de, Direction as P, FOCUSING_UNIVER_EDITOR as $e, Disposable as ue, PositionedObjectLayoutType as Ve, ObjectRelativeFromH as Be, ObjectRelativeFromV as He, Plugin as ze, DependentOn as Ke } from "@univerjs/core";
|
|
5
|
+
import { Inject as y, Injector as me } from "@wendellhu/redi";
|
|
6
|
+
import { ImageCropperObject as Ze, COMPONENT_IMAGE_POPUP_MENU as Ye, OpenImageCropOperation as ke, ImageResetSizeOperation as Qe, DrawingCommonPanel as Xe, UniverDrawingUIPlugin as qe } from "@univerjs/drawing-ui";
|
|
7
|
+
import { IDrawingManagerService as N, DRAWING_IMAGE_ALLOW_IMAGE_LIST as Je, ArrangeTypeEnum as L, DrawingTypeEnum as Q, DRAWING_IMAGE_COUNT_LIMIT as ee, ImageUploadStatusType as K, DRAWING_IMAGE_ALLOW_SIZE as en, getImageSize as nn, DRAWING_IMAGE_WIDTH_LIMIT as ne, DRAWING_IMAGE_HEIGHT_LIMIT as te, IImageIoService as tn, UniverDrawingPlugin as rn } from "@univerjs/drawing";
|
|
8
|
+
import { IDocDrawingService as M, SetDocDrawingApplyMutation as p, DocDrawingApplyType as f, UniverDocsDrawingPlugin as on } from "@univerjs/docs-drawing";
|
|
9
|
+
import { IRenderManagerService as H, getGroupState as an, transformObjectOutOfGroup as sn } from "@univerjs/engine-render";
|
|
10
|
+
import { takeUntil as re } from "rxjs";
|
|
11
|
+
import { DocCanvasPopManagerService as cn, transformToDocDrawingPosition as le, docDrawingPositionToTransform as ie } from "@univerjs/docs-ui";
|
|
12
|
+
import { ISidebarService as dn, MenuItemType as ge, MenuPosition as un, MenuGroup as mn, getMenuHiddenObservable as pe, KeyCode as R, ComponentManager as ln, IMenuService as gn, IShortcutService as pn, IMessageService as fn } from "@univerjs/ui";
|
|
13
|
+
import { useDependency as b } from "@wendellhu/redi/react-bindings";
|
|
14
|
+
import C, { forwardRef as fe, useRef as he, createElement as ve, useState as Z, useEffect as Ie } from "react";
|
|
15
|
+
import j from "clsx";
|
|
16
|
+
import { MessageType as W } from "@univerjs/design";
|
|
17
|
+
import { TextSelectionManagerService as hn, DocSkeletonManagerService as vn } from "@univerjs/docs";
|
|
18
|
+
const w = {
|
|
19
19
|
id: "sheet.operation.clear-drawing-transformer",
|
|
20
|
-
type:
|
|
20
|
+
type: S.MUTATION,
|
|
21
21
|
handler: (e, n) => {
|
|
22
|
-
const t = e.get(
|
|
22
|
+
const t = e.get(H);
|
|
23
23
|
return n.forEach((r) => {
|
|
24
24
|
var i, o;
|
|
25
25
|
(o = (i = t.getRenderById(r)) == null ? void 0 : i.scene.getTransformer()) == null || o.debounceRefreshControls();
|
|
26
26
|
}), !0;
|
|
27
27
|
}
|
|
28
|
-
},
|
|
28
|
+
}, X = {
|
|
29
29
|
id: "doc.command.remove-doc-image",
|
|
30
|
-
type:
|
|
30
|
+
type: S.COMMAND,
|
|
31
31
|
handler: (e, n) => {
|
|
32
|
-
const t = e.get(
|
|
32
|
+
const t = e.get(I), r = e.get(U), i = e.get(M);
|
|
33
33
|
if (!n) return !1;
|
|
34
34
|
const { drawings: o } = n, a = [];
|
|
35
|
-
o.forEach((
|
|
36
|
-
const { unitId:
|
|
37
|
-
a.push(
|
|
35
|
+
o.forEach((h) => {
|
|
36
|
+
const { unitId: v } = h;
|
|
37
|
+
a.push(v);
|
|
38
38
|
});
|
|
39
|
-
const s = i.getBatchRemoveOp(o), { unitId: c, subUnitId:
|
|
40
|
-
return t.syncExecuteCommand(
|
|
39
|
+
const s = i.getBatchRemoveOp(o), { unitId: c, subUnitId: u, undo: m, redo: d, objects: l } = s;
|
|
40
|
+
return t.syncExecuteCommand(p.id, { unitId: c, subUnitId: u, op: d, objects: l, type: f.REMOVE }) ? (r.pushUndoRedo({
|
|
41
41
|
unitID: c,
|
|
42
42
|
undoMutations: [
|
|
43
|
-
{ id:
|
|
44
|
-
{ id:
|
|
43
|
+
{ id: p.id, params: { unitId: c, subUnitId: u, op: m, objects: l, type: f.INSERT } },
|
|
44
|
+
{ id: w.id, params: a }
|
|
45
45
|
],
|
|
46
46
|
redoMutations: [
|
|
47
|
-
{ id:
|
|
48
|
-
{ id:
|
|
47
|
+
{ id: p.id, params: { unitId: c, subUnitId: u, op: d, objects: l, type: f.REMOVE } },
|
|
48
|
+
{ id: w.id, params: a }
|
|
49
49
|
]
|
|
50
50
|
}), !0) : !1;
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, _e = "COMPONENT_DOC_DRAWING_PANEL", we = {
|
|
53
53
|
id: "sidebar.operation.doc-image",
|
|
54
|
-
type:
|
|
54
|
+
type: S.COMMAND,
|
|
55
55
|
handler: async (e, n) => {
|
|
56
|
-
const t = e.get(
|
|
56
|
+
const t = e.get(dn), r = e.get(k), i = e.get(N);
|
|
57
57
|
switch (n.value) {
|
|
58
58
|
case "open":
|
|
59
59
|
t.open({
|
|
60
60
|
header: { title: r.t("docImage.panel.title") },
|
|
61
|
-
children: { label:
|
|
61
|
+
children: { label: _e },
|
|
62
62
|
onClose: () => {
|
|
63
63
|
i.focusDrawing(null);
|
|
64
64
|
},
|
|
@@ -72,27 +72,27 @@ const S = {
|
|
|
72
72
|
}
|
|
73
73
|
return !0;
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, Se = {
|
|
76
76
|
id: "sheet.operation.edit-sheet-image",
|
|
77
|
-
type:
|
|
77
|
+
type: S.OPERATION,
|
|
78
78
|
handler: (e, n) => {
|
|
79
|
-
const t = e.get(
|
|
80
|
-
return n == null ? !1 : (t.focusDrawing([n]), r.executeCommand(
|
|
79
|
+
const t = e.get(N), r = e.get(I);
|
|
80
|
+
return n == null ? !1 : (t.focusDrawing([n]), r.executeCommand(we.id, { value: "open" }), !0);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
var
|
|
84
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
83
|
+
var In = Object.defineProperty, _n = Object.getOwnPropertyDescriptor, wn = (e, n, t, r) => {
|
|
84
|
+
for (var i = r > 1 ? void 0 : r ? _n(n, t) : n, o = e.length - 1, a; o >= 0; o--)
|
|
85
85
|
(a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
|
|
86
|
-
return r && i &&
|
|
87
|
-
},
|
|
88
|
-
let
|
|
86
|
+
return r && i && In(n, t, i), i;
|
|
87
|
+
}, A = (e, n) => (t, r) => n(t, r, e);
|
|
88
|
+
let F = class extends je {
|
|
89
89
|
constructor(n, t, r, i, o) {
|
|
90
90
|
super();
|
|
91
|
-
|
|
91
|
+
J(this, "_initImagePopupMenu", /* @__PURE__ */ new Set());
|
|
92
92
|
this._drawingManagerService = n, this._canvasPopManagerService = t, this._renderManagerService = r, this._univerInstanceService = i, this._contextService = o, this._init();
|
|
93
93
|
}
|
|
94
94
|
_init() {
|
|
95
|
-
this._univerInstanceService.getCurrentTypeOfUnit$(
|
|
95
|
+
this._univerInstanceService.getCurrentTypeOfUnit$(E.UNIVER_DOC).pipe(re(this.dispose$)).subscribe((n) => this._create(n)), this._univerInstanceService.getTypeOfUnitDisposed$(E.UNIVER_DOC).pipe(re(this.dispose$)).subscribe((n) => this._dispose(n)), this._univerInstanceService.getAllUnitsForType(E.UNIVER_DOC).forEach((n) => this._create(n));
|
|
96
96
|
}
|
|
97
97
|
_dispose(n) {
|
|
98
98
|
const t = n.getUnitId();
|
|
@@ -107,7 +107,7 @@ let z = class extends ke {
|
|
|
107
107
|
_hasCropObject(n) {
|
|
108
108
|
const t = n.getAllObjects();
|
|
109
109
|
for (const r of t)
|
|
110
|
-
if (r instanceof
|
|
110
|
+
if (r instanceof Ze)
|
|
111
111
|
return !0;
|
|
112
112
|
return !1;
|
|
113
113
|
}
|
|
@@ -121,8 +121,8 @@ let z = class extends ke {
|
|
|
121
121
|
return;
|
|
122
122
|
const i = [];
|
|
123
123
|
this.disposeWithMe(
|
|
124
|
-
|
|
125
|
-
r.
|
|
124
|
+
We(
|
|
125
|
+
r.createControl$.subscribe(() => {
|
|
126
126
|
if (this._hasCropObject(t))
|
|
127
127
|
return;
|
|
128
128
|
const a = r.getSelectedObjectMap();
|
|
@@ -133,36 +133,32 @@ let z = class extends ke {
|
|
|
133
133
|
const s = a.values().next().value;
|
|
134
134
|
if (!s)
|
|
135
135
|
return;
|
|
136
|
-
const c = s.oKey,
|
|
137
|
-
if (!
|
|
136
|
+
const c = s.oKey, u = this._drawingManagerService.getDrawingOKey(c);
|
|
137
|
+
if (!u)
|
|
138
138
|
return;
|
|
139
|
-
const { unitId: m, subUnitId:
|
|
139
|
+
const { unitId: m, subUnitId: d, drawingId: l } = u;
|
|
140
140
|
i.push(this.disposeWithMe(this._canvasPopManagerService.attachPopupToObject(s, {
|
|
141
|
-
componentKey:
|
|
141
|
+
componentKey: Ye,
|
|
142
142
|
direction: "horizontal",
|
|
143
143
|
offset: [2, 0],
|
|
144
144
|
extraProps: {
|
|
145
|
-
menuItems: this._getImageMenuItems(m,
|
|
145
|
+
menuItems: this._getImageMenuItems(m, d, l)
|
|
146
146
|
}
|
|
147
147
|
}))), this._drawingManagerService.focusDrawing([{
|
|
148
148
|
unitId: m,
|
|
149
|
-
subUnitId:
|
|
149
|
+
subUnitId: d,
|
|
150
150
|
drawingId: l
|
|
151
151
|
}]);
|
|
152
152
|
})
|
|
153
153
|
)
|
|
154
154
|
), this.disposeWithMe(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
})
|
|
159
|
-
)
|
|
155
|
+
r.clearControl$.subscribe(() => {
|
|
156
|
+
i.forEach((a) => a.dispose()), this._contextService.setContextValue(V, !1), this._drawingManagerService.focusDrawing(null);
|
|
157
|
+
})
|
|
160
158
|
), this.disposeWithMe(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
})
|
|
165
|
-
)
|
|
159
|
+
r.changing$.subscribe(() => {
|
|
160
|
+
i.forEach((a) => a.dispose());
|
|
161
|
+
})
|
|
166
162
|
);
|
|
167
163
|
}
|
|
168
164
|
_getImageMenuItems(n, t, r) {
|
|
@@ -170,68 +166,68 @@ let z = class extends ke {
|
|
|
170
166
|
{
|
|
171
167
|
label: "image-popup.edit",
|
|
172
168
|
index: 0,
|
|
173
|
-
commandId:
|
|
169
|
+
commandId: Se.id,
|
|
174
170
|
commandParams: { unitId: n, subUnitId: t, drawingId: r },
|
|
175
171
|
disable: !1
|
|
176
172
|
},
|
|
177
173
|
{
|
|
178
174
|
label: "image-popup.delete",
|
|
179
175
|
index: 1,
|
|
180
|
-
commandId:
|
|
176
|
+
commandId: X.id,
|
|
181
177
|
commandParams: { unitId: n, drawings: [{ unitId: n, subUnitId: t, drawingId: r }] },
|
|
182
178
|
disable: !1
|
|
183
179
|
},
|
|
184
180
|
{
|
|
185
181
|
label: "image-popup.crop",
|
|
186
182
|
index: 2,
|
|
187
|
-
commandId:
|
|
183
|
+
commandId: ke.id,
|
|
188
184
|
commandParams: { unitId: n, subUnitId: t, drawingId: r },
|
|
189
185
|
disable: !1
|
|
190
186
|
},
|
|
191
187
|
{
|
|
192
188
|
label: "image-popup.reset",
|
|
193
189
|
index: 3,
|
|
194
|
-
commandId:
|
|
190
|
+
commandId: Qe.id,
|
|
195
191
|
commandParams: [{ unitId: n, subUnitId: t, drawingId: r }],
|
|
196
192
|
disable: !1
|
|
197
193
|
}
|
|
198
194
|
];
|
|
199
195
|
}
|
|
200
196
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
],
|
|
209
|
-
var
|
|
210
|
-
return
|
|
197
|
+
F = wn([
|
|
198
|
+
se(ce.Rendered, F),
|
|
199
|
+
A(0, N),
|
|
200
|
+
A(1, y(cn)),
|
|
201
|
+
A(2, H),
|
|
202
|
+
A(3, Fe),
|
|
203
|
+
A(4, de)
|
|
204
|
+
], F);
|
|
205
|
+
var _ = function() {
|
|
206
|
+
return _ = Object.assign || function(e) {
|
|
211
207
|
for (var n, t = 1, r = arguments.length; t < r; t++) {
|
|
212
208
|
n = arguments[t];
|
|
213
209
|
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
|
|
214
210
|
}
|
|
215
211
|
return e;
|
|
216
|
-
},
|
|
217
|
-
},
|
|
212
|
+
}, _.apply(this, arguments);
|
|
213
|
+
}, Sn = function(e, n) {
|
|
218
214
|
var t = {};
|
|
219
215
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
|
|
220
216
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
221
217
|
for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
|
|
222
218
|
n.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (t[r[i]] = e[r[i]]);
|
|
223
219
|
return t;
|
|
224
|
-
},
|
|
225
|
-
var t = e.icon, r = e.id, i = e.className, o = e.extend, a =
|
|
226
|
-
return
|
|
220
|
+
}, Ce = fe(function(e, n) {
|
|
221
|
+
var t = e.icon, r = e.id, i = e.className, o = e.extend, a = Sn(e, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), c = he("_".concat(Mn()));
|
|
222
|
+
return De(t, "".concat(r), { defIds: t.defIds, idSuffix: c.current }, _({ ref: n, className: s }, a), o);
|
|
227
223
|
});
|
|
228
|
-
function
|
|
229
|
-
return
|
|
230
|
-
return
|
|
224
|
+
function De(e, n, t, r, i) {
|
|
225
|
+
return ve(e.tag, _(_({ key: n }, Cn(e, t, i)), r), (Dn(e, t).children || []).map(function(o, a) {
|
|
226
|
+
return De(o, "".concat(n, "-").concat(e.tag, "-").concat(a), t, void 0, i);
|
|
231
227
|
}));
|
|
232
228
|
}
|
|
233
|
-
function
|
|
234
|
-
var r =
|
|
229
|
+
function Cn(e, n, t) {
|
|
230
|
+
var r = _({}, e.attrs);
|
|
235
231
|
t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1);
|
|
236
232
|
var i = n.defIds;
|
|
237
233
|
return !i || i.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + n.idSuffix), Object.entries(r).forEach(function(o) {
|
|
@@ -239,227 +235,217 @@ function Mn(e, n, t) {
|
|
|
239
235
|
typeof s == "string" && (r[a] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
|
|
240
236
|
})), r;
|
|
241
237
|
}
|
|
242
|
-
function
|
|
238
|
+
function Dn(e, n) {
|
|
243
239
|
var t, r = n.defIds;
|
|
244
|
-
return !r || r.length === 0 ? e : e.tag === "defs" && (!((t = e.children) === null || t === void 0) && t.length) ?
|
|
245
|
-
return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ?
|
|
240
|
+
return !r || r.length === 0 ? e : e.tag === "defs" && (!((t = e.children) === null || t === void 0) && t.length) ? _(_({}, e), { children: e.children.map(function(i) {
|
|
241
|
+
return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? _(_({}, i), { attrs: _(_({}, i.attrs), { id: i.attrs.id + n.idSuffix }) }) : i;
|
|
246
242
|
}) }) : e;
|
|
247
243
|
}
|
|
248
|
-
function
|
|
244
|
+
function Mn() {
|
|
249
245
|
return Math.random().toString(36).substring(2, 8);
|
|
250
246
|
}
|
|
251
|
-
|
|
252
|
-
var
|
|
253
|
-
return
|
|
247
|
+
Ce.displayName = "UniverIcon";
|
|
248
|
+
var On = { 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" } }] }, Me = fe(function(e, n) {
|
|
249
|
+
return ve(Ce, Object.assign({}, e, {
|
|
254
250
|
id: "add-image-single",
|
|
255
251
|
ref: n,
|
|
256
|
-
icon:
|
|
252
|
+
icon: On
|
|
257
253
|
}));
|
|
258
254
|
});
|
|
259
|
-
|
|
260
|
-
const
|
|
255
|
+
Me.displayName = "AddImageSingle";
|
|
256
|
+
const z = {
|
|
261
257
|
id: "doc.operation.insert-float-image",
|
|
262
|
-
type:
|
|
263
|
-
handler: (
|
|
264
|
-
},
|
|
265
|
-
uploadFileMenu:
|
|
266
|
-
uploadFileMenuInput:
|
|
267
|
-
},
|
|
268
|
-
const e =
|
|
258
|
+
type: S.OPERATION,
|
|
259
|
+
handler: () => !0
|
|
260
|
+
}, Pn = "univer-upload-file-menu", En = "univer-upload-file-menu-input", oe = {
|
|
261
|
+
uploadFileMenu: Pn,
|
|
262
|
+
uploadFileMenuInput: En
|
|
263
|
+
}, yn = () => {
|
|
264
|
+
const e = b(I), n = he(null), t = () => {
|
|
269
265
|
var o;
|
|
270
266
|
(o = n.current) == null || o.click();
|
|
271
|
-
}, r =
|
|
267
|
+
}, r = Je.map((o) => `.${o.replace("image/", "")}`).join(","), i = (o) => {
|
|
272
268
|
const a = o.target.files;
|
|
273
269
|
if (a == null)
|
|
274
270
|
return;
|
|
275
271
|
const s = Array.from(a);
|
|
276
|
-
e.executeCommand(
|
|
272
|
+
e.executeCommand(z.id, { files: s }), n.current && (n.current.value = "");
|
|
277
273
|
};
|
|
278
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ C.createElement("div", { onClick: t, className: oe.uploadFileMenu }, /* @__PURE__ */ C.createElement(
|
|
279
275
|
"input",
|
|
280
276
|
{
|
|
281
277
|
type: "file",
|
|
282
|
-
className:
|
|
278
|
+
className: oe.uploadFileMenuInput,
|
|
283
279
|
ref: n,
|
|
284
280
|
onChange: i,
|
|
285
281
|
accept: r,
|
|
286
282
|
multiple: !0
|
|
287
283
|
}
|
|
288
284
|
));
|
|
289
|
-
},
|
|
290
|
-
function
|
|
285
|
+
}, Oe = "COMPONENT_DOC_UPLOAD_FILE_MENU", Pe = "addition-and-subtraction-single", Ee = "doc.menu.image";
|
|
286
|
+
function bn(e) {
|
|
291
287
|
return {
|
|
292
|
-
id:
|
|
293
|
-
type:
|
|
294
|
-
positions: [
|
|
295
|
-
group:
|
|
296
|
-
icon:
|
|
288
|
+
id: Ee,
|
|
289
|
+
type: ge.SUBITEMS,
|
|
290
|
+
positions: [un.TOOLBAR_START],
|
|
291
|
+
group: mn.TOOLBAR_LAYOUT,
|
|
292
|
+
icon: Pe,
|
|
297
293
|
tooltip: "docImage.title",
|
|
298
|
-
hidden$:
|
|
294
|
+
hidden$: pe(e, E.UNIVER_DOC)
|
|
299
295
|
};
|
|
300
296
|
}
|
|
301
|
-
function
|
|
297
|
+
function Rn(e) {
|
|
302
298
|
return {
|
|
303
|
-
id:
|
|
299
|
+
id: z.id,
|
|
304
300
|
title: "docImage.upload.float",
|
|
305
|
-
type:
|
|
301
|
+
type: ge.SELECTOR,
|
|
306
302
|
label: {
|
|
307
|
-
name:
|
|
303
|
+
name: Oe
|
|
308
304
|
},
|
|
309
|
-
positions: [
|
|
310
|
-
hidden$:
|
|
305
|
+
positions: [Ee],
|
|
306
|
+
hidden$: pe(e, E.UNIVER_DOC)
|
|
311
307
|
};
|
|
312
308
|
}
|
|
313
|
-
const
|
|
314
|
-
imageCommonPanel:
|
|
315
|
-
imageCommonPanelGrid:
|
|
316
|
-
imageCommonPanelBorder:
|
|
317
|
-
imageCommonPanelTitle:
|
|
318
|
-
imageCommonPanelRow:
|
|
319
|
-
imageCommonPanelRowVertical:
|
|
320
|
-
imageCommonPanelColumn:
|
|
321
|
-
imageCommonPanelColumnCenter:
|
|
322
|
-
imageCommonPanelInline:
|
|
323
|
-
imageCommonPanelSpan2:
|
|
324
|
-
imageCommonPanelSpan3:
|
|
325
|
-
imageCommonPanelInput:
|
|
326
|
-
sheetImageMenu:
|
|
327
|
-
sheetImageMenuInput:
|
|
328
|
-
},
|
|
309
|
+
const Un = "univer-image-common-panel", Nn = "univer-image-common-panel-grid", An = "univer-image-common-panel-border", Tn = "univer-image-common-panel-title", xn = "univer-image-common-panel-row", Gn = "univer-image-common-panel-row-vertical", Ln = "univer-image-common-panel-column", jn = "univer-image-common-panel-column-center", Wn = "univer-image-common-panel-inline", Fn = "univer-image-common-panel-span2", $n = "univer-image-common-panel-span3", Vn = "univer-image-common-panel-input", Bn = "univer-sheet-image-menu", Hn = "univer-sheet-image-menu-input", O = {
|
|
310
|
+
imageCommonPanel: Un,
|
|
311
|
+
imageCommonPanelGrid: Nn,
|
|
312
|
+
imageCommonPanelBorder: An,
|
|
313
|
+
imageCommonPanelTitle: Tn,
|
|
314
|
+
imageCommonPanelRow: xn,
|
|
315
|
+
imageCommonPanelRowVertical: Gn,
|
|
316
|
+
imageCommonPanelColumn: Ln,
|
|
317
|
+
imageCommonPanelColumnCenter: jn,
|
|
318
|
+
imageCommonPanelInline: Wn,
|
|
319
|
+
imageCommonPanelSpan2: Fn,
|
|
320
|
+
imageCommonPanelSpan3: $n,
|
|
321
|
+
imageCommonPanelInput: Vn,
|
|
322
|
+
sheetImageMenu: Bn,
|
|
323
|
+
sheetImageMenuInput: Hn
|
|
324
|
+
}, q = {
|
|
329
325
|
id: "doc.command.set-doc-image",
|
|
330
|
-
type:
|
|
326
|
+
type: S.COMMAND,
|
|
331
327
|
handler: (e, n) => {
|
|
332
|
-
const t = e.get(
|
|
328
|
+
const t = e.get(I), r = e.get(U), i = e.get(M);
|
|
333
329
|
if (!n) return !1;
|
|
334
|
-
const { drawings: o } = n, a = i.getBatchUpdateOp(o), { unitId: s, subUnitId: c, undo:
|
|
335
|
-
return t.syncExecuteCommand(
|
|
330
|
+
const { drawings: o } = n, a = i.getBatchUpdateOp(o), { unitId: s, subUnitId: c, undo: u, redo: m, objects: d } = a;
|
|
331
|
+
return t.syncExecuteCommand(p.id, { unitId: s, subUnitId: c, op: m, objects: d, type: f.UPDATE }) ? (r.pushUndoRedo({
|
|
336
332
|
unitID: s,
|
|
337
333
|
undoMutations: [
|
|
338
|
-
{ id:
|
|
339
|
-
{ id:
|
|
334
|
+
{ id: p.id, params: { unitId: s, subUnitId: c, op: u, objects: d, type: f.UPDATE } },
|
|
335
|
+
{ id: w.id, params: [s] }
|
|
340
336
|
],
|
|
341
337
|
redoMutations: [
|
|
342
|
-
{ id:
|
|
343
|
-
{ id:
|
|
338
|
+
{ id: p.id, params: { unitId: s, subUnitId: c, op: m, objects: d, type: f.UPDATE } },
|
|
339
|
+
{ id: w.id, params: [s] }
|
|
344
340
|
]
|
|
345
341
|
}), !0) : !1;
|
|
346
342
|
}
|
|
347
343
|
}, zn = (e) => {
|
|
348
|
-
|
|
349
|
-
const n =
|
|
350
|
-
|
|
344
|
+
b(I);
|
|
345
|
+
const n = b(k);
|
|
346
|
+
b(N);
|
|
347
|
+
const t = b(H), { drawings: r } = e, i = r[0];
|
|
348
|
+
if (i == null)
|
|
351
349
|
return;
|
|
352
|
-
const { unitId:
|
|
353
|
-
if (
|
|
350
|
+
const { unitId: o } = i, a = t.getRenderById(o), s = a == null ? void 0 : a.scene;
|
|
351
|
+
if (s == null)
|
|
354
352
|
return;
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
return p.forEach((O) => {
|
|
360
|
-
const { oKey: U } = O;
|
|
361
|
-
if (f.getDrawingOKey(U) == null)
|
|
362
|
-
return v.push(null), !0;
|
|
363
|
-
}), v;
|
|
364
|
-
}
|
|
365
|
-
Pe(() => {
|
|
366
|
-
const p = d.onClearControlObservable.add((v) => {
|
|
367
|
-
v === !0 && u(!1);
|
|
368
|
-
}), f = d.onChangeStartObservable.add((v) => {
|
|
369
|
-
const { objects: O } = v;
|
|
370
|
-
l(O, t);
|
|
353
|
+
const c = s.getTransformerByCreate(), [u, m] = Z(!0);
|
|
354
|
+
Z(""), Ie(() => {
|
|
355
|
+
const l = c.clearControl$.subscribe((g) => {
|
|
356
|
+
g === !0 && m(!1);
|
|
371
357
|
});
|
|
372
358
|
return () => {
|
|
373
|
-
|
|
359
|
+
l.unsubscribe();
|
|
374
360
|
};
|
|
375
361
|
}, []);
|
|
376
|
-
const
|
|
377
|
-
return /* @__PURE__ */
|
|
378
|
-
},
|
|
379
|
-
const e = N
|
|
380
|
-
return
|
|
362
|
+
const d = (l) => l ? "block" : "none";
|
|
363
|
+
return /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelGrid, O.imageCommonPanelBorder), style: { display: d(u) } }, /* @__PURE__ */ C.createElement("div", { className: O.imageCommonPanelRow }, /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelColumn, O.imageCommonPanelTitle) }, /* @__PURE__ */ C.createElement("div", null, n.t("drawing-anchor.title")))), /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelRow) }, /* @__PURE__ */ C.createElement("div", { className: j(O.imageCommonPanelColumn) })));
|
|
364
|
+
}, Kn = () => {
|
|
365
|
+
const e = b(N), n = e.getFocusDrawings(), [t, r] = Z(n);
|
|
366
|
+
return Ie(() => {
|
|
381
367
|
const i = e.focus$.subscribe((o) => {
|
|
382
368
|
r(o);
|
|
383
369
|
});
|
|
384
370
|
return () => {
|
|
385
371
|
i.unsubscribe();
|
|
386
372
|
};
|
|
387
|
-
}, []), !!(t != null && t.length) && /* @__PURE__ */
|
|
388
|
-
},
|
|
373
|
+
}, []), !!(t != null && t.length) && /* @__PURE__ */ C.createElement("div", { className: O.imageCommonPanel }, /* @__PURE__ */ C.createElement(Xe, { drawings: t }), /* @__PURE__ */ C.createElement(zn, { drawings: t }));
|
|
374
|
+
}, x = {
|
|
389
375
|
id: "doc.command.move-drawing",
|
|
390
|
-
type:
|
|
376
|
+
type: S.COMMAND,
|
|
391
377
|
handler: (e, n) => {
|
|
392
|
-
const t = e.get(
|
|
378
|
+
const t = e.get(I), r = e.get(M), { direction: i } = n, o = r.getFocusDrawings();
|
|
393
379
|
if (o.length === 0)
|
|
394
380
|
return !1;
|
|
395
|
-
const a = o[0].unitId, s = o.map((
|
|
396
|
-
const { transform: m } =
|
|
381
|
+
const a = o[0].unitId, s = o.map((u) => {
|
|
382
|
+
const { transform: m } = u;
|
|
397
383
|
if (m == null)
|
|
398
384
|
return null;
|
|
399
|
-
const
|
|
400
|
-
return i ===
|
|
401
|
-
...
|
|
402
|
-
transform:
|
|
403
|
-
docTransform:
|
|
385
|
+
const d = { ...m }, { left: l = 0, top: g = 0 } = m;
|
|
386
|
+
return i === P.UP ? d.top = g - 1 : i === P.DOWN ? d.top = g + 1 : i === P.LEFT ? d.left = l - 1 : i === P.RIGHT && (d.left = l + 1), {
|
|
387
|
+
...u,
|
|
388
|
+
transform: d,
|
|
389
|
+
docTransform: le(d)
|
|
404
390
|
};
|
|
405
|
-
}).filter((
|
|
406
|
-
return t.syncExecuteCommand(
|
|
391
|
+
}).filter((u) => u != null);
|
|
392
|
+
return t.syncExecuteCommand(q.id, {
|
|
407
393
|
unitId: a,
|
|
408
394
|
drawings: s
|
|
409
|
-
}) ? (t.syncExecuteCommand(
|
|
395
|
+
}) ? (t.syncExecuteCommand(w.id, [a]), !0) : !1;
|
|
410
396
|
}
|
|
411
|
-
},
|
|
397
|
+
}, ye = {
|
|
412
398
|
id: "doc.command.delete-drawing",
|
|
413
|
-
type:
|
|
399
|
+
type: S.COMMAND,
|
|
414
400
|
handler: (e) => {
|
|
415
|
-
const n = e.get(
|
|
401
|
+
const n = e.get(I), r = e.get(M).getFocusDrawings();
|
|
416
402
|
if (r.length === 0)
|
|
417
403
|
return !1;
|
|
418
404
|
const i = r[0].unitId, o = r.map((a) => {
|
|
419
|
-
const { unitId: s, subUnitId: c, drawingId:
|
|
405
|
+
const { unitId: s, subUnitId: c, drawingId: u, drawingType: m } = a;
|
|
420
406
|
return {
|
|
421
407
|
unitId: s,
|
|
422
408
|
subUnitId: c,
|
|
423
|
-
drawingId:
|
|
409
|
+
drawingId: u,
|
|
424
410
|
drawingType: m
|
|
425
411
|
};
|
|
426
412
|
});
|
|
427
|
-
return n.executeCommand(
|
|
413
|
+
return n.executeCommand(X.id, {
|
|
428
414
|
unitId: i,
|
|
429
415
|
drawings: o
|
|
430
416
|
});
|
|
431
417
|
}
|
|
432
|
-
},
|
|
418
|
+
}, be = {
|
|
433
419
|
id: "doc.command.set-drawing-arrange",
|
|
434
|
-
type:
|
|
420
|
+
type: S.COMMAND,
|
|
435
421
|
handler: (e, n) => {
|
|
436
|
-
const t = e.get(
|
|
422
|
+
const t = e.get(I), r = e.get(U);
|
|
437
423
|
if (!n) return !1;
|
|
438
|
-
const i = e.get(
|
|
424
|
+
const i = e.get(M), { unitId: o, subUnitId: a, drawingIds: s, arrangeType: c } = n, u = { unitId: o, subUnitId: a, drawingIds: s };
|
|
439
425
|
let m;
|
|
440
|
-
if (c ===
|
|
426
|
+
if (c === L.forward ? m = i.getForwardDrawingsOp(u) : c === L.backward ? m = i.getBackwardDrawingOp(u) : c === L.front ? m = i.getFrontDrawingsOp(u) : c === L.back && (m = i.getBackDrawingsOp(u)), m == null)
|
|
441
427
|
return !1;
|
|
442
|
-
const { objects:
|
|
443
|
-
return t.syncExecuteCommand(
|
|
428
|
+
const { objects: d, redo: l, undo: g } = m;
|
|
429
|
+
return t.syncExecuteCommand(p.id, { op: l, unitId: o, subUnitId: a, objects: d, type: f.ARRANGE }) ? (r.pushUndoRedo({
|
|
444
430
|
unitID: o,
|
|
445
431
|
undoMutations: [
|
|
446
|
-
{ id:
|
|
432
|
+
{ id: p.id, params: { op: g, unitId: o, subUnitId: a, objects: d, type: f.ARRANGE } }
|
|
447
433
|
],
|
|
448
434
|
redoMutations: [
|
|
449
|
-
{ id:
|
|
435
|
+
{ id: p.id, params: { op: l, unitId: o, subUnitId: a, objects: d, type: f.ARRANGE } }
|
|
450
436
|
]
|
|
451
437
|
}), !0) : !1;
|
|
452
438
|
}
|
|
453
439
|
};
|
|
454
|
-
function
|
|
440
|
+
function Zn(e) {
|
|
455
441
|
const n = [];
|
|
456
442
|
return e.forEach((t) => {
|
|
457
|
-
const { parent: r, children: i } = t, { unitId: o, subUnitId: a, drawingId: s } = r, c =
|
|
458
|
-
const l =
|
|
443
|
+
const { parent: r, children: i } = t, { unitId: o, subUnitId: a, drawingId: s } = r, c = an(0, 0, i.map((d) => d.transform || {})), u = i.map((d) => {
|
|
444
|
+
const l = d.transform || { left: 0, top: 0 }, { unitId: g, subUnitId: h, drawingId: v } = d;
|
|
459
445
|
return {
|
|
460
446
|
unitId: g,
|
|
461
|
-
subUnitId:
|
|
462
|
-
drawingId:
|
|
447
|
+
subUnitId: h,
|
|
448
|
+
drawingId: v,
|
|
463
449
|
transform: {
|
|
464
450
|
...l,
|
|
465
451
|
left: l.left - c.left,
|
|
@@ -471,12 +457,12 @@ function qn(e) {
|
|
|
471
457
|
unitId: o,
|
|
472
458
|
subUnitId: a,
|
|
473
459
|
drawingId: s,
|
|
474
|
-
drawingType:
|
|
460
|
+
drawingType: Q.DRAWING_GROUP,
|
|
475
461
|
transform: c
|
|
476
462
|
};
|
|
477
463
|
n.push({
|
|
478
464
|
parent: m,
|
|
479
|
-
children:
|
|
465
|
+
children: u
|
|
480
466
|
});
|
|
481
467
|
}), n;
|
|
482
468
|
}
|
|
@@ -486,20 +472,20 @@ function Yn(e) {
|
|
|
486
472
|
const { parent: r, children: i } = t, { unitId: o, subUnitId: a, drawingId: s, transform: c = { width: 0, height: 0 } } = r;
|
|
487
473
|
if (c == null)
|
|
488
474
|
return;
|
|
489
|
-
const
|
|
490
|
-
const { transform: l } =
|
|
475
|
+
const u = i.map((d) => {
|
|
476
|
+
const { transform: l } = d, { unitId: g, subUnitId: h, drawingId: v } = d, xe = sn(l || {}, c, c.width || 0, c.height || 0);
|
|
491
477
|
return {
|
|
492
478
|
unitId: g,
|
|
493
|
-
subUnitId:
|
|
494
|
-
drawingId:
|
|
495
|
-
transform:
|
|
479
|
+
subUnitId: h,
|
|
480
|
+
drawingId: v,
|
|
481
|
+
transform: xe,
|
|
496
482
|
groupId: void 0
|
|
497
483
|
};
|
|
498
484
|
}), m = {
|
|
499
485
|
unitId: o,
|
|
500
486
|
subUnitId: a,
|
|
501
487
|
drawingId: s,
|
|
502
|
-
drawingType:
|
|
488
|
+
drawingType: Q.DRAWING_GROUP,
|
|
503
489
|
transform: {
|
|
504
490
|
left: 0,
|
|
505
491
|
top: 0
|
|
@@ -507,177 +493,177 @@ function Yn(e) {
|
|
|
507
493
|
};
|
|
508
494
|
n.push({
|
|
509
495
|
parent: m,
|
|
510
|
-
children:
|
|
496
|
+
children: u
|
|
511
497
|
});
|
|
512
498
|
}), n;
|
|
513
499
|
}
|
|
514
|
-
const
|
|
500
|
+
const Re = {
|
|
515
501
|
id: "doc.command.ungroup-doc-image",
|
|
516
|
-
type:
|
|
502
|
+
type: S.COMMAND,
|
|
517
503
|
handler: (e, n) => {
|
|
518
|
-
const t = e.get(
|
|
504
|
+
const t = e.get(I), r = e.get(U), i = e.get(M);
|
|
519
505
|
if (!n) return !1;
|
|
520
506
|
const o = [];
|
|
521
|
-
n.forEach(({ parent: g, children:
|
|
522
|
-
o.push(g.unitId),
|
|
523
|
-
o.push(
|
|
507
|
+
n.forEach(({ parent: g, children: h }) => {
|
|
508
|
+
o.push(g.unitId), h.forEach((v) => {
|
|
509
|
+
o.push(v.unitId);
|
|
524
510
|
});
|
|
525
511
|
});
|
|
526
|
-
const a = i.getUngroupDrawingOp(n), { unitId: s, subUnitId: c, undo:
|
|
527
|
-
return t.syncExecuteCommand(
|
|
512
|
+
const a = i.getUngroupDrawingOp(n), { unitId: s, subUnitId: c, undo: u, redo: m, objects: d } = a;
|
|
513
|
+
return t.syncExecuteCommand(p.id, { op: m, unitId: s, subUnitId: c, objects: d, type: f.UNGROUP }) ? (r.pushUndoRedo({
|
|
528
514
|
unitID: s,
|
|
529
515
|
undoMutations: [
|
|
530
|
-
{ id:
|
|
531
|
-
{ id:
|
|
516
|
+
{ id: p.id, params: { op: u, unitId: s, subUnitId: c, objects: Zn(d), type: f.GROUP } },
|
|
517
|
+
{ id: w.id, params: o }
|
|
532
518
|
],
|
|
533
519
|
redoMutations: [
|
|
534
|
-
{ id:
|
|
535
|
-
{ id:
|
|
520
|
+
{ id: p.id, params: { op: m, unitId: s, subUnitId: c, objects: d, type: f.UNGROUP } },
|
|
521
|
+
{ id: w.id, params: o }
|
|
536
522
|
]
|
|
537
523
|
}), !0) : !1;
|
|
538
524
|
}
|
|
539
|
-
},
|
|
525
|
+
}, Ue = {
|
|
540
526
|
id: "doc.command.group-doc-image",
|
|
541
|
-
type:
|
|
527
|
+
type: S.COMMAND,
|
|
542
528
|
handler: (e, n) => {
|
|
543
|
-
const t = e.get(
|
|
529
|
+
const t = e.get(I), r = e.get(U), i = e.get(M);
|
|
544
530
|
if (!n) return !1;
|
|
545
531
|
const o = [];
|
|
546
|
-
n.forEach(({ parent: g, children:
|
|
547
|
-
o.push(g.unitId),
|
|
548
|
-
o.push(
|
|
532
|
+
n.forEach(({ parent: g, children: h }) => {
|
|
533
|
+
o.push(g.unitId), h.forEach((v) => {
|
|
534
|
+
o.push(v.unitId);
|
|
549
535
|
});
|
|
550
536
|
});
|
|
551
|
-
const a = i.getGroupDrawingOp(n), { unitId: s, subUnitId: c, undo:
|
|
552
|
-
return t.syncExecuteCommand(
|
|
537
|
+
const a = i.getGroupDrawingOp(n), { unitId: s, subUnitId: c, undo: u, redo: m, objects: d } = a;
|
|
538
|
+
return t.syncExecuteCommand(p.id, { op: m, unitId: s, subUnitId: c, objects: d, type: f.GROUP }) ? (r.pushUndoRedo({
|
|
553
539
|
unitID: s,
|
|
554
540
|
undoMutations: [
|
|
555
|
-
{ id:
|
|
556
|
-
{ id:
|
|
541
|
+
{ id: p.id, params: { op: u, unitId: s, subUnitId: c, objects: Yn(d), type: f.UNGROUP } },
|
|
542
|
+
{ id: w.id, params: o }
|
|
557
543
|
],
|
|
558
544
|
redoMutations: [
|
|
559
|
-
{ id:
|
|
560
|
-
{ id:
|
|
545
|
+
{ id: p.id, params: { op: m, unitId: s, subUnitId: c, objects: d, type: f.GROUP } },
|
|
546
|
+
{ id: w.id, params: o }
|
|
561
547
|
]
|
|
562
548
|
}), !0) : !1;
|
|
563
549
|
}
|
|
564
|
-
},
|
|
550
|
+
}, Ne = {
|
|
565
551
|
id: "doc.command.insert-doc-image",
|
|
566
|
-
type:
|
|
552
|
+
type: S.COMMAND,
|
|
567
553
|
handler: (e, n) => {
|
|
568
|
-
const t = e.get(
|
|
554
|
+
const t = e.get(I), r = e.get(U), i = e.get(M);
|
|
569
555
|
if (!n) return !1;
|
|
570
|
-
const o = n.drawings, a = o.map((
|
|
571
|
-
return t.syncExecuteCommand(
|
|
556
|
+
const o = n.drawings, a = o.map((h) => h.unitId), s = i.getBatchAddOp(o), { unitId: c, subUnitId: u, undo: m, redo: d, objects: l } = s;
|
|
557
|
+
return t.syncExecuteCommand(p.id, { op: d, unitId: c, subUnitId: u, objects: l, type: f.INSERT }) ? (r.pushUndoRedo({
|
|
572
558
|
unitID: c,
|
|
573
559
|
undoMutations: [
|
|
574
|
-
{ id:
|
|
575
|
-
{ id:
|
|
560
|
+
{ id: p.id, params: { op: m, unitId: c, subUnitId: u, objects: l, type: f.REMOVE } },
|
|
561
|
+
{ id: w.id, params: a }
|
|
576
562
|
],
|
|
577
563
|
redoMutations: [
|
|
578
|
-
{ id:
|
|
579
|
-
{ id:
|
|
564
|
+
{ id: p.id, params: { op: d, unitId: c, subUnitId: u, objects: l, type: f.INSERT } },
|
|
565
|
+
{ id: w.id, params: a }
|
|
580
566
|
]
|
|
581
567
|
}), !0) : !1;
|
|
582
568
|
}
|
|
583
569
|
};
|
|
584
|
-
function
|
|
585
|
-
return !e.getContextValue(
|
|
570
|
+
function G(e) {
|
|
571
|
+
return !e.getContextValue($e) && e.getContextValue(V);
|
|
586
572
|
}
|
|
587
|
-
const
|
|
588
|
-
id:
|
|
573
|
+
const kn = {
|
|
574
|
+
id: x.id,
|
|
589
575
|
description: "shortcut.doc.drawing-move-down",
|
|
590
576
|
group: "4_doc-drawing-view",
|
|
591
|
-
binding:
|
|
577
|
+
binding: R.ARROW_DOWN,
|
|
592
578
|
priority: 100,
|
|
593
|
-
preconditions:
|
|
579
|
+
preconditions: G,
|
|
594
580
|
staticParameters: {
|
|
595
|
-
direction:
|
|
581
|
+
direction: P.DOWN
|
|
596
582
|
}
|
|
597
|
-
},
|
|
598
|
-
id:
|
|
583
|
+
}, Qn = {
|
|
584
|
+
id: x.id,
|
|
599
585
|
description: "shortcut.doc.drawing-move-up",
|
|
600
586
|
group: "4_doc-drawing-view",
|
|
601
|
-
binding:
|
|
587
|
+
binding: R.ARROW_UP,
|
|
602
588
|
priority: 100,
|
|
603
|
-
preconditions:
|
|
589
|
+
preconditions: G,
|
|
604
590
|
staticParameters: {
|
|
605
|
-
direction:
|
|
591
|
+
direction: P.UP
|
|
606
592
|
}
|
|
607
|
-
},
|
|
608
|
-
id:
|
|
593
|
+
}, Xn = {
|
|
594
|
+
id: x.id,
|
|
609
595
|
description: "shortcut.doc.drawing-move-left",
|
|
610
596
|
group: "4_doc-drawing-view",
|
|
611
|
-
binding:
|
|
597
|
+
binding: R.ARROW_LEFT,
|
|
612
598
|
priority: 100,
|
|
613
|
-
preconditions:
|
|
599
|
+
preconditions: G,
|
|
614
600
|
staticParameters: {
|
|
615
|
-
direction:
|
|
601
|
+
direction: P.LEFT
|
|
616
602
|
}
|
|
617
|
-
},
|
|
618
|
-
id:
|
|
603
|
+
}, qn = {
|
|
604
|
+
id: x.id,
|
|
619
605
|
description: "shortcut.doc.drawing-move-right",
|
|
620
606
|
group: "4_doc-drawing-view",
|
|
621
|
-
binding:
|
|
607
|
+
binding: R.ARROW_RIGHT,
|
|
622
608
|
priority: 100,
|
|
623
|
-
preconditions:
|
|
609
|
+
preconditions: G,
|
|
624
610
|
staticParameters: {
|
|
625
|
-
direction:
|
|
611
|
+
direction: P.RIGHT
|
|
626
612
|
}
|
|
627
|
-
},
|
|
628
|
-
id:
|
|
613
|
+
}, Jn = {
|
|
614
|
+
id: ye.id,
|
|
629
615
|
description: "shortcut.doc.drawing-delete",
|
|
630
616
|
group: "4_doc-drawing-view",
|
|
631
617
|
// when focusing on any other input tag do not trigger this shortcut
|
|
632
|
-
preconditions:
|
|
633
|
-
binding:
|
|
634
|
-
mac:
|
|
618
|
+
preconditions: G,
|
|
619
|
+
binding: R.DELETE,
|
|
620
|
+
mac: R.BACKSPACE
|
|
635
621
|
};
|
|
636
|
-
var
|
|
637
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
622
|
+
var et = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, tt = (e, n, t, r) => {
|
|
623
|
+
for (var i = r > 1 ? void 0 : r ? nt(n, t) : n, o = e.length - 1, a; o >= 0; o--)
|
|
638
624
|
(a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
|
|
639
|
-
return r && i &&
|
|
640
|
-
},
|
|
641
|
-
let
|
|
625
|
+
return r && i && et(n, t, i), i;
|
|
626
|
+
}, T = (e, n) => (t, r) => n(t, r, e);
|
|
627
|
+
let $ = class extends ue {
|
|
642
628
|
constructor(e, n, t, r, i) {
|
|
643
629
|
super(), this._injector = e, this._componentManager = n, this._menuService = t, this._commandService = r, this._shortcutService = i, this._init();
|
|
644
630
|
}
|
|
645
631
|
_initCustomComponents() {
|
|
646
632
|
const e = this._componentManager;
|
|
647
|
-
this.disposeWithMe(e.register(
|
|
633
|
+
this.disposeWithMe(e.register(Pe, Me)), this.disposeWithMe(e.register(Oe, yn)), this.disposeWithMe(e.register(_e, Kn));
|
|
648
634
|
}
|
|
649
635
|
_initMenus() {
|
|
650
636
|
[
|
|
651
|
-
|
|
652
|
-
|
|
637
|
+
bn,
|
|
638
|
+
Rn
|
|
653
639
|
].forEach((e) => {
|
|
654
640
|
this.disposeWithMe(this._menuService.addMenuItem(this._injector.invoke(e), {}));
|
|
655
641
|
});
|
|
656
642
|
}
|
|
657
643
|
_initCommands() {
|
|
658
644
|
[
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
645
|
+
z,
|
|
646
|
+
Ne,
|
|
647
|
+
X,
|
|
648
|
+
q,
|
|
649
|
+
we,
|
|
650
|
+
w,
|
|
651
|
+
Se,
|
|
652
|
+
Ue,
|
|
653
|
+
Re,
|
|
654
|
+
x,
|
|
655
|
+
ye,
|
|
656
|
+
be
|
|
671
657
|
].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
|
|
672
658
|
}
|
|
673
659
|
_initShortcuts() {
|
|
674
660
|
[
|
|
675
661
|
// sheet drawing shortcuts
|
|
662
|
+
kn,
|
|
676
663
|
Qn,
|
|
677
664
|
Xn,
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
nt
|
|
665
|
+
qn,
|
|
666
|
+
Jn
|
|
681
667
|
].forEach((e) => {
|
|
682
668
|
this.disposeWithMe(this._shortcutService.registerShortcut(e));
|
|
683
669
|
});
|
|
@@ -686,117 +672,96 @@ let Z = class extends ve {
|
|
|
686
672
|
this._initCommands(), this._initCustomComponents(), this._initMenus(), this._initShortcuts();
|
|
687
673
|
}
|
|
688
674
|
};
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
],
|
|
697
|
-
var
|
|
698
|
-
for (var i = r > 1 ? void 0 : r ?
|
|
675
|
+
$ = tt([
|
|
676
|
+
se(ce.Ready, $),
|
|
677
|
+
T(0, y(me)),
|
|
678
|
+
T(1, y(ln)),
|
|
679
|
+
T(2, gn),
|
|
680
|
+
T(3, I),
|
|
681
|
+
T(4, pn)
|
|
682
|
+
], $);
|
|
683
|
+
var rt = Object.defineProperty, it = Object.getOwnPropertyDescriptor, ot = (e, n, t, r) => {
|
|
684
|
+
for (var i = r > 1 ? void 0 : r ? it(n, t) : n, o = e.length - 1, a; o >= 0; o--)
|
|
699
685
|
(a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
|
|
700
|
-
return r && i &&
|
|
686
|
+
return r && i && rt(n, t, i), i;
|
|
701
687
|
}, D = (e, n) => (t, r) => n(t, r, e);
|
|
702
|
-
let
|
|
703
|
-
constructor(e, n, t, r, i, o, a, s, c,
|
|
704
|
-
super(), this.
|
|
705
|
-
}
|
|
706
|
-
_init() {
|
|
707
|
-
this._initCommandListeners(), this._updateDrawingListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
688
|
+
let Y = class extends ue {
|
|
689
|
+
constructor(e, n, t, r, i, o, a, s, c, u) {
|
|
690
|
+
super(), this._context = e, this._commandService = n, this._textSelectionManagerService = t, this._docSkeletonManagerService = r, this._sheetDrawingService = i, this._imageIoService = o, this._drawingManagerService = a, this._contextService = s, this._messageService = c, this._localeService = u, this._initCommandListeners(), this._updateDrawingListener(), this._updateOrderListener(), this._groupDrawingListener(), this._focusDrawingListener();
|
|
708
691
|
}
|
|
709
692
|
/**
|
|
710
693
|
* Upload image to cell or float image
|
|
711
694
|
*/
|
|
712
695
|
_initCommandListeners() {
|
|
713
|
-
this.disposeWithMe(
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
content: this._localeService.t("update-status.exceedMaxCount", String(ue))
|
|
724
|
-
});
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
this._imageIoService.setWaitCount(t), n.files.forEach(async (r) => {
|
|
728
|
-
await this._insertFloatImage(r);
|
|
696
|
+
this.disposeWithMe(this._commandService.onCommandExecuted(async (e) => {
|
|
697
|
+
if (e.id === z.id) {
|
|
698
|
+
const n = e.params;
|
|
699
|
+
if (n.files == null)
|
|
700
|
+
return;
|
|
701
|
+
const t = n.files.length;
|
|
702
|
+
if (t > ee) {
|
|
703
|
+
this._messageService.show({
|
|
704
|
+
type: W.Error,
|
|
705
|
+
content: this._localeService.t("update-status.exceedMaxCount", String(ee))
|
|
729
706
|
});
|
|
707
|
+
return;
|
|
730
708
|
}
|
|
731
|
-
|
|
732
|
-
|
|
709
|
+
this._imageIoService.setWaitCount(t), n.files.forEach(async (r) => {
|
|
710
|
+
await this._insertFloatImage(r);
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
}));
|
|
733
714
|
}
|
|
734
715
|
async _insertFloatImage(e) {
|
|
735
|
-
var
|
|
716
|
+
var g;
|
|
736
717
|
let n;
|
|
737
718
|
try {
|
|
738
719
|
n = await this._imageIoService.saveImage(e);
|
|
739
|
-
} catch (
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
type:
|
|
743
|
-
content: this._localeService.t("update-status.exceedMaxSize", String(
|
|
744
|
-
}) :
|
|
745
|
-
type:
|
|
720
|
+
} catch (h) {
|
|
721
|
+
const v = h.message;
|
|
722
|
+
v === K.ERROR_EXCEED_SIZE ? this._messageService.show({
|
|
723
|
+
type: W.Error,
|
|
724
|
+
content: this._localeService.t("update-status.exceedMaxSize", String(en / (1024 * 1024)))
|
|
725
|
+
}) : v === K.ERROR_IMAGE_TYPE ? this._messageService.show({
|
|
726
|
+
type: W.Error,
|
|
746
727
|
content: this._localeService.t("update-status.invalidImageType")
|
|
747
|
-
}) :
|
|
748
|
-
type:
|
|
728
|
+
}) : v === K.ERROR_IMAGE && this._messageService.show({
|
|
729
|
+
type: W.Error,
|
|
749
730
|
content: this._localeService.t("update-status.invalidImage")
|
|
750
731
|
});
|
|
751
732
|
}
|
|
752
733
|
if (n == null)
|
|
753
734
|
return;
|
|
754
|
-
const t = this.
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
const { width: g, height: p } = l.scene;
|
|
761
|
-
this._imageIoService.addImageSourceCache(o, a, u);
|
|
762
|
-
let f = 1;
|
|
763
|
-
if (d > me || m > le) {
|
|
764
|
-
const G = me / d, T = le / m;
|
|
765
|
-
f = Math.max(G, T);
|
|
735
|
+
const { unitId: t } = this._context, { imageId: r, imageSourceType: i, source: o, base64Cache: a } = n, { width: s, height: c, image: u } = await nn(a || "");
|
|
736
|
+
this._imageIoService.addImageSourceCache(r, i, u);
|
|
737
|
+
let m = 1;
|
|
738
|
+
if (s > ne || c > te) {
|
|
739
|
+
const h = ne / s, v = te / c;
|
|
740
|
+
m = Math.max(h, v);
|
|
766
741
|
}
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
742
|
+
const d = this._getImagePosition(s * m, c * m);
|
|
743
|
+
if (d == null)
|
|
769
744
|
return;
|
|
770
|
-
const
|
|
771
|
-
unitId:
|
|
772
|
-
subUnitId:
|
|
773
|
-
drawingId:
|
|
774
|
-
drawingType:
|
|
775
|
-
imageSourceType:
|
|
776
|
-
source:
|
|
777
|
-
transform:
|
|
778
|
-
docTransform:
|
|
745
|
+
const l = {
|
|
746
|
+
unitId: t,
|
|
747
|
+
subUnitId: t,
|
|
748
|
+
drawingId: r,
|
|
749
|
+
drawingType: Q.DRAWING_IMAGE,
|
|
750
|
+
imageSourceType: i,
|
|
751
|
+
source: o,
|
|
752
|
+
transform: ie(d),
|
|
753
|
+
docTransform: d,
|
|
779
754
|
title: "",
|
|
780
755
|
description: "",
|
|
781
|
-
layoutType:
|
|
782
|
-
};
|
|
783
|
-
this._commandService.executeCommand(Fe.id, {
|
|
784
|
-
unitId: r,
|
|
785
|
-
drawings: [O]
|
|
786
|
-
}), (U = this._docSkeletonManagerService.getCurrent()) == null || U.skeleton.calculate();
|
|
787
|
-
}
|
|
788
|
-
_getUnitInfo() {
|
|
789
|
-
const e = this._univerInstanceService.getCurrentUnitForType(R.UNIVER_DOC);
|
|
790
|
-
if (e == null)
|
|
791
|
-
return;
|
|
792
|
-
const n = e.getUnitId();
|
|
793
|
-
return {
|
|
794
|
-
unitId: n,
|
|
795
|
-
subUnitId: n
|
|
756
|
+
layoutType: Ve.WRAP_SQUARE
|
|
796
757
|
};
|
|
758
|
+
this._commandService.executeCommand(Ne.id, {
|
|
759
|
+
unitId: t,
|
|
760
|
+
drawings: [l]
|
|
761
|
+
}), (g = this._docSkeletonManagerService.getSkeleton()) == null || g.calculate();
|
|
797
762
|
}
|
|
798
|
-
_getImagePosition(e, n
|
|
799
|
-
const
|
|
763
|
+
_getImagePosition(e, n) {
|
|
764
|
+
const t = this._textSelectionManagerService.getActiveTextRange(), r = (t == null ? void 0 : t.getAbsolutePosition()) || {
|
|
800
765
|
left: 0,
|
|
801
766
|
top: 0
|
|
802
767
|
};
|
|
@@ -806,12 +771,12 @@ let q = class extends ve {
|
|
|
806
771
|
height: n
|
|
807
772
|
},
|
|
808
773
|
positionH: {
|
|
809
|
-
relativeFrom:
|
|
810
|
-
posOffset:
|
|
774
|
+
relativeFrom: Be.MARGIN,
|
|
775
|
+
posOffset: r.left
|
|
811
776
|
},
|
|
812
777
|
positionV: {
|
|
813
|
-
relativeFrom:
|
|
814
|
-
posOffset:
|
|
778
|
+
relativeFrom: He.PAGE,
|
|
779
|
+
posOffset: r.top
|
|
815
780
|
},
|
|
816
781
|
angle: 0
|
|
817
782
|
};
|
|
@@ -819,7 +784,7 @@ let q = class extends ve {
|
|
|
819
784
|
_updateOrderListener() {
|
|
820
785
|
this._drawingManagerService.featurePluginOrderUpdate$.subscribe((e) => {
|
|
821
786
|
const { unitId: n, subUnitId: t, drawingIds: r, arrangeType: i } = e;
|
|
822
|
-
this._commandService.executeCommand(
|
|
787
|
+
this._commandService.executeCommand(be.id, {
|
|
823
788
|
unitId: n,
|
|
824
789
|
subUnitId: t,
|
|
825
790
|
drawingIds: r,
|
|
@@ -829,124 +794,105 @@ let q = class extends ve {
|
|
|
829
794
|
}
|
|
830
795
|
_updateDrawingListener() {
|
|
831
796
|
this._drawingManagerService.featurePluginUpdate$.subscribe((e) => {
|
|
797
|
+
if (e.length === 0)
|
|
798
|
+
return;
|
|
832
799
|
const n = [];
|
|
833
|
-
|
|
834
|
-
const { unitId: r, subUnitId: i, drawingId: o,
|
|
800
|
+
if (e.forEach((t) => {
|
|
801
|
+
const { unitId: r, subUnitId: i, drawingId: o, transform: a } = t;
|
|
802
|
+
if (a == null)
|
|
803
|
+
return;
|
|
804
|
+
const s = this._sheetDrawingService.getDrawingByParam({ unitId: r, subUnitId: i, drawingId: o });
|
|
835
805
|
if (s == null)
|
|
836
806
|
return;
|
|
837
|
-
const c =
|
|
807
|
+
const c = le({ ...s.transform, ...a });
|
|
838
808
|
if (c == null)
|
|
839
809
|
return;
|
|
840
|
-
const
|
|
841
|
-
if (d == null)
|
|
842
|
-
return;
|
|
843
|
-
const m = {
|
|
810
|
+
const u = {
|
|
844
811
|
...t,
|
|
845
|
-
transform: { ...
|
|
846
|
-
docTransform: { ...
|
|
812
|
+
transform: { ...a, ...ie(c) },
|
|
813
|
+
docTransform: { ...c }
|
|
847
814
|
};
|
|
848
|
-
n.push(
|
|
849
|
-
}), n.length > 0
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
815
|
+
n.push(u);
|
|
816
|
+
}), n.length > 0) {
|
|
817
|
+
const t = e[0].unitId;
|
|
818
|
+
this._commandService.syncExecuteCommand(q.id, {
|
|
819
|
+
unitId: t,
|
|
820
|
+
drawings: n
|
|
821
|
+
}), this._refreshDocSkeleton();
|
|
822
|
+
}
|
|
853
823
|
});
|
|
854
824
|
}
|
|
855
|
-
_getDocsOffsetInfo() {
|
|
856
|
-
const e = this._docSkeletonManagerService.getCurrent();
|
|
857
|
-
if (e == null)
|
|
858
|
-
return {
|
|
859
|
-
pageMarginCache: /* @__PURE__ */ new Map(),
|
|
860
|
-
docsLeft: 0,
|
|
861
|
-
docsTop: 0
|
|
862
|
-
};
|
|
863
|
-
const { unitId: n, skeleton: t } = e, r = this._renderManagerService.getRenderById(n), i = t == null ? void 0 : t.getSkeletonData();
|
|
864
|
-
if (r == null || !i)
|
|
865
|
-
return {
|
|
866
|
-
pageMarginCache: /* @__PURE__ */ new Map(),
|
|
867
|
-
docsLeft: 0,
|
|
868
|
-
docsTop: 0
|
|
869
|
-
};
|
|
870
|
-
const { mainComponent: o } = r, a = o, { left: s, top: c, pageLayoutType: d, pageMarginLeft: m, pageMarginTop: u } = a, { pages: l } = i, g = new Je(), p = /* @__PURE__ */ new Map();
|
|
871
|
-
for (let f = 0, v = l.length; f < v; f++) {
|
|
872
|
-
const O = l[f], { skeDrawings: U, marginLeft: G, marginTop: T } = O;
|
|
873
|
-
g.translatePagePadding(O), U.forEach((Ve) => {
|
|
874
|
-
const { aLeft: lt, aTop: gt, height: pt, width: ft, drawingId: $e, drawingOrigin: ht } = Ve;
|
|
875
|
-
p.set($e, {
|
|
876
|
-
marginLeft: g.x,
|
|
877
|
-
marginTop: g.y
|
|
878
|
-
});
|
|
879
|
-
}), g.restorePagePadding(O), g.translatePage(O, d, m, u);
|
|
880
|
-
}
|
|
881
|
-
return { pageMarginCache: p, docsLeft: s, docsTop: c };
|
|
882
|
-
}
|
|
883
825
|
_refreshDocSkeleton() {
|
|
884
|
-
const e = this._docSkeletonManagerService.
|
|
885
|
-
|
|
886
|
-
return;
|
|
887
|
-
const { unitId: n, skeleton: t } = e, r = this._renderManagerService.getRenderById(n);
|
|
888
|
-
if (r == null)
|
|
889
|
-
return;
|
|
890
|
-
const { mainComponent: i } = r;
|
|
891
|
-
t == null || t.calculate(), i == null || i.makeDirty();
|
|
826
|
+
const e = this._docSkeletonManagerService.getSkeleton(), { mainComponent: n } = this._context;
|
|
827
|
+
e == null || e.calculate(), n == null || n.makeDirty();
|
|
892
828
|
}
|
|
893
829
|
_groupDrawingListener() {
|
|
894
830
|
this._drawingManagerService.featurePluginGroupUpdate$.subscribe((e) => {
|
|
895
|
-
this._commandService.executeCommand(
|
|
831
|
+
this._commandService.executeCommand(Ue.id, e);
|
|
896
832
|
}), this._drawingManagerService.featurePluginUngroupUpdate$.subscribe((e) => {
|
|
897
|
-
this._commandService.executeCommand(
|
|
833
|
+
this._commandService.executeCommand(Re.id, e);
|
|
898
834
|
});
|
|
899
835
|
}
|
|
900
836
|
_focusDrawingListener() {
|
|
901
837
|
this.disposeWithMe(
|
|
902
838
|
this._drawingManagerService.focus$.subscribe((e) => {
|
|
903
|
-
e == null || e.length === 0 ? (this._contextService.setContextValue(
|
|
839
|
+
e == null || e.length === 0 ? (this._contextService.setContextValue(V, !1), this._sheetDrawingService.focusDrawing([])) : (this._contextService.setContextValue(V, !0), this._sheetDrawingService.focusDrawing(e));
|
|
904
840
|
})
|
|
905
841
|
);
|
|
906
842
|
}
|
|
907
843
|
};
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
D(
|
|
911
|
-
D(
|
|
912
|
-
D(
|
|
913
|
-
D(
|
|
914
|
-
D(
|
|
915
|
-
D(
|
|
916
|
-
D(
|
|
917
|
-
D(
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
], q);
|
|
922
|
-
var ct = Object.defineProperty, dt = Object.getOwnPropertyDescriptor, ut = (e, n, t, r) => {
|
|
923
|
-
for (var i = r > 1 ? void 0 : r ? dt(n, t) : n, o = e.length - 1, a; o >= 0; o--)
|
|
844
|
+
Y = ot([
|
|
845
|
+
D(1, I),
|
|
846
|
+
D(2, y(hn)),
|
|
847
|
+
D(3, y(vn)),
|
|
848
|
+
D(4, M),
|
|
849
|
+
D(5, tn),
|
|
850
|
+
D(6, N),
|
|
851
|
+
D(7, de),
|
|
852
|
+
D(8, fn),
|
|
853
|
+
D(9, y(k))
|
|
854
|
+
], Y);
|
|
855
|
+
var Ae = Object.defineProperty, at = Object.getOwnPropertyDescriptor, st = (e, n, t) => n in e ? Ae(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, ct = (e, n, t, r) => {
|
|
856
|
+
for (var i = r > 1 ? void 0 : r ? at(n, t) : n, o = e.length - 1, a; o >= 0; o--)
|
|
924
857
|
(a = e[o]) && (i = (r ? a(n, t, i) : a(i)) || i);
|
|
925
|
-
return r && i &&
|
|
926
|
-
},
|
|
927
|
-
const
|
|
928
|
-
|
|
929
|
-
let fe = (K = class extends Ye {
|
|
858
|
+
return r && i && Ae(n, t, i), i;
|
|
859
|
+
}, ae = (e, n) => (t, r) => n(t, r, e), Te = (e, n, t) => st(e, typeof n != "symbol" ? n + "" : n, t);
|
|
860
|
+
const dt = "DOCS_DRAWING_UI_PLUGIN";
|
|
861
|
+
let B = class extends ze {
|
|
930
862
|
constructor(e, n, t) {
|
|
931
|
-
super(), this._injector = n, this.
|
|
863
|
+
super(), this._injector = n, this._renderManagerSrv = t;
|
|
932
864
|
}
|
|
933
865
|
onStarting(e) {
|
|
934
|
-
this._initDependencies(e);
|
|
935
|
-
}
|
|
936
|
-
_initDependencies(e) {
|
|
937
866
|
[
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
[Z],
|
|
941
|
-
[q],
|
|
942
|
-
[z]
|
|
867
|
+
[$],
|
|
868
|
+
[F]
|
|
943
869
|
].forEach((t) => e.add(t));
|
|
944
870
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
871
|
+
onReady() {
|
|
872
|
+
[
|
|
873
|
+
Y
|
|
874
|
+
].forEach((e) => this._renderManagerSrv.registerRenderModule(E.UNIVER_DOC, e));
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
Te(B, "type", E.UNIVER_DOC);
|
|
878
|
+
Te(B, "pluginName", dt);
|
|
879
|
+
B = ct([
|
|
880
|
+
Ke(qe, rn, on),
|
|
881
|
+
ae(1, y(me)),
|
|
882
|
+
ae(2, H)
|
|
883
|
+
], B);
|
|
950
884
|
export {
|
|
951
|
-
|
|
885
|
+
w as ClearDocDrawingTransformerOperation,
|
|
886
|
+
ye as DeleteDocDrawingsCommand,
|
|
887
|
+
Se as EditDocDrawingOperation,
|
|
888
|
+
Ue as GroupDocDrawingCommand,
|
|
889
|
+
Ne as InsertDocDrawingCommand,
|
|
890
|
+
z as InsertDocImageOperation,
|
|
891
|
+
x as MoveDocDrawingsCommand,
|
|
892
|
+
X as RemoveDocDrawingCommand,
|
|
893
|
+
be as SetDocDrawingArrangeCommand,
|
|
894
|
+
q as SetDocDrawingCommand,
|
|
895
|
+
we as SidebarDocDrawingOperation,
|
|
896
|
+
Re as UngroupDocDrawingCommand,
|
|
897
|
+
B as UniverDocsDrawingUIPlugin
|
|
952
898
|
};
|