@dreamboard-games/sdk 0.5.0-alpha.26 → 0.5.0-alpha.28
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 +5 -5
- package/dist/{chunk-3RFGPBES.js → chunk-3KBMAFNW.js} +5 -5
- package/dist/{chunk-3RFGPBES.js.map → chunk-3KBMAFNW.js.map} +1 -1
- package/dist/index.d.ts +20 -5
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/react.js +11 -7
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createGestureRecognizer,
|
|
4
4
|
isSameDropTarget,
|
|
5
5
|
magneticDropPoint
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3KBMAFNW.js";
|
|
7
7
|
import {
|
|
8
8
|
inputValueKey
|
|
9
9
|
} from "./chunk-CZRPUWCT.js";
|
|
@@ -572,10 +572,14 @@ function createGestureSession(game) {
|
|
|
572
572
|
function inspectWithAlt() {
|
|
573
573
|
const target = hover ?? focused;
|
|
574
574
|
const cardId = target?.kind === "card" ? target.value : null;
|
|
575
|
-
const pending = store.get()
|
|
575
|
+
const { drag: pending, inspect } = store.get();
|
|
576
576
|
set({
|
|
577
577
|
activeTarget: target,
|
|
578
|
-
inspect:
|
|
578
|
+
inspect: (
|
|
579
|
+
// Chrome's long press moves focus to the held card; a hold lasts
|
|
580
|
+
// until its press ends.
|
|
581
|
+
press && inspect?.via === "hold" ? inspect : alt && cardId && !press && !(pending?.settling && pending.cardIds.includes(cardId)) ? { cardId, via: "hover" } : null
|
|
582
|
+
)
|
|
579
583
|
});
|
|
580
584
|
}
|
|
581
585
|
function targetOf(element) {
|
|
@@ -775,8 +779,8 @@ function createGestureSession(game) {
|
|
|
775
779
|
const cancel = (next) => recognizer.cancel(next);
|
|
776
780
|
const blur = () => recognizer.cancel();
|
|
777
781
|
addEventListener("pointermove", move);
|
|
778
|
-
addEventListener("pointerup", up);
|
|
779
|
-
addEventListener("pointercancel", cancel);
|
|
782
|
+
addEventListener("pointerup", up, true);
|
|
783
|
+
addEventListener("pointercancel", cancel, true);
|
|
780
784
|
addEventListener("blur", blur);
|
|
781
785
|
if (event.pointerType === "mouse") {
|
|
782
786
|
try {
|
|
@@ -792,8 +796,8 @@ function createGestureSession(game) {
|
|
|
792
796
|
target: null,
|
|
793
797
|
detach() {
|
|
794
798
|
removeEventListener("pointermove", move);
|
|
795
|
-
removeEventListener("pointerup", up);
|
|
796
|
-
removeEventListener("pointercancel", cancel);
|
|
799
|
+
removeEventListener("pointerup", up, true);
|
|
800
|
+
removeEventListener("pointercancel", cancel, true);
|
|
797
801
|
removeEventListener("blur", blur);
|
|
798
802
|
if (capture.hasPointerCapture(event.pointerId))
|
|
799
803
|
capture.releasePointerCapture(event.pointerId);
|