@wireweave/core 3.1.0-beta.9 → 4.0.0-beta.12

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.
Files changed (50) hide show
  1. package/README.md +17 -126
  2. package/dist/app.cjs +31 -0
  3. package/dist/app.d.cts +488 -0
  4. package/dist/app.d.ts +488 -0
  5. package/dist/app.js +31 -0
  6. package/dist/chunk-3RWGG5EC.js +18088 -0
  7. package/dist/chunk-4TMDPWPR.cjs +196 -0
  8. package/dist/chunk-5DGRIQDU.cjs +842 -0
  9. package/dist/chunk-7VTK6LHL.cjs +4374 -0
  10. package/dist/chunk-ETV4XYOV.cjs +7 -0
  11. package/dist/chunk-IMUVIIJR.cjs +18088 -0
  12. package/dist/chunk-JJWAFHSV.js +842 -0
  13. package/dist/chunk-MD6MNOEQ.cjs +2905 -0
  14. package/dist/chunk-PKBMQBKP.js +7 -0
  15. package/dist/chunk-QOS4IC75.js +4374 -0
  16. package/dist/chunk-R5WBZWBC.js +196 -0
  17. package/dist/chunk-V3HVWC7C.js +2905 -0
  18. package/dist/chunk-WV724EAW.js +0 -0
  19. package/dist/chunk-XENFKHRC.cjs +1 -0
  20. package/dist/chunk-XYACLXXF.js +51612 -0
  21. package/dist/chunk-ZPHNXJRY.cjs +51612 -0
  22. package/dist/index-Br7pNaf3.d.cts +240 -0
  23. package/dist/index-CghCKUPx.d.ts +337 -0
  24. package/dist/index-Da_B3eoM.d.ts +240 -0
  25. package/dist/index-G906GEtg.d.cts +337 -0
  26. package/dist/index.cjs +963 -64577
  27. package/dist/index.d.cts +13 -522
  28. package/dist/index.d.ts +13 -522
  29. package/dist/index.js +711 -64118
  30. package/dist/interaction.cjs +17 -0
  31. package/dist/interaction.d.cts +3 -0
  32. package/dist/interaction.d.ts +3 -0
  33. package/dist/interaction.js +17 -0
  34. package/dist/parser.cjs +18 -7832
  35. package/dist/parser.d.cts +10 -1
  36. package/dist/parser.d.ts +10 -1
  37. package/dist/parser.js +16 -7800
  38. package/dist/renderer.cjs +7 -53162
  39. package/dist/renderer.d.cts +19 -239
  40. package/dist/renderer.d.ts +19 -239
  41. package/dist/renderer.js +37 -53137
  42. package/dist/spec.cjs +42 -2883
  43. package/dist/spec.d.cts +4 -75
  44. package/dist/spec.d.ts +4 -75
  45. package/dist/spec.js +25 -2818
  46. package/dist/types-Dkgr0Wyc.d.cts +75 -0
  47. package/dist/types-Dkgr0Wyc.d.ts +75 -0
  48. package/dist/v4-types-Baz9yqAS.d.cts +137 -0
  49. package/dist/v4-types-Baz9yqAS.d.ts +137 -0
  50. package/package.json +22 -1
@@ -1,162 +1,6 @@
1
1
  import { be as WireframeDocument, h as AnyNode, as as PageNode, H as ComponentUseNode, aa as LayoutDefinitionNode, a8 as InteractiveProps, Y as GuardedOutcomeProps } from './types-vhPCZpAW.cjs';
