@tanstack/react-router 0.0.1-beta.79 → 0.0.1-beta.80

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.
@@ -7,7 +7,7 @@
7
7
  "name": "index.production.js",
8
8
  "children": [
9
9
  {
10
- "uid": "9710-109",
10
+ "uid": "5504-109",
11
11
  "name": "\u0000rollupPluginBabelHelpers.js"
12
12
  },
13
13
  {
@@ -15,11 +15,11 @@
15
15
  "children": [
16
16
  {
17
17
  "name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
18
- "uid": "9710-111"
18
+ "uid": "5504-111"
19
19
  },
20
20
  {
21
21
  "name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
22
- "uid": "9710-113"
22
+ "uid": "5504-113"
23
23
  }
24
24
  ]
25
25
  },
@@ -28,19 +28,19 @@
28
28
  "children": [
29
29
  {
30
30
  "name": "store/build/esm/index.js",
31
- "uid": "9710-115"
31
+ "uid": "5504-115"
32
32
  },
33
33
  {
34
34
  "name": "router/build/esm/index.js",
35
- "uid": "9710-117"
35
+ "uid": "5504-117"
36
36
  },
37
37
  {
38
38
  "name": "react-store/build/esm/index.js",
39
- "uid": "9710-119"
39
+ "uid": "5504-119"
40
40
  },
41
41
  {
42
42
  "name": "react-router/src/index.tsx",
43
- "uid": "9710-121"
43
+ "uid": "5504-121"
44
44
  }
45
45
  ]
46
46
  }
@@ -50,176 +50,176 @@
50
50
  "isRoot": true
51
51
  },
