@wireweave/core 2.3.1 → 2.5.0-beta.0

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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AnyNode, a as AccordionNode, b as AlertNode, c as AvatarNode, B as BadgeNode, d as BreadcrumbNode, e as ButtonNode, C as CardNode, f as CheckboxNode, g as ColNode, h as ContainerComponentNode, i as ContainerNode, D as DataNode, j as DisplayNode, k as DividerComponentNode, l as DrawerNode, m as DropdownNode, F as FeedbackNode, n as FooterNode, G as GridNode, H as HeaderNode, I as IconNode, o as ImageNode, p as InputComponentNode, q as InputNode, L as LayoutNode, r as LeafNode, s as LinkNode, t as ListNode, M as MainNode, u as ModalNode, N as NavNode, v as NavigationNode, w as NodeType, O as OverlayNode, P as PageNode, x as PlaceholderNode, y as PopoverNode, z as ProgressNode, R as RadioNode, E as RowNode, S as SectionNode, J as SelectNode, K as SidebarNode, Q as SliderNode, T as SpinnerNode, U as SwitchNode, V as TableNode, W as TabsNode, X as TextContentNode, Y as TextNode, Z as TextareaNode, _ as TitleNode, $ as ToastNode, a0 as TooltipNode, a1 as WireframeDocument } from './types-D0t4JRY3.cjs';
2
- export { a2 as AlertVariant, a3 as AlignValue, a4 as AppearanceProps, a5 as AvatarSize, a6 as AvatarSizeToken, a7 as BadgeSize, a8 as BadgeSizeToken, a9 as BadgeVariant, aa as BaseNode, ab as BreadcrumbItem, ac as ButtonSize, ad as ButtonSizeToken, ae as ButtonVariant, af as CommonProps, ag as DirectionValue, ah as DividerNode, ai as DrawerPosition, aj as DropdownItemNode, ak as FlexProps, al as GridProps, am as HeightValue, an as IconSize, ao as IconSizeToken, ap as InputType, aq as InteractiveProps, ar as JustifyValue, as as ListItemNode, at as NavBlockItem, au as NavChild, av as NavDivider, aw as NavGroupNode, ax as NavItem, ay as Position, az as PositionProps, aA as SelectOption, aB as ShadowValue, aC as SizeProps, aD as SourceLocation, aE as SpacingProps, aF as SpacingValue, aG as SpinnerSize, aH as SpinnerSizeToken, aI as TabNode, aJ as TextAlign, aK as TextSize, aL as TextSizeToken, aM as TextWeight, aN as TitleLevel, aO as ToastPosition, aP as TooltipPosition, aQ as ValueWithUnit, aR as WidthValue } from './types-D0t4JRY3.cjs';
1
+ import { A as AnyNode, a as AccordionNode, b as AlertNode, c as AvatarNode, B as BadgeNode, d as BreadcrumbNode, e as ButtonNode, C as CardNode, f as CheckboxNode, g as ColNode, h as ContainerComponentNode, i as ContainerNode, D as DataNode, j as DisplayNode, k as DividerComponentNode, l as DrawerNode, m as DropdownNode, F as FeedbackNode, n as FooterNode, G as GridNode, H as HeaderNode, I as IconNode, o as ImageNode, p as InputComponentNode, q as InputNode, L as LayoutNode, r as LeafNode, s as LinkNode, t as ListNode, M as MainNode, u as ModalNode, N as NavNode, v as NavigationNode, w as NodeType, O as OverlayNode, P as PageNode, x as PlaceholderNode, y as PopoverNode, z as ProgressNode, R as RadioNode, E as RowNode, S as SectionNode, J as SelectNode, K as SidebarNode, Q as SliderNode, T as SpinnerNode, U as SwitchNode, V as TableNode, W as TabsNode, X as TextContentNode, Y as TextNode, Z as TextareaNode, _ as TitleNode, $ as ToastNode, a0 as TooltipNode, a1 as WireframeDocument } from './types-EbEsGNxL.cjs';
2
+ export { a2 as AlertVariant, a3 as AlignValue, a4 as AnchorPosition, a5 as AnnotationItemNode, a6 as AnnotationNode, a7 as AnnotationsNode, a8 as AppearanceProps, a9 as AvatarSize, aa as AvatarSizeToken, ab as BadgeSize, ac as BadgeSizeToken, ad as BadgeVariant, ae as BaseNode, af as BreadcrumbItem, ag as ButtonSize, ah as ButtonSizeToken, ai as ButtonVariant, aj as CommonProps, ak as DirectionValue, al as DividerNode, am as DrawerPosition, an as DropdownItemNode, ao as FlexProps, ap as GridProps, aq as HeightValue, ar as IconSize, as as IconSizeToken, at as InputType, au as InteractiveProps, av as JustifyValue, aw as ListItemNode, ax as MarkerColor, ay as MarkerNode, az as NavBlockItem, aA as NavChild, aB as NavDivider, aC as NavGroupNode, aD as NavItem, aE as Position, aF as PositionProps, aG as RelativeNode, aH as SelectOption, aI as ShadowValue, aJ as SizeProps, aK as SourceLocation, aL as SpacingProps, aM as SpacingValue, aN as SpinnerSize, aO as SpinnerSizeToken, aP as StackNode, aQ as TabNode, aR as TextAlign, aS as TextSize, aT as TextSizeToken, aU as TextWeight, aV as TitleLevel, aW as ToastPosition, aX as TooltipPosition, aY as ValueWithUnit, aZ as WidthValue } from './types-EbEsGNxL.cjs';
3
3
  export { ExpectedToken, ParseError, ParseErrorInfo, ParseOptions, ParseResult, getErrors, isValid, parse, tryParse } from './parser.cjs';
