@flight-framework/router 0.2.0 → 0.3.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 +488 -488
- package/dist/{chunk-MO2HMSZH.js → chunk-YXMDNDIZ.js} +35 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/preact/index.d.ts +2 -2
- package/dist/preact/index.js +1 -1
- package/dist/{prefetch-CMmeei6-.d.ts → prefetch-COkjiZgH.d.ts} +14 -0
- package/dist/react/index.d.ts +8 -5
- package/dist/react/index.js +467 -4
- package/dist/solid/index.d.ts +2 -2
- package/dist/solid/index.js +1 -1
- package/dist/svelte/index.d.ts +2 -2
- package/dist/svelte/index.js +1 -1
- package/dist/vue/index.d.ts +2 -2
- package/dist/vue/index.js +1 -1
- package/package.json +93 -92
- package/LICENSE +0 -21
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
1
33
|
// src/context.ts
|
|
2
34
|
var isBrowser = typeof window !== "undefined";
|
|
3
35
|
var currentContext = {
|
|
@@ -454,6 +486,9 @@ function redirect(url) {
|
|
|
454
486
|
}
|
|
455
487
|
|
|
456
488
|
export {
|
|
489
|
+
__require,
|
|
490
|
+
__commonJS,
|
|
491
|
+
__toESM,
|
|
457
492
|
subscribe,
|
|
458
493
|
getRouterContext,
|
|
459
494
|
initRouter,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LinkProps, R as RouteParams, S as SearchParams } from './prefetch-
|
|
2
|
-
export { g as LoaderContext, f as LoaderFunction, N as NavigateOptions, d as PrefetchOptions, k as PrefetchPageLinks, c as PrefetchPriority, P as PrefetchStrategy, e as RouteDefinition, h as RouteMatch, i as RouterContext, a as RouterContextValue, j as RouterProvider, b as RouterProviderProps, w as clearPrefetchCache, l as findRoute, o as generatePath, q as isActive, v as isPrefetched, m as matchRoute, n as navigate, x as observeForPrefetch, p as parseParams, s as prefetch, t as prefetchAll, z as prefetchPages, A as prefetchWhenIdle, r as redirect, y as setupIntentPrefetch, u as useRouter } from './prefetch-
|
|
1
|
+
import { L as LinkProps, R as RouteParams, S as SearchParams } from './prefetch-COkjiZgH.js';
|
|
2
|
+
export { g as LoaderContext, f as LoaderFunction, N as NavigateOptions, d as PrefetchOptions, k as PrefetchPageLinks, c as PrefetchPriority, P as PrefetchStrategy, e as RouteDefinition, h as RouteMatch, i as RouterContext, a as RouterContextValue, j as RouterProvider, b as RouterProviderProps, w as clearPrefetchCache, l as findRoute, o as generatePath, q as isActive, v as isPrefetched, m as matchRoute, n as navigate, x as observeForPrefetch, p as parseParams, s as prefetch, t as prefetchAll, z as prefetchPages, A as prefetchWhenIdle, r as redirect, y as setupIntentPrefetch, u as useRouter } from './prefetch-COkjiZgH.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @flight-framework/router - Link Component
|
package/dist/index.js
CHANGED
package/dist/preact/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PrefetchStrategy, b as RouterProviderProps, a as RouterContextValue } from '../prefetch-
|
|
2
|
-
export { L as LinkProps, N as NavigateOptions, d as PrefetchOptions, c as PrefetchPriority, R as RouteParams, S as SearchParams, w as clearPrefetchCache, l as findRoute, o as generatePath, B as getRouterContext, D as initRouter, q as isActive, v as isPrefetched, m as matchRoute, n as navigate, x as observeForPrefetch, p as parseParams, s as prefetch, t as prefetchAll, z as prefetchPages, A as prefetchWhenIdle, r as redirect, y as setupIntentPrefetch, C as subscribe } from '../prefetch-
|
|
1
|
+
import { P as PrefetchStrategy, b as RouterProviderProps, a as RouterContextValue } from '../prefetch-COkjiZgH.js';
|
|
2
|
+
export { L as LinkProps, N as NavigateOptions, d as PrefetchOptions, c as PrefetchPriority, R as RouteParams, S as SearchParams, w as clearPrefetchCache, l as findRoute, o as generatePath, B as getRouterContext, D as initRouter, q as isActive, v as isPrefetched, m as matchRoute, n as navigate, x as observeForPrefetch, p as parseParams, s as prefetch, t as prefetchAll, z as prefetchPages, A as prefetchWhenIdle, r as redirect, y as setupIntentPrefetch, C as subscribe } from '../prefetch-COkjiZgH.js';
|
|
3
3
|
import * as preact$1 from 'preact';
|
|
4
4
|
import { FunctionComponent, ComponentChildren } from 'preact';
|
|
5
5
|
|
package/dist/preact/index.js
CHANGED
|
@@ -84,6 +84,14 @@ interface LinkProps {
|
|
|
84
84
|
'aria-label'?: string;
|
|
85
85
|
/** Click handler */
|
|
86
86
|
onClick?: (event: MouseEvent) => void;
|
|
87
|
+
/**
|
|
88
|
+
* Enable View Transitions API for this navigation.
|
|
89
|
+
* Wraps the navigation in document.startViewTransition() with flushSync.
|
|
90
|
+
*
|
|
91
|
+
* @default false
|
|
92
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
|
|
93
|
+
*/
|
|
94
|
+
viewTransition?: boolean;
|
|
87
95
|
}
|
|
88
96
|
/**
|
|
89
97
|
* Options for programmatic navigation
|
|
@@ -95,6 +103,12 @@ interface NavigateOptions {
|
|
|
95
103
|
scroll?: boolean;
|
|
96
104
|
/** State data to pass to the new route */
|
|
97
105
|
state?: unknown;
|
|
106
|
+
/**
|
|
107
|
+
* Enable View Transitions API for this navigation.
|
|
108
|
+
*
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
viewTransition?: boolean;
|
|
98
112
|
}
|
|
99
113
|
/**
|
|
100
114
|
* Dynamic route parameters extracted from URL
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { L as LinkProps, b as RouterProviderProps, a as RouterContextValue, R as RouteParams } from '../prefetch-
|
|
2
|
-
export { g as LoaderContext, f as LoaderFunction, N as NavigateOptions, d as PrefetchOptions, c as PrefetchPriority, P as PrefetchStrategy, e as RouteDefinition, h as RouteMatch, S as SearchParams, w as clearPrefetchCache, l as findRoute, o as generatePath, B as getRouterContext, D as initRouter, q as isActive, v as isPrefetched, m as matchRoute, n as navigate, x as observeForPrefetch, p as parseParams, s as prefetch, t as prefetchAll, z as prefetchPages, A as prefetchWhenIdle, r as redirect, y as setupIntentPrefetch, C as subscribe } from '../prefetch-
|
|
1
|
+
import { L as LinkProps, b as RouterProviderProps, a as RouterContextValue, R as RouteParams } from '../prefetch-COkjiZgH.js';
|
|
2
|
+
export { g as LoaderContext, f as LoaderFunction, N as NavigateOptions, d as PrefetchOptions, c as PrefetchPriority, P as PrefetchStrategy, e as RouteDefinition, h as RouteMatch, S as SearchParams, w as clearPrefetchCache, l as findRoute, o as generatePath, B as getRouterContext, D as initRouter, q as isActive, v as isPrefetched, m as matchRoute, n as navigate, x as observeForPrefetch, p as parseParams, s as prefetch, t as prefetchAll, z as prefetchPages, A as prefetchWhenIdle, r as redirect, y as setupIntentPrefetch, C as subscribe } from '../prefetch-COkjiZgH.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* React Link Component
|
|
7
7
|
*
|
|
8
|
-
* Provides client-side navigation with prefetching support.
|
|
8
|
+
* Provides client-side navigation with prefetching and View Transitions support.
|
|
9
9
|
* Properly imports React for SSR compatibility.
|
|
10
10
|
*/
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
* Flight Link Component for React
|
|
14
14
|
*
|
|
15
15
|
* A drop-in replacement for `<a>` that enables SPA navigation
|
|
16
|
-
* with optional prefetching strategies.
|
|
16
|
+
* with optional prefetching strategies and View Transitions.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```tsx
|
|
@@ -23,6 +23,9 @@ import React from 'react';
|
|
|
23
23
|
* // With prefetch on hover/focus (recommended)
|
|
24
24
|
* <Link href="/docs" prefetch="intent">Docs</Link>
|
|
25
25
|
*
|
|
26
|
+
* // With View Transitions (smooth page animations)
|
|
27
|
+
* <Link href="/docs" viewTransition>Docs</Link>
|
|
28
|
+
*
|
|
26
29
|
* // Prefetch immediately when link renders
|
|
27
30
|
* <Link href="/checkout" prefetch="render">Checkout</Link>
|
|
28
31
|
*
|
|
@@ -30,7 +33,7 @@ import React from 'react';
|
|
|
30
33
|
* <Link href="/products" prefetch="viewport">Products</Link>
|
|
31
34
|
* ```
|
|
32
35
|
*/
|
|
33
|
-
declare function Link({ href, children, className, target, rel, prefetch: prefetchProp, replace, scroll, onClick, 'aria-label': ariaLabel, ...props }: LinkProps): React.ReactElement;
|
|
36
|
+
declare function Link({ href, children, className, target, rel, prefetch: prefetchProp, replace, scroll, viewTransition, onClick, 'aria-label': ariaLabel, ...props }: LinkProps): React.ReactElement;
|
|
34
37
|
|
|
35
38
|
/**
|
|
36
39
|
* React Router Provider
|