Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/gesture-browser-negotiation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[chore] Internal: touch-action derivation, the native scroll probe and haptics for the gesture system. Not exported from the package entry point; no component uses them yet.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/gesture-host.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[chore] Internal: the gesture system's DOM host (claims, click suppression, the browser's takeover, the pointer behind a contact), serving a mouse, a pen and a finger alike, with no page listener while idle where the primary pointer is fine. Not exported from the package entry point; no component uses it yet.

@vjeux
35 changes: 35 additions & 0 deletions packages/core/src/gestures/GestureArena.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,41 @@ export class GestureArena {
});
}

/**
* A contact began where nothing takes part (plain page content). It is
* never tracked and stays the browser's; recognizers already tracking a
* gesture hear of it, as of any touch off their hit path.
*/
untrackedBegan(input: TouchBeganInput): void {
if (!this.active.some(recognizer => recognizer.numberOfTouches > 0)) {
return;
}
this.run(input.time, () => {
const time = this.clampTime(input.time);
const touch: GestureTouch = {
id: input.id,
pointerType: input.pointerType,
phase: 'began',
x: input.x,
y: input.y,
time,
startX: input.x,
startY: input.y,
startTime: time,
samples: [{x: input.x, y: input.y, time}],
target: input.target,
scroll: input.scroll ?? null,
takenByBrowser: false,
};
const context = this.context();
for (const recognizer of [...this.active]) {
if (recognizer.numberOfTouches > 0) {
recognizer.deliverBeganElsewhere([touch], context);
}
}
});
}

/** Contacts moved. */
moved(inputs: ReadonlyArray<TouchInput>): void {
if (inputs.length === 0) {
Expand Down
Loading
Loading