@weasel-js/routing 1.5.1 → 1.5.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/dist/{chunk-ZZICE4J7.js → chunk-H5AGTB2J.js} +12 -12
- package/dist/chunk-H5AGTB2J.js.map +1 -0
- package/dist/{index-DhFGCPmN.d.ts → index-D4hKg8yu.d.ts} +12 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +18 -10
- package/dist/react.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-ZZICE4J7.js.map +0 -1
|
@@ -488,11 +488,10 @@ function worldPointOf(event) {
|
|
|
488
488
|
switch (event.kind) {
|
|
489
489
|
case "pointerdown":
|
|
490
490
|
case "longpress":
|
|
491
|
-
return event.x !== void 0 && event.y !== void 0 ? { x: event.x, y: event.y } : void 0;
|
|
492
491
|
case "click":
|
|
493
492
|
case "doubleclick":
|
|
494
493
|
case "contextmenu":
|
|
495
|
-
return event.
|
|
494
|
+
return event.x !== void 0 && event.y !== void 0 ? { x: event.x, y: event.y } : void 0;
|
|
496
495
|
default:
|
|
497
496
|
return void 0;
|
|
498
497
|
}
|
|
@@ -548,9 +547,9 @@ function createDispatcher(opts) {
|
|
|
548
547
|
base.key = { key: event.key, repeat: false };
|
|
549
548
|
} else if (event.kind === "wheel") {
|
|
550
549
|
base.wheel = { deltaX: event.deltaX, deltaY: event.deltaY, deltaZ: 0 };
|
|
551
|
-
} else if (event.kind === "pointerdown" || event.kind === "click") {
|
|
552
|
-
const sx = event.kind === "
|
|
553
|
-
const sy = event.kind === "
|
|
550
|
+
} else if (event.kind === "pointerdown" || event.kind === "click" || event.kind === "doubleclick" || event.kind === "contextmenu") {
|
|
551
|
+
const sx = event.x ?? (event.kind === "click" ? event.pressX : void 0) ?? 0;
|
|
552
|
+
const sy = event.y ?? (event.kind === "click" ? event.pressY : void 0) ?? 0;
|
|
554
553
|
base.world = { x: sx, y: sy };
|
|
555
554
|
const affordance = event.kind === "pointerdown" ? event.affordance : void 0;
|
|
556
555
|
base.drag = {
|
|
@@ -566,7 +565,8 @@ function createDispatcher(opts) {
|
|
|
566
565
|
const origin = gestureId ? dragOrigins.get(gestureId) : void 0;
|
|
567
566
|
const ox = origin?.x ?? cx;
|
|
568
567
|
const oy = origin?.y ?? cy;
|
|
569
|
-
const
|
|
568
|
+
const live = gestureId ? dragPoints.get(gestureId) : void 0;
|
|
569
|
+
const points = live && event.kind === "pointerup" ? [...live] : live;
|
|
570
570
|
const eventClientX = event.clientX;
|
|
571
571
|
const eventClientY = event.clientY;
|
|
572
572
|
const hasClient = eventClientX !== void 0 && eventClientY !== void 0 && origin?.clientX !== void 0 && origin?.clientY !== void 0;
|
|
@@ -791,8 +791,8 @@ function createDispatcher(opts) {
|
|
|
791
791
|
};
|
|
792
792
|
} else if (event.kind === "click" || event.kind === "doubleclick") {
|
|
793
793
|
params = {
|
|
794
|
-
worldX: event.
|
|
795
|
-
worldY: event.
|
|
794
|
+
worldX: event.x,
|
|
795
|
+
worldY: event.y,
|
|
796
796
|
affordance: event.affordance,
|
|
797
797
|
// Press point as well as release point — an action that places
|
|
798
798
|
// geometry at the click wants the former. See `ClickEvent`.
|
|
@@ -802,8 +802,8 @@ function createDispatcher(opts) {
|
|
|
802
802
|
};
|
|
803
803
|
} else if (event.kind === "contextmenu" || event.kind === "longpress") {
|
|
804
804
|
params = {
|
|
805
|
-
worldX: event.
|
|
806
|
-
worldY: event.
|
|
805
|
+
worldX: event.x,
|
|
806
|
+
worldY: event.y,
|
|
807
807
|
affordance: event.affordance,
|
|
808
808
|
bodyTarget: event.bodyTarget,
|
|
809
809
|
mods: modifiersOf(event),
|
|
@@ -1510,5 +1510,5 @@ function dlog(namespace, ...args) {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
|
|
1512
1512
|
export { ALWAYS, COARSE_TARGET_SCALE, DEFAULT_ALLOWED_CAPABILITIES, DEFAULT_DEVICE_PROFILE, INGEST_STRING_MIMES, NEVER, PREDICATE_TARGET, TOOL_OFFHAND_ID, actionBindings, buildDepsFromRequires, buildRouteRegistry, buildRuleCtx, buildToolOffhandBindings, clientToCanvas, clientToCanvasRect, createDispatcher, describeRule, dlog, evaluate, filterEligible, findConflicts, isDev, isEditableTarget, itemsFromClipboardData, itemsFromDataTransfer, itemsFromFiles, liveScope, makeToolOffhandAction, matchBest, matchSorted, matchesKeyBinding, offhandKeyFor, openPointerSession, pointerGestureId, recordModeSwitch, reportRouteConflicts, resolveDeviceProfile, resolveParams, routeGestureForSpecKind, routesForSpec, scopeBindings, specificity, targetConsultsAffordance, validateActionDefaultBinding, validateActionId };
|
|
1513
|
-
//# sourceMappingURL=chunk-
|
|
1514
|
-
//# sourceMappingURL=chunk-
|
|
1513
|
+
//# sourceMappingURL=chunk-H5AGTB2J.js.map
|
|
1514
|
+
//# sourceMappingURL=chunk-H5AGTB2J.js.map
|