@univerjs/drawing-ui 0.1.16 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +644 -647
- package/lib/types/index.d.ts +3 -2
- package/lib/umd/index.js +1 -1
- package/package.json +18 -17
package/lib/es/index.js
CHANGED
|
@@ -1,104 +1,105 @@
|
|
|
1
1
|
var Mt = Object.defineProperty;
|
|
2
2
|
var Ot = (a, n, e) => n in a ? Mt(a, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[n] = e;
|
|
3
|
-
var
|
|
4
|
-
import { getDrawingShapeKeyByDrawingSearch as
|
|
5
|
-
import { Group as
|
|
6
|
-
import { UniverInstanceType as
|
|
7
|
-
import { useDependency as
|
|
8
|
-
import
|
|
9
|
-
import { Button as
|
|
3
|
+
var Q = (a, n, e) => Ot(a, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { getDrawingShapeKeyByDrawingSearch as G, DrawingTypeEnum as te, ImageSourceType as Nt, IDrawingManagerService as ne, IImageIoService as rt, ArrangeTypeEnum as Se } from "@univerjs/drawing";
|
|
5
|
+
import { Group as pe, DRAWING_OBJECT_LAYER_INDEX as ze, Image as We, IRenderManagerService as ge, getGroupState as Dt, transformObjectOutOfGroup as Tt, RENDER_CLASS_TYPE as Xe, Shape as Bt, Rect as jt, Canvas as Ut, precisionTo as be, CURSOR_TYPE as Te, Vector2 as xe, degToRad as Je } from "@univerjs/engine-render";
|
|
6
|
+
import { UniverInstanceType as Re, LocaleService as Z, debounce as Ie, CommandType as we, ICommandService as ce, Tools as Ht, Disposable as Ue, checkIfMove as at, toDisposable as Ce, OnLifecycle as He, LifecycleStages as Le, IUniverInstanceService as Fe, Plugin as Lt } from "@univerjs/core";
|
|
7
|
+
import { useDependency as x } from "@wendellhu/redi/react-bindings";
|
|
8
|
+
import c, { forwardRef as Y, useRef as it, createElement as X, useState as L, useEffect as ve } from "react";
|
|
9
|
+
import { Button as ie, InputNumber as de, Checkbox as At, Select as ot, Dropdown as Vt, MessageType as qe } from "@univerjs/design";
|
|
10
10
|
import T from "clsx";
|
|
11
|
-
import { Inject as se, Injector as
|
|
12
|
-
import { ComponentManager as xt, IMenuService as Gt, IMessageService as Wt, IDialogService as
|
|
13
|
-
|
|
11
|
+
import { Inject as se, Injector as st } from "@wendellhu/redi";
|
|
12
|
+
import { ComponentManager as xt, IMenuService as Gt, IMessageService as Wt, IDialogService as $t } from "@univerjs/ui";
|
|
13
|
+
import { filter as kt, switchMap as zt } from "rxjs";
|
|
14
|
+
function Ft(a, n, e, t) {
|
|
14
15
|
const r = t.getDrawingByParam(a);
|
|
15
16
|
if (r == null)
|
|
16
17
|
return;
|
|
17
|
-
const o =
|
|
18
|
-
if (i && !(i instanceof
|
|
18
|
+
const o = G(a), i = e.getObject(o);
|
|
19
|
+
if (i && !(i instanceof pe))
|
|
19
20
|
return;
|
|
20
21
|
if (i != null) {
|
|
21
22
|
i.addObject(n);
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
|
-
const s = new
|
|
25
|
+
const s = new pe(o);
|
|
25
26
|
e.addObject(s, ze).attachTransformerTo(s), s.addObject(n);
|
|
26
|
-
const { transform:
|
|
27
|
-
|
|
27
|
+
const { transform: l } = r;
|
|
28
|
+
l && s.transformByState(
|
|
28
29
|
{
|
|
29
|
-
left:
|
|
30
|
-
top:
|
|
31
|
-
angle:
|
|
30
|
+
left: l.left,
|
|
31
|
+
top: l.top,
|
|
32
|
+
angle: l.angle
|
|
32
33
|
}
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function $e(a) {
|
|
36
37
|
var r;
|
|
37
38
|
const n = a.getFocusedUnit();
|
|
38
39
|
if (n == null)
|
|
39
40
|
return;
|
|
40
41
|
const e = n.getUnitId();
|
|
41
42
|
let t;
|
|
42
|
-
return n.type ===
|
|
43
|
+
return n.type === Re.UNIVER_SHEET ? t = (r = n.getActiveSheet()) == null ? void 0 : r.getSheetId() : (n.type === Re.UNIVER_DOC || n.type === Re.UNIVER_SLIDE) && (t = e), { unitId: e, subUnitId: t };
|
|
43
44
|
}
|
|
44
|
-
var
|
|
45
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
45
|
+
var Kt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, Yt = (a, n, e, t) => {
|
|
46
|
+
for (var r = t > 1 ? void 0 : t ? Zt(n, e) : n, o = a.length - 1, i; o >= 0; o--)
|
|
46
47
|
(i = a[o]) && (r = (t ? i(n, e, r) : i(r)) || r);
|
|
47
|
-
return t && r &&
|
|
48
|
-
},
|
|
48
|
+
return t && r && Kt(n, e, r), r;
|
|
49
|
+
}, Qe = (a, n) => (e, t) => n(e, t, a);
|
|
49
50
|
let Be = class {
|
|
50
51
|
constructor(a, n) {
|
|
51
52
|
this._drawingManagerService = a, this._imageIoService = n;
|
|
52
53
|
}
|
|
53
54
|
async renderImage(a, n) {
|
|
54
|
-
const { transform: e, drawingType: t, source: r, imageSourceType: o, srcRect: i, prstGeom: s, groupId:
|
|
55
|
-
if (t !==
|
|
55
|
+
const { transform: e, drawingType: t, source: r, imageSourceType: o, srcRect: i, prstGeom: s, groupId: l, unitId: g, subUnitId: u, drawingId: d } = a;
|
|
56
|
+
if (t !== te.DRAWING_IMAGE || !this._drawingManagerService.getDrawingVisible() || e == null)
|
|
56
57
|
return;
|
|
57
|
-
const { left: h, top: f, width: v, height: w, angle: p, flipX:
|
|
58
|
+
const { left: h, top: f, width: v, height: w, angle: p, flipX: E, flipY: _, skewX: M, skewY: S } = e, R = G({ unitId: g, subUnitId: u, drawingId: d }), b = n.getObject(R);
|
|
58
59
|
if (b != null) {
|
|
59
|
-
b.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX:
|
|
60
|
+
b.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX: E, flipY: _, skewX: M, skewY: S });
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
65
|
-
|
|
63
|
+
const y = this._drawingManagerService.getDrawingOrder(g, u), I = y.indexOf(d), P = { ...e, zIndex: I === -1 ? y.length - 1 : I }, N = this._imageIoService.getImageSourceCache(r, o);
|
|
64
|
+
let B = !1;
|
|
65
|
+
if (N != null)
|
|
66
|
+
P.image = N;
|
|
66
67
|
else {
|
|
67
68
|
if (o === Nt.UUID)
|
|
68
69
|
try {
|
|
69
|
-
|
|
70
|
-
} catch (
|
|
71
|
-
console.error(
|
|
70
|
+
P.url = await this._imageIoService.getImage(r);
|
|
71
|
+
} catch (W) {
|
|
72
|
+
console.error(W);
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
75
|
else
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
P.url = r;
|
|
77
|
+
B = !0;
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
-
const D = new We(
|
|
80
|
-
if (
|
|
79
|
+
P.printable = !0;
|
|
80
|
+
const D = new We(R, P);
|
|
81
|
+
if (B && this._imageIoService.addImageSourceCache(r, o, D.getNative()), !this._drawingManagerService.getDrawingVisible())
|
|
81
82
|
return;
|
|
82
|
-
const
|
|
83
|
-
return this._drawingManagerService.getDrawingEditable() &&
|
|
83
|
+
const le = n.addObject(D, ze);
|
|
84
|
+
return this._drawingManagerService.getDrawingEditable() && le.attachTransformerTo(D), l && Ft({ drawingId: l, unitId: g, subUnitId: u }, D, n, this._drawingManagerService), s != null && D.setPrstGeom(s), i != null && D.setSrcRect(i), D;
|
|
84
85
|
}
|
|
85
86
|
renderDrawing(a, n) {
|
|
86
87
|
const e = this._drawingManagerService.getDrawingByParam(a);
|
|
87
88
|
if (e != null)
|
|
88
89
|
switch (e.drawingType) {
|
|
89
|
-
case
|
|
90
|
+
case te.DRAWING_IMAGE:
|
|
90
91
|
return this.renderImage(e, n);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
};
|
|
94
|
-
Be =
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
Be = Yt([
|
|
96
|
+
Qe(0, ne),
|
|
97
|
+
Qe(1, rt)
|
|
97
98
|
], Be);
|
|
98
|
-
function
|
|
99
|
+
function Ae(a, n) {
|
|
99
100
|
const e = [];
|
|
100
101
|
return a.forEach((t) => {
|
|
101
|
-
const { oKey: r, left: o, top: i, height: s, width:
|
|
102
|
+
const { oKey: r, left: o, top: i, height: s, width: l, angle: g } = t, u = n.getDrawingOKey(r);
|
|
102
103
|
if (u == null)
|
|
103
104
|
return e.push(null), !0;
|
|
104
105
|
const { unitId: d, subUnitId: h, drawingId: f, drawingType: v } = u, w = {
|
|
@@ -110,58 +111,39 @@ function we(a, n) {
|
|
|
110
111
|
left: o,
|
|
111
112
|
top: i,
|
|
112
113
|
height: s,
|
|
113
|
-
width:
|
|
114
|
+
width: l,
|
|
114
115
|
angle: g
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
|
-
v ===
|
|
118
|
+
v === te.DRAWING_IMAGE && (w.srcRect = t.srcRect), e.push(w);
|
|
118
119
|
}), e;
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
type: ve.OPERATION,
|
|
123
|
-
handler: (a, n) => !0
|
|
124
|
-
}, ke = {
|
|
125
|
-
id: "sheet.operation.open-image-crop",
|
|
126
|
-
type: ve.OPERATION,
|
|
127
|
-
handler: (a, n) => !0
|
|
128
|
-
}, ge = {
|
|
129
|
-
id: "sheet.operation.close-image-crop",
|
|
130
|
-
type: ve.OPERATION,
|
|
131
|
-
handler: (a, n) => !0
|
|
132
|
-
};
|
|
133
|
-
var H = /* @__PURE__ */ ((a) => (a.FREE = "0", a.R1_1 = "1", a.R16_9 = "2", a.R9_16 = "3", a.R5_4 = "4", a.R4_5 = "5", a.R4_3 = "6", a.R3_4 = "7", a.R3_2 = "8", a.R2_3 = "9", a))(H || {});
|
|
134
|
-
const je = {
|
|
135
|
-
id: "sheet.operation.Auto-image-crop",
|
|
136
|
-
type: ve.OPERATION,
|
|
137
|
-
handler: (a, n) => !0
|
|
138
|
-
};
|
|
139
|
-
var z = function() {
|
|
140
|
-
return z = Object.assign || function(a) {
|
|
121
|
+
var $ = function() {
|
|
122
|
+
return $ = Object.assign || function(a) {
|
|
141
123
|
for (var n, e = 1, t = arguments.length; e < t; e++) {
|
|
142
124
|
n = arguments[e];
|
|
143
125
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (a[r] = n[r]);
|
|
144
126
|
}
|
|
145
127
|
return a;
|
|
146
|
-
},
|
|
147
|
-
},
|
|
128
|
+
}, $.apply(this, arguments);
|
|
129
|
+
}, Xt = function(a, n) {
|
|
148
130
|
var e = {};
|
|
149
131
|
for (var t in a) Object.prototype.hasOwnProperty.call(a, t) && n.indexOf(t) < 0 && (e[t] = a[t]);
|
|
150
132
|
if (a != null && typeof Object.getOwnPropertySymbols == "function")
|
|
151
133
|
for (var r = 0, t = Object.getOwnPropertySymbols(a); r < t.length; r++)
|
|
152
134
|
n.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(a, t[r]) && (e[t[r]] = a[t[r]]);
|
|
153
135
|
return e;
|
|
154
|
-
},
|
|
155
|
-
var e = a.icon, t = a.id, r = a.className, o = a.extend, i =
|
|
156
|
-
return ct(e, "".concat(t), { defIds: e.defIds, idSuffix:
|
|
136
|
+
}, J = Y(function(a, n) {
|
|
137
|
+
var e = a.icon, t = a.id, r = a.className, o = a.extend, i = Xt(a, ["icon", "id", "className", "extend"]), s = "univerjs-icon univerjs-icon-".concat(t, " ").concat(r || "").trim(), l = it("_".concat(Qt()));
|
|
138
|
+
return ct(e, "".concat(t), { defIds: e.defIds, idSuffix: l.current }, $({ ref: n, className: s }, i), o);
|
|
157
139
|
});
|
|
158
140
|
function ct(a, n, e, t, r) {
|
|
159
|
-
return
|
|
141
|
+
return X(a.tag, $($({ key: n }, Jt(a, e, r)), t), (qt(a, e).children || []).map(function(o, i) {
|
|
160
142
|
return ct(o, "".concat(n, "-").concat(a.tag, "-").concat(i), e, void 0, r);
|
|
161
143
|
}));
|
|
162
144
|
}
|
|
163
|
-
function
|
|
164
|
-
var t =
|
|
145
|
+
function Jt(a, n, e) {
|
|
146
|
+
var t = $({}, a.attrs);
|
|
165
147
|
e != null && e.colorChannel1 && t.fill === "colorChannel1" && (t.fill = e.colorChannel1);
|
|
166
148
|
var r = n.defIds;
|
|
167
149
|
return !r || r.length === 0 || (a.tag === "use" && t["xlink:href"] && (t["xlink:href"] = t["xlink:href"] + n.idSuffix), Object.entries(t).forEach(function(o) {
|
|
@@ -169,104 +151,104 @@ function Yt(a, n, e) {
|
|
|
169
151
|
typeof s == "string" && (t[i] = s.replace(/url\(#(.*)\)/, "url(#$1".concat(n.idSuffix, ")")));
|
|
170
152
|
})), t;
|
|
171
153
|
}
|
|
172
|
-
function
|
|
154
|
+
function qt(a, n) {
|
|
173
155
|
var e, t = n.defIds;
|
|
174
|
-
return !t || t.length === 0 ? a : a.tag === "defs" && (!((e = a.children) === null || e === void 0) && e.length) ?
|
|
175
|
-
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ?
|
|
156
|
+
return !t || t.length === 0 ? a : a.tag === "defs" && (!((e = a.children) === null || e === void 0) && e.length) ? $($({}, a), { children: a.children.map(function(r) {
|
|
157
|
+
return typeof r.attrs.id == "string" && t && t.indexOf(r.attrs.id) > -1 ? $($({}, r), { attrs: $($({}, r.attrs), { id: r.attrs.id + n.idSuffix }) }) : r;
|
|
176
158
|
}) }) : a;
|
|
177
159
|
}
|
|
178
|
-
function
|
|
160
|
+
function Qt() {
|
|
179
161
|
return Math.random().toString(36).substring(2, 8);
|
|
180
162
|
}
|
|
181
|
-
|
|
182
|
-
var
|
|
183
|
-
return
|
|
163
|
+
J.displayName = "UniverIcon";
|
|
164
|
+
var en = { 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" } }] }, lt = Y(function(a, n) {
|
|
165
|
+
return X(J, Object.assign({}, a, {
|
|
184
166
|
id: "autofill",
|
|
185
167
|
ref: n,
|
|
186
|
-
icon:
|
|
168
|
+
icon: en
|
|
187
169
|
}));
|
|
188
170
|
});
|
|
189
|
-
|
|
190
|
-
var
|
|
191
|
-
return
|
|
171
|
+
lt.displayName = "Autofill";
|
|
172
|
+
var tn = { 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 = Y(function(a, n) {
|
|
173
|
+
return X(J, Object.assign({}, a, {
|
|
192
174
|
id: "bottom-single",
|
|
193
175
|
ref: n,
|
|
194
|
-
icon:
|
|
176
|
+
icon: tn
|
|
195
177
|
}));
|
|
196
178
|
});
|
|
197
|
-
|
|
198
|
-
var
|
|
199
|
-
return
|
|
179
|
+
mt.displayName = "BottomSingle";
|
|
180
|
+
var nn = { 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" } }] }, gt = Y(function(a, n) {
|
|
181
|
+
return X(J, Object.assign({}, a, {
|
|
200
182
|
id: "create-copy-single",
|
|
201
183
|
ref: n,
|
|
202
|
-
icon:
|
|
184
|
+
icon: nn
|
|
203
185
|
}));
|
|
204
186
|
});
|
|
205
|
-
|
|
206
|
-
var
|
|
207
|
-
return
|
|
187
|
+
gt.displayName = "CreateCopySingle";
|
|
188
|
+
var rn = { 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" } }] }, ut = Y(function(a, n) {
|
|
189
|
+
return X(J, Object.assign({}, a, {
|
|
208
190
|
id: "group-single",
|
|
209
191
|
ref: n,
|
|
210
|
-
icon:
|
|
192
|
+
icon: rn
|
|
211
193
|
}));
|
|
212
194
|
});
|
|
213
|
-
|
|
214
|
-
var
|
|
215
|
-
return
|
|
195
|
+
ut.displayName = "GroupSingle";
|
|
196
|
+
var an = { 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" } }] }, dt = Y(function(a, n) {
|
|
197
|
+
return X(J, Object.assign({}, a, {
|
|
216
198
|
id: "more-down-single",
|
|
217
199
|
ref: n,
|
|
218
|
-
icon:
|
|
200
|
+
icon: an
|
|
219
201
|
}));
|
|
220
202
|
});
|
|
221
|
-
|
|
222
|
-
var
|
|
223
|
-
return
|
|
203
|
+
dt.displayName = "MoreDownSingle";
|
|
204
|
+
var on = { 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" } }] }, ht = Y(function(a, n) {
|
|
205
|
+
return X(J, Object.assign({}, a, {
|
|
224
206
|
id: "move-down-single",
|
|
225
207
|
ref: n,
|
|
226
|
-
icon:
|
|
208
|
+
icon: on
|
|
227
209
|
}));
|
|
228
210
|
});
|
|
229
|
-
|
|
230
|
-
var
|
|
231
|
-
return
|
|
211
|
+
ht.displayName = "MoveDownSingle";
|
|
212
|
+
var sn = { 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" } }] }, ft = Y(function(a, n) {
|
|
213
|
+
return X(J, Object.assign({}, a, {
|
|
232
214
|
id: "move-up-single",
|
|
233
215
|
ref: n,
|
|
234
|
-
icon:
|
|
216
|
+
icon: sn
|
|
235
217
|
}));
|
|
236
218
|
});
|
|
237
|
-
|
|
238
|
-
var
|
|
239
|
-
return
|
|
219
|
+
ft.displayName = "MoveUpSingle";
|
|
220
|
+
var cn = { 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" } }] }, pt = Y(function(a, n) {
|
|
221
|
+
return X(J, Object.assign({}, a, {
|
|
240
222
|
id: "topmost-single",
|
|
241
223
|
ref: n,
|
|
242
|
-
icon:
|
|
224
|
+
icon: cn
|
|
243
225
|
}));
|
|
244
226
|
});
|
|
245
|
-
|
|
246
|
-
var
|
|
247
|
-
return
|
|
227
|
+
pt.displayName = "TopmostSingle";
|
|
228
|
+
var ln = { 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" } }] }, Ct = Y(function(a, n) {
|
|
229
|
+
return X(J, Object.assign({}, a, {
|
|
248
230
|
id: "ungroup-single",
|
|
249
231
|
ref: n,
|
|
250
|
-
icon:
|
|
232
|
+
icon: ln
|
|
251
233
|
}));
|
|
252
234
|
});
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
imageCommonPanel:
|
|
256
|
-
imageCommonPanelGrid:
|
|
257
|
-
imageCommonPanelBorder:
|
|
258
|
-
imageCommonPanelTitle:
|
|
259
|
-
imageCommonPanelRow:
|
|
260
|
-
imageCommonPanelRowVertical:
|
|
261
|
-
imageCommonPanelColumn:
|
|
262
|
-
imageCommonPanelColumnCenter:
|
|
263
|
-
imageCommonPanelInline:
|
|
264
|
-
imageCommonPanelSpan2:
|
|
265
|
-
imageCommonPanelSpan3:
|
|
266
|
-
imageCommonPanelInput:
|
|
267
|
-
},
|
|
268
|
-
const { arrangeShow: n, drawings: e } = a, t =
|
|
269
|
-
|
|
235
|
+
Ct.displayName = "UngroupSingle";
|
|
236
|
+
const mn = "univer-image-common-panel", gn = "univer-image-common-panel-grid", un = "univer-image-common-panel-border", dn = "univer-image-common-panel-title", hn = "univer-image-common-panel-row", fn = "univer-image-common-panel-row-vertical", pn = "univer-image-common-panel-column", Cn = "univer-image-common-panel-column-center", wn = "univer-image-common-panel-inline", vn = "univer-image-common-panel-span2", _n = "univer-image-common-panel-span3", Sn = "univer-image-common-panel-input", m = {
|
|
237
|
+
imageCommonPanel: mn,
|
|
238
|
+
imageCommonPanelGrid: gn,
|
|
239
|
+
imageCommonPanelBorder: un,
|
|
240
|
+
imageCommonPanelTitle: dn,
|
|
241
|
+
imageCommonPanelRow: hn,
|
|
242
|
+
imageCommonPanelRowVertical: fn,
|
|
243
|
+
imageCommonPanelColumn: pn,
|
|
244
|
+
imageCommonPanelColumnCenter: Cn,
|
|
245
|
+
imageCommonPanelInline: wn,
|
|
246
|
+
imageCommonPanelSpan2: vn,
|
|
247
|
+
imageCommonPanelSpan3: _n,
|
|
248
|
+
imageCommonPanelInput: Sn
|
|
249
|
+
}, bn = (a) => {
|
|
250
|
+
const { arrangeShow: n, drawings: e } = a, t = x(Z), r = x(ne), o = (g) => g ? "block" : "none", [i, s] = L(e);
|
|
251
|
+
ve(() => {
|
|
270
252
|
const g = r.focus$.subscribe((u) => {
|
|
271
253
|
s(u);
|
|
272
254
|
});
|
|
@@ -274,176 +256,180 @@ const ln = "univer-image-common-panel", cn = "univer-image-common-panel-grid", m
|
|
|
274
256
|
g.unsubscribe();
|
|
275
257
|
};
|
|
276
258
|
}, []);
|
|
277
|
-
const
|
|
259
|
+
const l = (g) => {
|
|
278
260
|
const u = i[0].unitId, d = i[0].subUnitId, h = i.map((f) => f.drawingId);
|
|
279
261
|
r.featurePluginOrderUpdateNotification({ unitId: u, subUnitId: d, drawingIds: h, arrangeType: g });
|
|
280
262
|
};
|
|
281
|
-
return /* @__PURE__ */
|
|
282
|
-
|
|
283
|
-
} }, /* @__PURE__ */
|
|
284
|
-
|
|
285
|
-
} }, /* @__PURE__ */
|
|
286
|
-
|
|
287
|
-
} }, /* @__PURE__ */
|
|
288
|
-
|
|
289
|
-
} }, /* @__PURE__ */
|
|
290
|
-
},
|
|
291
|
-
var
|
|
292
|
-
const n =
|
|
263
|
+
return /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelGrid, style: { display: o(n) } }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle) }, /* @__PURE__ */ c.createElement("div", null, t.t("image-panel.arrange.title")))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2) }, /* @__PURE__ */ c.createElement(ie, { size: "small", onClick: () => {
|
|
264
|
+
l(Se.forward);
|
|
265
|
+
} }, /* @__PURE__ */ c.createElement("span", { className: m.imageCommonPanelInline }, /* @__PURE__ */ c.createElement(ft, null), t.t("image-panel.arrange.forward")))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2) }, /* @__PURE__ */ c.createElement(ie, { size: "small", onClick: () => {
|
|
266
|
+
l(Se.backward);
|
|
267
|
+
} }, /* @__PURE__ */ c.createElement("span", { className: m.imageCommonPanelInline }, /* @__PURE__ */ c.createElement(ht, null), t.t("image-panel.arrange.backward"))))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2) }, /* @__PURE__ */ c.createElement(ie, { size: "small", onClick: () => {
|
|
268
|
+
l(Se.front);
|
|
269
|
+
} }, /* @__PURE__ */ c.createElement("span", { className: m.imageCommonPanelInline }, /* @__PURE__ */ c.createElement(pt, null), t.t("image-panel.arrange.front")))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2) }, /* @__PURE__ */ c.createElement(ie, { size: "small", onClick: () => {
|
|
270
|
+
l(Se.back);
|
|
271
|
+
} }, /* @__PURE__ */ c.createElement("span", { className: m.imageCommonPanelInline }, /* @__PURE__ */ c.createElement(mt, null), t.t("image-panel.arrange.back"))))));
|
|
272
|
+
}, re = 20, In = 20, Pn = [-3600, 3600], Pe = 300, yn = (a) => {
|
|
273
|
+
var Ye;
|
|
274
|
+
const n = x(Z), e = x(ne), t = x(ge), { drawings: r, transformShow: o } = a, i = r[0];
|
|
293
275
|
if (i == null)
|
|
294
276
|
return;
|
|
295
277
|
const s = i.transform;
|
|
296
278
|
if (s == null)
|
|
297
279
|
return;
|
|
298
|
-
const { unitId:
|
|
280
|
+
const { unitId: l, subUnitId: g, drawingId: u, drawingType: d } = i, h = t.getRenderById(l), f = h == null ? void 0 : h.scene;
|
|
299
281
|
if (f == null)
|
|
300
282
|
return;
|
|
301
|
-
const v = (
|
|
283
|
+
const v = (Ye = f.getEngine()) == null ? void 0 : Ye.activeScene;
|
|
302
284
|
if (v == null)
|
|
303
285
|
return;
|
|
304
286
|
const w = f.getTransformerByCreate(), {
|
|
305
287
|
width: p = 0,
|
|
306
|
-
height:
|
|
288
|
+
height: E = 0,
|
|
307
289
|
left: _ = 0,
|
|
308
|
-
top:
|
|
290
|
+
top: M = 0,
|
|
309
291
|
angle: S = 0
|
|
310
|
-
} = s, [
|
|
311
|
-
const { width:
|
|
312
|
-
let
|
|
313
|
-
return C +
|
|
314
|
-
limitLeft:
|
|
315
|
-
limitTop:
|
|
316
|
-
limitWidth:
|
|
317
|
-
limitHeight:
|
|
292
|
+
} = s, [R, b] = L(p), [y, I] = L(E), [P, N] = L(_), [B, D] = L(M), [le, W] = L(S), [Ve, _t] = L(w.keepRatio), _e = (C, A, V, H) => {
|
|
293
|
+
const { width: U, height: q } = v, { ancestorLeft: k, ancestorTop: z } = f;
|
|
294
|
+
let F = C, K = A, ee = V, ue = H;
|
|
295
|
+
return C + k < 0 && (F = -k), A + z < 0 && (K = -z), ee = U - F - k, ee < re && (ee = re), ue = q - K - z, ue < re && (ue = re), C + ee + k > U && (F = U - V - k), A + ue + z > q && (K = q - H - z), {
|
|
296
|
+
limitLeft: F,
|
|
297
|
+
limitTop: K,
|
|
298
|
+
limitWidth: ee,
|
|
299
|
+
limitHeight: ue
|
|
318
300
|
};
|
|
319
|
-
},
|
|
320
|
-
const { objects:
|
|
321
|
-
if (
|
|
301
|
+
}, Ze = (C) => {
|
|
302
|
+
const { objects: A } = C, V = Ae(A, e);
|
|
303
|
+
if (V.length !== 1)
|
|
322
304
|
return;
|
|
323
|
-
const
|
|
324
|
-
if (
|
|
305
|
+
const H = V[0];
|
|
306
|
+
if (H == null)
|
|
325
307
|
return;
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
308
|
+
const U = H.transform;
|
|
309
|
+
if (U == null)
|
|
328
310
|
return;
|
|
329
311
|
const {
|
|
330
|
-
width:
|
|
331
|
-
height:
|
|
332
|
-
left:
|
|
333
|
-
top:
|
|
334
|
-
angle:
|
|
335
|
-
} =
|
|
336
|
-
|
|
312
|
+
width: q,
|
|
313
|
+
height: k,
|
|
314
|
+
left: z,
|
|
315
|
+
top: F,
|
|
316
|
+
angle: K
|
|
317
|
+
} = U;
|
|
318
|
+
q != null && b(q), k != null && I(k), z != null && N(z), F != null && D(F), K != null && W(K);
|
|
337
319
|
};
|
|
338
|
-
|
|
339
|
-
const C = w.
|
|
340
|
-
|
|
341
|
-
}),
|
|
342
|
-
|
|
343
|
-
}),
|
|
344
|
-
if (
|
|
320
|
+
ve(() => {
|
|
321
|
+
const C = w.changeStart$.subscribe((H) => {
|
|
322
|
+
Ze(H);
|
|
323
|
+
}), A = w.changing$.subscribe((H) => {
|
|
324
|
+
Ze(H);
|
|
325
|
+
}), V = e.focus$.subscribe((H) => {
|
|
326
|
+
if (H.length !== 1)
|
|
345
327
|
return;
|
|
346
|
-
const
|
|
347
|
-
if (
|
|
328
|
+
const U = e.getDrawingByParam(H[0]);
|
|
329
|
+
if (U == null)
|
|
348
330
|
return;
|
|
349
|
-
const
|
|
350
|
-
if (
|
|
331
|
+
const q = U.transform;
|
|
332
|
+
if (q == null)
|
|
351
333
|
return;
|
|
352
334
|
const {
|
|
353
|
-
width:
|
|
354
|
-
height:
|
|
355
|
-
left:
|
|
356
|
-
top:
|
|
357
|
-
angle:
|
|
358
|
-
} =
|
|
359
|
-
|
|
335
|
+
width: k,
|
|
336
|
+
height: z,
|
|
337
|
+
left: F,
|
|
338
|
+
top: K,
|
|
339
|
+
angle: ee
|
|
340
|
+
} = q;
|
|
341
|
+
k != null && b(k), z != null && I(z), F != null && N(F), K != null && D(K), ee != null && W(ee);
|
|
360
342
|
});
|
|
361
343
|
return () => {
|
|
362
|
-
|
|
344
|
+
A.unsubscribe(), C.unsubscribe(), V.unsubscribe();
|
|
363
345
|
};
|
|
364
346
|
}, []);
|
|
365
|
-
const St =
|
|
347
|
+
const St = Ie((C) => {
|
|
366
348
|
if (C == null)
|
|
367
349
|
return;
|
|
368
|
-
C = Math.max(C,
|
|
369
|
-
const { limitWidth:
|
|
370
|
-
C =
|
|
371
|
-
const
|
|
372
|
-
if (
|
|
373
|
-
let
|
|
374
|
-
|
|
350
|
+
C = Math.max(C, re);
|
|
351
|
+
const { limitWidth: A, limitHeight: V } = _e(P, B, C, y);
|
|
352
|
+
C = Math.min(C, A);
|
|
353
|
+
const H = { unitId: l, subUnitId: g, drawingId: u, drawingType: d, transform: { width: C } };
|
|
354
|
+
if (Ve) {
|
|
355
|
+
let U = C / R * y;
|
|
356
|
+
if (U = Math.max(U, In), U > V)
|
|
357
|
+
return;
|
|
358
|
+
I(U), H.transform.height = U;
|
|
375
359
|
}
|
|
376
|
-
b(C), e.featurePluginUpdateNotification([
|
|
377
|
-
},
|
|
360
|
+
b(C), e.featurePluginUpdateNotification([H]), w.refreshControls().changeNotification();
|
|
361
|
+
}, Pe), bt = Ie((C) => {
|
|
378
362
|
if (C == null)
|
|
379
363
|
return;
|
|
380
|
-
C = Math.max(C,
|
|
381
|
-
const { limitHeight:
|
|
382
|
-
C =
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
let
|
|
386
|
-
|
|
364
|
+
C = Math.max(C, re);
|
|
365
|
+
const { limitHeight: A, limitWidth: V } = _e(P, B, R, C);
|
|
366
|
+
C = Math.min(C, A);
|
|
367
|
+
const H = { unitId: l, subUnitId: g, drawingId: u, drawingType: d, transform: { height: C } };
|
|
368
|
+
if (Ve) {
|
|
369
|
+
let U = C / y * R;
|
|
370
|
+
if (U = Math.max(U, re), U > V)
|
|
371
|
+
return;
|
|
372
|
+
b(U), H.transform.width = U;
|
|
387
373
|
}
|
|
388
|
-
|
|
389
|
-
},
|
|
374
|
+
I(C), e.featurePluginUpdateNotification([H]), w.refreshControls().changeNotification();
|
|
375
|
+
}, Pe), It = Ie((C) => {
|
|
390
376
|
if (C == null)
|
|
391
377
|
return;
|
|
392
|
-
const { limitLeft:
|
|
393
|
-
C =
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
},
|
|
378
|
+
const { limitLeft: A } = _e(C, B, R, y);
|
|
379
|
+
C = A;
|
|
380
|
+
const V = { unitId: l, subUnitId: g, drawingId: u, drawingType: d, transform: { left: C } };
|
|
381
|
+
N(C), e.featurePluginUpdateNotification([V]), w.refreshControls().changeNotification();
|
|
382
|
+
}, Pe), Pt = Ie((C) => {
|
|
397
383
|
if (C == null)
|
|
398
384
|
return;
|
|
399
|
-
const { limitTop:
|
|
400
|
-
C =
|
|
401
|
-
const
|
|
402
|
-
D(C), e.featurePluginUpdateNotification([
|
|
403
|
-
},
|
|
385
|
+
const { limitTop: A } = _e(P, C, R, y);
|
|
386
|
+
C = A;
|
|
387
|
+
const V = { unitId: l, subUnitId: g, drawingId: u, drawingType: d, transform: { top: C } };
|
|
388
|
+
D(C), e.featurePluginUpdateNotification([V]), w.refreshControls().changeNotification();
|
|
389
|
+
}, Pe), yt = (C) => {
|
|
404
390
|
if (C == null)
|
|
405
391
|
return;
|
|
406
|
-
const [
|
|
407
|
-
C <
|
|
408
|
-
const
|
|
409
|
-
|
|
392
|
+
const [A, V] = Pn;
|
|
393
|
+
C < A && (C = A), C > V && (C = V);
|
|
394
|
+
const H = { unitId: l, subUnitId: g, drawingId: u, drawingType: d, transform: { angle: C } };
|
|
395
|
+
W(C), e.featurePluginUpdateNotification([H]), w.refreshControls().changeNotification();
|
|
410
396
|
}, Et = (C) => {
|
|
411
397
|
_t(C), w.keepRatio = C;
|
|
412
398
|
}, Rt = (C) => C ? "block" : "none";
|
|
413
|
-
return /* @__PURE__ */
|
|
399
|
+
return /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: Rt(o) } }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle) }, /* @__PURE__ */ c.createElement("div", null, n.t("image-panel.transform.title")))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3) }, /* @__PURE__ */ c.createElement("label", null, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, n.t("image-panel.transform.width"))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, /* @__PURE__ */ c.createElement(de, { precision: 1, value: R, onChange: (C) => {
|
|
414
400
|
St(C);
|
|
415
|
-
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */
|
|
401
|
+
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3) }, /* @__PURE__ */ c.createElement("label", null, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, n.t("image-panel.transform.height"))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, /* @__PURE__ */ c.createElement(de, { precision: 1, value: y, onChange: (C) => {
|
|
416
402
|
bt(C);
|
|
417
|
-
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */
|
|
403
|
+
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3) }, /* @__PURE__ */ c.createElement("label", null, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, n.t("image-panel.transform.lock"))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelRow, m.imageCommonPanelRowVertical) }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, /* @__PURE__ */ c.createElement(At, { checked: Ve, onChange: Et })))))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3) }, /* @__PURE__ */ c.createElement("label", null, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, n.t("image-panel.transform.x"))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, /* @__PURE__ */ c.createElement(de, { precision: 1, value: P, onChange: (C) => {
|
|
418
404
|
It(C);
|
|
419
|
-
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */
|
|
405
|
+
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3) }, /* @__PURE__ */ c.createElement("label", null, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, n.t("image-panel.transform.y"))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, /* @__PURE__ */ c.createElement(de, { precision: 1, value: B, onChange: (C) => {
|
|
420
406
|
Pt(C);
|
|
421
|
-
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */
|
|
407
|
+
}, className: m.imageCommonPanelInput }))))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan3) }, /* @__PURE__ */ c.createElement("label", null, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, n.t("image-panel.transform.rotate"))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelColumn }, /* @__PURE__ */ c.createElement(de, { precision: 1, value: le, onChange: yt, className: m.imageCommonPanelInput })))))));
|
|
422
408
|
};
|
|
423
|
-
var
|
|
424
|
-
const
|
|
409
|
+
var O = /* @__PURE__ */ ((a) => (a.default = "0", a.left = "1", a.center = "2", a.right = "3", a.top = "4", a.middle = "5", a.bottom = "6", a.horizon = "7", a.vertical = "8", a))(O || {});
|
|
410
|
+
const Ke = {
|
|
425
411
|
id: "sheet.operation.set-image-align",
|
|
426
|
-
type:
|
|
412
|
+
type: we.OPERATION,
|
|
427
413
|
handler: (a, n) => !0
|
|
428
|
-
},
|
|
429
|
-
const n =
|
|
414
|
+
}, En = (a) => {
|
|
415
|
+
const n = x(ce), e = x(Z), { alignShow: t } = a, [r, o] = L(O.default), i = [
|
|
430
416
|
{
|
|
431
417
|
label: e.t("image-panel.align.default"),
|
|
432
|
-
value:
|
|
418
|
+
value: O.default
|
|
433
419
|
},
|
|
434
420
|
{
|
|
435
421
|
options: [
|
|
436
422
|
{
|
|
437
423
|
label: e.t("image-panel.align.left"),
|
|
438
|
-
value:
|
|
424
|
+
value: O.left
|
|
439
425
|
},
|
|
440
426
|
{
|
|
441
427
|
label: e.t("image-panel.align.center"),
|
|
442
|
-
value:
|
|
428
|
+
value: O.center
|
|
443
429
|
},
|
|
444
430
|
{
|
|
445
431
|
label: e.t("image-panel.align.right"),
|
|
446
|
-
value:
|
|
432
|
+
value: O.right
|
|
447
433
|
}
|
|
448
434
|
]
|
|
449
435
|
},
|
|
@@ -451,15 +437,15 @@ const Fe = {
|
|
|
451
437
|
options: [
|
|
452
438
|
{
|
|
453
439
|
label: e.t("image-panel.align.top"),
|
|
454
|
-
value:
|
|
440
|
+
value: O.top
|
|
455
441
|
},
|
|
456
442
|
{
|
|
457
443
|
label: e.t("image-panel.align.middle"),
|
|
458
|
-
value:
|
|
444
|
+
value: O.middle
|
|
459
445
|
},
|
|
460
446
|
{
|
|
461
447
|
label: e.t("image-panel.align.bottom"),
|
|
462
|
-
value:
|
|
448
|
+
value: O.bottom
|
|
463
449
|
}
|
|
464
450
|
]
|
|
465
451
|
},
|
|
@@ -467,73 +453,87 @@ const Fe = {
|
|
|
467
453
|
options: [
|
|
468
454
|
{
|
|
469
455
|
label: e.t("image-panel.align.horizon"),
|
|
470
|
-
value:
|
|
456
|
+
value: O.horizon
|
|
471
457
|
},
|
|
472
458
|
{
|
|
473
459
|
label: e.t("image-panel.align.vertical"),
|
|
474
|
-
value:
|
|
460
|
+
value: O.vertical
|
|
475
461
|
}
|
|
476
462
|
]
|
|
477
463
|
}
|
|
478
464
|
];
|
|
479
465
|
function s(g) {
|
|
480
|
-
o(g), n.executeCommand(
|
|
466
|
+
o(g), n.executeCommand(Ke.id, {
|
|
481
467
|
alignType: g
|
|
482
468
|
});
|
|
483
469
|
}
|
|
484
|
-
const
|
|
485
|
-
return /* @__PURE__ */
|
|
486
|
-
},
|
|
487
|
-
|
|
470
|
+
const l = (g) => g ? "block" : "none";
|
|
471
|
+
return /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: l(t) } }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle) }, /* @__PURE__ */ c.createElement("div", null, e.t("image-panel.align.title")))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn) }, /* @__PURE__ */ c.createElement(ot, { value: r, options: i, onChange: s }))));
|
|
472
|
+
}, ke = {
|
|
473
|
+
id: "sheet.operation.open-image-crop",
|
|
474
|
+
type: we.OPERATION,
|
|
475
|
+
handler: (a, n) => !0
|
|
476
|
+
}, oe = {
|
|
477
|
+
id: "sheet.operation.close-image-crop",
|
|
478
|
+
type: we.OPERATION,
|
|
479
|
+
handler: (a, n) => !0
|
|
480
|
+
};
|
|
481
|
+
var j = /* @__PURE__ */ ((a) => (a.FREE = "0", a.R1_1 = "1", a.R16_9 = "2", a.R9_16 = "3", a.R5_4 = "4", a.R4_5 = "5", a.R4_3 = "6", a.R3_4 = "7", a.R3_2 = "8", a.R2_3 = "9", a))(j || {});
|
|
482
|
+
const je = {
|
|
483
|
+
id: "sheet.operation.Auto-image-crop",
|
|
484
|
+
type: we.OPERATION,
|
|
485
|
+
handler: (a, n) => !0
|
|
486
|
+
}, Rn = (a) => {
|
|
487
|
+
const n = x(ce), e = x(Z), { drawings: t, cropperShow: r } = a;
|
|
488
488
|
if (t[0] == null)
|
|
489
489
|
return;
|
|
490
|
-
const [i, s] =
|
|
490
|
+
const [i, s] = L(j.FREE), l = it(!1), g = [
|
|
491
491
|
{
|
|
492
492
|
label: e.t("image-panel.crop.mode"),
|
|
493
|
-
value:
|
|
493
|
+
value: j.FREE
|
|
494
494
|
},
|
|
495
495
|
{
|
|
496
496
|
label: "1:1",
|
|
497
|
-
value:
|
|
497
|
+
value: j.R1_1
|
|
498
498
|
},
|
|
499
499
|
{
|
|
500
500
|
label: "16:9",
|
|
501
|
-
value:
|
|
501
|
+
value: j.R16_9
|
|
502
502
|
},
|
|
503
503
|
{
|
|
504
504
|
label: "9:16",
|
|
505
|
-
value:
|
|
505
|
+
value: j.R9_16
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
508
|
label: "5:4",
|
|
509
|
-
value:
|
|
509
|
+
value: j.R5_4
|
|
510
510
|
},
|
|
511
511
|
{
|
|
512
512
|
label: "4:5",
|
|
513
|
-
value:
|
|
513
|
+
value: j.R4_5
|
|
514
514
|
},
|
|
515
515
|
{
|
|
516
516
|
label: "4:3",
|
|
517
|
-
value:
|
|
517
|
+
value: j.R4_3
|
|
518
518
|
},
|
|
519
519
|
{
|
|
520
520
|
label: "3:4",
|
|
521
|
-
value:
|
|
521
|
+
value: j.R3_4
|
|
522
522
|
},
|
|
523
523
|
{
|
|
524
524
|
label: "3:2",
|
|
525
|
-
value:
|
|
525
|
+
value: j.R3_2
|
|
526
526
|
},
|
|
527
527
|
{
|
|
528
528
|
label: "2:3",
|
|
529
|
-
value:
|
|
529
|
+
value: j.R2_3
|
|
530
530
|
}
|
|
531
531
|
];
|
|
532
|
-
|
|
532
|
+
ve(() => {
|
|
533
533
|
const f = n.onCommandExecuted((v) => {
|
|
534
|
-
if (v.id ===
|
|
534
|
+
if (v.id === oe.id) {
|
|
535
535
|
const w = v.params;
|
|
536
|
-
w != null && w.isAuto || (
|
|
536
|
+
w != null && w.isAuto || (l.current = !1);
|
|
537
537
|
}
|
|
538
538
|
});
|
|
539
539
|
return () => {
|
|
@@ -541,61 +541,61 @@ const Fe = {
|
|
|
541
541
|
};
|
|
542
542
|
}, []);
|
|
543
543
|
function u(f) {
|
|
544
|
-
s(f),
|
|
544
|
+
s(f), l.current && n.executeCommand(je.id, {
|
|
545
545
|
cropType: f
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
const d = (f) => f ? "block" : "none", h = (f) => {
|
|
549
549
|
n.executeCommand(je.id, {
|
|
550
550
|
cropType: f
|
|
551
|
-
}),
|
|
551
|
+
}), l.current = !0;
|
|
552
552
|
};
|
|
553
|
-
return /* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: d(r) } }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle) }, /* @__PURE__ */ c.createElement("div", null, e.t("image-panel.crop.title")))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelRow, m.imageCommonPanelRowVertical) }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2) }, /* @__PURE__ */ c.createElement(ie, { size: "small", onClick: () => {
|
|
554
554
|
h(i);
|
|
555
|
-
} }, /* @__PURE__ */
|
|
556
|
-
},
|
|
557
|
-
const n =
|
|
558
|
-
const p = t.getFocusDrawings(), { unitId:
|
|
559
|
-
unitId:
|
|
555
|
+
} }, /* @__PURE__ */ c.createElement("span", { className: m.imageCommonPanelInline }, /* @__PURE__ */ c.createElement(gt, null), e.t("image-panel.crop.start")))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2) }, /* @__PURE__ */ c.createElement(ot, { value: i, options: g, onChange: u }))));
|
|
556
|
+
}, Mn = (a) => {
|
|
557
|
+
const n = x(Z), e = x(ge), t = x(ne), { hasGroup: r, drawings: o } = a, [i, s] = L(!1), [l, g] = L(!0), [u, d] = L(!0), h = (p) => p ? "block" : "none", f = () => {
|
|
558
|
+
const p = t.getFocusDrawings(), { unitId: E, subUnitId: _ } = p[0], M = Ht.generateRandomId(10), S = Dt(0, 0, p.map((y) => y.transform || {})), R = {
|
|
559
|
+
unitId: E,
|
|
560
560
|
subUnitId: _,
|
|
561
|
-
drawingId:
|
|
562
|
-
drawingType:
|
|
561
|
+
drawingId: M,
|
|
562
|
+
drawingType: te.DRAWING_GROUP,
|
|
563
563
|
transform: S
|
|
564
|
-
}, b = p.map((
|
|
565
|
-
const
|
|
564
|
+
}, b = p.map((y) => {
|
|
565
|
+
const I = y.transform || { left: 0, top: 0 }, { unitId: P, subUnitId: N, drawingId: B } = y;
|
|
566
566
|
return {
|
|
567
|
-
unitId:
|
|
568
|
-
subUnitId:
|
|
569
|
-
drawingId:
|
|
567
|
+
unitId: P,
|
|
568
|
+
subUnitId: N,
|
|
569
|
+
drawingId: B,
|
|
570
570
|
transform: {
|
|
571
|
-
...
|
|
572
|
-
left:
|
|
573
|
-
top:
|
|
571
|
+
...I,
|
|
572
|
+
left: I.left - S.left,
|
|
573
|
+
top: I.top - S.top
|
|
574
574
|
},
|
|
575
|
-
groupId:
|
|
575
|
+
groupId: M
|
|
576
576
|
};
|
|
577
577
|
});
|
|
578
578
|
t.featurePluginGroupUpdateNotification([{
|
|
579
|
-
parent:
|
|
579
|
+
parent: R,
|
|
580
580
|
children: b
|
|
581
581
|
}]);
|
|
582
582
|
}, v = (p) => {
|
|
583
|
-
if (p.drawingType !==
|
|
583
|
+
if (p.drawingType !== te.DRAWING_GROUP)
|
|
584
584
|
return;
|
|
585
|
-
const { unitId:
|
|
585
|
+
const { unitId: E, subUnitId: _, drawingId: M, transform: S = { width: 0, height: 0 } } = p;
|
|
586
586
|
if (S == null)
|
|
587
587
|
return;
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
588
|
+
const R = t.getDrawingsByGroup({ unitId: E, subUnitId: _, drawingId: M });
|
|
589
|
+
if (R.length === 0)
|
|
590
590
|
return;
|
|
591
|
-
const b =
|
|
592
|
-
const { transform:
|
|
591
|
+
const b = R.map((y) => {
|
|
592
|
+
const { transform: I } = y, { unitId: P, subUnitId: N, drawingId: B } = y, D = Tt(I || {}, S, S.width || 0, S.height || 0);
|
|
593
593
|
return {
|
|
594
|
-
unitId:
|
|
595
|
-
subUnitId:
|
|
596
|
-
drawingId:
|
|
594
|
+
unitId: P,
|
|
595
|
+
subUnitId: N,
|
|
596
|
+
drawingId: B,
|
|
597
597
|
transform: {
|
|
598
|
-
...
|
|
598
|
+
...I,
|
|
599
599
|
...D
|
|
600
600
|
},
|
|
601
601
|
groupId: void 0
|
|
@@ -606,68 +606,68 @@ const Fe = {
|
|
|
606
606
|
children: b
|
|
607
607
|
};
|
|
608
608
|
}, w = () => {
|
|
609
|
-
const
|
|
609
|
+
const E = t.getFocusDrawings().map(
|
|
610
610
|
(_) => v(_)
|
|
611
611
|
).filter((_) => _ != null);
|
|
612
|
-
|
|
612
|
+
E.length !== 0 && t.featurePluginUngroupUpdateNotification(E);
|
|
613
613
|
};
|
|
614
|
-
return
|
|
614
|
+
return ve(() => {
|
|
615
615
|
const p = o[0];
|
|
616
616
|
if (p == null)
|
|
617
617
|
return;
|
|
618
|
-
const { unitId:
|
|
619
|
-
if (
|
|
618
|
+
const { unitId: E } = p, _ = e.getRenderById(E), M = _ == null ? void 0 : _.scene;
|
|
619
|
+
if (M == null)
|
|
620
620
|
return;
|
|
621
|
-
const S =
|
|
622
|
-
|
|
623
|
-
}), b = S.
|
|
624
|
-
const { objects:
|
|
625
|
-
let
|
|
626
|
-
|
|
621
|
+
const S = M.getTransformerByCreate(), R = S.clearControl$.subscribe((y) => {
|
|
622
|
+
y === !0 && s(!1);
|
|
623
|
+
}), b = S.changeStart$.subscribe((y) => {
|
|
624
|
+
const { objects: I } = y, P = Ae(I, t), N = P.filter((W) => (W == null ? void 0 : W.drawingType) === te.DRAWING_GROUP);
|
|
625
|
+
let B = !1, D = !1;
|
|
626
|
+
P.length > 1 && (B = !0), N.length > 0 && (D = !0), s(B || D), g(B), d(D);
|
|
627
627
|
});
|
|
628
628
|
return () => {
|
|
629
|
-
b
|
|
629
|
+
b.unsubscribe(), R.unsubscribe();
|
|
630
630
|
};
|
|
631
|
-
}, []), /* @__PURE__ */
|
|
631
|
+
}, []), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelGrid, m.imageCommonPanelBorder), style: { display: h(r === !0 ? i : !1) } }, /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelTitle) }, /* @__PURE__ */ c.createElement("div", null, n.t("image-panel.group.title")))), /* @__PURE__ */ c.createElement("div", { className: m.imageCommonPanelRow }, /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2, m.imageCommonPanelColumnCenter) }, /* @__PURE__ */ c.createElement(ie, { size: "small", onClick: () => {
|
|
632
632
|
f();
|
|
633
|
-
}, style: { display: h(
|
|
633
|
+
}, style: { display: h(l) } }, /* @__PURE__ */ c.createElement("span", { className: m.imageCommonPanelInline }, /* @__PURE__ */ c.createElement(ut, null), n.t("image-panel.group.group")))), /* @__PURE__ */ c.createElement("div", { className: T(m.imageCommonPanelColumn, m.imageCommonPanelSpan2, m.imageCommonPanelColumnCenter) }, /* @__PURE__ */ c.createElement(ie, { size: "small", onClick: () => {
|
|
634
634
|
w();
|
|
635
|
-
}, style: { display: h(u) } }, /* @__PURE__ */
|
|
636
|
-
},
|
|
637
|
-
const n =
|
|
635
|
+
}, style: { display: h(u) } }, /* @__PURE__ */ c.createElement("span", { className: m.imageCommonPanelInline }, /* @__PURE__ */ c.createElement(Ct, null), n.t("image-panel.group.unGroup"))))));
|
|
636
|
+
}, ur = (a) => {
|
|
637
|
+
const n = x(ne), e = x(ge), t = x(Z), { drawings: r, hasArrange: o = !0, hasTransform: i = !0, hasAlign: s = !0, hasCropper: l = !0, hasGroup: g = !0 } = a, u = r[0];
|
|
638
638
|
if (u == null)
|
|
639
639
|
return;
|
|
640
640
|
const { unitId: d } = u, h = e.getRenderById(d), f = h == null ? void 0 : h.scene;
|
|
641
641
|
if (f == null)
|
|
642
642
|
return;
|
|
643
|
-
const v = f.getTransformerByCreate(), [w, p] =
|
|
644
|
-
return
|
|
645
|
-
const
|
|
646
|
-
D === !0 && (p(!1), _(!1), S(!1), b(!1),
|
|
647
|
-
}),
|
|
648
|
-
const { objects:
|
|
649
|
-
|
|
650
|
-
}),
|
|
651
|
-
D.length === 0 ? (p(!1), _(!1), S(!1), b(!1),
|
|
643
|
+
const v = f.getTransformerByCreate(), [w, p] = L(!0), [E, _] = L(!0), [M, S] = L(!1), [R, b] = L(!0), [y, I] = L(!1);
|
|
644
|
+
return ve(() => {
|
|
645
|
+
const P = v.clearControl$.subscribe((D) => {
|
|
646
|
+
D === !0 && (p(!1), _(!1), S(!1), b(!1), I(!0));
|
|
647
|
+
}), N = v.changeStart$.subscribe((D) => {
|
|
648
|
+
const { objects: le } = D, W = Ae(le, n);
|
|
649
|
+
W.length === 0 ? (p(!1), _(!1), S(!1), b(!1), I(!0)) : W.length === 1 ? (p(!0), _(!0), S(!1), b(!0), I(!1)) : (p(!0), _(!1), S(!0), b(!1), I(!1));
|
|
650
|
+
}), B = n.focus$.subscribe((D) => {
|
|
651
|
+
D.length === 0 ? (p(!1), _(!1), S(!1), b(!1), I(!0)) : D.length === 1 ? (p(!0), _(!0), S(!1), b(!0), I(!1)) : (p(!0), _(!1), S(!0), b(!1), I(!1));
|
|
652
652
|
});
|
|
653
653
|
return () => {
|
|
654
|
-
|
|
654
|
+
N.unsubscribe(), P.unsubscribe(), B.unsubscribe();
|
|
655
655
|
};
|
|
656
|
-
}, []), /* @__PURE__ */
|
|
657
|
-
},
|
|
658
|
-
imagePopupMenu:
|
|
659
|
-
imagePopupMenuItem:
|
|
660
|
-
imagePopupMenuItemIcon:
|
|
661
|
-
imagePopupMenuItemTitle:
|
|
662
|
-
imagePopupMenuItemHide:
|
|
663
|
-
btnContainer:
|
|
664
|
-
btnContainerExpand:
|
|
665
|
-
},
|
|
656
|
+
}, []), /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("div", { style: { display: y === !0 ? "block" : "none", height: "100%" } }, /* @__PURE__ */ c.createElement("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%", top: "50%", marginTop: "-100px" } }, /* @__PURE__ */ c.createElement("span", null, t.t("image-panel.null")))), /* @__PURE__ */ c.createElement(bn, { arrangeShow: o === !0 ? w : !1, drawings: r }), /* @__PURE__ */ c.createElement(yn, { transformShow: i === !0 ? E : !1, drawings: r }), /* @__PURE__ */ c.createElement(En, { alignShow: s === !0 ? M : !1, drawings: r }), /* @__PURE__ */ c.createElement(Rn, { cropperShow: l === !0 ? R : !1, drawings: r }), /* @__PURE__ */ c.createElement(Mn, { hasGroup: g, drawings: r }));
|
|
657
|
+
}, On = "univer-image-popup-menu", Nn = "univer-image-popup-menu-item", Dn = "univer-image-popup-menu-item-icon", Tn = "univer-image-popup-menu-item-title", Bn = "univer-image-popup-menu-item-hide", jn = "univer-btn-container", Un = "univer-btn-container-expand", he = {
|
|
658
|
+
imagePopupMenu: On,
|
|
659
|
+
imagePopupMenuItem: Nn,
|
|
660
|
+
imagePopupMenuItemIcon: Dn,
|
|
661
|
+
imagePopupMenuItemTitle: Tn,
|
|
662
|
+
imagePopupMenuItemHide: Bn,
|
|
663
|
+
btnContainer: jn,
|
|
664
|
+
btnContainerExpand: Un
|
|
665
|
+
}, Hn = (a) => {
|
|
666
666
|
var v, w;
|
|
667
667
|
const n = (w = (v = a.popup) == null ? void 0 : v.extraProps) == null ? void 0 : w.menuItems;
|
|
668
668
|
if (!n)
|
|
669
669
|
return null;
|
|
670
|
-
const e =
|
|
670
|
+
const e = x(ce), t = x(Z), [r, o] = L(!1), [i, s] = L(!1), l = () => {
|
|
671
671
|
s(!0);
|
|
672
672
|
}, g = () => {
|
|
673
673
|
s(!1);
|
|
@@ -676,57 +676,57 @@ const Fe = {
|
|
|
676
676
|
}, d = (p) => {
|
|
677
677
|
e.executeCommand(p.commandId, p.commandParams), o(!1);
|
|
678
678
|
}, h = r || i, f = n.filter((p) => !p.disable);
|
|
679
|
-
return /* @__PURE__ */
|
|
679
|
+
return /* @__PURE__ */ c.createElement(
|
|
680
680
|
"div",
|
|
681
681
|
{
|
|
682
|
-
onMouseEnter:
|
|
682
|
+
onMouseEnter: l,
|
|
683
683
|
onMouseLeave: g
|
|
684
684
|
},
|
|
685
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ c.createElement(
|
|
686
686
|
Vt,
|
|
687
687
|
{
|
|
688
688
|
placement: "bottomLeft",
|
|
689
689
|
trigger: ["click"],
|
|
690
|
-
overlay: /* @__PURE__ */
|
|
690
|
+
overlay: /* @__PURE__ */ c.createElement("ul", { className: he.imagePopupMenu }, f.map((p) => /* @__PURE__ */ c.createElement(
|
|
691
691
|
"li",
|
|
692
692
|
{
|
|
693
693
|
key: p.index,
|
|
694
694
|
onClick: () => d(p),
|
|
695
|
-
className:
|
|
695
|
+
className: he.imagePopupMenuItem
|
|
696
696
|
},
|
|
697
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ c.createElement("span", { className: he.imagePopupMenuItemTitle }, t.t(p.label))
|
|
698
698
|
))),
|
|
699
699
|
visible: r,
|
|
700
700
|
onVisibleChange: u
|
|
701
701
|
},
|
|
702
|
-
/* @__PURE__ */
|
|
702
|
+
/* @__PURE__ */ c.createElement(
|
|
703
703
|
"div",
|
|
704
704
|
{
|
|
705
|
-
className: T(
|
|
706
|
-
[
|
|
705
|
+
className: T(he.btnContainer, {
|
|
706
|
+
[he.btnContainerExpand]: r
|
|
707
707
|
})
|
|
708
708
|
},
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
|
|
709
|
+
/* @__PURE__ */ c.createElement(
|
|
710
|
+
lt,
|
|
711
711
|
{
|
|
712
712
|
style: { color: "#35322B" },
|
|
713
713
|
extend: { colorChannel1: "rgb(var(--green-700, #409f11))" }
|
|
714
714
|
}
|
|
715
715
|
),
|
|
716
|
-
h && /* @__PURE__ */
|
|
716
|
+
h && /* @__PURE__ */ c.createElement(dt, { style: { color: "#CCCCCC", fontSize: "8px", marginLeft: "8px" } })
|
|
717
717
|
)
|
|
718
718
|
)
|
|
719
719
|
);
|
|
720
|
-
},
|
|
721
|
-
var
|
|
722
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
720
|
+
}, Ln = "COMPONENT_IMAGE_POPUP_MENU";
|
|
721
|
+
var An = Object.defineProperty, Vn = Object.getOwnPropertyDescriptor, xn = (a, n, e, t) => {
|
|
722
|
+
for (var r = t > 1 ? void 0 : t ? Vn(n, e) : n, o = a.length - 1, i; o >= 0; o--)
|
|
723
723
|
(i = a[o]) && (r = (t ? i(n, e, r) : i(r)) || r);
|
|
724
|
-
return t && r &&
|
|
725
|
-
},
|
|
724
|
+
return t && r && An(n, e, r), r;
|
|
725
|
+
}, ye = (a, n) => (e, t) => n(e, t, a);
|
|
726
726
|
let Me = class extends Ue {
|
|
727
727
|
constructor(n, e, t, r) {
|
|
728
728
|
super();
|
|
729
|
-
|
|
729
|
+
Q(this, "_sceneListenerOnDrawingMap", /* @__PURE__ */ new WeakSet());
|
|
730
730
|
this._currentUniverService = n, this._commandService = e, this._renderManagerService = t, this._drawingManagerService = r, this._initialize();
|
|
731
731
|
}
|
|
732
732
|
dispose() {
|
|
@@ -736,15 +736,15 @@ let Me = class extends Ue {
|
|
|
736
736
|
this._recoveryImages(), this._drawingAddListener(), this._drawingRemoveListener(), this._drawingUpdateListener(), this._commandExecutedListener(), this._drawingArrangeListener(), this._drawingGroupListener(), this._drawingRefreshListener(), this._drawingVisibleListener();
|
|
737
737
|
}
|
|
738
738
|
_recoveryImages() {
|
|
739
|
-
const n = this._drawingManagerService.drawingManagerData, e =
|
|
739
|
+
const n = this._drawingManagerService.drawingManagerData, e = $e(this._currentUniverService);
|
|
740
740
|
if (e == null)
|
|
741
741
|
return;
|
|
742
742
|
const { unitId: t, subUnitId: r } = e;
|
|
743
743
|
Object.keys(n).forEach((o) => {
|
|
744
744
|
Object.keys(n[o]).forEach((i) => {
|
|
745
745
|
const s = n[o][i].data;
|
|
746
|
-
s == null || o !== t || i !== r || Object.keys(s).forEach((
|
|
747
|
-
s[
|
|
746
|
+
s == null || o !== t || i !== r || Object.keys(s).forEach((l) => {
|
|
747
|
+
s[l] && this._insertDrawing([{ unitId: o, subUnitId: i, drawingId: l }]);
|
|
748
748
|
});
|
|
749
749
|
});
|
|
750
750
|
});
|
|
@@ -752,7 +752,7 @@ let Me = class extends Ue {
|
|
|
752
752
|
_commandExecutedListener() {
|
|
753
753
|
this.disposeWithMe(
|
|
754
754
|
this._commandService.onCommandExecuted((n) => {
|
|
755
|
-
if (n.id ===
|
|
755
|
+
if (n.id === Ke.id) {
|
|
756
756
|
const e = n.params;
|
|
757
757
|
if (e == null)
|
|
758
758
|
return;
|
|
@@ -810,20 +810,20 @@ let Me = class extends Ue {
|
|
|
810
810
|
const { parent: e, children: t } = n, { unitId: r, subUnitId: o, drawingId: i } = e, s = this._getSceneAndTransformerByDrawingSearch(e.unitId);
|
|
811
811
|
if (s == null)
|
|
812
812
|
return;
|
|
813
|
-
const { scene:
|
|
814
|
-
this._commandService.syncExecuteCommand(
|
|
813
|
+
const { scene: l, transformer: g } = s;
|
|
814
|
+
this._commandService.syncExecuteCommand(oe.id);
|
|
815
815
|
const u = [];
|
|
816
816
|
if (t.forEach((f) => {
|
|
817
|
-
const v =
|
|
817
|
+
const v = G(f), w = l.getObjectIncludeInGroup(v);
|
|
818
818
|
if (w == null || u.includes(w))
|
|
819
819
|
return;
|
|
820
820
|
u.push(w);
|
|
821
821
|
const { transform: p } = f;
|
|
822
|
-
p != null && (w.classType ===
|
|
822
|
+
p != null && (w.classType === Xe.GROUP ? w.transformByState({ left: p.left, top: p.top }) : w.transformByState(p));
|
|
823
823
|
}), u.length === 0)
|
|
824
824
|
return;
|
|
825
|
-
const d =
|
|
826
|
-
|
|
825
|
+
const d = G({ unitId: r, subUnitId: o, drawingId: i }), h = new pe(d);
|
|
826
|
+
l.addObject(h, ze).attachTransformerTo(h), h.addObjects(...u), e.transform && h.transformByState({ left: e.transform.left, top: e.transform.top }), g.clearSelectedObjects(), g.setSelectedControl(h);
|
|
827
827
|
}
|
|
828
828
|
// private _regroupDrawings(drawings: IDrawingSearch[]) {
|
|
829
829
|
// const renderObject = this._getSceneAndTransformerByDrawingSearch(drawings[0].unitId);
|
|
@@ -870,25 +870,25 @@ let Me = class extends Ue {
|
|
|
870
870
|
return;
|
|
871
871
|
const { scene: o, transformer: i } = r;
|
|
872
872
|
t.forEach((d) => {
|
|
873
|
-
const h =
|
|
873
|
+
const h = G(d), f = o.getObjectIncludeInGroup(h);
|
|
874
874
|
if (f == null)
|
|
875
875
|
return !0;
|
|
876
876
|
if (f == null)
|
|
877
877
|
return;
|
|
878
878
|
const { transform: v } = d;
|
|
879
|
-
v != null && (f.classType ===
|
|
879
|
+
v != null && (f.classType === Xe.GROUP ? f.transformByState({ left: v.left, top: v.top }) : f.transformByState(v));
|
|
880
880
|
});
|
|
881
|
-
const s =
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
}),
|
|
881
|
+
const s = G(e), l = o.getObject(s), { width: g, height: u } = l;
|
|
882
|
+
l.getObjects().forEach((d) => {
|
|
883
|
+
l.removeSelfObjectAndTransform(d.oKey, g, u);
|
|
884
|
+
}), l.dispose(), i.clearSelectedObjects();
|
|
885
885
|
}
|
|
886
886
|
_drawingAlign(n) {
|
|
887
887
|
const { alignType: e } = n, t = this._drawingManagerService.getFocusDrawings();
|
|
888
|
-
if (e ===
|
|
888
|
+
if (e === O.default)
|
|
889
889
|
return;
|
|
890
890
|
const r = [];
|
|
891
|
-
let o = Number.POSITIVE_INFINITY, i = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY,
|
|
891
|
+
let o = Number.POSITIVE_INFINITY, i = Number.POSITIVE_INFINITY, s = Number.NEGATIVE_INFINITY, l = Number.NEGATIVE_INFINITY, g = 0;
|
|
892
892
|
t.forEach((u) => {
|
|
893
893
|
const { unitId: d, subUnitId: h, drawingId: f, drawingType: v } = u, w = this._drawingManagerService.getDrawingByParam({ unitId: d, subUnitId: h, drawingId: f });
|
|
894
894
|
if (w == null || w.transform == null)
|
|
@@ -900,52 +900,52 @@ let Me = class extends Ue {
|
|
|
900
900
|
drawingType: v,
|
|
901
901
|
transform: w.transform
|
|
902
902
|
});
|
|
903
|
-
const { left: p = 0, top:
|
|
904
|
-
o = Math.min(o, p), i = Math.min(i,
|
|
905
|
-
}), g !== 0 && (this._sortDrawingTransform(r, e), this._applyAlignType(r, e, o, i, s,
|
|
903
|
+
const { left: p = 0, top: E = 0, width: _ = 0, height: M = 0 } = w.transform;
|
|
904
|
+
o = Math.min(o, p), i = Math.min(i, E), s = Math.max(s, p + _), l = Math.max(l, E + M), g++;
|
|
905
|
+
}), g !== 0 && (this._sortDrawingTransform(r, e), this._applyAlignType(r, e, o, i, s, l, g));
|
|
906
906
|
}
|
|
907
907
|
_applyAlignType(n, e, t, r, o, i, s) {
|
|
908
|
-
const
|
|
908
|
+
const l = Math.round((o - t) / s * 10) / 10, g = Math.round((i - r) / s * 10) / 10, u = [], d = this._getSceneAndTransformerByDrawingSearch(n[0].unitId);
|
|
909
909
|
if (d == null)
|
|
910
910
|
return;
|
|
911
911
|
const { scene: h, transformer: f } = d;
|
|
912
912
|
n.forEach((v, w) => {
|
|
913
|
-
const { unitId: p, subUnitId:
|
|
914
|
-
let
|
|
913
|
+
const { unitId: p, subUnitId: E, drawingId: _, transform: M, drawingType: S } = v, { left: R = 0, top: b = 0, width: y = 0, height: I = 0 } = M;
|
|
914
|
+
let P = R, N = b;
|
|
915
915
|
switch (e) {
|
|
916
|
-
case
|
|
917
|
-
|
|
916
|
+
case O.left:
|
|
917
|
+
P = t;
|
|
918
918
|
break;
|
|
919
|
-
case
|
|
920
|
-
|
|
919
|
+
case O.center:
|
|
920
|
+
P = t + (o - t) / 2 - y / 2;
|
|
921
921
|
break;
|
|
922
|
-
case
|
|
923
|
-
|
|
922
|
+
case O.right:
|
|
923
|
+
P = o - y;
|
|
924
924
|
break;
|
|
925
|
-
case
|
|
926
|
-
|
|
925
|
+
case O.top:
|
|
926
|
+
N = r;
|
|
927
927
|
break;
|
|
928
|
-
case
|
|
929
|
-
|
|
928
|
+
case O.middle:
|
|
929
|
+
N = r + (i - r) / 2 - I / 2;
|
|
930
930
|
break;
|
|
931
|
-
case
|
|
932
|
-
|
|
931
|
+
case O.bottom:
|
|
932
|
+
N = i - I;
|
|
933
933
|
break;
|
|
934
|
-
case
|
|
935
|
-
|
|
934
|
+
case O.horizon:
|
|
935
|
+
P = t + l * w;
|
|
936
936
|
break;
|
|
937
|
-
case
|
|
938
|
-
|
|
937
|
+
case O.vertical:
|
|
938
|
+
N = r + g * w;
|
|
939
939
|
break;
|
|
940
940
|
}
|
|
941
|
-
(
|
|
941
|
+
(P !== R || N !== b) && u.push({
|
|
942
942
|
unitId: p,
|
|
943
|
-
subUnitId:
|
|
943
|
+
subUnitId: E,
|
|
944
944
|
drawingId: _,
|
|
945
945
|
drawingType: S,
|
|
946
946
|
transform: {
|
|
947
|
-
left:
|
|
948
|
-
top:
|
|
947
|
+
left: P,
|
|
948
|
+
top: N
|
|
949
949
|
}
|
|
950
950
|
});
|
|
951
951
|
}), this._drawingManagerService.featurePluginUpdateNotification(u), f.refreshControls().changeNotification();
|
|
@@ -954,7 +954,7 @@ let Me = class extends Ue {
|
|
|
954
954
|
n.sort((t, r) => {
|
|
955
955
|
const o = t.transform, i = r.transform, {
|
|
956
956
|
left: s = 0,
|
|
957
|
-
top:
|
|
957
|
+
top: l = 0,
|
|
958
958
|
width: g = 0,
|
|
959
959
|
height: u = 0
|
|
960
960
|
} = o, {
|
|
@@ -964,22 +964,22 @@ let Me = class extends Ue {
|
|
|
964
964
|
height: v = 0
|
|
965
965
|
} = i;
|
|
966
966
|
switch (e) {
|
|
967
|
-
case
|
|
967
|
+
case O.left:
|
|
968
968
|
return s - d;
|
|
969
|
-
case
|
|
969
|
+
case O.center:
|
|
970
970
|
return s + g / 2 - (d + f / 2);
|
|
971
|
-
case
|
|
971
|
+
case O.right:
|
|
972
972
|
return s + g - (d + f);
|
|
973
|
-
case
|
|
974
|
-
return
|
|
975
|
-
case
|
|
976
|
-
return
|
|
977
|
-
case
|
|
978
|
-
return
|
|
979
|
-
case
|
|
973
|
+
case O.top:
|
|
974
|
+
return l - h;
|
|
975
|
+
case O.middle:
|
|
976
|
+
return l + u / 2 - (h + v / 2);
|
|
977
|
+
case O.bottom:
|
|
978
|
+
return l + u - (h + v);
|
|
979
|
+
case O.horizon:
|
|
980
980
|
return s + g / 2 - (d + f / 2);
|
|
981
|
-
case
|
|
982
|
-
return
|
|
981
|
+
case O.vertical:
|
|
982
|
+
return l + u / 2 - (h + v / 2);
|
|
983
983
|
default:
|
|
984
984
|
return 0;
|
|
985
985
|
}
|
|
@@ -997,11 +997,11 @@ let Me = class extends Ue {
|
|
|
997
997
|
if (o == null)
|
|
998
998
|
return;
|
|
999
999
|
const { scene: i, transformer: s } = o;
|
|
1000
|
-
r.forEach((
|
|
1001
|
-
const g =
|
|
1000
|
+
r.forEach((l) => {
|
|
1001
|
+
const g = G({ unitId: e, subUnitId: t, drawingId: l }), u = i.getObject(g);
|
|
1002
1002
|
if (u == null)
|
|
1003
1003
|
return;
|
|
1004
|
-
const d = this._drawingManagerService.getDrawingOrder(e, t).indexOf(
|
|
1004
|
+
const d = this._drawingManagerService.getDrawingOrder(e, t).indexOf(l);
|
|
1005
1005
|
u.setProps({ zIndex: d }), u.makeDirty();
|
|
1006
1006
|
});
|
|
1007
1007
|
}
|
|
@@ -1018,10 +1018,10 @@ let Me = class extends Ue {
|
|
|
1018
1018
|
const { unitId: r, subUnitId: o, drawingId: i } = t;
|
|
1019
1019
|
if (this._drawingManagerService.getDrawingByParam(t) == null)
|
|
1020
1020
|
return;
|
|
1021
|
-
const
|
|
1022
|
-
if (
|
|
1021
|
+
const l = this._getSceneAndTransformerByDrawingSearch(r);
|
|
1022
|
+
if (l == null)
|
|
1023
1023
|
return;
|
|
1024
|
-
const { scene: g, transformer: u } =
|
|
1024
|
+
const { scene: g, transformer: u } = l;
|
|
1025
1025
|
e.includes(g) || e.push(g);
|
|
1026
1026
|
}), e.forEach((t) => {
|
|
1027
1027
|
this._sceneListenerOnDrawingMap.has(t) || (this._addListenerOnDrawing(t), this._sceneListenerOnDrawingMap.add(t));
|
|
@@ -1035,7 +1035,7 @@ let Me = class extends Ue {
|
|
|
1035
1035
|
const { unitId: t, subUnitId: r, drawingId: o } = e, i = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1036
1036
|
if (i == null)
|
|
1037
1037
|
return;
|
|
1038
|
-
const { scene: s, transformer:
|
|
1038
|
+
const { scene: s, transformer: l } = i, g = G({ unitId: t, subUnitId: r, drawingId: o }), u = s.getObject(g);
|
|
1039
1039
|
u != null && (u.dispose(), (d = s.getTransformer()) == null || d.clearSelectedObjects());
|
|
1040
1040
|
});
|
|
1041
1041
|
})
|
|
@@ -1048,16 +1048,16 @@ let Me = class extends Ue {
|
|
|
1048
1048
|
const { unitId: t, subUnitId: r, drawingId: o } = e, i = this._drawingManagerService.getDrawingByParam(e);
|
|
1049
1049
|
if (i == null)
|
|
1050
1050
|
return;
|
|
1051
|
-
const { transform: s, drawingType:
|
|
1051
|
+
const { transform: s, drawingType: l } = i, g = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1052
1052
|
if (g == null)
|
|
1053
1053
|
return;
|
|
1054
1054
|
const { scene: u, transformer: d } = g;
|
|
1055
1055
|
if (s == null)
|
|
1056
1056
|
return !0;
|
|
1057
|
-
const { left: h = 0, top: f = 0, width: v = 0, height: w = 0, angle: p = 0, flipX:
|
|
1057
|
+
const { left: h = 0, top: f = 0, width: v = 0, height: w = 0, angle: p = 0, flipX: E = !1, flipY: _ = !1, skewX: M = 0, skewY: S = 0 } = s, R = G({ unitId: t, subUnitId: r, drawingId: o }), b = u.getObject(R);
|
|
1058
1058
|
if (b == null)
|
|
1059
1059
|
return !0;
|
|
1060
|
-
b.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX:
|
|
1060
|
+
b.transformByState({ left: h, top: f, width: v, height: w, angle: p, flipX: E, flipY: _, skewX: M, skewY: S });
|
|
1061
1061
|
});
|
|
1062
1062
|
})
|
|
1063
1063
|
);
|
|
@@ -1069,16 +1069,16 @@ let Me = class extends Ue {
|
|
|
1069
1069
|
const { unitId: t, subUnitId: r, drawingId: o } = e, i = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1070
1070
|
if (i == null)
|
|
1071
1071
|
return;
|
|
1072
|
-
const { scene: s, transformer:
|
|
1072
|
+
const { scene: s, transformer: l } = i, g = G({ unitId: t, subUnitId: r, drawingId: o }), u = s.getObject(g), d = this._drawingManagerService.getDrawingByParam(e);
|
|
1073
1073
|
if (d == null)
|
|
1074
1074
|
return;
|
|
1075
1075
|
const { transform: h } = d;
|
|
1076
1076
|
if (h == null)
|
|
1077
1077
|
return !0;
|
|
1078
|
-
const { left: f = 0, top: v = 0, width: w = 0, height: p = 0, angle:
|
|
1078
|
+
const { left: f = 0, top: v = 0, width: w = 0, height: p = 0, angle: E = 0, flipX: _ = !1, flipY: M = !1, skewX: S = 0, skewY: R = 0 } = h;
|
|
1079
1079
|
if (u == null)
|
|
1080
1080
|
return !0;
|
|
1081
|
-
u.transformByState({ left: f, top: v, width: w, height: p, angle:
|
|
1081
|
+
u.transformByState({ left: f, top: v, width: w, height: p, angle: E, flipX: _, flipY: M, skewX: S, skewY: R });
|
|
1082
1082
|
});
|
|
1083
1083
|
})
|
|
1084
1084
|
);
|
|
@@ -1090,7 +1090,7 @@ let Me = class extends Ue {
|
|
|
1090
1090
|
const { unitId: t, subUnitId: r, drawingId: o, visible: i } = e, s = this._getSceneAndTransformerByDrawingSearch(t);
|
|
1091
1091
|
if (s == null)
|
|
1092
1092
|
return;
|
|
1093
|
-
const { scene:
|
|
1093
|
+
const { scene: l, transformer: g } = s, u = G({ unitId: t, subUnitId: r, drawingId: o }), d = l.getObject(u);
|
|
1094
1094
|
if (d == null)
|
|
1095
1095
|
return !0;
|
|
1096
1096
|
i ? d.show() : d.hide();
|
|
@@ -1103,7 +1103,7 @@ let Me = class extends Ue {
|
|
|
1103
1103
|
if (t == null)
|
|
1104
1104
|
return !1;
|
|
1105
1105
|
const { transform: o } = t;
|
|
1106
|
-
return
|
|
1106
|
+
return at(o, e == null ? void 0 : e[r]);
|
|
1107
1107
|
});
|
|
1108
1108
|
}
|
|
1109
1109
|
// group?.getObjects().forEach((o) => {
|
|
@@ -1117,79 +1117,76 @@ let Me = class extends Ue {
|
|
|
1117
1117
|
const e = n.getTransformerByCreate();
|
|
1118
1118
|
let t = null;
|
|
1119
1119
|
this.disposeWithMe(
|
|
1120
|
-
|
|
1121
|
-
e.
|
|
1120
|
+
Ce(
|
|
1121
|
+
e.changeStart$.subscribe((r) => {
|
|
1122
1122
|
const { objects: o } = r, i = Array.from(o.values()), s = [];
|
|
1123
|
-
t = i.map((
|
|
1124
|
-
const { left: g, top: u, height: d, width: h, angle: f, oKey: v, groupKey: w, isInGroup: p } =
|
|
1125
|
-
if (p ||
|
|
1126
|
-
let _ =
|
|
1127
|
-
if (_ == null &&
|
|
1123
|
+
t = i.map((l) => {
|
|
1124
|
+
const { left: g, top: u, height: d, width: h, angle: f, oKey: v, groupKey: w, isInGroup: p } = l, E = this._drawingManagerService.getDrawingOKey(v);
|
|
1125
|
+
if (p || l instanceof pe) {
|
|
1126
|
+
let _ = l.ancestorGroup;
|
|
1127
|
+
if (_ == null && l instanceof pe && (_ = l), _ == null)
|
|
1128
1128
|
return null;
|
|
1129
|
-
const
|
|
1130
|
-
if (
|
|
1131
|
-
const { unitId: S, subUnitId:
|
|
1132
|
-
s.push({ unitId: S, subUnitId:
|
|
1133
|
-
const { left:
|
|
1134
|
-
return { left:
|
|
1129
|
+
const M = this._drawingManagerService.getDrawingOKey(_.oKey);
|
|
1130
|
+
if (M) {
|
|
1131
|
+
const { unitId: S, subUnitId: R, drawingId: b } = M;
|
|
1132
|
+
s.push({ unitId: S, subUnitId: R, drawingId: b });
|
|
1133
|
+
const { left: y, top: I, height: P, width: N, angle: B } = _;
|
|
1134
|
+
return { left: y, top: I, height: P, width: N, angle: B };
|
|
1135
1135
|
}
|
|
1136
|
-
} else if (
|
|
1137
|
-
const { unitId: _, subUnitId:
|
|
1138
|
-
return s.push({ unitId: _, subUnitId:
|
|
1136
|
+
} else if (E != null) {
|
|
1137
|
+
const { unitId: _, subUnitId: M, drawingId: S } = E;
|
|
1138
|
+
return s.push({ unitId: _, subUnitId: M, drawingId: S }), { left: g, top: u, height: d, width: h, angle: f };
|
|
1139
1139
|
}
|
|
1140
1140
|
return null;
|
|
1141
|
-
}).filter((
|
|
1141
|
+
}).filter((l) => l != null), s.length > 0 ? this._drawingManagerService.focusDrawing(s) : this._drawingManagerService.focusDrawing(null);
|
|
1142
1142
|
})
|
|
1143
1143
|
)
|
|
1144
1144
|
), this.disposeWithMe(
|
|
1145
|
-
|
|
1146
|
-
e.
|
|
1147
|
-
const { objects: o } = r;
|
|
1148
|
-
we(o, this._drawingManagerService).length > 0;
|
|
1149
|
-
})
|
|
1150
|
-
)
|
|
1151
|
-
), this.disposeWithMe(
|
|
1152
|
-
K(
|
|
1153
|
-
e.onChangeEndObservable.add((r) => {
|
|
1154
|
-
const { objects: o } = r, i = this._filterUpdateParams(we(o, this._drawingManagerService), t);
|
|
1145
|
+
Ce(
|
|
1146
|
+
e.changeEnd$.subscribe((r) => {
|
|
1147
|
+
const { objects: o } = r, i = this._filterUpdateParams(Ae(o, this._drawingManagerService), t);
|
|
1155
1148
|
i.length > 0 && this._drawingManagerService.featurePluginUpdateNotification(i);
|
|
1156
1149
|
})
|
|
1157
1150
|
)
|
|
1158
1151
|
);
|
|
1159
1152
|
}
|
|
1160
1153
|
};
|
|
1161
|
-
Me =
|
|
1154
|
+
Me = xn([
|
|
1162
1155
|
He(Le.Rendered, Me),
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1156
|
+
ye(0, Fe),
|
|
1157
|
+
ye(1, ce),
|
|
1158
|
+
ye(2, ge),
|
|
1159
|
+
ye(3, ne)
|
|
1167
1160
|
], Me);
|
|
1168
|
-
const
|
|
1161
|
+
const Gn = (a) => {
|
|
1169
1162
|
const { src: n } = a;
|
|
1170
|
-
return n ? /* @__PURE__ */
|
|
1171
|
-
},
|
|
1172
|
-
|
|
1173
|
-
|
|
1163
|
+
return n ? /* @__PURE__ */ c.createElement("div", null, /* @__PURE__ */ c.createElement("img", { src: n, alt: "Univer Image Viewer", style: { width: "100%", height: "100%", position: "relative" } })) : null;
|
|
1164
|
+
}, wt = "COMPONENT_IMAGE_VIEWER", vt = {
|
|
1165
|
+
id: "sheet.operation.image-reset-size",
|
|
1166
|
+
type: we.OPERATION,
|
|
1167
|
+
handler: (a, n) => !0
|
|
1168
|
+
};
|
|
1169
|
+
var Wn = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, kn = (a, n, e, t) => {
|
|
1170
|
+
for (var r = t > 1 ? void 0 : t ? $n(n, e) : n, o = a.length - 1, i; o >= 0; o--)
|
|
1174
1171
|
(i = a[o]) && (r = (t ? i(n, e, r) : i(r)) || r);
|
|
1175
|
-
return t && r &&
|
|
1176
|
-
},
|
|
1172
|
+
return t && r && Wn(n, e, r), r;
|
|
1173
|
+
}, fe = (a, n) => (e, t) => n(e, t, a);
|
|
1177
1174
|
let Oe = class extends Ue {
|
|
1178
1175
|
constructor(a, n, e, t, r) {
|
|
1179
1176
|
super(), this._injector = a, this._componentManager = n, this._menuService = e, this._commandService = t, this._localeService = r, this._init();
|
|
1180
1177
|
}
|
|
1181
1178
|
_initCustomComponents() {
|
|
1182
1179
|
const a = this._componentManager;
|
|
1183
|
-
this.disposeWithMe(a.register(
|
|
1180
|
+
this.disposeWithMe(a.register(Ln, Hn)), this.disposeWithMe(a.register(wt, Gn));
|
|
1184
1181
|
}
|
|
1185
1182
|
_initMenus() {
|
|
1186
1183
|
}
|
|
1187
1184
|
_initCommands() {
|
|
1188
1185
|
[
|
|
1189
1186
|
ke,
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1187
|
+
oe,
|
|
1188
|
+
vt,
|
|
1189
|
+
Ke,
|
|
1193
1190
|
je
|
|
1194
1191
|
].forEach((a) => this.disposeWithMe(this._commandService.registerCommand(a)));
|
|
1195
1192
|
}
|
|
@@ -1197,15 +1194,15 @@ let Oe = class extends Ue {
|
|
|
1197
1194
|
this._initCommands(), this._initCustomComponents(), this._initMenus();
|
|
1198
1195
|
}
|
|
1199
1196
|
};
|
|
1200
|
-
Oe =
|
|
1197
|
+
Oe = kn([
|
|
1201
1198
|
He(Le.Rendered, Oe),
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1199
|
+
fe(0, se(st)),
|
|
1200
|
+
fe(1, se(xt)),
|
|
1201
|
+
fe(2, Gt),
|
|
1202
|
+
fe(3, ce),
|
|
1203
|
+
fe(4, se(Z))
|
|
1207
1204
|
], Oe);
|
|
1208
|
-
class
|
|
1205
|
+
class Ee extends Bt {
|
|
1209
1206
|
constructor(e, t) {
|
|
1210
1207
|
t == null && (t = {}), t.transformerConfig = {
|
|
1211
1208
|
keepRatio: !1,
|
|
@@ -1215,11 +1212,11 @@ class Re extends Bt {
|
|
|
1215
1212
|
anchorSize: 24
|
|
1216
1213
|
};
|
|
1217
1214
|
super(e, t);
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1215
|
+
Q(this, "_srcRect");
|
|
1216
|
+
Q(this, "_prstGeom");
|
|
1217
|
+
Q(this, "_applyTransform");
|
|
1218
|
+
Q(this, "_dragPadding", 8);
|
|
1219
|
+
Q(this, "_cacheCanvas");
|
|
1223
1220
|
t != null && t.srcRect && (this._srcRect = t.srcRect), t != null && t.prstGeom && (this._prstGeom = t.prstGeom), t != null && t.applyTransform && (this._applyTransform = t.applyTransform), t != null && t.dragPadding && (this._dragPadding = t.dragPadding), this._applyProps();
|
|
1224
1221
|
}
|
|
1225
1222
|
refreshSrcRect(e, t) {
|
|
@@ -1244,9 +1241,9 @@ class Re extends Bt {
|
|
|
1244
1241
|
return this.visible ? (e.save(), this._draw(e), e.restore(), this.makeDirty(!1), this) : (this.makeDirty(!1), this);
|
|
1245
1242
|
}
|
|
1246
1243
|
_draw(e) {
|
|
1247
|
-
var
|
|
1244
|
+
var l, g;
|
|
1248
1245
|
const r = this.getScene().getEngine(), { width: o, height: i } = r;
|
|
1249
|
-
this._initialCacheCanvas(), (
|
|
1246
|
+
this._initialCacheCanvas(), (l = this._cacheCanvas) == null || l.clear();
|
|
1250
1247
|
const s = (g = this._cacheCanvas) == null ? void 0 : g.getContext();
|
|
1251
1248
|
s != null && (s.save(), jt.drawWith(s, {
|
|
1252
1249
|
left: 0,
|
|
@@ -1267,7 +1264,7 @@ class Re extends Bt {
|
|
|
1267
1264
|
if (this._applyTransform == null)
|
|
1268
1265
|
return;
|
|
1269
1266
|
let e = 0, t = 0, r = 0, o = 0;
|
|
1270
|
-
const { left: i = 0, top: s = 0, width:
|
|
1267
|
+
const { left: i = 0, top: s = 0, width: l = 0, height: g = 0, angle: u } = this._applyTransform;
|
|
1271
1268
|
if (this._srcRect != null) {
|
|
1272
1269
|
const { left: f = 0, top: v = 0, right: w = 0, bottom: p = 0 } = this._srcRect;
|
|
1273
1270
|
e = f, t = v, r = w, o = p;
|
|
@@ -1276,7 +1273,7 @@ class Re extends Bt {
|
|
|
1276
1273
|
this.transformByState({
|
|
1277
1274
|
left: d,
|
|
1278
1275
|
top: h,
|
|
1279
|
-
width: i +
|
|
1276
|
+
width: i + l - r - d,
|
|
1280
1277
|
height: s + g - o - h,
|
|
1281
1278
|
angle: u
|
|
1282
1279
|
});
|
|
@@ -1292,21 +1289,21 @@ class Re extends Bt {
|
|
|
1292
1289
|
return;
|
|
1293
1290
|
this._cacheCanvas = new Ut();
|
|
1294
1291
|
const e = this.getScene().getEngine();
|
|
1295
|
-
this._cacheCanvas.setSize(e.width, e.height),
|
|
1292
|
+
this._cacheCanvas.setSize(e.width, e.height), e.onTransformChange$.subscribeEvent(() => {
|
|
1296
1293
|
var t;
|
|
1297
1294
|
(t = this._cacheCanvas) == null || t.setSize(e.width, e.height), this.makeDirty(!0);
|
|
1298
1295
|
});
|
|
1299
1296
|
}
|
|
1300
1297
|
}
|
|
1301
|
-
var
|
|
1302
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1298
|
+
var zn = Object.defineProperty, Fn = Object.getOwnPropertyDescriptor, Kn = (a, n, e, t) => {
|
|
1299
|
+
for (var r = t > 1 ? void 0 : t ? Fn(n, e) : n, o = a.length - 1, i; o >= 0; o--)
|
|
1303
1300
|
(i = a[o]) && (r = (t ? i(n, e, r) : i(r)) || r);
|
|
1304
|
-
return t && r &&
|
|
1301
|
+
return t && r && zn(n, e, r), r;
|
|
1305
1302
|
}, me = (a, n) => (e, t) => n(e, t, a);
|
|
1306
1303
|
let Ne = class extends Ue {
|
|
1307
1304
|
constructor(n, e, t, r, o, i) {
|
|
1308
1305
|
super();
|
|
1309
|
-
|
|
1306
|
+
Q(this, "_sceneListenerOnImageMap", /* @__PURE__ */ new WeakSet());
|
|
1310
1307
|
this._commandService = n, this._drawingManagerService = e, this._renderManagerService = t, this._univerInstanceService = r, this._messageService = o, this._localeService = i, this._init();
|
|
1311
1308
|
}
|
|
1312
1309
|
_init() {
|
|
@@ -1323,75 +1320,75 @@ let Ne = class extends Ue {
|
|
|
1323
1320
|
const { cropType: t } = e, r = this._drawingManagerService.getFocusDrawings();
|
|
1324
1321
|
if (r.length !== 1)
|
|
1325
1322
|
return;
|
|
1326
|
-
const o = r[0], { unitId: i, subUnitId: s, drawingId:
|
|
1323
|
+
const o = r[0], { unitId: i, subUnitId: s, drawingId: l } = o, g = this._renderManagerService.getRenderById(i), u = g == null ? void 0 : g.scene;
|
|
1327
1324
|
if (u == null)
|
|
1328
1325
|
return !0;
|
|
1329
|
-
this._searchCropObject(u) != null && this._commandService.syncExecuteCommand(
|
|
1330
|
-
const h =
|
|
1326
|
+
this._searchCropObject(u) != null && this._commandService.syncExecuteCommand(oe.id, { isAuto: !0 });
|
|
1327
|
+
const h = G({ unitId: i, subUnitId: s, drawingId: l }), f = u.getObject(h);
|
|
1331
1328
|
if (!(f instanceof We)) {
|
|
1332
1329
|
this._messageService.show({
|
|
1333
|
-
type:
|
|
1330
|
+
type: qe.Error,
|
|
1334
1331
|
content: this._localeService.t("image-cropper.error")
|
|
1335
1332
|
});
|
|
1336
1333
|
return;
|
|
1337
1334
|
}
|
|
1338
|
-
f != null && (this._updateCropperObject(t, f), this._commandService.executeCommand(ke.id, { unitId: i, subUnitId: s, drawingId:
|
|
1335
|
+
f != null && (this._updateCropperObject(t, f), this._commandService.executeCommand(ke.id, { unitId: i, subUnitId: s, drawingId: l }));
|
|
1339
1336
|
})
|
|
1340
1337
|
);
|
|
1341
1338
|
}
|
|
1342
1339
|
_calculateSrcRectByRatio(n, e, t, r, o, i) {
|
|
1343
|
-
const s = t / r,
|
|
1340
|
+
const s = t / r, l = o / i;
|
|
1344
1341
|
let g = t, u = r;
|
|
1345
|
-
s >
|
|
1342
|
+
s > l ? g = r * l : u = t / l;
|
|
1346
1343
|
const d = (t - g) / 2, h = (r - u) / 2;
|
|
1347
1344
|
return {
|
|
1348
|
-
left:
|
|
1349
|
-
top:
|
|
1350
|
-
right:
|
|
1351
|
-
bottom:
|
|
1345
|
+
left: be(d, 1),
|
|
1346
|
+
top: be(h, 1),
|
|
1347
|
+
right: be(t - (d + g), 1),
|
|
1348
|
+
bottom: be(r - (h + u), 1)
|
|
1352
1349
|
};
|
|
1353
1350
|
}
|
|
1354
1351
|
_updateCropperObject(n, e) {
|
|
1355
1352
|
const { left: t, top: r, width: o, height: i } = e.calculateTransformWithSrcRect();
|
|
1356
1353
|
let s;
|
|
1357
1354
|
switch (n) {
|
|
1358
|
-
case
|
|
1355
|
+
case j.R1_1:
|
|
1359
1356
|
s = this._calculateSrcRectByRatio(t, r, o, i, 1, 1);
|
|
1360
1357
|
break;
|
|
1361
|
-
case
|
|
1358
|
+
case j.R16_9:
|
|
1362
1359
|
s = this._calculateSrcRectByRatio(t, r, o, i, 16, 9);
|
|
1363
1360
|
break;
|
|
1364
|
-
case
|
|
1361
|
+
case j.R9_16:
|
|
1365
1362
|
s = this._calculateSrcRectByRatio(t, r, o, i, 9, 16);
|
|
1366
1363
|
break;
|
|
1367
|
-
case
|
|
1364
|
+
case j.R5_4:
|
|
1368
1365
|
s = this._calculateSrcRectByRatio(t, r, o, i, 5, 4);
|
|
1369
1366
|
break;
|
|
1370
|
-
case
|
|
1367
|
+
case j.R4_5:
|
|
1371
1368
|
s = this._calculateSrcRectByRatio(t, r, o, i, 4, 5);
|
|
1372
1369
|
break;
|
|
1373
|
-
case
|
|
1370
|
+
case j.R4_3:
|
|
1374
1371
|
s = this._calculateSrcRectByRatio(t, r, o, i, 4, 3);
|
|
1375
1372
|
break;
|
|
1376
|
-
case
|
|
1373
|
+
case j.R3_4:
|
|
1377
1374
|
s = this._calculateSrcRectByRatio(t, r, o, i, 3, 4);
|
|
1378
1375
|
break;
|
|
1379
|
-
case
|
|
1376
|
+
case j.R3_2:
|
|
1380
1377
|
s = this._calculateSrcRectByRatio(t, r, o, i, 3, 2);
|
|
1381
1378
|
break;
|
|
1382
|
-
case
|
|
1379
|
+
case j.R2_3:
|
|
1383
1380
|
s = this._calculateSrcRectByRatio(t, r, o, i, 2, 3);
|
|
1384
1381
|
break;
|
|
1385
|
-
case
|
|
1382
|
+
case j.FREE:
|
|
1386
1383
|
}
|
|
1387
1384
|
if (s == null)
|
|
1388
1385
|
return;
|
|
1389
1386
|
e.setSrcRect(s);
|
|
1390
|
-
const { left:
|
|
1387
|
+
const { left: l = 0, top: g = 0, bottom: u = 0, right: d = 0 } = s;
|
|
1391
1388
|
e.transformByStateCloseCropper({
|
|
1392
|
-
left: t +
|
|
1389
|
+
left: t + l,
|
|
1393
1390
|
top: r + g,
|
|
1394
|
-
width: o - d -
|
|
1391
|
+
width: o - d - l,
|
|
1395
1392
|
height: i - u - g
|
|
1396
1393
|
});
|
|
1397
1394
|
}
|
|
@@ -1408,19 +1405,19 @@ let Ne = class extends Ue {
|
|
|
1408
1405
|
return !0;
|
|
1409
1406
|
if (this._sceneListenerOnImageMap.has(s) || (this._addListenerOnImage(s), this._sceneListenerOnImageMap.add(s)), this._drawingManagerService.getDrawingByParam({ unitId: t, subUnitId: r, drawingId: o }) == null)
|
|
1410
1407
|
return;
|
|
1411
|
-
const g =
|
|
1408
|
+
const g = G({ unitId: t, subUnitId: r, drawingId: o }), u = s.getObject(g);
|
|
1412
1409
|
if (u == null)
|
|
1413
1410
|
return;
|
|
1414
1411
|
if (!(u instanceof We)) {
|
|
1415
1412
|
this._messageService.show({
|
|
1416
|
-
type:
|
|
1413
|
+
type: qe.Error,
|
|
1417
1414
|
content: this._localeService.t("image-cropper.error")
|
|
1418
1415
|
});
|
|
1419
1416
|
return;
|
|
1420
1417
|
}
|
|
1421
1418
|
const d = s.getTransformer();
|
|
1422
1419
|
d == null || d.clearControls();
|
|
1423
|
-
const h = new
|
|
1420
|
+
const h = new Ee(`${g}-crop`, {
|
|
1424
1421
|
srcRect: u.srcRect,
|
|
1425
1422
|
prstGeom: u.prstGeom,
|
|
1426
1423
|
applyTransform: u.calculateTransformWithSrcRect()
|
|
@@ -1432,46 +1429,53 @@ let Ne = class extends Ue {
|
|
|
1432
1429
|
_searchCropObject(n) {
|
|
1433
1430
|
const e = n.getAllObjects();
|
|
1434
1431
|
for (const t of e)
|
|
1435
|
-
if (t instanceof
|
|
1432
|
+
if (t instanceof Ee)
|
|
1436
1433
|
return t;
|
|
1437
1434
|
}
|
|
1438
1435
|
_initCloseCrop() {
|
|
1439
1436
|
this.disposeWithMe(
|
|
1440
|
-
this._commandService.onCommandExecuted((
|
|
1441
|
-
if (
|
|
1437
|
+
this._commandService.onCommandExecuted((e) => {
|
|
1438
|
+
if (e.id !== oe.id)
|
|
1442
1439
|
return;
|
|
1443
|
-
const
|
|
1444
|
-
if (
|
|
1440
|
+
const t = this._univerInstanceService.getFocusedUnit();
|
|
1441
|
+
if (t == null)
|
|
1445
1442
|
return;
|
|
1446
|
-
const
|
|
1447
|
-
if (o == null)
|
|
1448
|
-
return !0;
|
|
1449
|
-
const i = this._searchCropObject(o);
|
|
1443
|
+
const r = t.getUnitId(), o = this._renderManagerService.getRenderById(r), i = o == null ? void 0 : o.scene;
|
|
1450
1444
|
if (i == null)
|
|
1451
|
-
return;
|
|
1452
|
-
const s = this.
|
|
1445
|
+
return !0;
|
|
1446
|
+
const s = this._searchCropObject(i);
|
|
1453
1447
|
if (s == null)
|
|
1454
1448
|
return;
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1449
|
+
const l = this._getApplyObjectByCropObject(s);
|
|
1450
|
+
if (l == null)
|
|
1451
|
+
return;
|
|
1452
|
+
const g = i.getTransformerByCreate();
|
|
1453
|
+
g.detachFrom(s), g.clearCopperControl();
|
|
1454
|
+
const u = this._getSrcRectByTransformState(l, s), d = this._drawingManagerService.getDrawingOKey(l.oKey);
|
|
1455
|
+
if (d != null) {
|
|
1456
|
+
const { left: h, top: f, height: v, width: w } = s;
|
|
1460
1457
|
this._drawingManagerService.featurePluginUpdateNotification([{
|
|
1461
|
-
...
|
|
1458
|
+
...d,
|
|
1462
1459
|
transform: {
|
|
1463
|
-
...
|
|
1464
|
-
left:
|
|
1465
|
-
top:
|
|
1466
|
-
height:
|
|
1467
|
-
width:
|
|
1460
|
+
...d.transform,
|
|
1461
|
+
left: h,
|
|
1462
|
+
top: f,
|
|
1463
|
+
height: v,
|
|
1464
|
+
width: w
|
|
1468
1465
|
},
|
|
1469
|
-
srcRect:
|
|
1466
|
+
srcRect: u.srcRectAngle
|
|
1470
1467
|
}]);
|
|
1471
1468
|
}
|
|
1472
|
-
|
|
1469
|
+
l.setSrcRect({ ...u.srcRectAngle }), l.closeRenderByCropper(), l.makeDirty(!0), s == null || s.dispose();
|
|
1473
1470
|
})
|
|
1474
1471
|
);
|
|
1472
|
+
const n = this._univerInstanceService.getCurrentTypeOfUnit$(Re.UNIVER_SHEET).pipe(
|
|
1473
|
+
kt((e) => !!e),
|
|
1474
|
+
zt((e) => e.activeSheet$)
|
|
1475
|
+
);
|
|
1476
|
+
this.disposeWithMe(n.subscribe(() => {
|
|
1477
|
+
this._commandService.syncExecuteCommand(oe.id);
|
|
1478
|
+
}));
|
|
1475
1479
|
}
|
|
1476
1480
|
_getApplyObjectByCropObject(n) {
|
|
1477
1481
|
const e = n.oKey, t = e.slice(0, e.length - 5), r = n.getScene().getObject(t);
|
|
@@ -1481,94 +1485,84 @@ let Ne = class extends Ue {
|
|
|
1481
1485
|
const e = n.getTransformerByCreate();
|
|
1482
1486
|
let t = null;
|
|
1483
1487
|
this.disposeWithMe(
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
})
|
|
1492
|
-
)
|
|
1488
|
+
e.changeStart$.subscribe((r) => {
|
|
1489
|
+
const { objects: o } = r, i = o.values().next().value;
|
|
1490
|
+
if (i == null || !(i instanceof Ee))
|
|
1491
|
+
return;
|
|
1492
|
+
const { left: s, top: l, height: g, width: u, angle: d } = i;
|
|
1493
|
+
t = { left: s, top: l, height: g, width: u, angle: d }, e.clearCopperControl();
|
|
1494
|
+
})
|
|
1493
1495
|
), this.disposeWithMe(
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
})
|
|
1508
|
-
)
|
|
1496
|
+
e.changeEnd$.subscribe((r) => {
|
|
1497
|
+
const { objects: o } = r, i = o.values().next().value;
|
|
1498
|
+
if (i == null || !(i instanceof Ee))
|
|
1499
|
+
return;
|
|
1500
|
+
const { left: s, top: l, height: g, width: u, angle: d } = i;
|
|
1501
|
+
if (!at({ left: s, top: l, height: g, width: u, angle: d }, t))
|
|
1502
|
+
return;
|
|
1503
|
+
const h = this._getApplyObjectByCropObject(i);
|
|
1504
|
+
if (h == null)
|
|
1505
|
+
return;
|
|
1506
|
+
const f = this._getSrcRectByTransformState(h, i);
|
|
1507
|
+
i.refreshSrcRect(f.srcRect, h.getState()), e.createControlForCopper(i);
|
|
1508
|
+
})
|
|
1509
1509
|
), this._endCropListener(n);
|
|
1510
1510
|
}
|
|
1511
1511
|
_addHoverForImageCopper(n) {
|
|
1512
1512
|
this.disposeWithMe(
|
|
1513
|
-
|
|
1514
|
-
n.
|
|
1515
|
-
|
|
1516
|
-
})
|
|
1517
|
-
)
|
|
1513
|
+
n.onPointerEnter$.subscribeEvent(() => {
|
|
1514
|
+
n.cursor = Te.MOVE;
|
|
1515
|
+
})
|
|
1518
1516
|
), this.disposeWithMe(
|
|
1519
|
-
|
|
1520
|
-
n.
|
|
1521
|
-
|
|
1522
|
-
})
|
|
1523
|
-
)
|
|
1517
|
+
n.onPointerLeave$.subscribeEvent(() => {
|
|
1518
|
+
n.cursor = Te.DEFAULT;
|
|
1519
|
+
})
|
|
1524
1520
|
);
|
|
1525
1521
|
}
|
|
1526
1522
|
_endCropListener(n) {
|
|
1527
1523
|
const e = n.getTransformerByCreate();
|
|
1528
1524
|
this.disposeWithMe(
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
})
|
|
1533
|
-
)
|
|
1525
|
+
e.clearControl$.subscribe((t) => {
|
|
1526
|
+
t === !0 && this._commandService.syncExecuteCommand(oe.id);
|
|
1527
|
+
})
|
|
1534
1528
|
);
|
|
1535
1529
|
}
|
|
1536
1530
|
_getSrcRectByTransformState(n, e) {
|
|
1537
|
-
const { left: t, top: r, height: o, width: i, strokeWidth: s, angle:
|
|
1531
|
+
const { left: t, top: r, height: o, width: i, strokeWidth: s, angle: l } = e, { left: g, top: u, width: d, height: h, angle: f, strokeWidth: v } = n, w = t - g, p = r - u, E = {
|
|
1538
1532
|
left: w,
|
|
1539
1533
|
top: p,
|
|
1540
1534
|
right: d - w - i,
|
|
1541
1535
|
bottom: h - p - o
|
|
1542
|
-
}, _ = { ...
|
|
1536
|
+
}, _ = { ...E };
|
|
1543
1537
|
if (f !== 0) {
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1548
|
-
const
|
|
1549
|
-
_.left =
|
|
1538
|
+
const M = t + i / 2, S = r + o / 2, R = new xe(M, S), b = d / 2 + g, y = h / 2 + u, I = new xe(b, y), P = new xe(g, u);
|
|
1539
|
+
P.rotateByPoint(Je(f), I);
|
|
1540
|
+
const N = P.clone();
|
|
1541
|
+
N.rotateByPoint(Je(-f), R);
|
|
1542
|
+
const B = t - N.x, D = r - N.y;
|
|
1543
|
+
_.left = B, _.top = D, _.right = d - B - i, _.bottom = h - D - o;
|
|
1550
1544
|
}
|
|
1551
1545
|
return {
|
|
1552
|
-
srcRect:
|
|
1546
|
+
srcRect: E,
|
|
1553
1547
|
srcRectAngle: _
|
|
1554
1548
|
};
|
|
1555
1549
|
}
|
|
1556
1550
|
};
|
|
1557
|
-
Ne =
|
|
1551
|
+
Ne = Kn([
|
|
1558
1552
|
He(Le.Rendered, Ne),
|
|
1559
|
-
me(0,
|
|
1560
|
-
me(1,
|
|
1561
|
-
me(2,
|
|
1562
|
-
me(3,
|
|
1553
|
+
me(0, ce),
|
|
1554
|
+
me(1, ne),
|
|
1555
|
+
me(2, ge),
|
|
1556
|
+
me(3, Fe),
|
|
1563
1557
|
me(4, Wt),
|
|
1564
|
-
me(5, se(
|
|
1558
|
+
me(5, se(Z))
|
|
1565
1559
|
], Ne);
|
|
1566
|
-
var
|
|
1567
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1560
|
+
var Zn = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, Xn = (a, n, e, t) => {
|
|
1561
|
+
for (var r = t > 1 ? void 0 : t ? Yn(n, e) : n, o = a.length - 1, i; o >= 0; o--)
|
|
1568
1562
|
(i = a[o]) && (r = (t ? i(n, e, r) : i(r)) || r);
|
|
1569
|
-
return t && r &&
|
|
1570
|
-
},
|
|
1571
|
-
const
|
|
1563
|
+
return t && r && Zn(n, e, r), r;
|
|
1564
|
+
}, ae = (a, n) => (e, t) => n(e, t, a);
|
|
1565
|
+
const et = 50;
|
|
1572
1566
|
let De = class extends Ue {
|
|
1573
1567
|
constructor(a, n, e, t, r, o, i) {
|
|
1574
1568
|
super(), this._commandService = a, this._renderManagerService = n, this._drawingManagerService = e, this._dialogService = t, this._imageIoService = r, this._currentUniverService = o, this._drawingRenderService = i, this._initialize();
|
|
@@ -1580,7 +1574,7 @@ let De = class extends Ue {
|
|
|
1580
1574
|
this._recoveryImages(), this._drawingAddListener(), this._commandExecutedListener(), this._imageUpdateListener();
|
|
1581
1575
|
}
|
|
1582
1576
|
_recoveryImages() {
|
|
1583
|
-
const a = this._drawingManagerService.drawingManagerData, n =
|
|
1577
|
+
const a = this._drawingManagerService.drawingManagerData, n = $e(this._currentUniverService);
|
|
1584
1578
|
if (n == null)
|
|
1585
1579
|
return;
|
|
1586
1580
|
const { unitId: e, subUnitId: t } = n;
|
|
@@ -1596,7 +1590,7 @@ let De = class extends Ue {
|
|
|
1596
1590
|
_commandExecutedListener() {
|
|
1597
1591
|
this.disposeWithMe(
|
|
1598
1592
|
this._commandService.onCommandExecuted((a) => {
|
|
1599
|
-
if (a.id ===
|
|
1593
|
+
if (a.id === vt.id) {
|
|
1600
1594
|
const n = a.params;
|
|
1601
1595
|
if (n == null)
|
|
1602
1596
|
return;
|
|
@@ -1620,17 +1614,17 @@ let De = class extends Ue {
|
|
|
1620
1614
|
const { unitId: r, subUnitId: o, drawingId: i } = t, s = this._getSceneAndTransformerByDrawingSearch(r);
|
|
1621
1615
|
if (s == null)
|
|
1622
1616
|
return;
|
|
1623
|
-
const { scene:
|
|
1617
|
+
const { scene: l, transformer: g } = s, u = G({ unitId: r, subUnitId: o, drawingId: i }), d = l.getObject(u);
|
|
1624
1618
|
if (d == null)
|
|
1625
1619
|
return !0;
|
|
1626
1620
|
const h = this._drawingManagerService.getDrawingByParam(t);
|
|
1627
1621
|
if (h == null)
|
|
1628
1622
|
return !0;
|
|
1629
|
-
if (h.drawingType !==
|
|
1623
|
+
if (h.drawingType !== te.DRAWING_IMAGE)
|
|
1630
1624
|
return;
|
|
1631
1625
|
d.resetSize();
|
|
1632
1626
|
const { width: f, height: v } = d.getNativeSize();
|
|
1633
|
-
e.includes(
|
|
1627
|
+
e.includes(l) === !1 && e.push(l), n.push({
|
|
1634
1628
|
...h,
|
|
1635
1629
|
transform: {
|
|
1636
1630
|
...h.transform,
|
|
@@ -1654,14 +1648,15 @@ let De = class extends Ue {
|
|
|
1654
1648
|
}
|
|
1655
1649
|
_insertImages(a) {
|
|
1656
1650
|
a.forEach(async (n) => {
|
|
1657
|
-
|
|
1658
|
-
|
|
1651
|
+
var g;
|
|
1652
|
+
const { unitId: e, subUnitId: t, drawingId: r } = n, o = this._getSceneAndTransformerByDrawingSearch(e), i = (g = $e(this._currentUniverService)) == null ? void 0 : g.subUnitId;
|
|
1653
|
+
if (o == null || i !== t)
|
|
1659
1654
|
return;
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1655
|
+
const s = this._drawingManagerService.getDrawingByParam(n);
|
|
1656
|
+
if (s == null)
|
|
1662
1657
|
return;
|
|
1663
|
-
const
|
|
1664
|
-
|
|
1658
|
+
const l = await this._drawingRenderService.renderImage(s, o.scene);
|
|
1659
|
+
l && (this._addHoverForImage(l), this._addDialogForImage(l));
|
|
1665
1660
|
});
|
|
1666
1661
|
}
|
|
1667
1662
|
_imageUpdateListener() {
|
|
@@ -1671,8 +1666,8 @@ let De = class extends Ue {
|
|
|
1671
1666
|
const { unitId: e, subUnitId: t, drawingId: r } = n, o = this._drawingManagerService.getDrawingByParam(n);
|
|
1672
1667
|
if (o == null)
|
|
1673
1668
|
return;
|
|
1674
|
-
const { transform: i, drawingType: s, srcRect:
|
|
1675
|
-
if (s !==
|
|
1669
|
+
const { transform: i, drawingType: s, srcRect: l, prstGeom: g, source: u, imageSourceType: d } = o;
|
|
1670
|
+
if (s !== te.DRAWING_IMAGE)
|
|
1676
1671
|
return;
|
|
1677
1672
|
const h = this._getSceneAndTransformerByDrawingSearch(e);
|
|
1678
1673
|
if (h == null)
|
|
@@ -1680,24 +1675,24 @@ let De = class extends Ue {
|
|
|
1680
1675
|
const { scene: f, transformer: v } = h;
|
|
1681
1676
|
if (i == null)
|
|
1682
1677
|
return !0;
|
|
1683
|
-
const w =
|
|
1678
|
+
const w = G({ unitId: e, subUnitId: t, drawingId: r }), p = f.getObject(w);
|
|
1684
1679
|
if (p == null)
|
|
1685
1680
|
return !0;
|
|
1686
|
-
p.setSrcRect(
|
|
1681
|
+
p.setSrcRect(l), p.setPrstGeom(g);
|
|
1687
1682
|
});
|
|
1688
1683
|
})
|
|
1689
1684
|
);
|
|
1690
1685
|
}
|
|
1691
1686
|
_addHoverForImage(a) {
|
|
1692
1687
|
this.disposeWithMe(
|
|
1693
|
-
|
|
1694
|
-
a.
|
|
1688
|
+
Ce(
|
|
1689
|
+
a.onPointerEnter$.subscribeEvent(() => {
|
|
1695
1690
|
a.cursor = Te.GRAB;
|
|
1696
1691
|
})
|
|
1697
1692
|
)
|
|
1698
1693
|
), this.disposeWithMe(
|
|
1699
|
-
|
|
1700
|
-
a.
|
|
1694
|
+
Ce(
|
|
1695
|
+
a.onPointerLeave$.subscribeEvent(() => {
|
|
1701
1696
|
a.cursor = Te.DEFAULT;
|
|
1702
1697
|
})
|
|
1703
1698
|
)
|
|
@@ -1705,16 +1700,16 @@ let De = class extends Ue {
|
|
|
1705
1700
|
}
|
|
1706
1701
|
_addDialogForImage(a) {
|
|
1707
1702
|
this.disposeWithMe(
|
|
1708
|
-
|
|
1709
|
-
a.
|
|
1703
|
+
Ce(
|
|
1704
|
+
a.onDblclick$.subscribeEvent(() => {
|
|
1710
1705
|
var s;
|
|
1711
|
-
const n = `${a.oKey}-viewer-dialog`, e = a.getNativeSize(), t = window.innerWidth -
|
|
1706
|
+
const n = `${a.oKey}-viewer-dialog`, e = a.getNativeSize(), t = window.innerWidth - et, r = window.innerHeight - et, o = this._adjustImageSize(e.width, e.height, t, r), i = this._dialogService.open({
|
|
1712
1707
|
width: o.width,
|
|
1713
1708
|
id: n,
|
|
1714
1709
|
style: { margin: "0", top: "50%", left: "50%", transform: "translate(-50%, -50%)" },
|
|
1715
1710
|
children: {
|
|
1716
1711
|
label: {
|
|
1717
|
-
name:
|
|
1712
|
+
name: wt,
|
|
1718
1713
|
props: {
|
|
1719
1714
|
src: (s = a.getNative()) == null ? void 0 : s.src,
|
|
1720
1715
|
width: o.width,
|
|
@@ -1745,24 +1740,24 @@ let De = class extends Ue {
|
|
|
1745
1740
|
};
|
|
1746
1741
|
}
|
|
1747
1742
|
};
|
|
1748
|
-
De =
|
|
1743
|
+
De = Xn([
|
|
1749
1744
|
He(Le.Rendered, De),
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1745
|
+
ae(0, ce),
|
|
1746
|
+
ae(1, ge),
|
|
1747
|
+
ae(2, ne),
|
|
1748
|
+
ae(3, $t),
|
|
1749
|
+
ae(4, rt),
|
|
1750
|
+
ae(5, Fe),
|
|
1751
|
+
ae(6, se(Be))
|
|
1757
1752
|
], De);
|
|
1758
|
-
var
|
|
1759
|
-
for (var r = t > 1 ? void 0 : t ?
|
|
1753
|
+
var Jn = Object.defineProperty, qn = Object.getOwnPropertyDescriptor, Qn = (a, n, e, t) => {
|
|
1754
|
+
for (var r = t > 1 ? void 0 : t ? qn(n, e) : n, o = a.length - 1, i; o >= 0; o--)
|
|
1760
1755
|
(i = a[o]) && (r = (t ? i(n, e, r) : i(r)) || r);
|
|
1761
|
-
return t && r &&
|
|
1762
|
-
},
|
|
1763
|
-
const
|
|
1756
|
+
return t && r && Jn(n, e, r), r;
|
|
1757
|
+
}, tt = (a, n) => (e, t) => n(e, t, a);
|
|
1758
|
+
const er = "DRAWING_UI_PLUGIN";
|
|
1764
1759
|
var Ge;
|
|
1765
|
-
let
|
|
1760
|
+
let nt = (Ge = class extends Lt {
|
|
1766
1761
|
constructor(a, n, e) {
|
|
1767
1762
|
super(), this._injector = n, this._localeService = e;
|
|
1768
1763
|
}
|
|
@@ -1780,20 +1775,22 @@ let tt = (Ge = class extends Lt {
|
|
|
1780
1775
|
[De]
|
|
1781
1776
|
].forEach((e) => a.add(e));
|
|
1782
1777
|
}
|
|
1783
|
-
},
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
],
|
|
1778
|
+
}, Q(Ge, "pluginName", er), Ge);
|
|
1779
|
+
nt = Qn([
|
|
1780
|
+
tt(1, se(st)),
|
|
1781
|
+
tt(2, se(Z))
|
|
1782
|
+
], nt);
|
|
1788
1783
|
export {
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1784
|
+
je as AutoImageCropOperation,
|
|
1785
|
+
Ln as COMPONENT_IMAGE_POPUP_MENU,
|
|
1786
|
+
oe as CloseImageCropOperation,
|
|
1787
|
+
ur as DrawingCommonPanel,
|
|
1792
1788
|
Be as DrawingRenderService,
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1789
|
+
Ee as ImageCropperObject,
|
|
1790
|
+
Hn as ImagePopupMenu,
|
|
1791
|
+
vt as ImageResetSizeOperation,
|
|
1796
1792
|
ke as OpenImageCropOperation,
|
|
1797
|
-
|
|
1798
|
-
|
|
1793
|
+
Ke as SetDrawingAlignOperation,
|
|
1794
|
+
nt as UniverDrawingUIPlugin,
|
|
1795
|
+
Ae as getUpdateParams
|
|
1799
1796
|
};
|