@storybook/tanstack-react 0.0.0-pr-35044-sha-4ef63dcf → 0.0.0-pr-34837-sha-bef69a85
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/_browser-chunks/{chunk-WQHJSC2D.js → chunk-SNKUITN7.js} +1 -4
- package/dist/export-mocks/react-router.js +3 -7
- package/dist/index.js +1 -2
- package/dist/node/index.js +6 -6
- package/dist/preset.js +6 -6
- package/dist/preview.js +1 -2
- package/package.json +5 -5
- package/dist/_browser-chunks/chunk-XKNIZ3MM.js +0 -19
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
normalizeFileRoutePath
|
|
3
|
-
} from "./chunk-XKNIZ3MM.js";
|
|
4
1
|
import {
|
|
5
2
|
__export
|
|
6
3
|
} from "./chunk-4BE7D4DS.js";
|
|
@@ -134,7 +131,7 @@ function createStoryRouter({
|
|
|
134
131
|
context,
|
|
135
132
|
routerContext
|
|
136
133
|
}) {
|
|
137
|
-
let routerParameters = context.parameters.tanstack?.router ?? {}, { tree, leaf } = resolveTree(Story, context), routeTree = tree.root, inferredPath = routerParameters?.path || leaf.fullPath ||
|
|
134
|
+
let routerParameters = context.parameters.tanstack?.router ?? {}, { tree, leaf } = resolveTree(Story, context), routeTree = tree.root, inferredPath = routerParameters?.path || leaf.fullPath || routeTree.children?.[0]?.fullPath || "/", resolvedPath = interpolatePath({
|
|
138
135
|
path: inferredPath,
|
|
139
136
|
params: routerParameters?.params ?? {}
|
|
140
137
|
}).interpolatedPath, search = routerParameters?.query ? defaultStringifySearch(routerParameters.query) : "";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
normalizeFileRoutePath
|
|
3
|
-
} from "../_browser-chunks/chunk-XKNIZ3MM.js";
|
|
4
1
|
import {
|
|
5
2
|
onNavigate
|
|
6
3
|
} from "../_browser-chunks/chunk-4CKCBIXI.js";
|
|
@@ -51,15 +48,14 @@ var useNavigate = fn(_useNavigate).mockName("@tanstack/react-router::useNavigate
|
|
|
51
48
|
);
|
|
52
49
|
};
|
|
53
50
|
function createFileRoute(path) {
|
|
54
|
-
let normalizedPath = normalizeFileRoutePath(path);
|
|
55
51
|
return (options) => createRoute({
|
|
56
|
-
path
|
|
52
|
+
path,
|
|
57
53
|
...options,
|
|
58
54
|
isRoot: !1
|
|
59
55
|
}).update({
|
|
60
56
|
id: path,
|
|
61
|
-
path
|
|
62
|
-
fullPath:
|
|
57
|
+
path,
|
|
58
|
+
fullPath: path
|
|
63
59
|
// any because tanstack router does that
|
|
64
60
|
});
|
|
65
61
|
}
|
package/dist/index.js
CHANGED
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_t3fpqqa2et from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_t3fpqqa2et from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_t3fpqqa2et from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_t3fpqqa2et.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_t3fpqqa2et.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_t3fpqqa2et.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_t3fpqqa2et from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_t3fpqqa2et from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_t3fpqqa2et from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_t3fpqqa2et.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_t3fpqqa2et.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_t3fpqqa2et.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preview.js
CHANGED
|
@@ -3,8 +3,7 @@ import {
|
|
|
3
3
|
loaders,
|
|
4
4
|
optimizeDeps,
|
|
5
5
|
parameters
|
|
6
|
-
} from "./_browser-chunks/chunk-
|
|
7
|
-
import "./_browser-chunks/chunk-XKNIZ3MM.js";
|
|
6
|
+
} from "./_browser-chunks/chunk-SNKUITN7.js";
|
|
8
7
|
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
|
9
8
|
export {
|
|
10
9
|
applyDecorators,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/tanstack-react",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-34837-sha-bef69a85",
|
|
4
4
|
"description": "Storybook for TanStack (React, Vite): Router and Start ready Storybook framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"!src/**/*"
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@storybook/builder-vite": "0.0.0-pr-
|
|
79
|
-
"@storybook/react": "0.0.0-pr-
|
|
80
|
-
"@storybook/react-vite": "0.0.0-pr-
|
|
78
|
+
"@storybook/builder-vite": "0.0.0-pr-34837-sha-bef69a85",
|
|
79
|
+
"@storybook/react": "0.0.0-pr-34837-sha-bef69a85",
|
|
80
|
+
"@storybook/react-vite": "0.0.0-pr-34837-sha-bef69a85"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@tanstack/react-router": "^1.168.10",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@tanstack/start-client-core": "^1.167.9",
|
|
96
96
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
97
97
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
98
|
-
"storybook": "^0.0.0-pr-
|
|
98
|
+
"storybook": "^0.0.0-pr-34837-sha-bef69a85",
|
|
99
99
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependenciesMeta": {
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/routing/path-utils.ts
|
|
2
|
-
var possiblyNestedRouteGroupPatternRegex = /\([^/]+\)\/?/g;
|
|
3
|
-
function removeGroups(s) {
|
|
4
|
-
return s.replace(possiblyNestedRouteGroupPatternRegex, "");
|
|
5
|
-
}
|
|
6
|
-
function removeLayoutSegments(routePath = "/") {
|
|
7
|
-
return routePath.split("/").filter((segment) => !segment.startsWith("_")).join("/");
|
|
8
|
-
}
|
|
9
|
-
var underscoreStartEndRegex = /(^_|_$)/gi, underscoreSlashRegex = /(\/_|_\/)/gi;
|
|
10
|
-
function removeUnderscores(s) {
|
|
11
|
-
return s?.replace(underscoreStartEndRegex, "").replace(underscoreSlashRegex, "/");
|
|
12
|
-
}
|
|
13
|
-
function normalizeFileRoutePath(path) {
|
|
14
|
-
return removeGroups(removeUnderscores(removeLayoutSegments(path)) ?? "") || "/";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
normalizeFileRoutePath
|
|
19
|
-
};
|