@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.
- package/README.md +351 -0
- package/dist/index.cjs +56106 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +252 -0
- package/dist/index.d.ts +252 -0
- package/dist/index.js +55985 -0
- package/dist/index.js.map +1 -0
- package/dist/parser.cjs +5417 -0
- package/dist/parser.cjs.map +1 -0
- package/dist/parser.d.cts +89 -0
- package/dist/parser.d.ts +89 -0
- package/dist/parser.js +5387 -0
- package/dist/parser.js.map +1 -0
- package/dist/renderer.cjs +50244 -0
- package/dist/renderer.cjs.map +1 -0
- package/dist/renderer.d.cts +497 -0
- package/dist/renderer.d.ts +497 -0
- package/dist/renderer.js +50202 -0
- package/dist/renderer.js.map +1 -0
- package/dist/types-DtovIYS6.d.cts +419 -0
- package/dist/types-DtovIYS6.d.ts +419 -0
- package/package.json +59 -0
- package/src/ast/guards.ts +361 -0
- package/src/ast/index.ts +9 -0
- package/src/ast/types.ts +661 -0
- package/src/ast/utils.ts +238 -0
- package/src/grammar/wireframe.peggy +677 -0
- package/src/icons/lucide-icons.ts +46422 -0
- package/src/index.ts +20 -0
- package/src/parser/generated-parser.js +5199 -0
- package/src/parser/index.ts +214 -0
- package/src/renderer/html/base.ts +186 -0
- package/src/renderer/html/components.ts +1092 -0
- package/src/renderer/html/index.ts +1608 -0
- package/src/renderer/html/layout.ts +392 -0
- package/src/renderer/index.ts +143 -0
- package/src/renderer/styles-components.ts +1232 -0
- package/src/renderer/styles.ts +382 -0
- package/src/renderer/svg/index.ts +1050 -0
- package/src/renderer/types.ts +173 -0
- package/src/types/index.ts +138 -0
- package/src/viewport/index.ts +17 -0
- 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 };
|
package/dist/parser.d.ts
ADDED
|
@@ -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 };
|