4
4
  export { HtmlRenderer, IconData, IconElement, RenderContext, RenderOptions, RenderResult, SvgRenderOptions, SvgRenderResult, ThemeColors, ThemeConfig, createHtmlRenderer, darkTheme, defaultTheme, generateComponentStyles, generateStyles, getIconData, getTheme, lucideIcons, render, renderIconSvg, renderToHtml, renderToSvg } from './renderer.cjs';
5
5
 
@@ -272,7 +272,7 @@ interface AttributeSpec {
272
272
  /**
273
273
  * Component category
274
274
  */
275
- type ComponentCategory = 'layout' | 'grid' | 'container' | 'text' | 'input' | 'display' | 'data' | 'feedback' | 'overlay' | 'navigation';
275
+ type ComponentCategory = 'layout' | 'grid' | 'container' | 'text' | 'input' | 'display' | 'data' | 'feedback' | 'overlay' | 'navigation' | 'annotation';
276
276
  /**
277
277
  * Component definition
278
278
  */
@@ -567,9 +567,93 @@ interface JsonExportResult {
567
567
  componentTypes: string[];
568
568
  };
569
569
  }
570
+ /**
571
+ * Figma node types that we can map to
572
+ */
573
+ type FigmaNodeType = 'DOCUMENT' | 'CANVAS' | 'FRAME' | 'GROUP' | 'TEXT' | 'RECTANGLE' | 'INSTANCE' | 'COMPONENT';
574
+ /**
575
+ * Figma Auto Layout mode
576
+ */
577
+ type FigmaLayoutMode = 'NONE' | 'HORIZONTAL' | 'VERTICAL';
578
+ /**
579
+ * Figma sizing mode for Auto Layout
580
+ */
581
+ type FigmaSizingMode = 'FIXED' | 'HUG' | 'FILL';
582
+ /**
583
+ * Figma primary axis alignment (justify)
584
+ */
585
+ type FigmaPrimaryAxisAlign = 'MIN' | 'CENTER' | 'MAX' | 'SPACE_BETWEEN';
586
+ /**
587
+ * Figma counter axis alignment (align)
588
+ */
589
+ type FigmaCounterAxisAlign = 'MIN' | 'CENTER' | 'MAX' | 'STRETCH' | 'BASELINE';
590
+ /**
591
+ * Figma text alignment
592
+ */
593
+ type FigmaTextAlign = 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
594
+ /**
595
+ * Figma color (RGBA, 0-1 range)
596
+ */
597
+ interface FigmaColor {
598
+ r: number;
599
+ g: number;
600
+ b: number;
601
+ a: number;
602
+ }
603
+ /**
604
+ * Figma solid fill
605
+ */
606
+ interface FigmaSolidFill {
607
+ type: 'SOLID';
608
+ color: FigmaColor;
609
+ opacity?: number;
610
+ }
611
+ /**
612
+ * Figma stroke
613
+ */
614
+ interface FigmaStroke {
615
+ type: 'SOLID';
616
+ color: FigmaColor;
617
+ }
618
+ /**
619
+ * Figma Auto Layout properties
620
+ */
621
+ interface FigmaAutoLayout {
622
+ layoutMode: FigmaLayoutMode;
623
+ layoutSizingHorizontal: FigmaSizingMode;
624
+ layoutSizingVertical: FigmaSizingMode;
625
+ primaryAxisAlignItems: FigmaPrimaryAxisAlign;
626
+ counterAxisAlignItems: FigmaCounterAxisAlign;
627
+ paddingTop: number;
628
+ paddingRight: number;
629
+ paddingBottom: number;
630
+ paddingLeft: number;
631
+ itemSpacing: number;
632
+ layoutWrap?: 'NO_WRAP' | 'WRAP';
633
+ }
634
+ /**
635
+ * Figma size properties
636
+ */
637
+ interface FigmaSize {
638
+ width: number;
639
+ height: number;
640
+ minWidth?: number;
641
+ maxWidth?: number;
642
+ minHeight?: number;
643
+ maxHeight?: number;
644
+ }
645
+ /**
646
+ * Figma text properties
647
+ */
648
+ interface FigmaTextStyle {
649
+ fontSize: number;
650
+ fontWeight: number;
651
+ textAlignHorizontal: FigmaTextAlign;
652
+ characters: string;
653
+ }
570
654
  /**
571
655
  * Figma-compatible node structure
572
- * Based on Figma's REST API structure
656
+ * Based on Figma's Plugin API structure
573
657
  */
