@wireweave/core 1.0.0-beta.20260107130355

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.
Files changed (43) hide show
  1. package/README.md +351 -0
  2. package/dist/index.cjs +56106 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +252 -0
  5. package/dist/index.d.ts +252 -0
  6. package/dist/index.js +55985 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/parser.cjs +5417 -0
  9. package/dist/parser.cjs.map +1 -0
  10. package/dist/parser.d.cts +89 -0
  11. package/dist/parser.d.ts +89 -0
  12. package/dist/parser.js +5387 -0
  13. package/dist/parser.js.map +1 -0
  14. package/dist/renderer.cjs +50244 -0
  15. package/dist/renderer.cjs.map +1 -0
  16. package/dist/renderer.d.cts +497 -0
  17. package/dist/renderer.d.ts +497 -0
  18. package/dist/renderer.js +50202 -0
  19. package/dist/renderer.js.map +1 -0
  20. package/dist/types-DtovIYS6.d.cts +419 -0
  21. package/dist/types-DtovIYS6.d.ts +419 -0
  22. package/package.json +59 -0
  23. package/src/ast/guards.ts +361 -0
  24. package/src/ast/index.ts +9 -0
  25. package/src/ast/types.ts +661 -0
  26. package/src/ast/utils.ts +238 -0
  27. package/src/grammar/wireframe.peggy +677 -0
  28. package/src/icons/lucide-icons.ts +46422 -0
  29. package/src/index.ts +20 -0
  30. package/src/parser/generated-parser.js +5199 -0
  31. package/src/parser/index.ts +214 -0
  32. package/src/renderer/html/base.ts +186 -0
  33. package/src/renderer/html/components.ts +1092 -0
  34. package/src/renderer/html/index.ts +1608 -0
  35. package/src/renderer/html/layout.ts +392 -0
  36. package/src/renderer/index.ts +143 -0
  37. package/src/renderer/styles-components.ts +1232 -0
  38. package/src/renderer/styles.ts +382 -0
  39. package/src/renderer/svg/index.ts +1050 -0
  40. package/src/renderer/types.ts +173 -0
  41. package/src/types/index.ts +138 -0
  42. package/src/viewport/index.ts +17 -0
  43. package/src/viewport/presets.ts +181 -0
