cineview 1.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.
- package/LICENSE +21 -0
- package/README.md +284 -0
- package/README.zh-CN.md +284 -0
- package/dist/animations/animationParser.d.ts +24 -0
- package/dist/animations/composer.d.ts +13 -0
- package/dist/animations/presets/blink.d.ts +18 -0
- package/dist/animations/presets/blur.d.ts +18 -0
- package/dist/animations/presets/bounce.d.ts +18 -0
- package/dist/animations/presets/elastic.d.ts +23 -0
- package/dist/animations/presets/fade.d.ts +18 -0
- package/dist/animations/presets/flip.d.ts +18 -0
- package/dist/animations/presets/index.d.ts +38 -0
- package/dist/animations/presets/rotate.d.ts +23 -0
- package/dist/animations/presets/shake.d.ts +28 -0
- package/dist/animations/presets/slide.d.ts +23 -0
- package/dist/animations/presets/special.d.ts +38 -0
- package/dist/animations/presets/zoom.d.ts +23 -0
- package/dist/animations/registry.d.ts +51 -0
- package/dist/artifacts.json +40 -0
- package/dist/blink-BGmsrTwW.mjs +81 -0
- package/dist/blur-CQoB_VWp.mjs +52 -0
- package/dist/bounce-B_QJxgOq.mjs +64 -0
- package/dist/cineview-dev.css +2 -0
- package/dist/cineview-dev.es.mjs +2 -0
- package/dist/cineview-drag.umd.js +2 -0
- package/dist/cineview-scroll.umd.js +2 -0
- package/dist/cineview.es.mjs +2 -0
- package/dist/cineview.umd.js +2 -0
- package/dist/components/Animate/Animate.d.ts +67 -0
- package/dist/components/Animate/AnimateRenderBridge.d.ts +16 -0
- package/dist/components/Animate/AnimateVideo.d.ts +59 -0
- package/dist/components/Animate/StaggerContainer.d.ts +35 -0
- package/dist/components/Animate/__fixtures__/animate-media-public-path.fixture.d.ts +1 -0
- package/dist/components/Animate/animateInterpolation.d.ts +41 -0
- package/dist/components/Animate/animateRenderState.d.ts +23 -0
- package/dist/components/Animate/animateSemantics.d.ts +39 -0
- package/dist/components/Animate/animateTimeline.d.ts +14 -0
- package/dist/components/Animate/dragVisualState.d.ts +26 -0
- package/dist/components/Animate/index.d.ts +6 -0
- package/dist/components/Animate/useAnimateArrival.d.ts +35 -0
- package/dist/components/Animate/useAnimateDrag.d.ts +34 -0
- package/dist/components/Animate/useAnimatePublicTimeline.d.ts +16 -0
- package/dist/components/Animate/useAnimateScroll.d.ts +83 -0
- package/dist/components/Animate/useAnimatedPropertyLanes.d.ts +30 -0
- package/dist/components/Animate/visibilityScheduler.d.ts +12 -0
- package/dist/components/CineView/CineView.d.ts +48 -0
- package/dist/components/CineView/CineViewDispatch.d.ts +2 -0
- package/dist/components/CineView/DirectScrollCineView.d.ts +5 -0
- package/dist/components/CineView/DragSceneStack.d.ts +55 -0
- package/dist/components/CineView/ScrollSceneSlot.d.ts +42 -0
- package/dist/components/CineView/ScrollSceneStack.d.ts +13 -0
- package/dist/components/CineView/ScrollbarOverlay.d.ts +24 -0
- package/dist/components/CineView/directScrollHelpers.d.ts +75 -0
- package/dist/components/CineView/index.d.ts +5 -0
- package/dist/components/CineView/preloadTargets.d.ts +18 -0
- package/dist/components/CineView/regroupCallbacks.d.ts +10 -0
- package/dist/components/CineView/useCineViewImperativeApi.d.ts +21 -0
- package/dist/components/CineView/useNativeScrollController.d.ts +38 -0
- package/dist/components/CineView/useScrollInputBindings.d.ts +9 -0
- package/dist/components/CineView/useScrollSceneLayout.d.ts +24 -0
- package/dist/components/CineView/useScrollSceneSnapshots.d.ts +32 -0
- package/dist/components/CineView/useScrollViewport.d.ts +20 -0
- package/dist/components/CineView/useScrollZoneRegistry.d.ts +34 -0
- package/dist/components/Container/Container.d.ts +2 -0
- package/dist/components/Container/index.d.ts +1 -0
- package/dist/components/Image/Image.d.ts +12 -0
- package/dist/components/Image/index.d.ts +2 -0
- package/dist/components/Position/Position.d.ts +13 -0
- package/dist/components/Position/index.d.ts +1 -0
- package/dist/components/Scene/Scene.d.ts +10 -0
- package/dist/components/Scene/SceneFixedLayer.d.ts +14 -0
- package/dist/components/Scene/__fixtures__/scene-grouped-public-path.fixture.d.ts +1 -0
- package/dist/components/Scene/dragPreparedState.d.ts +49 -0
- package/dist/components/Scene/helpers.d.ts +101 -0
- package/dist/components/Scene/index.d.ts +1 -0
- package/dist/components/Scene/sceneScrollBudget.d.ts +36 -0
- package/dist/components/Scene/sceneScrollRuntime.d.ts +66 -0
- package/dist/components/Scene/types.d.ts +189 -0
- package/dist/components/Scene/useDragSceneEngine.d.ts +67 -0
- package/dist/components/Scene/useElementTrack.d.ts +82 -0
- package/dist/components/Scene/useNativePointerDrag.d.ts +25 -0
- package/dist/components/Scene/useSceneAnimationRegistry.d.ts +56 -0
- package/dist/components/Scene/useScenePointerInput.d.ts +28 -0
- package/dist/components/Scene/useSceneRuntimeState.d.ts +17 -0
- package/dist/components/Scene/useSceneScrollTakeover.d.ts +14 -0
- package/dist/components/Scene/useScrollSceneEngine.d.ts +28 -0
- package/dist/components/runtime/runtimeContext.d.ts +14 -0
- package/dist/components/runtime/scrollExternalStore.d.ts +13 -0
- package/dist/components/runtime/scrollSceneFrameStore.d.ts +29 -0
- package/dist/context/CineViewContext.d.ts +25 -0
- package/dist/dev/PerfPanel.d.ts +16 -0
- package/dist/dev/index.d.ts +14 -0
- package/dist/dev/usePerfMonitor.d.ts +9 -0
- package/dist/drag-scene-engine-y8Wj9ivV.mjs +270 -0
- package/dist/elastic-CBP_FdRv.mjs +129 -0
- package/dist/element-track-Du10P12_.mjs +316 -0
- package/dist/entry-drag.d.ts +14 -0
- package/dist/entry-scroll.d.ts +14 -0
- package/dist/fade-DXxFsgxR.mjs +22 -0
- package/dist/flip-CrCoNIws.mjs +49 -0
- package/dist/hooks/imagePreloadCache.d.ts +4 -0
- package/dist/hooks/mediaPreloadCache.d.ts +31 -0
- package/dist/hooks/useFirstSceneEnter.d.ts +65 -0
- package/dist/hooks/useImagePreloader.d.ts +31 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +12 -0
- package/dist/hooks/useSceneManager.d.ts +78 -0
- package/dist/index.d.ts +17 -0
- package/dist/media/VideoFrameRenderer.d.ts +48 -0
- package/dist/media/videoPlaybackOwnership.d.ts +63 -0
- package/dist/performance-monitor-AlOOwzY_.mjs +73 -0
- package/dist/public-api.d.ts +12 -0
- package/dist/rotate-BMEBKDk5.mjs +69 -0
- package/dist/scene-animation-registry-8b0m_IaZ.mjs +422 -0
- package/dist/shake-BV6SdR9O.mjs +171 -0
- package/dist/slide-DWmVtj0L.mjs +63 -0
- package/dist/special-DDz8BopB.mjs +224 -0
- package/dist/types/index.d.ts +555 -0
- package/dist/utils/animationHelpers.d.ts +15 -0
- package/dist/utils/debounce.d.ts +18 -0
- package/dist/utils/devLog.d.ts +16 -0
- package/dist/utils/dragTimelineMapping.d.ts +30 -0
- package/dist/utils/gestureDetector.d.ts +67 -0
- package/dist/utils/performanceMonitor.d.ts +66 -0
- package/dist/utils/styleConvert.d.ts +7 -0
- package/dist/utils/useIsomorphicLayoutEffect.d.ts +22 -0
- package/dist/utils/useStructurallyStableValue.d.ts +5 -0
- package/dist/zoom-CuAthpqd.mjs +63 -0
- package/package.json +167 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CSSProperties, VideoHTMLAttributes } from 'react';
|
|
2
|
+
import { AnimationType } from '../../types';
|
|
3
|
+
type NativeVideoEventProps = Pick<VideoHTMLAttributes<HTMLVideoElement>, 'onEnded' | 'onPlay' | 'onPause' | 'onTimeUpdate' | 'onError'>;
|
|
4
|
+
export interface AnimateVideoProps extends NativeVideoEventProps {
|
|
5
|
+
/**
|
|
6
|
+
* Video resource URL. Videos authored for scrubbing should use dense keyframes;
|
|
7
|
+
* all-keyframe encoding provides the most predictable reverse-seek performance.
|
|
8
|
+
*/
|
|
9
|
+
src: string;
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
/** Whether this component eagerly fills the shared video preload cache. */
|
|
15
|
+
preload?: boolean;
|
|
16
|
+
poster?: string;
|
|
17
|
+
playbackRate?: number;
|
|
18
|
+
/** Optional video-time interval driven by progress, including reverse intervals. */
|
|
19
|
+
scrubRange?: readonly [fromSeconds: number, toSeconds: number];
|
|
20
|
+
animateId?: string;
|
|
21
|
+
duration?: {
|
|
22
|
+
enter?: number;
|
|
23
|
+
exit?: number;
|
|
24
|
+
};
|
|
25
|
+
/** Defaults to a neutral variant so frame scrubbing remains the visible animation. */
|
|
26
|
+
enterAnimation?: AnimationType;
|
|
27
|
+
exitAnimation?: AnimationType;
|
|
28
|
+
timeline?: {
|
|
29
|
+
delay?: number;
|
|
30
|
+
after?: string;
|
|
31
|
+
};
|
|
32
|
+
visibility?: {
|
|
33
|
+
replay?: boolean;
|
|
34
|
+
enterMargin?: number;
|
|
35
|
+
exitMargin?: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Scroll mode, takeover zones only (default `false`). When `true`, the
|
|
39
|
+
* decoded-frame residency of the scrub video follows the zone's approach
|
|
40
|
+
* band (task-flow 2026-08-14, Plan A "release when far / preload when near"):
|
|
41
|
+
*
|
|
42
|
+
* - Leaving the zone beyond 1.5 viewports (band `'far'`) drops the decoded
|
|
43
|
+
* frames/textures via `pause + removeAttribute('src') + load()` — probe
|
|
44
|
+
* evidence shows those frames otherwise cost real compositor time in the
|
|
45
|
+
* scenes the viewer scrolls to next.
|
|
46
|
+
* - Returning within 1 viewport of the zone (band `'near'`) re-attaches the
|
|
47
|
+
* source (blob already in memory, zero network) and catches the seek up to
|
|
48
|
+
* the current timeline position once metadata is back.
|
|
49
|
+
*
|
|
50
|
+
* The release threshold sits deliberately outside the preload threshold
|
|
51
|
+
* (Schmitt ordering) so hovering between them cannot flap. Ignored outside
|
|
52
|
+
* scroll takeover zones and in drag mode. Releasing only happens after the
|
|
53
|
+
* timeline has actually been scrubbed/played once (an un-watched video has
|
|
54
|
+
* nothing resident to free).
|
|
55
|
+
*/
|
|
56
|
+
releaseOnLeave?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare const AnimateVideo: import('react').ForwardRefExoticComponent<AnimateVideoProps & import('react').RefAttributes<HTMLVideoElement>>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { MotionValue } from 'framer-motion';
|
|
3
|
+
import { AnimatePhase, ParsedAnimationVariant } from '../../types';
|
|
4
|
+
import { DragVisualState } from './useAnimateDrag';
|
|
5
|
+
type StaggerFrom = 'first' | 'last' | 'center';
|
|
6
|
+
type StaggerPhase = 'initial' | 'animate' | 'exit';
|
|
7
|
+
export interface StaggerTiming {
|
|
8
|
+
itemDurationMs: number;
|
|
9
|
+
tailDurationMs: number;
|
|
10
|
+
effectiveDurationMs: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function countStaggerItems(container: ReactElement): number;
|
|
13
|
+
export declare function resolveStaggerTiming(variant: ParsedAnimationVariant, authoredDurationMs: number, each: number, from: StaggerFrom, itemCount: number, target?: 'animate' | 'exit'): StaggerTiming;
|
|
14
|
+
export declare function renderStaggerTree(container: ReactElement, variant: ParsedAnimationVariant, each: number, from: StaggerFrom, phase: boolean | StaggerPhase, itemDurationMs?: number, exitVariant?: ParsedAnimationVariant | null, exitItemDurationMs?: number, instant?: boolean): ReactElement;
|
|
15
|
+
interface CommonProps {
|
|
16
|
+
container: ReactElement;
|
|
17
|
+
variant: ParsedAnimationVariant;
|
|
18
|
+
each: number;
|
|
19
|
+
from: StaggerFrom;
|
|
20
|
+
itemDurationMs?: number;
|
|
21
|
+
effectiveDurationMs?: number;
|
|
22
|
+
exitVariant?: ParsedAnimationVariant | null;
|
|
23
|
+
exitItemDurationMs?: number;
|
|
24
|
+
}
|
|
25
|
+
export declare function ScrollStagger({ container, variant, each, from, itemDurationMs, effectiveDurationMs, exitVariant, exitItemDurationMs, signedVisual, }: CommonProps & {
|
|
26
|
+
signedVisual: MotionValue<number>;
|
|
27
|
+
}): ReactElement;
|
|
28
|
+
export declare function ArrivalStagger({ container, variant, each, from, itemDurationMs, effectiveDurationMs, phaseMotion, staticReveal, }: CommonProps & {
|
|
29
|
+
phaseMotion: MotionValue<AnimatePhase>;
|
|
30
|
+
staticReveal: boolean;
|
|
31
|
+
}): ReactElement;
|
|
32
|
+
export declare function DragStagger({ container, variant, each, from, itemDurationMs, effectiveDurationMs, exitVariant, exitItemDurationMs, visualState, }: CommonProps & {
|
|
33
|
+
visualState: MotionValue<DragVisualState | null>;
|
|
34
|
+
}): ReactElement;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AnimateMediaPublicPathFixture(): React.JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared interpolation/variant helpers for the Animate hooks.
|
|
3
|
+
*
|
|
4
|
+
* `useAnimateDrag` and `useAnimateScroll` are two independent driver
|
|
5
|
+
* implementations (follow-finger element clock vs. scroll-budget / visibility
|
|
6
|
+
* gate), but the leaf math that turns a variant record + progress into a CSS
|
|
7
|
+
* value is identical. These pure helpers were duplicated verbatim in both hooks;
|
|
8
|
+
* keeping one copy here removes the drift risk.
|
|
9
|
+
*
|
|
10
|
+
* `lerpTransformValue` is the superset string interpolator (drag's former
|
|
11
|
+
* `lerpStringValue`): it handles number, unit-suffixed strings (`100%`, `12px`,
|
|
12
|
+
* `45deg`), AND single-arg transform functions (`translateY(100%)`). Scroll's
|
|
13
|
+
* former `lerpValue` lacked the function branch; adopting the superset is purely
|
|
14
|
+
* additive — non-function values resolve identically.
|
|
15
|
+
*/
|
|
16
|
+
export type AnimatableProperty = 'opacity' | 'x' | 'y' | 'scale' | 'rotate' | 'rotateX' | 'rotateY' | 'skewX' | 'skewY' | 'filter';
|
|
17
|
+
export type TransformValue = number | string;
|
|
18
|
+
export type VariantRecord = Record<string, unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* Compiled variant records shared by the drag and scroll drivers (both have
|
|
21
|
+
* full enter/exit semantics). The arrival driver intentionally keeps its own
|
|
22
|
+
* two-field shape { initial, animate } — it has no exit concept, and faking an
|
|
23
|
+
* empty exitTarget here would be a semantic lie.
|
|
24
|
+
*/
|
|
25
|
+
export interface SceneVariantRecords {
|
|
26
|
+
enterInitial: VariantRecord;
|
|
27
|
+
enterAnimate: VariantRecord;
|
|
28
|
+
exitTarget: VariantRecord;
|
|
29
|
+
}
|
|
30
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
31
|
+
export declare function lerp(start: number, end: number, progress: number): number;
|
|
32
|
+
export declare function lerpTransformValue(start: TransformValue, end: TransformValue, progress: number): TransformValue;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve one property from a Framer Motion variant record at a scrubbed local progress.
|
|
35
|
+
* Array targets are full keyframe sequences; scalar targets retain the existing from-to lerp.
|
|
36
|
+
*/
|
|
37
|
+
export declare function interpolateVariantValue(from: TransformValue, record: VariantRecord, property: AnimatableProperty, fallback: TransformValue, progress: number): TransformValue;
|
|
38
|
+
export declare function getVariantTerminalValue(record: VariantRecord, property: AnimatableProperty, fallback: TransformValue): TransformValue;
|
|
39
|
+
export declare function parseNumericValue(value: unknown, fallback: number): number;
|
|
40
|
+
export declare function getDefaultValue(property: AnimatableProperty, phase: 'initial' | 'animate' | 'exit'): TransformValue;
|
|
41
|
+
export declare function getVariantValue<T extends TransformValue>(record: VariantRecord, property: AnimatableProperty, fallback: T): T;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AnimateRenderState } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Render-prop state normalization (pure functions, exported for testing).
|
|
4
|
+
*
|
|
5
|
+
* Scroll and drag use different phase vocabularies:
|
|
6
|
+
* - scroll: `GatePhase`('idle'|'waiting'|'entering'|'entered'|'exiting'|'exited'), passed through directly.
|
|
7
|
+
* - drag: `DragVisualState.mode`('rest'|'outgoing'|'enter'|'hidden') + `localProgress`(0..1),
|
|
8
|
+
* normalized to unified `AnimateRenderState.phase` vocabulary.
|
|
9
|
+
*
|
|
10
|
+
* Both sides converge `enterProgress` to 0..1 (0=initial frame, 1=fully entered).
|
|
11
|
+
*/
|
|
12
|
+
export type ScrollGatePhase = 'idle' | 'waiting' | 'entering' | 'entered' | 'exiting' | 'exited';
|
|
13
|
+
export type DragVisualMode = 'rest' | 'outgoing' | 'enter' | 'hidden';
|
|
14
|
+
/** Drag side: mode + localProgress → unified phase vocabulary. */
|
|
15
|
+
export declare function normalizeDragPhase(mode: DragVisualMode, localProgress: number): AnimateRenderState['phase'];
|
|
16
|
+
/** Scroll side: `visualMotion` convention 0=initial, 1=enter, -1=exit; enterProgress takes positive segment. */
|
|
17
|
+
export declare function resolveScrollEnterProgress(signedVisual: number): number;
|
|
18
|
+
/** Scroll side: assemble complete render state. */
|
|
19
|
+
export declare function resolveScrollRenderState(phase: ScrollGatePhase, signedVisual: number): AnimateRenderState;
|
|
20
|
+
/** Drag side: assemble complete render state. localProgress is already unsigned 0..1. */
|
|
21
|
+
export declare function resolveDragRenderState(mode: DragVisualMode, localProgress: number): AnimateRenderState;
|
|
22
|
+
/** No-animation early-exit branch: always initial state (progress 0, phase idle), still supports function children. */
|
|
23
|
+
export declare const IDLE_RENDER_STATE: AnimateRenderState;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AnimateProps, AnimationType } from '../../types';
|
|
2
|
+
type WidenAnimationRequirements<T> = T extends unknown ? Omit<T, 'enterAnimation' | 'loopAnimation'> & {
|
|
3
|
+
enterAnimation?: AnimationType;
|
|
4
|
+
loopAnimation?: AnimationType;
|
|
5
|
+
} : never;
|
|
6
|
+
/**
|
|
7
|
+
* Runtime implementation shape. The public union requires enter or loop,
|
|
8
|
+
* while this internal view remains defensive against JavaScript/`as any`
|
|
9
|
+
* callers so invalid configurations can fail open and report INVALID_ANIMATION.
|
|
10
|
+
*/
|
|
11
|
+
export type AnimateInternalProps = WidenAnimationRequirements<AnimateProps>;
|
|
12
|
+
export interface NormalizedAnimateTimeline {
|
|
13
|
+
driver: 'scene' | 'clock';
|
|
14
|
+
delay: number;
|
|
15
|
+
after?: string;
|
|
16
|
+
zoneId?: string;
|
|
17
|
+
phase?: {
|
|
18
|
+
start?: number;
|
|
19
|
+
end?: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export type ResolvedAnimateTimeline = Omit<NormalizedAnimateTimeline, 'driver'> & {
|
|
23
|
+
lane: 'scroll' | 'visibility';
|
|
24
|
+
};
|
|
25
|
+
export interface NormalizedAnimateVisibility {
|
|
26
|
+
replay: boolean;
|
|
27
|
+
enterMargin?: number;
|
|
28
|
+
exitMargin?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface NormalizedAnimateSemantics {
|
|
31
|
+
duration: {
|
|
32
|
+
enter: number;
|
|
33
|
+
exit: number;
|
|
34
|
+
};
|
|
35
|
+
timeline: NormalizedAnimateTimeline;
|
|
36
|
+
visibility: NormalizedAnimateVisibility;
|
|
37
|
+
}
|
|
38
|
+
export declare function normalizeAnimateSemantics({ duration, timeline, visibility, }: Pick<AnimateInternalProps, 'duration' | 'timeline' | 'visibility'>): NormalizedAnimateSemantics;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AnimateTimeline } from '../../types';
|
|
3
|
+
interface AnimateTimelineProviderProps {
|
|
4
|
+
value: AnimateTimeline;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function AnimateTimelineProvider({ value, children, }: AnimateTimelineProviderProps): React.JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Read the nearest Animate timeline without subscribing React to frame updates.
|
|
10
|
+
* Consumers attach MotionValues directly to motion styles or subscribe with
|
|
11
|
+
* useMotionValueEvent; CineView remains the only timeline writer.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useAnimateTimeline(): AnimateTimeline;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SceneContextType } from './Animate';
|
|
2
|
+
import { AnimatableProperty, SceneVariantRecords, TransformValue } from './animateInterpolation';
|
|
3
|
+
import { DragSceneTransaction, PreparedSceneSnapshot } from '../Scene/dragPreparedState';
|
|
4
|
+
export interface DragVisualState {
|
|
5
|
+
mode: 'rest' | 'outgoing' | 'enter' | 'hidden';
|
|
6
|
+
direction: 'forward' | 'backward';
|
|
7
|
+
transitionProgress: number;
|
|
8
|
+
sharedElapsedMs: number;
|
|
9
|
+
projectedSceneElapsedMs: number;
|
|
10
|
+
sharedTimelineDurationMs: number;
|
|
11
|
+
sceneTimelineDurationMs: number;
|
|
12
|
+
localProgress: number;
|
|
13
|
+
sceneOffset: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveDirection(sceneContext: SceneContextType): 'forward' | 'backward';
|
|
16
|
+
export declare function resolveElementElapsed(sceneContext: SceneContextType): number;
|
|
17
|
+
export declare function resolveRenderProgress(sceneContext: SceneContextType): number;
|
|
18
|
+
export declare function resolvePlaybackSnapshot(sceneContext: SceneContextType): DragSceneTransaction | PreparedSceneSnapshot | null;
|
|
19
|
+
export declare function resolveSceneTimelineDuration(sceneContext: SceneContextType): number;
|
|
20
|
+
export declare function resolveTransitionProgress(sceneContext: SceneContextType): number;
|
|
21
|
+
export declare function resolveSharedTimelineDuration(sceneContext: SceneContextType): number;
|
|
22
|
+
export declare function resolveEnterLocalProgress(sceneElapsedMs: number, calculatedDelay: number, enterDuration: number): number;
|
|
23
|
+
export declare function resolveVisualState(sceneContext: SceneContextType, calculatedDelay: number, enterDuration: number, exitDuration: number): DragVisualState;
|
|
24
|
+
export declare function resolvePlaybackVisualState(sceneContext: SceneContextType, calculatedDelay: number, enterDuration: number, exitDuration: number, excludedFromPlayback: boolean, variantsPending: boolean): DragVisualState;
|
|
25
|
+
export declare function resolvePropertyValue(state: DragVisualState, variants: SceneVariantRecords, property: AnimatableProperty): TransformValue;
|
|
26
|
+
export declare function resolveDragPropertyValue(state: DragVisualState | null, variants: SceneVariantRecords, property: AnimatableProperty): TransformValue;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Animate } from './Animate';
|
|
2
|
+
export { useAnimateTimeline } from './animateTimeline';
|
|
3
|
+
export { SceneContext } from './Animate';
|
|
4
|
+
export type { SceneAnimationRegistryContext, SceneBaseRuntimeContext, SceneContextType, SceneDragRuntimeContext, SceneScrollRuntimeBridgeContext, } from './Animate';
|
|
5
|
+
export type { AnimateInternalProps, NormalizedAnimateSemantics, NormalizedAnimateTimeline, NormalizedAnimateVisibility, } from './animateSemantics';
|
|
6
|
+
export type { AnimateRegistrationInfo } from '../../animations/registry';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { MotionValue } from 'framer-motion';
|
|
3
|
+
import { AnimatePhase, ParsedAnimationVariant } from '../../types';
|
|
4
|
+
import { SceneContextType } from './Animate';
|
|
5
|
+
interface UseAnimateArrivalParams {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
sceneContext: SceneContextType | null;
|
|
8
|
+
enterVariant: ParsedAnimationVariant | null;
|
|
9
|
+
hasAuthoredEnterAnimation: boolean;
|
|
10
|
+
parseReady: boolean;
|
|
11
|
+
delay: number;
|
|
12
|
+
enterDuration: number;
|
|
13
|
+
/** Manual enter trigger (see `AnimateProps.enterRef`). `delay` is this lane's
|
|
14
|
+
* fallback switch: with a delay authored the pass still self-starts after it,
|
|
15
|
+
* with none the element holds at its initial frame until the consumer calls.
|
|
16
|
+
* (`after` is ignored on this lane by design, so it is not a fallback here.) */
|
|
17
|
+
enterRef?: MutableRefObject<(() => void) | null>;
|
|
18
|
+
}
|
|
19
|
+
interface UseAnimateArrivalReturn {
|
|
20
|
+
style: Record<string, MotionValue<number> | MotionValue<string> | MotionValue<number | string>>;
|
|
21
|
+
visualMotion: MotionValue<number>;
|
|
22
|
+
phaseMotion: MotionValue<AnimatePhase>;
|
|
23
|
+
shouldRunInfinite: boolean;
|
|
24
|
+
/** Existing content revealed by the first-screen timeout must not tween stagger children. */
|
|
25
|
+
staticReveal: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* * Real-time post-arrival driver for drag + timeline driver 'clock'.
|
|
29
|
+
*
|
|
30
|
+
* It never reads drag progress and never registers with the Scene element track.
|
|
31
|
+
* The sole start signal is Scene.activationToken. A Scene departure resets the
|
|
32
|
+
* element; returning mints a new token and therefore replays exactly once.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useAnimateArrival({ enabled, sceneContext, enterVariant, hasAuthoredEnterAnimation, parseReady, delay, enterDuration, enterRef, }: UseAnimateArrivalParams): UseAnimateArrivalReturn;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MotionValue } from 'framer-motion';
|
|
2
|
+
import { ParsedAnimationVariant } from '../../types';
|
|
3
|
+
import { SceneContextType } from './Animate';
|
|
4
|
+
import { resolveEnterLocalProgress, DragVisualState } from './dragVisualState';
|
|
5
|
+
export { resolveEnterLocalProgress };
|
|
6
|
+
export type { DragVisualState };
|
|
7
|
+
interface UseAnimateDragParams {
|
|
8
|
+
sceneContext: SceneContextType | null;
|
|
9
|
+
enterVariant: ParsedAnimationVariant | null;
|
|
10
|
+
exitVariant: ParsedAnimationVariant | null;
|
|
11
|
+
componentId: string;
|
|
12
|
+
delay: number;
|
|
13
|
+
enterDuration: number;
|
|
14
|
+
exitDuration: number;
|
|
15
|
+
after?: string;
|
|
16
|
+
/** An enter/infinite animation was authored but its variants have not parsed
|
|
17
|
+
* yet (async preset import). Hold the initial frame instead of resolving to
|
|
18
|
+
* the rest frame, which would paint the element fully visible for a frame and
|
|
19
|
+
* then snap it back — the refresh flash. */
|
|
20
|
+
variantsPending?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface UseAnimateDragReturn {
|
|
23
|
+
style: Record<string, DragMotionValue>;
|
|
24
|
+
opacity: MotionValue<number>;
|
|
25
|
+
x: MotionValue<number | string>;
|
|
26
|
+
y: MotionValue<number | string>;
|
|
27
|
+
scale: MotionValue<number>;
|
|
28
|
+
rotate: MotionValue<number | string>;
|
|
29
|
+
useInteractiveStyles: boolean;
|
|
30
|
+
shouldRunInfinite: boolean;
|
|
31
|
+
visualState: MotionValue<DragVisualState | null>;
|
|
32
|
+
}
|
|
33
|
+
type DragMotionValue = MotionValue<number> | MotionValue<string> | MotionValue<number | string>;
|
|
34
|
+
export declare function useAnimateDrag({ sceneContext, enterVariant, exitVariant, componentId, delay, enterDuration, exitDuration, after, variantsPending, }: UseAnimateDragParams): UseAnimateDragReturn;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MotionValue } from 'framer-motion';
|
|
2
|
+
import { AnimatePhase, AnimateTimeline, ScrollMode } from '../../types';
|
|
3
|
+
import { SceneContextType } from './Animate';
|
|
4
|
+
import { DragVisualState } from './dragVisualState';
|
|
5
|
+
export interface UseAnimatePublicTimelineParams {
|
|
6
|
+
mode: ScrollMode;
|
|
7
|
+
isDragArrival: boolean;
|
|
8
|
+
timelineLane: AnimateTimeline['lane'];
|
|
9
|
+
sceneContext: SceneContextType | null;
|
|
10
|
+
arrivalVisualMotion: MotionValue<number>;
|
|
11
|
+
arrivalPhaseMotion: MotionValue<AnimatePhase>;
|
|
12
|
+
scrollVisualMotion: MotionValue<number>;
|
|
13
|
+
scrollPhaseMotion: MotionValue<AnimatePhase>;
|
|
14
|
+
dragVisualState: MotionValue<DragVisualState | null>;
|
|
15
|
+
}
|
|
16
|
+
export declare function useAnimatePublicTimeline({ mode, isDragArrival, timelineLane, sceneContext, arrivalVisualMotion, arrivalPhaseMotion, scrollVisualMotion, scrollPhaseMotion, dragVisualState, }: UseAnimatePublicTimelineParams): AnimateTimeline;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { MotionValue } from 'framer-motion';
|
|
3
|
+
import { ParsedAnimationVariant } from '../../types';
|
|
4
|
+
import { SceneContextType } from './Animate';
|
|
5
|
+
import { ResolvedAnimateTimeline, NormalizedAnimateVisibility } from './animateSemantics';
|
|
6
|
+
import { SceneScrollZoneRuntime } from '../Scene/sceneScrollRuntime';
|
|
7
|
+
interface UseAnimateScrollParams {
|
|
8
|
+
sceneContext: SceneContextType | null;
|
|
9
|
+
zoneRuntime: SceneScrollZoneRuntime | null;
|
|
10
|
+
zoneId: string | null;
|
|
11
|
+
enterVariant: ParsedAnimationVariant | null;
|
|
12
|
+
exitVariant: ParsedAnimationVariant | null;
|
|
13
|
+
hasAuthoredEnterAnimation?: boolean;
|
|
14
|
+
hasAuthoredExitAnimation?: boolean;
|
|
15
|
+
/** Whether this Animate has a parsed infinite variant to gate. Without one,
|
|
16
|
+
* the zone's visual subscription is the only per-frame consumer required. */
|
|
17
|
+
hasInfiniteAnimation?: boolean;
|
|
18
|
+
componentId: string;
|
|
19
|
+
duration: {
|
|
20
|
+
enter: number;
|
|
21
|
+
exit: number;
|
|
22
|
+
};
|
|
23
|
+
timeline: ResolvedAnimateTimeline;
|
|
24
|
+
visibility: NormalizedAnimateVisibility;
|
|
25
|
+
/** CineView-level default enter/exit gate margins (design px). Per-Animate
|
|
26
|
+
* visibility margins override these; both undefined → fall back to 50. */
|
|
27
|
+
globalEnterMargin?: number;
|
|
28
|
+
globalExitMargin?: number;
|
|
29
|
+
/** Manual enter/exit triggers (see `AnimateProps.enterRef` / `exitRef`).
|
|
30
|
+
* Honoured on the visibility lane only — the scroll-takeover lane's progress
|
|
31
|
+
* is a pure function of scrollTop and has no tween to trigger. */
|
|
32
|
+
enterRef?: MutableRefObject<(() => void) | null>;
|
|
33
|
+
exitRef?: MutableRefObject<(() => void) | null>;
|
|
34
|
+
/** An animation was authored but its variants have not parsed yet. The gate
|
|
35
|
+
* must not start an enter attempt against the empty variant records — it
|
|
36
|
+
* would tween through the DEFAULT frames and then swap mid-flight once the
|
|
37
|
+
* real ones land. Hold the initial frame until the parse settles. */
|
|
38
|
+
variantsPending?: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface UseAnimateScrollReturn {
|
|
41
|
+
style: Record<string, MotionValue<number> | MotionValue<string> | MotionValue<number | string>>;
|
|
42
|
+
shouldRunInfinite: boolean;
|
|
43
|
+
visualMotion: MotionValue<number>;
|
|
44
|
+
phaseMotion: MotionValue<GatePhase>;
|
|
45
|
+
}
|
|
46
|
+
export type GatePhase = 'idle' | 'waiting' | 'entering' | 'entered' | 'exiting' | 'exited';
|
|
47
|
+
export type GateAction = 'enter' | 'exit' | null;
|
|
48
|
+
/**
|
|
49
|
+
* Pure phase-transition decision for the visibility gate state machine.
|
|
50
|
+
*
|
|
51
|
+
* Enter and exit gates overlap in relTop ∈ [0, exitMargin] (both true). Without
|
|
52
|
+
* a mutex, reverse re-entry drives the element down through that band and the
|
|
53
|
+
* machine flips enter→exit→enter within one update batch — the exit snap to
|
|
54
|
+
* -epsilon flashes a near-animate frame ("element appears then replays from 0").
|
|
55
|
+
* The overlap band is therefore a hysteresis dead zone: when BOTH gates are
|
|
56
|
+
* true, hold the current phase (return null). Enter only fires strictly above
|
|
57
|
+
* the band (enterGate && !exitGate); exit only strictly below it
|
|
58
|
+
* (exitGate && !enterGate). Geometry (gate definitions) is unchanged — this only
|
|
59
|
+
* governs which transition the band resolves to.
|
|
60
|
+
*
|
|
61
|
+
* Returns the tween to launch, or null to hold the current phase.
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveGatePhaseAction(phase: GatePhase, enterGate: boolean, exitGate: boolean, opts: {
|
|
64
|
+
hasExplicitExit: boolean;
|
|
65
|
+
replay: boolean;
|
|
66
|
+
}): GateAction;
|
|
67
|
+
/**
|
|
68
|
+
* Pure decision for whether a visibility-driven element's loopAnimation
|
|
69
|
+
* should be running.
|
|
70
|
+
*
|
|
71
|
+
* The infinite (e.g. pulse) loop must only run while the element is BOTH in its
|
|
72
|
+
* entered phase AND currently intersecting the viewport. An element with no
|
|
73
|
+
* authored exitAnimation (hasExplicitExit === false) never exits — its phase
|
|
74
|
+
* stays 'entered' indefinitely even after it scrolls fully off-screen in either
|
|
75
|
+
* direction. Without an explicit on-screen check the infinite loop then keeps
|
|
76
|
+
* spinning off-screen forever (wasted work, and the element silently pulses
|
|
77
|
+
* where nobody can see it). Tying it to live viewport intersection pauses the
|
|
78
|
+
* loop the moment the element leaves the viewport in EITHER direction and
|
|
79
|
+
* resumes it on return.
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveInfiniteActive(phase: GatePhase, onScreen: boolean): boolean;
|
|
82
|
+
export declare function useAnimateScroll({ sceneContext, zoneRuntime, zoneId, enterVariant, exitVariant, hasAuthoredEnterAnimation, hasAuthoredExitAnimation, hasInfiniteAnimation, componentId, duration, timeline, visibility, globalEnterMargin, globalExitMargin, enterRef, exitRef, variantsPending, }: UseAnimateScrollParams): UseAnimateScrollReturn;
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MotionValue } from 'framer-motion';
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
3
|
+
import { AnimatableProperty, TransformValue } from './animateInterpolation';
|
|
4
|
+
/** Per-driver leaf resolution: (source value, variants, property) → raw value. */
|
|
5
|
+
export type PropertyValueResolver<T, V> = (input: T, variants: V, property: AnimatableProperty) => TransformValue;
|
|
6
|
+
export interface AnimatedPropertyLanes {
|
|
7
|
+
style: {
|
|
8
|
+
opacity: MotionValue<number>;
|
|
9
|
+
x: MotionValue<TransformValue>;
|
|
10
|
+
y: MotionValue<TransformValue>;
|
|
11
|
+
scale: MotionValue<number>;
|
|
12
|
+
rotate: MotionValue<TransformValue>;
|
|
13
|
+
rotateX: MotionValue<TransformValue>;
|
|
14
|
+
rotateY: MotionValue<TransformValue>;
|
|
15
|
+
skewX: MotionValue<TransformValue>;
|
|
16
|
+
skewY: MotionValue<TransformValue>;
|
|
17
|
+
filter: MotionValue<TransformValue>;
|
|
18
|
+
};
|
|
19
|
+
opacity: MotionValue<number>;
|
|
20
|
+
x: MotionValue<TransformValue>;
|
|
21
|
+
y: MotionValue<TransformValue>;
|
|
22
|
+
scale: MotionValue<number>;
|
|
23
|
+
rotate: MotionValue<TransformValue>;
|
|
24
|
+
rotateX: MotionValue<TransformValue>;
|
|
25
|
+
rotateY: MotionValue<TransformValue>;
|
|
26
|
+
skewX: MotionValue<TransformValue>;
|
|
27
|
+
skewY: MotionValue<TransformValue>;
|
|
28
|
+
filter: MotionValue<TransformValue>;
|
|
29
|
+
}
|
|
30
|
+
export declare function useAnimatedPropertyLanes<T, V>(source: MotionValue<T>, variantsRef: MutableRefObject<V>, resolveValue: PropertyValueResolver<T, V>, resolveNumericValue?: PropertyValueResolver<T, V>): AnimatedPropertyLanes;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface VisibilityRootMeasurement {
|
|
2
|
+
top: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
type VisibilitySubscriber = (measurement: VisibilityRootMeasurement) => void;
|
|
6
|
+
type VisibilityRoot = Window | HTMLElement;
|
|
7
|
+
export declare function subscribeVisibilityMeasurement(root: VisibilityRoot, subscriber: VisibilitySubscriber): () => void;
|
|
8
|
+
/** Queue one targeted visibility re-measurement on the next frame. Dependency
|
|
9
|
+
* completion and delay timers use this instead of launching a tween from a stale
|
|
10
|
+
* gate snapshot. Multiple wakeups for the same callback coalesce into one frame. */
|
|
11
|
+
export declare function scheduleVisibilityRecheck(ownerWindow: Window, callback: () => void): () => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AnimationType, CineViewRef, DragModeConfig, SceneProps, ScrollMode } from '../../types';
|
|
3
|
+
type SceneAuthoringCompatProps = SceneProps & {
|
|
4
|
+
mode?: ScrollMode;
|
|
5
|
+
slideDirection?: 'x' | 'y';
|
|
6
|
+
slideDuration?: number;
|
|
7
|
+
sceneTransitionDuration?: number;
|
|
8
|
+
enterAnimation?: AnimationType;
|
|
9
|
+
exitAnimation?: AnimationType;
|
|
10
|
+
exitDuration?: number;
|
|
11
|
+
sceneWidth?: number | string;
|
|
12
|
+
sceneHeight?: number | string;
|
|
13
|
+
sceneZIndex?: number;
|
|
14
|
+
sceneStackMode?: 'replace' | 'cover';
|
|
15
|
+
scrollEnterLength?: number;
|
|
16
|
+
scrollExitLength?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function resolveRootMode(mode: ScrollMode | undefined): ScrollMode;
|
|
19
|
+
export declare function resolveRootSceneStackMode(sceneProps: Pick<SceneAuthoringCompatProps, 'layout' | 'sceneStackMode'>, rootMode: ScrollMode): 'replace' | 'cover';
|
|
20
|
+
/**
|
|
21
|
+
* Drag engine root component. Exported so UMD can split into single-engine builds by mode
|
|
22
|
+
* (see task-flow `2026-08-04-umd-mode-split.md`: scroll engine accounts for 20.3% of UMD bundle;
|
|
23
|
+
* script-tag consumers using only drag shouldn't carry it).
|
|
24
|
+
* Not re-exported from barrel: public API remains only `CineView` + `mode` prop.
|
|
25
|
+
*/
|
|
26
|
+
export declare const CineViewDragEngine: React.ForwardRefExoticComponent<import('../..').CineViewBaseProps & DragModeConfig & {
|
|
27
|
+
mode?: "drag";
|
|
28
|
+
callbacks?: import('../..').DragModeCallbacks;
|
|
29
|
+
} & {
|
|
30
|
+
zoneTrigger?: undefined;
|
|
31
|
+
sceneSizing?: undefined;
|
|
32
|
+
enterMargin?: undefined;
|
|
33
|
+
exitMargin?: undefined;
|
|
34
|
+
debug?: undefined;
|
|
35
|
+
} & React.RefAttributes<CineViewRef>>;
|
|
36
|
+
export {};
|
|
37
|
+
/**
|
|
38
|
+
* ⚠️ Mode dispatcher is NOT in this file, see `CineViewDispatch.tsx`.
|
|
39
|
+
*
|
|
40
|
+
* Originally there was a 5-line dispatcher here that statically imported both engines, causing
|
|
41
|
+
* ANY path reaching this file to pull in BOTH engines. UMD must be single-file (Rollup refuses
|
|
42
|
+
* UMD code splitting), so script-tag consumers using only drag carried the scroll engine's
|
|
43
|
+
* gzip 10437 bytes (20.3% of total bundle), pushing the package over 50 KB.
|
|
44
|
+
* After moving the dispatcher out, this file contains only the drag engine, allowing
|
|
45
|
+
* `entry-drag.ts` to truly exclude scroll. Real-world lesson: merely adding entry files
|
|
46
|
+
* without moving the dispatcher resulted in a drag build of 51937 bytes (larger than full bundle).
|
|
47
|
+
* See task-flow `2026-08-04-umd-mode-split.md` for details.
|
|
48
|
+
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CineViewRef, CineViewScrollModeProps } from '../../types';
|
|
3
|
+
export declare const DirectScrollCineView: React.ForwardRefExoticComponent<Omit<CineViewScrollModeProps, "mode"> & {
|
|
4
|
+
mode?: "scroll";
|
|
5
|
+
} & React.RefAttributes<CineViewRef>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { default as React, MutableRefObject } from 'react';
|
|
2
|
+
import { MotionValue } from 'framer-motion';
|
|
3
|
+
import { DragModeConfig, ScrollMode } from '../../types';
|
|
4
|
+
import { DragRelease, DragReleaseInput, SceneManagerActions } from '../../hooks/useSceneManager';
|
|
5
|
+
import { DragRenderLane, DragTakeoverSnapshot, SceneActivationRecord } from '../Scene/types';
|
|
6
|
+
import { DragSceneTransaction, PreparedSceneInvalidation, PreparedSceneSnapshot } from '../Scene/dragPreparedState';
|
|
7
|
+
interface DragSceneStackProps {
|
|
8
|
+
scenes: React.ReactElement[];
|
|
9
|
+
visibleSceneIndices: Set<number>;
|
|
10
|
+
currentScene: number;
|
|
11
|
+
totalScenes: number;
|
|
12
|
+
mode: ScrollMode;
|
|
13
|
+
dragConfig?: DragModeConfig;
|
|
14
|
+
dragProgress: number;
|
|
15
|
+
dragTimelineProgress: number;
|
|
16
|
+
renderProgress: number;
|
|
17
|
+
renderProgressMotion: MotionValue<number>;
|
|
18
|
+
timelineProgressMotion: MotionValue<number>;
|
|
19
|
+
isDragging: boolean;
|
|
20
|
+
sharedTimelineDurationMs: number;
|
|
21
|
+
dragRelease: DragRelease | null;
|
|
22
|
+
sceneActivations: ReadonlyMap<number, SceneActivationRecord>;
|
|
23
|
+
firstSceneEnterActive: boolean;
|
|
24
|
+
firstSceneEnterReady: boolean;
|
|
25
|
+
direction: 'forward' | 'backward' | null;
|
|
26
|
+
isAnimating: boolean;
|
|
27
|
+
viewportWidth: number;
|
|
28
|
+
viewportHeight: number;
|
|
29
|
+
sceneActions: SceneManagerActions;
|
|
30
|
+
sceneWrapperRefs: MutableRefObject<Array<HTMLDivElement | null>>;
|
|
31
|
+
/** CineView-owned shared render-lane slot (D-F1); stable ref. */
|
|
32
|
+
renderLaneRef: MutableRefObject<DragRenderLane | null>;
|
|
33
|
+
/** Synchronous baseline shared by the render and element lanes during takeover. */
|
|
34
|
+
takeoverSnapshot: MutableRefObject<DragTakeoverSnapshot | null>;
|
|
35
|
+
candidateSuspended: boolean;
|
|
36
|
+
onCandidateSuspensionChange: (suspended: boolean) => boolean;
|
|
37
|
+
onElementContinuationChange: (sceneIndex: number, active: boolean) => void;
|
|
38
|
+
onPointerSessionStart: () => void;
|
|
39
|
+
dragTransaction: DragSceneTransaction | null;
|
|
40
|
+
onPrepared: (snapshot: PreparedSceneSnapshot) => void;
|
|
41
|
+
onPreparedInvalidated: (invalidation: PreparedSceneInvalidation) => void;
|
|
42
|
+
onOwnershipRequest: (direction: 'forward' | 'backward') => boolean;
|
|
43
|
+
onSceneChange: (direction: 'forward' | 'backward', progressRatio?: number, committedElapsedMs?: number, timelineDuration?: number) => void;
|
|
44
|
+
onDragProgressChange: (progress: number) => void;
|
|
45
|
+
onRenderProgressChange?: (progress: number) => void;
|
|
46
|
+
onDragTimelineProgressChange: (progress: number) => void;
|
|
47
|
+
onDraggingChange: (dragging: boolean) => void;
|
|
48
|
+
onSharedTimelineDurationChange: (duration: number) => void;
|
|
49
|
+
onDragRelease: (release: DragReleaseInput | null) => void;
|
|
50
|
+
onDragReset: () => void;
|
|
51
|
+
onTransactionComplete: (transactionId: symbol) => void;
|
|
52
|
+
onFirstSceneEnterComplete: () => void;
|
|
53
|
+
}
|
|
54
|
+
export declare function DragSceneStack({ scenes, visibleSceneIndices, currentScene, totalScenes, mode, dragConfig, dragProgress, dragTimelineProgress, renderProgress, renderProgressMotion, timelineProgressMotion, isDragging, sharedTimelineDurationMs, dragRelease, sceneActivations, firstSceneEnterActive, firstSceneEnterReady, direction, isAnimating, viewportWidth, viewportHeight, sceneActions, sceneWrapperRefs, renderLaneRef, takeoverSnapshot, candidateSuspended, onCandidateSuspensionChange, onElementContinuationChange, onPointerSessionStart, dragTransaction, onPrepared, onPreparedInvalidated, onOwnershipRequest, onSceneChange, onDragProgressChange, onRenderProgressChange, onDragTimelineProgressChange, onDraggingChange, onSharedTimelineDurationChange, onDragRelease, onDragReset, onTransactionComplete, onFirstSceneEnterComplete, }: DragSceneStackProps): React.ReactElement;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { buildSceneTimelineState, SceneAuthoringCompatProps, SceneLayoutInfo, ScrollInputDirection } from './directScrollHelpers';
|
|
3
|
+
import { ScrollModeConfig } from '../../types';
|
|
4
|
+
import { GroupedCallbacks } from './regroupCallbacks';
|
|
5
|
+
import { SceneScrollTimelineState } from '../Scene/sceneScrollRuntime';
|
|
6
|
+
import { KeyedScrollExternalStore } from '../runtime/scrollExternalStore';
|
|
7
|
+
import { ScrollSceneFrameStore } from '../runtime/scrollSceneFrameStore';
|
|
8
|
+
export interface ScrollSceneRenderSnapshot {
|
|
9
|
+
sceneLayout: SceneLayoutInfo | null;
|
|
10
|
+
sceneZoneState: SceneScrollTimelineState | null;
|
|
11
|
+
sceneTimelineState: ReturnType<typeof buildSceneTimelineState> | null;
|
|
12
|
+
isCurrent: boolean;
|
|
13
|
+
isBackdropActive: boolean;
|
|
14
|
+
visualViewportOffset: number;
|
|
15
|
+
isScrolling: boolean;
|
|
16
|
+
scrollDirection: ScrollInputDirection | null;
|
|
17
|
+
activeSceneIndex: number;
|
|
18
|
+
viewportWidth: number;
|
|
19
|
+
viewportHeight: number;
|
|
20
|
+
firstSceneEnterGateKnown: boolean;
|
|
21
|
+
firstSceneEnterActive: boolean;
|
|
22
|
+
firstSceneEnterReady: boolean;
|
|
23
|
+
direction: 'x' | 'y';
|
|
24
|
+
sceneCount: number;
|
|
25
|
+
sceneSizing: ScrollModeConfig['sceneSizing'];
|
|
26
|
+
exposeTakeoverDebugData: boolean;
|
|
27
|
+
takeoverSceneSpan: number | null;
|
|
28
|
+
}
|
|
29
|
+
export declare const EMPTY_SCROLL_SCENE_SNAPSHOT: ScrollSceneRenderSnapshot;
|
|
30
|
+
export type ScrollSceneSnapshotList = readonly (ScrollSceneRenderSnapshot | undefined)[];
|
|
31
|
+
export type ScrollSceneSnapshotStore = KeyedScrollExternalStore<ScrollSceneSnapshotList, number, ScrollSceneRenderSnapshot>;
|
|
32
|
+
interface ScrollSceneSlotProps {
|
|
33
|
+
child: React.ReactElement<SceneAuthoringCompatProps>;
|
|
34
|
+
store: ScrollSceneSnapshotStore;
|
|
35
|
+
frameStore?: ScrollSceneFrameStore;
|
|
36
|
+
sceneIndex: number;
|
|
37
|
+
setWrapperRef: (sceneIndex: number, node: HTMLDivElement | null) => void;
|
|
38
|
+
scrollCallbacks?: GroupedCallbacks['scroll'];
|
|
39
|
+
}
|
|
40
|
+
export declare function areScrollSceneRenderSnapshotsEqual(previous: ScrollSceneRenderSnapshot, next: ScrollSceneRenderSnapshot): boolean;
|
|
41
|
+
export declare const ScrollSceneSlot: React.NamedExoticComponent<ScrollSceneSlotProps>;
|
|
42
|
+
export {};
|