574
658
  interface FigmaNode {
575
659
  /** Unique identifier */
@@ -580,13 +664,27 @@ interface FigmaNode {
580
664
  type: FigmaNodeType;
581
665
  /** Visibility */
582
666
  visible: boolean;
583
- /** Node-specific properties */
584
- [key: string]: unknown;
667
+ /** Original Wireweave type */
668
+ wireweaveType?: string;
669
+ /** Original Wireweave attributes */
670
+ wireweaveAttributes?: Record<string, unknown>;
671
+ /** Child nodes */
672
+ children?: FigmaNode[];
673
+ /** Auto Layout properties (for FRAME) */
674
+ autoLayout?: FigmaAutoLayout;
675
+ /** Size properties */
676
+ size?: FigmaSize;
677
+ /** Text properties (for TEXT) */
678
+ textStyle?: FigmaTextStyle;
679
+ /** Background fills */
680
+ fills?: FigmaSolidFill[];
681
+ /** Border strokes */
682
+ strokes?: FigmaStroke[];
683
+ /** Stroke weight */
684
+ strokeWeight?: number;
685
+ /** Corner radius */
686
+ cornerRadius?: number;
585
687
  }
586
- /**
587
- * Figma node types that we can map to
588
- */
589
- type FigmaNodeType = 'DOCUMENT' | 'CANVAS' | 'FRAME' | 'GROUP' | 'TEXT' | 'RECTANGLE' | 'INSTANCE' | 'COMPONENT';
590
688
  /**
591
689
  * Figma export result
592
690
  */
@@ -642,18 +740,21 @@ declare function importFromJson(json: JsonExportResult): JsonNode[];
642
740
 
643
741
  /**
644
742
  * Figma export functionality
743
+ *
744
+ * Converts Wireweave AST to Figma Plugin API compatible format.
745
+ * The output can be directly used by a Figma plugin to create nodes.
645
746
  */
646
747
 
647
- /**
648
- * Reset Figma ID counter
649
- */
650
748
  declare function resetFigmaIdCounter(): void;
651
749
  /**
652
750
  * Export wireframe to Figma-compatible format
653
751
  *
654
- * Note: This creates a structure inspired by Figma's format,
655
- * but is not directly importable to Figma. It's designed to be
656
- * used with Figma plugins or as a reference for manual recreation.
752
+ * The output is designed to be directly usable by a Figma plugin.
753
+ * Each node includes:
754
+ * - Auto Layout properties (layoutMode, padding, gap, alignment)
755
+ * - Size properties (width, height, constraints)
756
+ * - Text properties (fontSize, fontWeight, alignment)
757
+ * - Visual properties (fills, strokes, cornerRadius)
657
758
  *
658
759
  * @param doc - The parsed wireframe document
659
760
  * @returns Figma export result
@@ -844,4 +945,4 @@ interface AnalysisOptions {
844
945
  */
845
946
  declare function analyze(doc: WireframeDocument, options?: AnalysisOptions): AnalysisResult;
846
947
 
847
- export { ATTRIBUTE_MAP, ATTRIBUTE_SPECS, type AccessibilityMetrics, AccordionNode, AlertNode, type AnalysisOptions, type AnalysisResult, AnyNode, type AttributeChange, type AttributeSpec, type AttributeValueType, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, COMMON_ATTRIBUTES, COMPONENT_MAP, COMPONENT_SPECS, CardNode, CheckboxNode, ColNode, type ComplexityMetrics, type ComponentCategory, type ComponentSpec, type ComponentStats, ContainerComponentNode, ContainerNode, type ContentAnalysis, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, type DiffChangeType, type DiffOptions, type DiffResult, type DiffSummary, DisplayNode, DividerComponentNode, DrawerNode, DropdownNode, type ExportOptions, FeedbackNode, type FigmaExportResult, type FigmaNode, type FigmaNodeType, FooterNode, GridNode, HeaderNode, IconNode, ImageNode, InputComponentNode, InputNode, type JsonExportResult, type JsonNode, type LayoutAnalysis, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NODE_TYPE_MAP, NavNode, NavigationNode, type NodeChange, type NodePredicate, NodeType, OverlayNode, PageNode, PlaceholderNode, PopoverNode, type PreviewWrapperOptions, ProgressNode, RadioNode, RowNode, SectionNode, SelectNode, SidebarNode, SliderNode, SpinnerNode, SwitchNode, TableNode, TabsNode, TextContentNode, TextNode, TextareaNode, TitleNode, ToastNode, TooltipNode, type TreeMetrics, VALID_ATTRIBUTE_NAMES, VALID_COMPONENT_NAMES, type ValidationError, type ValidationOptions, type ValidationResult, type ViewportSize, type WalkCallback, WireframeDocument, analyze, areIdentical, calculateViewportScale, cloneNode, contains, countNodes, diff, exportToFigma, exportToFigmaString, exportToJson, exportToJsonString, find, findAll, findByType, getAncestors, getChangeSummary, getDevicePresets, getMaxDepth, getNodeTypes, getValidAttributes, getValidationErrors, hasChildren, importFromJson, isAccordionNode, isAlertNode, isAvatarNode, isBadgeNode, isBreadcrumbNode, isButtonNode, isCardNode, isCheckboxNode, isColNode, isContainerComponentNode, isContainerNode, isDataNode, isDisplayNode, isDividerNode, isDrawerNode, isDropdownNode, isFeedbackNode, isFooterNode, isGridNode, isHeaderNode, isIconNode, isImageNode, isInputComponentNode, isInputNode, isLayoutNode, isLeafNode, isLinkNode, isListNode, isMainNode, isModalNode, isNavNode, isNavigationNode, isNodeType, isOverlayNode, isPageNode, isPlaceholderNode, isPopoverNode, isProgressNode, isRadioNode, isRowNode, isSectionNode, isSelectNode, isSidebarNode, isSliderNode, isSpinnerNode, isSwitchNode, isTableNode, isTabsNode, isTextContentNode, isTextNode, isTextareaNode, isTitleNode, isToastNode, isTooltipNode, isValidAst, isValidAttribute, isValidDevicePreset, mapNodes, parseViewportString, resetFigmaIdCounter, resolveViewport, validate, walk, walkDocument, wrapInPreviewContainer };
948
+ export { ATTRIBUTE_MAP, ATTRIBUTE_SPECS, type AccessibilityMetrics, AccordionNode, AlertNode, type AnalysisOptions, type AnalysisResult, AnyNode, type AttributeChange, type AttributeSpec, type AttributeValueType, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, COMMON_ATTRIBUTES, COMPONENT_MAP, COMPONENT_SPECS, CardNode, CheckboxNode, ColNode, type ComplexityMetrics, type ComponentCategory, type ComponentSpec, type ComponentStats, ContainerComponentNode, ContainerNode, type ContentAnalysis, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, type DiffChangeType, type DiffOptions, type DiffResult, type DiffSummary, DisplayNode, DividerComponentNode, 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, IconNode, ImageNode, InputComponentNode, InputNode, type JsonExportResult, type JsonNode, type LayoutAnalysis, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NODE_TYPE_MAP, NavNode, NavigationNode, type NodeChange, type NodePredicate, NodeType, OverlayNode, PageNode, PlaceholderNode, PopoverNode, type PreviewWrapperOptions, ProgressNode, RadioNode, RowNode, SectionNode, SelectNode, SidebarNode, SliderNode, SpinnerNode, SwitchNode, TableNode, TabsNode, TextContentNode, TextNode, TextareaNode, TitleNode, ToastNode, TooltipNode, type TreeMetrics, VALID_ATTRIBUTE_NAMES, VALID_COMPONENT_NAMES, type ValidationError, type ValidationOptions, type ValidationResult, type ViewportSize, type WalkCallback, WireframeDocument, analyze, areIdentical, calculateViewportScale, cloneNode, contains, countNodes, diff, exportToFigma, exportToFigmaString, exportToJson, exportToJsonString, find, findAll, findByType, getAncestors, getChangeSummary, getDevicePresets, getMaxDepth, getNodeTypes, getValidAttributes, getValidationErrors, hasChildren, importFromJson, isAccordionNode, isAlertNode, isAvatarNode, isBadgeNode, isBreadcrumbNode, isButtonNode, isCardNode, isCheckboxNode, isColNode, isContainerComponentNode, isContainerNode, isDataNode, isDisplayNode, isDividerNode, isDrawerNode, isDropdownNode, isFeedbackNode, isFooterNode, isGridNode, isHeaderNode, isIconNode, isImageNode, isInputComponentNode, isInputNode, isLayoutNode, isLeafNode, isLinkNode, isListNode, isMainNode, isModalNode, isNavNode, isNavigationNode, isNodeType, isOverlayNode, isPageNode, isPlaceholderNode, isPopoverNode, isProgressNode, isRadioNode, isRowNode, isSectionNode, isSelectNode, isSidebarNode, isSliderNode, isSpinnerNode, isSwitchNode, isTableNode, isTabsNode, isTextContentNode, isTextNode, isTextareaNode, isTitleNode, isToastNode, isTooltipNode, isValidAst, isValidAttribute, isValidDevicePreset, mapNodes, parseViewportString, resetFigmaIdCounter, resolveViewport, validate, walk, walkDocument, wrapInPreviewContainer };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AnyNode, a as AccordionNode, b as AlertNode, c as AvatarNode, B as BadgeNode, d as BreadcrumbNode, e as ButtonNode, C as CardNode, f as CheckboxNode, g as ColNode, h as ContainerComponentNode, i as ContainerNode, D as DataNode, j as DisplayNode, k as DividerComponentNode, l as DrawerNode, m as DropdownNode, F as FeedbackNode, n as FooterNode, G as GridNode, H as HeaderNode, I as IconNode, o as ImageNode, p as InputComponentNode, q as InputNode, L as LayoutNode, r as LeafNode, s as LinkNode, t as ListNode, M as MainNode, u as ModalNode, N as NavNode, v as NavigationNode, w as NodeType, O as OverlayNode, P as PageNode, x as PlaceholderNode, y as PopoverNode, z as ProgressNode, R as RadioNode, E as RowNode, S as SectionNode, J as SelectNode, K as SidebarNode, Q as SliderNode, T as SpinnerNode, U as SwitchNode, V as TableNode, W as TabsNode, X as TextContentNode, Y as TextNode, Z as TextareaNode, _ as TitleNode, $ as ToastNode, a0 as TooltipNode, a1 as WireframeDocument } from './types-D0t4JRY3.js';
2
- export { a2 as AlertVariant, a3 as AlignValue, a4 as AppearanceProps, a5 as AvatarSize, a6 as AvatarSizeToken, a7 as BadgeSize, a8 as BadgeSizeToken, a9 as BadgeVariant, aa as BaseNode, ab as BreadcrumbItem, ac as ButtonSize, ad as ButtonSizeToken, ae as ButtonVariant, af as CommonProps, ag as DirectionValue, ah as DividerNode, ai as DrawerPosition, aj as DropdownItemNode, ak as FlexProps, al as GridProps, am as HeightValue, an as IconSize, ao as IconSizeToken, ap as InputType, aq as InteractiveProps, ar as JustifyValue, as as ListItemNode, at as NavBlockItem, au as NavChild, av as NavDivider, aw as NavGroupNode, ax as NavItem, ay as Position, az as PositionProps, aA as SelectOption, aB as ShadowValue, aC as SizeProps, aD as SourceLocation, aE as SpacingProps, aF as SpacingValue, aG as SpinnerSize, aH as SpinnerSizeToken, aI as TabNode, aJ as TextAlign, aK as TextSize, aL as TextSizeToken, aM as TextWeight, aN as TitleLevel, aO as ToastPosition, aP as TooltipPosition, aQ as ValueWithUnit, aR as WidthValue } from './types-D0t4JRY3.js';
1
+ import { A as AnyNode, a as AccordionNode, b as AlertNode, c as AvatarNode, B as BadgeNode, d as BreadcrumbNode, e as ButtonNode, C as CardNode, f as CheckboxNode, g as ColNode, h as ContainerComponentNode, i as ContainerNode, D as DataNode, j as DisplayNode, k as DividerComponentNode, l as DrawerNode, m as DropdownNode, F as FeedbackNode, n as FooterNode, G as GridNode, H as HeaderNode, I as IconNode, o as ImageNode, p as InputComponentNode, q as InputNode, L as LayoutNode, r as LeafNode, s as LinkNode, t as ListNode, M as MainNode, u as ModalNode, N as NavNode, v as NavigationNode, w as NodeType, O as OverlayNode, P as PageNode, x as PlaceholderNode, y as PopoverNode, z as ProgressNode, R as RadioNode, E as RowNode, S as SectionNode, J as SelectNode, K as SidebarNode, Q as SliderNode, T as SpinnerNode, U as SwitchNode, V as TableNode, W as TabsNode, X as TextContentNode, Y as TextNode, Z as TextareaNode, _ as TitleNode, $ as ToastNode, a0 as TooltipNode, a1 as WireframeDocument } from './types-EbEsGNxL.js';
2
+ export { a2 as AlertVariant, a3 as AlignValue, a4 as AnchorPosition, a5 as AnnotationItemNode, a6 as AnnotationNode, a7 as AnnotationsNode, a8 as AppearanceProps, a9 as AvatarSize, aa as AvatarSizeToken, ab as BadgeSize, ac as BadgeSizeToken, ad as BadgeVariant, ae as BaseNode, af as BreadcrumbItem, ag as ButtonSize, ah as ButtonSizeToken, ai as ButtonVariant, aj as CommonProps, ak as DirectionValue, al as DividerNode, am as DrawerPosition, an as DropdownItemNode, ao as FlexProps, ap as GridProps, aq as HeightValue, ar as IconSize, as as IconSizeToken, at as InputType, au as InteractiveProps, av as JustifyValue, aw as ListItemNode, ax as MarkerColor, ay as MarkerNode, az as NavBlockItem, aA as NavChild, aB as NavDivider, aC as NavGroupNode, aD as NavItem, aE as Position, aF as PositionProps, aG as RelativeNode, aH as SelectOption, aI as ShadowValue, aJ as SizeProps, aK as SourceLocation, aL as SpacingProps, aM as SpacingValue, aN as SpinnerSize, aO as SpinnerSizeToken, aP as StackNode, aQ as TabNode, aR as TextAlign, aS as TextSize, aT as TextSizeToken, aU as TextWeight, aV as TitleLevel, aW as ToastPosition, aX as TooltipPosition, aY as ValueWithUnit, aZ as WidthValue } from './types-EbEsGNxL.js';
3
3
  export { ExpectedToken, ParseError, ParseErrorInfo, ParseOptions, ParseResult, getErrors, isValid, parse, tryParse } from './parser.js';
4
4
  export { HtmlRenderer, IconData, IconElement, RenderContext, RenderOptions, RenderResult, SvgRenderOptions, SvgRenderResult, ThemeColors, ThemeConfig, createHtmlRenderer, darkTheme, defaultTheme, generateComponentStyles, generateStyles, getIconData, getTheme, lucideIcons, render, renderIconSvg, renderToHtml, renderToSvg } from './renderer.js';
5
5
 
@@ -272,7 +272,7 @@ interface AttributeSpec {
272
272
  /**
273
273
  * Component category
274
274
  */
275
- type ComponentCategory = 'layout' | 'grid' | 'container' | 'text' | 'input' | 'display' | 'data' | 'feedback' | 'overlay' | 'navigation';
275
+ type ComponentCategory = 'layout' | 'grid' | 'container' | 'text' | 'input' | 'display' | 'data' | 'feedback' | 'overlay' | 'navigation' | 'annotation';
276
276
  /**
277
277
  * Component definition
278
278
  */
@@ -567,9 +567,93 @@ interface JsonExportResult {
567
567
  componentTypes: string[];
568
568
  };
569
569
  }
570
+ /**
571
+ * Figma node types that we can map to
572
+ */
573
+ type FigmaNodeType = 'DOCUMENT' | 'CANVAS' | 'FRAME' | 'GROUP' | 'TEXT' | 'RECTANGLE' | 'INSTANCE' | 'COMPONENT';
574
+ /**
575
+ * Figma Auto Layout mode
576
+ */
577
+ type FigmaLayoutMode = 'NONE' | 'HORIZONTAL' | 'VERTICAL';
578
+ /**
579
+ * Figma sizing mode for Auto Layout
580
+ */
581
+ type FigmaSizingMode = 'FIXED' | 'HUG' | 'FILL';
582
+ /**
583
+ * Figma primary axis alignment (justify)
584
+ */
585
+ type FigmaPrimaryAxisAlign = 'MIN' | 'CENTER' | 'MAX' | 'SPACE_BETWEEN';
586
+ /**
587
+ * Figma counter axis alignment (align)
588
+ */
589
+ type FigmaCounterAxisAlign = 'MIN' | 'CENTER' | 'MAX' | 'STRETCH' | 'BASELINE';
590
+ /**
591
+ * Figma text alignment
592
+ */
593
+ type FigmaTextAlign = 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
594
+ /**
595
+ * Figma color (RGBA, 0-1 range)
596
+ */
597
+ interface FigmaColor {
598
+ r: number;
599
+ g: number;
600
+ b: number;
601
+ a: number;
602
+ }
603
+ /**
604
+ * Figma solid fill
605
+ */
606
+ interface FigmaSolidFill {
607
+ type: 'SOLID';
608
+ color: FigmaColor;
609
+ opacity?: number;
610
+ }
611
+ /**
612
+ * Figma stroke
613
+ */
614
+ interface FigmaStroke {
615
+ type: 'SOLID';
616
+ color: FigmaColor;
617
+ }
618
+ /**
619
+ * Figma Auto Layout properties
620
+ */
621
+ interface FigmaAutoLayout {
622
+ layoutMode: FigmaLayoutMode;
623
+ layoutSizingHorizontal: FigmaSizingMode;
624
+ layoutSizingVertical: FigmaSizingMode;
625
+ primaryAxisAlignItems: FigmaPrimaryAxisAlign;
626
+ counterAxisAlignItems: FigmaCounterAxisAlign;
627
+ paddingTop: number;
628
+ paddingRight: number;
629
+ paddingBottom: number;
630
+ paddingLeft: number;
631
+ itemSpacing: number;
632
+ layoutWrap?: 'NO_WRAP' | 'WRAP';
633
+ }
634
+ /**
635
+ * Figma size properties
636
+ */
637
+ interface FigmaSize {
638
+ width: number;
639
+ height: number;
640
+ minWidth?: number;
641
+ maxWidth?: number;
642
+ minHeight?: number;
643
+ maxHeight?: number;
644
+ }
645
+ /**
646
+ * Figma text properties
647
+ */
648
+ interface FigmaTextStyle {
649
+ fontSize: number;
650
+ fontWeight: number;
651
+ textAlignHorizontal: FigmaTextAlign;
652
+ characters: string;
653
+ }
570
654
  /**
571
655
  * Figma-compatible node structure
572
- * Based on Figma's REST API structure
656
+ * Based on Figma's Plugin API structure
573
657
  */
574
658
  interface FigmaNode {
575
659
  /** Unique identifier */
@@ -580,13 +664,27 @@ interface FigmaNode {
580
664
  type: FigmaNodeType;
581
665
  /** Visibility */
582
666
  visible: boolean;
583
- /** Node-specific properties */
584
- [key: string]: unknown;
667
+ /** Original Wireweave type */
668
+ wireweaveType?: string;
669
+ /** Original Wireweave attributes */
670
+ wireweaveAttributes?: Record<string, unknown>;
671
+ /** Child nodes */
672
+ children?: FigmaNode[];
673
+ /** Auto Layout properties (for FRAME) */
674
+ autoLayout?: FigmaAutoLayout;
675
+ /** Size properties */
676
+ size?: FigmaSize;
677
+ /** Text properties (for TEXT) */
678
+ textStyle?: FigmaTextStyle;
679
+ /** Background fills */
680
+ fills?: FigmaSolidFill[];
681
+ /** Border strokes */
682
+ strokes?: FigmaStroke[];
683
+ /** Stroke weight */
684
+ strokeWeight?: number;
685
+ /** Corner radius */
686
+ cornerRadius?: number;
585
687
  }
586
- /**
587
- * Figma node types that we can map to
588
- */
589
- type FigmaNodeType = 'DOCUMENT' | 'CANVAS' | 'FRAME' | 'GROUP' | 'TEXT' | 'RECTANGLE' | 'INSTANCE' | 'COMPONENT';
590
688
  /**
591
689
  * Figma export result
592
690
  */
@@ -642,18 +740,21 @@ declare function importFromJson(json: JsonExportResult): JsonNode[];
642
740
 
643
741
  /**
644
742
  * Figma export functionality
743
+ *
744
+ * Converts Wireweave AST to Figma Plugin API compatible format.
745
+ * The output can be directly used by a Figma plugin to create nodes.
645
746
  */
646
747
 
647
- /**
648
- * Reset Figma ID counter
649
- */
650
748
  declare function resetFigmaIdCounter(): void;
651
749
  /**
652
750
  * Export wireframe to Figma-compatible format
653
751
  *
654
- * Note: This creates a structure inspired by Figma's format,
655
- * but is not directly importable to Figma. It's designed to be
656
- * used with Figma plugins or as a reference for manual recreation.
752
+ * The output is designed to be directly usable by a Figma plugin.
753
+ * Each node includes:
754
+ * - Auto Layout properties (layoutMode, padding, gap, alignment)
755
+ * - Size properties (width, height, constraints)
756
+ * - Text properties (fontSize, fontWeight, alignment)
757
+ * - Visual properties (fills, strokes, cornerRadius)
657
758
  *
658
759
  * @param doc - The parsed wireframe document
659
760
  * @returns Figma export result
@@ -844,4 +945,4 @@ interface AnalysisOptions {
844
945
  */
845
946
  declare function analyze(doc: WireframeDocument, options?: AnalysisOptions): AnalysisResult;
846
947
 
847
- export { ATTRIBUTE_MAP, ATTRIBUTE_SPECS, type AccessibilityMetrics, AccordionNode, AlertNode, type AnalysisOptions, type AnalysisResult, AnyNode, type AttributeChange, type AttributeSpec, type AttributeValueType, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, COMMON_ATTRIBUTES, COMPONENT_MAP, COMPONENT_SPECS, CardNode, CheckboxNode, ColNode, type ComplexityMetrics, type ComponentCategory, type ComponentSpec, type ComponentStats, ContainerComponentNode, ContainerNode, type ContentAnalysis, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, type DiffChangeType, type DiffOptions, type DiffResult, type DiffSummary, DisplayNode, DividerComponentNode, DrawerNode, DropdownNode, type ExportOptions, FeedbackNode, type FigmaExportResult, type FigmaNode, type FigmaNodeType, FooterNode, GridNode, HeaderNode, IconNode, ImageNode, InputComponentNode, InputNode, type JsonExportResult, type JsonNode, type LayoutAnalysis, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NODE_TYPE_MAP, NavNode, NavigationNode, type NodeChange, type NodePredicate, NodeType, OverlayNode, PageNode, PlaceholderNode, PopoverNode, type PreviewWrapperOptions, ProgressNode, RadioNode, RowNode, SectionNode, SelectNode, SidebarNode, SliderNode, SpinnerNode, SwitchNode, TableNode, TabsNode, TextContentNode, TextNode, TextareaNode, TitleNode, ToastNode, TooltipNode, type TreeMetrics, VALID_ATTRIBUTE_NAMES, VALID_COMPONENT_NAMES, type ValidationError, type ValidationOptions, type ValidationResult, type ViewportSize, type WalkCallback, WireframeDocument, analyze, areIdentical, calculateViewportScale, cloneNode, contains, countNodes, diff, exportToFigma, exportToFigmaString, exportToJson, exportToJsonString, find, findAll, findByType, getAncestors, getChangeSummary, getDevicePresets, getMaxDepth, getNodeTypes, getValidAttributes, getValidationErrors, hasChildren, importFromJson, isAccordionNode, isAlertNode, isAvatarNode, isBadgeNode, isBreadcrumbNode, isButtonNode, isCardNode, isCheckboxNode, isColNode, isContainerComponentNode, isContainerNode, isDataNode, isDisplayNode, isDividerNode, isDrawerNode, isDropdownNode, isFeedbackNode, isFooterNode, isGridNode, isHeaderNode, isIconNode, isImageNode, isInputComponentNode, isInputNode, isLayoutNode, isLeafNode, isLinkNode, isListNode, isMainNode, isModalNode, isNavNode, isNavigationNode, isNodeType, isOverlayNode, isPageNode, isPlaceholderNode, isPopoverNode, isProgressNode, isRadioNode, isRowNode, isSectionNode, isSelectNode, isSidebarNode, isSliderNode, isSpinnerNode, isSwitchNode, isTableNode, isTabsNode, isTextContentNode, isTextNode, isTextareaNode, isTitleNode, isToastNode, isTooltipNode, isValidAst, isValidAttribute, isValidDevicePreset, mapNodes, parseViewportString, resetFigmaIdCounter, resolveViewport, validate, walk, walkDocument, wrapInPreviewContainer };
948
+ export { ATTRIBUTE_MAP, ATTRIBUTE_SPECS, type AccessibilityMetrics, AccordionNode, AlertNode, type AnalysisOptions, type AnalysisResult, AnyNode, type AttributeChange, type AttributeSpec, type AttributeValueType, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, COMMON_ATTRIBUTES, COMPONENT_MAP, COMPONENT_SPECS, CardNode, CheckboxNode, ColNode, type ComplexityMetrics, type ComponentCategory, type ComponentSpec, type ComponentStats, ContainerComponentNode, ContainerNode, type ContentAnalysis, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, type DiffChangeType, type DiffOptions, type DiffResult, type DiffSummary, DisplayNode, DividerComponentNode, 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, IconNode, ImageNode, InputComponentNode, InputNode, type JsonExportResult, type JsonNode, type LayoutAnalysis, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NODE_TYPE_MAP, NavNode, NavigationNode, type NodeChange, type NodePredicate, NodeType, OverlayNode, PageNode, PlaceholderNode, PopoverNode, type PreviewWrapperOptions, ProgressNode, RadioNode, RowNode, SectionNode, SelectNode, SidebarNode, SliderNode, SpinnerNode, SwitchNode, TableNode, TabsNode, TextContentNode, TextNode, TextareaNode, TitleNode, ToastNode, TooltipNode, type TreeMetrics, VALID_ATTRIBUTE_NAMES, VALID_COMPONENT_NAMES, type ValidationError, type ValidationOptions, type ValidationResult, type ViewportSize, type WalkCallback, WireframeDocument, analyze, areIdentical, calculateViewportScale, cloneNode, contains, countNodes, diff, exportToFigma, exportToFigmaString, exportToJson, exportToJsonString, find, findAll, findByType, getAncestors, getChangeSummary, getDevicePresets, getMaxDepth, getNodeTypes, getValidAttributes, getValidationErrors, hasChildren, importFromJson, isAccordionNode, isAlertNode, isAvatarNode, isBadgeNode, isBreadcrumbNode, isButtonNode, isCardNode, isCheckboxNode, isColNode, isContainerComponentNode, isContainerNode, isDataNode, isDisplayNode, isDividerNode, isDrawerNode, isDropdownNode, isFeedbackNode, isFooterNode, isGridNode, isHeaderNode, isIconNode, isImageNode, isInputComponentNode, isInputNode, isLayoutNode, isLeafNode, isLinkNode, isListNode, isMainNode, isModalNode, isNavNode, isNavigationNode, isNodeType, isOverlayNode, isPageNode, isPlaceholderNode, isPopoverNode, isProgressNode, isRadioNode, isRowNode, isSectionNode, isSelectNode, isSidebarNode, isSliderNode, isSpinnerNode, isSwitchNode, isTableNode, isTabsNode, isTextContentNode, isTextNode, isTextareaNode, isTitleNode, isToastNode, isTooltipNode, isValidAst, isValidAttribute, isValidDevicePreset, mapNodes, parseViewportString, resetFigmaIdCounter, resolveViewport, validate, walk, walkDocument, wrapInPreviewContainer };