@benjavicente/angular-router-experimental 1.142.14 → 1.142.15
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/fesm2022/tanstack-angular-router-experimental-experimental.mjs +57 -58
- package/dist/fesm2022/tanstack-angular-router-experimental.mjs +516 -507
- package/dist/types/tanstack-angular-router-experimental-experimental.d.ts +37 -37
- package/dist/types/tanstack-angular-router-experimental.d.ts +37 -37
- package/package.json +3 -5
- package/src/document/install-unified-document-sync.ts +7 -0
- package/src/document/provide-tanstack-body-managed-tags.ts +3 -0
- package/src/document/provide-tanstack-head-managed-tags.ts +3 -0
|
@@ -22,40 +22,6 @@ export declare function injectRouteErrorHandler<TRouter extends AnyRouter = Regi
|
|
|
22
22
|
export { }
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
declare module '@benjavicente/router-core' {
|
|
26
|
-
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
27
|
-
injectMatch: InjectMatchRoute<TRoute['id']>;
|
|
28
|
-
injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
|
|
29
|
-
injectSearch: InjectSearchRoute<TRoute['id']>;
|
|
30
|
-
injectParams: InjectParamsRoute<TRoute['id']>;
|
|
31
|
-
injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
|
|
32
|
-
injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
|
|
33
|
-
injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
declare module '@benjavicente/router-core' {
|
|
39
|
-
interface UpdatableRouteOptionsExtensions {
|
|
40
|
-
component?: RouteComponent;
|
|
41
|
-
errorComponent?: false | null | undefined | ErrorRouteComponent;
|
|
42
|
-
notFoundComponent?: NotFoundRouteComponent;
|
|
43
|
-
pendingComponent?: RouteComponent;
|
|
44
|
-
}
|
|
45
|
-
interface RootRouteOptionsExtensions {
|
|
46
|
-
}
|
|
47
|
-
interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
|
|
48
|
-
injectMatch: InjectMatchRoute<TId>;
|
|
49
|
-
injectRouteContext: InjectRouteContextRoute<TId>;
|
|
50
|
-
injectSearch: InjectSearchRoute<TId>;
|
|
51
|
-
injectParams: InjectParamsRoute<TId>;
|
|
52
|
-
injectLoaderDeps: InjectLoaderDepsRoute<TId>;
|
|
53
|
-
injectLoaderData: InjectLoaderDataRoute<TId>;
|
|
54
|
-
injectNavigate: () => UseNavigateResult<TFullPath>;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
25
|
declare module '@benjavicente/router-core' {
|
|
60
26
|
interface RouterOptionsExtensions {
|
|
61
27
|
/**
|
|
@@ -92,9 +58,36 @@ declare module '@benjavicente/router-core' {
|
|
|
92
58
|
}
|
|
93
59
|
|
|
94
60
|
|
|
95
|
-
declare
|
|
96
|
-
interface
|
|
97
|
-
|
|
61
|
+
declare module '@benjavicente/router-core' {
|
|
62
|
+
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
63
|
+
injectMatch: InjectMatchRoute<TRoute['id']>;
|
|
64
|
+
injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
|
|
65
|
+
injectSearch: InjectSearchRoute<TRoute['id']>;
|
|
66
|
+
injectParams: InjectParamsRoute<TRoute['id']>;
|
|
67
|
+
injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
|
|
68
|
+
injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
|
|
69
|
+
injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
declare module '@benjavicente/router-core' {
|
|
75
|
+
interface UpdatableRouteOptionsExtensions {
|
|
76
|
+
component?: RouteComponent;
|
|
77
|
+
errorComponent?: false | null | undefined | ErrorRouteComponent;
|
|
78
|
+
notFoundComponent?: NotFoundRouteComponent;
|
|
79
|
+
pendingComponent?: RouteComponent;
|
|
80
|
+
}
|
|
81
|
+
interface RootRouteOptionsExtensions {
|
|
82
|
+
}
|
|
83
|
+
interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
|
|
84
|
+
injectMatch: InjectMatchRoute<TId>;
|
|
85
|
+
injectRouteContext: InjectRouteContextRoute<TId>;
|
|
86
|
+
injectSearch: InjectSearchRoute<TId>;
|
|
87
|
+
injectParams: InjectParamsRoute<TId>;
|
|
88
|
+
injectLoaderDeps: InjectLoaderDepsRoute<TId>;
|
|
89
|
+
injectLoaderData: InjectLoaderDataRoute<TId>;
|
|
90
|
+
injectNavigate: () => UseNavigateResult<TFullPath>;
|
|
98
91
|
}
|
|
99
92
|
}
|
|
100
93
|
|
|
@@ -109,3 +102,10 @@ declare module '@benjavicente/router-core' {
|
|
|
109
102
|
pendingRouteIds: RouterReadableStore<Record<string, boolean>>;
|
|
110
103
|
}
|
|
111
104
|
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
declare global {
|
|
108
|
+
interface Window {
|
|
109
|
+
__TSR_ROUTER_INJECTION_KEY__?: Angular.InjectionToken<AnyRouter>;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -657,40 +657,6 @@ export declare type UseBlockerOpts<TRouter extends AnyRouter = RegisteredRouter,
|
|
|
657
657
|
export { }
|
|
658
658
|
|
|
659
659
|
|
|
660
|
-
declare module '@benjavicente/router-core' {
|
|
661
|
-
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
662
|
-
injectMatch: InjectMatchRoute<TRoute['id']>;
|
|
663
|
-
injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
|
|
664
|
-
injectSearch: InjectSearchRoute<TRoute['id']>;
|
|
665
|
-
injectParams: InjectParamsRoute<TRoute['id']>;
|
|
666
|
-
injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
|
|
667
|
-
injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
|
|
668
|
-
injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
declare module '@benjavicente/router-core' {
|
|
674
|
-
interface UpdatableRouteOptionsExtensions {
|
|
675
|
-
component?: RouteComponent;
|
|
676
|
-
errorComponent?: false | null | undefined | ErrorRouteComponent;
|
|
677
|
-
notFoundComponent?: NotFoundRouteComponent;
|
|
678
|
-
pendingComponent?: RouteComponent;
|
|
679
|
-
}
|
|
680
|
-
interface RootRouteOptionsExtensions {
|
|
681
|
-
}
|
|
682
|
-
interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
|
|
683
|
-
injectMatch: InjectMatchRoute<TId>;
|
|
684
|
-
injectRouteContext: InjectRouteContextRoute<TId>;
|
|
685
|
-
injectSearch: InjectSearchRoute<TId>;
|
|
686
|
-
injectParams: InjectParamsRoute<TId>;
|
|
687
|
-
injectLoaderDeps: InjectLoaderDepsRoute<TId>;
|
|
688
|
-
injectLoaderData: InjectLoaderDataRoute<TId>;
|
|
689
|
-
injectNavigate: () => UseNavigateResult<TFullPath>;
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
660
|
declare module '@benjavicente/router-core' {
|
|
695
661
|
interface RouterOptionsExtensions {
|
|
696
662
|
/**
|
|
@@ -727,9 +693,36 @@ declare module '@benjavicente/router-core' {
|
|
|
727
693
|
}
|
|
728
694
|
|
|
729
695
|
|
|
730
|
-
declare
|
|
731
|
-
interface
|
|
732
|
-
|
|
696
|
+
declare module '@benjavicente/router-core' {
|
|
697
|
+
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
698
|
+
injectMatch: InjectMatchRoute<TRoute['id']>;
|
|
699
|
+
injectRouteContext: InjectRouteContextRoute<TRoute['id']>;
|
|
700
|
+
injectSearch: InjectSearchRoute<TRoute['id']>;
|
|
701
|
+
injectParams: InjectParamsRoute<TRoute['id']>;
|
|
702
|
+
injectLoaderDeps: InjectLoaderDepsRoute<TRoute['id']>;
|
|
703
|
+
injectLoaderData: InjectLoaderDataRoute<TRoute['id']>;
|
|
704
|
+
injectNavigate: () => UseNavigateResult<TRoute['fullPath']>;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
declare module '@benjavicente/router-core' {
|
|
710
|
+
interface UpdatableRouteOptionsExtensions {
|
|
711
|
+
component?: RouteComponent;
|
|
712
|
+
errorComponent?: false | null | undefined | ErrorRouteComponent;
|
|
713
|
+
notFoundComponent?: NotFoundRouteComponent;
|
|
714
|
+
pendingComponent?: RouteComponent;
|
|
715
|
+
}
|
|
716
|
+
interface RootRouteOptionsExtensions {
|
|
717
|
+
}
|
|
718
|
+
interface RouteExtensions<in out TId extends string, in out TFullPath extends string> {
|
|
719
|
+
injectMatch: InjectMatchRoute<TId>;
|
|
720
|
+
injectRouteContext: InjectRouteContextRoute<TId>;
|
|
721
|
+
injectSearch: InjectSearchRoute<TId>;
|
|
722
|
+
injectParams: InjectParamsRoute<TId>;
|
|
723
|
+
injectLoaderDeps: InjectLoaderDepsRoute<TId>;
|
|
724
|
+
injectLoaderData: InjectLoaderDataRoute<TId>;
|
|
725
|
+
injectNavigate: () => UseNavigateResult<TFullPath>;
|
|
733
726
|
}
|
|
734
727
|
}
|
|
735
728
|
|
|
@@ -744,3 +737,10 @@ declare module '@benjavicente/router-core' {
|
|
|
744
737
|
pendingRouteIds: RouterReadableStore<Record<string, boolean>>;
|
|
745
738
|
}
|
|
746
739
|
}
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
declare global {
|
|
743
|
+
interface Window {
|
|
744
|
+
__TSR_ROUTER_INJECTION_KEY__?: Angular.InjectionToken<AnyRouter>;
|
|
745
|
+
}
|
|
746
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benjavicente/angular-router-experimental",
|
|
3
|
-
"version": "1.142.
|
|
3
|
+
"version": "1.142.15",
|
|
4
4
|
"description": "Modern and scalable routing for Angular applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,12 +53,11 @@
|
|
|
53
53
|
"@tanstack/store": "^0.9.3",
|
|
54
54
|
"isbot": "^5.1.22",
|
|
55
55
|
"tslib": "^2.3.0",
|
|
56
|
-
"@benjavicente/
|
|
57
|
-
"@benjavicente/
|
|
56
|
+
"@benjavicente/history": "1.161.6",
|
|
57
|
+
"@benjavicente/router-core": "1.169.2"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@analogjs/vitest-angular": "^2.2.1",
|
|
61
|
-
"@angular/common": "^21.2.6",
|
|
62
61
|
"@angular/compiler": "^21.2.6",
|
|
63
62
|
"@angular/compiler-cli": "^21.2.6",
|
|
64
63
|
"@angular/core": "^21.2.6",
|
|
@@ -78,7 +77,6 @@
|
|
|
78
77
|
"zod": "^3.24.2"
|
|
79
78
|
},
|
|
80
79
|
"peerDependencies": {
|
|
81
|
-
"@angular/common": "^21.2.6",
|
|
82
80
|
"@angular/core": "^21.2.6"
|
|
83
81
|
},
|
|
84
82
|
"scripts": {
|
|
@@ -13,6 +13,10 @@ import type {
|
|
|
13
13
|
ManagedTagCollection,
|
|
14
14
|
} from './managed-document-types'
|
|
15
15
|
|
|
16
|
+
function hasManagedDocumentRoots(document: Document | null | undefined): document is Document {
|
|
17
|
+
return !!document?.head && !!document?.body
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
function applyManagedDocumentContent({
|
|
17
21
|
document,
|
|
18
22
|
initialTitle,
|
|
@@ -42,6 +46,9 @@ function applyManagedDocumentContent({
|
|
|
42
46
|
*/
|
|
43
47
|
export function installUnifiedTanstackDocumentSync(injectedRouter: AnyRouter) {
|
|
44
48
|
const document = Angular.inject(Angular.DOCUMENT)
|
|
49
|
+
if (!hasManagedDocumentRoots(document)) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
45
52
|
const rendererFactory = Angular.inject(Angular.RendererFactory2, {
|
|
46
53
|
optional: true,
|
|
47
54
|
})
|
|
@@ -14,6 +14,9 @@ import type { ManagedTag } from './managed-document-types'
|
|
|
14
14
|
*/
|
|
15
15
|
export function installTanstackBodyManagedTags(injectedRouter: AnyRouter) {
|
|
16
16
|
const document = Angular.inject(Angular.DOCUMENT)
|
|
17
|
+
if (!document.body) {
|
|
18
|
+
return
|
|
19
|
+
}
|
|
17
20
|
const rendererFactory = Angular.inject(Angular.RendererFactory2, {
|
|
18
21
|
optional: true,
|
|
19
22
|
})
|
|
@@ -10,6 +10,9 @@ import type { ManagedTag } from './managed-document-types'
|
|
|
10
10
|
/** Managed `<head>` tags from active matches (call from an injection context). */
|
|
11
11
|
export function installTanstackHeadManagedTags(injectedRouter: AnyRouter) {
|
|
12
12
|
const document = Angular.inject(Angular.DOCUMENT)
|
|
13
|
+
if (!document.head) {
|
|
14
|
+
return
|
|
15
|
+
}
|
|
13
16
|
const rendererFactory = Angular.inject(Angular.RendererFactory2, {
|
|
14
17
|
optional: true,
|
|
15
18
|
})
|