@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,97 @@
|
|
|
1
|
+
import { V as ViewTransition, a as ViewTransitionOptions, b as ViewTransitionResult } from './types-BT3SCjiY.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @flight-framework/transitions - View Transition API Wrapper
|
|
5
|
+
*
|
|
6
|
+
* Provides a cross-browser wrapper for the View Transitions API with
|
|
7
|
+
* automatic fallback for unsupported browsers.
|
|
8
|
+
*
|
|
9
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Check if the browser supports the View Transitions API
|
|
14
|
+
* @returns true if startViewTransition is available
|
|
15
|
+
*/
|
|
16
|
+
declare function isViewTransitionSupported(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check if cross-document view transitions are supported
|
|
19
|
+
* @returns true if @view-transition CSS at-rule is supported
|
|
20
|
+
*/
|
|
21
|
+
declare function isCrossDocumentTransitionSupported(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Start a view transition with automatic fallback
|
|
24
|
+
*
|
|
25
|
+
* Uses the native View Transitions API when available, otherwise
|
|
26
|
+
* provides a compatible fallback that executes the callback immediately.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const transition = startViewTransition(() => {
|
|
31
|
+
* // Update the DOM
|
|
32
|
+
* document.getElementById('content').innerHTML = newContent;
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* // Wait for animation to be ready
|
|
36
|
+
* await transition.ready;
|
|
37
|
+
*
|
|
38
|
+
* // Wait for animation to complete
|
|
39
|
+
* await transition.finished;
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function startViewTransition(updateCallback: () => void | Promise<void>, options?: ViewTransitionOptions): ViewTransitionResult;
|
|
43
|
+
/**
|
|
44
|
+
* Options for cross-document (MPA) transitions
|
|
45
|
+
*/
|
|
46
|
+
interface CrossDocumentTransitionOptions {
|
|
47
|
+
/** Enable transitions for same-origin navigations */
|
|
48
|
+
enabled?: boolean;
|
|
49
|
+
/** Types to apply to the transition */
|
|
50
|
+
types?: string[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Enable cross-document view transitions for MPA navigations
|
|
54
|
+
*
|
|
55
|
+
* This injects the necessary CSS and sets up event listeners for
|
|
56
|
+
* pagereveal and pageswap events.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* enableCrossDocumentTransitions({
|
|
61
|
+
* enabled: true,
|
|
62
|
+
* types: ['slide-left']
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare function enableCrossDocumentTransitions(options?: CrossDocumentTransitionOptions): () => void;
|
|
67
|
+
interface PageRevealEvent extends Event {
|
|
68
|
+
readonly viewTransition: ViewTransition | null;
|
|
69
|
+
}
|
|
70
|
+
interface PageSwapEvent extends Event {
|
|
71
|
+
readonly viewTransition: ViewTransition | null;
|
|
72
|
+
readonly activation: NavigationActivation | null;
|
|
73
|
+
}
|
|
74
|
+
interface NavigationActivation {
|
|
75
|
+
readonly entry: NavigationHistoryEntry;
|
|
76
|
+
readonly from: NavigationHistoryEntry | null;
|
|
77
|
+
readonly navigationType: NavigationHistoryEntryType;
|
|
78
|
+
}
|
|
79
|
+
interface NavigationHistoryEntry {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly index: number;
|
|
82
|
+
readonly key: string;
|
|
83
|
+
readonly sameDocument: boolean;
|
|
84
|
+
readonly url: string | null;
|
|
85
|
+
}
|
|
86
|
+
type NavigationHistoryEntryType = 'push' | 'replace' | 'reload' | 'traverse';
|
|
87
|
+
declare global {
|
|
88
|
+
interface Document {
|
|
89
|
+
startViewTransition(callback: () => void | Promise<void>): ViewTransition;
|
|
90
|
+
}
|
|
91
|
+
interface WindowEventMap {
|
|
92
|
+
pagereveal: PageRevealEvent;
|
|
93
|
+
pageswap: PageSwapEvent;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { type CrossDocumentTransitionOptions as C, isCrossDocumentTransitionSupported as a, enableCrossDocumentTransitions as e, isViewTransitionSupported as i, startViewTransition as s };
|
package/package.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flight-framework/transitions",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Smooth page, layout, and component transitions for Flight Framework",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"flight",
|
|
7
|
+
"transitions",
|
|
8
|
+
"view-transitions",
|
|
9
|
+
"animation",
|
|
10
|
+
"page-transition",
|
|
11
|
+
"layout-transition"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": "Flight Contributors",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./core": {
|
|
22
|
+
"types": "./dist/core/index.d.ts",
|
|
23
|
+
"import": "./dist/core/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./page": {
|
|
26
|
+
"types": "./dist/page/index.d.ts",
|
|
27
|
+
"import": "./dist/page/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./layout": {
|
|
30
|
+
"types": "./dist/layout/index.d.ts",
|
|
31
|
+
"import": "./dist/layout/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./component": {
|
|
34
|
+
"types": "./dist/component/index.d.ts",
|
|
35
|
+
"import": "./dist/component/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./presets": {
|
|
38
|
+
"types": "./dist/presets/index.d.ts",
|
|
39
|
+
"import": "./dist/presets/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./css": "./dist/css/transitions.css",
|
|
42
|
+
"./css/view-transitions": "./dist/css/view-transitions.css",
|
|
43
|
+
"./react": {
|
|
44
|
+
"types": "./dist/adapters/react/index.d.ts",
|
|
45
|
+
"import": "./dist/adapters/react/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./vue": {
|
|
48
|
+
"types": "./dist/adapters/vue/index.d.ts",
|
|
49
|
+
"import": "./dist/adapters/vue/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./svelte": {
|
|
52
|
+
"types": "./dist/adapters/svelte/index.d.ts",
|
|
53
|
+
"import": "./dist/adapters/svelte/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./solid": {
|
|
56
|
+
"types": "./dist/adapters/solid/index.d.ts",
|
|
57
|
+
"import": "./dist/adapters/solid/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./router": {
|
|
60
|
+
"types": "./dist/router/index.d.ts",
|
|
61
|
+
"import": "./dist/router/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./config": {
|
|
64
|
+
"types": "./dist/config/index.d.ts",
|
|
65
|
+
"import": "./dist/config/index.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"main": "./dist/index.js",
|
|
69
|
+
"types": "./dist/index.d.ts",
|
|
70
|
+
"files": [
|
|
71
|
+
"dist"
|
|
72
|
+
],
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsup",
|
|
75
|
+
"dev": "tsup --watch",
|
|
76
|
+
"test": "vitest run",
|
|
77
|
+
"test:watch": "vitest",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"lint": "eslint src/",
|
|
80
|
+
"clean": "rimraf dist"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@types/node": "^22.0.0",
|
|
84
|
+
"@types/react": "^19.0.0",
|
|
85
|
+
"rimraf": "^6.0.0",
|
|
86
|
+
"tsup": "^8.0.0",
|
|
87
|
+
"typescript": "^5.7.0",
|
|
88
|
+
"vitest": "^2.0.0"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
92
|
+
"vue": "^3.0.0",
|
|
93
|
+
"svelte": "^4.0.0 || ^5.0.0",
|
|
94
|
+
"solid-js": "^1.0.0"
|
|
95
|
+
},
|
|
96
|
+
"peerDependenciesMeta": {
|
|
97
|
+
"react": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"vue": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"svelte": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"solid-js": {
|
|
107
|
+
"optional": true
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|