@wireweave/core 4.0.0-beta.12 → 4.0.0-beta.13
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/app.cjs +50 -31
- package/dist/app.d.cts +3 -3
- package/dist/app.d.ts +3 -3
- package/dist/app.js +1 -31
- package/dist/chunk-3RWGG5EC.js +296 -342
- package/dist/chunk-4TMDPWPR.cjs +22 -32
- package/dist/{chunk-7VTK6LHL.cjs → chunk-4UZBGIGJ.cjs} +82 -97
- package/dist/chunk-5DGRIQDU.cjs +26 -44
- package/dist/chunk-ETV4XYOV.cjs +4 -6
- package/dist/{chunk-QOS4IC75.js → chunk-FS6A6EJ4.js} +28 -57
- package/dist/chunk-IMUVIIJR.cjs +317 -354
- package/dist/chunk-JJWAFHSV.js +2 -23
- package/dist/chunk-MD6MNOEQ.cjs +121 -142
- package/dist/chunk-PKBMQBKP.js +1 -3
- package/dist/chunk-R5WBZWBC.js +3 -19
- package/dist/chunk-V3HVWC7C.js +1 -32
- package/dist/chunk-XYACLXXF.js +4 -132
- package/dist/chunk-ZPHNXJRY.cjs +158 -180
- package/dist/{index-Da_B3eoM.d.ts → index-BGU_4N4W.d.ts} +2 -2
- package/dist/{index-G906GEtg.d.cts → index-BlNYFaZd.d.cts} +2 -2
- package/dist/{index-CghCKUPx.d.ts → index-Cx4-VXVS.d.ts} +2 -2
- package/dist/{index-Br7pNaf3.d.cts → index-DyXaMSgd.d.cts} +2 -2
- package/dist/index.cjs +738 -419
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +12 -385
- package/dist/interaction.cjs +26 -17
- package/dist/interaction.d.cts +2 -2
- package/dist/interaction.d.ts +2 -2
- package/dist/interaction.js +1 -17
- package/dist/parser.cjs +38 -21
- package/dist/parser.d.cts +3 -3
- package/dist/parser.d.ts +3 -3
- package/dist/parser.js +1 -21
- package/dist/renderer.cjs +124 -68
- package/dist/renderer.d.cts +104 -104
- package/dist/renderer.d.ts +104 -104
- package/dist/renderer.js +3 -68
- package/dist/spec.cjs +94 -49
- package/dist/spec.js +1 -49
- package/dist/{types-vhPCZpAW.d.cts → types-CGRi1k2N.d.cts} +1 -1
- package/dist/{types-vhPCZpAW.d.ts → types-CGRi1k2N.d.ts} +1 -1
- package/dist/{v4-types-Baz9yqAS.d.cts → v4-types-2ORUg6To.d.cts} +1 -1
- package/dist/{v4-types-Baz9yqAS.d.ts → v4-types-2ORUg6To.d.ts} +1 -1
- package/package.json +21 -23
- package/dist/chunk-WV724EAW.js +0 -0
- package/dist/chunk-XENFKHRC.cjs +0 -1
package/dist/parser.js
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
V4ParseError,
|
|
3
|
-
getErrors,
|
|
4
|
-
getV4SourceSpan,
|
|
5
|
-
isValid,
|
|
6
|
-
parse,
|
|
7
|
-
parseV4,
|
|
8
|
-
tryParse,
|
|
9
|
-
tryParseV4
|
|
10
|
-
} from "./chunk-3RWGG5EC.js";
|
|
11
|
-
import "./chunk-PKBMQBKP.js";
|
|
12
|
-
export {
|
|
13
|
-
V4ParseError,
|
|
14
|
-
getErrors,
|
|
15
|
-
getV4SourceSpan,
|
|
16
|
-
isValid,
|
|
17
|
-
parse,
|
|
18
|
-
parseV4,
|
|
19
|
-
tryParse,
|
|
20
|
-
tryParseV4
|
|
21
|
-
};
|
|
1
|
+
export { V4ParseError, getErrors, getV4SourceSpan, isValid, parse, parseV4, tryParse, tryParseV4 } from './chunk-3RWGG5EC.js';
|
package/dist/renderer.cjs
CHANGED
|
@@ -1,68 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk4TMDPWPR_cjs = require('./chunk-4TMDPWPR.cjs');
|
|
4
|
+
var chunk5DGRIQDU_cjs = require('./chunk-5DGRIQDU.cjs');
|
|
5
|
+
var chunkZPHNXJRY_cjs = require('./chunk-ZPHNXJRY.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "layoutCanvas", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunk4TMDPWPR_cjs.layoutCanvas; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "render", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunk4TMDPWPR_cjs.render; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "renderCanvas", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunk4TMDPWPR_cjs.renderCanvas; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "renderToHtml", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunk4TMDPWPR_cjs.renderToHtml; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "renderToSvg", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunk4TMDPWPR_cjs.renderToSvg; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "renderSite", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunk5DGRIQDU_cjs.renderSite; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "ENABLED_GUARD_ATTR", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return chunkZPHNXJRY_cjs.ENABLED_GUARD_ATTR; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "EXTERNAL_NAVIGATE_ATTR", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return chunkZPHNXJRY_cjs.EXTERNAL_NAVIGATE_ATTR; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "HtmlRenderer", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return chunkZPHNXJRY_cjs.HtmlRenderer; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "INERT_HREF", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return chunkZPHNXJRY_cjs.INERT_HREF; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "INTERACTIVE_ATTR_NAMES", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return chunkZPHNXJRY_cjs.INTERACTIVE_ATTR_NAMES; }
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "TYPED_INTERACTION_ATTR", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return chunkZPHNXJRY_cjs.TYPED_INTERACTION_ATTR; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "VISIBLE_GUARD_ATTR", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return chunkZPHNXJRY_cjs.VISIBLE_GUARD_ATTR; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "anchorIntent", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return chunkZPHNXJRY_cjs.anchorIntent; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "buildSiteModel", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return chunkZPHNXJRY_cjs.buildSiteModel; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "createHtmlRenderer", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return chunkZPHNXJRY_cjs.createHtmlRenderer; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "darkTheme", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return chunkZPHNXJRY_cjs.darkTheme; }
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "defaultTheme", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () { return chunkZPHNXJRY_cjs.defaultTheme; }
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "generateComponentStyles", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return chunkZPHNXJRY_cjs.generateComponentStyles; }
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "generateStyles", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: function () { return chunkZPHNXJRY_cjs.generateStyles; }
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "getIconData", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: function () { return chunkZPHNXJRY_cjs.getIconData; }
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "getTheme", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () { return chunkZPHNXJRY_cjs.getTheme; }
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "guardedOutcomeAttrs", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function () { return chunkZPHNXJRY_cjs.guardedOutcomeAttrs; }
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "interactiveAttrs", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () { return chunkZPHNXJRY_cjs.interactiveAttrs; }
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "lucideIcons", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () { return chunkZPHNXJRY_cjs.lucideIcons; }
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(exports, "renderIconSvg", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () { return chunkZPHNXJRY_cjs.renderIconSvg; }
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(exports, "renderPage", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: function () { return chunkZPHNXJRY_cjs.renderPage; }
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "renderUnknownIconSvg", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function () { return chunkZPHNXJRY_cjs.renderUnknownIconSvg; }
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(exports, "resolvePageDimensions", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () { return chunkZPHNXJRY_cjs.resolvePageDimensions; }
|
|
124
|
+
});
|
package/dist/renderer.d.cts
CHANGED
|
@@ -1,6 +1,107 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as RenderContext,
|
|
3
|
-
export {
|
|
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.cjs';
|
|
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-DyXaMSgd.cjs';
|
|
3
|
+
export { e as SiteOptions, f as ThemeColors, g as darkTheme, h as defaultTheme, i as getTheme, r as renderSite } from './index-DyXaMSgd.cjs';
|
|
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;
|
|
4
105
|
|
|
5
106
|
/**
|
|
6
107
|
* Base HTML Renderer for wireweave
|
|
@@ -414,107 +515,6 @@ declare function layoutCanvas(pages: PageNode[], gap?: number): {
|
|
|
414
515
|
*/
|
|
415
516
|
declare function renderCanvas(doc: WireframeDocument, options?: CanvasOptions): CanvasRenderResult;
|
|
416
517
|
|
|
417
|
-
/**
|
|
418
|
-
* The screen model behind `renderSite` — which pages become screens, which
|
|
419
|
-
* shell each one is drawn inside, and what names address it.
|
|
420
|
-
*
|
|
421
|
-
* Nothing here renders. It answers three questions the site renderer and its
|
|
422
|
-
* inline runtime both need the *same* answer to, so the answer is computed once
|
|
423
|
-
* and handed to both.
|
|
424
|
-
*
|
|
425
|
-
* ## Totality
|
|
426
|
-
*
|
|
427
|
-
* A wireframe document can name a layout that does not exist, declare two pages
|
|
428
|
-
* with the same `id`, or use a layout with no `slot`. None of those is a parse
|
|
429
|
-
* error (see the note on `WireframeDocument`), so none of them may stop a
|
|
430
|
-
* render either: every function here is total. Where a document is ambiguous
|
|
431
|
-
* the rule is always **first-wins in document order** — the same rule
|
|
432
|
-
* `extract/transitions.ts` already applies to titles — and the loser is not
|
|
433
|
-
* dropped silently: it is rendered with a `data-wf-*` marker naming what went
|
|
434
|
-
* unmet, so a reader of the output can see it and `validation/` can report it
|
|
435
|
-
* with a source location.
|
|
436
|
-
*/
|
|
437
|
-
|
|
438
|
-
/** Why a page that declared `uses=` is not composed into a shell after all. */
|
|
439
|
-
type ShellMiss =
|
|
440
|
-
/** No `layout` in the document carries that name. */
|
|
441
|
-
'unknown-layout'
|
|
442
|
-
/** The layout exists but has no `slot`, so it has nowhere to put a page. */
|
|
443
|
-
| 'slotless-layout';
|
|
444
|
-
/** One page, as a screen of the composed document. */
|
|
445
|
-
interface SiteScreen {
|
|
446
|
-
/** Position in `documentPages(doc)`. This is the screen's DOM key. */
|
|
447
|
-
index: number;
|
|
448
|
-
page: PageNode;
|
|
449
|
-
/**
|
|
450
|
-
* The variant this screen draws, when its page came from a `variants=` list.
|
|
451
|
-
*
|
|
452
|
-
* Read off the page rather than derived here: `expandVariants` has already
|
|
453
|
-
* turned one variant-bearing page into one page per variant by the time a
|
|
454
|
-
* model is built, so each of those pages is a screen like any other and this
|
|
455
|
-
* only records which one it is.
|
|
456
|
-
*/
|
|
457
|
-
variant?: string;
|
|
458
|
-
/** Name of the shell this screen is composed into, when it has one. */
|
|
459
|
-
shell?: string;
|
|
460
|
-
/** Set when `uses=` was declared and could not be honoured. */
|
|
461
|
-
miss?: {
|
|
462
|
-
uses: string;
|
|
463
|
-
reason: ShellMiss;
|
|
464
|
-
};
|
|
465
|
-
/**
|
|
466
|
-
* The public name this screen *owns* — the name that resolves to it.
|
|
467
|
-
*
|
|
468
|
-
* Absent when the page declared no name, and also when every name it declared
|
|
469
|
-
* is already owned by an earlier page. A screen without a name is still
|
|
470
|
-
* reachable: its index addresses it.
|
|
471
|
-
*/
|
|
472
|
-
name?: string;
|
|
473
|
-
}
|
|
474
|
-
/** One layout, emitted once, hosting every screen that uses it. */
|
|
475
|
-
interface SiteShell {
|
|
476
|
-
/** The `layout <name>` identifier, which `uses=` addresses. */
|
|
477
|
-
name: string;
|
|
478
|
-
layout: LayoutDefinitionNode;
|
|
479
|
-
/** Screens composed into this shell, in document order. */
|
|
480
|
-
screens: SiteScreen[];
|
|
481
|
-
/**
|
|
482
|
-
* Frame size of the shell, resolved from its first screen's page.
|
|
483
|
-
*
|
|
484
|
-
* A layout has no viewport of its own — it is the pages that declare one — so
|
|
485
|
-
* the first page to use it fixes the frame. A later page resolving to a
|
|
486
|
-
* different size is a conflict the author has to settle; it is marked on that
|
|
487
|
-
* screen rather than resized, because silently stretching one page's frame to
|
|
488
|
-
* another's is the kind of change that is invisible until a screenshot.
|
|
489
|
-
*/
|
|
490
|
-
width: number;
|
|
491
|
-
height: number;
|
|
492
|
-
}
|
|
493
|
-
interface SiteModel {
|
|
494
|
-
screens: SiteScreen[];
|
|
495
|
-
/** Shells in first-use order — the order pages first reference them. */
|
|
496
|
-
shells: SiteShell[];
|
|
497
|
-
/**
|
|
498
|
-
* Every name that addresses a screen → that screen's index.
|
|
499
|
-
*
|
|
500
|
-
* Built exactly like `extract/transitions.ts` resolves `navigate`: the `id`
|
|
501
|
-
* namespace is consulted before the `title` namespace, and within each
|
|
502
|
-
* namespace the first page in document order wins. A `navigate` target and a
|
|
503
|
-
* URL fragment therefore land on the same screen the transition graph says
|
|
504
|
-
* they do — one resolution rule, two consumers.
|
|
505
|
-
*/
|
|
506
|
-
names: Map<string, number>;
|
|
507
|
-
/** Screen shown when no fragment selects one. `-1` for a document with no pages. */
|
|
508
|
-
entry: number;
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Derive the screen model of a document.
|
|
512
|
-
*
|
|
513
|
-
* Pure and deterministic: same document in, same model out, whatever the
|
|
514
|
-
* document contains.
|
|
515
|
-
*/
|
|
516
|
-
declare function buildSiteModel(doc: WireframeDocument): SiteModel;
|
|
517
|
-
|
|
518
518
|
/**
|
|
519
519
|
* Interaction intent → HTML attributes.
|
|
520
520
|
*
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,6 +1,107 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { R as RenderContext,
|
|
3
|
-
export {
|
|
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;
|
|
4
105
|
|
|
5
106
|
/**
|
|
6
107
|
* Base HTML Renderer for wireweave
|
|
@@ -414,107 +515,6 @@ declare function layoutCanvas(pages: PageNode[], gap?: number): {
|
|
|
414
515
|
*/
|
|
415
516
|
declare function renderCanvas(doc: WireframeDocument, options?: CanvasOptions): CanvasRenderResult;
|
|
416
517
|
|
|
417
|
-
/**
|
|
418
|
-
* The screen model behind `renderSite` — which pages become screens, which
|
|
419
|
-
* shell each one is drawn inside, and what names address it.
|
|
420
|
-
*
|
|
421
|
-
* Nothing here renders. It answers three questions the site renderer and its
|
|
422
|
-
* inline runtime both need the *same* answer to, so the answer is computed once
|
|
423
|
-
* and handed to both.
|
|
424
|
-
*
|
|
425
|
-
* ## Totality
|
|
426
|
-
*
|
|
427
|
-
* A wireframe document can name a layout that does not exist, declare two pages
|
|
428
|
-
* with the same `id`, or use a layout with no `slot`. None of those is a parse
|
|
429
|
-
* error (see the note on `WireframeDocument`), so none of them may stop a
|
|
430
|
-
* render either: every function here is total. Where a document is ambiguous
|
|
431
|
-
* the rule is always **first-wins in document order** — the same rule
|
|
432
|
-
* `extract/transitions.ts` already applies to titles — and the loser is not
|
|
433
|
-
* dropped silently: it is rendered with a `data-wf-*` marker naming what went
|
|
434
|
-
* unmet, so a reader of the output can see it and `validation/` can report it
|
|
435
|
-
* with a source location.
|
|
436
|
-
*/
|
|
437
|
-
|
|
438
|
-
/** Why a page that declared `uses=` is not composed into a shell after all. */
|
|
439
|
-
type ShellMiss =
|
|
440
|
-
/** No `layout` in the document carries that name. */
|
|
441
|
-
'unknown-layout'
|
|
442
|
-
/** The layout exists but has no `slot`, so it has nowhere to put a page. */
|
|
443
|
-
| 'slotless-layout';
|
|
444
|
-
/** One page, as a screen of the composed document. */
|
|
445
|
-
interface SiteScreen {
|
|
446
|
-
/** Position in `documentPages(doc)`. This is the screen's DOM key. */
|
|
447
|
-
index: number;
|
|
448
|
-
page: PageNode;
|
|
449
|
-
/**
|
|
450
|
-
* The variant this screen draws, when its page came from a `variants=` list.
|
|
451
|
-
*
|
|
452
|
-
* Read off the page rather than derived here: `expandVariants` has already
|
|
453
|
-
* turned one variant-bearing page into one page per variant by the time a
|
|
454
|
-
* model is built, so each of those pages is a screen like any other and this
|
|
455
|
-
* only records which one it is.
|
|
456
|
-
*/
|
|
457
|
-
variant?: string;
|
|
458
|
-
/** Name of the shell this screen is composed into, when it has one. */
|
|
459
|
-
shell?: string;
|
|
460
|
-
/** Set when `uses=` was declared and could not be honoured. */
|
|
461
|
-
miss?: {
|
|
462
|
-
uses: string;
|
|
463
|
-
reason: ShellMiss;
|
|
464
|
-
};
|
|
465
|
-
/**
|
|
466
|
-
* The public name this screen *owns* — the name that resolves to it.
|
|
467
|
-
*
|
|
468
|
-
* Absent when the page declared no name, and also when every name it declared
|
|
469
|
-
* is already owned by an earlier page. A screen without a name is still
|
|
470
|
-
* reachable: its index addresses it.
|
|
471
|
-
*/
|
|
472
|
-
name?: string;
|
|
473
|
-
}
|
|
474
|
-
/** One layout, emitted once, hosting every screen that uses it. */
|
|
475
|
-
interface SiteShell {
|
|
476
|
-
/** The `layout <name>` identifier, which `uses=` addresses. */
|
|
477
|
-
name: string;
|
|
478
|
-
layout: LayoutDefinitionNode;
|
|
479
|
-
/** Screens composed into this shell, in document order. */
|
|
480
|
-
screens: SiteScreen[];
|
|
481
|
-
/**
|
|
482
|
-
* Frame size of the shell, resolved from its first screen's page.
|
|
483
|
-
*
|
|
484
|
-
* A layout has no viewport of its own — it is the pages that declare one — so
|
|
485
|
-
* the first page to use it fixes the frame. A later page resolving to a
|
|
486
|
-
* different size is a conflict the author has to settle; it is marked on that
|
|
487
|
-
* screen rather than resized, because silently stretching one page's frame to
|
|
488
|
-
* another's is the kind of change that is invisible until a screenshot.
|
|
489
|
-
*/
|
|
490
|
-
width: number;
|
|
491
|
-
height: number;
|
|
492
|
-
}
|
|
493
|
-
interface SiteModel {
|
|
494
|
-
screens: SiteScreen[];
|
|
495
|
-
/** Shells in first-use order — the order pages first reference them. */
|
|
496
|
-
shells: SiteShell[];
|
|
497
|
-
/**
|
|
498
|
-
* Every name that addresses a screen → that screen's index.
|
|
499
|
-
*
|
|
500
|
-
* Built exactly like `extract/transitions.ts` resolves `navigate`: the `id`
|
|
501
|
-
* namespace is consulted before the `title` namespace, and within each
|
|
502
|
-
* namespace the first page in document order wins. A `navigate` target and a
|
|
503
|
-
* URL fragment therefore land on the same screen the transition graph says
|
|
504
|
-
* they do — one resolution rule, two consumers.
|
|
505
|
-
*/
|
|
506
|
-
names: Map<string, number>;
|
|
507
|
-
/** Screen shown when no fragment selects one. `-1` for a document with no pages. */
|
|
508
|
-
entry: number;
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Derive the screen model of a document.
|
|
512
|
-
*
|
|
513
|
-
* Pure and deterministic: same document in, same model out, whatever the
|
|
514
|
-
* document contains.
|
|
515
|
-
*/
|
|
516
|
-
declare function buildSiteModel(doc: WireframeDocument): SiteModel;
|
|
517
|
-
|
|
518
518
|
/**
|
|
519
519
|
* Interaction intent → HTML attributes.
|
|
520
520
|
*
|