@devup-ui/wasm 0.1.26 → 0.1.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devup-ui/wasm",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/pkg/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function importSheet(sheet_object: any): void;
4
+ export function exportSheet(): string;
5
+ export function importClassMap(sheet_object: any): void;
6
+ export function exportClassMap(): string;
3
7
  export function codeExtract(filename: string, code: string, _package: string, css_file: string): Output;
4
8
  export function registerTheme(theme_object: any): void;
5
9
  export function getCss(): string;
package/pkg/index.js CHANGED
@@ -4,34 +4,6 @@ imports['__wbindgen_placeholder__'] = module.exports;
4
4
  let wasm;
5
5
  const { TextEncoder, TextDecoder } = require(`util`);
6
6
 
7
- function addToExternrefTable0(obj) {
8
- const idx = wasm.__externref_table_alloc();
9
- wasm.__wbindgen_export_2.set(idx, obj);
10
- return idx;
11
- }
12
-
13
- function handleError(f, args) {
14
- try {
15
- return f.apply(this, args);
16
- } catch (e) {
17
- const idx = addToExternrefTable0(e);
18
- wasm.__wbindgen_exn_store(idx);
19
- }
20
- }
21
-
22
- function isLikeNone(x) {
23
- return x === undefined || x === null;
24
- }
25
-
26
- let cachedDataViewMemory0 = null;
27
-
28
- function getDataViewMemory0() {
29
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
30
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
31
- }
32
- return cachedDataViewMemory0;
33
- }
34
-
35
7
  let WASM_VECTOR_LEN = 0;
36
8
 
37
9
  let cachedUint8ArrayMemory0 = null;
@@ -97,6 +69,99 @@ function passStringToWasm0(arg, malloc, realloc) {
97
69
  return ptr;
98
70
  }
99
71
 
72
+ let cachedDataViewMemory0 = null;
73
+
74
+ function getDataViewMemory0() {
75
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
76
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
77
+ }
78
+ return cachedDataViewMemory0;
79
+ }
80
+
81
+ function addToExternrefTable0(obj) {
82
+ const idx = wasm.__externref_table_alloc();
83
+ wasm.__wbindgen_export_4.set(idx, obj);
84
+ return idx;
85
+ }
86
+
87
+ function handleError(f, args) {
88
+ try {
89
+ return f.apply(this, args);
90
+ } catch (e) {
91
+ const idx = addToExternrefTable0(e);
92
+ wasm.__wbindgen_exn_store(idx);
93
+ }
94
+ }
95
+
96
+ function isLikeNone(x) {
97
+ return x === undefined || x === null;
98
+ }
99
+
100
+ function debugString(val) {
101
+ // primitive types
102
+ const type = typeof val;
103
+ if (type == 'number' || type == 'boolean' || val == null) {
104
+ return `${val}`;
105
+ }
106
+ if (type == 'string') {
107
+ return `"${val}"`;
108
+ }
109
+ if (type == 'symbol') {
110
+ const description = val.description;
111
+ if (description == null) {
112
+ return 'Symbol';
113
+ } else {
114
+ return `Symbol(${description})`;
115
+ }
116
+ }
117
+ if (type == 'function') {
118
+ const name = val.name;
119
+ if (typeof name == 'string' && name.length > 0) {
120
+ return `Function(${name})`;
121
+ } else {
122
+ return 'Function';
123
+ }
124
+ }
125
+ // objects
126
+ if (Array.isArray(val)) {
127
+ const length = val.length;
128
+ let debug = '[';
129
+ if (length > 0) {
130
+ debug += debugString(val[0]);
131
+ }
132
+ for(let i = 1; i < length; i++) {
133
+ debug += ', ' + debugString(val[i]);
134
+ }
135
+ debug += ']';
136
+ return debug;
137
+ }
138
+ // Test for built-in
139
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
140
+ let className;
141
+ if (builtInMatches && builtInMatches.length > 1) {
142
+ className = builtInMatches[1];
143
+ } else {
144
+ // Failed to match the standard '[object ClassName]'
145
+ return toString.call(val);
146
+ }
147
+ if (className == 'Object') {
148
+ // we're a user defined class or Object
149
+ // JSON.stringify avoids problems with cycles, and is generally much
150
+ // easier than looping through ownProperties of `val`.
151
+ try {
152
+ return 'Object(' + JSON.stringify(val) + ')';
153
+ } catch (_) {
154
+ return 'Object';
155
+ }
156
+ }
157
+ // errors
158
+ if (val instanceof Error) {
159
+ return `${val.name}: ${val.message}\n${val.stack}`;
160
+ }
161
+ // TODO we could test for more things here, like `Set`s and `Map`s.
162
+ return className;
163
+ }
164
+
100
165
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
101
166
 
102
167
  cachedTextDecoder.decode();
@@ -107,10 +172,74 @@ function getStringFromWasm0(ptr, len) {
107
172
  }
108
173
 