2
-
3
- /**
4
- * Renderer type definitions for wireweave
5
- *
6
- * Provides types for rendering options, themes, and context
7
- */
8
- /** Annotation presentation used by the renderer. */
9
- type AnnotationStyle = 'legacy' | 'neutral';
10
- interface RenderOptions {
11
- /** Theme variant */
12
- theme?: 'light' | 'dark';
13
- /** Scale factor for sizing */
14
- scale?: number;
15
- /** Include CSS styles in output */
16
- includeStyles?: boolean;
17
- /** Minify output (no indentation/newlines) */
18
- minify?: boolean;
19
- /** CSS class prefix for scoping */
20
- classPrefix?: string;
21
- /** Background color (e.g., '#ffffff', 'transparent') */
22
- background?: string;
23
- /**
24
- * Annotation presentation. Defaults to `legacy` so existing render output
25
- * stays unchanged; use `neutral` for deterministic grayscale annotations.
26
- */
27
- annotationStyle?: AnnotationStyle;
28
- /**
29
- * Emit source-anchor attributes (`data-wf-path` / `data-wf-loc`) on each
30
- * rendered component element, enabling DOM ↔ AST ↔ source mapping. Default
31
- * `false` — output is byte-identical to non-anchored rendering when off.
32
- */
33
- sourceAnchors?: boolean;
34
- /**
35
- * Prefix prepended to every DOM `id` this render emits.
36
- *
37
- * An authored `id` is unique inside the page that declares it and nowhere
38
- * else, which is all a page needs while it is a document of its own. Compose
39
- * several pages into one document and that stops being true: two screens
40
- * declaring `confirm` produce two elements with the same id, and a duplicate
41
- * id is not a rendering bug — the picture is right — but it is a lie told to
42
- * every reader of the DOM. Devtools resolve it to the first match, the
43
- * accessibility tree treats `aria-*` references as pointing at one element,
44
- * and any external tool doing `#confirm` gets an arbitrary one of them.
45
- *
46
- * Default `''` — no prefix, so output is byte-identical to unscoped
47
- * rendering when unset, which is what every existing entry point does.
48
- * `renderSite` sets it per screen and per shell, because it is the one
49
- * renderer that puts pages of different origin in the same document.
50
- *
51
- * Authored intent is not rewritten: the interaction attributes that point at
52
- * an overlay keep the name their author wrote, and their consumer composes
53
- * the scope back on. The prefix belongs to identity, not to intent.
54
- */
55
- idScope?: string;
56
- }
57
- interface RenderResult {
58
- /** Rendered HTML content */
59
- html: string;
60
- /** Generated CSS styles */
61
- css: string;
62
- }
63
- /**
64
- * Result of rendering a single page in isolation (`renderPage`).
65
- * Carries the resolved pixel dimensions so callers (export pipelines, hosts)
66
- * can size their wrapper without re-resolving viewport/device themselves.
67
- */
68
- interface PageRenderResult extends RenderResult {
69
- width: number;
70
- height: number;
71
- }
72
- interface CanvasOptions extends RenderOptions {
73
- /** Gap between auto-laid-out pages, in pixels. Default `64`. */
74
- gap?: number;
75
- }
76
- interface CanvasRenderResult extends RenderResult {
77
- /** Total canvas width — bounding box of all pages. */
78
- width: number;
79
- /** Total canvas height — bounding box of all pages. */
80
- height: number;
81
- }
82
- interface SvgRenderOptions {
83
- /** Width of the SVG viewport */
84
- width?: number;
85
- /** Height of the SVG viewport */
86
- height?: number;
87
- /** Padding around content */
88
- padding?: number;
89
- /** Scale factor */
90
- scale?: number;
91
- /** Background color */
92
- background?: string;
93
- /** Font family */
94
- fontFamily?: string;
95
- /** Theme variant */
96
- theme?: 'light' | 'dark';
97
- }
98
- interface SvgRenderResult {
99
- /** Rendered SVG content */
100
- svg: string;
101
- /** Actual width */
102
- width: number;
103
- /** Actual height */
104
- height: number;
105
- }
106
- interface RenderContext {
107
- /** Resolved render options */
108
- options: Required<RenderOptions>;
109
- /** Theme configuration */
110
- theme: ThemeConfig;
111
- /** Current nesting depth for indentation */
112
- depth: number;
113
- }
114
- interface ThemeColors {
115
- /** Primary action color */
116
- primary: string;
117
- /** Secondary/muted action color */
118
- secondary: string;
119
- /** Success state color */
120
- success: string;
121
- /** Warning state color */
122
- warning: string;
123
- /** Danger/error state color */
124
- danger: string;
125
- /** Muted/disabled color */
126
- muted: string;
127
- /** Background color */
128
- background: string;
129
- /** Foreground/text color */
130
- foreground: string;
131
- /** Border color */
132
- border: string;
133
- }
134
- interface ThemeConfig {
135
- /** Color palette */
136
- colors: ThemeColors;
137
- /** Spacing scale (number -> px value) */
138
- spacing: Record<number, string>;
139
- /** Border radius */
140
- radius: string;
141
- /** Font family */
142
- fontFamily: string;
143
- /** Shadow styles */
144
- shadows: Record<string, string>;
145
- }
146
- /**
147
- * Default wireframe theme using black/white/gray palette
148
- * Follows wireweave design principles for sketch-like appearance
149
- */
150
- declare const defaultTheme: ThemeConfig;
151
- /**
152
- * Dark theme configuration
153
- * Inverts colors for dark mode display
154
- */
155
- declare const darkTheme: ThemeConfig;
156
- /**
157
- * Get theme configuration by name
158
- */
159
- declare function getTheme(name: 'light' | 'dark'): ThemeConfig;
2
+ import { R as RenderContext, b as RenderOptions, f as ThemeConfig, c as RenderResult, A as AnnotationStyle, P as PageRenderResult, C as CanvasOptions, a as CanvasRenderResult, d as SvgRenderOptions, e as SvgRenderResult } from './index-Br7pNaf3.cjs';
3
+ export { S as SiteOptions, T as ThemeColors, g as darkTheme, h as defaultTheme, i as getTheme, r as renderSite } from './index-Br7pNaf3.cjs';
160
4
 
