@storybook/angular-vite 10.6.0-alpha.5 → 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.
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_1pj9uj7yzpf from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1pj9uj7yzpf from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf 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_1pj9uj7yzpf.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1pj9uj7yzpf.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf.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_1pj9uj7yzpf from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1pj9uj7yzpf from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf 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_1pj9uj7yzpf.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1pj9uj7yzpf.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf.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-RC6UIUJ4.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_1pj9uj7yzpf from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1pj9uj7yzpf from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf 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_1pj9uj7yzpf.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1pj9uj7yzpf.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf.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-35U7AODH.js";
16
+ } from "../../_node-chunks/chunk-V7GJH7LA.js";
17
17
  import {
18
18
  findTsconfigUp
19
- } from "../../_node-chunks/chunk-RC6UIUJ4.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_1pj9uj7yzpf from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1pj9uj7yzpf from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf 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_1pj9uj7yzpf.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1pj9uj7yzpf.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1pj9uj7yzpf.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-35U7AODH.js";
16
+ } from "../../_node-chunks/chunk-V7GJH7LA.js";
17
17
  import {
18
18
  findTsconfigUp
19
- } from "../../_node-chunks/chunk-RC6UIUJ4.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-XXAOQLNU.js";
5
+ } from "../_browser-chunks/chunk-AL7GEPYM.js";
6
6
  import {
7
7
  render,
8
8
  renderToCanvas
9
- } from "../_browser-chunks/chunk-6DVGZIOB.js";
9
+ } from "../_browser-chunks/chunk-UJ3I56EP.js";
10
10
  export {
11
11
  decorateStory as applyDecorators,
12
12
  argTypesEnhancers,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  decorators,
3
3
  parameters
4
- } from "../../_browser-chunks/chunk-THKACJYB.js";
5
- import "../../_browser-chunks/chunk-6DVGZIOB.js";
4
+ } from "../../_browser-chunks/chunk-VP3W5GY3.js";
5
+ import "../../_browser-chunks/chunk-UJ3I56EP.js";
6
6
  export {
7
7
  decorators,
8
8
  parameters
@@ -5,10 +5,10 @@ import {
5
5
  componentWrapperDecorator,
6
6
  moduleMetadata,
7
7
  setProjectAnnotations
8
- } from "../_browser-chunks/chunk-GVH2OCSY.js";
9
- import "../_browser-chunks/chunk-XXAOQLNU.js";
10
- import "../_browser-chunks/chunk-THKACJYB.js";
11
- import "../_browser-chunks/chunk-6DVGZIOB.js";
8
+ } from "../_browser-chunks/chunk-THQDNKQS.js";
9
+ import "../_browser-chunks/chunk-AL7GEPYM.js";
10
+ import "../_browser-chunks/chunk-VP3W5GY3.js";
11
+ import "../_browser-chunks/chunk-UJ3I56EP.js";
12
12
  export {
13
13
  __definePreview,
14
14
  applicationConfig,