@wire-dsl/engine 0.1.0 → 0.2.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/README.md +3 -3
- package/dist/index.cjs +3517 -397
- package/dist/index.d.cts +553 -53
- package/dist/index.d.ts +553 -53
- package/dist/index.js +3510 -397
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -34,7 +34,7 @@ interface PropertySourceMap {
|
|
|
34
34
|
/**
|
|
35
35
|
* Types of nodes in Wire DSL
|
|
36
36
|
*/
|
|
37
|
-
type SourceMapNodeType = 'project' | 'screen' | 'layout' | 'component' | 'component-definition' | 'cell' | '
|
|
37
|
+
type SourceMapNodeType = 'project' | 'screen' | 'layout' | 'component' | 'component-definition' | 'cell' | 'style' | 'mocks' | 'colors';
|
|
38
38
|
/**
|
|
39
39
|
* Main SourceMap entry - represents one node in the AST
|
|
40
40
|
*/
|
|
@@ -97,7 +97,7 @@ interface CapturedTokens {
|
|
|
97
97
|
interface AST {
|
|
98
98
|
type: 'project';
|
|
99
99
|
name: string;
|
|
100
|
-
|
|
100
|
+
style: Record<string, string>;
|
|
101
101
|
mocks: Record<string, string>;
|
|
102
102
|
colors: Record<string, string>;
|
|
103
103
|
definedComponents: ASTDefinedComponent[];
|
|
@@ -203,19 +203,21 @@ interface IRContract {
|
|
|
203
203
|
interface IRProject {
|
|
204
204
|
id: string;
|
|
205
205
|
name: string;
|
|
206
|
-
|
|
206
|
+
style: IRStyle;
|
|
207
207
|
mocks: Record<string, unknown>;
|
|
208
208
|
colors: Record<string, string>;
|
|
209
209
|
screens: IRScreen[];
|
|
210
210
|
nodes: Record<string, IRNode>;
|
|
211
211
|
}
|
|
212
|
-
interface
|
|
212
|
+
interface IRStyle {
|
|
213
213
|
density: 'compact' | 'normal' | 'comfortable';
|
|
214
214
|
spacing: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
215
215
|
radius: 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
216
216
|
stroke: 'thin' | 'normal' | 'thick';
|
|
217
217
|
font: 'sm' | 'base' | 'lg';
|
|
218
218
|
background?: string;
|
|
219
|
+
theme?: string;
|
|
220
|
+
device?: string;
|
|
219
221
|
}
|
|
220
222
|
interface IRScreen {
|
|
221
223
|
id: string;
|
|
@@ -238,7 +240,7 @@ interface IRContainerNode {
|
|
|
238
240
|
children: Array<{
|
|
239
241
|
ref: string;
|
|
240
242
|
}>;
|
|
241
|
-
style:
|
|
243
|
+
style: IRNodeStyle;
|
|
242
244
|
meta: IRMeta;
|
|
243
245
|
}
|
|
244
246
|
interface IRComponentNode {
|
|
@@ -246,10 +248,10 @@ interface IRComponentNode {
|
|
|
246
248
|
kind: 'component';
|
|
247
249
|
componentType: string;
|
|
248
250
|
props: Record<string, string | number>;
|
|
249
|
-
style:
|
|
251
|
+
style: IRNodeStyle;
|
|
250
252
|
meta: IRMeta;
|
|
251
253
|
}
|
|
252
|
-
interface
|
|
254
|
+
interface IRNodeStyle {
|
|
253
255
|
padding?: string;
|
|
254
256
|
gap?: string;
|
|
255
257
|
align?: 'left' | 'center' | 'right' | 'justify';
|
|
@@ -267,9 +269,9 @@ declare class IRGenerator {
|
|
|
267
269
|
private definedComponentIndices;
|
|
268
270
|
private undefinedComponentsUsed;
|
|
269
271
|
private warnings;
|
|
270
|
-
private
|
|
272
|
+
private style;
|
|
271
273
|
generate(ast: AST): IRContract;
|
|
272
|
-
private
|
|
274
|
+
private applyStyle;
|
|
273
275
|
private convertScreen;
|
|
274
276
|
/**
|
|
275
277
|
* Validates that component definitions appear before their first usage
|
|
@@ -322,6 +324,44 @@ interface IRMetadata {
|
|
|
322
324
|
description?: string;
|
|
323
325
|
}
|
|
324
326
|
|
|
327
|
+
/**
|
|
328
|
+
* Device viewport presets for multi-device wireframe rendering
|
|
329
|
+
*
|
|
330
|
+
* Defines standard viewport widths and minimum heights for different device
|
|
331
|
+
* categories. Final render height remains dynamic and grows with content.
|
|
332
|
+
*/
|
|
333
|
+
interface DevicePreset {
|
|
334
|
+
name: string;
|
|
335
|
+
width: number;
|
|
336
|
+
minHeight: number;
|
|
337
|
+
category: 'mobile' | 'desktop' | 'tablet' | 'print';
|
|
338
|
+
description: string;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Standard device viewport presets
|
|
342
|
+
*
|
|
343
|
+
* `minHeight` is used as the baseline viewport height. Renderers still
|
|
344
|
+
* expand dynamically when content exceeds this value.
|
|
345
|
+
*/
|
|
346
|
+
declare const DEVICE_PRESETS: Record<string, DevicePreset>;
|
|
347
|
+
/**
|
|
348
|
+
* Resolve device preset name to viewport dimensions
|
|
349
|
+
*
|
|
350
|
+
* @param device - Device preset name (case-insensitive)
|
|
351
|
+
* @returns Viewport width and minimum height in pixels
|
|
352
|
+
*/
|
|
353
|
+
declare function resolveDevicePreset(device: string): {
|
|
354
|
+
width: number;
|
|
355
|
+
minHeight: number;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Check if a device preset name is valid
|
|
359
|
+
*
|
|
360
|
+
* @param device - Device preset name to validate
|
|
361
|
+
* @returns True if device preset exists
|
|
362
|
+
*/
|
|
363
|
+
declare function isValidDevice(device: string): boolean;
|
|
364
|
+
|
|
325
365
|
/**
|
|
326
366
|
* Layout Engine
|
|
327
367
|
*
|
|
@@ -339,7 +379,7 @@ interface LayoutResult {
|
|
|
339
379
|
}
|
|
340
380
|
declare class LayoutEngine {
|
|
341
381
|
private nodes;
|
|
342
|
-
private
|
|
382
|
+
private style;
|
|
343
383
|
private result;
|
|
344
384
|
private viewport;
|
|
345
385
|
private ir;
|
|
@@ -356,16 +396,119 @@ declare class LayoutEngine {
|
|
|
356
396
|
private calculateCard;
|
|
357
397
|
private calculateComponent;
|
|
358
398
|
private resolveSpacing;
|
|
399
|
+
private getSeparateSize;
|
|
359
400
|
private getComponentHeight;
|
|
401
|
+
private getTextMetricsForDensity;
|
|
402
|
+
private getButtonMetricsForDensity;
|
|
403
|
+
private getHeadingMetricsForDensity;
|
|
404
|
+
private wrapTextToLines;
|
|
360
405
|
private getIntrinsicComponentHeight;
|
|
406
|
+
private getControlLabelOffset;
|
|
361
407
|
private getIntrinsicComponentWidth;
|
|
362
408
|
private calculateChildHeight;
|
|
363
409
|
private calculateChildWidth;
|
|
410
|
+
private estimateTextWidth;
|
|
364
411
|
private adjustNodeYPositions;
|
|
365
412
|
}
|
|
366
413
|
declare function calculateLayout(ir: IRContract): LayoutResult;
|
|
367
414
|
declare function resolveGridPosition(row: number, col: number, rowSpan?: number, colSpan?: number, gridWidth?: number, gridHeight?: number, gridCols?: number, gridRows?: number): LayoutPosition;
|
|
368
415
|
|
|
416
|
+
/**
|
|
417
|
+
* Color Resolver
|
|
418
|
+
*
|
|
419
|
+
* Resolves color references from project colors, named colors, or hex values
|
|
420
|
+
*/
|
|
421
|
+
declare class ColorResolver {
|
|
422
|
+
private customColors;
|
|
423
|
+
private namedColors;
|
|
424
|
+
/**
|
|
425
|
+
* Set custom colors from project definition
|
|
426
|
+
*/
|
|
427
|
+
setCustomColors(colors: Record<string, string>): void;
|
|
428
|
+
/**
|
|
429
|
+
* Check if a color key/reference is resolvable.
|
|
430
|
+
*/
|
|
431
|
+
hasColor(colorRef: string): boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Resolve a color reference to a hex value
|
|
434
|
+
* Priority: custom colors > named colors > hex validation > default
|
|
435
|
+
*/
|
|
436
|
+
resolveColor(colorRef: string, defaultColor?: string): string;
|
|
437
|
+
private resolveColorInternal;
|
|
438
|
+
/**
|
|
439
|
+
* Validate hex color (6-character hex code)
|
|
440
|
+
*/
|
|
441
|
+
private isValidHex;
|
|
442
|
+
/**
|
|
443
|
+
* Validate and return hex, or undefined if invalid
|
|
444
|
+
*/
|
|
445
|
+
private validateHex;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Design Tokens System
|
|
450
|
+
*
|
|
451
|
+
* Visual properties organized by density levels.
|
|
452
|
+
* These tokens are read from ir.project.style (density, spacing, radius, stroke, font)
|
|
453
|
+
* and used by all renderers to maintain consistent visual styling.
|
|
454
|
+
*/
|
|
455
|
+
interface DesignTokens {
|
|
456
|
+
spacing: {
|
|
457
|
+
xs: number;
|
|
458
|
+
sm: number;
|
|
459
|
+
md: number;
|
|
460
|
+
lg: number;
|
|
461
|
+
xl: number;
|
|
462
|
+
};
|
|
463
|
+
button: {
|
|
464
|
+
paddingX: number;
|
|
465
|
+
paddingY: number;
|
|
466
|
+
radius: number;
|
|
467
|
+
fontSize: number;
|
|
468
|
+
fontWeight: number;
|
|
469
|
+
};
|
|
470
|
+
input: {
|
|
471
|
+
paddingX: number;
|
|
472
|
+
paddingY: number;
|
|
473
|
+
radius: number;
|
|
474
|
+
fontSize: number;
|
|
475
|
+
};
|
|
476
|
+
card: {
|
|
477
|
+
padding: number;
|
|
478
|
+
radius: number;
|
|
479
|
+
strokeWidth: number;
|
|
480
|
+
};
|
|
481
|
+
heading: {
|
|
482
|
+
fontSize: number;
|
|
483
|
+
fontWeight: number;
|
|
484
|
+
marginBottom: number;
|
|
485
|
+
};
|
|
486
|
+
text: {
|
|
487
|
+
fontSize: number;
|
|
488
|
+
lineHeight: number;
|
|
489
|
+
};
|
|
490
|
+
badge: {
|
|
491
|
+
paddingX: number;
|
|
492
|
+
paddingY: number;
|
|
493
|
+
radius: number | 'pill';
|
|
494
|
+
fontSize: number;
|
|
495
|
+
};
|
|
496
|
+
table: {
|
|
497
|
+
cellPaddingX: number;
|
|
498
|
+
cellPaddingY: number;
|
|
499
|
+
headerFontWeight: number;
|
|
500
|
+
borderWidth: number;
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Token sets for each density level
|
|
505
|
+
*/
|
|
506
|
+
declare const DENSITY_TOKENS: Record<'compact' | 'normal' | 'comfortable', DesignTokens>;
|
|
507
|
+
/**
|
|
508
|
+
* Resolve design tokens based on IRStyle
|
|
509
|
+
*/
|
|
510
|
+
declare function resolveTokens(style: any): DesignTokens;
|
|
511
|
+
|
|
369
512
|
/**
|
|
370
513
|
* SVG Renderer
|
|
371
514
|
*
|
|
@@ -384,14 +527,40 @@ interface SVGComponent {
|
|
|
384
527
|
children?: SVGComponent[];
|
|
385
528
|
text?: string;
|
|
386
529
|
}
|
|
530
|
+
declare const THEMES: {
|
|
531
|
+
light: {
|
|
532
|
+
bg: string;
|
|
533
|
+
cardBg: string;
|
|
534
|
+
border: string;
|
|
535
|
+
text: string;
|
|
536
|
+
textMuted: string;
|
|
537
|
+
primary: string;
|
|
538
|
+
primaryHover: string;
|
|
539
|
+
primaryLight: string;
|
|
540
|
+
};
|
|
541
|
+
dark: {
|
|
542
|
+
bg: string;
|
|
543
|
+
cardBg: string;
|
|
544
|
+
border: string;
|
|
545
|
+
text: string;
|
|
546
|
+
textMuted: string;
|
|
547
|
+
primary: string;
|
|
548
|
+
primaryHover: string;
|
|
549
|
+
primaryLight: string;
|
|
550
|
+
};
|
|
551
|
+
};
|
|
387
552
|
declare class SVGRenderer {
|
|
388
553
|
private ir;
|
|
389
554
|
private layout;
|
|
390
|
-
|
|
391
|
-
|
|
555
|
+
protected options: Required<Omit<SVGRenderOptions, 'screenName'>> & {
|
|
556
|
+
screenName?: string;
|
|
557
|
+
};
|
|
558
|
+
protected renderTheme: typeof THEMES.light;
|
|
559
|
+
protected tokens: DesignTokens;
|
|
392
560
|
private selectedScreenName?;
|
|
393
|
-
|
|
394
|
-
|
|
561
|
+
protected renderedNodeIds: Set<string>;
|
|
562
|
+
protected colorResolver: ColorResolver;
|
|
563
|
+
protected fontFamily: string;
|
|
395
564
|
constructor(ir: IRContract, layout: LayoutResult, options?: SVGRenderOptions);
|
|
396
565
|
/**
|
|
397
566
|
* Get list of available screens in the project
|
|
@@ -403,58 +572,389 @@ declare class SVGRenderer {
|
|
|
403
572
|
/**
|
|
404
573
|
* Get the currently selected or first screen
|
|
405
574
|
*/
|
|
406
|
-
|
|
575
|
+
protected getSelectedScreen(): {
|
|
576
|
+
screen: any;
|
|
577
|
+
name: string;
|
|
578
|
+
};
|
|
407
579
|
render(): string;
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
580
|
+
protected calculateContentHeight(): number;
|
|
581
|
+
protected renderNode(nodeId: string, output: string[]): void;
|
|
582
|
+
protected renderComponent(node: IRComponentNode, pos: {
|
|
583
|
+
x: number;
|
|
584
|
+
y: number;
|
|
585
|
+
width: number;
|
|
586
|
+
height: number;
|
|
587
|
+
}): string;
|
|
588
|
+
protected renderHeading(node: IRComponentNode, pos: any): string;
|
|
589
|
+
protected renderButton(node: IRComponentNode, pos: any): string;
|
|
590
|
+
protected renderLink(node: IRComponentNode, pos: any): string;
|
|
591
|
+
protected renderInput(node: IRComponentNode, pos: any): string;
|
|
592
|
+
protected renderTopbar(node: IRComponentNode, pos: any): string;
|
|
593
|
+
protected renderPanelBorder(node: IRNode, pos: any, output: string[]): void;
|
|
594
|
+
protected renderCardBorder(node: IRNode, pos: any, output: string[]): void;
|
|
595
|
+
protected renderTable(node: IRComponentNode, pos: any): string;
|
|
596
|
+
protected renderChartPlaceholder(node: IRComponentNode, pos: any): string;
|
|
597
|
+
protected renderText(node: IRComponentNode, pos: any): string;
|
|
598
|
+
protected renderLabel(node: IRComponentNode, pos: any): string;
|
|
599
|
+
protected renderCode(node: IRComponentNode, pos: any): string;
|
|
600
|
+
protected renderTextarea(node: IRComponentNode, pos: any): string;
|
|
601
|
+
protected renderSelect(node: IRComponentNode, pos: any): string;
|
|
602
|
+
protected renderCheckbox(node: IRComponentNode, pos: any): string;
|
|
603
|
+
protected renderRadio(node: IRComponentNode, pos: any): string;
|
|
604
|
+
protected renderToggle(node: IRComponentNode, pos: any): string;
|
|
605
|
+
protected renderSidebar(node: IRComponentNode, pos: any): string;
|
|
606
|
+
protected renderTabs(node: IRComponentNode, pos: any): string;
|
|
607
|
+
protected renderDivider(node: IRComponentNode, pos: any): string;
|
|
608
|
+
protected renderSeparate(node: IRComponentNode, _pos: any): string;
|
|
609
|
+
protected renderAlert(node: IRComponentNode, pos: any): string;
|
|
610
|
+
protected renderBadge(node: IRComponentNode, pos: any): string;
|
|
611
|
+
protected renderModal(node: IRComponentNode, pos: any): string;
|
|
612
|
+
protected renderList(node: IRComponentNode, pos: any): string;
|
|
613
|
+
protected renderGenericComponent(node: IRComponentNode, pos: any): string;
|
|
614
|
+
protected renderStatCard(node: IRComponentNode, pos: any): string;
|
|
615
|
+
protected renderImage(node: IRComponentNode, pos: any): string;
|
|
616
|
+
protected renderBreadcrumbs(node: IRComponentNode, pos: any): string;
|
|
617
|
+
protected renderSidebarMenu(node: IRComponentNode, pos: any): string;
|
|
618
|
+
protected renderIcon(node: IRComponentNode, pos: any): string;
|
|
619
|
+
protected renderIconButton(node: IRComponentNode, pos: any): string;
|
|
441
620
|
/**
|
|
442
621
|
* Extract SVG path/element content from a full SVG string
|
|
443
622
|
* Removes the outer <svg> tag but keeps the content
|
|
444
623
|
*/
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
624
|
+
protected extractSvgContent(svgString: string): string;
|
|
625
|
+
protected resolveVariantColor(variant: string, fallback: string): string;
|
|
626
|
+
protected resolveAccentColor(): string;
|
|
627
|
+
protected resolveControlColor(): string;
|
|
628
|
+
protected resolveChartColor(): string;
|
|
629
|
+
protected getSemanticVariantColor(variant: string): string | undefined;
|
|
630
|
+
protected hexToRgba(hex: string, alpha: number): string;
|
|
631
|
+
protected getIconSize(size?: string): number;
|
|
632
|
+
protected getIconButtonSize(size?: string): number;
|
|
633
|
+
protected resolveSpacing(spacing?: string): number;
|
|
634
|
+
protected wrapTextToLines(text: string, maxWidth: number, fontSize: number): string[];
|
|
635
|
+
protected clampControlWidth(idealWidth: number, availableWidth: number): number;
|
|
636
|
+
protected truncateTextToWidth(text: string, maxWidth: number, fontSize: number): string;
|
|
637
|
+
protected estimateTextWidth(text: string, fontSize: number): number;
|
|
638
|
+
protected generateUpwardTrendValues(count: number, start: number, end: number): number[];
|
|
639
|
+
protected getControlLabelOffset(label: string): number;
|
|
640
|
+
protected getControlLabelBaselineY(y: number): number;
|
|
641
|
+
protected getHeadingTypography(node: IRComponentNode): {
|
|
642
|
+
fontSize: number;
|
|
643
|
+
fontWeight: number;
|
|
644
|
+
lineHeight: number;
|
|
645
|
+
};
|
|
646
|
+
protected getHeadingFirstLineY(node: IRComponentNode, pos: {
|
|
647
|
+
y: number;
|
|
648
|
+
height: number;
|
|
649
|
+
}, fontSize: number, lineHeightPx: number, lineCount: number): number;
|
|
650
|
+
protected calculateTopbarLayout(node: IRComponentNode, pos: {
|
|
651
|
+
x: number;
|
|
652
|
+
y: number;
|
|
653
|
+
width: number;
|
|
654
|
+
height: number;
|
|
655
|
+
}, title: string, subtitle: string, actions: string, user: string): {
|
|
656
|
+
hasSubtitle: boolean;
|
|
657
|
+
titleY: number;
|
|
658
|
+
subtitleY: number;
|
|
659
|
+
textX: number;
|
|
660
|
+
titleMaxWidth: number;
|
|
661
|
+
visibleTitle: string;
|
|
662
|
+
visibleSubtitle: string;
|
|
663
|
+
leftIcon: null | {
|
|
664
|
+
badgeX: number;
|
|
665
|
+
badgeY: number;
|
|
666
|
+
badgeSize: number;
|
|
667
|
+
badgeRadius: number;
|
|
668
|
+
iconX: number;
|
|
669
|
+
iconY: number;
|
|
670
|
+
iconSize: number;
|
|
671
|
+
iconSvg: string;
|
|
672
|
+
};
|
|
673
|
+
actions: Array<{
|
|
674
|
+
x: number;
|
|
675
|
+
y: number;
|
|
676
|
+
width: number;
|
|
677
|
+
height: number;
|
|
678
|
+
label: string;
|
|
679
|
+
}>;
|
|
680
|
+
userBadge: null | {
|
|
681
|
+
x: number;
|
|
682
|
+
y: number;
|
|
683
|
+
width: number;
|
|
684
|
+
height: number;
|
|
685
|
+
label: string;
|
|
686
|
+
};
|
|
687
|
+
avatar: null | {
|
|
688
|
+
cx: number;
|
|
689
|
+
cy: number;
|
|
690
|
+
r: number;
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
protected parseBooleanProp(value: unknown, fallback?: boolean): boolean;
|
|
694
|
+
protected escapeXml(text: string): string;
|
|
448
695
|
/**
|
|
449
696
|
* Get data-node-id attribute string for SVG elements
|
|
450
697
|
* Enables bidirectional selection between code and canvas
|
|
451
698
|
*/
|
|
452
|
-
|
|
699
|
+
protected getDataNodeId(node: IRComponentNode | IRContainerNode): string;
|
|
453
700
|
}
|
|
454
701
|
declare function renderToSVG(ir: IRContract, layout: LayoutResult, options?: SVGRenderOptions): string;
|
|
455
702
|
declare function createSVGElement(tag: string, attrs: Record<string, string | number>, children?: string[]): string;
|
|
456
703
|
declare function buildSVG(component: SVGComponent): string;
|
|
457
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Skeleton SVG Renderer
|
|
707
|
+
*
|
|
708
|
+
* Renders wireframes in a skeleton/loading state style:
|
|
709
|
+
* - Text/Heading: Gray rectangular blocks instead of text
|
|
710
|
+
* - Buttons: Shape outline only (no text, no fill)
|
|
711
|
+
* - Icons: Hidden completely
|
|
712
|
+
* - All text content: Gray blocks instead of actual text
|
|
713
|
+
*
|
|
714
|
+
* Used for:
|
|
715
|
+
* - Loading states
|
|
716
|
+
* - Content placeholders
|
|
717
|
+
* - Wireframe presentations without actual content
|
|
718
|
+
*/
|
|
719
|
+
|
|
720
|
+
declare class SkeletonSVGRenderer extends SVGRenderer {
|
|
721
|
+
/**
|
|
722
|
+
* Render button with same appearance as standard but without text
|
|
723
|
+
*/
|
|
724
|
+
protected renderButton(node: IRComponentNode, pos: any): string;
|
|
725
|
+
/**
|
|
726
|
+
* Render link as placeholder block + underline (no text)
|
|
727
|
+
*/
|
|
728
|
+
protected renderLink(node: IRComponentNode, pos: any): string;
|
|
729
|
+
/**
|
|
730
|
+
* Render heading as gray block
|
|
731
|
+
*/
|
|
732
|
+
protected renderHeading(node: IRComponentNode, pos: any): string;
|
|
733
|
+
/**
|
|
734
|
+
* Render text as gray block
|
|
735
|
+
*/
|
|
736
|
+
protected renderText(node: IRComponentNode, pos: any): string;
|
|
737
|
+
/**
|
|
738
|
+
* Render label as gray block
|
|
739
|
+
*/
|
|
740
|
+
protected renderLabel(node: IRComponentNode, pos: any): string;
|
|
741
|
+
/**
|
|
742
|
+
* Render badge as shape only (no text)
|
|
743
|
+
*/
|
|
744
|
+
protected renderBadge(node: IRComponentNode, pos: any): string;
|
|
745
|
+
/**
|
|
746
|
+
* Render alert as shape with gray block instead of message
|
|
747
|
+
*/
|
|
748
|
+
protected renderAlert(node: IRComponentNode, pos: any): string;
|
|
749
|
+
/**
|
|
750
|
+
* Render input with gray block for placeholder text
|
|
751
|
+
*/
|
|
752
|
+
protected renderInput(node: IRComponentNode, pos: any): string;
|
|
753
|
+
/**
|
|
754
|
+
* Render textarea with gray block for placeholder text
|
|
755
|
+
*/
|
|
756
|
+
protected renderTextarea(node: IRComponentNode, pos: any): string;
|
|
757
|
+
/**
|
|
758
|
+
* Render select as shape only (no placeholder text)
|
|
759
|
+
*/
|
|
760
|
+
protected renderSelect(node: IRComponentNode, pos: any): string;
|
|
761
|
+
/**
|
|
762
|
+
* Render checkbox as shape only (no label text)
|
|
763
|
+
*/
|
|
764
|
+
protected renderCheckbox(node: IRComponentNode, pos: any): string;
|
|
765
|
+
/**
|
|
766
|
+
* Render radio as shape only (no label text)
|
|
767
|
+
*/
|
|
768
|
+
protected renderRadio(node: IRComponentNode, pos: any): string;
|
|
769
|
+
/**
|
|
770
|
+
* Render toggle as shape only (no label text)
|
|
771
|
+
*/
|
|
772
|
+
protected renderToggle(node: IRComponentNode, pos: any): string;
|
|
773
|
+
/**
|
|
774
|
+
* Render code as shape with gray block instead of code text
|
|
775
|
+
*/
|
|
776
|
+
protected renderCode(node: IRComponentNode, pos: any): string;
|
|
777
|
+
/**
|
|
778
|
+
* Render table with gray blocks instead of text
|
|
779
|
+
*/
|
|
780
|
+
protected renderTable(node: IRComponentNode, pos: any): string;
|
|
781
|
+
/**
|
|
782
|
+
* Render topbar with gray blocks instead of text
|
|
783
|
+
*/
|
|
784
|
+
protected renderTopbar(node: IRComponentNode, pos: any): string;
|
|
785
|
+
/**
|
|
786
|
+
* Render StatCard with gray blocks instead of values
|
|
787
|
+
*/
|
|
788
|
+
protected renderStatCard(node: IRComponentNode, pos: any): string;
|
|
789
|
+
/**
|
|
790
|
+
* Render icon as gray square instead of hiding it
|
|
791
|
+
*/
|
|
792
|
+
protected renderIcon(node: IRComponentNode, pos: any): string;
|
|
793
|
+
/**
|
|
794
|
+
* Render IconButton with same appearance as standard but without icon
|
|
795
|
+
*/
|
|
796
|
+
protected renderIconButton(node: IRComponentNode, pos: any): string;
|
|
797
|
+
/**
|
|
798
|
+
* Render Sidebar with gray blocks instead of text
|
|
799
|
+
*/
|
|
800
|
+
protected renderSidebar(node: IRComponentNode, pos: any): string;
|
|
801
|
+
/**
|
|
802
|
+
* Render SidebarMenu with gray blocks instead of text and no icons
|
|
803
|
+
*/
|
|
804
|
+
protected renderSidebarMenu(node: IRComponentNode, pos: any): string;
|
|
805
|
+
/**
|
|
806
|
+
* Private helper: Render text as gray block
|
|
807
|
+
*/
|
|
808
|
+
private renderTextBlock;
|
|
809
|
+
private renderWrappedLineBlocks;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Sketch SVG Renderer
|
|
814
|
+
*
|
|
815
|
+
* Renders wireframes in a hand-drawn/sketch style:
|
|
816
|
+
* - Thicker borders with sketch appearance
|
|
817
|
+
* - For variant elements (Button, Badge): colored border instead of fill
|
|
818
|
+
* - Keeps text and icons visible
|
|
819
|
+
* - Traditional wireframe look
|
|
820
|
+
*
|
|
821
|
+
* Used for:
|
|
822
|
+
* - Low-fidelity wireframes
|
|
823
|
+
* - Traditional hand-drawn wireframe presentations
|
|
824
|
+
* - Early design mockups
|
|
825
|
+
*/
|
|
826
|
+
|
|
827
|
+
declare class SketchSVGRenderer extends SVGRenderer {
|
|
828
|
+
/**
|
|
829
|
+
* Override render to add sketch filter definitions
|
|
830
|
+
*/
|
|
831
|
+
render(): string;
|
|
832
|
+
/**
|
|
833
|
+
* Render button with colored border instead of fill
|
|
834
|
+
*/
|
|
835
|
+
protected renderButton(node: IRComponentNode, pos: any): string;
|
|
836
|
+
/**
|
|
837
|
+
* Render badge with colored border instead of fill
|
|
838
|
+
*/
|
|
839
|
+
protected renderBadge(node: IRComponentNode, pos: any): string;
|
|
840
|
+
/**
|
|
841
|
+
* Render IconButton with colored border instead of fill
|
|
842
|
+
*/
|
|
843
|
+
protected renderIconButton(node: IRComponentNode, pos: any): string;
|
|
844
|
+
/**
|
|
845
|
+
* Render alert with colored border
|
|
846
|
+
*/
|
|
847
|
+
protected renderAlert(node: IRComponentNode, pos: any): string;
|
|
848
|
+
/**
|
|
849
|
+
* Render input with thicker border
|
|
850
|
+
*/
|
|
851
|
+
protected renderInput(node: IRComponentNode, pos: any): string;
|
|
852
|
+
/**
|
|
853
|
+
* Render textarea with thicker border
|
|
854
|
+
*/
|
|
855
|
+
protected renderTextarea(node: IRComponentNode, pos: any): string;
|
|
856
|
+
/**
|
|
857
|
+
* Render card with thicker border and sketch filter
|
|
858
|
+
*/
|
|
859
|
+
protected renderCard(node: IRComponentNode, pos: any): string;
|
|
860
|
+
/**
|
|
861
|
+
* Render panel with thicker border and sketch filter
|
|
862
|
+
*/
|
|
863
|
+
protected renderPanel(node: IRComponentNode, pos: any): string;
|
|
864
|
+
/**
|
|
865
|
+
* Render heading with sketch filter and Comic Sans
|
|
866
|
+
*/
|
|
867
|
+
protected renderHeading(node: IRComponentNode, pos: any): string;
|
|
868
|
+
/**
|
|
869
|
+
* Render topbar with sketch filter and Comic Sans
|
|
870
|
+
*/
|
|
871
|
+
protected renderTopbar(node: IRComponentNode, pos: any): string;
|
|
872
|
+
/**
|
|
873
|
+
* Render table with sketch filter and Comic Sans
|
|
874
|
+
*/
|
|
875
|
+
protected renderTable(node: IRComponentNode, pos: any): string;
|
|
876
|
+
/**
|
|
877
|
+
* Render text with Comic Sans
|
|
878
|
+
*/
|
|
879
|
+
protected renderText(node: IRComponentNode, pos: any): string;
|
|
880
|
+
/**
|
|
881
|
+
* Render label with Comic Sans
|
|
882
|
+
*/
|
|
883
|
+
protected renderLabel(node: IRComponentNode, pos: any): string;
|
|
884
|
+
/**
|
|
885
|
+
* Render code with sketch filter and Comic Sans
|
|
886
|
+
*/
|
|
887
|
+
protected renderCode(node: IRComponentNode, pos: any): string;
|
|
888
|
+
/**
|
|
889
|
+
* Render select with sketch filter and Comic Sans
|
|
890
|
+
*/
|
|
891
|
+
protected renderSelect(node: IRComponentNode, pos: any): string;
|
|
892
|
+
/**
|
|
893
|
+
* Render checkbox with sketch filter and Comic Sans
|
|
894
|
+
*/
|
|
895
|
+
protected renderCheckbox(node: IRComponentNode, pos: any): string;
|
|
896
|
+
/**
|
|
897
|
+
* Render radio with sketch filter and Comic Sans
|
|
898
|
+
*/
|
|
899
|
+
protected renderRadio(node: IRComponentNode, pos: any): string;
|
|
900
|
+
/**
|
|
901
|
+
* Render toggle with sketch filter and Comic Sans
|
|
902
|
+
*/
|
|
903
|
+
protected renderToggle(node: IRComponentNode, pos: any): string;
|
|
904
|
+
/**
|
|
905
|
+
* Render sidebar with sketch filter and Comic Sans
|
|
906
|
+
*/
|
|
907
|
+
protected renderSidebar(node: IRComponentNode, pos: any): string;
|
|
908
|
+
/**
|
|
909
|
+
* Render tabs with sketch filter and Comic Sans
|
|
910
|
+
*/
|
|
911
|
+
protected renderTabs(node: IRComponentNode, pos: any): string;
|
|
912
|
+
/**
|
|
913
|
+
* Render divider with sketch filter
|
|
914
|
+
*/
|
|
915
|
+
protected renderDivider(node: IRComponentNode, pos: any): string;
|
|
916
|
+
/**
|
|
917
|
+
* Render modal with sketch filter and Comic Sans
|
|
918
|
+
*/
|
|
919
|
+
protected renderModal(node: IRComponentNode, pos: any): string;
|
|
920
|
+
/**
|
|
921
|
+
* Render list with sketch filter and Comic Sans
|
|
922
|
+
*/
|
|
923
|
+
protected renderList(node: IRComponentNode, pos: any): string;
|
|
924
|
+
/**
|
|
925
|
+
* Render generic component with sketch filter and Comic Sans
|
|
926
|
+
*/
|
|
927
|
+
protected renderGenericComponent(node: IRComponentNode, pos: any): string;
|
|
928
|
+
/**
|
|
929
|
+
* Render stat card with sketch filter and Comic Sans
|
|
930
|
+
*/
|
|
931
|
+
protected renderStatCard(node: IRComponentNode, pos: any): string;
|
|
932
|
+
/**
|
|
933
|
+
* Render image with sketch filter
|
|
934
|
+
*/
|
|
935
|
+
protected renderImage(node: IRComponentNode, pos: any): string;
|
|
936
|
+
/**
|
|
937
|
+
* Render breadcrumbs with Comic Sans
|
|
938
|
+
*/
|
|
939
|
+
protected renderBreadcrumbs(node: IRComponentNode, pos: any): string;
|
|
940
|
+
/**
|
|
941
|
+
* Render sidebar menu with sketch filter and Comic Sans
|
|
942
|
+
*/
|
|
943
|
+
protected renderSidebarMenu(node: IRComponentNode, pos: any): string;
|
|
944
|
+
/**
|
|
945
|
+
* Render icon (same as base, icons don't need filter)
|
|
946
|
+
*/
|
|
947
|
+
protected renderIcon(node: IRComponentNode, pos: any): string;
|
|
948
|
+
/**
|
|
949
|
+
* Render chart placeholder with sketch filter and Comic Sans
|
|
950
|
+
*/
|
|
951
|
+
protected renderChartPlaceholder(node: IRComponentNode, pos: any): string;
|
|
952
|
+
/**
|
|
953
|
+
* Helper method to get icon SVG
|
|
954
|
+
*/
|
|
955
|
+
private getIconSvg;
|
|
956
|
+
}
|
|
957
|
+
|
|
458
958
|
/**
|
|
459
959
|
* Content-based hash generation for stable NodeIds
|
|
460
960
|
*
|
|
@@ -783,4 +1283,4 @@ declare class SourceMapResolver {
|
|
|
783
1283
|
|
|
784
1284
|
declare const version = "0.0.1";
|
|
785
1285
|
|
|
786
|
-
export { type AST, type ASTCell, type ASTComponent, type ASTDefinedComponent, type ASTLayout, type ASTScreen, type CapturedTokens, type CodeRange, type IRComponent, type IRComponentNode, type IRContainerNode, type IRContract, IRGenerator, type IRLayout, type IRMeta, type IRMetadata, type IRNode, type
|
|
1286
|
+
export { type AST, type ASTCell, type ASTComponent, type ASTDefinedComponent, type ASTLayout, type ASTScreen, type CapturedTokens, type CodeRange, DENSITY_TOKENS, DEVICE_PRESETS, type DesignTokens, type DevicePreset, type IRComponent, type IRComponentNode, type IRContainerNode, type IRContract, IRGenerator, type IRLayout, type IRMeta, type IRMetadata, type IRNode, type IRNodeStyle, type IRProject, type IRScreen, type IRStyle, type IRWireframe, type InsertionPoint, LayoutEngine, type LayoutPosition, type LayoutResult, type ParseError, type ParseResult, type ParsedComponent, type ParsedWireframe, type Position, type PositionQueryResult, type PropertySourceMap, type SVGComponent, type SVGRenderOptions, SVGRenderer, SkeletonSVGRenderer, SketchSVGRenderer, SourceMapBuilder, type SourceMapEntry, type SourceMapNodeType, SourceMapResolver, buildSVG, calculateLayout, createSVGElement, generateIR, generateStableNodeId, getTypeFromNodeId, isValidDevice, isValidNodeId, parseWireDSL, parseWireDSLWithSourceMap, renderToSVG, resolveDevicePreset, resolveGridPosition, resolveTokens, version };
|