161
5
  /**
162
6
  * Base HTML Renderer for wireweave
@@ -320,7 +164,22 @@ declare class HtmlRenderer extends BaseRenderer {
320
164
  * isolated render of the layout and a composed one.
321
165
  */
322
166
  protected renderSlot(): string;
323
- /** Render one linked component invocation with its stable instance marker. */
167
+ /**
168
+ * Render one linked component invocation with its stable instance marker.
169
+ *
170
+ * The wrapper is identified by `data-` attributes and carries no class. It
171
+ * declares `display: contents`, so by construction it has no box of its own
172
+ * and its children lay out as though it were not there — which is the whole
173
+ * point: an invocation must not disturb the layout of what it expands to.
174
+ * A class is the hook a stylesheet paints a box through, and any rule that
175
+ * gave this one a box would defeat `display: contents`; there is therefore
176
+ * no style it could ever legitimately carry. It emitted
177
+ * `${this.prefix}-component-instance` regardless, which no rule in the
178
+ * generated CSS defined and nothing read — a class the markup advertises as
179
+ * styleable while the stylesheet leaves it undefined. Identity that exists
180
+ * to be *queried* rather than *painted* belongs in `data-`, alongside the
181
+ * `data-wf-component` / `data-wf-instance` pair already carrying it.
182
+ */
324
183
  protected renderComponentUse(node: ComponentUseNode): string;
325
184
  /**
326
185
  * Render a list of nodes with no page frame around them.
@@ -656,85 +515,6 @@ interface SiteModel {
656
515
  */
657
516
  declare function buildSiteModel(doc: WireframeDocument): SiteModel;
658
517
 
