├── CHANGELOG.md ├── test └── htmltodart_jaspr_test.dart ├── docs ├── jasprconverter.wasm ├── jasprconverter.unopt.wasm ├── main.js ├── index.html └── jasprconverter.mjs ├── web ├── jasprconverter.wasm ├── jasprconverter.unopt.wasm ├── main.js ├── index.html └── jasprconverter.mjs ├── lib ├── jaspr_html_convert.dart └── src │ ├── schema.dart │ ├── parse.dart │ └── components.dart ├── pubspec.yaml ├── Makefile ├── bin └── htmltodart_jaspr.dart ├── analysis_options.yaml ├── README.md └── pubspec.lock /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version. 4 | -------------------------------------------------------------------------------- /test/htmltodart_jaspr_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /docs/jasprconverter.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agusibrahim/htmltodart_jaspr/HEAD/docs/jasprconverter.wasm -------------------------------------------------------------------------------- /web/jasprconverter.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agusibrahim/htmltodart_jaspr/HEAD/web/jasprconverter.wasm -------------------------------------------------------------------------------- /web/jasprconverter.unopt.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agusibrahim/htmltodart_jaspr/HEAD/web/jasprconverter.unopt.wasm -------------------------------------------------------------------------------- /docs/jasprconverter.unopt.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agusibrahim/htmltodart_jaspr/HEAD/docs/jasprconverter.unopt.wasm -------------------------------------------------------------------------------- /lib/jaspr_html_convert.dart: -------------------------------------------------------------------------------- 1 | /// jaspr_html_convert, Library to convert raw HTML to Jaspr components 2 | /// 3 | /// ```sh 4 | /// # activate openapi_spec 5 | /// dart pub global activate jaspr_html_convert 6 | /// 7 | /// # see usage 8 | /// jaspr_html_convert --help 9 | /// ``` 10 | library jaspr_html_convert; 11 | 12 | export 'src/parse.dart'; 13 | -------------------------------------------------------------------------------- /docs/main.js: -------------------------------------------------------------------------------- 1 | (async function () { 2 | try { 3 | const dartModulePromise = WebAssembly.compileStreaming(fetch('jasprconverter.wasm')); 4 | let dart2wasm_runtime = await import('./jasprconverter.mjs'); 5 | let moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, {}); 6 | moduleInstance.exports.init() 7 | 8 | } catch (exception) { 9 | console.error(`Failed to fetch and instantiate wasm module: ${exception}`); 10 | } 11 | })(); -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: htmltodart_jaspr 2 | description: A sample command-line application. 3 | version: 1.0.0 4 | # repository: https://github.com/my_org/my_repo 5 | environment: 6 | sdk: ^3.4.1 7 | 8 | # Add regular dependencies here. 9 | dependencies: 10 | dart_style: ^2.3.6 11 | html: ^0.15.4 12 | js: ^0.7.1 13 | shelf: ^1.4.2 14 | shelf_static: ^1.1.2 15 | web: ^1.0.0 16 | # path: ^1.8.0 17 | dev_dependencies: 18 | lints: ^3.0.0 19 | test: ^1.24.0 20 | -------------------------------------------------------------------------------- /web/main.js: -------------------------------------------------------------------------------- 1 | (async function () { 2 | try { 3 | const dartModulePromise = WebAssembly.compileStreaming(fetch('jasprconverter.wasm')); 4 | let dart2wasm_runtime = await import('./jasprconverter.mjs'); 5 | let moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, {}); 6 | moduleInstance.exports.init() 7 | 8 | } catch (exception) { 9 | console.error(`Failed to fetch and instantiate wasm module: ${exception}`); 10 | } 11 | })(); -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Makefile to compile Dart to WebAssembly 2 | 3 | # Variables 4 | DART_FILE=bin/htmltodart_jaspr.dart 5 | OUTPUT_DIR=docs 6 | OUTPUT_FILE=jasprconverter.wasm 7 | 8 | # Default target 9 | all: compile 10 | 11 | # Compile Dart to WebAssembly 12 | compile: 13 | dart compile wasm $(DART_FILE) -o $(OUTPUT_DIR)/$(OUTPUT_FILE) 14 | 15 | # Clean up generated files 16 | clean: 17 | rm -f $(OUTPUT_DIR)/$(OUTPUT_FILE) 18 | 19 | # Phony targets 20 | .PHONY: all compile clean 21 | -------------------------------------------------------------------------------- /bin/htmltodart_jaspr.dart: -------------------------------------------------------------------------------- 1 | import 'dart:js_interop'; 2 | 3 | //import 'package:js/js.dart' as js; 4 | import 'package:dart_style/dart_style.dart'; 5 | import 'package:htmltodart_jaspr/jaspr_html_convert.dart'; 6 | 7 | @JS() 8 | external set convertToJaspr(JSFunction fn); 9 | 10 | void main(List arguments) async {} 11 | 12 | void _createJasprElement(JSString data, JSFunction fn) { 13 | final converter = JasprConverter(classesAsList: false); 14 | var result = converter.convert(data.toString()).replaceAll(",}", "}").replaceAll(",]", "]").replaceAll(",)", ")"); 15 | var jsprel = DartFormatter(indent: 2).format('final x = $result;').replaceAll("final x = ", "").replaceAll(" [", "[").replaceAll(" ];", "]").replaceAll(" ", " ").replaceAll(" target: '_blank'", " target: Target.blank"); 16 | fn.callAsFunction(null, jsprel.toJS); 17 | } 18 | 19 | @pragma("wasm:export") 20 | void init() { 21 | convertToJaspr = _createJasprElement.toJS; 22 | } 23 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the static analysis results for your project (errors, 2 | # warnings, and lints). 3 | # 4 | # This enables the 'recommended' set of lints from `package:lints`. 5 | # This set helps identify many issues that may lead to problems when running 6 | # or consuming Dart code, and enforces writing Dart using a single, idiomatic 7 | # style and format. 8 | # 9 | # If you want a smaller set of lints you can change this to specify 10 | # 'package:lints/core.yaml'. These are just the most critical lints 11 | # (the recommended set includes the core lints). 12 | # The core lints are also what is used by pub.dev for scoring packages. 13 | 14 | include: package:lints/recommended.yaml 15 | 16 | # Uncomment the following section to specify additional rules. 17 | 18 | # linter: 19 | # rules: 20 | # - camel_case_types 21 | 22 | # analyzer: 23 | # exclude: 24 | # - path/to/excluded/files/** 25 | 26 | # For more information about the core and recommended set of lints, see 27 | # https://dart.dev/go/core-lints 28 | 29 | # For additional information about configuring this file, see 30 | # https://dart.dev/guides/language/analysis-options 31 | -------------------------------------------------------------------------------- /lib/src/schema.dart: -------------------------------------------------------------------------------- 1 | // ========================================== 2 | // CLASS: ComponentStructure 3 | // ========================================== 4 | 5 | class ComponentStructure { 6 | final String name; 7 | final List attributes; 8 | final bool selfClosing; 9 | 10 | const ComponentStructure({ 11 | required this.name, 12 | this.attributes = const [], 13 | this.selfClosing = false, 14 | }); 15 | } 16 | 17 | // ========================================== 18 | // CLASS: ComponentAttribute 19 | // ========================================== 20 | 21 | class ComponentAttribute { 22 | final String raw; 23 | final String name; 24 | final String type; 25 | 26 | const ComponentAttribute({ 27 | required this.raw, 28 | required this.name, 29 | required this.type, 30 | }); 31 | } 32 | 33 | /// Inherited properties for all shapes 34 | const List shapes = [ 35 | ComponentAttribute( 36 | raw: 'fill', 37 | name: 'fill', 38 | type: 'Color', 39 | ), 40 | ComponentAttribute( 41 | raw: 'stroke', 42 | name: 'stroke', 43 | type: 'Color', 44 | ), 45 | ComponentAttribute( 46 | raw: 'stroke-width', 47 | name: 'strokeWidth', 48 | type: 'string', 49 | ), 50 | ]; 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HTML to Dart Jaspr Converter 2 | 3 | This project provides a web-based tool to convert HTML into Dart components using the [Jaspr](https://github.com/schultek/jaspr) framework. The tool features a side-by-side editor interface powered by Ace Editor, allowing users to write HTML on the left and see the generated Dart code on the right. 4 | 5 | ## LIVE DEMO 6 | https://www.agusibrah.im/htmltodart_jaspr/ 7 | 8 | ## Features 9 | 10 | - **Side-by-Side Editors**: Use Ace Editor to write HTML and see the converted Dart Jaspr code side-by-side. 11 | - **Auto-Formatting**: Automatically formats the HTML code upon pasting. 12 | - **Syntax Validation**: Validates HTML syntax and displays errors using Ace Editor's built-in capabilities. 13 | - **Persistence**: Saves the HTML content to `localStorage` on change, allowing the user to resume editing from where they left off. 14 | 15 | ## Getting Started 16 | 17 | ### Prerequisites 18 | 19 | - **Dart SDK**: Make sure you have Dart installed. You can download it from [dart.dev](https://dart.dev/get-dart). 20 | 21 | ### Installation 22 | 23 | 1. Clone the repository: 24 | 25 | ```bash 26 | git clone https://github.com/agusibrahim/htmltodart_jaspr.git 27 | cd htmltodart_jaspr 28 | ``` 29 | 30 | 2. Install dependencies: 31 | ```bash 32 | dart pub get 33 | ``` 34 | 35 | ### Compiling to WebAssembly 36 | 37 | This project includes a Dart script (`bin/htmltodart_jaspr.dart`) that can be compiled into WebAssembly to power the converter. 38 | 39 | To compile the Dart script to WebAssembly: 40 | ```bash 41 | make 42 | ``` 43 | 44 | This will generate a `jasprconverter.wasm` file inside the `docs` directory. 45 | 46 | ### Running the Web Application 47 | 48 | You can serve the `docs` directory using any static file server or deploy it as a GitHub Pages site. 49 | 50 | ### Usage 51 | 52 | 1. Open the web application in your browser. 53 | 2. In the left editor, paste or write your HTML code. 54 | 3. The converted Dart code for Jaspr will appear in the right editor. 55 | 4. You can then copy the Dart code and use it in your Jaspr project. 56 | 57 | ## Acknowledgements 58 | 59 | - **[Jaspr Framework](https://github.com/schultek/jaspr)**: For providing the tools to build powerful and reactive Dart applications. 60 | - **[Ace Editor](https://ace.c9.io/)**: For the powerful code editor used in this project. 61 | - **[jaspr_html_convert](https://github.com/tazatechnology/jaspr_html_convert)**: This project uses the engine converter from this repository to handle the HTML to Dart conversion. 62 | 63 | ## Contributing 64 | 65 | Contributions are welcome! Please feel free to submit a Pull Request or open an issue if you encounter any bugs or have suggestions for improvements. 66 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HTML to Dart Converter 8 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 |