109
174
  function takeFromExternrefTable0(idx) {
110
- const value = wasm.__wbindgen_export_2.get(idx);
175
+ const value = wasm.__wbindgen_export_4.get(idx);
111
176
  wasm.__externref_table_dealloc(idx);
112
177
  return value;
113
178
  }
179
+ /**
180
+ * @param {any} sheet_object
181
+ */
182
+ module.exports.importSheet = function(sheet_object) {
183
+ const ret = wasm.importSheet(sheet_object);
184
+ if (ret[1]) {
185
+ throw takeFromExternrefTable0(ret[0]);
186
+ }
187
+ };
188
+
189
+ /**
190
+ * @returns {string}
191
+ */
192
+ module.exports.exportSheet = function() {
193
+ let deferred2_0;
194
+ let deferred2_1;
195
+ try {
196
+ const ret = wasm.exportSheet();
197
+ var ptr1 = ret[0];
198
+ var len1 = ret[1];
199
+ if (ret[3]) {
200
+ ptr1 = 0; len1 = 0;
201
+ throw takeFromExternrefTable0(ret[2]);
202
+ }
203
+ deferred2_0 = ptr1;
204
+ deferred2_1 = len1;
205
+ return getStringFromWasm0(ptr1, len1);
206
+ } finally {
207
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
208
+ }
209
+ };
210
+
211
+ /**
212
+ * @param {any} sheet_object
213
+ */
214
+ module.exports.importClassMap = function(sheet_object) {
215
+ const ret = wasm.importClassMap(sheet_object);
216
+ if (ret[1]) {
217
+ throw takeFromExternrefTable0(ret[0]);
218
+ }
219
+ };
220
+
221
+ /**
222
+ * @returns {string}
223
+ */
224
+ module.exports.exportClassMap = function() {
225
+ let deferred2_0;
226
+ let deferred2_1;
227
+ try {
228
+ const ret = wasm.exportClassMap();
229
+ var ptr1 = ret[0];
230
+ var len1 = ret[1];
231
+ if (ret[3]) {
232
+ ptr1 = 0; len1 = 0;
233
+ throw takeFromExternrefTable0(ret[2]);
234
+ }
235
+ deferred2_0 = ptr1;
236
+ deferred2_1 = len1;
237
+ return getStringFromWasm0(ptr1, len1);
238
+ } finally {
239
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
240
+ }
241
+ };
242
+
114
243
  /**
115
244
  * @param {string} filename
116
245
  * @param {string} code
@@ -251,6 +380,29 @@ class Output {
251
380
  }
252
381
  module.exports.Output = Output;
253
382
 
383
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
384
+ const ret = String(arg1);
385
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
386
+ const len1 = WASM_VECTOR_LEN;
387
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
388
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
389
+ };
390
+
391
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
392
+ const ret = arg0.buffer;
393
+ return ret;
394
+ };
395
+
396
+ module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
397
+ const ret = arg0.call(arg1);
398
+ return ret;
399
+ }, arguments) };
400
+
401
+ module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
402
+ const ret = arg0.done;
403
+ return ret;
404
+ };
405
+
254
406
  module.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
255
407
  const ret = Object.entries(arg0);
256
408
  return ret;
@@ -266,10 +418,37 @@ module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
266
418
  return ret;
267
419
  };
268
420
 
269
- module.exports.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) {
421
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
422
+ const ret = arg0[arg1];
423
+ return ret;
424
+ };
425
+
426
+ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
427
+ let result;
428
+ try {
429
+ result = arg0 instanceof ArrayBuffer;
430
+ } catch (_) {
431
+ result = false;
432
+ }
433
+ const ret = result;
434
+ return ret;
435
+ };
436
+
437
+ module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
438
+ let result;
439
+ try {
440
+ result = arg0 instanceof Map;
441
+ } catch (_) {
442
+ result = false;
443
+ }
444
+ const ret = result;
445
+ return ret;
446
+ };
447
+
448
+ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
270
449
  let result;
271
450
  try {
272
- result = arg0 instanceof Object;
451
+ result = arg0 instanceof Uint8Array;
273
452
  } catch (_) {
274
453
  result = false;
275
454
  }
@@ -282,13 +461,98 @@ module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
282
461
  return ret;
283
462
  };
284
463
 
464
+ module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
465
+ const ret = Number.isSafeInteger(arg0);
466
+ return ret;
467
+ };
468
+
469
+ module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
470
+ const ret = Symbol.iterator;
471
+ return ret;
472
+ };
473
+
474
+ module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
475
+ const ret = arg0.length;
476
+ return ret;
477
+ };
478
+
285
479
  module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
286
480
  const ret = arg0.length;
287
481
  return ret;
288
482
  };
289
483
 
484
+ module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
485
+ const ret = new Uint8Array(arg0);
486
+ return ret;
487
+ };
488
+
489
+ module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
490
+ const ret = arg0.next;
491
+ return ret;
492
+ };
493
+
494
+ module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
495
+ const ret = arg0.next();
496
+ return ret;
497
+ }, arguments) };
498
+
499
+ module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
500
+ arg0.set(arg1, arg2 >>> 0);
501
+ };
502
+
503
+ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
504
+ const ret = arg0.value;
505
+ return ret;
506
+ };
507
+
508
+ module.exports.__wbindgen_as_number = function(arg0) {
509
+ const ret = +arg0;
510
+ return ret;
511
+ };
512
+
513
+ module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
514
+ const ret = arg0;
515
+ return ret;
516
+ };
517
+
518
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
519
+ const ret = BigInt.asUintN(64, arg0);
520
+ return ret;
521
+ };
522
+
523
+ module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
524
+ const v = arg1;
525
+ const ret = typeof(v) === 'bigint' ? v : undefined;
526
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
527
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
528
+ };
529
+
530
+ module.exports.__wbindgen_boolean_get = function(arg0) {
531
+ const v = arg0;
532
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
533
+ return ret;
534
+ };
535
+
536
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
537
+ const ret = debugString(arg1);
538
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
539
+ const len1 = WASM_VECTOR_LEN;
540
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
541
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
542
+ };
543
+
544
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
545
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
546
+ return ret;
547
+ };
548
+
549
+ module.exports.__wbindgen_in = function(arg0, arg1) {
550
+ const ret = arg0 in arg1;
551
+ return ret;
552
+ };
553
+
290
554
  module.exports.__wbindgen_init_externref_table = function() {
291
- const table = wasm.__wbindgen_export_2;
555
+ const table = wasm.__wbindgen_export_4;
292
556
  const offset = table.grow(4);
293
557
  table.set(0, undefined);
294
558
  table.set(offset + 0, undefined);
@@ -298,13 +562,13 @@ module.exports.__wbindgen_init_externref_table = function() {
298
562
  ;
299
563
  };
300
564
 
301
- module.exports.__wbindgen_is_array = function(arg0) {
302
- const ret = Array.isArray(arg0);
565
+ module.exports.__wbindgen_is_bigint = function(arg0) {
566
+ const ret = typeof(arg0) === 'bigint';
303
567
  return ret;
304
568
  };
305
569
 
306
- module.exports.__wbindgen_is_null = function(arg0) {
307
- const ret = arg0 === null;
570
+ module.exports.__wbindgen_is_function = function(arg0) {
571
+ const ret = typeof(arg0) === 'function';
308
572
  return ret;
309
573
  };
310
574
 
@@ -314,6 +578,31 @@ module.exports.__wbindgen_is_object = function(arg0) {
314
578
  return ret;
315
579
  };
316
580
 
581
+ module.exports.__wbindgen_is_string = function(arg0) {
582
+ const ret = typeof(arg0) === 'string';
583
+ return ret;
584
+ };
585
+
586
+ module.exports.__wbindgen_is_undefined = function(arg0) {
587
+ const ret = arg0 === undefined;
588
+ return ret;
589
+ };
590
+
591
+ module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
592
+ const ret = arg0 === arg1;
593
+ return ret;
594
+ };
595
+
596
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
597
+ const ret = arg0 == arg1;
598
+ return ret;
599
+ };
600
+
601
+ module.exports.__wbindgen_memory = function() {
602
+ const ret = wasm.memory;
603
+ return ret;
604
+ };
605
+
317
606
  module.exports.__wbindgen_number_get = function(arg0, arg1) {
318
607
  const obj = arg1;
319
608
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -321,11 +610,6 @@ module.exports.__wbindgen_number_get = function(arg0, arg1) {
321
610
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
322
611
  };
323
612
 
324
- module.exports.__wbindgen_number_new = function(arg0) {
325
- const ret = arg0;
326
- return ret;
327
- };
328
-
329
613
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
330
614
  const obj = arg1;
331
615
  const ret = typeof(obj) === 'string' ? obj : undefined;
package/pkg/index_bg.wasm CHANGED
Binary file
@@ -4,15 +4,19 @@ export const memory: WebAssembly.Memory;
4
4
  export const __wbg_output_free: (a: number, b: number) => void;
5
5
  export const output_code: (a: number) => [number, number];
6
6
  export const output_css: (a: number) => [number, number];
7
+ export const importSheet: (a: any) => [number, number];
8
+ export const exportSheet: () => [number, number, number, number];
9
+ export const importClassMap: (a: any) => [number, number];
10
+ export const exportClassMap: () => [number, number, number, number];
7
11
  export const codeExtract: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
8
12
  export const registerTheme: (a: any) => [number, number];
9
13
  export const getCss: () => [number, number, number, number];
10
14
  export const getThemeInterface: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
11
- export const __wbindgen_exn_store: (a: number) => void;
12
- export const __externref_table_alloc: () => number;
13
- export const __wbindgen_export_2: WebAssembly.Table;
14
15
  export const __wbindgen_malloc: (a: number, b: number) => number;
15
16
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
17
+ export const __wbindgen_exn_store: (a: number) => void;
18
+ export const __externref_table_alloc: () => number;
19
+ export const __wbindgen_export_4: WebAssembly.Table;
16
20
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
17
21
  export const __externref_table_dealloc: (a: number) => void;
18
22
  export const __wbindgen_start: () => void;