prev-cli 0.21.0 → 0.21.1
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/package.json +1 -1
- package/src/theme/entry.tsx +19 -7
package/package.json
CHANGED
package/src/theme/entry.tsx
CHANGED
|
@@ -343,17 +343,24 @@ const rootRoute = createRootRoute({
|
|
|
343
343
|
component: RootLayout,
|
|
344
344
|
})
|
|
345
345
|
|
|
346
|
-
// Previews
|
|
347
|
-
const
|
|
346
|
+
// Previews layout route (just passes through to children)
|
|
347
|
+
const previewsLayoutRoute = createRoute({
|
|
348
348
|
getParentRoute: () => rootRoute,
|
|
349
349
|
path: '/previews',
|
|
350
|
+
component: () => <Outlet />,
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
// Previews catalog route (index)
|
|
354
|
+
const previewsCatalogRoute = createRoute({
|
|
355
|
+
getParentRoute: () => previewsLayoutRoute,
|
|
356
|
+
path: '/',
|
|
350
357
|
component: PreviewsCatalog,
|
|
351
358
|
})
|
|
352
359
|
|
|
353
|
-
// Individual preview route (
|
|
360
|
+
// Individual preview route (splat captures nested paths like buttons/primary)
|
|
354
361
|
const previewDetailRoute = createRoute({
|
|
355
|
-
getParentRoute: () =>
|
|
356
|
-
path: '
|
|
362
|
+
getParentRoute: () => previewsLayoutRoute,
|
|
363
|
+
path: '$',
|
|
357
364
|
component: PreviewPage,
|
|
358
365
|
})
|
|
359
366
|
|
|
@@ -390,9 +397,14 @@ function NotFoundPage() {
|
|
|
390
397
|
}
|
|
391
398
|
|
|
392
399
|
// Create router with notFoundRoute
|
|
393
|
-
|
|
394
|
-
|
|
400
|
+
// Previews routes: layout with catalog (index) and detail (splat) children
|
|
401
|
+
const previewsRouteWithChildren = previewsLayoutRoute.addChildren([
|
|
402
|
+
previewsCatalogRoute,
|
|
395
403
|
previewDetailRoute,
|
|
404
|
+
])
|
|
405
|
+
|
|
406
|
+
const routeTree = rootRoute.addChildren([
|
|
407
|
+
previewsRouteWithChildren,
|
|
396
408
|
...(indexRedirectRoute ? [indexRedirectRoute] : []),
|
|
397
409
|
...pageRoutes,
|
|
398
410
|
])
|