52
52
  "nodeParts": {
53
- "9710-109": {
53
+ "5504-109": {
54
54
  "renderedLength": 429,
55
55
  "gzipLength": 238,
56
56
  "brotliLength": 0,
57
- "mainUid": "9710-108"
57
+ "mainUid": "5504-108"
58
58
  },
59
- "9710-111": {
59
+ "5504-111": {
60
60
  "renderedLength": 181,
61
61
  "gzipLength": 129,
62
62
  "brotliLength": 0,
63
- "mainUid": "9710-110"
63
+ "mainUid": "5504-110"
64
64
  },
65
- "9710-113": {
65
+ "5504-113": {
66
66
  "renderedLength": 44,
67
67
  "gzipLength": 62,
68
68
  "brotliLength": 0,
69
- "mainUid": "9710-112"
69
+ "mainUid": "5504-112"
70
70
  },
71
- "9710-115": {
71
+ "5504-115": {
72
72
  "renderedLength": 1288,
73
73
  "gzipLength": 497,
74
74
  "brotliLength": 0,
75
- "mainUid": "9710-114"
75
+ "mainUid": "5504-114"
76
76
  },
77
- "9710-117": {
77
+ "5504-117": {
78
78
  "renderedLength": 49433,
79
79
  "gzipLength": 11720,
80
80
  "brotliLength": 0,
81
- "mainUid": "9710-116"
81
+ "mainUid": "5504-116"
82
82
  },
83
- "9710-119": {
83
+ "5504-119": {
84
84
  "renderedLength": 1571,
85
85
  "gzipLength": 594,
86
86
  "brotliLength": 0,
87
- "mainUid": "9710-118"
87
+ "mainUid": "5504-118"
88
88
  },
89
- "9710-121": {
90
- "renderedLength": 12277,
91
- "gzipLength": 3110,
89
+ "5504-121": {
90
+ "renderedLength": 12297,
91
+ "gzipLength": 3115,
92
92
  "brotliLength": 0,
93
- "mainUid": "9710-120"
93
+ "mainUid": "5504-120"
94
94
  }
95
95
  },
96
96
  "nodeMetas": {
97
- "9710-108": {
97
+ "5504-108": {
98
98
  "id": "\u0000rollupPluginBabelHelpers.js",
99
99
  "moduleParts": {
100
- "index.production.js": "9710-109"
100
+ "index.production.js": "5504-109"
101
101
  },
102
102
  "imported": [],
103
103
  "importedBy": [
104
104
  {
105
- "uid": "9710-120"
105
+ "uid": "5504-120"
106
106
  }
107
107
  ]
108
108
  },
109
- "9710-110": {
109
+ "5504-110": {
110
110
  "id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
111
111
  "moduleParts": {
112
- "index.production.js": "9710-111"
112
+ "index.production.js": "5504-111"
113
113
  },
114
114
  "imported": [],
115
115
  "importedBy": [
116
116
  {
117
- "uid": "9710-116"
117
+ "uid": "5504-116"
118
118
  }
119
119
  ]
120
120
  },
121
- "9710-112": {
121
+ "5504-112": {
122
122
  "id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
123
123
  "moduleParts": {
124
- "index.production.js": "9710-113"
124
+ "index.production.js": "5504-113"
125
125
  },
126
126
  "imported": [],
127
127
  "importedBy": [
128
128
  {
129
- "uid": "9710-116"
129
+ "uid": "5504-116"
130
130
  }
131
131
  ]
132
132
  },
133
- "9710-114": {
133
+ "5504-114": {
134
134
  "id": "/packages/store/build/esm/index.js",
135
135
  "moduleParts": {
136
- "index.production.js": "9710-115"
136
+ "index.production.js": "5504-115"
137
137
  },
138
138
  "imported": [],
139
139
  "importedBy": [
140
140
  {
141
- "uid": "9710-116"
141
+ "uid": "5504-116"
142
142
  }
143
143
  ]
144
144
  },
145
- "9710-116": {
145
+ "5504-116": {
146
146
  "id": "/packages/router/build/esm/index.js",
147
147
  "moduleParts": {
148
- "index.production.js": "9710-117"
148
+ "index.production.js": "5504-117"
149
149
  },
150
150
  "imported": [
151
151
  {
152
- "uid": "9710-110"
152
+ "uid": "5504-110"
153
153
  },
154
154
  {
155
- "uid": "9710-112"
155
+ "uid": "5504-112"
156
156
  },
157
157
  {
158
- "uid": "9710-114"
158
+ "uid": "5504-114"
159
159
  }
160
160
  ],
161
161
  "importedBy": [
162
162
  {
163
- "uid": "9710-120"
163
+ "uid": "5504-120"
164
164
  }
165
165
  ]
166
166
  },
167
- "9710-118": {
167
+ "5504-118": {
168
168
  "id": "/packages/react-store/build/esm/index.js",
169
169
  "moduleParts": {
170
- "index.production.js": "9710-119"
170
+ "index.production.js": "5504-119"
171
171
  },
172
172
  "imported": [
173
173
  {
174
- "uid": "9710-123"
174
+ "uid": "5504-123"
175
175
  }
176
176
  ],
177
177
  "importedBy": [
178
178
  {
179
- "uid": "9710-120"
179
+ "uid": "5504-120"
180
180
  }
181
181
  ]
182
182
  },
183
- "9710-120": {
183
+ "5504-120": {
184
184
  "id": "/packages/react-router/src/index.tsx",
185
185
  "moduleParts": {
186
- "index.production.js": "9710-121"
186
+ "index.production.js": "5504-121"
187
187
  },
188
188
  "imported": [
189
189
  {
190
- "uid": "9710-108"
190
+ "uid": "5504-108"
191
191
  },
192
192
  {
193
- "uid": "9710-122"
193
+ "uid": "5504-122"
194
194
  },
195
195
  {
196
- "uid": "9710-116"
196
+ "uid": "5504-116"
197
197
  },
198
198
  {
199
- "uid": "9710-118"
199
+ "uid": "5504-118"
200
200
  }
201
201
  ],
202
202
  "importedBy": [],
203
203
  "isEntry": true
204
204
  },
205
- "9710-122": {
205
+ "5504-122": {
206
206
  "id": "react",
207
207
  "moduleParts": {},
208
208
  "imported": [],
209
209
  "importedBy": [
210
210
  {
211
- "uid": "9710-120"
211
+ "uid": "5504-120"
212
212
  }
213
213
  ],
214
214
  "isExternal": true
215
215
  },
216
- "9710-123": {
216
+ "5504-123": {
217
217
  "id": "use-sync-external-store/shim/with-selector",
218
218
  "moduleParts": {},
219
219
  "imported": [],
220
220
  "importedBy": [
221
221
  {
222
- "uid": "9710-118"
222
+ "uid": "5504-118"
223
223
  }
224
224
  ],
225
225
  "isExternal": true
@@ -53,7 +53,7 @@ declare module '@tanstack/router' {
53
53
  }
54
54
  type PromptProps = {
55
55
  message: string;
56
- when?: boolean | any;
56
+ condition?: boolean | any;
57
57
  children?: ReactNode;
58
58
  };
59
59
  declare function useLinkProps<TFrom extends ValidFromPath<RegisteredRoutesInfo> = '/', TTo extends string = ''>(options: MakeLinkPropsOptions<TFrom, TTo>): React.AnchorHTMLAttributes<HTMLAnchorElement>;
@@ -106,7 +106,7 @@ declare function Outlet(): JSX.Element | null;
106
106
  declare function ErrorComponent({ error }: {
107
107
  error: any;
108
108
  }): JSX.Element;
109
- declare function useBlocker(message: string, when?: boolean | any): void;
110
- declare function Block({ message, when, children }: PromptProps): any;
109
+ declare function useBlocker(message: string, condition?: boolean | any): void;
110
+ declare function Block({ message, condition, children }: PromptProps): any;
111
111
 
112
112
  export { Block, ErrorComponent, Link, LinkFn, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, MatchesProviderProps, Navigate, Outlet, PromptProps, ReactRouter, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, lazy, matchesContext, routerContext, useBlocker, useLinkProps, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRoute, useRouter, useRouterContext, useSearch };
@@ -2185,10 +2185,10 @@
2185
2185
  }
2186
2186
  }, error.message ? /*#__PURE__*/React__namespace.createElement("code", null, error.message) : null)));
2187
2187
  }
2188
- function useBlocker(message, when = true) {
2188
+ function useBlocker(message, condition = true) {
2189
2189
  const router = useRouter();
2190
2190
  React__namespace.useEffect(() => {
2191
- if (!when) return;
2191
+ if (!condition) return;
2192
2192
  let unblock = router.history.block((retry, cancel) => {
2193
2193
  if (window.confirm(message)) {
2194
2194
  unblock();
@@ -2202,10 +2202,10 @@
2202
2202
  }
2203
2203
  function Block({
2204
2204
  message,
2205
- when,
2205
+ condition,
2206
2206
  children
2207
2207
  }) {
2208
- useBlocker(message, when);
2208
+ useBlocker(message, condition);
2209
2209
  return children ?? null;
2210
2210
  }
2211
2211