@kolkrabbi/design-editor 0.2.0 → 0.3.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/README.md +41 -26
- package/dist/{BufferResource-CKQMSOM4.js → BufferResource-BfLgK37S.js} +42 -34
- package/dist/{CanvasPool-ilDNHrRx.js → CanvasPool-YNSF8hsR.js} +9 -9
- package/dist/CanvasRenderer-Bl0rlqNq.js +2 -0
- package/dist/{browserAll-CJ593myQ.js → FederatedEventTarget-BJgROaRQ.js} +119 -127
- package/dist/FilterSystem-BUrPNXx-.js +1323 -0
- package/dist/{Geometry-D3fkwmax.js → Geometry-C5s5KpWq.js} +492 -411
- package/dist/{OrbitControls-CE3qSrHQ.js → OrbitControls-Cql8Rn2i.js} +1944 -1914
- package/dist/{RenderTargetSystem-umK0aqrs.js → RenderTargetSystem-oFwWv5IW.js} +1107 -612
- package/dist/WebGLRenderer-CXxpVIx3.js +2 -0
- package/dist/WebGPURenderer-BwLEUYBa.js +2 -0
- package/dist/browserAll-CAzdTUbR.js +6 -0
- package/dist/canvasUtils-BoNfkAod.js +168 -0
- package/dist/{rolldown-runtime-B0aSnxlc.js → chunk-3b4jIN3o.js} +4 -11
- package/dist/design-editor.css +2 -2
- package/dist/design-editor.js +7675 -8478
- package/dist/{getTextureBatchBindGroup-ChWkOJ3t.js → getTextureBatchBindGroup-CNWhZRbV.js} +5 -5
- package/dist/{host-6EhdLf5-.js → host-CVR9RL_W.js} +8 -6
- package/dist/{host-DPFYZP9I.js → host-be1CWhN1.js} +4 -2
- package/dist/init-jApIMi04.js +4 -0
- package/dist/{phase-D3rwI6OO.js → phase-t_DhU5Nm.js} +2 -2
- package/dist/pipeline-CMpuPUaX.js +11995 -0
- package/dist/{src-zDOFeQWX.js → src-QwKcYKfv.js} +747 -746
- package/dist/webworkerAll-DEZhpG90.js +2 -0
- package/package.json +32 -26
- package/LICENSE +0 -21
- package/dist/CanvasRenderer-CDbc3nH9.js +0 -3396
- package/dist/WebGLRenderer-DVKPZbKc.js +0 -2145
- package/dist/WebGPURenderer-DHSBocAL.js +0 -1656
- package/dist/canvasUtils-CXoNqK7T.js +0 -168
- package/dist/defaultFilter.vert-C9efGgir.js +0 -888
- package/dist/init-4Y6mtayI.js +0 -441
- package/dist/pipeline-DfTD40M-.js +0 -4825
- package/dist/webworkerAll-wTH3MKcZ.js +0 -2
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/dom/CanvasObserver.mjs
|
|
5
|
-
var l = class {
|
|
1
|
+
import { G as e, J as t, S as n, at as r, it as i, tt as a, x as o } from "./Geometry-C5s5KpWq.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/dom/CanvasObserver.mjs
|
|
3
|
+
var s = class {
|
|
6
4
|
constructor(e) {
|
|
7
5
|
this._lastTransform = "", this._observer = null, this._tickerAttached = !1, this.updateTranslation = () => {
|
|
8
6
|
if (!this._canvas) return;
|
|
@@ -23,14 +21,14 @@ var l = class {
|
|
|
23
21
|
let e = this.canvas.width, n = this.canvas.height, r = t.contentRect.width / e * this._renderer.resolution, i = t.contentRect.height / n * this._renderer.resolution;
|
|
24
22
|
(this._lastScaleX !== r || this._lastScaleY !== i) && (this.updateTranslation(), this._lastScaleX = r, this._lastScaleY = i);
|
|
25
23
|
}
|
|
26
|
-
}), this._observer.observe(this._canvas)) : this._tickerAttached ||
|
|
24
|
+
}), this._observer.observe(this._canvas)) : this._tickerAttached || o.shared.add(this.updateTranslation, this, n.HIGH);
|
|
27
25
|
}
|
|
28
26
|
destroy() {
|
|
29
|
-
this._observer ? (this._observer.disconnect(), this._observer = null) : this._tickerAttached &&
|
|
27
|
+
this._observer ? (this._observer.disconnect(), this._observer = null) : this._tickerAttached && o.shared.remove(this.updateTranslation), this._domElement = null, this._renderer = null, this._canvas = null, this._tickerAttached = !1, this._lastTransform = "", this._lastScaleX = null, this._lastScaleY = null;
|
|
30
28
|
}
|
|
31
|
-
},
|
|
32
|
-
constructor(
|
|
33
|
-
this.bubbles = !0, this.cancelBubble = !0, this.cancelable = !1, this.composed = !1, this.defaultPrevented = !1, this.eventPhase =
|
|
29
|
+
}, c = class e {
|
|
30
|
+
constructor(t) {
|
|
31
|
+
this.bubbles = !0, this.cancelBubble = !0, this.cancelable = !1, this.composed = !1, this.defaultPrevented = !1, this.eventPhase = e.prototype.NONE, this.propagationStopped = !1, this.propagationImmediatelyStopped = !1, this.layer = new a(), this.page = new a(), this.NONE = 0, this.CAPTURING_PHASE = 1, this.AT_TARGET = 2, this.BUBBLING_PHASE = 3, this.manager = t;
|
|
34
32
|
}
|
|
35
33
|
get layerX() {
|
|
36
34
|
return this.layer.x;
|
|
@@ -65,15 +63,15 @@ var l = class {
|
|
|
65
63
|
stopPropagation() {
|
|
66
64
|
this.propagationStopped = !0;
|
|
67
65
|
}
|
|
68
|
-
},
|
|
66
|
+
}, l = /iPhone/i, u = /iPod/i, d = /iPad/i, f = /\biOS-universal(?:.+)Mac\b/i, p = /\bAndroid(?:.+)Mobile\b/i, m = /Android/i, h = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i, g = /Silk/i, _ = /Windows Phone/i, v = /\bWindows(?:.+)ARM\b/i, y = /BlackBerry/i, b = /BB10/i, x = /Opera Mini/i, S = /\b(CriOS|Chrome)(?:.+)Mobile/i, C = /Mobile(?:.+)Firefox\b/i, w = function(e) {
|
|
69
67
|
return e !== void 0 && e.platform === "MacIntel" && typeof e.maxTouchPoints == "number" && e.maxTouchPoints > 1 && typeof MSStream > "u";
|
|
70
68
|
};
|
|
71
|
-
function
|
|
69
|
+
function T(e) {
|
|
72
70
|
return function(t) {
|
|
73
71
|
return t.test(e);
|
|
74
72
|
};
|
|
75
73
|
}
|
|
76
|
-
function
|
|
74
|
+
function E(e) {
|
|
77
75
|
var t = {
|
|
78
76
|
userAgent: "",
|
|
79
77
|
platform: "",
|
|
@@ -90,36 +88,36 @@ function O(e) {
|
|
|
90
88
|
});
|
|
91
89
|
var n = t.userAgent, r = n.split("[FBAN");
|
|
92
90
|
r[1] !== void 0 && (n = r[0]), r = n.split("Twitter"), r[1] !== void 0 && (n = r[0]);
|
|
93
|
-
var i =
|
|
91
|
+
var i = T(n), a = {
|
|
94
92
|
apple: {
|
|
95
|
-
phone: i(
|
|
96
|
-
ipod: i(
|
|
97
|
-
tablet: !i(
|
|
98
|
-
universal: i(
|
|
99
|
-
device: (i(
|
|
93
|
+
phone: i(l) && !i(_),
|
|
94
|
+
ipod: i(u),
|
|
95
|
+
tablet: !i(l) && (i(d) || w(t)) && !i(_),
|
|
96
|
+
universal: i(f),
|
|
97
|
+
device: (i(l) || i(u) || i(d) || i(f) || w(t)) && !i(_)
|
|
100
98
|
},
|
|
101
99
|
amazon: {
|
|
102
|
-
phone: i(
|
|
103
|
-
tablet: !i(
|
|
104
|
-
device: i(
|
|
100
|
+
phone: i(h),
|
|
101
|
+
tablet: !i(h) && i(g),
|
|
102
|
+
device: i(h) || i(g)
|
|
105
103
|
},
|
|
106
104
|
android: {
|
|
107
|
-
phone: !i(
|
|
108
|
-
tablet: !i(
|
|
109
|
-
device: !i(
|
|
105
|
+
phone: !i(_) && i(h) || !i(_) && i(p),
|
|
106
|
+
tablet: !i(_) && !i(h) && !i(p) && (i(g) || i(m)),
|
|
107
|
+
device: !i(_) && (i(h) || i(g) || i(p) || i(m)) || i(/\bokhttp\b/i)
|
|
110
108
|
},
|
|
111
109
|
windows: {
|
|
112
|
-
phone: i(
|
|
113
|
-
tablet: i(
|
|
114
|
-
device: i(
|
|
110
|
+
phone: i(_),
|
|
111
|
+
tablet: i(v),
|
|
112
|
+
device: i(_) || i(v)
|
|
115
113
|
},
|
|
116
114
|
other: {
|
|
117
|
-
blackberry: i(
|
|
118
|
-
blackberry10: i(
|
|
119
|
-
opera: i(
|
|
120
|
-
firefox: i(
|
|
121
|
-
chrome: i(
|
|
122
|
-
device: i(
|
|
115
|
+
blackberry: i(y),
|
|
116
|
+
blackberry10: i(b),
|
|
117
|
+
opera: i(x),
|
|
118
|
+
firefox: i(C),
|
|
119
|
+
chrome: i(S),
|
|
120
|
+
device: i(y) || i(b) || i(x) || i(C) || i(S)
|
|
123
121
|
},
|
|
124
122
|
any: !1,
|
|
125
123
|
phone: !1,
|
|
@@ -128,9 +126,9 @@ function O(e) {
|
|
|
128
126
|
return a.any = a.apple.device || a.android.device || a.windows.device || a.other.device, a.phone = a.apple.phone || a.android.phone || a.windows.phone, a.tablet = a.apple.tablet || a.android.tablet || a.windows.tablet, a;
|
|
129
127
|
}
|
|
130
128
|
//#endregion
|
|
131
|
-
//#region node_modules/.pnpm/pixi.js@8.
|
|
132
|
-
var
|
|
133
|
-
constructor(e, t =
|
|
129
|
+
//#region ../../node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/browser/isMobile.mjs
|
|
130
|
+
var D = (E.default ?? E)(globalThis.navigator), O = 9, k = 100, A = 0, j = 0, M = 2, N = 1, P = -1e3, F = -1e3, I = 2, L = class t {
|
|
131
|
+
constructor(e, t = D) {
|
|
134
132
|
this._mobileInfo = t, this.debug = !1, this._activateOnTab = !0, this._deactivateOnMouseMove = !0, this._isActive = !1, this._isMobileAccessibility = !1, this._div = null, this._pools = {}, this._renderId = 0, this._children = [], this._androidUpdateCount = 0, this._androidUpdateFrequency = 500, this._isRunningTests = !1, this._boundOnKeyDown = this._onKeyDown.bind(this), this._boundOnMouseMove = this._onMouseMove.bind(this), this._hookDiv = null, (t.tablet || t.phone) && this._createTouchHook(), this._renderer = e;
|
|
135
133
|
}
|
|
136
134
|
get isActive() {
|
|
@@ -147,7 +145,7 @@ var k = (O.default ?? O)(globalThis.navigator), A = 9, j = 100, M = 0, N = 0, P
|
|
|
147
145
|
}
|
|
148
146
|
_createTouchHook() {
|
|
149
147
|
let e = document.createElement("button");
|
|
150
|
-
e.style.width = `${
|
|
148
|
+
e.style.width = `${N}px`, e.style.height = `${N}px`, e.style.position = "absolute", e.style.top = `${P}px`, e.style.left = `${F}px`, e.style.zIndex = I.toString(), e.style.backgroundColor = "#FF0000", e.title = "select to enable accessibility for this content", e.addEventListener("focus", () => {
|
|
151
149
|
this._isMobileAccessibility = !0, this._activate(), this._destroyTouchHook();
|
|
152
150
|
}), document.body.appendChild(e), this._hookDiv = e;
|
|
153
151
|
}
|
|
@@ -156,7 +154,7 @@ var k = (O.default ?? O)(globalThis.navigator), A = 9, j = 100, M = 0, N = 0, P
|
|
|
156
154
|
}
|
|
157
155
|
_activate() {
|
|
158
156
|
if (this._isActive) return;
|
|
159
|
-
this._isActive = !0, this._div || (this._div = document.createElement("div"), this._div.style.position = "absolute", this._div.style.top = `${
|
|
157
|
+
this._isActive = !0, this._div || (this._div = document.createElement("div"), this._div.style.position = "absolute", this._div.style.top = `${A}px`, this._div.style.left = `${j}px`, this._div.style.pointerEvents = "none", this._div.style.zIndex = M.toString(), this._canvasObserver = new s({
|
|
160
158
|
domElement: this._div,
|
|
161
159
|
renderer: this._renderer
|
|
162
160
|
})), this._activateOnTab && globalThis.addEventListener("keydown", this._boundOnKeyDown, !1), this._deactivateOnMouseMove && globalThis.document.addEventListener("mousemove", this._boundOnMouseMove, !0);
|
|
@@ -191,24 +189,24 @@ var k = (O.default ?? O)(globalThis.navigator), A = 9, j = 100, M = 0, N = 0, P
|
|
|
191
189
|
let t = e.children;
|
|
192
190
|
if (t) for (let e = 0; e < t.length; e++) this._updateAccessibleObjects(t[e]);
|
|
193
191
|
}
|
|
194
|
-
init(
|
|
192
|
+
init(e) {
|
|
195
193
|
let n = { accessibilityOptions: {
|
|
196
|
-
...
|
|
197
|
-
...
|
|
194
|
+
...t.defaultOptions,
|
|
195
|
+
...e?.accessibilityOptions || {}
|
|
198
196
|
} };
|
|
199
197
|
this.debug = n.accessibilityOptions.debug, this._activateOnTab = n.accessibilityOptions.activateOnTab, this._deactivateOnMouseMove = n.accessibilityOptions.deactivateOnMouseMove, n.accessibilityOptions.enabledByDefault && this._activate(), this._renderer.runners.postrender.remove(this);
|
|
200
198
|
}
|
|
201
199
|
postrender() {
|
|
202
|
-
let
|
|
203
|
-
if (this._mobileInfo.android.device &&
|
|
204
|
-
let
|
|
200
|
+
let t = performance.now();
|
|
201
|
+
if (this._mobileInfo.android.device && t < this._androidUpdateCount || (this._androidUpdateCount = t + this._androidUpdateFrequency, (!this._renderer.renderingToScreen || !this._renderer.view.canvas) && !this._isRunningTests)) return;
|
|
202
|
+
let n = /* @__PURE__ */ new Set();
|
|
205
203
|
if (this._renderer.lastObjectRendered) {
|
|
206
204
|
this._updateAccessibleObjects(this._renderer.lastObjectRendered);
|
|
207
|
-
for (let e of this._children) e._renderId === this._renderId &&
|
|
205
|
+
for (let e of this._children) e._renderId === this._renderId && n.add(this._children.indexOf(e));
|
|
208
206
|
}
|
|
209
|
-
for (let
|
|
210
|
-
let r = this._children[
|
|
211
|
-
|
|
207
|
+
for (let t = this._children.length - 1; t >= 0; t--) {
|
|
208
|
+
let r = this._children[t];
|
|
209
|
+
n.has(t) || (r._accessibleDiv && r._accessibleDiv.parentNode && (r._accessibleDiv.parentNode.removeChild(r._accessibleDiv), this._getPool(r.accessibleType).push(r._accessibleDiv), r._accessibleDiv = null), r._accessibleActive = !1, e(this._children, t, 1));
|
|
212
210
|
}
|
|
213
211
|
this._renderer.renderingToScreen && this._canvasObserver.ensureAttached();
|
|
214
212
|
for (let e = 0; e < this._children.length; e++) {
|
|
@@ -232,10 +230,10 @@ var k = (O.default ?? O)(globalThis.navigator), A = 9, j = 100, M = 0, N = 0, P
|
|
|
232
230
|
}
|
|
233
231
|
_addChild(e) {
|
|
234
232
|
let t = this._getPool(e.accessibleType).pop();
|
|
235
|
-
t ? (t.innerHTML = "", t.removeAttribute("title"), t.removeAttribute("aria-label"), t.tabIndex = 0) : (e.accessibleType === "button" ? t = document.createElement("button") : (t = document.createElement(e.accessibleType), t.style.cssText = "\n color: transparent;\n pointer-events: none;\n padding: 0;\n margin: 0;\n border: 0;\n outline: 0;\n background: transparent;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n ", e.accessibleText && (t.innerText = e.accessibleText)), t.style.width = `${
|
|
233
|
+
t ? (t.innerHTML = "", t.removeAttribute("title"), t.removeAttribute("aria-label"), t.tabIndex = 0) : (e.accessibleType === "button" ? t = document.createElement("button") : (t = document.createElement(e.accessibleType), t.style.cssText = "\n color: transparent;\n pointer-events: none;\n padding: 0;\n margin: 0;\n border: 0;\n outline: 0;\n background: transparent;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n ", e.accessibleText && (t.innerText = e.accessibleText)), t.style.width = `${k}px`, t.style.height = `${k}px`, t.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" : "transparent", t.style.position = "absolute", t.style.zIndex = M.toString(), t.style.borderStyle = "none", navigator.userAgent.toLowerCase().includes("chrome") ? t.setAttribute("aria-live", "off") : t.setAttribute("aria-live", "polite"), navigator.userAgent.match(/rv:.*Gecko\//) ? t.setAttribute("aria-relevant", "additions") : t.setAttribute("aria-relevant", "text"), t.addEventListener("click", this._onClick.bind(this)), t.addEventListener("focus", this._onFocus.bind(this)), t.addEventListener("focusout", this._onFocusOut.bind(this))), t.style.pointerEvents = e.accessiblePointerEvents, t.type = e.accessibleType, e.accessibleTitle && e.accessibleTitle !== null ? t.title = e.accessibleTitle : (!e.accessibleHint || e.accessibleHint === null) && (t.title = `container ${e.tabIndex}`), e.accessibleHint && e.accessibleHint !== null && t.setAttribute("aria-label", e.accessibleHint), e.interactive ? t.tabIndex = e.tabIndex : t.tabIndex = 0, this.debug && this._updateDebugHTML(t), e._accessibleActive = !0, e._accessibleDiv = t, t.container = e, this._children.push(e), this._div.appendChild(e._accessibleDiv);
|
|
236
234
|
}
|
|
237
235
|
_dispatchEvent(e, t) {
|
|
238
|
-
let { container: n } = e.target, r = this._renderer.events.rootBoundary, i = Object.assign(new
|
|
236
|
+
let { container: n } = e.target, r = this._renderer.events.rootBoundary, i = Object.assign(new c(r), { target: n });
|
|
239
237
|
r.rootTarget = this._renderer.lastObjectRendered, t.forEach((e) => r.dispatchEvent(i, e));
|
|
240
238
|
}
|
|
241
239
|
_onClick(e) {
|
|
@@ -252,10 +250,10 @@ var k = (O.default ?? O)(globalThis.navigator), A = 9, j = 100, M = 0, N = 0, P
|
|
|
252
250
|
e.target.getAttribute("aria-live") || e.target.setAttribute("aria-live", "polite"), this._dispatchEvent(e, ["mouseout"]);
|
|
253
251
|
}
|
|
254
252
|
_onKeyDown(e) {
|
|
255
|
-
e.keyCode !==
|
|
253
|
+
e.keyCode !== O || !this._activateOnTab || this._activate();
|
|
256
254
|
}
|
|
257
255
|
_onMouseMove(e) {
|
|
258
|
-
|
|
256
|
+
e.movementX === 0 && e.movementY === 0 || this._deactivate();
|
|
259
257
|
}
|
|
260
258
|
destroy() {
|
|
261
259
|
this._deactivate(), this._destroyTouchHook(), this._canvasObserver?.destroy(), this._canvasObserver = null, this._div = null, this._pools = null, this._children = null, this._renderer = null, this._hookDiv = null, globalThis.removeEventListener("keydown", this._boundOnKeyDown), this._boundOnKeyDown = null, globalThis.document.removeEventListener("mousemove", this._boundOnMouseMove, !0), this._boundOnMouseMove = null;
|
|
@@ -267,17 +265,16 @@ var k = (O.default ?? O)(globalThis.navigator), A = 9, j = 100, M = 0, N = 0, P
|
|
|
267
265
|
return this._pools[e] || (this._pools[e] = []), this._pools[e];
|
|
268
266
|
}
|
|
269
267
|
};
|
|
270
|
-
|
|
271
|
-
type: [
|
|
268
|
+
L.extension = {
|
|
269
|
+
type: [r.WebGLSystem, r.WebGPUSystem],
|
|
272
270
|
name: "accessibility"
|
|
273
|
-
},
|
|
271
|
+
}, L.defaultOptions = {
|
|
274
272
|
enabledByDefault: !1,
|
|
275
273
|
debug: !1,
|
|
276
274
|
activateOnTab: !0,
|
|
277
275
|
deactivateOnMouseMove: !0
|
|
278
276
|
};
|
|
279
|
-
var
|
|
280
|
-
i.add(B), i.mixin(s, {
|
|
277
|
+
var R = L, z = {
|
|
281
278
|
accessible: !1,
|
|
282
279
|
accessibleTitle: null,
|
|
283
280
|
accessibleHint: null,
|
|
@@ -289,15 +286,12 @@ i.add(B), i.mixin(s, {
|
|
|
289
286
|
_accessibleActive: !1,
|
|
290
287
|
_accessibleDiv: null,
|
|
291
288
|
_renderId: -1
|
|
292
|
-
}
|
|
293
|
-
//#endregion
|
|
294
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/dom/DOMPipe.mjs
|
|
295
|
-
var V = class {
|
|
289
|
+
}, B = class {
|
|
296
290
|
constructor(e) {
|
|
297
291
|
this._attachedDomElements = [], this._renderer = e, this._renderer.runners.postrender.add(this), this._renderer.runners.init.add(this), this._domElement = document.createElement("div"), this._domElement.style.position = "absolute", this._domElement.style.top = "0", this._domElement.style.left = "0", this._domElement.style.pointerEvents = "none", this._domElement.style.zIndex = "1000";
|
|
298
292
|
}
|
|
299
293
|
init() {
|
|
300
|
-
this._canvasObserver = new
|
|
294
|
+
this._canvasObserver = new s({
|
|
301
295
|
domElement: this._domElement,
|
|
302
296
|
renderer: this._renderer
|
|
303
297
|
});
|
|
@@ -332,17 +326,15 @@ var V = class {
|
|
|
332
326
|
this._attachedDomElements.length = 0, this._domElement.remove(), this._canvasObserver.destroy(), this._renderer = null;
|
|
333
327
|
}
|
|
334
328
|
};
|
|
335
|
-
|
|
336
|
-
//#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/dom/init.mjs
|
|
337
|
-
V.extension = {
|
|
329
|
+
B.extension = {
|
|
338
330
|
type: [
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
331
|
+
r.WebGLPipes,
|
|
332
|
+
r.WebGPUPipes,
|
|
333
|
+
r.CanvasPipes
|
|
342
334
|
],
|
|
343
335
|
name: "dom"
|
|
344
|
-
}
|
|
345
|
-
var
|
|
336
|
+
};
|
|
337
|
+
var V = new class {
|
|
346
338
|
constructor() {
|
|
347
339
|
this.interactionFrequency = 10, this._deltaTime = 0, this._didMove = !1, this._tickerAdded = !1, this._pauseUpdate = !0;
|
|
348
340
|
}
|
|
@@ -356,10 +348,10 @@ var H = new class {
|
|
|
356
348
|
this._pauseUpdate = e;
|
|
357
349
|
}
|
|
358
350
|
addTickerListener() {
|
|
359
|
-
this._tickerAdded || !this.domElement || (
|
|
351
|
+
this._tickerAdded || !this.domElement || (o.system.add(this._tickerUpdate, this, n.INTERACTION), this._tickerAdded = !0);
|
|
360
352
|
}
|
|
361
353
|
removeTickerListener() {
|
|
362
|
-
this._tickerAdded &&= (
|
|
354
|
+
this._tickerAdded &&= (o.system.remove(this._tickerUpdate, this), !1);
|
|
363
355
|
}
|
|
364
356
|
pointerMoved() {
|
|
365
357
|
this._didMove = !0;
|
|
@@ -387,9 +379,9 @@ var H = new class {
|
|
|
387
379
|
destroy() {
|
|
388
380
|
this.removeTickerListener(), this.events = null, this.domElement = null, this._deltaTime = 0, this._didMove = !1, this._tickerAdded = !1, this._pauseUpdate = !0;
|
|
389
381
|
}
|
|
390
|
-
}(),
|
|
382
|
+
}(), H = class extends c {
|
|
391
383
|
constructor() {
|
|
392
|
-
super(...arguments), this.client = new
|
|
384
|
+
super(...arguments), this.client = new a(), this.movement = new a(), this.offset = new a(), this.global = new a(), this.screen = new a();
|
|
393
385
|
}
|
|
394
386
|
get clientX() {
|
|
395
387
|
return this.client.x;
|
|
@@ -436,9 +428,9 @@ var H = new class {
|
|
|
436
428
|
initMouseEvent(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
437
429
|
throw Error("Method not implemented.");
|
|
438
430
|
}
|
|
439
|
-
},
|
|
431
|
+
}, U = class extends H {
|
|
440
432
|
constructor() {
|
|
441
|
-
super(...arguments), this.width = 0, this.height = 0, this.isPrimary = !1;
|
|
433
|
+
super(...arguments), this.width = 0, this.height = 0, this.isPrimary = !1, this.persistentDeviceId = 0;
|
|
442
434
|
}
|
|
443
435
|
getCoalescedEvents() {
|
|
444
436
|
return this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove" ? [this] : [];
|
|
@@ -446,17 +438,17 @@ var H = new class {
|
|
|
446
438
|
getPredictedEvents() {
|
|
447
439
|
throw Error("getPredictedEvents is not supported!");
|
|
448
440
|
}
|
|
449
|
-
},
|
|
441
|
+
}, W = class extends H {
|
|
450
442
|
constructor() {
|
|
451
443
|
super(...arguments), this.DOM_DELTA_PIXEL = 0, this.DOM_DELTA_LINE = 1, this.DOM_DELTA_PAGE = 2;
|
|
452
444
|
}
|
|
453
445
|
};
|
|
454
|
-
|
|
446
|
+
W.DOM_DELTA_PIXEL = 0, W.DOM_DELTA_LINE = 1, W.DOM_DELTA_PAGE = 2;
|
|
455
447
|
//#endregion
|
|
456
|
-
//#region node_modules/.pnpm/pixi.js@8.
|
|
457
|
-
var
|
|
448
|
+
//#region ../../node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/events/EventBoundary.mjs
|
|
449
|
+
var G = 2048, K = new a(), q = new a(), J = class {
|
|
458
450
|
constructor(e) {
|
|
459
|
-
this.dispatch = new
|
|
451
|
+
this.dispatch = new i(), this.moveOnAll = !1, this.enableGlobalMoveEvents = !0, this.mappingState = { trackingData: {} }, this.eventPool = /* @__PURE__ */ new Map(), this._allInteractiveElements = [], this._hitElements = [], this._isPointerMoveEvent = !1, this.rootTarget = e, this.hitPruneFn = this.hitPruneFn.bind(this), this.hitTestFn = this.hitTestFn.bind(this), this.mapPointerDown = this.mapPointerDown.bind(this), this.mapPointerMove = this.mapPointerMove.bind(this), this.mapPointerOut = this.mapPointerOut.bind(this), this.mapPointerOver = this.mapPointerOver.bind(this), this.mapPointerUp = this.mapPointerUp.bind(this), this.mapPointerUpOutside = this.mapPointerUpOutside.bind(this), this.mapWheel = this.mapWheel.bind(this), this.mappingTable = {}, this.addEventMapping("pointerdown", this.mapPointerDown), this.addEventMapping("pointermove", this.mapPointerMove), this.addEventMapping("pointerout", this.mapPointerOut), this.addEventMapping("pointerleave", this.mapPointerOut), this.addEventMapping("pointerover", this.mapPointerOver), this.addEventMapping("pointerup", this.mapPointerUp), this.addEventMapping("pointerupoutside", this.mapPointerUpOutside), this.addEventMapping("wheel", this.mapWheel);
|
|
460
452
|
}
|
|
461
453
|
addEventMapping(e, t) {
|
|
462
454
|
this.mappingTable[e] || (this.mappingTable[e] = []), this.mappingTable[e].push({
|
|
@@ -474,8 +466,8 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
474
466
|
else t(`[EventBoundary]: Event mapping not defined for ${e.type}`);
|
|
475
467
|
}
|
|
476
468
|
hitTest(e, t) {
|
|
477
|
-
|
|
478
|
-
let n = this._isPointerMoveEvent && this.enableGlobalMoveEvents ? "hitTestMoveRecursive" : "hitTestRecursive", r = this[n](this.rootTarget, this.rootTarget.eventMode,
|
|
469
|
+
V.pauseUpdate = !0;
|
|
470
|
+
let n = this._isPointerMoveEvent && this.enableGlobalMoveEvents ? "hitTestMoveRecursive" : "hitTestRecursive", r = this[n](this.rootTarget, this.rootTarget.eventMode, K.set(e, t), this.hitTestFn, this.hitPruneFn);
|
|
479
471
|
return r && r[0];
|
|
480
472
|
}
|
|
481
473
|
propagate(e, t) {
|
|
@@ -498,7 +490,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
498
490
|
}
|
|
499
491
|
propagationPath(e) {
|
|
500
492
|
let t = [e];
|
|
501
|
-
for (let n = 0; n <
|
|
493
|
+
for (let n = 0; n < G && e !== this.rootTarget && e.parent; n++) {
|
|
502
494
|
if (!e.parent) throw Error("Cannot find propagation path to disconnected target");
|
|
503
495
|
t.push(e.parent), e = e.parent;
|
|
504
496
|
}
|
|
@@ -507,7 +499,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
507
499
|
hitTestMoveRecursive(e, t, n, r, i, a = !1) {
|
|
508
500
|
let o = !1;
|
|
509
501
|
if (this._interactivePrune(e)) return null;
|
|
510
|
-
if ((e.eventMode === "dynamic" || t === "dynamic") && (
|
|
502
|
+
if ((e.eventMode === "dynamic" || t === "dynamic") && (V.pauseUpdate = !1), e.interactiveChildren && e.children) {
|
|
511
503
|
let s = e.children;
|
|
512
504
|
for (let c = s.length - 1; c >= 0; c--) {
|
|
513
505
|
let l = s[c], u = this.hitTestMoveRecursive(l, this._isInteractive(t) ? t : l.eventMode, n, r, i, a || i(e, n));
|
|
@@ -523,7 +515,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
523
515
|
}
|
|
524
516
|
hitTestRecursive(e, t, n, r, i) {
|
|
525
517
|
if (this._interactivePrune(e) || i(e, n)) return null;
|
|
526
|
-
if ((e.eventMode === "dynamic" || t === "dynamic") && (
|
|
518
|
+
if ((e.eventMode === "dynamic" || t === "dynamic") && (V.pauseUpdate = !1), e.interactiveChildren && e.children) {
|
|
527
519
|
let a = e.children, o = n;
|
|
528
520
|
for (let n = a.length - 1; n >= 0; n--) {
|
|
529
521
|
let s = a[n], c = this.hitTestRecursive(s, this._isInteractive(t) ? t : s.eventMode, o, r, i);
|
|
@@ -544,7 +536,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
544
536
|
return !e || !e.visible || !e.renderable || !e.measurable || e.eventMode === "none" || e.eventMode === "passive" && !e.interactiveChildren;
|
|
545
537
|
}
|
|
546
538
|
hitPruneFn(e, t) {
|
|
547
|
-
if (e.hitArea && (e.worldTransform.applyInverse(t,
|
|
539
|
+
if (e.hitArea && (e.worldTransform.applyInverse(t, q), !e.hitArea.contains(q.x, q.y))) return !0;
|
|
548
540
|
if (e.effects && e.effects.length) for (let n = 0; n < e.effects.length; n++) {
|
|
549
541
|
let r = e.effects[n];
|
|
550
542
|
if (r.containsPoint && !r.containsPoint(t, this.hitTestFn)) return !0;
|
|
@@ -552,7 +544,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
552
544
|
return !1;
|
|
553
545
|
}
|
|
554
546
|
hitTestFn(e, t) {
|
|
555
|
-
return e.hitArea ? !0 : e?.containsPoint ? (e.worldTransform.applyInverse(t,
|
|
547
|
+
return e.hitArea ? !0 : e?.containsPoint ? (e.worldTransform.applyInverse(t, q), e.containsPoint(q)) : !1;
|
|
556
548
|
}
|
|
557
549
|
notifyTarget(e, t) {
|
|
558
550
|
if (!e.currentTarget.isInteractive()) return;
|
|
@@ -563,7 +555,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
563
555
|
this._notifyListeners(e, r), e.eventPhase === e.AT_TARGET && this._notifyListeners(e, t);
|
|
564
556
|
}
|
|
565
557
|
mapPointerDown(e) {
|
|
566
|
-
if (!(e instanceof
|
|
558
|
+
if (!(e instanceof U)) {
|
|
567
559
|
t("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
568
560
|
return;
|
|
569
561
|
}
|
|
@@ -577,7 +569,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
577
569
|
r.pressTargetsByButton[e.button] = n.composedPath(), this.freeEvent(n);
|
|
578
570
|
}
|
|
579
571
|
mapPointerMove(e) {
|
|
580
|
-
if (!(e instanceof
|
|
572
|
+
if (!(e instanceof U)) {
|
|
581
573
|
t("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
582
574
|
return;
|
|
583
575
|
}
|
|
@@ -610,7 +602,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
610
602
|
this.moveOnAll ? o.push("pointermove") : this.dispatchEvent(n, "pointermove"), s && o.push("globalpointermove"), n.pointerType === "touch" && (this.moveOnAll ? o.splice(1, 0, "touchmove") : this.dispatchEvent(n, "touchmove"), s && o.push("globaltouchmove")), r && (this.moveOnAll ? o.splice(1, 0, "mousemove") : this.dispatchEvent(n, "mousemove"), s && o.push("globalmousemove"), this.cursor = n.target?.cursor), o.length > 0 && this.all(n, o), this._allInteractiveElements.length = 0, this._hitElements.length = 0, i.overTargets = n.composedPath(), this.freeEvent(n);
|
|
611
603
|
}
|
|
612
604
|
mapPointerOver(e) {
|
|
613
|
-
if (!(e instanceof
|
|
605
|
+
if (!(e instanceof U)) {
|
|
614
606
|
t("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
615
607
|
return;
|
|
616
608
|
}
|
|
@@ -621,7 +613,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
621
613
|
n.overTargets = r.composedPath(), this.freeEvent(r), this.freeEvent(a);
|
|
622
614
|
}
|
|
623
615
|
mapPointerOut(e) {
|
|
624
|
-
if (!(e instanceof
|
|
616
|
+
if (!(e instanceof U)) {
|
|
625
617
|
t("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
626
618
|
return;
|
|
627
619
|
}
|
|
@@ -636,7 +628,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
636
628
|
this.cursor = null;
|
|
637
629
|
}
|
|
638
630
|
mapPointerUp(e) {
|
|
639
|
-
if (!(e instanceof
|
|
631
|
+
if (!(e instanceof U)) {
|
|
640
632
|
t("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
641
633
|
return;
|
|
642
634
|
}
|
|
@@ -676,7 +668,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
676
668
|
this.freeEvent(r);
|
|
677
669
|
}
|
|
678
670
|
mapPointerUpOutside(e) {
|
|
679
|
-
if (!(e instanceof
|
|
671
|
+
if (!(e instanceof U)) {
|
|
680
672
|
t("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
681
673
|
return;
|
|
682
674
|
}
|
|
@@ -689,7 +681,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
689
681
|
this.freeEvent(i);
|
|
690
682
|
}
|
|
691
683
|
mapWheel(e) {
|
|
692
|
-
if (!(e instanceof
|
|
684
|
+
if (!(e instanceof W)) {
|
|
693
685
|
t("EventBoundary cannot map a non-wheel event as a wheel event");
|
|
694
686
|
return;
|
|
695
687
|
}
|
|
@@ -703,25 +695,25 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
703
695
|
return t;
|
|
704
696
|
}
|
|
705
697
|
createPointerEvent(e, t, n) {
|
|
706
|
-
let r = this.allocateEvent(
|
|
698
|
+
let r = this.allocateEvent(U);
|
|
707
699
|
return this.copyPointerData(e, r), this.copyMouseData(e, r), this.copyData(e, r), r.nativeEvent = e.nativeEvent, r.originalEvent = e, r.target = n ?? this.hitTest(r.global.x, r.global.y) ?? this._hitElements[0], typeof t == "string" && (r.type = t), r;
|
|
708
700
|
}
|
|
709
701
|
createWheelEvent(e) {
|
|
710
|
-
let t = this.allocateEvent(
|
|
702
|
+
let t = this.allocateEvent(W);
|
|
711
703
|
return this.copyWheelData(e, t), this.copyMouseData(e, t), this.copyData(e, t), t.nativeEvent = e.nativeEvent, t.originalEvent = e, t.target = this.hitTest(t.global.x, t.global.y), t;
|
|
712
704
|
}
|
|
713
705
|
clonePointerEvent(e, t) {
|
|
714
|
-
let n = this.allocateEvent(
|
|
706
|
+
let n = this.allocateEvent(U);
|
|
715
707
|
return n.nativeEvent = e.nativeEvent, n.originalEvent = e.originalEvent, this.copyPointerData(e, n), this.copyMouseData(e, n), this.copyData(e, n), n.target = e.target, n.path = e.composedPath().slice(), n.type = t ?? n.type, n;
|
|
716
708
|
}
|
|
717
709
|
copyWheelData(e, t) {
|
|
718
710
|
t.deltaMode = e.deltaMode, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ;
|
|
719
711
|
}
|
|
720
712
|
copyPointerData(e, t) {
|
|
721
|
-
e instanceof
|
|
713
|
+
e instanceof U && t instanceof U && (t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.persistentDeviceId = e.persistentDeviceId);
|
|
722
714
|
}
|
|
723
715
|
copyMouseData(e, t) {
|
|
724
|
-
e instanceof
|
|
716
|
+
e instanceof H && t instanceof H && (t.altKey = e.altKey, t.button = e.button, t.buttons = e.buttons, t.client.copyFrom(e.client), t.ctrlKey = e.ctrlKey, t.metaKey = e.metaKey, t.movement.copyFrom(e.movement), t.screen.copyFrom(e.screen), t.shiftKey = e.shiftKey, t.global.copyFrom(e.global));
|
|
725
717
|
}
|
|
726
718
|
copyData(e, t) {
|
|
727
719
|
t.isTrusted = e.isTrusted, t.srcElement = e.srcElement, t.timeStamp = performance.now(), t.type = e.type, t.detail = e.detail, t.view = e.view, t.which = e.which, t.layer.copyFrom(e.layer), t.page.copyFrom(e.page);
|
|
@@ -745,20 +737,18 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
745
737
|
}
|
|
746
738
|
_notifyListeners(e, t) {
|
|
747
739
|
let n = e.currentTarget._events[t];
|
|
748
|
-
if (n)
|
|
749
|
-
|
|
750
|
-
else for (let r = 0, i = n.length; r < i && !e.propagationImmediatelyStopped; r++) n[r].once && e.currentTarget.removeListener(t, n[r].fn, void 0, !0), n[r].fn.call(n[r].context, e);
|
|
751
|
-
}
|
|
740
|
+
if (n) if ("fn" in n) n.once && e.currentTarget.removeListener(t, n.fn, void 0, !0), n.fn.call(n.context, e);
|
|
741
|
+
else for (let r = 0, i = n.length; r < i && !e.propagationImmediatelyStopped; r++) n[r].once && e.currentTarget.removeListener(t, n[r].fn, void 0, !0), n[r].fn.call(n[r].context, e);
|
|
752
742
|
}
|
|
753
|
-
},
|
|
743
|
+
}, Y = 1, X = {
|
|
754
744
|
touchstart: "pointerdown",
|
|
755
745
|
touchend: "pointerup",
|
|
756
746
|
touchendoutside: "pointerupoutside",
|
|
757
747
|
touchmove: "pointermove",
|
|
758
748
|
touchcancel: "pointercancel"
|
|
759
|
-
},
|
|
749
|
+
}, Z = class e {
|
|
760
750
|
constructor(t) {
|
|
761
|
-
this.supportsTouchEvents = "ontouchstart" in globalThis, this.supportsPointerEvents = !!globalThis.PointerEvent, this.domElement = null, this.resolution = 1, this.renderer = t, this.rootBoundary = new
|
|
751
|
+
this.supportsTouchEvents = "ontouchstart" in globalThis, this.supportsPointerEvents = !!globalThis.PointerEvent, this.domElement = null, this.resolution = 1, this.renderer = t, this.rootBoundary = new J(null), V.init(this), this.autoPreventDefault = !0, this._eventsAdded = !1, this._rootPointerEvent = new U(null), this._rootWheelEvent = new W(null), this.cursorStyles = {
|
|
762
752
|
default: "inherit",
|
|
763
753
|
pointer: "pointer"
|
|
764
754
|
}, this.features = new Proxy({ ...e.defaultEventFeatures }, { set: (e, t, n) => (t === "globalMove" && (this.rootBoundary.enableGlobalMoveEvents = n), e[t] = n, !0) }), this._onPointerDown = this._onPointerDown.bind(this), this._onPointerMove = this._onPointerMove.bind(this), this._onPointerUp = this._onPointerUp.bind(this), this._onPointerOverOut = this._onPointerOverOut.bind(this), this.onWheel = this.onWheel.bind(this);
|
|
@@ -774,7 +764,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
774
764
|
this.resolution = e;
|
|
775
765
|
}
|
|
776
766
|
destroy() {
|
|
777
|
-
|
|
767
|
+
V.destroy(), this.setTargetElement(null), this.renderer = null, this._currentCursor = null;
|
|
778
768
|
}
|
|
779
769
|
setCursor(e) {
|
|
780
770
|
e ||= "default";
|
|
@@ -789,7 +779,9 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
789
779
|
case "function":
|
|
790
780
|
n(e);
|
|
791
781
|
break;
|
|
792
|
-
case "object":
|
|
782
|
+
case "object":
|
|
783
|
+
t && Object.assign(this.domElement.style, n);
|
|
784
|
+
break;
|
|
793
785
|
}
|
|
794
786
|
else t && typeof e == "string" && !Object.prototype.hasOwnProperty.call(this.cursorStyles, e) && (this.domElement.style.cursor = e);
|
|
795
787
|
}
|
|
@@ -809,7 +801,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
809
801
|
}
|
|
810
802
|
_onPointerMove(e) {
|
|
811
803
|
if (!this.features.move) return;
|
|
812
|
-
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered,
|
|
804
|
+
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, V.pointerMoved();
|
|
813
805
|
let t = this._normalizeToPointerData(e);
|
|
814
806
|
for (let e = 0, n = t.length; e < n; e++) {
|
|
815
807
|
let n = this._bootstrapEvent(this._rootPointerEvent, t[e]);
|
|
@@ -845,11 +837,11 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
845
837
|
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, this.rootBoundary.mapEvent(t);
|
|
846
838
|
}
|
|
847
839
|
setTargetElement(e) {
|
|
848
|
-
this._removeEvents(), this.domElement = e,
|
|
840
|
+
this._removeEvents(), this.domElement = e, V.domElement = e, this._addEvents();
|
|
849
841
|
}
|
|
850
842
|
_addEvents() {
|
|
851
843
|
if (this._eventsAdded || !this.domElement) return;
|
|
852
|
-
|
|
844
|
+
V.addTickerListener();
|
|
853
845
|
let e = this.domElement.style;
|
|
854
846
|
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : this.supportsPointerEvents && (e.touchAction = "none")), this.supportsPointerEvents ? (globalThis.document.addEventListener("pointermove", this._onPointerMove, !0), this.domElement.addEventListener("pointerdown", this._onPointerDown, !0), this.domElement.addEventListener("pointerleave", this._onPointerOverOut, !0), this.domElement.addEventListener("pointerover", this._onPointerOverOut, !0), globalThis.addEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.addEventListener("mousemove", this._onPointerMove, !0), this.domElement.addEventListener("mousedown", this._onPointerDown, !0), this.domElement.addEventListener("mouseout", this._onPointerOverOut, !0), this.domElement.addEventListener("mouseover", this._onPointerOverOut, !0), globalThis.addEventListener("mouseup", this._onPointerUp, !0), this.supportsTouchEvents && (this.domElement.addEventListener("touchstart", this._onPointerDown, !0), this.domElement.addEventListener("touchend", this._onPointerUp, !0), this.domElement.addEventListener("touchmove", this._onPointerMove, !0))), this.domElement.addEventListener("wheel", this.onWheel, {
|
|
855
847
|
passive: !0,
|
|
@@ -858,7 +850,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
858
850
|
}
|
|
859
851
|
_removeEvents() {
|
|
860
852
|
if (!this._eventsAdded || !this.domElement) return;
|
|
861
|
-
|
|
853
|
+
V.removeTickerListener();
|
|
862
854
|
let e = this.domElement.style;
|
|
863
855
|
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : this.supportsPointerEvents && (e.touchAction = "")), this.supportsPointerEvents ? (globalThis.document.removeEventListener("pointermove", this._onPointerMove, !0), this.domElement.removeEventListener("pointerdown", this._onPointerDown, !0), this.domElement.removeEventListener("pointerleave", this._onPointerOverOut, !0), this.domElement.removeEventListener("pointerover", this._onPointerOverOut, !0), globalThis.removeEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.removeEventListener("mousemove", this._onPointerMove, !0), this.domElement.removeEventListener("mousedown", this._onPointerDown, !0), this.domElement.removeEventListener("mouseout", this._onPointerOverOut, !0), this.domElement.removeEventListener("mouseover", this._onPointerOverOut, !0), globalThis.removeEventListener("mouseup", this._onPointerUp, !0), this.supportsTouchEvents && (this.domElement.removeEventListener("touchstart", this._onPointerDown, !0), this.domElement.removeEventListener("touchend", this._onPointerUp, !0), this.domElement.removeEventListener("touchmove", this._onPointerMove, !0))), this.domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this._eventsAdded = !1;
|
|
864
856
|
}
|
|
@@ -881,7 +873,7 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
881
873
|
}
|
|
882
874
|
else if (!globalThis.MouseEvent || e instanceof MouseEvent && (!this.supportsPointerEvents || !(e instanceof globalThis.PointerEvent))) {
|
|
883
875
|
let n = e;
|
|
884
|
-
n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId =
|
|
876
|
+
n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId = Y), n.pressure === void 0 && (n.pressure = .5), n.twist === void 0 && (n.twist = 0), n.tangentialPressure === void 0 && (n.tangentialPressure = 0), n.isNormalized = !0, t.push(n);
|
|
885
877
|
} else t.push(e);
|
|
886
878
|
return t;
|
|
887
879
|
}
|
|
@@ -890,28 +882,27 @@ var K = 2048, q = new e(), J = new e(), Y = class {
|
|
|
890
882
|
return this._transferMouseData(t, e), t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.copyFrom(t.screen), t.offset.copyFrom(t.screen), t.nativeEvent = e, t.type = e.type, t;
|
|
891
883
|
}
|
|
892
884
|
_bootstrapEvent(e, t) {
|
|
893
|
-
return e.originalEvent = null, e.nativeEvent = t, e.pointerId = t.pointerId, e.width = t.width, e.height = t.height, e.isPrimary = t.isPrimary, e.pointerType = t.pointerType, e.pressure = t.pressure, e.tangentialPressure = t.tangentialPressure, e.tiltX = t.tiltX, e.tiltY = t.tiltY, e.twist = t.twist, this._transferMouseData(e, t), this.mapPositionToPoint(e.screen, t.clientX, t.clientY), e.global.copyFrom(e.screen), e.offset.copyFrom(e.screen), e.isTrusted = t.isTrusted, e.type === "pointerleave" && (e.type = "pointerout"), e.type.startsWith("mouse") && (e.type = e.type.replace("mouse", "pointer")), e.type.startsWith("touch") && (e.type =
|
|
885
|
+
return e.originalEvent = null, e.nativeEvent = t, e.pointerId = t.pointerId, e.width = t.width, e.height = t.height, e.isPrimary = t.isPrimary, e.pointerType = t.pointerType, e.pressure = t.pressure, e.tangentialPressure = t.tangentialPressure, e.tiltX = t.tiltX, e.tiltY = t.tiltY, e.twist = t.twist, this._transferMouseData(e, t), this.mapPositionToPoint(e.screen, t.clientX, t.clientY), e.global.copyFrom(e.screen), e.offset.copyFrom(e.screen), e.isTrusted = t.isTrusted, e.type === "pointerleave" && (e.type = "pointerout"), e.type.startsWith("mouse") && (e.type = e.type.replace("mouse", "pointer")), e.type.startsWith("touch") && (e.type = X[e.type] || e.type), e;
|
|
894
886
|
}
|
|
895
887
|
_transferMouseData(e, t) {
|
|
896
888
|
e.isTrusted = t.isTrusted, e.srcElement = t.srcElement, e.timeStamp = performance.now(), e.type = t.type, e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
|
|
897
889
|
}
|
|
898
890
|
};
|
|
899
|
-
|
|
891
|
+
Z.extension = {
|
|
900
892
|
name: "events",
|
|
901
893
|
type: [
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
894
|
+
r.WebGLSystem,
|
|
895
|
+
r.CanvasSystem,
|
|
896
|
+
r.WebGPUSystem
|
|
905
897
|
],
|
|
906
898
|
priority: -1
|
|
907
|
-
},
|
|
899
|
+
}, Z.defaultEventFeatures = {
|
|
908
900
|
move: !0,
|
|
909
901
|
globalMove: !0,
|
|
910
902
|
click: !0,
|
|
911
903
|
wheel: !0
|
|
912
904
|
};
|
|
913
|
-
var $ =
|
|
914
|
-
i.add($), i.mixin(s, {
|
|
905
|
+
var Q = Z, $ = {
|
|
915
906
|
onclick: null,
|
|
916
907
|
onmousedown: null,
|
|
917
908
|
onmouseenter: null,
|
|
@@ -953,7 +944,7 @@ i.add($), i.mixin(s, {
|
|
|
953
944
|
},
|
|
954
945
|
_internalEventMode: void 0,
|
|
955
946
|
get eventMode() {
|
|
956
|
-
return this._internalEventMode ??
|
|
947
|
+
return this._internalEventMode ?? Q.defaultEventMode;
|
|
957
948
|
},
|
|
958
949
|
set eventMode(e) {
|
|
959
950
|
this._internalEventMode = e;
|
|
@@ -964,7 +955,7 @@ i.add($), i.mixin(s, {
|
|
|
964
955
|
interactiveChildren: !0,
|
|
965
956
|
hitArea: null,
|
|
966
957
|
addEventListener(e, t, n) {
|
|
967
|
-
let r = typeof n == "boolean" && n || typeof n == "object" && n.capture, i = typeof n == "object" ? n.signal : void 0, a = typeof n == "object"
|
|
958
|
+
let r = typeof n == "boolean" && n || typeof n == "object" && n.capture, i = typeof n == "object" ? n.signal : void 0, a = typeof n == "object" ? n.once === !0 : !1, o = typeof t == "function" ? void 0 : t;
|
|
968
959
|
e = r ? `${e}capture` : e;
|
|
969
960
|
let s = typeof t == "function" ? t : t.handleEvent, c = this;
|
|
970
961
|
i && i.addEventListener("abort", () => {
|
|
@@ -976,8 +967,9 @@ i.add($), i.mixin(s, {
|
|
|
976
967
|
e = r ? `${e}capture` : e, t = typeof t == "function" ? t : t.handleEvent, this.off(e, t, i);
|
|
977
968
|
},
|
|
978
969
|
dispatchEvent(e) {
|
|
979
|
-
if (!(e instanceof
|
|
970
|
+
if (!(e instanceof c)) throw Error("Container cannot propagate events outside of the Federated Events API");
|
|
980
971
|
return e.defaultPrevented = !1, e.path = null, e.target = this, e.manager.dispatchEvent(e), !e.defaultPrevented;
|
|
981
972
|
}
|
|
982
|
-
}
|
|
973
|
+
};
|
|
983
974
|
//#endregion
|
|
975
|
+
export { R as a, z as i, Q as n, B as r, $ as t };
|