@storybook/web-components 11.0.0-rc.2 → 11.0.0-rc.4
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/preset.js +20 -18
- package/package.json +2 -2
package/dist/preset.js
CHANGED
|
@@ -424,9 +424,13 @@ function slottedHtml(name, html) {
|
|
|
424
424
|
var attrHole = (arg, name, mode) => ({ kind: "attr", arg, ...name !== arg && { name }, mode });
|
|
425
425
|
|
|
426
426
|
// src/docgen/story-docs/html-tree.ts
|
|
427
|
-
|
|
427
|
+
import {
|
|
428
|
+
SNIPPET_INDENT as INDENT,
|
|
429
|
+
SNIPPET_PRINT_WIDTH,
|
|
430
|
+
printOpeningTag
|
|
431
|
+
} from "storybook/internal/docs-tools";
|
|
428
432
|
function printHtml(nodes, marks) {
|
|
429
|
-
let tags = /* @__PURE__ */ new Map(), expanded = expandHoles(nodes, tags), marked = marks && { mark: marks.mark, tags }, html = expanded.filter(isPrintable).map((node) => printNode(node, 0, marked)).join(`
|
|
433
|
+
let tags = /* @__PURE__ */ new Map(), expanded = expandHoles(nodes, tags), marked = marks && { mark: marks.mark, measure: marks.unmark, tags }, html = expanded.filter(isPrintable).map((node) => printNode(node, 0, marked)).join(`
|
|
430
434
|
`);
|
|
431
435
|
return html + placeholderHoles(expanded, html ? `
|
|
432
436
|
` : "", marked);
|
|
@@ -484,7 +488,7 @@ var expandHoles = (nodes, tags) => nodes.flatMap((node) => {
|
|
|
484
488
|
return node.closed ? `${startTag}${content}</${node.name}>` : `${startTag}${content}`;
|
|
485
489
|
}
|
|
486
490
|
let inline = inlineElementText(node, !0, void 0)?.text;
|
|
487
|
-
if (inline && indent.length + inline.length <=
|
|
491
|
+
if (inline && indent.length + inline.length <= SNIPPET_PRINT_WIDTH)
|
|
488
492
|
return `${indent}${marks ? inlineElementText(node, !0, marks).text : inline}`;
|
|
489
493
|
let body = printChildLines(node.children, depth + 1, marks).join(`
|
|
490
494
|
`) + placeholderHoles(node.children, `
|
|
@@ -498,7 +502,7 @@ ${body}`;
|
|
|
498
502
|
if (group.length === 0)
|
|
499
503
|
return;
|
|
500
504
|
let inline = inlineChildrenText(group, void 0), indent = INDENT.repeat(depth);
|
|
501
|
-
inline && inline.hasText && indent.length + inline.text.length <=
|
|
505
|
+
inline && inline.hasText && indent.length + inline.text.length <= SNIPPET_PRINT_WIDTH ? lines.push(`${indent}${marks ? inlineChildrenText(group, marks).text : inline.text}`) : group.forEach((child) => lines.push(printNode(child, depth, marks))), group = [];
|
|
502
506
|
};
|
|
503
507
|
for (let child of children)
|
|
504
508
|
if (!isPlaceholder(child)) {
|
|
@@ -560,20 +564,18 @@ ${body}`;
|
|
|
560
564
|
let startTag = printStartTag({ attributes: node.attributes, name: node.name }, depth, marks);
|
|
561
565
|
return node.closed ? `${startTag}${node.text}</${node.name}>` : `${startTag}${node.text}`;
|
|
562
566
|
}, printStartTag = (node, depth, marks) => {
|
|
563
|
-
let indent = INDENT.repeat(depth),
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
].join(`
|
|
576
|
-
`);
|
|
567
|
+
let indent = INDENT.repeat(depth), { text } = printOpeningTag(
|
|
568
|
+
{
|
|
569
|
+
open: `<${node.name}`,
|
|
570
|
+
attributes: [
|
|
571
|
+
...shown(node.attributes).map((attribute) => printHtmlAttribute(attribute, marks)),
|
|
572
|
+
(separator) => omittedHoles(node.attributes, separator, marks)
|
|
573
|
+
],
|
|
574
|
+
close: ">"
|
|
575
|
+
},
|
|
576
|
+
{ indent, measure: marks?.measure }
|
|
577
|
+
);
|
|
578
|
+
return `${indent}${text}`;
|
|
577
579
|
}, printCompactStartTag = (node, marks) => {
|
|
578
580
|
let attrs = shown(node.attributes).map((attribute) => printHtmlAttribute(attribute, marks)).join(" "), omitted = omittedHoles(node.attributes, " ", marks);
|
|
579
581
|
return `<${node.name}${attrs ? ` ${attrs}` : ""}${omitted}>`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/web-components",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.4",
|
|
4
4
|
"description": "Storybook Web Components renderer: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"lit": "^2.0.0 || ^3.0.0",
|
|
77
|
-
"storybook": "^11.0.0-rc.
|
|
77
|
+
"storybook": "^11.0.0-rc.4",
|
|
78
78
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|