float-pigment-css 0.6.0 → 0.7.1
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/float_pigment_css.js +104 -62
- package/float_pigment_css_bg.wasm +0 -0
- package/package.json +1 -1
package/float_pigment_css.js
CHANGED
|
@@ -4,6 +4,12 @@ imports['__wbindgen_placeholder__'] = module.exports;
|
|
|
4
4
|
let wasm;
|
|
5
5
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
|
+
const heap = new Array(128).fill(undefined);
|
|
8
|
+
|
|
9
|
+
heap.push(undefined, null, true, false);
|
|
10
|
+
|
|
11
|
+
function getObject(idx) { return heap[idx]; }
|
|
12
|
+
|
|
7
13
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
8
14
|
|
|
9
15
|
cachedTextDecoder.decode();
|
|
@@ -22,9 +28,14 @@ function getStringFromWasm0(ptr, len) {
|
|
|
22
28
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
let heap_next = heap.length;
|
|
32
|
+
|
|
33
|
+
function addHeapObject(obj) {
|
|
34
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
35
|
+
const idx = heap_next;
|
|
36
|
+
heap_next = heap[idx];
|
|
37
|
+
|
|
38
|
+
heap[idx] = obj;
|
|
28
39
|
return idx;
|
|
29
40
|
}
|
|
30
41
|
|
|
@@ -32,8 +43,7 @@ function handleError(f, args) {
|
|
|
32
43
|
try {
|
|
33
44
|
return f.apply(this, args);
|
|
34
45
|
} catch (e) {
|
|
35
|
-
|
|
36
|
-
wasm.__wbindgen_exn_store(idx);
|
|
46
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
49
|
|
|
@@ -167,14 +177,25 @@ function debugString(val) {
|
|
|
167
177
|
return className;
|
|
168
178
|
}
|
|
169
179
|
|
|
180
|
+
function dropObject(idx) {
|
|
181
|
+
if (idx < 132) return;
|
|
182
|
+
heap[idx] = heap_next;
|
|
183
|
+
heap_next = idx;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function takeObject(idx) {
|
|
187
|
+
const ret = getObject(idx);
|
|
188
|
+
dropObject(idx);
|
|
189
|
+
return ret;
|
|
190
|
+
}
|
|
191
|
+
|
|
170
192
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
171
193
|
ptr = ptr >>> 0;
|
|
172
194
|
const mem = getDataViewMemory0();
|
|
173
195
|
const result = [];
|
|
174
196
|
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
175
|
-
result.push(
|
|
197
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
176
198
|
}
|
|
177
|
-
wasm.__externref_drop_slice(ptr, len);
|
|
178
199
|
return result;
|
|
179
200
|
}
|
|
180
201
|
|
|
@@ -201,14 +222,21 @@ module.exports.wasm_main = function() {
|
|
|
201
222
|
* @returns {Uint8Array}
|
|
202
223
|
*/
|
|
203
224
|
module.exports.compileStyleSheetToBincode = function(filename, style_text) {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
225
|
+
try {
|
|
226
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
227
|
+
const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
228
|
+
const len0 = WASM_VECTOR_LEN;
|
|
229
|
+
const ptr1 = passStringToWasm0(style_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
230
|
+
const len1 = WASM_VECTOR_LEN;
|
|
231
|
+
wasm.compileStyleSheetToBincode(retptr, ptr0, len0, ptr1, len1);
|
|
232
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
233
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
234
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
235
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
236
|
+
return v3;
|
|
237
|
+
} finally {
|
|
238
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
239
|
+
}
|
|
212
240
|
};
|
|
213
241
|
|
|
214
242
|
/**
|
|
@@ -289,17 +317,24 @@ class StyleSheetImportIndex {
|
|
|
289
317
|
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
290
318
|
const len0 = WASM_VECTOR_LEN;
|
|
291
319
|
const ret = wasm.stylesheetimportindex_queryAndMarkDependencies(this.__wbg_ptr, ptr0, len0);
|
|
292
|
-
return ret;
|
|
320
|
+
return takeObject(ret);
|
|
293
321
|
}
|
|
294
322
|
/**
|
|
295
323
|
* Serialize it to the binary format.
|
|
296
324
|
* @returns {Uint8Array}
|
|
297
325
|
*/
|
|
298
326
|
serializeBincode() {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
327
|
+
try {
|
|
328
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
329
|
+
wasm.stylesheetimportindex_serializeBincode(retptr, this.__wbg_ptr);
|
|
330
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
331
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
332
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
333
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
334
|
+
return v1;
|
|
335
|
+
} finally {
|
|
336
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
337
|
+
}
|
|
303
338
|
}
|
|
304
339
|
/**
|
|
305
340
|
* Deserialize from the binary format.
|
|
@@ -378,12 +413,19 @@ class StyleSheetResource {
|
|
|
378
413
|
* @returns {any[]}
|
|
379
414
|
*/
|
|
380
415
|
directDependencies(path) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
416
|
+
try {
|
|
417
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
418
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
419
|
+
const len0 = WASM_VECTOR_LEN;
|
|
420
|
+
wasm.stylesheetresource_directDependencies(retptr, this.__wbg_ptr, ptr0, len0);
|
|
421
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
422
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
423
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
424
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
425
|
+
return v2;
|
|
426
|
+
} finally {
|
|
427
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
428
|
+
}
|
|
387
429
|
}
|
|
388
430
|
/**
|
|
389
431
|
* Serialize the specified style sheet to the binary format.
|
|
@@ -391,15 +433,22 @@ class StyleSheetResource {
|
|
|
391
433
|
* @returns {Uint8Array | undefined}
|
|
392
434
|
*/
|
|
393
435
|
serializeBincode(path) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
436
|
+
try {
|
|
437
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
438
|
+
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
439
|
+
const len0 = WASM_VECTOR_LEN;
|
|
440
|
+
wasm.stylesheetresource_serializeBincode(retptr, this.__wbg_ptr, ptr0, len0);
|
|
441
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
442
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
443
|
+
let v2;
|
|
444
|
+
if (r0 !== 0) {
|
|
445
|
+
v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
446
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
447
|
+
}
|
|
448
|
+
return v2;
|
|
449
|
+
} finally {
|
|
450
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
401
451
|
}
|
|
402
|
-
return v2;
|
|
403
452
|
}
|
|
404
453
|
/**
|
|
405
454
|
* Add a style sheet file (for JavaScript).
|
|
@@ -413,7 +462,7 @@ class StyleSheetResource {
|
|
|
413
462
|
const ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
414
463
|
const len1 = WASM_VECTOR_LEN;
|
|
415
464
|
const ret = wasm.stylesheetresource_addSource(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
416
|
-
return ret;
|
|
465
|
+
return takeObject(ret);
|
|
417
466
|
}
|
|
418
467
|
/**
|
|
419
468
|
* Add a style sheet file in the binary format (for JavaScript).
|
|
@@ -427,13 +476,13 @@ class StyleSheetResource {
|
|
|
427
476
|
const ptr1 = passArray8ToWasm0(bincode, wasm.__wbindgen_malloc);
|
|
428
477
|
const len1 = WASM_VECTOR_LEN;
|
|
429
478
|
const ret = wasm.stylesheetresource_addBincode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
430
|
-
return ret;
|
|
479
|
+
return takeObject(ret);
|
|
431
480
|
}
|
|
432
481
|
}
|
|
433
482
|
module.exports.StyleSheetResource = StyleSheetResource;
|
|
434
483
|
|
|
435
484
|
module.exports.__wbg_debug_156ca727dbc3150f = function(arg0) {
|
|
436
|
-
console.debug(arg0);
|
|
485
|
+
console.debug(getObject(arg0));
|
|
437
486
|
};
|
|
438
487
|
|
|
439
488
|
module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
@@ -449,49 +498,49 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
|
449
498
|
};
|
|
450
499
|
|
|
451
500
|
module.exports.__wbg_error_fab41a42d22bf2bc = function(arg0) {
|
|
452
|
-
console.error(arg0);
|
|
501
|
+
console.error(getObject(arg0));
|
|
453
502
|
};
|
|
454
503
|
|
|
455
504
|
module.exports.__wbg_info_c3044c86ae29faab = function(arg0) {
|
|
456
|
-
console.info(arg0);
|
|
505
|
+
console.info(getObject(arg0));
|
|
457
506
|
};
|
|
458
507
|
|
|
459
508
|
module.exports.__wbg_log_464d1b2190ca1e04 = function(arg0) {
|
|
460
|
-
console.log(arg0);
|
|
509
|
+
console.log(getObject(arg0));
|
|
461
510
|
};
|
|
462
511
|
|
|
463
512
|
module.exports.__wbg_new_254fa9eac11932ae = function() {
|
|
464
513
|
const ret = new Array();
|
|
465
|
-
return ret;
|
|
514
|
+
return addHeapObject(ret);
|
|
466
515
|
};
|
|
467
516
|
|
|
468
517
|
module.exports.__wbg_new_688846f374351c92 = function() {
|
|
469
518
|
const ret = new Object();
|
|
470
|
-
return ret;
|
|
519
|
+
return addHeapObject(ret);
|
|
471
520
|
};
|
|
472
521
|
|
|
473
522
|
module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
474
523
|
const ret = new Error();
|
|
475
|
-
return ret;
|
|
524
|
+
return addHeapObject(ret);
|
|
476
525
|
};
|
|
477
526
|
|
|
478
527
|
module.exports.__wbg_newwithlength_759c7b9d6a7a314f = function(arg0) {
|
|
479
528
|
const ret = new Array(arg0 >>> 0);
|
|
480
|
-
return ret;
|
|
529
|
+
return addHeapObject(ret);
|
|
481
530
|
};
|
|
482
531
|
|
|
483
532
|
module.exports.__wbg_push_6edad0df4b546b2c = function(arg0, arg1) {
|
|
484
|
-
const ret = arg0.push(arg1);
|
|
533
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
485
534
|
return ret;
|
|
486
535
|
};
|
|
487
536
|
|
|
488
537
|
module.exports.__wbg_set_4e647025551483bd = function() { return handleError(function (arg0, arg1, arg2) {
|
|
489
|
-
const ret = Reflect.set(arg0, arg1, arg2);
|
|
538
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
490
539
|
return ret;
|
|
491
540
|
}, arguments) };
|
|
492
541
|
|
|
493
542
|
module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
494
|
-
const ret = arg1.stack;
|
|
543
|
+
const ret = getObject(arg1).stack;
|
|
495
544
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
496
545
|
const len1 = WASM_VECTOR_LEN;
|
|
497
546
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
@@ -499,36 +548,29 @@ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
|
499
548
|
};
|
|
500
549
|
|
|
501
550
|
module.exports.__wbg_warn_123db6aa8948382e = function(arg0) {
|
|
502
|
-
console.warn(arg0);
|
|
551
|
+
console.warn(getObject(arg0));
|
|
503
552
|
};
|
|
504
553
|
|
|
505
554
|
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
506
|
-
const ret = debugString(arg1);
|
|
555
|
+
const ret = debugString(getObject(arg1));
|
|
507
556
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
508
557
|
const len1 = WASM_VECTOR_LEN;
|
|
509
558
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
510
559
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
511
560
|
};
|
|
512
561
|
|
|
513
|
-
module.exports.__wbindgen_init_externref_table = function() {
|
|
514
|
-
const table = wasm.__wbindgen_export_3;
|
|
515
|
-
const offset = table.grow(4);
|
|
516
|
-
table.set(0, undefined);
|
|
517
|
-
table.set(offset + 0, undefined);
|
|
518
|
-
table.set(offset + 1, null);
|
|
519
|
-
table.set(offset + 2, true);
|
|
520
|
-
table.set(offset + 3, false);
|
|
521
|
-
;
|
|
522
|
-
};
|
|
523
|
-
|
|
524
562
|
module.exports.__wbindgen_number_new = function(arg0) {
|
|
525
563
|
const ret = arg0;
|
|
526
|
-
return ret;
|
|
564
|
+
return addHeapObject(ret);
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
568
|
+
takeObject(arg0);
|
|
527
569
|
};
|
|
528
570
|
|
|
529
571
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
530
572
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
531
|
-
return ret;
|
|
573
|
+
return addHeapObject(ret);
|
|
532
574
|
};
|
|
533
575
|
|
|
534
576
|
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
Binary file
|