@storybook/angular-vite 10.6.0-alpha.6 → 10.6.0-alpha.7

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/build-schema.json CHANGED
@@ -60,16 +60,16 @@
60
60
  },
61
61
  "compodoc": {
62
62
  "type": "boolean",
63
- "description": "Execute compodoc before.",
64
- "default": true
63
+ "description": "Deprecated. Compodoc no longer runs.",
64
+ "x-deprecated": "Compodoc no longer runs. @storybook/angular-vite extracts Angular metadata in-process, so this option does nothing. Remove it from angular.json."
65
65
  },
66
66
  "compodocArgs": {
67
67
  "type": "array",
68
- "description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
69
- "default": ["-e", "json"],
68
+ "description": "Deprecated. Compodoc no longer runs.",
70
69
  "items": {
71
70
  "type": "string"
72
- }
71
+ },
72
+ "x-deprecated": "Compodoc no longer runs. @storybook/angular-vite extracts Angular metadata in-process, so this option does nothing. Remove it from angular.json."
73
73
  },
74
74
  "statsJson": {
75
75
  "type": ["boolean", "string"],
@@ -104,6 +104,34 @@
104
104
  "items": {
105
105
  "type": "string"
106
106
  }
107
+ },
108
+ "sass": {
109
+ "description": "Options to pass to the sass preprocessor.",
110
+ "type": "object",
111
+ "properties": {
112
+ "fatalDeprecations": {
113
+ "description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.",
114
+ "type": "array",
115
+ "items": {
116
+ "type": "string"
117
+ }
118
+ },
119
+ "silenceDeprecations": {
120
+ "description": "A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.",
121
+ "type": "array",
122
+ "items": {
123
+ "type": "string"
124
+ }
125
+ },
126
+ "futureDeprecations": {
127
+ "description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.",
128
+ "type": "array",
129
+ "items": {
130
+ "type": "string"
131
+ }
132
+ }
133
+ },
134
+ "additionalProperties": false
107
135
  }
108
136
  },
109
137
  "additionalProperties": false
@@ -1,10 +1,9 @@
1
1
  import {
2
2
  __export,
3
3
  computesTemplateFromComponent,
4
- getComponentInputsOutputs,
5
4
  render,
6
5
  renderToCanvas
7
- } from "./chunk-ECGMCGUZ.js";
6
+ } from "./chunk-UJ3I56EP.js";
8
7
 
9
8
  // src/client/config.ts
10
9
  var config_exports = {};
@@ -23,7 +22,7 @@ global.STORYBOOK_ENV = "angular";
23
22
  // src/client/decorateStory.ts
24
23
  import { sanitizeStoryContextUpdate } from "storybook/preview-api";