HTML to Jaspr Converter

82 |
83 | 84 |
85 | 86 |
87 |

HTML Input

88 |
89 |
90 | 91 | 92 |
93 |

Result

94 |
95 |
96 |
97 | 98 | 99 | 104 | 105 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HTML to Dart Converter 8 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
81 |

HTML to Dart Converter

82 |
83 | 84 |
85 | 86 |
87 |

HTML Input

88 |
89 |
90 | 91 | 92 |
93 |

Result

94 |
95 |
96 |
97 | 98 | 99 | 104 | 105 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /lib/src/parse.dart: -------------------------------------------------------------------------------- 1 | import 'package:collection/collection.dart'; 2 | import 'package:html/dom.dart'; 3 | import 'package:html/parser.dart'; 4 | 5 | import 'components.dart'; 6 | 7 | // ========================================== 8 | // CLASS: JasprConverter 9 | // ========================================== 10 | 11 | class JasprConverter { 12 | const JasprConverter({ 13 | this.classesAsList = false, 14 | }); 15 | 16 | /// Convert classes to list of strings with a join statement 17 | /// 18 | /// Useful for easily adding/removing classes in component code 19 | final bool classesAsList; 20 | 21 | // ------------------------------------------ 22 | // METHOD: convert 23 | // ------------------------------------------ 24 | 25 | /// Converts an HTML string input into Jaspr components 26 | String convert(String source) { 27 | String output = ''; 28 | 29 | final doc = parse(source); 30 | 31 | // Process each top-level child of the root element 32 | for (final element in doc.children.first.children) { 33 | output += _convertElement(element, source); 34 | } 35 | 36 | output = '[${output.replaceAll('\n\n', '\n').trim()}]'; 37 | return output; 38 | } 39 | 40 | // ------------------------------------------ 41 | // METHOD: _convertElement 42 | // ------------------------------------------ 43 | 44 | String _convertElement(Element e, String source) { 45 | final eName = e.localName; 46 | final c = components.firstWhereOrNull((c) => c.name == eName); 47 | final unSupportedComponent = c == null; 48 | final selfClosing = c?.selfClosing ?? false; 49 | final sourceContainsParent = source.contains('<$eName'); 50 | 51 | // Skip elements added by the parser that are not present in the source 52 | if (!sourceContainsParent && e.children.isEmpty) { 53 | return ''; 54 | } 55 | 56 | String out = ''; 57 | 58 | // Handle the opening of the element 59 | if (sourceContainsParent) { 60 | if (selfClosing) { 61 | out = '\n$eName(\n'; 62 | } else { 63 | if (unSupportedComponent) { 64 | out = "DomComponent(tag: '$eName', children: ["; 65 | } else { 66 | out = '\n$eName(['; 67 | } 68 | } 69 | } 70 | 71 | // Process children and text nodes in the correct order 72 | for (final node in e.nodes) { 73 | if (node.nodeType == Node.TEXT_NODE && (node.text?.trim().isNotEmpty ?? false)) { 74 | String value = node.text!.replaceAll('\n', '').trim(); 75 | // Escape any invalid characters to avoid breaking the string 76 | value = value.replaceAll(r'\', r'\\'); 77 | value = value.replaceAll(r"$", r"\$"); 78 | value = value.replaceAll(r"'", r"\'"); 79 | out += "text('$value'),"; 80 | } else if (node is Element) { 81 | out += _convertElement(node, source); 82 | } 83 | } 84 | 85 | // Handle closing of the element 86 | if (!selfClosing) { 87 | out += '],'; 88 | } 89 | 90 | // Add classes 91 | if (e.className.isNotEmpty) { 92 | if (classesAsList) { 93 | final classList = e.className.split(' ').map((e) => e.replaceAll(RegExp(r'\s+'), ' ').trim()).join("', '"); 94 | out += "classes: ['$classList',].join(' '),"; 95 | } else { 96 | out += "classes: '${e.className}',"; 97 | } 98 | } 99 | 100 | // Add styles as a raw map 101 | if (e.attributes.containsKey('style')) { 102 | final rawStyle = e.attributes['style'].toString(); 103 | final rawStyles = rawStyle.split(';'); 104 | if (rawStyles.isNotEmpty) { 105 | out += 'styles: Styles.raw({'; 106 | for (final s in rawStyles) { 107 | final style = s.split(':'); 108 | if (style.length == 2) { 109 | out += "'${style[0].trim()}': '${style[1].trim()}',"; 110 | } 111 | } 112 | out += '}),'; 113 | } 114 | } 115 | 116 | // Handle supported and unsupported attributes 117 | if (c != null) { 118 | final Map unsupportedAttrMap = {}; 119 | 120 | // Add attributes 121 | for (final attr in e.attributes.entries) { 122 | String attrKey = attr.key.toString(); 123 | 124 | if (attrKey == 'class' || attrKey == 'style') { 125 | continue; 126 | } 127 | 128 | // Check if attribute is supported by component 129 | final attrSchema = c.attributes.firstWhereOrNull((a) => a.raw == attrKey); 130 | 131 | // Special case for id attribute 132 | if (attrKey == 'id') { 133 | out += "id: '${attr.value}',"; 134 | continue; 135 | } 136 | 137 | // Not supported, add to unsupported map 138 | if (attrSchema == null) { 139 | unsupportedAttrMap[attrKey] = attr.value; 140 | continue; 141 | } 142 | 143 | // Handle different attribute types 144 | if (attrSchema.type == 'Unit') { 145 | final px = attr.value.toString().replaceAll('px', ''); 146 | out += "${attrSchema.name}: Unit.pixels($px),"; 147 | } else if (attrSchema.type == 'Color') { 148 | if (attr.value.startsWith('#')) { 149 | out += "${attrSchema.name}: Color.hex('${attr.value}'),"; 150 | } else { 151 | out += "${attrSchema.name}: Color.named('${attr.value}'),"; 152 | } 153 | } else if (attrSchema.type == 'ButtonType') { 154 | out += "${attrSchema.name}: ButtonType.${attr.value},"; 155 | } else if (attrSchema.type == 'InputType') { 156 | if (attr.value == 'datetime') { 157 | out += "${attrSchema.name}: InputType.date,"; 158 | } else if (attr.value == 'datetime-local') { 159 | out += "${attrSchema.name}: InputType.dateTimeLocal,"; 160 | } else { 161 | out += "${attrSchema.name}: InputType.${attr.value},"; 162 | } 163 | } else if (attrSchema.type == 'NumberingType') { 164 | final typeMap = { 165 | 'a': 'lowercaseLetters', 166 | 'A': 'uppercaseLetters', 167 | 'i': 'lowercaseRomanNumerals', 168 | 'I': 'uppercaseRomanNumerals', 169 | '1': 'numbers', 170 | }; 171 | if (typeMap.containsKey(attr.value)) { 172 | out += "${attrSchema.name}: NumberingType.${typeMap[attr.value]},"; 173 | } 174 | } else if (attrSchema.type == 'boolean') { 175 | out += "${attrSchema.name}: true,"; 176 | } else if (attrSchema.type == 'int' || attrSchema.type == 'double') { 177 | out += "${attrSchema.name}: ${attr.value},"; 178 | } else { 179 | out += "${attrSchema.name}: '${attr.value}',"; 180 | } 181 | } 182 | 183 | // Add unsupported attributes to attributes map 184 | if (unsupportedAttrMap.isNotEmpty) { 185 | out += 'attributes: {'; 186 | for (final attr in unsupportedAttrMap.entries) { 187 | out += "'${attr.key}': '${attr.value}',"; 188 | } 189 | out += '},'; 190 | } 191 | } 192 | 193 | out += '),\n'; 194 | 195 | return out; 196 | } 197 | } 198 | -------------------------------------------------------------------------------- /docs/jasprconverter.mjs: -------------------------------------------------------------------------------- 1 | let buildArgsList; 2 | 3 | // `modulePromise` is a promise to the `WebAssembly.module` object to be 4 | // instantiated. 5 | // `importObjectPromise` is a promise to an object that contains any additional 6 | // imports needed by the module that aren't provided by the standard runtime. 7 | // The fields on this object will be merged into the importObject with which 8 | // the module will be instantiated. 9 | // This function returns a promise to the instantiated module. 10 | export const instantiate = async (modulePromise, importObjectPromise) => { 11 | let dartInstance; 12 | 13 | function stringFromDartString(string) { 14 | const totalLength = dartInstance.exports.$stringLength(string); 15 | let result = ''; 16 | let index = 0; 17 | while (index < totalLength) { 18 | let chunkLength = Math.min(totalLength - index, 0xFFFF); 19 | const array = new Array(chunkLength); 20 | for (let i = 0; i < chunkLength; i++) { 21 | array[i] = dartInstance.exports.$stringRead(string, index++); 22 | } 23 | result += String.fromCharCode(...array); 24 | } 25 | return result; 26 | } 27 | 28 | function stringToDartString(string) { 29 | const length = string.length; 30 | let range = 0; 31 | for (let i = 0; i < length; i++) { 32 | range |= string.codePointAt(i); 33 | } 34 | if (range < 256) { 35 | const dartString = dartInstance.exports.$stringAllocate1(length); 36 | for (let i = 0; i < length; i++) { 37 | dartInstance.exports.$stringWrite1(dartString, i, string.codePointAt(i)); 38 | } 39 | return dartString; 40 | } else { 41 | const dartString = dartInstance.exports.$stringAllocate2(length); 42 | for (let i = 0; i < length; i++) { 43 | dartInstance.exports.$stringWrite2(dartString, i, string.charCodeAt(i)); 44 | } 45 | return dartString; 46 | } 47 | } 48 | 49 | // Prints to the console 50 | function printToConsole(value) { 51 | if (typeof dartPrint == "function") { 52 | dartPrint(value); 53 | return; 54 | } 55 | if (typeof console == "object" && typeof console.log != "undefined") { 56 | console.log(value); 57 | return; 58 | } 59 | if (typeof print == "function") { 60 | print(value); 61 | return; 62 | } 63 | 64 | throw "Unable to print message: " + js; 65 | } 66 | 67 | // Converts a Dart List to a JS array. Any Dart objects will be converted, but 68 | // this will be cheap for JSValues. 69 | function arrayFromDartList(constructor, list) { 70 | const length = dartInstance.exports.$listLength(list); 71 | const array = new constructor(length); 72 | for (let i = 0; i < length; i++) { 73 | array[i] = dartInstance.exports.$listRead(list, i); 74 | } 75 | return array; 76 | } 77 | 78 | buildArgsList = function(list) { 79 | const dartList = dartInstance.exports.$makeStringList(); 80 | for (let i = 0; i < list.length; i++) { 81 | dartInstance.exports.$listAdd(dartList, stringToDartString(list[i])); 82 | } 83 | return dartList; 84 | } 85 | 86 | // A special symbol attached to functions that wrap Dart functions. 87 | const jsWrappedDartFunctionSymbol = Symbol("JSWrappedDartFunction"); 88 | 89 | function finalizeWrapper(dartFunction, wrapped) { 90 | wrapped.dartFunction = dartFunction; 91 | wrapped[jsWrappedDartFunctionSymbol] = true; 92 | return wrapped; 93 | } 94 | 95 | // Imports 96 | const dart2wasm = { 97 | 98 | _20: (x0,x1,x2) => x0.call(x1,x2), 99 | _75: x0 => globalThis.convertToJaspr = x0, 100 | _76: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._76(f,x0,x1)), 101 | _12912: v => stringToDartString(v.toString()), 102 | _12926: s => { 103 | const jsSource = stringFromDartString(s); 104 | if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s*$/.test(jsSource)) { 105 | return NaN; 106 | } 107 | return parseFloat(jsSource); 108 | }, 109 | _12927: () => { 110 | let stackString = new Error().stack.toString(); 111 | let frames = stackString.split('\n'); 112 | let drop = 2; 113 | if (frames[0] === 'Error') { 114 | drop += 1; 115 | } 116 | return frames.slice(drop).join('\n'); 117 | }, 118 | _12931: () => { 119 | // On browsers return `globalThis.location.href` 120 | if (globalThis.location != null) { 121 | return stringToDartString(globalThis.location.href); 122 | } 123 | return null; 124 | }, 125 | _12932: () => { 126 | return typeof process != undefined && 127 | Object.prototype.toString.call(process) == "[object process]" && 128 | process.platform == "win32" 129 | }, 130 | _12936: s => stringToDartString(JSON.stringify(stringFromDartString(s))), 131 | _12937: s => printToConsole(stringFromDartString(s)), 132 | _12955: (c) => 133 | queueMicrotask(() => dartInstance.exports.$invokeCallback(c)), 134 | _12957: (a, i) => a.push(i), 135 | _12967: (a, b) => a == b ? 0 : (a > b ? 1 : -1), 136 | _12968: a => a.length, 137 | _12970: (a, i) => a[i], 138 | _12971: (a, i, v) => a[i] = v, 139 | _12973: a => a.join(''), 140 | _12974: (o, a, b) => o.replace(a, b), 141 | _12976: (s, t) => s.split(t), 142 | _12977: s => s.toLowerCase(), 143 | _12978: s => s.toUpperCase(), 144 | _12979: s => s.trim(), 145 | _12981: s => s.trimRight(), 146 | _12983: (s, p, i) => s.indexOf(p, i), 147 | _12984: (s, p, i) => s.lastIndexOf(p, i), 148 | _12986: (o, start, length) => new Uint8Array(o.buffer, o.byteOffset + start, length), 149 | _12987: (o, start, length) => new Int8Array(o.buffer, o.byteOffset + start, length), 150 | _12988: (o, start, length) => new Uint8ClampedArray(o.buffer, o.byteOffset + start, length), 151 | _12989: (o, start, length) => new Uint16Array(o.buffer, o.byteOffset + start, length), 152 | _12990: (o, start, length) => new Int16Array(o.buffer, o.byteOffset + start, length), 153 | _12991: (o, start, length) => new Uint32Array(o.buffer, o.byteOffset + start, length), 154 | _12992: (o, start, length) => new Int32Array(o.buffer, o.byteOffset + start, length), 155 | _12995: (o, start, length) => new Float32Array(o.buffer, o.byteOffset + start, length), 156 | _12996: (o, start, length) => new Float64Array(o.buffer, o.byteOffset + start, length), 157 | _12997: Object.is, 158 | _13000: (o) => new DataView(o.buffer, o.byteOffset, o.byteLength), 159 | _13004: Function.prototype.call.bind(Object.getOwnPropertyDescriptor(DataView.prototype, 'byteLength').get), 160 | _13005: (b, o) => new DataView(b, o), 161 | _13007: Function.prototype.call.bind(DataView.prototype.getUint8), 162 | _13008: Function.prototype.call.bind(DataView.prototype.setUint8), 163 | _13009: Function.prototype.call.bind(DataView.prototype.getInt8), 164 | _13010: Function.prototype.call.bind(DataView.prototype.setInt8), 165 | _13011: Function.prototype.call.bind(DataView.prototype.getUint16), 166 | _13012: Function.prototype.call.bind(DataView.prototype.setUint16), 167 | _13013: Function.prototype.call.bind(DataView.prototype.getInt16), 168 | _13014: Function.prototype.call.bind(DataView.prototype.setInt16), 169 | _13015: Function.prototype.call.bind(DataView.prototype.getUint32), 170 | _13016: Function.prototype.call.bind(DataView.prototype.setUint32), 171 | _13017: Function.prototype.call.bind(DataView.prototype.getInt32), 172 | _13018: Function.prototype.call.bind(DataView.prototype.setInt32), 173 | _13023: Function.prototype.call.bind(DataView.prototype.getFloat32), 174 | _13024: Function.prototype.call.bind(DataView.prototype.setFloat32), 175 | _13025: Function.prototype.call.bind(DataView.prototype.getFloat64), 176 | _13026: Function.prototype.call.bind(DataView.prototype.setFloat64), 177 | _13032: s => stringToDartString(stringFromDartString(s).toUpperCase()), 178 | _13033: s => stringToDartString(stringFromDartString(s).toLowerCase()), 179 | _13035: (s, m) => { 180 | try { 181 | return new RegExp(s, m); 182 | } catch (e) { 183 | return String(e); 184 | } 185 | }, 186 | _13036: (x0,x1) => x0.exec(x1), 187 | _13037: (x0,x1) => x0.test(x1), 188 | _13038: (x0,x1) => x0.exec(x1), 189 | _13039: (x0,x1) => x0.exec(x1), 190 | _13040: x0 => x0.pop(), 191 | _13046: o => o === undefined, 192 | _13047: o => typeof o === 'boolean', 193 | _13048: o => typeof o === 'number', 194 | _13050: o => typeof o === 'string', 195 | _13053: o => o instanceof Int8Array, 196 | _13054: o => o instanceof Uint8Array, 197 | _13055: o => o instanceof Uint8ClampedArray, 198 | _13056: o => o instanceof Int16Array, 199 | _13057: o => o instanceof Uint16Array, 200 | _13058: o => o instanceof Int32Array, 201 | _13059: o => o instanceof Uint32Array, 202 | _13060: o => o instanceof Float32Array, 203 | _13061: o => o instanceof Float64Array, 204 | _13062: o => o instanceof ArrayBuffer, 205 | _13063: o => o instanceof DataView, 206 | _13064: o => o instanceof Array, 207 | _13065: o => typeof o === 'function' && o[jsWrappedDartFunctionSymbol] === true, 208 | _13068: o => o instanceof RegExp, 209 | _13069: (l, r) => l === r, 210 | _13070: o => o, 211 | _13071: o => o, 212 | _13072: o => o, 213 | _13073: b => !!b, 214 | _13074: o => o.length, 215 | _13077: (o, i) => o[i], 216 | _13078: f => f.dartFunction, 217 | _13079: l => arrayFromDartList(Int8Array, l), 218 | _13080: l => arrayFromDartList(Uint8Array, l), 219 | _13081: l => arrayFromDartList(Uint8ClampedArray, l), 220 | _13082: l => arrayFromDartList(Int16Array, l), 221 | _13083: l => arrayFromDartList(Uint16Array, l), 222 | _13084: l => arrayFromDartList(Int32Array, l), 223 | _13085: l => arrayFromDartList(Uint32Array, l), 224 | _13086: l => arrayFromDartList(Float32Array, l), 225 | _13087: l => arrayFromDartList(Float64Array, l), 226 | _13088: (data, length) => { 227 | const view = new DataView(new ArrayBuffer(length)); 228 | for (let i = 0; i < length; i++) { 229 | view.setUint8(i, dartInstance.exports.$byteDataGetUint8(data, i)); 230 | } 231 | return view; 232 | }, 233 | _13089: l => arrayFromDartList(Array, l), 234 | _13090: stringFromDartString, 235 | _13091: stringToDartString, 236 | _13094: l => new Array(l), 237 | _13098: (o, p) => o[p], 238 | _13102: o => String(o), 239 | _13107: x0 => x0.index, 240 | _13109: x0 => x0.length, 241 | _13111: (x0,x1) => x0[x1], 242 | _13113: (x0,x1) => x0.exec(x1), 243 | _13115: x0 => x0.flags, 244 | _13116: x0 => x0.multiline, 245 | _13117: x0 => x0.ignoreCase, 246 | _13118: x0 => x0.unicode, 247 | _13119: x0 => x0.dotAll, 248 | _13120: (x0,x1) => x0.lastIndex = x1 249 | }; 250 | 251 | const baseImports = { 252 | dart2wasm: dart2wasm, 253 | 254 | 255 | Math: Math, 256 | Date: Date, 257 | Object: Object, 258 | Array: Array, 259 | Reflect: Reflect, 260 | }; 261 | 262 | const jsStringPolyfill = { 263 | "charCodeAt": (s, i) => s.charCodeAt(i), 264 | "compare": (s1, s2) => { 265 | if (s1 < s2) return -1; 266 | if (s1 > s2) return 1; 267 | return 0; 268 | }, 269 | "concat": (s1, s2) => s1 + s2, 270 | "equals": (s1, s2) => s1 === s2, 271 | "fromCharCode": (i) => String.fromCharCode(i), 272 | "length": (s) => s.length, 273 | "substring": (s, a, b) => s.substring(a, b), 274 | }; 275 | 276 | dartInstance = await WebAssembly.instantiate(await modulePromise, { 277 | ...baseImports, 278 | ...(await importObjectPromise), 279 | "wasm:js-string": jsStringPolyfill, 280 | }); 281 | 282 | return dartInstance; 283 | } 284 | 285 | // Call the main function for the instantiated module 286 | // `moduleInstance` is the instantiated dart2wasm module 287 | // `args` are any arguments that should be passed into the main function. 288 | export const invoke = (moduleInstance, ...args) => { 289 | const dartMain = moduleInstance.exports.$getMain(); 290 | const dartArgs = buildArgsList(args); 291 | moduleInstance.exports.$invokeMain(dartMain, dartArgs); 292 | } 293 | 294 | -------------------------------------------------------------------------------- /web/jasprconverter.mjs: -------------------------------------------------------------------------------- 1 | let buildArgsList; 2 | 3 | // `modulePromise` is a promise to the `WebAssembly.module` object to be 4 | // instantiated. 5 | // `importObjectPromise` is a promise to an object that contains any additional 6 | // imports needed by the module that aren't provided by the standard runtime. 7 | // The fields on this object will be merged into the importObject with which 8 | // the module will be instantiated. 9 | // This function returns a promise to the instantiated module. 10 | export const instantiate = async (modulePromise, importObjectPromise) => { 11 | let dartInstance; 12 | 13 | function stringFromDartString(string) { 14 | const totalLength = dartInstance.exports.$stringLength(string); 15 | let result = ''; 16 | let index = 0; 17 | while (index < totalLength) { 18 | let chunkLength = Math.min(totalLength - index, 0xFFFF); 19 | const array = new Array(chunkLength); 20 | for (let i = 0; i < chunkLength; i++) { 21 | array[i] = dartInstance.exports.$stringRead(string, index++); 22 | } 23 | result += String.fromCharCode(...array); 24 | } 25 | return result; 26 | } 27 | 28 | function stringToDartString(string) { 29 | const length = string.length; 30 | let range = 0; 31 | for (let i = 0; i < length; i++) { 32 | range |= string.codePointAt(i); 33 | } 34 | if (range < 256) { 35 | const dartString = dartInstance.exports.$stringAllocate1(length); 36 | for (let i = 0; i < length; i++) { 37 | dartInstance.exports.$stringWrite1(dartString, i, string.codePointAt(i)); 38 | } 39 | return dartString; 40 | } else { 41 | const dartString = dartInstance.exports.$stringAllocate2(length); 42 | for (let i = 0; i < length; i++) { 43 | dartInstance.exports.$stringWrite2(dartString, i, string.charCodeAt(i)); 44 | } 45 | return dartString; 46 | } 47 | } 48 | 49 | // Prints to the console 50 | function printToConsole(value) { 51 | if (typeof dartPrint == "function") { 52 | dartPrint(value); 53 | return; 54 | } 55 | if (typeof console == "object" && typeof console.log != "undefined") { 56 | console.log(value); 57 | return; 58 | } 59 | if (typeof print == "function") { 60 | print(value); 61 | return; 62 | } 63 | 64 | throw "Unable to print message: " + js; 65 | } 66 | 67 | // Converts a Dart List to a JS array. Any Dart objects will be converted, but 68 | // this will be cheap for JSValues. 69 | function arrayFromDartList(constructor, list) { 70 | const length = dartInstance.exports.$listLength(list); 71 | const array = new constructor(length); 72 | for (let i = 0; i < length; i++) { 73 | array[i] = dartInstance.exports.$listRead(list, i); 74 | } 75 | return array; 76 | } 77 | 78 | buildArgsList = function(list) { 79 | const dartList = dartInstance.exports.$makeStringList(); 80 | for (let i = 0; i < list.length; i++) { 81 | dartInstance.exports.$listAdd(dartList, stringToDartString(list[i])); 82 | } 83 | return dartList; 84 | } 85 | 86 | // A special symbol attached to functions that wrap Dart functions. 87 | const jsWrappedDartFunctionSymbol = Symbol("JSWrappedDartFunction"); 88 | 89 | function finalizeWrapper(dartFunction, wrapped) { 90 | wrapped.dartFunction = dartFunction; 91 | wrapped[jsWrappedDartFunctionSymbol] = true; 92 | return wrapped; 93 | } 94 | 95 | // Imports 96 | const dart2wasm = { 97 | 98 | _20: (x0,x1,x2) => x0.call(x1,x2), 99 | _75: x0 => globalThis.convertToJaspr = x0, 100 | _76: f => finalizeWrapper(f,(x0,x1) => dartInstance.exports._76(f,x0,x1)), 101 | _12912: v => stringToDartString(v.toString()), 102 | _12926: s => { 103 | const jsSource = stringFromDartString(s); 104 | if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s*$/.test(jsSource)) { 105 | return NaN; 106 | } 107 | return parseFloat(jsSource); 108 | }, 109 | _12927: () => { 110 | let stackString = new Error().stack.toString(); 111 | let frames = stackString.split('\n'); 112 | let drop = 2; 113 | if (frames[0] === 'Error') { 114 | drop += 1; 115 | } 116 | return frames.slice(drop).join('\n'); 117 | }, 118 | _12931: () => { 119 | // On browsers return `globalThis.location.href` 120 | if (globalThis.location != null) { 121 | return stringToDartString(globalThis.location.href); 122 | } 123 | return null; 124 | }, 125 | _12932: () => { 126 | return typeof process != undefined && 127 | Object.prototype.toString.call(process) == "[object process]" && 128 | process.platform == "win32" 129 | }, 130 | _12936: s => stringToDartString(JSON.stringify(stringFromDartString(s))), 131 | _12937: s => printToConsole(stringFromDartString(s)), 132 | _12955: (c) => 133 | queueMicrotask(() => dartInstance.exports.$invokeCallback(c)), 134 | _12957: (a, i) => a.push(i), 135 | _12967: (a, b) => a == b ? 0 : (a > b ? 1 : -1), 136 | _12968: a => a.length, 137 | _12970: (a, i) => a[i], 138 | _12971: (a, i, v) => a[i] = v, 139 | _12973: a => a.join(''), 140 | _12974: (o, a, b) => o.replace(a, b), 141 | _12976: (s, t) => s.split(t), 142 | _12977: s => s.toLowerCase(), 143 | _12978: s => s.toUpperCase(), 144 | _12979: s => s.trim(), 145 | _12981: s => s.trimRight(), 146 | _12983: (s, p, i) => s.indexOf(p, i), 147 | _12984: (s, p, i) => s.lastIndexOf(p, i), 148 | _12986: (o, start, length) => new Uint8Array(o.buffer, o.byteOffset + start, length), 149 | _12987: (o, start, length) => new Int8Array(o.buffer, o.byteOffset + start, length), 150 | _12988: (o, start, length) => new Uint8ClampedArray(o.buffer, o.byteOffset + start, length), 151 | _12989: (o, start, length) => new Uint16Array(o.buffer, o.byteOffset + start, length), 152 | _12990: (o, start, length) => new Int16Array(o.buffer, o.byteOffset + start, length), 153 | _12991: (o, start, length) => new Uint32Array(o.buffer, o.byteOffset + start, length), 154 | _12992: (o, start, length) => new Int32Array(o.buffer, o.byteOffset + start, length), 155 | _12995: (o, start, length) => new Float32Array(o.buffer, o.byteOffset + start, length), 156 | _12996: (o, start, length) => new Float64Array(o.buffer, o.byteOffset + start, length), 157 | _12997: Object.is, 158 | _13000: (o) => new DataView(o.buffer, o.byteOffset, o.byteLength), 159 | _13004: Function.prototype.call.bind(Object.getOwnPropertyDescriptor(DataView.prototype, 'byteLength').get), 160 | _13005: (b, o) => new DataView(b, o), 161 | _13007: Function.prototype.call.bind(DataView.prototype.getUint8), 162 | _13008: Function.prototype.call.bind(DataView.prototype.setUint8), 163 | _13009: Function.prototype.call.bind(DataView.prototype.getInt8), 164 | _13010: Function.prototype.call.bind(DataView.prototype.setInt8), 165 | _13011: Function.prototype.call.bind(DataView.prototype.getUint16), 166 | _13012: Function.prototype.call.bind(DataView.prototype.setUint16), 167 | _13013: Function.prototype.call.bind(DataView.prototype.getInt16), 168 | _13014: Function.prototype.call.bind(DataView.prototype.setInt16), 169 | _13015: Function.prototype.call.bind(DataView.prototype.getUint32), 170 | _13016: Function.prototype.call.bind(DataView.prototype.setUint32), 171 | _13017: Function.prototype.call.bind(DataView.prototype.getInt32), 172 | _13018: Function.prototype.call.bind(DataView.prototype.setInt32), 173 | _13023: Function.prototype.call.bind(DataView.prototype.getFloat32), 174 | _13024: Function.prototype.call.bind(DataView.prototype.setFloat32), 175 | _13025: Function.prototype.call.bind(DataView.prototype.getFloat64), 176 | _13026: Function.prototype.call.bind(DataView.prototype.setFloat64), 177 | _13032: s => stringToDartString(stringFromDartString(s).toUpperCase()), 178 | _13033: s => stringToDartString(stringFromDartString(s).toLowerCase()), 179 | _13035: (s, m) => { 180 | try { 181 | return new RegExp(s, m); 182 | } catch (e) { 183 | return String(e); 184 | } 185 | }, 186 | _13036: (x0,x1) => x0.exec(x1), 187 | _13037: (x0,x1) => x0.test(x1), 188 | _13038: (x0,x1) => x0.exec(x1), 189 | _13039: (x0,x1) => x0.exec(x1), 190 | _13040: x0 => x0.pop(), 191 | _13046: o => o === undefined, 192 | _13047: o => typeof o === 'boolean', 193 | _13048: o => typeof o === 'number', 194 | _13050: o => typeof o === 'string', 195 | _13053: o => o instanceof Int8Array, 196 | _13054: o => o instanceof Uint8Array, 197 | _13055: o => o instanceof Uint8ClampedArray, 198 | _13056: o => o instanceof Int16Array, 199 | _13057: o => o instanceof Uint16Array, 200 | _13058: o => o instanceof Int32Array, 201 | _13059: o => o instanceof Uint32Array, 202 | _13060: o => o instanceof Float32Array, 203 | _13061: o => o instanceof Float64Array, 204 | _13062: o => o instanceof ArrayBuffer, 205 | _13063: o => o instanceof DataView, 206 | _13064: o => o instanceof Array, 207 | _13065: o => typeof o === 'function' && o[jsWrappedDartFunctionSymbol] === true, 208 | _13068: o => o instanceof RegExp, 209 | _13069: (l, r) => l === r, 210 | _13070: o => o, 211 | _13071: o => o, 212 | _13072: o => o, 213 | _13073: b => !!b, 214 | _13074: o => o.length, 215 | _13077: (o, i) => o[i], 216 | _13078: f => f.dartFunction, 217 | _13079: l => arrayFromDartList(Int8Array, l), 218 | _13080: l => arrayFromDartList(Uint8Array, l), 219 | _13081: l => arrayFromDartList(Uint8ClampedArray, l), 220 | _13082: l => arrayFromDartList(Int16Array, l), 221 | _13083: l => arrayFromDartList(Uint16Array, l), 222 | _13084: l => arrayFromDartList(Int32Array, l), 223 | _13085: l => arrayFromDartList(Uint32Array, l), 224 | _13086: l => arrayFromDartList(Float32Array, l), 225 | _13087: l => arrayFromDartList(Float64Array, l), 226 | _13088: (data, length) => { 227 | const view = new DataView(new ArrayBuffer(length)); 228 | for (let i = 0; i < length; i++) { 229 | view.setUint8(i, dartInstance.exports.$byteDataGetUint8(data, i)); 230 | } 231 | return view; 232 | }, 233 | _13089: l => arrayFromDartList(Array, l), 234 | _13090: stringFromDartString, 235 | _13091: stringToDartString, 236 | _13094: l => new Array(l), 237 | _13098: (o, p) => o[p], 238 | _13102: o => String(o), 239 | _13107: x0 => x0.index, 240 | _13109: x0 => x0.length, 241 | _13111: (x0,x1) => x0[x1], 242 | _13113: (x0,x1) => x0.exec(x1), 243 | _13115: x0 => x0.flags, 244 | _13116: x0 => x0.multiline, 245 | _13117: x0 => x0.ignoreCase, 246 | _13118: x0 => x0.unicode, 247 | _13119: x0 => x0.dotAll, 248 | _13120: (x0,x1) => x0.lastIndex = x1 249 | }; 250 | 251 | const baseImports = { 252 | dart2wasm: dart2wasm, 253 | 254 | 255 | Math: Math, 256 | Date: Date, 257 | Object: Object, 258 | Array: Array, 259 | Reflect: Reflect, 260 | }; 261 | 262 | const jsStringPolyfill = { 263 | "charCodeAt": (s, i) => s.charCodeAt(i), 264 | "compare": (s1, s2) => { 265 | if (s1 < s2) return -1; 266 | if (s1 > s2) return 1; 267 | return 0; 268 | }, 269 | "concat": (s1, s2) => s1 + s2, 270 | "equals": (s1, s2) => s1 === s2, 271 | "fromCharCode": (i) => String.fromCharCode(i), 272 | "length": (s) => s.length, 273 | "substring": (s, a, b) => s.substring(a, b), 274 | }; 275 | 276 | dartInstance = await WebAssembly.instantiate(await modulePromise, { 277 | ...baseImports, 278 | ...(await importObjectPromise), 279 | "wasm:js-string": jsStringPolyfill, 280 | }); 281 | 282 | return dartInstance; 283 | } 284 | 285 | // Call the main function for the instantiated module 286 | // `moduleInstance` is the instantiated dart2wasm module 287 | // `args` are any arguments that should be passed into the main function. 288 | export const invoke = (moduleInstance, ...args) => { 289 | const dartMain = moduleInstance.exports.$getMain(); 290 | const dartArgs = buildArgsList(args); 291 | moduleInstance.exports.$invokeMain(dartMain, dartArgs); 292 | } 293 | 294 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | _fe_analyzer_shared: 5 | dependency: transitive 6 | description: 7 | name: _fe_analyzer_shared 8 | sha256: "5aaf60d96c4cd00fe7f21594b5ad6a1b699c80a27420f8a837f4d68473ef09e3" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "68.0.0" 12 | _macros: 13 | dependency: transitive 14 | description: dart 15 | source: sdk 16 | version: "0.1.0" 17 | analyzer: 18 | dependency: transitive 19 | description: 20 | name: analyzer 21 | sha256: "21f1d3720fd1c70316399d5e2bccaebb415c434592d778cce8acb967b8578808" 22 | url: "https://pub.dev" 23 | source: hosted 24 | version: "6.5.0" 25 | args: 26 | dependency: transitive 27 | description: 28 | name: args 29 | sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" 30 | url: "https://pub.dev" 31 | source: hosted 32 | version: "2.5.0" 33 | async: 34 | dependency: transitive 35 | description: 36 | name: async 37 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 38 | url: "https://pub.dev" 39 | source: hosted 40 | version: "2.11.0" 41 | boolean_selector: 42 | dependency: transitive 43 | description: 44 | name: boolean_selector 45 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 46 | url: "https://pub.dev" 47 | source: hosted 48 | version: "2.1.1" 49 | collection: 50 | dependency: transitive 51 | description: 52 | name: collection 53 | sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf 54 | url: "https://pub.dev" 55 | source: hosted 56 | version: "1.19.0" 57 | convert: 58 | dependency: transitive 59 | description: 60 | name: convert 61 | sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" 62 | url: "https://pub.dev" 63 | source: hosted 64 | version: "3.1.1" 65 | coverage: 66 | dependency: transitive 67 | description: 68 | name: coverage 69 | sha256: "576aaab8b1abdd452e0f656c3e73da9ead9d7880e15bdc494189d9c1a1baf0db" 70 | url: "https://pub.dev" 71 | source: hosted 72 | version: "1.9.0" 73 | crypto: 74 | dependency: transitive 75 | description: 76 | name: crypto 77 | sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 78 | url: "https://pub.dev" 79 | source: hosted 80 | version: "3.0.5" 81 | csslib: 82 | dependency: transitive 83 | description: 84 | name: csslib 85 | sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" 86 | url: "https://pub.dev" 87 | source: hosted 88 | version: "1.0.0" 89 | dart_style: 90 | dependency: "direct main" 91 | description: 92 | name: dart_style 93 | sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" 94 | url: "https://pub.dev" 95 | source: hosted 96 | version: "2.3.6" 97 | file: 98 | dependency: transitive 99 | description: 100 | name: file 101 | sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" 102 | url: "https://pub.dev" 103 | source: hosted 104 | version: "7.0.0" 105 | frontend_server_client: 106 | dependency: transitive 107 | description: 108 | name: frontend_server_client 109 | sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 110 | url: "https://pub.dev" 111 | source: hosted 112 | version: "4.0.0" 113 | glob: 114 | dependency: transitive 115 | description: 116 | name: glob 117 | sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" 118 | url: "https://pub.dev" 119 | source: hosted 120 | version: "2.1.2" 121 | html: 122 | dependency: "direct main" 123 | description: 124 | name: html 125 | sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" 126 | url: "https://pub.dev" 127 | source: hosted 128 | version: "0.15.4" 129 | http_multi_server: 130 | dependency: transitive 131 | description: 132 | name: http_multi_server 133 | sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" 134 | url: "https://pub.dev" 135 | source: hosted 136 | version: "3.2.1" 137 | http_parser: 138 | dependency: transitive 139 | description: 140 | name: http_parser 141 | sha256: "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4" 142 | url: "https://pub.dev" 143 | source: hosted 144 | version: "4.1.0" 145 | io: 146 | dependency: transitive 147 | description: 148 | name: io 149 | sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" 150 | url: "https://pub.dev" 151 | source: hosted 152 | version: "1.0.4" 153 | js: 154 | dependency: "direct main" 155 | description: 156 | name: js 157 | sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf 158 | url: "https://pub.dev" 159 | source: hosted 160 | version: "0.7.1" 161 | lints: 162 | dependency: "direct dev" 163 | description: 164 | name: lints 165 | sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 166 | url: "https://pub.dev" 167 | source: hosted 168 | version: "3.0.0" 169 | logging: 170 | dependency: transitive 171 | description: 172 | name: logging 173 | sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" 174 | url: "https://pub.dev" 175 | source: hosted 176 | version: "1.2.0" 177 | macros: 178 | dependency: transitive 179 | description: 180 | name: macros 181 | sha256: "12e8a9842b5a7390de7a781ec63d793527582398d16ea26c60fed58833c9ae79" 182 | url: "https://pub.dev" 183 | source: hosted 184 | version: "0.1.0-main.0" 185 | matcher: 186 | dependency: transitive 187 | description: 188 | name: matcher 189 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 190 | url: "https://pub.dev" 191 | source: hosted 192 | version: "0.12.16+1" 193 | meta: 194 | dependency: transitive 195 | description: 196 | name: meta 197 | sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 198 | url: "https://pub.dev" 199 | source: hosted 200 | version: "1.15.0" 201 | mime: 202 | dependency: transitive 203 | description: 204 | name: mime 205 | sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" 206 | url: "https://pub.dev" 207 | source: hosted 208 | version: "1.0.6" 209 | node_preamble: 210 | dependency: transitive 211 | description: 212 | name: node_preamble 213 | sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" 214 | url: "https://pub.dev" 215 | source: hosted 216 | version: "2.0.2" 217 | package_config: 218 | dependency: transitive 219 | description: 220 | name: package_config 221 | sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" 222 | url: "https://pub.dev" 223 | source: hosted 224 | version: "2.1.0" 225 | path: 226 | dependency: transitive 227 | description: 228 | name: path 229 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 230 | url: "https://pub.dev" 231 | source: hosted 232 | version: "1.9.0" 233 | pool: 234 | dependency: transitive 235 | description: 236 | name: pool 237 | sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" 238 | url: "https://pub.dev" 239 | source: hosted 240 | version: "1.5.1" 241 | pub_semver: 242 | dependency: transitive 243 | description: 244 | name: pub_semver 245 | sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" 246 | url: "https://pub.dev" 247 | source: hosted 248 | version: "2.1.4" 249 | shelf: 250 | dependency: "direct main" 251 | description: 252 | name: shelf 253 | sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 254 | url: "https://pub.dev" 255 | source: hosted 256 | version: "1.4.2" 257 | shelf_packages_handler: 258 | dependency: transitive 259 | description: 260 | name: shelf_packages_handler 261 | sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" 262 | url: "https://pub.dev" 263 | source: hosted 264 | version: "3.0.2" 265 | shelf_static: 266 | dependency: "direct main" 267 | description: 268 | name: shelf_static 269 | sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e 270 | url: "https://pub.dev" 271 | source: hosted 272 | version: "1.1.2" 273 | shelf_web_socket: 274 | dependency: transitive 275 | description: 276 | name: shelf_web_socket 277 | sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" 278 | url: "https://pub.dev" 279 | source: hosted 280 | version: "2.0.0" 281 | source_map_stack_trace: 282 | dependency: transitive 283 | description: 284 | name: source_map_stack_trace 285 | sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b 286 | url: "https://pub.dev" 287 | source: hosted 288 | version: "2.1.2" 289 | source_maps: 290 | dependency: transitive 291 | description: 292 | name: source_maps 293 | sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" 294 | url: "https://pub.dev" 295 | source: hosted 296 | version: "0.10.12" 297 | source_span: 298 | dependency: transitive 299 | description: 300 | name: source_span 301 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 302 | url: "https://pub.dev" 303 | source: hosted 304 | version: "1.10.0" 305 | stack_trace: 306 | dependency: transitive 307 | description: 308 | name: stack_trace 309 | sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" 310 | url: "https://pub.dev" 311 | source: hosted 312 | version: "1.11.1" 313 | stream_channel: 314 | dependency: transitive 315 | description: 316 | name: stream_channel 317 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 318 | url: "https://pub.dev" 319 | source: hosted 320 | version: "2.1.2" 321 | string_scanner: 322 | dependency: transitive 323 | description: 324 | name: string_scanner 325 | sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" 326 | url: "https://pub.dev" 327 | source: hosted 328 | version: "1.3.0" 329 | term_glyph: 330 | dependency: transitive 331 | description: 332 | name: term_glyph 333 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 334 | url: "https://pub.dev" 335 | source: hosted 336 | version: "1.2.1" 337 | test: 338 | dependency: "direct dev" 339 | description: 340 | name: test 341 | sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" 342 | url: "https://pub.dev" 343 | source: hosted 344 | version: "1.25.8" 345 | test_api: 346 | dependency: transitive 347 | description: 348 | name: test_api 349 | sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" 350 | url: "https://pub.dev" 351 | source: hosted 352 | version: "0.7.3" 353 | test_core: 354 | dependency: transitive 355 | description: 356 | name: test_core 357 | sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" 358 | url: "https://pub.dev" 359 | source: hosted 360 | version: "0.6.5" 361 | typed_data: 362 | dependency: transitive 363 | description: 364 | name: typed_data 365 | sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c 366 | url: "https://pub.dev" 367 | source: hosted 368 | version: "1.3.2" 369 | vm_service: 370 | dependency: transitive 371 | description: 372 | name: vm_service 373 | sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" 374 | url: "https://pub.dev" 375 | source: hosted 376 | version: "14.2.5" 377 | watcher: 378 | dependency: transitive 379 | description: 380 | name: watcher 381 | sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" 382 | url: "https://pub.dev" 383 | source: hosted 384 | version: "1.1.0" 385 | web: 386 | dependency: "direct main" 387 | description: 388 | name: web 389 | sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 390 | url: "https://pub.dev" 391 | source: hosted 392 | version: "1.0.0" 393 | web_socket: 394 | dependency: transitive 395 | description: 396 | name: web_socket 397 | sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" 398 | url: "https://pub.dev" 399 | source: hosted 400 | version: "0.1.6" 401 | web_socket_channel: 402 | dependency: transitive 403 | description: 404 | name: web_socket_channel 405 | sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" 406 | url: "https://pub.dev" 407 | source: hosted 408 | version: "3.0.1" 409 | webkit_inspection_protocol: 410 | dependency: transitive 411 | description: 412 | name: webkit_inspection_protocol 413 | sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" 414 | url: "https://pub.dev" 415 | source: hosted 416 | version: "1.2.1" 417 | yaml: 418 | dependency: transitive 419 | description: 420 | name: yaml 421 | sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" 422 | url: "https://pub.dev" 423 | source: hosted 424 | version: "3.1.2" 425 | sdks: 426 | dart: ">=3.4.1 <4.0.0" 427 | -------------------------------------------------------------------------------- /lib/src/components.dart: -------------------------------------------------------------------------------- 1 | import 'schema.dart'; 2 | 3 | const List components = [ 4 | ComponentStructure( 5 | name: 'article', 6 | ), 7 | ComponentStructure( 8 | name: 'aside', 9 | ), 10 | ComponentStructure( 11 | name: 'body', 12 | ), 13 | ComponentStructure( 14 | name: 'footer', 15 | ), 16 | ComponentStructure( 17 | name: 'head', 18 | ), 19 | ComponentStructure( 20 | name: 'header', 21 | ), 22 | ComponentStructure( 23 | name: 'html', 24 | ), 25 | ComponentStructure( 26 | name: 'h1', 27 | ), 28 | ComponentStructure( 29 | name: 'h2', 30 | ), 31 | ComponentStructure( 32 | name: 'h3', 33 | ), 34 | ComponentStructure( 35 | name: 'h4', 36 | ), 37 | ComponentStructure( 38 | name: 'h5', 39 | ), 40 | ComponentStructure( 41 | name: 'h6', 42 | ), 43 | ComponentStructure( 44 | name: 'nav', 45 | ), 46 | ComponentStructure( 47 | name: 'section', 48 | ), 49 | ComponentStructure( 50 | name: 'blockquote', 51 | attributes: [ 52 | ComponentAttribute( 53 | raw: 'cite', 54 | name: 'cite', 55 | type: 'string', 56 | ), 57 | ], 58 | ), 59 | ComponentStructure( 60 | name: 'div', 61 | ), 62 | ComponentStructure( 63 | name: 'ul', 64 | ), 65 | ComponentStructure( 66 | name: 'ol', 67 | attributes: [ 68 | ComponentAttribute( 69 | raw: 'reversed', 70 | name: 'reversed', 71 | type: 'boolean', 72 | ), 73 | ComponentAttribute( 74 | raw: 'start', 75 | name: 'start', 76 | type: 'int', 77 | ), 78 | ComponentAttribute( 79 | raw: 'type', 80 | name: 'type', 81 | type: 'NumberingType', 82 | ), 83 | ], 84 | ), 85 | ComponentStructure( 86 | name: 'li', 87 | attributes: [ 88 | ComponentAttribute( 89 | raw: 'value', 90 | name: 'value', 91 | type: 'int', 92 | ), 93 | ], 94 | ), 95 | ComponentStructure( 96 | name: 'hr', 97 | selfClosing: true, 98 | ), 99 | ComponentStructure( 100 | name: 'p', 101 | ), 102 | ComponentStructure( 103 | name: 'pre', 104 | ), 105 | ComponentStructure( 106 | name: 'a', 107 | attributes: [ 108 | ComponentAttribute( 109 | raw: 'download', 110 | name: 'download', 111 | type: 'string', 112 | ), 113 | ComponentAttribute( 114 | raw: 'href', 115 | name: 'href', 116 | type: 'string', 117 | ), 118 | ComponentAttribute( 119 | raw: 'target', 120 | name: 'target', 121 | type: 'Target', 122 | ), 123 | ComponentAttribute( 124 | raw: 'type', 125 | name: 'type', 126 | type: 'string', 127 | ), 128 | ComponentAttribute( 129 | raw: 'referrerpolicy', 130 | name: 'referrerPolicy', 131 | type: 'ReferrerPolicy', 132 | ), 133 | ], 134 | ), 135 | ComponentStructure( 136 | name: 'b', 137 | ), 138 | ComponentStructure( 139 | name: 'br', 140 | selfClosing: true, 141 | ), 142 | ComponentStructure( 143 | name: 'code', 144 | ), 145 | ComponentStructure( 146 | name: 'em', 147 | ), 148 | ComponentStructure( 149 | name: 'i', 150 | ), 151 | ComponentStructure( 152 | name: 's', 153 | ), 154 | ComponentStructure( 155 | name: 'small', 156 | ), 157 | ComponentStructure( 158 | name: 'span', 159 | ), 160 | ComponentStructure( 161 | name: 'strong', 162 | ), 163 | ComponentStructure( 164 | name: 'u', 165 | ), 166 | ComponentStructure( 167 | name: 'audio', 168 | attributes: [ 169 | ComponentAttribute( 170 | raw: 'autoplay', 171 | name: 'autoplay', 172 | type: 'boolean', 173 | ), 174 | ComponentAttribute( 175 | raw: 'controls', 176 | name: 'controls', 177 | type: 'boolean', 178 | ), 179 | ComponentAttribute( 180 | raw: 'crossorigin', 181 | name: 'crossOrigin', 182 | type: 'CrossOrigin', 183 | ), 184 | ComponentAttribute( 185 | raw: 'loop', 186 | name: 'loop', 187 | type: 'boolean', 188 | ), 189 | ComponentAttribute( 190 | raw: 'muted', 191 | name: 'muted', 192 | type: 'boolean', 193 | ), 194 | ComponentAttribute( 195 | raw: 'preload', 196 | name: 'preload', 197 | type: 'Preload', 198 | ), 199 | ComponentAttribute( 200 | raw: 'src', 201 | name: 'src', 202 | type: 'string', 203 | ), 204 | ], 205 | ), 206 | ComponentStructure( 207 | name: 'img', 208 | selfClosing: true, 209 | attributes: [ 210 | ComponentAttribute( 211 | raw: 'alt', 212 | name: 'alt', 213 | type: 'string', 214 | ), 215 | ComponentAttribute( 216 | raw: 'crossorigin', 217 | name: 'crossOrigin', 218 | type: 'CrossOrigin', 219 | ), 220 | ComponentAttribute( 221 | raw: 'width', 222 | name: 'width', 223 | type: 'int', 224 | ), 225 | ComponentAttribute( 226 | raw: 'height', 227 | name: 'height', 228 | type: 'int', 229 | ), 230 | ComponentAttribute( 231 | raw: 'loading', 232 | name: 'loading', 233 | type: 'MediaLoading', 234 | ), 235 | ComponentAttribute( 236 | raw: 'src', 237 | name: 'src', 238 | type: 'string', 239 | ), 240 | ComponentAttribute( 241 | raw: 'referrerpolicy', 242 | name: 'referrerPolicy', 243 | type: 'ReferrerPolicy', 244 | ), 245 | ], 246 | ), 247 | ComponentStructure( 248 | name: 'video', 249 | attributes: [ 250 | ComponentAttribute( 251 | raw: 'autoplay', 252 | name: 'autoplay', 253 | type: 'boolean', 254 | ), 255 | ComponentAttribute( 256 | raw: 'controls', 257 | name: 'controls', 258 | type: 'boolean', 259 | ), 260 | ComponentAttribute( 261 | raw: 'crossorigin', 262 | name: 'crossOrigin', 263 | type: 'CrossOrigin', 264 | ), 265 | ComponentAttribute( 266 | raw: 'loop', 267 | name: 'loop', 268 | type: 'boolean', 269 | ), 270 | ComponentAttribute( 271 | raw: 'muted', 272 | name: 'muted', 273 | type: 'boolean', 274 | ), 275 | ComponentAttribute( 276 | raw: 'poster', 277 | name: 'poster', 278 | type: 'string', 279 | ), 280 | ComponentAttribute( 281 | raw: 'preload', 282 | name: 'preload', 283 | type: 'Preload', 284 | ), 285 | ComponentAttribute( 286 | raw: 'src', 287 | name: 'src', 288 | type: 'string', 289 | ), 290 | ComponentAttribute( 291 | raw: 'width', 292 | name: 'width', 293 | type: 'int', 294 | ), 295 | ComponentAttribute( 296 | raw: 'height', 297 | name: 'height', 298 | type: 'int', 299 | ), 300 | ], 301 | ), 302 | ComponentStructure( 303 | name: 'embed', 304 | selfClosing: true, 305 | attributes: [ 306 | ComponentAttribute( 307 | raw: 'src', 308 | name: 'src', 309 | type: 'string', 310 | ), 311 | ComponentAttribute( 312 | raw: 'type', 313 | name: 'type', 314 | type: 'string', 315 | ), 316 | ComponentAttribute( 317 | raw: 'width', 318 | name: 'width', 319 | type: 'int', 320 | ), 321 | ComponentAttribute( 322 | raw: 'height', 323 | name: 'height', 324 | type: 'int', 325 | ), 326 | ], 327 | ), 328 | ComponentStructure( 329 | name: 'iframe', 330 | attributes: [ 331 | ComponentAttribute( 332 | raw: 'src', 333 | name: 'src', 334 | type: 'string', 335 | ), 336 | ComponentAttribute( 337 | raw: 'allow', 338 | name: 'allow', 339 | type: 'string', 340 | ), 341 | ComponentAttribute( 342 | raw: 'csp', 343 | name: 'csp', 344 | type: 'string', 345 | ), 346 | ComponentAttribute( 347 | raw: 'loading', 348 | name: 'loading', 349 | type: 'MediaLoading', 350 | ), 351 | ComponentAttribute( 352 | raw: 'name', 353 | name: 'name', 354 | type: 'string', 355 | ), 356 | ComponentAttribute( 357 | raw: 'sandbox', 358 | name: 'sandbox', 359 | type: 'string', 360 | ), 361 | ComponentAttribute( 362 | raw: 'referrerpolicy', 363 | name: 'referrerPolicy', 364 | type: 'ReferrerPolicy', 365 | ), 366 | ComponentAttribute( 367 | raw: 'width', 368 | name: 'width', 369 | type: 'int', 370 | ), 371 | ComponentAttribute( 372 | raw: 'height', 373 | name: 'height', 374 | type: 'int', 375 | ), 376 | ], 377 | ), 378 | ComponentStructure( 379 | name: 'object', 380 | attributes: [ 381 | ComponentAttribute( 382 | raw: 'data', 383 | name: 'data', 384 | type: 'string', 385 | ), 386 | ComponentAttribute( 387 | raw: 'name', 388 | name: 'name', 389 | type: 'string', 390 | ), 391 | ComponentAttribute( 392 | raw: 'type', 393 | name: 'type', 394 | type: 'string', 395 | ), 396 | ComponentAttribute( 397 | raw: 'width', 398 | name: 'width', 399 | type: 'int', 400 | ), 401 | ComponentAttribute( 402 | raw: 'height', 403 | name: 'height', 404 | type: 'int', 405 | ), 406 | ], 407 | ), 408 | ComponentStructure( 409 | name: 'source', 410 | selfClosing: true, 411 | attributes: [ 412 | ComponentAttribute( 413 | raw: 'type', 414 | name: 'type', 415 | type: 'string', 416 | ), 417 | ComponentAttribute( 418 | raw: 'src', 419 | name: 'src', 420 | type: 'string', 421 | ), 422 | ], 423 | ), 424 | ComponentStructure( 425 | name: 'button', 426 | attributes: [ 427 | ComponentAttribute( 428 | raw: 'autofocus', 429 | name: 'autofocus', 430 | type: 'boolean', 431 | ), 432 | ComponentAttribute( 433 | raw: 'disabled', 434 | name: 'disabled', 435 | type: 'boolean', 436 | ), 437 | ComponentAttribute( 438 | raw: 'type', 439 | name: 'type', 440 | type: 'ButtonType', 441 | ), 442 | ComponentAttribute( 443 | raw: 'onClick', 444 | name: 'onClick', 445 | type: 'VoidCallback', 446 | ), 447 | ], 448 | ), 449 | ComponentStructure( 450 | name: 'form', 451 | attributes: [ 452 | ComponentAttribute( 453 | raw: 'action', 454 | name: 'action', 455 | type: 'string', 456 | ), 457 | ComponentAttribute( 458 | raw: 'method', 459 | name: 'method', 460 | type: 'FormMethod', 461 | ), 462 | ComponentAttribute( 463 | raw: 'enctype', 464 | name: 'encType', 465 | type: 'FormEncType', 466 | ), 467 | ComponentAttribute( 468 | raw: 'autocomplete', 469 | name: 'autoComplete', 470 | type: 'AutoComplete', 471 | ), 472 | ComponentAttribute( 473 | raw: 'name', 474 | name: 'name', 475 | type: 'string', 476 | ), 477 | ComponentAttribute( 478 | raw: 'novalidate', 479 | name: 'noValidate', 480 | type: 'boolean', 481 | ), 482 | ComponentAttribute( 483 | raw: 'target', 484 | name: 'target', 485 | type: 'Target', 486 | ), 487 | ], 488 | ), 489 | ComponentStructure( 490 | name: 'input', 491 | attributes: [ 492 | ComponentAttribute( 493 | raw: 'type', 494 | name: 'type', 495 | type: 'InputType', 496 | ), 497 | ComponentAttribute( 498 | raw: 'name', 499 | name: 'name', 500 | type: 'string', 501 | ), 502 | ComponentAttribute( 503 | raw: 'value', 504 | name: 'value', 505 | type: 'string', 506 | ), 507 | ComponentAttribute( 508 | raw: 'disabled', 509 | name: 'disabled', 510 | type: 'boolean', 511 | ), 512 | ComponentAttribute( 513 | raw: 'onInput', 514 | name: 'onInput', 515 | type: 'ValueChanged', 516 | ), 517 | ComponentAttribute( 518 | raw: 'onChange', 519 | name: 'onChange', 520 | type: 'ValueChanged', 521 | ), 522 | ], 523 | ), 524 | ComponentStructure( 525 | name: 'label', 526 | attributes: [ 527 | ComponentAttribute( 528 | raw: 'for', 529 | name: 'htmlFor', 530 | type: 'string', 531 | ), 532 | ], 533 | ), 534 | ComponentStructure( 535 | name: 'datalist', 536 | ), 537 | ComponentStructure( 538 | name: 'legend', 539 | ), 540 | ComponentStructure( 541 | name: 'meter', 542 | attributes: [ 543 | ComponentAttribute( 544 | raw: 'value', 545 | name: 'value', 546 | type: 'double', 547 | ), 548 | ComponentAttribute( 549 | raw: 'min', 550 | name: 'min', 551 | type: 'double', 552 | ), 553 | ComponentAttribute( 554 | raw: 'max', 555 | name: 'max', 556 | type: 'double', 557 | ), 558 | ComponentAttribute( 559 | raw: 'low', 560 | name: 'low', 561 | type: 'double', 562 | ), 563 | ComponentAttribute( 564 | raw: 'high', 565 | name: 'high', 566 | type: 'double', 567 | ), 568 | ComponentAttribute( 569 | raw: 'optimum', 570 | name: 'optimum', 571 | type: 'double', 572 | ), 573 | ], 574 | ), 575 | ComponentStructure( 576 | name: 'progress', 577 | attributes: [ 578 | ComponentAttribute( 579 | raw: 'value', 580 | name: 'value', 581 | type: 'double', 582 | ), 583 | ComponentAttribute( 584 | raw: 'max', 585 | name: 'max', 586 | type: 'double', 587 | ), 588 | ], 589 | ), 590 | ComponentStructure( 591 | name: 'optgroup', 592 | attributes: [ 593 | ComponentAttribute( 594 | raw: 'label', 595 | name: 'label', 596 | type: 'string', 597 | ), 598 | ComponentAttribute( 599 | raw: 'disabled', 600 | name: 'disabled', 601 | type: 'boolean', 602 | ), 603 | ], 604 | ), 605 | ComponentStructure( 606 | name: 'option', 607 | attributes: [ 608 | ComponentAttribute( 609 | raw: 'label', 610 | name: 'label', 611 | type: 'string', 612 | ), 613 | ComponentAttribute( 614 | raw: 'value', 615 | name: 'value', 616 | type: 'string', 617 | ), 618 | ComponentAttribute( 619 | raw: 'selected', 620 | name: 'selected', 621 | type: 'boolean', 622 | ), 623 | ComponentAttribute( 624 | raw: 'disabled', 625 | name: 'disabled', 626 | type: 'boolean', 627 | ), 628 | ], 629 | ), 630 | ComponentStructure( 631 | name: 'select', 632 | attributes: [ 633 | ComponentAttribute( 634 | raw: 'name', 635 | name: 'name', 636 | type: 'string', 637 | ), 638 | ComponentAttribute( 639 | raw: 'multiple', 640 | name: 'multiple', 641 | type: 'boolean', 642 | ), 643 | ComponentAttribute( 644 | raw: 'required', 645 | name: 'required', 646 | type: 'boolean', 647 | ), 648 | ComponentAttribute( 649 | raw: 'disabled', 650 | name: 'disabled', 651 | type: 'boolean', 652 | ), 653 | ComponentAttribute( 654 | raw: 'autofocus', 655 | name: 'autofocus', 656 | type: 'boolean', 657 | ), 658 | ComponentAttribute( 659 | raw: 'autocomplete', 660 | name: 'autocomplete', 661 | type: 'string', 662 | ), 663 | ComponentAttribute( 664 | raw: 'size', 665 | name: 'size', 666 | type: 'int', 667 | ), 668 | ComponentAttribute( 669 | raw: 'onInput', 670 | name: 'onInput', 671 | type: 'ValueChanged>', 672 | ), 673 | ComponentAttribute( 674 | raw: 'onChange', 675 | name: 'onChange', 676 | type: 'ValueChanged>', 677 | ), 678 | ], 679 | ), 680 | ComponentStructure( 681 | name: 'fieldset', 682 | attributes: [ 683 | ComponentAttribute( 684 | raw: 'name', 685 | name: 'name', 686 | type: 'string', 687 | ), 688 | ComponentAttribute( 689 | raw: 'disabled', 690 | name: 'disabled', 691 | type: 'boolean', 692 | ), 693 | ], 694 | ), 695 | ComponentStructure( 696 | name: 'textarea', 697 | attributes: [ 698 | ComponentAttribute( 699 | raw: 'autocomplete', 700 | name: 'autoComplete', 701 | type: 'AutoComplete', 702 | ), 703 | ComponentAttribute( 704 | raw: 'autofocus', 705 | name: 'autofocus', 706 | type: 'boolean', 707 | ), 708 | ComponentAttribute( 709 | raw: 'cols', 710 | name: 'cols', 711 | type: 'int', 712 | ), 713 | ComponentAttribute( 714 | raw: 'disabled', 715 | name: 'disabled', 716 | type: 'boolean', 717 | ), 718 | ComponentAttribute( 719 | raw: 'minlength', 720 | name: 'minLength', 721 | type: 'int', 722 | ), 723 | ComponentAttribute( 724 | raw: 'name', 725 | name: 'name', 726 | type: 'string', 727 | ), 728 | ComponentAttribute( 729 | raw: 'placeholder', 730 | name: 'placeholder', 731 | type: 'string', 732 | ), 733 | ComponentAttribute( 734 | raw: 'readonly', 735 | name: 'readonly', 736 | type: 'boolean', 737 | ), 738 | ComponentAttribute( 739 | raw: 'required', 740 | name: 'required', 741 | type: 'boolean', 742 | ), 743 | ComponentAttribute( 744 | raw: 'rows', 745 | name: 'rows', 746 | type: 'int', 747 | ), 748 | ComponentAttribute( 749 | raw: 'spellcheck', 750 | name: 'spellCheck', 751 | type: 'SpellCheck', 752 | ), 753 | ComponentAttribute( 754 | raw: 'wrap', 755 | name: 'wrap', 756 | type: 'TextWrap', 757 | ), 758 | ComponentAttribute( 759 | raw: 'onInput', 760 | name: 'onInput', 761 | type: 'ValueChanged', 762 | ), 763 | ComponentAttribute( 764 | raw: 'onChange', 765 | name: 'onChange', 766 | type: 'ValueChanged', 767 | ), 768 | ], 769 | ), 770 | ComponentStructure( 771 | name: 'details', 772 | attributes: [ 773 | ComponentAttribute( 774 | raw: 'open', 775 | name: 'open', 776 | type: 'boolean', 777 | ), 778 | ], 779 | ), 780 | ComponentStructure( 781 | name: 'dialog', 782 | attributes: [ 783 | ComponentAttribute( 784 | raw: 'open', 785 | name: 'open', 786 | type: 'boolean', 787 | ), 788 | ], 789 | ), 790 | ComponentStructure( 791 | name: 'summary', 792 | ), 793 | ComponentStructure( 794 | name: 'link', 795 | selfClosing: true, 796 | attributes: [ 797 | ComponentAttribute( 798 | raw: 'href', 799 | name: 'href', 800 | type: 'string', 801 | ), 802 | ComponentAttribute( 803 | raw: 'rel', 804 | name: 'rel', 805 | type: 'string', 806 | ), 807 | ComponentAttribute( 808 | raw: 'type', 809 | name: 'type', 810 | type: 'string', 811 | ), 812 | ComponentAttribute( 813 | raw: 'as', 814 | name: 'as', 815 | type: 'string', 816 | ), 817 | ], 818 | ), 819 | ComponentStructure( 820 | name: 'script', 821 | attributes: [ 822 | ComponentAttribute( 823 | raw: 'async', 824 | name: 'async', 825 | type: 'boolean', 826 | ), 827 | ComponentAttribute( 828 | raw: 'defer', 829 | name: 'defer', 830 | type: 'boolean', 831 | ), 832 | ComponentAttribute( 833 | raw: 'src', 834 | name: 'src', 835 | type: 'string', 836 | ), 837 | ], 838 | ), 839 | ComponentStructure( 840 | name: 'svg', 841 | attributes: [ 842 | ComponentAttribute( 843 | raw: 'viewBox', 844 | name: 'viewBox', 845 | type: 'string', 846 | ), 847 | ComponentAttribute( 848 | raw: 'width', 849 | name: 'width', 850 | type: 'Unit', 851 | ), 852 | ComponentAttribute( 853 | raw: 'height', 854 | name: 'height', 855 | type: 'Unit', 856 | ), 857 | ], 858 | ), 859 | ComponentStructure( 860 | name: 'rect', 861 | attributes: [ 862 | ...shapes, 863 | ComponentAttribute( 864 | raw: 'x', 865 | name: 'x', 866 | type: 'string', 867 | ), 868 | ComponentAttribute( 869 | raw: 'y', 870 | name: 'y', 871 | type: 'string', 872 | ), 873 | ComponentAttribute( 874 | raw: 'width', 875 | name: 'width', 876 | type: 'string', 877 | ), 878 | ComponentAttribute( 879 | raw: 'height', 880 | name: 'height', 881 | type: 'string', 882 | ), 883 | ], 884 | ), 885 | ComponentStructure( 886 | name: 'circle', 887 | attributes: [ 888 | ...shapes, 889 | ComponentAttribute( 890 | raw: 'cx', 891 | name: 'cx', 892 | type: 'string', 893 | ), 894 | ComponentAttribute( 895 | raw: 'cy', 896 | name: 'cy', 897 | type: 'string', 898 | ), 899 | ComponentAttribute( 900 | raw: 'r', 901 | name: 'r', 902 | type: 'string', 903 | ), 904 | ], 905 | ), 906 | ComponentStructure( 907 | name: 'ellipse', 908 | attributes: [ 909 | ...shapes, 910 | ComponentAttribute( 911 | raw: 'cx', 912 | name: 'cx', 913 | type: 'string', 914 | ), 915 | ComponentAttribute( 916 | raw: 'cy', 917 | name: 'cy', 918 | type: 'string', 919 | ), 920 | ComponentAttribute( 921 | raw: 'rx', 922 | name: 'rx', 923 | type: 'string', 924 | ), 925 | ComponentAttribute( 926 | raw: 'ry', 927 | name: 'ry', 928 | type: 'string', 929 | ), 930 | ], 931 | ), 932 | ComponentStructure( 933 | name: 'line', 934 | attributes: [ 935 | ...shapes, 936 | ComponentAttribute( 937 | raw: 'x1', 938 | name: 'x1', 939 | type: 'string', 940 | ), 941 | ComponentAttribute( 942 | raw: 'y1', 943 | name: 'y1', 944 | type: 'string', 945 | ), 946 | ComponentAttribute( 947 | raw: 'x2', 948 | name: 'x2', 949 | type: 'string', 950 | ), 951 | ComponentAttribute( 952 | raw: 'y2', 953 | name: 'y2', 954 | type: 'string', 955 | ), 956 | ], 957 | ), 958 | ComponentStructure( 959 | name: 'path', 960 | attributes: [ 961 | ...shapes, 962 | ComponentAttribute( 963 | raw: 'd', 964 | name: 'd', 965 | type: 'string', 966 | ), 967 | ], 968 | ), 969 | ComponentStructure( 970 | name: 'polygon', 971 | attributes: [ 972 | ...shapes, 973 | ComponentAttribute( 974 | raw: 'points', 975 | name: 'points', 976 | type: 'string', 977 | ), 978 | ], 979 | ), 980 | ComponentStructure( 981 | name: 'polyline', 982 | attributes: [ 983 | ...shapes, 984 | ComponentAttribute( 985 | raw: 'points', 986 | name: 'points', 987 | type: 'string', 988 | ), 989 | ], 990 | ), 991 | ]; 992 | --------------------------------------------------------------------------------