diff --git a/apps/vscode-editor/package.json b/apps/vscode-editor/package.json index 5bdc03d8..4d9ab289 100644 --- a/apps/vscode-editor/package.json +++ b/apps/vscode-editor/package.json @@ -43,6 +43,8 @@ "tsconfig": "*", "typescript": "^4.5.2", "vite": "^3.0.0", - "vite-plugin-static-copy": "^0.13.0" + "vite-plugin-static-copy": "^0.13.0", + "vite-plugin-top-level-await": "^1.6.0", + "vite-plugin-wasm": "^3.5.0" } } diff --git a/apps/vscode-editor/src/index.tsx b/apps/vscode-editor/src/index.tsx index 63161751..1625a762 100644 --- a/apps/vscode-editor/src/index.tsx +++ b/apps/vscode-editor/src/index.tsx @@ -53,11 +53,11 @@ async function runEditor() { const root = createRoot(document.getElementById('root')!); setEditorTheme(editorThemeFromStore(store)); root.render(); + + } catch (error) { - console.error(error); + console.error('error',error); } } runEditor(); - - diff --git a/apps/vscode-editor/src/wasm-qmd-parser-old/README.md b/apps/vscode-editor/src/wasm-qmd-parser-old/README.md new file mode 100644 index 00000000..6b684085 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser-old/README.md @@ -0,0 +1,84 @@ +
+ +

wasm-pack-template

+ + A template for kick starting a Rust and WebAssembly project using wasm-pack. + +

+ Build Status +

+ +

+ Tutorial + | + Chat +

+ + Built with 🦀🕸 by The Rust and WebAssembly Working Group +
+ +## About + +[**📚 Read this template tutorial! 📚**][template-docs] + +This template is designed for compiling Rust libraries into WebAssembly and +publishing the resulting package to NPM. + +Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other +templates and usages of `wasm-pack`. + +[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html +[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html + +## 🚴 Usage + +### 🐑 Use `cargo generate` to Clone this Template + +[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate) + +``` +cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project +cd my-project +``` + +### 🛠️ Build with `wasm-pack build` + +``` +wasm-pack build +``` + +### 🔬 Test in Headless Browsers with `wasm-pack test` + +``` +wasm-pack test --headless --firefox +``` + +### 🎁 Publish to NPM with `wasm-pack publish` + +``` +wasm-pack publish +``` + +## 🔋 Batteries Included + +* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating + between WebAssembly and JavaScript. +* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook) + for logging panic messages to the developer console. +* `LICENSE-APACHE` and `LICENSE-MIT`: most Rust projects are licensed this way, so these are included for you + +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally +submitted for inclusion in the work by you, as defined in the Apache-2.0 +license, shall be dual licensed as above, without any additional terms or +conditions. diff --git a/apps/vscode-editor/src/wasm-qmd-parser-old/index.html b/apps/vscode-editor/src/wasm-qmd-parser-old/index.html new file mode 100644 index 00000000..35e04b16 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser-old/index.html @@ -0,0 +1,15 @@ + + + + wasm-qmd-parser + + + + + + \ No newline at end of file diff --git a/apps/vscode-editor/src/wasm-qmd-parser-old/package.json b/apps/vscode-editor/src/wasm-qmd-parser-old/package.json new file mode 100644 index 00000000..0e9979e2 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser-old/package.json @@ -0,0 +1,18 @@ +{ + "name": "wasm-qmd-parser", + "type": "module", + "collaborators": [ + "Carlos Scheidegger " + ], + "version": "0.1.0", + "files": [ + "wasm_qmd_parser_bg.wasm", + "wasm_qmd_parser.js", + "wasm_qmd_parser.d.ts" + ], + "main": "wasm_qmd_parser.js", + "types": "wasm_qmd_parser.d.ts", + "sideEffects": [ + "./snippets/*" + ] +} \ No newline at end of file diff --git a/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser.d.ts b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser.d.ts new file mode 100644 index 00000000..1f28fd1c --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser.d.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +export function run(): void; +export function parse_qmd(input: any): any; +export function greet(): void; + +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +export interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly parse_qmd: (a: any) => any; + readonly run: () => void; + readonly greet: () => void; + readonly abort: () => void; + readonly calloc: (a: number, b: number) => number; + readonly clock: () => bigint; + readonly fclose: (a: number) => number; + readonly fdopen: (a: number, b: number) => number; + readonly fprintf: (a: number, b: number, c: number) => number; + readonly fputc: (a: number, b: number) => number; + readonly fputs: (a: number, b: number) => number; + readonly free: (a: number) => void; + readonly fwrite: (a: number, b: number, c: number, d: number) => number; + readonly isprint: (a: number) => number; + readonly iswalnum: (a: number) => number; + readonly iswalpha: (a: number) => number; + readonly iswdigit: (a: number) => number; + readonly iswspace: (a: number) => number; + readonly malloc: (a: number) => number; + readonly memcmp: (a: number, b: number, c: number) => number; + readonly memcpy: (a: number, b: number, c: number) => number; + readonly memmove: (a: number, b: number, c: number) => number; + readonly memset: (a: number, b: number, c: number) => number; + readonly realloc: (a: number, b: number) => number; + readonly strncmp: (a: number, b: number, c: number) => number; + readonly towlower: (a: number) => number; + readonly vsnprintf: (a: number, b: number, c: number, d: number) => number; + readonly __wbindgen_free: (a: number, b: number, c: number) => void; + readonly __wbindgen_malloc: (a: number, b: number) => number; + readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; + readonly __wbindgen_export_3: WebAssembly.Table; + readonly __wbindgen_start: () => void; +} + +export type SyncInitInput = BufferSource | WebAssembly.Module; +/** +* Instantiates the given `module`, which can either be bytes or +* a precompiled `WebAssembly.Module`. +* +* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. +* +* @returns {InitOutput} +*/ +export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. +* +* @returns {Promise} +*/ +export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise; diff --git a/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser.js b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser.js new file mode 100644 index 00000000..3b4f7464 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser.js @@ -0,0 +1,287 @@ +let wasm; + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function logError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + let error = (function () { + try { + return e instanceof Error ? `${e.message}\n\nStack:\n${e.stack}` : e.toString(); + } catch(_) { + return ""; + } + }()); + console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error); + throw e; + } +} + +let WASM_VECTOR_LEN = 0; + +const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (typeof(arg) !== 'string') throw new Error(`expected a string argument, found ${typeof(arg)}`); + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + if (ret.read !== arg.length) throw new Error('failed to pass whole string'); + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +export function run() { + wasm.run(); +} + +/** + * @param {any} input + * @returns {any} + */ +export function parse_qmd(input) { + const ret = wasm.parse_qmd(input); + return ret; +} + +export function greet() { + wasm.greet(); +} + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + // if (typeof WebAssembly.instantiateStreaming === 'function') { + // try { + // console.log('bbb', module,imports) + // return await WebAssembly.instantiateStreaming(module, imports); + + // } catch (e) { + // if (module.headers.get('Content-Type') != 'application/wasm') { + // console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + // } else { + // throw e; + // } + // } + // } + + const bytes = await module.arrayBuffer(); + console.log('bytes', bytes) + return await WebAssembly.instantiate(bytes, imports); + + } else { + console.log('hi', module, imports) + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_alert_34f1fdd515379713 = function() { return logError(function (arg0, arg1) { + alert(getStringFromWasm0(arg0, arg1)); + }, arguments) }; + imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function() { return logError(function (arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }, arguments) }; + imports.wbg.__wbg_new_8a6f238a6ece86ea = function() { return logError(function () { + const ret = new Error(); + return ret; + }, arguments) }; + imports.wbg.__wbg_stack_0ed75d68575b0f3c = function() { return logError(function (arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments) }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_export_3; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + + return imports; +} + +function __wbg_init_memory(imports, memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('wasm_qmd_parser_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + __wbg_init_memory(imports); + + const a = await module_or_path + console.log('aaaa',a) + const { instance, module } = await __wbg_load(a, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser_bg.wasm b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser_bg.wasm new file mode 100644 index 00000000..c7e659c4 Binary files /dev/null and b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser_bg.wasm differ diff --git a/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser_bg.wasm.d.ts b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser_bg.wasm.d.ts new file mode 100644 index 00000000..1f90979c --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser-old/wasm_qmd_parser_bg.wasm.d.ts @@ -0,0 +1,35 @@ +/* tslint:disable */ +/* eslint-disable */ +export const memory: WebAssembly.Memory; +export const parse_qmd: (a: any) => any; +export const run: () => void; +export const greet: () => void; +export const abort: () => void; +export const calloc: (a: number, b: number) => number; +export const clock: () => bigint; +export const fclose: (a: number) => number; +export const fdopen: (a: number, b: number) => number; +export const fprintf: (a: number, b: number, c: number) => number; +export const fputc: (a: number, b: number) => number; +export const fputs: (a: number, b: number) => number; +export const free: (a: number) => void; +export const fwrite: (a: number, b: number, c: number, d: number) => number; +export const isprint: (a: number) => number; +export const iswalnum: (a: number) => number; +export const iswalpha: (a: number) => number; +export const iswdigit: (a: number) => number; +export const iswspace: (a: number) => number; +export const malloc: (a: number) => number; +export const memcmp: (a: number, b: number, c: number) => number; +export const memcpy: (a: number, b: number, c: number) => number; +export const memmove: (a: number, b: number, c: number) => number; +export const memset: (a: number, b: number, c: number) => number; +export const realloc: (a: number, b: number) => number; +export const strncmp: (a: number, b: number, c: number) => number; +export const towlower: (a: number) => number; +export const vsnprintf: (a: number, b: number, c: number, d: number) => number; +export const __wbindgen_free: (a: number, b: number, c: number) => void; +export const __wbindgen_malloc: (a: number, b: number) => number; +export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; +export const __wbindgen_export_3: WebAssembly.Table; +export const __wbindgen_start: () => void; diff --git a/apps/vscode-editor/src/wasm-qmd-parser/README.md b/apps/vscode-editor/src/wasm-qmd-parser/README.md new file mode 100644 index 00000000..6b684085 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser/README.md @@ -0,0 +1,84 @@ +
+ +

