@wireweave/core 3.1.0-beta.3 → 3.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6851 -4530
- package/dist/index.d.cts +289 -5
- package/dist/index.d.ts +289 -5
- package/dist/index.js +6837 -4530
- package/dist/parser.cjs +1896 -927
- package/dist/parser.d.cts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/parser.js +1896 -927
- package/dist/renderer.cjs +1476 -171
- package/dist/renderer.d.cts +90 -22
- package/dist/renderer.d.ts +90 -22
- package/dist/renderer.js +1476 -171
- package/dist/{types-BDaNyWMR.d.cts → types-Bb3NSNUs.d.cts} +89 -7
- package/dist/{types-BDaNyWMR.d.ts → types-Bb3NSNUs.d.ts} +89 -7
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { h as AnyNode, A as AccordionNode, a as AlertNode, j as AvatarNode, B as BadgeNode, r as BreadcrumbNode, s as ButtonNode, C as CardNode, w as CheckboxNode, x as ColNode, z as ContainerComponentNode,
|
|
2
|
-
export { b as AlertVariant, c as AlignValue, d as AnchorPosition, e as AnnotationItemNode, f as AnnotationNode, g as AnnotationsNode, i as AppearanceProps, k as AvatarSize, l as AvatarSizeToken, m as BadgeSize, n as BadgeSizeToken, o as BadgeVariant, p as BaseNode, q as BreadcrumbItem, t as ButtonSize, u as ButtonSizeToken, v as ButtonVariant, y as CommonProps, G as DirectionValue,
|
|
1
|
+
import { h as AnyNode, A as AccordionNode, a as AlertNode, j as AvatarNode, B as BadgeNode, r as BreadcrumbNode, s as ButtonNode, C as CardNode, w as CheckboxNode, x as ColNode, z as ComponentDefinitionNode, H as ComponentUseNode, I as ContainerComponentNode, J as ContainerNode, K as DataNode, L as DefinitionNode, N as DisplayNode, O as DividerComponentNode, Q as DrawerNode, T as DropdownNode, U as FeedbackNode, W as FooterNode, X as GridNode, _ as HeaderNode, a0 as IconNode, a3 as ImageNode, a4 as InputComponentNode, a5 as InputNode, ab as LayoutDefinitionNode, ac as LayoutNode, ad as LeafNode, ae as LinkNode, ag as ListNode, ah as MainNode, ak as ModalNode, aq as NavNode, ar as NavigationNode, as as NodeType, at as OverlayNode, au as PageNode, av as PlaceholderNode, aw as PopoverNode, az as ProgressNode, aA as RadioNode, aC as RowNode, aD as SectionNode, aE as SelectNode, aH as SidebarNode, aJ as SliderNode, aK as SlotNode, aO as SpinnerNode, aW as SwitchNode, aY as TableNode, aZ as TabsNode, a$ as TextContentNode, b0 as TextNode, b4 as TextareaNode, b6 as TitleNode, b7 as ToastNode, b9 as TooltipNode, be as WireframeDocument, aL as SourceLocation, aS as StateDeclaration, aT as StateGuard, a7 as InteractionEffect, a6 as InputType } from './types-Bb3NSNUs.js';
|
|
2
|
+
export { b as AlertVariant, c as AlignValue, d as AnchorPosition, e as AnnotationItemNode, f as AnnotationNode, g as AnnotationsNode, i as AppearanceProps, k as AvatarSize, l as AvatarSizeToken, m as BadgeSize, n as BadgeSizeToken, o as BadgeVariant, p as BaseNode, q as BreadcrumbItem, t as ButtonSize, u as ButtonSizeToken, v as ButtonVariant, y as CommonProps, D as ComponentInputValue, E as ComponentParameter, F as ComponentParameterType, G as ComponentSlotFill, M as DirectionValue, P as DividerNode, R as DrawerPosition, S as DropdownItemNode, V as FlexProps, Y as GridProps, Z as GuardedOutcomeProps, $ as HeightValue, a1 as IconSize, a2 as IconSizeToken, a8 as InteractionHandler, a9 as InteractiveProps, aa as JustifyValue, af as ListItemNode, ai as MarkerColor, aj as MarkerNode, al as NavBlockItem, am as NavChild, an as NavDivider, ao as NavGroupNode, ap as NavItem, ax as Position, ay as PositionProps, aB as RelativeNode, aF as SelectOption, aG as ShadowValue, aI as SizeProps, aM as SpacingProps, aN as SpacingValue, aP as SpinnerSize, aQ as SpinnerSizeToken, aR as StackNode, aU as StateValue, aV as StateValueType, aX as TabNode, a_ as TextAlign, b1 as TextSize, b2 as TextSizeToken, b3 as TextWeight, b5 as TitleLevel, b8 as ToastPosition, ba as TooltipPosition, bb as TopLevelNode, bc as ValueWithUnit, bd as WidthValue } from './types-Bb3NSNUs.js';
|
|
3
3
|
export { ExpectedToken, ParseError, ParseErrorInfo, ParseOptions, ParseResult, getErrors, isValid, parse, tryParse } from './parser.js';
|
|
4
|
-
|
|
4
|
+
import { SiteOptions } from './renderer.js';
|
|
5
|
+
export { AnnotationStyle, CanvasOptions, CanvasRenderResult, HtmlRenderer, IconData, IconElement, InteractiveAttrs, PageRenderResult, PlacedPage, RenderContext, RenderOptions, RenderResult, ShellMiss, SiteModel, SiteScreen, SiteShell, SvgRenderOptions, SvgRenderResult, ThemeColors, ThemeConfig, anchorIntent, buildSiteModel, createHtmlRenderer, darkTheme, defaultTheme, generateComponentStyles, generateStyles, getIconData, getTheme, layoutCanvas, lucideIcons, render, renderCanvas, renderIconSvg, renderPage, renderSite, renderToHtml, renderToSvg, renderUnknownIconSvg, resolvePageDimensions } from './renderer.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Type guards for wireweave AST
|
|
@@ -16,7 +17,10 @@ declare function hasChildren(node: AnyNode): node is AnyNode & {
|
|
|
16
17
|
declare function isLeafNode(node: AnyNode): node is LeafNode;
|
|
17
18
|
declare function isLayoutNode(node: AnyNode): node is LayoutNode;
|
|
18
19
|
declare function isPageNode(node: AnyNode): node is PageNode;
|
|
20
|
+
declare function isDefinitionNode(node: AnyNode): node is DefinitionNode;
|
|
19
21
|
declare function isLayoutDefinitionNode(node: AnyNode): node is LayoutDefinitionNode;
|
|
22
|
+
declare function isComponentDefinitionNode(node: AnyNode): node is ComponentDefinitionNode;
|
|
23
|
+
declare function isComponentUseNode(node: AnyNode): node is ComponentUseNode;
|
|
20
24
|
declare function isSlotNode(node: AnyNode): node is SlotNode;
|
|
21
25
|
declare function isHeaderNode(node: AnyNode): node is HeaderNode;
|
|
22
26
|
declare function isMainNode(node: AnyNode): node is MainNode;
|
|
@@ -303,7 +307,7 @@ declare function wrapInPreviewContainer(html: string, viewport: ViewportSize, op
|
|
|
303
307
|
/**
|
|
304
308
|
* Attribute value type
|
|
305
309
|
*/
|
|
306
|
-
type AttributeValueType = 'boolean' | 'number' | 'string' | 'string[]' | 'enum';
|
|
310
|
+
type AttributeValueType = 'boolean' | 'number' | 'string' | 'string[]' | 'object' | 'object[]' | 'enum';
|
|
307
311
|
/**
|
|
308
312
|
* Attribute definition
|
|
309
313
|
*/
|
|
@@ -393,6 +397,8 @@ declare const ATTRIBUTE_MAP: ReadonlyMap<string, AttributeSpec>;
|
|
|
393
397
|
* Common attributes available to most components
|
|
394
398
|
*/
|
|
395
399
|
declare const COMMON_ATTRIBUTES: readonly string[];
|
|
400
|
+
/** Attributes shared by elements that can trigger interactions. */
|
|
401
|
+
declare const INTERACTIVE_ATTRIBUTES: readonly string[];
|
|
396
402
|
|
|
397
403
|
/**
|
|
398
404
|
* Wireweave DSL Validation
|
|
@@ -993,6 +999,64 @@ interface AnalysisOptions {
|
|
|
993
999
|
*/
|
|
994
1000
|
declare function analyze(doc: WireframeDocument, options?: AnalysisOptions): AnalysisResult;
|
|
995
1001
|
|
|
1002
|
+
/** Overlay toggle is distinct from the typed boolean-state `toggle` effect. */
|
|
1003
|
+
type NormalizedInteractionEffect = InteractionEffect | {
|
|
1004
|
+
kind: 'toggle-overlay';
|
|
1005
|
+
target: string;
|
|
1006
|
+
} | {
|
|
1007
|
+
kind: 'legacy-action';
|
|
1008
|
+
action: string;
|
|
1009
|
+
};
|
|
1010
|
+
interface NormalizedInteractionHandler {
|
|
1011
|
+
event: 'click';
|
|
1012
|
+
guard?: StateGuard;
|
|
1013
|
+
effects: NormalizedInteractionEffect[];
|
|
1014
|
+
}
|
|
1015
|
+
interface NormalizedInteraction {
|
|
1016
|
+
screenIndex: number;
|
|
1017
|
+
source: 'screen' | 'layout';
|
|
1018
|
+
signature: string;
|
|
1019
|
+
handler: NormalizedInteractionHandler;
|
|
1020
|
+
/** Present when this entry came from a legacy scalar intent attribute. */
|
|
1021
|
+
legacyKind?: InteractionKind;
|
|
1022
|
+
trigger: {
|
|
1023
|
+
nodeType: NodeType;
|
|
1024
|
+
label?: string;
|
|
1025
|
+
loc?: SourceLocation;
|
|
1026
|
+
item?: {
|
|
1027
|
+
index: number;
|
|
1028
|
+
};
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
type InteractionDiagnosticCode = 'invalid-state-declaration' | 'duplicate-state-declaration' | 'invalid-interaction-handler' | 'unknown-legacy-action';
|
|
1032
|
+
interface InteractionDiagnostic {
|
|
1033
|
+
code: InteractionDiagnosticCode;
|
|
1034
|
+
message: string;
|
|
1035
|
+
screenIndex?: number;
|
|
1036
|
+
source?: 'screen' | 'layout';
|
|
1037
|
+
loc?: SourceLocation;
|
|
1038
|
+
}
|
|
1039
|
+
interface InteractionModel {
|
|
1040
|
+
states: StateDeclaration[];
|
|
1041
|
+
interactions: NormalizedInteraction[];
|
|
1042
|
+
diagnostics: InteractionDiagnostic[];
|
|
1043
|
+
}
|
|
1044
|
+
/** Normalize a guard object emitted by the generic DSL object grammar. */
|
|
1045
|
+
declare function normalizeStateGuard(value: unknown): StateGuard | undefined;
|
|
1046
|
+
/**
|
|
1047
|
+
* Normalize the public `on=` shape. Malformed handlers are inert; diagnostics
|
|
1048
|
+
* are added by {@link collectInteractions}, where screen/source context exists.
|
|
1049
|
+
*/
|
|
1050
|
+
declare function normalizeInteractionHandlers(value: unknown): NormalizedInteractionHandler[];
|
|
1051
|
+
/** Stable payload shared by rendered DOM markers and the runtime registry. */
|
|
1052
|
+
declare function interactionSignature(handler: NormalizedInteractionHandler): string;
|
|
1053
|
+
/**
|
|
1054
|
+
* The canonical interaction/state source for graph extraction and renderSite.
|
|
1055
|
+
* Layout intent is expanded once per screen using that layout, so shared chrome
|
|
1056
|
+
* has the same reachable routes in both consumers.
|
|
1057
|
+
*/
|
|
1058
|
+
declare function collectInteractions(doc: WireframeDocument): InteractionModel;
|
|
1059
|
+
|
|
996
1060
|
/**
|
|
997
1061
|
* Types for the deterministic extraction module.
|
|
998
1062
|
*
|
|
@@ -1105,6 +1169,7 @@ interface ScreenFields {
|
|
|
1105
1169
|
* A node in the screen-transition graph.
|
|
1106
1170
|
*/
|
|
1107
1171
|
interface TransitionScreen {
|
|
1172
|
+
id?: string;
|
|
1108
1173
|
title?: string;
|
|
1109
1174
|
index: number;
|
|
1110
1175
|
loc?: SourceLocation;
|
|
@@ -1115,6 +1180,7 @@ interface TransitionScreen {
|
|
|
1115
1180
|
interface TransitionEdge {
|
|
1116
1181
|
from: {
|
|
1117
1182
|
pageIndex: number;
|
|
1183
|
+
id?: string;
|
|
1118
1184
|
title?: string;
|
|
1119
1185
|
};
|
|
1120
1186
|
/**
|
|
@@ -1124,11 +1190,18 @@ interface TransitionEdge {
|
|
|
1124
1190
|
*/
|
|
1125
1191
|
to: {
|
|
1126
1192
|
pageIndex: number;
|
|
1193
|
+
id?: string;
|
|
1127
1194
|
title?: string;
|
|
1128
1195
|
} | null;
|
|
1129
1196
|
/** The raw target string as written in the DSL. */
|
|
1130
1197
|
target: string;
|
|
1131
1198
|
kind: InteractionKind;
|
|
1199
|
+
/** Typed event metadata; absent for legacy scalar interaction attributes. */
|
|
1200
|
+
event?: 'click';
|
|
1201
|
+
guard?: StateGuard;
|
|
1202
|
+
effect?: NormalizedInteractionEffect;
|
|
1203
|
+
/** A shared-layout edge is expanded once for every screen using that layout. */
|
|
1204
|
+
source?: 'screen' | 'layout';
|
|
1132
1205
|
/**
|
|
1133
1206
|
* What fired the transition. For a component node, `nodeType` is that node's
|
|
1134
1207
|
* type. For a menu item inside a nav/dropdown/breadcrumb, `nodeType` is the
|
|
@@ -1333,4 +1406,215 @@ declare function getNodeSource(source: string, doc: WireframeDocument, path: str
|
|
|
1333
1406
|
*/
|
|
1334
1407
|
declare function buildDomTree(doc: WireframeDocument, pageIndexBase?: number): DomTreeNode[];
|
|
1335
1408
|
|
|
1336
|
-
|
|
1409
|
+
/** A source file and exact span within it. */
|
|
1410
|
+
interface AppSourceSpan {
|
|
1411
|
+
sourceId: string;
|
|
1412
|
+
location: SourceLocation;
|
|
1413
|
+
}
|
|
1414
|
+
/** The two reusable definition kinds addressable by an app reference. */
|
|
1415
|
+
type AppDefinitionKind = 'layout' | 'component';
|
|
1416
|
+
/** Every stable, top-level node kind in a linked application. */
|
|
1417
|
+
type AppNodeKind = AppDefinitionKind | 'screen';
|
|
1418
|
+
/** A manifest entry assigning one module its stable application namespace. */
|
|
1419
|
+
interface AppManifestModule {
|
|
1420
|
+
id: string;
|
|
1421
|
+
namespace: string;
|
|
1422
|
+
location: SourceLocation;
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Core-owned manifest describing the modules that make up one application.
|
|
1426
|
+
* @public
|
|
1427
|
+
*/
|
|
1428
|
+
interface AppManifest {
|
|
1429
|
+
id: string;
|
|
1430
|
+
sourceId: string;
|
|
1431
|
+
modules: readonly AppManifestModule[];
|
|
1432
|
+
}
|
|
1433
|
+
/** A reference to a layout or component, local to the owner namespace by default. */
|
|
1434
|
+
interface AppReferenceInput {
|
|
1435
|
+
kind: AppDefinitionKind;
|
|
1436
|
+
id: string;
|
|
1437
|
+
namespace?: string;
|
|
1438
|
+
source: AppSourceSpan;
|
|
1439
|
+
}
|
|
1440
|
+
interface AppNodeInput<TNode> {
|
|
1441
|
+
/** Stable identifier within the module namespace and node kind. */
|
|
1442
|
+
id: string;
|
|
1443
|
+
node: TNode;
|
|
1444
|
+
source: AppSourceSpan;
|
|
1445
|
+
}
|
|
1446
|
+
/** A layout declaration and the reusable definitions it depends on. */
|
|
1447
|
+
interface AppLayoutInput extends AppNodeInput<LayoutDefinitionNode> {
|
|
1448
|
+
references?: readonly AppReferenceInput[];
|
|
1449
|
+
}
|
|
1450
|
+
/** A component declaration and the reusable definitions it depends on. */
|
|
1451
|
+
interface AppComponentInput extends AppNodeInput<ComponentDefinitionNode> {
|
|
1452
|
+
references?: readonly AppReferenceInput[];
|
|
1453
|
+
}
|
|
1454
|
+
/** A screen declaration and the layouts/components it consumes. */
|
|
1455
|
+
interface AppScreenInput extends AppNodeInput<PageNode> {
|
|
1456
|
+
references?: readonly AppReferenceInput[];
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* One parsed Wireweave module supplied to the Core linker.
|
|
1460
|
+
* @public
|
|
1461
|
+
*/
|
|
1462
|
+
interface AppModuleInput {
|
|
1463
|
+
id: string;
|
|
1464
|
+
source: AppSourceSpan;
|
|
1465
|
+
layouts: readonly AppLayoutInput[];
|
|
1466
|
+
components: readonly AppComponentInput[];
|
|
1467
|
+
screens: readonly AppScreenInput[];
|
|
1468
|
+
}
|
|
1469
|
+
/** Opaque stable identity assigned by the linker. */
|
|
1470
|
+
type AppNodeId = string & {
|
|
1471
|
+
readonly __appNodeId: unique symbol;
|
|
1472
|
+
};
|
|
1473
|
+
/** Stable identity of one expanded component invocation. */
|
|
1474
|
+
type AppComponentInstanceId = string & {
|
|
1475
|
+
readonly __appComponentInstanceId: unique symbol;
|
|
1476
|
+
};
|
|
1477
|
+
/** A reference whose target has been resolved to stable app identity. */
|
|
1478
|
+
interface ResolvedAppReference {
|
|
1479
|
+
kind: AppDefinitionKind;
|
|
1480
|
+
id: string;
|
|
1481
|
+
namespace: string;
|
|
1482
|
+
targetId: AppNodeId;
|
|
1483
|
+
source: AppSourceSpan;
|
|
1484
|
+
}
|
|
1485
|
+
interface ResolvedAppNode<TKind extends AppNodeKind, TNode> {
|
|
1486
|
+
nodeId: AppNodeId;
|
|
1487
|
+
kind: TKind;
|
|
1488
|
+
id: string;
|
|
1489
|
+
moduleId: string;
|
|
1490
|
+
namespace: string;
|
|
1491
|
+
node: TNode;
|
|
1492
|
+
source: AppSourceSpan;
|
|
1493
|
+
references: readonly ResolvedAppReference[];
|
|
1494
|
+
}
|
|
1495
|
+
type ResolvedAppLayout = ResolvedAppNode<'layout', LayoutDefinitionNode>;
|
|
1496
|
+
type ResolvedAppComponent = ResolvedAppNode<'component', ComponentDefinitionNode>;
|
|
1497
|
+
type ResolvedAppScreen = ResolvedAppNode<'screen', PageNode>;
|
|
1498
|
+
/** Stable node-to-source mapping emitted in manifest order. */
|
|
1499
|
+
interface AppSourceMapEntry {
|
|
1500
|
+
nodeId: AppNodeId;
|
|
1501
|
+
source: AppSourceSpan;
|
|
1502
|
+
}
|
|
1503
|
+
/** One resolved module in a linked application document. */
|
|
1504
|
+
interface ResolvedAppModule {
|
|
1505
|
+
id: string;
|
|
1506
|
+
namespace: string;
|
|
1507
|
+
layouts: readonly ResolvedAppLayout[];
|
|
1508
|
+
components: readonly ResolvedAppComponent[];
|
|
1509
|
+
screens: readonly ResolvedAppScreen[];
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Core's dependency-closed representation of a multi-module application.
|
|
1513
|
+
* @public
|
|
1514
|
+
*/
|
|
1515
|
+
interface AppDocument {
|
|
1516
|
+
type: 'AppDocument';
|
|
1517
|
+
id: string;
|
|
1518
|
+
modules: readonly ResolvedAppModule[];
|
|
1519
|
+
layouts: readonly ResolvedAppLayout[];
|
|
1520
|
+
components: readonly ResolvedAppComponent[];
|
|
1521
|
+
screens: readonly ResolvedAppScreen[];
|
|
1522
|
+
sourceMap: readonly AppSourceMapEntry[];
|
|
1523
|
+
}
|
|
1524
|
+
/** Stable machine-readable linker diagnostic kinds. */
|
|
1525
|
+
type AppLinkDiagnosticCode = 'missing-module' | 'duplicate-module' | 'duplicate-namespace' | 'duplicate-definition' | 'duplicate-screen' | 'missing-reference' | 'cyclic-reference' | 'invalid-component-definition' | 'invalid-component-invocation';
|
|
1526
|
+
/**
|
|
1527
|
+
* A deterministic linker failure with the exact source span that caused it.
|
|
1528
|
+
* @public
|
|
1529
|
+
*/
|
|
1530
|
+
interface AppLinkDiagnostic {
|
|
1531
|
+
code: AppLinkDiagnosticCode;
|
|
1532
|
+
message: string;
|
|
1533
|
+
source: AppSourceSpan;
|
|
1534
|
+
}
|
|
1535
|
+
type AppLinkResult = {
|
|
1536
|
+
ok: true;
|
|
1537
|
+
document: AppDocument;
|
|
1538
|
+
diagnostics: readonly [];
|
|
1539
|
+
} | {
|
|
1540
|
+
ok: false;
|
|
1541
|
+
document: null;
|
|
1542
|
+
diagnostics: readonly AppLinkDiagnostic[];
|
|
1543
|
+
};
|
|
1544
|
+
|
|
1545
|
+
/**
|
|
1546
|
+
* Create the stable identity used by linked documents and source maps.
|
|
1547
|
+
* Each segment is encoded so punctuation in authored identifiers cannot collide.
|
|
1548
|
+
*
|
|
1549
|
+
* @public
|
|
1550
|
+
*/
|
|
1551
|
+
declare function createAppNodeId(namespace: string, kind: AppNodeKind, id: string): AppNodeId;
|
|
1552
|
+
/** Create the stable identity of an invocation from its owner and structural path. */
|
|
1553
|
+
declare function createAppComponentInstanceId(ownerId: AppNodeId, targetId: AppNodeId, path: readonly number[]): AppComponentInstanceId;
|
|
1554
|
+
/**
|
|
1555
|
+
* Link parsed Wireweave modules into one dependency-closed application document.
|
|
1556
|
+
* The function is pure and returns no document whenever validation finds an error.
|
|
1557
|
+
*
|
|
1558
|
+
* @public
|
|
1559
|
+
* @example
|
|
1560
|
+
* `const result = linkApp(manifest, modules)`
|
|
1561
|
+
*/
|
|
1562
|
+
declare function linkApp(manifest: AppManifest, modules: readonly AppModuleInput[]): AppLinkResult;
|
|
1563
|
+
|
|
1564
|
+
/**
|
|
1565
|
+
* Options for {@link compileApp}.
|
|
1566
|
+
*
|
|
1567
|
+
* Application artifacts always use neutral annotation styling. The option is
|
|
1568
|
+
* intentionally omitted here so every compiler caller gets the same wireframe
|
|
1569
|
+
* presentation while legacy render entry points keep their historical default.
|
|
1570
|
+
*
|
|
1571
|
+
* @public
|
|
1572
|
+
*/
|
|
1573
|
+
type CompileAppOptions = Omit<SiteOptions, 'annotationStyle'>;
|
|
1574
|
+
/** Result of linking modules and compiling the resulting application. @public */
|
|
1575
|
+
type AppCompileResult = {
|
|
1576
|
+
ok: true;
|
|
1577
|
+
document: AppDocument;
|
|
1578
|
+
html: string;
|
|
1579
|
+
diagnostics: readonly [];
|
|
1580
|
+
} | {
|
|
1581
|
+
ok: false;
|
|
1582
|
+
document: null;
|
|
1583
|
+
html: null;
|
|
1584
|
+
diagnostics: readonly AppLinkDiagnostic[];
|
|
1585
|
+
};
|
|
1586
|
+
/**
|
|
1587
|
+
* Compile one linked application into a deterministic, self-contained HTML document.
|
|
1588
|
+
*
|
|
1589
|
+
* The linker has already expanded component invocations and resolved shared
|
|
1590
|
+
* layouts. This function only projects those resolved nodes into the generic
|
|
1591
|
+
* site compositor, using stable app identities for layout names so modules
|
|
1592
|
+
* cannot collide.
|
|
1593
|
+
*
|
|
1594
|
+
* @public
|
|
1595
|
+
* @example
|
|
1596
|
+
* `const html = compileApp(linked.document)`
|
|
1597
|
+
*/
|
|
1598
|
+
declare function compileApp(document: AppDocument, options?: CompileAppOptions): string;
|
|
1599
|
+
/**
|
|
1600
|
+
* Link application modules and compile them when linking succeeds.
|
|
1601
|
+
*
|
|
1602
|
+
* Linker diagnostics remain explicit and no partial HTML is emitted on failure.
|
|
1603
|
+
*
|
|
1604
|
+
* @public
|
|
1605
|
+
* @example
|
|
1606
|
+
* `const result = linkAndCompileApp(manifest, modules)`
|
|
1607
|
+
*/
|
|
1608
|
+
declare function linkAndCompileApp(manifest: AppManifest, modules: readonly AppModuleInput[], options?: CompileAppOptions): AppCompileResult;
|
|
1609
|
+
|
|
1610
|
+
/**
|
|
1611
|
+
* Whether a `navigate` target is a URL rather than the name of a page.
|
|
1612
|
+
*
|
|
1613
|
+
* The renderer and transition extractor share this predicate so an outbound
|
|
1614
|
+
* target cannot be rendered as a URL while simultaneously being reported as a
|
|
1615
|
+
* broken page reference. Whitespace-bearing values are treated as page names;
|
|
1616
|
+
* valid URLs must encode spaces, while page titles commonly contain them.
|
|
1617
|
+
*/
|
|
1618
|
+
declare function isUrlTarget(target: string | undefined): target is string;
|
|
1619
|
+
|
|
1620
|
+
export { ANCHOR_LOC_ATTR, ANCHOR_PATH_ATTR, ATTRIBUTE_MAP, ATTRIBUTE_SPECS, type AccessibilityMetrics, AccordionNode, AlertNode, type AnalysisOptions, type AnalysisResult, type AnchorEntry, AnyNode, type AppCompileResult, type AppComponentInput, type AppComponentInstanceId, type AppDefinitionKind, type AppDocument, type AppLayoutInput, type AppLinkDiagnostic, type AppLinkDiagnosticCode, type AppLinkResult, type AppManifest, type AppManifestModule, type AppModuleInput, type AppNodeId, type AppNodeKind, type AppReferenceInput, type AppScreenInput, type AppSourceMapEntry, type AppSourceSpan, type AttributeChange, type AttributeSpec, type AttributeValueType, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, COMMON_ATTRIBUTES, COMPONENT_MAP, COMPONENT_SPECS, CardNode, CheckboxNode, ColNode, type CompileAppOptions, type ComplexityMetrics, type ComponentCategory, ComponentDefinitionNode, type ComponentSpec, type ComponentStats, ComponentUseNode, ContainerComponentNode, ContainerNode, type ContentAnalysis, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, DefinitionNode, type DiffChangeType, type DiffOptions, type DiffResult, type DiffSummary, DisplayNode, DividerComponentNode, type DomTreeNode, DrawerNode, DropdownNode, type ExportOptions, FeedbackNode, type FigmaAutoLayout, type FigmaColor, type FigmaCounterAxisAlign, type FigmaExportResult, type FigmaLayoutMode, type FigmaNode, type FigmaNodeType, type FigmaPrimaryAxisAlign, type FigmaSize, type FigmaSizingMode, type FigmaSolidFill, type FigmaStroke, type FigmaTextAlign, type FigmaTextStyle, FooterNode, GridNode, HeaderNode, INTERACTIVE_ATTRIBUTES, IconNode, ImageNode, InputComponentNode, InputNode, InputType, type InteractionDiagnostic, type InteractionDiagnosticCode, InteractionEffect, type InteractionKind, type InteractionModel, type JsonExportResult, type JsonNode, type LayoutAnalysis, LayoutDefinitionNode, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NODE_TYPE_MAP, NavNode, NavigationNode, type NodeChange, type NodePredicate, NodeType, type NormalizedInteraction, type NormalizedInteractionEffect, type NormalizedInteractionHandler, OverlayNode, PageNode, PlaceholderNode, PopoverNode, type PreviewWrapperOptions, ProgressNode, RadioNode, type ResolvedAppComponent, type ResolvedAppLayout, type ResolvedAppModule, type ResolvedAppReference, type ResolvedAppScreen, RowNode, type ScreenAction, type ScreenDisplay, type ScreenElement, type ScreenFields, type ScreenFieldsSummary, type ScreenInput, type ScreenTransitionGraph, SectionNode, SelectNode, SidebarNode, SiteOptions, SliderNode, SlotNode, SourceLocation, type SourceSlice, SpinnerNode, StateDeclaration, StateGuard, SwitchNode, TableNode, TabsNode, TextContentNode, TextNode, TextareaNode, TitleNode, ToastNode, TooltipNode, type TransitionEdge, type TransitionScreen, type TreeMetrics, VALID_ATTRIBUTE_NAMES, VALID_COMPONENT_NAMES, type ValidationError, type ValidationOptions, type ValidationResult, type ViewportSize, type WalkCallback, WireframeDocument, analyze, areIdentical, buildAnchorIndex, buildDomTree, calculateViewportScale, cloneNode, collectInteractions, compileApp, contains, countNodes, createAppComponentInstanceId, createAppNodeId, diff, documentDefinitions, documentPages, exportToFigma, exportToFigmaString, exportToJson, exportToJsonString, extractAllScreenFields, extractScreenFields, extractScreenTransitions, find, findAll, findByType, formatWireframeCode, getAncestors, getChangeSummary, getDevicePresets, getMaxDepth, getNodeSource, getNodeTypes, getPageSource, getValidAttributes, getValidationErrors, hasChildren, importFromJson, interactionSignature, isAccordionNode, isAlertNode, isAvatarNode, isBadgeNode, isBreadcrumbNode, isButtonNode, isCardNode, isCheckboxNode, isColNode, isComponentDefinitionNode, isComponentUseNode, isContainerComponentNode, isContainerNode, isDataNode, isDefinitionNode, isDisplayNode, isDividerNode, isDrawerNode, isDropdownNode, isFeedbackNode, isFooterNode, isGridNode, isHeaderNode, isIconNode, isImageNode, isInputComponentNode, isInputNode, isLayoutDefinitionNode, isLayoutNode, isLeafNode, isLinkNode, isListNode, isMainNode, isModalNode, isNavNode, isNavigationNode, isNodeType, isOverlayNode, isPageNode, isPlaceholderNode, isPopoverNode, isProgressNode, isRadioNode, isRowNode, isSectionNode, isSelectNode, isSidebarNode, isSliderNode, isSlotNode, isSpinnerNode, isSwitchNode, isTableNode, isTabsNode, isTextContentNode, isTextNode, isTextareaNode, isTitleNode, isToastNode, isTooltipNode, isUrlTarget, isValidAst, isValidAttribute, isValidDevicePreset, linkAndCompileApp, linkApp, mapNodes, normalizeInteractionHandlers, normalizeStateGuard, parseViewportString, printWireframe, resetFigmaIdCounter, resolveAnchor, resolveViewport, validate, walk, walkDocument, wrapInPreviewContainer };
|