@deepseek-ai/libreoffice-kit 0.0.2-rc5 → 0.0.2-rc7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/assets/font-subset.json +4 -4
- package/lib/browser/assets.json +2 -2
- package/lib/browser/index.js +65 -16
- package/lib/browser/types/font-channel.d.ts +5 -4
- package/lib/browser/types/index.d.ts +2 -1
- package/lib/browser/types/office-engine.d.ts +2 -0
- package/lib/browser/types/preparation.d.ts +13 -0
- package/lib/browser/types/protocol.d.ts +7 -6
- package/lib/browser/types/types.d.ts +29 -8
- package/lib/browser/worker.js +138 -21
- package/lib/browser-assets.js +1 -1
- package/lib/cli.js +2 -2
- package/lib/font-source.js +19 -1
- package/lib/font-worker.js +133 -35
- package/lib/index.js +2 -2
- package/lib/types/engine.d.ts +1 -1
- package/lib/types/font-source-types.d.ts +11 -0
- package/lib/types/font-subsets.d.ts +5 -1
- package/lib/types/fonts.d.ts +1 -0
- package/lib/types/office-fonts.d.ts +6 -0
- package/lib/worker.js +7 -6
- package/package.json +2 -2
- package/sources/browser/packages/browser/package.json +1 -1
- package/sources/browser/packages/browser/src/connection.ts +8 -3
- package/sources/browser/packages/browser/src/font-channel.ts +75 -14
- package/sources/browser/packages/browser/src/index.ts +2 -1
- package/sources/browser/packages/browser/src/office-engine.ts +26 -2
- package/sources/browser/packages/browser/src/preparation.ts +41 -0
- package/sources/browser/packages/browser/src/protocol.ts +5 -3
- package/sources/browser/packages/browser/src/types.ts +23 -2
- package/sources/browser/packages/browser/src/worker.ts +19 -4
- package/sources/browser/scripts/build-browser.mjs +1 -1
- package/sources/font-subset/scripts/platform-matrix.mjs +1 -1
- package/sources/font-subset/scripts/verify-artifacts.mjs +3 -3
package/README.md
CHANGED
|
@@ -52,7 +52,9 @@ CLI paths resolve against its working directory. Success writes one JSON object
|
|
|
52
52
|
|
|
53
53
|
Node operations and the Host font service use bounded system-font discovery. Exact installed families and explicit aliases precede Unicode-script and regional body-text preferences, then other glyph-covering fonts. Windows preferences derive from pinned Chromium data; macOS/Linux use Fontconfig categories, with the other source supplying additional candidates. Unicode 17 Script/Script_Extensions data keeps mixed text independent of incorrectly declared document languages. Only unlisted Latin/CJK decorative faces are demoted; cursive writing traditions such as Urdu Nastaliq remain normal body fonts. No fonts are downloaded or bundled by these rules. Full original files retain shaping and encoding. Recreate the converter after changing installed fonts. `missingFonts` reports unavailable declared OOXML families; font-service `unresolvedCodePoints` separately reports scalars no installed face covers. The rule data and licenses are regenerated with `node scripts/generate-font-preferences.mjs` and retained in `NOTICE`.
|
|
54
54
|
|
|
55
|
-
`createFontSource` from `@deepseek-ai/libreoffice-kit/fonts` provides an independent
|
|
55
|
+
`createFontSource` from `@deepseek-ai/libreoffice-kit/fonts` provides an independent Worker service. `prepare()` builds its lifetime font snapshot before the first document request. Default discovery supplements normal system roots with a small compatibility set from an installed Microsoft Office on macOS or Windows; explicit `fontDirectories` replace all defaults. No font bytes or Host paths enter the package. `resolve(attributes)` retains the Unicode-script subset behavior for interactive Office. `resolve({...attributes, mode:'full'})` returns opaque `full_…` identities, original family names and `format` (`ttf`, `otf`, `ttc`); `read(id)` returns complete original font bytes. Apple dfont resources are extracted as complete sfnt faces. Reads reject unknown or changed sources and do not expose host paths.
|
|
56
|
+
|
|
57
|
+
Full-mode selections from the same unchanged TTC share one file read and retained byte entry while keeping each selected family's name and alias. The existing cache budget counts unique full assets once; eviction may require a later read to regenerate them. Subsets and dfont resources remain specific to each physical face.
|
|
56
58
|
|
|
57
59
|
PDFium is an experimental direct raster path, separate from PDF.js and Office reading sessions. Embedded PDF fonts remain PDFium-owned. A fixed, bounded set of regular faces selected from `initialFontFamilies` and fallback groups is mounted before PDFium's first font enumeration. This does not infer every arbitrary PDF font or repair custom encodings. Password-protected PDFs are rejected; forms are rasterized by the upstream PDFium wrapper, while ordinary annotations and advanced PDF features require further qualification.
|
|
58
60
|
|
package/assets/font-subset.json
CHANGED
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
"sha256": "3dbe51aba06e309bc9a8573462af1a8c93628cf325e88db7d32320fc2a9d54e8"
|
|
32
32
|
},
|
|
33
33
|
"sources/font-subset/scripts/platform-matrix.mjs": {
|
|
34
|
-
"bytes":
|
|
35
|
-
"sha256": "
|
|
34
|
+
"bytes": 4819,
|
|
35
|
+
"sha256": "870716743136c2a79283910ed58b73aa88766a94f491ca171a59c7fb7512890d"
|
|
36
36
|
},
|
|
37
37
|
"sources/font-subset/scripts/pack-utils.mjs": {
|
|
38
38
|
"bytes": 3327,
|
|
39
39
|
"sha256": "aa5368e0dd38d90459f0ef14e1d4b27740aef2f4e46617aca6d6fafed0577a44"
|
|
40
40
|
},
|
|
41
41
|
"sources/font-subset/scripts/verify-artifacts.mjs": {
|
|
42
|
-
"bytes":
|
|
43
|
-
"sha256": "
|
|
42
|
+
"bytes": 16020,
|
|
43
|
+
"sha256": "bc3103bdeedc64c80487e7daf096a03e3b8c180e0b4fdc8986e987fb823a6d82"
|
|
44
44
|
},
|
|
45
45
|
"sources/font-subset/engine/font-subset/README.md": {
|
|
46
46
|
"bytes": 2130,
|
package/lib/browser/assets.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"files": {
|
|
4
4
|
"worker": {
|
|
5
5
|
"path": "lib/browser/worker.js",
|
|
6
|
-
"bytes":
|
|
7
|
-
"sha256": "
|
|
6
|
+
"bytes": 120352,
|
|
7
|
+
"sha256": "f74836c2d512f9f9da3fc5d8ff29296932ed25f3e4af918a1595f22eb6a84e89"
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
package/lib/browser/index.js
CHANGED
|
@@ -21,16 +21,28 @@ function fontViews(channel) {
|
|
|
21
21
|
bytes: new Uint8Array(channel, 8)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
function* fontFrames(result) {
|
|
24
|
+
/** Only uninstalled content crosses the channel; each family retains its own alias. */
|
|
25
|
+
function* fontFrames(result, known = []) {
|
|
26
|
+
const identities = new Map(known.map((font) => [font.id, font]));
|
|
26
27
|
const header = {
|
|
27
|
-
fonts: result.fonts.map((font) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
fonts: result.fonts.map((font) => {
|
|
29
|
+
const size = font.data === void 0 ? font.bytes : font.data.byteLength;
|
|
30
|
+
const identity = {
|
|
31
|
+
id: font.id,
|
|
32
|
+
bytes: size,
|
|
33
|
+
...font.format ? { format: font.format } : {}
|
|
34
|
+
};
|
|
35
|
+
const prior = identities.get(font.id);
|
|
36
|
+
if (prior && (prior.bytes !== identity.bytes || prior.format !== identity.format)) throw new BrowserRenderError("font-unavailable", "Font identity has conflicting bytes or formats.");
|
|
37
|
+
if (!prior && font.data === void 0) throw new BrowserRenderError("font-unavailable", "Font reference has not been installed.");
|
|
38
|
+
identities.set(font.id, identity);
|
|
39
|
+
return {
|
|
40
|
+
...identity,
|
|
41
|
+
family: font.family,
|
|
42
|
+
alias: font.alias,
|
|
43
|
+
...prior ? { reference: true } : {}
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
34
46
|
...result.missingFamily === void 0 ? {} : { missingFamily: result.missingFamily }
|
|
35
47
|
};
|
|
36
48
|
const encoded = new TextEncoder().encode(JSON.stringify(header));
|
|
@@ -39,16 +51,51 @@ function* fontFrames(result) {
|
|
|
39
51
|
state: 1,
|
|
40
52
|
bytes: encoded
|
|
41
53
|
};
|
|
42
|
-
for (const font of result.fonts
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
for (const [index, font] of result.fonts.entries()) {
|
|
55
|
+
if (header.fonts[index].reference) continue;
|
|
56
|
+
/* v8 ignore next -- header validation rejects an unknown data-less font before iteration. */
|
|
57
|
+
if (font.data === void 0) throw new BrowserRenderError("font-unavailable", "Font reference has not been installed.");
|
|
58
|
+
for (let offset = 0; offset < font.data.byteLength; offset += FONT_CHUNK_BYTES) yield {
|
|
59
|
+
state: 2,
|
|
60
|
+
bytes: font.data.subarray(offset, offset + FONT_CHUNK_BYTES)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
46
63
|
yield {
|
|
47
64
|
state: 3,
|
|
48
65
|
bytes: /* @__PURE__ */ new Uint8Array()
|
|
49
66
|
};
|
|
50
67
|
}
|
|
51
68
|
//#endregion
|
|
69
|
+
//#region lib/types/preparation.js
|
|
70
|
+
/** Browser-side WASM compilation without creating an Office Worker or memory. */
|
|
71
|
+
/**
|
|
72
|
+
* Compile the version-matched LibreOffice WASM module for later document Workers.
|
|
73
|
+
* @param assets - Browser resources whose WASM URL identifies the compiled module.
|
|
74
|
+
* @param signal - Cancels the resource request; compilation may finish before cancellation is observed.
|
|
75
|
+
* @returns an opaque, structured-cloneable engine handle that allocates no WASM memory.
|
|
76
|
+
*/
|
|
77
|
+
async function prepareOfficeBrowser(assets, signal) {
|
|
78
|
+
signal?.throwIfAborted();
|
|
79
|
+
if (typeof WebAssembly.compileStreaming !== "function") throw new BrowserRenderError("unavailable", "Streaming WebAssembly compilation is unavailable.");
|
|
80
|
+
const response = await fetch(assets.wasmUrl, {
|
|
81
|
+
credentials: "same-origin",
|
|
82
|
+
...signal === void 0 ? {} : { signal }
|
|
83
|
+
});
|
|
84
|
+
if (!response.ok) throw new BrowserRenderError("unavailable", `LibreOffice WASM request failed: ${response.status}`);
|
|
85
|
+
const module = await WebAssembly.compileStreaming(Promise.resolve(response));
|
|
86
|
+
signal?.throwIfAborted();
|
|
87
|
+
return Object.freeze({
|
|
88
|
+
wasmUrl: assets.wasmUrl,
|
|
89
|
+
module
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** Return the compiled module after validating the Worker-bound asset identity. */
|
|
93
|
+
function preparedBrowserModule(prepared, assets) {
|
|
94
|
+
const record = prepared;
|
|
95
|
+
if (record.wasmUrl !== assets.wasmUrl || !(record.module instanceof WebAssembly.Module)) throw new TypeError("The prepared browser engine does not match the requested WASM asset.");
|
|
96
|
+
return record.module;
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
52
99
|
//#region lib/types/connection.js
|
|
53
100
|
/** Browser document ownership, cancellation and asynchronous Host font delivery. */
|
|
54
101
|
/**
|
|
@@ -74,6 +121,7 @@ async function openBrowserConnection(options, signal, office = false, onEvent) {
|
|
|
74
121
|
"ppt",
|
|
75
122
|
"pptx"
|
|
76
123
|
] : ["pdf"]).includes(options.extension) || options.data.byteLength === 0) throw new BrowserRenderError("invalid-document", "The document is empty or has an unsupported extension.");
|
|
124
|
+
if (options.preparedEngine !== void 0) preparedBrowserModule(options.preparedEngine, options.assets);
|
|
77
125
|
const worker = new Worker(options.assets.workerUrl, { name: "libreoffice-document" });
|
|
78
126
|
const channel = new SharedArrayBuffer(1048584);
|
|
79
127
|
const { control, bytes } = fontViews(channel);
|
|
@@ -124,9 +172,9 @@ async function openBrowserConnection(options, signal, office = false, onEvent) {
|
|
|
124
172
|
return;
|
|
125
173
|
case "font":
|
|
126
174
|
if (closed) return;
|
|
127
|
-
Promise.resolve().then(() => options.resolveFonts(message.request, lifetime.signal)).then((result) => {
|
|
175
|
+
Promise.resolve().then(() => options.resolveFonts(message.request, message.known, lifetime.signal)).then((result) => {
|
|
128
176
|
if (closed) return;
|
|
129
|
-
frames = fontFrames(result);
|
|
177
|
+
frames = fontFrames(result, message.known);
|
|
130
178
|
pumpFonts();
|
|
131
179
|
}, sendFontError);
|
|
132
180
|
return;
|
|
@@ -239,6 +287,7 @@ async function openBrowserConnection(options, signal, office = false, onEvent) {
|
|
|
239
287
|
data,
|
|
240
288
|
extension: options.extension,
|
|
241
289
|
assets: options.assets,
|
|
290
|
+
...options.preparedEngine === void 0 ? {} : { preparedEngine: options.preparedEngine },
|
|
242
291
|
timeoutMs: options.timeoutMs,
|
|
243
292
|
maxLoadedFontBytes: options.maxLoadedFontBytes,
|
|
244
293
|
fontFallbacks: options.fontFallbacks,
|
|
@@ -439,4 +488,4 @@ async function openDocument(options, signal) {
|
|
|
439
488
|
};
|
|
440
489
|
}
|
|
441
490
|
//#endregion
|
|
442
|
-
export { BrowserRenderError, openDocument, openOfficeDocument };
|
|
491
|
+
export { BrowserRenderError, openDocument, openOfficeDocument, prepareOfficeBrowser };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { FontState } from './protocol.ts';
|
|
2
|
+
import type { FontIdentity } from './protocol.ts';
|
|
2
3
|
import type { BrowserFontRequest, BrowserFontResult } from './types.ts';
|
|
3
4
|
/** Views shared by the owner and engine; only the engine uses Atomics.wait. */
|
|
4
5
|
export declare function fontViews(channel: SharedArrayBuffer): {
|
|
5
6
|
control: Int32Array;
|
|
6
7
|
bytes: Uint8Array;
|
|
7
8
|
};
|
|
8
|
-
/**
|
|
9
|
-
export declare function fontFrames(result: BrowserFontResult): Generator<{
|
|
9
|
+
/** Only uninstalled content crosses the channel; each family retains its own alias. */
|
|
10
|
+
export declare function fontFrames(result: BrowserFontResult, known?: readonly FontIdentity[]): Generator<{
|
|
10
11
|
state: FontState;
|
|
11
12
|
bytes: Uint8Array;
|
|
12
13
|
}>;
|
|
@@ -15,6 +16,6 @@ export interface EngineFontFace {
|
|
|
15
16
|
readonly path: string;
|
|
16
17
|
readonly family: string;
|
|
17
18
|
}
|
|
18
|
-
/** The synchronous reader installs immutable
|
|
19
|
-
export declare function createFontReader(channel: SharedArrayBuffer, timeoutMs: number, maxLoadedFontBytes: number, declaredFamilies: ReadonlyMap<string, string>, request: (request: BrowserFontRequest) => void, next: () => void, install: (path: string, bytes: Uint8Array) => void, missing: (families: readonly string[]) => void): (request: BrowserFontRequest) => EngineFontFace[];
|
|
19
|
+
/** The synchronous reader installs immutable font assets before returning their MEMFS paths and aliases. */
|
|
20
|
+
export declare function createFontReader(channel: SharedArrayBuffer, timeoutMs: number, maxLoadedFontBytes: number, declaredFamilies: ReadonlyMap<string, string>, request: (request: BrowserFontRequest, known: readonly FontIdentity[]) => void, next: () => void, install: (path: string, bytes: Uint8Array) => void, missing: (families: readonly string[]) => void, documentCodePoints?: readonly number[]): (request: BrowserFontRequest) => EngineFontFace[];
|
|
20
21
|
//# sourceMappingURL=font-channel.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BrowserDocument, BrowserDocumentOptions } from './types.ts';
|
|
2
2
|
export { BrowserRenderError } from './types.ts';
|
|
3
3
|
export { openOfficeDocument } from './office.ts';
|
|
4
|
+
export { prepareOfficeBrowser } from './preparation.ts';
|
|
4
5
|
export type * from './office-types.ts';
|
|
5
|
-
export type { BrowserDocument, BrowserDocumentOptions, BrowserEngineAssets, BrowserFontRequest, BrowserFontResult, BrowserPage, BrowserRenderErrorCode, BrowserTile, BrowserTileRequest } from './types.ts';
|
|
6
|
+
export type { BrowserDocument, BrowserDocumentOptions, BrowserEngineAssets, BrowserFontIdentity, BrowserFontRequest, BrowserFontResult, BrowserPage, BrowserRenderErrorCode, BrowserResolvedFont, BrowserTile, BrowserTileRequest, PreparedBrowserEngine } from './types.ts';
|
|
6
7
|
/**
|
|
7
8
|
* Open a read-only document; each call owns an independent Worker.
|
|
8
9
|
* @param options - Source bytes, version-matched resources and Host fonts.
|
|
@@ -15,6 +15,8 @@ export declare class OfficeEngine {
|
|
|
15
15
|
private stopped;
|
|
16
16
|
private layoutWidth;
|
|
17
17
|
private viewport;
|
|
18
|
+
private captureView;
|
|
19
|
+
private readingView;
|
|
18
20
|
private commandResult;
|
|
19
21
|
constructor(module: EmscriptenModule, document: number, format: OfficeDocumentFormat, emit: (event: OfficeDocumentEvent) => void, failure: (error: unknown) => void);
|
|
20
22
|
private call;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BrowserEngineAssets, PreparedBrowserEngine } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Compile the version-matched LibreOffice WASM module for later document Workers.
|
|
4
|
+
* @param assets - Browser resources whose WASM URL identifies the compiled module.
|
|
5
|
+
* @param signal - Cancels the resource request; compilation may finish before cancellation is observed.
|
|
6
|
+
* @returns an opaque, structured-cloneable engine handle that allocates no WASM memory.
|
|
7
|
+
*/
|
|
8
|
+
export declare function prepareOfficeBrowser(assets: BrowserEngineAssets, signal?: AbortSignal): Promise<PreparedBrowserEngine>;
|
|
9
|
+
/** Return the compiled module after validating the Worker-bound asset identity. */
|
|
10
|
+
export declare function preparedBrowserModule(prepared: PreparedBrowserEngine, assets: BrowserEngineAssets): WebAssembly.Module;
|
|
11
|
+
/** Instantiate precompiled code through Emscripten's synchronous override. */
|
|
12
|
+
export declare function instantiatePreparedModule(module: WebAssembly.Module, imports: WebAssembly.Imports, receive: (instance: WebAssembly.Instance, module: WebAssembly.Module) => void): WebAssembly.Exports;
|
|
13
|
+
//# sourceMappingURL=preparation.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Private messages exchanged by the document owner and its single engine Worker. */
|
|
2
|
-
import type { BrowserDocumentOptions, BrowserFontRequest, BrowserPage, BrowserRenderErrorCode, BrowserTile, BrowserTileRequest } from './types.ts';
|
|
2
|
+
import type { BrowserDocumentOptions, BrowserFontIdentity, BrowserFontRequest, BrowserPage, BrowserRenderErrorCode, BrowserTile, BrowserTileRequest } from './types.ts';
|
|
3
3
|
import type { OfficeDocumentEvent, OfficeDocumentNavigation, OfficeDocumentOptions, OfficeDocumentState, OfficeDocumentPointer, OfficeDocumentLayoutRequest, OfficeDocumentLayoutResult, OfficeDocumentTileRequest, OfficeDocumentRectangle } from './office-types.ts';
|
|
4
4
|
export declare const FONT_CHUNK_BYTES: number;
|
|
5
5
|
export declare const FONT_HEADER_BYTES = 8;
|
|
@@ -89,20 +89,21 @@ export type WorkerMessage = {
|
|
|
89
89
|
} | {
|
|
90
90
|
readonly type: 'font';
|
|
91
91
|
readonly request: BrowserFontRequest;
|
|
92
|
+
readonly known: readonly FontIdentity[];
|
|
92
93
|
} | {
|
|
93
94
|
readonly type: 'font-next';
|
|
94
95
|
} | {
|
|
95
96
|
readonly type: 'missing-fonts';
|
|
96
97
|
readonly families: readonly string[];
|
|
97
98
|
};
|
|
99
|
+
/** Immutable bytes already installed in this document's MEMFS. */
|
|
100
|
+
export type FontIdentity = BrowserFontIdentity;
|
|
98
101
|
export interface FontHeader {
|
|
99
|
-
readonly fonts: readonly {
|
|
100
|
-
readonly id: string;
|
|
101
|
-
readonly bytes: number;
|
|
102
|
+
readonly fonts: readonly (FontIdentity & {
|
|
102
103
|
readonly family: string;
|
|
103
104
|
readonly alias: string;
|
|
104
|
-
readonly
|
|
105
|
-
}[];
|
|
105
|
+
readonly reference?: true;
|
|
106
|
+
})[];
|
|
106
107
|
readonly missingFamily?: string;
|
|
107
108
|
}
|
|
108
109
|
export {};
|
|
@@ -8,6 +8,11 @@ export interface BrowserEngineAssets {
|
|
|
8
8
|
readonly metadataUrl: string;
|
|
9
9
|
readonly programDirectory: string;
|
|
10
10
|
}
|
|
11
|
+
declare const preparedBrowserEngine: unique symbol;
|
|
12
|
+
/** Compiled engine code bound to one WASM resource identity. */
|
|
13
|
+
export interface PreparedBrowserEngine {
|
|
14
|
+
readonly [preparedBrowserEngine]: true;
|
|
15
|
+
}
|
|
11
16
|
/** VCL attributes passed unchanged to the Host's font matcher. */
|
|
12
17
|
export interface BrowserFontRequest {
|
|
13
18
|
readonly mode?: 'full';
|
|
@@ -20,15 +25,28 @@ export interface BrowserFontRequest {
|
|
|
20
25
|
readonly language: string;
|
|
21
26
|
readonly codePoints: readonly number[];
|
|
22
27
|
}
|
|
28
|
+
/** Immutable font content already installed in one document Worker. */
|
|
29
|
+
export interface BrowserFontIdentity {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly bytes: number;
|
|
32
|
+
readonly format?: 'ttf' | 'otf' | 'ttc';
|
|
33
|
+
}
|
|
34
|
+
/** One new font body or a metadata-only reference to content already installed in the Worker. */
|
|
35
|
+
export type BrowserResolvedFont = {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly family: string;
|
|
38
|
+
readonly alias: string;
|
|
39
|
+
readonly format?: 'ttf' | 'otf' | 'ttc';
|
|
40
|
+
} & ({
|
|
41
|
+
readonly data: Uint8Array;
|
|
42
|
+
readonly bytes?: never;
|
|
43
|
+
} | {
|
|
44
|
+
readonly data?: never;
|
|
45
|
+
readonly bytes: number;
|
|
46
|
+
});
|
|
23
47
|
/** Immutable per-face font subsets; equal ids and aliases must identify equal bytes. */
|
|
24
48
|
export interface BrowserFontResult {
|
|
25
|
-
readonly fonts: readonly
|
|
26
|
-
readonly id: string;
|
|
27
|
-
readonly data: Uint8Array;
|
|
28
|
-
readonly family: string;
|
|
29
|
-
readonly alias: string;
|
|
30
|
-
readonly format?: 'ttf' | 'otf' | 'ttc';
|
|
31
|
-
}[];
|
|
49
|
+
readonly fonts: readonly BrowserResolvedFont[];
|
|
32
50
|
readonly missingFamily?: string;
|
|
33
51
|
/** Missing scalars reported by the Host, independently of a substituted family. */
|
|
34
52
|
readonly unresolvedCodePoints?: readonly number[];
|
|
@@ -58,6 +76,8 @@ export interface BrowserDocumentOptions {
|
|
|
58
76
|
readonly data: Uint8Array;
|
|
59
77
|
readonly extension: 'pdf';
|
|
60
78
|
readonly assets: BrowserEngineAssets;
|
|
79
|
+
/** Optional compiled WASM code created by prepareOfficeBrowser for these assets. */
|
|
80
|
+
readonly preparedEngine?: PreparedBrowserEngine;
|
|
61
81
|
/** Maximum time for each load, render, font request, or teardown operation. */
|
|
62
82
|
readonly timeoutMs: number;
|
|
63
83
|
/** Maximum ZIP entries inspected before LibreOffice loads OOXML. */
|
|
@@ -69,7 +89,7 @@ export interface BrowserDocumentOptions {
|
|
|
69
89
|
/** The same ordered substitution groups used by the Host font matcher. */
|
|
70
90
|
readonly fontFallbacks: readonly (readonly string[])[];
|
|
71
91
|
/** Match fonts without blocking the browser's main thread. */
|
|
72
|
-
readonly resolveFonts: (request: BrowserFontRequest, signal: AbortSignal) => Promise<BrowserFontResult>;
|
|
92
|
+
readonly resolveFonts: (request: BrowserFontRequest, known: readonly BrowserFontIdentity[], signal: AbortSignal) => Promise<BrowserFontResult>;
|
|
73
93
|
/** Called with unavailable declared OOXML families; binary DOC/PPT have no font diagnostics. */
|
|
74
94
|
readonly onMissingFonts?: (families: readonly string[]) => void;
|
|
75
95
|
}
|
|
@@ -89,4 +109,5 @@ export declare class BrowserRenderError extends Error {
|
|
|
89
109
|
readonly code: BrowserRenderErrorCode;
|
|
90
110
|
constructor(code: BrowserRenderErrorCode, message: string);
|
|
91
111
|
}
|
|
112
|
+
export {};
|
|
92
113
|
//# sourceMappingURL=types.d.ts.map
|
package/lib/browser/worker.js
CHANGED
|
@@ -2457,12 +2457,39 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2457
2457
|
bytes: new Uint8Array(channel, 8)
|
|
2458
2458
|
};
|
|
2459
2459
|
}
|
|
2460
|
-
|
|
2461
|
-
|
|
2460
|
+
const SCRIPT_GROUPS = [
|
|
2461
|
+
["arabic", /\p{Script_Extensions=Arabic}/u],
|
|
2462
|
+
["cyrillic", /\p{Script_Extensions=Cyrillic}/u],
|
|
2463
|
+
["devanagari", /\p{Script_Extensions=Devanagari}/u],
|
|
2464
|
+
["greek", /\p{Script_Extensions=Greek}/u],
|
|
2465
|
+
["han", /\p{Script_Extensions=Han}/u],
|
|
2466
|
+
["hangul", /\p{Script_Extensions=Hangul}/u],
|
|
2467
|
+
["hebrew", /\p{Script_Extensions=Hebrew}/u],
|
|
2468
|
+
["hiragana", /\p{Script_Extensions=Hiragana}/u],
|
|
2469
|
+
["katakana", /\p{Script_Extensions=Katakana}/u],
|
|
2470
|
+
["latin", /\p{Script_Extensions=Latin}/u],
|
|
2471
|
+
["thai", /\p{Script_Extensions=Thai}/u],
|
|
2472
|
+
["common", /[\p{Script=Common}\p{Script=Inherited}]/u]
|
|
2473
|
+
];
|
|
2474
|
+
function scriptGroup(point) {
|
|
2475
|
+
const character = String.fromCodePoint(point);
|
|
2476
|
+
return SCRIPT_GROUPS.find(([, pattern]) => pattern.test(character))?.[0] ?? `other-${point >>> 8}`;
|
|
2477
|
+
}
|
|
2478
|
+
/** The synchronous reader installs immutable font assets before returning their MEMFS paths and aliases. */
|
|
2479
|
+
function createFontReader(channel, timeoutMs, maxLoadedFontBytes, declaredFamilies, request, next, install, missing, documentCodePoints = []) {
|
|
2462
2480
|
const { control, bytes } = fontViews(channel);
|
|
2463
2481
|
const installed = /* @__PURE__ */ new Map();
|
|
2464
2482
|
const aliases = /* @__PURE__ */ new Map();
|
|
2465
2483
|
const requests = /* @__PURE__ */ new Map();
|
|
2484
|
+
const coverage = /* @__PURE__ */ new Map();
|
|
2485
|
+
const expanded = /* @__PURE__ */ new Map();
|
|
2486
|
+
const documentGroups = /* @__PURE__ */ new Map();
|
|
2487
|
+
for (const point of [...new Set(documentCodePoints)].sort((left, right) => left - right)) {
|
|
2488
|
+
const group = scriptGroup(point);
|
|
2489
|
+
const points = documentGroups.get(group);
|
|
2490
|
+
if (points) points.push(point);
|
|
2491
|
+
else documentGroups.set(group, [point]);
|
|
2492
|
+
}
|
|
2466
2493
|
const families = /* @__PURE__ */ new Set();
|
|
2467
2494
|
let loadedBytes = 0;
|
|
2468
2495
|
function read() {
|
|
@@ -2486,14 +2513,34 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2486
2513
|
}
|
|
2487
2514
|
return (attributes) => {
|
|
2488
2515
|
const canonical = aliases.get(normalize(attributes.family))?.family;
|
|
2516
|
+
const codePoints = [...new Set(attributes.codePoints)].sort((left, right) => left - right);
|
|
2489
2517
|
const original = {
|
|
2490
2518
|
...attributes,
|
|
2519
|
+
codePoints,
|
|
2491
2520
|
...canonical === void 0 ? {} : { family: canonical }
|
|
2492
2521
|
};
|
|
2493
2522
|
const key = JSON.stringify(original);
|
|
2494
2523
|
const cached = requests.get(key);
|
|
2495
2524
|
if (cached) return cached;
|
|
2496
|
-
|
|
2525
|
+
const { codePoints: _points, ...base } = original;
|
|
2526
|
+
const coverageKey = JSON.stringify(base);
|
|
2527
|
+
const covered = coverage.get(coverageKey);
|
|
2528
|
+
if (codePoints.length > 0 && covered && (covered.complete || codePoints.every((point) => covered.points.has(point)))) {
|
|
2529
|
+
requests.set(key, covered.faces);
|
|
2530
|
+
return covered.faces;
|
|
2531
|
+
}
|
|
2532
|
+
const groups = new Set(codePoints.map(scriptGroup));
|
|
2533
|
+
const expandedGroups = expanded.get(coverageKey);
|
|
2534
|
+
const newGroups = original.mode === "full" ? [] : [...groups].filter((group) => !expandedGroups?.has(group));
|
|
2535
|
+
const requestedPoints = newGroups.length === 0 ? codePoints : [.../* @__PURE__ */ new Set([...codePoints, ...newGroups.flatMap((group) => documentGroups.get(group) ?? [])])].sort((left, right) => left - right);
|
|
2536
|
+
request({
|
|
2537
|
+
...original,
|
|
2538
|
+
codePoints: requestedPoints
|
|
2539
|
+
}, [...installed].map(([id, font]) => ({
|
|
2540
|
+
id,
|
|
2541
|
+
bytes: font.bytes,
|
|
2542
|
+
...font.format ? { format: font.format } : {}
|
|
2543
|
+
})));
|
|
2497
2544
|
const first = read();
|
|
2498
2545
|
if (first.state !== 1) throw new BrowserRenderError("font-unavailable", "Expected font transfer metadata.");
|
|
2499
2546
|
let header;
|
|
@@ -2511,15 +2558,17 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2511
2558
|
"otf",
|
|
2512
2559
|
"ttc"
|
|
2513
2560
|
].includes(font.format)) throw new BrowserRenderError("font-unavailable", "Invalid full font format.");
|
|
2561
|
+
if (font.reference !== void 0 && font.reference !== true) throw new BrowserRenderError("font-unavailable", "Invalid font reference descriptor.");
|
|
2514
2562
|
const prior = installed.get(font.id);
|
|
2515
|
-
if (
|
|
2563
|
+
if (font.reference && !prior) throw new BrowserRenderError("font-unavailable", "Font reference has not been installed.");
|
|
2564
|
+
if (prior && (prior.bytes !== font.bytes || prior.format !== font.format || font.format === void 0 && prior.face.family !== font.alias)) throw new BrowserRenderError("font-unavailable", "Font identity has conflicting bytes, aliases or formats.");
|
|
2516
2565
|
const alias = normalize(font.alias);
|
|
2517
2566
|
const previousAlias = aliases.get(alias);
|
|
2518
2567
|
if (previousAlias && (previousAlias.family !== font.family || font.format === void 0 && previousAlias.id !== font.id)) throw new BrowserRenderError("font-unavailable", "Font alias identifies conflicting subsets.");
|
|
2519
2568
|
if (!prior && loadedBytes + font.bytes > maxLoadedFontBytes) throw new BrowserRenderError("font-limit", "Imported fonts exceed maxLoadedFontBytes.");
|
|
2520
2569
|
const buffer = prior ? void 0 : new Uint8Array(font.bytes);
|
|
2521
2570
|
let received = 0;
|
|
2522
|
-
while (received < font.bytes) {
|
|
2571
|
+
while (!font.reference && received < font.bytes) {
|
|
2523
2572
|
const frame = read();
|
|
2524
2573
|
if (frame.state !== 2 || frame.data.length === 0 || received + frame.data.length > font.bytes) throw new BrowserRenderError("font-unavailable", "Incomplete font file transfer.");
|
|
2525
2574
|
buffer?.set(frame.data, received);
|
|
@@ -2533,6 +2582,7 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2533
2582
|
install(face.path, buffer);
|
|
2534
2583
|
installed.set(font.id, {
|
|
2535
2584
|
face,
|
|
2585
|
+
bytes: buffer.length,
|
|
2536
2586
|
format: font.format
|
|
2537
2587
|
});
|
|
2538
2588
|
loadedBytes += buffer.length;
|
|
@@ -2550,10 +2600,36 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2550
2600
|
missing([...families]);
|
|
2551
2601
|
}
|
|
2552
2602
|
requests.set(key, faces);
|
|
2603
|
+
if (newGroups.length > 0) expanded.set(coverageKey, /* @__PURE__ */ new Set([...expandedGroups ?? [], ...newGroups]));
|
|
2604
|
+
if (requestedPoints.length > 0) {
|
|
2605
|
+
const group = {
|
|
2606
|
+
points: new Set(covered?.points),
|
|
2607
|
+
faces: [...covered?.faces ?? []],
|
|
2608
|
+
complete: covered?.complete ?? false
|
|
2609
|
+
};
|
|
2610
|
+
for (const point of requestedPoints) group.points.add(point);
|
|
2611
|
+
for (const face of faces) if (!group.faces.some((existing) => existing.path === face.path && existing.family === face.family)) group.faces.push(face);
|
|
2612
|
+
group.complete ||= header.fonts.every((font) => font.format !== void 0);
|
|
2613
|
+
coverage.set(coverageKey, group);
|
|
2614
|
+
}
|
|
2553
2615
|
return faces;
|
|
2554
2616
|
};
|
|
2555
2617
|
}
|
|
2556
2618
|
//#endregion
|
|
2619
|
+
//#region lib/types/preparation.js
|
|
2620
|
+
/** Return the compiled module after validating the Worker-bound asset identity. */
|
|
2621
|
+
function preparedBrowserModule(prepared, assets) {
|
|
2622
|
+
const record = prepared;
|
|
2623
|
+
if (record.wasmUrl !== assets.wasmUrl || !(record.module instanceof WebAssembly.Module)) throw new TypeError("The prepared browser engine does not match the requested WASM asset.");
|
|
2624
|
+
return record.module;
|
|
2625
|
+
}
|
|
2626
|
+
/** Instantiate precompiled code through Emscripten's synchronous override. */
|
|
2627
|
+
function instantiatePreparedModule(module, imports, receive) {
|
|
2628
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2629
|
+
receive(instance, module);
|
|
2630
|
+
return instance.exports;
|
|
2631
|
+
}
|
|
2632
|
+
//#endregion
|
|
2557
2633
|
//#region ../entry/lib/sheet-geometry.js
|
|
2558
2634
|
const MAX_COLUMN = 16383;
|
|
2559
2635
|
const MAX_ROW = 1048575;
|
|
@@ -2751,6 +2827,8 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2751
2827
|
stopped = false;
|
|
2752
2828
|
layoutWidth = 0;
|
|
2753
2829
|
viewport = "";
|
|
2830
|
+
captureView;
|
|
2831
|
+
readingView;
|
|
2754
2832
|
commandResult;
|
|
2755
2833
|
constructor(module, document, format, emit, failure) {
|
|
2756
2834
|
this.module = module;
|
|
@@ -2800,6 +2878,20 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2800
2878
|
/** Enforce the native read-only view before accepting any input. */
|
|
2801
2879
|
async start() {
|
|
2802
2880
|
this.requireOpen();
|
|
2881
|
+
if (this.state.documentType === "presentation") {
|
|
2882
|
+
const view = this.call("dsh_lok_document_get_view", [this.document]);
|
|
2883
|
+
try {
|
|
2884
|
+
const created = this.call("dsh_lok_document_create_view", [this.document]);
|
|
2885
|
+
if (created < 0) throw new BrowserRenderError("render-failed", "LibreOffice could not create a slide capture view.");
|
|
2886
|
+
this.captureView = created;
|
|
2887
|
+
this.invoke("initialize_rendering");
|
|
2888
|
+
this.configure({ mode: "paginated" });
|
|
2889
|
+
this.pump();
|
|
2890
|
+
} finally {
|
|
2891
|
+
this.invoke("set_view", [view]);
|
|
2892
|
+
}
|
|
2893
|
+
this.readingView = view;
|
|
2894
|
+
}
|
|
2803
2895
|
this.configure({ mode: "paginated" });
|
|
2804
2896
|
this.invoke("listen");
|
|
2805
2897
|
this.refreshGeometry();
|
|
@@ -2879,12 +2971,14 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2879
2971
|
}
|
|
2880
2972
|
}
|
|
2881
2973
|
pump() {
|
|
2974
|
+
if (this.readingView !== void 0) this.invoke("set_view", [this.readingView]);
|
|
2882
2975
|
const deadline = performance.now() + 8;
|
|
2883
2976
|
for (let pass = 0; pass < 8; pass++) {
|
|
2884
2977
|
const result = this.call("dsh_lok_pump");
|
|
2885
2978
|
if (result < 0) throw new BrowserRenderError("render-failed", "LibreOffice event processing failed.");
|
|
2886
2979
|
if (!result || performance.now() >= deadline) break;
|
|
2887
2980
|
}
|
|
2981
|
+
if (this.readingView !== void 0) this.invoke("set_view", [this.readingView]);
|
|
2888
2982
|
this.flush();
|
|
2889
2983
|
}
|
|
2890
2984
|
flush() {
|
|
@@ -2993,6 +3087,7 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
2993
3087
|
/** The Worker permits only these typed reading operations, including at runtime. */
|
|
2994
3088
|
async operation(operation) {
|
|
2995
3089
|
this.requireOpen();
|
|
3090
|
+
if (this.readingView !== void 0) this.invoke("set_view", [this.readingView]);
|
|
2996
3091
|
if (!operation || typeof operation !== "object") throw new BrowserRenderError("render-failed", "Invalid Office reading operation.");
|
|
2997
3092
|
switch (operation.type) {
|
|
2998
3093
|
case "pointer": {
|
|
@@ -3189,10 +3284,13 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
3189
3284
|
/** Direct tiles preserve the active view, navigation state and selection. */
|
|
3190
3285
|
render(request) {
|
|
3191
3286
|
this.requireOpen();
|
|
3287
|
+
if (this.readingView !== void 0) this.invoke("set_view", [this.readingView]);
|
|
3192
3288
|
this.flush();
|
|
3193
3289
|
const part = this.state.parts[integer(request.part, this.state.parts.length - 1)];
|
|
3194
|
-
|
|
3290
|
+
const capture = request.part !== this.state.part;
|
|
3291
|
+
if (capture && this.state.documentType !== "presentation") throw new BrowserRenderError("stale-part", "The Office tile belongs to an inactive worksheet.");
|
|
3195
3292
|
try {
|
|
3293
|
+
if (capture) this.invoke("set_view", [this.captureView]);
|
|
3196
3294
|
return renderRegion(this.module, this.document, {
|
|
3197
3295
|
...request,
|
|
3198
3296
|
pageIndex: 0
|
|
@@ -3203,6 +3301,7 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
3203
3301
|
part: this.state.documentType === "text" ? -1 : request.part
|
|
3204
3302
|
}], () => new BrowserRenderError("render-failed", "Office tile rendering failed."));
|
|
3205
3303
|
} finally {
|
|
3304
|
+
if (this.readingView !== void 0) this.invoke("set_view", [this.readingView]);
|
|
3206
3305
|
this.flush();
|
|
3207
3306
|
}
|
|
3208
3307
|
}
|
|
@@ -3240,6 +3339,7 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
3240
3339
|
}
|
|
3241
3340
|
async function open(options, channel, reading = false) {
|
|
3242
3341
|
const { assets } = options;
|
|
3342
|
+
const prepared = options.preparedEngine === void 0 ? void 0 : preparedBrowserModule(options.preparedEngine, assets);
|
|
3243
3343
|
let metadata;
|
|
3244
3344
|
try {
|
|
3245
3345
|
metadata = options.extension === "pdf" ? {
|
|
@@ -3249,6 +3349,22 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
3249
3349
|
} catch (failure) {
|
|
3250
3350
|
throw new BrowserRenderError("invalid-document", failure instanceof Error ? failure.message : String(failure));
|
|
3251
3351
|
}
|
|
3352
|
+
const initialFont = {
|
|
3353
|
+
family: "sans-serif",
|
|
3354
|
+
style: "",
|
|
3355
|
+
weight: 5,
|
|
3356
|
+
italic: 0,
|
|
3357
|
+
width: 5,
|
|
3358
|
+
pitch: 0,
|
|
3359
|
+
language: "",
|
|
3360
|
+
codePoints: []
|
|
3361
|
+
};
|
|
3362
|
+
let initialFontPending = options.extension !== "pdf";
|
|
3363
|
+
if (initialFontPending) send({
|
|
3364
|
+
type: "font",
|
|
3365
|
+
request: initialFont,
|
|
3366
|
+
known: []
|
|
3367
|
+
});
|
|
3252
3368
|
const response = await fetch(assets.dataUrl, {
|
|
3253
3369
|
credentials: "same-origin",
|
|
3254
3370
|
signal: lifetime.signal
|
|
@@ -3275,6 +3391,9 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
3275
3391
|
}
|
|
3276
3392
|
},
|
|
3277
3393
|
getPreloadedPackage: () => data,
|
|
3394
|
+
...prepared === void 0 ? {} : { instantiateWasm(imports, receive) {
|
|
3395
|
+
return instantiatePreparedModule(prepared, imports, receive);
|
|
3396
|
+
} },
|
|
3278
3397
|
dshResolveSystemFontFaces(request) {
|
|
3279
3398
|
if (!resolveFonts) throw new BrowserRenderError("font-unavailable", "LibreOffice requested fonts before MEMFS initialization.");
|
|
3280
3399
|
try {
|
|
@@ -3298,25 +3417,23 @@ ${XMLNS_NAMESPACE}.`);
|
|
|
3298
3417
|
FONTCONFIG_FILE: "/dsh/fonts.conf",
|
|
3299
3418
|
LOK_HOST_ALLOWLIST: "^$"
|
|
3300
3419
|
});
|
|
3301
|
-
resolveFonts = createFontReader(channel, options.timeoutMs, options.maxLoadedFontBytes, metadata.families, (request) =>
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3420
|
+
resolveFonts = createFontReader(channel, options.timeoutMs, options.maxLoadedFontBytes, metadata.families, (request, known) => {
|
|
3421
|
+
if (initialFontPending) initialFontPending = false;
|
|
3422
|
+
else send({
|
|
3423
|
+
type: "font",
|
|
3424
|
+
request,
|
|
3425
|
+
known
|
|
3426
|
+
});
|
|
3427
|
+
}, () => send({ type: "font-next" }), (path, bytes) => loaded.FS.writeFile(path, bytes), (families) => send({
|
|
3305
3428
|
type: "missing-fonts",
|
|
3306
3429
|
families
|
|
3307
|
-
}));
|
|
3308
|
-
|
|
3309
|
-
|
|
3430
|
+
}), metadata.codePoints);
|
|
3431
|
+
if (options.extension === "pdf") for (const family of new Set(options.fontFallbacks.flat())) resolveFonts({
|
|
3432
|
+
...initialFont,
|
|
3310
3433
|
family,
|
|
3311
|
-
|
|
3312
|
-
weight: 5,
|
|
3313
|
-
italic: 0,
|
|
3314
|
-
width: 5,
|
|
3315
|
-
pitch: 0,
|
|
3316
|
-
language: "",
|
|
3317
|
-
codePoints: [],
|
|
3318
|
-
...options.extension === "pdf" ? { mode: "full" } : {}
|
|
3434
|
+
mode: "full"
|
|
3319
3435
|
});
|
|
3436
|
+
else resolveFonts(initialFont);
|
|
3320
3437
|
}],
|
|
3321
3438
|
onAbort() {
|
|
3322
3439
|
fatal = true;
|
package/lib/browser-assets.js
CHANGED
|
@@ -47,7 +47,7 @@ async function readEngine(packageFile) {
|
|
|
47
47
|
const root = dirname(packageFile);
|
|
48
48
|
const [pkg, manifest] = await Promise.all([readFile(packageFile, "utf8").then((text) => JSON.parse(text)), readFile(resolve(root, "prebuilds.json"), "utf8").then((text) => JSON.parse(text))]);
|
|
49
49
|
const engine = manifest.engine;
|
|
50
|
-
if (pkg.name !== `${ENGINE_PREFIX}-wasm` || pkg.version !== "0.0.2-
|
|
50
|
+
if (pkg.name !== `${ENGINE_PREFIX}-wasm` || pkg.version !== "0.0.2-rc7" || manifest.version !== pkg.version || manifest.schemaVersion !== 1 || manifest.status !== "built" || engine === void 0 || engine.kind !== "wasm" || manifest.platform !== "wasm") throw new Error("Installed LibreOfficeKit wasm package has an incompatible or incomplete manifest.");
|
|
51
51
|
if (engine.glibcMinimum !== void 0) throw new Error("Installed LibreOfficeKit engine has an invalid glibcMinimum.");
|
|
52
52
|
return {
|
|
53
53
|
backend: "wasm",
|