@wireweave/core 1.0.0-beta.20260110141318 → 1.1.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.cjs +823 -3067
- package/dist/index.d.cts +3 -168
- package/dist/index.d.ts +3 -168
- package/dist/index.js +823 -3054
- package/dist/parser.cjs +292 -636
- package/dist/parser.d.cts +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/parser.js +292 -636
- package/dist/renderer.cjs +525 -1756
- package/dist/renderer.d.cts +58 -105
- package/dist/renderer.d.ts +58 -105
- package/dist/renderer.js +525 -1756
- package/dist/{types-lcJzPcR0.d.cts → types-DtovIYS6.d.cts} +2 -40
- package/dist/{types-lcJzPcR0.d.ts → types-DtovIYS6.d.ts} +2 -40
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnyNode, C as ContainerNode, L as LeafNode, a as LayoutNode, P as PageNode, H as HeaderNode, M as MainNode, F as FooterNode, S as SidebarNode, b as SectionNode, G as GridNode, R as RowNode, c as ColNode, d as ContainerComponentNode, e as CardNode, f as ModalNode, D as DrawerNode, g as AccordionNode, T as TextContentNode, h as TextNode, i as TitleNode, j as LinkNode, I as InputComponentNode, k as InputNode, l as TextareaNode, m as SelectNode, n as CheckboxNode, o as RadioNode, p as SwitchNode, q as SliderNode, B as ButtonNode, r as DisplayNode, s as ImageNode, t as PlaceholderNode, u as AvatarNode, v as BadgeNode, w as IconNode, x as DataNode, y as TableNode, z as ListNode, E as FeedbackNode, J as AlertNode, K as ToastNode, N as ProgressNode, O as SpinnerNode, Q as OverlayNode, U as TooltipNode, V as PopoverNode, W as DropdownNode, X as NavigationNode, Y as NavNode, Z as TabsNode, _ as BreadcrumbNode, $ as DividerComponentNode, a0 as NodeType, a1 as WireframeDocument } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { A as AnyNode, C as ContainerNode, L as LeafNode, a as LayoutNode, P as PageNode, H as HeaderNode, M as MainNode, F as FooterNode, S as SidebarNode, b as SectionNode, G as GridNode, R as RowNode, c as ColNode, d as ContainerComponentNode, e as CardNode, f as ModalNode, D as DrawerNode, g as AccordionNode, T as TextContentNode, h as TextNode, i as TitleNode, j as LinkNode, I as InputComponentNode, k as InputNode, l as TextareaNode, m as SelectNode, n as CheckboxNode, o as RadioNode, p as SwitchNode, q as SliderNode, B as ButtonNode, r as DisplayNode, s as ImageNode, t as PlaceholderNode, u as AvatarNode, v as BadgeNode, w as IconNode, x as DataNode, y as TableNode, z as ListNode, E as FeedbackNode, J as AlertNode, K as ToastNode, N as ProgressNode, O as SpinnerNode, Q as OverlayNode, U as TooltipNode, V as PopoverNode, W as DropdownNode, X as NavigationNode, Y as NavNode, Z as TabsNode, _ as BreadcrumbNode, $ as DividerComponentNode, a0 as NodeType, a1 as WireframeDocument } from './types-DtovIYS6.cjs';
|
|
2
|
+
export { ax as AlertVariant, ac as AlignValue, as as AvatarSize, au as BadgeSize, at as BadgeVariant, a4 as BaseNode, aF as BreadcrumbItem, ar as ButtonSize, aq as ButtonVariant, ag as CommonProps, ad as DirectionValue, aC as DividerNode, ai as DrawerPosition, aB as DropdownItemNode, ae as FlexProps, af as GridProps, a9 as HeightValue, av as IconSize, ao as InputType, ab as JustifyValue, aw as ListItemNode, aD as NavItem, a2 as Position, ap as SelectOption, ah as ShadowValue, aa as SizeProps, a3 as SourceLocation, a7 as SpacingProps, a6 as SpacingValue, az as SpinnerSize, aE as TabNode, am as TextAlign, ak as TextSize, aj as TextSizeToken, al as TextWeight, an as TitleLevel, ay as ToastPosition, aA as TooltipPosition, a5 as ValueWithUnit, a8 as WidthValue } from './types-DtovIYS6.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, SvgRenderer, ThemeColors, ThemeConfig, createHtmlRenderer, createSvgRenderer, darkTheme, defaultTheme, generateComponentStyles, generateStyles, getIconData, getTheme, lucideIcons, render, renderIconSvg, renderToHtml, renderToPureSvg, renderToSvg } from './renderer.cjs';
|
|
5
5
|
|
|
@@ -249,169 +249,4 @@ interface PreviewWrapperOptions {
|
|
|
249
249
|
*/
|
|
250
250
|
declare function wrapInPreviewContainer(html: string, viewport: ViewportSize, options?: PreviewWrapperOptions): string;
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
* Types for Wireweave DSL Specification
|
|
254
|
-
*/
|
|
255
|
-
/**
|
|
256
|
-
* Attribute value type
|
|
257
|
-
*/
|
|
258
|
-
type AttributeValueType = 'boolean' | 'number' | 'string' | 'string[]' | 'enum';
|
|
259
|
-
/**
|
|
260
|
-
* Attribute definition
|
|
261
|
-
*/
|
|
262
|
-
interface AttributeSpec {
|
|
263
|
-
/** Attribute name */
|
|
264
|
-
name: string;
|
|
265
|
-
/** Value type */
|
|
266
|
-
type: AttributeValueType;
|
|
267
|
-
/** Enum values (if type is 'enum') */
|
|
268
|
-
values?: readonly string[];
|
|
269
|
-
/** Description for documentation */
|
|
270
|
-
description?: string;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Component category
|
|
274
|
-
*/
|
|
275
|
-
type ComponentCategory = 'layout' | 'grid' | 'container' | 'text' | 'input' | 'display' | 'data' | 'feedback' | 'overlay' | 'navigation';
|
|
276
|
-
/**
|
|
277
|
-
* Component definition
|
|
278
|
-
*/
|
|
279
|
-
interface ComponentSpec {
|
|
280
|
-
/** Component name (lowercase, as used in DSL) */
|
|
281
|
-
name: string;
|
|
282
|
-
/** AST node type (PascalCase) */
|
|
283
|
-
nodeType: string;
|
|
284
|
-
/** Component category */
|
|
285
|
-
category: ComponentCategory;
|
|
286
|
-
/** Valid attributes for this component (names only, definitions in ATTRIBUTES) */
|
|
287
|
-
attributes: readonly string[];
|
|
288
|
-
/** Whether this component can have children */
|
|
289
|
-
hasChildren: boolean;
|
|
290
|
-
/** Description for documentation */
|
|
291
|
-
description?: string;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Wireweave DSL Component Definitions
|
|
296
|
-
*
|
|
297
|
-
* Complete list of all valid components in Wireweave DSL.
|
|
298
|
-
* Each component specifies its valid attributes.
|
|
299
|
-
*/
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* All valid components in Wireweave DSL
|
|
303
|
-
*/
|
|
304
|
-
declare const COMPONENT_SPECS: readonly ComponentSpec[];
|
|
305
|
-
/**
|
|
306
|
-
* Set of all valid component names for quick lookup
|
|
307
|
-
*/
|
|
308
|
-
declare const VALID_COMPONENT_NAMES: ReadonlySet<string>;
|
|
309
|
-
/**
|
|
310
|
-
* Map of component name to spec for quick lookup
|
|
311
|
-
*/
|
|
312
|
-
declare const COMPONENT_MAP: ReadonlyMap<string, ComponentSpec>;
|
|
313
|
-
/**
|
|
314
|
-
* Map of AST node type to spec for quick lookup
|
|
315
|
-
*/
|
|
316
|
-
declare const NODE_TYPE_MAP: ReadonlyMap<string, ComponentSpec>;
|
|
317
|
-
/**
|
|
318
|
-
* Get valid attributes for a component (by name or node type)
|
|
319
|
-
*/
|
|
320
|
-
declare function getValidAttributes(componentNameOrType: string): readonly string[] | undefined;
|
|
321
|
-
/**
|
|
322
|
-
* Check if an attribute is valid for a component
|
|
323
|
-
*/
|
|
324
|
-
declare function isValidAttribute(componentNameOrType: string, attributeName: string): boolean;
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Wireweave DSL Attribute Definitions
|
|
328
|
-
*
|
|
329
|
-
* Complete list of all valid attributes in Wireweave DSL.
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* All valid attributes in Wireweave DSL
|
|
334
|
-
*/
|
|
335
|
-
declare const ATTRIBUTE_SPECS: readonly AttributeSpec[];
|
|
336
|
-
/**
|
|
337
|
-
* Set of all valid attribute names for quick lookup
|
|
338
|
-
*/
|
|
339
|
-
declare const VALID_ATTRIBUTE_NAMES: ReadonlySet<string>;
|
|
340
|
-
/**
|
|
341
|
-
* Map of attribute name to spec for quick lookup
|
|
342
|
-
*/
|
|
343
|
-
declare const ATTRIBUTE_MAP: ReadonlyMap<string, AttributeSpec>;
|
|
344
|
-
/**
|
|
345
|
-
* Common attributes available to most components
|
|
346
|
-
*/
|
|
347
|
-
declare const COMMON_ATTRIBUTES: readonly string[];
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Wireweave DSL Validation
|
|
351
|
-
*
|
|
352
|
-
* Validates AST nodes against the DSL specification.
|
|
353
|
-
* Checks that all attributes are valid for their respective components.
|
|
354
|
-
*/
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Validation error details
|
|
358
|
-
*/
|
|
359
|
-
interface ValidationError {
|
|
360
|
-
/** Error message */
|
|
361
|
-
message: string;
|
|
362
|
-
/** Path to the invalid node (e.g., "pages[0].children[1]") */
|
|
363
|
-
path: string;
|
|
364
|
-
/** Node type where error occurred */
|
|
365
|
-
nodeType: string;
|
|
366
|
-
/** Invalid attribute name (if applicable) */
|
|
367
|
-
attribute?: string;
|
|
368
|
-
/** Source location (if available) */
|
|
369
|
-
location?: {
|
|
370
|
-
line: number;
|
|
371
|
-
column: number;
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Validation result
|
|
376
|
-
*/
|
|
377
|
-
interface ValidationResult {
|
|
378
|
-
/** Whether the AST is valid */
|
|
379
|
-
valid: boolean;
|
|
380
|
-
/** List of validation errors */
|
|
381
|
-
errors: ValidationError[];
|
|
382
|
-
/** Summary error message (if invalid) */
|
|
383
|
-
errorSummary?: string;
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Validation options
|
|
387
|
-
*/
|
|
388
|
-
interface ValidationOptions {
|
|
389
|
-
/** If true, stop at first error */
|
|
390
|
-
stopOnFirstError?: boolean;
|
|
391
|
-
/** Maximum number of errors to collect */
|
|
392
|
-
maxErrors?: number;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Validate a Wireweave AST document
|
|
396
|
-
*
|
|
397
|
-
* @param ast - The parsed AST document
|
|
398
|
-
* @param options - Validation options
|
|
399
|
-
* @returns Validation result with errors if invalid
|
|
400
|
-
*/
|
|
401
|
-
declare function validate(ast: WireframeDocument, options?: ValidationOptions): ValidationResult;
|
|
402
|
-
/**
|
|
403
|
-
* Quick validation check - returns true if AST has valid attributes
|
|
404
|
-
*
|
|
405
|
-
* @param ast - The parsed AST document
|
|
406
|
-
* @returns true if all attributes are valid
|
|
407
|
-
*/
|
|
408
|
-
declare function isValidAst(ast: WireframeDocument): boolean;
|
|
409
|
-
/**
|
|
410
|
-
* Get all validation errors from an AST
|
|
411
|
-
*
|
|
412
|
-
* @param ast - The parsed AST document
|
|
413
|
-
* @returns Array of validation errors
|
|
414
|
-
*/
|
|
415
|
-
declare function getValidationErrors(ast: WireframeDocument): ValidationError[];
|
|
416
|
-
|
|
417
|
-
export { ATTRIBUTE_MAP, ATTRIBUTE_SPECS, AccordionNode, AlertNode, AnyNode, type AttributeSpec, type AttributeValueType, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, COMMON_ATTRIBUTES, COMPONENT_MAP, COMPONENT_SPECS, CardNode, CheckboxNode, ColNode, type ComponentCategory, type ComponentSpec, ContainerComponentNode, ContainerNode, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, DisplayNode, DividerComponentNode, DrawerNode, DropdownNode, FeedbackNode, FooterNode, GridNode, HeaderNode, IconNode, ImageNode, InputComponentNode, InputNode, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NODE_TYPE_MAP, NavNode, NavigationNode, 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, VALID_ATTRIBUTE_NAMES, VALID_COMPONENT_NAMES, type ValidationError, type ValidationOptions, type ValidationResult, type ViewportSize, type WalkCallback, WireframeDocument, calculateViewportScale, cloneNode, contains, countNodes, find, findAll, findByType, getAncestors, getDevicePresets, getMaxDepth, getNodeTypes, getValidAttributes, getValidationErrors, hasChildren, 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, resolveViewport, validate, walk, walkDocument, wrapInPreviewContainer };
|
|
252
|
+
export { AccordionNode, AlertNode, AnyNode, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, CardNode, CheckboxNode, ColNode, ContainerComponentNode, ContainerNode, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, DisplayNode, DividerComponentNode, DrawerNode, DropdownNode, FeedbackNode, FooterNode, GridNode, HeaderNode, IconNode, ImageNode, InputComponentNode, InputNode, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NavNode, NavigationNode, 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 ViewportSize, type WalkCallback, WireframeDocument, calculateViewportScale, cloneNode, contains, countNodes, find, findAll, findByType, getAncestors, getDevicePresets, getMaxDepth, getNodeTypes, hasChildren, 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, isValidDevicePreset, mapNodes, parseViewportString, resolveViewport, walk, walkDocument, wrapInPreviewContainer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AnyNode, C as ContainerNode, L as LeafNode, a as LayoutNode, P as PageNode, H as HeaderNode, M as MainNode, F as FooterNode, S as SidebarNode, b as SectionNode, G as GridNode, R as RowNode, c as ColNode, d as ContainerComponentNode, e as CardNode, f as ModalNode, D as DrawerNode, g as AccordionNode, T as TextContentNode, h as TextNode, i as TitleNode, j as LinkNode, I as InputComponentNode, k as InputNode, l as TextareaNode, m as SelectNode, n as CheckboxNode, o as RadioNode, p as SwitchNode, q as SliderNode, B as ButtonNode, r as DisplayNode, s as ImageNode, t as PlaceholderNode, u as AvatarNode, v as BadgeNode, w as IconNode, x as DataNode, y as TableNode, z as ListNode, E as FeedbackNode, J as AlertNode, K as ToastNode, N as ProgressNode, O as SpinnerNode, Q as OverlayNode, U as TooltipNode, V as PopoverNode, W as DropdownNode, X as NavigationNode, Y as NavNode, Z as TabsNode, _ as BreadcrumbNode, $ as DividerComponentNode, a0 as NodeType, a1 as WireframeDocument } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { A as AnyNode, C as ContainerNode, L as LeafNode, a as LayoutNode, P as PageNode, H as HeaderNode, M as MainNode, F as FooterNode, S as SidebarNode, b as SectionNode, G as GridNode, R as RowNode, c as ColNode, d as ContainerComponentNode, e as CardNode, f as ModalNode, D as DrawerNode, g as AccordionNode, T as TextContentNode, h as TextNode, i as TitleNode, j as LinkNode, I as InputComponentNode, k as InputNode, l as TextareaNode, m as SelectNode, n as CheckboxNode, o as RadioNode, p as SwitchNode, q as SliderNode, B as ButtonNode, r as DisplayNode, s as ImageNode, t as PlaceholderNode, u as AvatarNode, v as BadgeNode, w as IconNode, x as DataNode, y as TableNode, z as ListNode, E as FeedbackNode, J as AlertNode, K as ToastNode, N as ProgressNode, O as SpinnerNode, Q as OverlayNode, U as TooltipNode, V as PopoverNode, W as DropdownNode, X as NavigationNode, Y as NavNode, Z as TabsNode, _ as BreadcrumbNode, $ as DividerComponentNode, a0 as NodeType, a1 as WireframeDocument } from './types-DtovIYS6.js';
|
|
2
|
+
export { ax as AlertVariant, ac as AlignValue, as as AvatarSize, au as BadgeSize, at as BadgeVariant, a4 as BaseNode, aF as BreadcrumbItem, ar as ButtonSize, aq as ButtonVariant, ag as CommonProps, ad as DirectionValue, aC as DividerNode, ai as DrawerPosition, aB as DropdownItemNode, ae as FlexProps, af as GridProps, a9 as HeightValue, av as IconSize, ao as InputType, ab as JustifyValue, aw as ListItemNode, aD as NavItem, a2 as Position, ap as SelectOption, ah as ShadowValue, aa as SizeProps, a3 as SourceLocation, a7 as SpacingProps, a6 as SpacingValue, az as SpinnerSize, aE as TabNode, am as TextAlign, ak as TextSize, aj as TextSizeToken, al as TextWeight, an as TitleLevel, ay as ToastPosition, aA as TooltipPosition, a5 as ValueWithUnit, a8 as WidthValue } from './types-DtovIYS6.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, SvgRenderer, ThemeColors, ThemeConfig, createHtmlRenderer, createSvgRenderer, darkTheme, defaultTheme, generateComponentStyles, generateStyles, getIconData, getTheme, lucideIcons, render, renderIconSvg, renderToHtml, renderToPureSvg, renderToSvg } from './renderer.js';
|
|
5
5
|
|
|
@@ -249,169 +249,4 @@ interface PreviewWrapperOptions {
|
|
|
249
249
|
*/
|
|
250
250
|
declare function wrapInPreviewContainer(html: string, viewport: ViewportSize, options?: PreviewWrapperOptions): string;
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
* Types for Wireweave DSL Specification
|
|
254
|
-
*/
|
|
255
|
-
/**
|
|
256
|
-
* Attribute value type
|
|
257
|
-
*/
|
|
258
|
-
type AttributeValueType = 'boolean' | 'number' | 'string' | 'string[]' | 'enum';
|
|
259
|
-
/**
|
|
260
|
-
* Attribute definition
|
|
261
|
-
*/
|
|
262
|
-
interface AttributeSpec {
|
|
263
|
-
/** Attribute name */
|
|
264
|
-
name: string;
|
|
265
|
-
/** Value type */
|
|
266
|
-
type: AttributeValueType;
|
|
267
|
-
/** Enum values (if type is 'enum') */
|
|
268
|
-
values?: readonly string[];
|
|
269
|
-
/** Description for documentation */
|
|
270
|
-
description?: string;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Component category
|
|
274
|
-
*/
|
|
275
|
-
type ComponentCategory = 'layout' | 'grid' | 'container' | 'text' | 'input' | 'display' | 'data' | 'feedback' | 'overlay' | 'navigation';
|
|
276
|
-
/**
|
|
277
|
-
* Component definition
|
|
278
|
-
*/
|
|
279
|
-
interface ComponentSpec {
|
|
280
|
-
/** Component name (lowercase, as used in DSL) */
|
|
281
|
-
name: string;
|
|
282
|
-
/** AST node type (PascalCase) */
|
|
283
|
-
nodeType: string;
|
|
284
|
-
/** Component category */
|
|
285
|
-
category: ComponentCategory;
|
|
286
|
-
/** Valid attributes for this component (names only, definitions in ATTRIBUTES) */
|
|
287
|
-
attributes: readonly string[];
|
|
288
|
-
/** Whether this component can have children */
|
|
289
|
-
hasChildren: boolean;
|
|
290
|
-
/** Description for documentation */
|
|
291
|
-
description?: string;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Wireweave DSL Component Definitions
|
|
296
|
-
*
|
|
297
|
-
* Complete list of all valid components in Wireweave DSL.
|
|
298
|
-
* Each component specifies its valid attributes.
|
|
299
|
-
*/
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* All valid components in Wireweave DSL
|
|
303
|
-
*/
|
|
304
|
-
declare const COMPONENT_SPECS: readonly ComponentSpec[];
|
|
305
|
-
/**
|
|
306
|
-
* Set of all valid component names for quick lookup
|
|
307
|
-
*/
|
|
308
|
-
declare const VALID_COMPONENT_NAMES: ReadonlySet<string>;
|
|
309
|
-
/**
|
|
310
|
-
* Map of component name to spec for quick lookup
|
|
311
|
-
*/
|
|
312
|
-
declare const COMPONENT_MAP: ReadonlyMap<string, ComponentSpec>;
|
|
313
|
-
/**
|
|
314
|
-
* Map of AST node type to spec for quick lookup
|
|
315
|
-
*/
|
|
316
|
-
declare const NODE_TYPE_MAP: ReadonlyMap<string, ComponentSpec>;
|
|
317
|
-
/**
|
|
318
|
-
* Get valid attributes for a component (by name or node type)
|
|
319
|
-
*/
|
|
320
|
-
declare function getValidAttributes(componentNameOrType: string): readonly string[] | undefined;
|
|
321
|
-
/**
|
|
322
|
-
* Check if an attribute is valid for a component
|
|
323
|
-
*/
|
|
324
|
-
declare function isValidAttribute(componentNameOrType: string, attributeName: string): boolean;
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Wireweave DSL Attribute Definitions
|
|
328
|
-
*
|
|
329
|
-
* Complete list of all valid attributes in Wireweave DSL.
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* All valid attributes in Wireweave DSL
|
|
334
|
-
*/
|
|
335
|
-
declare const ATTRIBUTE_SPECS: readonly AttributeSpec[];
|
|
336
|
-
/**
|
|
337
|
-
* Set of all valid attribute names for quick lookup
|
|
338
|
-
*/
|
|
339
|
-
declare const VALID_ATTRIBUTE_NAMES: ReadonlySet<string>;
|
|
340
|
-
/**
|
|
341
|
-
* Map of attribute name to spec for quick lookup
|
|
342
|
-
*/
|
|
343
|
-
declare const ATTRIBUTE_MAP: ReadonlyMap<string, AttributeSpec>;
|
|
344
|
-
/**
|
|
345
|
-
* Common attributes available to most components
|
|
346
|
-
*/
|
|
347
|
-
declare const COMMON_ATTRIBUTES: readonly string[];
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Wireweave DSL Validation
|
|
351
|
-
*
|
|
352
|
-
* Validates AST nodes against the DSL specification.
|
|
353
|
-
* Checks that all attributes are valid for their respective components.
|
|
354
|
-
*/
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Validation error details
|
|
358
|
-
*/
|
|
359
|
-
interface ValidationError {
|
|
360
|
-
/** Error message */
|
|
361
|
-
message: string;
|
|
362
|
-
/** Path to the invalid node (e.g., "pages[0].children[1]") */
|
|
363
|
-
path: string;
|
|
364
|
-
/** Node type where error occurred */
|
|
365
|
-
nodeType: string;
|
|
366
|
-
/** Invalid attribute name (if applicable) */
|
|
367
|
-
attribute?: string;
|
|
368
|
-
/** Source location (if available) */
|
|
369
|
-
location?: {
|
|
370
|
-
line: number;
|
|
371
|
-
column: number;
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Validation result
|
|
376
|
-
*/
|
|
377
|
-
interface ValidationResult {
|
|
378
|
-
/** Whether the AST is valid */
|
|
379
|
-
valid: boolean;
|
|
380
|
-
/** List of validation errors */
|
|
381
|
-
errors: ValidationError[];
|
|
382
|
-
/** Summary error message (if invalid) */
|
|
383
|
-
errorSummary?: string;
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
* Validation options
|
|
387
|
-
*/
|
|
388
|
-
interface ValidationOptions {
|
|
389
|
-
/** If true, stop at first error */
|
|
390
|
-
stopOnFirstError?: boolean;
|
|
391
|
-
/** Maximum number of errors to collect */
|
|
392
|
-
maxErrors?: number;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Validate a Wireweave AST document
|
|
396
|
-
*
|
|
397
|
-
* @param ast - The parsed AST document
|
|
398
|
-
* @param options - Validation options
|
|
399
|
-
* @returns Validation result with errors if invalid
|
|
400
|
-
*/
|
|
401
|
-
declare function validate(ast: WireframeDocument, options?: ValidationOptions): ValidationResult;
|
|
402
|
-
/**
|
|
403
|
-
* Quick validation check - returns true if AST has valid attributes
|
|
404
|
-
*
|
|
405
|
-
* @param ast - The parsed AST document
|
|
406
|
-
* @returns true if all attributes are valid
|
|
407
|
-
*/
|
|
408
|
-
declare function isValidAst(ast: WireframeDocument): boolean;
|
|
409
|
-
/**
|
|
410
|
-
* Get all validation errors from an AST
|
|
411
|
-
*
|
|
412
|
-
* @param ast - The parsed AST document
|
|
413
|
-
* @returns Array of validation errors
|
|
414
|
-
*/
|
|
415
|
-
declare function getValidationErrors(ast: WireframeDocument): ValidationError[];
|
|
416
|
-
|
|
417
|
-
export { ATTRIBUTE_MAP, ATTRIBUTE_SPECS, AccordionNode, AlertNode, AnyNode, type AttributeSpec, type AttributeValueType, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, COMMON_ATTRIBUTES, COMPONENT_MAP, COMPONENT_SPECS, CardNode, CheckboxNode, ColNode, type ComponentCategory, type ComponentSpec, ContainerComponentNode, ContainerNode, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, DisplayNode, DividerComponentNode, DrawerNode, DropdownNode, FeedbackNode, FooterNode, GridNode, HeaderNode, IconNode, ImageNode, InputComponentNode, InputNode, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NODE_TYPE_MAP, NavNode, NavigationNode, 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, VALID_ATTRIBUTE_NAMES, VALID_COMPONENT_NAMES, type ValidationError, type ValidationOptions, type ValidationResult, type ViewportSize, type WalkCallback, WireframeDocument, calculateViewportScale, cloneNode, contains, countNodes, find, findAll, findByType, getAncestors, getDevicePresets, getMaxDepth, getNodeTypes, getValidAttributes, getValidationErrors, hasChildren, 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, resolveViewport, validate, walk, walkDocument, wrapInPreviewContainer };
|
|
252
|
+
export { AccordionNode, AlertNode, AnyNode, AvatarNode, BadgeNode, BreadcrumbNode, ButtonNode, CardNode, CheckboxNode, ColNode, ContainerComponentNode, ContainerNode, DEFAULT_VIEWPORT, DEVICE_PRESETS, DataNode, DisplayNode, DividerComponentNode, DrawerNode, DropdownNode, FeedbackNode, FooterNode, GridNode, HeaderNode, IconNode, ImageNode, InputComponentNode, InputNode, LayoutNode, LeafNode, LinkNode, ListNode, MainNode, ModalNode, NavNode, NavigationNode, 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 ViewportSize, type WalkCallback, WireframeDocument, calculateViewportScale, cloneNode, contains, countNodes, find, findAll, findByType, getAncestors, getDevicePresets, getMaxDepth, getNodeTypes, hasChildren, 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, isValidDevicePreset, mapNodes, parseViewportString, resolveViewport, walk, walkDocument, wrapInPreviewContainer };
|