@storybook/angular 10.1.0-alpha.10 → 10.1.0-alpha.12

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,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_2x62fuu3g38 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_2x62fuu3g38 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_2x62fuu3g38 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_qv1b0zi7im from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_qv1b0zi7im from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_qv1b0zi7im from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_2x62fuu3g38.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_2x62fuu3g38.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_2x62fuu3g38.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_qv1b0zi7im.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_qv1b0zi7im.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_qv1b0zi7im.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -14,13 +14,10 @@ import {
14
14
  printErrorDetails,
15
15
  runCompodoc,
16
16
  up as up2
17
- } from "../../_node-chunks/chunk-QC5VOLQ4.js";
17
+ } from "../../_node-chunks/chunk-6VHHYZRT.js";
18
18
  import {
19
19
  up
20
- } from "../../_node-chunks/chunk-4RJNAYZ2.js";
21
- import {
22
- __name
23
- } from "../../_node-chunks/chunk-CE4PZTEJ.js";
20
+ } from "../../_node-chunks/chunk-CI264AI2.js";
24
21
 
25
22
  // src/builders/start-storybook/index.ts
26
23
  import { readFileSync } from "node:fs";
@@ -32,121 +29,104 @@ import { Observable, from, of } from "rxjs";
32
29
  import { map, mapTo, switchMap } from "rxjs/operators";
33
30
  import { VERSION } from "@angular/core";
34
31
  addToGlobalContext("cliVersion", versions.storybook);
