@react-motion-router/core 2.0.0-beta.sha-20ff5ff → 2.0.0-beta.sha-112968d
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/build/Anchor.d.ts +29 -0
- package/build/MetaData.d.ts +5 -5
- package/build/NavigationBase.d.ts +31 -13
- package/build/RouterBase.d.ts +7 -7
- package/build/RouterContext.d.ts +1 -1
- package/build/ScreenBase.d.ts +7 -7
- package/build/ScreenTransitionLayer.d.ts +2 -2
- package/build/ScreenTransitionProvider.d.ts +2 -2
- package/build/SharedElement.d.ts +4 -6
- package/build/SharedElementTransitionLayer.d.ts +2 -2
- package/build/__tests__/Anchor/index.test.d.ts +1 -0
- package/build/__tests__/Anchor/push.test.d.ts +1 -0
- package/build/__tests__/Anchor/reload.test.d.ts +1 -0
- package/build/__tests__/Anchor/replace.test.d.ts +1 -0
- package/build/__tests__/Anchor/traverse.test.d.ts +1 -0
- package/build/__tests__/RouterBase/get-router-by-id.test.d.ts +1 -0
- package/build/__tests__/RouterBase/index.test.d.ts +1 -0
- package/build/__tests__/RouterBase/preload-screen.test.d.ts +1 -0
- package/build/__tests__/RouterBase/screen-child-from-pathname.test.d.ts +1 -0
- package/build/__tests__/common/utils.d.ts +33 -0
- package/build/__tests__/lazy.test.d.ts +1 -0
- package/build/__tests__/load-event.test.d.ts +1 -0
- package/build/__tests__/meta-data.test.d.ts +1 -0
- package/build/__tests__/screen.test.d.ts +1 -0
- package/build/common/constants.d.ts +4 -0
- package/build/common/test-utils.d.ts +12 -0
- package/build/common/types.d.ts +3 -5
- package/build/common/utils.d.ts +3 -3
- package/build/index.d.ts +2 -0
- package/build/index.js +938 -587
- package/build/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface AnchorProps extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
|
3
|
+
href?: string;
|
|
4
|
+
rel?: string;
|
|
5
|
+
historyEntryKey?: string;
|
|
6
|
+
navigateInfo?: unknown;
|
|
7
|
+
navigateState?: unknown;
|
|
8
|
+
reload?: boolean;
|
|
9
|
+
replace?: boolean;
|
|
10
|
+
traverse?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
type AnchorState = {
|
|
14
|
+
href?: string | null;
|
|
15
|
+
};
|
|
16
|
+
export declare class Anchor extends React.Component<AnchorProps, AnchorState> {
|
|
17
|
+
constructor(props: AnchorProps);
|
|
18
|
+
private readonly anchorRef;
|
|
19
|
+
private static directionFromRel;
|
|
20
|
+
private static findClosestEntryByHref;
|
|
21
|
+
private static findClosestEntry;
|
|
22
|
+
componentDidMount(): void;
|
|
23
|
+
componentWillUnmount(): void;
|
|
24
|
+
private readonly onNavigate;
|
|
25
|
+
private get href();
|
|
26
|
+
private readonly handleClick;
|
|
27
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
package/build/MetaData.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { MetaType } from './common/types';
|
|
2
2
|
export declare class MetaData {
|
|
3
3
|
#private;
|
|
4
|
-
private mutationObserver;
|
|
4
|
+
private readonly mutationObserver;
|
|
5
5
|
constructor();
|
|
6
6
|
get(key: string | MetaType): string | [string, string][] | undefined;
|
|
7
7
|
set(key: string | MetaType, content?: string | [string, string][]): void;
|
|
8
8
|
has(key: string | MetaType): boolean;
|
|
9
9
|
delete(key: string | MetaType): void;
|
|
10
10
|
clear(): void;
|
|
11
|
-
entries(): MapIterator<[
|
|
12
|
-
[Symbol.iterator](): MapIterator<[
|
|
11
|
+
entries(): MapIterator<[`${string}=${string}`, string | undefined]>;
|
|
12
|
+
[Symbol.iterator](): MapIterator<[`${string}=${string}`, string | undefined]>;
|
|
13
13
|
get size(): number;
|
|
14
14
|
private observeMutations;
|
|
15
15
|
private metaDataFromNode;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
16
|
+
private formatMetaKey;
|
|
17
|
+
private formatMetaContent;
|
|
18
18
|
private updateMetaElement;
|
|
19
19
|
}
|
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
import { RouterHTMLElement, RouterBaseEventMap } from './common/types';
|
|
2
2
|
import { MetaData } from './MetaData';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
protected abstract readonly router: RouterBase;
|
|
6
|
-
private static rootNavigatorRef;
|
|
7
|
-
readonly metaData: MetaData;
|
|
8
|
-
constructor();
|
|
9
|
-
addEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => any, options?: boolean | AddEventListenerOptions): () => void;
|
|
3
|
+
export interface NavigationBaseConfig<E extends RouterBaseEventMap = RouterBaseEventMap> {
|
|
4
|
+
addEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => void, options?: boolean | AddEventListenerOptions): () => void;
|
|
10
5
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
11
|
-
|
|
6
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
7
|
+
removeEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => void, options?: boolean | EventListenerOptions | undefined): void;
|
|
8
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
12
9
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
13
10
|
dispatchEvent(event: Event): Promise<boolean>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
getNavigatorById(routerId: string): NavigationBase
|
|
11
|
+
parent: NavigationBase | null;
|
|
12
|
+
routerId: string;
|
|
13
|
+
baseURL: URL;
|
|
14
|
+
baseURLPattern: URLPattern;
|
|
15
|
+
getNavigatorById(routerId: string): NavigationBase | null;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class NavigationBase<E extends RouterBaseEventMap = RouterBaseEventMap> {
|
|
18
|
+
private static rootNavigatorRef;
|
|
19
|
+
readonly metaData: MetaData;
|
|
20
|
+
readonly addEventListener: {
|
|
21
|
+
<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => void, options?: boolean | AddEventListenerOptions): () => void;
|
|
22
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
23
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
24
|
+
};
|
|
25
|
+
readonly removeEventListener: {
|
|
26
|
+
<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => void, options?: boolean | EventListenerOptions | undefined): void;
|
|
27
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
28
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
29
|
+
};
|
|
30
|
+
readonly dispatchEvent: (event: Event) => Promise<boolean>;
|
|
31
|
+
readonly parent: NavigationBase<RouterBaseEventMap> | null;
|
|
32
|
+
readonly routerId: string;
|
|
33
|
+
readonly baseURL: URL;
|
|
34
|
+
readonly baseURLPattern: URLPattern;
|
|
35
|
+
readonly getNavigatorById: (routerId: string) => NavigationBase | null;
|
|
36
|
+
constructor(config: NavigationBaseConfig<E>);
|
|
19
37
|
private get isInDocument();
|
|
20
38
|
}
|
package/build/RouterBase.d.ts
CHANGED
|
@@ -14,12 +14,11 @@ export interface RouterBaseProps<S extends ScreenBase = ScreenBase> {
|
|
|
14
14
|
config?: RouterBaseConfig;
|
|
15
15
|
children: ScreenChild<S> | ScreenChild<S>[];
|
|
16
16
|
}
|
|
17
|
-
export
|
|
18
|
-
}
|
|
17
|
+
export type RouterBaseState = object;
|
|
19
18
|
export declare abstract class RouterBase<P extends RouterBaseProps = RouterBaseProps, S extends RouterBaseState = RouterBaseState, E extends RouterBaseEventMap = RouterBaseEventMap> extends Component<P, S> {
|
|
20
19
|
#private;
|
|
21
|
-
protected readonly ref: import('react').RefObject<RouterHTMLElement<E
|
|
22
|
-
protected screenTransitionLayer: import('react').RefObject<ScreenTransitionLayer>;
|
|
20
|
+
protected readonly ref: import('react').RefObject<RouterHTMLElement<E> | null>;
|
|
21
|
+
protected screenTransitionLayer: import('react').RefObject<ScreenTransitionLayer | null>;
|
|
23
22
|
abstract readonly navigation: NavigationBase;
|
|
24
23
|
readonly parent: RouterBase | null;
|
|
25
24
|
private loadDispatched;
|
|
@@ -37,15 +36,16 @@ export declare abstract class RouterBase<P extends RouterBaseProps = RouterBaseP
|
|
|
37
36
|
private handleNavigationDispatch;
|
|
38
37
|
getRouterById(routerId: string, target?: RouterBase): RouterBase | null;
|
|
39
38
|
dispatchEvent(event: Event): Promise<boolean>;
|
|
40
|
-
addEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) =>
|
|
39
|
+
addEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => void, options?: boolean | AddEventListenerOptions): () => void;
|
|
41
40
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
42
|
-
removeEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) =>
|
|
41
|
+
removeEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => void, options?: boolean | EventListenerOptions | undefined): void;
|
|
43
42
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
44
43
|
protected screenChildFromPathname(pathname: string): {
|
|
45
44
|
child: ScreenChild<ScreenType<P["children"]>>;
|
|
46
45
|
matchInfo: import('./common/types').MatchedRoute;
|
|
47
46
|
} | null;
|
|
48
47
|
protected preloadScreen(screen: ScreenChild): Promise<void>;
|
|
48
|
+
includesRoute(pathname: string, baseURLPattern?: string): boolean;
|
|
49
49
|
get id(): string;
|
|
50
50
|
get isRoot(): boolean;
|
|
51
51
|
get baseURL(): URL;
|
|
@@ -61,6 +61,6 @@ export declare abstract class RouterBase<P extends RouterBaseProps = RouterBaseP
|
|
|
61
61
|
protected abstract shouldIntercept(navigateEvent: NavigateEvent): boolean;
|
|
62
62
|
protected abstract intercept(navigateEvent: NavigateEvent): void;
|
|
63
63
|
protected abstract get screens(): P['children'];
|
|
64
|
-
render(): JSX.Element | undefined;
|
|
64
|
+
render(): import("react/jsx-runtime").JSX.Element | undefined;
|
|
65
65
|
}
|
|
66
66
|
export {};
|
package/build/RouterContext.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export declare const NestedRouterContext: import('react').Context<{
|
|
|
4
4
|
parentRouter: RouterBase;
|
|
5
5
|
parentScreen: ScreenBase;
|
|
6
6
|
} | null>;
|
|
7
|
-
export declare const RouterContext: import('react').Context<RouterBase<import('./RouterBase').RouterBaseProps<ScreenBase<import('./ScreenBase').ScreenBaseProps, import('./ScreenBase').ScreenBaseState<import('./ScreenBase').ScreenBaseConfig<import('.').RoutePropBase<{}, import('.').PlainObject<any>>, import('./NavigationBase').NavigationBase<import('.').RouterBaseEventMap>> | undefined, import('.').PlainObject>, import('.').RoutePropBase<import('./ScreenBase').ScreenBaseConfig<import('.').RoutePropBase<{}, import('.').PlainObject<any>>, import('./NavigationBase').NavigationBase<import('.').RouterBaseEventMap>> | undefined, import('.').PlainObject<any>>>>,
|
|
7
|
+
export declare const RouterContext: import('react').Context<RouterBase<import('./RouterBase').RouterBaseProps<ScreenBase<import('./ScreenBase').ScreenBaseProps, import('./ScreenBase').ScreenBaseState<import('./ScreenBase').ScreenBaseConfig<import('.').RoutePropBase<{}, import('.').PlainObject<any>>, import('./NavigationBase').NavigationBase<import('.').RouterBaseEventMap>> | undefined, import('.').PlainObject>, import('.').RoutePropBase<import('./ScreenBase').ScreenBaseConfig<import('.').RoutePropBase<{}, import('.').PlainObject<any>>, import('./NavigationBase').NavigationBase<import('.').RouterBaseEventMap>> | undefined, import('.').PlainObject<any>>>>, object, import('.').RouterBaseEventMap>>;
|
package/build/ScreenBase.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { RouterContext } from './RouterContext';
|
|
|
5
5
|
import { NavigationBase } from './NavigationBase';
|
|
6
6
|
import { SharedElementScene } from './SharedElementScene';
|
|
7
7
|
export interface ScreenBaseComponentProps<R extends RoutePropBase = RoutePropBase, N extends NavigationBase = NavigationBase> {
|
|
8
|
-
route: R;
|
|
9
|
-
navigation: N;
|
|
8
|
+
readonly route: R;
|
|
9
|
+
readonly navigation: N;
|
|
10
10
|
}
|
|
11
11
|
export type LifecycleProps<R extends RoutePropBase, N extends NavigationBase = NavigationBase> = ({
|
|
12
12
|
signal: AbortSignal;
|
|
@@ -51,12 +51,12 @@ export interface ScreenBaseState<C extends ScreenBaseProps['config'] = ScreenBas
|
|
|
51
51
|
export declare abstract class ScreenBase<P extends ScreenBaseProps = ScreenBaseProps, S extends ScreenBaseState<P['config']> = ScreenBaseState<P['config']>, R extends RoutePropBase<P['config']> = RoutePropBase<P['config']>> extends Component<P, S> {
|
|
52
52
|
#private;
|
|
53
53
|
readonly sharedElementScene: SharedElementScene;
|
|
54
|
-
protected readonly ref: import('react').RefObject<HTMLDivElement>;
|
|
54
|
+
protected readonly ref: import('react').RefObject<HTMLDivElement | null>;
|
|
55
55
|
protected readonly nestedRouterData: {
|
|
56
56
|
parentScreen: ScreenBase;
|
|
57
|
-
parentRouter: import('./RouterBase').RouterBase<import('./RouterBase').RouterBaseProps<ScreenBase<ScreenBaseProps, ScreenBaseState<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject>, RoutePropBase<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject<any>>>>,
|
|
57
|
+
parentRouter: import('./RouterBase').RouterBase<import('./RouterBase').RouterBaseProps<ScreenBase<ScreenBaseProps, ScreenBaseState<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject>, RoutePropBase<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject<any>>>>, object, import('./common/types').RouterBaseEventMap>;
|
|
58
58
|
};
|
|
59
|
-
static readonly contextType: import('react').Context<import('./RouterBase').RouterBase<import('./RouterBase').RouterBaseProps<ScreenBase<ScreenBaseProps, ScreenBaseState<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject>, RoutePropBase<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject<any>>>>,
|
|
59
|
+
static readonly contextType: import('react').Context<import('./RouterBase').RouterBase<import('./RouterBase').RouterBaseProps<ScreenBase<ScreenBaseProps, ScreenBaseState<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject>, RoutePropBase<ScreenBaseConfig<RoutePropBase<{}, PlainObject<any>>, NavigationBase<import('./common/types').RouterBaseEventMap>> | undefined, PlainObject<any>>>>, object, import('./common/types').RouterBaseEventMap>>;
|
|
60
60
|
context: React.ContextType<typeof RouterContext>;
|
|
61
61
|
state: S;
|
|
62
62
|
constructor(props: P, context: React.ContextType<typeof RouterContext>);
|
|
@@ -79,6 +79,6 @@ export declare abstract class ScreenBase<P extends ScreenBaseProps = ScreenBaseP
|
|
|
79
79
|
onEnter(signal: AbortSignal): Promise<void>;
|
|
80
80
|
onEntered(signal: AbortSignal): Promise<void>;
|
|
81
81
|
get path(): P["path"];
|
|
82
|
-
get transitionProvider(): import('react').RefObject<ScreenTransitionProvider>;
|
|
83
|
-
render(): JSX.Element;
|
|
82
|
+
get transitionProvider(): import('react').RefObject<ScreenTransitionProvider | null>;
|
|
83
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
84
84
|
}
|
|
@@ -15,7 +15,7 @@ interface ScreenTransitionLayerState {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class ScreenTransitionLayer extends Component<ScreenTransitionLayerProps, ScreenTransitionLayerState> {
|
|
17
17
|
#private;
|
|
18
|
-
readonly sharedElementTransitionLayer: RefObject<SharedElementTransitionLayer>;
|
|
18
|
+
readonly sharedElementTransitionLayer: RefObject<SharedElementTransitionLayer | null>;
|
|
19
19
|
readonly animation: Animation;
|
|
20
20
|
state: ScreenTransitionLayerState;
|
|
21
21
|
private onTransitionCancel;
|
|
@@ -27,6 +27,6 @@ export declare class ScreenTransitionLayer extends Component<ScreenTransitionLay
|
|
|
27
27
|
get direction(): PlaybackDirection;
|
|
28
28
|
get hasUAVisualTransition(): boolean;
|
|
29
29
|
transition(): Animation;
|
|
30
|
-
render(): JSX.Element;
|
|
30
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
@@ -14,7 +14,7 @@ interface ScreenTransitionProviderState {
|
|
|
14
14
|
zIndex: React.CSSProperties['zIndex'];
|
|
15
15
|
}
|
|
16
16
|
export declare class ScreenTransitionProvider extends Component<ScreenTransitionProviderProps, ScreenTransitionProviderState> {
|
|
17
|
-
readonly ref: import('react').RefObject<HTMLElement>;
|
|
17
|
+
readonly ref: import('react').RefObject<HTMLElement | null>;
|
|
18
18
|
static readonly contextType: import('react').Context<import('./ScreenTransitionLayer').ScreenTransitionLayer>;
|
|
19
19
|
context: React.ContextType<typeof ScreenTransitionLayerContext>;
|
|
20
20
|
index: number;
|
|
@@ -26,6 +26,6 @@ export declare class ScreenTransitionProvider extends Component<ScreenTransition
|
|
|
26
26
|
componentWillUnmount(): void;
|
|
27
27
|
get animationEffect(): AnimationEffect | null;
|
|
28
28
|
setZIndex(zIndex: React.CSSProperties['zIndex']): Promise<void>;
|
|
29
|
-
render(): JSX.Element;
|
|
29
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
package/build/SharedElement.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { SharedElementTransitionType, StyleKeyList } from './common/types';
|
|
|
3
3
|
import { SharedElementSceneContext } from './SharedElementSceneContext';
|
|
4
4
|
interface SharedElementConfig extends OptionalEffectTiming {
|
|
5
5
|
type?: SharedElementTransitionType;
|
|
6
|
-
transformOrigin?: React.CSSProperties[
|
|
6
|
+
transformOrigin?: React.CSSProperties['transformOrigin'];
|
|
7
7
|
styles?: StyleKeyList;
|
|
8
8
|
deepClone?: boolean;
|
|
9
9
|
}
|
|
@@ -13,10 +13,8 @@ interface SharedElementProps {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
config?: SharedElementConfig;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare class SharedElement extends Component<SharedElementProps, SharedElementState> {
|
|
19
|
-
readonly ref: import('react').RefObject<HTMLDivElement>;
|
|
16
|
+
export declare class SharedElement extends Component<SharedElementProps> {
|
|
17
|
+
readonly ref: import('react').RefObject<HTMLDivElement | null>;
|
|
20
18
|
static readonly contextType: import('react').Context<import('./SharedElementScene').SharedElementScene>;
|
|
21
19
|
context: React.ContextType<typeof SharedElementSceneContext>;
|
|
22
20
|
componentDidMount(): void;
|
|
@@ -31,6 +29,6 @@ export declare class SharedElement extends Component<SharedElementProps, SharedE
|
|
|
31
29
|
clone(): HTMLElement | null;
|
|
32
30
|
hide(): void;
|
|
33
31
|
unhide(): void;
|
|
34
|
-
render(): JSX.Element;
|
|
32
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
35
33
|
}
|
|
36
34
|
export {};
|
|
@@ -12,7 +12,7 @@ interface SharedElementTransitionLayerState {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class SharedElementTransitionLayer extends Component<SharedElementTransitionLayerProps, SharedElementTransitionLayerState> {
|
|
14
14
|
#private;
|
|
15
|
-
readonly ref: RefObject<HTMLDialogElement>;
|
|
15
|
+
readonly ref: RefObject<HTMLDialogElement | null>;
|
|
16
16
|
state: SharedElementTransitionLayerState;
|
|
17
17
|
set outgoingScreen(outgoingScreen: RefObject<ScreenBase> | null);
|
|
18
18
|
set incomingScreen(incomingScreen: RefObject<ScreenBase> | null);
|
|
@@ -26,6 +26,6 @@ export declare class SharedElementTransitionLayer extends Component<SharedElemen
|
|
|
26
26
|
rect: DOMRect;
|
|
27
27
|
}>(start: T, end: T): ParallelEffect;
|
|
28
28
|
get animationEffect(): ParallelEffect | null;
|
|
29
|
-
render(): JSX.Element;
|
|
29
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NavigationBase } from '../../NavigationBase';
|
|
3
|
+
import { RouterBase, RouterBaseProps } from '../../RouterBase';
|
|
4
|
+
import { NestedRouterContext } from '../../RouterContext';
|
|
5
|
+
import { ScreenBase } from '../../ScreenBase';
|
|
6
|
+
export declare class TestNavigation extends NavigationBase {
|
|
7
|
+
}
|
|
8
|
+
export declare class TestRouter extends RouterBase {
|
|
9
|
+
navigation: TestNavigation;
|
|
10
|
+
state: {
|
|
11
|
+
screens: RouterBase["screens"];
|
|
12
|
+
};
|
|
13
|
+
constructor(props: RouterBaseProps, context: React.ContextType<typeof NestedRouterContext>);
|
|
14
|
+
protected canIntercept(): boolean;
|
|
15
|
+
protected shouldIntercept(): boolean;
|
|
16
|
+
protected get screens(): React.CElement<import('../../ScreenBase').ScreenBaseProps, ScreenBase<import('../../ScreenBase').ScreenBaseProps, import('../../ScreenBase').ScreenBaseState<import('../../ScreenBase').ScreenBaseConfig<import('../..').RoutePropBase<{}, import('../..').PlainObject<any>>, NavigationBase<import('../..').RouterBaseEventMap>> | undefined, import('../..').PlainObject>, import('../..').RoutePropBase<import('../../ScreenBase').ScreenBaseConfig<import('../..').RoutePropBase<{}, import('../..').PlainObject<any>>, NavigationBase<import('../..').RouterBaseEventMap>> | undefined, import('../..').PlainObject<any>>>> | React.CElement<import('../../ScreenBase').ScreenBaseProps, ScreenBase<import('../../ScreenBase').ScreenBaseProps, import('../../ScreenBase').ScreenBaseState<import('../../ScreenBase').ScreenBaseConfig<import('../..').RoutePropBase<{}, import('../..').PlainObject<any>>, NavigationBase<import('../..').RouterBaseEventMap>> | undefined, import('../..').PlainObject>, import('../..').RoutePropBase<import('../../ScreenBase').ScreenBaseConfig<import('../..').RoutePropBase<{}, import('../..').PlainObject<any>>, NavigationBase<import('../..').RouterBaseEventMap>> | undefined, import('../..').PlainObject<any>>>>[];
|
|
17
|
+
protected intercept(e: NavigateEvent): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class TestScreen extends ScreenBase {
|
|
20
|
+
get id(): string;
|
|
21
|
+
get params(): import('../..').PlainObject;
|
|
22
|
+
get config(): import('../../ScreenBase').ScreenBaseConfig<import('../..').RoutePropBase<{}, import('../..').PlainObject<any>>, NavigationBase<import('../..').RouterBaseEventMap>>;
|
|
23
|
+
get resolvedPathname(): string;
|
|
24
|
+
protected get routeProp(): {
|
|
25
|
+
config: import('../../ScreenBase').ScreenBaseConfig<import('../..').RoutePropBase<{}, import('../..').PlainObject<any>>, NavigationBase<import('../..').RouterBaseEventMap>>;
|
|
26
|
+
params: import('../..').PlainObject;
|
|
27
|
+
focused: boolean;
|
|
28
|
+
path: string;
|
|
29
|
+
resolvedPathname: string;
|
|
30
|
+
setConfig(): void;
|
|
31
|
+
setParams(): void;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,3 +3,7 @@ export declare const MAX_PROGRESS = 100;
|
|
|
3
3
|
export declare const MIN_PROGRESS = 0;
|
|
4
4
|
export declare const MIN_NORM_PROGRESS = 0;
|
|
5
5
|
export declare const MAX_NORM_PROGRESS = 1;
|
|
6
|
+
export declare const LAST_INDEX = -1;
|
|
7
|
+
export declare const FIRST_INDEX = 0;
|
|
8
|
+
export declare const SINGLE_ELEMENT_LENGTH = 1;
|
|
9
|
+
export declare const EMPTY_COLLECTION_LENGTH = 0;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function useRerender(): CSSNumberish | null;
|
|
2
|
+
export declare function useRerenderCallback<T extends () => unknown>(callback: T): void;
|
|
3
|
+
export declare function triggerRerender(): void;
|
|
4
|
+
export declare function createHistoryEntry(url: string, index: number): NavigationHistoryEntry;
|
|
5
|
+
export declare function assertNavigationAvailable(): void;
|
|
6
|
+
export declare function waitForNavigateSuccess(): Promise<void>;
|
|
7
|
+
export declare function navTo(url: string): Promise<void>;
|
|
8
|
+
export declare function traverseTo(key: string): Promise<void>;
|
|
9
|
+
export declare function traverseToStart(): Promise<void>;
|
|
10
|
+
export declare function seedHistory(): Promise<void>;
|
|
11
|
+
export declare function installInterceptor(): Promise<void>;
|
|
12
|
+
export declare function uninstallInterceptor(): Promise<void>;
|
package/build/common/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScreenBase, ScreenBaseProps } from '../ScreenBase';
|
|
2
|
-
import { MotionProgressEndEvent,
|
|
2
|
+
import { MotionProgressEndEvent, MotionProgressStartEvent, TransitionCancelEvent, TransitionEndEvent, TransitionStartEvent } from './events';
|
|
3
3
|
import { SharedElement } from '../SharedElement';
|
|
4
4
|
import { StandardPropertiesHyphen } from 'csstype';
|
|
5
5
|
export type ScreenChild<E extends ScreenBase = ScreenBase> = E extends ScreenBase<infer P> ? React.CElement<P, E> : never;
|
|
@@ -14,9 +14,8 @@ export interface AnimationEffectFactoryProps<R extends HTMLElement = HTMLElement
|
|
|
14
14
|
hasUAVisualTransition: boolean;
|
|
15
15
|
}
|
|
16
16
|
export type AnimationEffectFactory<R extends HTMLElement = HTMLElement> = (props: AnimationEffectFactoryProps<R>) => AnimationEffect;
|
|
17
|
-
export type
|
|
18
|
-
export type
|
|
19
|
-
export type MetaKey = `${MetaTypeKey}=${string}`;
|
|
17
|
+
export type MetaType = [string, string];
|
|
18
|
+
export type MetaKey = `${string}=${string}`;
|
|
20
19
|
export interface LazyExoticComponent<T extends React.ComponentType<any>> extends React.LazyExoticComponent<T> {
|
|
21
20
|
load: () => Promise<{
|
|
22
21
|
default: T;
|
|
@@ -44,7 +43,6 @@ export interface RouterBaseEventMap extends HTMLElementEventMap {
|
|
|
44
43
|
'transition-cancel': TransitionCancelEvent;
|
|
45
44
|
'transition-end': TransitionEndEvent;
|
|
46
45
|
'motion-progress-start': MotionProgressStartEvent;
|
|
47
|
-
'motion-progress': MotionProgressEvent;
|
|
48
46
|
'motion-progress-end': MotionProgressEndEvent;
|
|
49
47
|
}
|
|
50
48
|
export type RouterHTMLElement<E extends RouterBaseEventMap, T extends HTMLElement = HTMLDivElement> = T & {
|
package/build/common/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ClonedElementType, ElementPropType, LazyExoticComponent, MatchedRoute
|
|
1
|
+
import { ClonedElementType, ElementPropType, LazyExoticComponent, MatchedRoute } from './types';
|
|
2
2
|
export declare function resolveBaseURLFromPattern(pattern: string, pathname: string): URL | null;
|
|
3
3
|
export declare function matchRoute(pathnamePattern: string, pathname: string, baseURLPattern?: string, caseSensitive?: boolean): MatchedRoute | null;
|
|
4
|
-
export declare function includesRoute(pathnamePatterns: PathPattern[], pathname: string, baseURL?: string): boolean;
|
|
5
4
|
export declare function dispatchEvent<T>(event: CustomEvent<T> | Event, target?: HTMLElement | EventTarget): Promise<boolean>;
|
|
6
5
|
export declare function lazy<T extends React.ComponentType<any>>(factory: () => Promise<{
|
|
7
6
|
default: T;
|
|
@@ -10,6 +9,7 @@ export declare function isNavigationSupported(): boolean;
|
|
|
10
9
|
export declare function isURLPatternSupported(): boolean;
|
|
11
10
|
export declare function polyfillURLPattern(): Promise<void>;
|
|
12
11
|
export declare function polyfillNavigation(): Promise<void>;
|
|
13
|
-
export declare function
|
|
12
|
+
export declare function PromiseAllSequential<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
|
|
14
13
|
export declare function toCamelCase(value: string): string;
|
|
15
14
|
export declare function cloneAndInject<C extends React.CElement<any, any>, IP extends Partial<ElementPropType<C>>>(element: C, injectProps: IP): ClonedElementType<C, IP>;
|
|
15
|
+
export declare function omit<T extends object, K extends readonly (keyof T)[]>(obj: T, keys: K): Omit<T, K[number]>;
|
package/build/index.d.ts
CHANGED