@wireweave/core 3.1.0-beta.1 → 3.1.0-beta.3

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.
@@ -111,7 +111,7 @@ interface InteractiveProps {
111
111
  action?: string;
112
112
  }
113
113
  /**
114
- * Wireframe Document — root node, holds zero or more `Page`s.
114
+ * Wireframe Document — root node, holds pages and named layout definitions.
115
115
  *
116
116
  * Multi-page semantics:
117
117
  * - A document is a *canvas* of pages. `renderPage` consumes one page;
@@ -123,7 +123,7 @@ interface InteractiveProps {
123
123
  */
124
124
  interface WireframeDocument extends BaseNode {
125
125
  type: 'Document';
126
- children: PageNode[];
126
+ children: TopLevelNode[];
127
127
  }
128
128
  /**
129
129
  * Page — a single fixed-size board (one wireframe screen).
@@ -139,6 +139,8 @@ interface WireframeDocument extends BaseNode {
139
139
  */
140
140
  interface PageNode extends BaseNode, CommonProps {
141
141
  type: 'Page';
142
+ /** Stable address used by `navigate=`; distinct from the display title. */
143
+ id?: string;
142
144
  title?: string | null;
143
145
  /** Center content both horizontally and vertically */
144
146
  centered?: boolean;
@@ -146,8 +148,26 @@ interface PageNode extends BaseNode, CommonProps {
146
148
  viewport?: string | number;
147
149
  /** Device preset (e.g., "iphone14", "desktop") */
148
150
  device?: string;
151
+ /** Named layout shell that hosts this page's own children. */
152
+ uses?: string;
153
+ children: AnyNode[];
154
+ }
155
+ /**
156
+ * A named page shell declared with `layout NAME { ... slot ... }`.
157
+ *
158
+ * Layout definitions are top-level structure, not screens. The renderer
159
+ * composes a page's children into the first slot when the page says
160
+ * `uses=NAME`.
161
+ */
162
+ interface LayoutDefinitionNode extends BaseNode, CommonProps {
163
+ type: 'Layout';
164
+ name: string;
149
165
  children: AnyNode[];
150
166
  }
167
+ /** Bare positional marker inside a layout definition. */
168
+ interface SlotNode extends BaseNode, CommonProps {
169
+ type: 'Slot';
170
+ }
151
171
  interface HeaderNode extends BaseNode, CommonProps {
152
172
  type: 'Header';
153
173
  border?: boolean;
@@ -611,6 +631,8 @@ interface AnnotationItemNode extends BaseNode {
611
631
  children: AnyNode[];
612
632
  }
613
633
  type LayoutNode = PageNode | HeaderNode | MainNode | FooterNode | SidebarNode | SectionNode;
634
+ type DefinitionNode = LayoutDefinitionNode;
635
+ type TopLevelNode = PageNode | DefinitionNode;
614
636
  type GridNode = RowNode | ColNode | StackNode | RelativeNode;
615
637
  type ContainerComponentNode = CardNode | ModalNode | DrawerNode | AccordionNode;
616
638
  type TextContentNode = TextNode | TitleNode | LinkNode;
@@ -621,9 +643,9 @@ type FeedbackNode = AlertNode | ToastNode | ProgressNode | SpinnerNode;
621
643
  type OverlayNode = TooltipNode | PopoverNode | DropdownNode;
622
644
  type NavigationNode = NavNode | TabsNode | BreadcrumbNode;
623
645
  type AnnotationNode = MarkerNode | AnnotationsNode | AnnotationItemNode;
624
- type ContainerNode = LayoutNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode;
625
- type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode | DataNode | FeedbackNode | DropdownNode | NavigationNode | DividerComponentNode | MarkerNode;
646
+ type ContainerNode = LayoutNode | DefinitionNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode;
647
+ type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode | DataNode | FeedbackNode | DropdownNode | NavigationNode | DividerComponentNode | MarkerNode | SlotNode;
626
648
  type AnyNode = ContainerNode | LeafNode;
627
- type NodeType = 'Document' | 'Page' | 'Header' | 'Main' | 'Footer' | 'Sidebar' | 'Section' | 'Row' | 'Col' | 'Stack' | 'Relative' | 'Card' | 'Modal' | 'Drawer' | 'Accordion' | 'Text' | 'Title' | 'Link' | 'Input' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'Button' | 'Image' | 'Placeholder' | 'Avatar' | 'Badge' | 'Icon' | 'Table' | 'List' | 'Alert' | 'Toast' | 'Progress' | 'Spinner' | 'Tooltip' | 'Popover' | 'Dropdown' | 'Nav' | 'Tabs' | 'Breadcrumb' | 'Divider' | 'Marker' | 'Annotations' | 'AnnotationItem';
649
+ type NodeType = 'Document' | 'Page' | 'Layout' | 'Slot' | 'Header' | 'Main' | 'Footer' | 'Sidebar' | 'Section' | 'Row' | 'Col' | 'Stack' | 'Relative' | 'Card' | 'Modal' | 'Drawer' | 'Accordion' | 'Text' | 'Title' | 'Link' | 'Input' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'Button' | 'Image' | 'Placeholder' | 'Avatar' | 'Badge' | 'Icon' | 'Table' | 'List' | 'Alert' | 'Toast' | 'Progress' | 'Spinner' | 'Tooltip' | 'Popover' | 'Dropdown' | 'Nav' | 'Tabs' | 'Breadcrumb' | 'Divider' | 'Marker' | 'Annotations' | 'AnnotationItem';
628
650
 
629
- export type { InteractiveProps as $, AccordionNode as A, BadgeNode as B, CardNode as C, ContainerNode as D, DataNode as E, DirectionValue as F, DisplayNode as G, DividerComponentNode as H, DividerNode as I, DrawerNode as J, DrawerPosition as K, DropdownItemNode as L, DropdownNode as M, FeedbackNode as N, FlexProps as O, FooterNode as P, GridNode as Q, GridProps as R, HeaderNode as S, HeightValue as T, IconNode as U, IconSize as V, IconSizeToken as W, ImageNode as X, InputComponentNode as Y, InputNode as Z, InputType as _, AlertNode as a, JustifyValue as a0, LayoutNode as a1, LeafNode as a2, LinkNode as a3, ListItemNode as a4, ListNode as a5, MainNode as a6, MarkerColor as a7, MarkerNode as a8, ModalNode as a9, SpacingProps as aA, SpacingValue as aB, SpinnerNode as aC, SpinnerSize as aD, SpinnerSizeToken as aE, StackNode as aF, SwitchNode as aG, TabNode as aH, TableNode as aI, TabsNode as aJ, TextAlign as aK, TextContentNode as aL, TextNode as aM, TextSize as aN, TextSizeToken as aO, TextWeight as aP, TextareaNode as aQ, TitleLevel as aR, TitleNode as aS, ToastNode as aT, ToastPosition as aU, TooltipNode as aV, TooltipPosition as aW, ValueWithUnit as aX, WidthValue as aY, WireframeDocument as aZ, NavBlockItem as aa, NavChild as ab, NavDivider as ac, NavGroupNode as ad, NavItem as ae, NavNode as af, NavigationNode as ag, NodeType as ah, OverlayNode as ai, PageNode as aj, PlaceholderNode as ak, PopoverNode as al, Position as am, PositionProps as an, ProgressNode as ao, RadioNode as ap, RelativeNode as aq, RowNode as ar, SectionNode as as, SelectNode as at, SelectOption as au, ShadowValue as av, SidebarNode as aw, SizeProps as ax, SliderNode as ay, SourceLocation as az, AlertVariant as b, AlignValue as c, AnchorPosition as d, AnnotationItemNode as e, AnnotationNode as f, AnnotationsNode as g, AnyNode as h, AppearanceProps as i, AvatarNode as j, AvatarSize as k, AvatarSizeToken as l, BadgeSize as m, BadgeSizeToken as n, BadgeVariant as o, BaseNode as p, BreadcrumbItem as q, BreadcrumbNode as r, ButtonNode as s, ButtonSize as t, ButtonSizeToken as u, ButtonVariant as v, CheckboxNode as w, ColNode as x, CommonProps as y, ContainerComponentNode as z };
651
+ export type { InputType as $, AccordionNode as A, BadgeNode as B, CardNode as C, ContainerNode as D, DataNode as E, DefinitionNode as F, DirectionValue as G, DisplayNode as H, DividerComponentNode as I, DividerNode as J, DrawerNode as K, DrawerPosition as L, DropdownItemNode as M, DropdownNode as N, FeedbackNode as O, FlexProps as P, FooterNode as Q, GridNode as R, GridProps as S, HeaderNode as T, HeightValue as U, IconNode as V, IconSize as W, IconSizeToken as X, ImageNode as Y, InputComponentNode as Z, InputNode as _, AlertNode as a, ValueWithUnit as a$, InteractiveProps as a0, JustifyValue as a1, LayoutDefinitionNode as a2, LayoutNode as a3, LeafNode as a4, LinkNode as a5, ListItemNode as a6, ListNode as a7, MainNode as a8, MarkerColor as a9, SliderNode as aA, SlotNode as aB, SourceLocation as aC, SpacingProps as aD, SpacingValue as aE, SpinnerNode as aF, SpinnerSize as aG, SpinnerSizeToken as aH, StackNode as aI, SwitchNode as aJ, TabNode as aK, TableNode as aL, TabsNode as aM, TextAlign as aN, TextContentNode as aO, TextNode as aP, TextSize as aQ, TextSizeToken as aR, TextWeight as aS, TextareaNode as aT, TitleLevel as aU, TitleNode as aV, ToastNode as aW, ToastPosition as aX, TooltipNode as aY, TooltipPosition as aZ, TopLevelNode as a_, MarkerNode as aa, ModalNode as ab, NavBlockItem as ac, NavChild as ad, NavDivider as ae, NavGroupNode as af, NavItem as ag, NavNode as ah, NavigationNode as ai, NodeType as aj, OverlayNode as ak, PageNode as al, PlaceholderNode as am, PopoverNode as an, Position as ao, PositionProps as ap, ProgressNode as aq, RadioNode as ar, RelativeNode as as, RowNode as at, SectionNode as au, SelectNode as av, SelectOption as aw, ShadowValue as ax, SidebarNode as ay, SizeProps as az, AlertVariant as b, WidthValue as b0, WireframeDocument as b1, AlignValue as c, AnchorPosition as d, AnnotationItemNode as e, AnnotationNode as f, AnnotationsNode as g, AnyNode as h, AppearanceProps as i, AvatarNode as j, AvatarSize as k, AvatarSizeToken as l, BadgeSize as m, BadgeSizeToken as n, BadgeVariant as o, BaseNode as p, BreadcrumbItem as q, BreadcrumbNode as r, ButtonNode as s, ButtonSize as t, ButtonSizeToken as u, ButtonVariant as v, CheckboxNode as w, ColNode as x, CommonProps as y, ContainerComponentNode as z };
@@ -111,7 +111,7 @@ interface InteractiveProps {
111
111
  action?: string;
112
112
  }
113
113
  /**
114
- * Wireframe Document — root node, holds zero or more `Page`s.
114
+ * Wireframe Document — root node, holds pages and named layout definitions.
115
115
  *
116
116
  * Multi-page semantics:
117
117
  * - A document is a *canvas* of pages. `renderPage` consumes one page;
@@ -123,7 +123,7 @@ interface InteractiveProps {
123
123
  */
124
124
  interface WireframeDocument extends BaseNode {
125
125
  type: 'Document';
126
- children: PageNode[];
126
+ children: TopLevelNode[];
127
127
  }
128
128
  /**
129
129
  * Page — a single fixed-size board (one wireframe screen).
@@ -139,6 +139,8 @@ interface WireframeDocument extends BaseNode {
139
139
  */
140
140
  interface PageNode extends BaseNode, CommonProps {
141
141
  type: 'Page';
142
+ /** Stable address used by `navigate=`; distinct from the display title. */
143
+ id?: string;
142
144
  title?: string | null;
143
145
  /** Center content both horizontally and vertically */
144
146
  centered?: boolean;
@@ -146,8 +148,26 @@ interface PageNode extends BaseNode, CommonProps {
146
148
  viewport?: string | number;
147
149
  /** Device preset (e.g., "iphone14", "desktop") */
148
150
  device?: string;
151
+ /** Named layout shell that hosts this page's own children. */
152
+ uses?: string;
153
+ children: AnyNode[];
154
+ }
155
+ /**
156
+ * A named page shell declared with `layout NAME { ... slot ... }`.
157
+ *
158
+ * Layout definitions are top-level structure, not screens. The renderer
159
+ * composes a page's children into the first slot when the page says
160
+ * `uses=NAME`.
161
+ */
162
+ interface LayoutDefinitionNode extends BaseNode, CommonProps {
163
+ type: 'Layout';
164
+ name: string;
149
165
  children: AnyNode[];
150
166
  }
167
+ /** Bare positional marker inside a layout definition. */
168
+ interface SlotNode extends BaseNode, CommonProps {
169
+ type: 'Slot';
170
+ }
151
171
  interface HeaderNode extends BaseNode, CommonProps {
152
172
  type: 'Header';
153
173
  border?: boolean;
@@ -611,6 +631,8 @@ interface AnnotationItemNode extends BaseNode {
611
631
  children: AnyNode[];
612
632
  }
613
633
  type LayoutNode = PageNode | HeaderNode | MainNode | FooterNode | SidebarNode | SectionNode;
634
+ type DefinitionNode = LayoutDefinitionNode;
635
+ type TopLevelNode = PageNode | DefinitionNode;
614
636
  type GridNode = RowNode | ColNode | StackNode | RelativeNode;
615
637
  type ContainerComponentNode = CardNode | ModalNode | DrawerNode | AccordionNode;
616
638
  type TextContentNode = TextNode | TitleNode | LinkNode;
@@ -621,9 +643,9 @@ type FeedbackNode = AlertNode | ToastNode | ProgressNode | SpinnerNode;
621
643
  type OverlayNode = TooltipNode | PopoverNode | DropdownNode;
622
644
  type NavigationNode = NavNode | TabsNode | BreadcrumbNode;
623
645
  type AnnotationNode = MarkerNode | AnnotationsNode | AnnotationItemNode;
624
- type ContainerNode = LayoutNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode;
625
- type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode | DataNode | FeedbackNode | DropdownNode | NavigationNode | DividerComponentNode | MarkerNode;
646
+ type ContainerNode = LayoutNode | DefinitionNode | GridNode | ContainerComponentNode | PopoverNode | TooltipNode | AnnotationsNode | AnnotationItemNode;
647
+ type LeafNode = TextContentNode | InputComponentNode | ButtonNode | DisplayNode | DataNode | FeedbackNode | DropdownNode | NavigationNode | DividerComponentNode | MarkerNode | SlotNode;
626
648
  type AnyNode = ContainerNode | LeafNode;
627
- type NodeType = 'Document' | 'Page' | 'Header' | 'Main' | 'Footer' | 'Sidebar' | 'Section' | 'Row' | 'Col' | 'Stack' | 'Relative' | 'Card' | 'Modal' | 'Drawer' | 'Accordion' | 'Text' | 'Title' | 'Link' | 'Input' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'Button' | 'Image' | 'Placeholder' | 'Avatar' | 'Badge' | 'Icon' | 'Table' | 'List' | 'Alert' | 'Toast' | 'Progress' | 'Spinner' | 'Tooltip' | 'Popover' | 'Dropdown' | 'Nav' | 'Tabs' | 'Breadcrumb' | 'Divider' | 'Marker' | 'Annotations' | 'AnnotationItem';
649
+ type NodeType = 'Document' | 'Page' | 'Layout' | 'Slot' | 'Header' | 'Main' | 'Footer' | 'Sidebar' | 'Section' | 'Row' | 'Col' | 'Stack' | 'Relative' | 'Card' | 'Modal' | 'Drawer' | 'Accordion' | 'Text' | 'Title' | 'Link' | 'Input' | 'Textarea' | 'Select' | 'Checkbox' | 'Radio' | 'Switch' | 'Slider' | 'Button' | 'Image' | 'Placeholder' | 'Avatar' | 'Badge' | 'Icon' | 'Table' | 'List' | 'Alert' | 'Toast' | 'Progress' | 'Spinner' | 'Tooltip' | 'Popover' | 'Dropdown' | 'Nav' | 'Tabs' | 'Breadcrumb' | 'Divider' | 'Marker' | 'Annotations' | 'AnnotationItem';
628
650
 
629
- export type { InteractiveProps as $, AccordionNode as A, BadgeNode as B, CardNode as C, ContainerNode as D, DataNode as E, DirectionValue as F, DisplayNode as G, DividerComponentNode as H, DividerNode as I, DrawerNode as J, DrawerPosition as K, DropdownItemNode as L, DropdownNode as M, FeedbackNode as N, FlexProps as O, FooterNode as P, GridNode as Q, GridProps as R, HeaderNode as S, HeightValue as T, IconNode as U, IconSize as V, IconSizeToken as W, ImageNode as X, InputComponentNode as Y, InputNode as Z, InputType as _, AlertNode as a, JustifyValue as a0, LayoutNode as a1, LeafNode as a2, LinkNode as a3, ListItemNode as a4, ListNode as a5, MainNode as a6, MarkerColor as a7, MarkerNode as a8, ModalNode as a9, SpacingProps as aA, SpacingValue as aB, SpinnerNode as aC, SpinnerSize as aD, SpinnerSizeToken as aE, StackNode as aF, SwitchNode as aG, TabNode as aH, TableNode as aI, TabsNode as aJ, TextAlign as aK, TextContentNode as aL, TextNode as aM, TextSize as aN, TextSizeToken as aO, TextWeight as aP, TextareaNode as aQ, TitleLevel as aR, TitleNode as aS, ToastNode as aT, ToastPosition as aU, TooltipNode as aV, TooltipPosition as aW, ValueWithUnit as aX, WidthValue as aY, WireframeDocument as aZ, NavBlockItem as aa, NavChild as ab, NavDivider as ac, NavGroupNode as ad, NavItem as ae, NavNode as af, NavigationNode as ag, NodeType as ah, OverlayNode as ai, PageNode as aj, PlaceholderNode as ak, PopoverNode as al, Position as am, PositionProps as an, ProgressNode as ao, RadioNode as ap, RelativeNode as aq, RowNode as ar, SectionNode as as, SelectNode as at, SelectOption as au, ShadowValue as av, SidebarNode as aw, SizeProps as ax, SliderNode as ay, SourceLocation as az, AlertVariant as b, AlignValue as c, AnchorPosition as d, AnnotationItemNode as e, AnnotationNode as f, AnnotationsNode as g, AnyNode as h, AppearanceProps as i, AvatarNode as j, AvatarSize as k, AvatarSizeToken as l, BadgeSize as m, BadgeSizeToken as n, BadgeVariant as o, BaseNode as p, BreadcrumbItem as q, BreadcrumbNode as r, ButtonNode as s, ButtonSize as t, ButtonSizeToken as u, ButtonVariant as v, CheckboxNode as w, ColNode as x, CommonProps as y, ContainerComponentNode as z };
651
+ export type { InputType as $, AccordionNode as A, BadgeNode as B, CardNode as C, ContainerNode as D, DataNode as E, DefinitionNode as F, DirectionValue as G, DisplayNode as H, DividerComponentNode as I, DividerNode as J, DrawerNode as K, DrawerPosition as L, DropdownItemNode as M, DropdownNode as N, FeedbackNode as O, FlexProps as P, FooterNode as Q, GridNode as R, GridProps as S, HeaderNode as T, HeightValue as U, IconNode as V, IconSize as W, IconSizeToken as X, ImageNode as Y, InputComponentNode as Z, InputNode as _, AlertNode as a, ValueWithUnit as a$, InteractiveProps as a0, JustifyValue as a1, LayoutDefinitionNode as a2, LayoutNode as a3, LeafNode as a4, LinkNode as a5, ListItemNode as a6, ListNode as a7, MainNode as a8, MarkerColor as a9, SliderNode as aA, SlotNode as aB, SourceLocation as aC, SpacingProps as aD, SpacingValue as aE, SpinnerNode as aF, SpinnerSize as aG, SpinnerSizeToken as aH, StackNode as aI, SwitchNode as aJ, TabNode as aK, TableNode as aL, TabsNode as aM, TextAlign as aN, TextContentNode as aO, TextNode as aP, TextSize as aQ, TextSizeToken as aR, TextWeight as aS, TextareaNode as aT, TitleLevel as aU, TitleNode as aV, ToastNode as aW, ToastPosition as aX, TooltipNode as aY, TooltipPosition as aZ, TopLevelNode as a_, MarkerNode as aa, ModalNode as ab, NavBlockItem as ac, NavChild as ad, NavDivider as ae, NavGroupNode as af, NavItem as ag, NavNode as ah, NavigationNode as ai, NodeType as aj, OverlayNode as ak, PageNode as al, PlaceholderNode as am, PopoverNode as an, Position as ao, PositionProps as ap, ProgressNode as aq, RadioNode as ar, RelativeNode as as, RowNode as at, SectionNode as au, SelectNode as av, SelectOption as aw, ShadowValue as ax, SidebarNode as ay, SizeProps as az, AlertVariant as b, WidthValue as b0, WireframeDocument as b1, AlignValue as c, AnchorPosition as d, AnnotationItemNode as e, AnnotationNode as f, AnnotationsNode as g, AnyNode as h, AppearanceProps as i, AvatarNode as j, AvatarSize as k, AvatarSizeToken as l, BadgeSize as m, BadgeSizeToken as n, BadgeVariant as o, BaseNode as p, BreadcrumbItem as q, BreadcrumbNode as r, ButtonNode as s, ButtonSize as t, ButtonSizeToken as u, ButtonVariant as v, CheckboxNode as w, ColNode as x, CommonProps as y, ContainerComponentNode as z };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@wireweave/core",
3
- "version": "3.1.0-beta.1",
3
+ "version": "3.1.0-beta.3",
4
4
  "description": "Core parser and renderer for wireweave",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
- "module": "dist/index.mjs",
7
+ "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {