@storybook/angular 10.1.0-alpha.9 → 10.1.0-beta.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.
@@ -1,7 +1,6 @@
1
1
  import {
2
- __name,
3
2
  computesTemplateSourceFromComponent
4
- } from "../../_browser-chunks/chunk-L4GU2V72.js";
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 = /* @__PURE__ */ __name((context) => {
13
- const sourceParams = context?.parameters.docs?.source;
14
- if (sourceParams?.type === SourceType.DYNAMIC) {
15
- return false;
16
- }
17
- return sourceParams?.code || sourceParams?.type === SourceType.CODE;
18
- }, "skipSourceRender");
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
- const sourceFromComponent = computesTemplateSourceFromComponent(component, props, argTypes);
31
- const newSource = sourceFromComponent || template;
32
- if (newSource && newSource !== source.current) {
33
- emitTransformCode(newSource, context);
34
- source.current = newSource;
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
@@ -4,9 +4,9 @@ import {
4
4
  componentWrapperDecorator,
5
5
  moduleMetadata,
6
6
  setProjectAnnotations
7
- } from "../_browser-chunks/chunk-CV6HSYTZ.js";
7
+ } from "../_browser-chunks/chunk-T32Z4CGF.js";
8
8
  import "../_browser-chunks/chunk-DAHG2CDK.js";
9
- import "../_browser-chunks/chunk-L4GU2V72.js";
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-CV6HSYTZ.js";
7
+ } from "./_browser-chunks/chunk-T32Z4CGF.js";
8
8
  import "./_browser-chunks/chunk-DAHG2CDK.js";
9
- import "./_browser-chunks/chunk-L4GU2V72.js";
9
+ import "./_browser-chunks/chunk-6CHBWP5J.js";
10
10
  export {
11
11
  applicationConfig,
12
12
  argsToTemplate,
@@ -1,23 +1,19 @@
1
- import CJS_COMPAT_NODE_URL_4jamwxc2gs3 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_4jamwxc2gs3 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_4jamwxc2gs3 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_tvjgcptid3o from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_tvjgcptid3o from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_tvjgcptid3o from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_4jamwxc2gs3.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_4jamwxc2gs3.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_4jamwxc2gs3.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_tvjgcptid3o.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_tvjgcptid3o.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_tvjgcptid3o.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 CJS_COMPAT_NODE_URL_4jamwxc2gs3 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_4jamwxc2gs3 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_4jamwxc2gs3 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_tvjgcptid3o from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_tvjgcptid3o from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_tvjgcptid3o from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_4jamwxc2gs3.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_4jamwxc2gs3.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_4jamwxc2gs3.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_tvjgcptid3o.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_tvjgcptid3o.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_tvjgcptid3o.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
- var previewAnnotations = /* @__PURE__ */ __name(async (entries = [], options) => {
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
- const previewProdPath = fileURLToPath(
21
+ let previewProdPath = fileURLToPath(
27
22
  import.meta.resolve("@storybook/angular/client/preview-prod")
28
23
  );
29
24
  annotations.unshift(previewProdPath);
30
25
  }
31
- const docsConfig = await options.presets.apply("docs", {}, options);
32
- const docsEnabled = Object.keys(docsConfig).length > 0;
33
- if (docsEnabled) {
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
- }, "previewAnnotations");
41
- var core = /* @__PURE__ */ __name(async (config, options) => {
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 === "string" ? {} : framework.options.builder || {}
40
+ options: typeof framework == "string" ? {} : framework.options.builder || {}
48
41
  }
49
42
  };
50
- }, "core");
51
- var typescript = /* @__PURE__ */ __name(async (config) => {
52
- return {
53
- ...config,
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,