@flighthq/interaction 0.3.1-next.975.01aea94 → 0.4.0-edge.1908.751021c
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/contract.d.ts +0 -1
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +0 -1
- package/dist/contract.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactionSpatialIndex.d.ts.map +1 -1
- package/dist/interactionSpatialIndex.js +4 -4
- package/dist/interactionSpatialIndex.js.map +1 -1
- package/package.json +13 -13
- package/src/interactionSpatialIndex.test.ts +2 -2
- package/dist/cursorBackend.d.ts +0 -12
- package/dist/cursorBackend.d.ts.map +0 -1
- package/dist/cursorBackend.js +0 -17
- package/dist/cursorBackend.js.map +0 -1
- package/src/cursorBackend.test.ts +0 -24
package/dist/contract.d.ts
CHANGED
package/dist/contract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
package/dist/contract.js
CHANGED
package/dist/contract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { captureInteractionPointer, clearFocus, connectFocusNavigation, connectInputToInteraction, connectInteractionSignal, containsNode2D, createFocusManager, createInteractionManager, createNodeInteractionState,
|
|
1
|
+
export { captureInteractionPointer, clearFocus, connectFocusNavigation, connectInputToInteraction, connectInteractionSignal, containsNode2D, createFocusManager, createInteractionManager, createNodeInteractionState, describeGraphHit, disableInteractionGuards, disconnectInteractionSignal, dispatchInteractionContextMenu, dispatchInteractionKeyDown, dispatchInteractionKeyUp, dispatchInteractionPointerCancel, dispatchInteractionPointerDown, dispatchInteractionPointerMove, dispatchInteractionPointerUp, dispatchInteractionWheel, enableInteractionGuards, enableInteractionSignals, enableNodeInteractionState, explainInteractionHitEligibility, findGraphHitTarget, findGraphHitTargetPrecise, findGraphHitTargets, findGraphHitTargetsPrecise, findSpatialInteractionTarget, focusNextNode, focusNodeInDirection, focusPreviousNode, getFocusOrder, getFocusedNode, getInteractionSignals, getNode2DOverlapRectangle, getNodeCursor, getNodeHitArea, getNodeInteractionState, getNodeTabIndex, hitTestAreaQuery, hitTestAreaQueryCircle, hitTestGraphLocalBounds, hitTestGraphPoint, hitTestGraphPointPrecise, hitTestNode2Ds, hitTestNode2DsShape, hitTestNodeRegion, isNodeFocusable, isNodeFocused, isNodeHitTestEnabled, refreshInteractionSpatialIndex, registerSpriteHitTest, registerDefaultHitTests, registerHitTest, registerHitTestPrecise, registerShapeHitTest, registerTextHitTest, releaseInteractionPointer, setFocusedNode, setInteractionConnectGuard, setNodeCursor, setNodeFocusable, setNodeHitArea, setNodeHitTestEnabled, setNodeTabIndex, } from './contract';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,wBAAwB,EACxB,2BAA2B,EAC3B,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { captureInteractionPointer, clearFocus, connectFocusNavigation, connectInputToInteraction, connectInteractionSignal, containsNode2D, createFocusManager, createInteractionManager, createNodeInteractionState,
|
|
1
|
+
export { captureInteractionPointer, clearFocus, connectFocusNavigation, connectInputToInteraction, connectInteractionSignal, containsNode2D, createFocusManager, createInteractionManager, createNodeInteractionState, describeGraphHit, disableInteractionGuards, disconnectInteractionSignal, dispatchInteractionContextMenu, dispatchInteractionKeyDown, dispatchInteractionKeyUp, dispatchInteractionPointerCancel, dispatchInteractionPointerDown, dispatchInteractionPointerMove, dispatchInteractionPointerUp, dispatchInteractionWheel, enableInteractionGuards, enableInteractionSignals, enableNodeInteractionState, explainInteractionHitEligibility, findGraphHitTarget, findGraphHitTargetPrecise, findGraphHitTargets, findGraphHitTargetsPrecise, findSpatialInteractionTarget, focusNextNode, focusNodeInDirection, focusPreviousNode, getFocusOrder, getFocusedNode, getInteractionSignals, getNode2DOverlapRectangle, getNodeCursor, getNodeHitArea, getNodeInteractionState, getNodeTabIndex, hitTestAreaQuery, hitTestAreaQueryCircle, hitTestGraphLocalBounds, hitTestGraphPoint, hitTestGraphPointPrecise, hitTestNode2Ds, hitTestNode2DsShape, hitTestNodeRegion, isNodeFocusable, isNodeFocused, isNodeHitTestEnabled, refreshInteractionSpatialIndex, registerSpriteHitTest, registerDefaultHitTests, registerHitTest, registerHitTestPrecise, registerShapeHitTest, registerTextHitTest, releaseInteractionPointer, setFocusedNode, setInteractionConnectGuard, setNodeCursor, setNodeFocusable, setNodeHitArea, setNodeHitTestEnabled, setNodeTabIndex, } from './contract';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,wBAAwB,EACxB,2BAA2B,EAC3B,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,8BAA8B,EAC9B,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionSpatialIndex.d.ts","sourceRoot":"","sources":["../src/interactionSpatialIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAU,kBAAkB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"interactionSpatialIndex.d.ts","sourceRoot":"","sources":["../src/interactionSpatialIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAU,kBAAkB,EAAE,OAAO,EAAkC,MAAM,0BAA0B,CAAC;AAKpH;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,OAAO,EAC5D,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC9B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,OAAO,GAAE,OAAe,GACvB,CAAC,GAAG,IAAI,CAmBV;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,IAAI,CAiBtG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getNodeRuntime, getNodeWorldBoundsRectangle } from '@flighthq/node/contract';
|
|
2
|
-
import {
|
|
2
|
+
import { clearSpatialIndex2D, insertSpatialObject2D, querySpatialPoint2D } from '@flighthq/spatial/contract';
|
|
3
3
|
import { hitTestNodeRegion } from './hitTests';
|
|
4
4
|
import { getNodeInteractionState } from './nodeInteractionState';
|
|
5
5
|
/**
|
|
@@ -15,7 +15,7 @@ export function findSpatialInteractionTarget(manager, x, y, precise = false) {
|
|
|
15
15
|
const nodes = managerCandidates.get(manager);
|
|
16
16
|
if (nodes === undefined || nodes.length === 0)
|
|
17
17
|
return null;
|
|
18
|
-
|
|
18
|
+
querySpatialPoint2D(index, x, y, spatialQueryOut);
|
|
19
19
|
let best = null;
|
|
20
20
|
let bestRank = Infinity;
|
|
21
21
|
for (let i = 0; i < spatialQueryOut.length; i++) {
|
|
@@ -44,14 +44,14 @@ export function refreshInteractionSpatialIndex(manager) {
|
|
|
44
44
|
const nodes = [];
|
|
45
45
|
collectSpatialCandidates(manager.root, nodes);
|
|
46
46
|
managerCandidates.set(manager, nodes);
|
|
47
|
-
|
|
47
|
+
clearSpatialIndex2D(index);
|
|
48
48
|
for (let rank = 0; rank < nodes.length; rank++) {
|
|
49
49
|
const bounds = getNodeWorldBoundsRectangle(nodes[rank]);
|
|
50
50
|
spatialInsertAabb.minX = bounds.x;
|
|
51
51
|
spatialInsertAabb.minY = bounds.y;
|
|
52
52
|
spatialInsertAabb.maxX = bounds.x + bounds.width;
|
|
53
53
|
spatialInsertAabb.maxY = bounds.y + bounds.height;
|
|
54
|
-
|
|
54
|
+
insertSpatialObject2D(index, rank, spatialInsertAabb);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
function collectSpatialCandidates(node, out) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionSpatialIndex.js","sourceRoot":"","sources":["../src/interactionSpatialIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"interactionSpatialIndex.js","sourceRoot":"","sources":["../src/interactionSpatialIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EA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C,CAAC,QAAQ,CAAC;IAC/C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,OAAO;QAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,OAAO,EAAqB,CAAC;AAC3D,MAAM,iBAAiB,GAAkB,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAChF,MAAM,eAAe,GAAsB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/interaction",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-edge.1908.751021c",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/geometry": "0.
|
|
42
|
-
"@flighthq/node": "0.
|
|
43
|
-
"@flighthq/scene2d": "0.
|
|
44
|
-
"@flighthq/log": "0.
|
|
45
|
-
"@flighthq/path": "0.
|
|
46
|
-
"@flighthq/shape": "0.
|
|
47
|
-
"@flighthq/spatial": "0.
|
|
48
|
-
"@flighthq/signals": "0.
|
|
49
|
-
"@flighthq/bitmap": "0.
|
|
50
|
-
"@flighthq/text": "0.
|
|
51
|
-
"@flighthq/textlayout": "0.
|
|
52
|
-
"@flighthq/types": "0.
|
|
41
|
+
"@flighthq/geometry": "0.4.0-edge.1908.751021c",
|
|
42
|
+
"@flighthq/node": "0.4.0-edge.1908.751021c",
|
|
43
|
+
"@flighthq/scene2d": "0.4.0-edge.1908.751021c",
|
|
44
|
+
"@flighthq/log": "0.4.0-edge.1908.751021c",
|
|
45
|
+
"@flighthq/path": "0.4.0-edge.1908.751021c",
|
|
46
|
+
"@flighthq/shape": "0.4.0-edge.1908.751021c",
|
|
47
|
+
"@flighthq/spatial": "0.4.0-edge.1908.751021c",
|
|
48
|
+
"@flighthq/signals": "0.4.0-edge.1908.751021c",
|
|
49
|
+
"@flighthq/bitmap": "0.4.0-edge.1908.751021c",
|
|
50
|
+
"@flighthq/text": "0.4.0-edge.1908.751021c",
|
|
51
|
+
"@flighthq/textlayout": "0.4.0-edge.1908.751021c",
|
|
52
|
+
"@flighthq/types": "0.4.0-edge.1908.751021c"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@flighthq/quadbatch": "*",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setRectangle } from '@flighthq/geometry/contract';
|
|
2
2
|
import { addNodeChild, getNodeLocalBoundsRectangle, invalidateNodeLocalTransform } from '@flighthq/node/contract';
|
|
3
3
|
import { createDisplayObject, createNode2D } from '@flighthq/scene2d/contract';
|
|
4
|
-
import {
|
|
4
|
+
import { createSpatialIndex2D, createUniformGridSpatialBackend2D } from '@flighthq/spatial/contract';
|
|
5
5
|
import { DisplayObjectKind } from '@flighthq/types/contract';
|
|
6
6
|
|
|
7
7
|
import { hitTestGraphLocalBounds, registerHitTest } from './hitTests';
|
|
@@ -22,7 +22,7 @@ function candidate(x: number, y: number, w: number, h: number) {
|
|
|
22
22
|
function managedScene3D() {
|
|
23
23
|
registerHitTest(DisplayObjectKind, hitTestGraphLocalBounds);
|
|
24
24
|
const root = createDisplayObject();
|
|
25
|
-
const index =
|
|
25
|
+
const index = createSpatialIndex2D(createUniformGridSpatialBackend2D(64));
|
|
26
26
|
const manager = createInteractionManager(root, { spatialIndex: index });
|
|
27
27
|
return { manager, root };
|
|
28
28
|
}
|
package/dist/cursorBackend.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CursorBackend } from '@flighthq/types/contract';
|
|
2
|
-
/**
|
|
3
|
-
* Web cursor backend: applies the resolved rollover cursor to a DOM element's `style.cursor`
|
|
4
|
-
* (typically the render canvas). `setCursor(null)` clears back to the element's default. Pass the
|
|
5
|
-
* result to `createInteractionManager` via `cursorBackend`, or assign it to `manager.cursorBackend`.
|
|
6
|
-
*
|
|
7
|
-
* The backend is held per manager rather than globally, so multiple canvases each drive their own
|
|
8
|
-
* cursor zone. Import side-effect-free: this only constructs the backend; nothing is applied until
|
|
9
|
-
* pointer dispatch resolves a rollover.
|
|
10
|
-
*/
|
|
11
|
-
export declare function createWebCursorBackend(element: HTMLElement): CursorBackend;
|
|
12
|
-
//# sourceMappingURL=cursorBackend.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursorBackend.d.ts","sourceRoot":"","sources":["../src/cursorBackend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CAM1E"}
|
package/dist/cursorBackend.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Web cursor backend: applies the resolved rollover cursor to a DOM element's `style.cursor`
|
|
3
|
-
* (typically the render canvas). `setCursor(null)` clears back to the element's default. Pass the
|
|
4
|
-
* result to `createInteractionManager` via `cursorBackend`, or assign it to `manager.cursorBackend`.
|
|
5
|
-
*
|
|
6
|
-
* The backend is held per manager rather than globally, so multiple canvases each drive their own
|
|
7
|
-
* cursor zone. Import side-effect-free: this only constructs the backend; nothing is applied until
|
|
8
|
-
* pointer dispatch resolves a rollover.
|
|
9
|
-
*/
|
|
10
|
-
export function createWebCursorBackend(element) {
|
|
11
|
-
return {
|
|
12
|
-
setCursor(cursor) {
|
|
13
|
-
element.style.cursor = cursor ?? '';
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=cursorBackend.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursorBackend.js","sourceRoot":"","sources":["../src/cursorBackend.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAoB;IACzD,OAAO;QACL,SAAS,CAAC,MAAqB;YAC7B,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Cursor } from '@flighthq/types/contract';
|
|
2
|
-
|
|
3
|
-
import { createWebCursorBackend } from './cursorBackend';
|
|
4
|
-
|
|
5
|
-
describe('createWebCursorBackend', () => {
|
|
6
|
-
function fakeElement(): { style: { cursor: string } } {
|
|
7
|
-
return { style: { cursor: 'init' } };
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
it('writes the cursor value to element.style.cursor', () => {
|
|
11
|
-
const el = fakeElement();
|
|
12
|
-
const backend = createWebCursorBackend(el as unknown as HTMLElement);
|
|
13
|
-
backend.setCursor('pointer' as Cursor);
|
|
14
|
-
expect(el.style.cursor).toBe('pointer');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('clears to the empty string when given null', () => {
|
|
18
|
-
const el = fakeElement();
|
|
19
|
-
const backend = createWebCursorBackend(el as unknown as HTMLElement);
|
|
20
|
-
backend.setCursor('grab' as Cursor);
|
|
21
|
-
backend.setCursor(null);
|
|
22
|
-
expect(el.style.cursor).toBe('');
|
|
23
|
-
});
|
|
24
|
-
});
|