35
- var commandBuilder = /* @__PURE__ */ __name((options, context) => {
36
- const builder = from(setup(options, context)).pipe(
37
- switchMap(({ tsConfig }) => {
38
- const docTSConfig = up("tsconfig.doc.json", {
39
- cwd: options.configDir,
40
- last: getProjectRoot()
41
- });
42
- const runCompodoc$ = options.compodoc ? runCompodoc(
43
- {
44
- compodocArgs: [...options.compodocArgs, ...options.quiet ? ["--silent"] : []],
45
- tsconfig: docTSConfig ?? tsConfig
46
- },
47
- context
48
- ).pipe(mapTo({ tsConfig })) : of({});
49
- return runCompodoc$.pipe(mapTo({ tsConfig }));
50
- }),
51
- map(({ tsConfig }) => {
52
- getEnvConfig(options, {
53
- port: "SBCONFIG_PORT",
54
- host: "SBCONFIG_HOSTNAME",
55
- staticDir: "SBCONFIG_STATIC_DIR",
56
- configDir: "SBCONFIG_CONFIG_DIR",
57
- ci: "CI"
58
- });
59
- options.port = parseInt(`${options.port}`, 10);
60
- const {
61
- browserTarget,
62
- stylePreprocessorOptions,
63
- styles,
64
- ci,
65
- configDir,
66
- docs,
67
- host,
68
- https,
69
- port,
70
- quiet,
71
- enableProdMode = false,
72
- smokeTest,
73
- sslCa,
74
- sslCert,
75
- sslKey,
76
- disableTelemetry,
77
- assets,
78
- initialPath,
79
- open,
80
- debugWebpack,
81
- loglevel,
82
- webpackStatsJson,
83
- statsJson,
84
- previewUrl,
85
- sourceMap = false,
86
- preserveSymlinks = false,
87
- experimentalZoneless = !!(VERSION.major && Number(VERSION.major) >= 21)
88
- } = options;
89
- const packageJsonPath = up2({ cwd: __dirname });
90
- const packageJson = packageJsonPath != null ? JSON.parse(readFileSync(packageJsonPath, "utf8")) : null;
91
- const standaloneOptions = {
92
- packageJson,
93
- ci,
94
- configDir,
95
- ...docs ? { docs } : {},
96
- host,
97
- https,
98
- port,
99
- quiet,
100
- enableProdMode,
101
- smokeTest,
102
- sslCa,
103
- sslCert,
104
- sslKey,
105
- disableTelemetry,
106
- angularBrowserTarget: browserTarget,
107
- angularBuilderContext: context,
108
- angularBuilderOptions: {
109
- ...stylePreprocessorOptions ? { stylePreprocessorOptions } : {},
110
- ...styles ? { styles } : {},
111
- ...assets ? { assets } : {},
112
- preserveSymlinks,
113
- sourceMap,
114
- experimentalZoneless
115
- },
116
- tsConfig,
117
- initialPath,
118
- open,
119
- debugWebpack,
120
- webpackStatsJson,
121
- statsJson,
122
- loglevel,
123
- previewUrl
124
- };
125
- return standaloneOptions;
126
- }),
127
- switchMap((standaloneOptions) => runInstance(standaloneOptions)),
128
- map((port) => {
129
- return { success: true, info: { port } };
130
- })
131
- );
132
- return builder;
133
- }, "commandBuilder");
134
- var start_storybook_default = createBuilder(commandBuilder);
32
+ var commandBuilder = (options, context) => from(setup(options, context)).pipe(
33
+ switchMap(({ tsConfig }) => {
34
+ let docTSConfig = up("tsconfig.doc.json", {
35
+ cwd: options.configDir,
36
+ last: getProjectRoot()
37
+ });
38
+ return (options.compodoc ? runCompodoc(
39
+ {
40
+ compodocArgs: [...options.compodocArgs, ...options.quiet ? ["--silent"] : []],
41
+ tsconfig: docTSConfig ?? tsConfig
42
+ },
43
+ context
44
+ ).pipe(mapTo({ tsConfig })) : of({})).pipe(mapTo({ tsConfig }));
45
+ }),
46
+ map(({ tsConfig }) => {
47
+ getEnvConfig(options, {
48
+ port: "SBCONFIG_PORT",
49
+ host: "SBCONFIG_HOSTNAME",
50
+ staticDir: "SBCONFIG_STATIC_DIR",
51
+ configDir: "SBCONFIG_CONFIG_DIR",
52
+ ci: "CI"
53
+ }), options.port = parseInt(`${options.port}`, 10);
54
+ let {
55
+ browserTarget,
56
+ stylePreprocessorOptions,
57
+ styles,
58
+ ci,
59
+ configDir,
60
+ docs,
61
+ host,
62
+ https,
63
+ port,
64
+ quiet,
65
+ enableProdMode = !1,
66
+ smokeTest,
67
+ sslCa,
68
+ sslCert,
69
+ sslKey,
70
+ disableTelemetry,
71
+ assets,
72
+ initialPath,
73
+ open,
74
+ debugWebpack,
75
+ loglevel,
76
+ webpackStatsJson,
77
+ statsJson,
78
+ previewUrl,
79
+ sourceMap = !1,
80
+ preserveSymlinks = !1,
81
+ experimentalZoneless = !!(VERSION.major && Number(VERSION.major) >= 21)
82
+ } = options, packageJsonPath = up2({ cwd: __dirname });
83
+ return {
84
+ packageJson: packageJsonPath != null ? JSON.parse(readFileSync(packageJsonPath, "utf8")) : null,
85
+ ci,
86
+ configDir,
87
+ ...docs ? { docs } : {},
88
+ host,
89
+ https,
90
+ port,
91
+ quiet,
92
+ enableProdMode,
93
+ smokeTest,
94
+ sslCa,
95
+ sslCert,
96
+ sslKey,
97
+ disableTelemetry,
98
+ angularBrowserTarget: browserTarget,
99
+ angularBuilderContext: context,
100
+ angularBuilderOptions: {
101
+ ...stylePreprocessorOptions ? { stylePreprocessorOptions } : {},
102
+ ...styles ? { styles } : {},
103
+ ...assets ? { assets } : {},
104
+ preserveSymlinks,
105
+ sourceMap,
106
+ experimentalZoneless
107
+ },
108
+ tsConfig,
109
+ initialPath,
110
+ open,
111
+ debugWebpack,
112
+ webpackStatsJson,
113
+ statsJson,
114
+ loglevel,
115
+ previewUrl
116
+ };
117
+ }),
118
+ switchMap((standaloneOptions) => runInstance(standaloneOptions)),
119
+ map((port) => ({ success: !0, info: { port } }))
120
+ ), start_storybook_default = createBuilder(commandBuilder);
135
121
  async function setup(options, context) {
136
- let browserOptions;
137
- let browserTarget;
138
- if (options.browserTarget) {
139
- browserTarget = targetFromTargetString(options.browserTarget);
140
- browserOptions = await context.validateOptions(
141
- await context.getTargetOptions(browserTarget),
142
- await context.getBuilderNameForTarget(browserTarget)
143
- );
144
- }
145
- return {
122
+ let browserOptions, browserTarget;
123
+ return options.browserTarget && (browserTarget = targetFromTargetString(options.browserTarget), browserOptions = await context.validateOptions(
124
+ await context.getTargetOptions(browserTarget),
125
+ await context.getBuilderNameForTarget(browserTarget)
126
+ )), {
146
127
  tsConfig: options.tsConfig ?? up("tsconfig.json", { cwd: options.configDir }) ?? browserOptions.tsConfig
147
128
  };
148
129
  }
149
- __name(setup, "setup");
150
130
  function runInstance(options) {
151
131
  return new Observable((observer) => {
152
132
  withTelemetry(
@@ -162,7 +142,6 @@ function runInstance(options) {
162
142
  });
163
143
  });
164
144
  }
165
- __name(runInstance, "runInstance");
166
145
  export {
167
146
  start_storybook_default as default
168
147
  };
@@ -1,59 +1,40 @@
1
1
  import "../_browser-chunks/chunk-DAHG2CDK.js";
2
2
  import {
3
- __name,
4
3
  computesTemplateFromComponent,
5
4
  render,
6
5
  renderToCanvas
7
- } from "../_browser-chunks/chunk-L4GU2V72.js";
6
+ } from "../_browser-chunks/chunk-6CHBWP5J.js";
8
7
 
