@needle-tools/engine 3.21.1-alpha.1 → 3.21.2
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/CHANGELOG.md +4 -0
- package/dist/needle-engine.js +19 -14
- package/dist/needle-engine.light.js +19 -14
- package/dist/needle-engine.light.min.js +3 -3
- package/dist/needle-engine.light.umd.cjs +3 -3
- package/dist/needle-engine.min.js +3 -3
- package/dist/needle-engine.umd.cjs +3 -3
- package/lib/engine-components/EventList.d.ts +2 -1
- package/lib/engine-components/EventList.js +5 -1
- package/lib/engine-components/EventList.js.map +1 -1
- package/lib/engine-components/ui/Button.js +4 -2
- package/lib/engine-components/ui/Button.js.map +1 -1
- package/lib/engine-components/ui/EventSystem.js +1 -3
- package/lib/engine-components/ui/EventSystem.js.map +1 -1
- package/package.json +1 -1
- package/src/engine-components/EventList.ts +5 -1
- package/src/engine-components/ui/Button.ts +5 -3
- package/src/engine-components/ui/EventSystem.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,10 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [3.21.2] - 2023-10-23
|
|
8
|
+
- Change: Expose EventList subscriber count
|
|
9
|
+
- Change: `PointerEventArgs.use()` should not stop propagation
|
|
10
|
+
|
|
7
11
|
## [3.21.1-alpha] - 2023-10-20
|
|
8
12
|
- Add: Multitouch support on `input` events, our EventSystem implementation now handles multitouch cases and is using the browser events directly and immediately (before events via `window` where deferred and hanlded during the engine update loop)
|
|
9
13
|
|
package/dist/needle-engine.js
CHANGED
|
@@ -45958,25 +45958,31 @@ class qg {
|
|
|
45958
45958
|
this.key = t;
|
|
45959
45959
|
}
|
|
45960
45960
|
}
|
|
45961
|
+
get listenerCount() {
|
|
45962
|
+
var A;
|
|
45963
|
+
return ((A = this.methods) == null ? void 0 : A.length) ?? 0;
|
|
45964
|
+
}
|
|
45961
45965
|
invoke(...A) {
|
|
45962
|
-
|
|
45963
|
-
|
|
45964
|
-
return;
|
|
45965
|
-
|
|
45966
|
+
var e;
|
|
45967
|
+
if (this._isInvoking)
|
|
45968
|
+
return console.warn("Circular event invocation detected. Please check your event listeners for circular references.", this), !1;
|
|
45969
|
+
if (((e = this.methods) == null ? void 0 : e.length) <= 0)
|
|
45970
|
+
return !1;
|
|
45966
45971
|
this._isInvoking = !0;
|
|
45967
45972
|
try {
|
|
45968
|
-
for (const
|
|
45969
|
-
|
|
45973
|
+
for (const t of this.methods)
|
|
45974
|
+
t.invoke(...A);
|
|
45970
45975
|
if (typeof this.target == "object" && typeof this.key == "string") {
|
|
45971
|
-
const
|
|
45972
|
-
if (typeof
|
|
45973
|
-
const
|
|
45974
|
-
|
|
45976
|
+
const t = this.target.dispatchEvent;
|
|
45977
|
+
if (typeof t == "function") {
|
|
45978
|
+
const g = new HM(this.key);
|
|
45979
|
+
g.args = A, t.call(this.target, g);
|
|
45975
45980
|
}
|
|
45976
45981
|
}
|
|
45977
45982
|
} finally {
|
|
45978
45983
|
this._isInvoking = !1;
|
|
45979
45984
|
}
|
|
45985
|
+
return !0;
|
|
45980
45986
|
}
|
|
45981
45987
|
addEventListener(A) {
|
|
45982
45988
|
return this.methods.push(new Lh(A, !0)), A;
|
|
@@ -61285,9 +61291,9 @@ const Us = class extends NA {
|
|
|
61285
61291
|
* Propagate up in hiearchy and call the callback for each component that is possibly a handler
|
|
61286
61292
|
*/
|
|
61287
61293
|
propagate(e, t, g) {
|
|
61288
|
-
for (;
|
|
61294
|
+
for (; IA.foreachComponent(e, (I) => {
|
|
61289
61295
|
g(I);
|
|
61290
|
-
}, !1),
|
|
61296
|
+
}, !1), !!e.parent; )
|
|
61291
61297
|
e = e.parent;
|
|
61292
61298
|
}
|
|
61293
61299
|
/**
|
|
@@ -64698,8 +64704,7 @@ class ma extends NA {
|
|
|
64698
64704
|
bB && console.warn("Button Up", (t = this.animationTriggers) == null ? void 0 : t.highlightedTrigger, this.animator, this._isHovered), this.interactable && (this.transition == 3 && this.animationTriggers && this.animator ? this.animator.setTrigger(this._isHovered ? this.animationTriggers.highlightedTrigger : this.animationTriggers.normalTrigger) : this.transition === 1 && this.colors && ((g = this._image) == null || g.setState(this._isHovered ? "hovered" : "normal")));
|
|
64699
64705
|
}
|
|
64700
64706
|
onPointerClick(e) {
|
|
64701
|
-
|
|
64702
|
-
!this.interactable || e.pointerId === void 0 || e.pointerId !== 0 && this.context.input.getIsMouse(e.pointerId) || (bB && (console.warn("Button Click", this.onClick), Fi("CLICKED button " + this.name + " at " + this.context.time.frameCount)), (t = this.onClick) == null || t.invoke(), e.use());
|
|
64707
|
+
!this.interactable || e.pointerId === void 0 || e.pointerId !== 0 && this.context.input.getIsMouse(e.pointerId) || (bB && (console.warn("Button Click", this.onClick), Fi("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), e.use()));
|
|
64703
64708
|
}
|
|
64704
64709
|
set interactable(e) {
|
|
64705
64710
|
this._interactable = e, this._image && (this._image.setInteractable(e), e ? this._image.setState("normal") : this._image.setState("disabled"));
|
|
@@ -45958,25 +45958,31 @@ class Es {
|
|
|
45958
45958
|
this.key = i;
|
|
45959
45959
|
}
|
|
45960
45960
|
}
|
|
45961
|
+
get listenerCount() {
|
|
45962
|
+
var e;
|
|
45963
|
+
return ((e = this.methods) == null ? void 0 : e.length) ?? 0;
|
|
45964
|
+
}
|
|
45961
45965
|
invoke(...e) {
|
|
45962
|
-
|
|
45963
|
-
|
|
45964
|
-
return;
|
|
45965
|
-
|
|
45966
|
+
var t;
|
|
45967
|
+
if (this._isInvoking)
|
|
45968
|
+
return console.warn("Circular event invocation detected. Please check your event listeners for circular references.", this), !1;
|
|
45969
|
+
if (((t = this.methods) == null ? void 0 : t.length) <= 0)
|
|
45970
|
+
return !1;
|
|
45966
45971
|
this._isInvoking = !0;
|
|
45967
45972
|
try {
|
|
45968
|
-
for (const
|
|
45969
|
-
|
|
45973
|
+
for (const i of this.methods)
|
|
45974
|
+
i.invoke(...e);
|
|
45970
45975
|
if (typeof this.target == "object" && typeof this.key == "string") {
|
|
45971
|
-
const
|
|
45972
|
-
if (typeof
|
|
45973
|
-
const
|
|
45974
|
-
|
|
45976
|
+
const i = this.target.dispatchEvent;
|
|
45977
|
+
if (typeof i == "function") {
|
|
45978
|
+
const s = new T1(this.key);
|
|
45979
|
+
s.args = e, i.call(this.target, s);
|
|
45975
45980
|
}
|
|
45976
45981
|
}
|
|
45977
45982
|
} finally {
|
|
45978
45983
|
this._isInvoking = !1;
|
|
45979
45984
|
}
|
|
45985
|
+
return !0;
|
|
45980
45986
|
}
|
|
45981
45987
|
addEventListener(e) {
|
|
45982
45988
|
return this.methods.push(new lm(e, !0)), e;
|
|
@@ -61285,9 +61291,9 @@ const va = class extends Ie {
|
|
|
61285
61291
|
* Propagate up in hiearchy and call the callback for each component that is possibly a handler
|
|
61286
61292
|
*/
|
|
61287
61293
|
propagate(t, i, s) {
|
|
61288
|
-
for (;
|
|
61294
|
+
for (; ne.foreachComponent(t, (r) => {
|
|
61289
61295
|
s(r);
|
|
61290
|
-
}, !1),
|
|
61296
|
+
}, !1), !!t.parent; )
|
|
61291
61297
|
t = t.parent;
|
|
61292
61298
|
}
|
|
61293
61299
|
/**
|
|
@@ -64698,8 +64704,7 @@ class rh extends Ie {
|
|
|
64698
64704
|
ud && console.warn("Button Up", (i = this.animationTriggers) == null ? void 0 : i.highlightedTrigger, this.animator, this._isHovered), this.interactable && (this.transition == 3 && this.animationTriggers && this.animator ? this.animator.setTrigger(this._isHovered ? this.animationTriggers.highlightedTrigger : this.animationTriggers.normalTrigger) : this.transition === 1 && this.colors && ((s = this._image) == null || s.setState(this._isHovered ? "hovered" : "normal")));
|
|
64699
64705
|
}
|
|
64700
64706
|
onPointerClick(t) {
|
|
64701
|
-
|
|
64702
|
-
!this.interactable || t.pointerId === void 0 || t.pointerId !== 0 && this.context.input.getIsMouse(t.pointerId) || (ud && (console.warn("Button Click", this.onClick), _n("CLICKED button " + this.name + " at " + this.context.time.frameCount)), (i = this.onClick) == null || i.invoke(), t.use());
|
|
64707
|
+
!this.interactable || t.pointerId === void 0 || t.pointerId !== 0 && this.context.input.getIsMouse(t.pointerId) || (ud && (console.warn("Button Click", this.onClick), _n("CLICKED button " + this.name + " at " + this.context.time.frameCount)), this.onClick && this.onClick.listenerCount > 0 && (this.onClick.invoke(), t.use()));
|
|
64703
64708
|
}
|
|
64704
64709
|
set interactable(t) {
|
|
64705
64710
|
this._interactable = t, this._image && (this._image.setInteractable(t), t ? this._image.setState("normal") : this._image.setState("disabled"));
|