@wireweave/core 3.1.0-beta.5 → 3.1.0-beta.7
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 +1055 -827
- package/dist/index.d.cts +128 -3
- package/dist/index.d.ts +128 -3
- package/dist/index.js +1050 -827
- package/dist/parser.cjs +888 -801
- package/dist/parser.d.cts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/parser.js +888 -801
- package/dist/renderer.cjs +85 -0
- package/dist/renderer.d.cts +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.js +85 -0
- package/dist/spec.cjs +8 -0
- package/dist/spec.d.cts +2 -1
- package/dist/spec.d.ts +2 -1
- package/dist/spec.js +8 -0
- package/dist/{types-BiDAgo6f.d.cts → types-BphXi5Tn.d.cts} +21 -3
- package/dist/{types-BiDAgo6f.d.ts → types-BphXi5Tn.d.ts} +21 -3
- package/package.json +1 -1
package/dist/renderer.cjs
CHANGED
|
@@ -2331,6 +2331,82 @@ function buildAnchorPathMap(doc, pageIndexBase = 0) {
|
|
|
2331
2331
|
return map;
|
|
2332
2332
|
}
|
|
2333
2333
|
|
|
2334
|
+
// src/ast/expand-repeats.ts
|
|
2335
|
+
var REPEAT_EXPANSION_BUDGET = 500;
|
|
2336
|
+
var RepeatBudgetError = class extends Error {
|
|
2337
|
+
constructor(budget) {
|
|
2338
|
+
super(
|
|
2339
|
+
`repeat expansion exceeds ${budget} nodes \u2014 nesting multiplies, so check the nested counts rather than the outermost one`
|
|
2340
|
+
);
|
|
2341
|
+
this.name = "RepeatBudgetError";
|
|
2342
|
+
}
|
|
2343
|
+
};
|
|
2344
|
+
function cloneNode(value) {
|
|
2345
|
+
if (Array.isArray(value)) return value.map(cloneNode);
|
|
2346
|
+
if (value === null || typeof value !== "object") return value;
|
|
2347
|
+
const source = value;
|
|
2348
|
+
const result = {};
|
|
2349
|
+
for (const [key, item] of Object.entries(source)) {
|
|
2350
|
+
result[key] = key === "loc" ? item : cloneNode(item);
|
|
2351
|
+
}
|
|
2352
|
+
return result;
|
|
2353
|
+
}
|
|
2354
|
+
function containsRepeat(node) {
|
|
2355
|
+
if (node.type === "Repeat") return true;
|
|
2356
|
+
const children = node.children;
|
|
2357
|
+
if (Array.isArray(children)) {
|
|
2358
|
+
for (const child of children) if (containsRepeat(child)) return true;
|
|
2359
|
+
}
|
|
2360
|
+
const fills = node.fills;
|
|
2361
|
+
if (Array.isArray(fills)) {
|
|
2362
|
+
for (const fill of fills) {
|
|
2363
|
+
for (const child of fill.children ?? []) if (containsRepeat(child)) return true;
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
return false;
|
|
2367
|
+
}
|
|
2368
|
+
function expandOne(node, budget) {
|
|
2369
|
+
if (node.type === "Repeat") {
|
|
2370
|
+
const repeat = node;
|
|
2371
|
+
const count = Number.isInteger(repeat.count) && repeat.count > 0 ? repeat.count : 0;
|
|
2372
|
+
const result = [];
|
|
2373
|
+
for (let i = 0; i < count; i++) {
|
|
2374
|
+
for (const child of repeat.children) {
|
|
2375
|
+
for (const expanded of expandOne(child, budget)) {
|
|
2376
|
+
budget.remaining -= 1;
|
|
2377
|
+
if (budget.remaining < 0) throw new RepeatBudgetError(REPEAT_EXPANSION_BUDGET);
|
|
2378
|
+
result.push(cloneNode(expanded));
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
return result;
|
|
2383
|
+
}
|
|
2384
|
+
if (!containsRepeat(node)) return [node];
|
|
2385
|
+
const clone = { ...node };
|
|
2386
|
+
const children = clone.children;
|
|
2387
|
+
if (Array.isArray(children)) {
|
|
2388
|
+
clone.children = children.flatMap((child) => expandOne(child, budget));
|
|
2389
|
+
}
|
|
2390
|
+
const fills = clone.fills;
|
|
2391
|
+
if (Array.isArray(fills)) {
|
|
2392
|
+
clone.fills = fills.map((fill) => ({
|
|
2393
|
+
...fill,
|
|
2394
|
+
children: (fill.children ?? []).flatMap((child) => expandOne(child, budget))
|
|
2395
|
+
}));
|
|
2396
|
+
}
|
|
2397
|
+
return [clone];
|
|
2398
|
+
}
|
|
2399
|
+
function expandRepeats(document) {
|
|
2400
|
+
if (!document.children.some((child) => containsRepeat(child))) return document;
|
|
2401
|
+
const budget = { remaining: REPEAT_EXPANSION_BUDGET };
|
|
2402
|
+
return {
|
|
2403
|
+
...document,
|
|
2404
|
+
children: document.children.flatMap(
|
|
2405
|
+
(child) => expandOne(child, budget)
|
|
2406
|
+
)
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2334
2410
|
// src/spec/grammar-elements.generated.ts
|
|
2335
2411
|
var GRAMMAR_ELEMENTS = {
|
|
2336
2412
|
page: "Page",
|
|
@@ -2338,6 +2414,7 @@ var GRAMMAR_ELEMENTS = {
|
|
|
2338
2414
|
component: "Component",
|
|
2339
2415
|
use: "ComponentUse",
|
|
2340
2416
|
slot: "Slot",
|
|
2417
|
+
repeat: "Repeat",
|
|
2341
2418
|
header: "Header",
|
|
2342
2419
|
main: "Main",
|
|
2343
2420
|
footer: "Footer",
|
|
@@ -2848,6 +2925,12 @@ var COMPONENT_METADATA = {
|
|
|
2848
2925
|
hasChildren: false,
|
|
2849
2926
|
description: "Mark content insertion: bare inside a layout, or named inside a reusable component."
|
|
2850
2927
|
},
|
|
2928
|
+
repeat: {
|
|
2929
|
+
category: "structure",
|
|
2930
|
+
attributes: [],
|
|
2931
|
+
hasChildren: true,
|
|
2932
|
+
description: "Draw the same body a fixed number of times: `repeat 6 { use skeletonCard() }`. The count is positional, and there is deliberately no index variable \u2014 every copy is identical, because copies that differ are data binding rather than a wireframe."
|
|
2933
|
+
},
|
|
2851
2934
|
header: {
|
|
2852
2935
|
category: "layout",
|
|
2853
2936
|
attributes: [...BOX_ATTRIBUTES, ...CONTAINER_ATTRIBUTES],
|
|
@@ -51360,6 +51443,7 @@ var HtmlRenderer = class extends BaseRenderer {
|
|
|
51360
51443
|
* enabled so `renderNode` / `renderPage` can inject each node's path.
|
|
51361
51444
|
*/
|
|
51362
51445
|
render(document) {
|
|
51446
|
+
document = expandRepeats(document);
|
|
51363
51447
|
if (this.context.options.sourceAnchors) {
|
|
51364
51448
|
this.pathMap = buildAnchorPathMap(document, this.pageIndexBase);
|
|
51365
51449
|
}
|
|
@@ -52708,6 +52792,7 @@ function compactRuntimeInteractions(model, interactions) {
|
|
|
52708
52792
|
}
|
|
52709
52793
|
function renderSite(document, options = {}) {
|
|
52710
52794
|
const prefix = options.classPrefix ?? DEFAULT_PREFIX2;
|
|
52795
|
+
document = expandRepeats(document);
|
|
52711
52796
|
const model = buildSiteModel(document);
|
|
52712
52797
|
const interactionModel = collectInteractions(document);
|
|
52713
52798
|
const make = (idScope) => new HtmlRenderer({
|
package/dist/renderer.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bd as WireframeDocument, h as AnyNode, as as PageNode, H as ComponentUseNode, aa as LayoutDefinitionNode, a8 as InteractiveProps, Y as GuardedOutcomeProps } from './types-BphXi5Tn.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Renderer type definitions for wireweave
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bd as WireframeDocument, h as AnyNode, as as PageNode, H as ComponentUseNode, aa as LayoutDefinitionNode, a8 as InteractiveProps, Y as GuardedOutcomeProps } from './types-BphXi5Tn.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Renderer type definitions for wireweave
|
package/dist/renderer.js
CHANGED
|
@@ -2277,6 +2277,82 @@ function buildAnchorPathMap(doc, pageIndexBase = 0) {
|
|
|
2277
2277
|
return map;
|
|
2278
2278
|
}
|
|
2279
2279
|
|
|
2280
|
+
// src/ast/expand-repeats.ts
|
|
2281
|
+
var REPEAT_EXPANSION_BUDGET = 500;
|
|
2282
|
+
var RepeatBudgetError = class extends Error {
|
|
2283
|
+
constructor(budget) {
|
|
2284
|
+
super(
|
|
2285
|
+
`repeat expansion exceeds ${budget} nodes \u2014 nesting multiplies, so check the nested counts rather than the outermost one`
|
|
2286
|
+
);
|
|
2287
|
+
this.name = "RepeatBudgetError";
|
|
2288
|
+
}
|
|
2289
|
+
};
|
|
2290
|
+
function cloneNode(value) {
|
|
2291
|
+
if (Array.isArray(value)) return value.map(cloneNode);
|
|
2292
|
+
if (value === null || typeof value !== "object") return value;
|
|
2293
|
+
const source = value;
|
|
2294
|
+
const result = {};
|
|
2295
|
+
for (const [key, item] of Object.entries(source)) {
|
|
2296
|
+
result[key] = key === "loc" ? item : cloneNode(item);
|
|
2297
|
+
}
|
|
2298
|
+
return result;
|
|
2299
|
+
}
|
|
2300
|
+
function containsRepeat(node) {
|
|
2301
|
+
if (node.type === "Repeat") return true;
|
|
2302
|
+
const children = node.children;
|
|
2303
|
+
if (Array.isArray(children)) {
|
|
2304
|
+
for (const child of children) if (containsRepeat(child)) return true;
|
|
2305
|
+
}
|
|
2306
|
+
const fills = node.fills;
|
|
2307
|
+
if (Array.isArray(fills)) {
|
|
2308
|
+
for (const fill of fills) {
|
|
2309
|
+
for (const child of fill.children ?? []) if (containsRepeat(child)) return true;
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
return false;
|
|
2313
|
+
}
|
|
2314
|
+
function expandOne(node, budget) {
|
|
2315
|
+
if (node.type === "Repeat") {
|
|
2316
|
+
const repeat = node;
|
|
2317
|
+
const count = Number.isInteger(repeat.count) && repeat.count > 0 ? repeat.count : 0;
|
|
2318
|
+
const result = [];
|
|
2319
|
+
for (let i = 0; i < count; i++) {
|
|
2320
|
+
for (const child of repeat.children) {
|
|
2321
|
+
for (const expanded of expandOne(child, budget)) {
|
|
2322
|
+
budget.remaining -= 1;
|
|
2323
|
+
if (budget.remaining < 0) throw new RepeatBudgetError(REPEAT_EXPANSION_BUDGET);
|
|
2324
|
+
result.push(cloneNode(expanded));
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
return result;
|
|
2329
|
+
}
|
|
2330
|
+
if (!containsRepeat(node)) return [node];
|
|
2331
|
+
const clone = { ...node };
|
|
2332
|
+
const children = clone.children;
|
|
2333
|
+
if (Array.isArray(children)) {
|
|
2334
|
+
clone.children = children.flatMap((child) => expandOne(child, budget));
|
|
2335
|
+
}
|
|
2336
|
+
const fills = clone.fills;
|
|
2337
|
+
if (Array.isArray(fills)) {
|
|
2338
|
+
clone.fills = fills.map((fill) => ({
|
|
2339
|
+
...fill,
|
|
2340
|
+
children: (fill.children ?? []).flatMap((child) => expandOne(child, budget))
|
|
2341
|
+
}));
|
|
2342
|
+
}
|
|
2343
|
+
return [clone];
|
|
2344
|
+
}
|
|
2345
|
+
function expandRepeats(document) {
|
|
2346
|
+
if (!document.children.some((child) => containsRepeat(child))) return document;
|
|
2347
|
+
const budget = { remaining: REPEAT_EXPANSION_BUDGET };
|
|
2348
|
+
return {
|
|
2349
|
+
...document,
|
|
2350
|
+
children: document.children.flatMap(
|
|
2351
|
+
(child) => expandOne(child, budget)
|
|
2352
|
+
)
|
|
2353
|
+
};
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2280
2356
|
// src/spec/grammar-elements.generated.ts
|
|
2281
2357
|
var GRAMMAR_ELEMENTS = {
|
|
2282
2358
|
page: "Page",
|
|
@@ -2284,6 +2360,7 @@ var GRAMMAR_ELEMENTS = {
|
|
|
2284
2360
|
component: "Component",
|
|
2285
2361
|
use: "ComponentUse",
|
|
2286
2362
|
slot: "Slot",
|
|
2363
|
+
repeat: "Repeat",
|
|
2287
2364
|
header: "Header",
|
|
2288
2365
|
main: "Main",
|
|
2289
2366
|
footer: "Footer",
|
|
@@ -2794,6 +2871,12 @@ var COMPONENT_METADATA = {
|
|
|
2794
2871
|
hasChildren: false,
|
|
2795
2872
|
description: "Mark content insertion: bare inside a layout, or named inside a reusable component."
|
|
2796
2873
|
},
|
|
2874
|
+
repeat: {
|
|
2875
|
+
category: "structure",
|
|
2876
|
+
attributes: [],
|
|
2877
|
+
hasChildren: true,
|
|
2878
|
+
description: "Draw the same body a fixed number of times: `repeat 6 { use skeletonCard() }`. The count is positional, and there is deliberately no index variable \u2014 every copy is identical, because copies that differ are data binding rather than a wireframe."
|
|
2879
|
+
},
|
|
2797
2880
|
header: {
|
|
2798
2881
|
category: "layout",
|
|
2799
2882
|
attributes: [...BOX_ATTRIBUTES, ...CONTAINER_ATTRIBUTES],
|
|
@@ -51306,6 +51389,7 @@ var HtmlRenderer = class extends BaseRenderer {
|
|
|
51306
51389
|
* enabled so `renderNode` / `renderPage` can inject each node's path.
|
|
51307
51390
|
*/
|
|
51308
51391
|
render(document) {
|
|
51392
|
+
document = expandRepeats(document);
|
|
51309
51393
|
if (this.context.options.sourceAnchors) {
|
|
51310
51394
|
this.pathMap = buildAnchorPathMap(document, this.pageIndexBase);
|
|
51311
51395
|
}
|
|
@@ -52654,6 +52738,7 @@ function compactRuntimeInteractions(model, interactions) {
|
|
|
52654
52738
|
}
|
|
52655
52739
|
function renderSite(document, options = {}) {
|
|
52656
52740
|
const prefix = options.classPrefix ?? DEFAULT_PREFIX2;
|
|
52741
|
+
document = expandRepeats(document);
|
|
52657
52742
|
const model = buildSiteModel(document);
|
|
52658
52743
|
const interactionModel = collectInteractions(document);
|
|
52659
52744
|
const make = (idScope) => new HtmlRenderer({
|
package/dist/spec.cjs
CHANGED
|
@@ -52,6 +52,7 @@ var GRAMMAR_ELEMENTS = {
|
|
|
52
52
|
component: "Component",
|
|
53
53
|
use: "ComponentUse",
|
|
54
54
|
slot: "Slot",
|
|
55
|
+
repeat: "Repeat",
|
|
55
56
|
header: "Header",
|
|
56
57
|
main: "Main",
|
|
57
58
|
footer: "Footer",
|
|
@@ -151,6 +152,7 @@ var GRAMMAR_CHILD_KEYWORDS = [
|
|
|
151
152
|
"group",
|
|
152
153
|
"marker",
|
|
153
154
|
"annotations",
|
|
155
|
+
"repeat",
|
|
154
156
|
"layout",
|
|
155
157
|
"component",
|
|
156
158
|
"use",
|
|
@@ -2313,6 +2315,12 @@ var COMPONENT_METADATA = {
|
|
|
2313
2315
|
hasChildren: false,
|
|
2314
2316
|
description: "Mark content insertion: bare inside a layout, or named inside a reusable component."
|
|
2315
2317
|
},
|
|
2318
|
+
repeat: {
|
|
2319
|
+
category: "structure",
|
|
2320
|
+
attributes: [],
|
|
2321
|
+
hasChildren: true,
|
|
2322
|
+
description: "Draw the same body a fixed number of times: `repeat 6 { use skeletonCard() }`. The count is positional, and there is deliberately no index variable \u2014 every copy is identical, because copies that differ are data binding rather than a wireframe."
|
|
2323
|
+
},
|
|
2316
2324
|
header: {
|
|
2317
2325
|
category: "layout",
|
|
2318
2326
|
attributes: [...BOX_ATTRIBUTES, ...CONTAINER_ATTRIBUTES],
|
package/dist/spec.d.cts
CHANGED
|
@@ -12,6 +12,7 @@ declare const GRAMMAR_ELEMENTS: {
|
|
|
12
12
|
readonly component: "Component";
|
|
13
13
|
readonly use: "ComponentUse";
|
|
14
14
|
readonly slot: "Slot";
|
|
15
|
+
readonly repeat: "Repeat";
|
|
15
16
|
readonly header: "Header";
|
|
16
17
|
readonly main: "Main";
|
|
17
18
|
readonly footer: "Footer";
|
|
@@ -82,7 +83,7 @@ type GrammarBlockNodeType = (typeof GRAMMAR_BLOCK_NODE_TYPES)[number];
|
|
|
82
83
|
* elements of their own, and omits element keywords that are deliberately
|
|
83
84
|
* context-sensitive (`title`, `placeholder`, `icon` double as attribute names).
|
|
84
85
|
*/
|
|
85
|
-
declare const GRAMMAR_CHILD_KEYWORDS: readonly ["page", "header", "main", "footer", "sidebar", "row", "col", "stack", "relative", "card", "modal", "drawer", "accordion", "section", "text", "link", "button", "input", "textarea", "select", "checkbox", "radio", "switch", "slider", "image", "avatar", "badge", "table", "columns", "list", "item", "alert", "toast", "progress", "spinner", "tooltip", "popover", "dropdown", "divider", "nav", "tabs", "tab", "breadcrumb", "group", "marker", "annotations", "layout", "component", "use", "fill", "slot"];
|
|
86
|
+
declare const GRAMMAR_CHILD_KEYWORDS: readonly ["page", "header", "main", "footer", "sidebar", "row", "col", "stack", "relative", "card", "modal", "drawer", "accordion", "section", "text", "link", "button", "input", "textarea", "select", "checkbox", "radio", "switch", "slider", "image", "avatar", "badge", "table", "columns", "list", "item", "alert", "toast", "progress", "spinner", "tooltip", "popover", "dropdown", "divider", "nav", "tabs", "tab", "breadcrumb", "group", "marker", "annotations", "repeat", "layout", "component", "use", "fill", "slot"];
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
89
|
* GENERATED FILE — DO NOT EDIT.
|
package/dist/spec.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare const GRAMMAR_ELEMENTS: {
|
|
|
12
12
|
readonly component: "Component";
|
|
13
13
|
readonly use: "ComponentUse";
|
|
14
14
|
readonly slot: "Slot";
|
|
15
|
+
readonly repeat: "Repeat";
|
|
15
16
|
readonly header: "Header";
|
|
16
17
|
readonly main: "Main";
|
|
17
18
|
readonly footer: "Footer";
|
|
@@ -82,7 +83,7 @@ type GrammarBlockNodeType = (typeof GRAMMAR_BLOCK_NODE_TYPES)[number];
|
|
|
82
83
|
* elements of their own, and omits element keywords that are deliberately
|
|
83
84
|
* context-sensitive (`title`, `placeholder`, `icon` double as attribute names).
|
|
84
85
|
*/
|
|
85
|
-
declare const GRAMMAR_CHILD_KEYWORDS: readonly ["page", "header", "main", "footer", "sidebar", "row", "col", "stack", "relative", "card", "modal", "drawer", "accordion", "section", "text", "link", "button", "input", "textarea", "select", "checkbox", "radio", "switch", "slider", "image", "avatar", "badge", "table", "columns", "list", "item", "alert", "toast", "progress", "spinner", "tooltip", "popover", "dropdown", "divider", "nav", "tabs", "tab", "breadcrumb", "group", "marker", "annotations", "layout", "component", "use", "fill", "slot"];
|
|
86
|
+
declare const GRAMMAR_CHILD_KEYWORDS: readonly ["page", "header", "main", "footer", "sidebar", "row", "col", "stack", "relative", "card", "modal", "drawer", "accordion", "section", "text", "link", "button", "input", "textarea", "select", "checkbox", "radio", "switch", "slider", "image", "avatar", "badge", "table", "columns", "list", "item", "alert", "toast", "progress", "spinner", "tooltip", "popover", "dropdown", "divider", "nav", "tabs", "tab", "breadcrumb", "group", "marker", "annotations", "repeat", "layout", "component", "use", "fill", "slot"];
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
89
|
* GENERATED FILE — DO NOT EDIT.
|
package/dist/spec.js
CHANGED
|
@@ -5,6 +5,7 @@ var GRAMMAR_ELEMENTS = {
|
|
|
5
5
|
component: "Component",
|
|
6
6
|
use: "ComponentUse",
|
|
7
7
|
slot: "Slot",
|
|
8
|
+
repeat: "Repeat",
|
|
8
9
|
header: "Header",
|
|
9
10
|
main: "Main",
|
|
10
11
|
footer: "Footer",
|
|
@@ -104,6 +105,7 @@ var GRAMMAR_CHILD_KEYWORDS = [
|
|
|
104
105
|
"group",
|
|
105
106
|
"marker",
|
|
106
107
|
"annotations",
|
|
108
|
+
"repeat",
|
|
107
109
|
"layout",
|
|
108
110
|
"component",
|
|
109
111
|
"use",
|
|
@@ -2266,6 +2268,12 @@ var COMPONENT_METADATA = {
|
|
|
2266
2268
|
hasChildren: false,
|
|
2267
2269
|
description: "Mark content insertion: bare inside a layout, or named inside a reusable component."
|
|
2268
2270
|
},
|
|
2271
|
+
repeat: {
|
|
2272
|
+
category: "structure",
|
|
2273
|
+
attributes: [],
|
|
2274
|
+
hasChildren: true,
|
|
2275
|
+
description: "Draw the same body a fixed number of times: `repeat 6 { use skeletonCard() }`. The count is positional, and there is deliberately no index variable \u2014 every copy is identical, because copies that differ are data binding rather than a wireframe."
|
|
2276
|
+
},
|
|
2269
2277
|
header: {
|
|
2270
2278
|
category: "layout",
|
|
2271
2279
|
attributes: [...BOX_ATTRIBUTES, ...CONTAINER_ATTRIBUTES],
|
|
@@ -349,6 +349,24 @@ interface SectionNode extends BaseNode, CommonProps {
|
|
|
349
349
|
expanded?: boolean;
|
|
350
350
|
children: AnyNode[];
|
|
351
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* `repeat N { … }` — the same body drawn `count` times.
|
|
354
|
+
*
|
|
355
|
+
* A folding device, not an expressive one: it carries a count and nothing else,
|
|
356
|
+
* so every copy is identical by construction. There is deliberately no index
|
|
357
|
+
* variable — an index is what lets copies differ, and copies that differ are
|
|
358
|
+
* data binding rather than a wireframe.
|
|
359
|
+
*
|
|
360
|
+
* The node survives into the AST unexpanded so the printer can write
|
|
361
|
+
* `repeat 6` back out. Expansion happens on the way to a rendered tree
|
|
362
|
+
* (`expandRepeats`), never in the parser.
|
|
363
|
+
*/
|
|
364
|
+
interface RepeatNode extends BaseNode {
|
|
365
|
+
type: 'Repeat';
|
|
366
|
+
/** How many times to draw `children`. A non-negative integer; `0` draws nothing. */
|
|
367
|
+
count: number;
|
|
368
|
+
children: AnyNode[];
|
|
369
|
+
}
|
|
352
370
|
interface RowNode extends BaseNode, CommonProps {
|
|
353
371
|
type: 'Row';
|
|
354
372
|
children: AnyNode[];
|
|
@@ -807,9 +825,9 @@ type FeedbackNode = AlertNode | ToastNode | ProgressNode | SpinnerNode;
|
|
|
807
825
|
type OverlayNode = TooltipNode | PopoverNode | DropdownNode;
|
|
808
826
|
type NavigationNode = NavNode | TabsNode | BreadcrumbNode;
|
|
809
827
|
type AnnotationNode = MarkerNode | AnnotationsNode | AnnotationItemNode;
|
|
810
|
-
type ContainerNode = LayoutNode | DefinitionNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode | ComponentUseNode;
|
|
828
|
+
type ContainerNode = LayoutNode | DefinitionNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode | ComponentUseNode | RepeatNode;
|
|
811
829
|
type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode | DataNode | FeedbackNode | DropdownNode | NavigationNode | DividerComponentNode | MarkerNode | SlotNode;
|
|
812
830
|
type AnyNode = ContainerNode | LeafNode;
|
|
813
|
-
type NodeType = 'Document' | 'Page' | 'Layout' | 'Component' | 'ComponentUse' | 'Slot' | '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';
|
|
831
|
+
type NodeType = 'Document' | 'Page' | 'Layout' | 'Component' | 'ComponentUse' | 'Slot' | 'Repeat' | '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';
|
|
814
832
|
|
|
815
|
-
export type { IconNode as $, AccordionNode as A, BadgeNode as B, CardNode as C, ComponentInputValue as D, ComponentParameter as E, ComponentParameterType as F, ComponentSlotFill as G, ComponentUseNode as H, ContainerComponentNode as I, ContainerNode as J, DataNode as K, DefinitionNode as L, DirectionValue as M, DisplayNode as N, DividerComponentNode as O, DrawerNode as P, DrawerPosition as Q, DropdownItemNode as R, DropdownNode as S, FeedbackNode as T, FlexProps as U, FooterNode as V, GridNode as W, GridProps as X, GuardedOutcomeProps as Y, HeaderNode as Z, HeightValue as _, AlertNode as a,
|
|
833
|
+
export type { IconNode as $, AccordionNode as A, BadgeNode as B, CardNode as C, ComponentInputValue as D, ComponentParameter as E, ComponentParameterType as F, ComponentSlotFill as G, ComponentUseNode as H, ContainerComponentNode as I, ContainerNode as J, DataNode as K, DefinitionNode as L, DirectionValue as M, DisplayNode as N, DividerComponentNode as O, DrawerNode as P, DrawerPosition as Q, DropdownItemNode as R, DropdownNode as S, FeedbackNode as T, FlexProps as U, FooterNode as V, GridNode as W, GridProps as X, GuardedOutcomeProps as Y, HeaderNode as Z, HeightValue as _, AlertNode as a, TextNode as a$, IconSize as a0, IconSizeToken as a1, ImageNode as a2, InputComponentNode as a3, InputNode as a4, InputType as a5, InteractionEffect as a6, InteractionHandler as a7, InteractiveProps as a8, JustifyValue as a9, RepeatNode as aA, RowNode as aB, SectionNode as aC, SelectNode as aD, SelectOption as aE, ShadowValue as aF, SidebarNode as aG, SizeProps as aH, SliderNode as aI, SlotNode as aJ, SourceLocation as aK, SpacingProps as aL, SpacingValue as aM, SpinnerNode as aN, SpinnerSize as aO, SpinnerSizeToken as aP, StackNode as aQ, StateDeclaration as aR, StateGuard as aS, StateValue as aT, StateValueType as aU, SwitchNode as aV, TabNode as aW, TableNode as aX, TabsNode as aY, TextAlign as aZ, TextContentNode as a_, LayoutDefinitionNode as aa, LayoutNode as ab, LeafNode as ac, LinkNode as ad, ListItemNode as ae, ListNode as af, MainNode as ag, MarkerColor as ah, MarkerNode as ai, ModalNode as aj, NavBlockItem as ak, NavChild as al, NavGroupNode as am, NavItem as an, NavNode as ao, NavigationNode as ap, NodeType as aq, OverlayNode as ar, PageNode as as, PlaceholderNode as at, PopoverNode as au, Position as av, PositionProps as aw, ProgressNode as ax, RadioNode as ay, RelativeNode as az, AlertVariant as b, TextSize as b0, TextSizeToken as b1, TextWeight as b2, TextareaNode as b3, TitleLevel as b4, TitleNode as b5, ToastNode as b6, ToastPosition as b7, TooltipNode as b8, TooltipPosition as b9, TopLevelNode as ba, ValueWithUnit as bb, WidthValue as bc, WireframeDocument as bd, 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, ComponentDefinitionNode as z };
|
|
@@ -349,6 +349,24 @@ interface SectionNode extends BaseNode, CommonProps {
|
|
|
349
349
|
expanded?: boolean;
|
|
350
350
|
children: AnyNode[];
|
|
351
351
|
}
|
|
352
|
+
/**
|
|
353
|
+
* `repeat N { … }` — the same body drawn `count` times.
|
|
354
|
+
*
|
|
355
|
+
* A folding device, not an expressive one: it carries a count and nothing else,
|
|
356
|
+
* so every copy is identical by construction. There is deliberately no index
|
|
357
|
+
* variable — an index is what lets copies differ, and copies that differ are
|
|
358
|
+
* data binding rather than a wireframe.
|
|
359
|
+
*
|
|
360
|
+
* The node survives into the AST unexpanded so the printer can write
|
|
361
|
+
* `repeat 6` back out. Expansion happens on the way to a rendered tree
|
|
362
|
+
* (`expandRepeats`), never in the parser.
|
|
363
|
+
*/
|
|
364
|
+
interface RepeatNode extends BaseNode {
|
|
365
|
+
type: 'Repeat';
|
|
366
|
+
/** How many times to draw `children`. A non-negative integer; `0` draws nothing. */
|
|
367
|
+
count: number;
|
|
368
|
+
children: AnyNode[];
|
|
369
|
+
}
|
|
352
370
|
interface RowNode extends BaseNode, CommonProps {
|
|
353
371
|
type: 'Row';
|
|
354
372
|
children: AnyNode[];
|
|
@@ -807,9 +825,9 @@ type FeedbackNode = AlertNode | ToastNode | ProgressNode | SpinnerNode;
|
|
|
807
825
|
type OverlayNode = TooltipNode | PopoverNode | DropdownNode;
|
|
808
826
|
type NavigationNode = NavNode | TabsNode | BreadcrumbNode;
|
|
809
827
|
type AnnotationNode = MarkerNode | AnnotationsNode | AnnotationItemNode;
|
|
810
|
-
type ContainerNode = LayoutNode | DefinitionNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode | ComponentUseNode;
|
|
828
|
+
type ContainerNode = LayoutNode | DefinitionNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode | ComponentUseNode | RepeatNode;
|
|
811
829
|
type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode | DataNode | FeedbackNode | DropdownNode | NavigationNode | DividerComponentNode | MarkerNode | SlotNode;
|
|
812
830
|
type AnyNode = ContainerNode | LeafNode;
|
|
813
|
-
type NodeType = 'Document' | 'Page' | 'Layout' | 'Component' | 'ComponentUse' | 'Slot' | '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';
|
|
831
|
+
type NodeType = 'Document' | 'Page' | 'Layout' | 'Component' | 'ComponentUse' | 'Slot' | 'Repeat' | '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';
|
|
814
832
|
|
|
815
|
-
export type { IconNode as $, AccordionNode as A, BadgeNode as B, CardNode as C, ComponentInputValue as D, ComponentParameter as E, ComponentParameterType as F, ComponentSlotFill as G, ComponentUseNode as H, ContainerComponentNode as I, ContainerNode as J, DataNode as K, DefinitionNode as L, DirectionValue as M, DisplayNode as N, DividerComponentNode as O, DrawerNode as P, DrawerPosition as Q, DropdownItemNode as R, DropdownNode as S, FeedbackNode as T, FlexProps as U, FooterNode as V, GridNode as W, GridProps as X, GuardedOutcomeProps as Y, HeaderNode as Z, HeightValue as _, AlertNode as a,
|
|
833
|
+
export type { IconNode as $, AccordionNode as A, BadgeNode as B, CardNode as C, ComponentInputValue as D, ComponentParameter as E, ComponentParameterType as F, ComponentSlotFill as G, ComponentUseNode as H, ContainerComponentNode as I, ContainerNode as J, DataNode as K, DefinitionNode as L, DirectionValue as M, DisplayNode as N, DividerComponentNode as O, DrawerNode as P, DrawerPosition as Q, DropdownItemNode as R, DropdownNode as S, FeedbackNode as T, FlexProps as U, FooterNode as V, GridNode as W, GridProps as X, GuardedOutcomeProps as Y, HeaderNode as Z, HeightValue as _, AlertNode as a, TextNode as a$, IconSize as a0, IconSizeToken as a1, ImageNode as a2, InputComponentNode as a3, InputNode as a4, InputType as a5, InteractionEffect as a6, InteractionHandler as a7, InteractiveProps as a8, JustifyValue as a9, RepeatNode as aA, RowNode as aB, SectionNode as aC, SelectNode as aD, SelectOption as aE, ShadowValue as aF, SidebarNode as aG, SizeProps as aH, SliderNode as aI, SlotNode as aJ, SourceLocation as aK, SpacingProps as aL, SpacingValue as aM, SpinnerNode as aN, SpinnerSize as aO, SpinnerSizeToken as aP, StackNode as aQ, StateDeclaration as aR, StateGuard as aS, StateValue as aT, StateValueType as aU, SwitchNode as aV, TabNode as aW, TableNode as aX, TabsNode as aY, TextAlign as aZ, TextContentNode as a_, LayoutDefinitionNode as aa, LayoutNode as ab, LeafNode as ac, LinkNode as ad, ListItemNode as ae, ListNode as af, MainNode as ag, MarkerColor as ah, MarkerNode as ai, ModalNode as aj, NavBlockItem as ak, NavChild as al, NavGroupNode as am, NavItem as an, NavNode as ao, NavigationNode as ap, NodeType as aq, OverlayNode as ar, PageNode as as, PlaceholderNode as at, PopoverNode as au, Position as av, PositionProps as aw, ProgressNode as ax, RadioNode as ay, RelativeNode as az, AlertVariant as b, TextSize as b0, TextSizeToken as b1, TextWeight as b2, TextareaNode as b3, TitleLevel as b4, TitleNode as b5, ToastNode as b6, ToastPosition as b7, TooltipNode as b8, TooltipPosition as b9, TopLevelNode as ba, ValueWithUnit as bb, WidthValue as bc, WireframeDocument as bd, 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, ComponentDefinitionNode as z };
|