@flight-framework/transitions 0.1.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/README.md +232 -0
- package/dist/adapters/react/index.d.ts +210 -0
- package/dist/adapters/react/index.js +261 -0
- package/dist/adapters/react/index.js.map +1 -0
- package/dist/adapters/solid/index.d.ts +5 -0
- package/dist/adapters/solid/index.js +9 -0
- package/dist/adapters/solid/index.js.map +1 -0
- package/dist/adapters/svelte/index.d.ts +5 -0
- package/dist/adapters/svelte/index.js +9 -0
- package/dist/adapters/svelte/index.js.map +1 -0
- package/dist/adapters/vue/index.d.ts +5 -0
- package/dist/adapters/vue/index.js +9 -0
- package/dist/adapters/vue/index.js.map +1 -0
- package/dist/chunk-4SF4GHDQ.js +252 -0
- package/dist/chunk-4SF4GHDQ.js.map +1 -0
- package/dist/chunk-7R3FXL3A.js +442 -0
- package/dist/chunk-7R3FXL3A.js.map +1 -0
- package/dist/chunk-BAILQEFB.js +136 -0
- package/dist/chunk-BAILQEFB.js.map +1 -0
- package/dist/chunk-ITLC6KJ4.js +138 -0
- package/dist/chunk-ITLC6KJ4.js.map +1 -0
- package/dist/chunk-JRRJMJDL.js +121 -0
- package/dist/chunk-JRRJMJDL.js.map +1 -0
- package/dist/chunk-UZUZC3MA.js +190 -0
- package/dist/chunk-UZUZC3MA.js.map +1 -0
- package/dist/chunk-W7HSR35B.js +3 -0
- package/dist/chunk-W7HSR35B.js.map +1 -0
- package/dist/chunk-WDXXYC7B.js +70 -0
- package/dist/chunk-WDXXYC7B.js.map +1 -0
- package/dist/chunk-XLVYHPII.js +3 -0
- package/dist/chunk-XLVYHPII.js.map +1 -0
- package/dist/chunk-ZBJ6FSAK.js +438 -0
- package/dist/chunk-ZBJ6FSAK.js.map +1 -0
- package/dist/component/index.d.ts +87 -0
- package/dist/component/index.js +5 -0
- package/dist/component/index.js.map +1 -0
- package/dist/config/index.d.ts +93 -0
- package/dist/config/index.js +5 -0
- package/dist/config/index.js.map +1 -0
- package/dist/core/index.d.ts +107 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +112 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/page/index.d.ts +87 -0
- package/dist/page/index.js +7 -0
- package/dist/page/index.js.map +1 -0
- package/dist/presets/index.d.ts +192 -0
- package/dist/presets/index.js +3 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/router/index.d.ts +104 -0
- package/dist/router/index.js +7 -0
- package/dist/router/index.js.map +1 -0
- package/dist/transition-manager-CuO0S_Yn.d.ts +62 -0
- package/dist/types-BT3SCjiY.d.ts +272 -0
- package/dist/view-transition-Hp-Q9vWJ.d.ts +97 -0
- package/package.json +110 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { T as TransitionPreset, C as CustomTransition } from '../types-BT3SCjiY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @flight-framework/transitions - Component Transitions
|
|
5
|
+
*
|
|
6
|
+
* Component-level transitions for enter/leave animations.
|
|
7
|
+
* Framework-agnostic primitives that adapters build upon.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates a presence controller for managing enter/exit animations
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const presence = createPresence(element, {
|
|
16
|
+
* type: 'fade',
|
|
17
|
+
* onComplete: () => element.remove(),
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // Show
|
|
21
|
+
* await presence.enter();
|
|
22
|
+
*
|
|
23
|
+
* // Hide
|
|
24
|
+
* await presence.exit();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function createPresence(element: HTMLElement, options?: PresenceOptions): PresenceController;
|
|
28
|
+
interface PresenceOptions {
|
|
29
|
+
type?: TransitionPreset | CustomTransition;
|
|
30
|
+
duration?: number;
|
|
31
|
+
appear?: boolean;
|
|
32
|
+
onEnterStart?: () => void;
|
|
33
|
+
onEnterComplete?: () => void;
|
|
34
|
+
onExitStart?: () => void;
|
|
35
|
+
onExitComplete?: () => void;
|
|
36
|
+
}
|
|
37
|
+
interface PresenceController {
|
|
38
|
+
readonly isPresent: boolean;
|
|
39
|
+
enter(): Promise<void>;
|
|
40
|
+
exit(): Promise<void>;
|
|
41
|
+
cancel(): void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates a transition group controller for list animations
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const group = createTransitionGroup(containerElement, {
|
|
49
|
+
* type: 'fade',
|
|
50
|
+
* stagger: 50,
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
53
|
+
* // Animate items entering
|
|
54
|
+
* group.addItems([item1, item2, item3]);
|
|
55
|
+
*
|
|
56
|
+
* // Animate items leaving
|
|
57
|
+
* group.removeItems([item2]);
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function createTransitionGroup(container: HTMLElement, options?: TransitionGroupOptions): TransitionGroupController;
|
|
61
|
+
interface TransitionGroupOptions {
|
|
62
|
+
type?: TransitionPreset | CustomTransition;
|
|
63
|
+
stagger?: number;
|
|
64
|
+
appear?: boolean;
|
|
65
|
+
}
|
|
66
|
+
interface TransitionGroupController {
|
|
67
|
+
readonly items: HTMLElement[];
|
|
68
|
+
addItems(items: HTMLElement[]): Promise<void>;
|
|
69
|
+
removeItems(items: HTMLElement[]): Promise<void>;
|
|
70
|
+
reorderItems(newOrder: HTMLElement[], animate?: boolean): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Simple visibility toggle with transition
|
|
74
|
+
*/
|
|
75
|
+
declare function toggleVisibility(element: HTMLElement, show: boolean, options?: {
|
|
76
|
+
type?: TransitionPreset | CustomTransition;
|
|
77
|
+
duration?: number;
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Transition between two elements (one out, one in)
|
|
81
|
+
*/
|
|
82
|
+
declare function crossfade(outElement: HTMLElement, inElement: HTMLElement, options?: {
|
|
83
|
+
type?: TransitionPreset | CustomTransition;
|
|
84
|
+
mode?: 'in-out' | 'out-in' | 'simultaneous';
|
|
85
|
+
}): Promise<void>;
|
|
86
|
+
|
|
87
|
+
export { type PresenceController, type PresenceOptions, type TransitionGroupController, type TransitionGroupOptions, createPresence, createTransitionGroup, crossfade, toggleVisibility };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { i as TransitionsConfig, T as TransitionPreset, C as CustomTransition } from '../types-BT3SCjiY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @flight-framework/transitions - Configuration Module
|
|
5
|
+
*
|
|
6
|
+
* Configuration helpers and defaults for the transitions system.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Default transitions configuration
|
|
11
|
+
*/
|
|
12
|
+
declare const defaultConfig: TransitionsConfig;
|
|
13
|
+
/**
|
|
14
|
+
* Define transitions configuration
|
|
15
|
+
*
|
|
16
|
+
* Use this in flight.config.ts to configure transitions globally.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // flight.config.ts
|
|
21
|
+
* import { defineConfig } from '@flight-framework/core';
|
|
22
|
+
* import { defineTransitionsConfig } from '@flight-framework/transitions/config';
|
|
23
|
+
*
|
|
24
|
+
* export default defineConfig({
|
|
25
|
+
* transitions: defineTransitionsConfig({
|
|
26
|
+
* pageTransition: 'slide-left',
|
|
27
|
+
* duration: 300,
|
|
28
|
+
* }),
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare function defineTransitionsConfig(config: Partial<TransitionsConfig>): TransitionsConfig;
|
|
33
|
+
/**
|
|
34
|
+
* Initialize the transitions system with configuration
|
|
35
|
+
*
|
|
36
|
+
* Call this during app initialization to set up transitions.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* import { initializeTransitions } from '@flight-framework/transitions/config';
|
|
41
|
+
*
|
|
42
|
+
* initializeTransitions({
|
|
43
|
+
* pageTransition: 'fade',
|
|
44
|
+
* reduceMotion: 'respect-system',
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
declare function initializeTransitions(config?: Partial<TransitionsConfig>): void;
|
|
49
|
+
/**
|
|
50
|
+
* Update transitions configuration at runtime
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // Disable transitions
|
|
55
|
+
* updateTransitionsConfig({ enabled: false });
|
|
56
|
+
*
|
|
57
|
+
* // Change default transition
|
|
58
|
+
* updateTransitionsConfig({ pageTransition: 'slide-left' });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare function updateTransitionsConfig(config: Partial<TransitionsConfig>): void;
|
|
62
|
+
/**
|
|
63
|
+
* Get the current transitions configuration
|
|
64
|
+
*/
|
|
65
|
+
declare function getTransitionsConfig(): TransitionsConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Check if a value is a valid transition preset name
|
|
68
|
+
*/
|
|
69
|
+
declare function isTransitionPreset(value: unknown): value is TransitionPreset;
|
|
70
|
+
/**
|
|
71
|
+
* Check if a value is a custom transition definition
|
|
72
|
+
*/
|
|
73
|
+
declare function isCustomTransition(value: unknown): value is CustomTransition;
|
|
74
|
+
/**
|
|
75
|
+
* Check if the current environment supports transitions
|
|
76
|
+
*/
|
|
77
|
+
declare function isTransitionsSupported(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get browser capability information
|
|
80
|
+
*/
|
|
81
|
+
declare function getCapabilities(): TransitionCapabilities;
|
|
82
|
+
interface TransitionCapabilities {
|
|
83
|
+
/** Browser supports View Transitions API */
|
|
84
|
+
viewTransitionsApi: boolean;
|
|
85
|
+
/** Browser supports Web Animations API */
|
|
86
|
+
webAnimationsApi: boolean;
|
|
87
|
+
/** Browser supports CSS view-transition-name */
|
|
88
|
+
cssViewTransitions: boolean;
|
|
89
|
+
/** User prefers reduced motion */
|
|
90
|
+
reducedMotion: boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { type TransitionCapabilities, defaultConfig, defineTransitionsConfig, getCapabilities, getTransitionsConfig, initializeTransitions, isCustomTransition, isTransitionPreset, isTransitionsSupported, updateTransitionsConfig };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { defaultConfig, defineTransitionsConfig, getCapabilities, getTransitionsConfig, initializeTransitions, isCustomTransition, isTransitionPreset, isTransitionsSupported, updateTransitionsConfig } from '../chunk-WDXXYC7B.js';
|
|
2
|
+
import '../chunk-7R3FXL3A.js';
|
|
3
|
+
import '../chunk-4SF4GHDQ.js';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { d as TransitionKeyframe, F as FillMode, R as ResolvedTransition, T as TransitionPreset, C as CustomTransition } from '../types-BT3SCjiY.js';
|
|
2
|
+
export { A as AnimatableProperty, L as LayoutTransitionConfig, m as LinkWithTransitionProps, N as NavigateWithTransitionOptions, P as PageTransitionConfig, e as ReduceMotionBehavior, S as SharedElementConfig, f as TransitionContext, c as TransitionDirection, h as TransitionGroupProps, l as TransitionInput, k as TransitionListener, g as TransitionProps, j as TransitionState, i as TransitionsConfig, V as ViewTransition, a as ViewTransitionOptions, b as ViewTransitionResult } from '../types-BT3SCjiY.js';
|
|
3
|
+
export { C as CrossDocumentTransitionOptions, e as enableCrossDocumentTransitions, a as isCrossDocumentTransitionSupported, i as isViewTransitionSupported, s as startViewTransition } from '../view-transition-Hp-Q9vWJ.js';
|
|
4
|
+
export { T as TransitionManager, c as createTransitionManager, g as getTransitionManager, i as initTransitions } from '../transition-manager-CuO0S_Yn.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @flight-framework/transitions - Animation Engine
|
|
8
|
+
*
|
|
9
|
+
* Low-level animation primitives using the Web Animations API.
|
|
10
|
+
* Provides performant, interruptible animations with proper cleanup.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** Default animation duration in milliseconds */
|
|
14
|
+
declare const DEFAULT_DURATION = 200;
|
|
15
|
+
/** Default easing function */
|
|
16
|
+
declare const DEFAULT_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
17
|
+
/** Reduced motion duration (near-instant) */
|
|
18
|
+
declare const REDUCED_MOTION_DURATION = 1;
|
|
19
|
+
/**
|
|
20
|
+
* Options for creating an animation
|
|
21
|
+
*/
|
|
22
|
+
interface AnimationOptions {
|
|
23
|
+
/** Animation duration in milliseconds */
|
|
24
|
+
duration?: number;
|
|
25
|
+
/** CSS easing function */
|
|
26
|
+
easing?: string;
|
|
27
|
+
/** Delay before animation starts */
|
|
28
|
+
delay?: number;
|
|
29
|
+
/** Animation fill mode */
|
|
30
|
+
fill?: FillMode;
|
|
31
|
+
/** Callback when animation starts */
|
|
32
|
+
onStart?: () => void;
|
|
33
|
+
/** Callback when animation completes */
|
|
34
|
+
onComplete?: () => void;
|
|
35
|
+
/** Callback when animation is cancelled */
|
|
36
|
+
onCancel?: () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Result from creating an animation
|
|
40
|
+
*/
|
|
41
|
+
interface AnimationHandle {
|
|
42
|
+
/** The underlying Animation object */
|
|
43
|
+
animation: Animation;
|
|
44
|
+
/** Promise that resolves when animation finishes */
|
|
45
|
+
finished: Promise<void>;
|
|
46
|
+
/** Cancel the animation */
|
|
47
|
+
cancel(): void;
|
|
48
|
+
/** Pause the animation */
|
|
49
|
+
pause(): void;
|
|
50
|
+
/** Resume a paused animation */
|
|
51
|
+
resume(): void;
|
|
52
|
+
/** Reverse the animation direction */
|
|
53
|
+
reverse(): void;
|
|
54
|
+
/** Set the current time (0-1 normalized) */
|
|
55
|
+
seek(progress: number): void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Animate an element with keyframes
|
|
59
|
+
*
|
|
60
|
+
* Uses the Web Animations API for smooth, performant animations.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const handle = animate(element, {
|
|
65
|
+
* from: { opacity: '1', transform: 'scale(1)' },
|
|
66
|
+
* to: { opacity: '0', transform: 'scale(0.95)' }
|
|
67
|
+
* }, { duration: 200 });
|
|
68
|
+
*
|
|
69
|
+
* await handle.finished;
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
declare function animate(element: Element, keyframe: TransitionKeyframe, options?: AnimationOptions): AnimationHandle;
|
|
73
|
+
/**
|
|
74
|
+
* Animate an element out (leaving)
|
|
75
|
+
*/
|
|
76
|
+
declare function animateOut(element: Element, transition: ResolvedTransition, options?: Omit<AnimationOptions, 'duration' | 'easing'>): AnimationHandle;
|
|
77
|
+
/**
|
|
78
|
+
* Animate an element in (entering)
|
|
79
|
+
*/
|
|
80
|
+
declare function animateIn(element: Element, transition: ResolvedTransition, options?: Omit<AnimationOptions, 'duration' | 'easing'>): AnimationHandle;
|
|
81
|
+
/**
|
|
82
|
+
* Resolve a preset name or custom transition to a normalized format
|
|
83
|
+
*/
|
|
84
|
+
declare function resolveTransition(input: TransitionPreset | CustomTransition | false, reducedMotion?: boolean): ResolvedTransition | null;
|
|
85
|
+
/**
|
|
86
|
+
* Check if user prefers reduced motion
|
|
87
|
+
*/
|
|
88
|
+
declare function prefersReducedMotion(): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Subscribe to reduced motion preference changes
|
|
91
|
+
*/
|
|
92
|
+
declare function onReducedMotionChange(callback: (prefersReduced: boolean) => void): () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Cancel all running animations on an element
|
|
95
|
+
*/
|
|
96
|
+
declare function cancelAnimations(element: Element): void;
|
|
97
|
+
/**
|
|
98
|
+
* Wait for all animations on an element to complete
|
|
99
|
+
*/
|
|
100
|
+
declare function waitForAnimations(element: Element): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* FLIP animation helper (First, Last, Invert, Play)
|
|
103
|
+
* Useful for shared element transitions
|
|
104
|
+
*/
|
|
105
|
+
declare function flip(element: HTMLElement, callback: () => void | Promise<void>, options?: AnimationOptions): AnimationHandle;
|
|
106
|
+
|
|
107
|
+
export { type AnimationHandle, type AnimationOptions, CustomTransition, DEFAULT_DURATION, DEFAULT_EASING, FillMode, REDUCED_MOTION_DURATION, ResolvedTransition, TransitionKeyframe, TransitionPreset, animate, animateIn, animateOut, cancelAnimations, flip, onReducedMotionChange, prefersReducedMotion, resolveTransition, waitForAnimations };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import '../chunk-W7HSR35B.js';
|
|
2
|
+
export { createTransitionManager, enableCrossDocumentTransitions, getTransitionManager, initTransitions, isCrossDocumentTransitionSupported, isViewTransitionSupported, startViewTransition } from '../chunk-7R3FXL3A.js';
|
|
3
|
+
export { DEFAULT_DURATION, DEFAULT_EASING, REDUCED_MOTION_DURATION, animate, animateIn, animateOut, cancelAnimations, flip, onReducedMotionChange, prefersReducedMotion, resolveTransition, waitForAnimations } from '../chunk-4SF4GHDQ.js';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { C as CustomTransition, L as LayoutTransitionConfig, P as PageTransitionConfig, e as ReduceMotionBehavior, R as ResolvedTransition, S as SharedElementConfig, f as TransitionContext, c as TransitionDirection, h as TransitionGroupProps, d as TransitionKeyframe, k as TransitionListener, T as TransitionPreset, g as TransitionProps, j as TransitionState, i as TransitionsConfig, V as ViewTransition, a as ViewTransitionOptions, b as ViewTransitionResult } from './types-BT3SCjiY.js';
|
|
2
|
+
export { e as enableCrossDocumentTransitions, a as isCrossDocumentTransitionSupported, i as isViewTransitionSupported, s as startViewTransition } from './view-transition-Hp-Q9vWJ.js';
|
|
3
|
+
export { DEFAULT_DURATION, DEFAULT_EASING, animate, animateIn, animateOut, cancelAnimations, flip, onReducedMotionChange, prefersReducedMotion, resolveTransition, waitForAnimations } from './core/index.js';
|
|
4
|
+
export { c as createTransitionManager, g as getTransitionManager, i as initTransitions } from './transition-manager-CuO0S_Yn.js';
|
|
5
|
+
export { definePageTransition, executePageTransition, getPageTransition, onAfterPageEnter, onAfterPageLeave, onBeforePageEnter, onBeforePageLeave } from './page/index.js';
|
|
6
|
+
export { animateSharedElement, autoRegisterSharedElements, defineLayoutTransition, getSharedElement, registerSharedElement, setupSharedElementObserver, unregisterSharedElement } from './layout/index.js';
|
|
7
|
+
export { createPresence, createTransitionGroup, crossfade, toggleVisibility } from './component/index.js';
|
|
8
|
+
export { circleReveal, expand, fade, fadeBlur, fadeFast, fadeScale, fadeSlow, flipX, flipY, getPreset, getPresetNames, isPresetName, morph, none, pop, presetMap, rotate, scale, scaleDown, scaleFade, scaleUp, slideDown, slideFade, slideLeft, slideRight, slideScale, slideUp, wipeLeft, wipeUp } from './presets/index.js';
|
|
9
|
+
export { defaultConfig, defineTransitionsConfig, getCapabilities, getTransitionsConfig, initializeTransitions, isTransitionsSupported, updateTransitionsConfig } from './config/index.js';
|
|
10
|
+
export { navigateWithTransition, prefetchRoute, registerRouteTransitions, setupHistoryTransitions } from './router/index.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { navigateWithTransition, prefetchRoute, registerRouteTransitions, setupHistoryTransitions } from './chunk-JRRJMJDL.js';
|
|
2
|
+
export { defaultConfig, defineTransitionsConfig, getCapabilities, getTransitionsConfig, initializeTransitions, isTransitionsSupported, updateTransitionsConfig } from './chunk-WDXXYC7B.js';
|
|
3
|
+
export { createPresence, createTransitionGroup, crossfade, toggleVisibility } from './chunk-UZUZC3MA.js';
|
|
4
|
+
import './chunk-XLVYHPII.js';
|
|
5
|
+
export { definePageTransition, executePageTransition, getPageTransition, onAfterPageEnter, onAfterPageLeave, onBeforePageEnter, onBeforePageLeave } from './chunk-ITLC6KJ4.js';
|
|
6
|
+
export { animateSharedElement, autoRegisterSharedElements, defineLayoutTransition, getSharedElement, registerSharedElement, setupSharedElementObserver, unregisterSharedElement } from './chunk-BAILQEFB.js';
|
|
7
|
+
export { circleReveal, expand, fade, fadeBlur, fadeFast, fadeScale, fadeSlow, flipX, flipY, getPreset, getPresetNames, isPresetName, morph, none, pop, presetMap, rotate, scale, scaleDown, scaleFade, scaleUp, slideDown, slideFade, slideLeft, slideRight, slideScale, slideUp, wipeLeft, wipeUp } from './chunk-ZBJ6FSAK.js';
|
|
8
|
+
export { createTransitionManager, enableCrossDocumentTransitions, getTransitionManager, initTransitions, isCrossDocumentTransitionSupported, isViewTransitionSupported, startViewTransition } from './chunk-7R3FXL3A.js';
|
|
9
|
+
export { DEFAULT_DURATION, DEFAULT_EASING, animate, animateIn, animateOut, cancelAnimations, flip, onReducedMotionChange, prefersReducedMotion, resolveTransition, waitForAnimations } from './chunk-4SF4GHDQ.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { L as LayoutTransitionConfig } from '../types-BT3SCjiY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @flight-framework/transitions - Layout Transitions
|
|
5
|
+
*
|
|
6
|
+
* Layout-level transitions for persistent UI elements across navigations.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Define transition configuration for a layout
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // In a layout component
|
|
15
|
+
* defineLayoutTransition({
|
|
16
|
+
* default: 'fade',
|
|
17
|
+
* persist: true, // Layout persists during page transitions
|
|
18
|
+
* sharedElements: [
|
|
19
|
+
* { name: 'header', animation: 'none' },
|
|
20
|
+
* { name: 'sidebar', animation: 'none' },
|
|
21
|
+
* ],
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function defineLayoutTransition(layoutId: string, config: LayoutTransitionConfig): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get the transition configuration for a layout
|
|
28
|
+
*/
|
|
29
|
+
declare function getLayoutTransition(layoutId: string): LayoutTransitionConfig | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Clear all layout transition configurations
|
|
32
|
+
*/
|
|
33
|
+
declare function clearLayoutTransitions(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Register a shared element for transition
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // Register an element
|
|
40
|
+
* registerSharedElement('hero-image', document.getElementById('hero'));
|
|
41
|
+
*
|
|
42
|
+
* // On navigation, elements with matching names will animate between positions
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare function registerSharedElement(name: string, element: HTMLElement): void;
|
|
46
|
+
/**
|
|
47
|
+
* Unregister a shared element
|
|
48
|
+
*/
|
|
49
|
+
declare function unregisterSharedElement(name: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Get a registered shared element
|
|
52
|
+
*/
|
|
53
|
+
declare function getSharedElement(name: string): HTMLElement | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Clear all shared elements
|
|
56
|
+
*/
|
|
57
|
+
declare function clearSharedElements(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get all registered shared element names
|
|
60
|
+
*/
|
|
61
|
+
declare function getSharedElementNames(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Options for shared element transition
|
|
64
|
+
*/
|
|
65
|
+
interface SharedElementTransitionOptions {
|
|
66
|
+
/** Name of the shared element */
|
|
67
|
+
name: string;
|
|
68
|
+
/** Duration of the animation */
|
|
69
|
+
duration?: number;
|
|
70
|
+
/** Easing function */
|
|
71
|
+
easing?: string;
|
|
72
|
+
/** Callback when animation completes */
|
|
73
|
+
onComplete?: () => void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Animate a shared element between two states using FLIP
|
|
77
|
+
*
|
|
78
|
+
* This manually implements shared element transitions for browsers
|
|
79
|
+
* that don't support the View Transitions API.
|
|
80
|
+
*/
|
|
81
|
+
declare function animateSharedElement(options: SharedElementTransitionOptions): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Mark a layout as persistent (it won't transition)
|
|
84
|
+
*/
|
|
85
|
+
declare function markLayoutPersistent(layoutId: string): void;
|
|
86
|
+
/**
|
|
87
|
+
* Check if a layout is persistent
|
|
88
|
+
*/
|
|
89
|
+
declare function isLayoutPersistent(layoutId: string): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Clear persistent layout tracking
|
|
92
|
+
*/
|
|
93
|
+
declare function clearPersistentLayouts(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Execute a layout transition
|
|
96
|
+
*
|
|
97
|
+
* Unlike page transitions, layout transitions are more subtle and
|
|
98
|
+
* typically involve animating specific sections while preserving others.
|
|
99
|
+
*/
|
|
100
|
+
declare function executeLayoutTransition(fromLayoutId: string | null, toLayoutId: string, updateDOM: () => void | Promise<void>): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Automatically find and register shared elements based on data attributes
|
|
103
|
+
*
|
|
104
|
+
* Elements with `data-transition-name` or `transition:name` will be registered.
|
|
105
|
+
*/
|
|
106
|
+
declare function autoRegisterSharedElements(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Set up a MutationObserver to auto-register shared elements
|
|
109
|
+
*/
|
|
110
|
+
declare function setupSharedElementObserver(): () => void;
|
|
111
|
+
|
|
112
|
+
export { type SharedElementTransitionOptions, animateSharedElement, autoRegisterSharedElements, clearLayoutTransitions, clearPersistentLayouts, clearSharedElements, defineLayoutTransition, executeLayoutTransition, getLayoutTransition, getSharedElement, getSharedElementNames, isLayoutPersistent, markLayoutPersistent, registerSharedElement, setupSharedElementObserver, unregisterSharedElement };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { animateSharedElement, autoRegisterSharedElements, clearLayoutTransitions, clearPersistentLayouts, clearSharedElements, defineLayoutTransition, executeLayoutTransition, getLayoutTransition, getSharedElement, getSharedElementNames, isLayoutPersistent, markLayoutPersistent, registerSharedElement, setupSharedElementObserver, unregisterSharedElement } from '../chunk-BAILQEFB.js';
|
|
2
|
+
import '../chunk-4SF4GHDQ.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { P as PageTransitionConfig, T as TransitionPreset, C as CustomTransition, c as TransitionDirection, f as TransitionContext } from '../types-BT3SCjiY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @flight-framework/transitions - Page Transitions
|
|
5
|
+
*
|
|
6
|
+
* Page-level transition management for route navigation.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Define transition configuration for the current page
|
|
11
|
+
* Similar to Nuxt's definePageMeta but for transitions only
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // In a page component
|
|
16
|
+
* definePageTransition({
|
|
17
|
+
* default: 'slide-left',
|
|
18
|
+
* backTransition: 'slide-right',
|
|
19
|
+
* duration: 250,
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* export default function DashboardPage() {
|
|
23
|
+
* return <div>Dashboard</div>;
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare function definePageTransition(config: PageTransitionConfig): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get the transition configuration for a specific page
|
|
30
|
+
*/
|
|
31
|
+
declare function getPageTransition(path: string): PageTransitionConfig | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Clear all page transition configurations
|
|
34
|
+
* Useful for testing or hot module replacement
|
|
35
|
+
*/
|
|
36
|
+
declare function clearPageTransitions(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Options for executing a page transition
|
|
39
|
+
*/
|
|
40
|
+
interface ExecutePageTransitionOptions {
|
|
41
|
+
/** The path being navigated to */
|
|
42
|
+
to: string;
|
|
43
|
+
/** The path being navigated from */
|
|
44
|
+
from?: string;
|
|
45
|
+
/** Override the transition type */
|
|
46
|
+
transition?: TransitionPreset | CustomTransition | false;
|
|
47
|
+
/** Force a specific direction */
|
|
48
|
+
direction?: TransitionDirection;
|
|
49
|
+
/** Callback to execute the actual DOM update */
|
|
50
|
+
updateDOM: () => void | Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Execute a page transition
|
|
54
|
+
*
|
|
55
|
+
* This is the main function used by the router integration to
|
|
56
|
+
* perform transitions between pages.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* await executePageTransition({
|
|
61
|
+
* to: '/dashboard',
|
|
62
|
+
* from: '/home',
|
|
63
|
+
* updateDOM: () => {
|
|
64
|
+
* // Update the page content
|
|
65
|
+
* },
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
declare function executePageTransition(options: ExecutePageTransitionOptions): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Register a callback to run before a page leaves
|
|
72
|
+
*/
|
|
73
|
+
declare function onBeforePageLeave(callback: (context: TransitionContext) => void): () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Register a callback to run after a page leaves
|
|
76
|
+
*/
|
|
77
|
+
declare function onAfterPageLeave(callback: (context: TransitionContext) => void): () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Register a callback to run before a page enters
|
|
80
|
+
*/
|
|
81
|
+
declare function onBeforePageEnter(callback: (context: TransitionContext) => void): () => void;
|
|
82
|
+
/**
|
|
83
|
+
* Register a callback to run after a page enters
|
|
84
|
+
*/
|
|
85
|
+
declare function onAfterPageEnter(callback: (context: TransitionContext) => void): () => void;
|
|
86
|
+
|
|
87
|
+
export { type ExecutePageTransitionOptions, clearPageTransitions, definePageTransition, executePageTransition, getPageTransition, onAfterPageEnter, onAfterPageLeave, onBeforePageEnter, onBeforePageLeave };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import '../chunk-XLVYHPII.js';
|
|
2
|
+
export { clearPageTransitions, definePageTransition, executePageTransition, getPageTransition, onAfterPageEnter, onAfterPageLeave, onBeforePageEnter, onBeforePageLeave } from '../chunk-ITLC6KJ4.js';
|
|
3
|
+
import '../chunk-ZBJ6FSAK.js';
|
|
4
|
+
import '../chunk-7R3FXL3A.js';
|
|
5
|
+
import '../chunk-4SF4GHDQ.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|