659
- /**
660
- * `renderSite` — a whole wireframe document as one navigable HTML file.
661
- *
662
- * The other renderers answer "what does this screen look like". This one
663
- * answers "what does this product look like": every page of a document, the
664
- * shells they share, and the moves between them, in a single file with no
665
- * server, no build step and no dependencies. Open it and click.
666
- *
667
- * ## What makes it one document rather than N concatenated
668
- *
669
- * Three things exist once, however many screens there are:
670
- *
671
- * - **the stylesheet** — component styles are generated per document, not per
672
- * page, so N screens cost one copy instead of N;
673
- * - **the runtime** — one inline script drives every screen;
674
- * - **each layout** — a `layout` referenced by `uses=` is emitted once, and
675
- * every page using it is hosted inside that one copy at the `slot` position.
676
- *
677
- * The third is the one that has to be structural. Emitting a copy of the shell
678
- * per screen and hiding all but one with CSS produces the same picture while
679
- * keeping every byte the shared shell exists to remove; the shell is therefore
680
- * shared in the DOM, and only screens are switched.
681
- *
682
- * ## Ids under composition
683
- *
684
- * An authored `id` is unique inside the page that declares it. Once several
685
- * pages share a document that guarantee is gone, so every screen and every
686
- * shell renders under an id scope of its own and the runtime composes the scope
687
- * with the authored name when it looks an overlay up. Two screens can both
688
- * declare `confirm` and each opens its own.
689
- *
690
- * ## What is left alone
691
- *
692
- * A page with no `uses=` renders exactly as `renderPage` renders it, frame and
693
- * all, as its own screen. That is the whole corpus today, so composition is
694
- * something a document opts into and nothing changes shape without being asked.
695
- *
696
- * `render` / `renderToHtml` / `renderCanvas` / `renderToSvg` are untouched:
697
- * `renderSite` is a fifth entry point beside them, not a mode of them.
698
- */
699
-
700
- /**
701
- * Options for {@link renderSite}.
702
- *
703
- * A subset of {@link RenderOptions}: `includeStyles` is meaningless for a
704
- * standalone document that has nowhere else to get its styles from, and
705
- * `sourceAnchors` is omitted because an anchor path names a node's position
706
- * under one page — a shell belongs to every page that uses it and has no single
707
- * such position, so the scheme has nothing true to say about it.
708
- */
709
- interface SiteOptions extends Pick<RenderOptions, 'theme' | 'classPrefix' | 'background' | 'annotationStyle'> {
710
- /** `<title>` of the produced document. Defaults to the entry page's title. */
711
- title?: string;
712
- /**
713
- * The screen shown when the URL carries no fragment.
714
- *
715
- * Named the way everything else names a screen — an `id` or a `title`, put
716
- * through {@link SiteModel.names}, so a caller writes the same string here
717
- * that it would write in a `navigate=` and lands on the same page. Taking an
718
- * index instead would make the option depend on document order, which is the
719
- * one thing a caller holding a screen name does not know.
720
- *
721
- * Defaults to the first page in document order. A name that addresses no
722
- * screen leaves that default in place and is marked on the site container as
723
- * `data-wf-entry-unresolved`, the way an unmet `uses=` is marked on its
724
- * screen: the request stays visible in the artefact instead of disappearing
725
- * between the call and the HTML.
726
- */
727
- entry?: string;
728
- }
729
- /**
730
- * Render a whole document as one navigable, self-contained HTML file.
731
- *
732
- * @param document - Parsed wireframe document
733
- * @param options - Site render options
734
- * @returns A complete HTML document, ready to write to disk and open
735
- */
736
- declare function renderSite(document: WireframeDocument, options?: SiteOptions): string;
737
-
738
518
  /**
739
519
  * Interaction intent → HTML attributes.
740
520
  *
@@ -973,4 +753,4 @@ declare function renderToHtml(document: WireframeDocument, options?: RenderOptio
973
753
  */
974
754
  declare function renderToSvg(document: WireframeDocument, options?: SvgRenderOptions): SvgRenderResult;
975
755
 
976
- export { type AnnotationStyle, type CanvasOptions, type CanvasRenderResult, ENABLED_GUARD_ATTR, EXTERNAL_NAVIGATE_ATTR, HtmlRenderer, INERT_HREF, INTERACTIVE_ATTR_NAMES, type IconData, type IconElement, type InteractiveAttrs, type PageRenderResult, type PlacedPage, type RenderContext, type RenderOptions, type RenderResult, type ShellMiss, type SiteModel, type SiteOptions, type SiteScreen, type SiteShell, type SvgRenderOptions, type SvgRenderResult, TYPED_INTERACTION_ATTR, type ThemeColors, type ThemeConfig, VISIBLE_GUARD_ATTR, anchorIntent, buildSiteModel, createHtmlRenderer, darkTheme, defaultTheme, generateComponentStyles, generateStyles, getIconData, getTheme, guardedOutcomeAttrs, interactiveAttrs, layoutCanvas, lucideIcons, render, renderCanvas, renderIconSvg, renderPage, renderSite, renderToHtml, renderToSvg, renderUnknownIconSvg, resolvePageDimensions };
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,162 +1,6 @@
1
1
  import { be as WireframeDocument, h as AnyNode, as as PageNode, H as ComponentUseNode, aa as LayoutDefinitionNode, a8 as InteractiveProps, Y as GuardedOutcomeProps } from './types-vhPCZpAW.js';
