storybook-framework-cedarjs 4.0.0 → 4.0.1-next.67
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-router.d.ts","sourceRoot":"","sources":["../../src/plugins/mock-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,wBAAgB,UAAU,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"mock-router.d.ts","sourceRoot":"","sources":["../../src/plugins/mock-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,wBAAgB,UAAU,IAAI,YAAY,CAczC"}
|
|
@@ -6,8 +6,7 @@ function mockRouter() {
|
|
|
6
6
|
if (id.includes("src")) {
|
|
7
7
|
code = code.replace(
|
|
8
8
|
"'@cedarjs/router'",
|
|
9
|
-
|
|
10
|
-
"'storybook-framework-cedarjs/dist/mocks/MockRouter'"
|
|
9
|
+
"'@cedarjs/testing/web/MockRouter.js'"
|
|
11
10
|
);
|
|
12
11
|
}
|
|
13
12
|
return code;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-framework-cedarjs",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1-next.67+ad97a60c79",
|
|
4
4
|
"description": "Storybook for CedarJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Storybook",
|
|
@@ -29,9 +29,6 @@
|
|
|
29
29
|
"types": "./dist/preset.d.ts",
|
|
30
30
|
"default": "./dist/preset.js"
|
|
31
31
|
},
|
|
32
|
-
"./dist/mocks/MockRouter": {
|
|
33
|
-
"default": "./dist/mocks/MockRouter.js"
|
|
34
|
-
},
|
|
35
32
|
"./dist/preview.js": "./dist/preview.js",
|
|
36
33
|
"./package.json": "./package.json"
|
|
37
34
|
},
|
|
@@ -52,7 +49,7 @@
|
|
|
52
49
|
"test:watch": "vitest watch"
|
|
53
50
|
},
|
|
54
51
|
"dependencies": {
|
|
55
|
-
"@cedarjs/testing": "4.0.
|
|
52
|
+
"@cedarjs/testing": "4.0.1-next.67+ad97a60c79",
|
|
56
53
|
"@rollup/pluginutils": "5.3.0",
|
|
57
54
|
"@storybook/addon-essentials": "8.6.14",
|
|
58
55
|
"@storybook/builder-vite": "8.6.18",
|
|
@@ -60,6 +57,7 @@
|
|
|
60
57
|
"empathic": "2.0.0",
|
|
61
58
|
"magic-string": "0.30.21",
|
|
62
59
|
"react-docgen": "7.1.1",
|
|
60
|
+
"tsconfig-paths": "^3.15.0",
|
|
63
61
|
"unplugin-auto-import": "19.3.0",
|
|
64
62
|
"vite-plugin-node-polyfills": "0.26.0"
|
|
65
63
|
},
|
|
@@ -91,5 +89,5 @@
|
|
|
91
89
|
],
|
|
92
90
|
"platform": "node"
|
|
93
91
|
},
|
|
94
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "ad97a60c793c21b3263b4178e339d89406f7a7a3"
|
|
95
93
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { RouterProps } from '@cedarjs/router/dist/router';
|
|
3
|
-
export * from '@cedarjs/router/dist/index';
|
|
4
|
-
export declare const routes: {
|
|
5
|
-
[routeName: string]: () => string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* This router populates the `routes.<pageName>()` utility object.
|
|
9
|
-
*/
|
|
10
|
-
export declare const Router: React.FC<RouterProps>;
|
|
11
|
-
//# sourceMappingURL=MockRouter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MockRouter.d.ts","sourceRoot":"","sources":["../../src/mocks/MockRouter.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAG9D,cAAc,4BAA4B,CAAA;AAE1C,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,MAAM,CAAA;CAAO,CAAA;AAE/D;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAcxC,CAAA"}
|
package/dist/mocks/MockRouter.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { flattenAll } from "@cedarjs/router/dist/react-util";
|
|
2
|
-
import { isValidRoute } from "@cedarjs/router/dist/route-validators";
|
|
3
|
-
import { replaceParams } from "@cedarjs/router/dist/util";
|
|
4
|
-
export * from "@cedarjs/router/dist/index";
|
|
5
|
-
const routes = {};
|
|
6
|
-
const Router = ({ children }) => {
|
|
7
|
-
const flatChildArray = flattenAll(children);
|
|
8
|
-
flatChildArray.forEach((child) => {
|
|
9
|
-
if (isValidRoute(child)) {
|
|
10
|
-
const { name, path } = child.props;
|
|
11
|
-
if (name && path) {
|
|
12
|
-
routes[name] = (args = {}) => replaceParams(path, args);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return null;
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
Router,
|
|
20
|
-
routes
|
|
21
|
-
};
|