@tanstack/router-core 1.115.3 → 1.117.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/dist/cjs/router.cjs +9 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +7 -1
- package/dist/esm/router.d.ts +7 -1
- package/dist/esm/router.js +9 -1
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/router.ts +23 -2
package/dist/cjs/router.d.cts
CHANGED
|
@@ -434,7 +434,13 @@ export interface ServerSrr {
|
|
|
434
434
|
export type AnyRouterWithContext<TContext> = RouterCore<AnyRouteWithContext<TContext>, any, any, any, any>;
|
|
435
435
|
export type AnyRouter = RouterCore<any, any, any, any, any>;
|
|
436
436
|
export interface ViewTransitionOptions {
|
|
437
|
-
types: Array<string
|
|
437
|
+
types: Array<string> | ((locationChangeInfo: {
|
|
438
|
+
fromLocation?: ParsedLocation;
|
|
439
|
+
toLocation: ParsedLocation;
|
|
440
|
+
pathChanged: boolean;
|
|
441
|
+
hrefChanged: boolean;
|
|
442
|
+
hashChanged: boolean;
|
|
443
|
+
}) => Array<string>);
|
|
438
444
|
}
|
|
439
445
|
export declare function defaultSerializeError(err: unknown): {
|
|
440
446
|
name: string;
|
package/dist/esm/router.d.ts
CHANGED
|
@@ -434,7 +434,13 @@ export interface ServerSrr {
|
|
|
434
434
|
export type AnyRouterWithContext<TContext> = RouterCore<AnyRouteWithContext<TContext>, any, any, any, any>;
|
|
435
435
|
export type AnyRouter = RouterCore<any, any, any, any, any>;
|
|
436
436
|
export interface ViewTransitionOptions {
|
|
437
|
-
types: Array<string
|
|
437
|
+
types: Array<string> | ((locationChangeInfo: {
|
|
438
|
+
fromLocation?: ParsedLocation;
|
|
439
|
+
toLocation: ParsedLocation;
|
|
440
|
+
pathChanged: boolean;
|
|
441
|
+
hrefChanged: boolean;
|
|
442
|
+
hashChanged: boolean;
|
|
443
|
+
}) => Array<string>);
|
|
438
444
|
}
|
|
439
445
|
export declare function defaultSerializeError(err: unknown): {
|
|
440
446
|
name: string;
|
package/dist/esm/router.js
CHANGED
|
@@ -772,9 +772,17 @@ class RouterCore {
|
|
|
772
772
|
if (shouldViewTransition && typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function") {
|
|
773
773
|
let startViewTransitionParams;
|
|
774
774
|
if (typeof shouldViewTransition === "object" && this.isViewTransitionTypesSupported) {
|
|
775
|
+
const next = this.latestLocation;
|
|
776
|
+
const prevLocation = this.state.resolvedLocation;
|
|
777
|
+
const resolvedViewTransitionTypes = typeof shouldViewTransition.types === "function" ? shouldViewTransition.types(
|
|
778
|
+
getLocationChangeInfo({
|
|
779
|
+
resolvedLocation: prevLocation,
|
|
780
|
+
location: next
|
|
781
|
+
})
|
|
782
|
+
) : shouldViewTransition.types;
|
|
775
783
|
startViewTransitionParams = {
|
|
776
784
|
update: fn,
|
|
777
|
-
types:
|
|
785
|
+
types: resolvedViewTransitionTypes
|
|
778
786
|
};
|
|
779
787
|
} else {
|
|
780
788
|
startViewTransitionParams = fn;
|