25
24
  function decorateStory(mainStoryFn, decorators) {
26
- return [cleanArgsDecorator, ...decorators].reduce(
25
+ return decorators.reduce(
27
26
  (previousStoryFn, decorator) => (context) => decorator((update) => previousStoryFn({
28
27
  ...context,
29
28
  ...sanitizeStoryContextUpdate(update)
@@ -41,21 +40,10 @@ var prepareMain = (story, context) => {
41
40
  function hasNoTemplate(template) {
42
41
  return template == null;
43
42
  }
44
- var cleanArgsDecorator = (storyFn, context) => {
45
- if (!context.argTypes || !context.args || Object.keys(context.argTypes).length === 0)
46
- return storyFn();
47
- let componentIO = context.component ? getComponentInputsOutputs(context.component) : { inputs: [], outputs: [] }, componentBindings = /* @__PURE__ */ new Set([
48
- ...componentIO.inputs.map((i) => i.templateName),
49
- ...componentIO.outputs.map((o) => o.templateName)
50
- ]), argsToClean = context.args;
51
- return context.args = Object.entries(argsToClean).reduce((obj, [key, arg]) => {
52
- let argType = context.argTypes[key];
53
- return argType?.action || argType?.control || componentBindings.has(key) ? { ...obj, [key]: arg } : obj;
54
- }, {}), storyFn();
55
- };
56
43
 
57
44
  // src/client/config.ts
58
45
  import { enhanceArgTypes } from "storybook/internal/docs-tools";
46
+ import { global as global3 } from "@storybook/global";
59
47
 
60
48
  // ../../../node_modules/entities/lib/esm/generated/decode-data-html.js
61
49
  var decode_data_html_default = new Uint16Array(
@@ -422,7 +410,7 @@ var EncodingMode;
422
410
  EncodingMode2[EncodingMode2.UTF8 = 0] = "UTF8", EncodingMode2[EncodingMode2.ASCII = 1] = "ASCII", EncodingMode2[EncodingMode2.Extensive = 2] = "Extensive", EncodingMode2[EncodingMode2.Attribute = 3] = "Attribute", EncodingMode2[EncodingMode2.Text = 4] = "Text";
423
411
  })(EncodingMode || (EncodingMode = {}));
424
412
 
425
- // ../../lib/angular-compodoc/dist/_browser-chunks/chunk-Q5BEVNMG.js
413
+ // ../../lib/angular-compodoc/dist/_browser-chunks/chunk-FMGKBLGO.js
426
414
  var NOOP_LOGGER = {
427
415
  warn: () => {
428
416
  },
@@ -497,7 +485,7 @@ var SECTION_ORDER = [
497
485
  componentFile
498
486
  );
499
487
  return typeAlias ? (seen.add(compodocType), resolveTypealias(typeAlias.rawtype, compodocJson, componentFile, seen)) : compodocType;
500
- }, isFunctionTypeString = (compodocType) => compodocType === "function" || /^\(.*\)\s*=>/.test(compodocType), extractType = (property, defaultValue, compodocJson, componentFile, modern = !1) => {
488
+ }, isFunctionTypeString = (compodocType) => compodocType === "function" || /^(new\s+)?(<.*>\s*)?\(.*\)\s*=>/.test(compodocType), extractType = (property, defaultValue, compodocJson, componentFile, modern = !1) => {
501
489
  let compodocType = property.type || extractTypeFromValue(defaultValue);
502
490
  switch (compodocType) {
503
491
  case "string":
@@ -602,12 +590,12 @@ var SECTION_ORDER = [
602
590
  });
603
591
  }, extractArgTypesFromData = (componentData, {
604
592
  compodocJson,
605
- filterNonInputControls,
593
+ filterNonInputControls: filterNonInputControls2,
606
594
  logger: logger2 = NOOP_LOGGER,
607
595
  unwrapHtml: unwrapHtml2,
608
596
  modern = !1
609
597
  }) => {
610
- let sectionToItems = {}, componentClasses = filterNonInputControls ? ["inputsClass"] : ["propertiesClass", "methodsClass", "inputsClass", "outputsClass"], compodocClasses = isDirectiveEntry(componentData) ? componentClasses : ["properties", "methods"], modelProperties = getModelProperties(componentData), modelPropertyNames = new Set(modelProperties.map((item) => item.name));
598
+ let sectionToItems = {}, componentClasses = filterNonInputControls2 ? ["inputsClass"] : ["propertiesClass", "methodsClass", "inputsClass", "outputsClass"], compodocClasses = isDirectiveEntry(componentData) ? componentClasses : ["properties", "methods"], modelProperties = getModelProperties(componentData), modelPropertyNames = new Set(modelProperties.map((item) => item.name));
611
599
  compodocClasses.forEach((key) => {
612
600
  readMembers(componentData, key).forEach((item) => {
613
601
  if (modern && item.name.startsWith("#"))
@@ -663,27 +651,28 @@ import { logger } from "storybook/internal/client-logger";
663
651
  import { global as global2 } from "@storybook/global";
664
652
  var { FEATURES } = global2;
665
653
  var getCompodocJson = () => global2.__STORYBOOK_COMPODOC_JSON__;
666
- var unwrapHtml = (html) => new global2.DOMParser().parseFromString(html, "text/html").body.textContent ?? "", extractArgTypesFromData2 = (componentData) => extractArgTypesFromData(componentData, {
654
+ var unwrapHtml = (html) => new global2.DOMParser().parseFromString(html, "text/html").body.textContent ?? "", extractArgTypesFromData2 = (componentData, { filterNonInputControls: filterNonInputControls2 = FEATURES.angularFilterNonInputControls } = {}) => extractArgTypesFromData(componentData, {
667
655
  compodocJson: getCompodocJson(),
668
- // Asserted rather than optional-chained: a preview without `FEATURES` is broken, and this has
669
- // always thrown there rather than silently reading the flag as `false`.
670
- filterNonInputControls: FEATURES.angularFilterNonInputControls,
656
+ filterNonInputControls: filterNonInputControls2,
671
657
  logger,
672
658
  unwrapHtml
673
- }), extractArgTypes = (component) => {
659
+ }), extractArgTypes = (component, options) => {
674
660
  let componentData = getComponentData(component, { compodocJson: getCompodocJson(), logger });
675
- return componentData && extractArgTypesFromData2(componentData);
661
+ return componentData && extractArgTypesFromData2(componentData, options);
676
662
  }, extractComponentDescription = (component) => {
677
663
  let componentData = getComponentData(component, { compodocJson: getCompodocJson(), logger });
678
664
  return componentData && (componentData.rawdescription || componentData.description);
679
665
  };
680
666
 
667
+ // src/client/compodoc.ts
668
+ var filterNonInputControls = typeof STORYBOOK_ANGULAR_OPTIONS > "u" || STORYBOOK_ANGULAR_OPTIONS.propsTable === void 0 ? void 0 : STORYBOOK_ANGULAR_OPTIONS.propsTable === "inputs", extractArgTypes2 = (component) => extractArgTypes(component, { filterNonInputControls });
669
+
681
670
  // src/client/config.ts
682
671
  var parameters = {
683
672
  renderer: "angular",
684
673
  docs: {
685
674
  story: { inline: !0 },
686
- extractArgTypes,
675
+ extractArgTypes: (component) => global3.FEATURES?.experimentalDocgenServer === !0 ? {} : extractArgTypes2(component),
687
676
  extractComponentDescription
688
677
  }
689
678
  }, argTypesEnhancers = [enhanceArgTypes];
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  config_exports
3
- } from "./chunk-CHMLOECK.js";
3
+ } from "./chunk-AL7GEPYM.js";
4
4
  import {
5
5
  config_exports as config_exports2
6
- } from "./chunk-BUNW7ROM.js";
6
+ } from "./chunk-VP3W5GY3.js";
7
7
  import {
8
8
  computesTemplateFromComponent,
9
9
  formatPropInTemplate,
10
10
  isComponent,
11
11
  render_exports
12
- } from "./chunk-ECGMCGUZ.js";
12
+ } from "./chunk-UJ3I56EP.js";
13
13
 
14
14
  // src/client/portable-stories.ts
15
15
  import {
@@ -64,27 +64,28 @@ var isValidIdentifier = (name) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name), forma
64
64
  "source",
65
65
  "track",
66
66
  "wbr"
67
- ]), LEADING_CLASS = /^\..+/, LEADING_ATTRIBUTE = /^\[.+?]/, ID = /#([\w-]+)/, CLASS_RUN = /(\.[\w-]+)+/, ATTRIBUTE = /\[(.+?)]/g, ELEMENT_AND_ATTRIBUTES = /(\S+)(.*)/, MAX_SINGLE_LINE = 80, buildTemplate = (selector, { inputs, outputs, innerTemplate = "" }) => {
67
+ ]), LEADING_CLASS = /^\..+/, LEADING_ATTRIBUTE = /^\[.+?]/, ID = /#([\w-]+)/, CLASS_RUN = /(\.[\w-]+)+/, ATTRIBUTE = /\[(.+?)]/g, ELEMENT_AND_ATTRIBUTES = /(\S+)(.*)/, MAX_SINGLE_LINE = 80, buildTemplate = (selector, { inputs, outputs, innerTemplate = "", selfClosing = !1 }) => {
68
68
  let bindings = [
69
69
  ...inputs.map(({ name, expression }) => `[${name}]="${expression}"`),
70
70
  ...outputs.map((name) => `(${name})="${formatPropInTemplate(name)}($event)"`)
71
71
  ], firstSelector = selector.split(",")[0];
72
72
  return (LEADING_CLASS.test(firstSelector) || LEADING_ATTRIBUTE.test(firstSelector) ? `div${firstSelector}` : firstSelector).replace(ID, ' id="$1"').replace(CLASS_RUN, (classes) => ` class="${classes.split(".").join(" ").trim()}"`).replace(ATTRIBUTE, " $1").replace(ELEMENT_AND_ATTRIBUTES, (_, element, attributes) => {
73
- let inlineTag = `<${element}${attributes}${bindings.map((binding) => ` ${binding}`).join("")}`, inline = VOID_ELEMENTS.has(element) ? `${inlineTag} />` : `${inlineTag}>${innerTemplate}</${element}>`;
73
+ let closesItself = VOID_ELEMENTS.has(element) || selfClosing && element.includes("-") && innerTemplate === "", inlineTag = `<${element}${attributes}${bindings.map((binding) => ` ${binding}`).join("")}`, inline = closesItself ? `${inlineTag} />` : `${inlineTag}>${innerTemplate}</${element}>`;
74
74
  if (inline.length <= MAX_SINGLE_LINE || bindings.length === 0)
75
75
  return inline;
76
76
  let brokenTag = `<${element}${attributes}
77
77
  ${bindings.map((binding) => ` ${binding}`).join(`
78
78
  `)}`;
79
- if (VOID_ELEMENTS.has(element))
80
- return `${brokenTag} />`;
79
+ if (closesItself)
80
+ return selfClosing ? `${brokenTag}
81
+ />` : `${brokenTag} />`;
81
82
  let content = innerTemplate === "" ? `
82
83
  ` : `
83
84
  ${innerTemplate}
84
85
  `;
85
86
  return `${brokenTag}>${content}</${element}>`;
86
87
  });
87
- }, buildComponentOutletTemplate = (componentName) => `<ng-container *ngComponentOutlet="${componentName}"></ng-container>`;
88
+ }, buildComponentOutletTemplate = (componentName, { selfClosing = !1 } = {}) => selfClosing ? `<ng-container *ngComponentOutlet="${componentName}" />` : `<ng-container *ngComponentOutlet="${componentName}"></ng-container>`;
88
89
 
89
90
  // src/client/renderer/utils/NgComponentAnalyzer.ts
90
91
  import {
@@ -703,7 +704,6 @@ async function renderToCanvas({
703
704
  export {
704
705
  __export,
705
706
  formatPropInTemplate,
706
- getComponentInputsOutputs,
707
707
  isComponent,
708
708
  computesTemplateFromComponent,
709
709
  computesTemplateSourceFromComponent,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __export,
3
3
  computesTemplateSourceFromComponent
4
- } from "./chunk-ECGMCGUZ.js";
4
+ } from "./chunk-UJ3I56EP.js";
5
5
 
6
6
  // src/client/docs/config.ts
7
7
  var config_exports = {};
@@ -31,14 +31,14 @@ var skipSourceRender = (context) => {
31
31
  };
32
32
 
33
33
  // src/client/docs/config.ts
34
- var language = globalThis.FEATURES?.experimentalDocgenServer ? "ts" : "html", parameters = {
34
+ var useStaticServiceSnippets = globalThis.FEATURES?.experimentalDocgenServer === !0, parameters = {
35
35
  docs: {
36
36
  source: {
37
37
  type: SourceType2.DYNAMIC,
38
- language
38
+ language: useStaticServiceSnippets ? "ts" : "html"
39
39
  }
40
40
  }
41
- }, decorators = [sourceDecorator];
41
+ }, decorators = useStaticServiceSnippets ? [] : [sourceDecorator];
42
42
 
43
43
  export {
44
44
  parameters,
@@ -0,0 +1,42 @@
1
+ import CJS_COMPAT_NODE_URL_8ni5g5ueuqs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8ni5g5ueuqs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_8ni5g5ueuqs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8ni5g5ueuqs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+
13
+ // src/docgen/resolve-component.ts
14
+ import {
15
+ createMetaComponentResolver,
16
+ createModuleResolver,
17
+ jsTsSourceExtensions
18
+ } from "storybook/internal/common";
19
+ import { loadCsf } from "storybook/internal/csf-tools";
20
+ import { readFileSync } from "node:fs";
21
+ var resolveMetaComponent = createMetaComponentResolver(), storyImportResolver = createModuleResolver({
22
+ extensions: [...jsTsSourceExtensions],
23
+ mainFields: ["module", "main"],
24
+ tsconfig: "auto"
25
+ });
26
+ function parseStoryFile(storyFilePath, title) {
27
+ try {
28
+ let source = readFileSync(storyFilePath, "utf8");
29
+ return loadCsf(source, { makeTitle: () => title }).parse();
30
+ } catch {
31
+ return;
32
+ }
33
+ }
34
+ function resolveStoryComponent(storyFilePath, title = "Docgen") {
35
+ let csf = parseStoryFile(storyFilePath, title);
36
+ return csf ? resolveMetaComponent(csf, storyFilePath) : { reason: "no-meta-component" };
37
+ }
38
+
39
+ export {
40
+ parseStoryFile,
41
+ resolveStoryComponent
42
+ };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ze1vib595n from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ze1vib595n from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ze1vib595n from "node:module";
1
+ import CJS_COMPAT_NODE_URL_8ni5g5ueuqs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8ni5g5ueuqs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ze1vib595n.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ze1vib595n.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ze1vib595n.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_8ni5g5ueuqs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8ni5g5ueuqs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_ze1vib595n from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ze1vib595n from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ze1vib595n from "node:module";
1
+ import CJS_COMPAT_NODE_URL_8ni5g5ueuqs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8ni5g5ueuqs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ze1vib595n.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ze1vib595n.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ze1vib595n.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_8ni5g5ueuqs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8ni5g5ueuqs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  up
14
- } from "./chunk-ORVVXDOZ.js";
14
+ } from "./chunk-QNPJ2GGJ.js";
15
15
 
16
16
  // ../../../node_modules/empathic/package.mjs
17
17
  function up2(options) {
@@ -0,0 +1,163 @@
1
+ import CJS_COMPAT_NODE_URL_8ni5g5ueuqs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8ni5g5ueuqs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_8ni5g5ueuqs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8ni5g5ueuqs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+
13
+ // src/docgen/story-docs-template-analysis.ts
14
+ import {
15
+ CombinedRecursiveAstVisitor,
16
+ ImplicitReceiver,
17
+ LiteralPrimitive,
18
+ PropertyRead,
19
+ R3TargetBinder,
20
+ ThisReceiver,
21
+ TmplAstTextAttribute,
22
+ parseTemplate
23
+ } from "@angular/compiler";
24
+ var StoryTemplateVisitor = class extends CombinedRecursiveAstVisitor {
25
+ constructor(target, expansions) {
26
+ super();
27
+ this.referencedNames = /* @__PURE__ */ new Set();
28
+ this.boundOutputs = /* @__PURE__ */ new Set();
29
+ this.errors = /* @__PURE__ */ new Set();
30
+ this.replacements = [];
31
+ this.seenExpansionMarkers = /* @__PURE__ */ new Set();
32
+ this.inEventHandler = !1;
33
+ this.target = target, this.expansions = expansions;
34
+ }
35
+ visitElement(element) {
36
+ this.recordExpansions(element.attributes, element.outputs), super.visitElement(element);
37
+ }
38
+ visitTemplate(template) {
39
+ this.recordExpansions(
40
+ [
41
+ ...template.attributes,
42
+ ...template.templateAttrs.filter(
43
+ (attribute) => attribute instanceof TmplAstTextAttribute
44
+ )
45
+ ],
46
+ template.outputs
47
+ ), super.visitTemplate(template);
48
+ }
49
+ visitPropertyRead(ast) {
50
+ this.recordComponentReference(ast), super.visitPropertyRead(ast, void 0);
51
+ }
52
+ visitSafePropertyRead(ast) {
53
+ this.recordComponentReference(ast), super.visitSafePropertyRead(ast, void 0);
54
+ }
55
+ visitKeyedRead(ast) {
56
+ this.recordComponentKey(ast), super.visitKeyedRead(ast, void 0);
57
+ }
58
+ visitSafeKeyedRead(ast) {
59
+ this.recordComponentKey(ast), super.visitSafeKeyedRead(ast, void 0);
60
+ }
61
+ visitCall(ast) {
62
+ let previous = this.builtinAnyReceiver;
63
+ this.builtinAnyReceiver = isBuiltinAnyCall(ast) ? ast.receiver : void 0;
64
+ try {
65
+ super.visitCall(ast, void 0);
66
+ } finally {
67
+ this.builtinAnyReceiver = previous;
68
+ }
69
+ }
70
+ visitBoundEvent(event) {
71
+ this.boundOutputs.add(event.name);
72
+ let wasInEventHandler = this.inEventHandler;
73
+ this.inEventHandler = !0, super.visitBoundEvent(event), this.inEventHandler = wasInEventHandler;
74
+ }
75
+ recordComponentReference(ast) {
76
+ this.isComponentReceiver(ast.receiver) && this.target.getExpressionTarget(ast) === null && ast !== this.builtinAnyReceiver && !(this.inEventHandler && ast.name === "$event") && this.referencedNames.add(ast.name);
77
+ }
78
+ recordExpansions(attributes, outputs) {
79
+ let occupiedOutputs = new Set(outputs.map((output) => output.name)), markers = attributes.map((attribute) => ({ attribute, expansion: this.expansions.get(attribute.name) })).filter(
80
+ (entry) => entry.expansion !== void 0 && !this.seenExpansionMarkers.has(entry.attribute.name)
81
+ ).sort(
82
+ (left, right) => left.attribute.sourceSpan.start.offset - right.attribute.sourceSpan.start.offset
83
+ );
84
+ for (let { attribute, expansion } of markers) {
85
+ this.seenExpansionMarkers.add(attribute.name);
86
+ let outputAttributes = expansion.outputAttributes.filter(
87
+ ({ name }) => !occupiedOutputs.has(name)
88
+ );
89
+ outputAttributes.forEach(({ name }) => {
90
+ occupiedOutputs.add(name), this.boundOutputs.add(name);
91
+ }), this.replacements.push({
92
+ marker: attribute.name,
93
+ start: attribute.sourceSpan.start.offset,
94
+ end: attribute.sourceSpan.end.offset,
95
+ text: [...expansion.inputAttributes, ...outputAttributes.map(({ markup }) => markup)].join(
96
+ " "
97
+ )
98
+ });
99
+ }
100
+ }
101
+ recordComponentKey(ast) {
102
+ !this.isComponentReceiver(ast.receiver) || this.target.getExpressionTarget(ast) !== null || (ast.key instanceof LiteralPrimitive && typeof ast.key.value == "string" ? this.referencedNames.add(ast.key.value) : this.errors.add("A component-root keyed read has a dynamic key."));
103
+ }
104
+ isComponentReceiver(receiver) {
105
+ return receiver instanceof ImplicitReceiver || receiver instanceof ThisReceiver;
106
+ }
107
+ }, isBuiltinAnyCall = (ast) => ast.receiver instanceof PropertyRead && ast.receiver.name === "$any" && ast.receiver.receiver instanceof ImplicitReceiver && !(ast.receiver.receiver instanceof ThisReceiver), analyzeStoryTemplate = (markup, expansions = []) => {
108
+ let expansionMap = new Map(expansions.map((expansion) => [expansion.marker, expansion]));
109
+ try {
110
+ let parsed = parseTemplate(markup, "storybook-template.html");
111
+ if (parsed.errors)
112
+ return {
113
+ kind: "unresolvable",
114
+ markup: materializeWithoutAnalysis(markup, expansions),
115
+ errors: parsed.errors.map((error) => error.toString())
116
+ };
117
+ let target = new R3TargetBinder(null).bind({ template: parsed.nodes }), visitor = new StoryTemplateVisitor(target, expansionMap);
118
+ parsed.nodes.forEach((node) => visitor.visit(node));
119
+ let missingExpansion = visitor.replacements.length !== expansions.length;
120
+ missingExpansion && visitor.errors.add("An argsToTemplate expression is not inside an element start tag.");
121
+ let materializedMarkup = missingExpansion ? materializeWithoutAnalysis(markup, expansions, visitor.replacements) : applyReplacements(markup, visitor.replacements);
122
+ return visitor.errors.size > 0 ? { kind: "unresolvable", markup: materializedMarkup, errors: [...visitor.errors] } : {
123
+ kind: "resolved",
124
+ markup: materializedMarkup,
125
+ referencedNames: [...visitor.referencedNames],
126
+ boundOutputs: [...visitor.boundOutputs]
127
+ };
128
+ } catch (error) {
129
+ return {
130
+ kind: "unresolvable",
131
+ markup: materializeWithoutAnalysis(markup, expansions),
132
+ errors: [error instanceof Error ? error.message : String(error)]
133
+ };
134
+ }
135
+ }, applyReplacements = (markup, replacements) => {
136
+ let position = 0, materialized = "";
137
+ for (let replacement of [...replacements].sort((left, right) => left.start - right.start)) {
138
+ let precedingMarkup = markup.slice(position, replacement.start);
139
+ materialized += (replacement.text === "" ? precedingMarkup.trimEnd() : precedingMarkup) + replacement.text, position = replacement.end;
140
+ }
141
+ return materialized + markup.slice(position);
142
+ }, materializeWithoutAnalysis = (markup, expansions, replacements = []) => {
143
+ let replacedMarkers = new Set(replacements.map(({ marker }) => marker)), fallbackReplacements = expansions.flatMap((expansion) => {
144
+ if (replacedMarkers.has(expansion.marker))
145
+ return [];
146
+ let start = markup.indexOf(expansion.marker);
147
+ return start === -1 ? [] : [
148
+ {
149
+ marker: expansion.marker,
150
+ start,
151
+ end: start + expansion.marker.length,
152
+ text: [
153
+ ...expansion.inputAttributes,
154
+ ...expansion.outputAttributes.map(({ markup: attribute }) => attribute)
155
+ ].join(" ")
156
+ }
157
+ ];
158
+ });
159
+ return applyReplacements(markup, [...replacements, ...fallbackReplacements]);
160
+ };
161
+ export {
162
+ analyzeStoryTemplate
163
+ };
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ze1vib595n from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ze1vib595n from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ze1vib595n from "node:module";
1
+ import CJS_COMPAT_NODE_URL_8ni5g5ueuqs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8ni5g5ueuqs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ze1vib595n.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ze1vib595n.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ze1vib595n.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_8ni5g5ueuqs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8ni5g5ueuqs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,10 +13,10 @@ import {
13
13
  errorSummary,
14
14
  printErrorDetails,
15
15
  up
16
- } from "../../_node-chunks/chunk-6P3TQP4W.js";
16
+ } from "../../_node-chunks/chunk-V7GJH7LA.js";
17
17
  import {
18
18
  findTsconfigUp
19
- } from "../../_node-chunks/chunk-ORVVXDOZ.js";
19
+ } from "../../_node-chunks/chunk-QNPJ2GGJ.js";
20
20
 
21
21
  // src/builders/build-storybook/index.ts
22
22
  import { readFileSync } from "node:fs";
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ze1vib595n from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ze1vib595n from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ze1vib595n from "node:module";
1
+ import CJS_COMPAT_NODE_URL_8ni5g5ueuqs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_8ni5g5ueuqs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ze1vib595n.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ze1vib595n.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ze1vib595n.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_8ni5g5ueuqs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_8ni5g5ueuqs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_8ni5g5ueuqs.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -13,10 +13,10 @@ import {
13
13
  errorSummary,
14
14
  printErrorDetails,
15
15
  up
16
- } from "../../_node-chunks/chunk-6P3TQP4W.js";
16
+ } from "../../_node-chunks/chunk-V7GJH7LA.js";
17
17
  import {
18
18
  findTsconfigUp
19
- } from "../../_node-chunks/chunk-ORVVXDOZ.js";
19
+ } from "../../_node-chunks/chunk-QNPJ2GGJ.js";
20
20
 