@@ -0,0 +1,89 @@
1
+ import { a3 as SourceLocation, a1 as WireframeDocument } from './types-DtovIYS6.cjs';
2
+
3
+ /**
4
+ * Parser module for wireweave
5
+ *
6
+ * Provides parse function to convert wireframe DSL to AST
7
+ */
8
+
9
+ /**
10
+ * Parse options
11
+ */
12
+ interface ParseOptions {
13
+ /** Starting rule (defaults to 'Document') */
14
+ startRule?: string;
15
+ /** Include source location in error messages */
16
+ includeLocation?: boolean;
17
+ }
18
+ /**
19
+ * Expected token description from Peggy
20
+ */
21
+ interface ExpectedToken {
22
+ type: string;
23
+ description?: string;
24
+ text?: string;
25
+ }
26
+ /**
27
+ * Parse error with location information
28
+ */
29
+ interface ParseError extends Error {
30
+ name: 'ParseError';
31
+ message: string;
32
+ location: SourceLocation;
33
+ expected: ExpectedToken[];
34
+ found: string | null;
35
+ }
36
+ /**
37
+ * Parse result for tryParse
38
+ */
39
+ interface ParseResult {
40
+ success: boolean;
41
+ document: WireframeDocument | null;
42
+ errors: ParseErrorInfo[];
43
+ }
44
+ /**
45
+ * Simplified error info
46
+ */
47
+ interface ParseErrorInfo {
48
+ message: string;
49
+ location: {
50
+ line: number;
51
+ column: number;
52
+ offset?: number;
53
+ } | null;
54
+ expected?: string[];
55
+ found?: string | null;
56
+ }
57
+ /**
58
+ * Parse wireframe DSL source code into AST
59
+ *
60
+ * @param source - wireweave source code
61
+ * @param options - Parse options
62
+ * @returns Parsed AST document
63
+ * @throws {ParseError} When source contains syntax errors
64
+ */
65
+ declare function parse(source: string, options?: ParseOptions): WireframeDocument;
66
+ /**
67
+ * Parse wireframe DSL with error recovery
68
+ *
69
+ * @param source - wireweave source code
70
+ * @param options - Parse options
71
+ * @returns Parse result with AST or errors
72
+ */
73
+ declare function tryParse(source: string, options?: ParseOptions): ParseResult;
74
+ /**
75
+ * Validate source code without throwing
76
+ *
77
+ * @param source - wireweave source code
78
+ * @returns true if valid, false otherwise
79
+ */
80
+ declare function isValid(source: string): boolean;
81
+ /**
82
+ * Get syntax errors from source code
83
+ *
84
+ * @param source - wireweave source code
85
+ * @returns Array of error info, empty if valid
86
+ */
87
+ declare function getErrors(source: string): ParseErrorInfo[];
88
+
89
+ export { type ExpectedToken, type ParseError, type ParseErrorInfo, type ParseOptions, type ParseResult, getErrors, isValid, parse, tryParse };
@@ -0,0 +1,89 @@
1
+ import { a3 as SourceLocation, a1 as WireframeDocument } from './types-DtovIYS6.js';
2
+
3
+ /**
4
+ * Parser module for wireweave
5
+ *
6
+ * Provides parse function to convert wireframe DSL to AST
7
+ */
8
+
9
+ /**
10
+ * Parse options
11
+ */
12
+ interface ParseOptions {
13
+ /** Starting rule (defaults to 'Document') */
14
+ startRule?: string;
15
+ /** Include source location in error messages */
16
+ includeLocation?: boolean;
17
+ }
18
+ /**
19
+ * Expected token description from Peggy
20
+ */
21
+ interface ExpectedToken {
22
+ type: string;
23
+ description?: string;
24
+ text?: string;
25
+ }
26
+ /**
27
+ * Parse error with location information
28
+ */
29
+ interface ParseError extends Error {
30
+ name: 'ParseError';
31
+ message: string;
32
+ location: SourceLocation;
33
+ expected: ExpectedToken[];
34
+ found: string | null;
35
+ }
36
+ /**
37
+ * Parse result for tryParse
38
+ */
39
+ interface ParseResult {
40
+ success: boolean;
41
+ document: WireframeDocument | null;
42
+ errors: ParseErrorInfo[];
43
+ }
44
+ /**
45
+ * Simplified error info
46
+ */
47
+ interface ParseErrorInfo {
48
+ message: string;
49
+ location: {
50
+ line: number;
51
+ column: number;
52
+ offset?: number;
53
+ } | null;
54
+ expected?: string[];
55
+ found?: string | null;
56
+ }
57
+ /**
58
+ * Parse wireframe DSL source code into AST
59
+ *
60
+ * @param source - wireweave source code
61
+ * @param options - Parse options
62
+ * @returns Parsed AST document
63
+ * @throws {ParseError} When source contains syntax errors
64
+ */
65
+ declare function parse(source: string, options?: ParseOptions): WireframeDocument;
66
+ /**
67
+ * Parse wireframe DSL with error recovery
68
+ *
69
+ * @param source - wireweave source code
70
+ * @param options - Parse options
71
+ * @returns Parse result with AST or errors
72
+ */
73
+ declare function tryParse(source: string, options?: ParseOptions): ParseResult;
74
+ /**
75
+ * Validate source code without throwing
76
+ *
77
+ * @param source - wireweave source code
78
+ * @returns true if valid, false otherwise
79
+ */
80
+ declare function isValid(source: string): boolean;
81
+ /**
82
+ * Get syntax errors from source code
83
+ *
84
+ * @param source - wireweave source code
85
+ * @returns Array of error info, empty if valid
86
+ */
87
+ declare function getErrors(source: string): ParseErrorInfo[];
88
+
89
+ export { type ExpectedToken, type ParseError, type ParseErrorInfo, type ParseOptions, type ParseResult, getErrors, isValid, parse, tryParse };