@wireweave/core 4.0.0-beta.13 → 4.0.0-beta.15

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.
@@ -1,756 +1,4 @@
1
- import { P as PageNode, L as LayoutDefinitionNode, W as WireframeDocument, A as AnyNode, C as ComponentUseNode, I as InteractiveProps, G as GuardedOutcomeProps } from './types-CGRi1k2N.js';
2
- import { R as RenderContext, a as RenderOptions, T as ThemeConfig, b as RenderResult, A as AnnotationStyle, P as PageRenderResult, C as CanvasOptions, c as CanvasRenderResult, S as SvgRenderOptions, d as SvgRenderResult } from './index-BGU_4N4W.js';
3
- export { e as SiteOptions, f as ThemeColors, g as darkTheme, h as defaultTheme, i as getTheme, r as renderSite } from './index-BGU_4N4W.js';
4
-
5
- /**
6
- * The screen model behind `renderSite` — which pages become screens, which
7
- * shell each one is drawn inside, and what names address it.
8
- *
9
- * Nothing here renders. It answers three questions the site renderer and its
10
- * inline runtime both need the *same* answer to, so the answer is computed once
11
- * and handed to both.
12
- *
13
- * ## Totality
14
- *
15
- * A wireframe document can name a layout that does not exist, declare two pages
16
- * with the same `id`, or use a layout with no `slot`. None of those is a parse
17
- * error (see the note on `WireframeDocument`), so none of them may stop a
18
- * render either: every function here is total. Where a document is ambiguous
19
- * the rule is always **first-wins in document order** — the same rule
20
- * `extract/transitions.ts` already applies to titles — and the loser is not
21
- * dropped silently: it is rendered with a `data-wf-*` marker naming what went
22
- * unmet, so a reader of the output can see it and `validation/` can report it
23
- * with a source location.
24
- */
25
-
26
- /** Why a page that declared `uses=` is not composed into a shell after all. */
27
- type ShellMiss =
28
- /** No `layout` in the document carries that name. */
29
- 'unknown-layout'
30
- /** The layout exists but has no `slot`, so it has nowhere to put a page. */
31
- | 'slotless-layout';
32
- /** One page, as a screen of the composed document. */
33
- interface SiteScreen {
34
- /** Position in `documentPages(doc)`. This is the screen's DOM key. */
35
- index: number;
36
- page: PageNode;
37
- /**
38
- * The variant this screen draws, when its page came from a `variants=` list.
39
- *
40
- * Read off the page rather than derived here: `expandVariants` has already
41
- * turned one variant-bearing page into one page per variant by the time a
42
- * model is built, so each of those pages is a screen like any other and this
43
- * only records which one it is.
44
- */
45
- variant?: string;
46
- /** Name of the shell this screen is composed into, when it has one. */
47
- shell?: string;
48
- /** Set when `uses=` was declared and could not be honoured. */
49
- miss?: {
50
- uses: string;
51
- reason: ShellMiss;
52
- };
53
- /**
54
- * The public name this screen *owns* — the name that resolves to it.
55
- *
56
- * Absent when the page declared no name, and also when every name it declared
57
- * is already owned by an earlier page. A screen without a name is still
58
- * reachable: its index addresses it.
59
- */
60
- name?: string;
61
- }
62
- /** One layout, emitted once, hosting every screen that uses it. */
63
- interface SiteShell {
64
- /** The `layout <name>` identifier, which `uses=` addresses. */
65
- name: string;
66
- layout: LayoutDefinitionNode;
67
- /** Screens composed into this shell, in document order. */
68
- screens: SiteScreen[];
69
- /**
70
- * Frame size of the shell, resolved from its first screen's page.
71
- *
72
- * A layout has no viewport of its own — it is the pages that declare one — so
73
- * the first page to use it fixes the frame. A later page resolving to a
74
- * different size is a conflict the author has to settle; it is marked on that
75
- * screen rather than resized, because silently stretching one page's frame to
76
- * another's is the kind of change that is invisible until a screenshot.
77
- */
78
- width: number;
79
- height: number;
80
- }
81
- interface SiteModel {
82
- screens: SiteScreen[];
83
- /** Shells in first-use order — the order pages first reference them. */
84
- shells: SiteShell[];
85
- /**
86
- * Every name that addresses a screen → that screen's index.
87
- *
88
- * Built exactly like `extract/transitions.ts` resolves `navigate`: the `id`
89
- * namespace is consulted before the `title` namespace, and within each
90
- * namespace the first page in document order wins. A `navigate` target and a
91
- * URL fragment therefore land on the same screen the transition graph says
92
- * they do — one resolution rule, two consumers.
93
- */
94
- names: Map<string, number>;
95
- /** Screen shown when no fragment selects one. `-1` for a document with no pages. */
96
- entry: number;
97
- }
98
- /**
99
- * Derive the screen model of a document.
100
- *
101
- * Pure and deterministic: same document in, same model out, whatever the
102
- * document contains.
103
- */
104
- declare function buildSiteModel(doc: WireframeDocument): SiteModel;
105
-
106
- /**
107
- * Base HTML Renderer for wireweave
108
- *
109
- * Provides abstract base class for HTML rendering with theme support
110
- */
111
-
112
- /**
113
- * Abstract base renderer class
114
- *
115
- * Provides core infrastructure for HTML rendering:
116
- * - Theme management
117
- * - Indentation and formatting
118
- * - Depth tracking for nested elements
119
- */
120
- declare abstract class BaseRenderer {
121
- protected context: RenderContext;
122
- constructor(options?: RenderOptions);
123
- /**
124
- * Build theme configuration based on options
125
- * Note: background option is NOT applied to theme.colors.background
126
- * It's only used for page background in renderPage() to avoid affecting
127
- * component colors that use var(--wf-bg)
128
- */
129
- protected buildTheme(options: RenderOptions): ThemeConfig;
130
- /**
131
- * Render a wireframe document to HTML and CSS
132
- */
133
- render(document: WireframeDocument): RenderResult;
134
- /**
135
- * Render a complete wireframe document.
136
- *
137
- * Only pages are drawn. A document's top level also holds `layout` and
138
- * `component` definitions, which are reusable fragments a page refers to —
139
- * drawing one would put a screen on the canvas that the author never wrote a
140
- * page for, and would do it the moment the reuse feature was used at all.
141
- */
142
- protected renderDocument(document: WireframeDocument): string;
143
- /**
144
- * Render a page node (to be implemented by subclasses)
145
- */
146
- protected abstract renderPage(node: AnyNode): string;
147
- /**
148
- * Render any AST node (to be implemented by subclasses)
149
- */
150
- protected abstract renderNode(node: AnyNode): string;
151
- /**
152
- * Get the CSS class prefix
153
- */
154
- protected get prefix(): string;
155
- /**
156
- * Add indentation based on current depth
157
- */
158
- protected indent(content: string): string;
159
- /**
160
- * Execute a function with increased depth
161
- */
162
- protected withDepth<T>(fn: () => T): T;
163
- /**
164
- * Escape HTML special characters
165
- */
166
- protected escapeHtml(text: string): string;
167
- /**
168
- * The DOM id an authored id becomes under this render's `idScope`.
169
- *
170
- * One function so that "what is the id in the document" has one answer. A
171
- * renderer that prefixed at some emission sites and not others would produce
172
- * a document where `#confirm` resolves for one element and `#s0-confirm` for
173
- * another, which is worse than either convention alone.
174
- *
175
- * Only identity is prefixed. The interaction attributes that point at an
176
- * overlay still carry the name their author wrote — they are spelled in one
177
- * file (`html/interactive.ts`) and read by whoever consumes them, which
178
- * composes the scope back on. See `RenderOptions.idScope`.
179
- */
180
- protected scopedId(id: string): string;
181
- /**
182
- * Build a CSS class string from an array of class names
183
- */
184
- protected buildClassString(classes: (string | undefined | false)[]): string;
185
- /**
186
- * Build HTML attributes string
187
- */
188
- protected buildAttrsString(attrs: Record<string, string | undefined | boolean>): string;
189
- /**
190
- * Simple HTML minification
191
- */
192
- private minifyHtml;
193
- /**
194
- * Simple CSS minification
195
- */
196
- private minifyCss;
197
- }
198
-
199
- /**
200
- * HTML Renderer for wireweave
201
- *
202
- * Converts AST nodes to HTML output
203
- */
204
-
205
- /**
206
- * HTML Renderer class
207
- *
208
- * Renders wireframe AST to semantic HTML with utility classes
209
- */
210
- declare class HtmlRenderer extends BaseRenderer {
211
- /**
212
- * Node type to renderer method mapping
213
- */
214
- private readonly nodeRenderers;
215
- /**
216
- * Node → anchor-path map for the document currently being rendered. Non-null
217
- * only while rendering with `sourceAnchors` enabled.
218
- */
219
- private pathMap;
220
- /**
221
- * Base index added to page anchor paths. Non-zero when a page is rendered in
222
- * isolation (canvas per-page composition) but must keep its true document
223
- * index in the anchor scheme.
224
- */
225
- private readonly pageIndexBase;
226
- /**
227
- * HTML the next `slot` renders, or `null` when there is none to place.
228
- *
229
- * Set for the duration of one `renderFragment` call and consumed by the first
230
- * slot reached, so it never leaks into an unrelated render.
231
- */
232
- private slotContent;
233
- constructor(options?: RenderOptions, pageIndexBase?: number);
234
- /**
235
- * Render a document, building the anchor-path map first when anchors are
236
- * enabled so `renderNode` / `renderPage` can inject each node's path.
237
- */
238
- render(document: WireframeDocument): RenderResult;
239
- /**
240
- * Get render context for external renderer functions
241
- */
242
- private getRenderContext;
243
- /**
244
- * Get grid render context (extends RenderContext with buildColStyles)
245
- */
246
- private getGridRenderContext;
247
- /**
248
- * Create the node renderer mapping
249
- */
250
- private createNodeRenderers;
251
- /**
252
- * Render a page node
253
- */
254
- protected renderPage(node: PageNode): string;
255
- /**
256
- * Render any AST node
257
- */
258
- protected renderNode(node: AnyNode): string;
259
- /**
260
- * Render the `slot` of a layout — the position a page's content is placed at.
261
- *
262
- * The element is always emitted, filled or not. A layout is a shell, and a
263
- * shell keeps its shape whether or not something is currently inside it;
264
- * collapsing the slot away when empty would make the frame reflow between an
265
- * isolated render of the layout and a composed one.
266
- */
267
- protected renderSlot(): string;
268
- /**
269
- * Render one linked component invocation with its stable instance marker.
270
- *
271
- * The wrapper is identified by `data-` attributes and carries no class. It
272
- * declares `display: contents`, so by construction it has no box of its own
273
- * and its children lay out as though it were not there — which is the whole
274
- * point: an invocation must not disturb the layout of what it expands to.
275
- * A class is the hook a stylesheet paints a box through, and any rule that
276
- * gave this one a box would defeat `display: contents`; there is therefore
277
- * no style it could ever legitimately carry. It emitted
278
- * `${this.prefix}-component-instance` regardless, which no rule in the
279
- * generated CSS defined and nothing read — a class the markup advertises as
280
- * styleable while the stylesheet leaves it undefined. Identity that exists
281
- * to be *queried* rather than *painted* belongs in `data-`, alongside the
282
- * `data-wf-component` / `data-wf-instance` pair already carrying it.
283
- */
284
- protected renderComponentUse(node: ComponentUseNode): string;
285
- /**
286
- * Render a list of nodes with no page frame around them.
287
- *
288
- * The frame — viewport size, background, the CSS reset every component
289
- * depends on — belongs to whatever is composing these nodes. `renderSite`
290
- * uses this twice per shell: once for the layout's own markup, where
291
- * `slotContent` is the screens that live in it, and once per screen for that
292
- * page's body.
293
- *
294
- * @param nodes - Nodes to render, in order
295
- * @param slotContent - HTML placed inside the first `slot` encountered
296
- */
297
- renderFragment(nodes: AnyNode[], slotContent?: string | null): string;
298
- /**
299
- * Render children nodes
300
- */
301
- protected renderChildren(children: AnyNode[]): string;
302
- /**
303
- * Get common CSS classes from props
304
- * Uses Omit to exclude 'align' since TextNode/TitleNode have incompatible align types
305
- *
306
- * All numeric values are handled by buildCommonStyles as inline px values.
307
- * CSS classes are only used for keyword values (full, auto, screen, fit, etc.)
308
- */
309
- private getCommonClasses;
310
- private renderHeader;
311
- private renderMain;
312
- private renderFooter;
313
- private renderSidebar;
314
- private renderSection;
315
- private renderRow;
316
- private renderCol;
317
- private renderStack;
318
- private renderRelative;
319
- /**
320
- * Build common inline styles for all values
321
- *
322
- * Position values (x, y) for absolute positioning:
323
- * - When x or y is specified, element gets position: absolute
324
- * - x → left, y → top
325
- *
326
- * Spacing values (p, m, gap) use token system:
327
- * - number: spacing token (e.g., p=4 → padding: 16px from token table)
328
- * - ValueWithUnit: direct CSS value (e.g., p=16px → padding: 16px)
329
- *
330
- * Size values (w, h, minW, maxW, minH, maxH) use direct px:
331
- * - number: direct px value (e.g., w=400 → width: 400px)
332
- * - ValueWithUnit: direct CSS value (e.g., w=50% → width: 50%)
333
- *
334
- * Token table: 0=0px, 1=4px, 2=8px, 3=12px, 4=16px, 5=20px, 6=24px, 8=32px, etc.
335
- *
336
- * Uses Omit to exclude 'align' since TextNode/TitleNode have incompatible align types
337
- */
338
- private buildCommonStyles;
339
- /**
340
- * Build position styles (absolute positioning)
341
- */
342
- private buildPositionStyles;
343
- /**
344
- * Build size styles (width, height, min/max)
345
- */
346
- private buildSizeStyles;
347
- /**
348
- * Build padding styles (p, px, py, pt, pr, pb, pl)
349
- */
350
- private buildPaddingStyles;
351
- /**
352
- * Build margin styles (m, mx, my, mt, mr, mb, ml)
353
- */
354
- private buildMarginStyles;
355
- /**
356
- * Build gap styles
357
- */
358
- private buildGapStyles;
359
- /**
360
- * Build inline styles for Col node (extends common styles with order)
361
- */
362
- private buildColStyles;
363
- private renderCard;
364
- private renderModal;
365
- private renderDrawer;
366
- private renderAccordion;
367
- private renderText;
368
- private renderTitle;
369
- private renderLink;
370
- private renderInput;
371
- private renderTextarea;
372
- private renderSelect;
373
- private renderCheckbox;
374
- private renderRadio;
375
- private renderSwitch;
376
- private renderSlider;
377
- private renderButton;
378
- private renderImage;
379
- private renderPlaceholder;
380
- private renderAvatar;
381
- private renderBadge;
382
- private renderIcon;
383
- private renderTable;
384
- private renderList;
385
- private renderAlert;
386
- private renderToast;
387
- private renderProgress;
388
- private renderSpinner;
389
- private renderTooltip;
390
- private renderPopover;
391
- private renderDropdown;
392
- private renderNav;
393
- private renderTabs;
394
- private renderBreadcrumb;
395
- private renderDivider;
396
- private renderMarker;
397
- private renderAnnotations;
398
- private renderAnnotationItem;
399
- }
400
- /**
401
- * Create a new HTML renderer instance
402
- */
403
- declare function createHtmlRenderer(options?: RenderOptions): HtmlRenderer;
404
-
405
- /**
406
- * CSS Style Generator for wireweave
407
- *
408
- * Generates CSS classes for grid, spacing, and flex utilities
409
- */
410
-
411
- /**
412
- * Generate all CSS styles for wireframe rendering
413
- *
414
- * @param theme - Theme configuration
415
- * @param prefix - CSS class prefix (default: 'wf')
416
- * @returns Complete CSS string
417
- */
418
- declare function generateStyles(theme: ThemeConfig, prefix?: string, annotationStyle?: AnnotationStyle): string;
419
-
420
- /**
421
- * Component-specific CSS styles for wireweave
422
- *
423
- * Detailed styles for all UI components with:
424
- * - Wireframe aesthetic (black/white/gray)
425
- * - Accessibility considerations
426
- * - Responsive design
427
- */
428
-
429
- /**
430
- * Generate all component-specific CSS styles
431
- */
432
- declare function generateComponentStyles(_theme: ThemeConfig, prefix?: string, annotationStyle?: AnnotationStyle): string;
433
-
434
- /**
435
- * Page renderer — single-Page primitive.
436
- *
437
- * `renderPage` is the *pure* unit of this renderer: its output depends only
438
- * on the page itself, never on sibling pages or canvas-level options. This
439
- * is what export pipelines (1 page = 1 file) consume, and it is also the
440
- * building block `renderCanvas` composes when laying multiple pages out.
441
- */
442
-
443
- /**
444
- * Render a single page to self-contained HTML + CSS.
445
- *
446
- * The page's HTML output is identical to what `render(document)` produces
447
- * for a document containing only this page — we route through `HtmlRenderer`
448
- * so the existing renderer pipeline (themes, prefix, indentation, minify)
449
- * applies uniformly.
450
- */
451
- declare function renderPage(page: PageNode, options?: RenderOptions): PageRenderResult;
452
- /**
453
- * Resolve a page's pixel dimensions from explicit `w`/`h` or viewport/device.
454
- *
455
- * Mirrors the precedence used inside `HtmlRenderer.renderPage`:
456
- * 1. Explicit numeric `w` and `h` both set → use them.
457
- * 2. Otherwise resolve via viewport string / device preset.
458
- *
459
- * Non-numeric `w`/`h` (e.g. keyword `'full'` or `ValueWithUnit`) fall through
460
- * to the viewport — those are layout-internal hints, not canvas dimensions.
461
- */
462
- declare function resolvePageDimensions(page: PageNode): {
463
- width: number;
464
- height: number;
465
- };
466
-
467
- /**
468
- * Canvas renderer — multi-page composition.
469
- *
470
- * `renderCanvas` lays out one or more pages on a single bounded canvas. The
471
- * DSL stays page-centric — coordinates come from each page's optional
472
- * `at(x, y)` attribute (resolved into `Page.x` / `Page.y` by the parser).
473
- * Pages without coordinates auto-flow horizontally with `gap` between them.
474
- *
475
- * Output is intentionally minimal: a bounded `<div class="wf-canvas">` of the
476
- * exact layout extent, containing absolutely-positioned `<div class="wf-canvas-board">`
477
- * wrappers around each page's HTML. No chrome, no decoration, no grid, no
478
- * labels. Hosts (dashboard editor, markdown plugin, VSCode preview) wrap this
479
- * output in their own viewport / grid / pan-zoom layers.
480
- *
481
- * `layoutCanvas` is exposed as a pure utility so hosts that want to compose
482
- * the canvas DOM themselves can reuse the placement math.
483
- */
484
-
485
- interface PlacedPage {
486
- page: PageNode;
487
- x: number;
488
- y: number;
489
- w: number;
490
- h: number;
491
- }
492
- /**
493
- * Compute each page's position on the canvas and the bounding canvas size.
494
- *
495
- * Per-page mode:
496
- * - `Page.x` / `Page.y` set → placed at exactly those coordinates.
497
- * - Either missing → auto-flow: continues from the running cursor in a
498
- * single horizontal row, advancing by `width + gap` after each
499
- * auto-placed page. The cursor is unaffected by explicitly-placed pages.
500
- *
501
- * Mixed documents are allowed (ux-rules will warn) but explicit pages may
502
- * overlap auto pages — that is the author's responsibility.
503
- */
504
- declare function layoutCanvas(pages: PageNode[], gap?: number): {
505
- placed: PlacedPage[];
506
- width: number;
507
- height: number;
508
- };
509
- /**
510
- * Render a multi-page document to a single bounded canvas of HTML + CSS.
511
- *
512
- * Output: `<div class="wf-canvas" style="width:Wpx; height:Hpx; position:relative">`
513
- * containing one `<div class="wf-canvas-board">` per page, absolutely
514
- * positioned at the layout coordinates.
515
- */
516
- declare function renderCanvas(doc: WireframeDocument, options?: CanvasOptions): CanvasRenderResult;
517
-
518
- /**
519
- * Interaction intent → HTML attributes.
520
- *
521
- * `navigate` / `opens` / `toggles` / `action` are the declared interaction
522
- * intent of a wireframe element (see {@link InteractiveProps}). They are the
523
- * only structural link between screens, so every consumer of rendered
524
- * output — the studio runtime, the transition graph, a prototype harness —
525
- * finds them by these four `data-*` names.
526
- *
527
- * This module is their single owner. The attribute names are written down
528
- * exactly once, here; renderers ask for the record and never spell the names
529
- * themselves. Before this existed the block was copy-pasted into five
530
- * renderers, and the sixth (`navigation.ts`) simply never got a copy — nav,
531
- * tab and breadcrumb items parsed their interaction intent and then dropped it
532
- * on the floor, which is the failure mode this module exists to make
533
- * impossible to repeat.
534
- *
535
- * `__tests__/renderer-interactive.test.ts` enforces the single-owner property:
536
- * it fails if any other file under `src/renderer/` spells one of these names.
537
- */
538
-
539
- /** The `data-*` attribute name carrying each interaction kind. */
540
- declare const INTERACTIVE_ATTR_NAMES: readonly ["data-navigate", "data-opens", "data-toggles", "data-action"];
541
- /** Internal: the shape of {@link InteractiveAttrs}'s keys. Consumers use that. */
542
- type InteractiveAttrName = (typeof INTERACTIVE_ATTR_NAMES)[number];
543
- /**
544
- * Marks a `data-navigate` whose target is a URL rather than a page name.
545
- *
546
- * Only elements that are not anchors ever carry it: an anchor puts a URL in its
547
- * `href` and emits no `data-navigate` at all, so there is nothing left to
548
- * qualify. A button or a current-page `<span>` has no `href` to move the target
549
- * into, so the URL travels in the data attribute — and without this marker every
550
- * consumer would have to re-derive, from the string, the thing the renderer
551
- * already worked out.
552
- *
553
- * That re-derivation is the point. {@link isUrlTarget} is a TypeScript predicate;
554
- * the site runtime is generated JavaScript. A second copy of the rule over there
555
- * is a drift surface by construction, and the two copies disagreeing means the
556
- * runtime starts hunting for a screen named `https://…`. So the judgment is made
557
- * once, here, at render time, and shipped as a fact the runtime only reads.
558
- *
559
- * The single-owner gate in `__tests__/renderer-interactive.test.ts` covers this
560
- * name for free: it contains `data-navigate`, so any other file under
561
- * `src/renderer/` that spells it is already an offender.
562
- */
563
- declare const EXTERNAL_NAVIGATE_ATTR = "data-navigate-external";
564
- /** Typed runtime markers, owned beside the legacy interaction attributes. */
565
- declare const TYPED_INTERACTION_ATTR = "data-wf-on";
566
- declare const VISIBLE_GUARD_ATTR = "data-wf-visible-when";
567
- declare const ENABLED_GUARD_ATTR = "data-wf-enabled-when";
568
- /**
569
- * The `href` an anchor gets when it has no destination of its own.
570
- *
571
- * An anchor must have an `href` to be a link — focusable, keyboard-activatable,
572
- * announced as a link — but a wireframe anchor usually has nowhere to go: its
573
- * intent, if any, travels as `data-navigate` and names a screen, not a URL.
574
- * `#` is the standard inert stand-in, and it is a *statement by the renderer*:
575
- * this element's `href` carries no destination.
576
- *
577
- * It is exported because the site runtime needs to read that statement back.
578
- * The browser's default action for `#` is a same-document navigation, and inside
579
- * the `srcdoc` frame consumers mount the wireframe in, `#` resolves against the
580
- * *embedder's* URL — so an unhandled click walks the frame out of the wireframe
581
- * and loads the host app inside it. Measured on a 20-screen demo: 44 such
582
- * anchors, frame URL `about:srcdoc` → `<host page>#`, host assets refetched.
583
- *
584
- * The runtime must therefore distinguish "inert" from "a real link the author
585
- * asked for", and re-deriving that from the string over there is the drift
586
- * surface {@link EXTERNAL_NAVIGATE_ATTR} exists to avoid. So the value is owned
587
- * here and embedded into the generated script, like the attribute names.
588
- */
589
- declare const INERT_HREF = "#";
590
- /**
591
- * Attribute record for one element; absent intents stay `undefined`.
592
- *
593
- * The marker is boolean because it carries no value of its own — it qualifies
594
- * the target next to it. `buildAttrsString` renders `true` as `name="name"`,
595
- * which is the form that survives the XML parsing of an SVG `foreignObject`.
596
- */
597
- type InteractiveAttrs = Record<InteractiveAttrName, string | undefined> & Record<typeof EXTERNAL_NAVIGATE_ATTR, true | undefined> & Record<typeof TYPED_INTERACTION_ATTR | typeof VISIBLE_GUARD_ATTR | typeof ENABLED_GUARD_ATTR, string | undefined>;
598
- /** Guard attributes accepted by ordinary nodes that do not carry events. */
599
- declare function guardedOutcomeAttrs(node: Partial<GuardedOutcomeProps>): Record<typeof VISIBLE_GUARD_ATTR | typeof ENABLED_GUARD_ATTR, string | undefined>;
600
- /**
601
- * The interaction attributes of any node carrying {@link InteractiveProps}.
602
- *
603
- * The result is spread into a renderer's attribute record, or passed straight
604
- * to `buildAttrsString` — which drops `undefined` entries, so an element with
605
- * no declared intent emits nothing at all.
606
- *
607
- * Emission order is fixed (navigate, opens, toggles, action) so that rendered
608
- * HTML stays byte-stable across runs; the marker sits next to the target it
609
- * qualifies.
610
- */
611
- declare function interactiveAttrs(node: Partial<InteractiveProps>): InteractiveAttrs;
612
- /**
613
- * The `href` and interaction attributes of an element rendered as an `<a>`.
614
- *
615
- * An anchor is the one element with two channels that can carry a destination,
616
- * so it is the one element where they can contradict each other — and it is the
617
- * only place the choice between them has to be made. Both halves of that choice
618
- * are decided here so a renderer never has to know the rule:
619
- *
620
- * - An authored `href` is the anchor and is left exactly as written.
621
- * - Otherwise a URL-shaped `navigate` (see {@link isUrlTarget}) becomes the
622
- * `href`, and no `data-navigate` goes out beside it. A URL is not a screen:
623
- * emitting both would hand a consumer two destinations for one element and
624
- * send a runtime hunting for a screen named `https://…`.
625
- * - Otherwise the `navigate` target names a page. The anchor stays inert `#` —
626
- * `href="교환소 지도"` is a broken relative link — and the intent travels as
627
- * `data-navigate` for the consumer that knows what pages are.
628
- *
629
- * When an `href` *and* a URL-shaped `navigate` are both authored, both are
630
- * emitted unchanged: the element already has its destination, and quietly
631
- * dropping the second one would hide a contradiction only the author can settle.
632
- * Naming that conflict belongs to validation, not to rendering.
633
- *
634
- * Elements that are not anchors keep {@link interactiveAttrs}: with no `href` to
635
- * move it into, a URL-shaped target has only the data attribute to travel in,
636
- * and dropping it there would discard what the author wrote. Those are the
637
- * elements {@link EXTERNAL_NAVIGATE_ATTR} exists for.
638
- */
639
- declare function anchorIntent(node: Partial<InteractiveProps> & {
640
- href?: string;
641
- }): {
642
- href: string;
643
- attrs: InteractiveAttrs;
644
- };
645
-
646
- /**
647
- * GENERATED FILE -- DO NOT EDIT.
648
- *
649
- * The icon dataset, generated from the installed `lucide` package by
650
- * `scripts/generate-icons.mjs` (`pnpm build:icons`). Names kept beyond what
651
- * lucide ships come from `scripts/icon-overrides.mjs`; add them there, never
652
- * here, or the next regeneration deletes them.
653
- *
654
- * Total icons: 1667
655
- *
656
- * The lookup, alias and rendering code that consumes this lives in
657
- * `./lucide-icons.ts` and is hand-written.
658
- *
659
- * @license ISC License
660
- *
661
- * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023
662
- * as part of Feather (MIT). All other copyright (c) for Lucide are held
663
- * by Lucide Contributors 2025.
664
- *
665
- * Permission to use, copy, modify, and/or distribute this software for any
666
- * purpose with or without fee is hereby granted, provided that the above
667
- * copyright notice and this permission notice appear in all copies.
668
- *
669
- * @see https://lucide.dev
670
- */
671
- type IconElement = [string, Record<string, string>];
672
- type IconData = IconElement[];
673
- declare const lucideIcons: Record<string, IconData>;
674
-
675
- /**
676
- * Icon lookup and SVG rendering.
677
- *
678
- * HAND-WRITTEN. The dataset this reads is generated -- see
679
- * `./lucide-icons.generated.ts` and `scripts/generate-icons.mjs`. The two were
680
- * a single file until the split: it carried an "Auto-generated ... Do not edit
681
- * manually" header while the alias table, the alias branches in `getIconData`,
682
- * the `renderIconSvg` signature and all of `renderUnknownIconSvg` below were
683
- * added by hand, so running the generator would have destroyed working code
684
- * that four renderers import. Data and code now have one owner each.
685
- *
686
- * The dataset's exports are re-exported here so `src/index.ts` can keep
687
- * re-exporting this module and the public surface is unchanged.
688
- */
689
-
690
- /**
691
- * Get icon data by name.
692
- *
693
- * Resolution order is exact key, then alias, then camelCase folded to
694
- * kebab-case, then that folded name through the aliases. A name that survives
695
- * all four is not drawable, and the caller renders the placeholder below.
696
- */
697
- declare function getIconData(name: string): IconData | undefined;
698
- /**
699
- * Render icon data to SVG string
700
- */
701
- declare function renderIconSvg(data: IconData, _size?: number, // size is now controlled by CSS, this param is kept for API compatibility
702
- strokeWidth?: number, className?: string, styleAttr?: string): string;
703
- /**
704
- * Render the canonical "unknown icon" placeholder SVG — a dashed circle with a
705
- * `?` glyph. Shared by every renderer (icon node, button, input) so an
706
- * unresolved icon name always produces the SAME visual placeholder and never
707
- * leaks the raw DSL name as literal text. Callers add a
708
- * `title="Unknown icon: <name>"` on the wrapping element for hover context.
709
- */
710
- declare function renderUnknownIconSvg(className?: string, size?: number, styleAttr?: string): string;
711
-
712
- /**
713
- * Renderer module for wireweave
714
- *
715
- * Provides render functions to convert AST to HTML/CSS and SVG
716
- */
717
-
718
- /**
719
- * Render AST to HTML and CSS.
720
- *
721
- * Two modes, decided automatically by page count:
722
- * 1. Multiple pages → canvas mode (bounded layout, absolutely-positioned
723
- * boards). Hosts wrap this in their own viewport / grid / pan-zoom layer.
724
- * 2. Single page → legacy mode (page only, no canvas wrapper) for
725
- * backward compatibility with single-page consumers (markdown-plugin,
726
- * dashboard previews, vscode-extension).
727
- *
728
- * Use `renderPage(page)` for explicit single-page export, or
729
- * `renderCanvas(doc)` for explicit multi-page composition.
730
- */
731
- declare function render(document: WireframeDocument, options?: RenderOptions | CanvasOptions): RenderResult;
732
- /**
733
- * Render AST to standalone HTML with embedded CSS
734
- *
735
- * @param document - Parsed wireframe document
736
- * @param options - Render options
737
- * @returns Complete HTML document string
738
- */
739
- declare function renderToHtml(document: WireframeDocument, options?: RenderOptions): string;
740
- /**
741
- * Render AST to SVG using foreignObject with HTML+CSS
742
- *
743
- * This approach embeds HTML+CSS inside SVG using foreignObject,
744
- * which allows CSS flexbox/grid layouts to work properly.
745
- *
746
- * Multi-page documents are auto-rendered as a bounded canvas, with the
747
- * SVG viewBox sized to the canvas bounding box. Single-page documents
748
- * keep their legacy single-page sizing.
749
- *
750
- * @param document - Parsed wireframe document
751
- * @param options - SVG render options
752
- * @returns Object containing SVG string and dimensions
753
- */
754
- declare function renderToSvg(document: WireframeDocument, options?: SvgRenderOptions): SvgRenderResult;
755
-
756
- export { AnnotationStyle, CanvasOptions, CanvasRenderResult, ENABLED_GUARD_ATTR, EXTERNAL_NAVIGATE_ATTR, HtmlRenderer, INERT_HREF, INTERACTIVE_ATTR_NAMES, type IconData, type IconElement, type InteractiveAttrs, PageRenderResult, type PlacedPage, RenderContext, RenderOptions, RenderResult, type ShellMiss, type SiteModel, type SiteScreen, type SiteShell, SvgRenderOptions, SvgRenderResult, TYPED_INTERACTION_ATTR, ThemeConfig, VISIBLE_GUARD_ATTR, anchorIntent, buildSiteModel, createHtmlRenderer, generateComponentStyles, generateStyles, getIconData, guardedOutcomeAttrs, interactiveAttrs, layoutCanvas, lucideIcons, render, renderCanvas, renderIconSvg, renderPage, renderToHtml, renderToSvg, renderUnknownIconSvg, resolvePageDimensions };
1
+ import './types-CGRi1k2N.js';
2
+ export { e as AnnotationStyle, C as CanvasOptions, f as CanvasRenderResult, P as PageRenderResult, R as RenderContext, c as RenderOptions, d as RenderResult, i as SiteOptions, g as SvgRenderOptions, h as SvgRenderResult, j as ThemeColors, T as ThemeConfig, k as darkTheme, l as defaultTheme, m as getTheme, r as renderSite } from './index-c4FTW7XA.js';
3
+ export { e as ENABLED_GUARD_ATTR, f as EXTERNAL_NAVIGATE_ATTR, H as HtmlRenderer, I as INERT_HREF, x as INTERACTIVE_ATTR_NAMES, y as IconData, z as IconElement, A as InteractiveAttrs, P as PlacedPage, S as ShellMiss, B as SiteModel, D as SiteScreen, G as SiteShell, T as TYPED_INTERACTION_ATTR, O as VISIBLE_GUARD_ATTR, Q as anchorIntent, R as buildSiteModel, U as createHtmlRenderer, W as generateComponentStyles, X as generateStyles, Y as getIconData, Z as guardedOutcomeAttrs, _ as interactiveAttrs, $ as layoutCanvas, a0 as lucideIcons, a1 as render, a2 as renderCanvas, a3 as renderIconSvg, a4 as renderPage, a5 as renderToHtml, a6 as renderToSvg, a7 as renderUnknownIconSvg, a8 as resolvePageDimensions } from './index-DwGsnD0n.js';
4
+ import './v4-types-2ORUg6To.js';