@baleada/logic 0.24.18 → 0.24.19
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/lib/index.cjs +55 -346
- package/lib/index.d.ts +37 -114
- package/lib/index.js +52 -337
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -862,7 +862,7 @@ const observerAssertionsByType = {
|
|
|
862
862
|
resize: (observer) => observer instanceof ResizeObserver
|
|
863
863
|
};
|
|
864
864
|
|
|
865
|
-
const defaultOptions$
|
|
865
|
+
const defaultOptions$i = {
|
|
866
866
|
minDuration: 0,
|
|
867
867
|
preventsDefaultUnlessDenied: true,
|
|
868
868
|
toCode: (alias) => fromAliasToCode(alias),
|
|
@@ -878,7 +878,7 @@ function createKeypress(keycomboOrKeycombos, options = {}) {
|
|
|
878
878
|
onDown,
|
|
879
879
|
onUp,
|
|
880
880
|
onVisibilitychange
|
|
881
|
-
} = { ...defaultOptions$
|
|
881
|
+
} = { ...defaultOptions$i, ...options }, {
|
|
882
882
|
matchPredicatesByKeycombo,
|
|
883
883
|
getDownCombos,
|
|
884
884
|
predicateValid,
|
|
@@ -1015,7 +1015,7 @@ class Keypress extends Listenable {
|
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
1017
|
|
|
1018
|
-
const defaultOptions$
|
|
1018
|
+
const defaultOptions$h = {
|
|
1019
1019
|
minDuration: 0,
|
|
1020
1020
|
preventsDefaultUnlessDenied: true,
|
|
1021
1021
|
toCode: (alias) => fromAliasToCode(alias),
|
|
@@ -1031,7 +1031,7 @@ function createKeyrelease(keycomboOrKeycombos, options = {}) {
|
|
|
1031
1031
|
onDown,
|
|
1032
1032
|
onUp,
|
|
1033
1033
|
onVisibilitychange
|
|
1034
|
-
} = { ...defaultOptions$
|
|
1034
|
+
} = { ...defaultOptions$h, ...options }, {
|
|
1035
1035
|
matchPredicatesByKeycombo,
|
|
1036
1036
|
getDownCombos,
|
|
1037
1037
|
predicateValid,
|
|
@@ -1174,7 +1174,7 @@ class Keyrelease extends Listenable {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
|
|
1177
|
-
const defaultOptions$
|
|
1177
|
+
const defaultOptions$g = {
|
|
1178
1178
|
minDuration: 0,
|
|
1179
1179
|
maxInterval: 5e3,
|
|
1180
1180
|
// VS Code default
|
|
@@ -1193,7 +1193,7 @@ function createKeychord(keycombos, options = {}) {
|
|
|
1193
1193
|
onDown,
|
|
1194
1194
|
onUp,
|
|
1195
1195
|
onVisibilitychange
|
|
1196
|
-
} = { ...defaultOptions$
|
|
1196
|
+
} = { ...defaultOptions$g, ...options }, narrowedKeycombos = keycombos.split(" "), keyStates = createMap((keycombo) => createKeyState({
|
|
1197
1197
|
keycomboOrKeycombos: keycombo,
|
|
1198
1198
|
toLonghand,
|
|
1199
1199
|
toCode,
|
|
@@ -1369,11 +1369,11 @@ class Konami extends Listenable {
|
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
1371
|
|
|
1372
|
-
const defaultOptions$
|
|
1372
|
+
const defaultOptions$f = {
|
|
1373
1373
|
minDuration: 0,
|
|
1374
1374
|
minDistance: 0
|
|
1375
1375
|
};
|
|
1376
|
-
function
|
|
1376
|
+
function createPointerpress(options = {}) {
|
|
1377
1377
|
const {
|
|
1378
1378
|
minDuration,
|
|
1379
1379
|
minDistance,
|
|
@@ -1381,31 +1381,31 @@ function createMousepress(options = {}) {
|
|
|
1381
1381
|
onOut,
|
|
1382
1382
|
onMove,
|
|
1383
1383
|
onUp
|
|
1384
|
-
} = { ...defaultOptions$
|
|
1384
|
+
} = { ...defaultOptions$f, ...options }, stop = (target) => {
|
|
1385
1385
|
window.cancelAnimationFrame(request);
|
|
1386
|
-
target.removeEventListener("
|
|
1386
|
+
target.removeEventListener("pointermove", pointermoveEffect);
|
|
1387
1387
|
};
|
|
1388
1388
|
let request;
|
|
1389
|
-
let
|
|
1390
|
-
let
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1393
|
-
|
|
1389
|
+
let pointermoveEffect;
|
|
1390
|
+
let pointerStatus;
|
|
1391
|
+
const pointerdown = (event, api) => {
|
|
1392
|
+
pointerStatus = "down";
|
|
1393
|
+
pointermoveEffect = (event2) => pointermove(event2, api);
|
|
1394
1394
|
storePointerStartMetadata({ event, api });
|
|
1395
1395
|
storePointerMoveMetadata({ event, api });
|
|
1396
1396
|
storePointerTimeMetadata({
|
|
1397
1397
|
event,
|
|
1398
1398
|
api,
|
|
1399
|
-
getShouldStore: () =>
|
|
1399
|
+
getShouldStore: () => pointerStatus === "down",
|
|
1400
1400
|
setRequest: (newRequest) => request = newRequest,
|
|
1401
1401
|
// @ts-expect-error
|
|
1402
1402
|
recognize
|
|
1403
1403
|
});
|
|
1404
|
-
const { listenInjection: { optionsByType: {
|
|
1405
|
-
target.addEventListener("
|
|
1404
|
+
const { listenInjection: { optionsByType: { pointerdown: { target } } } } = api;
|
|
1405
|
+
target.addEventListener("pointermove", pointermoveEffect);
|
|
1406
1406
|
onDown?.(toHookApi(api));
|
|
1407
1407
|
};
|
|
1408
|
-
const
|
|
1408
|
+
const pointermove = (event, api) => {
|
|
1409
1409
|
const { pushSequence } = api;
|
|
1410
1410
|
pushSequence(event);
|
|
1411
1411
|
storePointerMoveMetadata({ event, api });
|
|
@@ -1418,325 +1418,44 @@ function createMousepress(options = {}) {
|
|
|
1418
1418
|
recognized();
|
|
1419
1419
|
}
|
|
1420
1420
|
};
|
|
1421
|
-
const
|
|
1422
|
-
const { denied, listenInjection: { optionsByType: {
|
|
1421
|
+
const pointerout = (event, api) => {
|
|
1422
|
+
const { denied, listenInjection: { optionsByType: { pointerout: { target } } } } = api;
|
|
1423
1423
|
if (event.target !== target && target.contains?.(event.relatedTarget)) {
|
|
1424
1424
|
onOut?.(toHookApi(api));
|
|
1425
1425
|
return;
|
|
1426
1426
|
}
|
|
1427
|
-
if (
|
|
1427
|
+
if (pointerStatus === "down") {
|
|
1428
1428
|
denied();
|
|
1429
1429
|
stop(target);
|
|
1430
|
-
|
|
1430
|
+
pointerStatus = "leave";
|
|
1431
1431
|
}
|
|
1432
1432
|
onOut?.(toHookApi(api));
|
|
1433
1433
|
};
|
|
1434
|
-
const
|
|
1435
|
-
const { denied, listenInjection: { optionsByType: {
|
|
1436
|
-
if (
|
|
1434
|
+
const pointerup = (event, api) => {
|
|
1435
|
+
const { denied, listenInjection: { optionsByType: { pointerup: { target } } } } = api;
|
|
1436
|
+
if (pointerStatus !== "down")
|
|
1437
1437
|
return;
|
|
1438
1438
|
denied();
|
|
1439
1439
|
stop(target);
|
|
1440
|
-
|
|
1441
|
-
onUp?.(toHookApi(api));
|
|
1442
|
-
};
|
|
1443
|
-
return {
|
|
1444
|
-
mousedown: {
|
|
1445
|
-
effect: mousedown,
|
|
1446
|
-
stop
|
|
1447
|
-
},
|
|
1448
|
-
mouseout,
|
|
1449
|
-
mouseup
|
|
1450
|
-
};
|
|
1451
|
-
}
|
|
1452
|
-
class Mousepress extends Listenable {
|
|
1453
|
-
constructor(options) {
|
|
1454
|
-
super(
|
|
1455
|
-
"recognizeable",
|
|
1456
|
-
{
|
|
1457
|
-
recognizeable: {
|
|
1458
|
-
effects: createMousepress(options)
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
);
|
|
1462
|
-
}
|
|
1463
|
-
get metadata() {
|
|
1464
|
-
return this.recognizeable.metadata;
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
const defaultOptions$h = {
|
|
1469
|
-
minDuration: 0,
|
|
1470
|
-
minDistance: 0,
|
|
1471
|
-
minVelocity: 0
|
|
1472
|
-
};
|
|
1473
|
-
function createMouserelease(options = {}) {
|
|
1474
|
-
const {
|
|
1475
|
-
minDuration,
|
|
1476
|
-
minDistance,
|
|
1477
|
-
minVelocity,
|
|
1478
|
-
onDown,
|
|
1479
|
-
onOut,
|
|
1480
|
-
onMove,
|
|
1481
|
-
onUp
|
|
1482
|
-
} = { ...defaultOptions$h, ...options }, stop = (target) => {
|
|
1483
|
-
window.cancelAnimationFrame(request);
|
|
1484
|
-
target.removeEventListener("mousemove", mousemoveEffect);
|
|
1485
|
-
};
|
|
1486
|
-
let request;
|
|
1487
|
-
let mousemoveEffect;
|
|
1488
|
-
let mouseStatus;
|
|
1489
|
-
const mousedown = (event, api) => {
|
|
1490
|
-
mouseStatus = "down";
|
|
1491
|
-
mousemoveEffect = (event2) => mousemove(event2, api);
|
|
1492
|
-
storePointerStartMetadata({ event, api });
|
|
1493
|
-
storePointerMoveMetadata({ event, api });
|
|
1494
|
-
storePointerTimeMetadata({
|
|
1495
|
-
event,
|
|
1496
|
-
api,
|
|
1497
|
-
getShouldStore: () => mouseStatus === "down",
|
|
1498
|
-
setRequest: (newRequest) => request = newRequest
|
|
1499
|
-
});
|
|
1500
|
-
const { listenInjection: { optionsByType: { mousedown: { target } } } } = api;
|
|
1501
|
-
target.addEventListener("mousemove", mousemoveEffect);
|
|
1502
|
-
onDown?.(toHookApi(api));
|
|
1503
|
-
};
|
|
1504
|
-
const mousemove = (event, api) => {
|
|
1505
|
-
storePointerMoveMetadata({ event, api });
|
|
1506
|
-
onMove?.(toHookApi(api));
|
|
1507
|
-
};
|
|
1508
|
-
const mouseout = (event, api) => {
|
|
1509
|
-
const { denied, listenInjection: { optionsByType: { mouseout: { target } } } } = api;
|
|
1510
|
-
if (event.target !== target && target.contains?.(event.relatedTarget)) {
|
|
1511
|
-
onOut?.(toHookApi(api));
|
|
1512
|
-
return;
|
|
1513
|
-
}
|
|
1514
|
-
if (mouseStatus === "down") {
|
|
1515
|
-
denied();
|
|
1516
|
-
stop(target);
|
|
1517
|
-
mouseStatus = "leave";
|
|
1518
|
-
}
|
|
1519
|
-
onOut?.(toHookApi(api));
|
|
1520
|
-
};
|
|
1521
|
-
const mouseup = (event, api) => {
|
|
1522
|
-
if (mouseStatus !== "down")
|
|
1523
|
-
return;
|
|
1524
|
-
storePointerMoveMetadata({ event, api });
|
|
1525
|
-
const { listenInjection: { optionsByType: { mouseup: { target } } } } = api;
|
|
1526
|
-
stop(target);
|
|
1527
|
-
mouseStatus = "up";
|
|
1528
|
-
recognize(event, api);
|
|
1440
|
+
pointerStatus = "up";
|
|
1529
1441
|
onUp?.(toHookApi(api));
|
|
1530
1442
|
};
|
|
1531
|
-
const recognize = (event, api) => {
|
|
1532
|
-
const { getMetadata, recognized, denied } = api, metadata = getMetadata();
|
|
1533
|
-
if (metadata.duration >= minDuration && metadata.distance.straight.fromStart >= minDistance && metadata.velocity >= minVelocity) {
|
|
1534
|
-
recognized();
|
|
1535
|
-
return;
|
|
1536
|
-
}
|
|
1537
|
-
denied();
|
|
1538
|
-
};
|
|
1539
1443
|
return {
|
|
1540
|
-
|
|
1541
|
-
effect:
|
|
1444
|
+
pointerdown: {
|
|
1445
|
+
effect: pointerdown,
|
|
1542
1446
|
stop
|
|
1543
1447
|
},
|
|
1544
|
-
|
|
1545
|
-
|
|
1448
|
+
pointerout,
|
|
1449
|
+
pointerup
|
|
1546
1450
|
};
|
|
1547
1451
|
}
|
|
1548
|
-
class
|
|
1452
|
+
class Pointerpress extends Listenable {
|
|
1549
1453
|
constructor(options) {
|
|
1550
1454
|
super(
|
|
1551
1455
|
"recognizeable",
|
|
1552
1456
|
{
|
|
1553
1457
|
recognizeable: {
|
|
1554
|
-
effects:
|
|
1555
|
-
}
|
|
1556
|
-
}
|
|
1557
|
-
);
|
|
1558
|
-
}
|
|
1559
|
-
get metadata() {
|
|
1560
|
-
return this.recognizeable.metadata;
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
const defaultOptions$g = {
|
|
1565
|
-
minDuration: 0,
|
|
1566
|
-
minDistance: 0
|
|
1567
|
-
};
|
|
1568
|
-
function createTouchpress(options = {}) {
|
|
1569
|
-
const {
|
|
1570
|
-
minDuration,
|
|
1571
|
-
minDistance,
|
|
1572
|
-
onStart,
|
|
1573
|
-
onCancel,
|
|
1574
|
-
onMove,
|
|
1575
|
-
onEnd
|
|
1576
|
-
} = { ...defaultOptions$g, ...options }, stop = () => {
|
|
1577
|
-
window.cancelAnimationFrame(request);
|
|
1578
|
-
};
|
|
1579
|
-
let request;
|
|
1580
|
-
let totalTouches = 0;
|
|
1581
|
-
const touchstart = (event, api) => {
|
|
1582
|
-
const { denied } = api;
|
|
1583
|
-
totalTouches++;
|
|
1584
|
-
if (totalTouches > 1) {
|
|
1585
|
-
stop();
|
|
1586
|
-
denied();
|
|
1587
|
-
onStart?.(toHookApi(api));
|
|
1588
|
-
return;
|
|
1589
|
-
}
|
|
1590
|
-
storePointerStartMetadata({ event, api });
|
|
1591
|
-
storePointerMoveMetadata({ event, api });
|
|
1592
|
-
storePointerTimeMetadata({
|
|
1593
|
-
event,
|
|
1594
|
-
api,
|
|
1595
|
-
getShouldStore: () => totalTouches === 1,
|
|
1596
|
-
setRequest: (newRequest) => request = newRequest,
|
|
1597
|
-
// @ts-expect-error
|
|
1598
|
-
recognize
|
|
1599
|
-
});
|
|
1600
|
-
onStart?.(toHookApi(api));
|
|
1601
|
-
};
|
|
1602
|
-
const touchmove = (event, api) => {
|
|
1603
|
-
const { getStatus } = api;
|
|
1604
|
-
if (getStatus() !== "denied") {
|
|
1605
|
-
storePointerMoveMetadata({ event, api });
|
|
1606
|
-
recognize(event, api);
|
|
1607
|
-
}
|
|
1608
|
-
onMove?.(toHookApi(api));
|
|
1609
|
-
};
|
|
1610
|
-
const recognize = (event, api) => {
|
|
1611
|
-
const { getMetadata, recognized } = api, metadata = getMetadata();
|
|
1612
|
-
if (metadata.duration >= minDuration && metadata.distance.straight.fromStart >= minDistance) {
|
|
1613
|
-
recognized();
|
|
1614
|
-
}
|
|
1615
|
-
};
|
|
1616
|
-
const touchcancel = (event, api) => {
|
|
1617
|
-
const { denied } = api;
|
|
1618
|
-
stop();
|
|
1619
|
-
denied();
|
|
1620
|
-
totalTouches--;
|
|
1621
|
-
onCancel?.(toHookApi(api));
|
|
1622
|
-
};
|
|
1623
|
-
const touchend = (event, api) => {
|
|
1624
|
-
const { denied } = api;
|
|
1625
|
-
stop();
|
|
1626
|
-
denied();
|
|
1627
|
-
totalTouches--;
|
|
1628
|
-
onEnd?.(toHookApi(api));
|
|
1629
|
-
};
|
|
1630
|
-
return {
|
|
1631
|
-
touchstart,
|
|
1632
|
-
touchmove,
|
|
1633
|
-
touchcancel,
|
|
1634
|
-
touchend
|
|
1635
|
-
};
|
|
1636
|
-
}
|
|
1637
|
-
class Touchpress extends Listenable {
|
|
1638
|
-
constructor(options) {
|
|
1639
|
-
super(
|
|
1640
|
-
"recognizeable",
|
|
1641
|
-
{
|
|
1642
|
-
recognizeable: {
|
|
1643
|
-
effects: createTouchpress(options)
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1646
|
-
);
|
|
1647
|
-
}
|
|
1648
|
-
get metadata() {
|
|
1649
|
-
return this.recognizeable.metadata;
|
|
1650
|
-
}
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
const defaultOptions$f = {
|
|
1654
|
-
minDuration: 0,
|
|
1655
|
-
minDistance: 0,
|
|
1656
|
-
minVelocity: 0
|
|
1657
|
-
};
|
|
1658
|
-
function createTouchrelease(options = {}) {
|
|
1659
|
-
const {
|
|
1660
|
-
minDuration,
|
|
1661
|
-
minDistance,
|
|
1662
|
-
minVelocity,
|
|
1663
|
-
onStart,
|
|
1664
|
-
onCancel,
|
|
1665
|
-
onMove,
|
|
1666
|
-
onEnd
|
|
1667
|
-
} = { ...defaultOptions$f, ...options }, stop = () => {
|
|
1668
|
-
window.cancelAnimationFrame(request);
|
|
1669
|
-
};
|
|
1670
|
-
let request;
|
|
1671
|
-
let totalTouches = 0;
|
|
1672
|
-
const touchstart = (event, api) => {
|
|
1673
|
-
const { denied } = api;
|
|
1674
|
-
totalTouches++;
|
|
1675
|
-
if (totalTouches > 1) {
|
|
1676
|
-
stop();
|
|
1677
|
-
denied();
|
|
1678
|
-
onStart?.(toHookApi(api));
|
|
1679
|
-
return;
|
|
1680
|
-
}
|
|
1681
|
-
storePointerStartMetadata({ event, api });
|
|
1682
|
-
storePointerMoveMetadata({ event, api });
|
|
1683
|
-
storePointerTimeMetadata({
|
|
1684
|
-
event,
|
|
1685
|
-
api,
|
|
1686
|
-
getShouldStore: () => totalTouches === 1,
|
|
1687
|
-
setRequest: (newRequest) => request = newRequest
|
|
1688
|
-
});
|
|
1689
|
-
onStart?.(toHookApi(api));
|
|
1690
|
-
};
|
|
1691
|
-
const touchmove = (event, api) => {
|
|
1692
|
-
const { getStatus } = api;
|
|
1693
|
-
if (getStatus() !== "denied")
|
|
1694
|
-
storePointerMoveMetadata({ event, api });
|
|
1695
|
-
onMove?.(toHookApi(api));
|
|
1696
|
-
};
|
|
1697
|
-
const touchcancel = (event, api) => {
|
|
1698
|
-
const { denied } = api;
|
|
1699
|
-
stop();
|
|
1700
|
-
denied();
|
|
1701
|
-
totalTouches--;
|
|
1702
|
-
onCancel?.(toHookApi(api));
|
|
1703
|
-
};
|
|
1704
|
-
const touchend = (event, api) => {
|
|
1705
|
-
const { denied } = api;
|
|
1706
|
-
if (totalTouches !== 1) {
|
|
1707
|
-
stop();
|
|
1708
|
-
denied();
|
|
1709
|
-
onEnd?.(toHookApi(api));
|
|
1710
|
-
return;
|
|
1711
|
-
}
|
|
1712
|
-
storePointerMoveMetadata({ event, api });
|
|
1713
|
-
stop();
|
|
1714
|
-
totalTouches--;
|
|
1715
|
-
recognize(event, api);
|
|
1716
|
-
onEnd?.(toHookApi(api));
|
|
1717
|
-
};
|
|
1718
|
-
const recognize = (event, api) => {
|
|
1719
|
-
const { getMetadata, recognized, denied } = api, metadata = getMetadata();
|
|
1720
|
-
if (metadata.duration >= minDuration && metadata.distance.straight.fromStart >= minDistance && metadata.velocity >= minVelocity) {
|
|
1721
|
-
recognized();
|
|
1722
|
-
} else {
|
|
1723
|
-
denied();
|
|
1724
|
-
}
|
|
1725
|
-
};
|
|
1726
|
-
return {
|
|
1727
|
-
touchstart,
|
|
1728
|
-
touchmove,
|
|
1729
|
-
touchcancel,
|
|
1730
|
-
touchend
|
|
1731
|
-
};
|
|
1732
|
-
}
|
|
1733
|
-
class Touchrelease extends Listenable {
|
|
1734
|
-
constructor(options) {
|
|
1735
|
-
super(
|
|
1736
|
-
"recognizeable",
|
|
1737
|
-
{
|
|
1738
|
-
recognizeable: {
|
|
1739
|
-
effects: createTouchrelease(options)
|
|
1458
|
+
effects: createPointerpress(options)
|
|
1740
1459
|
}
|
|
1741
1460
|
}
|
|
1742
1461
|
);
|
|
@@ -1749,7 +1468,7 @@ class Touchrelease extends Listenable {
|
|
|
1749
1468
|
const defaultOptions$e = {
|
|
1750
1469
|
minDuration: 0
|
|
1751
1470
|
};
|
|
1752
|
-
function
|
|
1471
|
+
function createPointerhover(options = {}) {
|
|
1753
1472
|
const {
|
|
1754
1473
|
minDuration,
|
|
1755
1474
|
onOver,
|
|
@@ -1758,16 +1477,16 @@ function createHover(options = {}) {
|
|
|
1758
1477
|
window.cancelAnimationFrame(request);
|
|
1759
1478
|
};
|
|
1760
1479
|
let request;
|
|
1761
|
-
let
|
|
1762
|
-
const
|
|
1763
|
-
if (
|
|
1764
|
-
|
|
1480
|
+
let pointerStatus = "exited";
|
|
1481
|
+
const pointerover = (event, api) => {
|
|
1482
|
+
if (pointerStatus === "exited") {
|
|
1483
|
+
pointerStatus = "entered";
|
|
1765
1484
|
storePointerStartMetadata({ event, api });
|
|
1766
1485
|
storePointerMoveMetadata({ event, api });
|
|
1767
1486
|
storePointerTimeMetadata({
|
|
1768
1487
|
event,
|
|
1769
1488
|
api,
|
|
1770
|
-
getShouldStore: () =>
|
|
1489
|
+
getShouldStore: () => pointerStatus === "entered",
|
|
1771
1490
|
setRequest: (newRequest) => request = newRequest,
|
|
1772
1491
|
// @ts-expect-error
|
|
1773
1492
|
recognize
|
|
@@ -1784,38 +1503,34 @@ function createHover(options = {}) {
|
|
|
1784
1503
|
recognized();
|
|
1785
1504
|
}
|
|
1786
1505
|
};
|
|
1787
|
-
const
|
|
1788
|
-
const { denied, listenInjection: { optionsByType: {
|
|
1506
|
+
const pointerout = (event, api) => {
|
|
1507
|
+
const { denied, listenInjection: { optionsByType: { pointerout: { target } } } } = api;
|
|
1789
1508
|
if (event.target !== target && target.contains?.(event.relatedTarget)) {
|
|
1790
1509
|
onOut?.(toHookApi(api));
|
|
1791
1510
|
return;
|
|
1792
1511
|
}
|
|
1793
|
-
if (
|
|
1512
|
+
if (pointerStatus === "entered") {
|
|
1794
1513
|
denied();
|
|
1795
1514
|
stop();
|
|
1796
|
-
|
|
1515
|
+
pointerStatus = "exited";
|
|
1797
1516
|
}
|
|
1798
1517
|
onOut?.(toHookApi(api));
|
|
1799
1518
|
};
|
|
1800
|
-
const touchstart = (event) => {
|
|
1801
|
-
event.preventDefault();
|
|
1802
|
-
};
|
|
1803
1519
|
return {
|
|
1804
|
-
|
|
1805
|
-
effect:
|
|
1520
|
+
pointerover: {
|
|
1521
|
+
effect: pointerover,
|
|
1806
1522
|
stop
|
|
1807
1523
|
},
|
|
1808
|
-
|
|
1809
|
-
touchstart
|
|
1524
|
+
pointerout
|
|
1810
1525
|
};
|
|
1811
1526
|
}
|
|
1812
|
-
class
|
|
1527
|
+
class Pointerhover extends Listenable {
|
|
1813
1528
|
constructor(options) {
|
|
1814
1529
|
super(
|
|
1815
1530
|
"recognizeable",
|
|
1816
1531
|
{
|
|
1817
1532
|
recognizeable: {
|
|
1818
|
-
effects:
|
|
1533
|
+
effects: createPointerhover(options)
|
|
1819
1534
|
}
|
|
1820
1535
|
}
|
|
1821
1536
|
);
|
|
@@ -2942,7 +2657,7 @@ function toHookApi({
|
|
|
2942
2657
|
};
|
|
2943
2658
|
}
|
|
2944
2659
|
|
|
2945
|
-
function
|
|
2660
|
+
function toPointerPoint(event) {
|
|
2946
2661
|
return {
|
|
2947
2662
|
x: event.clientX,
|
|
2948
2663
|
y: event.clientY
|
|
@@ -3025,7 +2740,7 @@ const initialMetadata$2 = {
|
|
|
3025
2740
|
};
|
|
3026
2741
|
function storePointerStartMetadata({ event, api }) {
|
|
3027
2742
|
const { getMetadata } = api, metadata = getMetadata();
|
|
3028
|
-
const point = event instanceof MouseEvent ?
|
|
2743
|
+
const point = event instanceof MouseEvent || event instanceof PointerEvent ? toPointerPoint(event) : toTouchMovePoint(event);
|
|
3029
2744
|
if (!metadata.points)
|
|
3030
2745
|
metadata.points = createClone()(initialMetadata$2.points);
|
|
3031
2746
|
metadata.points.start = point;
|
|
@@ -3065,7 +2780,7 @@ function storePointerMoveMetadata({ event, api }) {
|
|
|
3065
2780
|
}
|
|
3066
2781
|
const { x: previousX, y: previousY } = metadata.points.end, { x: startX, y: startY } = metadata.points.start, { x: newX, y: newY } = (() => {
|
|
3067
2782
|
if (event instanceof MouseEvent) {
|
|
3068
|
-
return
|
|
2783
|
+
return toPointerPoint(event);
|
|
3069
2784
|
}
|
|
3070
2785
|
if (event instanceof TouchEvent) {
|
|
3071
2786
|
if (event.type === "touchmove") {
|
|
@@ -5597,4 +5312,4 @@ class Storeable {
|
|
|
5597
5312
|
}
|
|
5598
5313
|
}
|
|
5599
5314
|
|
|
5600
|
-
export { Animateable, Broadcastable, Compareable, Completeable, Copyable, Delayable, Drawable, Fetchable, Fullscreenable, Grantable,
|
|
5315
|
+
export { Animateable, Broadcastable, Compareable, Completeable, Copyable, Delayable, Drawable, Fetchable, Fullscreenable, Grantable, Keychord, Keypress, Keyrelease, Konami, Listenable, Navigateable, Pickable, Pointerhover, Pointerpress, Recognizeable, Resolveable, Shareable, Storeable, createFormat$2 as createArrayFormat, createClear$2 as createAssociativeArrayClear, createDelete$2 as createAssociativeArrayDelete, createHas$1 as createAssociativeArrayHas, createKeys$1 as createAssociativeArrayKeys, createSet$2 as createAssociativeArraySet, createValue$2 as createAssociativeArrayValue, createValues$1 as createAssociativeArrayValues, createBreadthPathConfig, createChildren, createClamp, createClear$1 as createClear, createClip, createClone, createComputedStyle, createConcat, createFormat$1 as createDateFormat, createAncestor$1 as createDecisionTreeAncestor, createCommonAncestors$1 as createDecisionTreeCommonAncestors, createNodeDepthFirstSteps$1 as createDecisionTreeNodeDepthFirstSteps, createPath$1 as createDecisionTreePath, createDepthFirstSteps$1 as createDecisionTreeSteps, createTree$1 as createDecisionTreeTree, createDeepEqual, createDeepMerge, createDelete$1 as createDelete, createDepthPathConfig, createDetermine, createAncestor$2 as createDirectedAcyclicAncestor, createAncestor as createDirectedAcyclicAsyncAncestor, createCommonAncestors as createDirectedAcyclicAsyncCommonAncestors, createDepthFirstSteps as createDirectedAcyclicAsyncDepthFirstSteps, createLayers as createDirectedAcyclicAsyncLayers, createNodeDepthFirstSteps as createDirectedAcyclicAsyncNodeDepthFirstSteps, createPath as createDirectedAcyclicAsyncPath, createTree as createDirectedAcyclicAsyncTree, createCommonAncestors$2 as createDirectedAcyclicCommonAncestors, createDepthFirstSteps$2 as createDirectedAcyclicDepthFirstSteps, createLayers$1 as createDirectedAcyclicLayers, createNodeDepthFirstSteps$2 as createDirectedAcyclicNodeDepthFirstSteps, createPath$2 as createDirectedAcyclicPath, createRoots as createDirectedAcyclicRoots, createTree$2 as createDirectedAcyclicTree, createEntries, createEqual, createEvery, createFilter, createFilterAsync, createFindAsync, createFindIndexAsync, createFocusable, createForEachAsync, createGraph, createGreater, createGreaterOrEqual, createHas, createIncoming, createIndegree, createInsert, createKeychord, createKeycomboMatch$1 as createKeycomboMatch, createKeypress, createKeyrelease, createKeys, createKonami, createLess, createLessOrEqual, createList, createMap, createMapAsync, createMix, createNumber, createFormat as createNumberFormat, createOmit, createOnlyChild, createOutdegree, createOutgoing, createPick, createPointerhover, createPointerpress, createReduce, createReduceAsync, createRemove, createReorder, createReplace, createResults, createReverse, createRoot, createSanitize, createSet$1 as createSet, createShuffle, createSiblings, createSlice, createSlug, createSome, createSort, createSwap, createTerminal, createTotalSiblings, createFind as createTreeFind, createTry, createTryAsync, createUnique, createValue$1 as createValue, defineAssociativeArray, defineGraph, defineGraphAsync, defineGraphAsyncEdge, defineGraphAsyncEdges, defineGraphEdge, defineGraphEdges, defineGraphNode, defineGraphNodes, easingsNetInBack, easingsNetInCirc, easingsNetInCubic, easingsNetInExpo, easingsNetInOutBack, easingsNetInOutCirc, easingsNetInOutCubic, easingsNetInOutExpo, easingsNetInOutQuad, easingsNetInOutQuint, easingsNetInOutSine, easingsNetInQuad, easingsNetInQuart, easingsNetInQuint, easingsNetInSine, easingsNetOutBack, easingsNetOutCirc, easingsNetOutCubic, easingsNetOutExpo, easingsNetOutQuad, easingsNetOutQuint, easingsNetOutSine, fromAliasToCode, fromCodeToAliases, fromKeyboardEventDescriptorToAliases, fromShorthandAliasToLonghandAlias, linear, materialAccelerated, materialDecelerated, materialStandard, toD, toFlattenedD, toMessageListenParams, verouEase, verouEaseIn, verouEaseInOut, verouEaseOut };
|