@kition/kit-layout-ui 0.0.0-stage → 0.1.3
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/layout-ui/LICENSE +177 -0
- package/layout-ui/NOTICE +209 -0
- package/layout-ui/THIRD_PARTY_NOTICES.txt +12429 -0
- package/layout-ui/agent/checks.json +51 -0
- package/layout-ui/agent/guide.md +301 -0
- package/layout-ui/assets/dev-urAth9yG.js +1 -0
- package/layout-ui/assets/index-3JO7a523.js +52 -0
- package/layout-ui/assets/index-DblcoJ90.js +1 -0
- package/layout-ui/assets/index-_eI3PfdK.css +1 -0
- package/layout-ui/assets/kitEngine.worker-9PIHJagj-Dwbox6hp.js +13020 -0
- package/layout-ui/engine/kition_layout_kit.js +1147 -0
- package/layout-ui/engine/kition_layout_kit_bg.wasm +0 -0
- package/layout-ui/fonts/BricolageGrotesque-OFL.txt +93 -0
- package/layout-ui/fonts/BricolageGrotesque-Variable.ttf +0 -0
- package/layout-ui/fonts/DroidSansFallback-NOTICE.txt +190 -0
- package/layout-ui/fonts/DroidSansFallbackFull.ttf +0 -0
- package/layout-ui/fonts/Inter-OFL.txt +93 -0
- package/layout-ui/fonts/Inter-Variable.ttf +0 -0
- package/layout-ui/fonts/JetBrainsMono-OFL.txt +93 -0
- package/layout-ui/fonts/JetBrainsMono-Variable.ttf +0 -0
- package/layout-ui/fonts/Lora-OFL.txt +93 -0
- package/layout-ui/fonts/Lora-Variable.ttf +0 -0
- package/layout-ui/index.html +14 -0
- package/layout-ui/kit-ui.json +1 -0
- package/layout-ui/kit.json +173 -0
- package/layout-ui/model/schema.json +544 -0
- package/layout-ui/templates/editorial.klayout +0 -0
- package/layout-ui/templates/editorial.png +0 -0
- package/layout-ui/templates/event.klayout +0 -0
- package/layout-ui/templates/event.png +0 -0
- package/layout-ui/templates/quote.klayout +0 -0
- package/layout-ui/templates/quote.png +0 -0
- package/layout-ui/templates/sale.klayout +0 -0
- package/layout-ui/templates/sale.png +0 -0
- package/package.json +31 -4
- package/README.md +0 -3
|
@@ -0,0 +1,1147 @@
|
|
|
1
|
+
export class LayoutDocument {
|
|
2
|
+
static __wrap(ptr) {
|
|
3
|
+
const obj = Object.create(LayoutDocument.prototype);
|
|
4
|
+
obj.__wbg_ptr = ptr;
|
|
5
|
+
LayoutDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
__destroy_into_raw() {
|
|
9
|
+
const ptr = this.__wbg_ptr;
|
|
10
|
+
this.__wbg_ptr = 0;
|
|
11
|
+
LayoutDocumentFinalization.unregister(this);
|
|
12
|
+
return ptr;
|
|
13
|
+
}
|
|
14
|
+
free() {
|
|
15
|
+
const ptr = this.__destroy_into_raw();
|
|
16
|
+
wasm.__wbg_layoutdocument_free(ptr, 0);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @param {Uint8Array} bytes
|
|
20
|
+
*/
|
|
21
|
+
addBlobs(bytes) {
|
|
22
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
23
|
+
const len0 = WASM_VECTOR_LEN;
|
|
24
|
+
const ret = wasm.layoutdocument_addBlobs(this.__wbg_ptr, ptr0, len0);
|
|
25
|
+
if (ret[1]) {
|
|
26
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @returns {number | undefined}
|
|
31
|
+
*/
|
|
32
|
+
authorSchemaVersion() {
|
|
33
|
+
const ret = wasm.layoutdocument_authorSchemaVersion(this.__wbg_ptr);
|
|
34
|
+
return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The blobs newly needed since `since` (empty bytes: everything the state references).
|
|
38
|
+
* @param {Uint8Array} since
|
|
39
|
+
* @returns {Uint8Array}
|
|
40
|
+
*/
|
|
41
|
+
blobsSince(since) {
|
|
42
|
+
const ptr0 = passArray8ToWasm0(since, wasm.__wbindgen_malloc);
|
|
43
|
+
const len0 = WASM_VECTOR_LEN;
|
|
44
|
+
const ret = wasm.layoutdocument_blobsSince(this.__wbg_ptr, ptr0, len0);
|
|
45
|
+
if (ret[3]) {
|
|
46
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
47
|
+
}
|
|
48
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
49
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
50
|
+
return v2;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Every blob the replica holds, for a peer's `addBlobs`.
|
|
54
|
+
* @returns {Uint8Array}
|
|
55
|
+
*/
|
|
56
|
+
blobs() {
|
|
57
|
+
const ret = wasm.layoutdocument_blobs(this.__wbg_ptr);
|
|
58
|
+
if (ret[3]) {
|
|
59
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
60
|
+
}
|
|
61
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
62
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
63
|
+
return v1;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
canRedo() {
|
|
69
|
+
const ret = wasm.layoutdocument_canRedo(this.__wbg_ptr);
|
|
70
|
+
return ret !== 0;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @returns {boolean}
|
|
74
|
+
*/
|
|
75
|
+
canUndo() {
|
|
76
|
+
const ret = wasm.layoutdocument_canUndo(this.__wbg_ptr);
|
|
77
|
+
return ret !== 0;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* `{ "diagnostics": [...] }` as JSON (standard 2.0 A21).
|
|
81
|
+
* @returns {string}
|
|
82
|
+
*/
|
|
83
|
+
check() {
|
|
84
|
+
let deferred1_0;
|
|
85
|
+
let deferred1_1;
|
|
86
|
+
try {
|
|
87
|
+
const ret = wasm.layoutdocument_check(this.__wbg_ptr);
|
|
88
|
+
deferred1_0 = ret[0];
|
|
89
|
+
deferred1_1 = ret[1];
|
|
90
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
91
|
+
} finally {
|
|
92
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @returns {string}
|
|
97
|
+
*/
|
|
98
|
+
commands() {
|
|
99
|
+
let deferred1_0;
|
|
100
|
+
let deferred1_1;
|
|
101
|
+
try {
|
|
102
|
+
const ret = wasm.layoutdocument_commands(this.__wbg_ptr);
|
|
103
|
+
deferred1_0 = ret[0];
|
|
104
|
+
deferred1_1 = ret[1];
|
|
105
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
106
|
+
} finally {
|
|
107
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @returns {number}
|
|
112
|
+
*/
|
|
113
|
+
static contractVersion() {
|
|
114
|
+
const ret = wasm.layoutdocument_contractVersion();
|
|
115
|
+
return ret >>> 0;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @param {string} name
|
|
119
|
+
* @param {number} width
|
|
120
|
+
* @param {number} height
|
|
121
|
+
* @returns {LayoutDocument}
|
|
122
|
+
*/
|
|
123
|
+
static create(name, width, height) {
|
|
124
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
const ret = wasm.layoutdocument_create(ptr0, len0, width, height);
|
|
127
|
+
if (ret[2]) {
|
|
128
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
129
|
+
}
|
|
130
|
+
return LayoutDocument.__wrap(ret[0]);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @returns {boolean}
|
|
134
|
+
*/
|
|
135
|
+
get dirty() {
|
|
136
|
+
const ret = wasm.layoutdocument_dirty(this.__wbg_ptr);
|
|
137
|
+
return ret !== 0;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The ids of the commands that cannot run now, as a JSON array.
|
|
141
|
+
* @returns {string}
|
|
142
|
+
*/
|
|
143
|
+
disabledCommands() {
|
|
144
|
+
let deferred1_0;
|
|
145
|
+
let deferred1_1;
|
|
146
|
+
try {
|
|
147
|
+
const ret = wasm.layoutdocument_disabledCommands(this.__wbg_ptr);
|
|
148
|
+
deferred1_0 = ret[0];
|
|
149
|
+
deferred1_1 = ret[1];
|
|
150
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
151
|
+
} finally {
|
|
152
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The replica's own document id, for the Kit UI protocol's `replica/info`.
|
|
157
|
+
* @returns {string | undefined}
|
|
158
|
+
*/
|
|
159
|
+
get docId() {
|
|
160
|
+
const ret = wasm.layoutdocument_docId(this.__wbg_ptr);
|
|
161
|
+
let v1;
|
|
162
|
+
if (ret[0] !== 0) {
|
|
163
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
164
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
165
|
+
}
|
|
166
|
+
return v1;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* The editor state that is not the document, as JSON (`KitDocument::editor_state`):
|
|
170
|
+
* an editor puts the person's aside while an agent's step runs in the agent's own.
|
|
171
|
+
* @returns {string}
|
|
172
|
+
*/
|
|
173
|
+
editorState() {
|
|
174
|
+
let deferred1_0;
|
|
175
|
+
let deferred1_1;
|
|
176
|
+
try {
|
|
177
|
+
const ret = wasm.layoutdocument_editorState(this.__wbg_ptr);
|
|
178
|
+
deferred1_0 = ret[0];
|
|
179
|
+
deferred1_1 = ret[1];
|
|
180
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
181
|
+
} finally {
|
|
182
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* `origin` is the KDM's commit form, the JSON array `[kind, principal, label]`.
|
|
187
|
+
* @param {string} command
|
|
188
|
+
* @param {string} params
|
|
189
|
+
* @param {string} origin
|
|
190
|
+
* @returns {string}
|
|
191
|
+
*/
|
|
192
|
+
executeAs(command, params, origin) {
|
|
193
|
+
let deferred5_0;
|
|
194
|
+
let deferred5_1;
|
|
195
|
+
try {
|
|
196
|
+
const ptr0 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
197
|
+
const len0 = WASM_VECTOR_LEN;
|
|
198
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
199
|
+
const len1 = WASM_VECTOR_LEN;
|
|
200
|
+
const ptr2 = passStringToWasm0(origin, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
201
|
+
const len2 = WASM_VECTOR_LEN;
|
|
202
|
+
const ret = wasm.layoutdocument_executeAs(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
203
|
+
var ptr4 = ret[0];
|
|
204
|
+
var len4 = ret[1];
|
|
205
|
+
if (ret[3]) {
|
|
206
|
+
ptr4 = 0; len4 = 0;
|
|
207
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
208
|
+
}
|
|
209
|
+
deferred5_0 = ptr4;
|
|
210
|
+
deferred5_1 = len4;
|
|
211
|
+
return getStringFromWasm0(ptr4, len4);
|
|
212
|
+
} finally {
|
|
213
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* @param {string} command
|
|
218
|
+
* @param {string} params
|
|
219
|
+
* @returns {string}
|
|
220
|
+
*/
|
|
221
|
+
execute(command, params) {
|
|
222
|
+
let deferred4_0;
|
|
223
|
+
let deferred4_1;
|
|
224
|
+
try {
|
|
225
|
+
const ptr0 = passStringToWasm0(command, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
226
|
+
const len0 = WASM_VECTOR_LEN;
|
|
227
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
228
|
+
const len1 = WASM_VECTOR_LEN;
|
|
229
|
+
const ret = wasm.layoutdocument_execute(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
230
|
+
var ptr3 = ret[0];
|
|
231
|
+
var len3 = ret[1];
|
|
232
|
+
if (ret[3]) {
|
|
233
|
+
ptr3 = 0; len3 = 0;
|
|
234
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
235
|
+
}
|
|
236
|
+
deferred4_0 = ptr3;
|
|
237
|
+
deferred4_1 = len3;
|
|
238
|
+
return getStringFromWasm0(ptr3, len3);
|
|
239
|
+
} finally {
|
|
240
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* @param {Uint8Array} since
|
|
245
|
+
* @returns {Uint8Array}
|
|
246
|
+
*/
|
|
247
|
+
exportChanges(since) {
|
|
248
|
+
const ptr0 = passArray8ToWasm0(since, wasm.__wbindgen_malloc);
|
|
249
|
+
const len0 = WASM_VECTOR_LEN;
|
|
250
|
+
const ret = wasm.layoutdocument_exportChanges(this.__wbg_ptr, ptr0, len0);
|
|
251
|
+
if (ret[3]) {
|
|
252
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
253
|
+
}
|
|
254
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
255
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
256
|
+
return v2;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* @returns {LayoutDocument}
|
|
260
|
+
*/
|
|
261
|
+
forkForPremises() {
|
|
262
|
+
const ret = wasm.layoutdocument_forkForPremises(this.__wbg_ptr);
|
|
263
|
+
if (ret[2]) {
|
|
264
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
265
|
+
}
|
|
266
|
+
return LayoutDocument.__wrap(ret[0]);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @returns {boolean}
|
|
270
|
+
*/
|
|
271
|
+
get hasReplica() {
|
|
272
|
+
const ret = wasm.layoutdocument_hasReplica(this.__wbg_ptr);
|
|
273
|
+
return ret !== 0;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @returns {number}
|
|
277
|
+
*/
|
|
278
|
+
get height() {
|
|
279
|
+
const ret = wasm.layoutdocument_height(this.__wbg_ptr);
|
|
280
|
+
return ret >>> 0;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* @param {Uint8Array} bytes
|
|
284
|
+
* @returns {string}
|
|
285
|
+
*/
|
|
286
|
+
importChanges(bytes) {
|
|
287
|
+
let deferred3_0;
|
|
288
|
+
let deferred3_1;
|
|
289
|
+
try {
|
|
290
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
291
|
+
const len0 = WASM_VECTOR_LEN;
|
|
292
|
+
const ret = wasm.layoutdocument_importChanges(this.__wbg_ptr, ptr0, len0);
|
|
293
|
+
var ptr2 = ret[0];
|
|
294
|
+
var len2 = ret[1];
|
|
295
|
+
if (ret[3]) {
|
|
296
|
+
ptr2 = 0; len2 = 0;
|
|
297
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
298
|
+
}
|
|
299
|
+
deferred3_0 = ptr2;
|
|
300
|
+
deferred3_1 = len2;
|
|
301
|
+
return getStringFromWasm0(ptr2, len2);
|
|
302
|
+
} finally {
|
|
303
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* @returns {string}
|
|
308
|
+
*/
|
|
309
|
+
inspect() {
|
|
310
|
+
let deferred2_0;
|
|
311
|
+
let deferred2_1;
|
|
312
|
+
try {
|
|
313
|
+
const ret = wasm.layoutdocument_inspect(this.__wbg_ptr);
|
|
314
|
+
var ptr1 = ret[0];
|
|
315
|
+
var len1 = ret[1];
|
|
316
|
+
if (ret[3]) {
|
|
317
|
+
ptr1 = 0; len1 = 0;
|
|
318
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
319
|
+
}
|
|
320
|
+
deferred2_0 = ptr1;
|
|
321
|
+
deferred2_1 = len1;
|
|
322
|
+
return getStringFromWasm0(ptr1, len1);
|
|
323
|
+
} finally {
|
|
324
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* @returns {number}
|
|
329
|
+
*/
|
|
330
|
+
kdmResets() {
|
|
331
|
+
const ret = wasm.layoutdocument_kdmResets(this.__wbg_ptr);
|
|
332
|
+
return ret >>> 0;
|
|
333
|
+
}
|
|
334
|
+
markSaved() {
|
|
335
|
+
wasm.layoutdocument_markSaved(this.__wbg_ptr);
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Opens a file with the replica a host stored for it; a `.klayout` file's own replica
|
|
339
|
+
* wins, and empty `bytes` open the replica alone.
|
|
340
|
+
* @param {string} name
|
|
341
|
+
* @param {Uint8Array} bytes
|
|
342
|
+
* @param {Uint8Array} snapshot
|
|
343
|
+
* @param {Uint8Array} blobs
|
|
344
|
+
* @returns {LayoutDocument}
|
|
345
|
+
*/
|
|
346
|
+
static openWithReplica(name, bytes, snapshot, blobs) {
|
|
347
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
348
|
+
const len0 = WASM_VECTOR_LEN;
|
|
349
|
+
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
350
|
+
const len1 = WASM_VECTOR_LEN;
|
|
351
|
+
const ptr2 = passArray8ToWasm0(snapshot, wasm.__wbindgen_malloc);
|
|
352
|
+
const len2 = WASM_VECTOR_LEN;
|
|
353
|
+
const ptr3 = passArray8ToWasm0(blobs, wasm.__wbindgen_malloc);
|
|
354
|
+
const len3 = WASM_VECTOR_LEN;
|
|
355
|
+
const ret = wasm.layoutdocument_openWithReplica(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
356
|
+
if (ret[2]) {
|
|
357
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
358
|
+
}
|
|
359
|
+
return LayoutDocument.__wrap(ret[0]);
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* @param {string} name
|
|
363
|
+
* @param {Uint8Array} bytes
|
|
364
|
+
* @returns {LayoutDocument}
|
|
365
|
+
*/
|
|
366
|
+
static open(name, bytes) {
|
|
367
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
368
|
+
const len0 = WASM_VECTOR_LEN;
|
|
369
|
+
const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
370
|
+
const len1 = WASM_VECTOR_LEN;
|
|
371
|
+
const ret = wasm.layoutdocument_open(ptr0, len0, ptr1, len1);
|
|
372
|
+
if (ret[2]) {
|
|
373
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
374
|
+
}
|
|
375
|
+
return LayoutDocument.__wrap(ret[0]);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* @returns {number}
|
|
379
|
+
*/
|
|
380
|
+
get pinnedLeft() {
|
|
381
|
+
const ret = wasm.layoutdocument_pinnedLeft(this.__wbg_ptr);
|
|
382
|
+
return ret >>> 0;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* @returns {number}
|
|
386
|
+
*/
|
|
387
|
+
get pinnedTop() {
|
|
388
|
+
const ret = wasm.layoutdocument_pinnedTop(this.__wbg_ptr);
|
|
389
|
+
return ret >>> 0;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* @param {string} event
|
|
393
|
+
* @returns {string}
|
|
394
|
+
*/
|
|
395
|
+
pointer(event) {
|
|
396
|
+
let deferred3_0;
|
|
397
|
+
let deferred3_1;
|
|
398
|
+
try {
|
|
399
|
+
const ptr0 = passStringToWasm0(event, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
400
|
+
const len0 = WASM_VECTOR_LEN;
|
|
401
|
+
const ret = wasm.layoutdocument_pointer(this.__wbg_ptr, ptr0, len0);
|
|
402
|
+
var ptr2 = ret[0];
|
|
403
|
+
var len2 = ret[1];
|
|
404
|
+
if (ret[3]) {
|
|
405
|
+
ptr2 = 0; len2 = 0;
|
|
406
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
407
|
+
}
|
|
408
|
+
deferred3_0 = ptr2;
|
|
409
|
+
deferred3_1 = len2;
|
|
410
|
+
return getStringFromWasm0(ptr2, len2);
|
|
411
|
+
} finally {
|
|
412
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* @param {string} method
|
|
417
|
+
* @param {string} params
|
|
418
|
+
* @returns {string}
|
|
419
|
+
*/
|
|
420
|
+
premiseRead(method, params) {
|
|
421
|
+
let deferred4_0;
|
|
422
|
+
let deferred4_1;
|
|
423
|
+
try {
|
|
424
|
+
const ptr0 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
425
|
+
const len0 = WASM_VECTOR_LEN;
|
|
426
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
427
|
+
const len1 = WASM_VECTOR_LEN;
|
|
428
|
+
const ret = wasm.layoutdocument_premiseRead(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
429
|
+
var ptr3 = ret[0];
|
|
430
|
+
var len3 = ret[1];
|
|
431
|
+
if (ret[3]) {
|
|
432
|
+
ptr3 = 0; len3 = 0;
|
|
433
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
434
|
+
}
|
|
435
|
+
deferred4_0 = ptr3;
|
|
436
|
+
deferred4_1 = len3;
|
|
437
|
+
return getStringFromWasm0(ptr3, len3);
|
|
438
|
+
} finally {
|
|
439
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @returns {string}
|
|
444
|
+
*/
|
|
445
|
+
redo() {
|
|
446
|
+
let deferred2_0;
|
|
447
|
+
let deferred2_1;
|
|
448
|
+
try {
|
|
449
|
+
const ret = wasm.layoutdocument_redo(this.__wbg_ptr);
|
|
450
|
+
var ptr1 = ret[0];
|
|
451
|
+
var len1 = ret[1];
|
|
452
|
+
if (ret[3]) {
|
|
453
|
+
ptr1 = 0; len1 = 0;
|
|
454
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
455
|
+
}
|
|
456
|
+
deferred2_0 = ptr1;
|
|
457
|
+
deferred2_1 = len1;
|
|
458
|
+
return getStringFromWasm0(ptr1, len1);
|
|
459
|
+
} finally {
|
|
460
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* @param {number} x0
|
|
465
|
+
* @param {number} y0
|
|
466
|
+
* @param {number} x1
|
|
467
|
+
* @param {number} y1
|
|
468
|
+
* @param {number} width
|
|
469
|
+
* @param {number} height
|
|
470
|
+
* @returns {Uint8Array}
|
|
471
|
+
*/
|
|
472
|
+
renderArea(x0, y0, x1, y1, width, height) {
|
|
473
|
+
const ret = wasm.layoutdocument_renderArea(this.__wbg_ptr, x0, y0, x1, y1, width, height);
|
|
474
|
+
if (ret[3]) {
|
|
475
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
476
|
+
}
|
|
477
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
478
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
479
|
+
return v1;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* @param {number} x
|
|
483
|
+
* @param {number} y
|
|
484
|
+
* @param {number} scale
|
|
485
|
+
* @param {number} width
|
|
486
|
+
* @param {number} height
|
|
487
|
+
* @returns {Uint8Array}
|
|
488
|
+
*/
|
|
489
|
+
render(x, y, scale, width, height) {
|
|
490
|
+
const ret = wasm.layoutdocument_render(this.__wbg_ptr, x, y, scale, width, height);
|
|
491
|
+
if (ret[3]) {
|
|
492
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
493
|
+
}
|
|
494
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
495
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
496
|
+
return v1;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Puts back what `editorState()` answered (`KitDocument::restore_editor_state`).
|
|
500
|
+
* @param {string} state
|
|
501
|
+
*/
|
|
502
|
+
restoreEditorState(state) {
|
|
503
|
+
const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
504
|
+
const len0 = WASM_VECTOR_LEN;
|
|
505
|
+
const ret = wasm.layoutdocument_restoreEditorState(this.__wbg_ptr, ptr0, len0);
|
|
506
|
+
if (ret[1]) {
|
|
507
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* @returns {bigint}
|
|
512
|
+
*/
|
|
513
|
+
get revision() {
|
|
514
|
+
const ret = wasm.layoutdocument_revision(this.__wbg_ptr);
|
|
515
|
+
return BigInt.asUintN(64, ret);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* @param {string | null} [name]
|
|
519
|
+
* @returns {Uint8Array}
|
|
520
|
+
*/
|
|
521
|
+
save(name) {
|
|
522
|
+
var ptr0 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
523
|
+
var len0 = WASM_VECTOR_LEN;
|
|
524
|
+
const ret = wasm.layoutdocument_save(this.__wbg_ptr, ptr0, len0);
|
|
525
|
+
if (ret[3]) {
|
|
526
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
527
|
+
}
|
|
528
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
529
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
530
|
+
return v2;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* @returns {number}
|
|
534
|
+
*/
|
|
535
|
+
schemaVersion() {
|
|
536
|
+
const ret = wasm.layoutdocument_schemaVersion(this.__wbg_ptr);
|
|
537
|
+
return ret >>> 0;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* @param {string} id
|
|
541
|
+
* @param {number} zoom
|
|
542
|
+
* @returns {string}
|
|
543
|
+
*/
|
|
544
|
+
selectTool(id, zoom) {
|
|
545
|
+
let deferred3_0;
|
|
546
|
+
let deferred3_1;
|
|
547
|
+
try {
|
|
548
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
549
|
+
const len0 = WASM_VECTOR_LEN;
|
|
550
|
+
const ret = wasm.layoutdocument_selectTool(this.__wbg_ptr, ptr0, len0, zoom);
|
|
551
|
+
var ptr2 = ret[0];
|
|
552
|
+
var len2 = ret[1];
|
|
553
|
+
if (ret[3]) {
|
|
554
|
+
ptr2 = 0; len2 = 0;
|
|
555
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
556
|
+
}
|
|
557
|
+
deferred3_0 = ptr2;
|
|
558
|
+
deferred3_1 = len2;
|
|
559
|
+
return getStringFromWasm0(ptr2, len2);
|
|
560
|
+
} finally {
|
|
561
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* The canvas around the spreads in `#rrggbb` (the editor's canvas color).
|
|
566
|
+
* @param {string} color
|
|
567
|
+
*/
|
|
568
|
+
setBackdrop(color) {
|
|
569
|
+
const ptr0 = passStringToWasm0(color, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
570
|
+
const len0 = WASM_VECTOR_LEN;
|
|
571
|
+
const ret = wasm.layoutdocument_setBackdrop(this.__wbg_ptr, ptr0, len0);
|
|
572
|
+
if (ret[1]) {
|
|
573
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Sets the editor state one command reads from a call context `{on?, part?, time?}` as
|
|
578
|
+
* JSON (`KitDocument::set_context`).
|
|
579
|
+
* @param {string} context
|
|
580
|
+
*/
|
|
581
|
+
setContext(context) {
|
|
582
|
+
const ptr0 = passStringToWasm0(context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
583
|
+
const len0 = WASM_VECTOR_LEN;
|
|
584
|
+
const ret = wasm.layoutdocument_setContext(this.__wbg_ptr, ptr0, len0);
|
|
585
|
+
if (ret[1]) {
|
|
586
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* @returns {Uint8Array}
|
|
591
|
+
*/
|
|
592
|
+
snapshot() {
|
|
593
|
+
const ret = wasm.layoutdocument_snapshot(this.__wbg_ptr);
|
|
594
|
+
if (ret[3]) {
|
|
595
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
596
|
+
}
|
|
597
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
598
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
599
|
+
return v1;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* The next chunk of output `id`, at most `max` bytes (engine contract E16).
|
|
603
|
+
* @param {string} id
|
|
604
|
+
* @param {number | null} [max]
|
|
605
|
+
* @returns {Uint8Array}
|
|
606
|
+
*/
|
|
607
|
+
takeOutput(id, max) {
|
|
608
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
609
|
+
const len0 = WASM_VECTOR_LEN;
|
|
610
|
+
const ret = wasm.layoutdocument_takeOutput(this.__wbg_ptr, ptr0, len0, isLikeNone(max) ? Number.MAX_SAFE_INTEGER : (max) >>> 0);
|
|
611
|
+
if (ret[3]) {
|
|
612
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
613
|
+
}
|
|
614
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
615
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
616
|
+
return v2;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* @param {string} key
|
|
620
|
+
* @param {string} mods_json
|
|
621
|
+
* @param {number} zoom
|
|
622
|
+
* @returns {string}
|
|
623
|
+
*/
|
|
624
|
+
toolKey(key, mods_json, zoom) {
|
|
625
|
+
let deferred4_0;
|
|
626
|
+
let deferred4_1;
|
|
627
|
+
try {
|
|
628
|
+
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
629
|
+
const len0 = WASM_VECTOR_LEN;
|
|
630
|
+
const ptr1 = passStringToWasm0(mods_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
|
+
const len1 = WASM_VECTOR_LEN;
|
|
632
|
+
const ret = wasm.layoutdocument_toolKey(this.__wbg_ptr, ptr0, len0, ptr1, len1, zoom);
|
|
633
|
+
var ptr3 = ret[0];
|
|
634
|
+
var len3 = ret[1];
|
|
635
|
+
if (ret[3]) {
|
|
636
|
+
ptr3 = 0; len3 = 0;
|
|
637
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
638
|
+
}
|
|
639
|
+
deferred4_0 = ptr3;
|
|
640
|
+
deferred4_1 = len3;
|
|
641
|
+
return getStringFromWasm0(ptr3, len3);
|
|
642
|
+
} finally {
|
|
643
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* @param {number} x
|
|
648
|
+
* @param {number} y
|
|
649
|
+
* @param {string} mods_json
|
|
650
|
+
* @param {number} zoom
|
|
651
|
+
* @returns {string}
|
|
652
|
+
*/
|
|
653
|
+
toolState(x, y, mods_json, zoom) {
|
|
654
|
+
let deferred2_0;
|
|
655
|
+
let deferred2_1;
|
|
656
|
+
try {
|
|
657
|
+
const ptr0 = passStringToWasm0(mods_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
658
|
+
const len0 = WASM_VECTOR_LEN;
|
|
659
|
+
const ret = wasm.layoutdocument_toolState(this.__wbg_ptr, x, y, ptr0, len0, zoom);
|
|
660
|
+
deferred2_0 = ret[0];
|
|
661
|
+
deferred2_1 = ret[1];
|
|
662
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
663
|
+
} finally {
|
|
664
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* @param {string} text
|
|
669
|
+
* @param {number} zoom
|
|
670
|
+
* @returns {string}
|
|
671
|
+
*/
|
|
672
|
+
toolText(text, zoom) {
|
|
673
|
+
let deferred3_0;
|
|
674
|
+
let deferred3_1;
|
|
675
|
+
try {
|
|
676
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
677
|
+
const len0 = WASM_VECTOR_LEN;
|
|
678
|
+
const ret = wasm.layoutdocument_toolText(this.__wbg_ptr, ptr0, len0, zoom);
|
|
679
|
+
var ptr2 = ret[0];
|
|
680
|
+
var len2 = ret[1];
|
|
681
|
+
if (ret[3]) {
|
|
682
|
+
ptr2 = 0; len2 = 0;
|
|
683
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
684
|
+
}
|
|
685
|
+
deferred3_0 = ptr2;
|
|
686
|
+
deferred3_1 = len2;
|
|
687
|
+
return getStringFromWasm0(ptr2, len2);
|
|
688
|
+
} finally {
|
|
689
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* @returns {string}
|
|
694
|
+
*/
|
|
695
|
+
tool() {
|
|
696
|
+
let deferred1_0;
|
|
697
|
+
let deferred1_1;
|
|
698
|
+
try {
|
|
699
|
+
const ret = wasm.layoutdocument_tool(this.__wbg_ptr);
|
|
700
|
+
deferred1_0 = ret[0];
|
|
701
|
+
deferred1_1 = ret[1];
|
|
702
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
703
|
+
} finally {
|
|
704
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* @returns {string}
|
|
709
|
+
*/
|
|
710
|
+
tools() {
|
|
711
|
+
let deferred1_0;
|
|
712
|
+
let deferred1_1;
|
|
713
|
+
try {
|
|
714
|
+
const ret = wasm.layoutdocument_tools(this.__wbg_ptr);
|
|
715
|
+
deferred1_0 = ret[0];
|
|
716
|
+
deferred1_1 = ret[1];
|
|
717
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
718
|
+
} finally {
|
|
719
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* @returns {string}
|
|
724
|
+
*/
|
|
725
|
+
undo() {
|
|
726
|
+
let deferred2_0;
|
|
727
|
+
let deferred2_1;
|
|
728
|
+
try {
|
|
729
|
+
const ret = wasm.layoutdocument_undo(this.__wbg_ptr);
|
|
730
|
+
var ptr1 = ret[0];
|
|
731
|
+
var len1 = ret[1];
|
|
732
|
+
if (ret[3]) {
|
|
733
|
+
ptr1 = 0; len1 = 0;
|
|
734
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
735
|
+
}
|
|
736
|
+
deferred2_0 = ptr1;
|
|
737
|
+
deferred2_1 = len1;
|
|
738
|
+
return getStringFromWasm0(ptr1, len1);
|
|
739
|
+
} finally {
|
|
740
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* @returns {Uint8Array}
|
|
745
|
+
*/
|
|
746
|
+
version() {
|
|
747
|
+
const ret = wasm.layoutdocument_version(this.__wbg_ptr);
|
|
748
|
+
if (ret[3]) {
|
|
749
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
750
|
+
}
|
|
751
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
752
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
753
|
+
return v1;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* @returns {number}
|
|
757
|
+
*/
|
|
758
|
+
get width() {
|
|
759
|
+
const ret = wasm.layoutdocument_width(this.__wbg_ptr);
|
|
760
|
+
return ret >>> 0;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
if (Symbol.dispose) LayoutDocument.prototype[Symbol.dispose] = LayoutDocument.prototype.free;
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Adds a font file's faces for text the embedded faces do not cover; returns how many.
|
|
767
|
+
* @param {Uint8Array} bytes
|
|
768
|
+
* @returns {number}
|
|
769
|
+
*/
|
|
770
|
+
export function addFont(bytes) {
|
|
771
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
772
|
+
const len0 = WASM_VECTOR_LEN;
|
|
773
|
+
const ret = wasm.addFont(ptr0, len0);
|
|
774
|
+
return ret >>> 0;
|
|
775
|
+
}
|
|
776
|
+
function __wbg_get_imports() {
|
|
777
|
+
const import0 = {
|
|
778
|
+
__proto__: null,
|
|
779
|
+
__wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
|
|
780
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
781
|
+
return ret;
|
|
782
|
+
},
|
|
783
|
+
__wbg___wbindgen_is_function_1f9d30630b8b1d3d: function(arg0) {
|
|
784
|
+
const ret = typeof(arg0) === 'function';
|
|
785
|
+
return ret;
|
|
786
|
+
},
|
|
787
|
+
__wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
|
|
788
|
+
const val = arg0;
|
|
789
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
790
|
+
return ret;
|
|
791
|
+
},
|
|
792
|
+
__wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
|
|
793
|
+
const ret = typeof(arg0) === 'string';
|
|
794
|
+
return ret;
|
|
795
|
+
},
|
|
796
|
+
__wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
|
|
797
|
+
const ret = arg0 === undefined;
|
|
798
|
+
return ret;
|
|
799
|
+
},
|
|
800
|
+
__wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
|
|
801
|
+
const obj = arg1;
|
|
802
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
803
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
804
|
+
var len1 = WASM_VECTOR_LEN;
|
|
805
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
806
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
807
|
+
},
|
|
808
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
809
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
810
|
+
},
|
|
811
|
+
__wbg_call_187d372bd5fdd4aa: function() { return handleError(function (arg0, arg1, arg2) {
|
|
812
|
+
const ret = arg0.call(arg1, arg2);
|
|
813
|
+
return ret;
|
|
814
|
+
}, arguments); },
|
|
815
|
+
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
816
|
+
const ret = arg0.crypto;
|
|
817
|
+
return ret;
|
|
818
|
+
},
|
|
819
|
+
__wbg_getRandomValues_973dabfb0ad1769f: function() { return handleError(function (arg0, arg1) {
|
|
820
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
821
|
+
}, arguments); },
|
|
822
|
+
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
823
|
+
arg0.getRandomValues(arg1);
|
|
824
|
+
}, arguments); },
|
|
825
|
+
__wbg_length_7f3c00c40364105e: function(arg0) {
|
|
826
|
+
const ret = arg0.length;
|
|
827
|
+
return ret;
|
|
828
|
+
},
|
|
829
|
+
__wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
|
|
830
|
+
const ret = arg0.msCrypto;
|
|
831
|
+
return ret;
|
|
832
|
+
},
|
|
833
|
+
__wbg_new_with_length_3da0ad195f6f63ba: function(arg0) {
|
|
834
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
835
|
+
return ret;
|
|
836
|
+
},
|
|
837
|
+
__wbg_node_84ea875411254db1: function(arg0) {
|
|
838
|
+
const ret = arg0.node;
|
|
839
|
+
return ret;
|
|
840
|
+
},
|
|
841
|
+
__wbg_now_08b1211f5e7581ea: function() {
|
|
842
|
+
const ret = Date.now();
|
|
843
|
+
return ret;
|
|
844
|
+
},
|
|
845
|
+
__wbg_now_e1044392fce0f3e7: function() { return handleError(function () {
|
|
846
|
+
const ret = Date.now();
|
|
847
|
+
return ret;
|
|
848
|
+
}, arguments); },
|
|
849
|
+
__wbg_process_44c7a14e11e9f69e: function(arg0) {
|
|
850
|
+
const ret = arg0.process;
|
|
851
|
+
return ret;
|
|
852
|
+
},
|
|
853
|
+
__wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
|
|
854
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
855
|
+
},
|
|
856
|
+
__wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {
|
|
857
|
+
arg0.randomFillSync(arg1);
|
|
858
|
+
}, arguments); },
|
|
859
|
+
__wbg_readRange_328178911d9b2600: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
860
|
+
const ret = kitionHost.readRange(getStringFromWasm0(arg1, arg2), arg3, arg4 >>> 0);
|
|
861
|
+
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
862
|
+
const len1 = WASM_VECTOR_LEN;
|
|
863
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
864
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
865
|
+
}, arguments); },
|
|
866
|
+
__wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {
|
|
867
|
+
const ret = module.require;
|
|
868
|
+
return ret;
|
|
869
|
+
}, arguments); },
|
|
870
|
+
__wbg_size_57ad508d94b5ed12: function() { return handleError(function (arg0, arg1) {
|
|
871
|
+
const ret = kitionHost.size(getStringFromWasm0(arg0, arg1));
|
|
872
|
+
return ret;
|
|
873
|
+
}, arguments); },
|
|
874
|
+
__wbg_static_accessor_GLOBAL_266715b9d96ba635: function() {
|
|
875
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
876
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
877
|
+
},
|
|
878
|
+
__wbg_static_accessor_GLOBAL_THIS_10fb7dc1ae063179: function() {
|
|
879
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
880
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
881
|
+
},
|
|
882
|
+
__wbg_static_accessor_SELF_0b583911f537483a: function() {
|
|
883
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
884
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
885
|
+
},
|
|
886
|
+
__wbg_static_accessor_WINDOW_d7f903d1508cbdc4: function() {
|
|
887
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
888
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
889
|
+
},
|
|
890
|
+
__wbg_subarray_002b94d5e13d1411: function(arg0, arg1, arg2) {
|
|
891
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
892
|
+
return ret;
|
|
893
|
+
},
|
|
894
|
+
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
895
|
+
const ret = arg0.versions;
|
|
896
|
+
return ret;
|
|
897
|
+
},
|
|
898
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
899
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
900
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
901
|
+
return ret;
|
|
902
|
+
},
|
|
903
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
904
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
905
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
906
|
+
return ret;
|
|
907
|
+
},
|
|
908
|
+
__wbindgen_init_externref_table: function() {
|
|
909
|
+
const table = wasm.__wbindgen_externrefs;
|
|
910
|
+
const offset = table.grow(4);
|
|
911
|
+
table.set(0, undefined);
|
|
912
|
+
table.set(offset + 0, undefined);
|
|
913
|
+
table.set(offset + 1, null);
|
|
914
|
+
table.set(offset + 2, true);
|
|
915
|
+
table.set(offset + 3, false);
|
|
916
|
+
},
|
|
917
|
+
};
|
|
918
|
+
return {
|
|
919
|
+
__proto__: null,
|
|
920
|
+
"./kition_layout_kit_bg.js": import0,
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
const LayoutDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
925
|
+
? { register: () => {}, unregister: () => {} }
|
|
926
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_layoutdocument_free(ptr, 1));
|
|
927
|
+
|
|
928
|
+
function addToExternrefTable0(obj) {
|
|
929
|
+
const idx = wasm.__externref_table_alloc();
|
|
930
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
931
|
+
return idx;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
935
|
+
ptr = ptr >>> 0;
|
|
936
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
let cachedDataViewMemory0 = null;
|
|
940
|
+
function getDataViewMemory0() {
|
|
941
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
942
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
943
|
+
}
|
|
944
|
+
return cachedDataViewMemory0;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
function getStringFromWasm0(ptr, len) {
|
|
948
|
+
return decodeText(ptr >>> 0, len);
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
let cachedUint8ArrayMemory0 = null;
|
|
952
|
+
function getUint8ArrayMemory0() {
|
|
953
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
954
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
955
|
+
}
|
|
956
|
+
return cachedUint8ArrayMemory0;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
function handleError(f, args) {
|
|
960
|
+
try {
|
|
961
|
+
return f.apply(this, args);
|
|
962
|
+
} catch (e) {
|
|
963
|
+
const idx = addToExternrefTable0(e);
|
|
964
|
+
wasm.__wbindgen_exn_store(idx);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
function isLikeNone(x) {
|
|
969
|
+
return x === undefined || x === null;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
973
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
974
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
975
|
+
WASM_VECTOR_LEN = arg.length;
|
|
976
|
+
return ptr;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
980
|
+
if (realloc === undefined) {
|
|
981
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
982
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
983
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
984
|
+
WASM_VECTOR_LEN = buf.length;
|
|
985
|
+
return ptr;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
let len = arg.length;
|
|
989
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
990
|
+
|
|
991
|
+
const mem = getUint8ArrayMemory0();
|
|
992
|
+
|
|
993
|
+
let offset = 0;
|
|
994
|
+
|
|
995
|
+
for (; offset < len; offset++) {
|
|
996
|
+
const code = arg.charCodeAt(offset);
|
|
997
|
+
if (code > 0x7F) break;
|
|
998
|
+
mem[ptr + offset] = code;
|
|
999
|
+
}
|
|
1000
|
+
if (offset !== len) {
|
|
1001
|
+
if (offset !== 0) {
|
|
1002
|
+
arg = arg.slice(offset);
|
|
1003
|
+
}
|
|
1004
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1005
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1006
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1007
|
+
|
|
1008
|
+
offset += ret.written;
|
|
1009
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
WASM_VECTOR_LEN = offset;
|
|
1013
|
+
return ptr;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
function takeFromExternrefTable0(idx) {
|
|
1017
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
1018
|
+
wasm.__externref_table_dealloc(idx);
|
|
1019
|
+
return value;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1023
|
+
cachedTextDecoder.decode();
|
|
1024
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1025
|
+
let numBytesDecoded = 0;
|
|
1026
|
+
function decodeText(ptr, len) {
|
|
1027
|
+
numBytesDecoded += len;
|
|
1028
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1029
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1030
|
+
cachedTextDecoder.decode();
|
|
1031
|
+
numBytesDecoded = len;
|
|
1032
|
+
}
|
|
1033
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1037
|
+
|
|
1038
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1039
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1040
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1041
|
+
view.set(buf);
|
|
1042
|
+
return {
|
|
1043
|
+
read: arg.length,
|
|
1044
|
+
written: buf.length
|
|
1045
|
+
};
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
let WASM_VECTOR_LEN = 0;
|
|
1050
|
+
|
|
1051
|
+
let wasmModule, wasmInstance, wasm;
|
|
1052
|
+
function __wbg_finalize_init(instance, module) {
|
|
1053
|
+
wasmInstance = instance;
|
|
1054
|
+
wasm = instance.exports;
|
|
1055
|
+
wasmModule = module;
|
|
1056
|
+
cachedDataViewMemory0 = null;
|
|
1057
|
+
cachedUint8ArrayMemory0 = null;
|
|
1058
|
+
wasm.__wbindgen_start();
|
|
1059
|
+
return wasm;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
async function __wbg_load(module, imports) {
|
|
1063
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1064
|
+
if (!module.ok) {
|
|
1065
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1069
|
+
try {
|
|
1070
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1071
|
+
} catch (e) {
|
|
1072
|
+
const validResponse = expectedResponseType(module.type);
|
|
1073
|
+
|
|
1074
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1075
|
+
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);
|
|
1076
|
+
|
|
1077
|
+
} else { throw e; }
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
const bytes = await module.arrayBuffer();
|
|
1082
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1083
|
+
} else {
|
|
1084
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1085
|
+
|
|
1086
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1087
|
+
return { instance, module };
|
|
1088
|
+
} else {
|
|
1089
|
+
return instance;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
function expectedResponseType(type) {
|
|
1094
|
+
switch (type) {
|
|
1095
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1096
|
+
}
|
|
1097
|
+
return false;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
function initSync(module) {
|
|
1102
|
+
if (wasm !== undefined) return wasm;
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
if (module !== undefined) {
|
|
1106
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1107
|
+
({module} = module)
|
|
1108
|
+
} else {
|
|
1109
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
const imports = __wbg_get_imports();
|
|
1114
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1115
|
+
module = new WebAssembly.Module(module);
|
|
1116
|
+
}
|
|
1117
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1118
|
+
return __wbg_finalize_init(instance, module);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
async function __wbg_init(module_or_path) {
|
|
1122
|
+
if (wasm !== undefined) return wasm;
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
if (module_or_path !== undefined) {
|
|
1126
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1127
|
+
({module_or_path} = module_or_path)
|
|
1128
|
+
} else {
|
|
1129
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
if (module_or_path === undefined) {
|
|
1134
|
+
module_or_path = new URL('kition_layout_kit_bg.wasm', import.meta.url);
|
|
1135
|
+
}
|
|
1136
|
+
const imports = __wbg_get_imports();
|
|
1137
|
+
|
|
1138
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1139
|
+
module_or_path = fetch(module_or_path);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1143
|
+
|
|
1144
|
+
return __wbg_finalize_init(instance, module);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
export { initSync, __wbg_init as default };
|