wasm-pack-template

+ + A template for kick starting a Rust and WebAssembly project using wasm-pack. + +

+ Build Status +

+ +

+ Tutorial + | + Chat +

+ + Built with 🦀🕸 by The Rust and WebAssembly Working Group +
+ +## About + +[**📚 Read this template tutorial! 📚**][template-docs] + +This template is designed for compiling Rust libraries into WebAssembly and +publishing the resulting package to NPM. + +Be sure to check out [other `wasm-pack` tutorials online][tutorials] for other +templates and usages of `wasm-pack`. + +[tutorials]: https://rustwasm.github.io/docs/wasm-pack/tutorials/index.html +[template-docs]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/index.html + +## 🚴 Usage + +### 🐑 Use `cargo generate` to Clone this Template + +[Learn more about `cargo generate` here.](https://github.com/ashleygwilliams/cargo-generate) + +``` +cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project +cd my-project +``` + +### 🛠️ Build with `wasm-pack build` + +``` +wasm-pack build +``` + +### 🔬 Test in Headless Browsers with `wasm-pack test` + +``` +wasm-pack test --headless --firefox +``` + +### 🎁 Publish to NPM with `wasm-pack publish` + +``` +wasm-pack publish +``` + +## 🔋 Batteries Included + +* [`wasm-bindgen`](https://github.com/rustwasm/wasm-bindgen) for communicating + between WebAssembly and JavaScript. +* [`console_error_panic_hook`](https://github.com/rustwasm/console_error_panic_hook) + for logging panic messages to the developer console. +* `LICENSE-APACHE` and `LICENSE-MIT`: most Rust projects are licensed this way, so these are included for you + +## License + +Licensed under either of + +* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) +* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally +submitted for inclusion in the work by you, as defined in the Apache-2.0 +license, shall be dual licensed as above, without any additional terms or +conditions. diff --git a/apps/vscode-editor/src/wasm-qmd-parser/index.html b/apps/vscode-editor/src/wasm-qmd-parser/index.html new file mode 100644 index 00000000..58070d9c --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser/index.html @@ -0,0 +1,16 @@ + + + + wasm-qmd-parser + + + + + + \ No newline at end of file diff --git a/apps/vscode-editor/src/wasm-qmd-parser/package.json b/apps/vscode-editor/src/wasm-qmd-parser/package.json new file mode 100644 index 00000000..0e9979e2 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser/package.json @@ -0,0 +1,18 @@ +{ + "name": "wasm-qmd-parser", + "type": "module", + "collaborators": [ + "Carlos Scheidegger " + ], + "version": "0.1.0", + "files": [ + "wasm_qmd_parser_bg.wasm", + "wasm_qmd_parser.js", + "wasm_qmd_parser.d.ts" + ], + "main": "wasm_qmd_parser.js", + "types": "wasm_qmd_parser.d.ts", + "sideEffects": [ + "./snippets/*" + ] +} \ No newline at end of file diff --git a/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser.d.ts b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser.d.ts new file mode 100644 index 00000000..de760141 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser.d.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +export function run(): void; +export function parse_qmd(input: any, include_resolved_locations: any): any; +export function write_qmd(input: any): any; +export function convert(document: any, input_format: any, output_format: any): any; +/** + * Render a QMD document with a template bundle. + * + * # Arguments + * * `input` - QMD source text + * * `bundle_json` - Template bundle as JSON string + * * `body_format` - "html" or "plaintext" + * + * # Returns + * JSON object with `{ "output": "..." }` or `{ "error": "...", "diagnostics": [...] }` + */ +export function render_with_template(input: any, bundle_json: any, body_format: any): any; +/** + * Get a built-in template as a JSON bundle. + * + * # Arguments + * * `name` - Template name ("html5" or "plain") + * + * # Returns + * Template bundle JSON or `{ "error": "..." }` + */ +export function get_builtin_template(name: any): any; + +export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; + +export interface InitOutput { + readonly memory: WebAssembly.Memory; + readonly abort: () => void; + readonly calloc: (a: number, b: number) => number; + readonly clock: () => bigint; + readonly fclose: (a: number) => number; + readonly fdopen: (a: number, b: number) => number; + readonly fprintf: (a: number, b: number, c: number) => number; + readonly fputc: (a: number, b: number) => number; + readonly fputs: (a: number, b: number) => number; + readonly free: (a: number) => void; + readonly fwrite: (a: number, b: number, c: number, d: number) => number; + readonly isprint: (a: number) => number; + readonly iswalnum: (a: number) => number; + readonly iswalpha: (a: number) => number; + readonly iswdigit: (a: number) => number; + readonly iswspace: (a: number) => number; + readonly malloc: (a: number) => number; + readonly memcmp: (a: number, b: number, c: number) => number; + readonly memcpy: (a: number, b: number, c: number) => number; + readonly memmove: (a: number, b: number, c: number) => number; + readonly memset: (a: number, b: number, c: number) => number; + readonly realloc: (a: number, b: number) => number; + readonly strncmp: (a: number, b: number, c: number) => number; + readonly towlower: (a: number) => number; + readonly vsnprintf: (a: number, b: number, c: number, d: number) => number; + readonly convert: (a: any, b: any, c: any) => any; + readonly get_builtin_template: (a: any) => any; + readonly parse_qmd: (a: any, b: any) => any; + readonly render_with_template: (a: any, b: any, c: any) => any; + readonly write_qmd: (a: any) => any; + readonly run: () => void; + readonly __wbindgen_malloc: (a: number, b: number) => number; + readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; + readonly __wbindgen_free: (a: number, b: number, c: number) => void; + readonly __wbindgen_externrefs: WebAssembly.Table; + readonly __wbindgen_start: () => void; +} + +export type SyncInitInput = BufferSource | WebAssembly.Module; +/** +* Instantiates the given `module`, which can either be bytes or +* a precompiled `WebAssembly.Module`. +* +* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. +* +* @returns {InitOutput} +*/ +export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; + +/** +* If `module_or_path` is {RequestInfo} or {URL}, makes a request and +* for everything else, calls `WebAssembly.instantiate` directly. +* +* @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. +* +* @returns {Promise} +*/ +export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise; diff --git a/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser.js b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser.js new file mode 100644 index 00000000..a6e78714 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser.js @@ -0,0 +1,318 @@ +let wasm; + +let WASM_VECTOR_LEN = 0; + +let cachedUint8ArrayMemory0 = null; + +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} + +const cachedTextEncoder = new TextEncoder(); + +if (!('encodeInto' in cachedTextEncoder)) { + cachedTextEncoder.encodeInto = function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; + } +} + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8ArrayMemory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = cachedTextEncoder.encodeInto(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +let cachedDataViewMemory0 = null; + +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} + +let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +const MAX_SAFARI_DECODE_BYTES = 2146435072; +let numBytesDecoded = 0; +function decodeText(ptr, len) { + numBytesDecoded += len; + if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) { + cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + cachedTextDecoder.decode(); + numBytesDecoded = len; + } + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return decodeText(ptr, len); +} + +export function run() { + wasm.run(); +} + +/** + * @param {any} input + * @param {any} include_resolved_locations + * @returns {any} + */ +export function parse_qmd(input, include_resolved_locations) { + const ret = wasm.parse_qmd(input, include_resolved_locations); + return ret; +} + +/** + * @param {any} input + * @returns {any} + */ +export function write_qmd(input) { + const ret = wasm.write_qmd(input); + return ret; +} + +/** + * @param {any} document + * @param {any} input_format + * @param {any} output_format + * @returns {any} + */ +export function convert(document, input_format, output_format) { + const ret = wasm.convert(document, input_format, output_format); + return ret; +} + +/** + * Render a QMD document with a template bundle. + * + * # Arguments + * * `input` - QMD source text + * * `bundle_json` - Template bundle as JSON string + * * `body_format` - "html" or "plaintext" + * + * # Returns + * JSON object with `{ "output": "..." }` or `{ "error": "...", "diagnostics": [...] }` + * @param {any} input + * @param {any} bundle_json + * @param {any} body_format + * @returns {any} + */ +export function render_with_template(input, bundle_json, body_format) { + const ret = wasm.render_with_template(input, bundle_json, body_format); + return ret; +} + +/** + * Get a built-in template as a JSON bundle. + * + * # Arguments + * * `name` - Template name ("html5" or "plain") + * + * # Returns + * Template bundle JSON or `{ "error": "..." }` + * @param {any} name + * @returns {any} + */ +export function get_builtin_template(name) { + const ret = wasm.get_builtin_template(name); + return ret; +} + +const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']); + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type); + + if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) { + const obj = arg1; + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(deferred0_0, deferred0_1, 1); + } + }; + imports.wbg.__wbg_new_8a6f238a6ece86ea = function() { + const ret = new Error(); + return ret; + }; + imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) { + const ret = arg1.stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) { + // Cast intrinsic for `Ref(String) -> Externref`. + const ret = getStringFromWasm0(arg0, arg1); + return ret; + }; + imports.wbg.__wbindgen_init_externref_table = function() { + const table = wasm.__wbindgen_externrefs; + const offset = table.grow(4); + table.set(0, undefined); + table.set(offset + 0, undefined); + table.set(offset + 1, null); + table.set(offset + 2, true); + table.set(offset + 3, false); + ; + }; + + return imports; +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedUint8ArrayMemory0 = null; + + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + + if (typeof module !== 'undefined') { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({module} = module) + } else { + console.warn('using deprecated parameters for `initSync()`; pass a single object instead') + } + } + + const imports = __wbg_get_imports(); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(module_or_path) { + if (wasm !== undefined) return wasm; + + + if (typeof module_or_path !== 'undefined') { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({module_or_path} = module_or_path) + } else { + console.warn('using deprecated parameters for the initialization function; pass a single object instead') + } + } + + if (typeof module_or_path === 'undefined') { + module_or_path = new URL('wasm_qmd_parser_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) { + module_or_path = fetch(module_or_path); + } + + const { instance, module } = await __wbg_load(await module_or_path, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync }; +export default __wbg_init; diff --git a/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser_bg.wasm b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser_bg.wasm new file mode 100644 index 00000000..fb0a4142 Binary files /dev/null and b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser_bg.wasm differ diff --git a/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser_bg.wasm.d.ts b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser_bg.wasm.d.ts new file mode 100644 index 00000000..fca809b3 --- /dev/null +++ b/apps/vscode-editor/src/wasm-qmd-parser/wasm_qmd_parser_bg.wasm.d.ts @@ -0,0 +1,38 @@ +/* tslint:disable */ +/* eslint-disable */ +export const memory: WebAssembly.Memory; +export const abort: () => void; +export const calloc: (a: number, b: number) => number; +export const clock: () => bigint; +export const fclose: (a: number) => number; +export const fdopen: (a: number, b: number) => number; +export const fprintf: (a: number, b: number, c: number) => number; +export const fputc: (a: number, b: number) => number; +export const fputs: (a: number, b: number) => number; +export const free: (a: number) => void; +export const fwrite: (a: number, b: number, c: number, d: number) => number; +export const isprint: (a: number) => number; +export const iswalnum: (a: number) => number; +export const iswalpha: (a: number) => number; +export const iswdigit: (a: number) => number; +export const iswspace: (a: number) => number; +export const malloc: (a: number) => number; +export const memcmp: (a: number, b: number, c: number) => number; +export const memcpy: (a: number, b: number, c: number) => number; +export const memmove: (a: number, b: number, c: number) => number; +export const memset: (a: number, b: number, c: number) => number; +export const realloc: (a: number, b: number) => number; +export const strncmp: (a: number, b: number, c: number) => number; +export const towlower: (a: number) => number; +export const vsnprintf: (a: number, b: number, c: number, d: number) => number; +export const convert: (a: any, b: any, c: any) => any; +export const get_builtin_template: (a: any) => any; +export const parse_qmd: (a: any, b: any) => any; +export const render_with_template: (a: any, b: any, c: any) => any; +export const write_qmd: (a: any) => any; +export const run: () => void; +export const __wbindgen_malloc: (a: number, b: number) => number; +export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; +export const __wbindgen_free: (a: number, b: number, c: number) => void; +export const __wbindgen_externrefs: WebAssembly.Table; +export const __wbindgen_start: () => void; diff --git a/apps/vscode-editor/vite.config.ts b/apps/vscode-editor/vite.config.ts index 31f63392..3b7a468b 100644 --- a/apps/vscode-editor/vite.config.ts +++ b/apps/vscode-editor/vite.config.ts @@ -1,10 +1,12 @@ import path from 'path' import { defineConfig, normalizePath } from 'vite' import { viteStaticCopy } from 'vite-plugin-static-copy' +import wasm from "vite-plugin-wasm"; +import topLevelAwait from "vite-plugin-top-level-await"; export default defineConfig(env => { - + const dev = env.mode === "development"; return { @@ -22,7 +24,9 @@ export default defineConfig(env => { dest: normalizePath(path.resolve(__dirname, '../vscode/assets/www/editor')) } ] - }) + }), + wasm(), + topLevelAwait() ], build: { watch: dev ? {} : null, @@ -30,7 +34,7 @@ export default defineConfig(env => { entry: 'src/index.tsx', formats: ['umd'], name: "QuartoVisualEditor", - fileName: () => 'index.js' + fileName: () => 'index.js' }, rollupOptions: { external: ['vscode-webview'], @@ -38,5 +42,5 @@ export default defineConfig(env => { sourcemap: dev ? 'inline' : false } }; - + }); diff --git a/apps/vscode/src/providers/editor/editor.ts b/apps/vscode/src/providers/editor/editor.ts index 80723103..9b1f8055 100644 --- a/apps/vscode/src/providers/editor/editor.ts +++ b/apps/vscode/src/providers/editor/editor.ts @@ -617,7 +617,13 @@ export class VisualEditorProvider implements CustomTextEditorProvider { - + diff --git a/packages/editor/src/pandoc/pandoc_converter.ts b/packages/editor/src/pandoc/pandoc_converter.ts index 6f104cb0..b5af5697 100644 --- a/packages/editor/src/pandoc/pandoc_converter.ts +++ b/packages/editor/src/pandoc/pandoc_converter.ts @@ -44,6 +44,7 @@ import { pandocFromProsemirror } from './pandoc_from_prosemirror'; import { isParagraphNode } from '../api/paragraph'; import { PandocFormat, PandocWriterOptions } from '../api/pandoc-types'; import { escapeRegExpCharacters, lines, normalizeNewlines } from 'core'; +import main from "../../../../apps/vscode-editor/src/wasm-qmd-parser"; export type PandocLineWrapping = 'none' | 'column' | 'sentence'; @@ -52,7 +53,7 @@ export interface PandocToProsemirrorResult { line_wrapping: PandocLineWrapping; unrecognized: string[]; example_lists: boolean; - unparsed_meta: { [key: string]: unknown }; + unparsed_meta: { [key: string]: unknown; }; } export class PandocConverter { @@ -69,6 +70,7 @@ export class PandocConverter { private readonly markdownPostProcessors: readonly PandocMarkdownPostProcessorFn[]; private readonly pandoc: PandocServer; private readonly pandocCapabilities: PandocCapabilities; + private m: any; constructor( schema: Schema, @@ -91,6 +93,9 @@ export class PandocConverter { this.pandoc = pandoc; this.pandocCapabilities = pandocCapabilities; + + const me = this; + main().then(result => { me.m = result; }); } public async toProsemirror(markdown: string, format: PandocFormat): Promise { @@ -104,20 +109,20 @@ export class PandocConverter { // that's how preprocessors hoist content through pandoc into our prosemirror token parser. // we always need to read with auto_identifiers so we can catch any auto-generated ids // required to fulfill links inside the document (we will strip out heading ids that - // aren't explicit or a link target using the heading_ids returned with the ast). + // aren't explicit or a link target using the heading_ids returned with the ast). // // we always read all forms of tables (since they can always be written back out as raw_html) // // we also always read math (since it can always be output as 'asciimath') - + // determine type of auto_ids const autoIds = format.extensions.gfm_auto_identifiers ? 'gfm_auto_identifiers' : 'auto_identifiers'; const targetFormat = adjustedFormat( format.fullName, - ['raw_html', 'raw_attribute', 'backtick_code_blocks', autoIds, - 'grid_tables', 'pipe_tables', 'multiline_tables', 'simple_tables', - 'tex_math_dollars'], - ['smart'], + ['raw_html', 'raw_attribute', 'backtick_code_blocks', autoIds, + 'grid_tables', 'pipe_tables', 'multiline_tables', 'simple_tables', + 'tex_math_dollars'], + ['smart'], ); // run preprocessors @@ -131,8 +136,15 @@ export class PandocConverter { }); const ast = await this.pandoc.markdownToAst(markdown, targetFormat, []); + + const wasmProducedASTString = this.m?.parse_qmd(markdown, "true"); + const wasmProducedAST = JSON.parse(wasmProducedASTString); + + console.log(JSON.stringify(ast)); + console.log(JSON.stringify(wasmProducedAST)); + const result = pandocToProsemirror( - ast, + wasmProducedAST, this.schema, format.extensions, this.readers, @@ -274,8 +286,8 @@ function disabledFormatOptions(format: string, pandocFormat: PandocFormat, doc: // if there are tables with inline R code then disable grid tables (as the inline // R code will mess up the column boundaries) - if (haveTableCellsWithInlineRcode(doc) || - (!gridTablesRequired(doc) && pandocFormat.extensions.pipe_tables)) { + if (haveTableCellsWithInlineRcode(doc) || + (!gridTablesRequired(doc) && pandocFormat.extensions.pipe_tables)) { disabledTableTypes += '-grid_tables'; } @@ -309,7 +321,7 @@ function gridTablesRequired(doc: ProsemirrorNode) { // paragraph with hard break const paraNode = cell.node.firstChild!; return findChildren(paraNode, node => node.type === schema.nodes.hard_break).length > 0; - }); + }); } function wrapOptions(options: PandocWriterOptions) { diff --git a/yarn.lock b/yarn.lock index d979aeb1..2b681a4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2182,51 +2182,101 @@ resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.12.11.tgz" integrity sha512-J19Jj9Y5x/N0loExH7W0OI9OwwoVyxutDdkyq1o/kgXyBqmmzV7Y/Q9QekI2Fm/qc5mNeAdP7aj4boY4AY/JPw== +"@swc/core-darwin-arm64@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.13.5.tgz#7638c073946f9297753ed9a2eb198d07b2336a24" + integrity sha512-lKNv7SujeXvKn16gvQqUQI5DdyY8v7xcoO3k06/FJbHJS90zEwZdQiMNRiqpYw/orU543tPaWgz7cIYWhbopiQ== + "@swc/core-darwin-x64@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.12.11.tgz#3d9ed5f7038cd22cfc46997777f82c51056fe110" integrity sha512-PTuUQrfStQ6cjW+uprGO2lpQHy84/l0v+GqRqq8s/jdK55rFRjMfCeyf6FAR0l6saO5oNOQl+zWR1aNpj8pMQw== +"@swc/core-darwin-x64@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.13.5.tgz#18061167378f0fb285e17818494bc6c89dd07551" + integrity sha512-ILd38Fg/w23vHb0yVjlWvQBoE37ZJTdlLHa8LRCFDdX4WKfnVBiblsCU9ar4QTMNdeTBEX9iUF4IrbNWhaF1Ng== + "@swc/core-linux-arm-gnueabihf@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.12.11.tgz#8d97b9b55ed286af233aef702208ed3b99db0364" integrity sha512-poxBq152HsupOtnZilenvHmxZ9a8SRj4LtfxUnkMDNOGrZR9oxbQNwEzNKfi3RXEcXz+P8c0Rai1ubBazXv8oQ== +"@swc/core-linux-arm-gnueabihf@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.13.5.tgz#4c8062bd598049b5b9b0beb762e075e76b4c23c3" + integrity sha512-Q6eS3Pt8GLkXxqz9TAw+AUk9HpVJt8Uzm54MvPsqp2yuGmY0/sNaPPNVqctCX9fu/Nu8eaWUen0si6iEiCsazQ== + "@swc/core-linux-arm64-gnu@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.12.11.tgz#e2eb74af3b863be2464bf343ed0f56652f3df6b2" integrity sha512-y1HNamR/D0Hc8xIE910ysyLe269UYiGaQPoLjQS0phzWFfWdMj9bHM++oydVXZ4RSWycO7KyJ3uvw4NilvyMKQ== +"@swc/core-linux-arm64-gnu@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.13.5.tgz#7222d321197ea9304e387933e87d775849fc1ae6" + integrity sha512-aNDfeN+9af+y+M2MYfxCzCy/VDq7Z5YIbMqRI739o8Ganz6ST+27kjQFd8Y/57JN/hcnUEa9xqdS3XY7WaVtSw== + "@swc/core-linux-arm64-musl@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.12.11.tgz#fc5093d83eba3958cd6ff6d03fb6069f0fe33456" integrity sha512-LlBxPh/32pyQsu2emMEOFRm7poEFLsw12Y1mPY7FWZiZeptomKSOSHRzKDz9EolMiV4qhK1caP1lvW4vminYgQ== +"@swc/core-linux-arm64-musl@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.13.5.tgz#51e7958deaf37edc212bd9dc0ea1476f151d2bea" + integrity sha512-9+ZxFN5GJag4CnYnq6apKTnnezpfJhCumyz0504/JbHLo+Ue+ZtJnf3RhyA9W9TINtLE0bC4hKpWi8ZKoETyOQ== + "@swc/core-linux-x64-gnu@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.12.11.tgz#cff28bb15fd8ad85c9e85333aaa1b348cbdc2d4d" integrity sha512-bOjiZB8O/1AzHkzjge1jqX62HGRIpOHqFUrGPfAln/NC6NR+Z2A78u3ixV7k5KesWZFhCV0YVGJL+qToL27myA== +"@swc/core-linux-x64-gnu@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.13.5.tgz#3476beab93ab03e92844d955ca9d9289aa4a5993" + integrity sha512-WD530qvHrki8Ywt/PloKUjaRKgstQqNGvmZl54g06kA+hqtSE2FTG9gngXr3UJxYu/cNAjJYiBifm7+w4nbHbA== + "@swc/core-linux-x64-musl@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.12.11.tgz#10bb975d77ab88caff665e508df0978be7f1915b" integrity sha512-4dzAtbT/m3/UjF045+33gLiHd8aSXJDoqof7gTtu4q0ZyAf7XJ3HHspz+/AvOJLVo4FHHdFcdXhmo/zi1nFn8A== +"@swc/core-linux-x64-musl@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.13.5.tgz#f4934b1e77e2a297909bb3ab977836205c36e5e0" + integrity sha512-Luj8y4OFYx4DHNQTWjdIuKTq2f5k6uSXICqx+FSabnXptaOBAbJHNbHT/06JZh6NRUouaf0mYXN0mcsqvkhd7Q== + "@swc/core-win32-arm64-msvc@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.12.11.tgz#66bdf65a5ba851da78bd430852414c9f72d1a5d6" integrity sha512-h8HiwBZErKvCAmjW92JvQp0iOqm6bncU4ac5jxBGkRApabpUenNJcj3h2g5O6GL5K6T9/WhnXE5gyq/s1fhPQg== +"@swc/core-win32-arm64-msvc@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.13.5.tgz#5084c107435cfc82d4d901bfb388dc319d38a236" + integrity sha512-cZ6UpumhF9SDJvv4DA2fo9WIzlNFuKSkZpZmPG1c+4PFSEMy5DFOjBSllCvnqihCabzXzpn6ykCwBmHpy31vQw== + "@swc/core-win32-ia32-msvc@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.12.11.tgz#b551f23eea19a14da9ade021b29c4b16ae08f8b1" integrity sha512-1pwr325mXRNUhxTtXmx1IokV5SiRL+6iDvnt3FRXj+X5UvXXKtg2zeyftk+03u8v8v8WUr5I32hIypVJPTNxNg== +"@swc/core-win32-ia32-msvc@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.13.5.tgz#f8b2e28bc51b30467e316ed736a130c1324b9880" + integrity sha512-C5Yi/xIikrFUzZcyGj9L3RpKljFvKiDMtyDzPKzlsDrKIw2EYY+bF88gB6oGY5RGmv4DAX8dbnpRAqgFD0FMEw== + "@swc/core-win32-x64-msvc@1.12.11": version "1.12.11" resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.12.11.tgz#a88f84c40c98c1dd252e8fd2ae5004e1336c2f5b" integrity sha512-5gggWo690Gvs7XiPxAmb5tHwzB9RTVXUV7AWoGb6bmyUd1OXYaebQF0HAOtade5jIoNhfQMQJ7QReRgt/d2jAA== +"@swc/core-win32-x64-msvc@1.13.5": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.13.5.tgz#13883cf3c63bf11b787e28dcdf75ca0cc49efa83" + integrity sha512-YrKdMVxbYmlfybCSbRtrilc6UA8GF5aPmGKBdPvjrarvsmf4i7ZHGCEnLtfOMd3Lwbs2WUZq3WdMbozYeLU93Q== + "@swc/core@^1.10.16": version "1.12.11" resolved "https://registry.npmjs.org/@swc/core/-/core-1.12.11.tgz" @@ -2246,6 +2296,25 @@ "@swc/core-win32-ia32-msvc" "1.12.11" "@swc/core-win32-x64-msvc" "1.12.11" +"@swc/core@^1.12.14": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.13.5.tgz#93874b831d3bd121560e6fcd688972b7fc7baa26" + integrity sha512-WezcBo8a0Dg2rnR82zhwoR6aRNxeTGfK5QCD6TQ+kg3xx/zNT02s/0o+81h/3zhvFSB24NtqEr8FTw88O5W/JQ== + dependencies: + "@swc/counter" "^0.1.3" + "@swc/types" "^0.1.24" + optionalDependencies: + "@swc/core-darwin-arm64" "1.13.5" + "@swc/core-darwin-x64" "1.13.5" + "@swc/core-linux-arm-gnueabihf" "1.13.5" + "@swc/core-linux-arm64-gnu" "1.13.5" + "@swc/core-linux-arm64-musl" "1.13.5" + "@swc/core-linux-x64-gnu" "1.13.5" + "@swc/core-linux-x64-musl" "1.13.5" + "@swc/core-win32-arm64-msvc" "1.13.5" + "@swc/core-win32-ia32-msvc" "1.13.5" + "@swc/core-win32-x64-msvc" "1.13.5" + "@swc/counter@^0.1.3": version "0.1.3" resolved "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz" @@ -2265,6 +2334,18 @@ dependencies: "@swc/counter" "^0.1.3" +"@swc/types@^0.1.24": + version "0.1.24" + resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.24.tgz#00f4343e2c966eac178cde89e8d821a784f7586d" + integrity sha512-tjTMh3V4vAORHtdTprLlfoMptu1WfTZG9Rsca6yOKyNYsRr+MUXutKmliB17orgSZk5DpnDxs8GUdd/qwYxOng== + dependencies: + "@swc/counter" "^0.1.3" + +"@swc/wasm@^1.12.14": + version "1.13.5" + resolved "https://registry.yarnpkg.com/@swc/wasm/-/wasm-1.13.5.tgz#dd087eba276898a099283d72071cef23ebb52d98" + integrity sha512-ZBZcxieydxNwgEU9eFAXGMaDb1Xoh+ZkZcUQ27LNJzc2lPSByoL6CSVqnYiaVo+n9JgqbYyHlMq+i7z0wRNTfA== + "@textlint/ast-node-types@^4.4.2": version "4.4.3" resolved "https://registry.npmjs.org/@textlint/ast-node-types/-/ast-node-types-4.4.3.tgz" @@ -9602,7 +9683,7 @@ utils-merge@1.0.1: resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== -uuid@^10.0.0: +uuid@10.0.0, uuid@^10.0.0: version "10.0.0" resolved "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz" integrity sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ== @@ -9665,9 +9746,19 @@ vite-plugin-top-level-await@^1.3.1: "@swc/core" "^1.10.16" uuid "^10.0.0" -vite-plugin-wasm@^3.2.2: +vite-plugin-top-level-await@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/vite-plugin-top-level-await/-/vite-plugin-top-level-await-1.6.0.tgz#c6ed0be438a1c14f48b4f9a56da859c12821a7c2" + integrity sha512-bNhUreLamTIkoulCR9aDXbTbhLk6n1YE8NJUTTxl5RYskNRtzOR0ASzSjBVRtNdjIfngDXo11qOsybGLNsrdww== + dependencies: + "@rollup/plugin-virtual" "^3.0.2" + "@swc/core" "^1.12.14" + "@swc/wasm" "^1.12.14" + uuid "10.0.0" + +vite-plugin-wasm@^3.2.2, vite-plugin-wasm@^3.5.0: version "3.5.0" - resolved "https://registry.npmjs.org/vite-plugin-wasm/-/vite-plugin-wasm-3.5.0.tgz" + resolved "https://registry.yarnpkg.com/vite-plugin-wasm/-/vite-plugin-wasm-3.5.0.tgz#c72af91b1e3687e12f1c339a12e25937b5813ae5" integrity sha512-X5VWgCnqiQEGb+omhlBVsvTfxikKtoOgAzQ95+BZ8gQ+VfMHIjSHr0wyvXFQCa0eKQ0fKyaL0kWcEnYqBac4lQ== vite@^3.0.0: