@storybook/angular 10.1.0-alpha.9 → 10.1.0-beta.0
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-6CHBWP5J.js +711 -0
- package/dist/_browser-chunks/{chunk-CV6HSYTZ.js → chunk-T32Z4CGF.js} +13 -28
- package/dist/_node-chunks/chunk-YMPHFUN2.js +43 -0
- package/dist/_node-chunks/chunk-Z5FLT7AH.js +62 -0
- package/dist/builders/build-storybook/index.js +87 -102
- package/dist/builders/start-storybook/index.js +104 -124
- package/dist/client/config.js +84 -179
- package/dist/client/docs/config.js +15 -33
- package/dist/client/index.js +2 -2
- package/dist/index.js +2 -2
- package/dist/node/index.js +6 -10
- package/dist/preset.js +19 -29
- package/dist/server/framework-preset-angular-cli.js +156 -158
- package/dist/server/framework-preset-angular-ivy.js +16 -25
- package/package.json +16 -17
- package/dist/_browser-chunks/chunk-L4GU2V72.js +0 -939
- package/dist/_node-chunks/chunk-PBNB2IPX.js +0 -17
- package/dist/_node-chunks/chunk-RLZZSHQD.js +0 -93
- package/dist/_node-chunks/chunk-T6SLYNLE.js +0 -58
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__name,
|
|
3
2
|
computesTemplateSourceFromComponent
|
|
4
|
-
} from "../../_browser-chunks/chunk-
|
|
3
|
+
} from "../../_browser-chunks/chunk-6CHBWP5J.js";
|
|
5
4
|
|
|
6
5
|
// src/client/docs/config.ts
|
|
7
6
|
import { SourceType as SourceType2 } from "storybook/internal/docs-tools";
|
|
@@ -9,37 +8,21 @@ import { SourceType as SourceType2 } from "storybook/internal/docs-tools";
|
|
|
9
8
|
// src/client/docs/sourceDecorator.ts
|
|
10
9
|
import { SourceType } from "storybook/internal/docs-tools";
|
|
11
10
|
import { useRef, emitTransformCode, useEffect } from "storybook/preview-api";
|
|
12
|
-
var skipSourceRender =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
var sourceDecorator = /* @__PURE__ */ __name((storyFn, context) => {
|
|
20
|
-
const story = storyFn();
|
|
21
|
-
const source = useRef(void 0);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (skipSourceRender(context)) {
|
|
11
|
+
var skipSourceRender = (context) => {
|
|
12
|
+
let sourceParams = context?.parameters.docs?.source;
|
|
13
|
+
return sourceParams?.type === SourceType.DYNAMIC ? !1 : sourceParams?.code || sourceParams?.type === SourceType.CODE;
|
|
14
|
+
}, sourceDecorator = (storyFn, context) => {
|
|
15
|
+
let story = storyFn(), source = useRef(void 0);
|
|
16
|
+
return useEffect(() => {
|
|
17
|
+
if (skipSourceRender(context))
|
|
24
18
|
return;
|
|
25
|
-
}
|
|
26
|
-
const { props, userDefinedTemplate } = story;
|
|
27
|
-
const { component, argTypes, parameters: parameters2 } = context;
|
|
28
|
-
const template = parameters2.docs?.source?.excludeDecorators ? context.originalStoryFn(context.args, context).template : story.template;
|
|
19
|
+
let { props, userDefinedTemplate } = story, { component, argTypes, parameters: parameters2 } = context, template = parameters2.docs?.source?.excludeDecorators ? context.originalStoryFn(context.args, context).template : story.template;
|
|
29
20
|
if (component && !userDefinedTemplate) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
} else if (template && template !== source.current) {
|
|
37
|
-
emitTransformCode(template, context);
|
|
38
|
-
source.current = template;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return story;
|
|
42
|
-
}, "sourceDecorator");
|
|
21
|
+
let newSource = computesTemplateSourceFromComponent(component, props, argTypes) || template;
|
|
22
|
+
newSource && newSource !== source.current && (emitTransformCode(newSource, context), source.current = newSource);
|
|
23
|
+
} else template && template !== source.current && (emitTransformCode(template, context), source.current = template);
|
|
24
|
+
}), story;
|
|
25
|
+
};
|
|
43
26
|
|
|
44
27
|
// src/client/docs/config.ts
|
|
45
28
|
var parameters = {
|
|
@@ -49,8 +32,7 @@ var parameters = {
|
|
|
49
32
|
language: "html"
|
|
50
33
|
}
|
|
51
34
|
}
|
|
52
|
-
};
|
|
53
|
-
var decorators = [sourceDecorator];
|
|
35
|
+
}, decorators = [sourceDecorator];
|
|
54
36
|
export {
|
|
55
37
|
decorators,
|
|
56
38
|
parameters
|
package/dist/client/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
componentWrapperDecorator,
|
|
5
5
|
moduleMetadata,
|
|
6
6
|
setProjectAnnotations
|
|
7
|
-
} from "../_browser-chunks/chunk-
|
|
7
|
+
} from "../_browser-chunks/chunk-T32Z4CGF.js";
|
|
8
8
|
import "../_browser-chunks/chunk-DAHG2CDK.js";
|
|
9
|
-
import "../_browser-chunks/chunk-
|
|
9
|
+
import "../_browser-chunks/chunk-6CHBWP5J.js";
|
|
10
10
|
export {
|
|
11
11
|
applicationConfig,
|
|
12
12
|
argsToTemplate,
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
componentWrapperDecorator,
|
|
5
5
|
moduleMetadata,
|
|
6
6
|
setProjectAnnotations
|
|
7
|
-
} from "./_browser-chunks/chunk-
|
|
7
|
+
} from "./_browser-chunks/chunk-T32Z4CGF.js";
|
|
8
8
|
import "./_browser-chunks/chunk-DAHG2CDK.js";
|
|
9
|
-
import "./_browser-chunks/chunk-
|
|
9
|
+
import "./_browser-chunks/chunk-6CHBWP5J.js";
|
|
10
10
|
export {
|
|
11
11
|
applicationConfig,
|
|
12
12
|
argsToTemplate,
|
package/dist/node/index.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_ysqodpy6j9j from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ysqodpy6j9j from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ysqodpy6j9j from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ysqodpy6j9j.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ysqodpy6j9j.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ysqodpy6j9j.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "../_node-chunks/chunk-PBNB2IPX.js";
|
|
15
12
|
|
|
16
13
|
// src/node/index.ts
|
|
17
14
|
function defineMain(config) {
|
|
18
15
|
return config;
|
|
19
16
|
}
|
|
20
|
-
__name(defineMain, "defineMain");
|
|
21
17
|
export {
|
|
22
18
|
defineMain
|
|
23
19
|
};
|
package/dist/preset.js
CHANGED
|
@@ -1,59 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_ysqodpy6j9j from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ysqodpy6j9j from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ysqodpy6j9j from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ysqodpy6j9j.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ysqodpy6j9j.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ysqodpy6j9j.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./_node-chunks/chunk-PBNB2IPX.js";
|
|
15
12
|
|
|
16
13
|
// src/preset.ts
|
|
17
14
|
import { fileURLToPath } from "node:url";
|
|
18
15
|
var addons = [
|
|
19
16
|
fileURLToPath(import.meta.resolve("@storybook/angular/server/framework-preset-angular-cli")),
|
|
20
17
|
fileURLToPath(import.meta.resolve("@storybook/angular/server/framework-preset-angular-ivy"))
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
const config = fileURLToPath(import.meta.resolve("@storybook/angular/client/config"));
|
|
24
|
-
const annotations = [...entries, config];
|
|
18
|
+
], previewAnnotations = async (entries = [], options) => {
|
|
19
|
+
let config = fileURLToPath(import.meta.resolve("@storybook/angular/client/config")), annotations = [...entries, config];
|
|
25
20
|
if (options.enableProdMode) {
|
|
26
|
-
|
|
21
|
+
let previewProdPath = fileURLToPath(
|
|
27
22
|
import.meta.resolve("@storybook/angular/client/preview-prod")
|
|
28
23
|
);
|
|
29
24
|
annotations.unshift(previewProdPath);
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const docsConfigPath = fileURLToPath(
|
|
26
|
+
let docsConfig = await options.presets.apply("docs", {}, options);
|
|
27
|
+
if (Object.keys(docsConfig).length > 0) {
|
|
28
|
+
let docsConfigPath = fileURLToPath(
|
|
35
29
|
import.meta.resolve("@storybook/angular/client/docs/config")
|
|
36
30
|
);
|
|
37
31
|
annotations.push(docsConfigPath);
|
|
38
32
|
}
|
|
39
33
|
return annotations;
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
const framework = await options.presets.apply("framework");
|
|
34
|
+
}, core = async (config, options) => {
|
|
35
|
+
let framework = await options.presets.apply("framework");
|
|
43
36
|
return {
|
|
44
37
|
...config,
|
|
45
38
|
builder: {
|
|
46
39
|
name: import.meta.resolve("@storybook/builder-webpack5"),
|
|
47
|
-
options: typeof framework
|
|
40
|
+
options: typeof framework == "string" ? {} : framework.options.builder || {}
|
|
48
41
|
}
|
|
49
42
|
};
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
skipCompiler: true
|
|
55
|
-
};
|
|
56
|
-
}, "typescript");
|
|
43
|
+
}, typescript = async (config) => ({
|
|
44
|
+
...config,
|
|
45
|
+
skipCompiler: !0
|
|
46
|
+
});
|
|
57
47
|
export {
|
|
58
48
|
addons,
|
|
59
49
|
core,
|