@storybook/angular-vite 11.0.0-rc.0 → 11.0.0-rc.2
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-UU6I6OE3.js → chunk-6VSOLSRX.js} +15 -43
- package/dist/_browser-chunks/{chunk-GVR3YWT3.js → chunk-IFJFIE3P.js} +10 -10
- package/dist/_browser-chunks/{chunk-2JE7SKTX.js → chunk-S752VTMD.js} +6 -39
- package/dist/_browser-chunks/chunk-T4WQC6BZ.js +47 -0
- package/dist/_browser-chunks/{chunk-56QYE53C.js → chunk-Y5SREGLY.js} +3 -3
- package/dist/_browser-chunks/chunk-YS33I6LM.js +42 -0
- package/dist/client/config.js +3 -2
- package/dist/client/docs/config.js +4 -2
- package/dist/client/docs/register-print-hole.js +2 -0
- package/dist/client/index.js +6 -4
- package/dist/docgen/docgen-worker.js +212 -76
- package/dist/index.js +6 -4
- package/dist/preset.js +4 -1
- package/package.json +7 -7
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
-
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
10
|
-
return kind && result && __defProp(target, key, result), result;
|
|
11
|
-
}, __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
1
|
+
import {
|
|
2
|
+
__decorateClass,
|
|
3
|
+
__decorateParam,
|
|
4
|
+
__export,
|
|
5
|
+
inputBinding,
|
|
6
|
+
isValidIdentifier
|
|
7
|
+
} from "./chunk-T4WQC6BZ.js";
|
|
12
8
|
|
|
13
9
|
// src/client/render.ts
|
|
14
10
|
var render_exports = {};
|
|
@@ -25,29 +21,6 @@ import { bootstrapApplication } from "@angular/platform-browser";
|
|
|
25
21
|
import { BehaviorSubject } from "rxjs";
|
|
26
22
|
import { stringify } from "telejson";
|
|
27
23
|
|
|
28
|
-
// src/snippet-values.ts
|
|
29
|
-
var isValidIdentifier = (name) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name), quoteExpressionString = (value) => `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r")}'`, printExpressionValue = (value, unprintable) => {
|
|
30
|
-
let parents = /* @__PURE__ */ new Set(), print = (value2) => {
|
|
31
|
-
if (typeof value2 == "string")
|
|
32
|
-
return quoteExpressionString(value2);
|
|
33
|
-
if (unprintable && hasNoExpression(value2, parents))
|
|
34
|
-
return unprintable();
|
|
35
|
-
if (typeof value2 != "object" || value2 === null)
|
|
36
|
-
return `${value2}`;
|
|
37
|
-
parents.add(value2);
|
|
38
|
-
let printed = Array.isArray(value2) ? `[${value2.map((element) => print(element ?? null)).join(", ")}]` : `{${Object.entries(value2).filter(([, entryValue]) => entryValue !== void 0).map(
|
|
39
|
-
([key, entryValue]) => `${isValidIdentifier(key) ? key : quoteExpressionString(key)}: ${print(entryValue)}`
|
|
40
|
-
).join(", ")}}`;
|
|
41
|
-
return parents.delete(value2), printed;
|
|
42
|
-
};
|
|
43
|
-
return print(value);
|
|
44
|
-
}, hasNoExpression = (value, parents) => {
|
|
45
|
-
if (typeof value != "object" || value === null)
|
|
46
|
-
return typeof value == "function" || typeof value == "symbol" || typeof value == "bigint";
|
|
47
|
-
let prototype = Object.getPrototypeOf(value);
|
|
48
|
-
return parents.has(value) || !Array.isArray(value) && prototype !== Object.prototype && prototype !== null;
|
|
49
|
-
}, escapeAttributeExpression = (expression) => expression.replace(/&(?=#|\w+;)/g, "&").replace(/"/g, """), escapeTemplateLiteral = (template) => template.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), inputBinding = (name, expression) => `[${name}]="${expression}"`, textValue = (value) => typeof value == "string" ? value : typeof value == "number" || typeof value == "boolean" ? String(value) : void 0, angularText = (text) => text.includes("{{") ? void 0 : text.replace(/[{}@]|\$$/g, (syntax) => `&#${syntax.charCodeAt(0)};`);
|
|
50
|
-
|
|
51
24
|
// src/template-grammar.ts
|
|
52
25
|
var formatPropInTemplate = (propertyName) => isValidIdentifier(propertyName) ? propertyName : `this['${propertyName}']`, stringifyCircular = (obj) => {
|
|
53
26
|
let seen = /* @__PURE__ */ new Set();
|
|
@@ -161,8 +134,10 @@ var reflectionCapabilities = new ReflectionCapabilities(), getComponentInputsOut
|
|
|
161
134
|
}
|
|
162
135
|
return previousValue;
|
|
163
136
|
}, initialValue) : initialValue;
|
|
164
|
-
return
|
|
165
|
-
}, hasEntry = (list, propName, templateName) => list.some((e) => e.propName === propName || e.templateName === templateName),
|
|
137
|
+
return addCompiledInputsOutputs(component, decoratorDerived);
|
|
138
|
+
}, hasEntry = (list, propName, templateName) => list.some((e) => e.propName === propName || e.templateName === templateName), hostDirectiveConfigs = (def) => (def.hostDirectives ?? []).flatMap(
|
|
139
|
+
(entry) => typeof entry == "function" ? entry() : [entry]
|
|
140
|
+
), hostBindingNames = (bindings) => Array.isArray(bindings) ? bindings.filter((_, index) => index % 2 === 1) : Object.values(bindings ?? {}), addCompiledInputsOutputs = (component, base) => {
|
|
166
141
|
let result = {
|
|
167
142
|
inputs: [...base.inputs],
|
|
168
143
|
outputs: [...base.outputs]
|
|
@@ -182,6 +157,10 @@ var reflectionCapabilities = new ReflectionCapabilities(), getComponentInputsOut
|
|
|
182
157
|
let propName = def.outputs[templateName] ?? templateName;
|
|
183
158
|
hasEntry(result.outputs, propName, templateName) || result.outputs.push({ propName, templateName });
|
|
184
159
|
}
|
|
160
|
+
for (let config of hostDirectiveConfigs(def))
|
|
161
|
+
for (let bucket of ["inputs", "outputs"])
|
|
162
|
+
for (let templateName of hostBindingNames(config[bucket]))
|
|
163
|
+
result[bucket].some((entry) => entry.templateName === templateName) || result[bucket].push({ propName: templateName, templateName });
|
|
185
164
|
return result;
|
|
186
165
|
};
|
|
187
166
|
var isComponent = (component) => component ? (reflectionCapabilities.annotations(component) || []).some((d) => d instanceof Component) : !1;
|
|
@@ -737,13 +716,6 @@ async function renderToCanvas({
|
|
|
737
716
|
}
|
|
738
717
|
|
|
739
718
|
export {
|
|
740
|
-
__export,
|
|
741
|
-
printExpressionValue,
|
|
742
|
-
escapeAttributeExpression,
|
|
743
|
-
escapeTemplateLiteral,
|
|
744
|
-
inputBinding,
|
|
745
|
-
textValue,
|
|
746
|
-
angularText,
|
|
747
719
|
formatPropInTemplate,
|
|
748
720
|
isComponent,
|
|
749
721
|
computesTemplateFromComponent,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
__export,
|
|
3
2
|
computesTemplateFromComponent,
|
|
4
3
|
render,
|
|
5
4
|
renderToCanvas
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6VSOLSRX.js";
|
|
6
|
+
import {
|
|
7
|
+
__export
|
|
8
|
+
} from "./chunk-T4WQC6BZ.js";
|
|
7
9
|
|
|
8
10
|
// src/client/config.ts
|
|
9
11
|
var config_exports = {};
|
|
@@ -16,8 +18,7 @@ __export(config_exports, {
|
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
// src/client/globals.ts
|
|
19
|
-
|
|
20
|
-
global.STORYBOOK_ENV = "angular";
|
|
21
|
+
globalThis.STORYBOOK_ENV = "angular";
|
|
21
22
|
|
|
22
23
|
// src/client/decorateStory.ts
|
|
23
24
|
import { sanitizeStoryContextUpdate } from "storybook/preview-api";
|
|
@@ -43,7 +44,6 @@ function hasNoTemplate(template) {
|
|
|
43
44
|
|
|
44
45
|
// src/client/config.ts
|
|
45
46
|
import { enhanceArgTypes } from "storybook/internal/docs-tools";
|
|
46
|
-
import { global as global3 } from "@storybook/global";
|
|
47
47
|
|
|
48
48
|
// ../../../node_modules/entities/lib/esm/generated/decode-data-html.js
|
|
49
49
|
var decode_data_html_default = new Uint16Array(
|
|
@@ -648,10 +648,10 @@ var TAG_INNER = `(?:[^>=]|=\\s*"[^"]*"|=\\s*'[^']*'|=(?!\\s*["']))*`, HTML_TAG =
|
|
|
648
648
|
|
|
649
649
|
// ../../lib/angular-compodoc/dist/browser.js
|
|
650
650
|
import { logger } from "storybook/internal/client-logger";
|
|
651
|
-
|
|
652
|
-
var
|
|
653
|
-
|
|
654
|
-
|
|
651
|
+
var getCompodocJson = () => globalThis.__STORYBOOK_COMPODOC_JSON__;
|
|
652
|
+
var unwrapHtml = (html) => new globalThis.DOMParser().parseFromString(html, "text/html").body.textContent ?? "", extractArgTypesFromData2 = (componentData, {
|
|
653
|
+
filterNonInputControls: filterNonInputControls2 = globalThis.FEATURES.angularFilterNonInputControls
|
|
654
|
+
} = {}) => extractArgTypesFromData(componentData, {
|
|
655
655
|
compodocJson: getCompodocJson(),
|
|
656
656
|
filterNonInputControls: filterNonInputControls2,
|
|
657
657
|
logger,
|
|
@@ -672,7 +672,7 @@ var parameters = {
|
|
|
672
672
|
renderer: "angular",
|
|
673
673
|
docs: {
|
|
674
674
|
story: { inline: !0 },
|
|
675
|
-
extractArgTypes: (component) =>
|
|
675
|
+
extractArgTypes: (component) => globalThis.FEATURES?.docgenServer === !0 ? {} : extractArgTypes2(component),
|
|
676
676
|
extractComponentDescription
|
|
677
677
|
}
|
|
678
678
|
}, argTypesEnhancers = [enhanceArgTypes];
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
inputBinding,
|
|
8
|
-
printExpressionValue,
|
|
9
|
-
textValue
|
|
10
|
-
} from "./chunk-UU6I6OE3.js";
|
|
2
|
+
computesTemplateSourceFromComponent
|
|
3
|
+
} from "./chunk-6VSOLSRX.js";
|
|
4
|
+
import {
|
|
5
|
+
__export
|
|
6
|
+
} from "./chunk-T4WQC6BZ.js";
|
|
11
7
|
|
|
12
8
|
// src/client/docs/config.ts
|
|
13
9
|
var config_exports = {};
|
|
@@ -17,34 +13,6 @@ __export(config_exports, {
|
|
|
17
13
|
});
|
|
18
14
|
import { SourceType as SourceType2, getSourceSnippetRuntime } from "storybook/internal/docs-tools";
|
|
19
15
|
|
|
20
|
-
// src/client/docs/print-hole.ts
|
|
21
|
-
import {
|
|
22
|
-
UnprintableArgError,
|
|
23
|
-
unknownHoleKind
|
|
24
|
-
} from "storybook/internal/docs-tools";
|
|
25
|
-
var printHole = (hole, value) => {
|
|
26
|
-
let arg = hole.arg ?? "", unprintable = () => {
|
|
27
|
-
throw new UnprintableArgError(arg);
|
|
28
|
-
}, expression = () => escapeAttributeExpression(printExpressionValue(value, unprintable));
|
|
29
|
-
switch (hole.kind) {
|
|
30
|
-
case "bind":
|
|
31
|
-
return escapeTemplateLiteral(expression());
|
|
32
|
-
case "prop":
|
|
33
|
-
return value === void 0 || typeof value == "function" ? "" : escapeTemplateLiteral(inputBinding(arg, expression()));
|
|
34
|
-
case "field":
|
|
35
|
-
return printExpressionValue(value, unprintable);
|
|
36
|
-
case "text":
|
|
37
|
-
return escapeTemplateLiteral(text(value) ?? unprintable());
|
|
38
|
-
default:
|
|
39
|
-
return unknownHoleKind(hole.kind);
|
|
40
|
-
}
|
|
41
|
-
}, text = (value) => {
|
|
42
|
-
if (value === void 0)
|
|
43
|
-
return "";
|
|
44
|
-
let printed = textValue(value);
|
|
45
|
-
return printed === void 0 ? void 0 : angularText(printed);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
16
|
// src/client/docs/sourceDecorator.ts
|
|
49
17
|
import { SourceType } from "storybook/internal/docs-tools";
|
|
50
18
|
import { useRef, emitTransformCode, useEffect } from "storybook/preview-api";
|
|
@@ -70,8 +38,7 @@ var snippetRuntime = getSourceSnippetRuntime(), parameters = {
|
|
|
70
38
|
source: {
|
|
71
39
|
type: SourceType2.DYNAMIC,
|
|
72
40
|
// The server snippet is the TypeScript host component that renders the story.
|
|
73
|
-
language: snippetRuntime === "server" ? "ts" : "html"
|
|
74
|
-
...snippetRuntime === "server" ? { printHole } : {}
|
|
41
|
+
language: snippetRuntime === "server" ? "ts" : "html"
|
|
75
42
|
}
|
|
76
43
|
}
|
|
77
44
|
}, decorators = snippetRuntime === "preview" ? [sourceDecorator] : [];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
6
|
+
};
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
+
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
10
|
+
return kind && result && __defProp(target, key, result), result;
|
|
11
|
+
}, __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
12
|
+
|
|
13
|
+
// src/snippet-values.ts
|
|
14
|
+
var isValidIdentifier = (name) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(name), quoteExpressionString = (value) => `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r")}'`, printExpressionValue = (value, unprintable) => {
|
|
15
|
+
let parents = /* @__PURE__ */ new Set(), print = (value2) => {
|
|
16
|
+
if (typeof value2 == "string")
|
|
17
|
+
return quoteExpressionString(value2);
|
|
18
|
+
if (unprintable && hasNoExpression(value2, parents))
|
|
19
|
+
return unprintable();
|
|
20
|
+
if (typeof value2 != "object" || value2 === null)
|
|
21
|
+
return `${value2}`;
|
|
22
|
+
parents.add(value2);
|
|
23
|
+
let printed = Array.isArray(value2) ? `[${value2.map((element) => print(element ?? null)).join(", ")}]` : `{${Object.entries(value2).filter(([, entryValue]) => entryValue !== void 0).map(
|
|
24
|
+
([key, entryValue]) => `${isValidIdentifier(key) ? key : quoteExpressionString(key)}: ${print(entryValue)}`
|
|
25
|
+
).join(", ")}}`;
|
|
26
|
+
return parents.delete(value2), printed;
|
|
27
|
+
};
|
|
28
|
+
return print(value);
|
|
29
|
+
}, hasNoExpression = (value, parents) => {
|
|
30
|
+
if (typeof value != "object" || value === null)
|
|
31
|
+
return typeof value == "function" || typeof value == "symbol" || typeof value == "bigint";
|
|
32
|
+
let prototype = Object.getPrototypeOf(value);
|
|
33
|
+
return parents.has(value) || !Array.isArray(value) && prototype !== Object.prototype && prototype !== null;
|
|
34
|
+
}, escapeAttributeExpression = (expression) => expression.replace(/&(?=#|\w+;)/g, "&").replace(/"/g, """), escapeTemplateLiteral = (template) => template.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), inputBinding = (name, expression) => `[${name}]="${expression}"`, textValue = (value) => typeof value == "string" ? value : typeof value == "number" || typeof value == "boolean" ? String(value) : void 0, angularText = (text) => text.includes("{{") ? void 0 : text.replace(/[{}@]|\$$/g, (syntax) => `&#${syntax.charCodeAt(0)};`);
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
__export,
|
|
38
|
+
__decorateClass,
|
|
39
|
+
__decorateParam,
|
|
40
|
+
isValidIdentifier,
|
|
41
|
+
printExpressionValue,
|
|
42
|
+
escapeAttributeExpression,
|
|
43
|
+
escapeTemplateLiteral,
|
|
44
|
+
inputBinding,
|
|
45
|
+
textValue,
|
|
46
|
+
angularText
|
|
47
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
config_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IFJFIE3P.js";
|
|
4
4
|
import {
|
|
5
5
|
config_exports as config_exports2
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S752VTMD.js";
|
|
7
7
|
import {
|
|
8
8
|
computesTemplateFromComponent,
|
|
9
9
|
formatPropInTemplate,
|
|
10
10
|
isComponent,
|
|
11
11
|
render_exports
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6VSOLSRX.js";
|
|
13
13
|
|
|
14
14
|
// src/client/portable-stories.ts
|
|
15
15
|
import {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
angularText,
|
|
3
|
+
escapeAttributeExpression,
|
|
4
|
+
escapeTemplateLiteral,
|
|
5
|
+
inputBinding,
|
|
6
|
+
printExpressionValue,
|
|
7
|
+
textValue
|
|
8
|
+
} from "./chunk-T4WQC6BZ.js";
|
|
9
|
+
|
|
10
|
+
// src/client/docs/register-print-hole.ts
|
|
11
|
+
import { registerPrintHole } from "storybook/internal/docs-tools/snippets";
|
|
12
|
+
|
|
13
|
+
// src/client/docs/print-hole.ts
|
|
14
|
+
import {
|
|
15
|
+
UnprintableArgError,
|
|
16
|
+
unknownHoleKind
|
|
17
|
+
} from "storybook/internal/docs-tools/snippets";
|
|
18
|
+
var printHole = (hole, value) => {
|
|
19
|
+
let arg = hole.arg ?? "", unprintable = () => {
|
|
20
|
+
throw new UnprintableArgError(arg);
|
|
21
|
+
}, expression = () => escapeAttributeExpression(printExpressionValue(value, unprintable));
|
|
22
|
+
switch (hole.kind) {
|
|
23
|
+
case "bind":
|
|
24
|
+
return escapeTemplateLiteral(expression());
|
|
25
|
+
case "prop":
|
|
26
|
+
return value === void 0 || typeof value == "function" ? "" : escapeTemplateLiteral(inputBinding(arg, expression()));
|
|
27
|
+
case "field":
|
|
28
|
+
return printExpressionValue(value, unprintable);
|
|
29
|
+
case "text":
|
|
30
|
+
return escapeTemplateLiteral(text(value) ?? unprintable());
|
|
31
|
+
default:
|
|
32
|
+
return unknownHoleKind(hole.kind);
|
|
33
|
+
}
|
|
34
|
+
}, text = (value) => {
|
|
35
|
+
if (value === void 0)
|
|
36
|
+
return "";
|
|
37
|
+
let printed = textValue(value);
|
|
38
|
+
return printed === void 0 ? void 0 : angularText(printed);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// src/client/docs/register-print-hole.ts
|
|
42
|
+
registerPrintHole(printHole);
|
package/dist/client/config.js
CHANGED
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
argTypesEnhancers,
|
|
3
3
|
decorateStory,
|
|
4
4
|
parameters
|
|
5
|
-
} from "../_browser-chunks/chunk-
|
|
5
|
+
} from "../_browser-chunks/chunk-IFJFIE3P.js";
|
|
6
6
|
import {
|
|
7
7
|
render,
|
|
8
8
|
renderToCanvas
|
|
9
|
-
} from "../_browser-chunks/chunk-
|
|
9
|
+
} from "../_browser-chunks/chunk-6VSOLSRX.js";
|
|
10
|
+
import "../_browser-chunks/chunk-T4WQC6BZ.js";
|
|
10
11
|
export {
|
|
11
12
|
decorateStory as applyDecorators,
|
|
12
13
|
argTypesEnhancers,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decorators,
|
|
3
3
|
parameters
|
|
4
|
-
} from "../../_browser-chunks/chunk-
|
|
5
|
-
import "../../_browser-chunks/chunk-
|
|
4
|
+
} from "../../_browser-chunks/chunk-S752VTMD.js";
|
|
5
|
+
import "../../_browser-chunks/chunk-YS33I6LM.js";
|
|
6
|
+
import "../../_browser-chunks/chunk-6VSOLSRX.js";
|
|
7
|
+
import "../../_browser-chunks/chunk-T4WQC6BZ.js";
|
|
6
8
|
export {
|
|
7
9
|
decorators,
|
|
8
10
|
parameters
|
package/dist/client/index.js
CHANGED
|
@@ -5,10 +5,12 @@ import {
|
|
|
5
5
|
componentWrapperDecorator,
|
|
6
6
|
moduleMetadata,
|
|
7
7
|
setProjectAnnotations
|
|
8
|
-
} from "../_browser-chunks/chunk-
|
|
9
|
-
import "../_browser-chunks/chunk-
|
|
10
|
-
import "../_browser-chunks/chunk-
|
|
11
|
-
import "../_browser-chunks/chunk-
|
|
8
|
+
} from "../_browser-chunks/chunk-Y5SREGLY.js";
|
|
9
|
+
import "../_browser-chunks/chunk-IFJFIE3P.js";
|
|
10
|
+
import "../_browser-chunks/chunk-S752VTMD.js";
|
|
11
|
+
import "../_browser-chunks/chunk-YS33I6LM.js";
|
|
12
|
+
import "../_browser-chunks/chunk-6VSOLSRX.js";
|
|
13
|
+
import "../_browser-chunks/chunk-T4WQC6BZ.js";
|
|
12
14
|
export {
|
|
13
15
|
__definePreview,
|
|
14
16
|
applicationConfig,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getStoryImportPathFromEntry as getStoryImportPathFromEntry2,
|
|
8
8
|
STORY_FILE_TEST_REGEXP
|
|
9
9
|
} from "storybook/internal/common";
|
|
10
|
-
import { logger as
|
|
10
|
+
import { logger as logger7 } from "storybook/internal/node-logger";
|
|
11
11
|
|
|
12
12
|
// ../../lib/angular-cm/dist/index.js
|
|
13
13
|
import { isInNodeModules } from "storybook/internal/common";
|
|
@@ -28,9 +28,10 @@ import { isInNodeModules as isInNodeModules2 } from "storybook/internal/common";
|
|
|
28
28
|
import {
|
|
29
29
|
extractComponentJsDocInfo
|
|
30
30
|
} from "storybook/internal/component-meta";
|
|
31
|
+
import { logger as logger5 } from "storybook/internal/node-logger";
|
|
31
32
|
import { logger as logger4 } from "storybook/internal/node-logger";
|
|
32
|
-
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
33
33
|
import { logger as logger2 } from "storybook/internal/node-logger";
|
|
34
|
+
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
34
35
|
import { slash as slash2 } from "storybook/internal/common";
|
|
35
36
|
import {
|
|
36
37
|
ProgramBackedProject,
|
|
@@ -296,7 +297,7 @@ ${detailLines(lines).join(`
|
|
|
296
297
|
case "composite":
|
|
297
298
|
return initializer.text;
|
|
298
299
|
}
|
|
299
|
-
}, extractDefaultValue = (property,
|
|
300
|
+
}, extractDefaultValue = (property, logger62) => {
|
|
300
301
|
try {
|
|
301
302
|
let authored = authoredDefault(property);
|
|
302
303
|
if (authored !== void 0)
|
|
@@ -304,14 +305,14 @@ ${detailLines(lines).join(`
|
|
|
304
305
|
if (property.initializer === void 0)
|
|
305
306
|
return;
|
|
306
307
|
if (property.initializer.kind === "expression") {
|
|
307
|
-
|
|
308
|
+
logger62.debug(
|
|
308
309
|
`${property.name}: non-literal default '${property.initializer.text}' not shown`
|
|
309
310
|
);
|
|
310
311
|
return;
|
|
311
312
|
}
|
|
312
313
|
return analyzerDefault(property.initializer);
|
|
313
314
|
} catch {
|
|
314
|
-
|
|
315
|
+
logger62.debug(`Error extracting ${property.name}: ${property.initializer?.text}`);
|
|
315
316
|
return;
|
|
316
317
|
}
|
|
317
318
|
}, extractMemberJsDocTags = (member) => {
|
|
@@ -333,7 +334,7 @@ ${detailLines(lines).join(`
|
|
|
333
334
|
let input = inputsByName.get(item.name);
|
|
334
335
|
return input?.line !== void 0 && input.line === item.line;
|
|
335
336
|
});
|
|
336
|
-
}, extractArgTypesFromData = (componentData, { metadataJson, propsTable, logger:
|
|
337
|
+
}, extractArgTypesFromData = (componentData, { metadataJson, propsTable, logger: logger62 = NOOP_LOGGER, context }) => {
|
|
337
338
|
let sectionToItems = {}, componentClasses = propsTable === "inputs" ? ["inputsClass"] : ["propertiesClass", "methodsClass", "inputsClass", "outputsClass"], memberKeys = isDirectiveEntry(componentData) ? componentClasses : ["properties", "methods"], modelProperties = getModelProperties(componentData), modelPropertyNames = new Set(modelProperties.map((item) => item.name));
|
|
338
339
|
memberKeys.forEach((key) => {
|
|
339
340
|
readMembers(componentData, key).forEach((item) => {
|
|
@@ -341,12 +342,12 @@ ${detailLines(lines).join(`
|
|
|
341
342
|
if (key === "outputsClass" && !isMethod(item) && modelPropertyNames.has(item.name))
|
|
342
343
|
return;
|
|
343
344
|
if (!documentedInMode(item, section2, propsTable)) {
|
|
344
|
-
|
|
345
|
+
logger62.debug(
|
|
345
346
|
`${componentData.name}.${item.name} left out of the props table: propsTable '${propsTable}'`
|
|
346
347
|
);
|
|
347
348
|
return;
|
|
348
349
|
}
|
|
349
|
-
let defaultValue = isMethod(item) ? void 0 : extractDefaultValue(item,
|
|
350
|
+
let defaultValue = isMethod(item) ? void 0 : extractDefaultValue(item, logger62), { type: declaredType, detail } = isMethod(item) || section2 !== "inputs" && section2 !== "properties" ? { type: { name: "other", value: "void" } } : extractType(item, defaultValue, metadataJson, componentData.file, context), type = section2 === "inputs" && !isMethod(item) && isRequired(item) ? { ...declaredType, required: !0 } : declaredType, action = section2 === "outputs" ? { action: item.name } : {}, jsDocTags = extractMemberJsDocTags(item), argType = {
|
|
350
351
|
name: item.name,
|
|
351
352
|
description: item.rawdescription || item.description,
|
|
352
353
|
type,
|
|
@@ -1172,9 +1173,33 @@ var isAngularCoreOrUnresolved = (ctx, node) => {
|
|
|
1172
1173
|
let arg = decorator.call?.arguments[0];
|
|
1173
1174
|
return arg && ctx.ts.isStringLiteralLike(arg) ? arg.text : void 0;
|
|
1174
1175
|
}, objectProperty = (ctx, object, key) => {
|
|
1175
|
-
|
|
1176
|
-
|
|
1176
|
+
let { ts } = ctx;
|
|
1177
|
+
for (let property of object.properties) {
|
|
1178
|
+
if (ts.isShorthandPropertyAssignment(property) && property.name.text === key)
|
|
1179
|
+
return property.name;
|
|
1180
|
+
if (ts.isPropertyAssignment(property) && (ts.isIdentifier(property.name) || ts.isStringLiteralLike(property.name)) && property.name.text === key)
|
|
1177
1181
|
return property.initializer;
|
|
1182
|
+
}
|
|
1183
|
+
}, MAX_REFERENCE_DEPTH = 10, resolveReference = (ctx, expression) => {
|
|
1184
|
+
let { ts } = ctx, current = unwrap(ctx, expression);
|
|
1185
|
+
for (let depth = 0; depth < MAX_REFERENCE_DEPTH; depth++) {
|
|
1186
|
+
if (!ts.isIdentifier(current))
|
|
1187
|
+
return current;
|
|
1188
|
+
let declaration = (ts.isShorthandPropertyAssignment(current.parent) ? ctx.checker.getShorthandAssignmentValueSymbol(current.parent) : resolvedSymbol(ctx, current))?.valueDeclaration;
|
|
1189
|
+
if (!declaration || !ts.isVariableDeclaration(declaration))
|
|
1190
|
+
return current;
|
|
1191
|
+
if (!declaration.initializer)
|
|
1192
|
+
return;
|
|
1193
|
+
current = unwrap(ctx, declaration.initializer);
|
|
1194
|
+
}
|
|
1195
|
+
}, unwrap = (ctx, expression) => {
|
|
1196
|
+
let { ts } = ctx, current = expression;
|
|
1197
|
+
for (; ts.isParenthesizedExpression(current) || ts.isAsExpression(current) || ts.isSatisfiesExpression(current) || ts.isNonNullExpression(current) || ts.isTypeAssertionExpression(current); )
|
|
1198
|
+
current = current.expression;
|
|
1199
|
+
return current;
|
|
1200
|
+
}, parseBindingName = (text) => {
|
|
1201
|
+
let [name, alias] = text.split(":").map((part) => part.trim());
|
|
1202
|
+
return name ? { name, ...alias ? { alias } : {} } : void 0;
|
|
1178
1203
|
}, stringOption = (ctx, object, key) => {
|
|
1179
1204
|
let initializer = objectProperty(ctx, object, key);
|
|
1180
1205
|
return initializer && ctx.ts.isStringLiteralLike(initializer) ? initializer.text : void 0;
|
|
@@ -1202,31 +1227,129 @@ var isAngularCoreOrUnresolved = (ctx, node) => {
|
|
|
1202
1227
|
if (!metadata)
|
|
1203
1228
|
return [];
|
|
1204
1229
|
let entries = [];
|
|
1205
|
-
for (let
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1230
|
+
for (let bucket of ["inputs", "outputs"]) {
|
|
1231
|
+
let initializer = objectProperty(ctx, metadata, bucket), list = initializer && resolveReference(ctx, initializer);
|
|
1232
|
+
if (!(!list || !ts.isArrayLiteralExpression(list)))
|
|
1233
|
+
for (let listElement of list.elements) {
|
|
1234
|
+
let element = resolveReference(ctx, listElement);
|
|
1235
|
+
if (element) {
|
|
1236
|
+
if (ts.isStringLiteralLike(element)) {
|
|
1237
|
+
let binding = parseBindingName(element.text);
|
|
1238
|
+
binding && entries.push({ bucket, ...binding });
|
|
1239
|
+
} else if (bucket === "inputs" && ts.isObjectLiteralExpression(element)) {
|
|
1240
|
+
let name = stringOption(ctx, element, "name");
|
|
1241
|
+
if (!name)
|
|
1242
|
+
continue;
|
|
1243
|
+
let alias = stringOption(ctx, element, "alias"), required = booleanOption(ctx, element, "required");
|
|
1244
|
+
entries.push({
|
|
1245
|
+
bucket,
|
|
1246
|
+
name,
|
|
1247
|
+
...alias ? { alias } : {},
|
|
1248
|
+
...required !== void 0 ? { required } : {}
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1225
1251
|
}
|
|
1226
|
-
|
|
1252
|
+
}
|
|
1227
1253
|
}
|
|
1228
1254
|
return entries;
|
|
1229
|
-
},
|
|
1255
|
+
}, MODEL_OUTPUT_SUFFIX = "Change", MAX_SPREAD_DEPTH = 10;
|
|
1256
|
+
function applyHostDirectives(ctx, hosts, members, resolveMembers) {
|
|
1257
|
+
let hostName = hosts[0]?.name?.text ?? "an anonymous class";
|
|
1258
|
+
for (let ref of hosts.flatMap((host) => readHostDirectives(ctx, host))) {
|
|
1259
|
+
if (!ref.inputs.length && !ref.outputs.length)
|
|
1260
|
+
continue;
|
|
1261
|
+
let exposed = resolveMembers(ref.declaration);
|
|
1262
|
+
if (!exposed)
|
|
1263
|
+
continue;
|
|
1264
|
+
let directiveName = ref.declaration.name?.text ?? "an anonymous directive", leaveOut = (binding, kind) => logger2.debug(
|
|
1265
|
+
`[angular-cm] ${hostName} host directive ${directiveName}.${binding.name} left out of docgen: no such ${kind}`
|
|
1266
|
+
), exposedModelInputs = /* @__PURE__ */ new Map();
|
|
1267
|
+
for (let binding of ref.inputs) {
|
|
1268
|
+
let entry = exposed.inputs.find((candidate) => isNamed(candidate, binding.name));
|
|
1269
|
+
if (!entry) {
|
|
1270
|
+
leaveOut(binding, "input");
|
|
1271
|
+
continue;
|
|
1272
|
+
}
|
|
1273
|
+
let name = binding.alias ?? binding.name;
|
|
1274
|
+
expose(members, "inputs", entry, name) && isModel(entry) && exposedModelInputs.set(entry.value.name, name);
|
|
1275
|
+
}
|
|
1276
|
+
for (let binding of ref.outputs) {
|
|
1277
|
+
let name = binding.alias ?? binding.name, output = exposed.outputs.find(
|
|
1278
|
+
(candidate) => isNamed(candidate, binding.name) && !isModel(candidate)
|
|
1279
|
+
);
|
|
1280
|
+
if (output) {
|
|
1281
|
+
expose(members, "outputs", output, name);
|
|
1282
|
+
continue;
|
|
1283
|
+
}
|
|
1284
|
+
let model = binding.name.endsWith(MODEL_OUTPUT_SUFFIX) ? exposed.outputs.find(
|
|
1285
|
+
(candidate) => isModel(candidate) && isNamed(candidate, binding.name.slice(0, -MODEL_OUTPUT_SUFFIX.length))
|
|
1286
|
+
) : void 0;
|
|
1287
|
+
if (!model) {
|
|
1288
|
+
leaveOut(binding, "output");
|
|
1289
|
+
continue;
|
|
1290
|
+
}
|
|
1291
|
+
let pairedInput = exposedModelInputs.get(model.value.name);
|
|
1292
|
+
pairedInput !== void 0 && name === `${pairedInput}${MODEL_OUTPUT_SUFFIX}` ? expose(members, "outputs", model, pairedInput) : expose(members, "outputs", asPlainOutput(model), name);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
var isModel = (entry) => entry.typeSource?.kind === "signal" && entry.typeSource.signalKind === "model", isNamed = (entry, name) => !entry.isStatic && entry.value.name === name, asPlainOutput = (model) => {
|
|
1297
|
+
let { initializer: _default, ...value } = model.value;
|
|
1298
|
+
return { ...model, typeSource: { kind: "signal", signalKind: "output" }, value };
|
|
1299
|
+
}, boundName = (entry, bucket) => bucket === "outputs" && isModel(entry) ? `${entry.value.name}${MODEL_OUTPUT_SUFFIX}` : entry.value.name;
|
|
1300
|
+
function expose(members, bucket, entry, name) {
|
|
1301
|
+
let added = { ...entry, value: { ...entry.value, name } }, bound = boundName(added, bucket);
|
|
1302
|
+
return members[bucket].some((own) => boundName(own, bucket) === bound) ? !1 : (members[bucket].push(added), !0);
|
|
1303
|
+
}
|
|
1304
|
+
function readHostDirectives(ctx, classNode) {
|
|
1305
|
+
let refs = [];
|
|
1306
|
+
for (let decoratorName of ["Component", "Directive"]) {
|
|
1307
|
+
let metadata = decoratorObjectArg(ctx, classNode, decoratorName), hostDirectives = metadata && objectProperty(ctx, metadata, "hostDirectives");
|
|
1308
|
+
hostDirectives && collectHostDirectives(ctx, hostDirectives, refs, 0);
|
|
1309
|
+
}
|
|
1310
|
+
return refs;
|
|
1311
|
+
}
|
|
1312
|
+
function collectHostDirectives(ctx, expression, refs, depth) {
|
|
1313
|
+
let { ts } = ctx, list = resolveReference(ctx, expression);
|
|
1314
|
+
if (!(!list || !ts.isArrayLiteralExpression(list) || depth > MAX_SPREAD_DEPTH))
|
|
1315
|
+
for (let element of list.elements) {
|
|
1316
|
+
if (ts.isSpreadElement(element)) {
|
|
1317
|
+
collectHostDirectives(ctx, element.expression, refs, depth + 1);
|
|
1318
|
+
continue;
|
|
1319
|
+
}
|
|
1320
|
+
let resolved = resolveReference(ctx, element);
|
|
1321
|
+
if (!resolved || !ts.isObjectLiteralExpression(resolved))
|
|
1322
|
+
continue;
|
|
1323
|
+
let directive = objectProperty(ctx, resolved, "directive"), declaration = directive && directiveDeclaration(ctx, directive);
|
|
1324
|
+
declaration && refs.push({
|
|
1325
|
+
declaration,
|
|
1326
|
+
inputs: readBindings(ctx, objectProperty(ctx, resolved, "inputs")),
|
|
1327
|
+
outputs: readBindings(ctx, objectProperty(ctx, resolved, "outputs"))
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
function readBindings(ctx, expression) {
|
|
1332
|
+
let list = expression && resolveReference(ctx, expression);
|
|
1333
|
+
return !list || !ctx.ts.isArrayLiteralExpression(list) ? [] : list.elements.flatMap((element) => {
|
|
1334
|
+
let value = resolveReference(ctx, element), binding = value && ctx.ts.isStringLiteralLike(value) && parseBindingName(value.text);
|
|
1335
|
+
return binding ? [binding] : [];
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
function directiveDeclaration(ctx, expression) {
|
|
1339
|
+
let target = unwrapForwardRef(ctx, unwrap(ctx, expression));
|
|
1340
|
+
if (!(!ctx.ts.isIdentifier(target) && !ctx.ts.isPropertyAccessExpression(target)))
|
|
1341
|
+
return resolvedSymbol(ctx, target)?.declarations?.find(
|
|
1342
|
+
(candidate) => ctx.ts.isClassDeclaration(candidate)
|
|
1343
|
+
);
|
|
1344
|
+
}
|
|
1345
|
+
function unwrapForwardRef(ctx, expression) {
|
|
1346
|
+
let { ts } = ctx;
|
|
1347
|
+
if (!ts.isCallExpression(expression) || expression.arguments.length !== 1)
|
|
1348
|
+
return expression;
|
|
1349
|
+
let callee = expression.expression, [factory] = expression.arguments, calleeName = ts.isIdentifier(callee) ? callee.text : ts.isPropertyAccessExpression(callee) ? callee.name.text : void 0;
|
|
1350
|
+
return !(calleeName !== void 0 && (resolvedSymbol(ctx, callee)?.name ?? calleeName) === "forwardRef" && isAngularCoreOrUnresolved(ctx, callee)) || !ts.isArrowFunction(factory) || ts.isBlock(factory.body) ? expression : unwrap(ctx, factory.body);
|
|
1351
|
+
}
|
|
1352
|
+
var PRE_STANDALONE_ARGUMENT_COUNT = 7, readComponentDeclaration = (ctx, classNode) => {
|
|
1230
1353
|
if (!classNode.getSourceFile().isDeclarationFile)
|
|
1231
1354
|
return;
|
|
1232
1355
|
let type = staticCmpType(ctx, classNode), typeArguments = type?.typeArguments;
|
|
@@ -1421,7 +1544,7 @@ var isAngularCoreOrUnresolved = (ctx, node) => {
|
|
|
1421
1544
|
candidate = candidate.parent;
|
|
1422
1545
|
return candidate?.name?.text ?? "an anonymous class";
|
|
1423
1546
|
}, dropped = (node, name, reason) => {
|
|
1424
|
-
|
|
1547
|
+
logger3.debug(`[angular-cm] ${owningClassName(node)}.${name} left out of docgen: ${reason}`);
|
|
1425
1548
|
}, ANGULAR_GENERATED_STATIC = /^(ngAcceptInputType_|ɵ)/;
|
|
1426
1549
|
function visitClassMembers(ctx, classNode, kind) {
|
|
1427
1550
|
let { ts } = ctx, members = { inputs: [], outputs: [], properties: [], methods: [] }, visitedAccessors = /* @__PURE__ */ new Set();
|
|
@@ -1683,37 +1806,56 @@ var reclassify = (members, entry, inputFields) => {
|
|
|
1683
1806
|
);
|
|
1684
1807
|
}, typeOfPropertyish = (ctx, member) => member.type ? ctx.types.render(member.type) : member.initializer && ctx.ts.isNewExpression(member.initializer) ? member.initializer.expression.getText() : ctx.types.infer(member);
|
|
1685
1808
|
function resolveClassMembers(ctx, classNode, kind) {
|
|
1686
|
-
return
|
|
1809
|
+
return resolveWithHostDirectives(ctx, classNode, kind, /* @__PURE__ */ new Set([classNode]));
|
|
1810
|
+
}
|
|
1811
|
+
function resolveWithHostDirectives(ctx, classNode, kind, visited) {
|
|
1812
|
+
let members = resolveWithBases(ctx, classNode, kind, new Set(visited), /* @__PURE__ */ new Map());
|
|
1813
|
+
return applyHostDirectives(
|
|
1814
|
+
ctx,
|
|
1815
|
+
[classNode, ...ancestors(ctx, classNode)],
|
|
1816
|
+
members,
|
|
1817
|
+
(declaration) => visited.has(declaration) ? void 0 : resolveWithHostDirectives(ctx, declaration, "directive", /* @__PURE__ */ new Set([...visited, declaration]))
|
|
1818
|
+
), members;
|
|
1687
1819
|
}
|
|
1688
1820
|
function resolveWithBases(ctx, classNode, kind, visited, substitutions, instantiatedType) {
|
|
1689
1821
|
let members = visitClassMembers(ctx, classNode, kind);
|
|
1690
1822
|
return walkBases(ctx, classNode, members, kind, visited, substitutions), applyMetadataInputsOutputs(ctx, classNode, members), instantiatedType && instantiateMembers(ctx, instantiatedType, classNode, members, substitutions), members;
|
|
1691
1823
|
}
|
|
1692
|
-
|
|
1824
|
+
var baseClasses = (ctx, classNode) => {
|
|
1693
1825
|
if (!classNode.name)
|
|
1694
|
-
return;
|
|
1826
|
+
return [];
|
|
1695
1827
|
let symbol = ctx.checker.getSymbolAtLocation(classNode.name), type = symbol && ctx.checker.getDeclaredTypeOfSymbol(symbol);
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1828
|
+
return type?.isClassOrInterface() ? ctx.checker.getBaseTypes(type).flatMap((baseType) => {
|
|
1829
|
+
let declaration = baseType.getSymbol()?.declarations?.find(
|
|
1830
|
+
(candidate) => ctx.ts.isClassDeclaration(candidate)
|
|
1831
|
+
);
|
|
1832
|
+
return declaration ? [{ declaration, baseType }] : [];
|
|
1833
|
+
}) : [];
|
|
1834
|
+
}, ancestors = (ctx, classNode) => {
|
|
1835
|
+
let found = [], pending = [classNode];
|
|
1836
|
+
for (let node = pending.pop(); node; node = pending.pop())
|
|
1837
|
+
for (let { declaration } of baseClasses(ctx, node))
|
|
1838
|
+
declaration !== classNode && !found.includes(declaration) && (found.push(declaration), pending.push(declaration));
|
|
1839
|
+
return found;
|
|
1840
|
+
};
|
|
1841
|
+
function walkBases(ctx, classNode, members, kind, visited, substitutions) {
|
|
1842
|
+
for (let { declaration, baseType } of baseClasses(ctx, classNode)) {
|
|
1843
|
+
if (visited.has(declaration))
|
|
1844
|
+
continue;
|
|
1845
|
+
visited.add(declaration);
|
|
1846
|
+
let inheritedSubstitutions = new Map(substitutions);
|
|
1847
|
+
for (let [parameter, argument] of typeParameterSubstitutions(ctx, classNode, declaration))
|
|
1848
|
+
inheritedSubstitutions.set(parameter, argument);
|
|
1849
|
+
let baseMembers = resolveWithBases(
|
|
1850
|
+
ctx,
|
|
1851
|
+
declaration,
|
|
1852
|
+
kind,
|
|
1853
|
+
visited,
|
|
1854
|
+
inheritedSubstitutions,
|
|
1855
|
+
baseType
|
|
1856
|
+
);
|
|
1857
|
+
mergeBucket(ctx, members, baseMembers, "inputs"), mergeBucket(ctx, members, baseMembers, "outputs"), mergeInto(members.properties, baseMembers.properties, members), mergeInto(members.methods, baseMembers.methods, members);
|
|
1858
|
+
}
|
|
1717
1859
|
}
|
|
1718
1860
|
var extendsClauseFor = (ctx, classNode, declaration) => {
|
|
1719
1861
|
let { ts } = ctx, expression = classNode.heritageClauses?.find(
|
|
@@ -2117,16 +2259,16 @@ function analyzeSourceFile(ts, sourceFile, checker, context = analyzerContext(ts
|
|
|
2117
2259
|
if (!ts.isClassDeclaration(statement) || !statement.name)
|
|
2118
2260
|
continue;
|
|
2119
2261
|
if (hasJsDocTag(ts, statement, "ignore")) {
|
|
2120
|
-
|
|
2262
|
+
logger4.debug(`[angular-cm] ${statement.name.text} left out of docgen: tagged @ignore`);
|
|
2121
2263
|
continue;
|
|
2122
2264
|
}
|
|
2123
2265
|
let kind = classify(ctx, statement);
|
|
2124
2266
|
if (kind === "ngmodule") {
|
|
2125
|
-
|
|
2267
|
+
logger4.debug(`[angular-cm] ${statement.name.text} left out of docgen: an @NgModule`);
|
|
2126
2268
|
continue;
|
|
2127
2269
|
}
|
|
2128
2270
|
if (kind === "class" && sourceFile.isDeclarationFile) {
|
|
2129
|
-
|
|
2271
|
+
logger4.debug(
|
|
2130
2272
|
`[angular-cm] ${statement.name.text} left out of docgen: a declaration-file class with no compiled \u0275cmp`
|
|
2131
2273
|
);
|
|
2132
2274
|
continue;
|
|
@@ -2206,7 +2348,7 @@ var KNOWN_DECORATORS = {
|
|
|
2206
2348
|
standalone: metadata && decoratorStandalone(ctx, metadata)
|
|
2207
2349
|
};
|
|
2208
2350
|
}, decoratorSelector = (ctx, metadata) => {
|
|
2209
|
-
let selector = objectProperty(ctx, metadata, "selector"), value = selector &&
|
|
2351
|
+
let selector = objectProperty(ctx, metadata, "selector"), value = selector && resolveReference(ctx, selector);
|
|
2210
2352
|
return value && ctx.ts.isStringLiteralLike(value) ? value.text : void 0;
|
|
2211
2353
|
}, decoratorStandalone = (ctx, metadata) => {
|
|
2212
2354
|
let standalone = !0;
|
|
@@ -2225,20 +2367,14 @@ var KNOWN_DECORATORS = {
|
|
|
2225
2367
|
}
|
|
2226
2368
|
if (!ctx.ts.isPropertyAssignment(property) || !ctx.ts.isIdentifier(property.name) && !ctx.ts.isStringLiteralLike(property.name) || property.name.text !== "standalone")
|
|
2227
2369
|
continue;
|
|
2228
|
-
let value =
|
|
2370
|
+
let value = resolveReference(ctx, property.initializer);
|
|
2229
2371
|
standalone = value?.kind === ctx.ts.SyntaxKind.TrueKeyword ? !0 : value?.kind === ctx.ts.SyntaxKind.FalseKeyword ? !1 : void 0;
|
|
2230
2372
|
}
|
|
2231
2373
|
return standalone;
|
|
2232
|
-
}, resolveInitializer = (ctx, expression) => {
|
|
2233
|
-
let { ts } = ctx;
|
|
2234
|
-
if (!ts.isIdentifier(expression))
|
|
2235
|
-
return expression;
|
|
2236
|
-
let declaration = resolvedSymbol(ctx, expression)?.valueDeclaration;
|
|
2237
|
-
return declaration && ts.isVariableDeclaration(declaration) ? declaration.initializer : void 0;
|
|
2238
2374
|
}, pipeName = (ctx, node) => {
|
|
2239
2375
|
let metadata = decoratorObjectArg(ctx, node, "Pipe");
|
|
2240
2376
|
return metadata && stringOption(ctx, metadata, "name");
|
|
2241
|
-
}, debugExtraction = (configFileName, message) =>
|
|
2377
|
+
}, debugExtraction = (configFileName, message) => logger5.debug(`[angular-cm] ${message}${configFileName ? ` (${configFileName})` : ""}`);
|
|
2242
2378
|
function extractComponent(typescript, checker, sourceFile, names, debug) {
|
|
2243
2379
|
let context = analyzerContext(typescript, sourceFile, checker), fileMeta = analyzeSourceFile(typescript, sourceFile, checker, context), entry = pickEntry(typescript, fileMeta, sourceFile, names);
|
|
2244
2380
|
if (entry)
|
|
@@ -2604,7 +2740,7 @@ function loadDocgenTypeScript(typeScriptSpecifier) {
|
|
|
2604
2740
|
import {
|
|
2605
2741
|
filterSourceFilePaths as filterSourceFilePaths2
|
|
2606
2742
|
} from "storybook/internal/component-meta";
|
|
2607
|
-
import { logger as
|
|
2743
|
+
import { logger as logger6 } from "storybook/internal/node-logger";
|
|
2608
2744
|
|
|
2609
2745
|
// src/docgen/build-docgen.ts
|
|
2610
2746
|
import {
|
|
@@ -2730,7 +2866,7 @@ Check the name against the module's exports, and any barrel that re-exports it.`
|
|
|
2730
2866
|
throw new Error(`Unhandled resolution ${JSON.stringify(unhandled)}`);
|
|
2731
2867
|
}
|
|
2732
2868
|
}
|
|
2733
|
-
}, extractClassDocgen = (component, displayName, reference, storyFilePath, { manager, options, logger:
|
|
2869
|
+
}, extractClassDocgen = (component, displayName, reference, storyFilePath, { manager, options, logger: logger8 }) => {
|
|
2734
2870
|
if (!component.path)
|
|
2735
2871
|
return notFound(
|
|
2736
2872
|
// The import can be written in another module the reference reaches, such as a barrel, so the
|
|
@@ -2760,14 +2896,14 @@ Check that the file exports the component class and is covered by a tsconfig.jso
|
|
|
2760
2896
|
let argTypes = extractArgTypesFromData(meta.entry, {
|
|
2761
2897
|
metadataJson: meta.json,
|
|
2762
2898
|
propsTable: options.propsTable,
|
|
2763
|
-
logger:
|
|
2899
|
+
logger: logger8,
|
|
2764
2900
|
// Named-type table detail resolves against the analyzer's live context; absent for stubbed
|
|
2765
2901
|
// analyzers, which keeps those payloads flat.
|
|
2766
2902
|
context: meta.context
|
|
2767
2903
|
}), apiArgTypes = options.propsTable === "api" ? argTypes : extractArgTypesFromData(meta.entry, {
|
|
2768
2904
|
metadataJson: meta.json,
|
|
2769
2905
|
propsTable: "api",
|
|
2770
|
-
logger:
|
|
2906
|
+
logger: logger8,
|
|
2771
2907
|
context: meta.context
|
|
2772
2908
|
}), jsDocTags = meta.jsDocInfo?.jsDocTags ?? analyzerJsDocTags(meta.entry), description = describedBy(meta.jsDocInfo?.description) ?? describedBy(meta.entry.rawdescription) ?? describedBy(meta.entry.description);
|
|
2773
2909
|
return {
|
|
@@ -2850,8 +2986,8 @@ Check that the file exports the component class and is covered by a tsconfig.jso
|
|
|
2850
2986
|
|
|
2851
2987
|
// src/docgen/docgen-worker.ts
|
|
2852
2988
|
var workerLogger = {
|
|
2853
|
-
warn: (message) =>
|
|
2854
|
-
debug: (message) =>
|
|
2989
|
+
warn: (message) => logger7.warn(`[storybook-angular-vite] ${message}`),
|
|
2990
|
+
debug: (message) => logger7.debug(`[storybook-angular-vite] ${message}`)
|
|
2855
2991
|
}, createManager = async (typeScriptSpecifier) => {
|
|
2856
2992
|
try {
|
|
2857
2993
|
let manager = new AngularComponentMetaManager(
|
|
@@ -2859,7 +2995,7 @@ var workerLogger = {
|
|
|
2859
2995
|
);
|
|
2860
2996
|
return manager.startWatching(), manager;
|
|
2861
2997
|
} catch (error) {
|
|
2862
|
-
|
|
2998
|
+
logger7.warn(
|
|
2863
2999
|
`Angular docgen is unavailable: the component meta analyzer could not be created. ${error instanceof Error ? error.message : String(error)}`
|
|
2864
3000
|
);
|
|
2865
3001
|
return;
|
package/dist/index.js
CHANGED
|
@@ -5,10 +5,12 @@ import {
|
|
|
5
5
|
componentWrapperDecorator,
|
|
6
6
|
moduleMetadata,
|
|
7
7
|
setProjectAnnotations
|
|
8
|
-
} from "./_browser-chunks/chunk-
|
|
9
|
-
import "./_browser-chunks/chunk-
|
|
10
|
-
import "./_browser-chunks/chunk-
|
|
11
|
-
import "./_browser-chunks/chunk-
|
|
8
|
+
} from "./_browser-chunks/chunk-Y5SREGLY.js";
|
|
9
|
+
import "./_browser-chunks/chunk-IFJFIE3P.js";
|
|
10
|
+
import "./_browser-chunks/chunk-S752VTMD.js";
|
|
11
|
+
import "./_browser-chunks/chunk-YS33I6LM.js";
|
|
12
|
+
import "./_browser-chunks/chunk-6VSOLSRX.js";
|
|
13
|
+
import "./_browser-chunks/chunk-T4WQC6BZ.js";
|
|
12
14
|
export {
|
|
13
15
|
__definePreview,
|
|
14
16
|
applicationConfig,
|
package/dist/preset.js
CHANGED
|
@@ -1148,7 +1148,10 @@ var warnedMissingDocgenService = !1, getDocgenPayload = async (componentId) => {
|
|
|
1148
1148
|
}, experimental_storyDocsProvider = createWorkerGatedStoryDocsProvider({
|
|
1149
1149
|
label: "Angular",
|
|
1150
1150
|
docgenWorker: fileURLToPath2(import.meta.resolve(DOCGEN_WORKER_SPECIFIER)),
|
|
1151
|
-
build: (input) => buildStoryDocsPayload(input, { getDocgenPayload })
|
|
1151
|
+
build: (input) => buildStoryDocsPayload(input, { getDocgenPayload }),
|
|
1152
|
+
printHole: fileURLToPath2(
|
|
1153
|
+
import.meta.resolve("@storybook/angular-vite/internal/register-print-hole")
|
|
1154
|
+
)
|
|
1152
1155
|
});
|
|
1153
1156
|
|
|
1154
1157
|
// src/preset.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/angular-vite",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.2",
|
|
4
4
|
"description": "Storybook for Angular: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"./client/docs/config": "./dist/client/docs/config.js",
|
|
38
38
|
"./client/preview-prod": "./dist/client/preview-prod.js",
|
|
39
39
|
"./internal/docgen-worker": "./dist/docgen/docgen-worker.js",
|
|
40
|
+
"./internal/register-print-hole": "./dist/client/docs/register-print-hole.js",
|
|
40
41
|
"./internal/vitest-compiler-setup": "./dist/client/vitest-compiler-setup.js",
|
|
41
42
|
"./node": {
|
|
42
43
|
"types": "./dist/node/index.d.ts",
|
|
@@ -64,8 +65,7 @@
|
|
|
64
65
|
"!src/**/*"
|
|
65
66
|
],
|
|
66
67
|
"dependencies": {
|
|
67
|
-
"@storybook/builder-vite": "11.0.0-rc.
|
|
68
|
-
"@storybook/global": "^5.0.0",
|
|
68
|
+
"@storybook/builder-vite": "11.0.0-rc.2",
|
|
69
69
|
"telejson": "8.0.0",
|
|
70
70
|
"ts-dedent": "^2.2.0",
|
|
71
71
|
"vite": ">=8.0.0"
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"@angular/forms": "^21.2.14",
|
|
83
83
|
"@angular/platform-browser": "^21.2.14",
|
|
84
84
|
"@angular/platform-browser-dynamic": "^21.2.14",
|
|
85
|
-
"@storybook/angular-cm": "11.0.0-rc.
|
|
86
|
-
"@storybook/angular-compodoc": "11.0.0-rc.
|
|
87
|
-
"@storybook/component-meta-typescript": "11.0.0-rc.
|
|
85
|
+
"@storybook/angular-cm": "11.0.0-rc.2",
|
|
86
|
+
"@storybook/angular-compodoc": "11.0.0-rc.2",
|
|
87
|
+
"@storybook/component-meta-typescript": "11.0.0-rc.2",
|
|
88
88
|
"@types/node": "^22.19.1",
|
|
89
89
|
"empathic": "^2.0.0",
|
|
90
90
|
"memfs": "^4.11.1",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"rxjs": "^7.4.0",
|
|
108
108
|
"sass": "^1.0.0",
|
|
109
109
|
"sass-embedded": "^1.0.0",
|
|
110
|
-
"storybook": "^11.0.0-rc.
|
|
110
|
+
"storybook": "^11.0.0-rc.2",
|
|
111
111
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0",
|
|
112
112
|
"vite": ">=8.0.0",
|
|
113
113
|
"zone.js": ">=0.14.0"
|