@stencil/storybook-plugin 0.5.9 → 0.6.0-dev.1783515311.4f8a25b
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/README.md +42 -138
- package/dist/docs/{index.d.ts → index.d.mts} +2 -4
- package/dist/docs/index.d.mts.map +1 -0
- package/dist/{docs-DFb4MYCm.js → docs/index.mjs} +17 -30
- package/dist/docs/index.mjs.map +1 -0
- package/dist/{entry-preview-C1JSJAGq.js → entry-preview-6xYusSlJ.mjs} +19 -22
- package/dist/entry-preview-6xYusSlJ.mjs.map +1 -0
- package/dist/entry-preview-argtypes.d.mts +14 -0
- package/dist/entry-preview-argtypes.d.mts.map +1 -0
- package/dist/entry-preview-argtypes.mjs +165 -0
- package/dist/entry-preview-argtypes.mjs.map +1 -0
- package/dist/entry-preview-auto-docs.d.mts +1 -0
- package/dist/entry-preview-auto-docs.mjs +11 -0
- package/dist/entry-preview-auto-docs.mjs.map +1 -0
- package/dist/{entry-preview-docs.d.ts → entry-preview-docs.d.mts} +2 -4
- package/dist/entry-preview-docs.d.mts.map +1 -0
- package/dist/{entry-preview-docs.js → entry-preview-docs.mjs} +3 -4
- package/dist/entry-preview-docs.mjs.map +1 -0
- package/dist/{entry-preview.d.ts → entry-preview.d.mts} +2 -5
- package/dist/entry-preview.d.mts.map +1 -0
- package/dist/entry-preview.mjs +2 -0
- package/dist/framework-api-oAIB4EMV.mjs +27 -0
- package/dist/framework-api-oAIB4EMV.mjs.map +1 -0
- package/dist/index.d.mts +677 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +32 -0
- package/dist/index.mjs.map +1 -0
- package/dist/node/{index.d.ts → index.d.mts} +2 -4
- package/dist/node/index.d.mts.map +1 -0
- package/dist/node/{index.js → index.mjs} +2 -2
- package/dist/node/index.mjs.map +1 -0
- package/dist/{preset.d.ts → preset.d.mts} +2 -4
- package/dist/preset.d.mts.map +1 -0
- package/dist/preset.mjs +35 -0
- package/dist/preset.mjs.map +1 -0
- package/dist/{rollup-parseAst-t-4tfMPG.d.ts → rollup-parseAst-DL0ij9mb.d.mts} +1 -1
- package/dist/rollup-parseAst-DL0ij9mb.d.mts.map +1 -0
- package/dist/{types-BZP9npQ9.d.cts → types-KTmT9_JX.d.mts} +2 -2
- package/dist/types-KTmT9_JX.d.mts.map +1 -0
- package/dist/wizard.d.mts +7 -0
- package/dist/wizard.d.mts.map +1 -0
- package/dist/wizard.mjs +159 -0
- package/dist/wizard.mjs.map +1 -0
- package/package.json +34 -35
- package/preset.js +1 -2
- package/dist/chunk-CsX-DzYB.cjs +0 -42
- package/dist/docs/index.cjs +0 -4
- package/dist/docs/index.d.cts +0 -15
- package/dist/docs/index.d.cts.map +0 -1
- package/dist/docs/index.d.ts.map +0 -1
- package/dist/docs/index.js +0 -3
- package/dist/docs-DFb4MYCm.js.map +0 -1
- package/dist/docs-ONVKsKI9.cjs +0 -97
- package/dist/docs-ONVKsKI9.cjs.map +0 -1
- package/dist/entry-preview-C0ipNwpw.cjs +0 -85
- package/dist/entry-preview-C0ipNwpw.cjs.map +0 -1
- package/dist/entry-preview-C1JSJAGq.js.map +0 -1
- package/dist/entry-preview-argtypes.cjs +0 -182
- package/dist/entry-preview-argtypes.cjs.map +0 -1
- package/dist/entry-preview-argtypes.d.cts +0 -19
- package/dist/entry-preview-argtypes.d.cts.map +0 -1
- package/dist/entry-preview-argtypes.d.ts +0 -19
- package/dist/entry-preview-argtypes.d.ts.map +0 -1
- package/dist/entry-preview-argtypes.js +0 -181
- package/dist/entry-preview-argtypes.js.map +0 -1
- package/dist/entry-preview-docs.cjs +0 -19
- package/dist/entry-preview-docs.cjs.map +0 -1
- package/dist/entry-preview-docs.d.cts +0 -11
- package/dist/entry-preview-docs.d.cts.map +0 -1
- package/dist/entry-preview-docs.d.ts.map +0 -1
- package/dist/entry-preview-docs.js.map +0 -1
- package/dist/entry-preview.cjs +0 -6
- package/dist/entry-preview.d.cts +0 -20
- package/dist/entry-preview.d.cts.map +0 -1
- package/dist/entry-preview.d.ts.map +0 -1
- package/dist/entry-preview.js +0 -3
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -65
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts +0 -40
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -5
- package/dist/node/index.cjs +0 -9
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -9
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js.map +0 -1
- package/dist/preset.cjs +0 -35
- package/dist/preset.cjs.map +0 -1
- package/dist/preset.d.cts +0 -11
- package/dist/preset.d.cts.map +0 -1
- package/dist/preset.d.ts.map +0 -1
- package/dist/preset.js +0 -32
- package/dist/preset.js.map +0 -1
- package/dist/rollup-parseAst-t-4tfMPG.d.ts.map +0 -1
- package/dist/src-BBcTbcCa.js +0 -55
- package/dist/src-BBcTbcCa.js.map +0 -1
- package/dist/src-D0dJRYm2.cjs +0 -91
- package/dist/src-D0dJRYm2.cjs.map +0 -1
- package/dist/types-BZP9npQ9.d.cts.map +0 -1
- package/dist/types-DqHtEV5w.d.ts +0 -71
- package/dist/types-DqHtEV5w.d.ts.map +0 -1
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import "./entry-preview-C1JSJAGq.js";
|
|
2
|
-
import "./rollup-parseAst-t-4tfMPG.d.ts";
|
|
3
|
-
import { getCustomElements, isValidComponent, isValidMetaData } from "./src-BBcTbcCa.js";
|
|
4
|
-
import { enhanceArgTypes } from "storybook/internal/docs-tools";
|
|
5
|
-
import { logger } from "storybook/internal/client-logger";
|
|
6
|
-
|
|
7
|
-
//#region src/docs/infer-type.ts
|
|
8
|
-
const inferSBType = (prop) => {
|
|
9
|
-
const scalarTypes = [
|
|
10
|
-
"string",
|
|
11
|
-
"number",
|
|
12
|
-
"boolean",
|
|
13
|
-
"symbol"
|
|
14
|
-
];
|
|
15
|
-
if (prop.type.toLowerCase() in scalarTypes) return {
|
|
16
|
-
name: prop.type.toLowerCase(),
|
|
17
|
-
raw: prop.type,
|
|
18
|
-
required: prop.required
|
|
19
|
-
};
|
|
20
|
-
if (/^\(.*\)\s*=>\s*.*$/.test(prop.type)) return {
|
|
21
|
-
name: "function",
|
|
22
|
-
raw: prop.type,
|
|
23
|
-
required: prop.required
|
|
24
|
-
};
|
|
25
|
-
return {
|
|
26
|
-
name: "other",
|
|
27
|
-
value: prop.type,
|
|
28
|
-
raw: prop.type,
|
|
29
|
-
required: prop.required
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
const mapPropOptions = (prop) => prop.values.filter((value) => ["string", "number"].includes(value.type)).map(({ value }) => value);
|
|
33
|
-
const inferControlType = (prop) => {
|
|
34
|
-
switch (prop.type) {
|
|
35
|
-
case "string":
|
|
36
|
-
case "string | undefined": return { type: "text" };
|
|
37
|
-
case "number":
|
|
38
|
-
case "number | undefined": return { type: "number" };
|
|
39
|
-
case "boolean":
|
|
40
|
-
case "boolean | undefined": return { type: "boolean" };
|
|
41
|
-
case "Date":
|
|
42
|
-
case "Date | string": return { type: "date" };
|
|
43
|
-
case "function":
|
|
44
|
-
case "function | undefined":
|
|
45
|
-
case "void":
|
|
46
|
-
case "void | undefined": return null;
|
|
47
|
-
default:
|
|
48
|
-
const values = mapPropOptions(prop);
|
|
49
|
-
if (values.length === 0) return { type: "object" };
|
|
50
|
-
if (values.length < 5) return { type: "radio" };
|
|
51
|
-
return { type: "select" };
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/docs/custom-elements.ts
|
|
57
|
-
/**
|
|
58
|
-
* Formats docsTags (@deprecated, @see, @since) and appends them to the description
|
|
59
|
-
*/
|
|
60
|
-
const formatDocsTags = (docs, docsTags) => {
|
|
61
|
-
if (!docsTags || docsTags.length === 0) return docs;
|
|
62
|
-
const tagSections = [];
|
|
63
|
-
const deprecationSections = [];
|
|
64
|
-
const deprecatedTags = docsTags.filter((tag) => tag.name === "deprecated");
|
|
65
|
-
if (deprecatedTags.length > 0) deprecatedTags.forEach((tag) => {
|
|
66
|
-
if (tag.text) deprecationSections.push(`**⚠️ DEPRECATED:** ${tag.text}`);
|
|
67
|
-
else deprecationSections.push(`**⚠️ DEPRECATED**`);
|
|
68
|
-
});
|
|
69
|
-
const seeTags = docsTags.filter((tag) => tag.name === "see");
|
|
70
|
-
if (seeTags.length > 0) {
|
|
71
|
-
const seeLinks = seeTags.map((tag) => {
|
|
72
|
-
const url = tag.text?.trim();
|
|
73
|
-
return url ? `[${url}](${url})` : "";
|
|
74
|
-
}).filter(Boolean).join(", ");
|
|
75
|
-
if (seeLinks) tagSections.push(`**See:** ${seeLinks}`);
|
|
76
|
-
}
|
|
77
|
-
const sinceTags = docsTags.filter((tag) => tag.name === "since");
|
|
78
|
-
if (sinceTags.length > 0) {
|
|
79
|
-
const sinceText = sinceTags.map((tag) => tag.text).filter(Boolean).join(", ");
|
|
80
|
-
if (sinceText) tagSections.push(`**Since:** ${sinceText}`);
|
|
81
|
-
}
|
|
82
|
-
const allSections = [
|
|
83
|
-
...deprecationSections,
|
|
84
|
-
docs,
|
|
85
|
-
...tagSections
|
|
86
|
-
].filter(Boolean);
|
|
87
|
-
return allSections.join("\n\n");
|
|
88
|
-
};
|
|
89
|
-
const mapData = (data, category) => data.reduce((acc, item) => {
|
|
90
|
-
acc[item.name] = {
|
|
91
|
-
name: item.name,
|
|
92
|
-
description: formatDocsTags(item.docs, item.docsTags),
|
|
93
|
-
control: false,
|
|
94
|
-
table: { category }
|
|
95
|
-
};
|
|
96
|
-
return acc;
|
|
97
|
-
}, {});
|
|
98
|
-
const mapMethods = (methods) => methods.reduce((acc, method) => {
|
|
99
|
-
acc[method.name] = {
|
|
100
|
-
name: method.name,
|
|
101
|
-
description: formatDocsTags(method.docs, method.docsTags),
|
|
102
|
-
control: null,
|
|
103
|
-
type: { name: "function" },
|
|
104
|
-
table: {
|
|
105
|
-
category: "methods",
|
|
106
|
-
type: { summary: method.signature }
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
return acc;
|
|
110
|
-
}, {});
|
|
111
|
-
const mapEvent = (events) => events.reduce((acc, event) => {
|
|
112
|
-
let name = event.event.replace(/(-|_|:|\.|\s)+(.)?/g, (_match, _separator, chr) => {
|
|
113
|
-
return chr ? chr.toUpperCase() : "";
|
|
114
|
-
}).replace(/^([A-Z])/, (match) => match.toLowerCase());
|
|
115
|
-
name = `on${name.charAt(0).toUpperCase() + name.slice(1)}`;
|
|
116
|
-
acc[name] = {
|
|
117
|
-
name,
|
|
118
|
-
description: formatDocsTags(event.docs, event.docsTags),
|
|
119
|
-
control: null,
|
|
120
|
-
table: {
|
|
121
|
-
category: "events",
|
|
122
|
-
type: { summary: event.detail }
|
|
123
|
-
},
|
|
124
|
-
type: { name: "function" }
|
|
125
|
-
};
|
|
126
|
-
return acc;
|
|
127
|
-
}, {});
|
|
128
|
-
const mapProps = (props) => props.reduce((acc, prop) => {
|
|
129
|
-
acc[prop.name] = {
|
|
130
|
-
name: prop.attr || prop.name,
|
|
131
|
-
description: formatDocsTags(prop.docs, prop.docsTags),
|
|
132
|
-
control: inferControlType(prop),
|
|
133
|
-
table: {
|
|
134
|
-
category: "properties",
|
|
135
|
-
type: { summary: prop.complexType?.original },
|
|
136
|
-
defaultValue: { summary: prop.default }
|
|
137
|
-
},
|
|
138
|
-
options: mapPropOptions(prop),
|
|
139
|
-
type: inferSBType(prop)
|
|
140
|
-
};
|
|
141
|
-
return acc;
|
|
142
|
-
}, {});
|
|
143
|
-
const getMetaData = (tagName, manifest) => {
|
|
144
|
-
if (!isValidComponent(tagName) || !isValidMetaData(manifest)) return null;
|
|
145
|
-
const metaData = manifest.components.find((component) => component.tag.toUpperCase() === tagName.toUpperCase());
|
|
146
|
-
if (!metaData) logger.warn(`Component not found in custom-elements.json: ${tagName}`);
|
|
147
|
-
return metaData;
|
|
148
|
-
};
|
|
149
|
-
const extractArgTypesFromElements = (tagName, customElements) => {
|
|
150
|
-
const metaData = getMetaData(tagName, customElements);
|
|
151
|
-
return metaData && {
|
|
152
|
-
...mapProps(metaData.props),
|
|
153
|
-
...mapEvent(metaData.events),
|
|
154
|
-
...mapMethods(metaData.methods),
|
|
155
|
-
...mapData(metaData.slots, "slots"),
|
|
156
|
-
...mapData(metaData.parts, "parts"),
|
|
157
|
-
...mapData(metaData.styles, "styles")
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
const extractArgTypes = (component) => {
|
|
161
|
-
const cem = getCustomElements();
|
|
162
|
-
const tagName = typeof component === "string" ? component : component?.is;
|
|
163
|
-
return extractArgTypesFromElements(tagName, cem);
|
|
164
|
-
};
|
|
165
|
-
const extractComponentDescription = (component) => {
|
|
166
|
-
const tagName = typeof component === "string" ? component : component?.is;
|
|
167
|
-
const metaData = getMetaData(tagName, getCustomElements());
|
|
168
|
-
return metaData && metaData.docs;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
//#endregion
|
|
172
|
-
//#region src/entry-preview-argtypes.ts
|
|
173
|
-
const parameters = { docs: {
|
|
174
|
-
extractArgTypes,
|
|
175
|
-
extractComponentDescription
|
|
176
|
-
} };
|
|
177
|
-
const argTypesEnhancers = [enhanceArgTypes];
|
|
178
|
-
|
|
179
|
-
//#endregion
|
|
180
|
-
export { argTypesEnhancers, parameters };
|
|
181
|
-
//# sourceMappingURL=entry-preview-argtypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-argtypes.js","names":["prop: JsonDocsProp","scalarTypes: SBScalarType['name'][]","docs: string","docsTags?: DocsTag[]","tagSections: string[]","deprecationSections: string[]","data: T[]","category: string","methods: JsonDocsMethod[]","events: JsonDocsEvent[]","chr: string","props: JsonDocsProp[]","tagName: string","manifest: JsonDocs","customElements: JsonDocs","component: any","argTypesEnhancers: ArgTypesEnhancer<StencilRenderer<unknown>>[]"],"sources":["../src/docs/infer-type.ts","../src/docs/custom-elements.ts","../src/entry-preview-argtypes.ts"],"sourcesContent":["import type { JsonDocsProp } from '@stencil/core/internal';\nimport type { InputType, SBScalarType, SBType } from 'storybook/internal/types';\n\nexport const inferSBType = (prop: JsonDocsProp): SBType => {\n const scalarTypes: SBScalarType['name'][] = ['string', 'number', 'boolean', 'symbol'];\n if (prop.type.toLowerCase() in scalarTypes) {\n return { name: prop.type.toLowerCase(), raw: prop.type, required: prop.required } as SBScalarType;\n }\n\n if (/^\\(.*\\)\\s*=>\\s*.*$/.test(prop.type)) {\n return { name: 'function', raw: prop.type, required: prop.required };\n }\n\n return { name: 'other', value: prop.type, raw: prop.type, required: prop.required };\n};\n\nexport const mapPropOptions = (prop: JsonDocsProp) =>\n prop.values.filter((value) => ['string', 'number'].includes(value.type)).map(({ value }) => value);\n\nexport const inferControlType = (prop: JsonDocsProp): InputType['control'] => {\n switch (prop.type) {\n case 'string':\n case 'string | undefined':\n return { type: 'text' };\n case 'number':\n case 'number | undefined':\n return { type: 'number' };\n case 'boolean':\n case 'boolean | undefined':\n return { type: 'boolean' };\n case 'Date':\n case 'Date | string':\n return { type: 'date' };\n case 'function':\n case 'function | undefined':\n case 'void':\n case 'void | undefined':\n return null;\n default:\n const values = mapPropOptions(prop);\n\n if (values.length === 0) {\n return { type: 'object' };\n }\n if (values.length < 5) {\n return { type: 'radio' };\n }\n return { type: 'select' };\n }\n};\n","import type {\n JsonDocs,\n JsonDocsEvent,\n JsonDocsMethod,\n JsonDocsPart,\n JsonDocsProp,\n JsonDocsSlot,\n JsonDocsStyle,\n} from '@stencil/core/internal';\nimport { logger } from 'storybook/internal/client-logger';\nimport type { ArgTypes } from 'storybook/internal/types';\n\nimport { getCustomElements, isValidComponent, isValidMetaData } from '..';\nimport { inferControlType, inferSBType, mapPropOptions } from './infer-type';\n\ninterface DocsTag {\n name: string;\n text?: string;\n}\n\n/**\n * Formats docsTags (@deprecated, @see, @since) and appends them to the description\n */\nconst formatDocsTags = (docs: string, docsTags?: DocsTag[]): string => {\n if (!docsTags || docsTags.length === 0) {\n return docs;\n }\n\n const tagSections: string[] = [];\n const deprecationSections: string[] = [];\n\n // Handle @deprecated tags - show at the top with emphasis\n const deprecatedTags = docsTags.filter((tag) => tag.name === 'deprecated');\n if (deprecatedTags.length > 0) {\n deprecatedTags.forEach((tag) => {\n if (tag.text) {\n deprecationSections.push(`**⚠️ DEPRECATED:** ${tag.text}`);\n } else {\n deprecationSections.push(`**⚠️ DEPRECATED**`);\n }\n });\n }\n\n // Handle @see tags - create links\n const seeTags = docsTags.filter((tag) => tag.name === 'see');\n if (seeTags.length > 0) {\n const seeLinks = seeTags\n .map((tag) => {\n const url = tag.text?.trim();\n return url ? `[${url}](${url})` : '';\n })\n .filter(Boolean)\n .join(', ');\n if (seeLinks) {\n tagSections.push(`**See:** ${seeLinks}`);\n }\n }\n\n // Handle @since tags\n const sinceTags = docsTags.filter((tag) => tag.name === 'since');\n if (sinceTags.length > 0) {\n const sinceText = sinceTags\n .map((tag) => tag.text)\n .filter(Boolean)\n .join(', ');\n if (sinceText) {\n tagSections.push(`**Since:** ${sinceText}`);\n }\n }\n\n // Combine all sections - deprecation first, then docs, then other tags\n const allSections = [...deprecationSections, docs, ...tagSections].filter(Boolean);\n\n return allSections.join('\\n\\n');\n};\n\nconst mapData = <T extends JsonDocsPart>(data: T[], category: string): ArgTypes =>\n data.reduce<ArgTypes>((acc, item) => {\n acc[item.name] = {\n name: item.name,\n description: formatDocsTags(item.docs, (item as any).docsTags as DocsTag[]),\n control: false,\n table: {\n category,\n },\n };\n return acc;\n }, {});\n\nconst mapMethods = (methods: JsonDocsMethod[]): ArgTypes =>\n methods.reduce<ArgTypes>((acc, method) => {\n acc[method.name] = {\n name: method.name,\n description: formatDocsTags(method.docs, method.docsTags as DocsTag[]),\n control: null,\n type: { name: 'function' },\n table: {\n category: 'methods',\n type: { summary: method.signature },\n },\n };\n return acc;\n }, {});\n\nconst mapEvent = (events: JsonDocsEvent[]): ArgTypes =>\n events.reduce<ArgTypes>((acc, event) => {\n let name = event.event\n .replace(/(-|_|:|\\.|\\s)+(.)?/g, (_match, _separator, chr: string) => {\n return chr ? chr.toUpperCase() : '';\n })\n .replace(/^([A-Z])/, (match) => match.toLowerCase());\n\n name = `on${name.charAt(0).toUpperCase() + name.slice(1)}`;\n\n acc[name] = {\n name,\n description: formatDocsTags(event.docs, event.docsTags as DocsTag[]),\n control: null,\n table: {\n category: 'events',\n type: { summary: event.detail },\n },\n type: { name: 'function' },\n };\n\n return acc;\n }, {});\n\nconst mapProps = (props: JsonDocsProp[]): ArgTypes =>\n props.reduce<ArgTypes>((acc, prop) => {\n acc[prop.name] = {\n name: prop.attr || prop.name,\n description: formatDocsTags(prop.docs, prop.docsTags as DocsTag[]),\n control: inferControlType(prop),\n table: {\n category: 'properties',\n type: { summary: prop.complexType?.original },\n defaultValue: { summary: prop.default },\n },\n options: mapPropOptions(prop),\n type: inferSBType(prop),\n };\n\n return acc;\n }, {});\n\nconst getMetaData = (tagName: string, manifest: JsonDocs) => {\n if (!isValidComponent(tagName) || !isValidMetaData(manifest)) {\n return null;\n }\n const metaData = manifest.components.find((component) => component.tag.toUpperCase() === tagName.toUpperCase());\n if (!metaData) {\n logger.warn(`Component not found in custom-elements.json: ${tagName}`);\n }\n return metaData;\n};\n\nexport const extractArgTypesFromElements = (tagName: string, customElements: JsonDocs) => {\n const metaData = getMetaData(tagName, customElements);\n return (\n metaData && {\n ...mapProps(metaData.props),\n ...mapEvent(metaData.events),\n ...mapMethods(metaData.methods),\n ...mapData<JsonDocsSlot>(metaData.slots, 'slots'),\n ...mapData<JsonDocsPart>(metaData.parts, 'parts'),\n ...mapData<JsonDocsStyle>(metaData.styles, 'styles'),\n }\n );\n};\n\nexport const extractArgTypes = (component: any) => {\n const cem = getCustomElements();\n // Handle both string references (lazy loading) and class references (auto-define)\n const tagName = typeof component === 'string' ? component : component?.is;\n return extractArgTypesFromElements(tagName, cem);\n};\n\nexport const extractComponentDescription = (component: any) => {\n // Handle both string references (lazy loading) and class references (auto-define)\n const tagName = typeof component === 'string' ? component : component?.is;\n const metaData = getMetaData(tagName, getCustomElements());\n return metaData && metaData.docs;\n};\n","import { enhanceArgTypes } from 'storybook/internal/docs-tools';\nimport type { ArgTypesEnhancer } from 'storybook/internal/types';\n\nimport { extractArgTypes, extractComponentDescription } from './docs/custom-elements';\nimport type { StencilRenderer } from './types';\n\nexport const parameters = {\n docs: {\n extractArgTypes,\n extractComponentDescription,\n },\n};\n\nexport const argTypesEnhancers: ArgTypesEnhancer<StencilRenderer<unknown>>[] = [enhanceArgTypes];"],"mappings":";;;;;;;AAGA,MAAa,cAAc,CAACA,SAA+B;CACzD,MAAMC,cAAsC;EAAC;EAAU;EAAU;EAAW;CAAS;AACrF,KAAI,KAAK,KAAK,aAAa,IAAI,YAC7B,QAAO;EAAE,MAAM,KAAK,KAAK,aAAa;EAAE,KAAK,KAAK;EAAM,UAAU,KAAK;CAAU;AAGnF,KAAI,qBAAqB,KAAK,KAAK,KAAK,CACtC,QAAO;EAAE,MAAM;EAAY,KAAK,KAAK;EAAM,UAAU,KAAK;CAAU;AAGtE,QAAO;EAAE,MAAM;EAAS,OAAO,KAAK;EAAM,KAAK,KAAK;EAAM,UAAU,KAAK;CAAU;AACpF;AAED,MAAa,iBAAiB,CAACD,SAC7B,KAAK,OAAO,OAAO,CAAC,UAAU,CAAC,UAAU,QAAS,EAAC,SAAS,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,MAAM;AAEpG,MAAa,mBAAmB,CAACA,SAA6C;AAC5E,SAAQ,KAAK,MAAb;EACE,KAAK;EACL,KAAK,qBACH,QAAO,EAAE,MAAM,OAAQ;EACzB,KAAK;EACL,KAAK,qBACH,QAAO,EAAE,MAAM,SAAU;EAC3B,KAAK;EACL,KAAK,sBACH,QAAO,EAAE,MAAM,UAAW;EAC5B,KAAK;EACL,KAAK,gBACH,QAAO,EAAE,MAAM,OAAQ;EACzB,KAAK;EACL,KAAK;EACL,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unk = require('./chunk-CsX-DzYB.cjs');
|
|
2
|
-
const require_docs = require('./docs-ONVKsKI9.cjs');
|
|
3
|
-
const storybook_internal_docs_tools = require_chunk.__toESM(require("storybook/internal/docs-tools"));
|
|
4
|
-
|
|
5
|
-
//#region src/entry-preview-docs.ts
|
|
6
|
-
const decorators = [require_docs.sourceDecorator];
|
|
7
|
-
const parameters = { docs: {
|
|
8
|
-
story: { inline: true },
|
|
9
|
-
source: {
|
|
10
|
-
type: storybook_internal_docs_tools.SourceType.DYNAMIC,
|
|
11
|
-
language: "html",
|
|
12
|
-
format: "dedent"
|
|
13
|
-
}
|
|
14
|
-
} };
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
exports.decorators = decorators;
|
|
18
|
-
exports.parameters = parameters;
|
|
19
|
-
//# sourceMappingURL=entry-preview-docs.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-docs.cjs","names":["decorators: DecoratorFunction<StencilRenderer<unknown>>[]","sourceDecorator","parameters: Parameters","SourceType"],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":["import { SourceType } from 'storybook/internal/docs-tools';\nimport type { DecoratorFunction, Parameters } from 'storybook/internal/types';\nimport { sourceDecorator } from './docs';\nimport type { StencilRenderer } from './types';\n\nexport const decorators: DecoratorFunction<StencilRenderer<unknown>>[] = [sourceDecorator];\n\nexport const parameters: Parameters = {\n docs: {\n story: { inline: true },\n source: {\n type: SourceType.DYNAMIC,\n language: 'html',\n format: 'dedent',\n },\n },\n};\n"],"mappings":";;;;;AAKA,MAAaA,aAA4D,CAACC,4BAAgB;AAE1F,MAAaC,aAAyB,EACpC,MAAM;CACJ,OAAO,EAAE,QAAQ,KAAM;CACvB,QAAQ;EACN,MAAMC,yCAAW;EACjB,UAAU;EACV,QAAQ;CACT;AACF,EACF"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { StencilRenderer } from "./types-BZP9npQ9.cjs";
|
|
2
|
-
import { DecoratorFunction, Parameters } from "storybook/internal/types";
|
|
3
|
-
|
|
4
|
-
//#region src/entry-preview-docs.d.ts
|
|
5
|
-
declare const decorators: DecoratorFunction<StencilRenderer<unknown>>[];
|
|
6
|
-
declare const parameters: Parameters;
|
|
7
|
-
//# sourceMappingURL=entry-preview-docs.d.ts.map
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { decorators, parameters };
|
|
11
|
-
//# sourceMappingURL=entry-preview-docs.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-docs.d.cts","names":[],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":[],"mappings":";;;;cAKa,YAAY,kBAAkB;cAE9B,YAAY;AAFzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-docs.d.ts","names":[],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":[],"mappings":";;;;cAKa,YAAY,kBAAkB;cAE9B,YAAY;AAFzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview-docs.js","names":["decorators: DecoratorFunction<StencilRenderer<unknown>>[]","parameters: Parameters"],"sources":["../src/entry-preview-docs.ts"],"sourcesContent":["import { SourceType } from 'storybook/internal/docs-tools';\nimport type { DecoratorFunction, Parameters } from 'storybook/internal/types';\nimport { sourceDecorator } from './docs';\nimport type { StencilRenderer } from './types';\n\nexport const decorators: DecoratorFunction<StencilRenderer<unknown>>[] = [sourceDecorator];\n\nexport const parameters: Parameters = {\n docs: {\n story: { inline: true },\n source: {\n type: SourceType.DYNAMIC,\n language: 'html',\n format: 'dedent',\n },\n },\n};\n"],"mappings":";;;;AAKA,MAAaA,aAA4D,CAAC,eAAgB;AAE1F,MAAaC,aAAyB,EACpC,MAAM;CACJ,OAAO,EAAE,QAAQ,KAAM;CACvB,QAAQ;EACN,MAAM,WAAW;EACjB,UAAU;EACV,QAAQ;CACT;AACF,EACF"}
|
package/dist/entry-preview.cjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const require_entry_preview = require('./entry-preview-C0ipNwpw.cjs');
|
|
2
|
-
|
|
3
|
-
exports.argTypesEnhancers = require_entry_preview.argTypesEnhancers;
|
|
4
|
-
exports.parameters = require_entry_preview.parameters;
|
|
5
|
-
exports.render = require_entry_preview.render;
|
|
6
|
-
exports.renderToCanvas = require_entry_preview.renderToCanvas;
|
package/dist/entry-preview.d.cts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { StencilRenderer } from "./types-BZP9npQ9.cjs";
|
|
2
|
-
import { ArgTypesEnhancer, ArgsStoryFn, Parameters, RenderContext } from "storybook/internal/types";
|
|
3
|
-
|
|
4
|
-
//#region src/render.d.ts
|
|
5
|
-
declare const render: ArgsStoryFn<StencilRenderer<unknown>>;
|
|
6
|
-
declare function renderToCanvas({
|
|
7
|
-
storyFn,
|
|
8
|
-
showMain,
|
|
9
|
-
storyContext
|
|
10
|
-
}: RenderContext<StencilRenderer<unknown>>, canvasElement: StencilRenderer<unknown>['canvasElement']): void;
|
|
11
|
-
//# sourceMappingURL=render.d.ts.map
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/entry-preview.d.ts
|
|
14
|
-
declare const parameters: Parameters;
|
|
15
|
-
declare const argTypesEnhancers: ArgTypesEnhancer[];
|
|
16
|
-
//# sourceMappingURL=entry-preview.d.ts.map
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { argTypesEnhancers, parameters, render, renderToCanvas };
|
|
20
|
-
//# sourceMappingURL=entry-preview.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview.d.cts","names":[],"sources":["../src/render.ts","../src/entry-preview.ts"],"sourcesContent":[],"mappings":";;;;cAMa,QAAQ,YAAY;iBAwCjB,cAAA;;;;GACuB,cAAc,0CACpC;AA1CjB;;;cCHa,YAAY;cAIZ,mBAAmB;ADDhC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-preview.d.ts","names":[],"sources":["../src/render.ts","../src/entry-preview.ts"],"sourcesContent":[],"mappings":";;;;cAMa,QAAQ,YAAY;iBAwCjB,cAAA;;;;GACuB,cAAc,0CACpC;AA1CjB;;;cCHa,YAAY;cAIZ,mBAAmB;ADDhC"}
|
package/dist/entry-preview.js
DELETED
package/dist/index.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const require_src = require('./src-D0dJRYm2.cjs');
|
|
2
|
-
require('./entry-preview-C0ipNwpw.cjs');
|
|
3
|
-
|
|
4
|
-
exports.getCustomElements = require_src.getCustomElements;
|
|
5
|
-
exports.isValidComponent = require_src.isValidComponent;
|
|
6
|
-
exports.isValidMetaData = require_src.isValidMetaData;
|
|
7
|
-
exports.setCustomElements = require_src.setCustomElements;
|
|
8
|
-
exports.setCustomElementsManifest = require_src.setCustomElementsManifest;
|
|
9
|
-
exports.setProjectAnnotations = require_src.setProjectAnnotations;
|
package/dist/index.d.cts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig } from "./types-BZP9npQ9.cjs";
|
|
2
|
-
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from "storybook/internal/types";
|
|
3
|
-
import { JsonDocs } from "@stencil/core/internal";
|
|
4
|
-
|
|
5
|
-
//#region @types/rollup-parseAst.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Extra type definitions for rollup/parseAst in cases the Rollup version between
|
|
9
|
-
* `@stencil/storybook-plugin` and `unplugin-stencil` is different. This may cause
|
|
10
|
-
* the following type error:
|
|
11
|
-
*
|
|
12
|
-
* ```
|
|
13
|
-
* [ ERROR ] TypeScript: node_modules/vite/dist/node/index.d.ts:5:41
|
|
14
|
-
* Cannot find module 'rollup/parseAst' or its corresponding type
|
|
15
|
-
* declarations.
|
|
16
|
-
*
|
|
17
|
-
* L4: export { rollup as Rollup };
|
|
18
|
-
* L5: export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
|
19
|
-
* L6: import * as http from 'node:http';
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* This file is a workaround to make sure the type definitions are available when
|
|
23
|
-
* importing `rollup/parseAst` in `unplugin-stencil`.
|
|
24
|
-
*/
|
|
25
|
-
declare module 'rollup/parseAst' {
|
|
26
|
-
export function parseAst(code: string, options?: any): any;
|
|
27
|
-
export function parseAstAsync(code: string, options?: any): Promise<any>;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/framework-api.d.ts
|
|
31
|
-
declare function isValidComponent(tagName: string): boolean;
|
|
32
|
-
declare function isValidMetaData(customElements: JsonDocs): boolean;
|
|
33
|
-
/** @param customElements `any` for now as spec is not super stable yet */
|
|
34
|
-
declare function setCustomElements(customElements: any): void;
|
|
35
|
-
declare function setCustomElementsManifest(customElements: any): void;
|
|
36
|
-
declare function getCustomElements(): any;
|
|
37
|
-
//# sourceMappingURL=framework-api.d.ts.map
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/portable-stories.d.ts
|
|
41
|
-
/**
|
|
42
|
-
* Function that sets the globalConfig of your storybook. The global config is the preview module of
|
|
43
|
-
* your .storybook folder.
|
|
44
|
-
*
|
|
45
|
-
* It should be run a single time, so that your global config (e.g. decorators) is applied to your
|
|
46
|
-
* stories when using `composeStories` or `composeStory`.
|
|
47
|
-
*
|
|
48
|
-
* Example:
|
|
49
|
-
*
|
|
50
|
-
* ```jsx
|
|
51
|
-
* // setup-file.js
|
|
52
|
-
* import { setProjectAnnotations } from '@storybook/web-components';
|
|
53
|
-
* import projectAnnotations from './.storybook/preview';
|
|
54
|
-
*
|
|
55
|
-
* setProjectAnnotations(projectAnnotations);
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @param projectAnnotations - E.g. (import projectAnnotations from '../.storybook/preview')
|
|
59
|
-
*/
|
|
60
|
-
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<StencilRenderer<unknown>>;
|
|
61
|
-
//# sourceMappingURL=portable-stories.d.ts.map
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
export { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig, getCustomElements, isValidComponent, isValidMetaData, setCustomElements, setCustomElementsManifest, setProjectAnnotations };
|
|
65
|
-
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["Promise","sideEffect"],"sources":["../@types/rollup-parseAst.d.ts","../src/framework-api.ts","../src/portable-stories.tsx"],"sourcesContent":["/**\n * Extra type definitions for rollup/parseAst in cases the Rollup version between\n * `@stencil/storybook-plugin` and `unplugin-stencil` is different. This may cause\n * the following type error:\n *\n * ```\n * [ ERROR ] TypeScript: node_modules/vite/dist/node/index.d.ts:5:41\n * Cannot find module 'rollup/parseAst' or its corresponding type\n * declarations.\n *\n * L4: export { rollup as Rollup };\n * L5: export { parseAst, parseAstAsync } from 'rollup/parseAst';\n * L6: import * as http from 'node:http';\n * ```\n *\n * This file is a workaround to make sure the type definitions are available when\n * importing `rollup/parseAst` in `unplugin-stencil`.\n */\ndeclare module 'rollup/parseAst' {\n export function parseAst(code: string, options?: any): any;\n export function parseAstAsync(code: string, options?: any): Promise<any>;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBqE;;;;ACjBrE;AAUA;AAaA;AAIA;AAIA;;;8DDd8DA;AES9D;;;iBD1BgB,gBAAA;iBAUA,eAAA,iBAAgC;;iBAahC,iBAAA;iBAIA,yBAAA;iBAIA,iBAAA,CAAA;;;;;;;;;;;;ADdqD;;;;ACjBrE;AAUA;AAaA;AAIA;AAIA;;;;ACLgB,iBAAA,qBAAA,CAAqB,kBAAA,EACf,gCADe,CAAA,GAAA,CAAA,GACyB,gCADzB,CAAA,GAAA,CAAA,EAAA,CAAA,EAElC,4BAFkC,CAEL,eAFK,CAAA,OAAA,CAAA,CAAA"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import "./rollup-parseAst-t-4tfMPG.js";
|
|
2
|
-
import { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig } from "./types-DqHtEV5w.js";
|
|
3
|
-
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations } from "storybook/internal/types";
|
|
4
|
-
import { JsonDocs } from "@stencil/core/internal";
|
|
5
|
-
|
|
6
|
-
//#region src/framework-api.d.ts
|
|
7
|
-
declare function isValidComponent(tagName: string): boolean;
|
|
8
|
-
declare function isValidMetaData(customElements: JsonDocs): boolean;
|
|
9
|
-
/** @param customElements `any` for now as spec is not super stable yet */
|
|
10
|
-
declare function setCustomElements(customElements: any): void;
|
|
11
|
-
declare function setCustomElementsManifest(customElements: any): void;
|
|
12
|
-
declare function getCustomElements(): any;
|
|
13
|
-
//# sourceMappingURL=framework-api.d.ts.map
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/portable-stories.d.ts
|
|
17
|
-
/**
|
|
18
|
-
* Function that sets the globalConfig of your storybook. The global config is the preview module of
|
|
19
|
-
* your .storybook folder.
|
|
20
|
-
*
|
|
21
|
-
* It should be run a single time, so that your global config (e.g. decorators) is applied to your
|
|
22
|
-
* stories when using `composeStories` or `composeStory`.
|
|
23
|
-
*
|
|
24
|
-
* Example:
|
|
25
|
-
*
|
|
26
|
-
* ```jsx
|
|
27
|
-
* // setup-file.js
|
|
28
|
-
* import { setProjectAnnotations } from '@storybook/web-components';
|
|
29
|
-
* import projectAnnotations from './.storybook/preview';
|
|
30
|
-
*
|
|
31
|
-
* setProjectAnnotations(projectAnnotations);
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @param projectAnnotations - E.g. (import projectAnnotations from '../.storybook/preview')
|
|
35
|
-
*/
|
|
36
|
-
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<StencilRenderer<unknown>>;
|
|
37
|
-
//# sourceMappingURL=portable-stories.d.ts.map
|
|
38
|
-
//#endregion
|
|
39
|
-
export { Decorator, Loader, Meta, Preview, StencilRenderer, StoryContext, StoryFn, StoryObj, StorybookConfig, getCustomElements, isValidComponent, isValidMetaData, setCustomElements, setCustomElementsManifest, setProjectAnnotations };
|
|
40
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/framework-api.ts","../src/portable-stories.tsx"],"sourcesContent":[],"mappings":";;;;;;iBAGgB,gBAAA;iBAUA,eAAA,iBAAgC;;iBAahC,iBAAA;iBAIA,yBAAA;AA3BA,iBA+BA,iBAAA,CAAA,CA/BgB,EAAA,GAAA;AAUhC;;;;;;;;AAVA;AAUA;AAaA;AAIA;AAIA;;;;ACLA;;;;;;AAE+B;iBAFf,qBAAA,qBACM,wCAAwC,0CAC3D,6BAA6B"}
|
package/dist/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import "./entry-preview-C1JSJAGq.js";
|
|
2
|
-
import "./rollup-parseAst-t-4tfMPG.d.ts";
|
|
3
|
-
import { getCustomElements, isValidComponent, isValidMetaData, setCustomElements, setCustomElementsManifest, setProjectAnnotations } from "./src-BBcTbcCa.js";
|
|
4
|
-
|
|
5
|
-
export { getCustomElements, isValidComponent, isValidMetaData, setCustomElements, setCustomElementsManifest, setProjectAnnotations };
|
package/dist/node/index.cjs
DELETED
package/dist/node/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["config: StorybookConfig"],"sources":["../../src/node/index.ts"],"sourcesContent":["import type { StorybookConfig } from '../types';\n\nexport function defineMain(config: StorybookConfig) {\n return config;\n}\n"],"mappings":";;AAEA,SAAgB,WAAWA,QAAyB;AAClD,QAAO;AACR"}
|
package/dist/node/index.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StorybookConfig } from "../types-BZP9npQ9.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/node/index.d.ts
|
|
4
|
-
declare function defineMain(config: StorybookConfig): StorybookConfig;
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { defineMain };
|
|
9
|
-
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/node/index.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,UAAA,SAAmB,kBAAe"}
|
package/dist/node/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/node/index.ts"],"sourcesContent":[],"mappings":";;;iBAEgB,UAAA,SAAmB,kBAAe"}
|
package/dist/node/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["config: StorybookConfig"],"sources":["../../src/node/index.ts"],"sourcesContent":["import type { StorybookConfig } from '../types';\n\nexport function defineMain(config: StorybookConfig) {\n return config;\n}\n"],"mappings":";AAEA,SAAgB,WAAWA,QAAyB;AAClD,QAAO;AACR"}
|
package/dist/preset.cjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-CsX-DzYB.cjs');
|
|
2
|
-
const module$1 = require_chunk.__toESM(require("module"));
|
|
3
|
-
const path = require_chunk.__toESM(require("path"));
|
|
4
|
-
const unplugin_stencil_vite = require_chunk.__toESM(require("unplugin-stencil/vite"));
|
|
5
|
-
const url = require_chunk.__toESM(require("url"));
|
|
6
|
-
const vite = require_chunk.__toESM(require("vite"));
|
|
7
|
-
|
|
8
|
-
//#region src/preset.ts
|
|
9
|
-
const require$1 = (0, module$1.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
10
|
-
const getAbsolutePath = (input) => (0, path.dirname)(require$1.resolve((0, path.join)(input, "package.json")));
|
|
11
|
-
const __dirname$1 = (0, path.dirname)((0, url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
|
|
12
|
-
const renderer = (0, path.join)(__dirname$1, "entry-preview.js");
|
|
13
|
-
const core = {
|
|
14
|
-
builder: getAbsolutePath("@storybook/builder-vite"),
|
|
15
|
-
renderer
|
|
16
|
-
};
|
|
17
|
-
const viteFinal = async (defaultConfig, { configType }) => {
|
|
18
|
-
const config = (0, vite.mergeConfig)(defaultConfig, {
|
|
19
|
-
build: { target: "es2020" },
|
|
20
|
-
plugins: [(0, unplugin_stencil_vite.default)({ rootPath: defaultConfig.root })]
|
|
21
|
-
});
|
|
22
|
-
if (configType === "DEVELOPMENT") return (0, vite.mergeConfig)(config, { build: { rollupOptions: { external: ["@stencil/core"] } } });
|
|
23
|
-
return config;
|
|
24
|
-
};
|
|
25
|
-
const previewAnnotations = async (input = [], options) => {
|
|
26
|
-
const docsEnabled = Object.keys(await options.presets.apply("docs", {}, options)).length > 0;
|
|
27
|
-
const result = [];
|
|
28
|
-
return result.concat(input).concat([renderer, (0, path.join)(__dirname$1, "entry-preview-argtypes.js")]).concat(docsEnabled ? [(0, path.join)(__dirname$1, "entry-preview-docs.js")] : []);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
exports.core = core;
|
|
33
|
-
exports.previewAnnotations = previewAnnotations;
|
|
34
|
-
exports.viteFinal = viteFinal;
|
|
35
|
-
//# sourceMappingURL=preset.cjs.map
|
package/dist/preset.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preset.cjs","names":["require","input: I","__dirname","core: StorybookConfig['core']","viteFinal: StorybookConfig['viteFinal']","previewAnnotations: StorybookConfig['previewAnnotations']","result: string[]"],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * we can't prefix the Node.js imports with `node:` because it will break\n * within Storybook due to its Vite setup.\n */\nimport { createRequire } from 'module';\nimport { dirname, join } from 'path';\nimport stencil from 'unplugin-stencil/vite';\nimport { fileURLToPath } from 'url';\nimport { mergeConfig } from 'vite';\nimport { StorybookConfig } from './types';\n\nconst require = createRequire(import.meta.url);\nconst getAbsolutePath = <I extends string>(input: I): I => dirname(require.resolve(join(input, 'package.json'))) as any;\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst renderer = join(__dirname, 'entry-preview.js');\n\nexport const core: StorybookConfig['core'] = {\n builder: getAbsolutePath('@storybook/builder-vite'),\n renderer,\n};\n\nexport const viteFinal: StorybookConfig['viteFinal'] = async (defaultConfig, { configType }) => {\n const config = mergeConfig(defaultConfig, {\n build: {\n target: 'es2020',\n },\n plugins: [\n stencil({\n rootPath: defaultConfig.root,\n }),\n ],\n });\n if (configType === 'DEVELOPMENT') {\n return mergeConfig(config, {\n build: {\n rollupOptions: {\n external: ['@stencil/core'],\n },\n },\n });\n }\n\n return config;\n};\n\nexport const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input = [], options) => {\n const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;\n const result: string[] = [];\n\n return result\n .concat(input)\n .concat([renderer, join(__dirname, 'entry-preview-argtypes.js')])\n .concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.js')] : []);\n};\n"],"mappings":";;;;;;;;AAWA,MAAMA,YAAU,0EAA8B;AAC9C,MAAM,kBAAkB,CAAmBC,UAAgB,kBAAQ,UAAQ,QAAQ,eAAK,OAAO,eAAe,CAAC,CAAC;AAEhH,MAAMC,cAAY,kBAAQ,qEAA8B,CAAC;AAEzD,MAAM,WAAW,eAAKA,aAAW,mBAAmB;AAEpD,MAAaC,OAAgC;CAC3C,SAAS,gBAAgB,0BAA0B;CACnD;AACD;AAED,MAAaC,YAA0C,OAAO,eAAe,EAAE,YAAY,KAAK;CAC9F,MAAM,SAAS,sBAAY,eAAe;EACxC,OAAO,EACL,QAAQ,SACT;EACD,SAAS,CACP,mCAAQ,EACN,UAAU,cAAc,KACzB,EAAC,AACH;CACF,EAAC;AACF,KAAI,eAAe,cACjB,QAAO,sBAAY,QAAQ,EACzB,OAAO,EACL,eAAe,EACb,UAAU,CAAC,eAAgB,EAC5B,EACF,EACF,EAAC;AAGJ,QAAO;AACR;AAED,MAAaC,qBAA4D,OAAO,QAAQ,CAAE,GAAE,YAAY;CACtG,MAAM,cAAc,OAAO,KAAK,MAAM,QAAQ,QAAQ,MAAM,QAAQ,CAAE,GAAE,QAAQ,CAAC,CAAC,SAAS;CAC3F,MAAMC,SAAmB,CAAE;AAE3B,QAAO,OACJ,OAAO,MAAM,CACb,OAAO,CAAC,UAAU,eAAKJ,aAAW,4BAA4B,AAAC,EAAC,CAChE,OAAO,cAAc,CAAC,eAAKA,aAAW,wBAAwB,AAAC,IAAG,CAAE,EAAC;AACzE"}
|
package/dist/preset.d.cts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { StorybookConfig } from "./types-BZP9npQ9.cjs";
|
|
2
|
-
|
|
3
|
-
//#region src/preset.d.ts
|
|
4
|
-
declare const core: StorybookConfig['core'];
|
|
5
|
-
declare const viteFinal: StorybookConfig['viteFinal'];
|
|
6
|
-
declare const previewAnnotations: StorybookConfig['previewAnnotations'];
|
|
7
|
-
//# sourceMappingURL=preset.d.ts.map
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { core, previewAnnotations, viteFinal };
|
|
11
|
-
//# sourceMappingURL=preset.d.cts.map
|
package/dist/preset.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.cts","names":[],"sources":["../src/preset.ts"],"sourcesContent":[],"mappings":";;;cAkBa,MAAM;cAKN,WAAW;AALX,cA6BA,kBA7BqB,EA6BD,eA7BC,CAAA,oBAAA,CAAA;AAKlC"}
|
package/dist/preset.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","names":[],"sources":["../src/preset.ts"],"sourcesContent":[],"mappings":";;;cAkBa,MAAM;cAKN,WAAW;AALX,cA6BA,kBA7BqB,EA6BD,eA7BC,CAAA,oBAAA,CAAA;AAKlC"}
|
package/dist/preset.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "module";
|
|
2
|
-
import { dirname, join } from "path";
|
|
3
|
-
import stencil from "unplugin-stencil/vite";
|
|
4
|
-
import { fileURLToPath } from "url";
|
|
5
|
-
import { mergeConfig } from "vite";
|
|
6
|
-
|
|
7
|
-
//#region src/preset.ts
|
|
8
|
-
const require = createRequire(import.meta.url);
|
|
9
|
-
const getAbsolutePath = (input) => dirname(require.resolve(join(input, "package.json")));
|
|
10
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
-
const renderer = join(__dirname, "entry-preview.js");
|
|
12
|
-
const core = {
|
|
13
|
-
builder: getAbsolutePath("@storybook/builder-vite"),
|
|
14
|
-
renderer
|
|
15
|
-
};
|
|
16
|
-
const viteFinal = async (defaultConfig, { configType }) => {
|
|
17
|
-
const config = mergeConfig(defaultConfig, {
|
|
18
|
-
build: { target: "es2020" },
|
|
19
|
-
plugins: [stencil({ rootPath: defaultConfig.root })]
|
|
20
|
-
});
|
|
21
|
-
if (configType === "DEVELOPMENT") return mergeConfig(config, { build: { rollupOptions: { external: ["@stencil/core"] } } });
|
|
22
|
-
return config;
|
|
23
|
-
};
|
|
24
|
-
const previewAnnotations = async (input = [], options) => {
|
|
25
|
-
const docsEnabled = Object.keys(await options.presets.apply("docs", {}, options)).length > 0;
|
|
26
|
-
const result = [];
|
|
27
|
-
return result.concat(input).concat([renderer, join(__dirname, "entry-preview-argtypes.js")]).concat(docsEnabled ? [join(__dirname, "entry-preview-docs.js")] : []);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
export { core, previewAnnotations, viteFinal };
|
|
32
|
-
//# sourceMappingURL=preset.js.map
|
package/dist/preset.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preset.js","names":["input: I","core: StorybookConfig['core']","viteFinal: StorybookConfig['viteFinal']","previewAnnotations: StorybookConfig['previewAnnotations']","result: string[]"],"sources":["../src/preset.ts"],"sourcesContent":["/**\n * we can't prefix the Node.js imports with `node:` because it will break\n * within Storybook due to its Vite setup.\n */\nimport { createRequire } from 'module';\nimport { dirname, join } from 'path';\nimport stencil from 'unplugin-stencil/vite';\nimport { fileURLToPath } from 'url';\nimport { mergeConfig } from 'vite';\nimport { StorybookConfig } from './types';\n\nconst require = createRequire(import.meta.url);\nconst getAbsolutePath = <I extends string>(input: I): I => dirname(require.resolve(join(input, 'package.json'))) as any;\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst renderer = join(__dirname, 'entry-preview.js');\n\nexport const core: StorybookConfig['core'] = {\n builder: getAbsolutePath('@storybook/builder-vite'),\n renderer,\n};\n\nexport const viteFinal: StorybookConfig['viteFinal'] = async (defaultConfig, { configType }) => {\n const config = mergeConfig(defaultConfig, {\n build: {\n target: 'es2020',\n },\n plugins: [\n stencil({\n rootPath: defaultConfig.root,\n }),\n ],\n });\n if (configType === 'DEVELOPMENT') {\n return mergeConfig(config, {\n build: {\n rollupOptions: {\n external: ['@stencil/core'],\n },\n },\n });\n }\n\n return config;\n};\n\nexport const previewAnnotations: StorybookConfig['previewAnnotations'] = async (input = [], options) => {\n const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;\n const result: string[] = [];\n\n return result\n .concat(input)\n .concat([renderer, join(__dirname, 'entry-preview-argtypes.js')])\n .concat(docsEnabled ? [join(__dirname, 'entry-preview-docs.js')] : []);\n};\n"],"mappings":";;;;;;;AAWA,MAAM,UAAU,cAAc,OAAO,KAAK,IAAI;AAC9C,MAAM,kBAAkB,CAAmBA,UAAgB,QAAQ,QAAQ,QAAQ,KAAK,OAAO,eAAe,CAAC,CAAC;AAEhH,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAEzD,MAAM,WAAW,KAAK,WAAW,mBAAmB;AAEpD,MAAaC,OAAgC;CAC3C,SAAS,gBAAgB,0BAA0B;CACnD;AACD;AAED,MAAaC,YAA0C,OAAO,eAAe,EAAE,YAAY,KAAK;CAC9F,MAAM,SAAS,YAAY,eAAe;EACxC,OAAO,EACL,QAAQ,SACT;EACD,SAAS,CACP,QAAQ,EACN,UAAU,cAAc,KACzB,EAAC,AACH;CACF,EAAC;AACF,KAAI,eAAe,cACjB,QAAO,YAAY,QAAQ,EACzB,OAAO,EACL,eAAe,EACb,UAAU,CAAC,eAAgB,EAC5B,EACF,EACF,EAAC;AAGJ,QAAO;AACR;AAED,MAAaC,qBAA4D,OAAO,QAAQ,CAAE,GAAE,YAAY;CACtG,MAAM,cAAc,OAAO,KAAK,MAAM,QAAQ,QAAQ,MAAM,QAAQ,CAAE,GAAE,QAAQ,CAAC,CAAC,SAAS;CAC3F,MAAMC,SAAmB,CAAE;AAE3B,QAAO,OACJ,OAAO,MAAM,CACb,OAAO,CAAC,UAAU,KAAK,WAAW,4BAA4B,AAAC,EAAC,CAChE,OAAO,cAAc,CAAC,KAAK,WAAW,wBAAwB,AAAC,IAAG,CAAE,EAAC;AACzE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rollup-parseAst-t-4tfMPG.d.ts","names":["Promise","sideEffect"],"sources":["../@types/rollup-parseAst.d.ts"],"sourcesContent":["/**\n * Extra type definitions for rollup/parseAst in cases the Rollup version between\n * `@stencil/storybook-plugin` and `unplugin-stencil` is different. This may cause\n * the following type error:\n *\n * ```\n * [ ERROR ] TypeScript: node_modules/vite/dist/node/index.d.ts:5:41\n * Cannot find module 'rollup/parseAst' or its corresponding type\n * declarations.\n *\n * L4: export { rollup as Rollup };\n * L5: export { parseAst, parseAstAsync } from 'rollup/parseAst';\n * L6: import * as http from 'node:http';\n * ```\n *\n * This file is a workaround to make sure the type definitions are available when\n * importing `rollup/parseAst` in `unplugin-stencil`.\n */\ndeclare module 'rollup/parseAst' {\n export function parseAst(code: string, options?: any): any;\n export function parseAstAsync(code: string, options?: any): Promise<any>;\n}\n"],"mappings":";;;;;;AAoBqE;;;;;;;;;;;;;;;8DAAPA"}
|