@nightshadeui/canvas 2.12.5 → 2.13.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/dist/CanvasBoxSelect.d.ts +2 -1
- package/dist/CanvasBoxSelect.d.ts.map +1 -0
- package/dist/CanvasConfig.d.ts +9 -0
- package/dist/CanvasConfig.d.ts.map +1 -0
- package/dist/CanvasController.d.ts +4 -4
- package/dist/CanvasController.d.ts.map +1 -0
- package/dist/CanvasEvents.d.ts +1 -0
- package/dist/CanvasEvents.d.ts.map +1 -0
- package/dist/CanvasMove.d.ts +1 -0
- package/dist/CanvasMove.d.ts.map +1 -0
- package/dist/CanvasObjectController.d.ts +2 -1
- package/dist/CanvasObjectController.d.ts.map +1 -0
- package/dist/CanvasObjectRegistry.d.ts +1 -0
- package/dist/CanvasObjectRegistry.d.ts.map +1 -0
- package/dist/CanvasPan.d.ts +1 -0
- package/dist/CanvasPan.d.ts.map +1 -0
- package/dist/CanvasSelection.d.ts +1 -0
- package/dist/CanvasSelection.d.ts.map +1 -0
- package/dist/CanvasSpace.d.ts +2 -1
- package/dist/CanvasSpace.d.ts.map +1 -0
- package/dist/CanvasViewport.d.ts +2 -1
- package/dist/CanvasViewport.d.ts.map +1 -0
- package/dist/CanvasZoom.d.ts +1 -0
- package/dist/CanvasZoom.d.ts.map +1 -0
- package/dist/canvas.css +1 -1
- package/dist/canvas.mjs +893 -919
- package/dist/components/CanvasBoxSelect.vue.d.ts +1 -0
- package/dist/components/CanvasBoxSelect.vue.d.ts.map +1 -0
- package/dist/components/CanvasDebugCoords.vue.d.ts +1 -0
- package/dist/components/CanvasDebugCoords.vue.d.ts.map +1 -0
- package/dist/components/CanvasObject.vue.d.ts +1 -0
- package/dist/components/CanvasObject.vue.d.ts.map +1 -0
- package/dist/components/CanvasObjectResize.vue.d.ts +1 -0
- package/dist/components/CanvasObjectResize.vue.d.ts.map +1 -0
- package/dist/components/CanvasView.vue.d.ts +1 -0
- package/dist/components/CanvasView.vue.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +2 -2
- package/dist/CanvasInputState.d.ts +0 -23
- package/dist/CanvasUiEvents.d.ts +0 -18
package/dist/canvas.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { openBlock as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (const [n,
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
},
|
|
1
|
+
import { openBlock as U, createElementBlock as q, createElementVNode as C, normalizeStyle as Z, createCommentVNode as Oe, resolveComponent as ot, createBlock as Nt, withCtx as G, createVNode as F, toDisplayString as X, withModifiers as B, normalizeClass as Pe, renderSlot as it, normalizeProps as je, guardReactiveProps as Ce, Fragment as _e, renderList as Ee, reactive as Ie } from "vue";
|
|
2
|
+
const tt = (r, t) => {
|
|
3
|
+
const e = r.__vccOpts || r;
|
|
4
|
+
for (const [n, o] of t)
|
|
5
|
+
e[n] = o;
|
|
6
|
+
return e;
|
|
7
|
+
}, Te = {
|
|
8
8
|
props: {
|
|
9
9
|
canvas: { type: Object, required: !0 }
|
|
10
10
|
}
|
|
11
|
-
},
|
|
11
|
+
}, ze = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "CanvasBoxSelect"
|
|
14
14
|
};
|
|
15
|
-
function
|
|
16
|
-
return
|
|
17
|
-
|
|
15
|
+
function De(r, t, e, n, o, l) {
|
|
16
|
+
return e.canvas.boxSelect.isSelecting() ? (U(), q("div", ze, [
|
|
17
|
+
C("div", {
|
|
18
18
|
class: "Box",
|
|
19
|
-
style: Z(
|
|
19
|
+
style: Z(e.canvas.boxSelect.getSelectionStyle())
|
|
20
20
|
}, null, 4)
|
|
21
|
-
])) :
|
|
21
|
+
])) : Oe("", !0);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const Re = /* @__PURE__ */ tt(Te, [["render", De], ["__scopeId", "data-v-9e8905e1"]]), ke = {
|
|
24
24
|
props: {
|
|
25
25
|
canvas: { type: Object, required: !0 }
|
|
26
26
|
},
|
|
27
27
|
computed: {
|
|
28
28
|
pagePos() {
|
|
29
|
-
return this.canvas.
|
|
29
|
+
return this.canvas.inputStateManager.lastMousePos;
|
|
30
30
|
},
|
|
31
31
|
viewportPos() {
|
|
32
32
|
return this.canvas.space.pageToViewport(this.pagePos);
|
|
@@ -39,50 +39,50 @@ const kt = /* @__PURE__ */ te(zt, [["render", Rt], ["__scopeId", "data-v-9e8905e
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
methods: {
|
|
42
|
-
format(
|
|
43
|
-
return `(${
|
|
42
|
+
format(r) {
|
|
43
|
+
return `(${r.x.toFixed(2)}, ${r.y.toFixed(2)})`;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
return
|
|
47
|
+
function Be(r, t, e, n, o, l) {
|
|
48
|
+
const g = ot("HGroup"), p = ot("VGroup");
|
|
49
|
+
return U(), Nt(p, {
|
|
50
50
|
class: "CanvasDebugCoords",
|
|
51
51
|
gap: "s"
|
|
52
52
|
}, {
|
|
53
53
|
default: G(() => [
|
|
54
|
-
|
|
54
|
+
F(g, { class: "Row" }, {
|
|
55
55
|
default: G(() => [
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
t[0] || (t[0] = C("strong", null, "page", -1)),
|
|
57
|
+
C("span", null, X(l.format(l.pagePos)), 1)
|
|
58
58
|
]),
|
|
59
59
|
_: 1
|
|
60
60
|
}),
|
|
61
|
-
|
|
61
|
+
F(g, { class: "Row" }, {
|
|
62
62
|
default: G(() => [
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
t[1] || (t[1] = C("strong", null, "viewport", -1)),
|
|
64
|
+
C("span", null, X(l.format(l.viewportPos)), 1)
|
|
65
65
|
]),
|
|
66
66
|
_: 1
|
|
67
67
|
}),
|
|
68
|
-
|
|
68
|
+
F(g, { class: "Row" }, {
|
|
69
69
|
default: G(() => [
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
t[2] || (t[2] = C("strong", null, "canvas", -1)),
|
|
71
|
+
C("span", null, X(l.format(l.canvasPos)), 1)
|
|
72
72
|
]),
|
|
73
73
|
_: 1
|
|
74
74
|
}),
|
|
75
|
-
|
|
75
|
+
F(g, { class: "Row" }, {
|
|
76
76
|
default: G(() => [
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
t[3] || (t[3] = C("strong", null, "local", -1)),
|
|
78
|
+
C("span", null, X(l.format(l.localPos)), 1)
|
|
79
79
|
]),
|
|
80
80
|
_: 1
|
|
81
81
|
}),
|
|
82
|
-
|
|
82
|
+
F(g, { class: "Row" }, {
|
|
83
83
|
default: G(() => [
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
t[4] || (t[4] = C("strong", null, "zoom", -1)),
|
|
85
|
+
C("span", null, X(e.canvas.space.zoom.toFixed(2)), 1)
|
|
86
86
|
]),
|
|
87
87
|
_: 1
|
|
88
88
|
})
|
|
@@ -90,307 +90,299 @@ function Ut(o, e, t, n, r, c) {
|
|
|
90
90
|
_: 1
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
function z(
|
|
95
|
-
return Math.max(
|
|
93
|
+
const gs = /* @__PURE__ */ tt(ke, [["render", Be], ["__scopeId", "data-v-871d7c0c"]]);
|
|
94
|
+
function z(r, t, e) {
|
|
95
|
+
return Math.max(t, Math.min(e, r));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function Yt(r, t) {
|
|
98
98
|
return {
|
|
99
|
-
x:
|
|
100
|
-
y:
|
|
99
|
+
x: r.x - t.x,
|
|
100
|
+
y: r.y - t.y
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const t
|
|
105
|
-
return [t, n];
|
|
106
|
-
}
|
|
107
|
-
function Le(o, e) {
|
|
108
|
-
const t = o[1].x >= e[0].x && e[1].x >= o[0].x, n = o[1].y >= e[0].y && e[1].y >= o[0].y;
|
|
109
|
-
return t && n;
|
|
110
|
-
}
|
|
111
|
-
function Vt(o) {
|
|
112
|
-
const [e, t] = o;
|
|
103
|
+
function Ue(r) {
|
|
104
|
+
const [t, e] = r;
|
|
113
105
|
return {
|
|
114
|
-
x: (
|
|
115
|
-
y: (
|
|
106
|
+
x: (e.x - t.x) * 0.5 + t.x,
|
|
107
|
+
y: (e.y - t.y) * 0.5 + t.y
|
|
116
108
|
};
|
|
117
109
|
}
|
|
118
|
-
function
|
|
119
|
-
const n =
|
|
120
|
-
return getComputedStyle(n).getPropertyValue(
|
|
110
|
+
function Ht(r, t, e) {
|
|
111
|
+
const n = r ?? document.documentElement;
|
|
112
|
+
return getComputedStyle(n).getPropertyValue(t).trim() || e;
|
|
121
113
|
}
|
|
122
|
-
function W(
|
|
123
|
-
const n =
|
|
124
|
-
return Number.isFinite(
|
|
114
|
+
function W(r, t, e) {
|
|
115
|
+
const n = Ht(r, t, String(e)), o = Number(n.replace(/px|em|%|vh|vw/g, ""));
|
|
116
|
+
return Number.isFinite(o) ? o : e;
|
|
125
117
|
}
|
|
126
|
-
function
|
|
127
|
-
const n =
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
return
|
|
118
|
+
function Bt(r, t, e) {
|
|
119
|
+
const n = r ?? document.documentElement, o = Ht(r, t, e), l = document.createElement("span");
|
|
120
|
+
l.style.position = "absolute", l.style.visibility = "hidden", l.style.pointerEvents = "none", l.style.color = e, l.style.color = o, n.appendChild(l);
|
|
121
|
+
const g = getComputedStyle(l).color.trim();
|
|
122
|
+
return l.remove(), g || e;
|
|
131
123
|
}
|
|
132
|
-
class
|
|
133
|
-
constructor(
|
|
134
|
-
this.target =
|
|
124
|
+
let Xt = class {
|
|
125
|
+
constructor(t) {
|
|
126
|
+
this.target = t, this.entries = [];
|
|
135
127
|
}
|
|
136
|
-
add(
|
|
137
|
-
this.target.addEventListener(
|
|
128
|
+
add(t, e, n) {
|
|
129
|
+
this.target.addEventListener(t, e, n), this.entries.push({ type: t, listener: e, options: n });
|
|
138
130
|
}
|
|
139
131
|
removeAll() {
|
|
140
|
-
for (const
|
|
141
|
-
this.target.removeEventListener(
|
|
132
|
+
for (const t of this.entries)
|
|
133
|
+
this.target.removeEventListener(t.type, t.listener, t.options);
|
|
142
134
|
this.entries = [];
|
|
143
135
|
}
|
|
144
|
-
}
|
|
145
|
-
function
|
|
146
|
-
const
|
|
136
|
+
};
|
|
137
|
+
function Ve(r, t, e, n = 2, o, l = 1) {
|
|
138
|
+
const g = [0, ...Le(r, t), r], p = [0, r], S = [
|
|
147
139
|
`<svg xmlns="http://www.w3.org/2000/svg"
|
|
148
|
-
width="${
|
|
149
|
-
height="${
|
|
150
|
-
viewBox="0 0 ${
|
|
140
|
+
width="${r}"
|
|
141
|
+
height="${r}"
|
|
142
|
+
viewBox="0 0 ${r} ${r}">`
|
|
151
143
|
];
|
|
152
|
-
if (
|
|
153
|
-
for (const
|
|
154
|
-
for (const E of
|
|
144
|
+
if (l)
|
|
145
|
+
for (const _ of g)
|
|
146
|
+
for (const E of g)
|
|
155
147
|
S.push(
|
|
156
|
-
`<circle cx="${
|
|
148
|
+
`<circle cx="${_}" cy="${E}" r="${l}" fill="${o}"/>`
|
|
157
149
|
);
|
|
158
150
|
if (n)
|
|
159
|
-
for (const
|
|
160
|
-
for (const E of
|
|
151
|
+
for (const _ of p)
|
|
152
|
+
for (const E of p)
|
|
161
153
|
S.push(
|
|
162
|
-
`<circle cx="${
|
|
154
|
+
`<circle cx="${_}" cy="${E}" r="${n}" fill="${e}"/>`
|
|
163
155
|
);
|
|
164
156
|
return S.push("</svg>"), S.join("");
|
|
165
157
|
}
|
|
166
|
-
function
|
|
167
|
-
const
|
|
168
|
-
for (let
|
|
169
|
-
|
|
170
|
-
return
|
|
158
|
+
function Le(r, t) {
|
|
159
|
+
const e = [], n = Math.round(r / t);
|
|
160
|
+
for (let o = 1; o < t; o++)
|
|
161
|
+
e.push(n * o);
|
|
162
|
+
return e;
|
|
171
163
|
}
|
|
172
|
-
var
|
|
173
|
-
var
|
|
174
|
-
function
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
var
|
|
178
|
-
return (function(
|
|
179
|
-
(function(
|
|
180
|
-
var n = typeof globalThis == "object" ? globalThis : typeof
|
|
181
|
-
typeof n.Reflect < "u" && (
|
|
182
|
-
function
|
|
164
|
+
var Ut = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Vt = {};
|
|
165
|
+
var Lt;
|
|
166
|
+
function Ae() {
|
|
167
|
+
if (Lt) return Vt;
|
|
168
|
+
Lt = 1;
|
|
169
|
+
var r;
|
|
170
|
+
return (function(t) {
|
|
171
|
+
(function(e) {
|
|
172
|
+
var n = typeof globalThis == "object" ? globalThis : typeof Ut == "object" ? Ut : typeof self == "object" ? self : typeof this == "object" ? this : S(), o = l(t);
|
|
173
|
+
typeof n.Reflect < "u" && (o = l(n.Reflect, o)), e(o, n), typeof n.Reflect > "u" && (n.Reflect = t);
|
|
174
|
+
function l(_, E) {
|
|
183
175
|
return function(R, N) {
|
|
184
|
-
Object.defineProperty(
|
|
176
|
+
Object.defineProperty(_, R, { configurable: !0, writable: !0, value: N }), E && E(R, N);
|
|
185
177
|
};
|
|
186
178
|
}
|
|
187
|
-
function
|
|
179
|
+
function g() {
|
|
188
180
|
try {
|
|
189
181
|
return Function("return this;")();
|
|
190
182
|
} catch {
|
|
191
183
|
}
|
|
192
184
|
}
|
|
193
|
-
function
|
|
185
|
+
function p() {
|
|
194
186
|
try {
|
|
195
187
|
return (0, eval)("(function() { return this; })()");
|
|
196
188
|
} catch {
|
|
197
189
|
}
|
|
198
190
|
}
|
|
199
191
|
function S() {
|
|
200
|
-
return
|
|
192
|
+
return g() || p();
|
|
201
193
|
}
|
|
202
|
-
})(function(
|
|
203
|
-
var
|
|
194
|
+
})(function(e, n) {
|
|
195
|
+
var o = Object.prototype.hasOwnProperty, l = typeof Symbol == "function", g = l && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", p = l && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", S = typeof Object.create == "function", _ = { __proto__: [] } instanceof Array, E = !S && !_, R = {
|
|
204
196
|
// create an object in dictionary mode (a.k.a. "slow" mode in v8)
|
|
205
197
|
create: S ? function() {
|
|
206
|
-
return
|
|
207
|
-
} :
|
|
208
|
-
return
|
|
198
|
+
return pt(/* @__PURE__ */ Object.create(null));
|
|
199
|
+
} : _ ? function() {
|
|
200
|
+
return pt({ __proto__: null });
|
|
209
201
|
} : function() {
|
|
210
|
-
return
|
|
202
|
+
return pt({});
|
|
211
203
|
},
|
|
212
204
|
has: E ? function(s, i) {
|
|
213
|
-
return
|
|
205
|
+
return o.call(s, i);
|
|
214
206
|
} : function(s, i) {
|
|
215
207
|
return i in s;
|
|
216
208
|
},
|
|
217
209
|
get: E ? function(s, i) {
|
|
218
|
-
return
|
|
210
|
+
return o.call(s, i) ? s[i] : void 0;
|
|
219
211
|
} : function(s, i) {
|
|
220
212
|
return s[i];
|
|
221
213
|
}
|
|
222
|
-
}, N = Object.getPrototypeOf(Function), Y = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map :
|
|
223
|
-
function
|
|
224
|
-
if (
|
|
225
|
-
if (!
|
|
214
|
+
}, N = Object.getPrototypeOf(Function), Y = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : me(), ut = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : be(), ht = typeof WeakMap == "function" ? WeakMap : xe(), L = l ? /* @__PURE__ */ Symbol.for("@reflect-metadata:registry") : void 0, et = ye(), mt = ge(et);
|
|
215
|
+
function Jt(s, i, a, c) {
|
|
216
|
+
if (y(a)) {
|
|
217
|
+
if (!_t(s))
|
|
226
218
|
throw new TypeError();
|
|
227
|
-
if (!
|
|
219
|
+
if (!Et(i))
|
|
228
220
|
throw new TypeError();
|
|
229
|
-
return
|
|
221
|
+
return ce(s, i);
|
|
230
222
|
} else {
|
|
231
|
-
if (!
|
|
223
|
+
if (!_t(s))
|
|
232
224
|
throw new TypeError();
|
|
233
225
|
if (!O(i))
|
|
234
226
|
throw new TypeError();
|
|
235
|
-
if (!O(
|
|
227
|
+
if (!O(c) && !y(c) && !A(c))
|
|
236
228
|
throw new TypeError();
|
|
237
|
-
return A(
|
|
229
|
+
return A(c) && (c = void 0), a = T(a), le(s, i, a, c);
|
|
238
230
|
}
|
|
239
231
|
}
|
|
240
|
-
|
|
241
|
-
function
|
|
242
|
-
function a(
|
|
243
|
-
if (!O(
|
|
232
|
+
e("decorate", Jt);
|
|
233
|
+
function Qt(s, i) {
|
|
234
|
+
function a(c, v) {
|
|
235
|
+
if (!O(c))
|
|
244
236
|
throw new TypeError();
|
|
245
|
-
if (!
|
|
237
|
+
if (!y(v) && !ve(v))
|
|
246
238
|
throw new TypeError();
|
|
247
|
-
|
|
239
|
+
Mt(s, i, c, v);
|
|
248
240
|
}
|
|
249
241
|
return a;
|
|
250
242
|
}
|
|
251
|
-
|
|
252
|
-
function
|
|
243
|
+
e("metadata", Qt);
|
|
244
|
+
function te(s, i, a, c) {
|
|
253
245
|
if (!O(a))
|
|
254
246
|
throw new TypeError();
|
|
255
|
-
return
|
|
247
|
+
return y(c) || (c = T(c)), Mt(s, i, a, c);
|
|
256
248
|
}
|
|
257
|
-
|
|
258
|
-
function
|
|
249
|
+
e("defineMetadata", te);
|
|
250
|
+
function ee(s, i, a) {
|
|
259
251
|
if (!O(i))
|
|
260
252
|
throw new TypeError();
|
|
261
|
-
return
|
|
253
|
+
return y(a) || (a = T(a)), bt(s, i, a);
|
|
262
254
|
}
|
|
263
|
-
|
|
264
|
-
function
|
|
255
|
+
e("hasMetadata", ee);
|
|
256
|
+
function se(s, i, a) {
|
|
265
257
|
if (!O(i))
|
|
266
258
|
throw new TypeError();
|
|
267
|
-
return
|
|
259
|
+
return y(a) || (a = T(a)), dt(s, i, a);
|
|
268
260
|
}
|
|
269
|
-
|
|
270
|
-
function
|
|
261
|
+
e("hasOwnMetadata", se);
|
|
262
|
+
function ne(s, i, a) {
|
|
271
263
|
if (!O(i))
|
|
272
264
|
throw new TypeError();
|
|
273
|
-
return
|
|
265
|
+
return y(a) || (a = T(a)), xt(s, i, a);
|
|
274
266
|
}
|
|
275
|
-
|
|
276
|
-
function
|
|
267
|
+
e("getMetadata", ne);
|
|
268
|
+
function ie(s, i, a) {
|
|
277
269
|
if (!O(i))
|
|
278
270
|
throw new TypeError();
|
|
279
|
-
return
|
|
271
|
+
return y(a) || (a = T(a)), St(s, i, a);
|
|
280
272
|
}
|
|
281
|
-
|
|
282
|
-
function
|
|
273
|
+
e("getOwnMetadata", ie);
|
|
274
|
+
function re(s, i) {
|
|
283
275
|
if (!O(s))
|
|
284
276
|
throw new TypeError();
|
|
285
|
-
return
|
|
277
|
+
return y(i) || (i = T(i)), Ot(s, i);
|
|
286
278
|
}
|
|
287
|
-
|
|
288
|
-
function
|
|
279
|
+
e("getMetadataKeys", re);
|
|
280
|
+
function oe(s, i) {
|
|
289
281
|
if (!O(s))
|
|
290
282
|
throw new TypeError();
|
|
291
|
-
return
|
|
283
|
+
return y(i) || (i = T(i)), Pt(s, i);
|
|
292
284
|
}
|
|
293
|
-
|
|
294
|
-
function
|
|
285
|
+
e("getOwnMetadataKeys", oe);
|
|
286
|
+
function ae(s, i, a) {
|
|
295
287
|
if (!O(i))
|
|
296
288
|
throw new TypeError();
|
|
297
|
-
if (
|
|
289
|
+
if (y(a) || (a = T(a)), !O(i))
|
|
298
290
|
throw new TypeError();
|
|
299
|
-
|
|
300
|
-
var
|
|
291
|
+
y(a) || (a = T(a));
|
|
292
|
+
var c = H(
|
|
301
293
|
i,
|
|
302
294
|
a,
|
|
303
295
|
/*Create*/
|
|
304
296
|
!1
|
|
305
297
|
);
|
|
306
|
-
return
|
|
298
|
+
return y(c) ? !1 : c.OrdinaryDeleteMetadata(s, i, a);
|
|
307
299
|
}
|
|
308
|
-
|
|
309
|
-
function
|
|
300
|
+
e("deleteMetadata", ae);
|
|
301
|
+
function ce(s, i) {
|
|
310
302
|
for (var a = s.length - 1; a >= 0; --a) {
|
|
311
|
-
var
|
|
312
|
-
if (!
|
|
313
|
-
if (!
|
|
303
|
+
var c = s[a], v = c(i);
|
|
304
|
+
if (!y(v) && !A(v)) {
|
|
305
|
+
if (!Et(v))
|
|
314
306
|
throw new TypeError();
|
|
315
307
|
i = v;
|
|
316
308
|
}
|
|
317
309
|
}
|
|
318
310
|
return i;
|
|
319
311
|
}
|
|
320
|
-
function
|
|
312
|
+
function le(s, i, a, c) {
|
|
321
313
|
for (var v = s.length - 1; v >= 0; --v) {
|
|
322
|
-
var
|
|
323
|
-
if (!
|
|
314
|
+
var j = s[v], P = j(i, a, c);
|
|
315
|
+
if (!y(P) && !A(P)) {
|
|
324
316
|
if (!O(P))
|
|
325
317
|
throw new TypeError();
|
|
326
|
-
|
|
318
|
+
c = P;
|
|
327
319
|
}
|
|
328
320
|
}
|
|
329
|
-
return
|
|
321
|
+
return c;
|
|
330
322
|
}
|
|
331
|
-
function
|
|
332
|
-
var
|
|
333
|
-
if (
|
|
323
|
+
function bt(s, i, a) {
|
|
324
|
+
var c = dt(s, i, a);
|
|
325
|
+
if (c)
|
|
334
326
|
return !0;
|
|
335
|
-
var v =
|
|
336
|
-
return A(v) ? !1 :
|
|
327
|
+
var v = vt(i);
|
|
328
|
+
return A(v) ? !1 : bt(s, v, a);
|
|
337
329
|
}
|
|
338
|
-
function
|
|
339
|
-
var
|
|
330
|
+
function dt(s, i, a) {
|
|
331
|
+
var c = H(
|
|
340
332
|
i,
|
|
341
333
|
a,
|
|
342
334
|
/*Create*/
|
|
343
335
|
!1
|
|
344
336
|
);
|
|
345
|
-
return
|
|
337
|
+
return y(c) ? !1 : Ct(c.OrdinaryHasOwnMetadata(s, i, a));
|
|
346
338
|
}
|
|
347
|
-
function
|
|
348
|
-
var
|
|
349
|
-
if (
|
|
350
|
-
return
|
|
351
|
-
var v =
|
|
339
|
+
function xt(s, i, a) {
|
|
340
|
+
var c = dt(s, i, a);
|
|
341
|
+
if (c)
|
|
342
|
+
return St(s, i, a);
|
|
343
|
+
var v = vt(i);
|
|
352
344
|
if (!A(v))
|
|
353
|
-
return
|
|
345
|
+
return xt(s, v, a);
|
|
354
346
|
}
|
|
355
|
-
function
|
|
356
|
-
var
|
|
347
|
+
function St(s, i, a) {
|
|
348
|
+
var c = H(
|
|
357
349
|
i,
|
|
358
350
|
a,
|
|
359
351
|
/*Create*/
|
|
360
352
|
!1
|
|
361
353
|
);
|
|
362
|
-
if (!
|
|
363
|
-
return
|
|
354
|
+
if (!y(c))
|
|
355
|
+
return c.OrdinaryGetOwnMetadata(s, i, a);
|
|
364
356
|
}
|
|
365
|
-
function
|
|
357
|
+
function Mt(s, i, a, c) {
|
|
366
358
|
var v = H(
|
|
367
359
|
a,
|
|
368
|
-
|
|
360
|
+
c,
|
|
369
361
|
/*Create*/
|
|
370
362
|
!0
|
|
371
363
|
);
|
|
372
|
-
v.OrdinaryDefineOwnMetadata(s, i, a,
|
|
364
|
+
v.OrdinaryDefineOwnMetadata(s, i, a, c);
|
|
373
365
|
}
|
|
374
|
-
function
|
|
375
|
-
var a =
|
|
376
|
-
if (
|
|
366
|
+
function Ot(s, i) {
|
|
367
|
+
var a = Pt(s, i), c = vt(s);
|
|
368
|
+
if (c === null)
|
|
377
369
|
return a;
|
|
378
|
-
var v =
|
|
370
|
+
var v = Ot(c, i);
|
|
379
371
|
if (v.length <= 0)
|
|
380
372
|
return a;
|
|
381
373
|
if (a.length <= 0)
|
|
382
374
|
return v;
|
|
383
|
-
for (var
|
|
384
|
-
var h = u[w], d =
|
|
385
|
-
d || (
|
|
375
|
+
for (var j = new ut(), P = [], w = 0, u = a; w < u.length; w++) {
|
|
376
|
+
var h = u[w], d = j.has(h);
|
|
377
|
+
d || (j.add(h), P.push(h));
|
|
386
378
|
}
|
|
387
379
|
for (var f = 0, m = v; f < m.length; f++) {
|
|
388
|
-
var h = m[f], d =
|
|
389
|
-
d || (
|
|
380
|
+
var h = m[f], d = j.has(h);
|
|
381
|
+
d || (j.add(h), P.push(h));
|
|
390
382
|
}
|
|
391
383
|
return P;
|
|
392
384
|
}
|
|
393
|
-
function
|
|
385
|
+
function Pt(s, i) {
|
|
394
386
|
var a = H(
|
|
395
387
|
s,
|
|
396
388
|
i,
|
|
@@ -399,7 +391,7 @@ function At() {
|
|
|
399
391
|
);
|
|
400
392
|
return a ? a.OrdinaryOwnMetadataKeys(s, i) : [];
|
|
401
393
|
}
|
|
402
|
-
function
|
|
394
|
+
function jt(s) {
|
|
403
395
|
if (s === null)
|
|
404
396
|
return 1;
|
|
405
397
|
switch (typeof s) {
|
|
@@ -419,20 +411,20 @@ function At() {
|
|
|
419
411
|
return 6;
|
|
420
412
|
}
|
|
421
413
|
}
|
|
422
|
-
function
|
|
414
|
+
function y(s) {
|
|
423
415
|
return s === void 0;
|
|
424
416
|
}
|
|
425
417
|
function A(s) {
|
|
426
418
|
return s === null;
|
|
427
419
|
}
|
|
428
|
-
function
|
|
420
|
+
function ue(s) {
|
|
429
421
|
return typeof s == "symbol";
|
|
430
422
|
}
|
|
431
423
|
function O(s) {
|
|
432
424
|
return typeof s == "object" ? s !== null : typeof s == "function";
|
|
433
425
|
}
|
|
434
|
-
function
|
|
435
|
-
switch (
|
|
426
|
+
function he(s, i) {
|
|
427
|
+
switch (jt(s)) {
|
|
436
428
|
case 0:
|
|
437
429
|
return s;
|
|
438
430
|
case 1:
|
|
@@ -446,54 +438,54 @@ function At() {
|
|
|
446
438
|
case 5:
|
|
447
439
|
return s;
|
|
448
440
|
}
|
|
449
|
-
var a = "string",
|
|
450
|
-
if (
|
|
451
|
-
var v =
|
|
441
|
+
var a = "string", c = It(s, g);
|
|
442
|
+
if (c !== void 0) {
|
|
443
|
+
var v = c.call(s, a);
|
|
452
444
|
if (O(v))
|
|
453
445
|
throw new TypeError();
|
|
454
446
|
return v;
|
|
455
447
|
}
|
|
456
|
-
return
|
|
448
|
+
return de(s);
|
|
457
449
|
}
|
|
458
|
-
function
|
|
459
|
-
var a,
|
|
450
|
+
function de(s, i) {
|
|
451
|
+
var a, c;
|
|
460
452
|
{
|
|
461
453
|
var v = s.toString;
|
|
462
|
-
if (
|
|
463
|
-
var
|
|
464
|
-
if (!O(
|
|
465
|
-
return
|
|
454
|
+
if (st(v)) {
|
|
455
|
+
var c = v.call(s);
|
|
456
|
+
if (!O(c))
|
|
457
|
+
return c;
|
|
466
458
|
}
|
|
467
459
|
var a = s.valueOf;
|
|
468
|
-
if (
|
|
469
|
-
var
|
|
470
|
-
if (!O(
|
|
471
|
-
return
|
|
460
|
+
if (st(a)) {
|
|
461
|
+
var c = a.call(s);
|
|
462
|
+
if (!O(c))
|
|
463
|
+
return c;
|
|
472
464
|
}
|
|
473
465
|
}
|
|
474
466
|
throw new TypeError();
|
|
475
467
|
}
|
|
476
|
-
function
|
|
468
|
+
function Ct(s) {
|
|
477
469
|
return !!s;
|
|
478
470
|
}
|
|
479
|
-
function
|
|
471
|
+
function fe(s) {
|
|
480
472
|
return "" + s;
|
|
481
473
|
}
|
|
482
474
|
function T(s) {
|
|
483
|
-
var i =
|
|
484
|
-
return
|
|
475
|
+
var i = he(s);
|
|
476
|
+
return ue(i) ? i : fe(i);
|
|
485
477
|
}
|
|
486
|
-
function
|
|
478
|
+
function _t(s) {
|
|
487
479
|
return Array.isArray ? Array.isArray(s) : s instanceof Object ? s instanceof Array : Object.prototype.toString.call(s) === "[object Array]";
|
|
488
480
|
}
|
|
489
|
-
function
|
|
481
|
+
function st(s) {
|
|
490
482
|
return typeof s == "function";
|
|
491
483
|
}
|
|
492
|
-
function
|
|
484
|
+
function Et(s) {
|
|
493
485
|
return typeof s == "function";
|
|
494
486
|
}
|
|
495
|
-
function
|
|
496
|
-
switch (
|
|
487
|
+
function ve(s) {
|
|
488
|
+
switch (jt(s)) {
|
|
497
489
|
case 3:
|
|
498
490
|
return !0;
|
|
499
491
|
case 4:
|
|
@@ -502,151 +494,151 @@ function At() {
|
|
|
502
494
|
return !1;
|
|
503
495
|
}
|
|
504
496
|
}
|
|
505
|
-
function
|
|
497
|
+
function ft(s, i) {
|
|
506
498
|
return s === i || s !== s && i !== i;
|
|
507
499
|
}
|
|
508
|
-
function
|
|
500
|
+
function It(s, i) {
|
|
509
501
|
var a = s[i];
|
|
510
502
|
if (a != null) {
|
|
511
|
-
if (!
|
|
503
|
+
if (!st(a))
|
|
512
504
|
throw new TypeError();
|
|
513
505
|
return a;
|
|
514
506
|
}
|
|
515
507
|
}
|
|
516
|
-
function
|
|
517
|
-
var i =
|
|
518
|
-
if (!
|
|
508
|
+
function Tt(s) {
|
|
509
|
+
var i = It(s, p);
|
|
510
|
+
if (!st(i))
|
|
519
511
|
throw new TypeError();
|
|
520
512
|
var a = i.call(s);
|
|
521
513
|
if (!O(a))
|
|
522
514
|
throw new TypeError();
|
|
523
515
|
return a;
|
|
524
516
|
}
|
|
525
|
-
function
|
|
517
|
+
function zt(s) {
|
|
526
518
|
return s.value;
|
|
527
519
|
}
|
|
528
|
-
function
|
|
520
|
+
function Dt(s) {
|
|
529
521
|
var i = s.next();
|
|
530
522
|
return i.done ? !1 : i;
|
|
531
523
|
}
|
|
532
|
-
function
|
|
524
|
+
function Rt(s) {
|
|
533
525
|
var i = s.return;
|
|
534
526
|
i && i.call(s);
|
|
535
527
|
}
|
|
536
|
-
function
|
|
528
|
+
function vt(s) {
|
|
537
529
|
var i = Object.getPrototypeOf(s);
|
|
538
530
|
if (typeof s != "function" || s === N || i !== N)
|
|
539
531
|
return i;
|
|
540
|
-
var a = s.prototype,
|
|
541
|
-
if (
|
|
532
|
+
var a = s.prototype, c = a && Object.getPrototypeOf(a);
|
|
533
|
+
if (c == null || c === Object.prototype)
|
|
542
534
|
return i;
|
|
543
|
-
var v =
|
|
535
|
+
var v = c.constructor;
|
|
544
536
|
return typeof v != "function" || v === s ? i : v;
|
|
545
537
|
}
|
|
546
|
-
function
|
|
538
|
+
function pe() {
|
|
547
539
|
var s;
|
|
548
|
-
!
|
|
549
|
-
var i, a,
|
|
540
|
+
!y(L) && typeof n.Reflect < "u" && !(L in n.Reflect) && typeof n.Reflect.defineMetadata == "function" && (s = we(n.Reflect));
|
|
541
|
+
var i, a, c, v = new ht(), j = {
|
|
550
542
|
registerProvider: P,
|
|
551
543
|
getProvider: u,
|
|
552
544
|
setProvider: d
|
|
553
545
|
};
|
|
554
|
-
return
|
|
546
|
+
return j;
|
|
555
547
|
function P(f) {
|
|
556
|
-
if (!Object.isExtensible(
|
|
548
|
+
if (!Object.isExtensible(j))
|
|
557
549
|
throw new Error("Cannot add provider to a frozen registry.");
|
|
558
550
|
switch (!0) {
|
|
559
551
|
case s === f:
|
|
560
552
|
break;
|
|
561
|
-
case
|
|
553
|
+
case y(i):
|
|
562
554
|
i = f;
|
|
563
555
|
break;
|
|
564
556
|
case i === f:
|
|
565
557
|
break;
|
|
566
|
-
case
|
|
558
|
+
case y(a):
|
|
567
559
|
a = f;
|
|
568
560
|
break;
|
|
569
561
|
case a === f:
|
|
570
562
|
break;
|
|
571
563
|
default:
|
|
572
|
-
|
|
564
|
+
c === void 0 && (c = new ut()), c.add(f);
|
|
573
565
|
break;
|
|
574
566
|
}
|
|
575
567
|
}
|
|
576
568
|
function w(f, m) {
|
|
577
|
-
if (!
|
|
569
|
+
if (!y(i)) {
|
|
578
570
|
if (i.isProviderFor(f, m))
|
|
579
571
|
return i;
|
|
580
|
-
if (!
|
|
572
|
+
if (!y(a)) {
|
|
581
573
|
if (a.isProviderFor(f, m))
|
|
582
574
|
return i;
|
|
583
|
-
if (!
|
|
584
|
-
for (var x =
|
|
585
|
-
var M =
|
|
575
|
+
if (!y(c))
|
|
576
|
+
for (var x = Tt(c); ; ) {
|
|
577
|
+
var M = Dt(x);
|
|
586
578
|
if (!M)
|
|
587
579
|
return;
|
|
588
|
-
var I =
|
|
580
|
+
var I = zt(M);
|
|
589
581
|
if (I.isProviderFor(f, m))
|
|
590
|
-
return
|
|
582
|
+
return Rt(x), I;
|
|
591
583
|
}
|
|
592
584
|
}
|
|
593
585
|
}
|
|
594
|
-
if (!
|
|
586
|
+
if (!y(s) && s.isProviderFor(f, m))
|
|
595
587
|
return s;
|
|
596
588
|
}
|
|
597
589
|
function u(f, m) {
|
|
598
590
|
var x = v.get(f), M;
|
|
599
|
-
return
|
|
591
|
+
return y(x) || (M = x.get(m)), y(M) && (M = w(f, m), y(M) || (y(x) && (x = new Y(), v.set(f, x)), x.set(m, M))), M;
|
|
600
592
|
}
|
|
601
593
|
function h(f) {
|
|
602
|
-
if (
|
|
594
|
+
if (y(f))
|
|
603
595
|
throw new TypeError();
|
|
604
|
-
return i === f || a === f || !
|
|
596
|
+
return i === f || a === f || !y(c) && c.has(f);
|
|
605
597
|
}
|
|
606
598
|
function d(f, m, x) {
|
|
607
599
|
if (!h(x))
|
|
608
600
|
throw new Error("Metadata provider not registered.");
|
|
609
601
|
var M = u(f, m);
|
|
610
602
|
if (M !== x) {
|
|
611
|
-
if (!
|
|
603
|
+
if (!y(M))
|
|
612
604
|
return !1;
|
|
613
605
|
var I = v.get(f);
|
|
614
|
-
|
|
606
|
+
y(I) && (I = new Y(), v.set(f, I)), I.set(m, x);
|
|
615
607
|
}
|
|
616
608
|
return !0;
|
|
617
609
|
}
|
|
618
610
|
}
|
|
619
|
-
function
|
|
611
|
+
function ye() {
|
|
620
612
|
var s;
|
|
621
|
-
return !
|
|
613
|
+
return !y(L) && O(n.Reflect) && Object.isExtensible(n.Reflect) && (s = n.Reflect[L]), y(s) && (s = pe()), !y(L) && O(n.Reflect) && Object.isExtensible(n.Reflect) && Object.defineProperty(n.Reflect, L, {
|
|
622
614
|
enumerable: !1,
|
|
623
615
|
configurable: !1,
|
|
624
616
|
writable: !1,
|
|
625
617
|
value: s
|
|
626
618
|
}), s;
|
|
627
619
|
}
|
|
628
|
-
function
|
|
629
|
-
var i = new
|
|
620
|
+
function ge(s) {
|
|
621
|
+
var i = new ht(), a = {
|
|
630
622
|
isProviderFor: function(h, d) {
|
|
631
623
|
var f = i.get(h);
|
|
632
|
-
return
|
|
624
|
+
return y(f) ? !1 : f.has(d);
|
|
633
625
|
},
|
|
634
626
|
OrdinaryDefineOwnMetadata: P,
|
|
635
627
|
OrdinaryHasOwnMetadata: v,
|
|
636
|
-
OrdinaryGetOwnMetadata:
|
|
628
|
+
OrdinaryGetOwnMetadata: j,
|
|
637
629
|
OrdinaryOwnMetadataKeys: w,
|
|
638
630
|
OrdinaryDeleteMetadata: u
|
|
639
631
|
};
|
|
640
|
-
return
|
|
641
|
-
function
|
|
632
|
+
return et.registerProvider(a), a;
|
|
633
|
+
function c(h, d, f) {
|
|
642
634
|
var m = i.get(h), x = !1;
|
|
643
|
-
if (
|
|
635
|
+
if (y(m)) {
|
|
644
636
|
if (!f)
|
|
645
637
|
return;
|
|
646
638
|
m = new Y(), i.set(h, m), x = !0;
|
|
647
639
|
}
|
|
648
640
|
var M = m.get(d);
|
|
649
|
-
if (
|
|
641
|
+
if (y(M)) {
|
|
650
642
|
if (!f)
|
|
651
643
|
return;
|
|
652
644
|
if (M = new Y(), m.set(d, M), !s.setProvider(h, d, a))
|
|
@@ -655,26 +647,26 @@ function At() {
|
|
|
655
647
|
return M;
|
|
656
648
|
}
|
|
657
649
|
function v(h, d, f) {
|
|
658
|
-
var m =
|
|
650
|
+
var m = c(
|
|
659
651
|
d,
|
|
660
652
|
f,
|
|
661
653
|
/*Create*/
|
|
662
654
|
!1
|
|
663
655
|
);
|
|
664
|
-
return
|
|
656
|
+
return y(m) ? !1 : Ct(m.has(h));
|
|
665
657
|
}
|
|
666
|
-
function
|
|
667
|
-
var m =
|
|
658
|
+
function j(h, d, f) {
|
|
659
|
+
var m = c(
|
|
668
660
|
d,
|
|
669
661
|
f,
|
|
670
662
|
/*Create*/
|
|
671
663
|
!1
|
|
672
664
|
);
|
|
673
|
-
if (!
|
|
665
|
+
if (!y(m))
|
|
674
666
|
return m.get(h);
|
|
675
667
|
}
|
|
676
668
|
function P(h, d, f, m) {
|
|
677
|
-
var x =
|
|
669
|
+
var x = c(
|
|
678
670
|
f,
|
|
679
671
|
m,
|
|
680
672
|
/*Create*/
|
|
@@ -683,72 +675,72 @@ function At() {
|
|
|
683
675
|
x.set(h, d);
|
|
684
676
|
}
|
|
685
677
|
function w(h, d) {
|
|
686
|
-
var f = [], m =
|
|
678
|
+
var f = [], m = c(
|
|
687
679
|
h,
|
|
688
680
|
d,
|
|
689
681
|
/*Create*/
|
|
690
682
|
!1
|
|
691
683
|
);
|
|
692
|
-
if (
|
|
684
|
+
if (y(m))
|
|
693
685
|
return f;
|
|
694
|
-
for (var x = m.keys(), M =
|
|
695
|
-
var
|
|
696
|
-
if (!
|
|
686
|
+
for (var x = m.keys(), M = Tt(x), I = 0; ; ) {
|
|
687
|
+
var kt = Dt(M);
|
|
688
|
+
if (!kt)
|
|
697
689
|
return f.length = I, f;
|
|
698
|
-
var
|
|
690
|
+
var Se = zt(kt);
|
|
699
691
|
try {
|
|
700
|
-
f[I] =
|
|
701
|
-
} catch (
|
|
692
|
+
f[I] = Se;
|
|
693
|
+
} catch (Me) {
|
|
702
694
|
try {
|
|
703
|
-
|
|
695
|
+
Rt(M);
|
|
704
696
|
} finally {
|
|
705
|
-
throw
|
|
697
|
+
throw Me;
|
|
706
698
|
}
|
|
707
699
|
}
|
|
708
700
|
I++;
|
|
709
701
|
}
|
|
710
702
|
}
|
|
711
703
|
function u(h, d, f) {
|
|
712
|
-
var m =
|
|
704
|
+
var m = c(
|
|
713
705
|
d,
|
|
714
706
|
f,
|
|
715
707
|
/*Create*/
|
|
716
708
|
!1
|
|
717
709
|
);
|
|
718
|
-
if (
|
|
710
|
+
if (y(m) || !m.delete(h))
|
|
719
711
|
return !1;
|
|
720
712
|
if (m.size === 0) {
|
|
721
713
|
var x = i.get(d);
|
|
722
|
-
|
|
714
|
+
y(x) || (x.delete(f), x.size === 0 && i.delete(x));
|
|
723
715
|
}
|
|
724
716
|
return !0;
|
|
725
717
|
}
|
|
726
718
|
}
|
|
727
|
-
function
|
|
728
|
-
var i = s.defineMetadata, a = s.hasOwnMetadata,
|
|
719
|
+
function we(s) {
|
|
720
|
+
var i = s.defineMetadata, a = s.hasOwnMetadata, c = s.getOwnMetadata, v = s.getOwnMetadataKeys, j = s.deleteMetadata, P = new ht(), w = {
|
|
729
721
|
isProviderFor: function(u, h) {
|
|
730
722
|
var d = P.get(u);
|
|
731
|
-
return !
|
|
723
|
+
return !y(d) && d.has(h) ? !0 : v(u, h).length ? (y(d) && (d = new ut(), P.set(u, d)), d.add(h), !0) : !1;
|
|
732
724
|
},
|
|
733
725
|
OrdinaryDefineOwnMetadata: i,
|
|
734
726
|
OrdinaryHasOwnMetadata: a,
|
|
735
|
-
OrdinaryGetOwnMetadata:
|
|
727
|
+
OrdinaryGetOwnMetadata: c,
|
|
736
728
|
OrdinaryOwnMetadataKeys: v,
|
|
737
|
-
OrdinaryDeleteMetadata:
|
|
729
|
+
OrdinaryDeleteMetadata: j
|
|
738
730
|
};
|
|
739
731
|
return w;
|
|
740
732
|
}
|
|
741
733
|
function H(s, i, a) {
|
|
742
|
-
var
|
|
743
|
-
if (!
|
|
744
|
-
return
|
|
734
|
+
var c = et.getProvider(s, i);
|
|
735
|
+
if (!y(c))
|
|
736
|
+
return c;
|
|
745
737
|
if (a) {
|
|
746
|
-
if (
|
|
747
|
-
return
|
|
738
|
+
if (et.setProvider(s, i, mt))
|
|
739
|
+
return mt;
|
|
748
740
|
throw new Error("Illegal state.");
|
|
749
741
|
}
|
|
750
742
|
}
|
|
751
|
-
function
|
|
743
|
+
function me() {
|
|
752
744
|
var s = {}, i = [], a = (
|
|
753
745
|
/** @class */
|
|
754
746
|
(function() {
|
|
@@ -757,7 +749,7 @@ function At() {
|
|
|
757
749
|
}
|
|
758
750
|
return w.prototype["@@iterator"] = function() {
|
|
759
751
|
return this;
|
|
760
|
-
}, w.prototype[
|
|
752
|
+
}, w.prototype[p] = function() {
|
|
761
753
|
return this;
|
|
762
754
|
}, w.prototype.next = function() {
|
|
763
755
|
var u = this._index;
|
|
@@ -772,7 +764,7 @@ function At() {
|
|
|
772
764
|
return this._index >= 0 && (this._index = -1, this._keys = i, this._values = i), { value: u, done: !0 };
|
|
773
765
|
}, w;
|
|
774
766
|
})()
|
|
775
|
-
),
|
|
767
|
+
), c = (
|
|
776
768
|
/** @class */
|
|
777
769
|
(function() {
|
|
778
770
|
function w() {
|
|
@@ -813,7 +805,7 @@ function At() {
|
|
|
813
805
|
if (h >= 0) {
|
|
814
806
|
for (var d = this._keys.length, f = h + 1; f < d; f++)
|
|
815
807
|
this._keys[f - 1] = this._keys[f], this._values[f - 1] = this._values[f];
|
|
816
|
-
return this._keys.length--, this._values.length--,
|
|
808
|
+
return this._keys.length--, this._values.length--, ft(u, this._cacheKey) && (this._cacheKey = s, this._cacheIndex = -2), !0;
|
|
817
809
|
}
|
|
818
810
|
return !1;
|
|
819
811
|
}, w.prototype.clear = function() {
|
|
@@ -821,18 +813,18 @@ function At() {
|
|
|
821
813
|
}, w.prototype.keys = function() {
|
|
822
814
|
return new a(this._keys, this._values, v);
|
|
823
815
|
}, w.prototype.values = function() {
|
|
824
|
-
return new a(this._keys, this._values,
|
|
816
|
+
return new a(this._keys, this._values, j);
|
|
825
817
|
}, w.prototype.entries = function() {
|
|
826
818
|
return new a(this._keys, this._values, P);
|
|
827
819
|
}, w.prototype["@@iterator"] = function() {
|
|
828
820
|
return this.entries();
|
|
829
|
-
}, w.prototype[
|
|
821
|
+
}, w.prototype[p] = function() {
|
|
830
822
|
return this.entries();
|
|
831
823
|
}, w.prototype._find = function(u, h) {
|
|
832
|
-
if (!
|
|
824
|
+
if (!ft(this._cacheKey, u)) {
|
|
833
825
|
this._cacheIndex = -1;
|
|
834
826
|
for (var d = 0; d < this._keys.length; d++)
|
|
835
|
-
if (
|
|
827
|
+
if (ft(this._keys[d], u)) {
|
|
836
828
|
this._cacheIndex = d;
|
|
837
829
|
break;
|
|
838
830
|
}
|
|
@@ -841,18 +833,18 @@ function At() {
|
|
|
841
833
|
}, w;
|
|
842
834
|
})()
|
|
843
835
|
);
|
|
844
|
-
return
|
|
836
|
+
return c;
|
|
845
837
|
function v(w, u) {
|
|
846
838
|
return w;
|
|
847
839
|
}
|
|
848
|
-
function
|
|
840
|
+
function j(w, u) {
|
|
849
841
|
return u;
|
|
850
842
|
}
|
|
851
843
|
function P(w, u) {
|
|
852
844
|
return [w, u];
|
|
853
845
|
}
|
|
854
846
|
}
|
|
855
|
-
function
|
|
847
|
+
function be() {
|
|
856
848
|
var s = (
|
|
857
849
|
/** @class */
|
|
858
850
|
(function() {
|
|
@@ -881,20 +873,20 @@ function At() {
|
|
|
881
873
|
return this._map.entries();
|
|
882
874
|
}, i.prototype["@@iterator"] = function() {
|
|
883
875
|
return this.keys();
|
|
884
|
-
}, i.prototype[
|
|
876
|
+
}, i.prototype[p] = function() {
|
|
885
877
|
return this.keys();
|
|
886
878
|
}, i;
|
|
887
879
|
})()
|
|
888
880
|
);
|
|
889
881
|
return s;
|
|
890
882
|
}
|
|
891
|
-
function
|
|
892
|
-
var s = 16, i = R.create(), a =
|
|
883
|
+
function xe() {
|
|
884
|
+
var s = 16, i = R.create(), a = c();
|
|
893
885
|
return (
|
|
894
886
|
/** @class */
|
|
895
887
|
(function() {
|
|
896
888
|
function u() {
|
|
897
|
-
this._key =
|
|
889
|
+
this._key = c();
|
|
898
890
|
}
|
|
899
891
|
return u.prototype.has = function(h) {
|
|
900
892
|
var d = v(
|
|
@@ -925,11 +917,11 @@ function At() {
|
|
|
925
917
|
);
|
|
926
918
|
return d !== void 0 ? delete d[this._key] : !1;
|
|
927
919
|
}, u.prototype.clear = function() {
|
|
928
|
-
this._key =
|
|
920
|
+
this._key = c();
|
|
929
921
|
}, u;
|
|
930
922
|
})()
|
|
931
923
|
);
|
|
932
|
-
function
|
|
924
|
+
function c() {
|
|
933
925
|
var u;
|
|
934
926
|
do
|
|
935
927
|
u = "@@WeakMap@@" + w();
|
|
@@ -937,14 +929,14 @@ function At() {
|
|
|
937
929
|
return i[u] = !0, u;
|
|
938
930
|
}
|
|
939
931
|
function v(u, h) {
|
|
940
|
-
if (!
|
|
932
|
+
if (!o.call(u, a)) {
|
|
941
933
|
if (!h)
|
|
942
934
|
return;
|
|
943
935
|
Object.defineProperty(u, a, { value: R.create() });
|
|
944
936
|
}
|
|
945
937
|
return u[a];
|
|
946
938
|
}
|
|
947
|
-
function
|
|
939
|
+
function j(u, h) {
|
|
948
940
|
for (var d = 0; d < h; ++d)
|
|
949
941
|
u[d] = Math.random() * 255 | 0;
|
|
950
942
|
return u;
|
|
@@ -952,9 +944,9 @@ function At() {
|
|
|
952
944
|
function P(u) {
|
|
953
945
|
if (typeof Uint8Array == "function") {
|
|
954
946
|
var h = new Uint8Array(u);
|
|
955
|
-
return typeof crypto < "u" ? crypto.getRandomValues(h) : typeof msCrypto < "u" ? msCrypto.getRandomValues(h) :
|
|
947
|
+
return typeof crypto < "u" ? crypto.getRandomValues(h) : typeof msCrypto < "u" ? msCrypto.getRandomValues(h) : j(h, u), h;
|
|
956
948
|
}
|
|
957
|
-
return
|
|
949
|
+
return j(new Array(u), u);
|
|
958
950
|
}
|
|
959
951
|
function w() {
|
|
960
952
|
var u = P(s);
|
|
@@ -966,270 +958,270 @@ function At() {
|
|
|
966
958
|
return h;
|
|
967
959
|
}
|
|
968
960
|
}
|
|
969
|
-
function
|
|
961
|
+
function pt(s) {
|
|
970
962
|
return s.__ = void 0, delete s.__, s;
|
|
971
963
|
}
|
|
972
964
|
});
|
|
973
|
-
})(
|
|
965
|
+
})(r || (r = {})), Vt;
|
|
974
966
|
}
|
|
975
|
-
|
|
976
|
-
class
|
|
967
|
+
Ae();
|
|
968
|
+
class Wt extends Error {
|
|
977
969
|
constructor() {
|
|
978
970
|
super(...arguments), this.name = this.constructor.name;
|
|
979
971
|
}
|
|
980
972
|
}
|
|
981
|
-
class
|
|
982
|
-
constructor(
|
|
983
|
-
super(`"${
|
|
973
|
+
class Ge extends Wt {
|
|
974
|
+
constructor(t, e) {
|
|
975
|
+
super(`"${e}" not found in Mesh "${t}"`);
|
|
984
976
|
}
|
|
985
977
|
}
|
|
986
|
-
class
|
|
987
|
-
constructor(
|
|
988
|
-
super(`Invalid binding "${
|
|
978
|
+
class At extends Wt {
|
|
979
|
+
constructor(t) {
|
|
980
|
+
super(`Invalid binding "${t}". Valid bindings are: string to constructor e.g. ("MyService", MyService) or abstract class to constructor e.g. (MyService, MyServiceImpl) orconstructor to self e.g. (MyService)`);
|
|
989
981
|
}
|
|
990
982
|
}
|
|
991
|
-
function D(
|
|
992
|
-
return typeof
|
|
983
|
+
function D(r) {
|
|
984
|
+
return typeof r == "string" ? r : r.name;
|
|
993
985
|
}
|
|
994
|
-
function
|
|
995
|
-
return typeof
|
|
986
|
+
function $e(r) {
|
|
987
|
+
return typeof r == "function" && r.prototype != null;
|
|
996
988
|
}
|
|
997
|
-
function
|
|
998
|
-
return
|
|
989
|
+
function Fe(r, ...t) {
|
|
990
|
+
return $e(r) ? new r(...t) : r(...t);
|
|
999
991
|
}
|
|
1000
|
-
const
|
|
1001
|
-
class
|
|
1002
|
-
constructor(
|
|
1003
|
-
this.name =
|
|
992
|
+
const Zt = /* @__PURE__ */ Symbol.for("MESH_REF");
|
|
993
|
+
class at {
|
|
994
|
+
constructor(t = "default", e = void 0) {
|
|
995
|
+
this.name = t, this.parent = e, this.bindings = /* @__PURE__ */ new Map(), this.instances = /* @__PURE__ */ new Map(), this.middlewares = [], this.constant(at, this), this.injectRef(this);
|
|
1004
996
|
}
|
|
1005
997
|
*[Symbol.iterator]() {
|
|
1006
998
|
yield* this.bindings.entries();
|
|
1007
999
|
}
|
|
1008
1000
|
clone() {
|
|
1009
|
-
const
|
|
1010
|
-
return
|
|
1001
|
+
const t = new at();
|
|
1002
|
+
return t.parent = this.parent, t.bindings = new Map(this.bindings), t;
|
|
1011
1003
|
}
|
|
1012
|
-
connect(
|
|
1013
|
-
const
|
|
1014
|
-
return this.injectRef(
|
|
1004
|
+
connect(t) {
|
|
1005
|
+
const e = this.applyMiddleware(t);
|
|
1006
|
+
return this.injectRef(e), e;
|
|
1015
1007
|
}
|
|
1016
|
-
use(
|
|
1017
|
-
return this.middlewares.push(
|
|
1008
|
+
use(t) {
|
|
1009
|
+
return this.middlewares.push(t), this;
|
|
1018
1010
|
}
|
|
1019
|
-
service(
|
|
1020
|
-
const n = D(
|
|
1021
|
-
if (typeof t == "function")
|
|
1022
|
-
return this.bindings.set(n, { type: "service", class: t }), this;
|
|
1011
|
+
service(t, e) {
|
|
1012
|
+
const n = D(t);
|
|
1023
1013
|
if (typeof e == "function")
|
|
1024
1014
|
return this.bindings.set(n, { type: "service", class: e }), this;
|
|
1025
|
-
throw new Ke(String(e));
|
|
1026
|
-
}
|
|
1027
|
-
scope(e, t) {
|
|
1028
|
-
const n = D(e);
|
|
1029
1015
|
if (typeof t == "function")
|
|
1030
|
-
return this.bindings.set(n, { type: "
|
|
1016
|
+
return this.bindings.set(n, { type: "service", class: t }), this;
|
|
1017
|
+
throw new At(String(t));
|
|
1018
|
+
}
|
|
1019
|
+
scope(t, e) {
|
|
1020
|
+
const n = D(t);
|
|
1031
1021
|
if (typeof e == "function")
|
|
1032
1022
|
return this.bindings.set(n, { type: "scope", factory: e }), this;
|
|
1033
|
-
|
|
1023
|
+
if (typeof t == "function")
|
|
1024
|
+
return this.bindings.set(n, { type: "scope", factory: t }), this;
|
|
1025
|
+
throw new At(String(t));
|
|
1034
1026
|
}
|
|
1035
|
-
constant(
|
|
1036
|
-
const n = D(
|
|
1037
|
-
return this.bindings.set(n, { type: "constant", value:
|
|
1027
|
+
constant(t, e) {
|
|
1028
|
+
const n = D(t);
|
|
1029
|
+
return this.bindings.set(n, { type: "constant", value: e }), this;
|
|
1038
1030
|
}
|
|
1039
|
-
alias(
|
|
1040
|
-
const n = D(
|
|
1041
|
-
return this.bindings.set(n, { type: "alias", key:
|
|
1031
|
+
alias(t, e) {
|
|
1032
|
+
const n = D(t), o = D(e);
|
|
1033
|
+
return this.bindings.set(n, { type: "alias", key: o }), this;
|
|
1042
1034
|
}
|
|
1043
|
-
delete(
|
|
1044
|
-
const
|
|
1045
|
-
return this.bindings.delete(
|
|
1035
|
+
delete(t) {
|
|
1036
|
+
const e = D(t);
|
|
1037
|
+
return this.bindings.delete(e), this;
|
|
1046
1038
|
}
|
|
1047
|
-
resolve(
|
|
1048
|
-
const n = this.tryResolve(
|
|
1039
|
+
resolve(t, e = !0) {
|
|
1040
|
+
const n = this.tryResolve(t, e);
|
|
1049
1041
|
if (n === void 0) {
|
|
1050
|
-
const
|
|
1051
|
-
throw new
|
|
1042
|
+
const o = D(t);
|
|
1043
|
+
throw new Ge(this.name, o);
|
|
1052
1044
|
}
|
|
1053
1045
|
return n;
|
|
1054
1046
|
}
|
|
1055
|
-
tryResolve(
|
|
1056
|
-
const n = D(
|
|
1057
|
-
let
|
|
1058
|
-
if (
|
|
1059
|
-
return
|
|
1060
|
-
const
|
|
1061
|
-
if (
|
|
1062
|
-
return
|
|
1063
|
-
if (
|
|
1064
|
-
return this.parent.tryResolve(
|
|
1065
|
-
}
|
|
1066
|
-
getBinding(
|
|
1067
|
-
const n = D(
|
|
1068
|
-
if (
|
|
1069
|
-
return
|
|
1070
|
-
if (
|
|
1071
|
-
return this.parent.getBinding(
|
|
1047
|
+
tryResolve(t, e = !0) {
|
|
1048
|
+
const n = D(t);
|
|
1049
|
+
let o = this.instances.get(n);
|
|
1050
|
+
if (o)
|
|
1051
|
+
return o;
|
|
1052
|
+
const l = this.bindings.get(n);
|
|
1053
|
+
if (l)
|
|
1054
|
+
return o = this.instantiate(l), o = this.connect(o), this.instances.set(n, o), o;
|
|
1055
|
+
if (e && this.parent)
|
|
1056
|
+
return this.parent.tryResolve(t);
|
|
1057
|
+
}
|
|
1058
|
+
getBinding(t, e = !0) {
|
|
1059
|
+
const n = D(t), o = this.bindings.get(n);
|
|
1060
|
+
if (o)
|
|
1061
|
+
return o;
|
|
1062
|
+
if (e && this.parent)
|
|
1063
|
+
return this.parent.getBinding(t);
|
|
1072
1064
|
}
|
|
1073
1065
|
*allBindings() {
|
|
1074
1066
|
yield* this.bindings.entries(), this.parent && (yield* this.parent.allBindings());
|
|
1075
1067
|
}
|
|
1076
1068
|
*missingDeps() {
|
|
1077
|
-
for (const
|
|
1078
|
-
this.getBinding(
|
|
1069
|
+
for (const t of this.allDeps())
|
|
1070
|
+
this.getBinding(t.key) || (yield t);
|
|
1079
1071
|
}
|
|
1080
1072
|
*allDeps() {
|
|
1081
|
-
const
|
|
1082
|
-
for (const [,
|
|
1083
|
-
|
|
1084
|
-
}
|
|
1085
|
-
*traverseClassDeps(
|
|
1086
|
-
const n =
|
|
1087
|
-
for (const
|
|
1088
|
-
if (
|
|
1073
|
+
const t = /* @__PURE__ */ new Set();
|
|
1074
|
+
for (const [, e] of this.allBindings())
|
|
1075
|
+
e.type === "service" && (yield* this.traverseClassDeps(e.class, t));
|
|
1076
|
+
}
|
|
1077
|
+
*traverseClassDeps(t, e = /* @__PURE__ */ new Set()) {
|
|
1078
|
+
const n = Ne(t);
|
|
1079
|
+
for (const o of n) {
|
|
1080
|
+
if (e.has(o.key))
|
|
1089
1081
|
continue;
|
|
1090
|
-
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1082
|
+
e.add(o.key), yield o;
|
|
1083
|
+
const l = this.getBinding(o.key);
|
|
1084
|
+
l?.type === "service" && (yield* this.traverseClassDeps(l.class, e));
|
|
1093
1085
|
}
|
|
1094
1086
|
}
|
|
1095
|
-
instantiate(
|
|
1096
|
-
switch (
|
|
1087
|
+
instantiate(t) {
|
|
1088
|
+
switch (t.type) {
|
|
1097
1089
|
case "alias":
|
|
1098
|
-
return this.resolve(
|
|
1090
|
+
return this.resolve(t.key);
|
|
1099
1091
|
case "service": {
|
|
1100
|
-
const
|
|
1092
|
+
const e = t.class, n = class extends e {
|
|
1101
1093
|
};
|
|
1102
|
-
return Object.defineProperty(n, "name", { value:
|
|
1094
|
+
return Object.defineProperty(n, "name", { value: e.name }), this.injectRef(n.prototype), new n();
|
|
1103
1095
|
}
|
|
1104
1096
|
case "constant":
|
|
1105
|
-
return
|
|
1097
|
+
return t.value;
|
|
1106
1098
|
case "scope":
|
|
1107
|
-
return (n) =>
|
|
1099
|
+
return (n) => Fe(t.factory, n ?? this);
|
|
1108
1100
|
}
|
|
1109
1101
|
}
|
|
1110
|
-
applyMiddleware(
|
|
1111
|
-
let
|
|
1102
|
+
applyMiddleware(t) {
|
|
1103
|
+
let e = t;
|
|
1112
1104
|
for (const n of this.middlewares)
|
|
1113
|
-
|
|
1114
|
-
return this.parent && (
|
|
1105
|
+
e = n(e);
|
|
1106
|
+
return this.parent && (e = this.parent.applyMiddleware(e)), e;
|
|
1115
1107
|
}
|
|
1116
|
-
injectRef(
|
|
1117
|
-
typeof
|
|
1108
|
+
injectRef(t) {
|
|
1109
|
+
typeof t == "object" && Object.defineProperty(t, Zt, {
|
|
1118
1110
|
get: () => this,
|
|
1119
1111
|
enumerable: !1,
|
|
1120
1112
|
configurable: !0
|
|
1121
1113
|
});
|
|
1122
1114
|
}
|
|
1123
1115
|
}
|
|
1124
|
-
const
|
|
1125
|
-
function
|
|
1126
|
-
const
|
|
1127
|
-
let
|
|
1128
|
-
for (;
|
|
1129
|
-
const n =
|
|
1130
|
-
|
|
1116
|
+
const Ke = [];
|
|
1117
|
+
function Ne(r) {
|
|
1118
|
+
const t = [];
|
|
1119
|
+
let e = r;
|
|
1120
|
+
for (; e !== Object.prototype; ) {
|
|
1121
|
+
const n = Ke.filter((o) => o.class === e);
|
|
1122
|
+
t.push(...n), e = Object.getPrototypeOf(e);
|
|
1131
1123
|
}
|
|
1132
|
-
return
|
|
1124
|
+
return t;
|
|
1133
1125
|
}
|
|
1134
|
-
const
|
|
1135
|
-
function b(
|
|
1126
|
+
const Ye = Object.getOwnPropertyNames(Reflect);
|
|
1127
|
+
function b(r, t, e = !0) {
|
|
1136
1128
|
let n;
|
|
1137
|
-
const
|
|
1138
|
-
for (const
|
|
1139
|
-
|
|
1129
|
+
const o = {};
|
|
1130
|
+
for (const l of Ye)
|
|
1131
|
+
o[l] = function(g, ...p) {
|
|
1140
1132
|
let S = n;
|
|
1141
|
-
return S || (S =
|
|
1133
|
+
return S || (S = r[Zt].resolve(t)), e && (n = S), Reflect[l](S, ...p);
|
|
1142
1134
|
};
|
|
1143
|
-
return new Proxy(
|
|
1135
|
+
return new Proxy(r, o);
|
|
1144
1136
|
}
|
|
1145
1137
|
class J {
|
|
1146
1138
|
constructor() {
|
|
1147
1139
|
this.autoCenter = !0, this.allowMultiSelect = !0;
|
|
1148
1140
|
}
|
|
1149
|
-
set(
|
|
1150
|
-
Object.assign(this,
|
|
1141
|
+
set(t) {
|
|
1142
|
+
Object.assign(this, t);
|
|
1151
1143
|
}
|
|
1152
1144
|
}
|
|
1153
|
-
class
|
|
1145
|
+
class $ {
|
|
1154
1146
|
constructor() {
|
|
1155
1147
|
this._groups = /* @__PURE__ */ new Map();
|
|
1156
1148
|
}
|
|
1157
|
-
on(
|
|
1158
|
-
let n = this._groups.get(
|
|
1159
|
-
return n || (n = /* @__PURE__ */ new Set(), this._groups.set(
|
|
1149
|
+
on(t, e = /* @__PURE__ */ Symbol()) {
|
|
1150
|
+
let n = this._groups.get(e);
|
|
1151
|
+
return n || (n = /* @__PURE__ */ new Set(), this._groups.set(e, n)), n.add(t), () => this.remove(t, e);
|
|
1160
1152
|
}
|
|
1161
|
-
once(
|
|
1162
|
-
const n = (
|
|
1163
|
-
|
|
1153
|
+
once(t, e = /* @__PURE__ */ Symbol()) {
|
|
1154
|
+
const n = (o) => {
|
|
1155
|
+
t(o), this.remove(n, e);
|
|
1164
1156
|
};
|
|
1165
|
-
return this.on(n,
|
|
1157
|
+
return this.on(n, e);
|
|
1166
1158
|
}
|
|
1167
|
-
remove(
|
|
1168
|
-
const n = this._groups.get(
|
|
1169
|
-
n && (n.delete(
|
|
1159
|
+
remove(t, e) {
|
|
1160
|
+
const n = this._groups.get(e);
|
|
1161
|
+
n && (n.delete(t), n.size === 0 && this._groups.delete(e));
|
|
1170
1162
|
}
|
|
1171
|
-
removeAll(
|
|
1172
|
-
this._groups.delete(
|
|
1163
|
+
removeAll(t) {
|
|
1164
|
+
this._groups.delete(t);
|
|
1173
1165
|
}
|
|
1174
|
-
emit(
|
|
1175
|
-
for (const
|
|
1176
|
-
for (const n of
|
|
1177
|
-
n(
|
|
1166
|
+
emit(t) {
|
|
1167
|
+
for (const e of this._groups.values())
|
|
1168
|
+
for (const n of e)
|
|
1169
|
+
n(t);
|
|
1178
1170
|
}
|
|
1179
1171
|
}
|
|
1180
|
-
class
|
|
1172
|
+
class K {
|
|
1181
1173
|
constructor() {
|
|
1182
|
-
this.mounted = new
|
|
1174
|
+
this.mounted = new $(), this.unmounted = new $(), this.selectionChanged = new $(), this.dragMove = new $(), this.dragEnd = new $(), this.objectPosUpdated = new $();
|
|
1183
1175
|
}
|
|
1184
1176
|
}
|
|
1185
|
-
const
|
|
1186
|
-
function
|
|
1187
|
-
return function(
|
|
1188
|
-
return (n,
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1177
|
+
const yt = /* @__PURE__ */ new Map();
|
|
1178
|
+
function He(r) {
|
|
1179
|
+
return function(e) {
|
|
1180
|
+
return (n, o) => {
|
|
1181
|
+
const l = yt.get(r) || [];
|
|
1182
|
+
yt.set(r, l), l.push({
|
|
1191
1183
|
target: n.constructor,
|
|
1192
|
-
memberName:
|
|
1193
|
-
metadata:
|
|
1184
|
+
memberName: o,
|
|
1185
|
+
metadata: e
|
|
1194
1186
|
});
|
|
1195
1187
|
};
|
|
1196
1188
|
};
|
|
1197
1189
|
}
|
|
1198
|
-
function
|
|
1199
|
-
return
|
|
1190
|
+
function Xe(r) {
|
|
1191
|
+
return yt.get(r) || [];
|
|
1200
1192
|
}
|
|
1201
|
-
function
|
|
1202
|
-
const n = [],
|
|
1203
|
-
for (const [
|
|
1204
|
-
if (
|
|
1205
|
-
for (const { target: S, memberName:
|
|
1206
|
-
(S ===
|
|
1207
|
-
target:
|
|
1208
|
-
memberName:
|
|
1193
|
+
function We(r, t, e = !0) {
|
|
1194
|
+
const n = [], o = Xe(r), l = e ? t.allBindings() : t.bindings.entries();
|
|
1195
|
+
for (const [g, p] of l)
|
|
1196
|
+
if (p.type === "service")
|
|
1197
|
+
for (const { target: S, memberName: _, metadata: E } of o)
|
|
1198
|
+
(S === p.class || Object.prototype.isPrototypeOf.call(S, p.class)) && n.push({
|
|
1199
|
+
target: t.resolve(g),
|
|
1200
|
+
memberName: _,
|
|
1209
1201
|
metadata: E
|
|
1210
1202
|
});
|
|
1211
1203
|
return n;
|
|
1212
1204
|
}
|
|
1213
|
-
function
|
|
1214
|
-
return
|
|
1205
|
+
function Ze(r, t, e = !0, ...n) {
|
|
1206
|
+
return We(r, t, e).map((g) => g.target[g.memberName](...n));
|
|
1215
1207
|
}
|
|
1216
|
-
const
|
|
1217
|
-
async function
|
|
1218
|
-
const
|
|
1219
|
-
await Promise.all(
|
|
1208
|
+
const qt = He("init");
|
|
1209
|
+
async function Gt(r, t = !0) {
|
|
1210
|
+
const e = Ze("init", r, t);
|
|
1211
|
+
await Promise.all(e);
|
|
1220
1212
|
}
|
|
1221
|
-
class
|
|
1213
|
+
class ct {
|
|
1222
1214
|
constructor() {
|
|
1223
1215
|
this.objects = /* @__PURE__ */ new Map();
|
|
1224
1216
|
}
|
|
1225
|
-
register(
|
|
1226
|
-
this.objects.set(
|
|
1217
|
+
register(t) {
|
|
1218
|
+
this.objects.set(t.objectId, t);
|
|
1227
1219
|
}
|
|
1228
|
-
unregister(
|
|
1229
|
-
this.objects.delete(
|
|
1220
|
+
unregister(t) {
|
|
1221
|
+
this.objects.delete(t);
|
|
1230
1222
|
}
|
|
1231
|
-
get(
|
|
1232
|
-
return this.objects.get(
|
|
1223
|
+
get(t) {
|
|
1224
|
+
return this.objects.get(t) ?? null;
|
|
1233
1225
|
}
|
|
1234
1226
|
getAll() {
|
|
1235
1227
|
return [...this.objects.values()];
|
|
@@ -1237,7 +1229,7 @@ class ce {
|
|
|
1237
1229
|
}
|
|
1238
1230
|
class Q {
|
|
1239
1231
|
constructor() {
|
|
1240
|
-
this.selectedIds = /* @__PURE__ */ new Set(), this.events = b(this,
|
|
1232
|
+
this.selectedIds = /* @__PURE__ */ new Set(), this.events = b(this, K);
|
|
1241
1233
|
}
|
|
1242
1234
|
get size() {
|
|
1243
1235
|
return this.selectedIds.size;
|
|
@@ -1248,225 +1240,225 @@ class Q {
|
|
|
1248
1240
|
getFirst() {
|
|
1249
1241
|
return [...this.selectedIds][0] ?? null;
|
|
1250
1242
|
}
|
|
1251
|
-
isSelected(
|
|
1252
|
-
return this.selectedIds.has(
|
|
1243
|
+
isSelected(t) {
|
|
1244
|
+
return this.selectedIds.has(t);
|
|
1253
1245
|
}
|
|
1254
|
-
isSingleSelected(
|
|
1255
|
-
return this.selectedIds.size === 1 && this.selectedIds.has(
|
|
1246
|
+
isSingleSelected(t) {
|
|
1247
|
+
return this.selectedIds.size === 1 && this.selectedIds.has(t);
|
|
1256
1248
|
}
|
|
1257
|
-
setSelectedIds(
|
|
1258
|
-
const
|
|
1259
|
-
this.selectedIds = new Set(
|
|
1249
|
+
setSelectedIds(t) {
|
|
1250
|
+
const e = new Set(this.selectedIds);
|
|
1251
|
+
this.selectedIds = new Set(t), this.notifySelectionChanged(e);
|
|
1260
1252
|
}
|
|
1261
|
-
selectSingle(
|
|
1262
|
-
if (this.isSingleSelected(
|
|
1253
|
+
selectSingle(t) {
|
|
1254
|
+
if (this.isSingleSelected(t))
|
|
1263
1255
|
return;
|
|
1264
|
-
const
|
|
1265
|
-
this.selectedIds.clear(), this.selectedIds.add(
|
|
1256
|
+
const e = new Set(this.selectedIds);
|
|
1257
|
+
this.selectedIds.clear(), this.selectedIds.add(t), this.notifySelectionChanged(e);
|
|
1266
1258
|
}
|
|
1267
|
-
addToSelection(...
|
|
1268
|
-
const
|
|
1269
|
-
for (const n of
|
|
1259
|
+
addToSelection(...t) {
|
|
1260
|
+
const e = new Set(this.selectedIds);
|
|
1261
|
+
for (const n of t)
|
|
1270
1262
|
this.selectedIds.add(n);
|
|
1271
|
-
this.notifySelectionChanged(
|
|
1263
|
+
this.notifySelectionChanged(e);
|
|
1272
1264
|
}
|
|
1273
|
-
removeFromSelection(...
|
|
1274
|
-
const
|
|
1275
|
-
for (const n of
|
|
1265
|
+
removeFromSelection(...t) {
|
|
1266
|
+
const e = new Set(this.selectedIds);
|
|
1267
|
+
for (const n of t)
|
|
1276
1268
|
this.selectedIds.delete(n);
|
|
1277
|
-
this.notifySelectionChanged(
|
|
1269
|
+
this.notifySelectionChanged(e);
|
|
1278
1270
|
}
|
|
1279
|
-
toggleSelection(
|
|
1280
|
-
if (this.isSelected(
|
|
1281
|
-
this.removeFromSelection(
|
|
1271
|
+
toggleSelection(t) {
|
|
1272
|
+
if (this.isSelected(t)) {
|
|
1273
|
+
this.removeFromSelection(t);
|
|
1282
1274
|
return;
|
|
1283
1275
|
}
|
|
1284
|
-
this.addToSelection(
|
|
1276
|
+
this.addToSelection(t);
|
|
1285
1277
|
}
|
|
1286
1278
|
deselectAll() {
|
|
1287
1279
|
if (this.selectedIds.size === 0)
|
|
1288
1280
|
return;
|
|
1289
|
-
const
|
|
1290
|
-
this.selectedIds.clear(), this.notifySelectionChanged(
|
|
1281
|
+
const t = new Set(this.selectedIds);
|
|
1282
|
+
this.selectedIds.clear(), this.notifySelectionChanged(t);
|
|
1291
1283
|
}
|
|
1292
|
-
notifySelectionChanged(
|
|
1293
|
-
if (
|
|
1294
|
-
let
|
|
1295
|
-
for (const n of
|
|
1284
|
+
notifySelectionChanged(t) {
|
|
1285
|
+
if (t.size === this.selectedIds.size) {
|
|
1286
|
+
let e = !1;
|
|
1287
|
+
for (const n of t)
|
|
1296
1288
|
if (!this.selectedIds.has(n)) {
|
|
1297
|
-
|
|
1289
|
+
e = !0;
|
|
1298
1290
|
break;
|
|
1299
1291
|
}
|
|
1300
|
-
if (!
|
|
1292
|
+
if (!e)
|
|
1301
1293
|
return;
|
|
1302
1294
|
}
|
|
1303
1295
|
this.events.selectionChanged.emit(this.getSelectedIds());
|
|
1304
1296
|
}
|
|
1305
|
-
setSelected(
|
|
1306
|
-
if (
|
|
1307
|
-
this.addToSelection(
|
|
1297
|
+
setSelected(t, e) {
|
|
1298
|
+
if (e) {
|
|
1299
|
+
this.addToSelection(t);
|
|
1308
1300
|
return;
|
|
1309
1301
|
}
|
|
1310
|
-
this.removeFromSelection(
|
|
1302
|
+
this.removeFromSelection(t);
|
|
1311
1303
|
}
|
|
1312
1304
|
}
|
|
1313
|
-
class
|
|
1305
|
+
class V {
|
|
1314
1306
|
constructor() {
|
|
1315
1307
|
this.zoom = 1, this.cellSize = 32, this.scrollPos = { x: 0, y: 0 }, this.viewportBox = [{ x: 0, y: 0 }, { x: 0, y: 0 }], this.canvasOrigin = { x: 0, y: 0 }, this.canvasSize = { x: 0, y: 0 };
|
|
1316
1308
|
}
|
|
1317
|
-
localToCanvas(
|
|
1309
|
+
localToCanvas(t) {
|
|
1318
1310
|
return {
|
|
1319
|
-
x:
|
|
1320
|
-
y:
|
|
1311
|
+
x: t.x * this.cellSize + this.canvasOrigin.x,
|
|
1312
|
+
y: t.y * this.cellSize + this.canvasOrigin.y
|
|
1321
1313
|
};
|
|
1322
1314
|
}
|
|
1323
|
-
canvasToLocal(
|
|
1315
|
+
canvasToLocal(t) {
|
|
1324
1316
|
return {
|
|
1325
|
-
x: (
|
|
1326
|
-
y: (
|
|
1317
|
+
x: (t.x - this.canvasOrigin.x) / this.cellSize,
|
|
1318
|
+
y: (t.y - this.canvasOrigin.y) / this.cellSize
|
|
1327
1319
|
};
|
|
1328
1320
|
}
|
|
1329
|
-
viewportToCanvas(
|
|
1321
|
+
viewportToCanvas(t) {
|
|
1330
1322
|
return {
|
|
1331
|
-
x: (
|
|
1332
|
-
y: (
|
|
1323
|
+
x: (t.x + this.scrollPos.x) / this.zoom,
|
|
1324
|
+
y: (t.y + this.scrollPos.y) / this.zoom
|
|
1333
1325
|
};
|
|
1334
1326
|
}
|
|
1335
|
-
canvasToViewport(
|
|
1327
|
+
canvasToViewport(t) {
|
|
1336
1328
|
return {
|
|
1337
|
-
x:
|
|
1338
|
-
y:
|
|
1329
|
+
x: t.x * this.zoom - this.scrollPos.x,
|
|
1330
|
+
y: t.y * this.zoom - this.scrollPos.y
|
|
1339
1331
|
};
|
|
1340
1332
|
}
|
|
1341
|
-
viewportToLocal(
|
|
1342
|
-
return this.canvasToLocal(this.viewportToCanvas(
|
|
1333
|
+
viewportToLocal(t) {
|
|
1334
|
+
return this.canvasToLocal(this.viewportToCanvas(t));
|
|
1343
1335
|
}
|
|
1344
|
-
localToViewport(
|
|
1345
|
-
return this.canvasToViewport(this.localToCanvas(
|
|
1336
|
+
localToViewport(t) {
|
|
1337
|
+
return this.canvasToViewport(this.localToCanvas(t));
|
|
1346
1338
|
}
|
|
1347
|
-
pageToViewport(
|
|
1339
|
+
pageToViewport(t) {
|
|
1348
1340
|
return {
|
|
1349
|
-
x:
|
|
1350
|
-
y:
|
|
1341
|
+
x: t.x - this.viewportBox[0].x,
|
|
1342
|
+
y: t.y - this.viewportBox[0].y
|
|
1351
1343
|
};
|
|
1352
1344
|
}
|
|
1353
|
-
pageToCanvas(
|
|
1354
|
-
return this.viewportToCanvas(this.pageToViewport(
|
|
1345
|
+
pageToCanvas(t) {
|
|
1346
|
+
return this.viewportToCanvas(this.pageToViewport(t));
|
|
1355
1347
|
}
|
|
1356
|
-
pageToLocal(
|
|
1357
|
-
return this.canvasToLocal(this.pageToCanvas(
|
|
1348
|
+
pageToLocal(t) {
|
|
1349
|
+
return this.canvasToLocal(this.pageToCanvas(t));
|
|
1358
1350
|
}
|
|
1359
1351
|
getViewportCenterInLocal() {
|
|
1360
|
-
const
|
|
1361
|
-
return this.viewportToLocal(
|
|
1352
|
+
const t = Ue(this.viewportBox), e = this.pageToViewport(t);
|
|
1353
|
+
return this.viewportToLocal(e);
|
|
1362
1354
|
}
|
|
1363
1355
|
}
|
|
1364
|
-
var
|
|
1365
|
-
for (var
|
|
1366
|
-
(
|
|
1367
|
-
return
|
|
1356
|
+
var qe = Object.defineProperty, Je = Object.getOwnPropertyDescriptor, Qe = (r, t, e, n) => {
|
|
1357
|
+
for (var o = Je(t, e), l = r.length - 1, g; l >= 0; l--)
|
|
1358
|
+
(g = r[l]) && (o = g(t, e, o) || o);
|
|
1359
|
+
return o && qe(t, e, o), o;
|
|
1368
1360
|
};
|
|
1369
|
-
class
|
|
1361
|
+
class wt {
|
|
1370
1362
|
constructor() {
|
|
1371
|
-
this.events = b(this,
|
|
1363
|
+
this.events = b(this, K), this.selection = b(this, Q), this.objectRegistry = b(this, ct), this.space = b(this, V), this.movingIds = /* @__PURE__ */ new Set(), this.moveOriginPos = null;
|
|
1372
1364
|
}
|
|
1373
1365
|
init() {
|
|
1374
|
-
this.events.dragMove.on((
|
|
1366
|
+
this.events.dragMove.on((t) => this.onDragMove(t)), this.events.dragEnd.on(() => this.stopMovingSelection()), this.events.unmounted.on(() => this.stopMovingSelection());
|
|
1375
1367
|
}
|
|
1376
|
-
isMoving(
|
|
1377
|
-
return this.movingIds.has(
|
|
1368
|
+
isMoving(t) {
|
|
1369
|
+
return this.movingIds.has(t);
|
|
1378
1370
|
}
|
|
1379
|
-
startMovingSelection(
|
|
1380
|
-
this.movingIds = new Set(this.selection.getSelectedIds()), this.moveOriginPos = { x:
|
|
1381
|
-
for (const
|
|
1382
|
-
this.objectRegistry.get(
|
|
1371
|
+
startMovingSelection(t) {
|
|
1372
|
+
this.movingIds = new Set(this.selection.getSelectedIds()), this.moveOriginPos = { x: t.pageX, y: t.pageY };
|
|
1373
|
+
for (const e of this.movingIds)
|
|
1374
|
+
this.objectRegistry.get(e)?.onMoveStart();
|
|
1383
1375
|
}
|
|
1384
|
-
onDragMove(
|
|
1376
|
+
onDragMove(t) {
|
|
1385
1377
|
if (!this.moveOriginPos)
|
|
1386
1378
|
return;
|
|
1387
|
-
const
|
|
1388
|
-
for (const
|
|
1389
|
-
this.objectRegistry.get(
|
|
1379
|
+
const e = this.space.pageToLocal(this.moveOriginPos), n = this.space.pageToLocal({ x: t.pageX, y: t.pageY }), o = Yt(n, e);
|
|
1380
|
+
for (const l of this.movingIds)
|
|
1381
|
+
this.objectRegistry.get(l)?.onMoveOffset(o);
|
|
1390
1382
|
}
|
|
1391
1383
|
stopMovingSelection() {
|
|
1392
|
-
for (const
|
|
1393
|
-
this.objectRegistry.get(
|
|
1384
|
+
for (const t of this.movingIds)
|
|
1385
|
+
this.objectRegistry.get(t)?.onMoveEnd();
|
|
1394
1386
|
this.movingIds.clear(), this.moveOriginPos = null;
|
|
1395
1387
|
}
|
|
1396
1388
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
],
|
|
1389
|
+
Qe([
|
|
1390
|
+
qt()
|
|
1391
|
+
], wt.prototype, "init");
|
|
1400
1392
|
class ts {
|
|
1401
|
-
constructor(
|
|
1402
|
-
this.config = b(this, J), this.events = b(this,
|
|
1393
|
+
constructor(t) {
|
|
1394
|
+
this.config = b(this, J), this.events = b(this, K), this.selection = b(this, Q), this.move = b(this, wt), this.space = b(this, V), this.element = null, this.selectable = !0, this.movable = !0, this.snapToGrid = !0, this.resizable = "none", this.bounds = [{ x: 1, y: 1 }, { x: 10, y: 10 }], this.pos = { x: 0, y: 0 }, this.localPos = { x: 0, y: 0, w: 1, h: 1 }, this.prevLocalPos = { x: 0, y: 0, w: 1, h: 1 }, this.resizingDirection = null, this.resizingBounds = [{ x: 0, y: 0 }, { x: 0, y: 0 }], this.objectId = t;
|
|
1403
1395
|
}
|
|
1404
|
-
setElement(
|
|
1405
|
-
this.element =
|
|
1396
|
+
setElement(t) {
|
|
1397
|
+
this.element = t;
|
|
1406
1398
|
}
|
|
1407
1399
|
getPos() {
|
|
1408
1400
|
return this.pos;
|
|
1409
1401
|
}
|
|
1410
|
-
setPos(
|
|
1411
|
-
this.pos =
|
|
1402
|
+
setPos(t) {
|
|
1403
|
+
this.pos = t, !this.isMoving() && !this.isResizing() && this.recalcLocalPos();
|
|
1412
1404
|
}
|
|
1413
1405
|
getBounds() {
|
|
1414
1406
|
return this.bounds;
|
|
1415
1407
|
}
|
|
1416
|
-
setBounds(
|
|
1417
|
-
this.bounds =
|
|
1408
|
+
setBounds(t) {
|
|
1409
|
+
this.bounds = t, !this.isMoving() && !this.isResizing() && this.recalcLocalPos();
|
|
1418
1410
|
}
|
|
1419
1411
|
isSelectable() {
|
|
1420
1412
|
return this.selectable;
|
|
1421
1413
|
}
|
|
1422
|
-
setSelectable(
|
|
1423
|
-
this.selectable =
|
|
1414
|
+
setSelectable(t) {
|
|
1415
|
+
this.selectable = t, t || this.selection.removeFromSelection(this.objectId);
|
|
1424
1416
|
}
|
|
1425
1417
|
isSelected() {
|
|
1426
1418
|
return this.selection.isSelected(this.objectId);
|
|
1427
1419
|
}
|
|
1428
|
-
setSelected(
|
|
1429
|
-
|
|
1420
|
+
setSelected(t) {
|
|
1421
|
+
t && !this.selectable || this.selection.setSelected(this.objectId, t);
|
|
1430
1422
|
}
|
|
1431
1423
|
isMovable() {
|
|
1432
1424
|
return this.movable;
|
|
1433
1425
|
}
|
|
1434
|
-
setMovable(
|
|
1435
|
-
this.movable =
|
|
1426
|
+
setMovable(t) {
|
|
1427
|
+
this.movable = t;
|
|
1436
1428
|
}
|
|
1437
1429
|
isSnapToGrid() {
|
|
1438
1430
|
return this.snapToGrid;
|
|
1439
1431
|
}
|
|
1440
|
-
setSnapToGrid(
|
|
1441
|
-
this.snapToGrid =
|
|
1432
|
+
setSnapToGrid(t) {
|
|
1433
|
+
this.snapToGrid = t;
|
|
1442
1434
|
}
|
|
1443
1435
|
isResizable() {
|
|
1444
1436
|
return this.resizable;
|
|
1445
1437
|
}
|
|
1446
|
-
setResizable(
|
|
1447
|
-
this.resizable =
|
|
1438
|
+
setResizable(t) {
|
|
1439
|
+
this.resizable = t;
|
|
1448
1440
|
}
|
|
1449
1441
|
/* Render state */
|
|
1450
1442
|
getCanvasCoords() {
|
|
1451
|
-
const
|
|
1443
|
+
const t = this.space.localToCanvas({ x: this.localPos.x, y: this.localPos.y }), e = this.space.localToCanvas({
|
|
1452
1444
|
x: this.localPos.x + this.localPos.w,
|
|
1453
1445
|
y: this.localPos.y + this.localPos.h
|
|
1454
|
-
}), n =
|
|
1446
|
+
}), n = Yt(e, t), o = this.pos.w === void 0 ? void 0 : n.x, l = this.pos.h === void 0 ? void 0 : n.y;
|
|
1455
1447
|
return {
|
|
1456
|
-
x:
|
|
1457
|
-
y:
|
|
1458
|
-
w:
|
|
1459
|
-
h:
|
|
1448
|
+
x: t.x,
|
|
1449
|
+
y: t.y,
|
|
1450
|
+
w: o,
|
|
1451
|
+
h: l
|
|
1460
1452
|
};
|
|
1461
1453
|
}
|
|
1462
1454
|
getStyle() {
|
|
1463
|
-
const
|
|
1455
|
+
const t = this.getCanvasCoords();
|
|
1464
1456
|
return {
|
|
1465
1457
|
position: "absolute",
|
|
1466
|
-
left: `${
|
|
1467
|
-
top: `${
|
|
1468
|
-
width:
|
|
1469
|
-
height:
|
|
1458
|
+
left: `${t.x}px`,
|
|
1459
|
+
top: `${t.y}px`,
|
|
1460
|
+
width: t.w === void 0 ? void 0 : `${t.w}px`,
|
|
1461
|
+
height: t.h === void 0 ? void 0 : `${t.h}px`
|
|
1470
1462
|
};
|
|
1471
1463
|
}
|
|
1472
1464
|
isMoving() {
|
|
@@ -1475,8 +1467,8 @@ class ts {
|
|
|
1475
1467
|
isResizing() {
|
|
1476
1468
|
return this.resizingDirection != null;
|
|
1477
1469
|
}
|
|
1478
|
-
commitNewPos(
|
|
1479
|
-
Object.assign(this.pos,
|
|
1470
|
+
commitNewPos(t) {
|
|
1471
|
+
Object.assign(this.pos, t), this.events.objectPosUpdated.emit({
|
|
1480
1472
|
objectId: this.objectId,
|
|
1481
1473
|
pos: { ...this.pos }
|
|
1482
1474
|
});
|
|
@@ -1486,11 +1478,11 @@ class ts {
|
|
|
1486
1478
|
* Click handles selection
|
|
1487
1479
|
* Shift/Ctrl/Meta key allows multi-select, if allowed by canvas config
|
|
1488
1480
|
*/
|
|
1489
|
-
onUiClick(
|
|
1481
|
+
onUiClick(t) {
|
|
1490
1482
|
if (!this.selectable)
|
|
1491
1483
|
return;
|
|
1492
|
-
const
|
|
1493
|
-
if (this.config.allowMultiSelect &&
|
|
1484
|
+
const e = t.shiftKey || t.ctrlKey || t.metaKey;
|
|
1485
|
+
if (this.config.allowMultiSelect && e) {
|
|
1494
1486
|
this.selection.toggleSelection(this.objectId);
|
|
1495
1487
|
return;
|
|
1496
1488
|
}
|
|
@@ -1500,22 +1492,22 @@ class ts {
|
|
|
1500
1492
|
* Dragging starts moving selected objects, if allowed.
|
|
1501
1493
|
* If not selected, single selection is performed first, then dragging starts.
|
|
1502
1494
|
*/
|
|
1503
|
-
onUiDragStart(
|
|
1504
|
-
this.movable && (this.isSelected() || (
|
|
1495
|
+
onUiDragStart(t) {
|
|
1496
|
+
this.movable && (this.isSelected() || (t.shiftKey ? this.selection.addToSelection(this.objectId) : this.selection.selectSingle(this.objectId)), !this.isResizing() && !this.isMoving() && this.move.startMovingSelection(t));
|
|
1505
1497
|
}
|
|
1506
1498
|
/**
|
|
1507
1499
|
* Drag move is re-emitted to global canvas events, so that each selected object moves.
|
|
1508
1500
|
* CanvasMove will call onMoveOffset on objects that are currently moving.
|
|
1509
1501
|
*/
|
|
1510
|
-
onUiDragMove(
|
|
1511
|
-
this.events.dragMove.emit(
|
|
1502
|
+
onUiDragMove(t) {
|
|
1503
|
+
this.events.dragMove.emit(t);
|
|
1512
1504
|
}
|
|
1513
1505
|
/**
|
|
1514
1506
|
* Drag end is re-emitted to global canvas events, so that each selected object stops moving.
|
|
1515
1507
|
* CanvasMove will call onMoveEnd on objects that are currently moving.
|
|
1516
1508
|
*/
|
|
1517
|
-
onUiDragEnd(
|
|
1518
|
-
this.events.dragEnd.emit(
|
|
1509
|
+
onUiDragEnd(t) {
|
|
1510
|
+
this.events.dragEnd.emit(t);
|
|
1519
1511
|
}
|
|
1520
1512
|
/* Moving */
|
|
1521
1513
|
/**
|
|
@@ -1529,10 +1521,10 @@ class ts {
|
|
|
1529
1521
|
* Move offset is called by CanvasMove when selected objects moves.
|
|
1530
1522
|
* It calculates the new local position based on the previous local position and the offset.
|
|
1531
1523
|
*/
|
|
1532
|
-
onMoveOffset(
|
|
1524
|
+
onMoveOffset(t) {
|
|
1533
1525
|
this.movable && (this.localPos = {
|
|
1534
|
-
x: this.prevLocalPos.x +
|
|
1535
|
-
y: this.prevLocalPos.y +
|
|
1526
|
+
x: this.prevLocalPos.x + t.x,
|
|
1527
|
+
y: this.prevLocalPos.y + t.y,
|
|
1536
1528
|
w: this.prevLocalPos.w,
|
|
1537
1529
|
h: this.prevLocalPos.h
|
|
1538
1530
|
});
|
|
@@ -1548,18 +1540,18 @@ class ts {
|
|
|
1548
1540
|
});
|
|
1549
1541
|
}
|
|
1550
1542
|
/* Resizing */
|
|
1551
|
-
startResizing(
|
|
1552
|
-
this.resizable === "none" || !this.canResizeInDirection(
|
|
1543
|
+
startResizing(t) {
|
|
1544
|
+
this.resizable === "none" || !this.canResizeInDirection(t) || (this.resizingDirection = t, this.resizingBounds = this.getObjectBounds(), this.selection.selectSingle(this.objectId));
|
|
1553
1545
|
}
|
|
1554
|
-
onResizeMove(
|
|
1546
|
+
onResizeMove(t) {
|
|
1555
1547
|
if (!this.resizingDirection)
|
|
1556
1548
|
return;
|
|
1557
|
-
const
|
|
1549
|
+
const e = { x: t.pageX, y: t.pageY }, n = this.space.pageToLocal(e), [o, l] = this.getResizingUpdates(this.resizingDirection, n);
|
|
1558
1550
|
this.localPos = {
|
|
1559
|
-
x:
|
|
1560
|
-
y:
|
|
1561
|
-
w:
|
|
1562
|
-
h:
|
|
1551
|
+
x: o.x,
|
|
1552
|
+
y: o.y,
|
|
1553
|
+
w: l.x - o.x,
|
|
1554
|
+
h: l.y - o.y
|
|
1563
1555
|
};
|
|
1564
1556
|
}
|
|
1565
1557
|
onResizeEnd() {
|
|
@@ -1583,68 +1575,68 @@ class ts {
|
|
|
1583
1575
|
}
|
|
1584
1576
|
}
|
|
1585
1577
|
getObjectBounds() {
|
|
1586
|
-
const
|
|
1578
|
+
const t = { x: this.localPos.x, y: this.localPos.y }, e = {
|
|
1587
1579
|
x: this.localPos.x + this.localPos.w,
|
|
1588
1580
|
y: this.localPos.y + this.localPos.h
|
|
1589
1581
|
};
|
|
1590
|
-
return [
|
|
1582
|
+
return [t, e];
|
|
1591
1583
|
}
|
|
1592
|
-
canResizeInDirection(
|
|
1593
|
-
return this.getResizeDirections().includes(
|
|
1584
|
+
canResizeInDirection(t) {
|
|
1585
|
+
return this.getResizeDirections().includes(t);
|
|
1594
1586
|
}
|
|
1595
1587
|
recalcLocalPos() {
|
|
1596
|
-
const
|
|
1588
|
+
const t = this.pos.w ?? this.localPos.w, e = this.pos.h ?? this.localPos.h;
|
|
1597
1589
|
this.localPos = {
|
|
1598
1590
|
x: this.pos.x,
|
|
1599
1591
|
y: this.pos.y,
|
|
1600
|
-
w: z(
|
|
1601
|
-
h: z(
|
|
1592
|
+
w: z(t, this.bounds[0].x, this.bounds[1].x),
|
|
1593
|
+
h: z(e, this.bounds[0].y, this.bounds[1].y)
|
|
1602
1594
|
};
|
|
1603
1595
|
}
|
|
1604
|
-
maybeRound(
|
|
1605
|
-
return this.snapToGrid ? Math.round(
|
|
1596
|
+
maybeRound(t) {
|
|
1597
|
+
return this.snapToGrid ? Math.round(t) : t;
|
|
1606
1598
|
}
|
|
1607
|
-
getResizingUpdates(
|
|
1608
|
-
const [n,
|
|
1609
|
-
switch (
|
|
1599
|
+
getResizingUpdates(t, e) {
|
|
1600
|
+
const [n, o] = this.resizingBounds, l = z(e.x, o.x - this.bounds[1].x, o.x - this.bounds[0].x), g = z(e.x, n.x + this.bounds[0].x, n.x + this.bounds[1].x), p = z(e.y, o.y - this.bounds[1].y, o.y - this.bounds[0].y), S = z(e.y, n.y + this.bounds[0].y, n.y + this.bounds[1].y);
|
|
1601
|
+
switch (t) {
|
|
1610
1602
|
case "n":
|
|
1611
|
-
return [{ x: n.x, y }, { x:
|
|
1603
|
+
return [{ x: n.x, y: p }, { x: o.x, y: o.y }];
|
|
1612
1604
|
case "s":
|
|
1613
|
-
return [{ x: n.x, y: n.y }, { x:
|
|
1605
|
+
return [{ x: n.x, y: n.y }, { x: o.x, y: S }];
|
|
1614
1606
|
case "w":
|
|
1615
|
-
return [{ x:
|
|
1607
|
+
return [{ x: l, y: n.y }, { x: o.x, y: o.y }];
|
|
1616
1608
|
case "e":
|
|
1617
|
-
return [{ x: n.x, y: n.y }, { x:
|
|
1609
|
+
return [{ x: n.x, y: n.y }, { x: g, y: o.y }];
|
|
1618
1610
|
case "ne":
|
|
1619
|
-
return [{ x: n.x, y }, { x:
|
|
1611
|
+
return [{ x: n.x, y: p }, { x: g, y: o.y }];
|
|
1620
1612
|
case "nw":
|
|
1621
|
-
return [{ x:
|
|
1613
|
+
return [{ x: l, y: p }, { x: o.x, y: o.y }];
|
|
1622
1614
|
case "se":
|
|
1623
|
-
return [{ x: n.x, y: n.y }, { x:
|
|
1615
|
+
return [{ x: n.x, y: n.y }, { x: g, y: S }];
|
|
1624
1616
|
case "sw":
|
|
1625
|
-
return [{ x:
|
|
1617
|
+
return [{ x: l, y: n.y }, { x: o.x, y: S }];
|
|
1626
1618
|
default:
|
|
1627
|
-
return [{ x: n.x, y: n.y }, { x:
|
|
1619
|
+
return [{ x: n.x, y: n.y }, { x: o.x, y: o.y }];
|
|
1628
1620
|
}
|
|
1629
1621
|
}
|
|
1630
1622
|
}
|
|
1631
|
-
const
|
|
1623
|
+
const es = {
|
|
1632
1624
|
props: {
|
|
1633
1625
|
canvasObject: { type: Object, required: !0 },
|
|
1634
1626
|
direction: { type: String, required: !0 }
|
|
1635
1627
|
}
|
|
1636
1628
|
};
|
|
1637
|
-
function
|
|
1638
|
-
return
|
|
1639
|
-
class:
|
|
1640
|
-
onUidragstart:
|
|
1641
|
-
onUidragmove:
|
|
1642
|
-
onUidragend:
|
|
1629
|
+
function ss(r, t, e, n, o, l) {
|
|
1630
|
+
return U(), q("div", {
|
|
1631
|
+
class: Pe(["ResizeHandle", `ResizeHandle-${e.direction}`]),
|
|
1632
|
+
onUidragstart: t[0] || (t[0] = B((g) => e.canvasObject.startResizing(e.direction), ["stop", "prevent"])),
|
|
1633
|
+
onUidragmove: t[1] || (t[1] = B((...g) => e.canvasObject.onResizeMove && e.canvasObject.onResizeMove(...g), ["stop", "prevent"])),
|
|
1634
|
+
onUidragend: t[2] || (t[2] = B((...g) => e.canvasObject.onResizeEnd && e.canvasObject.onResizeEnd(...g), ["stop", "prevent"]))
|
|
1643
1635
|
}, null, 34);
|
|
1644
1636
|
}
|
|
1645
|
-
const
|
|
1637
|
+
const ns = /* @__PURE__ */ tt(es, [["render", ss], ["__scopeId", "data-v-c83350e5"]]), is = {
|
|
1646
1638
|
components: {
|
|
1647
|
-
CanvasObjectResize:
|
|
1639
|
+
CanvasObjectResize: ns
|
|
1648
1640
|
},
|
|
1649
1641
|
props: {
|
|
1650
1642
|
canvas: { type: Object, required: !0 },
|
|
@@ -1684,66 +1676,66 @@ const is = /* @__PURE__ */ te(ss, [["render", ns], ["__scopeId", "data-v-c83350e
|
|
|
1684
1676
|
}
|
|
1685
1677
|
},
|
|
1686
1678
|
watch: {
|
|
1687
|
-
pos(
|
|
1688
|
-
this.canvasObject.setPos(
|
|
1679
|
+
pos(r) {
|
|
1680
|
+
this.canvasObject.setPos(r);
|
|
1689
1681
|
},
|
|
1690
|
-
isSelected(
|
|
1691
|
-
this.canvasObject.setSelected(
|
|
1682
|
+
isSelected(r) {
|
|
1683
|
+
this.canvasObject.setSelected(r);
|
|
1692
1684
|
},
|
|
1693
|
-
selectable(
|
|
1694
|
-
this.canvasObject.setSelectable(
|
|
1685
|
+
selectable(r) {
|
|
1686
|
+
this.canvasObject.setSelectable(r);
|
|
1695
1687
|
},
|
|
1696
|
-
movable(
|
|
1697
|
-
this.canvasObject.setMovable(
|
|
1688
|
+
movable(r) {
|
|
1689
|
+
this.canvasObject.setMovable(r);
|
|
1698
1690
|
},
|
|
1699
|
-
snapToGrid(
|
|
1700
|
-
this.canvasObject.setSnapToGrid(
|
|
1691
|
+
snapToGrid(r) {
|
|
1692
|
+
this.canvasObject.setSnapToGrid(r);
|
|
1701
1693
|
},
|
|
1702
|
-
resizable(
|
|
1703
|
-
this.canvasObject.setResizable(
|
|
1694
|
+
resizable(r) {
|
|
1695
|
+
this.canvasObject.setResizable(r);
|
|
1704
1696
|
},
|
|
1705
|
-
bounds(
|
|
1706
|
-
this.canvasObject.setBounds(
|
|
1697
|
+
bounds(r) {
|
|
1698
|
+
this.canvasObject.setBounds(r);
|
|
1707
1699
|
}
|
|
1708
1700
|
},
|
|
1709
1701
|
created() {
|
|
1710
|
-
this.canvasObject = new ts(this.objectId), this.canvas.mesh.connect(this.canvasObject), this.canvas.events.objectPosUpdated.on(({ objectId:
|
|
1711
|
-
|
|
1712
|
-
}, this), this.canvas.events.selectionChanged.on((
|
|
1713
|
-
const
|
|
1714
|
-
this.isSelected !==
|
|
1702
|
+
this.canvasObject = new ts(this.objectId), this.canvas.mesh.connect(this.canvasObject), this.canvas.events.objectPosUpdated.on(({ objectId: r, pos: t }) => {
|
|
1703
|
+
r === this.objectId && this.$emit("update:pos", t);
|
|
1704
|
+
}, this), this.canvas.events.selectionChanged.on((r) => {
|
|
1705
|
+
const t = r.includes(this.objectId);
|
|
1706
|
+
this.isSelected !== t && this.$emit("update:isSelected", t);
|
|
1715
1707
|
}, this);
|
|
1716
1708
|
},
|
|
1717
1709
|
mounted() {
|
|
1718
|
-
const
|
|
1719
|
-
this.canvas.objectRegistry.register(
|
|
1710
|
+
const r = this.canvasObject;
|
|
1711
|
+
this.canvas.objectRegistry.register(r), r.setElement(this.$refs.rootEl), r.setPos(this.pos), r.setSelectable(this.selectable), r.setMovable(this.movable), r.setSnapToGrid(this.snapToGrid), r.setResizable(this.resizable), r.setBounds(this.bounds), r.setSelected(this.isSelected);
|
|
1720
1712
|
},
|
|
1721
1713
|
unmounted() {
|
|
1722
1714
|
this.canvas.objectRegistry.unregister(this.objectId), this.canvasObject.setElement(null), this.canvas.selection.removeFromSelection(this.objectId), this.canvas.events.objectPosUpdated.removeAll(this), this.canvas.events.selectionChanged.removeAll(this);
|
|
1723
1715
|
}
|
|
1724
1716
|
};
|
|
1725
|
-
function
|
|
1726
|
-
const
|
|
1727
|
-
return
|
|
1717
|
+
function rs(r, t, e, n, o, l) {
|
|
1718
|
+
const g = ot("CanvasObjectResize");
|
|
1719
|
+
return U(), q("div", {
|
|
1728
1720
|
ref: "rootEl",
|
|
1729
1721
|
class: "CanvasObject",
|
|
1730
|
-
style: Z(
|
|
1731
|
-
onUiclick:
|
|
1732
|
-
onUidragstart:
|
|
1733
|
-
onUidragmove:
|
|
1734
|
-
onUidragend:
|
|
1722
|
+
style: Z(o.canvasObject.getStyle()),
|
|
1723
|
+
onUiclick: t[0] || (t[0] = B((...p) => o.canvasObject.onUiClick && o.canvasObject.onUiClick(...p), ["stop", "prevent"])),
|
|
1724
|
+
onUidragstart: t[1] || (t[1] = B((...p) => o.canvasObject.onUiDragStart && o.canvasObject.onUiDragStart(...p), ["stop", "prevent"])),
|
|
1725
|
+
onUidragmove: t[2] || (t[2] = B((...p) => o.canvasObject.onUiDragMove && o.canvasObject.onUiDragMove(...p), ["stop", "prevent"])),
|
|
1726
|
+
onUidragend: t[3] || (t[3] = B((...p) => o.canvasObject.onUiDragEnd && o.canvasObject.onUiDragEnd(...p), ["stop", "prevent"]))
|
|
1735
1727
|
}, [
|
|
1736
|
-
|
|
1737
|
-
(
|
|
1738
|
-
key:
|
|
1739
|
-
canvasObject:
|
|
1740
|
-
direction:
|
|
1728
|
+
it(r.$slots, "default", je(Ce(l.slotProps))),
|
|
1729
|
+
(U(!0), q(_e, null, Ee(l.resizeDirections, (p) => (U(), Nt(g, {
|
|
1730
|
+
key: p,
|
|
1731
|
+
canvasObject: o.canvasObject,
|
|
1732
|
+
direction: p
|
|
1741
1733
|
}, null, 8, ["canvasObject", "direction"]))), 128))
|
|
1742
1734
|
], 36);
|
|
1743
1735
|
}
|
|
1744
|
-
const
|
|
1736
|
+
const ms = /* @__PURE__ */ tt(is, [["render", rs]]), os = {
|
|
1745
1737
|
components: {
|
|
1746
|
-
CanvasBoxSelect:
|
|
1738
|
+
CanvasBoxSelect: Re
|
|
1747
1739
|
},
|
|
1748
1740
|
props: {
|
|
1749
1741
|
canvas: { type: Object, required: !0 }
|
|
@@ -1759,115 +1751,172 @@ const Os = /* @__PURE__ */ te(rs, [["render", os]]), as = {
|
|
|
1759
1751
|
this.canvas.selection.deselectAll();
|
|
1760
1752
|
}
|
|
1761
1753
|
}
|
|
1762
|
-
},
|
|
1763
|
-
function
|
|
1764
|
-
const
|
|
1765
|
-
return
|
|
1766
|
-
|
|
1754
|
+
}, as = { class: "CanvasView" };
|
|
1755
|
+
function cs(r, t, e, n, o, l) {
|
|
1756
|
+
const g = ot("CanvasBoxSelect");
|
|
1757
|
+
return U(), q("div", as, [
|
|
1758
|
+
C("div", {
|
|
1767
1759
|
ref: "viewport",
|
|
1768
1760
|
class: "Viewport",
|
|
1769
|
-
onMousedown:
|
|
1770
|
-
onUidragstart:
|
|
1771
|
-
onUidragmove:
|
|
1772
|
-
onUidragend:
|
|
1773
|
-
onUiclick:
|
|
1774
|
-
onScroll:
|
|
1775
|
-
onWheel:
|
|
1761
|
+
onMousedown: t[0] || (t[0] = (...p) => e.canvas.pan.onMouseDown && e.canvas.pan.onMouseDown(...p)),
|
|
1762
|
+
onUidragstart: t[1] || (t[1] = (...p) => e.canvas.boxSelect.onUiDragStart && e.canvas.boxSelect.onUiDragStart(...p)),
|
|
1763
|
+
onUidragmove: t[2] || (t[2] = (...p) => e.canvas.boxSelect.onUiDragMove && e.canvas.boxSelect.onUiDragMove(...p)),
|
|
1764
|
+
onUidragend: t[3] || (t[3] = (...p) => e.canvas.boxSelect.onUiDragEnd && e.canvas.boxSelect.onUiDragEnd(...p)),
|
|
1765
|
+
onUiclick: t[4] || (t[4] = (...p) => l.onCanvasUiClick && l.onCanvasUiClick(...p)),
|
|
1766
|
+
onScroll: t[5] || (t[5] = (...p) => e.canvas.viewport.onScroll && e.canvas.viewport.onScroll(...p)),
|
|
1767
|
+
onWheel: t[6] || (t[6] = (...p) => e.canvas.zoom.onWheel && e.canvas.zoom.onWheel(...p))
|
|
1776
1768
|
}, [
|
|
1777
|
-
|
|
1769
|
+
C("div", {
|
|
1778
1770
|
class: "Sizer",
|
|
1779
|
-
style: Z(
|
|
1771
|
+
style: Z(e.canvas.viewport.getSizerStyle())
|
|
1780
1772
|
}, null, 4),
|
|
1781
|
-
|
|
1773
|
+
C("div", {
|
|
1782
1774
|
class: "Canvas",
|
|
1783
|
-
style: Z(
|
|
1775
|
+
style: Z(e.canvas.viewport.getCanvasStyle())
|
|
1784
1776
|
}, [
|
|
1785
|
-
|
|
1786
|
-
|
|
1777
|
+
it(r.$slots, "default", {}, void 0, !0),
|
|
1778
|
+
C("div", {
|
|
1787
1779
|
class: "Origin",
|
|
1788
|
-
style: Z(
|
|
1780
|
+
style: Z(e.canvas.viewport.getOriginStyle())
|
|
1789
1781
|
}, [
|
|
1790
|
-
|
|
1782
|
+
it(r.$slots, "origin", {}, void 0, !0)
|
|
1791
1783
|
], 4)
|
|
1792
1784
|
], 4),
|
|
1793
|
-
|
|
1785
|
+
F(g, { canvas: e.canvas }, null, 8, ["canvas"])
|
|
1794
1786
|
], 544),
|
|
1795
|
-
|
|
1787
|
+
it(r.$slots, "overlays", {}, void 0, !0)
|
|
1796
1788
|
]);
|
|
1797
1789
|
}
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1790
|
+
const bs = /* @__PURE__ */ tt(os, [["render", cs], ["__scopeId", "data-v-5b37630f"]]);
|
|
1791
|
+
function nt(r, t) {
|
|
1792
|
+
const e = { x: Math.min(r.x, t.x), y: Math.min(r.y, t.y) }, n = { x: Math.max(r.x, t.x), y: Math.max(r.y, t.y) };
|
|
1793
|
+
return [e, n];
|
|
1794
|
+
}
|
|
1795
|
+
function $t(r, t) {
|
|
1796
|
+
const e = r[1].x >= t[0].x && t[1].x >= r[0].x, n = r[1].y >= t[0].y && t[1].y >= r[0].y;
|
|
1797
|
+
return e && n;
|
|
1798
|
+
}
|
|
1799
|
+
class ls {
|
|
1800
|
+
constructor(t) {
|
|
1801
|
+
this.target = t, this.entries = [];
|
|
1807
1802
|
}
|
|
1808
|
-
|
|
1809
|
-
this.
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1803
|
+
add(t, e, n) {
|
|
1804
|
+
this.target.addEventListener(t, e, n), this.entries.push({ type: t, listener: e, options: n });
|
|
1805
|
+
}
|
|
1806
|
+
removeAll() {
|
|
1807
|
+
for (const t of this.entries)
|
|
1808
|
+
this.target.removeEventListener(t.type, t.listener, t.options);
|
|
1809
|
+
this.entries = [];
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
const us = [
|
|
1813
|
+
"button",
|
|
1814
|
+
"a",
|
|
1815
|
+
"input",
|
|
1816
|
+
"textarea",
|
|
1817
|
+
"select",
|
|
1818
|
+
'[role="textbox"]',
|
|
1819
|
+
'[role="button"]',
|
|
1820
|
+
"[nodrag]"
|
|
1821
|
+
];
|
|
1822
|
+
class rt {
|
|
1823
|
+
constructor() {
|
|
1824
|
+
this.lastMousePos = { x: window.innerWidth * 0.5, y: window.innerHeight * 0.5 }, this.lmbPressed = !1, this.mmbPressed = !1, this.rmbPressed = !1, this.altKey = !1, this.ctrlKey = !1, this.metaKey = !1, this.shiftKey = !1, this.dragDistance = 4, this.windowEvents = new ls(window), this.lastMouseDownPos = { x: window.innerWidth * 0.5, y: window.innerHeight * 0.5 }, this.lastMouseDownTarget = null, this.dragTarget = null, this.inClickVicinity = !1, this.listening = !1;
|
|
1814
1825
|
}
|
|
1815
1826
|
get ctrlOrMetaKey() {
|
|
1816
1827
|
return this.ctrlKey || this.metaKey;
|
|
1817
1828
|
}
|
|
1818
|
-
|
|
1819
|
-
this.
|
|
1829
|
+
mount() {
|
|
1830
|
+
this.listening || (this.listening = !0, this.windowEvents.add("mousedown", (t) => this.onMouseDown(t)), this.windowEvents.add("mousemove", (t) => this.onMouseMove(t)), this.windowEvents.add("mouseup", (t) => this.onMouseUp(t)), this.windowEvents.add("keydown", (t) => this.onKeyDown(t)), this.windowEvents.add("keyup", (t) => this.onKeyUp(t)));
|
|
1831
|
+
}
|
|
1832
|
+
unmount() {
|
|
1833
|
+
this.listening && (this.listening = !1, this.windowEvents.removeAll(), this.dragTarget = null, this.inClickVicinity = !1, this.lastMouseDownTarget = null);
|
|
1834
|
+
}
|
|
1835
|
+
onMouseDown(t) {
|
|
1836
|
+
this.lastMousePos = { x: t.pageX, y: t.pageY }, this.lmbPressed = t.button === 0, this.mmbPressed = t.button === 1, this.rmbPressed = t.button === 2, t.button === 0 && (this.lastMouseDownPos = { x: t.pageX, y: t.pageY }, this.lastMouseDownTarget = t.target, this.inClickVicinity = !0);
|
|
1837
|
+
}
|
|
1838
|
+
onMouseMove(t) {
|
|
1839
|
+
if (this.lastMousePos = { x: t.pageX, y: t.pageY }, !this.lmbPressed)
|
|
1840
|
+
return;
|
|
1841
|
+
if (this.dragTarget) {
|
|
1842
|
+
this.dragTarget.dispatchEvent(this.cloneMouseEvent("uidragmove", t));
|
|
1843
|
+
return;
|
|
1844
|
+
}
|
|
1845
|
+
if (!this.inClickVicinity || !this.lastMouseDownTarget)
|
|
1846
|
+
return;
|
|
1847
|
+
const e = t.pageX - this.lastMouseDownPos.x, n = t.pageY - this.lastMouseDownPos.y;
|
|
1848
|
+
Math.hypot(e, n) < this.dragDistance || (this.inClickVicinity = !1, this.isDragAllowed(this.lastMouseDownTarget) && (this.dragTarget = this.lastMouseDownTarget, this.dragTarget.dispatchEvent(this.cloneMouseEvent("uidragstart", t))));
|
|
1849
|
+
}
|
|
1850
|
+
onMouseUp(t) {
|
|
1851
|
+
if (t.button === 0) {
|
|
1852
|
+
const e = this.dragTarget, n = this.inClickVicinity, o = this.lastMouseDownTarget;
|
|
1853
|
+
this.dragTarget = null, this.inClickVicinity = !1, this.lastMouseDownTarget = null, e && e.dispatchEvent(this.cloneMouseEvent("uidragend", t)), n && o && (o.dispatchEvent(this.cloneMouseEvent("uiclick", t)), this.dispatchActivate(o, t));
|
|
1854
|
+
}
|
|
1855
|
+
this.lastMousePos = { x: t.pageX, y: t.pageY }, this.lmbPressed = !1, this.mmbPressed = !1, this.rmbPressed = !1;
|
|
1856
|
+
}
|
|
1857
|
+
onKeyDown(t) {
|
|
1858
|
+
this.updateModifiers(t), (t.key === "Enter" || t.key === " ") && t.target && (t.target === document.body && t.key === " " && t.preventDefault(), this.dispatchActivate(t.target, t));
|
|
1820
1859
|
}
|
|
1821
|
-
|
|
1822
|
-
this.
|
|
1860
|
+
onKeyUp(t) {
|
|
1861
|
+
this.updateModifiers(t);
|
|
1823
1862
|
}
|
|
1824
|
-
|
|
1825
|
-
this.
|
|
1863
|
+
updateModifiers(t) {
|
|
1864
|
+
this.altKey = t.altKey, this.ctrlKey = t.ctrlKey, this.metaKey = t.metaKey, this.shiftKey = t.shiftKey;
|
|
1826
1865
|
}
|
|
1827
|
-
|
|
1828
|
-
|
|
1866
|
+
dispatchActivate(t, e) {
|
|
1867
|
+
t.closest(":disabled") || t.dispatchEvent(new CustomEvent("uiactivate", { detail: e }));
|
|
1829
1868
|
}
|
|
1830
|
-
|
|
1831
|
-
|
|
1869
|
+
isDragAllowed(t) {
|
|
1870
|
+
return t instanceof Element ? !t.closest(us.join(",")) : !1;
|
|
1832
1871
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1872
|
+
cloneMouseEvent(t, e) {
|
|
1873
|
+
return new MouseEvent(t, {
|
|
1874
|
+
bubbles: !0,
|
|
1875
|
+
cancelable: !0,
|
|
1876
|
+
clientX: e.clientX,
|
|
1877
|
+
clientY: e.clientY,
|
|
1878
|
+
screenX: e.screenX,
|
|
1879
|
+
screenY: e.screenY,
|
|
1880
|
+
button: e.button,
|
|
1881
|
+
buttons: e.buttons,
|
|
1882
|
+
ctrlKey: e.ctrlKey,
|
|
1883
|
+
shiftKey: e.shiftKey,
|
|
1884
|
+
altKey: e.altKey,
|
|
1885
|
+
metaKey: e.metaKey
|
|
1886
|
+
});
|
|
1835
1887
|
}
|
|
1836
1888
|
}
|
|
1837
|
-
|
|
1838
|
-
he()
|
|
1839
|
-
], ee.prototype, "init");
|
|
1840
|
-
class Ye {
|
|
1889
|
+
class Ft {
|
|
1841
1890
|
constructor() {
|
|
1842
|
-
this.config = b(this, J), this.
|
|
1891
|
+
this.config = b(this, J), this.inputStateManager = b(this, rt), this.objectRegistry = b(this, ct), this.selection = b(this, Q), this.space = b(this, V), this.selectionOriginPos = null, this.initialSelectionIds = /* @__PURE__ */ new Set(), this.objectBoxes = [];
|
|
1843
1892
|
}
|
|
1844
1893
|
isSelecting() {
|
|
1845
1894
|
return this.selectionOriginPos != null;
|
|
1846
1895
|
}
|
|
1847
|
-
onUiDragStart(
|
|
1848
|
-
this.config.allowMultiSelect && (this.isSelecting() || (this.selectionOriginPos = { x:
|
|
1896
|
+
onUiDragStart(t) {
|
|
1897
|
+
this.config.allowMultiSelect && (this.isSelecting() || (this.selectionOriginPos = { x: t.pageX, y: t.pageY }, t.shiftKey ? this.initialSelectionIds = new Set(this.selection.getSelectedIds()) : (this.initialSelectionIds.clear(), this.selection.deselectAll()), this.captureObjectBoxes()));
|
|
1849
1898
|
}
|
|
1850
|
-
onUiDragMove(
|
|
1851
|
-
this.isSelecting() && (
|
|
1899
|
+
onUiDragMove(t) {
|
|
1900
|
+
this.isSelecting() && (t.preventDefault(), this.updateSelection(t));
|
|
1852
1901
|
}
|
|
1853
|
-
onUiDragEnd(
|
|
1854
|
-
this.isSelecting() && this.updateSelection(
|
|
1902
|
+
onUiDragEnd(t) {
|
|
1903
|
+
this.isSelecting() && this.updateSelection(t), this.stopSelecting();
|
|
1855
1904
|
}
|
|
1856
1905
|
getSelectionBox() {
|
|
1857
|
-
return this.selectionOriginPos ?
|
|
1906
|
+
return this.selectionOriginPos ? nt(
|
|
1858
1907
|
this.space.pageToLocal(this.selectionOriginPos),
|
|
1859
|
-
this.space.pageToLocal(this.
|
|
1908
|
+
this.space.pageToLocal(this.inputStateManager.lastMousePos)
|
|
1860
1909
|
) : null;
|
|
1861
1910
|
}
|
|
1862
1911
|
getSelectionStyle() {
|
|
1863
1912
|
if (!this.selectionOriginPos)
|
|
1864
1913
|
return null;
|
|
1865
|
-
const
|
|
1914
|
+
const t = nt(this.selectionOriginPos, this.inputStateManager.lastMousePos), e = this.space.pageToCanvas(t[0]), n = this.space.pageToCanvas(t[1]);
|
|
1866
1915
|
return {
|
|
1867
|
-
left: `${
|
|
1868
|
-
top: `${
|
|
1869
|
-
width: `${n.x -
|
|
1870
|
-
height: `${n.y -
|
|
1916
|
+
left: `${e.x}px`,
|
|
1917
|
+
top: `${e.y}px`,
|
|
1918
|
+
width: `${n.x - e.x}px`,
|
|
1919
|
+
height: `${n.y - e.y}px`
|
|
1871
1920
|
};
|
|
1872
1921
|
}
|
|
1873
1922
|
stopSelecting() {
|
|
@@ -1875,57 +1924,57 @@ class Ye {
|
|
|
1875
1924
|
}
|
|
1876
1925
|
captureObjectBoxes() {
|
|
1877
1926
|
this.objectBoxes = [];
|
|
1878
|
-
const
|
|
1879
|
-
for (const
|
|
1880
|
-
if (!
|
|
1927
|
+
const t = this.space.viewportBox;
|
|
1928
|
+
for (const e of this.objectRegistry.getAll()) {
|
|
1929
|
+
if (!e.isSelectable())
|
|
1881
1930
|
continue;
|
|
1882
|
-
const n =
|
|
1931
|
+
const n = e.element;
|
|
1883
1932
|
if (!n)
|
|
1884
1933
|
continue;
|
|
1885
|
-
const
|
|
1886
|
-
{ x:
|
|
1887
|
-
{ x:
|
|
1934
|
+
const o = n.getBoundingClientRect(), l = nt(
|
|
1935
|
+
{ x: o.left, y: o.top },
|
|
1936
|
+
{ x: o.right, y: o.bottom }
|
|
1888
1937
|
);
|
|
1889
|
-
if (
|
|
1938
|
+
if (!$t(l, t))
|
|
1890
1939
|
continue;
|
|
1891
|
-
const
|
|
1892
|
-
this.space.pageToLocal(
|
|
1893
|
-
this.space.pageToLocal(
|
|
1940
|
+
const g = nt(
|
|
1941
|
+
this.space.pageToLocal(l[0]),
|
|
1942
|
+
this.space.pageToLocal(l[1])
|
|
1894
1943
|
);
|
|
1895
|
-
this.objectBoxes.push([
|
|
1944
|
+
this.objectBoxes.push([e.objectId, g]);
|
|
1896
1945
|
}
|
|
1897
1946
|
}
|
|
1898
|
-
updateSelection(
|
|
1899
|
-
const
|
|
1900
|
-
if (!
|
|
1947
|
+
updateSelection(t) {
|
|
1948
|
+
const e = this.getSelectionBox();
|
|
1949
|
+
if (!e)
|
|
1901
1950
|
return;
|
|
1902
1951
|
const n = new Set(this.initialSelectionIds);
|
|
1903
|
-
for (const [
|
|
1904
|
-
|
|
1952
|
+
for (const [o, l] of this.objectBoxes)
|
|
1953
|
+
$t(e, l) && n.add(o);
|
|
1905
1954
|
this.selection.setSelectedIds(n);
|
|
1906
1955
|
}
|
|
1907
1956
|
}
|
|
1908
|
-
class
|
|
1957
|
+
class lt {
|
|
1909
1958
|
constructor() {
|
|
1910
|
-
this.viewportEl = null, this.windowEvents = new
|
|
1959
|
+
this.viewportEl = null, this.windowEvents = new Xt(window), this.config = b(this, J), this.space = b(this, V);
|
|
1911
1960
|
}
|
|
1912
|
-
mount(
|
|
1913
|
-
this.viewportEl =
|
|
1961
|
+
mount(t) {
|
|
1962
|
+
this.viewportEl = t, this.recalcCanvasMetrics(), this.updateViewportBox(), this.centerOnOrigin(), this.onScroll(), this.windowEvents.add("resize", () => this.updateViewportBox()), this.windowEvents.add("scroll", () => this.updateViewportBox()), this.config.autoCenter && requestAnimationFrame(() => this.centerOnOrigin());
|
|
1914
1963
|
}
|
|
1915
1964
|
destroy() {
|
|
1916
1965
|
this.windowEvents.removeAll(), this.viewportEl = null, this.space.viewportBox = [{ x: 0, y: 0 }, { x: 0, y: 0 }];
|
|
1917
1966
|
}
|
|
1918
1967
|
getCanvasStyle() {
|
|
1919
|
-
const
|
|
1968
|
+
const t = Bt(this.viewportEl, "--canvas-grid-major-color", "#ddd"), e = Bt(this.viewportEl, "--canvas-grid-minor-color", "#eee"), n = W(this.viewportEl, "--canvas-grid-subdivisions", 4), o = W(this.viewportEl, "--canvas-grid-major-radius", 2), l = W(this.viewportEl, "--canvas-grid-minor-radius", 1), g = Ve(
|
|
1920
1969
|
this.space.cellSize,
|
|
1921
1970
|
n,
|
|
1922
|
-
e,
|
|
1923
|
-
r,
|
|
1924
1971
|
t,
|
|
1925
|
-
|
|
1972
|
+
o,
|
|
1973
|
+
e,
|
|
1974
|
+
l
|
|
1926
1975
|
);
|
|
1927
1976
|
return {
|
|
1928
|
-
background: `url(${`data:image/svg+xml;base64,${window.btoa(
|
|
1977
|
+
background: `url(${`data:image/svg+xml;base64,${window.btoa(g)}`}) repeat`,
|
|
1929
1978
|
width: `${this.space.canvasSize.x}px`,
|
|
1930
1979
|
height: `${this.space.canvasSize.y}px`,
|
|
1931
1980
|
transformOrigin: "0 0",
|
|
@@ -1953,29 +2002,29 @@ class le {
|
|
|
1953
2002
|
centerOnOrigin() {
|
|
1954
2003
|
if (!this.viewportEl)
|
|
1955
2004
|
return;
|
|
1956
|
-
const
|
|
2005
|
+
const t = this.getViewportSize();
|
|
1957
2006
|
this.setViewportScroll({
|
|
1958
|
-
x: this.space.canvasOrigin.x * this.space.zoom -
|
|
1959
|
-
y: this.space.canvasOrigin.y * this.space.zoom -
|
|
2007
|
+
x: this.space.canvasOrigin.x * this.space.zoom - t.x * 0.5,
|
|
2008
|
+
y: this.space.canvasOrigin.y * this.space.zoom - t.y * 0.5
|
|
1960
2009
|
});
|
|
1961
2010
|
}
|
|
1962
|
-
scrollBy(
|
|
2011
|
+
scrollBy(t, e) {
|
|
1963
2012
|
this.viewportEl && this.setViewportScroll({
|
|
1964
|
-
x: this.viewportEl.scrollLeft +
|
|
1965
|
-
y: this.viewportEl.scrollTop +
|
|
2013
|
+
x: this.viewportEl.scrollLeft + t,
|
|
2014
|
+
y: this.viewportEl.scrollTop + e
|
|
1966
2015
|
});
|
|
1967
2016
|
}
|
|
1968
|
-
scrollToLocalPoint(
|
|
1969
|
-
const
|
|
2017
|
+
scrollToLocalPoint(t) {
|
|
2018
|
+
const e = this.getViewportSize(), n = this.space.localToCanvas(t);
|
|
1970
2019
|
this.setViewportScroll({
|
|
1971
|
-
x: n.x * this.space.zoom -
|
|
1972
|
-
y: n.y * this.space.zoom -
|
|
2020
|
+
x: n.x * this.space.zoom - e.x * 0.5,
|
|
2021
|
+
y: n.y * this.space.zoom - e.y * 0.5
|
|
1973
2022
|
});
|
|
1974
2023
|
}
|
|
1975
|
-
setViewportScroll(
|
|
2024
|
+
setViewportScroll(t) {
|
|
1976
2025
|
this.viewportEl && (this.viewportEl.scrollTo({
|
|
1977
|
-
left: Math.max(0,
|
|
1978
|
-
top: Math.max(0,
|
|
2026
|
+
left: Math.max(0, t.x),
|
|
2027
|
+
top: Math.max(0, t.y),
|
|
1979
2028
|
behavior: "auto"
|
|
1980
2029
|
}), this.onScroll());
|
|
1981
2030
|
}
|
|
@@ -1984,10 +2033,10 @@ class le {
|
|
|
1984
2033
|
this.space.viewportBox = [{ x: 0, y: 0 }, { x: 0, y: 0 }];
|
|
1985
2034
|
return;
|
|
1986
2035
|
}
|
|
1987
|
-
const
|
|
2036
|
+
const t = this.viewportEl.getBoundingClientRect();
|
|
1988
2037
|
this.space.viewportBox = [
|
|
1989
|
-
{ x:
|
|
1990
|
-
{ x:
|
|
2038
|
+
{ x: t.left, y: t.top },
|
|
2039
|
+
{ x: t.right, y: t.bottom }
|
|
1991
2040
|
];
|
|
1992
2041
|
}
|
|
1993
2042
|
getViewportSize() {
|
|
@@ -1997,175 +2046,100 @@ class le {
|
|
|
1997
2046
|
};
|
|
1998
2047
|
}
|
|
1999
2048
|
recalcCanvasMetrics() {
|
|
2000
|
-
const
|
|
2049
|
+
const t = W(this.viewportEl, "--canvas-margin-cells", 64);
|
|
2001
2050
|
this.space.cellSize = W(this.viewportEl, "--canvas-grid-cell-size", 32);
|
|
2002
|
-
const
|
|
2003
|
-
this.space.canvasSize = { x:
|
|
2051
|
+
const e = t * this.space.cellSize;
|
|
2052
|
+
this.space.canvasSize = { x: e * 2, y: e * 2 }, this.space.canvasOrigin = { x: e, y: e };
|
|
2004
2053
|
}
|
|
2005
2054
|
}
|
|
2006
|
-
var
|
|
2007
|
-
for (var
|
|
2008
|
-
(
|
|
2009
|
-
return
|
|
2055
|
+
var hs = Object.defineProperty, ds = Object.getOwnPropertyDescriptor, fs = (r, t, e, n) => {
|
|
2056
|
+
for (var o = ds(t, e), l = r.length - 1, g; l >= 0; l--)
|
|
2057
|
+
(g = r[l]) && (o = g(t, e, o) || o);
|
|
2058
|
+
return o && hs(t, e, o), o;
|
|
2010
2059
|
};
|
|
2011
|
-
class
|
|
2060
|
+
class gt {
|
|
2012
2061
|
constructor() {
|
|
2013
|
-
this.viewport = b(this,
|
|
2062
|
+
this.viewport = b(this, lt), this.events = b(this, K), this.windowEvents = new Xt(window), this.isPanning = !1;
|
|
2014
2063
|
}
|
|
2015
2064
|
init() {
|
|
2016
2065
|
this.events.unmounted.on(() => this.stopPanning());
|
|
2017
2066
|
}
|
|
2018
|
-
onMouseDown(
|
|
2019
|
-
|
|
2067
|
+
onMouseDown(t) {
|
|
2068
|
+
t.button === 1 && (t.preventDefault(), this.isPanning = !0, this.windowEvents.add("mousemove", (e) => this.onMouseMove(e)), this.windowEvents.add("mouseup", (e) => this.onMouseUp(e)));
|
|
2020
2069
|
}
|
|
2021
2070
|
stopPanning() {
|
|
2022
2071
|
this.isPanning = !1, this.windowEvents.removeAll();
|
|
2023
2072
|
}
|
|
2024
|
-
onMouseMove(
|
|
2025
|
-
this.isPanning && this.viewport.scrollBy(-
|
|
2026
|
-
}
|
|
2027
|
-
onMouseUp(e) {
|
|
2028
|
-
e.button === 1 && this.stopPanning();
|
|
2073
|
+
onMouseMove(t) {
|
|
2074
|
+
this.isPanning && this.viewport.scrollBy(-t.movementX, -t.movementY);
|
|
2029
2075
|
}
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
he()
|
|
2033
|
-
], me.prototype, "init");
|
|
2034
|
-
var ys = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ws = (o, e, t, n) => {
|
|
2035
|
-
for (var r = gs(e, t), c = o.length - 1, p; c >= 0; c--)
|
|
2036
|
-
(p = o[c]) && (r = p(e, t, r) || r);
|
|
2037
|
-
return r && ys(e, t, r), r;
|
|
2038
|
-
};
|
|
2039
|
-
const ms = [
|
|
2040
|
-
"button",
|
|
2041
|
-
"a",
|
|
2042
|
-
"input",
|
|
2043
|
-
"textarea",
|
|
2044
|
-
"select",
|
|
2045
|
-
'[role="textbox"]',
|
|
2046
|
-
'[role="button"]',
|
|
2047
|
-
"[nodrag]"
|
|
2048
|
-
];
|
|
2049
|
-
class be {
|
|
2050
|
-
constructor() {
|
|
2051
|
-
this.events = b(this, k), this.inputState = b(this, ee), this.windowEvents = new ue(window), this.lastMouseDownPos = { x: window.innerWidth * 0.5, y: window.innerHeight * 0.5 }, this.lastMouseDownTarget = null, this.dragTarget = null, this.inClickVicinity = !1, this.dragDistance = 4;
|
|
2052
|
-
}
|
|
2053
|
-
init() {
|
|
2054
|
-
this.events.mounted.on(() => {
|
|
2055
|
-
this.windowEvents.add("mousedown", (e) => this.onMouseDown(e)), this.windowEvents.add("mousemove", (e) => this.onMouseMove(e)), this.windowEvents.add("mouseup", (e) => this.onMouseUp(e)), this.windowEvents.add("keydown", (e) => this.onKeyDown(e));
|
|
2056
|
-
}), this.events.unmounted.on(() => {
|
|
2057
|
-
this.windowEvents.removeAll();
|
|
2058
|
-
});
|
|
2059
|
-
}
|
|
2060
|
-
onMouseDown(e) {
|
|
2061
|
-
e.button === 0 && (this.lastMouseDownPos = { x: e.pageX, y: e.pageY }, this.lastMouseDownTarget = e.target, this.inClickVicinity = !0);
|
|
2062
|
-
}
|
|
2063
|
-
onMouseMove(e) {
|
|
2064
|
-
if (!this.inputState.lmbPressed)
|
|
2065
|
-
return;
|
|
2066
|
-
if (this.dragTarget) {
|
|
2067
|
-
this.dragTarget.dispatchEvent(this.cloneMouseEvent("uidragmove", e));
|
|
2068
|
-
return;
|
|
2069
|
-
}
|
|
2070
|
-
if (!this.inClickVicinity || !this.lastMouseDownTarget)
|
|
2071
|
-
return;
|
|
2072
|
-
const t = e.pageX - this.lastMouseDownPos.x, n = e.pageY - this.lastMouseDownPos.y;
|
|
2073
|
-
Math.hypot(t, n) < this.dragDistance || (this.inClickVicinity = !1, this.isDragAllowed(this.lastMouseDownTarget) && (this.dragTarget = this.lastMouseDownTarget, this.dragTarget.dispatchEvent(this.cloneMouseEvent("uidragstart", e))));
|
|
2074
|
-
}
|
|
2075
|
-
onMouseUp(e) {
|
|
2076
|
-
if (e.button !== 0)
|
|
2077
|
-
return;
|
|
2078
|
-
const t = this.dragTarget, n = this.inClickVicinity, r = this.lastMouseDownTarget;
|
|
2079
|
-
this.dragTarget = null, this.inClickVicinity = !1, this.lastMouseDownTarget = null, t && t.dispatchEvent(this.cloneMouseEvent("uidragend", e)), n && r && (r.dispatchEvent(this.cloneMouseEvent("uiclick", e)), this.dispatchActivate(r, e));
|
|
2080
|
-
}
|
|
2081
|
-
onKeyDown(e) {
|
|
2082
|
-
(e.key === "Enter" || e.key === " ") && e.target && (e.target === document.body && e.key === " " && e.preventDefault(), this.dispatchActivate(e.target, e));
|
|
2083
|
-
}
|
|
2084
|
-
dispatchActivate(e, t) {
|
|
2085
|
-
e.closest(":disabled") || e.dispatchEvent(new CustomEvent("uiactivate", { detail: t }));
|
|
2086
|
-
}
|
|
2087
|
-
isDragAllowed(e) {
|
|
2088
|
-
return e instanceof Element ? !e.closest(ms.join(",")) : !1;
|
|
2089
|
-
}
|
|
2090
|
-
cloneMouseEvent(e, t) {
|
|
2091
|
-
return new MouseEvent(e, {
|
|
2092
|
-
bubbles: !0,
|
|
2093
|
-
cancelable: !0,
|
|
2094
|
-
clientX: t.clientX,
|
|
2095
|
-
clientY: t.clientY,
|
|
2096
|
-
screenX: t.screenX,
|
|
2097
|
-
screenY: t.screenY,
|
|
2098
|
-
button: t.button,
|
|
2099
|
-
buttons: t.buttons,
|
|
2100
|
-
ctrlKey: t.ctrlKey,
|
|
2101
|
-
shiftKey: t.shiftKey,
|
|
2102
|
-
altKey: t.altKey,
|
|
2103
|
-
metaKey: t.metaKey
|
|
2104
|
-
});
|
|
2076
|
+
onMouseUp(t) {
|
|
2077
|
+
t.button === 1 && this.stopPanning();
|
|
2105
2078
|
}
|
|
2106
2079
|
}
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
],
|
|
2110
|
-
const
|
|
2111
|
-
class
|
|
2080
|
+
fs([
|
|
2081
|
+
qt()
|
|
2082
|
+
], gt.prototype, "init");
|
|
2083
|
+
const k = [0.33, 0.5, 0.6, 0.75, 0.85, 1, 1.15, 1.25, 1.5, 1.75, 2], vs = Math.min(...k), ps = Math.max(...k);
|
|
2084
|
+
class Kt {
|
|
2112
2085
|
constructor() {
|
|
2113
|
-
this.viewport = b(this,
|
|
2086
|
+
this.viewport = b(this, lt), this.space = b(this, V);
|
|
2114
2087
|
}
|
|
2115
|
-
onWheel(
|
|
2116
|
-
if (!
|
|
2088
|
+
onWheel(t) {
|
|
2089
|
+
if (!t.ctrlKey)
|
|
2117
2090
|
return;
|
|
2118
|
-
|
|
2119
|
-
const
|
|
2091
|
+
t.preventDefault();
|
|
2092
|
+
const e = z(t.deltaY, -40, 40) / 400, n = Math.exp(-e);
|
|
2120
2093
|
this.setZoom(this.space.zoom * n);
|
|
2121
2094
|
}
|
|
2122
|
-
setZoom(
|
|
2123
|
-
const
|
|
2124
|
-
this.space.zoom = z(
|
|
2095
|
+
setZoom(t) {
|
|
2096
|
+
const e = this.space.getViewportCenterInLocal();
|
|
2097
|
+
this.space.zoom = z(t, vs, ps), this.viewport.scrollToLocalPoint(e);
|
|
2125
2098
|
}
|
|
2126
2099
|
zoomIn() {
|
|
2127
|
-
const
|
|
2128
|
-
|
|
2100
|
+
const t = this.getClosestZoomStepIndex();
|
|
2101
|
+
t < k.length - 1 && this.setZoom(k[t + 1]);
|
|
2129
2102
|
}
|
|
2130
2103
|
zoomOut() {
|
|
2131
|
-
const
|
|
2132
|
-
|
|
2104
|
+
const t = this.getClosestZoomStepIndex();
|
|
2105
|
+
t > 0 && this.setZoom(k[t - 1]);
|
|
2133
2106
|
}
|
|
2134
2107
|
getClosestZoomStepIndex() {
|
|
2135
|
-
let
|
|
2136
|
-
for (let n = 0; n <
|
|
2137
|
-
const
|
|
2138
|
-
|
|
2108
|
+
let t = 0, e = Number.POSITIVE_INFINITY;
|
|
2109
|
+
for (let n = 0; n < k.length; n++) {
|
|
2110
|
+
const o = Math.abs(k[n] - this.space.zoom);
|
|
2111
|
+
o < e && (e = o, t = n);
|
|
2139
2112
|
}
|
|
2140
|
-
return
|
|
2113
|
+
return t;
|
|
2141
2114
|
}
|
|
2142
2115
|
}
|
|
2143
|
-
class
|
|
2144
|
-
constructor(
|
|
2145
|
-
this.mesh = new
|
|
2116
|
+
class xs {
|
|
2117
|
+
constructor(t = {}) {
|
|
2118
|
+
this.mesh = new at(), this.boxSelect = b(this, Ft), this.config = b(this, J), this.space = b(this, V), this.viewport = b(this, lt), this.pan = b(this, gt), this.events = b(this, K), this.inputStateManager = b(this, rt), this.objectRegistry = b(this, ct), this.selection = b(this, Q), this.zoom = b(this, Kt);
|
|
2119
|
+
const e = t.inputStateManager ?? new rt();
|
|
2120
|
+
this.ownsInputStateManager = t.inputStateManager == null, this.mesh.connect(this), this.mesh.use((n) => Ie(n)), this.mesh.constant(rt, e), this.mesh.service(Ft), this.mesh.service(lt), this.mesh.service(gt), this.mesh.service(J), this.mesh.service(V), this.mesh.service(K), this.mesh.service(wt), this.mesh.service(ct), this.mesh.service(Q), this.mesh.service(Kt), this.config.set(t);
|
|
2146
2121
|
}
|
|
2147
|
-
mount(
|
|
2148
|
-
|
|
2122
|
+
mount(t) {
|
|
2123
|
+
Gt(this.mesh), this.viewport.mount(t), this.events.mounted.emit(), this.ownsInputStateManager && this.inputStateManager.mount();
|
|
2149
2124
|
}
|
|
2150
2125
|
unmount() {
|
|
2151
|
-
|
|
2126
|
+
Gt(this.mesh), this.viewport.destroy(), this.ownsInputStateManager && this.inputStateManager.unmount(), this.events.unmounted.emit();
|
|
2152
2127
|
}
|
|
2153
2128
|
}
|
|
2154
2129
|
export {
|
|
2155
|
-
|
|
2130
|
+
Re as CanvasBoxSelect,
|
|
2156
2131
|
J as CanvasConfig,
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
Os as CanvasObject,
|
|
2132
|
+
xs as CanvasController,
|
|
2133
|
+
gs as CanvasDebugCoords,
|
|
2134
|
+
K as CanvasEvents,
|
|
2135
|
+
ms as CanvasObject,
|
|
2162
2136
|
ts as CanvasObjectController,
|
|
2163
|
-
|
|
2164
|
-
|
|
2137
|
+
ct as CanvasObjectRegistry,
|
|
2138
|
+
gt as CanvasPan,
|
|
2165
2139
|
Q as CanvasSelection,
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2140
|
+
V as CanvasSpace,
|
|
2141
|
+
bs as CanvasView,
|
|
2142
|
+
lt as CanvasViewport,
|
|
2143
|
+
Kt as CanvasZoom,
|
|
2144
|
+
rt as InputStateManager
|
|
2171
2145
|
};
|