@storybook/web-components 11.0.0-beta.1 → 11.0.0-beta.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-MWWF5KJS.js +326 -0
- package/dist/_browser-chunks/{chunk-4CVRUPXU.js → chunk-TBDFGSWB.js} +1 -1
- package/dist/_node-chunks/{chunk-RWJBQ2TK.js → chunk-5SMBZEFE.js} +10 -22
- package/dist/_node-chunks/{chunk-KEYAB73A.js → chunk-M3JM7VKZ.js} +31 -7
- package/dist/docgen/docgen-worker.js +8 -8
- package/dist/docgen/index.js +8 -8
- package/dist/entry-preview-argtypes.js +2 -2
- package/dist/entry-preview-docs.js +1 -1
- package/dist/index.js +2 -2
- package/dist/preset.js +455 -739
- package/package.json +2 -2
- package/dist/_browser-chunks/chunk-EGBR6PF2.js +0 -48
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-4BE7D4DS.js";
|
|
4
|
+
|
|
5
|
+
// src/entry-preview-docs.ts
|
|
6
|
+
var entry_preview_docs_exports = {};
|
|
7
|
+
__export(entry_preview_docs_exports, {
|
|
8
|
+
decorators: () => decorators,
|
|
9
|
+
parameters: () => parameters
|
|
10
|
+
});
|
|
11
|
+
import { SourceType as SourceType2 } from "storybook/internal/docs-tools";
|
|
12
|
+
|
|
13
|
+
// src/docs/print-hole.ts
|
|
14
|
+
import { isDirectiveResult, isTemplateResult } from "lit/directive-helpers.js";
|
|
15
|
+
import {
|
|
16
|
+
UnprintableArgError,
|
|
17
|
+
printValue,
|
|
18
|
+
unknownHoleKind
|
|
19
|
+
} from "storybook/internal/docs-tools";
|
|
20
|
+
|
|
21
|
+
// src/html-parse.ts
|
|
22
|
+
var RAW_TEXT_ELEMENTS = /* @__PURE__ */ new Set(["pre", "script", "style", "textarea", "title"]), VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
23
|
+
"area",
|
|
24
|
+
"base",
|
|
25
|
+
"br",
|
|
26
|
+
"col",
|
|
27
|
+
"embed",
|
|
28
|
+
"hr",
|
|
29
|
+
"img",
|
|
30
|
+
"input",
|
|
31
|
+
"link",
|
|
32
|
+
"meta",
|
|
33
|
+
"source",
|
|
34
|
+
"track",
|
|
35
|
+
"wbr"
|
|
36
|
+
]);
|
|
37
|
+
function parseHtml(source) {
|
|
38
|
+
let root = { children: [] }, stack = [root], offset = 0;
|
|
39
|
+
for (; offset < source.length; ) {
|
|
40
|
+
let read = readToken(source, offset);
|
|
41
|
+
if (!read) {
|
|
42
|
+
current(stack).children.push({ kind: "malformed", text: source.slice(offset) });
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
offset = read.end;
|
|
46
|
+
let token = read.token;
|
|
47
|
+
switch (token.kind) {
|
|
48
|
+
case "comment":
|
|
49
|
+
case "text":
|
|
50
|
+
current(stack).children.push(token);
|
|
51
|
+
break;
|
|
52
|
+
case "start": {
|
|
53
|
+
let node = {
|
|
54
|
+
attributes: token.attributes,
|
|
55
|
+
children: [],
|
|
56
|
+
closed: token.selfClosing || VOID_ELEMENTS.has(token.name.toLowerCase()),
|
|
57
|
+
kind: "element",
|
|
58
|
+
name: token.name,
|
|
59
|
+
selfClosing: token.selfClosing
|
|
60
|
+
};
|
|
61
|
+
current(stack).children.push(node), node.closed || stack.push(node);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case "raw":
|
|
65
|
+
current(stack).children.push({
|
|
66
|
+
attributes: token.attributes,
|
|
67
|
+
closed: !0,
|
|
68
|
+
kind: "rawText",
|
|
69
|
+
name: token.name,
|
|
70
|
+
text: token.text
|
|
71
|
+
});
|
|
72
|
+
break;
|
|
73
|
+
case "end": {
|
|
74
|
+
let top = stack.at(-1);
|
|
75
|
+
if (VOID_ELEMENTS.has(token.name))
|
|
76
|
+
break;
|
|
77
|
+
if (!("kind" in top) || top.kind !== "element" || top.name.toLowerCase() !== token.name)
|
|
78
|
+
return current(stack).children.push({ kind: "malformed", text: source.slice(read.start) }), root.children;
|
|
79
|
+
top.closed = !0, stack.pop();
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
default:
|
|
83
|
+
return token;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return root.children;
|
|
87
|
+
}
|
|
88
|
+
var current = (stack) => stack[stack.length - 1], readToken = (source, start) => {
|
|
89
|
+
if (source[start] !== "<") {
|
|
90
|
+
let next = source.indexOf("<", start), end2 = next === -1 ? source.length : next;
|
|
91
|
+
return { end: end2, start, token: { kind: "text", text: source.slice(start, end2) } };
|
|
92
|
+
}
|
|
93
|
+
if (source.startsWith("<!--", start)) {
|
|
94
|
+
let end2 = source.indexOf("-->", start + 4);
|
|
95
|
+
return end2 === -1 ? void 0 : { end: end2 + 3, start, token: { kind: "comment", text: source.slice(start, end2 + 3) } };
|
|
96
|
+
}
|
|
97
|
+
let end = findTagEnd(source, start);
|
|
98
|
+
if (end === void 0)
|
|
99
|
+
return;
|
|
100
|
+
let raw = source.slice(start, end), endMatch = /^<\/\s*([^\s>]+)\s*>$/.exec(raw);
|
|
101
|
+
if (endMatch)
|
|
102
|
+
return { end, start, token: { kind: "end", name: endMatch[1].toLowerCase() } };
|
|
103
|
+
let startMatch = /^<\s*([^\s/>]+)([\s\S]*?)>$/.exec(raw);
|
|
104
|
+
if (!startMatch)
|
|
105
|
+
return { end, start, token: { kind: "text", text: raw } };
|
|
106
|
+
let name = startMatch[1], rest = startMatch[2], selfClosing = hasSelfClosingSlash(rest), attrs = selfClosing ? rest.replace(/\/\s*$/, "") : rest, attributes = parseAttributes(attrs.trim());
|
|
107
|
+
if (!selfClosing && RAW_TEXT_ELEMENTS.has(name.toLowerCase())) {
|
|
108
|
+
let rawEnd = findRawTextEnd(source, end, name);
|
|
109
|
+
if (rawEnd)
|
|
110
|
+
return {
|
|
111
|
+
end: rawEnd.end,
|
|
112
|
+
start,
|
|
113
|
+
token: { attributes, kind: "raw", name, text: source.slice(end, rawEnd.start) }
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return { end, start, token: { attributes, kind: "start", name, selfClosing } };
|
|
117
|
+
}, parseAttributes = (source) => {
|
|
118
|
+
let attributes = [], index = 0;
|
|
119
|
+
for (; index < source.length; ) {
|
|
120
|
+
for (; /\s/.test(source[index] ?? ""); )
|
|
121
|
+
index += 1;
|
|
122
|
+
if (index >= source.length)
|
|
123
|
+
break;
|
|
124
|
+
let nameStart = index;
|
|
125
|
+
for (; index < source.length && !/[\s=]/.test(source[index]); )
|
|
126
|
+
index += 1;
|
|
127
|
+
let name = source.slice(nameStart, index);
|
|
128
|
+
for (; /\s/.test(source[index] ?? ""); )
|
|
129
|
+
index += 1;
|
|
130
|
+
if (source[index] !== "=") {
|
|
131
|
+
attributes.push({ name, value: void 0 });
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
for (index += 1; /\s/.test(source[index] ?? ""); )
|
|
135
|
+
index += 1;
|
|
136
|
+
let quote = source[index] === '"' || source[index] === "'" ? source[index] : void 0;
|
|
137
|
+
if (quote) {
|
|
138
|
+
index += 1;
|
|
139
|
+
let valueStart2 = index;
|
|
140
|
+
for (; index < source.length && source[index] !== quote; )
|
|
141
|
+
index += 1;
|
|
142
|
+
attributes.push({
|
|
143
|
+
name,
|
|
144
|
+
quoted: !0,
|
|
145
|
+
value: decodeAttribute(source.slice(valueStart2, index))
|
|
146
|
+
}), source[index] === quote && (index += 1);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
let valueStart = index;
|
|
150
|
+
for (; index < source.length && !/\s/.test(source[index]); )
|
|
151
|
+
index += 1;
|
|
152
|
+
attributes.push({ name, value: decodeAttribute(source.slice(valueStart, index)) });
|
|
153
|
+
}
|
|
154
|
+
return attributes;
|
|
155
|
+
}, decodeAttribute = (value) => value.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/&/g, "&"), hasSelfClosingSlash = (rest) => {
|
|
156
|
+
let index = rest.length - 1;
|
|
157
|
+
for (; index >= 0 && /\s/.test(rest[index]); )
|
|
158
|
+
index -= 1;
|
|
159
|
+
return rest[index] !== "/" ? !1 : index === 0 || /\s/.test(rest[index - 1]);
|
|
160
|
+
}, findTagEnd = (source, start) => {
|
|
161
|
+
let quote, canOpenQuote = !1;
|
|
162
|
+
for (let index = start + 1; index < source.length; index += 1) {
|
|
163
|
+
let char = source[index];
|
|
164
|
+
if (quote) {
|
|
165
|
+
char === quote && (quote = void 0);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if ((char === '"' || char === "'") && canOpenQuote) {
|
|
169
|
+
quote = char;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
if (/\s|=/.test(char) && (canOpenQuote = !0), char === ">")
|
|
173
|
+
return index + 1;
|
|
174
|
+
}
|
|
175
|
+
}, findRawTextEnd = (source, start, name) => {
|
|
176
|
+
let lower = source.toLowerCase(), close = `</${name.toLowerCase()}`, index = start;
|
|
177
|
+
for (; index < source.length; ) {
|
|
178
|
+
let found = lower.indexOf(close, index);
|
|
179
|
+
if (found === -1)
|
|
180
|
+
return;
|
|
181
|
+
let boundary = source[found + close.length];
|
|
182
|
+
if (boundary !== void 0 && /[\s>]/.test(boundary)) {
|
|
183
|
+
let end = findTagEnd(source, found);
|
|
184
|
+
return end === void 0 ? void 0 : { end, start: found };
|
|
185
|
+
}
|
|
186
|
+
index = found + close.length;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// src/snippet-values.ts
|
|
191
|
+
function escapeAttribute(value, quote = '"') {
|
|
192
|
+
let escaped = value.replace(/&/g, "&").replace(/</g, "<");
|
|
193
|
+
return quote === "'" ? escaped.replace(/'/g, "'") : escaped.replace(/"/g, """);
|
|
194
|
+
}
|
|
195
|
+
var quotedAttribute = (name, text) => `${name}="${escapeAttribute(text)}"`;
|
|
196
|
+
function attributeText(value, viaField) {
|
|
197
|
+
if (value === !0)
|
|
198
|
+
return !0;
|
|
199
|
+
if (value === "")
|
|
200
|
+
return viaField ? "" : void 0;
|
|
201
|
+
if (!(value === !1 || value === null || value === void 0))
|
|
202
|
+
return typeof value == "object" ? JSON.stringify(value) : String(value);
|
|
203
|
+
}
|
|
204
|
+
function printAttribute(name, value, viaField) {
|
|
205
|
+
let text = attributeText(value, viaField);
|
|
206
|
+
return text === void 0 ? void 0 : text === !0 ? name : quotedAttribute(name, text);
|
|
207
|
+
}
|
|
208
|
+
var cssDeclarations = (properties) => {
|
|
209
|
+
let declarations = properties.filter(({ value }) => value != null && value !== "").map(({ name, value }) => `${name}: ${String(value)};`);
|
|
210
|
+
return declarations.length === 0 ? void 0 : declarations.join(" ");
|
|
211
|
+
}, styleRule = (selector, declarations) => ` ${selector} { ${declarations} }`, styleElement = (rules) => `<style>
|
|
212
|
+
${rules.map(({ selector, declarations }) => styleRule(selector, declarations)).join(`
|
|
213
|
+
`)}
|
|
214
|
+
</style>`, slotText = (value) => value == null || value === "" ? "" : String(value);
|
|
215
|
+
function slotPlacement(name, html) {
|
|
216
|
+
if (name === "default" || html === "")
|
|
217
|
+
return "none";
|
|
218
|
+
let nodes = parseHtml(html), [only] = nodes;
|
|
219
|
+
return nodes.length === 1 && only?.kind === "element" && !only.selfClosing && !only.attributes.some((attribute) => attribute.name === "slot") ? "element" : "span";
|
|
220
|
+
}
|
|
221
|
+
function slottedHtml(name, html) {
|
|
222
|
+
switch (slotPlacement(name, html)) {
|
|
223
|
+
case "none":
|
|
224
|
+
return html;
|
|
225
|
+
case "element": {
|
|
226
|
+
let end = findTagEnd(html, 0) - 1;
|
|
227
|
+
return `${html.slice(0, end)} ${quotedAttribute("slot", name)}${html.slice(end)}`;
|
|
228
|
+
}
|
|
229
|
+
case "span":
|
|
230
|
+
return `<span ${quotedAttribute("slot", name)}>${html}</span>`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// src/docs/print-hole.ts
|
|
235
|
+
var printHole = (hole, changed) => {
|
|
236
|
+
let arg = hole.arg ?? "", value = printable(arg, changed);
|
|
237
|
+
switch (hole.kind) {
|
|
238
|
+
case "attr":
|
|
239
|
+
return printAttribute(hole.name ?? arg, value, hole.mode === "field") ?? "";
|
|
240
|
+
case "code":
|
|
241
|
+
return printValue(value, arg, { quote: "'", opaque: isLitValue });
|
|
242
|
+
case "css":
|
|
243
|
+
return escapeAttribute(cssDeclarations([{ name: hole.property ?? arg, value }]) ?? "");
|
|
244
|
+
case "cssattr": {
|
|
245
|
+
let args = changed, style = cssDeclarations(
|
|
246
|
+
hole.properties.filter((property) => Object.hasOwn(args, property.arg)).map((property) => ({
|
|
247
|
+
name: property.property,
|
|
248
|
+
value: printable(property.arg, args[property.arg])
|
|
249
|
+
}))
|
|
250
|
+
);
|
|
251
|
+
return style === void 0 ? "" : quotedAttribute("style", style);
|
|
252
|
+
}
|
|
253
|
+
case "slot":
|
|
254
|
+
return slottedHtml(hole.name, slotText(value));
|
|
255
|
+
case "rule":
|
|
256
|
+
return isSet(value) ? styleRule(hole.selector, String(value)) : "";
|
|
257
|
+
case "style":
|
|
258
|
+
return isSet(value) ? `${styleElement([{ selector: hole.selector, declarations: String(value) }])}
|
|
259
|
+
` : "";
|
|
260
|
+
case "props":
|
|
261
|
+
return propertyScript(hole.properties, changed);
|
|
262
|
+
case "guard":
|
|
263
|
+
throw new UnprintableArgError(arg);
|
|
264
|
+
default:
|
|
265
|
+
return unknownHoleKind(hole);
|
|
266
|
+
}
|
|
267
|
+
}, propertyScript = (properties, args) => {
|
|
268
|
+
let lines = properties.flatMap(({ arg, name, tag }) => {
|
|
269
|
+
let value = Object.hasOwn(args, arg) ? args[arg] : void 0;
|
|
270
|
+
if (value === void 0)
|
|
271
|
+
return [];
|
|
272
|
+
let code = printValue(value, arg, { quote: "'", opaque: isLitValue }).replace(
|
|
273
|
+
/<(\/|!--)/g,
|
|
274
|
+
"<\\$1"
|
|
275
|
+
), property = /^[A-Za-z_$][\w$]*$/.test(name) ? `.${name}` : `[${printValue(name, name, { quote: "'" })}]`;
|
|
276
|
+
return [` document.querySelector('${tag}')${property} = ${code};`];
|
|
277
|
+
});
|
|
278
|
+
return lines.length === 0 ? "" : `<script>
|
|
279
|
+
${lines.join(`
|
|
280
|
+
`)}
|
|
281
|
+
<\/script>`;
|
|
282
|
+
}, isSet = (value) => value != null && value !== "";
|
|
283
|
+
function printable(arg, value) {
|
|
284
|
+
if (typeof value == "function" || typeof value == "symbol" || isLitValue(value))
|
|
285
|
+
throw new UnprintableArgError(arg);
|
|
286
|
+
return value;
|
|
287
|
+
}
|
|
288
|
+
var isLitValue = (value) => isTemplateResult(value) || isDirectiveResult(value);
|
|
289
|
+
|
|
290
|
+
// src/docs/sourceDecorator.ts
|
|
291
|
+
import { SourceType } from "storybook/internal/docs-tools";
|
|
292
|
+
import { render } from "lit";
|
|
293
|
+
import { emitTransformCode, useEffect } from "storybook/preview-api";
|
|
294
|
+
var LIT_EXPRESSION_COMMENTS = /<!--\?lit\$[0-9]+\$-->|<!--\??-->/g;
|
|
295
|
+
function skipSourceRender(context) {
|
|
296
|
+
let sourceParams = context?.parameters.docs?.source, isArgsStory = context?.parameters.__isArgsStory;
|
|
297
|
+
return sourceParams?.type === SourceType.DYNAMIC ? !1 : !isArgsStory || sourceParams?.code || sourceParams?.type === SourceType.CODE;
|
|
298
|
+
}
|
|
299
|
+
function renderStorySource(storyResult) {
|
|
300
|
+
let container = window.document.createElement("div");
|
|
301
|
+
return storyResult instanceof DocumentFragment ? render(storyResult.cloneNode(!0), container) : render(storyResult, container), container.innerHTML.replace(LIT_EXPRESSION_COMMENTS, "");
|
|
302
|
+
}
|
|
303
|
+
function sourceDecorator(storyFn, context) {
|
|
304
|
+
let story = storyFn(), renderedForSource = context?.parameters.docs?.source?.excludeDecorators ? context.originalStoryFn(context.args, context) : story, source;
|
|
305
|
+
return useEffect(() => {
|
|
306
|
+
source && emitTransformCode(source, context);
|
|
307
|
+
}), skipSourceRender(context) || (source = renderStorySource(renderedForSource)), story;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// src/entry-preview-docs.ts
|
|
311
|
+
var useStaticServiceSnippets = "FEATURES" in globalThis && globalThis.FEATURES?.docgenServer, decorators = useStaticServiceSnippets ? [] : [sourceDecorator], parameters = {
|
|
312
|
+
docs: {
|
|
313
|
+
source: {
|
|
314
|
+
type: SourceType2.DYNAMIC,
|
|
315
|
+
language: "html",
|
|
316
|
+
...useStaticServiceSnippets ? { printHole } : {}
|
|
317
|
+
},
|
|
318
|
+
story: { inline: !0 }
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
export {
|
|
323
|
+
decorators,
|
|
324
|
+
parameters,
|
|
325
|
+
entry_preview_docs_exports
|
|
326
|
+
};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lr05dakzrtf from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lr05dakzrtf from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lr05dakzrtf from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lr05dakzrtf.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lr05dakzrtf.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lr05dakzrtf.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
|
+
DEFAULT_SLOT_NAME,
|
|
13
14
|
parseStoryFile,
|
|
14
|
-
resolveStoryComponent
|
|
15
|
-
|
|
15
|
+
resolveStoryComponent,
|
|
16
|
+
toArgKey
|
|
17
|
+
} from "./chunk-M3JM7VKZ.js";
|
|
16
18
|
|
|
17
19
|
// src/docgen/docgen-worker.ts
|
|
18
20
|
import { createLazyDocgenMiddleware, loadTypeScriptCompilerApi } from "storybook/internal/common";
|
|
@@ -106,20 +108,6 @@ var relative = function(from, to) {
|
|
|
106
108
|
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
107
109
|
};
|
|
108
110
|
|
|
109
|
-
// src/arg-keys.ts
|
|
110
|
-
var DEFAULT_SLOT_NAME = "default";
|
|
111
|
-
function toArgKey(category, name) {
|
|
112
|
-
return category === "cssProperties" ? name : `${name}${ARG_KEY_SUFFIXES[category]}`;
|
|
113
|
-
}
|
|
114
|
-
var ARG_KEY_SUFFIXES = {
|
|
115
|
-
attributes: "-attr",
|
|
116
|
-
events: "-event",
|
|
117
|
-
methods: "-method",
|
|
118
|
-
slots: "-slot",
|
|
119
|
-
cssParts: "-part",
|
|
120
|
-
cssStates: "-state"
|
|
121
|
-
};
|
|
122
|
-
|
|
123
111
|
// src/docgen/component-docgen/utils.ts
|
|
124
112
|
function isRecord(value) {
|
|
125
113
|
return value !== null && typeof value == "object";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lr05dakzrtf from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lr05dakzrtf from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lr05dakzrtf from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lr05dakzrtf.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lr05dakzrtf.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lr05dakzrtf.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -70,7 +70,31 @@ function localObject(argument, ctx) {
|
|
|
70
70
|
return init?.type === "ObjectExpression" && members ? { object: init, members } : void 0;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// src/arg-keys.ts
|
|
74
|
+
var DEFAULT_SLOT_NAME = "default";
|
|
75
|
+
function toArgKey(category, name) {
|
|
76
|
+
return category === "cssProperties" ? name : `${name}${ARG_KEY_SUFFIXES[category]}`;
|
|
77
|
+
}
|
|
78
|
+
function parseArgKey(key) {
|
|
79
|
+
if (key.startsWith("--"))
|
|
80
|
+
return { category: "cssProperties", name: key };
|
|
81
|
+
for (let [category, suffix] of Object.entries(ARG_KEY_SUFFIXES))
|
|
82
|
+
if (key.endsWith(suffix))
|
|
83
|
+
return { category, name: key.slice(0, -suffix.length) };
|
|
84
|
+
}
|
|
85
|
+
var ARG_KEY_SUFFIXES = {
|
|
86
|
+
attributes: "-attr",
|
|
87
|
+
events: "-event",
|
|
88
|
+
methods: "-method",
|
|
89
|
+
slots: "-slot",
|
|
90
|
+
cssParts: "-part",
|
|
91
|
+
cssStates: "-state"
|
|
92
|
+
};
|
|
93
|
+
|
|
73
94
|
export {
|
|
74
95
|
parseStoryFile,
|
|
75
|
-
resolveStoryComponent
|
|
96
|
+
resolveStoryComponent,
|
|
97
|
+
DEFAULT_SLOT_NAME,
|
|
98
|
+
toArgKey,
|
|
99
|
+
parseArgKey
|
|
76
100
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lr05dakzrtf from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lr05dakzrtf from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lr05dakzrtf from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lr05dakzrtf.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lr05dakzrtf.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lr05dakzrtf.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
createDocgenProvider
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
15
|
-
import "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-5SMBZEFE.js";
|
|
15
|
+
import "../_node-chunks/chunk-M3JM7VKZ.js";
|
|
16
16
|
export {
|
|
17
17
|
createDocgenProvider
|
|
18
18
|
};
|
package/dist/docgen/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_lr05dakzrtf from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_lr05dakzrtf from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_lr05dakzrtf from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_lr05dakzrtf.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_lr05dakzrtf.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_lr05dakzrtf.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,8 +12,8 @@ var require = CJS_COMPAT_NODE_MODULE_2mh2kj69z4k.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
buildDocgenPayload,
|
|
14
14
|
createDocgenProvider
|
|
15
|
-
} from "../_node-chunks/chunk-
|
|
16
|
-
import "../_node-chunks/chunk-
|
|
15
|
+
} from "../_node-chunks/chunk-5SMBZEFE.js";
|
|
16
|
+
import "../_node-chunks/chunk-M3JM7VKZ.js";
|
|
17
17
|
export {
|
|
18
18
|
buildDocgenPayload,
|
|
19
19
|
createDocgenProvider
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
getCustomElements,
|
|
3
3
|
isValidComponent,
|
|
4
4
|
isValidMetaData
|
|
5
|
-
} from "./_browser-chunks/chunk-
|
|
5
|
+
} from "./_browser-chunks/chunk-TBDFGSWB.js";
|
|
6
6
|
import "./_browser-chunks/chunk-XOX44XZE.js";
|
|
7
|
-
import "./_browser-chunks/chunk-
|
|
7
|
+
import "./_browser-chunks/chunk-MWWF5KJS.js";
|
|
8
8
|
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
|
9
9
|
|
|
10
10
|
// src/entry-preview-argtypes.ts
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
setCustomElements,
|
|
7
7
|
setCustomElementsManifest,
|
|
8
8
|
setProjectAnnotations
|
|
9
|
-
} from "./_browser-chunks/chunk-
|
|
9
|
+
} from "./_browser-chunks/chunk-TBDFGSWB.js";
|
|
10
10
|
import "./_browser-chunks/chunk-XOX44XZE.js";
|
|
11
|
-
import "./_browser-chunks/chunk-
|
|
11
|
+
import "./_browser-chunks/chunk-MWWF5KJS.js";
|
|
12
12
|
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
|
13
13
|
export {
|
|
14
14
|
__definePreview,
|