2
-
3
- /**
4
- * Renderer type definitions for wireweave
5
- *
6
- * Provides types for rendering options, themes, and context
7
- */
8
- /** Annotation presentation used by the renderer. */
9
- type AnnotationStyle = 'legacy' | 'neutral';
10
- interface RenderOptions {
11
- /** Theme variant */
12
- theme?: 'light' | 'dark';
13
- /** Scale factor for sizing */
14
- scale?: number;
15
- /** Include CSS styles in output */
16
- includeStyles?: boolean;
17
- /** Minify output (no indentation/newlines) */
18
- minify?: boolean;
19
- /** CSS class prefix for scoping */
20
- classPrefix?: string;
21
- /** Background color (e.g., '#ffffff', 'transparent') */
22
- background?: string;
23
- /**
24
- * Annotation presentation. Defaults to `legacy` so existing render output
25
- * stays unchanged; use `neutral` for deterministic grayscale annotations.
26
- */
27
- annotationStyle?: AnnotationStyle;
28
- /**
29
- * Emit source-anchor attributes (`data-wf-path` / `data-wf-loc`) on each
30
- * rendered component element, enabling DOM ↔ AST ↔ source mapping. Default
31
- * `false` — output is byte-identical to non-anchored rendering when off.
32
- */
33
- sourceAnchors?: boolean;
34
- /**
35
- * Prefix prepended to every DOM `id` this render emits.
36
- *
37
- * An authored `id` is unique inside the page that declares it and nowhere
38
- * else, which is all a page needs while it is a document of its own. Compose
39
- * several pages into one document and that stops being true: two screens
40
- * declaring `confirm` produce two elements with the same id, and a duplicate
41
- * id is not a rendering bug — the picture is right — but it is a lie told to
42
- * every reader of the DOM. Devtools resolve it to the first match, the
43
- * accessibility tree treats `aria-*` references as pointing at one element,
44
- * and any external tool doing `#confirm` gets an arbitrary one of them.
45
- *
46
- * Default `''` — no prefix, so output is byte-identical to unscoped
47
- * rendering when unset, which is what every existing entry point does.
48
- * `renderSite` sets it per screen and per shell, because it is the one
49
- * renderer that puts pages of different origin in the same document.
50
- *
51
- * Authored intent is not rewritten: the interaction attributes that point at
52
- * an overlay keep the name their author wrote, and their consumer composes
53
- * the scope back on. The prefix belongs to identity, not to intent.
54
- */
55
- idScope?: string;
56
- }
57
- interface RenderResult {
58
- /** Rendered HTML content */
59
- html: string;
60
- /** Generated CSS styles */
61
- css: string;
62
- }
63
- /**
64
- * Result of rendering a single page in isolation (`renderPage`).
65
- * Carries the resolved pixel dimensions so callers (export pipelines, hosts)
66
- * can size their wrapper without re-resolving viewport/device themselves.
67
- */
68
- interface PageRenderResult extends RenderResult {
69
- width: number;
70
- height: number;
71
- }
72
- interface CanvasOptions extends RenderOptions {
73
- /** Gap between auto-laid-out pages, in pixels. Default `64`. */
74
- gap?: number;
75
- }
76
- interface CanvasRenderResult extends RenderResult {
77
- /** Total canvas width — bounding box of all pages. */
78
- width: number;
79
- /** Total canvas height — bounding box of all pages. */
80
- height: number;
81
- }
82
- interface SvgRenderOptions {
83
- /** Width of the SVG viewport */
84
- width?: number;
85
- /** Height of the SVG viewport */
86
- height?: number;
87
- /** Padding around content */
88
- padding?: number;
89
- /** Scale factor */
90
- scale?: number;
91
- /** Background color */
92
- background?: string;
93
- /** Font family */
94
- fontFamily?: string;
95
- /** Theme variant */
96
- theme?: 'light' | 'dark';
97
- }
98
- interface SvgRenderResult {
99
- /** Rendered SVG content */
100
- svg: string;
101
- /** Actual width */
102
- width: number;
103
- /** Actual height */
104
- height: number;
105
- }
106
- interface RenderContext {
107
- /** Resolved render options */
108
- options: Required<RenderOptions>;
109
- /** Theme configuration */
110
- theme: ThemeConfig;
111
- /** Current nesting depth for indentation */
112
- depth: number;
113
- }
114
- interface ThemeColors {
115
- /** Primary action color */
116
- primary: string;
117
- /** Secondary/muted action color */
118
- secondary: string;
119
- /** Success state color */
120
- success: string;
121
- /** Warning state color */
122
- warning: string;
123
- /** Danger/error state color */
124
- danger: string;
125
- /** Muted/disabled color */
126
- muted: string;
127
- /** Background color */
128
- background: string;
129
- /** Foreground/text color */
130
- foreground: string;
131
- /** Border color */
132
- border: string;
133
- }
134
- interface ThemeConfig {
135
- /** Color palette */
136
- colors: ThemeColors;
137
- /** Spacing scale (number -> px value) */
138
- spacing: Record<number, string>;
139
- /** Border radius */
140
- radius: string;
141
- /** Font family */
142
- fontFamily: string;
143
- /** Shadow styles */
144
- shadows: Record<string, string>;
145
- }
146
- /**
147
- * Default wireframe theme using black/white/gray palette
148
- * Follows wireweave design principles for sketch-like appearance
149
- */
150
- declare const defaultTheme: ThemeConfig;
151
- /**
152
- * Dark theme configuration
153
- * Inverts colors for dark mode display
154
- */
155
- declare const darkTheme: ThemeConfig;
156
- /**
157
- * Get theme configuration by name
158
- */
159
- declare function getTheme(name: 'light' | 'dark'): ThemeConfig;
2
+ import { R as RenderContext, b as RenderOptions, f as ThemeConfig, c as RenderResult, A as AnnotationStyle, P as PageRenderResult, C as CanvasOptions, a as CanvasRenderResult, d as SvgRenderOptions, e as SvgRenderResult } from './index-Da_B3eoM.js';
3
+ export { S as SiteOptions, T as ThemeColors, g as darkTheme, h as defaultTheme, i as getTheme, r as renderSite } from './index-Da_B3eoM.js';
160
4
 