21
21
  // src/builders/start-storybook/index.ts
22
22
  import { readFileSync } from "node:fs";
@@ -0,0 +1,64 @@
1
+ import { CompatibleString, StorybookConfig } from "storybook/internal/types";
2
+ import { BuilderOptions, StorybookConfigVite } from "@storybook/builder-vite";
3
+
4
+ //#region code/lib/angular-cm/dist/index.d.ts
5
+ /**
6
+ * Which members reach the props table, as a strict ladder: `all` ⊃ `api` ⊃ `inputs`.
7
+ *
8
+ * - `all`: every member of every section.
9
+ * - `api`: the component's template-facing surface, meaning declared inputs and outputs whatever
10
+ * their TypeScript visibility, plus every property and method that is not TypeScript-`private`,
11
+ * ES-`#`, or carrying a JSDoc `internal` tag.
12
+ * - `inputs`: the inputs section, plus the `${name}Change` output a documented `model()` needs for
13
+ * its two-way binding to make sense.
14
+ *
15
+ * The tag is written without its `@` because `stripInternal` deletes any declaration whose leading
16
+ * comment contains that literal.
17
+ */
18
+ type PropsTableMode = 'all' | 'api' | 'inputs';
19
+ //#endregion
20
+ //#region code/frameworks/angular-vite/.dts-emit/code/frameworks/angular-vite/src/types.d.ts
21
+ type FrameworkName = CompatibleString<'@storybook/angular-vite'>;
22
+ type BuilderName = CompatibleString<'@storybook/builder-vite'>;
23
+ type FrameworkOptions = {
24
+ builder?: BuilderOptions;
25
+ jit?: boolean;
26
+ liveReload?: boolean;
27
+ inlineStylesExtension?: string;
28
+ tsconfig?: string;
29
+ compodoc?: boolean;
30
+ compodocArgs?: string[];
31
+ /**
32
+ * Which members the props table renders, as a ladder:
33
+ *
34
+ * - `all`: every member.
35
+ * - `api`: the component's template-facing surface, meaning every declared input and output
36
+ * whatever its TypeScript visibility (Angular only honours access modifiers on bindings behind
37
+ * the opt-in `strictInputAccessModifiers`), plus the properties and methods that are not
38
+ * `private`, ES `#`, or carrying a JSDoc `internal` tag (a declared non-API).
39
+ * - `inputs`: the inputs section alone.
40
+ *
41
+ * Tag a member `@ignore` to drop it whatever this says.
42
+ *
43
+ * `api` needs `features.experimentalDocgenServer`; without it only `all` and `inputs` apply.
44
+ *
45
+ * @default 'api'
46
+ */
47
+ propsTable?: PropsTableMode;
48
+ };
49
+ type StorybookConfigFramework = {
50
+ framework: FrameworkName | {
51
+ name: FrameworkName;
52
+ options: FrameworkOptions;
53
+ };
54
+ core?: StorybookConfig['core'] & {
55
+ builder?: BuilderName | {
56
+ name: BuilderName;
57
+ options: BuilderOptions;
58
+ };
59
+ };
60
+ };
61
+ /** The interface for Storybook configuration in `main.ts` files. */
62
+ type StorybookConfig$1 = Omit<StorybookConfig, keyof StorybookConfigVite | keyof StorybookConfigFramework> & StorybookConfigVite & StorybookConfigFramework;
63
+ //#endregion
64
+ export { StorybookConfig$1 as n, FrameworkOptions as t };
@@ -2,11 +2,11 @@ import {
2
2
  argTypesEnhancers,
3
3
  decorateStory,
4
4
  parameters
5
- } from "../_browser-chunks/chunk-CHMLOECK.js";
5
+ } from "../_browser-chunks/chunk-AL7GEPYM.js";
6
6
  import {
7
7
  render,
8
8
  renderToCanvas
9
- } from "../_browser-chunks/chunk-ECGMCGUZ.js";
9
+ } from "../_browser-chunks/chunk-UJ3I56EP.js";
10
10
  export {
11
11
  decorateStory as applyDecorators,
12
12
  argTypesEnhancers,