9
8
  // src/client/decorateStory.ts
10
9
  import { sanitizeStoryContextUpdate } from "storybook/preview-api";
11
10
  function decorateStory(mainStoryFn, decorators) {
12
- const returnDecorators = [cleanArgsDecorator, ...decorators].reduce(
13
- (previousStoryFn, decorator) => (context) => {
14
- const decoratedStory = decorator((update) => {
15
- return previousStoryFn({
16
- ...context,
17
- ...sanitizeStoryContextUpdate(update)
18
- });
19
- }, context);
20
- return decoratedStory;
21
- },
11
+ return [cleanArgsDecorator, ...decorators].reduce(
12
+ (previousStoryFn, decorator) => (context) => decorator((update) => previousStoryFn({
13
+ ...context,
14
+ ...sanitizeStoryContextUpdate(update)
15
+ }), context),
22
16
  (context) => prepareMain(mainStoryFn(context), context)
23
17
  );
24
- return returnDecorators;
25
18
  }
26
- __name(decorateStory, "decorateStory");
27
- var prepareMain = /* @__PURE__ */ __name((story, context) => {
28
- let { template } = story;
29
- const { component } = context;
30
- const userDefinedTemplate = !hasNoTemplate(template);
31
- if (!userDefinedTemplate && component) {
32
- template = computesTemplateFromComponent(component, story.props, "");
33
- }
34
- return {
19
+ var prepareMain = (story, context) => {
20
+ let { template } = story, { component } = context, userDefinedTemplate = !hasNoTemplate(template);
21
+ return !userDefinedTemplate && component && (template = computesTemplateFromComponent(component, story.props, "")), {
35
22
  ...story,
36
23
  ...template ? { template, userDefinedTemplate } : {}
37
24
  };
38
- }, "prepareMain");
25
+ };
39
26
  function hasNoTemplate(template) {
40
- return template === null || template === void 0;
27
+ return template == null;
41
28
  }
42
- __name(hasNoTemplate, "hasNoTemplate");
43
- var cleanArgsDecorator = /* @__PURE__ */ __name((storyFn, context) => {
44
- if (!context.argTypes || !context.args) {
29
+ var cleanArgsDecorator = (storyFn, context) => {
30
+ if (!context.argTypes || !context.args)
45
31
  return storyFn();
46
- }
47
- const argsToClean = context.args;
48
- context.args = Object.entries(argsToClean).reduce((obj, [key, arg]) => {
49
- const argType = context.argTypes[key];
50
- if (argType?.action || argType?.control) {
51
- return { ...obj, [key]: arg };
52
- }
53
- return obj;
54
- }, {});
55
- return storyFn();
56
- }, "cleanArgsDecorator");
32
+ let argsToClean = context.args;
33
+ return context.args = Object.entries(argsToClean).reduce((obj, [key, arg]) => {
34
+ let argType = context.argTypes[key];
35
+ return argType?.action || argType?.control ? { ...obj, [key]: arg } : obj;
36
+ }, {}), storyFn();
37
+ };
57
38
 
58
39
  // src/client/config.ts
59
40
  import { enhanceArgTypes } from "storybook/internal/docs-tools";
@@ -61,38 +42,14 @@ import { enhanceArgTypes } from "storybook/internal/docs-tools";
61
42
  // src/client/compodoc.ts
62
43
  import { logger } from "storybook/internal/client-logger";
63
44
  import { global } from "@storybook/global";
64
- var { FEATURES } = global;
65
- var isMethod = /* @__PURE__ */ __name((methodOrProp) => {
66
- return methodOrProp.args !== void 0;
67
- }, "isMethod");
68
- var getCompodocJson = /* @__PURE__ */ __name(() => global.__STORYBOOK_COMPODOC_JSON__, "getCompodocJson");
69
- var checkValidComponentOrDirective = /* @__PURE__ */ __name((component) => {
70
- if (!component.name) {
45
+ var { FEATURES } = global, isMethod = (methodOrProp) => methodOrProp.args !== void 0;
46
+ var getCompodocJson = () => global.__STORYBOOK_COMPODOC_JSON__, checkValidComponentOrDirective = (component) => {
47
+ if (!component.name)
71
48
  throw new Error(`Invalid component ${JSON.stringify(component)}`);
72
- }
73
- }, "checkValidComponentOrDirective");
74
- var checkValidCompodocJson = /* @__PURE__ */ __name((compodocJson) => {
75
- if (!compodocJson || !compodocJson.components) {
49
+ }, checkValidCompodocJson = (compodocJson) => {
50
+ if (!compodocJson || !compodocJson.components)
76
51
  throw new Error("Invalid compodoc JSON");
77
- }
78
- }, "checkValidCompodocJson");
79
- var hasDecorator = /* @__PURE__ */ __name((item, decoratorName) => item.decorators && item.decorators.find((x) => x.name === decoratorName), "hasDecorator");
80
- var mapPropertyToSection = /* @__PURE__ */ __name((item) => {
81
- if (hasDecorator(item, "ViewChild")) {
82
- return "view child";
83
- }
84
- if (hasDecorator(item, "ViewChildren")) {
85
- return "view children";
86
- }
87
- if (hasDecorator(item, "ContentChild")) {
88
- return "content child";
89
- }
90
- if (hasDecorator(item, "ContentChildren")) {
91
- return "content children";
92
- }
93
- return "properties";
94
- }, "mapPropertyToSection");
95
- var mapItemToSection = /* @__PURE__ */ __name((key, item) => {
52
+ }, hasDecorator = (item, decoratorName) => item.decorators && item.decorators.find((x) => x.name === decoratorName), mapPropertyToSection = (item) => hasDecorator(item, "ViewChild") ? "view child" : hasDecorator(item, "ViewChildren") ? "view children" : hasDecorator(item, "ContentChild") ? "content child" : hasDecorator(item, "ContentChildren") ? "content children" : "properties", mapItemToSection = (key, item) => {
96
53
  switch (key) {
97
54
  case "methods":
98
55
  case "methodsClass":
@@ -103,59 +60,40 @@ var mapItemToSection = /* @__PURE__ */ __name((key, item) => {
103
60
  return "outputs";
104
61
  case "properties":
105
62
  case "propertiesClass":
106
- if (isMethod(item)) {
63
+ if (isMethod(item))
107
64
  throw new Error("Cannot be of type Method if key === 'propertiesClass'");
108
- }
109
65
  return mapPropertyToSection(item);
110
66
  default:
111
67
  throw new Error(`Unknown key: ${key}`);
112
68
  }
113
- }, "mapItemToSection");
114
- var findComponentByName = /* @__PURE__ */ __name((name, compodocJson) => compodocJson.components.find((c) => c.name === name) || compodocJson.directives.find((c) => c.name === name) || compodocJson.pipes.find((c) => c.name === name) || compodocJson.injectables.find((c) => c.name === name) || compodocJson.classes.find((c) => c.name === name), "findComponentByName");
115
- var getComponentData = /* @__PURE__ */ __name((component) => {
116
- if (!component) {
69
+ }, findComponentByName = (name, compodocJson) => compodocJson.components.find((c) => c.name === name) || compodocJson.directives.find((c) => c.name === name) || compodocJson.pipes.find((c) => c.name === name) || compodocJson.injectables.find((c) => c.name === name) || compodocJson.classes.find((c) => c.name === name), getComponentData = (component) => {
70
+ if (!component)
117
71
  return null;
118
- }
119
72
  checkValidComponentOrDirective(component);
120
- const compodocJson = getCompodocJson();
121
- if (!compodocJson) {
73
+ let compodocJson = getCompodocJson();
74
+ if (!compodocJson)
122
75
  return null;
123
- }
124
76
  checkValidCompodocJson(compodocJson);
125
- const { name } = component;
126
- const metadata = findComponentByName(name, compodocJson);
127
- if (!metadata) {
128
- logger.warn(`Component not found in compodoc JSON: '${name}'`);
129
- }
130
- return metadata;
131
- }, "getComponentData");
132
- var displaySignature = /* @__PURE__ */ __name((item) => {
133
- const args = item.args.map(
134
- (arg) => `${arg.name}${arg.optional ? "?" : ""}: ${arg.type}`
135
- );
136
- return `(${args.join(", ")}) => ${item.returnType}`;
137
- }, "displaySignature");
138
- var extractTypeFromValue = /* @__PURE__ */ __name((defaultValue) => {
139
- const valueType = typeof defaultValue;
77
+ let { name } = component, metadata = findComponentByName(name, compodocJson);
78
+ return metadata || logger.warn(`Component not found in compodoc JSON: '${name}'`), metadata;
79
+ }, displaySignature = (item) => `(${item.args.map(
80
+ (arg) => `${arg.name}${arg.optional ? "?" : ""}: ${arg.type}`
81
+ ).join(", ")}) => ${item.returnType}`, extractTypeFromValue = (defaultValue) => {
82
+ let valueType = typeof defaultValue;
140
83
  return defaultValue || valueType === "number" || valueType === "boolean" || valueType === "string" ? valueType : null;
141
- }, "extractTypeFromValue");
142
- var extractEnumValues = /* @__PURE__ */ __name((compodocType) => {
143
- const compodocJson = getCompodocJson();
144
- const enumType = compodocJson?.miscellaneous?.enumerations?.find((x) => x.name === compodocType);
145
- if (enumType?.childs.every((x) => x.value)) {
84
+ }, extractEnumValues = (compodocType) => {
85
+ let enumType = getCompodocJson()?.miscellaneous?.enumerations?.find((x) => x.name === compodocType);
86
+ if (enumType?.childs.every((x) => x.value))
146
87
  return enumType.childs.map((x) => x.value);
147
- }
148
- if (typeof compodocType !== "string" || compodocType.indexOf("|") === -1) {
88
+ if (typeof compodocType != "string" || compodocType.indexOf("|") === -1)
149
89
  return null;
150
- }
151
90
  try {
152
91
  return compodocType.split("|").map((value) => JSON.parse(value));
153
- } catch (e) {
92
+ } catch {
154
93
  return null;
155
94
  }
156
- }, "extractEnumValues");
157
- var extractType = /* @__PURE__ */ __name((property, defaultValue) => {
158
- const compodocType = property.type || extractTypeFromValue(defaultValue);
95
+ }, extractType = (property, defaultValue) => {
96
+ let compodocType = property.type || extractTypeFromValue(defaultValue);
159
97
  switch (compodocType) {
160
98
  case "string":
161
99
  case "boolean":
@@ -165,80 +103,57 @@ var extractType = /* @__PURE__ */ __name((property, defaultValue) => {
165
103
  case null:
166
104
  return { name: "other", value: "void" };
167
105
  default: {
168
- const resolvedType = resolveTypealias(compodocType);
169
- const enumValues = extractEnumValues(resolvedType);
106
+ let resolvedType = resolveTypealias(compodocType), enumValues = extractEnumValues(resolvedType);
170
107
  return enumValues ? { name: "enum", value: enumValues } : { name: "other", value: "empty-enum" };
171
108
  }
172
109
  }
173
- }, "extractType");
174
- var castDefaultValue = /* @__PURE__ */ __name((property, defaultValue) => {
175
- const compodocType = property.type;
176
- if (["boolean", "number", "string", "EventEmitter"].includes(compodocType)) {
110
+ }, castDefaultValue = (property, defaultValue) => {
111
+ let compodocType = property.type;
112
+ if (["boolean", "number", "string", "EventEmitter"].includes(compodocType))
177
113
  switch (compodocType) {
178
114
  case "boolean":
179
115
  return defaultValue === "true";
180
116
  case "number":
181
117
  return Number(defaultValue);
182
118
  case "EventEmitter":
183
- return void 0;
119
+ return;
184
120
  default:
185
121
  return defaultValue;
186
122
  }
187
- } else {
123
+ else
188
124
  switch (defaultValue) {
189
125
  case "true":
190
- return true;
126
+ return !0;
191
127
  case "false":
192
- return false;
128
+ return !1;
193
129
  case "null":
194
130
  return null;
195
131
  case "undefined":
196
- return void 0;
132
+ return;
197
133
  default:
198
134
  return defaultValue;
199
135
  }
200
- }
201
- }, "castDefaultValue");
202
- var extractDefaultValueFromComments = /* @__PURE__ */ __name((property, value) => {
136
+ }, extractDefaultValueFromComments = (property, value) => {
203
137
  let commentValue = value;
204
- property.jsdoctags.forEach((tag) => {
205
- if (["default", "defaultvalue"].includes(tag.tagName.escapedText)) {
206
- const dom = new global.DOMParser().parseFromString(tag.comment, "text/html");
207
- commentValue = dom.body.textContent;
208
- }
209
- });
210
- return commentValue;
211
- }, "extractDefaultValueFromComments");
212
- var extractDefaultValue = /* @__PURE__ */ __name((property) => {
138
+ return property.jsdoctags.forEach((tag) => {
139
+ ["default", "defaultvalue"].includes(tag.tagName.escapedText) && (commentValue = new global.DOMParser().parseFromString(tag.comment, "text/html").body.textContent);
140
+ }), commentValue;
141
+ }, extractDefaultValue = (property) => {
213
142
  try {
214
143
  let value = property.defaultValue?.replace(/^'(.*)'$/, "$1");
215
- value = castDefaultValue(property, value);
216
- if (value == null && property.jsdoctags?.length > 0) {
217
- value = extractDefaultValueFromComments(property, value);
218
- }
219
- return value;
220
- } catch (err) {
144
+ return value = castDefaultValue(property, value), value == null && property.jsdoctags?.length > 0 && (value = extractDefaultValueFromComments(property, value)), value;
145
+ } catch {
221
146
  logger.debug(`Error extracting ${property.name}: ${property.defaultValue}`);
222
- return void 0;
147
+ return;
223
148
  }
224
- }, "extractDefaultValue");
225
- var resolveTypealias = /* @__PURE__ */ __name((compodocType) => {
226
- const compodocJson = getCompodocJson();
227
- const typeAlias = compodocJson?.miscellaneous?.typealiases?.find((x) => x.name === compodocType);
149
+ }, resolveTypealias = (compodocType) => {
150
+ let typeAlias = getCompodocJson()?.miscellaneous?.typealiases?.find((x) => x.name === compodocType);
228
151
  return typeAlias ? resolveTypealias(typeAlias.rawtype) : compodocType;
229
- }, "resolveTypealias");
230
- var extractArgTypesFromData = /* @__PURE__ */ __name((componentData) => {
231
- const sectionToItems = {};
232
- const componentClasses = FEATURES.angularFilterNonInputControls ? ["inputsClass"] : ["propertiesClass", "methodsClass", "inputsClass", "outputsClass"];
233
- const compodocClasses = ["component", "directive"].includes(componentData.type) ? componentClasses : ["properties", "methods"];
234
- compodocClasses.forEach((key) => {
235
- const data = componentData[key] || [];
236
- data.forEach((item) => {
237
- const section = mapItemToSection(key, item);
238
- const defaultValue = isMethod(item) ? void 0 : extractDefaultValue(item);
239
- const type = isMethod(item) || section !== "inputs" && section !== "properties" ? { name: "other", value: "void" } : extractType(item, defaultValue);
240
- const action = section === "outputs" ? { action: item.name } : {};
241
- const argType = {
152
+ }, extractArgTypesFromData = (componentData) => {
153
+ let sectionToItems = {}, componentClasses = FEATURES.angularFilterNonInputControls ? ["inputsClass"] : ["propertiesClass", "methodsClass", "inputsClass", "outputsClass"];
154
+ (["component", "directive"].includes(componentData.type) ? componentClasses : ["properties", "methods"]).forEach((key) => {
155
+ (componentData[key] || []).forEach((item) => {
156
+ let section = mapItemToSection(key, item), defaultValue = isMethod(item) ? void 0 : extractDefaultValue(item), type = isMethod(item) || section !== "inputs" && section !== "properties" ? { name: "other", value: "void" } : extractType(item, defaultValue), action = section === "outputs" ? { action: item.name } : {}, argType = {
242
157
  name: item.name,
243
158
  description: item.rawdescription || item.description,
244
159
  type,
@@ -247,18 +162,15 @@ var extractArgTypesFromData = /* @__PURE__ */ __name((componentData) => {
247
162
  category: section,
248
163
  type: {
249
164
  summary: isMethod(item) ? displaySignature(item) : item.type,
250
- required: isMethod(item) ? false : !item.optional
165
+ required: isMethod(item) ? !1 : !item.optional
251
166
  },
252
167
  defaultValue: { summary: defaultValue }
253
168
  }
254
169
  };
255
- if (!sectionToItems[section]) {
256
- sectionToItems[section] = [];
257
- }
258
- sectionToItems[section].push(argType);
170
+ sectionToItems[section] || (sectionToItems[section] = []), sectionToItems[section].push(argType);
259
171
  });
260
172
  });
261
- const SECTIONS = [
173
+ let SECTIONS = [
262
174
  "properties",
263
175
  "inputs",
264
176
  "outputs",
@@ -267,37 +179,30 @@ var extractArgTypesFromData = /* @__PURE__ */ __name((componentData) => {
267
179
  "view children",
268
180
  "content child",
269
181
  "content children"
270
- ];
271
- const argTypes = {};
272
- SECTIONS.forEach((section) => {
273
- const items = sectionToItems[section];
274
- if (items) {
275
- items.forEach((argType) => {
276
- argTypes[argType.name] = argType;
277
- });
278
- }
279
- });
280
- return argTypes;
281
- }, "extractArgTypesFromData");
282
- var extractArgTypes = /* @__PURE__ */ __name((component) => {
283
- const componentData = getComponentData(component);
182
+ ], argTypes = {};
183
+ return SECTIONS.forEach((section) => {
184
+ let items = sectionToItems[section];
185
+ items && items.forEach((argType) => {
186
+ argTypes[argType.name] = argType;
187
+ });
188
+ }), argTypes;
189
+ }, extractArgTypes = (component) => {
190
+ let componentData = getComponentData(component);
284
191
  return componentData && extractArgTypesFromData(componentData);
285
- }, "extractArgTypes");
286
- var extractComponentDescription = /* @__PURE__ */ __name((component) => {
287
- const componentData = getComponentData(component);
192
+ }, extractComponentDescription = (component) => {
193
+ let componentData = getComponentData(component);
288
194
  return componentData && (componentData.rawdescription || componentData.description);
289
- }, "extractComponentDescription");
195
+ };
290
196
 
291
197
  // src/client/config.ts
292
198
  var parameters = {
293
199
  renderer: "angular",
294
200
  docs: {
295
- story: { inline: true },
201
+ story: { inline: !0 },
296
202
  extractArgTypes,
297
203
  extractComponentDescription
298
204
  }
299
- };
300
- var argTypesEnhancers = [enhanceArgTypes];
205
+ }, argTypesEnhancers = [enhanceArgTypes];
301
206
  export {
302
207
  decorateStory as applyDecorators,
303
208
  argTypesEnhancers,