161
5
  /**
162
6
  * Base HTML Renderer for wireweave
@@ -320,7 +164,22 @@ declare class HtmlRenderer extends BaseRenderer {
320
164
  * isolated render of the layout and a composed one.
321
165
  */
322
166
  protected renderSlot(): string;
323
- /** Render one linked component invocation with its stable instance marker. */
167
+ /**
168
+ * Render one linked component invocation with its stable instance marker.
169
+ *
170
+ * The wrapper is identified by `data-` attributes and carries no class. It
171
+ * declares `display: contents`, so by construction it has no box of its own
172
+ * and its children lay out as though it were not there — which is the whole
173
+ * point: an invocation must not disturb the layout of what it expands to.
174
+ * A class is the hook a stylesheet paints a box through, and any rule that
175
+ * gave this one a box would defeat `display: contents`; there is therefore
176
+ * no style it could ever legitimately carry. It emitted
177
+ * `${this.prefix}-component-instance` regardless, which no rule in the
178
+ * generated CSS defined and nothing read — a class the markup advertises as
179
+ * styleable while the stylesheet leaves it undefined. Identity that exists
180
+ * to be *queried* rather than *painted* belongs in `data-`, alongside the
181
+ * `data-wf-component` / `data-wf-instance` pair already carrying it.
182
+ */
324
183
  protected renderComponentUse(node: ComponentUseNode): string;
325
184
  /**
326
185
  * Render a list of nodes with no page frame around them.
@@ -656,85 +515,6 @@ interface SiteModel {
656
515
  */
657
516
  declare function buildSiteModel(doc: WireframeDocument): SiteModel;
658
517
 
