@wireweave/core 2.3.1 → 2.5.0-beta.0
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/index.cjs +1904 -815
- package/dist/index.d.cts +118 -17
- package/dist/index.d.ts +118 -17
- package/dist/index.js +1904 -815
- package/dist/parser.cjs +1286 -755
- package/dist/parser.d.cts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/parser.js +1286 -755
- package/dist/renderer.cjs +328 -6
- package/dist/renderer.d.cts +6 -1
- package/dist/renderer.d.ts +6 -1
- package/dist/renderer.js +328 -6
- package/dist/{types-D0t4JRY3.d.cts → types-EbEsGNxL.d.cts} +105 -5
- package/dist/{types-D0t4JRY3.d.ts → types-EbEsGNxL.d.ts} +105 -5
- package/package.json +1 -1
package/dist/renderer.js
CHANGED
|
@@ -1284,6 +1284,106 @@ function generateAccessibilityStyles(prefix) {
|
|
|
1284
1284
|
}`;
|
|
1285
1285
|
}
|
|
1286
1286
|
|
|
1287
|
+
// src/renderer/styles/annotation.ts
|
|
1288
|
+
function generateAnnotationStyles(_theme, prefix) {
|
|
1289
|
+
return `/* Annotation Components */
|
|
1290
|
+
|
|
1291
|
+
/* Marker - Number marker for referencing */
|
|
1292
|
+
.${prefix}-marker {
|
|
1293
|
+
display: inline-flex;
|
|
1294
|
+
align-items: center;
|
|
1295
|
+
justify-content: center;
|
|
1296
|
+
width: 20px;
|
|
1297
|
+
height: 20px;
|
|
1298
|
+
border-radius: 50%;
|
|
1299
|
+
background: #3b82f6;
|
|
1300
|
+
border: 2px solid #2563eb;
|
|
1301
|
+
color: white;
|
|
1302
|
+
font-size: 11px;
|
|
1303
|
+
font-weight: 600;
|
|
1304
|
+
line-height: 1;
|
|
1305
|
+
z-index: 10;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/* Annotations Panel - Documentation container */
|
|
1309
|
+
.${prefix}-annotations {
|
|
1310
|
+
background: #fafafa;
|
|
1311
|
+
border: 2px dashed #d1d5db;
|
|
1312
|
+
border-radius: 8px;
|
|
1313
|
+
padding: 16px;
|
|
1314
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
.${prefix}-annotations-header {
|
|
1318
|
+
display: flex;
|
|
1319
|
+
align-items: center;
|
|
1320
|
+
gap: 8px;
|
|
1321
|
+
font-weight: 600;
|
|
1322
|
+
font-size: 14px;
|
|
1323
|
+
color: #6b7280;
|
|
1324
|
+
margin-bottom: 16px;
|
|
1325
|
+
padding-bottom: 8px;
|
|
1326
|
+
border-bottom: 1px solid #e5e7eb;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
.${prefix}-annotations-icon {
|
|
1330
|
+
font-size: 16px;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
.${prefix}-annotations-content {
|
|
1334
|
+
display: flex;
|
|
1335
|
+
flex-direction: column;
|
|
1336
|
+
gap: 12px;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
/* Annotation Item - Individual entry */
|
|
1340
|
+
.${prefix}-annotation-item {
|
|
1341
|
+
display: flex;
|
|
1342
|
+
flex-direction: column;
|
|
1343
|
+
gap: 4px;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
.${prefix}-annotation-item-header {
|
|
1347
|
+
display: flex;
|
|
1348
|
+
align-items: center;
|
|
1349
|
+
gap: 8px;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
.${prefix}-annotation-marker {
|
|
1353
|
+
display: inline-flex;
|
|
1354
|
+
align-items: center;
|
|
1355
|
+
justify-content: center;
|
|
1356
|
+
width: 18px;
|
|
1357
|
+
height: 18px;
|
|
1358
|
+
border-radius: 50%;
|
|
1359
|
+
background: #3b82f6;
|
|
1360
|
+
color: white;
|
|
1361
|
+
font-size: 10px;
|
|
1362
|
+
font-weight: 600;
|
|
1363
|
+
flex-shrink: 0;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
.${prefix}-annotation-item-title {
|
|
1367
|
+
font-weight: 500;
|
|
1368
|
+
font-size: 13px;
|
|
1369
|
+
color: #374151;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
.${prefix}-annotation-item-content {
|
|
1373
|
+
padding-left: 26px;
|
|
1374
|
+
font-size: 12px;
|
|
1375
|
+
color: #6b7280;
|
|
1376
|
+
line-height: 1.5;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
.${prefix}-annotation-item-content p,
|
|
1380
|
+
.${prefix}-annotation-item-content .${prefix}-text {
|
|
1381
|
+
margin: 0;
|
|
1382
|
+
font-size: 12px;
|
|
1383
|
+
color: #6b7280;
|
|
1384
|
+
}`;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1287
1387
|
// src/renderer/styles-components.ts
|
|
1288
1388
|
function generateComponentStyles(_theme, prefix = "wf") {
|
|
1289
1389
|
const parts = [
|
|
@@ -1297,7 +1397,8 @@ function generateComponentStyles(_theme, prefix = "wf") {
|
|
|
1297
1397
|
generateOverlayStyles(_theme, prefix),
|
|
1298
1398
|
generateNavigationStyles(_theme, prefix),
|
|
1299
1399
|
generateSemanticMarkerStyles(_theme, prefix),
|
|
1300
|
-
generateAccessibilityStyles(prefix)
|
|
1400
|
+
generateAccessibilityStyles(prefix),
|
|
1401
|
+
generateAnnotationStyles(_theme, prefix)
|
|
1301
1402
|
];
|
|
1302
1403
|
return parts.join("\n\n");
|
|
1303
1404
|
}
|
|
@@ -1408,11 +1509,36 @@ function generateGridClasses(_theme, prefix) {
|
|
|
1408
1509
|
}
|
|
1409
1510
|
|
|
1410
1511
|
/* When explicit width is set, don't flex-grow */
|
|
1411
|
-
.${prefix}-row[style*="width
|
|
1412
|
-
.${prefix}-col[style*="width
|
|
1512
|
+
.${prefix}-row[style*="width"],
|
|
1513
|
+
.${prefix}-col[style*="width"] {
|
|
1514
|
+
flex: 0 0 auto;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
/* Stack - vertical content grouping (does not fill available space) */
|
|
1518
|
+
.${prefix}-stack {
|
|
1519
|
+
display: flex;
|
|
1520
|
+
flex-direction: column;
|
|
1413
1521
|
flex: 0 0 auto;
|
|
1522
|
+
box-sizing: border-box;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/* Relative - container for absolute positioning children */
|
|
1526
|
+
.${prefix}-relative {
|
|
1527
|
+
position: relative;
|
|
1528
|
+
display: inline-flex;
|
|
1414
1529
|
}
|
|
1415
1530
|
|
|
1531
|
+
/* Anchor positioning for relative container children */
|
|
1532
|
+
.${prefix}-anchor-top-left { position: absolute; top: -4px; left: -4px; }
|
|
1533
|
+
.${prefix}-anchor-top-center { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); }
|
|
1534
|
+
.${prefix}-anchor-top-right { position: absolute; top: -4px; right: -4px; }
|
|
1535
|
+
.${prefix}-anchor-center-left { position: absolute; top: 50%; left: -4px; transform: translateY(-50%); }
|
|
1536
|
+
.${prefix}-anchor-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
|
|
1537
|
+
.${prefix}-anchor-center-right { position: absolute; top: 50%; right: -4px; transform: translateY(-50%); }
|
|
1538
|
+
.${prefix}-anchor-bottom-left { position: absolute; bottom: -4px; left: -4px; }
|
|
1539
|
+
.${prefix}-anchor-bottom-center { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); }
|
|
1540
|
+
.${prefix}-anchor-bottom-right { position: absolute; bottom: -4px; right: -4px; }
|
|
1541
|
+
|
|
1416
1542
|
`;
|
|
1417
1543
|
for (let i = 1; i <= 12; i++) {
|
|
1418
1544
|
css += `.${prefix}-col-${i} { flex: ${i} 0 0%; min-width: 0; }
|
|
@@ -2006,6 +2132,30 @@ function renderCol(node, ctx) {
|
|
|
2006
2132
|
${children}
|
|
2007
2133
|
</div>`;
|
|
2008
2134
|
}
|
|
2135
|
+
function renderStack(node, ctx) {
|
|
2136
|
+
const classes = ctx.buildClassString([
|
|
2137
|
+
`${ctx.prefix}-stack`,
|
|
2138
|
+
...ctx.getCommonClasses(node)
|
|
2139
|
+
]);
|
|
2140
|
+
const styles = ctx.buildCommonStyles(node);
|
|
2141
|
+
const styleAttr = styles ? ` style="${styles}"` : "";
|
|
2142
|
+
const children = ctx.renderChildren(node.children);
|
|
2143
|
+
return `<div class="${classes}"${styleAttr}>
|
|
2144
|
+
${children}
|
|
2145
|
+
</div>`;
|
|
2146
|
+
}
|
|
2147
|
+
function renderRelative(node, ctx) {
|
|
2148
|
+
const classes = ctx.buildClassString([
|
|
2149
|
+
`${ctx.prefix}-relative`,
|
|
2150
|
+
...ctx.getCommonClasses(node)
|
|
2151
|
+
]);
|
|
2152
|
+
const styles = ctx.buildCommonStyles(node);
|
|
2153
|
+
const styleAttr = styles ? ` style="${styles}"` : "";
|
|
2154
|
+
const children = ctx.renderChildren(node.children);
|
|
2155
|
+
return `<div class="${classes}"${styleAttr}>
|
|
2156
|
+
${children}
|
|
2157
|
+
</div>`;
|
|
2158
|
+
}
|
|
2009
2159
|
|
|
2010
2160
|
// src/renderer/html/renderers/container.ts
|
|
2011
2161
|
function buildInteractiveAttrs(node) {
|
|
@@ -12841,6 +12991,28 @@ var lucideIcons = {
|
|
|
12841
12991
|
}
|
|
12842
12992
|
]
|
|
12843
12993
|
],
|
|
12994
|
+
"circle-help": [
|
|
12995
|
+
[
|
|
12996
|
+
"circle",
|
|
12997
|
+
{
|
|
12998
|
+
"cx": "12",
|
|
12999
|
+
"cy": "12",
|
|
13000
|
+
"r": "10"
|
|
13001
|
+
}
|
|
13002
|
+
],
|
|
13003
|
+
[
|
|
13004
|
+
"path",
|
|
13005
|
+
{
|
|
13006
|
+
"d": "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"
|
|
13007
|
+
}
|
|
13008
|
+
],
|
|
13009
|
+
[
|
|
13010
|
+
"path",
|
|
13011
|
+
{
|
|
13012
|
+
"d": "M12 17h.01"
|
|
13013
|
+
}
|
|
13014
|
+
]
|
|
13015
|
+
],
|
|
12844
13016
|
"circle-minus": [
|
|
12845
13017
|
[
|
|
12846
13018
|
"circle",
|
|
@@ -48903,10 +49075,20 @@ function renderAvatar(node, ctx) {
|
|
|
48903
49075
|
const sizeStyle = sizeResolved.style || "";
|
|
48904
49076
|
const combinedStyles = baseStyles && sizeStyle ? `${baseStyles}; ${sizeStyle}` : baseStyles || sizeStyle;
|
|
48905
49077
|
const styleAttr = combinedStyles ? ` style="${combinedStyles}"` : "";
|
|
48906
|
-
|
|
49078
|
+
let content;
|
|
49079
|
+
if (node.name) {
|
|
49080
|
+
content = node.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2);
|
|
49081
|
+
} else {
|
|
49082
|
+
const iconData = getIconData("user");
|
|
49083
|
+
if (iconData) {
|
|
49084
|
+
content = renderIconSvg(iconData, 16, 2, `${ctx.prefix}-icon`);
|
|
49085
|
+
} else {
|
|
49086
|
+
content = "?";
|
|
49087
|
+
}
|
|
49088
|
+
}
|
|
48907
49089
|
const interactiveAttrs = buildInteractiveAttrs2(node);
|
|
48908
49090
|
const interactiveAttrStr = ctx.buildAttrsString(interactiveAttrs);
|
|
48909
|
-
return `<div class="${classes}"${styleAttr}${interactiveAttrStr} role="img" aria-label="${ctx.escapeHtml(node.name || "Avatar")}">${
|
|
49091
|
+
return `<div class="${classes}"${styleAttr}${interactiveAttrStr} role="img" aria-label="${ctx.escapeHtml(node.name || "Avatar")}">${content}</div>`;
|
|
48910
49092
|
}
|
|
48911
49093
|
function renderBadge(node, ctx) {
|
|
48912
49094
|
const interactiveAttrs = buildInteractiveAttrs2(node);
|
|
@@ -48918,6 +49100,7 @@ function renderBadge(node, ctx) {
|
|
|
48918
49100
|
`${ctx.prefix}-badge-icon`,
|
|
48919
49101
|
sizeResolved.className,
|
|
48920
49102
|
node.variant ? `${ctx.prefix}-badge-icon-${node.variant}` : void 0,
|
|
49103
|
+
node.anchor ? `${ctx.prefix}-anchor-${node.anchor}` : void 0,
|
|
48921
49104
|
...ctx.getCommonClasses(node)
|
|
48922
49105
|
]);
|
|
48923
49106
|
const baseStyles2 = ctx.buildCommonStyles(node);
|
|
@@ -48937,6 +49120,7 @@ function renderBadge(node, ctx) {
|
|
|
48937
49120
|
sizeResolved.className,
|
|
48938
49121
|
node.variant ? `${ctx.prefix}-badge-${node.variant}` : void 0,
|
|
48939
49122
|
node.pill ? `${ctx.prefix}-badge-pill` : void 0,
|
|
49123
|
+
node.anchor ? `${ctx.prefix}-anchor-${node.anchor}` : void 0,
|
|
48940
49124
|
...ctx.getCommonClasses(node)
|
|
48941
49125
|
]);
|
|
48942
49126
|
const baseStyles = ctx.buildCommonStyles(node);
|
|
@@ -49271,6 +49455,117 @@ function renderDivider(node, ctx) {
|
|
|
49271
49455
|
return `<hr class="${ctx.prefix}-divider"${styleAttr} />`;
|
|
49272
49456
|
}
|
|
49273
49457
|
|
|
49458
|
+
// src/renderer/html/renderers/annotation.ts
|
|
49459
|
+
var MARKER_COLORS = {
|
|
49460
|
+
blue: { bg: "#3b82f6", border: "#2563eb" },
|
|
49461
|
+
red: { bg: "#ef4444", border: "#dc2626" },
|
|
49462
|
+
green: { bg: "#22c55e", border: "#16a34a" },
|
|
49463
|
+
yellow: { bg: "#eab308", border: "#ca8a04" },
|
|
49464
|
+
purple: { bg: "#a855f7", border: "#9333ea" },
|
|
49465
|
+
orange: { bg: "#f97316", border: "#ea580c" }
|
|
49466
|
+
};
|
|
49467
|
+
function getAnchorStyles(anchor) {
|
|
49468
|
+
if (!anchor) return "";
|
|
49469
|
+
const styles = ["position: absolute"];
|
|
49470
|
+
switch (anchor) {
|
|
49471
|
+
case "top-left":
|
|
49472
|
+
styles.push("top: -8px", "left: -8px");
|
|
49473
|
+
break;
|
|
49474
|
+
case "top-center":
|
|
49475
|
+
styles.push("top: -8px", "left: 50%", "transform: translateX(-50%)");
|
|
49476
|
+
break;
|
|
49477
|
+
case "top-right":
|
|
49478
|
+
styles.push("top: -8px", "right: -8px");
|
|
49479
|
+
break;
|
|
49480
|
+
case "center-left":
|
|
49481
|
+
styles.push("top: 50%", "left: -8px", "transform: translateY(-50%)");
|
|
49482
|
+
break;
|
|
49483
|
+
case "center":
|
|
49484
|
+
styles.push("top: 50%", "left: 50%", "transform: translate(-50%, -50%)");
|
|
49485
|
+
break;
|
|
49486
|
+
case "center-right":
|
|
49487
|
+
styles.push("top: 50%", "right: -8px", "transform: translateY(-50%)");
|
|
49488
|
+
break;
|
|
49489
|
+
case "bottom-left":
|
|
49490
|
+
styles.push("bottom: -8px", "left: -8px");
|
|
49491
|
+
break;
|
|
49492
|
+
case "bottom-center":
|
|
49493
|
+
styles.push("bottom: -8px", "left: 50%", "transform: translateX(-50%)");
|
|
49494
|
+
break;
|
|
49495
|
+
case "bottom-right":
|
|
49496
|
+
styles.push("bottom: -8px", "right: -8px");
|
|
49497
|
+
break;
|
|
49498
|
+
}
|
|
49499
|
+
return styles.join("; ");
|
|
49500
|
+
}
|
|
49501
|
+
function renderMarker(node, ctx) {
|
|
49502
|
+
const color = node.color || "blue";
|
|
49503
|
+
const colorConfig = MARKER_COLORS[color] || MARKER_COLORS.blue;
|
|
49504
|
+
const baseStyles = [
|
|
49505
|
+
"display: inline-flex",
|
|
49506
|
+
"align-items: center",
|
|
49507
|
+
"justify-content: center",
|
|
49508
|
+
"width: 20px",
|
|
49509
|
+
"height: 20px",
|
|
49510
|
+
"border-radius: 50%",
|
|
49511
|
+
`background: ${colorConfig.bg}`,
|
|
49512
|
+
`border: 2px solid ${colorConfig.border}`,
|
|
49513
|
+
"color: white",
|
|
49514
|
+
"font-size: 11px",
|
|
49515
|
+
"font-weight: 600",
|
|
49516
|
+
"line-height: 1",
|
|
49517
|
+
"z-index: 10"
|
|
49518
|
+
];
|
|
49519
|
+
const anchorStyles = getAnchorStyles(node.anchor);
|
|
49520
|
+
const commonStyles = ctx.buildCommonStyles(node);
|
|
49521
|
+
const allStyles = [
|
|
49522
|
+
...baseStyles,
|
|
49523
|
+
...anchorStyles ? [anchorStyles] : [],
|
|
49524
|
+
...commonStyles ? [commonStyles] : []
|
|
49525
|
+
].join("; ");
|
|
49526
|
+
return `<span class="${ctx.prefix}-marker" style="${allStyles}" aria-label="Marker ${node.number}">${node.number}</span>`;
|
|
49527
|
+
}
|
|
49528
|
+
function renderAnnotations(node, ctx) {
|
|
49529
|
+
const title = node.title || "\uD654\uBA74 \uC124\uBA85";
|
|
49530
|
+
const commonStyles = ctx.buildCommonStyles(node);
|
|
49531
|
+
const styleAttr = commonStyles ? ` style="${commonStyles}"` : "";
|
|
49532
|
+
const items = (node.children || []).map((child) => renderAnnotationItem(child, ctx)).join("\n");
|
|
49533
|
+
return `<aside class="${ctx.prefix}-annotations" data-role="documentation" aria-label="${ctx.escapeHtml(title)}"${styleAttr}>
|
|
49534
|
+
<header class="${ctx.prefix}-annotations-header">
|
|
49535
|
+
<span class="${ctx.prefix}-annotations-icon" aria-hidden="true">📋</span>
|
|
49536
|
+
<span>${ctx.escapeHtml(title)}</span>
|
|
49537
|
+
</header>
|
|
49538
|
+
<div class="${ctx.prefix}-annotations-content">
|
|
49539
|
+
${items}
|
|
49540
|
+
</div>
|
|
49541
|
+
</aside>`;
|
|
49542
|
+
}
|
|
49543
|
+
function renderAnnotationItem(node, ctx) {
|
|
49544
|
+
const color = MARKER_COLORS.blue;
|
|
49545
|
+
const markerStyle = [
|
|
49546
|
+
"display: inline-flex",
|
|
49547
|
+
"align-items: center",
|
|
49548
|
+
"justify-content: center",
|
|
49549
|
+
"width: 18px",
|
|
49550
|
+
"height: 18px",
|
|
49551
|
+
"border-radius: 50%",
|
|
49552
|
+
`background: ${color.bg}`,
|
|
49553
|
+
"color: white",
|
|
49554
|
+
"font-size: 10px",
|
|
49555
|
+
"font-weight: 600",
|
|
49556
|
+
"flex-shrink: 0"
|
|
49557
|
+
].join("; ");
|
|
49558
|
+
const children = node.children || [];
|
|
49559
|
+
const content = children.length > 0 ? ctx.renderChildren(children) : "";
|
|
49560
|
+
return `<div class="${ctx.prefix}-annotation-item">
|
|
49561
|
+
<div class="${ctx.prefix}-annotation-item-header">
|
|
49562
|
+
<span class="${ctx.prefix}-annotation-marker" style="${markerStyle}">${node.number}</span>
|
|
49563
|
+
<span class="${ctx.prefix}-annotation-item-title">${ctx.escapeHtml(node.title)}</span>
|
|
49564
|
+
</div>
|
|
49565
|
+
${content ? `<div class="${ctx.prefix}-annotation-item-content">${content}</div>` : ""}
|
|
49566
|
+
</div>`;
|
|
49567
|
+
}
|
|
49568
|
+
|
|
49274
49569
|
// src/renderer/html/index.ts
|
|
49275
49570
|
var SPACING_TOKENS = {
|
|
49276
49571
|
0: "0px",
|
|
@@ -49357,6 +49652,8 @@ var HtmlRenderer = class extends BaseRenderer {
|
|
|
49357
49652
|
// Grid nodes
|
|
49358
49653
|
Row: (node) => this.renderRow(node),
|
|
49359
49654
|
Col: (node) => this.renderCol(node),
|
|
49655
|
+
Stack: (node) => this.renderStack(node),
|
|
49656
|
+
Relative: (node) => this.renderRelative(node),
|
|
49360
49657
|
// Container nodes
|
|
49361
49658
|
Card: (node) => this.renderCard(node),
|
|
49362
49659
|
Modal: (node) => this.renderModal(node),
|
|
@@ -49399,7 +49696,11 @@ var HtmlRenderer = class extends BaseRenderer {
|
|
|
49399
49696
|
Tabs: (node) => this.renderTabs(node),
|
|
49400
49697
|
Breadcrumb: (node) => this.renderBreadcrumb(node),
|
|
49401
49698
|
// Other
|
|
49402
|
-
Divider: (node) => this.renderDivider(node)
|
|
49699
|
+
Divider: (node) => this.renderDivider(node),
|
|
49700
|
+
// Annotation nodes
|
|
49701
|
+
Marker: (node) => this.renderMarker(node),
|
|
49702
|
+
Annotations: (node) => this.renderAnnotations(node),
|
|
49703
|
+
AnnotationItem: (node) => this.renderAnnotationItem(node)
|
|
49403
49704
|
};
|
|
49404
49705
|
}
|
|
49405
49706
|
/**
|
|
@@ -49516,6 +49817,12 @@ ${title}${children}
|
|
|
49516
49817
|
renderCol(node) {
|
|
49517
49818
|
return renderCol(node, this.getGridRenderContext());
|
|
49518
49819
|
}
|
|
49820
|
+
renderStack(node) {
|
|
49821
|
+
return renderStack(node, this.getRenderContext());
|
|
49822
|
+
}
|
|
49823
|
+
renderRelative(node) {
|
|
49824
|
+
return renderRelative(node, this.getRenderContext());
|
|
49825
|
+
}
|
|
49519
49826
|
/**
|
|
49520
49827
|
* Build common inline styles for all values
|
|
49521
49828
|
*
|
|
@@ -49678,6 +49985,9 @@ ${title}${children}
|
|
|
49678
49985
|
if (commonStyles) {
|
|
49679
49986
|
styles.push(commonStyles);
|
|
49680
49987
|
}
|
|
49988
|
+
if (node.w !== void 0 && node.flex === void 0) {
|
|
49989
|
+
styles.push("flex: none");
|
|
49990
|
+
}
|
|
49681
49991
|
if (node.order !== void 0) {
|
|
49682
49992
|
styles.push(`order: ${node.order}`);
|
|
49683
49993
|
}
|
|
@@ -49812,6 +50122,18 @@ ${title}${children}
|
|
|
49812
50122
|
renderDivider(node) {
|
|
49813
50123
|
return renderDivider(node, this.getRenderContext());
|
|
49814
50124
|
}
|
|
50125
|
+
// ===========================================
|
|
50126
|
+
// Annotation Renderers
|
|
50127
|
+
// ===========================================
|
|
50128
|
+
renderMarker(node) {
|
|
50129
|
+
return renderMarker(node, this.getRenderContext());
|
|
50130
|
+
}
|
|
50131
|
+
renderAnnotations(node) {
|
|
50132
|
+
return renderAnnotations(node, this.getRenderContext());
|
|
50133
|
+
}
|
|
50134
|
+
renderAnnotationItem(node) {
|
|
50135
|
+
return renderAnnotationItem(node, this.getRenderContext());
|
|
50136
|
+
}
|
|
49815
50137
|
};
|
|
49816
50138
|
function createHtmlRenderer(options) {
|
|
49817
50139
|
return new HtmlRenderer(options);
|
|
@@ -169,6 +169,36 @@ interface ColNode extends BaseNode, CommonProps {
|
|
|
169
169
|
scroll?: boolean;
|
|
170
170
|
children: AnyNode[];
|
|
171
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Stack - Vertical content grouping container
|
|
174
|
+
*
|
|
175
|
+
* Unlike Col which fills available space (flex: 1),
|
|
176
|
+
* Stack only takes up the space needed by its content (flex: 0 0 auto).
|
|
177
|
+
*
|
|
178
|
+
* Use cases:
|
|
179
|
+
* - Grouping form fields vertically
|
|
180
|
+
* - Card content layout
|
|
181
|
+
* - Centering content with justify/align
|
|
182
|
+
*/
|
|
183
|
+
interface StackNode extends BaseNode, CommonProps {
|
|
184
|
+
type: 'Stack';
|
|
185
|
+
children: AnyNode[];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Relative - Position children with absolute positioning
|
|
189
|
+
*
|
|
190
|
+
* Creates a position: relative container.
|
|
191
|
+
* First child is the base element, subsequent children are overlaid on top.
|
|
192
|
+
* Child elements can use `anchor` attribute to specify position:
|
|
193
|
+
* - top-left, top-center, top-right
|
|
194
|
+
* - center-left, center, center-right
|
|
195
|
+
* - bottom-left, bottom-center, bottom-right
|
|
196
|
+
*/
|
|
197
|
+
interface RelativeNode extends BaseNode, CommonProps {
|
|
198
|
+
type: 'Relative';
|
|
199
|
+
children: AnyNode[];
|
|
200
|
+
}
|
|
201
|
+
type AnchorPosition = 'top-left' | 'top-center' | 'top-right' | 'center-left' | 'center' | 'center-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
172
202
|
type ShadowValue = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
173
203
|
interface CardNode extends BaseNode, CommonProps, InteractiveProps {
|
|
174
204
|
type: 'Card';
|
|
@@ -330,6 +360,8 @@ interface BadgeNode extends BaseNode, CommonProps, InteractiveProps {
|
|
|
330
360
|
pill?: boolean;
|
|
331
361
|
icon?: string;
|
|
332
362
|
size?: BadgeSize;
|
|
363
|
+
/** Anchor position when inside an overlay container */
|
|
364
|
+
anchor?: AnchorPosition;
|
|
333
365
|
}
|
|
334
366
|
type IconSizeToken = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
335
367
|
type IconSize = IconSizeToken | number | ValueWithUnit;
|
|
@@ -474,8 +506,75 @@ interface BreadcrumbNode extends BaseNode, CommonProps {
|
|
|
474
506
|
interface DividerComponentNode extends BaseNode, CommonProps {
|
|
475
507
|
type: 'Divider';
|
|
476
508
|
}
|
|
509
|
+
type MarkerColor = 'blue' | 'red' | 'green' | 'yellow' | 'purple' | 'orange';
|
|
510
|
+
/**
|
|
511
|
+
* Marker - Number marker for referencing in annotations
|
|
512
|
+
*
|
|
513
|
+
* Displays a numbered circle that can be placed on UI elements.
|
|
514
|
+
* Recommended to use inside `relative` with `anchor` for positioning outside the UI.
|
|
515
|
+
*
|
|
516
|
+
* Example:
|
|
517
|
+
* ```wireframe
|
|
518
|
+
* relative {
|
|
519
|
+
* button "Submit"
|
|
520
|
+
* marker 1 anchor=top-right
|
|
521
|
+
* }
|
|
522
|
+
* ```
|
|
523
|
+
*/
|
|
524
|
+
interface MarkerNode extends BaseNode, CommonProps {
|
|
525
|
+
type: 'Marker';
|
|
526
|
+
/** The marker number (1, 2, 3, ...) */
|
|
527
|
+
number: number;
|
|
528
|
+
/** Marker color */
|
|
529
|
+
color?: MarkerColor;
|
|
530
|
+
/** Anchor position when inside a relative container */
|
|
531
|
+
anchor?: AnchorPosition;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Annotations - Documentation panel for screen specifications
|
|
535
|
+
*
|
|
536
|
+
* Container for annotation items that describe UI elements.
|
|
537
|
+
* Visually distinct from wireframe UI with dashed border and different background.
|
|
538
|
+
* Rendered with data-role="documentation" for LLM recognition.
|
|
539
|
+
*
|
|
540
|
+
* Example:
|
|
541
|
+
* ```wireframe
|
|
542
|
+
* annotations title="화면 설명" {
|
|
543
|
+
* item 1 "이메일 입력" { text "유효성 검사 적용" }
|
|
544
|
+
* item 2 "로그인 버튼" { text "OAuth 연동" }
|
|
545
|
+
* }
|
|
546
|
+
* ```
|
|
547
|
+
*/
|
|
548
|
+
interface AnnotationsNode extends BaseNode, CommonProps {
|
|
549
|
+
type: 'Annotations';
|
|
550
|
+
/** Panel title (default: "화면 설명" or "Annotations") */
|
|
551
|
+
title?: string;
|
|
552
|
+
children: AnnotationItemNode[];
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* AnnotationItem - Individual annotation entry
|
|
556
|
+
*
|
|
557
|
+
* Represents a single annotation with a marker number, title, and description content.
|
|
558
|
+
*
|
|
559
|
+
* Example:
|
|
560
|
+
* ```wireframe
|
|
561
|
+
* item 1 "이메일 입력" {
|
|
562
|
+
* text "- 유효성 검사 적용"
|
|
563
|
+
* text "- 최대 255자"
|
|
564
|
+
* }
|
|
565
|
+
* ```
|
|
566
|
+
*/
|
|
567
|
+
interface AnnotationItemNode extends BaseNode {
|
|
568
|
+
type: 'AnnotationItem';
|
|
569
|
+
/** The marker number this item references */
|
|
570
|
+
number: number;
|
|
571
|
+
/** Item title */
|
|
572
|
+
title: string;
|
|
573
|
+
/** Description content (Text nodes) */
|
|
574
|
+
children: AnyNode[];
|
|
575
|
+
}
|
|
477
576
|
type LayoutNode = PageNode | HeaderNode | MainNode | FooterNode | SidebarNode | SectionNode;
|
|
478
|
-
type GridNode = RowNode | ColNode;
|
|
577
|
+
type GridNode = RowNode | ColNode | StackNode | RelativeNode;
|
|
479
578
|
type ContainerComponentNode = CardNode | ModalNode | DrawerNode | AccordionNode;
|
|
480
579
|
type TextContentNode = TextNode | TitleNode | LinkNode;
|
|
481
580
|
type InputComponentNode = InputNode | TextareaNode | SelectNode | CheckboxNode | RadioNode | SwitchNode | SliderNode;
|
|
@@ -484,9 +583,10 @@ type DataNode = TableNode | ListNode;
|
|
|
484
583
|
type FeedbackNode = AlertNode | ToastNode | ProgressNode | SpinnerNode;
|
|
485
584
|
type OverlayNode = TooltipNode | PopoverNode | DropdownNode;
|
|
486
585
|
type NavigationNode = NavNode | TabsNode | BreadcrumbNode;
|
|
487
|
-
type
|
|
488
|
-
type
|
|
586
|
+
type AnnotationNode = MarkerNode | AnnotationsNode | AnnotationItemNode;
|
|
587
|
+
type ContainerNode = LayoutNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode;
|
|
588
|
+
type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode | DataNode | FeedbackNode | DropdownNode | NavigationNode | DividerComponentNode | MarkerNode;
|
|
489
589
|
type AnyNode = ContainerNode | LeafNode;
|
|
490
|
-
type NodeType = 'Document' | 'Page' | 'Header' | 'Main' | 'Footer' | 'Sidebar' | 'Section' | 'Row' | 'Col' | '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';
|
|
590
|
+
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';
|
|
491
591
|
|
|
492
|
-
export type { ToastNode as $, AnyNode as A, BadgeNode as B, CardNode as C, DataNode as D, RowNode as E, FeedbackNode as F, GridNode as G, HeaderNode as H, IconNode as I, SelectNode as J, SidebarNode as K, LayoutNode as L, MainNode as M, NavNode as N, OverlayNode as O, PageNode as P, SliderNode as Q, RadioNode as R, SectionNode as S, SpinnerNode as T, SwitchNode as U, TableNode as V, TabsNode as W, TextContentNode as X, TextNode as Y, TextareaNode as Z, TitleNode as _, AccordionNode as a, TooltipNode as a0, WireframeDocument as a1, AlertVariant as a2, AlignValue as a3,
|
|
592
|
+
export type { ToastNode as $, AnyNode as A, BadgeNode as B, CardNode as C, DataNode as D, RowNode as E, FeedbackNode as F, GridNode as G, HeaderNode as H, IconNode as I, SelectNode as J, SidebarNode as K, LayoutNode as L, MainNode as M, NavNode as N, OverlayNode as O, PageNode as P, SliderNode as Q, RadioNode as R, SectionNode as S, SpinnerNode as T, SwitchNode as U, TableNode as V, TabsNode as W, TextContentNode as X, TextNode as Y, TextareaNode as Z, TitleNode as _, AccordionNode as a, TooltipNode as a0, WireframeDocument as a1, AlertVariant as a2, AlignValue as a3, AnchorPosition as a4, AnnotationItemNode as a5, AnnotationNode as a6, AnnotationsNode as a7, AppearanceProps as a8, AvatarSize as a9, NavChild as aA, NavDivider as aB, NavGroupNode as aC, NavItem as aD, Position as aE, PositionProps as aF, RelativeNode as aG, SelectOption as aH, ShadowValue as aI, SizeProps as aJ, SourceLocation as aK, SpacingProps as aL, SpacingValue as aM, SpinnerSize as aN, SpinnerSizeToken as aO, StackNode as aP, TabNode as aQ, TextAlign as aR, TextSize as aS, TextSizeToken as aT, TextWeight as aU, TitleLevel as aV, ToastPosition as aW, TooltipPosition as aX, ValueWithUnit as aY, WidthValue as aZ, AvatarSizeToken as aa, BadgeSize as ab, BadgeSizeToken as ac, BadgeVariant as ad, BaseNode as ae, BreadcrumbItem as af, ButtonSize as ag, ButtonSizeToken as ah, ButtonVariant as ai, CommonProps as aj, DirectionValue as ak, DividerNode as al, DrawerPosition as am, DropdownItemNode as an, FlexProps as ao, GridProps as ap, HeightValue as aq, IconSize as ar, IconSizeToken as as, InputType as at, InteractiveProps as au, JustifyValue as av, ListItemNode as aw, MarkerColor as ax, MarkerNode as ay, NavBlockItem as az, AlertNode as b, AvatarNode as c, BreadcrumbNode as d, ButtonNode as e, CheckboxNode as f, ColNode as g, ContainerComponentNode as h, ContainerNode as i, DisplayNode as j, DividerComponentNode as k, DrawerNode as l, DropdownNode as m, FooterNode as n, ImageNode as o, InputComponentNode as p, InputNode as q, LeafNode as r, LinkNode as s, ListNode as t, ModalNode as u, NavigationNode as v, NodeType as w, PlaceholderNode as x, PopoverNode as y, ProgressNode as z };
|