@univerjs/drawing-ui 0.6.10 → 0.7.0-beta.1
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 +15 -2
- package/lib/es/index.js +1090 -1073
- package/lib/index.css +1 -1
- package/lib/index.js +1090 -1073
- package/lib/types/services/drawing-render.service.d.ts +3 -3
- package/lib/types/views/{image-viewer/component-name.d.ts → utils/classnames.d.ts} +3 -1
- package/lib/umd/index.js +15 -2
- package/package.json +10 -11
- package/lib/types/views/image-viewer/ImageViewer.d.ts +0 -6
package/lib/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { UniverInstanceType as
|
|
5
|
-
import { getDrawingShapeKeyByDrawingSearch as
|
|
6
|
-
import { Group as
|
|
7
|
-
import {
|
|
8
|
-
import { jsxs as
|
|
9
|
-
import { useState as
|
|
10
|
-
import {
|
|
11
|
-
import { switchMap as
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
1
|
+
var Dt = Object.defineProperty;
|
|
2
|
+
var Tt = (i, r, t) => r in i ? Dt(i, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[r] = t;
|
|
3
|
+
var te = (i, r, t) => Tt(i, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { UniverInstanceType as Te, DrawingTypeEnum as re, CommandType as Se, ICommandService as he, LocaleService as ie, ArrangeTypeEnum as Ie, Tools as Et, debounce as Me, Inject as ke, Disposable as Ve, checkIfMove as ot, toDisposable as _e, IUniverInstanceService as Ze, ImageSourceType as qe, Injector as Pt, IConfigService as jt, Plugin as Bt, merge as Ut } from "@univerjs/core";
|
|
5
|
+
import { getDrawingShapeKeyByDrawingSearch as W, ImageSourceType as xt, IDrawingManagerService as ae, IImageIoService as ct, SetDrawingSelectedOperation as Ee } from "@univerjs/drawing";
|
|
6
|
+
import { Group as Ce, DRAWING_OBJECT_LAYER_INDEX as Pe, Image as Ke, Rect as lt, IRenderManagerService as me, getGroupState as Ht, transformObjectOutOfGroup as At, RENDER_CLASS_TYPE as Qe, Shape as Lt, Canvas as kt, precisionTo as Re, CURSOR_TYPE as je, Vector2 as $e, degToRad as et } from "@univerjs/engine-render";
|
|
7
|
+
import { IGalleryService as Vt, useDependency as k, ComponentManager as Wt, IMessageService as Gt, IDialogService as $t } from "@univerjs/ui";
|
|
8
|
+
import { jsxs as P, jsx as g, Fragment as zt } from "react/jsx-runtime";
|
|
9
|
+
import { useState as L, forwardRef as X, useRef as dt, createElement as J, useEffect as be } from "react";
|
|
10
|
+
import { Select as ut, Button as ue, clsx as Y, InputNumber as we, Checkbox as Ft, DropdownMenu as Kt, MessageType as tt } from "@univerjs/design";
|
|
11
|
+
import { switchMap as Yt, of as Zt } from "rxjs";
|
|
12
|
+
function rt(i, r, t, e) {
|
|
13
|
+
const n = e.getDrawingByParam(i);
|
|
14
|
+
if (n == null)
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
if (a && !(a instanceof
|
|
16
|
+
const s = W(i), a = t.getObject(s);
|
|
17
|
+
if (a && !(a instanceof Ce))
|
|
18
18
|
return;
|
|
19
19
|
if (a != null) {
|
|
20
|
-
a.addObject(
|
|
20
|
+
a.addObject(r);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const { transform: c } =
|
|
26
|
-
c &&
|
|
23
|
+
const o = new Ce(s);
|
|
24
|
+
t.addObject(o, Pe).attachTransformerTo(o), o.addObject(r);
|
|
25
|
+
const { transform: c } = n;
|
|
26
|
+
c && o.transformByState(
|
|
27
27
|
{
|
|
28
28
|
left: c.left,
|
|
29
29
|
top: c.top,
|
|
@@ -31,209 +31,183 @@ function en(i, t, n, e) {
|
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
var
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
34
|
+
function gt(i, r) {
|
|
35
|
+
var s;
|
|
36
|
+
const t = r ? i.getUnit(r) : i.getFocusedUnit();
|
|
37
|
+
if (t == null)
|
|
38
38
|
return;
|
|
39
|
-
const e =
|
|
40
|
-
let
|
|
41
|
-
return
|
|
39
|
+
const e = t.getUnitId();
|
|
40
|
+
let n;
|
|
41
|
+
return t.type === Te.UNIVER_SHEET ? n = (s = t.getActiveSheet()) == null ? void 0 : s.getSheetId() : (t.type === Te.UNIVER_DOC || t.type === Te.UNIVER_SLIDE) && (n = e), { unitId: e, subUnitId: n, current: t };
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
constructor(i, t, n) {
|
|
52
|
-
this._drawingManagerService = i, this._imageIoService = t, this._dialogService = n;
|
|
43
|
+
var Xt = Object.getOwnPropertyDescriptor, Jt = (i, r, t, e) => {
|
|
44
|
+
for (var n = e > 1 ? void 0 : e ? Xt(r, t) : r, s = i.length - 1, a; s >= 0; s--)
|
|
45
|
+
(a = i[s]) && (n = a(n) || n);
|
|
46
|
+
return n;
|
|
47
|
+
}, ze = (i, r) => (t, e) => r(t, e, i);
|
|
48
|
+
let Be = class {
|
|
49
|
+
constructor(i, r, t) {
|
|
50
|
+
this._drawingManagerService = i, this._imageIoService = r, this._galleryService = t;
|
|
53
51
|
}
|
|
54
52
|
// eslint-disable-next-line max-lines-per-function
|
|
55
|
-
async renderImages(i,
|
|
53
|
+
async renderImages(i, r) {
|
|
56
54
|
const {
|
|
57
|
-
transform:
|
|
55
|
+
transform: t,
|
|
58
56
|
drawingType: e,
|
|
59
|
-
source:
|
|
60
|
-
imageSourceType:
|
|
57
|
+
source: n,
|
|
58
|
+
imageSourceType: s,
|
|
61
59
|
srcRect: a,
|
|
62
|
-
prstGeom:
|
|
60
|
+
prstGeom: o,
|
|
63
61
|
groupId: c,
|
|
64
62
|
unitId: l,
|
|
65
|
-
subUnitId:
|
|
66
|
-
drawingId:
|
|
63
|
+
subUnitId: d,
|
|
64
|
+
drawingId: u,
|
|
67
65
|
isMultiTransform: h,
|
|
68
66
|
transforms: f
|
|
69
67
|
} = i;
|
|
70
|
-
if (e !==
|
|
68
|
+
if (e !== re.DRAWING_IMAGE || !this._drawingManagerService.getDrawingVisible() || t == null)
|
|
71
69
|
return;
|
|
72
|
-
const
|
|
73
|
-
for (const
|
|
74
|
-
const { left:
|
|
70
|
+
const w = h && f ? f : [t], v = [];
|
|
71
|
+
for (const m of w) {
|
|
72
|
+
const { left: C, top: _, width: R, height: b, angle: N, flipX: I, flipY: S, skewX: y, skewY: M } = m, O = w.indexOf(m), j = W({ unitId: l, subUnitId: d, drawingId: u }, h ? O : void 0), T = r.getObject(j);
|
|
75
73
|
if (T != null) {
|
|
76
|
-
T.transformByState({ left:
|
|
74
|
+
T.transformByState({ left: C, top: _, width: R, height: b, angle: N, flipX: I, flipY: S, skewX: y, skewY: M });
|
|
77
75
|
continue;
|
|
78
76
|
}
|
|
79
|
-
const
|
|
80
|
-
let
|
|
81
|
-
if (
|
|
82
|
-
|
|
77
|
+
const se = this._drawingManagerService.getDrawingOrder(l, d), G = se.indexOf(u), Q = { ...m, zIndex: G === -1 ? se.length - 1 : G }, ye = this._imageIoService.getImageSourceCache(n, s);
|
|
78
|
+
let oe = !1;
|
|
79
|
+
if (ye != null)
|
|
80
|
+
Q.image = ye;
|
|
83
81
|
else {
|
|
84
|
-
if (
|
|
82
|
+
if (s === xt.UUID)
|
|
85
83
|
try {
|
|
86
|
-
|
|
87
|
-
} catch (
|
|
88
|
-
console.error(
|
|
84
|
+
Q.url = await this._imageIoService.getImage(n);
|
|
85
|
+
} catch (Ge) {
|
|
86
|
+
console.error(Ge);
|
|
89
87
|
continue;
|
|
90
88
|
}
|
|
91
89
|
else
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
Q.url = n;
|
|
91
|
+
oe = !0;
|
|
94
92
|
}
|
|
95
|
-
if (
|
|
93
|
+
if (r.getObject(j))
|
|
96
94
|
continue;
|
|
97
|
-
|
|
98
|
-
const z = new
|
|
99
|
-
|
|
95
|
+
Q.printable = !0;
|
|
96
|
+
const z = new Ke(j, Q);
|
|
97
|
+
oe && this._imageIoService.addImageSourceCache(n, s, z.getNative()), this._drawingManagerService.getDrawingVisible() && (r.addObject(z, Pe), this._drawingManagerService.getDrawingEditable() && r.attachTransformerTo(z), c && rt({ drawingId: c, unitId: l, subUnitId: d }, z, r, this._drawingManagerService), o != null && z.setPrstGeom(o), a != null && z.setSrcRect(a), v.push(z));
|
|
100
98
|
}
|
|
101
|
-
return
|
|
99
|
+
return v;
|
|
102
100
|
}
|
|
103
|
-
renderFloatDom(i,
|
|
101
|
+
renderFloatDom(i, r) {
|
|
104
102
|
const {
|
|
105
|
-
transform:
|
|
103
|
+
transform: t,
|
|
106
104
|
drawingType: e,
|
|
107
|
-
groupId:
|
|
108
|
-
unitId:
|
|
105
|
+
groupId: n,
|
|
106
|
+
unitId: s,
|
|
109
107
|
subUnitId: a,
|
|
110
|
-
drawingId:
|
|
108
|
+
drawingId: o,
|
|
111
109
|
isMultiTransform: c,
|
|
112
110
|
transforms: l
|
|
113
111
|
} = i;
|
|
114
|
-
if (e !==
|
|
112
|
+
if (e !== re.DRAWING_DOM || !this._drawingManagerService.getDrawingVisible() || t == null)
|
|
115
113
|
return;
|
|
116
|
-
const
|
|
117
|
-
for (const h of
|
|
118
|
-
const { left: f, top:
|
|
114
|
+
const d = c && l ? l : [t], u = [];
|
|
115
|
+
for (const h of d) {
|
|
116
|
+
const { left: f, top: w, width: v, height: m, angle: C, flipX: _, flipY: R, skewX: b, skewY: N } = h, I = d.indexOf(h), S = W({ unitId: s, subUnitId: a, drawingId: o }, c ? I : void 0), y = r.getObject(S);
|
|
119
117
|
if (y != null) {
|
|
120
|
-
y.transformByState({ left: f, top:
|
|
118
|
+
y.transformByState({ left: f, top: w, width: v, height: m, angle: C, flipX: _, flipY: R, skewX: b, skewY: N });
|
|
121
119
|
continue;
|
|
122
120
|
}
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
121
|
+
const M = this._drawingManagerService.getDrawingOrder(s, a), O = M.indexOf(o), j = { ...h, zIndex: O === -1 ? M.length - 1 : O };
|
|
122
|
+
if (r.getObject(S))
|
|
125
123
|
continue;
|
|
126
|
-
|
|
127
|
-
const T = new
|
|
128
|
-
this._drawingManagerService.getDrawingVisible() && (
|
|
124
|
+
j.printable = !1;
|
|
125
|
+
const T = new lt(S, j);
|
|
126
|
+
this._drawingManagerService.getDrawingVisible() && (r.addObject(T, Pe), this._drawingManagerService.getDrawingEditable() && i.allowTransform !== !1 && r.attachTransformerTo(T), n && rt({ drawingId: n, unitId: s, subUnitId: a }, T, r, this._drawingManagerService), u.push(T));
|
|
129
127
|
}
|
|
130
|
-
return
|
|
131
|
-
}
|
|
132
|
-
renderDrawing(i,
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
switch (
|
|
136
|
-
case
|
|
137
|
-
return this.renderImages(
|
|
128
|
+
return u;
|
|
129
|
+
}
|
|
130
|
+
renderDrawing(i, r) {
|
|
131
|
+
const t = this._drawingManagerService.getDrawingByParam(i);
|
|
132
|
+
if (t != null)
|
|
133
|
+
switch (t.drawingType) {
|
|
134
|
+
case re.DRAWING_IMAGE:
|
|
135
|
+
return this.renderImages(t, r);
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
|
-
previewImage(i,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
name: hn,
|
|
148
|
-
props: {
|
|
149
|
-
src: t,
|
|
150
|
-
width: s.width,
|
|
151
|
-
height: s.height
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
destroyOnClose: !0,
|
|
156
|
-
draggable: !1,
|
|
157
|
-
onClose: () => {
|
|
158
|
-
this._dialogService.close(r), c.dispose();
|
|
138
|
+
previewImage(i, r, t, e) {
|
|
139
|
+
this._galleryService.open({
|
|
140
|
+
images: [r],
|
|
141
|
+
// width: adjustSize.width,
|
|
142
|
+
// height: adjustSize.height,
|
|
143
|
+
onOpenChange: (n) => {
|
|
144
|
+
n || this._galleryService.close();
|
|
159
145
|
}
|
|
160
146
|
});
|
|
161
147
|
}
|
|
162
|
-
_adjustImageSize(i,
|
|
163
|
-
if (i <=
|
|
148
|
+
_adjustImageSize(i, r, t, e) {
|
|
149
|
+
if (i <= t && r <= e)
|
|
164
150
|
return {
|
|
165
151
|
width: i,
|
|
166
|
-
height:
|
|
152
|
+
height: r
|
|
167
153
|
};
|
|
168
|
-
const
|
|
154
|
+
const n = t / i, s = e / r, a = Math.min(n, s);
|
|
169
155
|
return {
|
|
170
156
|
width: Math.floor(i * a),
|
|
171
|
-
height: Math.floor(
|
|
157
|
+
height: Math.floor(r * a)
|
|
172
158
|
};
|
|
173
159
|
}
|
|
174
160
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
],
|
|
180
|
-
function
|
|
181
|
-
const
|
|
161
|
+
Be = Jt([
|
|
162
|
+
ze(0, ae),
|
|
163
|
+
ze(1, ct),
|
|
164
|
+
ze(2, Vt)
|
|
165
|
+
], Be);
|
|
166
|
+
function We(i, r) {
|
|
167
|
+
const t = [];
|
|
182
168
|
return i.forEach((e) => {
|
|
183
|
-
const { oKey:
|
|
184
|
-
if (
|
|
185
|
-
return
|
|
186
|
-
const { unitId:
|
|
187
|
-
unitId:
|
|
169
|
+
const { oKey: n, left: s, top: a, height: o, width: c, angle: l } = e, d = r.getDrawingOKey(n);
|
|
170
|
+
if (d == null)
|
|
171
|
+
return t.push(null), !0;
|
|
172
|
+
const { unitId: u, subUnitId: h, drawingId: f, drawingType: w } = d, v = {
|
|
173
|
+
unitId: u,
|
|
188
174
|
subUnitId: h,
|
|
189
175
|
drawingId: f,
|
|
190
|
-
drawingType:
|
|
176
|
+
drawingType: w,
|
|
191
177
|
transform: {
|
|
192
|
-
left:
|
|
178
|
+
left: s,
|
|
193
179
|
top: a,
|
|
194
|
-
height:
|
|
180
|
+
height: o,
|
|
195
181
|
width: c,
|
|
196
182
|
angle: l
|
|
197
183
|
}
|
|
198
184
|
};
|
|
199
|
-
|
|
200
|
-
}),
|
|
185
|
+
w === re.DRAWING_IMAGE && (v.srcRect = e.srcRect), t.push(v);
|
|
186
|
+
}), t;
|
|
201
187
|
}
|
|
202
188
|
var D = /* @__PURE__ */ ((i) => (i.default = "0", i.left = "1", i.center = "2", i.right = "3", i.top = "4", i.middle = "5", i.bottom = "6", i.horizon = "7", i.vertical = "8", i))(D || {});
|
|
203
|
-
const
|
|
189
|
+
const Xe = {
|
|
204
190
|
id: "sheet.operation.set-image-align",
|
|
205
|
-
type:
|
|
206
|
-
handler: (i,
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
imageCommonPanelBorder: et,
|
|
210
|
-
imageCommonPanelTitle: nt,
|
|
211
|
-
imageCommonPanelRow: tt,
|
|
212
|
-
imageCommonPanelRowVertical: rt,
|
|
213
|
-
imageCommonPanelColumn: it,
|
|
214
|
-
imageCommonPanelColumnCenter: at,
|
|
215
|
-
imageCommonPanelInline: ot,
|
|
216
|
-
imageCommonPanelSpan2: st,
|
|
217
|
-
imageCommonPanelSpan3: ct,
|
|
218
|
-
imageCommonPanelInput: lt
|
|
219
|
-
}, gt = (i) => {
|
|
220
|
-
const t = V(me), n = V(te), { alignShow: e } = i, [r, o] = x(D.default), a = [
|
|
191
|
+
type: Se.OPERATION,
|
|
192
|
+
handler: (i, r) => !0
|
|
193
|
+
}, qt = (i) => {
|
|
194
|
+
const r = k(he), t = k(ie), { alignShow: e } = i, [n, s] = L(D.default), a = [
|
|
221
195
|
{
|
|
222
|
-
label:
|
|
196
|
+
label: t.t("image-panel.align.default"),
|
|
223
197
|
value: D.default
|
|
224
198
|
},
|
|
225
199
|
{
|
|
226
200
|
options: [
|
|
227
201
|
{
|
|
228
|
-
label:
|
|
202
|
+
label: t.t("image-panel.align.left"),
|
|
229
203
|
value: D.left
|
|
230
204
|
},
|
|
231
205
|
{
|
|
232
|
-
label:
|
|
206
|
+
label: t.t("image-panel.align.center"),
|
|
233
207
|
value: D.center
|
|
234
208
|
},
|
|
235
209
|
{
|
|
236
|
-
label:
|
|
210
|
+
label: t.t("image-panel.align.right"),
|
|
237
211
|
value: D.right
|
|
238
212
|
}
|
|
239
213
|
]
|
|
@@ -241,15 +215,15 @@ const Ye = {
|
|
|
241
215
|
{
|
|
242
216
|
options: [
|
|
243
217
|
{
|
|
244
|
-
label:
|
|
218
|
+
label: t.t("image-panel.align.top"),
|
|
245
219
|
value: D.top
|
|
246
220
|
},
|
|
247
221
|
{
|
|
248
|
-
label:
|
|
222
|
+
label: t.t("image-panel.align.middle"),
|
|
249
223
|
value: D.middle
|
|
250
224
|
},
|
|
251
225
|
{
|
|
252
|
-
label:
|
|
226
|
+
label: t.t("image-panel.align.bottom"),
|
|
253
227
|
value: D.bottom
|
|
254
228
|
}
|
|
255
229
|
]
|
|
@@ -257,231 +231,263 @@ const Ye = {
|
|
|
257
231
|
{
|
|
258
232
|
options: [
|
|
259
233
|
{
|
|
260
|
-
label:
|
|
234
|
+
label: t.t("image-panel.align.horizon"),
|
|
261
235
|
value: D.horizon
|
|
262
236
|
},
|
|
263
237
|
{
|
|
264
|
-
label:
|
|
238
|
+
label: t.t("image-panel.align.vertical"),
|
|
265
239
|
value: D.vertical
|
|
266
240
|
}
|
|
267
241
|
]
|
|
268
242
|
}
|
|
269
243
|
];
|
|
270
|
-
function
|
|
271
|
-
|
|
244
|
+
function o(l) {
|
|
245
|
+
s(l), r.executeCommand(Xe.id, {
|
|
272
246
|
alignType: l
|
|
273
247
|
});
|
|
274
248
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
249
|
+
return /* @__PURE__ */ P(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
className: `
|
|
253
|
+
univer-relative univer-w-full univer-border-l-0 univer-border-r-0 univer-border-t univer-border-solid
|
|
254
|
+
univer-border-gray-200
|
|
255
|
+
`,
|
|
256
|
+
style: { display: ((l) => l ? "block" : "none")(e) },
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ g(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
className: `
|
|
262
|
+
univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
|
|
263
|
+
`,
|
|
264
|
+
children: /* @__PURE__ */ g("div", { className: "univer-w-full univer-text-gray-900", children: /* @__PURE__ */ g("div", { children: t.t("image-panel.align.title") }) })
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
/* @__PURE__ */ g(
|
|
268
|
+
"div",
|
|
269
|
+
{
|
|
270
|
+
className: `
|
|
271
|
+
univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-start
|
|
272
|
+
`,
|
|
273
|
+
children: /* @__PURE__ */ g("div", { className: "univer-w-full univer-text-gray-900", children: /* @__PURE__ */ g(ut, { value: n, options: a, onChange: o }) })
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
);
|
|
280
279
|
};
|
|
281
280
|
var $ = function() {
|
|
282
281
|
return $ = Object.assign || function(i) {
|
|
283
|
-
for (var
|
|
284
|
-
|
|
285
|
-
for (var
|
|
282
|
+
for (var r, t = 1, e = arguments.length; t < e; t++) {
|
|
283
|
+
r = arguments[t];
|
|
284
|
+
for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (i[n] = r[n]);
|
|
286
285
|
}
|
|
287
286
|
return i;
|
|
288
287
|
}, $.apply(this, arguments);
|
|
289
|
-
},
|
|
290
|
-
var
|
|
291
|
-
for (var e in i) Object.prototype.hasOwnProperty.call(i, e) &&
|
|
288
|
+
}, Qt = function(i, r) {
|
|
289
|
+
var t = {};
|
|
290
|
+
for (var e in i) Object.prototype.hasOwnProperty.call(i, e) && r.indexOf(e) < 0 && (t[e] = i[e]);
|
|
292
291
|
if (i != null && typeof Object.getOwnPropertySymbols == "function")
|
|
293
|
-
for (var
|
|
294
|
-
|
|
295
|
-
return
|
|
296
|
-
},
|
|
297
|
-
var
|
|
298
|
-
return
|
|
292
|
+
for (var n = 0, e = Object.getOwnPropertySymbols(i); n < e.length; n++)
|
|
293
|
+
r.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(i, e[n]) && (t[e[n]] = i[e[n]]);
|
|
294
|
+
return t;
|
|
295
|
+
}, q = X(function(i, r) {
|
|
296
|
+
var t = i.icon, e = i.id, n = i.className, s = i.extend, a = Qt(i, ["icon", "id", "className", "extend"]), o = "univerjs-icon univerjs-icon-".concat(e, " ").concat(n || "").trim(), c = dt("_".concat(rr()));
|
|
297
|
+
return ht(t, "".concat(e), { defIds: t.defIds, idSuffix: c.current }, $({ ref: r, className: o }, a), s);
|
|
299
298
|
});
|
|
300
|
-
function
|
|
301
|
-
return
|
|
302
|
-
return
|
|
299
|
+
function ht(i, r, t, e, n) {
|
|
300
|
+
return J(i.tag, $($({ key: r }, er(i, t, n)), e), (tr(i, t).children || []).map(function(s, a) {
|
|
301
|
+
return ht(s, "".concat(r, "-").concat(i.tag, "-").concat(a), t, void 0, n);
|
|
303
302
|
}));
|
|
304
303
|
}
|
|
305
|
-
function
|
|
304
|
+
function er(i, r, t) {
|
|
306
305
|
var e = $({}, i.attrs);
|
|
307
|
-
|
|
308
|
-
var a =
|
|
309
|
-
a === "mask" && typeof
|
|
306
|
+
t != null && t.colorChannel1 && e.fill === "colorChannel1" && (e.fill = t.colorChannel1), i.tag === "mask" && e.id && (e.id = e.id + r.idSuffix), Object.entries(e).forEach(function(s) {
|
|
307
|
+
var a = s[0], o = s[1];
|
|
308
|
+
a === "mask" && typeof o == "string" && (e[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(r.idSuffix, ")")));
|
|
310
309
|
});
|
|
311
|
-
var
|
|
312
|
-
return !
|
|
313
|
-
var a =
|
|
314
|
-
typeof
|
|
310
|
+
var n = r.defIds;
|
|
311
|
+
return !n || n.length === 0 || (i.tag === "use" && e["xlink:href"] && (e["xlink:href"] = e["xlink:href"] + r.idSuffix), Object.entries(e).forEach(function(s) {
|
|
312
|
+
var a = s[0], o = s[1];
|
|
313
|
+
typeof o == "string" && (e[a] = o.replace(/url\(#(.*)\)/, "url(#$1".concat(r.idSuffix, ")")));
|
|
315
314
|
})), e;
|
|
316
315
|
}
|
|
317
|
-
function
|
|
318
|
-
var
|
|
319
|
-
return !e || e.length === 0 ? i : i.tag === "defs" && (!((
|
|
320
|
-
return typeof
|
|
316
|
+
function tr(i, r) {
|
|
317
|
+
var t, e = r.defIds;
|
|
318
|
+
return !e || e.length === 0 ? i : i.tag === "defs" && (!((t = i.children) === null || t === void 0) && t.length) ? $($({}, i), { children: i.children.map(function(n) {
|
|
319
|
+
return typeof n.attrs.id == "string" && e && e.indexOf(n.attrs.id) > -1 ? $($({}, n), { attrs: $($({}, n.attrs), { id: n.attrs.id + r.idSuffix }) }) : n;
|
|
321
320
|
}) }) : i;
|
|
322
321
|
}
|
|
323
|
-
function
|
|
322
|
+
function rr() {
|
|
324
323
|
return Math.random().toString(36).substring(2, 8);
|
|
325
324
|
}
|
|
326
|
-
|
|
327
|
-
var
|
|
328
|
-
return
|
|
325
|
+
q.displayName = "UniverIcon";
|
|
326
|
+
var nr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M11.0363 12.2367V14.0367C11.0363 14.3681 11.3049 14.6367 11.6363 14.6367C11.9676 14.6367 12.2363 14.3681 12.2363 14.0367V12.2367H14.0364C14.3677 12.2367 14.6364 11.9681 14.6364 11.6367C14.6364 11.3054 14.3677 11.0367 14.0364 11.0367H12.2363V9.23672C12.2363 8.90535 11.9676 8.63672 11.6363 8.63672C11.3049 8.63672 11.0363 8.90535 11.0363 9.23672V11.0367H9.23635C8.90498 11.0367 8.63635 11.3054 8.63635 11.6367C8.63635 11.9681 8.90498 12.2367 9.23635 12.2367H11.0363Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.56365 1.36377C1.90091 1.36377 1.36365 1.90103 1.36365 2.56377V6.16377C1.36365 6.82651 1.90091 7.36377 2.56365 7.36377H6.16365C6.82639 7.36377 7.36365 6.82651 7.36365 6.16377V2.56377C7.36365 1.90103 6.82639 1.36377 6.16365 1.36377H2.56365zM6.16365 2.56377H2.56365L2.56365 6.16377H6.16365V2.56377zM2.56365 8.63647C1.90091 8.63647 1.36365 9.17373 1.36365 9.83647V13.4365C1.36365 14.0992 1.90091 14.6365 2.56365 14.6365H6.16365C6.82639 14.6365 7.36365 14.0992 7.36365 13.4365V9.83647C7.36365 9.17373 6.82639 8.63647 6.16365 8.63647H2.56365zM6.16365 9.83647H2.56365L2.56365 13.4365H6.16365V9.83647zM9.83635 7.36377C9.17361 7.36377 8.63635 6.82651 8.63635 6.16377V2.56377C8.63635 1.90103 9.17361 1.36377 9.83635 1.36377H13.4364C14.0991 1.36377 14.6364 1.90103 14.6364 2.56377V6.16377C14.6364 6.82651 14.0991 7.36377 13.4364 7.36377H9.83635zM9.83635 6.16377V2.56377L13.4364 2.56377V6.16377H9.83635z", fillRule: "evenodd", clipRule: "evenodd" } }] }, ft = X(function(i, r) {
|
|
327
|
+
return J(q, Object.assign({}, i, {
|
|
329
328
|
id: "autofill",
|
|
330
|
-
ref:
|
|
331
|
-
icon:
|
|
329
|
+
ref: r,
|
|
330
|
+
icon: nr
|
|
332
331
|
}));
|
|
333
332
|
});
|
|
334
|
-
|
|
335
|
-
var
|
|
336
|
-
return
|
|
333
|
+
ft.displayName = "Autofill";
|
|
334
|
+
var ir = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.0045 4.4334C14.8881 4.4334 15.6045 3.71705 15.6045 2.8334 15.6045 1.94974 14.8881 1.2334 14.0045 1.2334H3.70449C2.82084 1.2334 2.10449 1.94974 2.10449 2.8334 2.10449 3.71705 2.82084 4.4334 3.70449 4.4334H14.0045zM14.4045 2.8334C14.4045 3.05431 14.2254 3.2334 14.0045 3.2334H3.70449C3.48358 3.2334 3.30449 3.05431 3.30449 2.8334 3.30449 2.61248 3.48358 2.4334 3.70449 2.4334H14.0045C14.2254 2.4334 14.4045 2.61249 14.4045 2.8334zM14.1544 8.5999C15.038 8.5999 15.7544 7.88356 15.7544 6.9999 15.7544 6.11625 15.038 5.3999 14.1544 5.3999H3.85439C2.97074 5.3999 2.25439 6.11625 2.25439 6.9999 2.25439 7.88356 2.97074 8.5999 3.85439 8.5999H14.1544zM14.5544 6.9999C14.5544 7.22082 14.3753 7.3999 14.1544 7.3999H3.85439C3.63348 7.3999 3.45439 7.22082 3.45439 6.9999 3.45439 6.77899 3.63348 6.5999 3.85439 6.5999H14.1544C14.3753 6.5999 14.5544 6.77899 14.5544 6.9999z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.57975 14.5902L6.58023 12.5907C6.34591 12.3564 6.34591 11.9765 6.58023 11.7421 6.81454 11.5078 7.19444 11.5078 7.42876 11.7421L8.40449 12.7179V10.1664C8.40449 9.83504 8.67312 9.56641 9.00449 9.56641 9.33586 9.56641 9.60449 9.83504 9.60449 10.1664V12.7179L10.5802 11.7421C10.8145 11.5078 11.1944 11.5078 11.4288 11.7421 11.6631 11.9765 11.6631 12.3564 11.4288 12.5907L9.42923 14.5902M8.57975 14.5902C8.58121 14.5917 8.58268 14.5931 8.58416 14.5946 8.64077 14.6502 8.70566 14.6923 8.77482 14.7209 8.84557 14.7502 8.92314 14.7664 9.00449 14.7664 9.08585 14.7664 9.16342 14.7502 9.23416 14.7209 9.30332 14.6923 9.36821 14.6502 9.42482 14.5946" } }] }, mt = X(function(i, r) {
|
|
335
|
+
return J(q, Object.assign({}, i, {
|
|
337
336
|
id: "bottom-single",
|
|
338
|
-
ref:
|
|
339
|
-
icon:
|
|
337
|
+
ref: r,
|
|
338
|
+
icon: ir
|
|
340
339
|
}));
|
|
341
340
|
});
|
|
342
|
-
|
|
343
|
-
var
|
|
344
|
-
return
|
|
341
|
+
mt.displayName = "BottomSingle";
|
|
342
|
+
var ar = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.97705 7.51296C5.97705 7.18159 6.24568 6.91296 6.57705 6.91296H8.48632C8.81769 6.91296 9.08632 7.18159 9.08632 7.51296 9.08632 7.84433 8.81769 8.11296 8.48632 8.11296H6.57705C6.24568 8.11296 5.97705 7.84433 5.97705 7.51296zM6.57705 9.41028C6.24568 9.41028 5.97705 9.67891 5.97705 10.0103 5.97705 10.3416 6.24568 10.6103 6.57705 10.6103H10.8199C11.1512 10.6103 11.4199 10.3416 11.4199 10.0103 11.4199 9.67891 11.1512 9.41028 10.8199 9.41028H6.57705z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.51074 2.37063C3.51074 1.48697 4.22709 0.77063 5.11074 0.77063H9.80318L9.81294 0.770708C9.97168 0.768161 10.1311 0.82824 10.2511 0.95055L14.4317 5.21408C14.5165 5.30049 14.5697 5.406 14.5917 5.51645C14.6041 5.5644 14.6106 5.61467 14.6106 5.66648V11.6406C14.6106 12.5243 13.8943 13.2406 13.0106 13.2406H5.11074C4.22709 13.2406 3.51074 12.5243 3.51074 11.6406V2.37063ZM10.4032 4.66648V2.81964L12.6063 5.06648H10.8032C10.5823 5.06648 10.4032 4.88739 10.4032 4.66648ZM5.11074 1.97063C4.88983 1.97063 4.71074 2.14972 4.71074 2.37063V11.6406C4.71074 11.8615 4.88983 12.0406 5.11074 12.0406H13.0106C13.2316 12.0406 13.4106 11.8615 13.4106 11.6406V6.26648H10.8032C9.91953 6.26648 9.20318 5.55013 9.20318 4.66648V1.97063H5.11074Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M2.58916 6.6741C2.58916 6.34273 2.32053 6.0741 1.98916 6.0741C1.65779 6.0741 1.38916 6.34273 1.38916 6.6741V12.6294C1.38916 14.0653 2.55322 15.2294 3.98916 15.2294H9.41408C9.74545 15.2294 10.0141 14.9607 10.0141 14.6294C10.0141 14.298 9.74545 14.0294 9.41408 14.0294H3.98916C3.21596 14.0294 2.58916 13.4026 2.58916 12.6294V6.6741Z" } }] }, pt = X(function(i, r) {
|
|
343
|
+
return J(q, Object.assign({}, i, {
|
|
345
344
|
id: "create-copy-single",
|
|
346
|
-
ref:
|
|
347
|
-
icon:
|
|
345
|
+
ref: r,
|
|
346
|
+
icon: ar
|
|
348
347
|
}));
|
|
349
348
|
});
|
|
350
|
-
|
|
351
|
-
var
|
|
352
|
-
return
|
|
349
|
+
pt.displayName = "CreateCopySingle";
|
|
350
|
+
var sr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.38125 1.16211C6.49759 1.16211 5.78125 1.87845 5.78125 2.76211V5.6377H2.87783C1.99418 5.6377 1.27783 6.35404 1.27783 7.2377V13.2377C1.27783 14.1214 1.99418 14.8377 2.87783 14.8377H8.87783C9.76149 14.8377 10.4778 14.1214 10.4778 13.2377V10.3621H13.3813C14.2649 10.3621 14.9813 9.64577 14.9813 8.76211V2.76211C14.9813 1.87845 14.2649 1.16211 13.3813 1.16211H7.38125ZM10.4778 9.16211H13.3813C13.6022 9.16211 13.7812 8.98302 13.7812 8.76211V2.76211C13.7812 2.5412 13.6022 2.36211 13.3813 2.36211H7.38125C7.16034 2.36211 6.98125 2.5412 6.98125 2.76211V5.6377H8.87783C9.76149 5.6377 10.4778 6.35404 10.4778 7.2377V9.16211ZM6.98125 6.8377H8.87783C9.09875 6.8377 9.27783 7.01678 9.27783 7.2377V9.16211H7.38125C7.16034 9.16211 6.98125 8.98302 6.98125 8.76211V6.8377ZM5.78125 6.8377V8.76211C5.78125 9.64577 6.49759 10.3621 7.38125 10.3621H9.27783V13.2377C9.27783 13.4586 9.09875 13.6377 8.87783 13.6377H2.87783C2.65692 13.6377 2.47783 13.4586 2.47783 13.2377V7.2377C2.47783 7.01678 2.65692 6.8377 2.87783 6.8377H5.78125Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vt = X(function(i, r) {
|
|
351
|
+
return J(q, Object.assign({}, i, {
|
|
353
352
|
id: "group-single",
|
|
354
|
-
ref:
|
|
355
|
-
icon:
|
|
353
|
+
ref: r,
|
|
354
|
+
icon: sr
|
|
356
355
|
}));
|
|
357
356
|
});
|
|
358
|
-
|
|
359
|
-
var
|
|
360
|
-
return
|
|
357
|
+
vt.displayName = "GroupSingle";
|
|
358
|
+
var or = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, wt = X(function(i, r) {
|
|
359
|
+
return J(q, Object.assign({}, i, {
|
|
361
360
|
id: "more-down-single",
|
|
362
|
-
ref:
|
|
363
|
-
icon:
|
|
361
|
+
ref: r,
|
|
362
|
+
icon: or
|
|
364
363
|
}));
|
|
365
364
|
});
|
|
366
|
-
|
|
367
|
-
var
|
|
368
|
-
return
|
|
365
|
+
wt.displayName = "MoreDownSingle";
|
|
366
|
+
var cr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 2.96401C1.25 3.84767 1.96634 4.56401 2.85 4.56401H13.15C14.0337 4.56401 14.75 3.84767 14.75 2.96401C14.75 2.08036 14.0337 1.36401 13.15 1.36401H2.85C1.96635 1.36401 1.25 2.08036 1.25 2.96401ZM2.85 3.36401C2.62909 3.36401 2.45 3.18493 2.45 2.96401C2.45 2.7431 2.62909 2.56401 2.85 2.56401H13.15C13.3709 2.56401 13.55 2.7431 13.55 2.96401C13.55 3.18493 13.3709 3.36401 13.15 3.36401H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.57564 11.6118C5.80995 11.3774 6.18985 11.3774 6.42417 11.6118L7.3999 12.5875V6.36951C7.3999 6.03814 7.66853 5.76951 7.9999 5.76951C8.33127 5.76951 8.5999 6.03814 8.5999 6.36951V12.5875L9.57564 11.6118C9.80995 11.3774 10.1899 11.3774 10.4242 11.6118C10.6585 11.8461 10.6585 12.226 10.4242 12.4603L8.4324 14.452C8.32324 14.5655 8.16982 14.6362 7.9999 14.6362C7.82998 14.6362 7.67655 14.5655 7.56739 14.452L5.57564 12.4603C5.34132 12.226 5.34132 11.8461 5.57564 11.6118Z" } }] }, _t = X(function(i, r) {
|
|
367
|
+
return J(q, Object.assign({}, i, {
|
|
369
368
|
id: "move-down-single",
|
|
370
|
-
ref:
|
|
371
|
-
icon:
|
|
369
|
+
ref: r,
|
|
370
|
+
icon: cr
|
|
372
371
|
}));
|
|
373
372
|
});
|
|
374
|
-
|
|
375
|
-
var
|
|
376
|
-
return
|
|
373
|
+
_t.displayName = "MoveDownSingle";
|
|
374
|
+
var lr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.25 13.036C1.25 12.1523 1.96634 11.436 2.85 11.436H13.15C14.0337 11.436 14.75 12.1523 14.75 13.036C14.75 13.9196 14.0337 14.636 13.15 14.636H2.85C1.96635 14.636 1.25 13.9196 1.25 13.036ZM2.85 12.636C2.62909 12.636 2.45 12.8151 2.45 13.036C2.45 13.2569 2.62909 13.436 2.85 13.436H13.15C13.3709 13.436 13.55 13.2569 13.55 13.036C13.55 12.8151 13.3709 12.636 13.15 12.636H2.85Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M5.57564 4.38825C5.80995 4.62256 6.18985 4.62256 6.42417 4.38825L7.3999 3.41251V9.63049C7.3999 9.96186 7.66853 10.2305 7.9999 10.2305C8.33127 10.2305 8.5999 9.96186 8.5999 9.63049V3.41251L9.57564 4.38825C9.80995 4.62256 10.1899 4.62256 10.4242 4.38825C10.6585 4.15393 10.6585 3.77403 10.4242 3.53972L8.4324 1.54796C8.32324 1.43445 8.16982 1.36382 7.9999 1.36382C7.82998 1.36382 7.67655 1.43446 7.56739 1.54797L5.57564 3.53972C5.34132 3.77403 5.34132 4.15393 5.57564 4.38825Z" } }] }, Ct = X(function(i, r) {
|
|
375
|
+
return J(q, Object.assign({}, i, {
|
|
377
376
|
id: "move-up-single",
|
|
378
|
-
ref:
|
|
379
|
-
icon:
|
|
377
|
+
ref: r,
|
|
378
|
+
icon: lr
|
|
380
379
|
}));
|
|
381
380
|
});
|
|
382
|
-
|
|
383
|
-
var
|
|
384
|
-
return
|
|
381
|
+
Ct.displayName = "MoveUpSingle";
|
|
382
|
+
var dr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.82994 1.40913C7.88746 1.35161 7.95376 1.30821 8.02453 1.27893C8.09527 1.24959 8.17285 1.2334 8.2542 1.2334C8.33555 1.2334 8.41313 1.24959 8.48387 1.27893C8.55464 1.30821 8.62094 1.35161 8.67846 1.40913L10.6785 3.40913C10.9128 3.64345 10.9128 4.02335 10.6785 4.25766C10.4441 4.49198 10.0642 4.49198 9.82994 4.25766L8.8542 3.28193V5.8334C8.8542 6.16477 8.58557 6.4334 8.2542 6.4334C7.92283 6.4334 7.6542 6.16477 7.6542 5.8334V3.28193L6.67846 4.25766C6.44415 4.49198 6.06425 4.49198 5.82994 4.25766C5.59562 4.02335 5.59562 3.64345 5.82994 3.40913L7.82994 1.40913Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.50439 9C1.50439 8.11634 2.22074 7.4 3.10439 7.4H13.4044C14.288 7.4 15.0044 8.11634 15.0044 9 15.0044 9.88366 14.2881 10.6 13.4044 10.6H3.1044C2.22074 10.6 1.50439 9.88366 1.50439 9zM3.10439 8.6C2.88348 8.6 2.70439 8.77909 2.70439 9 2.70439 9.22091 2.88348 9.4 3.1044 9.4H13.4044C13.6253 9.4 13.8044 9.22091 13.8044 9 13.8044 8.77909 13.6253 8.6 13.4044 8.6H3.10439zM1.6543 13.1665C1.6543 12.2828 2.37064 11.5665 3.2543 11.5665H13.5543C14.438 11.5665 15.1543 12.2828 15.1543 13.1665 15.1543 14.0502 14.438 14.7665 13.5543 14.7665H3.2543C2.37064 14.7665 1.6543 14.0502 1.6543 13.1665zM3.2543 12.7665C3.03338 12.7665 2.8543 12.9456 2.8543 13.1665 2.8543 13.3874 3.03338 13.5665 3.2543 13.5665H13.5543C13.7752 13.5665 13.9543 13.3874 13.9543 13.1665 13.9543 12.9456 13.7752 12.7665 13.5543 12.7665H3.2543z", fillRule: "evenodd", clipRule: "evenodd" } }] }, St = X(function(i, r) {
|
|
383
|
+
return J(q, Object.assign({}, i, {
|
|
385
384
|
id: "topmost-single",
|
|
386
|
-
ref:
|
|
387
|
-
icon:
|
|
385
|
+
ref: r,
|
|
386
|
+
icon: dr
|
|
388
387
|
}));
|
|
389
388
|
});
|
|
390
|
-
|
|
391
|
-
var
|
|
392
|
-
return
|
|
389
|
+
St.displayName = "TopmostSingle";
|
|
390
|
+
var ur = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.46855 2.83731C7.46855 2.61639 7.64764 2.4373 7.86855 2.4373H13.8603C14.0812 2.4373 14.2603 2.61639 14.2603 2.8373V9.5049C14.2603 9.72581 14.0812 9.90489 13.8603 9.90489H12.866C12.5346 9.90489 12.266 10.1735 12.266 10.5049C12.266 10.8363 12.5346 11.1049 12.866 11.1049H13.8603C14.7439 11.1049 15.4603 10.3886 15.4603 9.5049V2.8373C15.4603 1.95365 14.7439 1.2373 13.8603 1.2373H7.86855C6.9849 1.2373 6.26855 1.95365 6.26855 2.83731V3.48688C6.26855 3.81825 6.53718 4.08688 6.86855 4.08688C7.19993 4.08688 7.46855 3.81825 7.46855 3.48688V2.83731Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.19888 5.56299C2.31522 5.56299 1.59888 6.27933 1.59888 7.16299V13.163C1.59888 14.0466 2.31522 14.763 3.19888 14.763H9.19888C10.0825 14.763 10.7989 14.0466 10.7989 13.163V7.16299C10.7989 6.27933 10.0825 5.56299 9.19888 5.56299H3.19888ZM2.79888 7.16299C2.79888 6.94207 2.97796 6.76299 3.19888 6.76299H9.19888C9.41979 6.76299 9.59888 6.94207 9.59888 7.16299V13.163C9.59888 13.3839 9.41979 13.563 9.19888 13.563H3.19888C2.97796 13.563 2.79888 13.3839 2.79888 13.163V7.16299Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, bt = X(function(i, r) {
|
|
391
|
+
return J(q, Object.assign({}, i, {
|
|
393
392
|
id: "ungroup-single",
|
|
394
|
-
ref:
|
|
395
|
-
icon:
|
|
393
|
+
ref: r,
|
|
394
|
+
icon: ur
|
|
396
395
|
}));
|
|
397
396
|
});
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
const { arrangeShow:
|
|
401
|
-
|
|
402
|
-
const l =
|
|
403
|
-
|
|
397
|
+
bt.displayName = "UngroupSingle";
|
|
398
|
+
const U = "univer-relative univer-mt-2.5 univer-flex univer-h-full univer-items-start univer-justify-between univer-gap-2 univer-flex-no-wrap", B = "univer-w-full univer-text-left univer-text-gray-400", ne = "univer-flex univer-items-center univer-gap-1", gr = (i) => {
|
|
399
|
+
const { arrangeShow: r, drawings: t } = i, e = k(ie), n = k(ae), s = (l) => l ? "block" : "none", [a, o] = L(t);
|
|
400
|
+
be(() => {
|
|
401
|
+
const l = n.focus$.subscribe((d) => {
|
|
402
|
+
o(d);
|
|
404
403
|
});
|
|
405
404
|
return () => {
|
|
406
405
|
l.unsubscribe();
|
|
407
406
|
};
|
|
408
407
|
}, []);
|
|
409
408
|
const c = (l) => {
|
|
410
|
-
const
|
|
411
|
-
|
|
409
|
+
const d = a[0].unitId, u = a[0].subUnitId, h = a.map((f) => f.drawingId);
|
|
410
|
+
n.featurePluginOrderUpdateNotification({ unitId: d, subUnitId: u, drawingIds: h, arrangeType: l });
|
|
412
411
|
};
|
|
413
|
-
return /* @__PURE__ */
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
412
|
+
return /* @__PURE__ */ P(
|
|
413
|
+
"div",
|
|
414
|
+
{
|
|
415
|
+
className: "univer-relative univer-mt-5 univer-w-full",
|
|
416
|
+
style: { display: s(r) },
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: e.t("image-panel.arrange.title") }) }) }),
|
|
419
|
+
/* @__PURE__ */ P("div", { className: U, children: [
|
|
420
|
+
/* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
|
|
421
|
+
c(Ie.forward);
|
|
422
|
+
}, children: /* @__PURE__ */ P("span", { className: ne, children: [
|
|
423
|
+
/* @__PURE__ */ g(Ct, {}),
|
|
424
|
+
e.t("image-panel.arrange.forward")
|
|
425
|
+
] }) }) }),
|
|
426
|
+
/* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
|
|
427
|
+
c(Ie.backward);
|
|
428
|
+
}, children: /* @__PURE__ */ P("span", { className: ne, children: [
|
|
429
|
+
/* @__PURE__ */ g(_t, {}),
|
|
430
|
+
e.t("image-panel.arrange.backward")
|
|
431
|
+
] }) }) })
|
|
432
|
+
] }),
|
|
433
|
+
/* @__PURE__ */ P("div", { className: U, children: [
|
|
434
|
+
/* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
|
|
435
|
+
c(Ie.front);
|
|
436
|
+
}, children: /* @__PURE__ */ P("span", { className: ne, children: [
|
|
437
|
+
/* @__PURE__ */ g(St, {}),
|
|
438
|
+
e.t("image-panel.arrange.front")
|
|
439
|
+
] }) }) }),
|
|
440
|
+
/* @__PURE__ */ g("div", { className: "univer-w-1/2", children: /* @__PURE__ */ g(ue, { onClick: () => {
|
|
441
|
+
c(Ie.back);
|
|
442
|
+
}, children: /* @__PURE__ */ P("span", { className: ne, children: [
|
|
443
|
+
/* @__PURE__ */ g(mt, {}),
|
|
444
|
+
e.t("image-panel.arrange.back")
|
|
445
|
+
] }) }) })
|
|
446
|
+
] })
|
|
447
|
+
]
|
|
448
|
+
}
|
|
449
|
+
);
|
|
450
|
+
}, hr = (i) => {
|
|
451
|
+
const r = k(ie), t = k(me), e = k(ae), { hasGroup: n, drawings: s } = i, [a, o] = L(!1), [c, l] = L(!0), [d, u] = L(!0), h = (m) => m ? "block" : "none", f = () => {
|
|
452
|
+
const m = e.getFocusDrawings(), { unitId: C, subUnitId: _ } = m[0], R = Et.generateRandomId(10), b = Ht(0, 0, m.map((S) => S.transform || {})), N = {
|
|
453
|
+
unitId: C,
|
|
448
454
|
subUnitId: _,
|
|
449
|
-
drawingId:
|
|
450
|
-
drawingType:
|
|
451
|
-
transform:
|
|
452
|
-
},
|
|
453
|
-
const y =
|
|
455
|
+
drawingId: R,
|
|
456
|
+
drawingType: re.DRAWING_GROUP,
|
|
457
|
+
transform: b
|
|
458
|
+
}, I = m.map((S) => {
|
|
459
|
+
const y = S.transform || { left: 0, top: 0 }, { unitId: M, subUnitId: O, drawingId: j } = S;
|
|
454
460
|
return {
|
|
455
|
-
unitId:
|
|
461
|
+
unitId: M,
|
|
456
462
|
subUnitId: O,
|
|
457
|
-
drawingId:
|
|
463
|
+
drawingId: j,
|
|
458
464
|
transform: {
|
|
459
465
|
...y,
|
|
460
|
-
left: y.left -
|
|
461
|
-
top: y.top -
|
|
466
|
+
left: y.left - b.left,
|
|
467
|
+
top: y.top - b.top
|
|
462
468
|
},
|
|
463
|
-
groupId:
|
|
469
|
+
groupId: R
|
|
464
470
|
};
|
|
465
471
|
});
|
|
466
472
|
e.featurePluginGroupUpdateNotification([{
|
|
467
473
|
parent: N,
|
|
468
|
-
children:
|
|
474
|
+
children: I
|
|
469
475
|
}]);
|
|
470
|
-
},
|
|
471
|
-
if (
|
|
476
|
+
}, w = (m) => {
|
|
477
|
+
if (m.drawingType !== re.DRAWING_GROUP)
|
|
472
478
|
return;
|
|
473
|
-
const { unitId:
|
|
474
|
-
if (
|
|
479
|
+
const { unitId: C, subUnitId: _, drawingId: R, transform: b = { width: 0, height: 0 } } = m;
|
|
480
|
+
if (b == null)
|
|
475
481
|
return;
|
|
476
|
-
const N = e.getDrawingsByGroup({ unitId:
|
|
482
|
+
const N = e.getDrawingsByGroup({ unitId: C, subUnitId: _, drawingId: R });
|
|
477
483
|
if (N.length === 0)
|
|
478
484
|
return;
|
|
479
|
-
const
|
|
480
|
-
const { transform: y } =
|
|
485
|
+
const I = N.map((S) => {
|
|
486
|
+
const { transform: y } = S, { unitId: M, subUnitId: O, drawingId: j } = S, T = At(y || {}, b, b.width || 0, b.height || 0);
|
|
481
487
|
return {
|
|
482
|
-
unitId:
|
|
488
|
+
unitId: M,
|
|
483
489
|
subUnitId: O,
|
|
484
|
-
drawingId:
|
|
490
|
+
drawingId: j,
|
|
485
491
|
transform: {
|
|
486
492
|
...y,
|
|
487
493
|
...T
|
|
@@ -490,388 +496,402 @@ const yt = (i) => {
|
|
|
490
496
|
};
|
|
491
497
|
});
|
|
492
498
|
return {
|
|
493
|
-
parent:
|
|
494
|
-
children:
|
|
499
|
+
parent: m,
|
|
500
|
+
children: I
|
|
495
501
|
};
|
|
496
|
-
},
|
|
497
|
-
const
|
|
498
|
-
(_) =>
|
|
502
|
+
}, v = () => {
|
|
503
|
+
const C = e.getFocusDrawings().map(
|
|
504
|
+
(_) => w(_)
|
|
499
505
|
).filter((_) => _ != null);
|
|
500
|
-
|
|
506
|
+
C.length !== 0 && e.featurePluginUngroupUpdateNotification(C);
|
|
501
507
|
};
|
|
502
|
-
return
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
508
|
+
return be(() => {
|
|
509
|
+
const m = s[0];
|
|
510
|
+
if (m == null)
|
|
505
511
|
return;
|
|
506
|
-
const { unitId:
|
|
507
|
-
if (
|
|
512
|
+
const { unitId: C } = m, _ = t.getRenderById(C), R = _ == null ? void 0 : _.scene;
|
|
513
|
+
if (R == null)
|
|
508
514
|
return;
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
}),
|
|
512
|
-
const { objects: y } =
|
|
513
|
-
let
|
|
514
|
-
|
|
515
|
+
const b = R.getTransformerByCreate(), N = b.clearControl$.subscribe((S) => {
|
|
516
|
+
S === !0 && o(!1);
|
|
517
|
+
}), I = b.changeStart$.subscribe((S) => {
|
|
518
|
+
const { objects: y } = S, M = We(y, e), O = M.filter((G) => (G == null ? void 0 : G.drawingType) === re.DRAWING_GROUP);
|
|
519
|
+
let j = !1, T = !1;
|
|
520
|
+
M.length > 1 && (j = !0), O.length > 0 && (T = !0), o(j || T), l(j), u(T);
|
|
515
521
|
});
|
|
516
522
|
return () => {
|
|
517
|
-
|
|
523
|
+
I.unsubscribe(), N.unsubscribe();
|
|
518
524
|
};
|
|
519
|
-
}, []), /* @__PURE__ */
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
/* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
525
|
+
}, []), /* @__PURE__ */ P("div", { className: "univer-relative univer-mt-5 univer-w-full", style: { display: h(n === !0 ? a : !1) }, children: [
|
|
526
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: r.t("image-panel.group.title") }) }) }),
|
|
527
|
+
/* @__PURE__ */ P("div", { className: U, children: [
|
|
528
|
+
/* @__PURE__ */ g("div", { className: Y(ne, "univer-justify-center"), children: /* @__PURE__ */ g(ue, { style: { display: h(c) }, onClick: f, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
529
|
+
/* @__PURE__ */ g(vt, {}),
|
|
530
|
+
r.t("image-panel.group.group")
|
|
525
531
|
] }) }) }),
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
/* @__PURE__ */
|
|
528
|
-
|
|
532
|
+
/* @__PURE__ */ g("div", { className: Y(ne, "univer-justify-center"), children: /* @__PURE__ */ g(ue, { style: { display: h(d) }, onClick: v, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
533
|
+
/* @__PURE__ */ g(bt, {}),
|
|
534
|
+
r.t("image-panel.group.unGroup")
|
|
529
535
|
] }) }) })
|
|
530
536
|
] })
|
|
531
537
|
] });
|
|
532
|
-
},
|
|
533
|
-
var
|
|
534
|
-
const
|
|
538
|
+
}, le = 20, fr = 20, mr = [-3600, 3600], Oe = 300, pr = (i) => {
|
|
539
|
+
var Je;
|
|
540
|
+
const r = k(ie), t = k(ae), e = k(me), { drawings: n, transformShow: s } = i, a = n[0];
|
|
535
541
|
if (a == null)
|
|
536
542
|
return;
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
543
|
+
const o = a.transform;
|
|
544
|
+
if (o == null)
|
|
539
545
|
return;
|
|
540
|
-
const { unitId: c, subUnitId: l, drawingId:
|
|
546
|
+
const { unitId: c, subUnitId: l, drawingId: d, drawingType: u } = a, h = e.getRenderById(c), f = h == null ? void 0 : h.scene;
|
|
541
547
|
if (f == null)
|
|
542
548
|
return;
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
549
|
+
const w = (Je = f.getEngine()) == null ? void 0 : Je.activeScene;
|
|
550
|
+
if (w == null)
|
|
545
551
|
return;
|
|
546
|
-
const
|
|
547
|
-
width:
|
|
548
|
-
height:
|
|
552
|
+
const v = f.getTransformerByCreate(), {
|
|
553
|
+
width: m = 0,
|
|
554
|
+
height: C = 0,
|
|
549
555
|
left: _ = 0,
|
|
550
|
-
top:
|
|
551
|
-
angle:
|
|
552
|
-
} =
|
|
553
|
-
const { width: H, height:
|
|
554
|
-
let
|
|
555
|
-
return
|
|
556
|
-
limitLeft:
|
|
557
|
-
limitTop:
|
|
558
|
-
limitWidth:
|
|
559
|
-
limitHeight:
|
|
556
|
+
top: R = 0,
|
|
557
|
+
angle: b = 0
|
|
558
|
+
} = o, [N, I] = L(m), [S, y] = L(C), [M, O] = L(_), [j, T] = L(R), [se, G] = L(b), [Q, ye] = L(v.keepRatio), oe = (p, E, A, V) => {
|
|
559
|
+
const { width: H, height: ee } = w, { ancestorLeft: F, ancestorTop: K } = f;
|
|
560
|
+
let Z = p, ce = E, pe = A, ve = V;
|
|
561
|
+
return p + F < 0 && (Z = -F), E + K < 0 && (ce = -K), pe = H - Z - F, pe < le && (pe = le), ve = ee - ce - K, ve < le && (ve = le), p + pe + F > H && (Z = H - A - F), E + ve + K > ee && (ce = ee - V - K), {
|
|
562
|
+
limitLeft: Z,
|
|
563
|
+
limitTop: ce,
|
|
564
|
+
limitWidth: pe,
|
|
565
|
+
limitHeight: ve
|
|
560
566
|
};
|
|
561
|
-
}, z = (
|
|
562
|
-
const { objects: E } =
|
|
563
|
-
if (
|
|
567
|
+
}, z = (p) => {
|
|
568
|
+
const { objects: E } = p, A = We(E, t);
|
|
569
|
+
if (A.length !== 1)
|
|
564
570
|
return;
|
|
565
|
-
const
|
|
566
|
-
if (
|
|
571
|
+
const V = A[0];
|
|
572
|
+
if (V == null)
|
|
567
573
|
return;
|
|
568
|
-
const { transform: H } =
|
|
574
|
+
const { transform: H } = V;
|
|
569
575
|
if (H == null)
|
|
570
576
|
return;
|
|
571
577
|
const {
|
|
572
|
-
width:
|
|
578
|
+
width: ee,
|
|
573
579
|
height: F,
|
|
574
580
|
left: K,
|
|
575
|
-
top:
|
|
576
|
-
angle:
|
|
581
|
+
top: Z,
|
|
582
|
+
angle: ce
|
|
577
583
|
} = H;
|
|
578
|
-
|
|
584
|
+
ee != null && I(ee), F != null && y(F), K != null && O(K), Z != null && T(Z), ce != null && G(ce);
|
|
579
585
|
};
|
|
580
|
-
|
|
581
|
-
const
|
|
582
|
-
|
|
586
|
+
be(() => {
|
|
587
|
+
const p = [
|
|
588
|
+
v.changeStart$.subscribe((E) => {
|
|
583
589
|
z(E);
|
|
584
590
|
}),
|
|
585
|
-
|
|
591
|
+
v.changing$.subscribe((E) => {
|
|
586
592
|
z(E);
|
|
587
593
|
}),
|
|
588
|
-
|
|
594
|
+
v.changeEnd$.subscribe((E) => {
|
|
589
595
|
z(E);
|
|
590
596
|
}),
|
|
591
|
-
|
|
597
|
+
t.focus$.subscribe((E) => {
|
|
592
598
|
if (E.length !== 1)
|
|
593
599
|
return;
|
|
594
|
-
const
|
|
595
|
-
if (
|
|
600
|
+
const A = t.getDrawingByParam(E[0]);
|
|
601
|
+
if (A == null)
|
|
596
602
|
return;
|
|
597
|
-
const
|
|
598
|
-
if (
|
|
603
|
+
const V = A.transform;
|
|
604
|
+
if (V == null)
|
|
599
605
|
return;
|
|
600
606
|
const {
|
|
601
607
|
width: H,
|
|
602
|
-
height:
|
|
608
|
+
height: ee,
|
|
603
609
|
left: F,
|
|
604
610
|
top: K,
|
|
605
|
-
angle:
|
|
606
|
-
} =
|
|
607
|
-
H != null &&
|
|
611
|
+
angle: Z
|
|
612
|
+
} = V;
|
|
613
|
+
H != null && I(H), ee != null && y(ee), F != null && O(F), K != null && T(K), Z != null && G(Z);
|
|
608
614
|
})
|
|
609
615
|
];
|
|
610
616
|
return () => {
|
|
611
|
-
|
|
617
|
+
p.forEach((E) => E.unsubscribe());
|
|
612
618
|
};
|
|
613
619
|
}, []);
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
620
|
+
const Ge = Me((p) => {
|
|
621
|
+
if (p == null)
|
|
616
622
|
return;
|
|
617
|
-
|
|
618
|
-
const { limitWidth: E, limitHeight:
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
let H =
|
|
623
|
-
if (H = Math.max(H,
|
|
623
|
+
p = Math.max(p, le);
|
|
624
|
+
const { limitWidth: E, limitHeight: A } = oe(M, j, p, S);
|
|
625
|
+
p = Math.min(p, E);
|
|
626
|
+
const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { width: p } };
|
|
627
|
+
if (Q) {
|
|
628
|
+
let H = p / N * S;
|
|
629
|
+
if (H = Math.max(H, fr), H > A)
|
|
624
630
|
return;
|
|
625
|
-
y(H),
|
|
631
|
+
y(H), V.transform.height = H;
|
|
626
632
|
}
|
|
627
|
-
|
|
628
|
-
},
|
|
629
|
-
if (
|
|
633
|
+
I(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
|
|
634
|
+
}, Oe), It = Me((p) => {
|
|
635
|
+
if (p == null)
|
|
630
636
|
return;
|
|
631
|
-
|
|
632
|
-
const { limitHeight: E, limitWidth:
|
|
633
|
-
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
636
|
-
let H =
|
|
637
|
-
if (H = Math.max(H,
|
|
637
|
+
p = Math.max(p, le);
|
|
638
|
+
const { limitHeight: E, limitWidth: A } = oe(M, j, N, p);
|
|
639
|
+
p = Math.min(p, E);
|
|
640
|
+
const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { height: p } };
|
|
641
|
+
if (Q) {
|
|
642
|
+
let H = p / S * N;
|
|
643
|
+
if (H = Math.max(H, le), H > A)
|
|
638
644
|
return;
|
|
639
|
-
|
|
645
|
+
I(H), V.transform.width = H;
|
|
640
646
|
}
|
|
641
|
-
y(
|
|
642
|
-
},
|
|
643
|
-
if (
|
|
647
|
+
y(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
|
|
648
|
+
}, Oe), Mt = Me((p) => {
|
|
649
|
+
if (p == null)
|
|
644
650
|
return;
|
|
645
|
-
const { limitLeft: E } =
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
-
O(
|
|
649
|
-
},
|
|
650
|
-
if (
|
|
651
|
+
const { limitLeft: E } = oe(p, j, N, S);
|
|
652
|
+
p = E;
|
|
653
|
+
const A = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { left: p } };
|
|
654
|
+
O(p), t.featurePluginUpdateNotification([A]), v.refreshControls().changeNotification();
|
|
655
|
+
}, Oe), Rt = Me((p) => {
|
|
656
|
+
if (p == null)
|
|
651
657
|
return;
|
|
652
|
-
const { limitTop: E } =
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
T(
|
|
656
|
-
},
|
|
657
|
-
if (
|
|
658
|
+
const { limitTop: E } = oe(M, p, N, S);
|
|
659
|
+
p = E;
|
|
660
|
+
const A = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { top: p } };
|
|
661
|
+
T(p), t.featurePluginUpdateNotification([A]), v.refreshControls().changeNotification();
|
|
662
|
+
}, Oe), Ot = (p) => {
|
|
663
|
+
if (p == null)
|
|
658
664
|
return;
|
|
659
|
-
const [E,
|
|
660
|
-
|
|
661
|
-
const
|
|
662
|
-
|
|
663
|
-
},
|
|
664
|
-
|
|
665
|
-
}
|
|
666
|
-
return /* @__PURE__ */
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}
|
|
665
|
+
const [E, A] = mr;
|
|
666
|
+
p < E && (p = E), p > A && (p = A);
|
|
667
|
+
const V = { unitId: c, subUnitId: l, drawingId: d, drawingType: u, transform: { angle: p } };
|
|
668
|
+
G(p), t.featurePluginUpdateNotification([V]), v.refreshControls().changeNotification();
|
|
669
|
+
}, Nt = (p) => {
|
|
670
|
+
ye(p), v.keepRatio = p;
|
|
671
|
+
};
|
|
672
|
+
return /* @__PURE__ */ P(
|
|
673
|
+
"div",
|
|
674
|
+
{
|
|
675
|
+
className: `
|
|
676
|
+
univer-relative univer-mt-5 univer-w-full univer-border-b-0 univer-border-l-0 univer-border-r-0
|
|
677
|
+
univer-border-t univer-border-solid univer-border-t-gray-200
|
|
678
|
+
`,
|
|
679
|
+
style: { display: ((p) => p ? "block" : "none")(s) },
|
|
680
|
+
children: [
|
|
681
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ g("div", { children: r.t("image-panel.transform.title") }) }) }),
|
|
682
|
+
/* @__PURE__ */ P("div", { className: U, children: [
|
|
683
|
+
/* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
|
|
684
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.width") }) }),
|
|
685
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: N, onChange: (p) => {
|
|
686
|
+
Ge(p);
|
|
687
|
+
} }) }) })
|
|
688
|
+
] }) }),
|
|
689
|
+
/* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
|
|
690
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.height") }) }),
|
|
691
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: S, onChange: (p) => {
|
|
692
|
+
It(p);
|
|
693
|
+
} }) }) })
|
|
694
|
+
] }) }),
|
|
695
|
+
/* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
|
|
696
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.lock") }) }),
|
|
697
|
+
/* @__PURE__ */ g("div", { className: Y(U, "univer-h-9 univer-items-center univer-justify-center"), children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(Ft, { checked: Q, onChange: Nt }) }) })
|
|
698
|
+
] }) })
|
|
699
|
+
] }),
|
|
700
|
+
/* @__PURE__ */ P("div", { className: U, children: [
|
|
701
|
+
/* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
|
|
702
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.x") }) }),
|
|
703
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: M, onChange: (p) => {
|
|
704
|
+
Mt(p);
|
|
705
|
+
} }) }) })
|
|
706
|
+
] }) }),
|
|
707
|
+
/* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
|
|
708
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.y") }) }),
|
|
709
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: j, onChange: (p) => {
|
|
710
|
+
Rt(p);
|
|
711
|
+
} }) }) })
|
|
712
|
+
] }) }),
|
|
713
|
+
/* @__PURE__ */ g("div", { className: Y(B), children: /* @__PURE__ */ P("label", { children: [
|
|
714
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: r.t("image-panel.transform.rotate") }) }),
|
|
715
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g(we, { precision: 1, value: se, onChange: Ot }) }) })
|
|
716
|
+
] }) })
|
|
717
|
+
] })
|
|
718
|
+
]
|
|
719
|
+
}
|
|
720
|
+
);
|
|
721
|
+
}, Ye = {
|
|
706
722
|
id: "sheet.operation.open-image-crop",
|
|
707
|
-
type:
|
|
708
|
-
handler: (i,
|
|
723
|
+
type: Se.OPERATION,
|
|
724
|
+
handler: (i, r) => !0
|
|
709
725
|
}, ge = {
|
|
710
726
|
id: "sheet.operation.close-image-crop",
|
|
711
|
-
type:
|
|
712
|
-
handler: (i,
|
|
727
|
+
type: Se.OPERATION,
|
|
728
|
+
handler: (i, r) => !0
|
|
713
729
|
};
|
|
714
|
-
var
|
|
715
|
-
const
|
|
730
|
+
var x = /* @__PURE__ */ ((i) => (i.FREE = "0", i.R1_1 = "1", i.R16_9 = "2", i.R9_16 = "3", i.R5_4 = "4", i.R4_5 = "5", i.R4_3 = "6", i.R3_4 = "7", i.R3_2 = "8", i.R2_3 = "9", i))(x || {});
|
|
731
|
+
const Ue = {
|
|
716
732
|
id: "sheet.operation.Auto-image-crop",
|
|
717
|
-
type:
|
|
718
|
-
handler: (i,
|
|
719
|
-
},
|
|
720
|
-
const
|
|
733
|
+
type: Se.OPERATION,
|
|
734
|
+
handler: (i, r) => !0
|
|
735
|
+
}, vr = (i) => {
|
|
736
|
+
const r = k(he), t = k(ie), { drawings: e, cropperShow: n } = i;
|
|
721
737
|
if (e[0] == null)
|
|
722
738
|
return;
|
|
723
|
-
const [a,
|
|
739
|
+
const [a, o] = L(x.FREE), c = dt(!1), l = [
|
|
724
740
|
{
|
|
725
|
-
label:
|
|
726
|
-
value:
|
|
741
|
+
label: t.t("image-panel.crop.mode"),
|
|
742
|
+
value: x.FREE
|
|
727
743
|
},
|
|
728
744
|
{
|
|
729
745
|
label: "1:1",
|
|
730
|
-
value:
|
|
746
|
+
value: x.R1_1
|
|
731
747
|
},
|
|
732
748
|
{
|
|
733
749
|
label: "16:9",
|
|
734
|
-
value:
|
|
750
|
+
value: x.R16_9
|
|
735
751
|
},
|
|
736
752
|
{
|
|
737
753
|
label: "9:16",
|
|
738
|
-
value:
|
|
754
|
+
value: x.R9_16
|
|
739
755
|
},
|
|
740
756
|
{
|
|
741
757
|
label: "5:4",
|
|
742
|
-
value:
|
|
758
|
+
value: x.R5_4
|
|
743
759
|
},
|
|
744
760
|
{
|
|
745
761
|
label: "4:5",
|
|
746
|
-
value:
|
|
762
|
+
value: x.R4_5
|
|
747
763
|
},
|
|
748
764
|
{
|
|
749
765
|
label: "4:3",
|
|
750
|
-
value:
|
|
766
|
+
value: x.R4_3
|
|
751
767
|
},
|
|
752
768
|
{
|
|
753
769
|
label: "3:4",
|
|
754
|
-
value:
|
|
770
|
+
value: x.R3_4
|
|
755
771
|
},
|
|
756
772
|
{
|
|
757
773
|
label: "3:2",
|
|
758
|
-
value:
|
|
774
|
+
value: x.R3_2
|
|
759
775
|
},
|
|
760
776
|
{
|
|
761
777
|
label: "2:3",
|
|
762
|
-
value:
|
|
778
|
+
value: x.R2_3
|
|
763
779
|
}
|
|
764
780
|
];
|
|
765
|
-
|
|
766
|
-
const f =
|
|
767
|
-
if (
|
|
768
|
-
const
|
|
769
|
-
|
|
781
|
+
be(() => {
|
|
782
|
+
const f = r.onCommandExecuted((w) => {
|
|
783
|
+
if (w.id === ge.id) {
|
|
784
|
+
const v = w.params;
|
|
785
|
+
v != null && v.isAuto || (c.current = !1);
|
|
770
786
|
}
|
|
771
787
|
});
|
|
772
788
|
return () => {
|
|
773
789
|
f == null || f.dispose();
|
|
774
790
|
};
|
|
775
791
|
}, []);
|
|
776
|
-
function
|
|
777
|
-
|
|
792
|
+
function d(f) {
|
|
793
|
+
o(f), c.current && r.executeCommand(Ue.id, {
|
|
778
794
|
cropType: f
|
|
779
795
|
});
|
|
780
796
|
}
|
|
781
|
-
const
|
|
782
|
-
|
|
797
|
+
const u = (f) => f ? "block" : "none", h = (f) => {
|
|
798
|
+
r.executeCommand(Ue.id, {
|
|
783
799
|
cropType: f
|
|
784
800
|
}), c.current = !0;
|
|
785
801
|
};
|
|
786
|
-
return /* @__PURE__ */
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
802
|
+
return /* @__PURE__ */ P(
|
|
803
|
+
"div",
|
|
804
|
+
{
|
|
805
|
+
className: `
|
|
806
|
+
univer-relative univer-mt-5 univer-w-full univer-border-b-0 univer-border-l-0 univer-border-r-0
|
|
807
|
+
univer-border-t univer-border-solid univer-border-t-gray-200
|
|
808
|
+
`,
|
|
809
|
+
style: { display: u(n) },
|
|
810
|
+
children: [
|
|
811
|
+
/* @__PURE__ */ g("div", { className: U, children: /* @__PURE__ */ g("div", { className: B, children: /* @__PURE__ */ g("div", { children: t.t("image-panel.crop.title") }) }) }),
|
|
812
|
+
/* @__PURE__ */ P("div", { className: U, children: [
|
|
813
|
+
/* @__PURE__ */ g("div", { className: ne, children: /* @__PURE__ */ g(ue, { onClick: () => {
|
|
814
|
+
h(a);
|
|
815
|
+
}, children: /* @__PURE__ */ P("span", { className: "univer-flex univer-items-center univer-gap-1", children: [
|
|
816
|
+
/* @__PURE__ */ g(pt, {}),
|
|
817
|
+
t.t("image-panel.crop.start")
|
|
818
|
+
] }) }) }),
|
|
819
|
+
/* @__PURE__ */ g("div", { className: ne, children: /* @__PURE__ */ g(ut, { value: a, options: l, onChange: d }) })
|
|
820
|
+
] })
|
|
821
|
+
]
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
}, Wr = (i) => {
|
|
825
|
+
const r = k(ae), t = k(me), e = k(ie), { drawings: n, hasArrange: s = !0, hasTransform: a = !0, hasAlign: o = !0, hasCropper: c = !0, hasGroup: l = !0 } = i, d = n[0];
|
|
826
|
+
if (d == null)
|
|
801
827
|
return;
|
|
802
|
-
const { unitId:
|
|
828
|
+
const { unitId: u } = d, h = t.getRenderById(u), f = h == null ? void 0 : h.scene;
|
|
803
829
|
if (f == null)
|
|
804
830
|
return;
|
|
805
|
-
const
|
|
806
|
-
return
|
|
807
|
-
const
|
|
808
|
-
T === !0 && (
|
|
809
|
-
}), O =
|
|
810
|
-
const { objects:
|
|
811
|
-
|
|
812
|
-
}),
|
|
813
|
-
T.length === 0 ? (
|
|
831
|
+
const w = f.getTransformerByCreate(), [v, m] = L(!0), [C, _] = L(!0), [R, b] = L(!1), [N, I] = L(!0), [S, y] = L(!1);
|
|
832
|
+
return be(() => {
|
|
833
|
+
const M = w.clearControl$.subscribe((T) => {
|
|
834
|
+
T === !0 && (m(!1), _(!1), b(!1), I(!1), y(!0));
|
|
835
|
+
}), O = w.changeStart$.subscribe((T) => {
|
|
836
|
+
const { objects: se } = T, G = We(se, r);
|
|
837
|
+
G.length === 0 ? (m(!1), _(!1), b(!1), I(!1), y(!0)) : G.length === 1 ? (m(!0), _(!0), b(!1), I(!0), y(!1)) : (m(!0), _(!1), b(!0), I(!1), y(!1));
|
|
838
|
+
}), j = r.focus$.subscribe((T) => {
|
|
839
|
+
T.length === 0 ? (m(!1), _(!1), b(!1), I(!1), y(!0)) : T.length === 1 ? (m(!0), _(!0), b(!1), I(!0), y(!1)) : (m(!0), _(!1), b(!0), I(!1), y(!1));
|
|
814
840
|
});
|
|
815
841
|
return () => {
|
|
816
|
-
O.unsubscribe(),
|
|
842
|
+
O.unsubscribe(), M.unsubscribe(), j.unsubscribe();
|
|
817
843
|
};
|
|
818
|
-
}, []), /* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
/* @__PURE__ */
|
|
822
|
-
/* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
844
|
+
}, []), /* @__PURE__ */ P(zt, { children: [
|
|
845
|
+
/* @__PURE__ */ g("div", { style: { display: S === !0 ? "block" : "none", height: "100%" }, children: /* @__PURE__ */ g("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", top: "50%", marginTop: "-100px" }, children: /* @__PURE__ */ g("span", { children: e.t("image-panel.null") }) }) }),
|
|
846
|
+
/* @__PURE__ */ g(gr, { arrangeShow: s === !0 ? v : !1, drawings: n }),
|
|
847
|
+
/* @__PURE__ */ g(pr, { transformShow: a === !0 ? C : !1, drawings: n }),
|
|
848
|
+
/* @__PURE__ */ g(qt, { alignShow: o === !0 ? R : !1, drawings: n }),
|
|
849
|
+
/* @__PURE__ */ g(vr, { cropperShow: c === !0 ? N : !1, drawings: n }),
|
|
850
|
+
/* @__PURE__ */ g(hr, { hasGroup: l, drawings: n })
|
|
825
851
|
] });
|
|
826
|
-
},
|
|
827
|
-
var
|
|
828
|
-
const { popup:
|
|
829
|
-
if (!
|
|
830
|
-
const e =
|
|
852
|
+
}, wr = (i) => {
|
|
853
|
+
var v;
|
|
854
|
+
const { popup: r } = i, t = (v = r == null ? void 0 : r.extraProps) == null ? void 0 : v.menuItems;
|
|
855
|
+
if (!t) return null;
|
|
856
|
+
const e = k(he), n = k(ie), [s, a] = L(!1), [o, c] = L(!1), l = () => {
|
|
831
857
|
c(!0);
|
|
832
|
-
},
|
|
858
|
+
}, d = () => {
|
|
833
859
|
c(!1);
|
|
834
|
-
},
|
|
835
|
-
a(
|
|
836
|
-
}, h = (
|
|
837
|
-
e.executeCommand(
|
|
838
|
-
}, f =
|
|
839
|
-
return /* @__PURE__ */
|
|
860
|
+
}, u = (m) => {
|
|
861
|
+
a(m);
|
|
862
|
+
}, h = (m) => {
|
|
863
|
+
e.executeCommand(m.commandId, m.commandParams), a(!1);
|
|
864
|
+
}, f = s || o, w = t.filter((m) => !m.disable);
|
|
865
|
+
return /* @__PURE__ */ g(
|
|
840
866
|
"div",
|
|
841
867
|
{
|
|
842
868
|
onMouseEnter: l,
|
|
843
|
-
onMouseLeave:
|
|
844
|
-
children: /* @__PURE__ */
|
|
845
|
-
|
|
869
|
+
onMouseLeave: d,
|
|
870
|
+
children: /* @__PURE__ */ g(
|
|
871
|
+
Kt,
|
|
846
872
|
{
|
|
847
873
|
align: "start",
|
|
848
|
-
items:
|
|
874
|
+
items: w.map((m) => ({
|
|
849
875
|
type: "item",
|
|
850
|
-
children:
|
|
851
|
-
onSelect: () => h(
|
|
876
|
+
children: n.t(m.label),
|
|
877
|
+
onSelect: () => h(m)
|
|
852
878
|
})),
|
|
853
|
-
open:
|
|
854
|
-
onOpenChange:
|
|
855
|
-
children: /* @__PURE__ */
|
|
879
|
+
open: s,
|
|
880
|
+
onOpenChange: u,
|
|
881
|
+
children: /* @__PURE__ */ P(
|
|
856
882
|
"div",
|
|
857
883
|
{
|
|
858
|
-
className:
|
|
884
|
+
className: Y(`
|
|
859
885
|
univer-flex univer-items-center univer-gap-2 univer-rounded univer-border univer-border-solid
|
|
860
886
|
univer-border-gray-200 univer-p-1
|
|
861
887
|
hover:univer-bg-gray-100
|
|
862
888
|
`, {
|
|
863
|
-
"univer-bg-gray-100":
|
|
864
|
-
"univer-bg-white": !
|
|
889
|
+
"univer-bg-gray-100": s,
|
|
890
|
+
"univer-bg-white": !s
|
|
865
891
|
}),
|
|
866
892
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
|
|
869
|
-
{
|
|
870
|
-
style: { color: "#35322B" },
|
|
871
|
-
extend: { colorChannel1: "rgb(var(--green-700, #409f11))" }
|
|
872
|
-
}
|
|
873
|
-
),
|
|
874
|
-
f && /* @__PURE__ */ u(_n, { className: "univer-text-[10px] univer-text-gray-400" })
|
|
893
|
+
/* @__PURE__ */ g(ft, { className: "univer-fill-primary-600 univer-text-gray-900" }),
|
|
894
|
+
f && /* @__PURE__ */ g(wt, {})
|
|
875
895
|
]
|
|
876
896
|
}
|
|
877
897
|
)
|
|
@@ -879,54 +899,51 @@ const Be = {
|
|
|
879
899
|
)
|
|
880
900
|
}
|
|
881
901
|
);
|
|
882
|
-
},
|
|
902
|
+
}, _r = "COMPONENT_IMAGE_POPUP_MENU", Cr = "drawing-ui.config", nt = {}, yt = {
|
|
883
903
|
id: "sheet.operation.image-reset-size",
|
|
884
|
-
type:
|
|
885
|
-
handler: (i,
|
|
886
|
-
}, Bt = (i) => {
|
|
887
|
-
const { src: t } = i;
|
|
888
|
-
return t ? /* @__PURE__ */ u("div", { children: /* @__PURE__ */ u("img", { src: t, alt: "Univer Image Viewer", style: { width: "100%", height: "100%", position: "relative" } }) }) : null;
|
|
904
|
+
type: Se.OPERATION,
|
|
905
|
+
handler: (i, r) => !0
|
|
889
906
|
};
|
|
890
|
-
var
|
|
891
|
-
for (var
|
|
892
|
-
(a = i[
|
|
893
|
-
return
|
|
894
|
-
},
|
|
895
|
-
let
|
|
896
|
-
constructor(i,
|
|
897
|
-
super(), this._componentManager = i, this._commandService =
|
|
907
|
+
var Sr = Object.getOwnPropertyDescriptor, br = (i, r, t, e) => {
|
|
908
|
+
for (var n = e > 1 ? void 0 : e ? Sr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
|
|
909
|
+
(a = i[s]) && (n = a(n) || n);
|
|
910
|
+
return n;
|
|
911
|
+
}, it = (i, r) => (t, e) => r(t, e, i);
|
|
912
|
+
let xe = class extends Ve {
|
|
913
|
+
constructor(i, r) {
|
|
914
|
+
super(), this._componentManager = i, this._commandService = r, this._init();
|
|
898
915
|
}
|
|
899
916
|
_initCustomComponents() {
|
|
900
917
|
const i = this._componentManager;
|
|
901
|
-
this.disposeWithMe(i.register(
|
|
918
|
+
this.disposeWithMe(i.register(_r, wr));
|
|
902
919
|
}
|
|
903
920
|
_initCommands() {
|
|
904
921
|
[
|
|
905
|
-
Fe,
|
|
906
|
-
ge,
|
|
907
|
-
Pn,
|
|
908
922
|
Ye,
|
|
909
|
-
|
|
923
|
+
ge,
|
|
924
|
+
yt,
|
|
925
|
+
Xe,
|
|
926
|
+
Ue
|
|
910
927
|
].forEach((i) => this.disposeWithMe(this._commandService.registerCommand(i)));
|
|
911
928
|
}
|
|
912
929
|
_init() {
|
|
913
930
|
this._initCommands(), this._initCustomComponents();
|
|
914
931
|
}
|
|
915
932
|
};
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
],
|
|
920
|
-
var
|
|
921
|
-
for (var
|
|
922
|
-
(a = i[
|
|
923
|
-
return
|
|
924
|
-
},
|
|
925
|
-
let
|
|
926
|
-
constructor(
|
|
933
|
+
xe = br([
|
|
934
|
+
it(0, ke(Wt)),
|
|
935
|
+
it(1, he)
|
|
936
|
+
], xe);
|
|
937
|
+
var yr = Object.getOwnPropertyDescriptor, Ir = (i, r, t, e) => {
|
|
938
|
+
for (var n = e > 1 ? void 0 : e ? yr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
|
|
939
|
+
(a = i[s]) && (n = a(n) || n);
|
|
940
|
+
return n;
|
|
941
|
+
}, Ne = (i, r) => (t, e) => r(t, e, i);
|
|
942
|
+
let He = class extends Ve {
|
|
943
|
+
constructor(r, t, e, n) {
|
|
927
944
|
super();
|
|
928
|
-
|
|
929
|
-
this._currentUniverService =
|
|
945
|
+
te(this, "_sceneListenerOnDrawingMap", /* @__PURE__ */ new WeakSet());
|
|
946
|
+
this._currentUniverService = r, this._commandService = t, this._renderManagerService = e, this._drawingManagerService = n, this._initialize();
|
|
930
947
|
}
|
|
931
948
|
dispose() {
|
|
932
949
|
super.dispose();
|
|
@@ -935,39 +952,39 @@ let Ue = class extends xe {
|
|
|
935
952
|
this._recoveryImages(), this._drawingAddListener(), this._drawingRemoveListener(), this._drawingUpdateListener(), this._commandExecutedListener(), this._drawingArrangeListener(), this._drawingGroupListener(), this._drawingRefreshListener(), this._drawingVisibleListener();
|
|
936
953
|
}
|
|
937
954
|
_recoveryImages() {
|
|
938
|
-
const
|
|
939
|
-
if (
|
|
955
|
+
const r = this._drawingManagerService.drawingManagerData, t = gt(this._currentUniverService);
|
|
956
|
+
if (t == null)
|
|
940
957
|
return;
|
|
941
|
-
const { unitId: e, subUnitId:
|
|
942
|
-
Object.keys(
|
|
943
|
-
Object.keys(
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
|
|
958
|
+
const { unitId: e, subUnitId: n } = t;
|
|
959
|
+
Object.keys(r).forEach((s) => {
|
|
960
|
+
Object.keys(r[s]).forEach((a) => {
|
|
961
|
+
const o = r[s][a].data;
|
|
962
|
+
o == null || s !== e || a !== n || Object.keys(o).forEach((c) => {
|
|
963
|
+
o[c] && this._insertDrawing([{ unitId: s, subUnitId: a, drawingId: c }]);
|
|
947
964
|
});
|
|
948
965
|
});
|
|
949
966
|
});
|
|
950
967
|
}
|
|
951
968
|
_commandExecutedListener() {
|
|
952
969
|
this.disposeWithMe(
|
|
953
|
-
this._commandService.onCommandExecuted((
|
|
954
|
-
if (
|
|
955
|
-
const
|
|
956
|
-
if (
|
|
970
|
+
this._commandService.onCommandExecuted((r) => {
|
|
971
|
+
if (r.id === Xe.id) {
|
|
972
|
+
const t = r.params;
|
|
973
|
+
if (t == null)
|
|
957
974
|
return;
|
|
958
|
-
this._drawingAlign(
|
|
975
|
+
this._drawingAlign(t);
|
|
959
976
|
}
|
|
960
977
|
})
|
|
961
978
|
);
|
|
962
979
|
}
|
|
963
980
|
_drawingGroupListener() {
|
|
964
981
|
this.disposeWithMe(
|
|
965
|
-
this._drawingManagerService.group$.subscribe((
|
|
966
|
-
this._groupDrawings(
|
|
982
|
+
this._drawingManagerService.group$.subscribe((r) => {
|
|
983
|
+
this._groupDrawings(r);
|
|
967
984
|
})
|
|
968
985
|
), this.disposeWithMe(
|
|
969
|
-
this._drawingManagerService.ungroup$.subscribe((
|
|
970
|
-
this._ungroupDrawings(
|
|
986
|
+
this._drawingManagerService.ungroup$.subscribe((r) => {
|
|
987
|
+
this._ungroupDrawings(r);
|
|
971
988
|
})
|
|
972
989
|
);
|
|
973
990
|
}
|
|
@@ -991,38 +1008,38 @@ let Ue = class extends xe {
|
|
|
991
1008
|
// break;
|
|
992
1009
|
// }
|
|
993
1010
|
// }
|
|
994
|
-
_getSceneAndTransformerByDrawingSearch(
|
|
995
|
-
if (
|
|
1011
|
+
_getSceneAndTransformerByDrawingSearch(r) {
|
|
1012
|
+
if (r == null)
|
|
996
1013
|
return;
|
|
997
|
-
const
|
|
1014
|
+
const t = this._renderManagerService.getRenderById(r), e = t == null ? void 0 : t.scene;
|
|
998
1015
|
if (e == null)
|
|
999
1016
|
return null;
|
|
1000
|
-
const
|
|
1001
|
-
return { scene: e, transformer:
|
|
1017
|
+
const n = e.getTransformerByCreate();
|
|
1018
|
+
return { scene: e, transformer: n };
|
|
1002
1019
|
}
|
|
1003
|
-
_groupDrawings(
|
|
1004
|
-
|
|
1005
|
-
this._groupDrawing(
|
|
1020
|
+
_groupDrawings(r) {
|
|
1021
|
+
r.forEach((t) => {
|
|
1022
|
+
this._groupDrawing(t);
|
|
1006
1023
|
});
|
|
1007
1024
|
}
|
|
1008
|
-
_groupDrawing(
|
|
1009
|
-
const { parent:
|
|
1010
|
-
if (
|
|
1025
|
+
_groupDrawing(r) {
|
|
1026
|
+
const { parent: t, children: e } = r, { unitId: n, subUnitId: s, drawingId: a } = t, o = this._getSceneAndTransformerByDrawingSearch(t.unitId);
|
|
1027
|
+
if (o == null)
|
|
1011
1028
|
return;
|
|
1012
|
-
const { scene: c, transformer: l } =
|
|
1029
|
+
const { scene: c, transformer: l } = o;
|
|
1013
1030
|
this._commandService.syncExecuteCommand(ge.id);
|
|
1014
|
-
const
|
|
1031
|
+
const d = [];
|
|
1015
1032
|
if (e.forEach((f) => {
|
|
1016
|
-
const
|
|
1017
|
-
if (
|
|
1033
|
+
const w = W(f), v = c.getObjectIncludeInGroup(w);
|
|
1034
|
+
if (v == null || d.includes(v))
|
|
1018
1035
|
return;
|
|
1019
|
-
|
|
1020
|
-
const { transform:
|
|
1021
|
-
|
|
1022
|
-
}),
|
|
1036
|
+
d.push(v);
|
|
1037
|
+
const { transform: m } = f;
|
|
1038
|
+
m != null && (v.classType === Qe.GROUP ? v.transformByState({ left: m.left, top: m.top }) : v.transformByState(m));
|
|
1039
|
+
}), d.length === 0)
|
|
1023
1040
|
return;
|
|
1024
|
-
const
|
|
1025
|
-
c.addObject(h,
|
|
1041
|
+
const u = W({ unitId: n, subUnitId: s, drawingId: a }), h = new Ce(u);
|
|
1042
|
+
c.addObject(h, Pe).attachTransformerTo(h), h.addObjects(...d), t.transform && h.transformByState({ left: t.transform.left, top: t.transform.top }), l.clearSelectedObjects(), l.setSelectedControl(h);
|
|
1026
1043
|
}
|
|
1027
1044
|
// private _regroupDrawings(drawings: IDrawingSearch[]) {
|
|
1028
1045
|
// const renderObject = this._getSceneAndTransformerByDrawingSearch(drawings[0].unitId);
|
|
@@ -1058,127 +1075,127 @@ let Ue = class extends xe {
|
|
|
1058
1075
|
// transformer.clearSelectedObjects();
|
|
1059
1076
|
// transformer.setSelectedControl(firstGroup);
|
|
1060
1077
|
// }
|
|
1061
|
-
_ungroupDrawings(
|
|
1062
|
-
|
|
1063
|
-
this._ungroupDrawing(
|
|
1078
|
+
_ungroupDrawings(r) {
|
|
1079
|
+
r.forEach((t) => {
|
|
1080
|
+
this._ungroupDrawing(t);
|
|
1064
1081
|
});
|
|
1065
1082
|
}
|
|
1066
|
-
_ungroupDrawing(
|
|
1067
|
-
const { parent:
|
|
1068
|
-
if (
|
|
1083
|
+
_ungroupDrawing(r) {
|
|
1084
|
+
const { parent: t, children: e } = r, n = this._getSceneAndTransformerByDrawingSearch(t.unitId);
|
|
1085
|
+
if (n == null)
|
|
1069
1086
|
return;
|
|
1070
|
-
const { scene:
|
|
1071
|
-
e.forEach((
|
|
1072
|
-
const h =
|
|
1087
|
+
const { scene: s, transformer: a } = n;
|
|
1088
|
+
e.forEach((u) => {
|
|
1089
|
+
const h = W(u), f = s.getObjectIncludeInGroup(h);
|
|
1073
1090
|
if (f == null)
|
|
1074
1091
|
return !0;
|
|
1075
1092
|
if (f == null)
|
|
1076
1093
|
return;
|
|
1077
|
-
const { transform:
|
|
1078
|
-
|
|
1094
|
+
const { transform: w } = u;
|
|
1095
|
+
w != null && (f.classType === Qe.GROUP ? f.transformByState({ left: w.left, top: w.top }) : f.transformByState(w));
|
|
1079
1096
|
});
|
|
1080
|
-
const
|
|
1081
|
-
c.getObjects().forEach((
|
|
1082
|
-
c.removeSelfObjectAndTransform(
|
|
1097
|
+
const o = W(t), c = s.getObject(o), { width: l, height: d } = c;
|
|
1098
|
+
c.getObjects().forEach((u) => {
|
|
1099
|
+
c.removeSelfObjectAndTransform(u.oKey, l, d);
|
|
1083
1100
|
}), c.dispose(), a.clearSelectedObjects();
|
|
1084
1101
|
}
|
|
1085
|
-
_drawingAlign(
|
|
1086
|
-
const { alignType:
|
|
1087
|
-
if (
|
|
1102
|
+
_drawingAlign(r) {
|
|
1103
|
+
const { alignType: t } = r, e = this._drawingManagerService.getFocusDrawings();
|
|
1104
|
+
if (t === D.default)
|
|
1088
1105
|
return;
|
|
1089
|
-
const
|
|
1090
|
-
let
|
|
1091
|
-
e.forEach((
|
|
1092
|
-
const { unitId:
|
|
1093
|
-
if (
|
|
1106
|
+
const n = [];
|
|
1107
|
+
let s = Number.POSITIVE_INFINITY, a = Number.POSITIVE_INFINITY, o = Number.NEGATIVE_INFINITY, c = Number.NEGATIVE_INFINITY, l = 0;
|
|
1108
|
+
e.forEach((d) => {
|
|
1109
|
+
const { unitId: u, subUnitId: h, drawingId: f, drawingType: w } = d, v = this._drawingManagerService.getDrawingByParam({ unitId: u, subUnitId: h, drawingId: f });
|
|
1110
|
+
if (v == null || v.transform == null)
|
|
1094
1111
|
return;
|
|
1095
|
-
|
|
1096
|
-
unitId:
|
|
1112
|
+
n.push({
|
|
1113
|
+
unitId: u,
|
|
1097
1114
|
subUnitId: h,
|
|
1098
1115
|
drawingId: f,
|
|
1099
|
-
drawingType:
|
|
1100
|
-
transform:
|
|
1116
|
+
drawingType: w,
|
|
1117
|
+
transform: v.transform
|
|
1101
1118
|
});
|
|
1102
|
-
const { left:
|
|
1103
|
-
|
|
1104
|
-
}), l !== 0 && (this._sortDrawingTransform(
|
|
1119
|
+
const { left: m = 0, top: C = 0, width: _ = 0, height: R = 0 } = v.transform;
|
|
1120
|
+
s = Math.min(s, m), a = Math.min(a, C), o = Math.max(o, m + _), c = Math.max(c, C + R), l++;
|
|
1121
|
+
}), l !== 0 && (this._sortDrawingTransform(n, t), this._applyAlignType(n, t, s, a, o, c, l));
|
|
1105
1122
|
}
|
|
1106
|
-
_applyAlignType(
|
|
1107
|
-
const c = Math.round((
|
|
1108
|
-
if (
|
|
1123
|
+
_applyAlignType(r, t, e, n, s, a, o) {
|
|
1124
|
+
const c = Math.round((s - e) / o * 10) / 10, l = Math.round((a - n) / o * 10) / 10, d = [], u = this._getSceneAndTransformerByDrawingSearch(r[0].unitId);
|
|
1125
|
+
if (u == null)
|
|
1109
1126
|
return;
|
|
1110
|
-
const { scene: h, transformer: f } =
|
|
1111
|
-
|
|
1112
|
-
const { unitId:
|
|
1113
|
-
let
|
|
1114
|
-
switch (
|
|
1127
|
+
const { scene: h, transformer: f } = u;
|
|
1128
|
+
r.forEach((w, v) => {
|
|
1129
|
+
const { unitId: m, subUnitId: C, drawingId: _, transform: R, drawingType: b } = w, { left: N = 0, top: I = 0, width: S = 0, height: y = 0 } = R;
|
|
1130
|
+
let M = N, O = I;
|
|
1131
|
+
switch (t) {
|
|
1115
1132
|
case D.left:
|
|
1116
|
-
|
|
1133
|
+
M = e;
|
|
1117
1134
|
break;
|
|
1118
1135
|
case D.center:
|
|
1119
|
-
|
|
1136
|
+
M = e + (s - e) / 2 - S / 2;
|
|
1120
1137
|
break;
|
|
1121
1138
|
case D.right:
|
|
1122
|
-
|
|
1139
|
+
M = s - S;
|
|
1123
1140
|
break;
|
|
1124
1141
|
case D.top:
|
|
1125
|
-
O =
|
|
1142
|
+
O = n;
|
|
1126
1143
|
break;
|
|
1127
1144
|
case D.middle:
|
|
1128
|
-
O =
|
|
1145
|
+
O = n + (a - n) / 2 - y / 2;
|
|
1129
1146
|
break;
|
|
1130
1147
|
case D.bottom:
|
|
1131
1148
|
O = a - y;
|
|
1132
1149
|
break;
|
|
1133
1150
|
case D.horizon:
|
|
1134
|
-
|
|
1151
|
+
M = e + c * v;
|
|
1135
1152
|
break;
|
|
1136
1153
|
case D.vertical:
|
|
1137
|
-
O =
|
|
1154
|
+
O = n + l * v;
|
|
1138
1155
|
break;
|
|
1139
1156
|
}
|
|
1140
|
-
(
|
|
1141
|
-
unitId:
|
|
1142
|
-
subUnitId:
|
|
1157
|
+
(M !== N || O !== I) && d.push({
|
|
1158
|
+
unitId: m,
|
|
1159
|
+
subUnitId: C,
|
|
1143
1160
|
drawingId: _,
|
|
1144
|
-
drawingType:
|
|
1161
|
+
drawingType: b,
|
|
1145
1162
|
transform: {
|
|
1146
|
-
left:
|
|
1163
|
+
left: M,
|
|
1147
1164
|
top: O
|
|
1148
1165
|
}
|
|
1149
1166
|
});
|
|
1150
|
-
}), this._drawingManagerService.featurePluginUpdateNotification(
|
|
1167
|
+
}), this._drawingManagerService.featurePluginUpdateNotification(d), f.refreshControls().changeNotification();
|
|
1151
1168
|
}
|
|
1152
|
-
_sortDrawingTransform(
|
|
1153
|
-
|
|
1154
|
-
const
|
|
1155
|
-
left:
|
|
1169
|
+
_sortDrawingTransform(r, t) {
|
|
1170
|
+
r.sort((e, n) => {
|
|
1171
|
+
const s = e.transform, a = n.transform, {
|
|
1172
|
+
left: o = 0,
|
|
1156
1173
|
top: c = 0,
|
|
1157
1174
|
width: l = 0,
|
|
1158
|
-
height:
|
|
1159
|
-
} =
|
|
1160
|
-
left:
|
|
1175
|
+
height: d = 0
|
|
1176
|
+
} = s, {
|
|
1177
|
+
left: u = 0,
|
|
1161
1178
|
top: h = 0,
|
|
1162
1179
|
width: f = 0,
|
|
1163
|
-
height:
|
|
1180
|
+
height: w = 0
|
|
1164
1181
|
} = a;
|
|
1165
|
-
switch (
|
|
1182
|
+
switch (t) {
|
|
1166
1183
|
case D.left:
|
|
1167
|
-
return
|
|
1184
|
+
return o - u;
|
|
1168
1185
|
case D.center:
|
|
1169
|
-
return
|
|
1186
|
+
return o + l / 2 - (u + f / 2);
|
|
1170
1187
|
case D.right:
|
|
1171
|
-
return
|
|
1188
|
+
return o + l - (u + f);
|
|
1172
1189
|
case D.top:
|
|
1173
1190
|
return c - h;
|
|
1174
1191
|
case D.middle:
|
|
1175
|
-
return c +
|
|
1192
|
+
return c + d / 2 - (h + w / 2);
|
|
1176
1193
|
case D.bottom:
|
|
1177
|
-
return c +
|
|
1194
|
+
return c + d - (h + w);
|
|
1178
1195
|
case D.horizon:
|
|
1179
|
-
return
|
|
1196
|
+
return o + l / 2 - (u + f / 2);
|
|
1180
1197
|
case D.vertical:
|
|
1181
|
-
return c +
|
|
1198
|
+
return c + d / 2 - (h + w / 2);
|
|
1182
1199
|
default:
|
|
1183
1200
|
return 0;
|
|
1184
1201
|
}
|
|
@@ -1186,60 +1203,60 @@ let Ue = class extends xe {
|
|
|
1186
1203
|
}
|
|
1187
1204
|
_drawingArrangeListener() {
|
|
1188
1205
|
this.disposeWithMe(
|
|
1189
|
-
this._drawingManagerService.order$.subscribe((
|
|
1190
|
-
this._drawingArrange(
|
|
1206
|
+
this._drawingManagerService.order$.subscribe((r) => {
|
|
1207
|
+
this._drawingArrange(r);
|
|
1191
1208
|
})
|
|
1192
1209
|
);
|
|
1193
1210
|
}
|
|
1194
|
-
_drawingArrange(
|
|
1195
|
-
const { unitId:
|
|
1196
|
-
if (
|
|
1211
|
+
_drawingArrange(r) {
|
|
1212
|
+
const { unitId: t, subUnitId: e, drawingIds: n } = r, s = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1213
|
+
if (s == null)
|
|
1197
1214
|
return;
|
|
1198
|
-
const { scene: a } =
|
|
1199
|
-
|
|
1200
|
-
const c =
|
|
1215
|
+
const { scene: a } = s;
|
|
1216
|
+
n.forEach((o) => {
|
|
1217
|
+
const c = W({ unitId: t, subUnitId: e, drawingId: o }), l = a.fuzzyMathObjects(c, !0);
|
|
1201
1218
|
if (l == null || l.length === 0)
|
|
1202
1219
|
return;
|
|
1203
|
-
const
|
|
1204
|
-
for (const
|
|
1205
|
-
|
|
1220
|
+
const d = this._drawingManagerService.getDrawingOrder(t, e).indexOf(o);
|
|
1221
|
+
for (const u of l)
|
|
1222
|
+
u.setProps({ zIndex: d }), u.makeDirty();
|
|
1206
1223
|
});
|
|
1207
1224
|
}
|
|
1208
1225
|
_drawingAddListener() {
|
|
1209
1226
|
this.disposeWithMe(
|
|
1210
|
-
this._drawingManagerService.add$.subscribe((
|
|
1211
|
-
this._insertDrawing(
|
|
1227
|
+
this._drawingManagerService.add$.subscribe((r) => {
|
|
1228
|
+
this._insertDrawing(r);
|
|
1212
1229
|
})
|
|
1213
1230
|
);
|
|
1214
1231
|
}
|
|
1215
|
-
_insertDrawing(
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1218
|
-
const { unitId:
|
|
1232
|
+
_insertDrawing(r) {
|
|
1233
|
+
const t = [];
|
|
1234
|
+
r.forEach((e) => {
|
|
1235
|
+
const { unitId: n } = e;
|
|
1219
1236
|
if (this._drawingManagerService.getDrawingByParam(e) == null)
|
|
1220
1237
|
return;
|
|
1221
|
-
const a = this._getSceneAndTransformerByDrawingSearch(
|
|
1238
|
+
const a = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1222
1239
|
if (a == null)
|
|
1223
1240
|
return;
|
|
1224
|
-
const { scene:
|
|
1225
|
-
|
|
1226
|
-
}),
|
|
1241
|
+
const { scene: o } = a;
|
|
1242
|
+
t.includes(o) || t.push(o);
|
|
1243
|
+
}), t.forEach((e) => {
|
|
1227
1244
|
this._sceneListenerOnDrawingMap.has(e) || (this._addListenerOnDrawing(e), this._sceneListenerOnDrawingMap.add(e));
|
|
1228
1245
|
});
|
|
1229
1246
|
}
|
|
1230
1247
|
_drawingRemoveListener() {
|
|
1231
1248
|
this.disposeWithMe(
|
|
1232
|
-
this._drawingManagerService.remove$.subscribe((
|
|
1233
|
-
|
|
1234
|
-
var
|
|
1235
|
-
const { unitId: e, subUnitId:
|
|
1249
|
+
this._drawingManagerService.remove$.subscribe((r) => {
|
|
1250
|
+
r.forEach((t) => {
|
|
1251
|
+
var d;
|
|
1252
|
+
const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._getSceneAndTransformerByDrawingSearch(e);
|
|
1236
1253
|
if (a == null)
|
|
1237
1254
|
return;
|
|
1238
|
-
const { scene:
|
|
1255
|
+
const { scene: o } = a, c = W({ unitId: e, subUnitId: n, drawingId: s }), l = o.fuzzyMathObjects(c, !0);
|
|
1239
1256
|
if (l.length > 0) {
|
|
1240
|
-
for (const
|
|
1241
|
-
|
|
1242
|
-
(
|
|
1257
|
+
for (const u of l)
|
|
1258
|
+
u.dispose();
|
|
1259
|
+
(d = o.getTransformer()) == null || d.clearSelectedObjects();
|
|
1243
1260
|
}
|
|
1244
1261
|
});
|
|
1245
1262
|
})
|
|
@@ -1247,76 +1264,76 @@ let Ue = class extends xe {
|
|
|
1247
1264
|
}
|
|
1248
1265
|
_drawingUpdateListener() {
|
|
1249
1266
|
this.disposeWithMe(
|
|
1250
|
-
this._drawingManagerService.update$.subscribe((
|
|
1251
|
-
|
|
1252
|
-
var
|
|
1253
|
-
const { unitId: e, subUnitId:
|
|
1267
|
+
this._drawingManagerService.update$.subscribe((r) => {
|
|
1268
|
+
r.forEach((t) => {
|
|
1269
|
+
var S;
|
|
1270
|
+
const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._drawingManagerService.getDrawingByParam(t);
|
|
1254
1271
|
if (a == null)
|
|
1255
1272
|
return;
|
|
1256
|
-
const { transform:
|
|
1273
|
+
const { transform: o, drawingType: c } = a, l = this._getSceneAndTransformerByDrawingSearch(e);
|
|
1257
1274
|
if (l == null)
|
|
1258
1275
|
return;
|
|
1259
|
-
const { scene:
|
|
1260
|
-
if (
|
|
1276
|
+
const { scene: d, transformer: u } = l;
|
|
1277
|
+
if (o == null)
|
|
1261
1278
|
return !0;
|
|
1262
|
-
const { left: h = 0, top: f = 0, width:
|
|
1263
|
-
if (
|
|
1279
|
+
const { left: h = 0, top: f = 0, width: w = 0, height: v = 0, angle: m = 0, flipX: C = !1, flipY: _ = !1, skewX: R = 0, skewY: b = 0 } = o, N = W({ unitId: e, subUnitId: n, drawingId: s }), I = d.getObject(N);
|
|
1280
|
+
if (I == null)
|
|
1264
1281
|
return !0;
|
|
1265
|
-
|
|
1282
|
+
I.transformByState({ left: h, top: f, width: w, height: v, angle: m, flipX: C, flipY: _, skewX: R, skewY: b }), (S = d.getTransformer()) == null || S.debounceRefreshControls();
|
|
1266
1283
|
});
|
|
1267
1284
|
})
|
|
1268
1285
|
);
|
|
1269
1286
|
}
|
|
1270
1287
|
_drawingRefreshListener() {
|
|
1271
1288
|
this.disposeWithMe(
|
|
1272
|
-
this._drawingManagerService.refreshTransform$.subscribe((
|
|
1273
|
-
|
|
1274
|
-
const { unitId: e, subUnitId:
|
|
1289
|
+
this._drawingManagerService.refreshTransform$.subscribe((r) => {
|
|
1290
|
+
r.forEach((t) => {
|
|
1291
|
+
const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._getSceneAndTransformerByDrawingSearch(e);
|
|
1275
1292
|
if (a == null)
|
|
1276
1293
|
return;
|
|
1277
|
-
const
|
|
1278
|
-
if (
|
|
1294
|
+
const o = this._drawingManagerService.getDrawingByParam(t);
|
|
1295
|
+
if (o == null)
|
|
1279
1296
|
return;
|
|
1280
|
-
const { transform: c } =
|
|
1281
|
-
if (
|
|
1297
|
+
const { transform: c } = o, { scene: l } = a, d = W({ unitId: e, subUnitId: n, drawingId: s }), u = l.getObject(d);
|
|
1298
|
+
if (u == null || c == null)
|
|
1282
1299
|
return !0;
|
|
1283
1300
|
const {
|
|
1284
1301
|
left: h = 0,
|
|
1285
1302
|
top: f = 0,
|
|
1286
|
-
width:
|
|
1287
|
-
height:
|
|
1288
|
-
angle:
|
|
1289
|
-
flipX:
|
|
1303
|
+
width: w = 0,
|
|
1304
|
+
height: v = 0,
|
|
1305
|
+
angle: m = 0,
|
|
1306
|
+
flipX: C = !1,
|
|
1290
1307
|
flipY: _ = !1,
|
|
1291
|
-
skewX:
|
|
1292
|
-
skewY:
|
|
1308
|
+
skewX: R = 0,
|
|
1309
|
+
skewY: b = 0
|
|
1293
1310
|
} = c;
|
|
1294
|
-
|
|
1311
|
+
u.transformByState({ left: h, top: f, width: w, height: v, angle: m, flipX: C, flipY: _, skewX: R, skewY: b });
|
|
1295
1312
|
});
|
|
1296
1313
|
})
|
|
1297
1314
|
);
|
|
1298
1315
|
}
|
|
1299
1316
|
_drawingVisibleListener() {
|
|
1300
1317
|
this.disposeWithMe(
|
|
1301
|
-
this._drawingManagerService.visible$.subscribe((
|
|
1302
|
-
|
|
1303
|
-
const { unitId: e, subUnitId:
|
|
1304
|
-
if (
|
|
1318
|
+
this._drawingManagerService.visible$.subscribe((r) => {
|
|
1319
|
+
r.forEach((t) => {
|
|
1320
|
+
const { unitId: e, subUnitId: n, drawingId: s, visible: a } = t, o = this._getSceneAndTransformerByDrawingSearch(e);
|
|
1321
|
+
if (o == null)
|
|
1305
1322
|
return;
|
|
1306
|
-
const { scene: c } =
|
|
1307
|
-
if (
|
|
1323
|
+
const { scene: c } = o, l = W({ unitId: e, subUnitId: n, drawingId: s }), d = c.getObject(l);
|
|
1324
|
+
if (d == null)
|
|
1308
1325
|
return !0;
|
|
1309
|
-
a ?
|
|
1326
|
+
a ? d.show() : d.hide();
|
|
1310
1327
|
});
|
|
1311
1328
|
})
|
|
1312
1329
|
);
|
|
1313
1330
|
}
|
|
1314
|
-
_filterUpdateParams(
|
|
1315
|
-
return
|
|
1331
|
+
_filterUpdateParams(r, t) {
|
|
1332
|
+
return r.filter((e, n) => {
|
|
1316
1333
|
if (e == null)
|
|
1317
1334
|
return !1;
|
|
1318
|
-
const { transform:
|
|
1319
|
-
return
|
|
1335
|
+
const { transform: s } = e;
|
|
1336
|
+
return ot(s, t == null ? void 0 : t[n]);
|
|
1320
1337
|
});
|
|
1321
1338
|
}
|
|
1322
1339
|
// group?.getObjects().forEach((o) => {
|
|
@@ -1326,52 +1343,52 @@ let Ue = class extends xe {
|
|
|
1326
1343
|
// drawings.push({ unitId, subUnitId, drawingId });
|
|
1327
1344
|
// }
|
|
1328
1345
|
// });
|
|
1329
|
-
_addListenerOnDrawing(
|
|
1330
|
-
const
|
|
1346
|
+
_addListenerOnDrawing(r) {
|
|
1347
|
+
const t = r.getTransformerByCreate();
|
|
1331
1348
|
let e = null;
|
|
1332
1349
|
this.disposeWithMe(
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
const { objects:
|
|
1350
|
+
_e(
|
|
1351
|
+
t.changeStart$.subscribe((n) => {
|
|
1352
|
+
const { objects: s } = n, a = Array.from(s.values()), o = [];
|
|
1336
1353
|
e = a.map((c) => {
|
|
1337
|
-
const { left: l, top:
|
|
1338
|
-
if (
|
|
1339
|
-
let
|
|
1340
|
-
if (
|
|
1354
|
+
const { left: l, top: d, height: u, width: h, angle: f, oKey: w, isInGroup: v } = c, m = this._drawingManagerService.getDrawingOKey(w);
|
|
1355
|
+
if (v || c instanceof Ce) {
|
|
1356
|
+
let C = c.ancestorGroup;
|
|
1357
|
+
if (C == null && c instanceof Ce && (C = c), C == null)
|
|
1341
1358
|
return null;
|
|
1342
|
-
const _ = this._drawingManagerService.getDrawingOKey(
|
|
1359
|
+
const _ = this._drawingManagerService.getDrawingOKey(C.oKey);
|
|
1343
1360
|
if (_) {
|
|
1344
|
-
const { unitId:
|
|
1345
|
-
|
|
1346
|
-
const { left:
|
|
1347
|
-
return { left:
|
|
1361
|
+
const { unitId: R, subUnitId: b, drawingId: N } = _;
|
|
1362
|
+
o.push({ unitId: R, subUnitId: b, drawingId: N });
|
|
1363
|
+
const { left: I, top: S, height: y, width: M, angle: O } = C;
|
|
1364
|
+
return { left: I, top: S, height: y, width: M, angle: O };
|
|
1348
1365
|
}
|
|
1349
|
-
} else if (
|
|
1350
|
-
const { unitId:
|
|
1351
|
-
return
|
|
1366
|
+
} else if (m != null) {
|
|
1367
|
+
const { unitId: C, subUnitId: _, drawingId: R } = m;
|
|
1368
|
+
return o.push({ unitId: C, subUnitId: _, drawingId: R }), { left: l, top: d, height: u, width: h, angle: f };
|
|
1352
1369
|
}
|
|
1353
1370
|
return null;
|
|
1354
|
-
}).filter((c) => c != null),
|
|
1371
|
+
}).filter((c) => c != null), o.length > 0 ? this._commandService.syncExecuteCommand(Ee.id, o) : this._commandService.syncExecuteCommand(Ee.id, []);
|
|
1355
1372
|
})
|
|
1356
1373
|
)
|
|
1357
1374
|
), this.disposeWithMe(
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
const { objects:
|
|
1375
|
+
_e(
|
|
1376
|
+
t.changeEnd$.subscribe((n) => {
|
|
1377
|
+
const { objects: s } = n, a = this._filterUpdateParams(We(s, this._drawingManagerService), e);
|
|
1361
1378
|
a.length > 0 && this._drawingManagerService.featurePluginUpdateNotification(a);
|
|
1362
1379
|
})
|
|
1363
1380
|
)
|
|
1364
1381
|
);
|
|
1365
1382
|
}
|
|
1366
1383
|
};
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
],
|
|
1373
|
-
class
|
|
1374
|
-
constructor(
|
|
1384
|
+
He = Ir([
|
|
1385
|
+
Ne(0, Ze),
|
|
1386
|
+
Ne(1, he),
|
|
1387
|
+
Ne(2, me),
|
|
1388
|
+
Ne(3, ae)
|
|
1389
|
+
], He);
|
|
1390
|
+
class De extends Lt {
|
|
1391
|
+
constructor(t, e) {
|
|
1375
1392
|
e == null && (e = {}), e.transformerConfig = {
|
|
1376
1393
|
keepRatio: !1,
|
|
1377
1394
|
isCropper: !0,
|
|
@@ -1379,362 +1396,362 @@ class Me extends Gn {
|
|
|
1379
1396
|
anchorStroke: "rgb(255, 255, 255)",
|
|
1380
1397
|
anchorSize: 24
|
|
1381
1398
|
};
|
|
1382
|
-
super(
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1399
|
+
super(t, e);
|
|
1400
|
+
te(this, "_srcRect");
|
|
1401
|
+
te(this, "_prstGeom");
|
|
1402
|
+
te(this, "_applyTransform");
|
|
1403
|
+
te(this, "_dragPadding", 8);
|
|
1404
|
+
te(this, "_cacheCanvas");
|
|
1388
1405
|
e != null && e.srcRect && (this._srcRect = e.srcRect), e != null && e.prstGeom && (this._prstGeom = e.prstGeom), e != null && e.applyTransform && (this._applyTransform = e.applyTransform), e != null && e.dragPadding && (this._dragPadding = e.dragPadding), this._applyProps();
|
|
1389
1406
|
}
|
|
1390
|
-
refreshSrcRect(
|
|
1391
|
-
this._srcRect =
|
|
1407
|
+
refreshSrcRect(t, e) {
|
|
1408
|
+
this._srcRect = t, this._applyTransform = e, this._applyProps();
|
|
1392
1409
|
}
|
|
1393
1410
|
get srcRect() {
|
|
1394
1411
|
return this._srcRect;
|
|
1395
1412
|
}
|
|
1396
1413
|
dispose() {
|
|
1397
|
-
var
|
|
1398
|
-
super.dispose(), (
|
|
1414
|
+
var t;
|
|
1415
|
+
super.dispose(), (t = this._cacheCanvas) == null || t.dispose(), this._srcRect = null;
|
|
1399
1416
|
}
|
|
1400
|
-
isHit(
|
|
1401
|
-
const e = this.getInverseCoord(
|
|
1417
|
+
isHit(t) {
|
|
1418
|
+
const e = this.getInverseCoord(t);
|
|
1402
1419
|
return e.x >= -this.strokeWidth / 2 && e.x <= this.width + this.strokeWidth / 2 && e.y >= -this.strokeWidth / 2 && e.y <= this.height + this.strokeWidth / 2 && !this._inSurround(e);
|
|
1403
1420
|
}
|
|
1404
|
-
_inSurround(
|
|
1421
|
+
_inSurround(t) {
|
|
1405
1422
|
const e = this._dragPadding;
|
|
1406
|
-
return
|
|
1423
|
+
return t.x >= e - this.strokeWidth / 2 && t.x <= this.width + this.strokeWidth / 2 - e && t.y >= e - this.strokeWidth / 2 && t.y <= this.height + this.strokeWidth / 2 - e;
|
|
1407
1424
|
}
|
|
1408
|
-
render(
|
|
1409
|
-
return this.visible ? (
|
|
1425
|
+
render(t, e) {
|
|
1426
|
+
return this.visible ? (t.save(), this._draw(t), t.restore(), this.makeDirty(!1), this) : (this.makeDirty(!1), this);
|
|
1410
1427
|
}
|
|
1411
|
-
_draw(
|
|
1428
|
+
_draw(t) {
|
|
1412
1429
|
var c, l;
|
|
1413
|
-
const
|
|
1430
|
+
const n = this.getScene().getEngine(), { width: s, height: a } = n;
|
|
1414
1431
|
this._initialCacheCanvas(), (c = this._cacheCanvas) == null || c.clear();
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1432
|
+
const o = (l = this._cacheCanvas) == null ? void 0 : l.getContext();
|
|
1433
|
+
o != null && (o.save(), lt.drawWith(o, {
|
|
1417
1434
|
left: 0,
|
|
1418
1435
|
top: 0,
|
|
1419
|
-
width:
|
|
1436
|
+
width: s,
|
|
1420
1437
|
height: a,
|
|
1421
1438
|
fill: "rgba(0, 0, 0, 0.5)"
|
|
1422
|
-
}),
|
|
1439
|
+
}), o.setTransform(t.getTransform()), this._clipForApplyObject(o), this._applyCache(t), o.restore());
|
|
1423
1440
|
}
|
|
1424
|
-
_clipForApplyObject(
|
|
1441
|
+
_clipForApplyObject(t) {
|
|
1425
1442
|
let e = 0;
|
|
1426
|
-
if (this._prstGeom != null && (e = 1),
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1443
|
+
if (this._prstGeom != null && (e = 1), t.globalCompositeOperation = "destination-out", t.beginPath(), e === 0) {
|
|
1444
|
+
const n = this.transform.getMatrix();
|
|
1445
|
+
t.transform(n[0], n[1], n[2], n[3], n[4], n[5]), t.rect(0, 0, this.width, this.height), t.fill();
|
|
1429
1446
|
}
|
|
1430
1447
|
}
|
|
1431
1448
|
_applyProps() {
|
|
1432
1449
|
if (this._applyTransform == null)
|
|
1433
1450
|
return;
|
|
1434
|
-
let
|
|
1435
|
-
const { left: a = 0, top:
|
|
1451
|
+
let t = 0, e = 0, n = 0, s = 0;
|
|
1452
|
+
const { left: a = 0, top: o = 0, width: c = 0, height: l = 0, angle: d } = this._applyTransform;
|
|
1436
1453
|
if (this._srcRect != null) {
|
|
1437
|
-
const { left: f = 0, top:
|
|
1438
|
-
|
|
1454
|
+
const { left: f = 0, top: w = 0, right: v = 0, bottom: m = 0 } = this._srcRect;
|
|
1455
|
+
t = f, e = w, n = v, s = m;
|
|
1439
1456
|
}
|
|
1440
|
-
const
|
|
1457
|
+
const u = a + t, h = o + e;
|
|
1441
1458
|
this.transformByState({
|
|
1442
|
-
left:
|
|
1459
|
+
left: u,
|
|
1443
1460
|
top: h,
|
|
1444
|
-
width: a + c -
|
|
1445
|
-
height:
|
|
1446
|
-
angle:
|
|
1461
|
+
width: a + c - n - u,
|
|
1462
|
+
height: o + l - s - h,
|
|
1463
|
+
angle: d
|
|
1447
1464
|
});
|
|
1448
1465
|
}
|
|
1449
|
-
_applyCache(
|
|
1450
|
-
if (!
|
|
1466
|
+
_applyCache(t) {
|
|
1467
|
+
if (!t || this._cacheCanvas == null)
|
|
1451
1468
|
return;
|
|
1452
1469
|
const e = this._cacheCanvas.getContext();
|
|
1453
|
-
e.save(),
|
|
1470
|
+
e.save(), t.save(), t.setTransform(1, 0, 0, 1, 0, 0), e.setTransform(1, 0, 0, 1, 0, 0), t.drawImage(this._cacheCanvas.getCanvasEle(), 0, 0), t.restore(), e.restore();
|
|
1454
1471
|
}
|
|
1455
1472
|
_initialCacheCanvas() {
|
|
1456
1473
|
if (this._cacheCanvas != null)
|
|
1457
1474
|
return;
|
|
1458
|
-
const
|
|
1459
|
-
if (
|
|
1460
|
-
this._cacheCanvas = new
|
|
1461
|
-
const e =
|
|
1475
|
+
const t = this.getScene();
|
|
1476
|
+
if (t == null) return;
|
|
1477
|
+
this._cacheCanvas = new kt();
|
|
1478
|
+
const e = t.getEngine();
|
|
1462
1479
|
this._cacheCanvas.setSize(e.width, e.height), e.onTransformChange$.subscribeEvent(() => {
|
|
1463
|
-
var
|
|
1464
|
-
(
|
|
1480
|
+
var n;
|
|
1481
|
+
(n = this._cacheCanvas) == null || n.setSize(e.width, e.height), this.makeDirty(!0);
|
|
1465
1482
|
});
|
|
1466
1483
|
}
|
|
1467
1484
|
}
|
|
1468
|
-
var
|
|
1469
|
-
for (var
|
|
1470
|
-
(a = i[
|
|
1471
|
-
return
|
|
1472
|
-
},
|
|
1473
|
-
let Ae = class extends
|
|
1474
|
-
constructor(
|
|
1485
|
+
var Mr = Object.getOwnPropertyDescriptor, Rr = (i, r, t, e) => {
|
|
1486
|
+
for (var n = e > 1 ? void 0 : e ? Mr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
|
|
1487
|
+
(a = i[s]) && (n = a(n) || n);
|
|
1488
|
+
return n;
|
|
1489
|
+
}, fe = (i, r) => (t, e) => r(t, e, i);
|
|
1490
|
+
let Ae = class extends Ve {
|
|
1491
|
+
constructor(r, t, e, n, s, a) {
|
|
1475
1492
|
super();
|
|
1476
|
-
|
|
1477
|
-
this._commandService =
|
|
1493
|
+
te(this, "_sceneListenerOnImageMap", /* @__PURE__ */ new WeakSet());
|
|
1494
|
+
this._commandService = r, this._drawingManagerService = t, this._renderManagerService = e, this._univerInstanceService = n, this._messageService = s, this._localeService = a, this._init();
|
|
1478
1495
|
}
|
|
1479
1496
|
_init() {
|
|
1480
1497
|
this._initOpenCrop(), this._initCloseCrop(), this._initAutoCrop();
|
|
1481
1498
|
}
|
|
1482
1499
|
_initAutoCrop() {
|
|
1483
1500
|
this.disposeWithMe(
|
|
1484
|
-
this._commandService.onCommandExecuted((
|
|
1485
|
-
if (
|
|
1501
|
+
this._commandService.onCommandExecuted((r) => {
|
|
1502
|
+
if (r.id !== Ue.id)
|
|
1486
1503
|
return;
|
|
1487
|
-
const
|
|
1488
|
-
if (
|
|
1504
|
+
const t = r.params;
|
|
1505
|
+
if (t == null)
|
|
1489
1506
|
return;
|
|
1490
|
-
const { cropType: e } =
|
|
1491
|
-
if (
|
|
1507
|
+
const { cropType: e } = t, n = this._drawingManagerService.getFocusDrawings();
|
|
1508
|
+
if (n.length !== 1)
|
|
1492
1509
|
return;
|
|
1493
|
-
const
|
|
1494
|
-
if (
|
|
1510
|
+
const s = n[0], { unitId: a, subUnitId: o, drawingId: c } = s, l = this._renderManagerService.getRenderById(a), d = l == null ? void 0 : l.scene;
|
|
1511
|
+
if (d == null)
|
|
1495
1512
|
return !0;
|
|
1496
|
-
this._searchCropObject(
|
|
1497
|
-
const h =
|
|
1498
|
-
if (!(f instanceof
|
|
1513
|
+
this._searchCropObject(d) != null && this._commandService.syncExecuteCommand(ge.id, { isAuto: !0 });
|
|
1514
|
+
const h = W({ unitId: a, subUnitId: o, drawingId: c }), f = d.getObject(h);
|
|
1515
|
+
if (!(f instanceof Ke)) {
|
|
1499
1516
|
this._messageService.show({
|
|
1500
|
-
type:
|
|
1517
|
+
type: tt.Error,
|
|
1501
1518
|
content: this._localeService.t("image-cropper.error")
|
|
1502
1519
|
});
|
|
1503
1520
|
return;
|
|
1504
1521
|
}
|
|
1505
|
-
f != null && (this._updateCropperObject(e, f), this._commandService.executeCommand(
|
|
1522
|
+
f != null && (this._updateCropperObject(e, f), this._commandService.executeCommand(Ye.id, { unitId: a, subUnitId: o, drawingId: c }));
|
|
1506
1523
|
})
|
|
1507
1524
|
);
|
|
1508
1525
|
}
|
|
1509
|
-
_calculateSrcRectByRatio(
|
|
1510
|
-
const
|
|
1511
|
-
let l = e,
|
|
1512
|
-
|
|
1513
|
-
const
|
|
1526
|
+
_calculateSrcRectByRatio(r, t, e, n, s, a) {
|
|
1527
|
+
const o = e / n, c = s / a;
|
|
1528
|
+
let l = e, d = n;
|
|
1529
|
+
o > c ? l = n * c : d = e / c;
|
|
1530
|
+
const u = (e - l) / 2, h = (n - d) / 2;
|
|
1514
1531
|
return {
|
|
1515
|
-
left:
|
|
1516
|
-
top:
|
|
1517
|
-
right:
|
|
1518
|
-
bottom:
|
|
1532
|
+
left: Re(u, 1),
|
|
1533
|
+
top: Re(h, 1),
|
|
1534
|
+
right: Re(e - (u + l), 1),
|
|
1535
|
+
bottom: Re(n - (h + d), 1)
|
|
1519
1536
|
};
|
|
1520
1537
|
}
|
|
1521
|
-
_updateCropperObject(
|
|
1522
|
-
const { left: e, top:
|
|
1523
|
-
let
|
|
1524
|
-
switch (
|
|
1525
|
-
case
|
|
1526
|
-
|
|
1538
|
+
_updateCropperObject(r, t) {
|
|
1539
|
+
const { left: e, top: n, width: s, height: a } = t.calculateTransformWithSrcRect();
|
|
1540
|
+
let o;
|
|
1541
|
+
switch (r) {
|
|
1542
|
+
case x.R1_1:
|
|
1543
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 1, 1);
|
|
1527
1544
|
break;
|
|
1528
|
-
case
|
|
1529
|
-
|
|
1545
|
+
case x.R16_9:
|
|
1546
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 16, 9);
|
|
1530
1547
|
break;
|
|
1531
|
-
case
|
|
1532
|
-
|
|
1548
|
+
case x.R9_16:
|
|
1549
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 9, 16);
|
|
1533
1550
|
break;
|
|
1534
|
-
case
|
|
1535
|
-
|
|
1551
|
+
case x.R5_4:
|
|
1552
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 5, 4);
|
|
1536
1553
|
break;
|
|
1537
|
-
case
|
|
1538
|
-
|
|
1554
|
+
case x.R4_5:
|
|
1555
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 4, 5);
|
|
1539
1556
|
break;
|
|
1540
|
-
case
|
|
1541
|
-
|
|
1557
|
+
case x.R4_3:
|
|
1558
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 4, 3);
|
|
1542
1559
|
break;
|
|
1543
|
-
case
|
|
1544
|
-
|
|
1560
|
+
case x.R3_4:
|
|
1561
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 3, 4);
|
|
1545
1562
|
break;
|
|
1546
|
-
case
|
|
1547
|
-
|
|
1563
|
+
case x.R3_2:
|
|
1564
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 3, 2);
|
|
1548
1565
|
break;
|
|
1549
|
-
case
|
|
1550
|
-
|
|
1566
|
+
case x.R2_3:
|
|
1567
|
+
o = this._calculateSrcRectByRatio(e, n, s, a, 2, 3);
|
|
1551
1568
|
break;
|
|
1552
|
-
case
|
|
1569
|
+
case x.FREE:
|
|
1553
1570
|
}
|
|
1554
|
-
if (
|
|
1571
|
+
if (o == null)
|
|
1555
1572
|
return;
|
|
1556
|
-
|
|
1557
|
-
const { left: c = 0, top: l = 0, bottom:
|
|
1558
|
-
|
|
1573
|
+
t.setSrcRect(o);
|
|
1574
|
+
const { left: c = 0, top: l = 0, bottom: d = 0, right: u = 0 } = o;
|
|
1575
|
+
t.transformByStateCloseCropper({
|
|
1559
1576
|
left: e + c,
|
|
1560
|
-
top:
|
|
1561
|
-
width:
|
|
1562
|
-
height: a -
|
|
1577
|
+
top: n + l,
|
|
1578
|
+
width: s - u - c,
|
|
1579
|
+
height: a - d - l
|
|
1563
1580
|
});
|
|
1564
1581
|
}
|
|
1565
1582
|
_initOpenCrop() {
|
|
1566
1583
|
this.disposeWithMe(
|
|
1567
|
-
this._commandService.onCommandExecuted((
|
|
1568
|
-
if (
|
|
1584
|
+
this._commandService.onCommandExecuted((r) => {
|
|
1585
|
+
if (r.id !== Ye.id)
|
|
1569
1586
|
return;
|
|
1570
|
-
const
|
|
1571
|
-
if (
|
|
1587
|
+
const t = r.params;
|
|
1588
|
+
if (t == null)
|
|
1572
1589
|
return;
|
|
1573
|
-
const { unitId: e, subUnitId:
|
|
1574
|
-
if (
|
|
1590
|
+
const { unitId: e, subUnitId: n, drawingId: s } = t, a = this._renderManagerService.getRenderById(e), o = a == null ? void 0 : a.scene;
|
|
1591
|
+
if (o == null)
|
|
1575
1592
|
return !0;
|
|
1576
|
-
if (this._sceneListenerOnImageMap.has(
|
|
1593
|
+
if (this._sceneListenerOnImageMap.has(o) || (this._addListenerOnImage(o), this._sceneListenerOnImageMap.add(o)), this._drawingManagerService.getDrawingByParam({ unitId: e, subUnitId: n, drawingId: s }) == null)
|
|
1577
1594
|
return;
|
|
1578
|
-
const l =
|
|
1579
|
-
if (
|
|
1595
|
+
const l = W({ unitId: e, subUnitId: n, drawingId: s }), d = o.getObject(l);
|
|
1596
|
+
if (d == null)
|
|
1580
1597
|
return;
|
|
1581
|
-
if (!(
|
|
1598
|
+
if (!(d instanceof Ke)) {
|
|
1582
1599
|
this._messageService.show({
|
|
1583
|
-
type:
|
|
1600
|
+
type: tt.Error,
|
|
1584
1601
|
content: this._localeService.t("image-cropper.error")
|
|
1585
1602
|
});
|
|
1586
1603
|
return;
|
|
1587
1604
|
}
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1590
|
-
const h = new
|
|
1591
|
-
srcRect:
|
|
1592
|
-
prstGeom:
|
|
1593
|
-
applyTransform:
|
|
1605
|
+
const u = o.getTransformer();
|
|
1606
|
+
u == null || u.clearControls();
|
|
1607
|
+
const h = new De(`${l}-crop`, {
|
|
1608
|
+
srcRect: d.srcRect,
|
|
1609
|
+
prstGeom: d.prstGeom,
|
|
1610
|
+
applyTransform: d.calculateTransformWithSrcRect()
|
|
1594
1611
|
});
|
|
1595
|
-
|
|
1612
|
+
o.addObject(h, d.getLayerIndex() + 1).attachTransformerTo(h), u == null || u.createControlForCopper(h), this._addHoverForImageCopper(h), d.openRenderByCropper(), u == null || u.refreshControls(), h.makeDirty(!0), this._commandService.syncExecuteCommand(Ee.id, [{ unitId: e, subUnitId: n, drawingId: s }]);
|
|
1596
1613
|
})
|
|
1597
1614
|
);
|
|
1598
1615
|
}
|
|
1599
|
-
_searchCropObject(
|
|
1600
|
-
const
|
|
1601
|
-
for (const e of
|
|
1602
|
-
if (e instanceof
|
|
1616
|
+
_searchCropObject(r) {
|
|
1617
|
+
const t = r.getAllObjectsByOrder();
|
|
1618
|
+
for (const e of t)
|
|
1619
|
+
if (e instanceof De)
|
|
1603
1620
|
return e;
|
|
1604
1621
|
}
|
|
1605
1622
|
_initCloseCrop() {
|
|
1606
1623
|
this.disposeWithMe(
|
|
1607
|
-
this._commandService.onCommandExecuted((
|
|
1608
|
-
if (
|
|
1624
|
+
this._commandService.onCommandExecuted((t) => {
|
|
1625
|
+
if (t.id !== ge.id)
|
|
1609
1626
|
return;
|
|
1610
1627
|
const e = this._univerInstanceService.getFocusedUnit();
|
|
1611
1628
|
if (e == null)
|
|
1612
1629
|
return;
|
|
1613
|
-
const
|
|
1630
|
+
const n = e.getUnitId(), s = this._renderManagerService.getRenderById(n), a = s == null ? void 0 : s.scene;
|
|
1614
1631
|
if (a == null)
|
|
1615
1632
|
return !0;
|
|
1616
|
-
const
|
|
1617
|
-
if (
|
|
1633
|
+
const o = this._searchCropObject(a);
|
|
1634
|
+
if (o == null)
|
|
1618
1635
|
return;
|
|
1619
|
-
const c = this._getApplyObjectByCropObject(
|
|
1636
|
+
const c = this._getApplyObjectByCropObject(o);
|
|
1620
1637
|
if (c == null)
|
|
1621
1638
|
return;
|
|
1622
1639
|
const l = a.getTransformerByCreate();
|
|
1623
|
-
l.detachFrom(
|
|
1624
|
-
const
|
|
1625
|
-
if (
|
|
1626
|
-
const { left: h, top: f, height:
|
|
1640
|
+
l.detachFrom(o), l.clearCopperControl();
|
|
1641
|
+
const d = this._getSrcRectByTransformState(c, o), u = this._drawingManagerService.getDrawingOKey(c.oKey);
|
|
1642
|
+
if (u != null) {
|
|
1643
|
+
const { left: h, top: f, height: w, width: v } = o;
|
|
1627
1644
|
this._drawingManagerService.featurePluginUpdateNotification([{
|
|
1628
|
-
...
|
|
1645
|
+
...u,
|
|
1629
1646
|
transform: {
|
|
1630
|
-
...
|
|
1647
|
+
...u.transform,
|
|
1631
1648
|
left: h,
|
|
1632
1649
|
top: f,
|
|
1633
|
-
height:
|
|
1634
|
-
width:
|
|
1650
|
+
height: w,
|
|
1651
|
+
width: v
|
|
1635
1652
|
},
|
|
1636
|
-
srcRect:
|
|
1653
|
+
srcRect: d.srcRectAngle
|
|
1637
1654
|
}]);
|
|
1638
1655
|
}
|
|
1639
|
-
c.setSrcRect({ ...
|
|
1656
|
+
c.setSrcRect({ ...d.srcRectAngle }), c.closeRenderByCropper(), c.makeDirty(!0), o == null || o.dispose();
|
|
1640
1657
|
})
|
|
1641
1658
|
);
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1659
|
+
const r = this._univerInstanceService.getCurrentTypeOfUnit$(Te.UNIVER_SHEET).pipe(
|
|
1660
|
+
Yt((t) => t ? t.activeSheet$ : Zt(null))
|
|
1644
1661
|
);
|
|
1645
|
-
this.disposeWithMe(
|
|
1662
|
+
this.disposeWithMe(r.subscribe(() => {
|
|
1646
1663
|
this._commandService.syncExecuteCommand(ge.id);
|
|
1647
1664
|
}));
|
|
1648
1665
|
}
|
|
1649
|
-
_getApplyObjectByCropObject(
|
|
1650
|
-
const
|
|
1651
|
-
if (!
|
|
1652
|
-
const
|
|
1653
|
-
return
|
|
1666
|
+
_getApplyObjectByCropObject(r) {
|
|
1667
|
+
const t = r.oKey, e = t.slice(0, t.length - 5), n = r.getScene();
|
|
1668
|
+
if (!n) return null;
|
|
1669
|
+
const s = n.getObject(e);
|
|
1670
|
+
return s == null ? null : s;
|
|
1654
1671
|
}
|
|
1655
|
-
_addListenerOnImage(
|
|
1656
|
-
const
|
|
1672
|
+
_addListenerOnImage(r) {
|
|
1673
|
+
const t = r.getTransformerByCreate();
|
|
1657
1674
|
let e = null;
|
|
1658
1675
|
this.disposeWithMe(
|
|
1659
|
-
|
|
1660
|
-
const { objects:
|
|
1661
|
-
if (a == null || !(a instanceof
|
|
1676
|
+
t.changeStart$.subscribe((n) => {
|
|
1677
|
+
const { objects: s } = n, a = s.values().next().value;
|
|
1678
|
+
if (a == null || !(a instanceof De))
|
|
1662
1679
|
return;
|
|
1663
|
-
const { left:
|
|
1664
|
-
e = { left:
|
|
1680
|
+
const { left: o, top: c, height: l, width: d, angle: u } = a;
|
|
1681
|
+
e = { left: o, top: c, height: l, width: d, angle: u }, t.clearCopperControl();
|
|
1665
1682
|
})
|
|
1666
1683
|
), this.disposeWithMe(
|
|
1667
|
-
|
|
1668
|
-
const { objects:
|
|
1669
|
-
if (a == null || !(a instanceof
|
|
1684
|
+
t.changeEnd$.subscribe((n) => {
|
|
1685
|
+
const { objects: s } = n, a = s.values().next().value;
|
|
1686
|
+
if (a == null || !(a instanceof De))
|
|
1670
1687
|
return;
|
|
1671
|
-
const { left:
|
|
1672
|
-
if (!
|
|
1688
|
+
const { left: o, top: c, height: l, width: d, angle: u } = a;
|
|
1689
|
+
if (!ot({ left: o, top: c, height: l, width: d, angle: u }, e))
|
|
1673
1690
|
return;
|
|
1674
1691
|
const h = this._getApplyObjectByCropObject(a);
|
|
1675
1692
|
if (h == null)
|
|
1676
1693
|
return;
|
|
1677
1694
|
const f = this._getSrcRectByTransformState(h, a);
|
|
1678
|
-
a.refreshSrcRect(f.srcRect, h.getState()),
|
|
1695
|
+
a.refreshSrcRect(f.srcRect, h.getState()), t.createControlForCopper(a);
|
|
1679
1696
|
})
|
|
1680
|
-
), this._endCropListener(
|
|
1697
|
+
), this._endCropListener(r);
|
|
1681
1698
|
}
|
|
1682
|
-
_addHoverForImageCopper(
|
|
1699
|
+
_addHoverForImageCopper(r) {
|
|
1683
1700
|
this.disposeWithMe(
|
|
1684
|
-
|
|
1685
|
-
|
|
1701
|
+
r.onPointerEnter$.subscribeEvent(() => {
|
|
1702
|
+
r.cursor = je.MOVE;
|
|
1686
1703
|
})
|
|
1687
1704
|
), this.disposeWithMe(
|
|
1688
|
-
|
|
1689
|
-
|
|
1705
|
+
r.onPointerLeave$.subscribeEvent(() => {
|
|
1706
|
+
r.cursor = je.DEFAULT;
|
|
1690
1707
|
})
|
|
1691
1708
|
);
|
|
1692
1709
|
}
|
|
1693
|
-
_endCropListener(
|
|
1694
|
-
const
|
|
1710
|
+
_endCropListener(r) {
|
|
1711
|
+
const t = r.getTransformerByCreate();
|
|
1695
1712
|
this.disposeWithMe(
|
|
1696
|
-
|
|
1713
|
+
t.clearControl$.subscribe((e) => {
|
|
1697
1714
|
e === !0 && this._commandService.syncExecuteCommand(ge.id);
|
|
1698
1715
|
})
|
|
1699
1716
|
);
|
|
1700
1717
|
}
|
|
1701
|
-
_getSrcRectByTransformState(
|
|
1702
|
-
const { left: e, top:
|
|
1703
|
-
left:
|
|
1704
|
-
top:
|
|
1705
|
-
right:
|
|
1706
|
-
bottom: h -
|
|
1707
|
-
}, _ = { ...
|
|
1718
|
+
_getSrcRectByTransformState(r, t) {
|
|
1719
|
+
const { left: e, top: n, height: s, width: a, strokeWidth: o, angle: c } = t, { left: l, top: d, width: u, height: h, angle: f, strokeWidth: w } = r, v = e - l, m = n - d, C = {
|
|
1720
|
+
left: v,
|
|
1721
|
+
top: m,
|
|
1722
|
+
right: u - v - a,
|
|
1723
|
+
bottom: h - m - s
|
|
1724
|
+
}, _ = { ...C };
|
|
1708
1725
|
if (f !== 0) {
|
|
1709
|
-
const
|
|
1710
|
-
|
|
1711
|
-
const O =
|
|
1712
|
-
O.rotateByPoint(
|
|
1713
|
-
const
|
|
1714
|
-
_.left =
|
|
1726
|
+
const R = e + a / 2, b = n + s / 2, N = new $e(R, b), I = u / 2 + l, S = h / 2 + d, y = new $e(I, S), M = new $e(l, d);
|
|
1727
|
+
M.rotateByPoint(et(f), y);
|
|
1728
|
+
const O = M.clone();
|
|
1729
|
+
O.rotateByPoint(et(-f), N);
|
|
1730
|
+
const j = e - O.x, T = n - O.y;
|
|
1731
|
+
_.left = j, _.top = T, _.right = u - j - a, _.bottom = h - T - s;
|
|
1715
1732
|
}
|
|
1716
1733
|
return {
|
|
1717
|
-
srcRect:
|
|
1734
|
+
srcRect: C,
|
|
1718
1735
|
srcRectAngle: _
|
|
1719
1736
|
};
|
|
1720
1737
|
}
|
|
1721
1738
|
};
|
|
1722
|
-
Ae =
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1739
|
+
Ae = Rr([
|
|
1740
|
+
fe(0, he),
|
|
1741
|
+
fe(1, ae),
|
|
1742
|
+
fe(2, me),
|
|
1743
|
+
fe(3, Ze),
|
|
1744
|
+
fe(4, Gt),
|
|
1745
|
+
fe(5, ke(ie))
|
|
1729
1746
|
], Ae);
|
|
1730
|
-
var
|
|
1731
|
-
for (var
|
|
1732
|
-
(a = i[
|
|
1733
|
-
return
|
|
1734
|
-
},
|
|
1735
|
-
let
|
|
1736
|
-
constructor(i,
|
|
1737
|
-
super(), this._commandService = i, this._renderManagerService =
|
|
1747
|
+
var Or = Object.getOwnPropertyDescriptor, Nr = (i, r, t, e) => {
|
|
1748
|
+
for (var n = e > 1 ? void 0 : e ? Or(r, t) : r, s = i.length - 1, a; s >= 0; s--)
|
|
1749
|
+
(a = i[s]) && (n = a(n) || n);
|
|
1750
|
+
return n;
|
|
1751
|
+
}, de = (i, r) => (t, e) => r(t, e, i);
|
|
1752
|
+
let Le = class extends Ve {
|
|
1753
|
+
constructor(i, r, t, e, n, s, a) {
|
|
1754
|
+
super(), this._commandService = i, this._renderManagerService = r, this._drawingManagerService = t, this._dialogService = e, this._imageIoService = n, this._currentUniverService = s, this._drawingRenderService = a, this._initialize();
|
|
1738
1755
|
}
|
|
1739
1756
|
dispose() {
|
|
1740
1757
|
super.dispose();
|
|
@@ -1745,11 +1762,11 @@ let He = class extends xe {
|
|
|
1745
1762
|
_commandExecutedListener() {
|
|
1746
1763
|
this.disposeWithMe(
|
|
1747
1764
|
this._commandService.onCommandExecuted((i) => {
|
|
1748
|
-
if (i.id ===
|
|
1749
|
-
const
|
|
1750
|
-
if (
|
|
1765
|
+
if (i.id === yt.id) {
|
|
1766
|
+
const r = i.params;
|
|
1767
|
+
if (r == null)
|
|
1751
1768
|
return;
|
|
1752
|
-
this._resetImageSize(
|
|
1769
|
+
this._resetImageSize(r);
|
|
1753
1770
|
}
|
|
1754
1771
|
})
|
|
1755
1772
|
);
|
|
@@ -1757,32 +1774,32 @@ let He = class extends xe {
|
|
|
1757
1774
|
_getSceneAndTransformerByDrawingSearch(i) {
|
|
1758
1775
|
if (i == null)
|
|
1759
1776
|
return;
|
|
1760
|
-
const
|
|
1761
|
-
if (
|
|
1777
|
+
const r = this._renderManagerService.getRenderById(i), t = r == null ? void 0 : r.scene;
|
|
1778
|
+
if (t == null)
|
|
1762
1779
|
return null;
|
|
1763
|
-
const e =
|
|
1764
|
-
return { scene:
|
|
1780
|
+
const e = t.getTransformerByCreate();
|
|
1781
|
+
return { scene: t, transformer: e };
|
|
1765
1782
|
}
|
|
1766
1783
|
_resetImageSize(i) {
|
|
1767
|
-
const
|
|
1784
|
+
const r = [], t = [];
|
|
1768
1785
|
i.forEach((e) => {
|
|
1769
|
-
const { unitId:
|
|
1770
|
-
if (
|
|
1786
|
+
const { unitId: n, subUnitId: s, drawingId: a } = e, o = this._getSceneAndTransformerByDrawingSearch(n);
|
|
1787
|
+
if (o == null)
|
|
1771
1788
|
return;
|
|
1772
|
-
const { scene: c } =
|
|
1773
|
-
if (m == null)
|
|
1774
|
-
return !0;
|
|
1775
|
-
const d = this._drawingManagerService.getDrawingByParam(e);
|
|
1789
|
+
const { scene: c } = o, l = W({ unitId: n, subUnitId: s, drawingId: a }), d = c.getObject(l);
|
|
1776
1790
|
if (d == null)
|
|
1777
1791
|
return !0;
|
|
1778
|
-
|
|
1792
|
+
const u = this._drawingManagerService.getDrawingByParam(e);
|
|
1793
|
+
if (u == null)
|
|
1794
|
+
return !0;
|
|
1795
|
+
if (u.drawingType !== re.DRAWING_IMAGE)
|
|
1779
1796
|
return;
|
|
1780
|
-
|
|
1781
|
-
const { width: h, height: f } =
|
|
1782
|
-
|
|
1783
|
-
...
|
|
1797
|
+
d.resetSize();
|
|
1798
|
+
const { width: h, height: f } = d.getNativeSize();
|
|
1799
|
+
t.includes(c) === !1 && t.push(c), r.push({
|
|
1800
|
+
...u,
|
|
1784
1801
|
transform: {
|
|
1785
|
-
...
|
|
1802
|
+
...u.transform,
|
|
1786
1803
|
height: f,
|
|
1787
1804
|
width: h,
|
|
1788
1805
|
angle: 0
|
|
@@ -1790,9 +1807,9 @@ let He = class extends xe {
|
|
|
1790
1807
|
srcRect: null,
|
|
1791
1808
|
prstGeom: null
|
|
1792
1809
|
});
|
|
1793
|
-
}), this._drawingManagerService.featurePluginUpdateNotification(
|
|
1810
|
+
}), this._drawingManagerService.featurePluginUpdateNotification(r), t.forEach((e) => {
|
|
1794
1811
|
e.getTransformerByCreate().refreshControls().changeNotification();
|
|
1795
|
-
}), this._commandService.syncExecuteCommand(
|
|
1812
|
+
}), this._commandService.syncExecuteCommand(Ee.id, i);
|
|
1796
1813
|
}
|
|
1797
1814
|
_drawingAddListener() {
|
|
1798
1815
|
this.disposeWithMe(
|
|
@@ -1802,127 +1819,127 @@ let He = class extends xe {
|
|
|
1802
1819
|
);
|
|
1803
1820
|
}
|
|
1804
1821
|
_insertImages(i) {
|
|
1805
|
-
i.forEach(async (
|
|
1822
|
+
i.forEach(async (r) => {
|
|
1806
1823
|
var c;
|
|
1807
|
-
const { unitId:
|
|
1808
|
-
if (
|
|
1824
|
+
const { unitId: t, subUnitId: e } = r, n = this._getSceneAndTransformerByDrawingSearch(t), s = (c = gt(this._currentUniverService, t)) == null ? void 0 : c.subUnitId;
|
|
1825
|
+
if (n == null || s !== e)
|
|
1809
1826
|
return;
|
|
1810
|
-
const a = this._drawingManagerService.getDrawingByParam(
|
|
1827
|
+
const a = this._drawingManagerService.getDrawingByParam(r);
|
|
1811
1828
|
if (a == null)
|
|
1812
1829
|
return;
|
|
1813
|
-
const
|
|
1814
|
-
if (this._drawingManagerService.refreshTransform([a]), !(
|
|
1815
|
-
for (const l of
|
|
1830
|
+
const o = await this._drawingRenderService.renderImages(a, n.scene);
|
|
1831
|
+
if (this._drawingManagerService.refreshTransform([a]), !(o == null || o.length === 0))
|
|
1832
|
+
for (const l of o)
|
|
1816
1833
|
this._addHoverForImage(l), this._addDialogForImage(l);
|
|
1817
1834
|
});
|
|
1818
1835
|
}
|
|
1819
1836
|
_imageUpdateListener() {
|
|
1820
1837
|
this.disposeWithMe(
|
|
1821
1838
|
this._drawingManagerService.update$.subscribe((i) => {
|
|
1822
|
-
i.forEach((
|
|
1823
|
-
const { unitId:
|
|
1824
|
-
if (
|
|
1839
|
+
i.forEach((r) => {
|
|
1840
|
+
const { unitId: t, subUnitId: e, drawingId: n } = r, s = this._drawingManagerService.getDrawingByParam(r);
|
|
1841
|
+
if (s == null)
|
|
1825
1842
|
return;
|
|
1826
|
-
const { transform: a, drawingType:
|
|
1827
|
-
if (
|
|
1843
|
+
const { transform: a, drawingType: o, srcRect: c, prstGeom: l, source: d, imageSourceType: u } = s;
|
|
1844
|
+
if (o !== re.DRAWING_IMAGE)
|
|
1828
1845
|
return;
|
|
1829
|
-
const h = this._getSceneAndTransformerByDrawingSearch(
|
|
1846
|
+
const h = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1830
1847
|
if (h == null)
|
|
1831
1848
|
return;
|
|
1832
|
-
const { scene: f, transformer:
|
|
1849
|
+
const { scene: f, transformer: w } = h;
|
|
1833
1850
|
if (a == null)
|
|
1834
1851
|
return !0;
|
|
1835
|
-
const
|
|
1836
|
-
if (
|
|
1852
|
+
const v = W({ unitId: t, subUnitId: e, drawingId: n }), m = f.getObject(v);
|
|
1853
|
+
if (m == null)
|
|
1837
1854
|
return !0;
|
|
1838
|
-
|
|
1855
|
+
m.setSrcRect(c), m.setPrstGeom(l), d != null && d.length > 0 && (u === qe.BASE64 || u === qe.URL) && m.changeSource(d);
|
|
1839
1856
|
});
|
|
1840
1857
|
})
|
|
1841
1858
|
);
|
|
1842
1859
|
}
|
|
1843
1860
|
_addHoverForImage(i) {
|
|
1844
1861
|
this.disposeWithMe(
|
|
1845
|
-
|
|
1862
|
+
_e(
|
|
1846
1863
|
i.onPointerEnter$.subscribeEvent(() => {
|
|
1847
|
-
i.cursor =
|
|
1864
|
+
i.cursor = je.GRAB;
|
|
1848
1865
|
})
|
|
1849
1866
|
)
|
|
1850
1867
|
), this.disposeWithMe(
|
|
1851
|
-
|
|
1868
|
+
_e(
|
|
1852
1869
|
i.onPointerLeave$.subscribeEvent(() => {
|
|
1853
|
-
i.cursor =
|
|
1870
|
+
i.cursor = je.DEFAULT;
|
|
1854
1871
|
})
|
|
1855
1872
|
)
|
|
1856
1873
|
);
|
|
1857
1874
|
}
|
|
1858
1875
|
_addDialogForImage(i) {
|
|
1859
1876
|
this.disposeWithMe(
|
|
1860
|
-
|
|
1877
|
+
_e(
|
|
1861
1878
|
i.onDblclick$.subscribeEvent(() => {
|
|
1862
|
-
const
|
|
1863
|
-
this._drawingRenderService.previewImage(
|
|
1879
|
+
const r = `${i.oKey}-viewer-dialog`;
|
|
1880
|
+
this._drawingRenderService.previewImage(r, i.getNative().src, i.getNativeSize().width, i.getNativeSize().height);
|
|
1864
1881
|
})
|
|
1865
1882
|
)
|
|
1866
1883
|
);
|
|
1867
1884
|
}
|
|
1868
1885
|
};
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
],
|
|
1878
|
-
var
|
|
1879
|
-
for (var
|
|
1880
|
-
(a = i[
|
|
1881
|
-
return
|
|
1882
|
-
},
|
|
1883
|
-
const
|
|
1884
|
-
var
|
|
1885
|
-
let
|
|
1886
|
-
constructor(i =
|
|
1887
|
-
super(), this._config = i, this._injector =
|
|
1888
|
-
const { menu: e, ...
|
|
1886
|
+
Le = Nr([
|
|
1887
|
+
de(0, he),
|
|
1888
|
+
de(1, me),
|
|
1889
|
+
de(2, ae),
|
|
1890
|
+
de(3, $t),
|
|
1891
|
+
de(4, ct),
|
|
1892
|
+
de(5, Ze),
|
|
1893
|
+
de(6, ke(Be))
|
|
1894
|
+
], Le);
|
|
1895
|
+
var Dr = Object.getOwnPropertyDescriptor, Tr = (i, r, t, e) => {
|
|
1896
|
+
for (var n = e > 1 ? void 0 : e ? Dr(r, t) : r, s = i.length - 1, a; s >= 0; s--)
|
|
1897
|
+
(a = i[s]) && (n = a(n) || n);
|
|
1898
|
+
return n;
|
|
1899
|
+
}, at = (i, r) => (t, e) => r(t, e, i);
|
|
1900
|
+
const Er = "UNIVER_DRAWING_UI_PLUGIN";
|
|
1901
|
+
var Fe;
|
|
1902
|
+
let st = (Fe = class extends Bt {
|
|
1903
|
+
constructor(i = nt, r, t) {
|
|
1904
|
+
super(), this._config = i, this._injector = r, this._configService = t;
|
|
1905
|
+
const { menu: e, ...n } = Ut(
|
|
1889
1906
|
{},
|
|
1890
|
-
|
|
1907
|
+
nt,
|
|
1891
1908
|
this._config
|
|
1892
1909
|
);
|
|
1893
|
-
e && this._configService.setConfig("menu", e, { merge: !0 }), this._configService.setConfig(
|
|
1910
|
+
e && this._configService.setConfig("menu", e, { merge: !0 }), this._configService.setConfig(Cr, n);
|
|
1894
1911
|
}
|
|
1895
1912
|
onStarting() {
|
|
1896
1913
|
this._initDependencies();
|
|
1897
1914
|
}
|
|
1898
1915
|
onRendered() {
|
|
1899
|
-
this._injector.get(
|
|
1916
|
+
this._injector.get(He), this._injector.get(xe), this._injector.get(Ae), this._injector.get(Le);
|
|
1900
1917
|
}
|
|
1901
1918
|
_initDependencies() {
|
|
1902
1919
|
[
|
|
1903
|
-
[
|
|
1904
|
-
[
|
|
1905
|
-
[
|
|
1920
|
+
[Be],
|
|
1921
|
+
[He],
|
|
1922
|
+
[xe],
|
|
1906
1923
|
[Ae],
|
|
1907
|
-
[
|
|
1908
|
-
].forEach((
|
|
1909
|
-
}
|
|
1910
|
-
},
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
],
|
|
1924
|
+
[Le]
|
|
1925
|
+
].forEach((r) => this._injector.add(r));
|
|
1926
|
+
}
|
|
1927
|
+
}, te(Fe, "pluginName", Er), Fe);
|
|
1928
|
+
st = Tr([
|
|
1929
|
+
at(1, ke(Pt)),
|
|
1930
|
+
at(2, jt)
|
|
1931
|
+
], st);
|
|
1915
1932
|
export {
|
|
1916
|
-
|
|
1917
|
-
|
|
1933
|
+
Ue as AutoImageCropOperation,
|
|
1934
|
+
_r as COMPONENT_IMAGE_POPUP_MENU,
|
|
1918
1935
|
ge as CloseImageCropOperation,
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1936
|
+
Wr as DrawingCommonPanel,
|
|
1937
|
+
Be as DrawingRenderService,
|
|
1938
|
+
De as ImageCropperObject,
|
|
1939
|
+
wr as ImagePopupMenu,
|
|
1940
|
+
yt as ImageResetSizeOperation,
|
|
1941
|
+
Ye as OpenImageCropOperation,
|
|
1942
|
+
Xe as SetDrawingAlignOperation,
|
|
1943
|
+
st as UniverDrawingUIPlugin,
|
|
1944
|
+
We as getUpdateParams
|
|
1928
1945
|
};
|