@flemo/core 2.3.0 → 2.4.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.
@@ -0,0 +1 @@
1
+ export {};
@@ -31,7 +31,29 @@ export interface CreateRouterScopeInput {
31
31
  browserDriver: HistoryDriver | null;
32
32
  hostedScope: FlemoStores | null;
33
33
  persistKey?: string;
34
+ deferEntryAdoption?: boolean;
34
35
  routerKey?: string;
35
36
  zoneEntryId?: string;
36
37
  }
37
38
  export default function createRouterScope(input: CreateRouterScopeInput): FlemoStores;
39
+ /**
40
+ * Adopt the identity of the browser entry this scope was seeded on, after the
41
+ * fact — the deferred half of `deferEntryAdoption`.
42
+ *
43
+ * A binding that hydrates calls this once hydration is over, and the store's
44
+ * root frame stops being the generic "root" and becomes the entry it is
45
+ * actually sitting on. That matters for exactly the reason the construction
46
+ * path adopts at all: a traversal back onto this entry has to match it by id
47
+ * rather than collide with every other scope's "root".
48
+ *
49
+ * Every guard below is a refusal to overwrite something real:
50
+ *
51
+ * - a scope that already navigated has a stack this is not the seed of, and
52
+ * rewriting its first frame's id would rename an entry the user has since
53
+ * left,
54
+ * - a seed that is no longer "root" was adopted already (a re-run, a strict
55
+ * mode double effect),
56
+ * - a memory scope has no browser entry to adopt, and
57
+ * - an entry with no frame of its own has no identity to take.
58
+ */
59
+ export declare function adoptEntryIdentity(scope: FlemoStores): void;
@@ -2,6 +2,18 @@ import { VariantMotion } from '../../transition/variantMotion';
2
2
  export interface RiderSwipe {
3
3
  /** Whether anything is actually being driven. */
4
4
  readonly active: boolean;
5
+ /**
6
+ * Whether any element this staged has left the document.
7
+ *
8
+ * A gesture stages against the elements that exist when it begins, and a
9
+ * drag's own wake can REPLACE one of them a frame later — a covered screen's
10
+ * dim moves between its container and the layer host as that screen's
11
+ * `<Layer>` slots unmount and re-mount (see resolvePrevDecorator in
12
+ * createSwipeController). The animations stay on the node that left, so the
13
+ * one on screen never moves. Reported for the hook-driven dim; the same wake
14
+ * reaches a pose-only one, which is what this is for.
15
+ */
16
+ readonly stale: boolean;
5
17
  /** Move every rider to this fraction of its travel (0 → 1). */
6
18
  scrub: (progress: number) => void;
7
19
  /**
@@ -12,8 +24,14 @@ export interface RiderSwipe {
12
24
  * pose — the contract the swipe already applies to the screen and the dim.
13
25
  * Otherwise they run backwards and the compiled rest rule takes them over
14
26
  * again.
27
+ *
28
+ * RESOLVES WHEN THE LANDING HAS LANDED. A caller that commits a navigation
29
+ * off the back of a release has to wait for it: the screens are staged
30
+ * animations now, so committing while they still play removes the screen
31
+ * mid-flight and it vanishes rather than leaving. Device-reported the first
32
+ * time the declarative path shipped without this.
15
33
  */
16
- settle: (commit: boolean, seconds: number) => void;
34
+ settle: (commit: boolean, seconds: number) => Promise<void>;
17
35
  }
18
36
  export interface RiderMotion {
19
37
  readonly element: HTMLElement;
@@ -24,5 +42,13 @@ export interface RiderMotion {
24
42
  * nothing to drive, so a gesture over chrome that declares no motion costs
25
43
  * nothing.
26
44
  */
27
- export declare const beginRiderSwipe: (riders: readonly RiderMotion[]) => RiderSwipe | null;
45
+ export declare const beginRiderSwipe: (riders: readonly RiderMotion[], options?: {
46
+ /**
47
+ * The writer staking the landed pose this hands back (see the note in
48
+ * `settle`). A caller whose own cleanup is owner-scoped — the swipe's
49
+ * riding bars are — has to be the one on the lease, or its clear will not
50
+ * release what was written here.
51
+ */
52
+ writer?: symbol;
53
+ }) => RiderSwipe | null;
28
54
  export default beginRiderSwipe;
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export { default as createNavigateStore, type NavigateStatus, type NavigateStore
10
10
  export { markSelfInducedPop, consumeSelfInducedPop, createSelfPopGuard, type SelfPopGuard } from './navigate/selfPopGuard';
11
11
  export { default as createNavigationController, type NavigationControllerDeps, type DistanceOptions, type NavigateOptions, type PopOptions } from './navigate/createNavigationController';
12
12
  export { default as createStepController, readStepParams, appendParamsQuery, subscribeStepParamsRestore, type StepControllerDeps } from './navigate/createStepController';
13
- export { default as createRouterScope, type FlemoStores, type CreateRouterScopeInput } from './core/createRouterScope';
13
+ export { default as createRouterScope, adoptEntryIdentity, type FlemoStores, type CreateRouterScopeInput } from './core/createRouterScope';
14
14
  export { default as createScreenStore, type ScreenStore, type ScreenStoreApi, type SharedBarPresence, type SharedBarId, type SharedBarMetadata, type SharedBarsMetadata, type ScreenSurface } from './screen/store';
15
15
  export { default as createScreenSelector, type ScreenSelection } from './screen/createScreenSelector';
16
16
  export { default as computeScreenFreeze, computeScreenFreezeMode, type ScreenFreezeInput, type ScreenFreezeMode } from './screen/computeScreenFreeze';
@@ -61,6 +61,8 @@ export { default as computeBarRiding, sharedBarsMatch, type BarRidingInput } fro
61
61
  export { animHoldKey, scheduleAnimHoldRelease, createAnimHoldCoordinator, eagerlyDecodeImages, ANIM_HOLD_RELEASE_BACKSTOP_MS, type AnimHoldInput, type AnimHoldCoordinator } from './screen/animStartAnchor';
62
62
  export { detectBlinkEngine, isDesktopBlink, isLegacyAndroidBlink } from './platform/engineProbes';
63
63
  export { steadySixtyDesktopProfile } from './platform/steadySixtyCadence';
64
+ export { resolveSwipeOptions, DEFAULT_COMMIT_FRACTION, DEFAULT_COMMIT_VELOCITY, type ResolvedSwipe } from './transition/resolveSwipeOptions';
65
+ export type { SwipeOptions, SwipeStop } from './transition/typing';
64
66
  export { swipeSettleSeconds, MIN_SETTLE_SECONDS, type SwipeSettleInput } from './transition/swipeSettle';
65
67
  export { default as observeBarHeight } from './screen/observeBarHeight';
66
68
  export { default as publishRideBox } from './screen/publishRideBox';