Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

docs(core): the gesture arena's and host's doc comments sit on their declarations (#9114)

Christopher Chedeaube4573764637
diff --git a/.changeset/gesture-doc-comments-placement.md b/.changeset/gesture-doc-comments-placement.md
new file mode 100644
index 0000000000..617529f674
--- /dev/null
+++ b/.changeset/gesture-doc-comments-placement.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+---
+
+[docs] The gesture arena's and the gesture host's internal doc comments sit on the declarations they describe.
+
+@vjeux
diff --git a/packages/core/src/gestures/GestureArena.ts b/packages/core/src/gestures/GestureArena.ts
index 5691eab56a..25f81a79c7 100644
--- a/packages/core/src/gestures/GestureArena.ts
+++ b/packages/core/src/gestures/GestureArena.ts
@@ -471,7 +471,6 @@ export class GestureArena {
}
}
- /** Cancel an active recognizer, or fail a possible one. */
/**
* Runs `body`, code outside input that stops recognizers (an Effect that
* turns one off or detaches it), without resolving what those stops
@@ -504,6 +503,7 @@ export class GestureArena {
: this.clock.now();
}
+ /** Cancel an active recognizer, or fail a possible one. */
stop(recognizer: GestureRecognizer): void {
// A cancel from code between events happens at the last event's time:
// wall time would run deadlines ahead of input still queued (FR16).
diff --git a/packages/core/src/gestures/GestureHost.ts b/packages/core/src/gestures/GestureHost.ts
index 55e63f4c28..71cf291dd5 100644
--- a/packages/core/src/gestures/GestureHost.ts
+++ b/packages/core/src/gestures/GestureHost.ts
@@ -217,10 +217,6 @@ function claimsWhileMoving(recognizer: GestureRecognizer): boolean {
return recognizer.acceptsTouchInput && recognizer.kind !== 'tap';
}
-/**
- * Run `task` in the next frame, before it paints: a read there styles what
- * the frame must style anyway, and its writes are what the frame shows.
- */
/**
* A CSS-wide keyword, which names no touch-action of its own: the value in
* force resolves it (`initial` and `unset` to `auto`, `inherit` to the
@@ -238,6 +234,10 @@ const CSS_WIDE_KEYWORDS: ReadonlySet<string> = new Set([
'revert-layer',
]);
+/**
+ * Run `task` in the next frame, before it paints: a read there styles what
+ * the frame must style anyway, and its writes are what the frame shows.
+ */
function inNextFrame(view: Window | null, task: () => void): void {
if (view != null && typeof view.requestAnimationFrame === 'function') {
view.requestAnimationFrame(task);
@@ -328,7 +328,6 @@ export class GestureHost {
private readonly touchIds = new Map<number, number>();
/** Touch.identifier → the element the finger landed on. */
private readonly touchTargets = new Map<number, EventTarget>();
- /** Finger targets with listeners of their own, and how many fingers each. */
/**
* Finger targets with listeners of their own: how many fingers each, and
* how many of those a recognizer could claim while they move (only those
@@ -374,20 +373,20 @@ export class GestureHost {
private readonly claimedLifts: PlacedContact[] = [];
/** Fingers still waiting for their pointerdown, by arena id. */
private readonly unpairedTouches = new Map<number, PlacedContact>();
- /** The last position fed per contact, so one channel's echo is dropped. */
/** The elements each held contact turned selection off on. */
private readonly heldSelectionBy = new Map<number, HTMLElement[]>();
private readonly isPrimaryPointerCoarse: () => boolean;
private readonly coarseQuery: MediaQueryList | null;
private isWatchingPointer = false;
private readonly onPointerKindChange = (): void => this.refreshAll();
+ /** The last position fed per contact, so one channel's echo is dropped. */
private readonly lastFed = new Map<number, TouchSample>();
/** When a finger was last down or lifted, and where it landed. */
private lastTouch: {readonly target: Node; readonly time: number} | null =
null;
- /** The last scroll a finger drove, and when. */
/** Scrollers a recognizer is scrolling itself this frame (ownScroll). */
private readonly ownedScrolls = new Set<Node>();
+ /** The last scroll a finger drove, and when. */
private lastScroll: {readonly scroller: Node; readonly time: number} | null =
null;
private nextId = 1;