@flemo/core 1.29.0 → 2.0.0

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.
Files changed (92) hide show
  1. package/dist/core/TaskManger.d.ts +13 -0
  2. package/dist/core/engine/__tests__/architectureDoc.test.d.ts +10 -0
  3. package/dist/core/engine/__tests__/diagnosticRegistry.test.d.ts +10 -0
  4. package/dist/core/engine/__tests__/flightRouting.test.d.ts +1 -0
  5. package/dist/core/engine/__tests__/landingGovernor.test.d.ts +1 -0
  6. package/dist/core/engine/__tests__/layerRiders.test.d.ts +1 -0
  7. package/dist/core/engine/__tests__/participantLayers.test.d.ts +1 -0
  8. package/dist/core/engine/__tests__/singleResolution.test.d.ts +1 -0
  9. package/dist/core/engine/arrivalHold.d.ts +1 -1
  10. package/dist/core/engine/cancelResume.d.ts +17 -0
  11. package/dist/core/engine/compositorWarmUp.d.ts +1 -1
  12. package/dist/core/engine/createSwipeController.d.ts +16 -0
  13. package/dist/core/engine/createTransitionEngine.d.ts +2 -1
  14. package/dist/core/engine/diagnosticFlags.d.ts +2 -10
  15. package/dist/core/engine/diagnosticRegistry.d.ts +38 -0
  16. package/dist/core/engine/flightHolds.d.ts +22 -0
  17. package/dist/core/engine/flightParticipants.d.ts +8 -0
  18. package/dist/core/engine/flightRouting.d.ts +91 -0
  19. package/dist/core/engine/gpuPipelinePrewarm.d.ts +1 -1
  20. package/dist/core/engine/imageDecodeOffloader.d.ts +1 -1
  21. package/dist/core/engine/landingGovernor.d.ts +3 -0
  22. package/dist/core/engine/layerRiders.d.ts +21 -0
  23. package/dist/core/engine/participantLayers.d.ts +12 -0
  24. package/dist/core/engine/types.d.ts +2 -1
  25. package/dist/dom/__tests__/attributes.test.d.ts +10 -0
  26. package/dist/dom/__tests__/stacking.test.d.ts +1 -0
  27. package/dist/dom/attributes.d.ts +239 -0
  28. package/dist/dom/stacking.d.ts +28 -0
  29. package/dist/history/store.d.ts +0 -1
  30. package/dist/index.d.ts +20 -4
  31. package/dist/index.mjs +2880 -1807
  32. package/dist/morph/__tests__/attachMorph.test.d.ts +1 -0
  33. package/dist/morph/__tests__/morphAnimations.test.d.ts +1 -0
  34. package/dist/morph/__tests__/morphClip.test.d.ts +1 -0
  35. package/dist/morph/__tests__/morphGeometry.test.d.ts +1 -0
  36. package/dist/morph/__tests__/morphKeyframes.test.d.ts +1 -0
  37. package/dist/morph/__tests__/morphLayer.test.d.ts +1 -0
  38. package/dist/morph/__tests__/morphPaint.test.d.ts +1 -0
  39. package/dist/morph/__tests__/morphPose.test.d.ts +1 -0
  40. package/dist/morph/__tests__/morphSheet.test.d.ts +1 -0
  41. package/dist/morph/__tests__/morphSide.test.d.ts +1 -0
  42. package/dist/morph/__tests__/morphSwipe.test.d.ts +1 -0
  43. package/dist/morph/attachMorph.d.ts +59 -0
  44. package/dist/morph/morphAnimations.d.ts +2 -0
  45. package/dist/morph/morphClip.d.ts +31 -0
  46. package/dist/morph/morphGeometry.d.ts +111 -0
  47. package/dist/morph/morphKeyframes.d.ts +190 -0
  48. package/dist/morph/morphLayer.d.ts +14 -0
  49. package/dist/morph/morphPaint.d.ts +31 -0
  50. package/dist/morph/morphPose.d.ts +44 -0
  51. package/dist/morph/morphSheet.d.ts +9 -0
  52. package/dist/morph/morphSide.d.ts +43 -0
  53. package/dist/morph/morphSwipe.d.ts +24 -0
  54. package/dist/navigate/createNavigationController.d.ts +0 -1
  55. package/dist/navigate/store.d.ts +1 -0
  56. package/dist/platform/__tests__/displayCadence.test.d.ts +1 -0
  57. package/dist/platform/__tests__/displayProbe.test.d.ts +1 -0
  58. package/dist/platform/__tests__/engineProbes.test.d.ts +1 -0
  59. package/dist/platform/__tests__/legacyBlinkGate.test.d.ts +1 -0
  60. package/dist/platform/__tests__/profile.test.d.ts +1 -0
  61. package/dist/platform/__tests__/steadySixtyCadence.test.d.ts +1 -0
  62. package/dist/platform/displayCadence.d.ts +3 -0
  63. package/dist/platform/displayProbe.d.ts +5 -0
  64. package/dist/platform/engineProbes.d.ts +4 -0
  65. package/dist/platform/profile.d.ts +70 -0
  66. package/dist/{core/engine → platform}/steadySixtyCadence.d.ts +1 -1
  67. package/dist/runtime/__tests__/flemoRuntime.test.d.ts +1 -0
  68. package/dist/runtime/flemoRuntime.d.ts +9 -0
  69. package/dist/transition/compileTransitionStyles.d.ts +0 -1
  70. package/dist/transition/cubicBezier.d.ts +25 -0
  71. package/dist/transition/morphTransition/__tests__/createMorphTransition.test.d.ts +1 -0
  72. package/dist/transition/morphTransition/createMorphTransition.d.ts +13 -0
  73. package/dist/transition/morphTransition/createRawMorphTransition.d.ts +17 -0
  74. package/dist/transition/morphTransition/morphTransition.d.ts +2 -0
  75. package/dist/transition/morphTransition/shared.d.ts +2 -0
  76. package/dist/transition/morphTransition/text.d.ts +2 -0
  77. package/dist/transition/morphTransition/typing.d.ts +72 -0
  78. package/dist/transition/morphTransition/zoom.d.ts +2 -0
  79. package/dist/transition/registerTransitionDefinitions.d.ts +2 -1
  80. package/dist/transition/swipeSettle.d.ts +82 -1
  81. package/dist/transition/typing.d.ts +2 -2
  82. package/package.json +7 -7
  83. package/dist/core/engine/driverPolicy.d.ts +0 -12
  84. package/dist/core/engine/landingPixelSnap.d.ts +0 -10
  85. package/dist/core/engine/motionDriverKind.d.ts +0 -7
  86. package/dist/core/engine/transitionPlayer.d.ts +0 -40
  87. /package/dist/core/engine/__tests__/{driverPolicy.test.d.ts → createSwipeController.dragHooks.test.d.ts} +0 -0
  88. /package/dist/core/engine/__tests__/{landingPixelSnap.test.d.ts → createSwipeController.layerRelease.test.d.ts} +0 -0
  89. /package/dist/core/engine/__tests__/{motionDriverKind.test.d.ts → createSwipeController.stuckGesture.test.d.ts} +0 -0
  90. /package/dist/core/engine/__tests__/{steadySixtyCadence.test.d.ts → createSwipeController.velocity.test.d.ts} +0 -0
  91. /package/dist/core/engine/__tests__/{transitionPlayer.test.d.ts → flightParticipants.test.d.ts} +0 -0
  92. /package/dist/{core/engine → platform}/governedCompiled.d.ts +0 -0
