An open source design system that's fully customizable and agent ready
TypeScript
docs(layer-runtime, Popover): name settledBox's readers; fix comments (#10300)
Christopher Chedeau74eb2160cc50
diff --git a/.changeset/popover-motion-comments.md b/.changeset/popover-motion-comments.mdnew file mode 100644index 0000000000..d043d9f51a--- /dev/null+++ b/.changeset/popover-motion-comments.md@@ -0,0 +1,7 @@+---+'@astryxdesign/core': patch+---++[chore] Internal: source comments in Popover's touch presentation and the transient copy now match what the code does: a touch that starts before the input hold can close the popover, and `measure` reads before the frame writes. Apps see no change.++@vjeuxdiff --git a/docs/architecture/layer-runtime.md b/docs/architecture/layer-runtime.mdindex b6cb8e0a16..ff367e0890 100644--- a/docs/architecture/layer-runtime.md+++ b/docs/architecture/layer-runtime.md@@ -734,7 +734,8 @@ is staged as `[breaking]` (`spec:AST-017` FR32) and `component:SelectableCard`open anchor-mode layer; the runtime imports it through `Layer/LayerTouch.ts`,its one touch module. `Layer/layerKeyboardClearance.ts` holds the clearanceand the cap's arithmetic. `Layer/settledBox.ts` reads a layer's box without- its entrance transform, for the fallback order and the keyboard's cap.+ its entrance transform, for the fallback order, the keyboard's cap and the+ exit copy.- `Layer/preserveAnimations.ts` owns carrying the CSS animations andtransitions of a layer and its content across the re-placement's displayreset.diff --git a/packages/core/src/Popover/popoverSurfaceMotion.ts b/packages/core/src/Popover/popoverSurfaceMotion.tsindex 27dcbcf0d4..df025fe5b9 100644--- a/packages/core/src/Popover/popoverSurfaceMotion.ts+++ b/packages/core/src/Popover/popoverSurfaceMotion.ts@@ -4,9 +4,9 @@/*** @file popoverSurfaceMotion.ts- * @input A Popover's layer element, the source it hangs off, the compositor- * animator, the theme's duration and easing tokens, and the layer- * runtime's exit copy and input hold+ * @input A Popover's layer element, the source it hangs off and the+ * compositor animator. Also the theme's duration and easing tokens, and+ * the layer runtime's exit copy and input hold* @output Exports `popoverCollapsedState`, `popoverFrame` and* `createPopoverSurfaceMotion`, the touch presentation's present and* dismiss.@@ -97,9 +97,10 @@ export interface PopoverSurfaceMotion {/*** The popover has just been shown in its touch presentation: grow it out* of its source, from the next animation frame, before it paints.- * `measure` reads the geometry there, with the element invisible at its- * full size. During a dismissal, the popover grows back from where the- * dismissal has it, about the same point, at once: it reads nothing.+ * `measure` reads the geometry there, before that frame writes anything,+ * with the element at its full size. During a dismissal, the popover grows+ * back from where the dismissal has it, about the same point, at once: it+ * does not call `measure`.*/enter(measure: () => PopoverSurfaceGeometry): void;/**@@ -150,8 +151,7 @@ const MOTION_STYLE_PROPERTIES = [* The hold starts with the growth, in its frame. Holding from the open* would lay the page out twice in the opening task, since the shield's* `showPopover()` lays it out. A touch that starts in the frame before the- * hold reaches the page. Its tap does not dismiss the popover: its lift- * lands on the hold.+ * hold reaches the page.** Under Reduce Motion the animator's policy applies. On a coarse pointer the* popover lands at its full size and cross-fades in, and it cross-fades outdiff --git a/packages/core/src/motion/transientCopy.ts b/packages/core/src/motion/transientCopy.tsindex d2695c70fa..cf7c8b0292 100644--- a/packages/core/src/motion/transientCopy.ts+++ b/packages/core/src/motion/transientCopy.ts@@ -8,8 +8,9 @@* Core makes, lays out and fades one transient copy of old content* @position Motion foundation, internal to core; the copy mechanism the* in-place swap uses (`spec:AST-105` FR8,- * `architecture:component-style-authoring` INV7), and the layer's exit copy.- * motion/animatedLayout.ts and Layer/layerExitCopy.ts import it.+ * `architecture:component-style-authoring` INV7). It also makes the+ * layer's exit copy. motion/animatedLayout.ts and Layer/layerExitCopy.ts+ * import it.** A copy takes no part in the page: it is inert and hidden from assistive* technology, carries no ids or test ids, joins no form or radio group (a@@ -161,7 +162,6 @@ function readInherited(element: Element): Map<string, string> {const FORM_CONTROLS ='button, fieldset, input, object, output, select, textarea';-/** Whether `node` is a custom element defined as form-associated. */function isFormAssociated(node: Element,registry: CustomElementRegistry | undefined,