@react-motion-router/stack 2.0.0-beta.sha-c19f37e → 2.0.0-beta.sha-9a4805f

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { PlainObject, AnchorProps as AnchorBaseProps } from '../../core/build';
1
+ import { PlainObject } from '../../core/build';
2
2
  import { ScreenConfig } from './Screen';
3
3
  interface OnSightPreloadBehaviour extends UseIntersectionOptions {
4
4
  type: 'onsight';
@@ -7,23 +7,29 @@ interface OnHoverPreloadBehaviour {
7
7
  type: 'onhover';
8
8
  forceThreshold?: number;
9
9
  }
10
- interface AnchorProps extends AnchorBaseProps {
11
- params?: PlainObject<string | boolean | number>;
10
+ interface AnchorProps extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
11
+ params?: PlainObject<string | boolean | number> | null;
12
12
  /**
13
13
  * Will override params object if supplied.
14
14
  * Used to control the search params that get passed to the href attribute.
15
15
  */
16
- searchParams?: PlainObject<string | boolean | number>;
16
+ searchParams?: PlainObject<string | boolean | number> | null;
17
17
  config?: ScreenConfig;
18
18
  preload?: boolean;
19
19
  preloadBehaviour?: OnSightPreloadBehaviour | OnHoverPreloadBehaviour | {
20
20
  type: 'force';
21
21
  };
22
+ rel?: 'next' | 'prev' | (string & {});
23
+ historyEntryKey?: string;
24
+ reload?: boolean;
25
+ replace?: boolean;
26
+ traverse?: boolean;
27
+ children?: React.ReactNode;
22
28
  }
23
29
  interface UseIntersectionOptions {
24
30
  root?: Element | null;
25
31
  rootMargin?: string;
26
32
  threshold?: number | number[];
27
33
  }
28
- export declare function Anchor({ preload, params, searchParams, config, preloadBehaviour, children, ...aProps }: AnchorProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function Anchor({ ref: forwardedRef, preload, params, searchParams, config, preloadBehaviour, children, ...props }: AnchorProps): import("react/jsx-runtime").JSX.Element;
29
35
  export {};
@@ -5,6 +5,7 @@ export declare class HistoryEntry implements Omit<NavigationHistoryEntry, 'url'>
5
5
  constructor(nativeEntry: NavigationHistoryEntry, routerId: string, index: number);
6
6
  set ondispose(handler: ((this: NavigationHistoryEntry, ev: Event) => void) | null);
7
7
  get ondispose(): ((this: NavigationHistoryEntry, ev: Event) => void) | null;
8
+ get nativeEntry(): NavigationHistoryEntry;
8
9
  get id(): string;
9
10
  get globalIndex(): number;
10
11
  get url(): URL | null;
@@ -4,6 +4,7 @@ import { HistoryEntry } from './HistoryEntry';
4
4
  export interface NavigationConfig extends NavigationBaseConfig {
5
5
  getCommitted(): Promise<NavigationHistoryEntry> | null;
6
6
  getTransition(): NavigationTransition | LoadNavigationTransition | null;
7
+ getDestination(): NavigationDestination | null;
7
8
  getPathPatterns(): PathPattern[];
8
9
  }
9
10
  export declare class Navigation extends NavigationBase {
package/build/Router.d.ts CHANGED
@@ -16,6 +16,7 @@ export interface RouterProps extends RouterBaseProps<Screen> {
16
16
  type InjectedScreenProps = Pick<ScreenProps, 'config' | 'defaultParams'> & ScreenInternalProps;
17
17
  export interface RouterState extends RouterBaseState {
18
18
  transition: NavigationTransition | LoadEvent['transition'] | null;
19
+ destination: NavigationDestination | null;
19
20
  screenStack: ClonedElementType<ScreenChild<Screen>, InjectedScreenProps>[];
20
21
  gestureDirection: SwipeDirection;
21
22
  gestureAreaWidth: number;
@@ -40,11 +41,9 @@ export declare class Router extends RouterBase<RouterProps, RouterState> {
40
41
  documentTitle: string | undefined;
41
42
  };
42
43
  componentDidMount(): void;
43
- shouldComponentUpdate(nextProps: Readonly<RouterProps>, nextState: Readonly<RouterState>): boolean;
44
44
  componentWillUnmount(): void;
45
45
  onnavigate(e: NavigateEvent): void;
46
46
  oncurrententrychange(): void;
47
- onnavigatesuccess(): void;
48
47
  onnavigateerror({ error }: ErrorEvent): void;
49
48
  private readonly onGestureCancel;
50
49
  private canGestureNavigate;
package/build/Screen.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { ScreenBase, PlainObject, ScreenBaseProps, ScreenBaseState, ScreenBaseComponentProps, ScreenBaseConfig, MatchedRoute } from '../../core/build';
1
+ import { ScreenBase, PlainObject, ScreenBaseProps, ScreenBaseState, ScreenBaseComponentProps, ScreenBaseConfig, MatchedRoute, ElementForTag } from '../../core/build';
2
2
  import { Navigation } from './Navigation';
3
3
  import { HistoryEntryState, RouteProp, SwipeDirection } from './common/types';
4
4
  import { Router } from './Router';
5
5
  import { HistoryEntry } from './HistoryEntry';
6
+ import { RefObject } from 'react';
6
7
  export type ScreenComponentProps<T extends PlainObject = object> = ScreenBaseComponentProps<RouteProp<T>, Navigation>;
7
8
  export interface ScreenConfig extends ScreenBaseConfig<RouteProp> {
8
9
  readonly title?: string;
@@ -16,9 +17,14 @@ export interface ScreenConfig extends ScreenBaseConfig<RouteProp> {
16
17
  }
17
18
  export interface ScreenProps extends ScreenBaseProps {
18
19
  config?: ScreenConfig;
20
+ ref?: RefObject<Screen | null>;
19
21
  }
20
- export declare class Screen extends ScreenBase<ScreenProps, ScreenBaseState, RouteProp> {
22
+ export interface ScreenState extends ScreenBaseState {
23
+ elementType: React.JSX.ElementType;
24
+ }
25
+ export declare class Screen extends ScreenBase<ScreenProps, ScreenState, RouteProp> {
21
26
  #private;
27
+ protected ref: RefObject<ElementForTag<"dialog" | "div"> | null>;
22
28
  constructor(props: ScreenProps, router: Router);
23
29
  static getDerivedStateFromProps(props: ScreenProps): {
24
30
  elementType: string;
@@ -30,7 +36,9 @@ export declare class Screen extends ScreenBase<ScreenProps, ScreenBaseState, Rou
30
36
  private get internalProps();
31
37
  get resolvedPathname(): string;
32
38
  private get historyEntryState();
39
+ get inert(): true | undefined;
33
40
  get id(): string;
41
+ get viewTransitionName(): string;
34
42
  get params(): {
35
43
  [x: string]: any;
36
44
  };
@@ -93,7 +101,8 @@ export declare class Screen extends ScreenBase<ScreenProps, ScreenBaseState, Rou
93
101
  };
94
102
  };
95
103
  protected setHistoryState(newState: PlainObject | ((prevState: PlainObject) => PlainObject)): void;
96
- private onClickOutside;
104
+ onclick(e: MouseEvent): void;
97
105
  onEnter(signal: AbortSignal): Promise<void>;
98
106
  onExited(signal: AbortSignal): Promise<void>;
107
+ render(): import("react/jsx-runtime").JSX.Element;
99
108
  }
@@ -2,6 +2,7 @@ import { PlainObject, RoutePropBase } from '../../../core/build';
2
2
  import { ScreenProps } from '../Screen';
3
3
  import { RefObject } from 'react';
4
4
  import { BackEvent, ForwardEvent, GestureCancelEvent, GestureEndEvent, GestureStartEvent, NavigateEvent } from './events';
5
+ import { HistoryEntry } from '../HistoryEntry';
5
6
  export interface NavigationBaseOptions {
6
7
  signal?: AbortSignal;
7
8
  }
@@ -44,4 +45,5 @@ export declare function isHorizontalDirection(direction: SwipeDirection): direct
44
45
  export interface ScreenInternalProps {
45
46
  resolvedPathname: string;
46
47
  id: React.Key;
48
+ entry: HistoryEntry;
47
49
  }