@wireweave/core 3.0.1-beta.0 → 3.1.0-beta.1
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 +80 -417
- package/dist/index.cjs +1010 -28
- package/dist/index.d.cts +370 -4
- package/dist/index.d.ts +370 -4
- package/dist/index.js +997 -28
- package/dist/parser.d.cts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/renderer.cjs +139 -20
- package/dist/renderer.d.cts +33 -3
- package/dist/renderer.d.ts +33 -3
- package/dist/renderer.js +138 -20
- package/dist/{types-hEr_afgw.d.cts → types-BDbXDhTp.d.cts} +14 -1
- package/dist/{types-hEr_afgw.d.ts → types-BDbXDhTp.d.ts} +14 -1
- package/package.json +21 -21
package/dist/renderer.js
CHANGED
|
@@ -115,8 +115,14 @@ function generateContainerStyles(prefix) {
|
|
|
115
115
|
font-weight: 600;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
/* Board-scoped: absolute (not fixed) so the drawer pins to its own page /
|
|
119
|
+
canvas board \u2014 the nearest positioned ancestor (.wf-page is position:relative,
|
|
120
|
+
.wf-canvas-board is position:absolute) \u2014 instead of the browser viewport.
|
|
121
|
+
Matches the modal backdrop's scoping and keeps the fixed-layout invariant:
|
|
122
|
+
with position:fixed a drawer in a multi-page canvas escapes to the viewport
|
|
123
|
+
top-left, overlapping other boards (see no-responsive.md). */
|
|
118
124
|
.${prefix}-drawer {
|
|
119
|
-
position:
|
|
125
|
+
position: absolute;
|
|
120
126
|
background: var(--${prefix}-bg);
|
|
121
127
|
border: 1px solid var(--${prefix}-border);
|
|
122
128
|
box-shadow: var(--${prefix}-shadow-xl);
|
|
@@ -1945,7 +1951,8 @@ var DEFAULT_OPTIONS = {
|
|
|
1945
1951
|
scale: 1,
|
|
1946
1952
|
includeStyles: true,
|
|
1947
1953
|
minify: false,
|
|
1948
|
-
classPrefix: "wf"
|
|
1954
|
+
classPrefix: "wf",
|
|
1955
|
+
sourceAnchors: false
|
|
1949
1956
|
};
|
|
1950
1957
|
var BaseRenderer = class {
|
|
1951
1958
|
context;
|
|
@@ -2116,6 +2123,52 @@ function resolveViewport(viewport, device) {
|
|
|
2116
2123
|
return DEFAULT_VIEWPORT;
|
|
2117
2124
|
}
|
|
2118
2125
|
|
|
2126
|
+
// src/ast/anchor-path.ts
|
|
2127
|
+
var ANCHOR_PATH_ATTR = "data-wf-path";
|
|
2128
|
+
var ANCHOR_LOC_ATTR = "data-wf-loc";
|
|
2129
|
+
var ANCHOR_CONTAINER_TYPES = /* @__PURE__ */ new Set([
|
|
2130
|
+
"Page",
|
|
2131
|
+
"Header",
|
|
2132
|
+
"Main",
|
|
2133
|
+
"Footer",
|
|
2134
|
+
"Sidebar",
|
|
2135
|
+
"Section",
|
|
2136
|
+
"Row",
|
|
2137
|
+
"Col",
|
|
2138
|
+
"Stack",
|
|
2139
|
+
"Relative",
|
|
2140
|
+
"Card",
|
|
2141
|
+
"Modal",
|
|
2142
|
+
"Drawer",
|
|
2143
|
+
"Accordion",
|
|
2144
|
+
"Tooltip",
|
|
2145
|
+
"Popover"
|
|
2146
|
+
]);
|
|
2147
|
+
function anchorChildNodes(node) {
|
|
2148
|
+
if (!ANCHOR_CONTAINER_TYPES.has(node.type)) return [];
|
|
2149
|
+
const children = node.children;
|
|
2150
|
+
return Array.isArray(children) ? children : [];
|
|
2151
|
+
}
|
|
2152
|
+
function formatAnchorLoc(loc) {
|
|
2153
|
+
return `${loc.start.offset}-${loc.end.offset}`;
|
|
2154
|
+
}
|
|
2155
|
+
function walkAnchorPaths(doc, visit, pageIndexBase = 0) {
|
|
2156
|
+
doc.children.forEach((page, i) => {
|
|
2157
|
+
visitAnchorNode(page, String(pageIndexBase + i), visit);
|
|
2158
|
+
});
|
|
2159
|
+
}
|
|
2160
|
+
function visitAnchorNode(node, path, visit) {
|
|
2161
|
+
visit(node, path);
|
|
2162
|
+
anchorChildNodes(node).forEach((child, i) => {
|
|
2163
|
+
visitAnchorNode(child, `${path}.${i}`, visit);
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
function buildAnchorPathMap(doc, pageIndexBase = 0) {
|
|
2167
|
+
const map = /* @__PURE__ */ new Map();
|
|
2168
|
+
walkAnchorPaths(doc, (node, path) => map.set(node, path), pageIndexBase);
|
|
2169
|
+
return map;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2119
2172
|
// src/renderer/html/components.ts
|
|
2120
2173
|
function buildClassString(classes) {
|
|
2121
2174
|
return classes.filter(Boolean).join(" ");
|
|
@@ -48822,8 +48875,13 @@ var iconAliases = {
|
|
|
48822
48875
|
close: "x",
|
|
48823
48876
|
menu: "menu",
|
|
48824
48877
|
hamburger: "menu",
|
|
48825
|
-
|
|
48826
|
-
|
|
48878
|
+
// Lucide renamed the overflow/kebab-menu glyphs to `ellipsis` /
|
|
48879
|
+
// `ellipsis-vertical`; map the legacy `more-*` names (and the `dots-*`
|
|
48880
|
+
// shorthands) onto the real keys so none of them dead-end.
|
|
48881
|
+
"more-horizontal": "ellipsis",
|
|
48882
|
+
"more-vertical": "ellipsis-vertical",
|
|
48883
|
+
dots: "ellipsis",
|
|
48884
|
+
"dots-vertical": "ellipsis-vertical",
|
|
48827
48885
|
cog: "settings",
|
|
48828
48886
|
gear: "settings"
|
|
48829
48887
|
};
|
|
@@ -48850,6 +48908,12 @@ function renderIconSvg(data, _size = 24, strokeWidth = 2, className = "", styleA
|
|
|
48850
48908
|
}).join("");
|
|
48851
48909
|
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${strokeWidth}" stroke-linecap="round" stroke-linejoin="round" class="${className}"${styleAttr}>${elements}</svg>`;
|
|
48852
48910
|
}
|
|
48911
|
+
function renderUnknownIconSvg(className = "", size = 24, styleAttr = "") {
|
|
48912
|
+
return `<svg class="${className}" width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"${styleAttr}>
|
|
48913
|
+
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" stroke-dasharray="4 2" fill="none" opacity="0.5"/>
|
|
48914
|
+
<text x="12" y="16" text-anchor="middle" font-size="10" fill="currentColor" opacity="0.7">?</text>
|
|
48915
|
+
</svg>`;
|
|
48916
|
+
}
|
|
48853
48917
|
|
|
48854
48918
|
// src/renderer/html/renderers/button.ts
|
|
48855
48919
|
function renderButton(node, ctx) {
|
|
@@ -48872,9 +48936,12 @@ function renderButton(node, ctx) {
|
|
|
48872
48936
|
const sizeStyle = sizeResolved.style || "";
|
|
48873
48937
|
const combinedStyles = baseStyles && sizeStyle ? `${baseStyles}; ${sizeStyle}` : baseStyles || sizeStyle;
|
|
48874
48938
|
const styleAttr = combinedStyles ? ` style="${combinedStyles}"` : "";
|
|
48939
|
+
const accessibleName = node.aria ?? node["aria-label"];
|
|
48875
48940
|
const attrs = {
|
|
48876
48941
|
class: classes,
|
|
48877
48942
|
disabled: node.disabled,
|
|
48943
|
+
"aria-label": accessibleName,
|
|
48944
|
+
title: node.title,
|
|
48878
48945
|
// Interactive attributes
|
|
48879
48946
|
"data-navigate": node.navigate,
|
|
48880
48947
|
"data-opens": node.opens,
|
|
@@ -48887,7 +48954,7 @@ function renderButton(node, ctx) {
|
|
|
48887
48954
|
if (iconData) {
|
|
48888
48955
|
icon = renderIconSvg(iconData, 16, 2, `${ctx.prefix}-icon`);
|
|
48889
48956
|
} else {
|
|
48890
|
-
icon = `<span class="${ctx.prefix}-icon"
|
|
48957
|
+
icon = `<span class="${ctx.prefix}-icon" title="Unknown icon: ${ctx.escapeHtml(node.icon)}">${renderUnknownIconSvg(`${ctx.prefix}-icon`, 16)}</span>`;
|
|
48891
48958
|
}
|
|
48892
48959
|
}
|
|
48893
48960
|
const loading = node.loading ? `<span class="${ctx.prefix}-spinner ${ctx.prefix}-spinner-sm"></span>` : "";
|
|
@@ -48971,7 +49038,7 @@ function renderInput(node, ctx) {
|
|
|
48971
49038
|
if (iconData) {
|
|
48972
49039
|
iconHtml = renderIconSvg(iconData, 16, 2, `${ctx.prefix}-input-icon`);
|
|
48973
49040
|
} else {
|
|
48974
|
-
iconHtml = `<span class="${ctx.prefix}-input-icon"
|
|
49041
|
+
iconHtml = `<span class="${ctx.prefix}-input-icon" title="Unknown icon: ${ctx.escapeHtml(node.icon)}">${renderUnknownIconSvg(`${ctx.prefix}-input-icon`, 16)}</span>`;
|
|
48975
49042
|
}
|
|
48976
49043
|
const wrapperClasses = ctx.buildClassString([`${ctx.prefix}-input-wrapper`]);
|
|
48977
49044
|
const wrapper = `<div class="${wrapperClasses}"${styleAttr}>${iconHtml}${inputElement}</div>`;
|
|
@@ -49236,10 +49303,10 @@ function renderIcon(node, ctx) {
|
|
|
49236
49303
|
}
|
|
49237
49304
|
const size = sizeResolved.style?.match(/(\d+)px/)?.[1] || "24";
|
|
49238
49305
|
const sizeNum = parseInt(size, 10);
|
|
49239
|
-
const placeholderSvg =
|
|
49240
|
-
|
|
49241
|
-
|
|
49242
|
-
|
|
49306
|
+
const placeholderSvg = renderUnknownIconSvg(
|
|
49307
|
+
`${ctx.prefix}-icon ${sizeResolved.className || ""}`,
|
|
49308
|
+
sizeNum
|
|
49309
|
+
);
|
|
49243
49310
|
const wrapperStyleAttr = baseStyles ? ` style="${baseStyles}"` : "";
|
|
49244
49311
|
return `<span class="${wrapperClasses}"${wrapperStyleAttr}${interactiveAttrStr} aria-hidden="true" title="Unknown icon: ${ctx.escapeHtml(node.name)}">${placeholderSvg}</span>`;
|
|
49245
49312
|
}
|
|
@@ -49644,6 +49711,10 @@ function renderAnnotationItem(node, ctx) {
|
|
|
49644
49711
|
}
|
|
49645
49712
|
|
|
49646
49713
|
// src/renderer/html/index.ts
|
|
49714
|
+
function injectAnchorAttrs(html, path, loc) {
|
|
49715
|
+
const attrs = loc ? ` ${ANCHOR_PATH_ATTR}="${path}" ${ANCHOR_LOC_ATTR}="${formatAnchorLoc(loc)}"` : ` ${ANCHOR_PATH_ATTR}="${path}"`;
|
|
49716
|
+
return html.replace(/<([a-zA-Z][a-zA-Z0-9-]*)/, (match) => `${match}${attrs}`);
|
|
49717
|
+
}
|
|
49647
49718
|
var SPACING_TOKENS = {
|
|
49648
49719
|
0: "0px",
|
|
49649
49720
|
1: "4px",
|
|
@@ -49686,10 +49757,36 @@ var HtmlRenderer = class extends BaseRenderer {
|
|
|
49686
49757
|
* Node type to renderer method mapping
|
|
49687
49758
|
*/
|
|
49688
49759
|
nodeRenderers;
|
|
49689
|
-
|
|
49760
|
+
/**
|
|
49761
|
+
* Node → anchor-path map for the document currently being rendered. Non-null
|
|
49762
|
+
* only while rendering with `sourceAnchors` enabled.
|
|
49763
|
+
*/
|
|
49764
|
+
pathMap = null;
|
|
49765
|
+
/**
|
|
49766
|
+
* Base index added to page anchor paths. Non-zero when a page is rendered in
|
|
49767
|
+
* isolation (canvas per-page composition) but must keep its true document
|
|
49768
|
+
* index in the anchor scheme.
|
|
49769
|
+
*/
|
|
49770
|
+
pageIndexBase;
|
|
49771
|
+
constructor(options = {}, pageIndexBase = 0) {
|
|
49690
49772
|
super(options);
|
|
49773
|
+
this.pageIndexBase = pageIndexBase;
|
|
49691
49774
|
this.nodeRenderers = this.createNodeRenderers();
|
|
49692
49775
|
}
|
|
49776
|
+
/**
|
|
49777
|
+
* Render a document, building the anchor-path map first when anchors are
|
|
49778
|
+
* enabled so `renderNode` / `renderPage` can inject each node's path.
|
|
49779
|
+
*/
|
|
49780
|
+
render(document) {
|
|
49781
|
+
if (this.context.options.sourceAnchors) {
|
|
49782
|
+
this.pathMap = buildAnchorPathMap(document, this.pageIndexBase);
|
|
49783
|
+
}
|
|
49784
|
+
try {
|
|
49785
|
+
return super.render(document);
|
|
49786
|
+
} finally {
|
|
49787
|
+
this.pathMap = null;
|
|
49788
|
+
}
|
|
49789
|
+
}
|
|
49693
49790
|
/**
|
|
49694
49791
|
* Get render context for external renderer functions
|
|
49695
49792
|
*/
|
|
@@ -49818,9 +49915,15 @@ var HtmlRenderer = class extends BaseRenderer {
|
|
|
49818
49915
|
}
|
|
49819
49916
|
const combinedStyle = commonStyles ? `${viewportStyle}; ${commonStyles}` : viewportStyle;
|
|
49820
49917
|
const dataAttrs = `data-viewport-width="${viewport.width}" data-viewport-height="${viewport.height}" data-viewport-label="${viewport.label}"`;
|
|
49821
|
-
|
|
49918
|
+
let pageDiv = `<div class="${classes}" style="${combinedStyle}" ${dataAttrs}>
|
|
49822
49919
|
${title}${uiContent}
|
|
49823
49920
|
</div>`;
|
|
49921
|
+
if (this.pathMap) {
|
|
49922
|
+
const path = this.pathMap.get(node);
|
|
49923
|
+
if (path !== void 0) {
|
|
49924
|
+
pageDiv = injectAnchorAttrs(pageDiv, path, node.loc);
|
|
49925
|
+
}
|
|
49926
|
+
}
|
|
49824
49927
|
if (annotationChildren.length > 0) {
|
|
49825
49928
|
const annotationsContent = this.renderChildren(annotationChildren);
|
|
49826
49929
|
return `<div class="${this.prefix}-page-wrapper" style="width: ${viewport.width}px">
|
|
@@ -49835,10 +49938,14 @@ ${annotationsContent}
|
|
|
49835
49938
|
*/
|
|
49836
49939
|
renderNode(node) {
|
|
49837
49940
|
const renderer = this.nodeRenderers[node.type];
|
|
49838
|
-
|
|
49839
|
-
|
|
49941
|
+
const html = renderer ? renderer(node) : `<!-- Unknown node type: ${node.type} -->`;
|
|
49942
|
+
if (this.pathMap && node.type !== "Page") {
|
|
49943
|
+
const path = this.pathMap.get(node);
|
|
49944
|
+
if (path !== void 0) {
|
|
49945
|
+
return injectAnchorAttrs(html, path, node.loc);
|
|
49946
|
+
}
|
|
49840
49947
|
}
|
|
49841
|
-
return
|
|
49948
|
+
return html;
|
|
49842
49949
|
}
|
|
49843
49950
|
/**
|
|
49844
49951
|
* Render children nodes
|
|
@@ -50289,8 +50396,8 @@ function renderCanvas(doc, options = {}) {
|
|
|
50289
50396
|
};
|
|
50290
50397
|
}
|
|
50291
50398
|
const { placed, width, height } = layoutCanvas(doc.children, gap);
|
|
50292
|
-
const
|
|
50293
|
-
|
|
50399
|
+
const boards = placed.map((p, pageIndex) => {
|
|
50400
|
+
const pageRenderer = new HtmlRenderer({ ...options, includeStyles: false }, pageIndex);
|
|
50294
50401
|
const { html: pageHtml } = pageRenderer.render({
|
|
50295
50402
|
type: "Document",
|
|
50296
50403
|
children: [p.page]
|
|
@@ -50328,6 +50435,9 @@ function render(document, options = {}) {
|
|
|
50328
50435
|
}
|
|
50329
50436
|
function renderToHtml(document, options = {}) {
|
|
50330
50437
|
const { html, css } = render(document, options);
|
|
50438
|
+
const prefix = options.classPrefix ?? "wf";
|
|
50439
|
+
const isMultiPage = document.children.length > 1;
|
|
50440
|
+
const bodyAlign = isMultiPage ? "justify-content: flex-start;\n align-items: flex-start;" : "justify-content: center;\n align-items: center;";
|
|
50331
50441
|
return `<!DOCTYPE html>
|
|
50332
50442
|
<html lang="en">
|
|
50333
50443
|
<head>
|
|
@@ -50335,7 +50445,7 @@ function renderToHtml(document, options = {}) {
|
|
|
50335
50445
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
50336
50446
|
<title>Wireframe</title>
|
|
50337
50447
|
<style>
|
|
50338
|
-
/*
|
|
50448
|
+
/* Viewport framing: center a single page, anchor a multi-page canvas top-left */
|
|
50339
50449
|
html, body {
|
|
50340
50450
|
margin: 0;
|
|
50341
50451
|
padding: 0;
|
|
@@ -50344,11 +50454,18 @@ html, body {
|
|
|
50344
50454
|
}
|
|
50345
50455
|
body {
|
|
50346
50456
|
display: flex;
|
|
50347
|
-
|
|
50348
|
-
align-items: center;
|
|
50457
|
+
${bodyAlign}
|
|
50349
50458
|
padding: 24px;
|
|
50350
50459
|
box-sizing: border-box;
|
|
50351
50460
|
}
|
|
50461
|
+
/* Fixed-layout invariant: the multi-page canvas is a flex item of <body> and
|
|
50462
|
+
must keep its intrinsic size when the viewport is narrower than the canvas.
|
|
50463
|
+
Without flex-shrink:0 the flex item shrinks and the boards reflow \u2014 the same
|
|
50464
|
+
defect class as .wf-page (see no-responsive.md). Single pages already carry
|
|
50465
|
+
flex-shrink:0 via generateStyles; the canvas wrapper needs it here. */
|
|
50466
|
+
.${prefix}-canvas {
|
|
50467
|
+
flex-shrink: 0;
|
|
50468
|
+
}
|
|
50352
50469
|
${css}
|
|
50353
50470
|
</style>
|
|
50354
50471
|
</head>
|
|
@@ -50425,6 +50542,7 @@ export {
|
|
|
50425
50542
|
renderPage,
|
|
50426
50543
|
renderToHtml,
|
|
50427
50544
|
renderToSvg,
|
|
50545
|
+
renderUnknownIconSvg,
|
|
50428
50546
|
resolvePageDimensions
|
|
50429
50547
|
};
|
|
50430
50548
|
/**
|
|
@@ -354,6 +354,19 @@ interface ButtonNode extends BaseNode, CommonProps, InteractiveProps {
|
|
|
354
354
|
icon?: string;
|
|
355
355
|
disabled?: boolean;
|
|
356
356
|
loading?: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Accessible name, rendered as `aria-label`. Use this to give an icon-only
|
|
359
|
+
* button (`button "" icon="x" aria="Close"`) a real accessible name for
|
|
360
|
+
* screen-reader users (WCAG 4.1.2 / 1.1.1) without showing visible text.
|
|
361
|
+
* `aria-label` is accepted as a synonym.
|
|
362
|
+
*/
|
|
363
|
+
aria?: string;
|
|
364
|
+
'aria-label'?: string;
|
|
365
|
+
/**
|
|
366
|
+
* Tooltip text, rendered as the `title` attribute. Also contributes an
|
|
367
|
+
* accessible name (lower priority than `aria-label`/text content).
|
|
368
|
+
*/
|
|
369
|
+
title?: string;
|
|
357
370
|
}
|
|
358
371
|
interface ImageNode extends BaseNode, CommonProps, InteractiveProps {
|
|
359
372
|
type: 'Image';
|
|
@@ -613,4 +626,4 @@ type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode
|
|
|
613
626
|
type AnyNode = ContainerNode | LeafNode;
|
|
614
627
|
type NodeType = 'Document' | 'Page' | 'Header' | 'Main' | 'Footer' | 'Sidebar' | 'Section' | 'Row' | 'Col' | 'Stack' | 'Relative' | 'Card' | 'Modal' | 'Drawer' | 'Accordion' | 'Text' | 'Title' | 'Link' | 'Input' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'Button' | 'Image' | 'Placeholder' | 'Avatar' | 'Badge' | 'Icon' | 'Table' | 'List' | 'Alert' | 'Toast' | 'Progress' | 'Spinner' | 'Tooltip' | 'Popover' | 'Dropdown' | 'Nav' | 'Tabs' | 'Breadcrumb' | 'Divider' | 'Marker' | 'Annotations' | 'AnnotationItem';
|
|
615
628
|
|
|
616
|
-
export type {
|
|
629
|
+
export type { InteractiveProps as $, AccordionNode as A, BadgeNode as B, CardNode as C, ContainerNode as D, DataNode as E, DirectionValue as F, DisplayNode as G, DividerComponentNode as H, DividerNode as I, DrawerNode as J, DrawerPosition as K, DropdownItemNode as L, DropdownNode as M, FeedbackNode as N, FlexProps as O, FooterNode as P, GridNode as Q, GridProps as R, HeaderNode as S, HeightValue as T, IconNode as U, IconSize as V, IconSizeToken as W, ImageNode as X, InputComponentNode as Y, InputNode as Z, InputType as _, AlertNode as a, JustifyValue as a0, LayoutNode as a1, LeafNode as a2, LinkNode as a3, ListItemNode as a4, ListNode as a5, MainNode as a6, MarkerColor as a7, MarkerNode as a8, ModalNode as a9, SpacingProps as aA, SpacingValue as aB, SpinnerNode as aC, SpinnerSize as aD, SpinnerSizeToken as aE, StackNode as aF, SwitchNode as aG, TabNode as aH, TableNode as aI, TabsNode as aJ, TextAlign as aK, TextContentNode as aL, TextNode as aM, TextSize as aN, TextSizeToken as aO, TextWeight as aP, TextareaNode as aQ, TitleLevel as aR, TitleNode as aS, ToastNode as aT, ToastPosition as aU, TooltipNode as aV, TooltipPosition as aW, ValueWithUnit as aX, WidthValue as aY, WireframeDocument as aZ, NavBlockItem as aa, NavChild as ab, NavDivider as ac, NavGroupNode as ad, NavItem as ae, NavNode as af, NavigationNode as ag, NodeType as ah, OverlayNode as ai, PageNode as aj, PlaceholderNode as ak, PopoverNode as al, Position as am, PositionProps as an, ProgressNode as ao, RadioNode as ap, RelativeNode as aq, RowNode as ar, SectionNode as as, SelectNode as at, SelectOption as au, ShadowValue as av, SidebarNode as aw, SizeProps as ax, SliderNode as ay, SourceLocation as az, AlertVariant as b, AlignValue as c, AnchorPosition as d, AnnotationItemNode as e, AnnotationNode as f, AnnotationsNode as g, AnyNode as h, AppearanceProps as i, AvatarNode as j, AvatarSize as k, AvatarSizeToken as l, BadgeSize as m, BadgeSizeToken as n, BadgeVariant as o, BaseNode as p, BreadcrumbItem as q, BreadcrumbNode as r, ButtonNode as s, ButtonSize as t, ButtonSizeToken as u, ButtonVariant as v, CheckboxNode as w, ColNode as x, CommonProps as y, ContainerComponentNode as z };
|
|
@@ -354,6 +354,19 @@ interface ButtonNode extends BaseNode, CommonProps, InteractiveProps {
|
|
|
354
354
|
icon?: string;
|
|
355
355
|
disabled?: boolean;
|
|
356
356
|
loading?: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Accessible name, rendered as `aria-label`. Use this to give an icon-only
|
|
359
|
+
* button (`button "" icon="x" aria="Close"`) a real accessible name for
|
|
360
|
+
* screen-reader users (WCAG 4.1.2 / 1.1.1) without showing visible text.
|
|
361
|
+
* `aria-label` is accepted as a synonym.
|
|
362
|
+
*/
|
|
363
|
+
aria?: string;
|
|
364
|
+
'aria-label'?: string;
|
|
365
|
+
/**
|
|
366
|
+
* Tooltip text, rendered as the `title` attribute. Also contributes an
|
|
367
|
+
* accessible name (lower priority than `aria-label`/text content).
|
|
368
|
+
*/
|
|
369
|
+
title?: string;
|
|
357
370
|
}
|
|
358
371
|
interface ImageNode extends BaseNode, CommonProps, InteractiveProps {
|
|
359
372
|
type: 'Image';
|
|
@@ -613,4 +626,4 @@ type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode
|
|
|
613
626
|
type AnyNode = ContainerNode | LeafNode;
|
|
614
627
|
type NodeType = 'Document' | 'Page' | 'Header' | 'Main' | 'Footer' | 'Sidebar' | 'Section' | 'Row' | 'Col' | 'Stack' | 'Relative' | 'Card' | 'Modal' | 'Drawer' | 'Accordion' | 'Text' | 'Title' | 'Link' | 'Input' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'Button' | 'Image' | 'Placeholder' | 'Avatar' | 'Badge' | 'Icon' | 'Table' | 'List' | 'Alert' | 'Toast' | 'Progress' | 'Spinner' | 'Tooltip' | 'Popover' | 'Dropdown' | 'Nav' | 'Tabs' | 'Breadcrumb' | 'Divider' | 'Marker' | 'Annotations' | 'AnnotationItem';
|
|
615
628
|
|
|
616
|
-
export type {
|
|
629
|
+
export type { InteractiveProps as $, AccordionNode as A, BadgeNode as B, CardNode as C, ContainerNode as D, DataNode as E, DirectionValue as F, DisplayNode as G, DividerComponentNode as H, DividerNode as I, DrawerNode as J, DrawerPosition as K, DropdownItemNode as L, DropdownNode as M, FeedbackNode as N, FlexProps as O, FooterNode as P, GridNode as Q, GridProps as R, HeaderNode as S, HeightValue as T, IconNode as U, IconSize as V, IconSizeToken as W, ImageNode as X, InputComponentNode as Y, InputNode as Z, InputType as _, AlertNode as a, JustifyValue as a0, LayoutNode as a1, LeafNode as a2, LinkNode as a3, ListItemNode as a4, ListNode as a5, MainNode as a6, MarkerColor as a7, MarkerNode as a8, ModalNode as a9, SpacingProps as aA, SpacingValue as aB, SpinnerNode as aC, SpinnerSize as aD, SpinnerSizeToken as aE, StackNode as aF, SwitchNode as aG, TabNode as aH, TableNode as aI, TabsNode as aJ, TextAlign as aK, TextContentNode as aL, TextNode as aM, TextSize as aN, TextSizeToken as aO, TextWeight as aP, TextareaNode as aQ, TitleLevel as aR, TitleNode as aS, ToastNode as aT, ToastPosition as aU, TooltipNode as aV, TooltipPosition as aW, ValueWithUnit as aX, WidthValue as aY, WireframeDocument as aZ, NavBlockItem as aa, NavChild as ab, NavDivider as ac, NavGroupNode as ad, NavItem as ae, NavNode as af, NavigationNode as ag, NodeType as ah, OverlayNode as ai, PageNode as aj, PlaceholderNode as ak, PopoverNode as al, Position as am, PositionProps as an, ProgressNode as ao, RadioNode as ap, RelativeNode as aq, RowNode as ar, SectionNode as as, SelectNode as at, SelectOption as au, ShadowValue as av, SidebarNode as aw, SizeProps as ax, SliderNode as ay, SourceLocation as az, AlertVariant as b, AlignValue as c, AnchorPosition as d, AnnotationItemNode as e, AnnotationNode as f, AnnotationsNode as g, AnyNode as h, AppearanceProps as i, AvatarNode as j, AvatarSize as k, AvatarSizeToken as l, BadgeSize as m, BadgeSizeToken as n, BadgeVariant as o, BaseNode as p, BreadcrumbItem as q, BreadcrumbNode as r, ButtonNode as s, ButtonSize as t, ButtonSizeToken as u, ButtonVariant as v, CheckboxNode as w, ColNode as x, CommonProps as y, ContainerComponentNode as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wireweave/core",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0-beta.1",
|
|
4
4
|
"description": "Core parser and renderer for wireweave",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,24 +26,6 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build:grammar": "peggy --format es -o src/parser/generated-parser.js src/grammar/wireframe.peggy",
|
|
31
|
-
"build:ts": "tsup",
|
|
32
|
-
"build": "pnpm build:grammar && pnpm build:ts",
|
|
33
|
-
"test": "vitest run",
|
|
34
|
-
"test:watch": "vitest",
|
|
35
|
-
"storybook": "storybook dev -p 6006",
|
|
36
|
-
"build-storybook": "storybook build",
|
|
37
|
-
"clean": "rm -rf dist",
|
|
38
|
-
"typecheck": "tsc --noEmit",
|
|
39
|
-
"lint": "eslint .",
|
|
40
|
-
"lint:fix": "eslint . --fix",
|
|
41
|
-
"format": "prettier --write .",
|
|
42
|
-
"format:check": "prettier --check .",
|
|
43
|
-
"knip": "knip",
|
|
44
|
-
"prepare": "husky",
|
|
45
|
-
"release": "release-it"
|
|
46
|
-
},
|
|
47
29
|
"devDependencies": {
|
|
48
30
|
"@commitlint/cli": "^21.0.1",
|
|
49
31
|
"@commitlint/config-conventional": "^21.0.1",
|
|
@@ -79,6 +61,24 @@
|
|
|
79
61
|
"license": "MIT",
|
|
80
62
|
"repository": {
|
|
81
63
|
"type": "git",
|
|
82
|
-
"url": "https://github.com/wireweave/
|
|
64
|
+
"url": "git+https://github.com/wireweave/wireweave.git",
|
|
65
|
+
"directory": "packages/core"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build:grammar": "peggy --format es -o src/parser/generated-parser.js src/grammar/wireframe.peggy",
|
|
69
|
+
"build:ts": "tsup",
|
|
70
|
+
"build": "pnpm build:grammar && pnpm build:ts",
|
|
71
|
+
"test": "vitest run",
|
|
72
|
+
"test:watch": "vitest",
|
|
73
|
+
"storybook": "storybook dev -p 6006",
|
|
74
|
+
"build-storybook": "storybook build",
|
|
75
|
+
"clean": "rm -rf dist",
|
|
76
|
+
"typecheck": "tsc --noEmit",
|
|
77
|
+
"lint": "eslint .",
|
|
78
|
+
"lint:fix": "eslint . --fix",
|
|
79
|
+
"format": "prettier --write .",
|
|
80
|
+
"format:check": "prettier --check .",
|
|
81
|
+
"knip": "knip",
|
|
82
|
+
"release": "release-it"
|
|
83
83
|
}
|
|
84
|
-
}
|
|
84
|
+
}
|