@@ -50,6 +50,19 @@ declare class TaskManager {
50
50
  emitSignal(signalName: string): void;
51
51
  private processPendingTasks;
52
52
  private pendingWaiters;
53
+ /**
54
+ * Wake the queue on the next frame, so the terminal flip's commit and the
55
+ * queued flight's opening commit land in different ones.
56
+ *
57
+ * Falls straight through where there is no frame clock (SSR, a non-browser
58
+ * embedder): there is no commit to separate from.
59
+ *
60
+ * Reaching this at all takes a task genuinely PENDING ahead of the queued one
61
+ * — a waiter added to an empty queue resolves on the spot and never goes
62
+ * through the notify path, so a test that merely drives two tasks exercises
63
+ * nothing here. The suite holds a manual task open and queues behind it.
64
+ */
65
+ private wakeQueueNextFrame;
53
66
  private notifyPendingWaiters;
54
67
  private waitForPendingTasks;
55
68
  private onTaskStatusChange;
@@ -0,0 +1,10 @@
1
+ declare global {
2
+ interface ImportMeta {
3
+ glob(pattern: string, options: {
4
+ query: string;
5
+ import: string;
6
+ eager: true;
7
+ }): Record<string, string>;
8
+ }
9
+ }
10
+ export {};
@@ -0,0 +1,10 @@
1
+ declare global {
2
+ interface ImportMeta {
3
+ glob(pattern: string, options: {
4
+ query: string;
5
+ import: string;
6
+ eager: true;
7
+ }): Record<string, string>;
8
+ }
9
+ }
10
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- export declare const HELD_ARRIVAL_ATTR = "data-flemo-held-arrival";
1
+ export { HELD_ARRIVAL_ATTR } from '../../dom/attributes';
2
2
  export default function createArrivalHold(scope: HTMLElement): () => void;
@@ -0,0 +1,17 @@
1
+ import { VariantMotion } from '../../transition/variantMotion';
2
+ export declare const RESUME_BUDGET = 4;
3
+ export interface CancelResumeConfig {
4
+ element: HTMLElement;
5
+ expectedName: string;
6
+ motion: VariantMotion;
7
+ isLive: () => boolean;
8
+ budgetUsed: () => number;
9
+ spendBudget: () => void;
10
+ onTerminal: () => void;
11
+ writer?: symbol;
12
+ }
13
+ export declare const wireCancelResume: (config: CancelResumeConfig) => {
14
+ attach: () => void;
15
+ detach: () => void;
16
+ fullRestart: () => void;
17
+ };
@@ -1,3 +1,3 @@
1
- export declare const WARM_ATTR = "data-flemo-warm";
1
+ export { WARM_ATTR } from '../../dom/attributes';
2
2
  export declare const resetCompositorWarmForTesting: () => void;
3
3
  export default function holdCompositorWarm(): () => void;
@@ -24,12 +24,28 @@ export interface SwipeControllerConfig {
24
24
  getPartnerBarMetadata?: () => SharedBarsMetadata | undefined;
25
25
  setDragStatus: (status: "IDLE" | "PENDING") => void;
26
26
  back: () => void;
27
+ onDragStart?: () => void;
28
+ /** 0 at rest, 1 at the point the gesture would commit. */
29
+ onDragProgress?: (progress: number) => void;
30
+ /** The release: whether it committed, and the seconds the screens settle in. */
31
+ onDragSettle?: (committed: boolean, seconds: number) => void;
27
32
  }
28
33
  export interface SwipeController {
29
34
  pointerDown: (event: PointerEvent) => void;
30
35
  pointerMove: (event: PointerEvent) => void;
31
36
  pointerUp: (event: PointerEvent) => void;
32
37
  pointerCancel: (event: PointerEvent) => void;
38
+ lostPointerCapture: (event: PointerEvent) => void;
39
+ /**
40
+ * Abandon whatever gesture is in flight, with no pointer to close it.
41
+ *
42
+ * The binding calls this when the SCREEN goes away underneath one: an unmount,
43
+ * or a freeze (which detaches the listeners but keeps this controller, since
44
+ * it outlives the effects). Without it the gesture state has exactly one way
45
+ * out — a pointerup carrying the id that armed it — and if the browser never
46
+ * delivers that event, nothing ever does. See the note on `abandon` below.
47
+ */
48
+ abandon: () => void;
33
49
  shouldPreventTouch: () => boolean;
34
50
  }
35
51
  export default function createSwipeController(config: SwipeControllerConfig): SwipeController;
@@ -1,3 +1,4 @@
1
1
  import { TransitionEngine, TransitionEngineDeps } from './types';
2
- export declare const resetDisplayProbeForTests: () => void;
2
+ import { resetDisplayProbeForTests } from '../../platform/displayProbe';
3
+ export { resetDisplayProbeForTests };
3
4
  export default function createTransitionEngine(deps: TransitionEngineDeps): TransitionEngine;
@@ -1,7 +1,6 @@
1
- export declare const readLandingSnapFlag: () => boolean;
2
1
  export declare const readImageHoldFlag: () => "on" | "off" | null;
2
+ export declare const morphTraceArmed: () => boolean;
3
3
  export declare const readSettleGateFlag: () => boolean;
4
- export declare const readHandoffFlag: () => boolean;
5
4
  export declare const readArrivalHoldFlag: () => boolean;
6
5
  export declare const readDesktopReleaseFlipFlag: () => boolean;
7
6
  export declare const readCreepHeadFlag: () => boolean;
@@ -10,14 +9,7 @@ export declare const readDesktopHeadFlag: () => boolean;
10
9
  export declare const readPrerasterFlag: () => boolean;
11
10
  export declare const readRestLayerPromotionFlag: () => boolean;
12
11
  export declare const readImageOffloadOverride: () => "on" | "off" | null;
13
- export declare const HANDOFF_MS_DEFAULT: number;
14
- export declare const JITTER_BAND_MAX_DEVICE_PX = 4;
15
- export declare const snapshotApplyOverride: () => "scrub" | null;
16
- export declare const handoffOverride: () => "on" | null;
17
- export declare const snapOverride: () => "always" | "off" | "gate" | "hybrid" | null;
18
- export declare const jitterBandMaxDevicePx: () => number;
19
- export declare const handoffMs: () => number;
20
- export declare const resetSessionOverrideCachesForTests: () => void;
12
+ export declare const readBlinkGovernedOverride: () => "on" | "off" | null;
21
13
  export declare const residentScreenLayers: () => boolean;
22
14
  export declare const resetResidentLayersForTesting: () => void;
23
15
  export declare const shallowFreeze: () => boolean;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * What kind of thing a flag is — which decides how a report should read it.
3
+ *
4
+ * - `production-state`: written by the library itself (a learned ledger). Never
5
+ * set by hand; the KEY STRINGS are frozen, since users' devices carry
6
+ * persisted values.
7
+ * - `production-default-with-override`: the library computes a default and the
8
+ * key overrides it both ways, for field debugging.
9
+ * - `opt-in-diagnostic`: default OFF. A measurement instrument that ships so a
10
+ * device session can be probed without a custom build.
11
+ */
12
+ export type DiagnosticFlagKind = "production-state" | "production-default-with-override" | "opt-in-diagnostic";
13
+ export interface DiagnosticFlag {
14
+ readonly key: string;
15
+ readonly storage: "session" | "local";
16
+ readonly kind: DiagnosticFlagKind;
17
+ /** Accepted values, for a report or a panel to offer. */
18
+ readonly values: string;
19
+ /** The default when the key is unset. */
20
+ readonly fallback: string;
21
+ readonly effect: string;
22
+ }
23
+ /** Every `flemo:*` key the library reads today. */
24
+ export declare const DIAGNOSTIC_FLAGS: readonly DiagnosticFlag[];
25
+ export interface RetiredDiagnosticFlag {
26
+ readonly key: string;
27
+ readonly storage: "session" | "local";
28
+ /** What it used to do, and when it stopped doing it. */
29
+ readonly retiredWith: string;
30
+ }
31
+ /**
32
+ * Keys the library once read and no longer does. Declared so a report can say
33
+ * "this is set, and it does nothing" — residue that is merely unknown reads as
34
+ * a lead worth chasing, and one such key once burned a multi-day investigation.
35
+ *
36
+ * Values persisted on users' devices are never read again.
37
+ */
38
+ export declare const RETIRED_DIAGNOSTIC_FLAGS: readonly RetiredDiagnosticFlag[];
@@ -0,0 +1,22 @@
1
+ import { TransitionName } from '../../transition/typing';
2
+ export interface FlightHoldsDeps {
3
+ /**
4
+ * Land any pending deferred landing NOW. A navigation starting inside a
5
+ * still-pending window must not let that window's reveal punch into it.
6
+ */
7
+ readonly landNow: () => void;
8
+ /** Defer a release to the frames past the COMPLETED flip. */
9
+ readonly scheduleLanding: (land: () => void) => void;
10
+ }
11
+ export interface FlightHoldsInput {
12
+ readonly isTransitional: boolean;
13
+ readonly isActive: boolean;
14
+ readonly status: string;
15
+ readonly transitionName: TransitionName;
16
+ readonly getScope: () => HTMLElement | null | undefined;
17
+ }
18
+ export interface FlightHolds {
19
+ /** Reconcile every hold with what this drive run says the screen is doing. */
20
+ readonly sync: (input: FlightHoldsInput) => void;
21
+ }
22
+ export declare const createFlightHolds: (deps: FlightHoldsDeps) => FlightHolds;
@@ -0,0 +1,8 @@
1
+ import { default as resolveTransition } from '../../transition/resolveTransition';
2
+ import { TransitionVariant } from '../../transition/typing';
3
+ export declare const collectScreenParts: (scope: HTMLElement) => HTMLElement[];
4
+ export declare const collectVariantParts: (scope: HTMLElement, variant: TransitionVariant) => HTMLElement[];
5
+ export declare const collectFlightParts: (scope: HTMLElement, status: string) => HTMLElement[];
6
+ export declare const collectUnheldOuterParts: (scope: HTMLElement, status: string) => HTMLElement[];
7
+ export declare const collectStampedOuterParts: (scope: HTMLElement) => HTMLElement[];
8
+ export declare const statusChoreographySpanMs: (scope: HTMLElement, transition: ReturnType<typeof resolveTransition>, status: string) => number;
@@ -0,0 +1,91 @@
1
+ import { Transition } from '../../transition/typing';
2
+ export interface FlightRouting {
3
+ /** This flight has motion to drive at all (not skipped, and it resolves). */
4
+ readonly hasDrivableMotion: boolean;
5
+ /**
6
+ * The engine may perform CLOCK SURGERY on this flight — the first-frame
7
+ * hold, the flight-start anchor, stall re-anchoring. Authored
8
+ * `driver: "native"` pins only, and never on Blink.
9
+ *
10
+ * Every one of those mutates a running animation's timing (WAAPI pause/play,
11
+ * startTime shifts), and the 2026-08 iPhone falsification series established
12
+ * that on WebKit any such touch costs the accelerated out-of-process path or
13
+ * desyncs its re-sync. The default therefore runs the compiled animation
14
+ * UNTOUCHED and protects the opening by release scheduling instead. An author
15
+ * who pins "native" takes the main-thread-presentation trade knowingly.
16
+ */
17
+ readonly nativeSurgeryAllowed: boolean;
18
+ /** Touch WebKit on the governed compiled tier. */
19
+ readonly touchGoverned: boolean;
20
+ /**
21
+ * Touch WebKit whose STATUS also takes the flat head: POP always, PUSH once
22
+ * the settle gate has moved the mount weight out of the release.
23
+ */
24
+ readonly forceCompiled: boolean;
25
+ /**
26
+ * This flight gets the GOVERNED HEAD KIT — a flat opening segment baked into
27
+ * the keyframes, so a commit that ages the wall clock eats the head instead
28
+ * of the curve's start.
29
+ */
30
+ readonly governedHead: boolean;
31
+ /**
32
+ * Desktop macOS Safari's own flat head: the same compiled clock presented
33
+ * from the main thread, with its own lengths and its own gate attribute.
34
+ * Arming it retires the birth anchor — two interventions on one clock is the
35
+ * pairing the touch tier was built to avoid.
36
+ */
37
+ readonly desktopHead: boolean;
38
+ /** The head's length for this status, in milliseconds. 0 when there is none. */
39
+ readonly birthHoldMs: number;
40
+ /**
41
+ * A SLIDE on the governed touch tier. It stands the wall-clock accelerators
42
+ * down for the same reason `forceCompiled` does, and covers one case that
43
+ * predicate does not: a touch-WebKit PUSH with the settle gate turned off.
44
+ *
45
+ * Named `governedSoftenActive` until 2026-08, after the front-softening
46
+ * treatment it shipped beside. That treatment is gone; this outlived it
47
+ * because what it guards is the clock, not the curve.
48
+ */
49
+ readonly governedSlide: boolean;
50
+ /**
51
+ * Keep a frame source alive for the flight. Compiled Blink only: a
52
+ * compositor-driven flight leaves the main thread idle, and Chrome then
53
+ * paces its macOS ProMotion presentation unevenly — video-measured as
54
+ * drops and double-steps the eye reads as trembling.
55
+ */
56
+ readonly framePacingKeepalive: boolean;
57
+ /** Arm the creep head beside the governed one (`flemo:creep`). */
58
+ readonly creepHead: boolean;
59
+ }
60
+ export interface FlightRoutingInput {
61
+ readonly status: string;
62
+ readonly transition: Transition;
63
+ /** The scope carries the skip marker for this flight. */
64
+ readonly skipAnimation: boolean;
65
+ /** The active variant resolves a motion. */
66
+ readonly hasActiveMotion: boolean;
67
+ /** The active variant has an authored animation at all. */
68
+ readonly hasAnimation: boolean;
69
+ }
70
+ /**
71
+ * WHICH HEAD KIT this session plays, and how long its flat head is.
72
+ *
73
+ * Extracted so it has exactly one definition. It is a pure function of the
74
+ * platform, the diagnostic flags and the status — nothing about the flight —
75
+ * and the MORPH runtime needs the same answer at a moment when it cannot get
76
+ * it from the DOM: the head is announced by an attribute on the root, and the
77
+ * engine writes that attribute from the SAME commit the morph is staged in.
78
+ * React runs a descendant's layout effect first, so a morph reading the
79
+ * attribute reads the PREVIOUS flight's answer — right by luck from the second
80
+ * navigation on, and wrong on the first, which is what made a first push run
81
+ * its element 33ms ahead of the screen carrying it while every push after it
82
+ * was aligned.
83
+ */
84
+ export declare const resolveHeadKit: (status: string) => {
85
+ touchGoverned: boolean;
86
+ forceCompiled: boolean;
87
+ governedHead: boolean;
88
+ desktopHead: boolean;
89
+ headMs: number;
90
+ };
91
+ export declare const resolveFlightRouting: (input: FlightRoutingInput) => FlightRouting;
@@ -1,4 +1,4 @@
1
- export declare const GPU_PREWARM_ATTR = "data-flemo-gpu-prewarm";
1
+ export { GPU_PREWARM_ATTR } from '../../dom/attributes';
2
2
  export declare const PREWARM_SPAN_MS = 450;
3
3
  export declare const resetGpuPipelinePrewarmForTesting: () => void;
4
4
  export default function ensureGpuPipelinePrewarm(): () => void;
@@ -1,5 +1,5 @@
1
1
  export declare const OVERSIZE_AREA_RATIO = 8;
2
- export declare const OFFLOADED_SRC_ATTR = "data-flemo-image-src";
2
+ export { OFFLOADED_SRC_ATTR } from '../../dom/attributes';
3
3
  export interface OversizeInput {
4
4
  naturalWidth: number;
5
5
  naturalHeight: number;
@@ -0,0 +1,3 @@
1
+ import { VariantMotion } from '../../transition/variantMotion';
2
+ import { PerceptualBox } from './perceptualSpan';
3
+ export declare const governedEasingForMotion: (motion: VariantMotion, box: PerceptualBox, devicePixelRatio: number, frameIntervalMs: number) => string | null;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The `<Layer>` overlays that move with the screen in this container.
3
+ *
4
+ * Two shapes, because a host is inherited. A screen that renders its OWN host
5
+ * moves everything portaled into it by moving that one box. A screen NESTED
6
+ * inside such a host has its overlays in a container that is not its own, and
7
+ * no walk of its subtree can find them — so they are matched by the owner id
8
+ * they carry.
9
+ *
10
+ * Never both: driving a host and the slots inside it would compose the two
11
+ * writes and send the overlay twice as far as its screen.
12
+ */
13
+ export declare const collectLayerRiders: (container: HTMLElement | null) => HTMLElement[];
14
+ /**
15
+ * Whether an element beside a scope is riding this flight.
16
+ *
17
+ * A bar rides only when its partner screen does not own it, so it says so with
18
+ * an attribute the binding flips per flight. An overlay has exactly one screen
19
+ * and always leaves with it, so being a host or a slot is the whole answer.
20
+ */
21
+ export declare const isRider: (element: HTMLElement | null | undefined) => element is HTMLElement;
@@ -0,0 +1,12 @@
1
+ import { default as resolveTransition } from '../../transition/resolveTransition';
2
+ import { TransitionVariant } from '../../transition/typing';
3
+ export declare const holdParticipantLayers: (elements: {
4
+ scope: HTMLElement;
5
+ decorator?: HTMLElement | null;
6
+ bars?: (HTMLElement | null | undefined)[];
7
+ }, transition: ReturnType<typeof resolveTransition>, variant: TransitionVariant, owner: symbol) => void;
8
+ export declare const releaseParticipantLayers: (elements: {
9
+ scope?: HTMLElement | null;
10
+ decorator?: HTMLElement | null;
11
+ bars?: (HTMLElement | null | undefined)[];
12
+ }, owner: symbol) => void;
@@ -1,6 +1,6 @@
1
1
  import { NavigateStatus } from '../../navigate/store';
2
2
  import { TransitionName } from '../../transition/typing';
3
- export declare const SKIP_ANIMATION_ATTR = "data-flemo-skip-animation";
3
+ export { SKIP_ANIMATION_ATTR } from '../../dom/attributes';
4
4
  export interface TransitionEngineDeps {
5
5
  getTransitionTaskId: () => string | null;
6
6
  setDragStatus: (status: "IDLE" | "PENDING") => void;
@@ -11,6 +11,7 @@ export interface ScreenLifecycleInput {
11
11
  scope: HTMLElement | null;
12
12
  decorator?: HTMLElement | null;
13
13
  bars?: (HTMLElement | null | undefined)[];
14
+ screenContainer?: HTMLElement | null;
14
15
  };
15
16
  transitionName: TransitionName;
16
17
  prevTransitionName: TransitionName;
@@ -0,0 +1,10 @@
1
+ declare global {
2
+ interface ImportMeta {
3
+ glob(pattern: string, options: {
4
+ query: string;
5
+ import: string;
6
+ eager: true;
7
+ }): Record<string, string>;
8
+ }
9
+ }
10
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,239 @@
1
+ /** Shared prefix. Every attribute below starts with it. */
2
+ export declare const FLEMO_ATTR_PREFIX = "data-flemo-";
3
+ /**
4
+ * Marks a screen scope, and carries that screen's id.
5
+ *
6
+ * The value was empty until a `<Layer>` slot needed to name the screen it
7
+ * belongs to from the DOM alone. Presence selectors are unaffected, which is
8
+ * what every existing reader uses; nothing may start requiring the value.
9
+ */
10
+ export declare const SCREEN_ATTR = "data-flemo-screen";
11
+ /** The navigation status this screen is rendering: a `NavigateStatus` value. */
12
+ export declare const STATUS_ATTR = "data-flemo-status";
13
+ /** `"true"` on the screen the navigation is moving TO, `"false"` on its partner. */
14
+ export declare const ACTIVE_ATTR = "data-flemo-active";
15
+ /** The resolved transition name, so the compiled rules select the right keyframes. */
16
+ export declare const TRANSITION_ATTR = "data-flemo-transition";
17
+ /**
18
+ * The owning Router's identity. The engine scopes a flight's choreography
19
+ * participants by this marker rather than by DOM structure: each screen sits in
20
+ * its own wrapper, a root Router renders no container, and two independent
21
+ * Routers may share a DOM parent — so structure cannot draw the line.
22
+ */
23
+ export declare const ROUTER_ATTR = "data-flemo-router";
24
+ /**
25
+ * `"true"` suppresses this screen's motion for one flight (an interrupted or
26
+ * restored navigation that must land without animating).
27
+ */
28
+ export declare const SKIP_ANIMATION_ATTR = "data-flemo-skip-animation";
29
+ /** Marks a shared bar element. */
30
+ export declare const BAR_ATTR = "data-flemo-bar";
31
+ /** The bar's own active flag (see ACTIVE_ATTR). */
32
+ export declare const BAR_ACTIVE_ATTR = "data-flemo-bar-active";
33
+ /** The bar's own status (see STATUS_ATTR). */
34
+ export declare const BAR_STATUS_ATTR = "data-flemo-bar-status";
35
+ /**
36
+ * `"true"` while the bar RIDES its screen's keyframes — the compiled rule pairs
37
+ * the bar selector with the screen rule, so the pair moves in lockstep.
38
+ */
39
+ export declare const BAR_RIDING_ATTR = "data-flemo-bar-riding";
40
+ /** The consumer-supplied shared-bar id, used to match a bar across screens. */
41
+ export declare const BAR_ID_ATTR = "data-flemo-bar-id";
42
+ /** The id's `typeof`, so `1` and `"1"` never match as the same bar. */
43
+ export declare const BAR_ID_TYPE_ATTR = "data-flemo-bar-id-type";
44
+ /** The transition name driving this bar. */
45
+ export declare const BAR_TRANSITION_ATTR = "data-flemo-bar-transition";
46
+ /** The layout spacer that reserves a shared bar's height in the screen flow. */
47
+ export declare const BAR_SPACER_ATTR = "data-flemo-bar-spacer";
48
+ /** Marks the decorator element (the dim/overlay layer between screens). */
49
+ export declare const DECORATOR_ATTR = "data-flemo-decorator";
50
+ /** The decorator definition's name, for its own compiled rules. */
51
+ export declare const DECORATOR_NAME_ATTR = "data-flemo-decorator-name";
52
+ /**
53
+ * The HOST: one childless box per screen chain, rendered by the OUTERMOST
54
+ * screen's container and inherited by every screen nested inside it. Outermost
55
+ * because an overlay has to clear the chrome of every screen above its own,
56
+ * and chrome declared by an ancestor sits outside that ancestor's scope.
57
+ *
58
+ * It is `position: absolute` and full-size so a consumer's absolutely
59
+ * positioned overlay has the region to anchor to, and it never takes a pointer
60
+ * itself — a host with nothing in it must not swallow taps meant for the
61
+ * screen underneath.
62
+ */
63
+ export declare const LAYER_HOST_ATTR = "data-flemo-layer-host";
64
+ /**
65
+ * A SLOT: one per `<Layer>`, portaled into the host, carrying its owning
66
+ * screen's identity. This is what keeps the escape from becoming an orphan —
67
+ * the slot leaves the screen's box for PAINT ORDER only, and takes the rest of
68
+ * being that screen with it:
69
+ *
70
+ * - it stacks by its owner's position, so two screens' overlays order the way
71
+ * their screens do rather than by portal mount order
72
+ * - it carries its owner's status/active/transition, so the compiled screen
73
+ * rule animates it in lockstep and it leaves WITH its screen (the same
74
+ * pairing a riding shared bar uses)
75
+ * - it mirrors its owner's paint-hidden state, which `visibility: hidden` on
76
+ * the screen container cannot reach across a portal
77
+ *
78
+ * Unmounting is React's: the slot is rendered from inside its screen's
79
+ * subtree, so it dies with the screen without anything having to notice.
80
+ */
81
+ export declare const LAYER_SLOT_ATTR = "data-flemo-layer-slot";
82
+ /**
83
+ * The id (see SCREEN_ATTR) of the screen a slot belongs to.
84
+ *
85
+ * A slot sits in an ancestor's host, so nothing about where it IS says whose
86
+ * it is. The gesture driver needs to: a drag moves a screen by writing inline
87
+ * styles frame by frame rather than through the compiled rules, so it has to
88
+ * enumerate everything that rides along, and it finds those by walking the
89
+ * moving screen's container. A slot is not in that container. This is how it
90
+ * is found anyway — the same problem a shared bar does not have, because a bar
91
+ * never leaves the container it belongs to.
92
+ */
93
+ export declare const LAYER_OWNER_ATTR = "data-flemo-layer-owner";
94
+ /**
95
+ * A `<Part>`'s registered part-transition name. Parts self-carry their screen's
96
+ * status/active (STATUS_ATTR/ACTIVE_ATTR) so the compiled part selectors and
97
+ * the engine's participant scan can both find them.
98
+ */
99
+ export declare const PART_NAME_ATTR = "data-flemo-part-name";
100
+ /**
101
+ * Marks a registered morph element. Presence only — the value is the ROLE
102
+ * (see MORPH_ROLE). Written by the binding, read by the morph runtime (to find
103
+ * the pair), by the compiled hold rule (so a morph pauses with its screen),
104
+ * and by devtools.
105
+ */
106
+ export declare const MORPH_ATTR = "data-flemo-morph";
107
+ /** The morph's side of the flight, stamped by the runtime for its duration. */
108
+ export declare const MORPH_ROLE: {
109
+ /** The arriving element: it travels from its partner's rect to its own. */
110
+ readonly ENTER: "enter";
111
+ /** The element left behind: it stays put and trades places with the arrival. */
112
+ readonly EXIT: "exit";
113
+ };
114
+ /**
115
+ * The registered morph-transition name for this element, so a consumer can run
116
+ * different morph choreography per element. Absent means the default preset.
117
+ */
118
+ export declare const MORPH_NAME_ATTR = "data-flemo-morph-name";
119
+ /**
120
+ * The per-Router FLIGHT LAYER: the box a shared element is staged in while it
121
+ * travels. Rendered by the binding (a Router knows which box bounds its
122
+ * screens); the morph runtime moves the element in at the start of a flight and
123
+ * back on landing. A morph inside a screen would be clipped by it, covered by
124
+ * it and dragged along with it — all three are properties of being a
125
+ * descendant, so for the flight it stops being one.
126
+ */
127
+ export declare const MORPH_LAYER_ATTR = "data-flemo-morph-layer";
128
+ /**
129
+ * The morph's placeholder: the box that stays behind in the layout, at the
130
+ * element's own size, while the element itself is up in the flight layer. It is
131
+ * what keeps the arriving screen laid out exactly as it will be at rest, so the
132
+ * landing has somewhere true to land.
133
+ */
134
+ export declare const MORPH_SLOT_ATTR = "data-flemo-morph-slot";
135
+ /**
136
+ * The STAND-IN: a copy of the element that is flying, left in its slot to hold
137
+ * its place in the layout.
138
+ *
139
+ * A placeholder measured in pixels is a placeholder that can be wrong, and
140
+ * "wrong" here is a layout shift lasting exactly as long as the flight. A copy
141
+ * of the element cannot be: the layout has no way to tell it apart from what
142
+ * was there — same box, same margins, same baseline. It paints nothing and
143
+ * takes no input, and it is replaced by the real element on landing. Owned
144
+ * entirely by the morph runtime.
145
+ */
146
+ export declare const MORPH_STAND_IN_ATTR = "data-flemo-morph-stand-in";
147
+ /**
148
+ * The GHOST: a copy of the element being replaced, carried inside the flight so
149
+ * the travelling box shows what was actually there at the start instead of the
150
+ * arrival's content squeezed into the departure's size. It cross-fades into the
151
+ * real element and is removed on landing. Owned entirely by the morph runtime.
152
+ */
153
+ export declare const MORPH_GHOST_ATTR = "data-flemo-morph-ghost";
154
+ /**
155
+ * The SCREEN a flight is driving as a camera, stamped with the flight's id.
156
+ *
157
+ * A morph with `carry: "screen"` does not just move its element: it moves the
158
+ * whole screen the element is small on, by exactly the zoom that takes the
159
+ * element from one end of the flight to the other. Everything else on that
160
+ * screen is then dragged along and pushed out of frame, which is what makes a
161
+ * container transform read as one camera move rather than as one card
162
+ * escaping a grid that stayed behind.
163
+ *
164
+ * The id is in the value because two flights can overlap: the rule that
165
+ * matches is the one whose keyframes are still in the sheet.
166
+ */
167
+ export declare const MORPH_CAMERA_ATTR = "data-flemo-morph-camera";
168
+ /**
169
+ * The `<style>` tag the morph runtime writes its per-flight keyframes into. A
170
+ * morph's geometry only exists once two rects do, so unlike every other
171
+ * animation in the library its keyframes cannot be compiled at registration —
172
+ * they are inserted when a flight starts and dropped when it lands. Kept out of
173
+ * the compiled sheet so that sheet stays a pure function of the definitions.
174
+ */
175
+ export declare const MORPH_SHEET_ATTR = "data-flemo-morph-sheet";
176
+ /**
177
+ * The animation hold. `"true"` pauses this element's compiled animation (and
178
+ * its descendant parts) at the from-pose; `"park"` parks it at its
179
+ * destination instead; `"false"` releases. The release flip is the moment a
180
+ * flight's clock starts.
181
+ */
182
+ export declare const ANIM_HOLD_ATTR = "data-flemo-anim-hold";
183
+ /**
184
+ * The values ANIM_HOLD_ATTR takes. These are as much of the contract as the
185
+ * attribute name: the binding writes them, the compiled stylesheet generates
186
+ * one rule per parked form, and the engine's release watch compares against
187
+ * RELEASED. All four "held" forms pause the animation; they differ in where
188
+ * the held element sits while it waits.
189
+ */
190
+ export declare const ANIM_HOLD: {
191
+ /** Paused at the keyframe's from-pose. */
192
+ readonly HELD: "true";
193
+ /** Released — the flight's clock starts on this write. */
194
+ readonly RELEASED: "false";
195
+ /** Pre-positioned at its DESTINATION, under an opaque cover. */
196
+ readonly PARK: "park";
197
+ /** The push-side mirror: the entering screen parked BELOW its cover. */
198
+ readonly PARK_UNDER: "park-under";
199
+ /** The promoted variant of PARK_UNDER, kept above so its raster survives. */
200
+ readonly PARK_OVER: "park-over";
201
+ };
202
+ /** The values the compiled hold rule must pause on. */
203
+ export declare const ANIM_HOLD_PAUSED_VALUES: readonly ["true", "park", "park-under", "park-over"];
204
+ /** Marks content parked by the in-flight arrival hold, pending its landing. */
205
+ export declare const HELD_ARRIVAL_ATTR = "data-flemo-held-arrival";
206
+ /** Marks an `<img>` whose reveal is held to the flight's rest. */
207
+ export declare const IMAGE_HOLD_ATTR = "data-flemo-img-hold";
208
+ /** The governed (touch WebKit) head kit. */
209
+ export declare const GOVERNED_ATTR = "data-flemo-governed";
210
+ /** The creep head: the head's end keyframe carries a hair of motion. */
211
+ export declare const CREEP_ATTR = "data-flemo-creep";
212
+ /** The desktop macOS Safari flat head, with its own lengths. */
213
+ export declare const DESK_HEAD_ATTR = "data-flemo-desk-head";
214
+ /** The compositor warm-up element. */
215
+ export declare const WARM_ATTR = "data-flemo-warm";
216
+ /** The warm-up's cadence video, when the desktop profile uses one. */
217
+ export declare const WARM_VIDEO_ATTR = "data-flemo-warm-video";
218
+ /** The one-shot GPU pipeline prewarm element. */
219
+ export declare const GPU_PREWARM_ATTR = "data-flemo-gpu-prewarm";
220
+ /**
221
+ * An offloaded `<img>`'s AUTHORED source, kept while `src` points at the
222
+ * decoded-to-scale replacement.
223
+ */
224
+ export declare const OFFLOADED_SRC_ATTR = "data-flemo-image-src";
225
+ /**
226
+ * The devtools panel's shadow host. Owned by @flemo/devtools, reserved here so
227
+ * the name cannot be reused and so the engine's own scans can skip it.
228
+ */
229
+ export declare const DEVTOOLS_PANEL_ATTR = "data-flemo-devtools-panel";
230
+ /** `[data-flemo-screen]` — presence selector for one attribute. */
231
+ export declare const attrSelector: (attribute: string) => string;
232
+ /** `[data-flemo-status="PUSHING"]` — value selector for one attribute. */
233
+ export declare const attrValueSelector: (attribute: string, value: string) => string;
234
+ /**
235
+ * Every attribute this library writes. Exported so a consumer, an e2e suite or
236
+ * a devtools build can assert against the shipped set instead of a hand-kept
237
+ * copy — the drift this module exists to end.
238
+ */
239
+ export declare const FLEMO_ATTRIBUTES: readonly ["data-flemo-screen", "data-flemo-status", "data-flemo-active", "data-flemo-transition", "data-flemo-router", "data-flemo-skip-animation", "data-flemo-bar", "data-flemo-bar-active", "data-flemo-bar-status", "data-flemo-bar-riding", "data-flemo-bar-id", "data-flemo-bar-id-type", "data-flemo-bar-transition", "data-flemo-bar-spacer", "data-flemo-decorator", "data-flemo-decorator-name", "data-flemo-layer-host", "data-flemo-layer-owner", "data-flemo-layer-slot", "data-flemo-part-name", "data-flemo-morph", "data-flemo-morph-camera", "data-flemo-morph-ghost", "data-flemo-morph-layer", "data-flemo-morph-name", "data-flemo-morph-slot", "data-flemo-morph-stand-in", "data-flemo-morph-sheet", "data-flemo-anim-hold", "data-flemo-held-arrival", "data-flemo-img-hold", "data-flemo-governed", "data-flemo-creep", "data-flemo-desk-head", "data-flemo-warm", "data-flemo-warm-video", "data-flemo-gpu-prewarm", "data-flemo-image-src", "data-flemo-devtools-panel"];