659
- /**
660
- * `renderSite` — a whole wireframe document as one navigable HTML file.
661
- *
662
- * The other renderers answer "what does this screen look like". This one
663
- * answers "what does this product look like": every page of a document, the
664
- * shells they share, and the moves between them, in a single file with no
665
- * server, no build step and no dependencies. Open it and click.
666
- *
667
- * ## What makes it one document rather than N concatenated
668
- *
669
- * Three things exist once, however many screens there are:
670
- *
671
- * - **the stylesheet** — component styles are generated per document, not per
672
- * page, so N screens cost one copy instead of N;
673
- * - **the runtime** — one inline script drives every screen;
674
- * - **each layout** — a `layout` referenced by `uses=` is emitted once, and
675
- * every page using it is hosted inside that one copy at the `slot` position.
676
- *
677
- * The third is the one that has to be structural. Emitting a copy of the shell
678
- * per screen and hiding all but one with CSS produces the same picture while
679
- * keeping every byte the shared shell exists to remove; the shell is therefore
680
- * shared in the DOM, and only screens are switched.
681
- *
682
- * ## Ids under composition
683
- *
684
- * An authored `id` is unique inside the page that declares it. Once several
685
- * pages share a document that guarantee is gone, so every screen and every
686
- * shell renders under an id scope of its own and the runtime composes the scope
687
- * with the authored name when it looks an overlay up. Two screens can both
688
- * declare `confirm` and each opens its own.
689
- *
690
- * ## What is left alone
691
- *
692
- * A page with no `uses=` renders exactly as `renderPage` renders it, frame and
693
- * all, as its own screen. That is the whole corpus today, so composition is
694
- * something a document opts into and nothing changes shape without being asked.
695
- *
696
- * `render` / `renderToHtml` / `renderCanvas` / `renderToSvg` are untouched:
697
- * `renderSite` is a fifth entry point beside them, not a mode of them.
698
- */
699
-
700
- /**
701
- * Options for {@link renderSite}.
702
- *
703
- * A subset of {@link RenderOptions}: `includeStyles` is meaningless for a
704
- * standalone document that has nowhere else to get its styles from, and
705
- * `sourceAnchors` is omitted because an anchor path names a node's position
706
- * under one page — a shell belongs to every page that uses it and has no single
707
- * such position, so the scheme has nothing true to say about it.
708
- */
709
- interface SiteOptions extends Pick<RenderOptions, 'theme' | 'classPrefix' | 'background' | 'annotationStyle'> {
710
- /** `<title>` of the produced document. Defaults to the entry page's title. */
711
- title?: string;
712
- /**
713
- * The screen shown when the URL carries no fragment.
714
- *
715
- * Named the way everything else names a screen — an `id` or a `title`, put
716
- * through {@link SiteModel.names}, so a caller writes the same string here
717
- * that it would write in a `navigate=` and lands on the same page. Taking an
718
- * index instead would make the option depend on document order, which is the
719
- * one thing a caller holding a screen name does not know.
720
- *
721
- * Defaults to the first page in document order. A name that addresses no
722
- * screen leaves that default in place and is marked on the site container as
723
- * `data-wf-entry-unresolved`, the way an unmet `uses=` is marked on its
724
- * screen: the request stays visible in the artefact instead of disappearing
725
- * between the call and the HTML.
726
- */
727
- entry?: string;
728
- }
729
- /**
730
- * Render a whole document as one navigable, self-contained HTML file.
731
- *
732
- * @param document - Parsed wireframe document
733
- * @param options - Site render options
734
- * @returns A complete HTML document, ready to write to disk and open
735
- */
736
- declare function renderSite(document: WireframeDocument, options?: SiteOptions): string;
737
-
738
518
  /**
739
519
  * Interaction intent → HTML attributes.
740
520
  *
@@ -973,4 +753,4 @@ declare function renderToHtml(document: WireframeDocument, options?: RenderOptio
973
753
  */
974
754
  declare function renderToSvg(document: WireframeDocument, options?: SvgRenderOptions): SvgRenderResult;
975
755
 
976
- export { type AnnotationStyle, type CanvasOptions, type CanvasRenderResult, ENABLED_GUARD_ATTR, EXTERNAL_NAVIGATE_ATTR, HtmlRenderer, INERT_HREF, INTERACTIVE_ATTR_NAMES, type IconData, type IconElement, type InteractiveAttrs, type PageRenderResult, type PlacedPage, type RenderContext, type RenderOptions, type RenderResult, type ShellMiss, type SiteModel, type SiteOptions, type SiteScreen, type SiteShell, type SvgRenderOptions, type SvgRenderResult, TYPED_INTERACTION_ATTR, type ThemeColors, type ThemeConfig, VISIBLE_GUARD_ATTR, anchorIntent, buildSiteModel, createHtmlRenderer, darkTheme, defaultTheme, generateComponentStyles, generateStyles, getIconData, getTheme, guardedOutcomeAttrs, interactiveAttrs, layoutCanvas, lucideIcons, render, renderCanvas, renderIconSvg, renderPage, renderSite, renderToHtml, renderToSvg, renderUnknownIconSvg, resolvePageDimensions };
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 };