@lynx-js/web-core-wasm-canary 0.0.2-canary-20260129-92881e7c → 0.0.2-canary-20260129-d02a6062

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/binary/client/client.d.ts +99 -99
  3. package/binary/client/client.js +381 -391
  4. package/binary/client/client_bg.wasm +0 -0
  5. package/binary/client/client_bg.wasm.d.ts +41 -40
  6. package/binary/client/client_debug.d.ts +102 -102
  7. package/binary/client/client_debug.js +381 -391
  8. package/binary/client/client_debug_bg.wasm +0 -0
  9. package/binary/client/client_debug_bg.wasm.d.ts +44 -43
  10. package/binary/encode/encode.d.ts +10 -59
  11. package/binary/encode/encode.js +151 -330
  12. package/binary/encode/encode_bg.wasm +0 -0
  13. package/binary/encode/encode_bg.wasm.d.ts +4 -24
  14. package/binary/encode/encode_debug.d.ts +10 -59
  15. package/binary/encode/encode_debug.js +82 -333
  16. package/binary/encode/encode_debug_bg.wasm +0 -0
  17. package/binary/encode/encode_debug_bg.wasm.d.ts +5 -25
  18. package/dist/client/decodeWorker/cssLoader.d.ts +1 -1
  19. package/dist/client/decodeWorker/cssLoader.js +2 -3
  20. package/dist/client/decodeWorker/decode.worker.js +4 -3
  21. package/dist/client/mainthread/LynxViewInstance.d.ts +1 -5
  22. package/dist/client/mainthread/LynxViewInstance.js +8 -16
  23. package/dist/client/mainthread/TemplateManager.d.ts +0 -1
  24. package/dist/client/mainthread/TemplateManager.js +5 -29
  25. package/dist/client/mainthread/elementAPIs/WASMJSBinding.d.ts +4 -10
  26. package/dist/client/mainthread/elementAPIs/WASMJSBinding.js +14 -19
  27. package/dist/client/mainthread/elementAPIs/createElementAPI.d.ts +1 -1
  28. package/dist/client/mainthread/elementAPIs/createElementAPI.js +60 -84
  29. package/dist/client/wasm.d.ts +1 -9
  30. package/dist/client/wasm.js +3 -17
  31. package/dist/client/webElementsDynamicLoader.d.ts +0 -7
  32. package/dist/client/webElementsDynamicLoader.js +3 -72
  33. package/dist/client_prod/static/js/async/web-core-main-chunk.js +1 -303
  34. package/dist/client_prod/static/js/async/web-core-template-loader-thread.js +4 -4
  35. package/dist/client_prod/static/js/async/web-elements.js +309 -0
  36. package/dist/client_prod/static/js/client.js +2 -2
  37. package/dist/client_prod/static/wasm/a156b496.module.wasm +0 -0
  38. package/dist/encode/webEncoder.js +1 -16
  39. package/dist/types/DecodedTemplate.d.ts +0 -3
  40. package/dist/types/IElementPAPI.d.ts +0 -2
  41. package/dist/types/IMtsBinding.d.ts +4 -1
  42. package/package.json +3 -4
  43. package/dist/client/mainthread/StyleManager.d.ts +0 -15
  44. package/dist/client/mainthread/StyleManager.js +0 -72
  45. package/dist/client_prod/static/js/async/web-elements-audio.js +0 -1
  46. package/dist/client_prod/static/js/async/web-elements-foldview.js +0 -1
  47. package/dist/client_prod/static/js/async/web-elements-input.js +0 -1
  48. package/dist/client_prod/static/js/async/web-elements-list.js +0 -1
  49. package/dist/client_prod/static/js/async/web-elements-overlay.js +0 -1
  50. package/dist/client_prod/static/js/async/web-elements-refrshview.js +0 -1
  51. package/dist/client_prod/static/js/async/web-elements-swiper.js +0 -1
  52. package/dist/client_prod/static/js/async/web-elements-textarea.js +0 -1
  53. package/dist/client_prod/static/js/async/web-elements-viewpager.js +0 -1
  54. package/dist/client_prod/static/wasm/aa6eb16a.module.wasm +0 -0
  55. package/dist/encode/encodeElementTemplate.d.ts +0 -2
  56. package/dist/encode/encodeElementTemplate.js +0 -52
  57. /package/dist/client_prod/static/css/async/{web-core-main-chunk.css → web-elements.css} +0 -0
@@ -1,301 +1,5 @@
1
1
  /* @ts-self-types="./encode.d.ts" */
2
2
 
3
- export class DecodedStyleData {
4
- __destroy_into_raw() {
5
- const ptr = this.__wbg_ptr;
6
- this.__wbg_ptr = 0;
7
- DecodedStyleDataFinalization.unregister(this);
8
- return ptr;
9
- }
10
- free() {
11
- const ptr = this.__destroy_into_raw();
12
- wasm.__wbg_decodedstyledata_free(ptr, 0);
13
- }
14
- /**
15
- * @param {Uint8Array} buffer
16
- * @param {string | null | undefined} entry_name
17
- * @param {boolean} config_enable_css_selector
18
- * @returns {Uint8Array}
19
- */
20
- static decode_into(buffer, entry_name, config_enable_css_selector) {
21
- var ptr0 = isLikeNone(entry_name) ? 0 : passStringToWasm0(entry_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
22
- var len0 = WASM_VECTOR_LEN;
23
- const ret = wasm.decodedstyledata_decode_into(buffer, ptr0, len0, config_enable_css_selector);
24
- if (ret[2]) {
25
- throw takeFromExternrefTable0(ret[1]);
26
- }
27
- return takeFromExternrefTable0(ret[0]);
28
- }
29
- /**
30
- * @param {RawStyleInfo} raw_style_info
31
- * @param {boolean} config_enable_css_selector
32
- * @param {string | null} [entry_name]
33
- * @returns {Uint8Array}
34
- */
35
- static encode_from_raw_style_info(raw_style_info, config_enable_css_selector, entry_name) {
36
- _assertClass(raw_style_info, RawStyleInfo);
37
- var ptr0 = raw_style_info.__destroy_into_raw();
38
- var ptr1 = isLikeNone(entry_name) ? 0 : passStringToWasm0(entry_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
39
- var len1 = WASM_VECTOR_LEN;
40
- const ret = wasm.decodedstyledata_encode_from_raw_style_info(ptr0, config_enable_css_selector, ptr1, len1);
41
- if (ret[2]) {
42
- throw takeFromExternrefTable0(ret[1]);
43
- }
44
- return takeFromExternrefTable0(ret[0]);
45
- }
46
- /**
47
- * @returns {string}
48
- */
49
- get font_face_content() {
50
- let deferred1_0;
51
- let deferred1_1;
52
- try {
53
- const ret = wasm.decodedstyledata_font_face_content(this.__wbg_ptr);
54
- deferred1_0 = ret[0];
55
- deferred1_1 = ret[1];
56
- return getStringFromWasm0(ret[0], ret[1]);
57
- } finally {
58
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
59
- }
60
- }
61
- /**
62
- * @param {Uint8Array} buffer
63
- */
64
- constructor(buffer) {
65
- const ret = wasm.decodedstyledata_new(buffer);
66
- if (ret[2]) {
67
- throw takeFromExternrefTable0(ret[1]);
68
- }
69
- this.__wbg_ptr = ret[0] >>> 0;
70
- DecodedStyleDataFinalization.register(this, this.__wbg_ptr, this);
71
- return this;
72
- }
73
- /**
74
- * @param {number} css_id
75
- * @param {string[]} class_name
76
- * @returns {string}
77
- */
78
- query_css_og_declarations_by_css_id(css_id, class_name) {
79
- let deferred2_0;
80
- let deferred2_1;
81
- try {
82
- const ptr0 = passArrayJsValueToWasm0(class_name, wasm.__wbindgen_malloc);
83
- const len0 = WASM_VECTOR_LEN;
84
- const ret = wasm.decodedstyledata_query_css_og_declarations_by_css_id(this.__wbg_ptr, css_id, ptr0, len0);
85
- deferred2_0 = ret[0];
86
- deferred2_1 = ret[1];
87
- return getStringFromWasm0(ret[0], ret[1]);
88
- } finally {
89
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
90
- }
91
- }
92
- /**
93
- * @returns {string}
94
- */
95
- get style_content() {
96
- let deferred1_0;
97
- let deferred1_1;
98
- try {
99
- const ret = wasm.decodedstyledata_style_content(this.__wbg_ptr);
100
- deferred1_0 = ret[0];
101
- deferred1_1 = ret[1];
102
- return getStringFromWasm0(ret[0], ret[1]);
103
- } finally {
104
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
105
- }
106
- }
107
- }
108
- if (Symbol.dispose) DecodedStyleData.prototype[Symbol.dispose] = DecodedStyleData.prototype.free;
109
-
110
- export class ElementTemplateSection {
111
- static __wrap(ptr) {
112
- ptr = ptr >>> 0;
113
- const obj = Object.create(ElementTemplateSection.prototype);
114
- obj.__wbg_ptr = ptr;
115
- ElementTemplateSectionFinalization.register(obj, obj.__wbg_ptr, obj);
116
- return obj;
117
- }
118
- __destroy_into_raw() {
119
- const ptr = this.__wbg_ptr;
120
- this.__wbg_ptr = 0;
121
- ElementTemplateSectionFinalization.unregister(this);
122
- return ptr;
123
- }
124
- free() {
125
- const ptr = this.__destroy_into_raw();
126
- wasm.__wbg_elementtemplatesection_free(ptr, 0);
127
- }
128
- /**
129
- * @param {string} id
130
- * @param {RawElementTemplate} raw_element_template
131
- */
132
- add_element_template(id, raw_element_template) {
133
- const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
134
- const len0 = WASM_VECTOR_LEN;
135
- _assertClass(raw_element_template, RawElementTemplate);
136
- var ptr1 = raw_element_template.__destroy_into_raw();
137
- wasm.elementtemplatesection_add_element_template(this.__wbg_ptr, ptr0, len0, ptr1);
138
- }
139
- /**
140
- * @returns {Uint8Array}
141
- */
142
- encode() {
143
- const ret = wasm.elementtemplatesection_encode(this.__wbg_ptr);
144
- return ret;
145
- }
146
- /**
147
- * @param {Uint8Array} buffer
148
- * @returns {ElementTemplateSection}
149
- */
150
- static from_encoded(buffer) {
151
- const ret = wasm.elementtemplatesection_from_encoded(buffer);
152
- if (ret[2]) {
153
- throw takeFromExternrefTable0(ret[1]);
154
- }
155
- return ElementTemplateSection.__wrap(ret[0]);
156
- }
157
- constructor() {
158
- const ret = wasm.elementtemplatesection_new();
159
- this.__wbg_ptr = ret >>> 0;
160
- ElementTemplateSectionFinalization.register(this, this.__wbg_ptr, this);
161
- return this;
162
- }
163
- }
164
- if (Symbol.dispose) ElementTemplateSection.prototype[Symbol.dispose] = ElementTemplateSection.prototype.free;
165
-
166
- /**
167
- * @enum {1 | 3 | 5 | 6 | 7 | 8 | 10 | 11 | 12}
168
- */
169
- export const LEOAsmOpcode = Object.freeze({
170
- SetAttribute: 1, "1": "SetAttribute",
171
- RemoveChild: 3, "3": "RemoveChild",
172
- AppendChild: 5, "5": "AppendChild",
173
- CreateElement: 6, "6": "CreateElement",
174
- SetAttributeSlot: 7, "7": "SetAttributeSlot",
175
- AppendElementSlot: 8, "8": "AppendElementSlot",
176
- SetDataset: 10, "10": "SetDataset",
177
- AddEvent: 11, "11": "AddEvent",
178
- AppendToRoot: 12, "12": "AppendToRoot",
179
- });
180
-
181
- export class Operation {
182
- __destroy_into_raw() {
183
- const ptr = this.__wbg_ptr;
184
- this.__wbg_ptr = 0;
185
- OperationFinalization.unregister(this);
186
- return ptr;
187
- }
188
- free() {
189
- const ptr = this.__destroy_into_raw();
190
- wasm.__wbg_operation_free(ptr, 0);
191
- }
192
- }
193
- if (Symbol.dispose) Operation.prototype[Symbol.dispose] = Operation.prototype.free;
194
-
195
- export class RawElementTemplate {
196
- __destroy_into_raw() {
197
- const ptr = this.__wbg_ptr;
198
- this.__wbg_ptr = 0;
199
- RawElementTemplateFinalization.unregister(this);
200
- return ptr;
201
- }
202
- free() {
203
- const ptr = this.__destroy_into_raw();
204
- wasm.__wbg_rawelementtemplate_free(ptr, 0);
205
- }
206
- /**
207
- * @param {number} parent_element_id
208
- * @param {number} child_element_id
209
- */
210
- append_child(parent_element_id, child_element_id) {
211
- wasm.rawelementtemplate_append_child(this.__wbg_ptr, parent_element_id, child_element_id);
212
- }
213
- /**
214
- * @param {number} parent_element_id
215
- * @param {number} child_element_slot_id
216
- */
217
- append_element_slot(parent_element_id, child_element_slot_id) {
218
- wasm.rawelementtemplate_append_element_slot(this.__wbg_ptr, parent_element_id, child_element_slot_id);
219
- }
220
- /**
221
- * @param {number} element_id
222
- */
223
- append_to_root(element_id) {
224
- wasm.rawelementtemplate_append_to_root(this.__wbg_ptr, element_id);
225
- }
226
- /**
227
- * @param {string} tag_names
228
- * @param {number} element_id
229
- */
230
- create_element(tag_names, element_id) {
231
- const ptr0 = passStringToWasm0(tag_names, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
232
- const len0 = WASM_VECTOR_LEN;
233
- wasm.rawelementtemplate_create_element(this.__wbg_ptr, ptr0, len0, element_id);
234
- }
235
- constructor() {
236
- const ret = wasm.rawelementtemplate_new();
237
- this.__wbg_ptr = ret >>> 0;
238
- RawElementTemplateFinalization.register(this, this.__wbg_ptr, this);
239
- return this;
240
- }
241
- /**
242
- * @param {number} element_id
243
- * @param {string} attr_name
244
- * @param {string} attr_value
245
- */
246
- set_attribute(element_id, attr_name, attr_value) {
247
- const ptr0 = passStringToWasm0(attr_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
248
- const len0 = WASM_VECTOR_LEN;
249
- const ptr1 = passStringToWasm0(attr_value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
250
- const len1 = WASM_VECTOR_LEN;
251
- wasm.rawelementtemplate_set_attribute(this.__wbg_ptr, element_id, ptr0, len0, ptr1, len1);
252
- }
253
- /**
254
- * @param {number} element_id
255
- * @param {number} attribute_slot_id
256
- * @param {string} attr_name
257
- */
258
- set_attribute_slot(element_id, attribute_slot_id, attr_name) {
259
- const ptr0 = passStringToWasm0(attr_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
260
- const len0 = WASM_VECTOR_LEN;
261
- wasm.rawelementtemplate_set_attribute_slot(this.__wbg_ptr, element_id, attribute_slot_id, ptr0, len0);
262
- }
263
- /**
264
- * @param {number} element_id
265
- * @param {string} event_type
266
- * @param {string} event_name
267
- * @param {string} event_value
268
- */
269
- set_cross_thread_event(element_id, event_type, event_name, event_value) {
270
- const ptr0 = passStringToWasm0(event_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
271
- const len0 = WASM_VECTOR_LEN;
272
- const ptr1 = passStringToWasm0(event_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273
- const len1 = WASM_VECTOR_LEN;
274
- const ptr2 = passStringToWasm0(event_value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
275
- const len2 = WASM_VECTOR_LEN;
276
- wasm.rawelementtemplate_set_cross_thread_event(this.__wbg_ptr, element_id, ptr0, len0, ptr1, len1, ptr2, len2);
277
- }
278
- /**
279
- * @param {number} element_id
280
- * @param {string} data_name
281
- * @param {string} data_value
282
- */
283
- set_dataset(element_id, data_name, data_value) {
284
- const ptr0 = passStringToWasm0(data_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
285
- const len0 = WASM_VECTOR_LEN;
286
- const ptr1 = passStringToWasm0(data_value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
287
- const len1 = WASM_VECTOR_LEN;
288
- wasm.rawelementtemplate_set_dataset(this.__wbg_ptr, element_id, ptr0, len0, ptr1, len1);
289
- }
290
- }
291
- if (Symbol.dispose) RawElementTemplate.prototype[Symbol.dispose] = RawElementTemplate.prototype.free;
292
-
293
- /**
294
- *
295
- * * key: cssId
296
- * * value: StyleSheet
297
- *
298
- */
299
3
  export class RawStyleInfo {
300
4
  __destroy_into_raw() {
301
5
  const ptr = this.__wbg_ptr;
@@ -322,7 +26,7 @@ export class RawStyleInfo {
322
26
  }
323
27
  /**
324
28
  *
325
- * * Encodes the RawStyleInfo into a Uint8Array using bincode serialization.
29
+ * * Encodes the RawStyleInfo into a Uint8Array using rkyv serialization.
326
30
  * * @returns A Uint8Array containing the serialized RawStyleInfo.
327
31
  *
328
32
  * @returns {Uint8Array}
@@ -390,6 +94,7 @@ export class Rule {
390
94
  /**
391
95
  *
392
96
  * * Pushes a declaration to the rule's declaration block.
97
+ * * LynxJS doesn't support !important
393
98
  * * @param property_name - The property name.
394
99
  * * @param value - The property value.
395
100
  *
@@ -524,6 +229,86 @@ export class StyleInfoDecoder {
524
229
  }
525
230
  if (Symbol.dispose) StyleInfoDecoder.prototype[Symbol.dispose] = StyleInfoDecoder.prototype.free;
526
231
 
232
+ /**
233
+ * @param {Uint8Array} buffer
234
+ * @param {string | null | undefined} entry_name
235
+ * @param {boolean} config_enable_css_selector
236
+ * @returns {Uint8Array}
237
+ */
238
+ export function decode_style_info(buffer, entry_name, config_enable_css_selector) {
239
+ var ptr0 = isLikeNone(entry_name) ? 0 : passStringToWasm0(entry_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
+ var len0 = WASM_VECTOR_LEN;
241
+ const ret = wasm.decode_style_info(buffer, ptr0, len0, config_enable_css_selector);
242
+ if (ret[2]) {
243
+ throw takeFromExternrefTable0(ret[1]);
244
+ }
245
+ return takeFromExternrefTable0(ret[0]);
246
+ }
247
+
248
+ /**
249
+ * @param {RawStyleInfo} raw_style_info
250
+ * @param {boolean} config_enable_css_selector
251
+ * @param {string | null} [entry_name]
252
+ * @returns {Uint8Array}
253
+ */
254
+ export function encode_legacy_json_generated_raw_style_info(raw_style_info, config_enable_css_selector, entry_name) {
255
+ _assertClass(raw_style_info, RawStyleInfo);
256
+ var ptr0 = raw_style_info.__destroy_into_raw();
257
+ var ptr1 = isLikeNone(entry_name) ? 0 : passStringToWasm0(entry_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
258
+ var len1 = WASM_VECTOR_LEN;
259
+ const ret = wasm.encode_legacy_json_generated_raw_style_info(ptr0, config_enable_css_selector, ptr1, len1);
260
+ if (ret[2]) {
261
+ throw takeFromExternrefTable0(ret[1]);
262
+ }
263
+ return takeFromExternrefTable0(ret[0]);
264
+ }
265
+
266
+ /**
267
+ * @param {Uint8Array} buffer
268
+ * @returns {string}
269
+ */
270
+ export function get_font_face_content(buffer) {
271
+ let deferred2_0;
272
+ let deferred2_1;
273
+ try {
274
+ const ret = wasm.get_font_face_content(buffer);
275
+ var ptr1 = ret[0];
276
+ var len1 = ret[1];
277
+ if (ret[3]) {
278
+ ptr1 = 0; len1 = 0;
279
+ throw takeFromExternrefTable0(ret[2]);
280
+ }
281
+ deferred2_0 = ptr1;
282
+ deferred2_1 = len1;
283
+ return getStringFromWasm0(ptr1, len1);
284
+ } finally {
285
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
286
+ }
287
+ }
288
+
289
+ /**
290
+ * @param {Uint8Array} buffer
291
+ * @returns {string}
292
+ */
293
+ export function get_style_content(buffer) {
294
+ let deferred2_0;
295
+ let deferred2_1;
296
+ try {
297
+ const ret = wasm.get_style_content(buffer);
298
+ var ptr1 = ret[0];
299
+ var len1 = ret[1];
300
+ if (ret[3]) {
301
+ ptr1 = 0; len1 = 0;
302
+ throw takeFromExternrefTable0(ret[2]);
303
+ }
304
+ deferred2_0 = ptr1;
305
+ deferred2_1 = len1;
306
+ return getStringFromWasm0(ptr1, len1);
307
+ } finally {
308
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
309
+ }
310
+ }
311
+
527
312
  function __wbg_get_imports() {
528
313
  const import0 = {
529
314
  __proto__: null,
@@ -531,11 +316,10 @@ function __wbg_get_imports() {
531
316
  const ret = Error(getStringFromWasm0(arg0, arg1));
532
317
  return ret;
533
318
  },
534
- __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
535
- const obj = arg1;
536
- const ret = typeof(obj) === 'string' ? obj : undefined;
537
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
538
- var len1 = WASM_VECTOR_LEN;
319
+ __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
320
+ const ret = debugString(arg1);
321
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
322
+ const len1 = WASM_VECTOR_LEN;
539
323
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
540
324
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
541
325
  },
@@ -569,18 +353,6 @@ function __wbg_get_imports() {
569
353
  };
570
354
  }
571
355
 
572
- const DecodedStyleDataFinalization = (typeof FinalizationRegistry === 'undefined')
573
- ? { register: () => {}, unregister: () => {} }
574
- : new FinalizationRegistry(ptr => wasm.__wbg_decodedstyledata_free(ptr >>> 0, 1));
575
- const ElementTemplateSectionFinalization = (typeof FinalizationRegistry === 'undefined')
576
- ? { register: () => {}, unregister: () => {} }
577
- : new FinalizationRegistry(ptr => wasm.__wbg_elementtemplatesection_free(ptr >>> 0, 1));
578
- const OperationFinalization = (typeof FinalizationRegistry === 'undefined')
579
- ? { register: () => {}, unregister: () => {} }
580
- : new FinalizationRegistry(ptr => wasm.__wbg_operation_free(ptr >>> 0, 1));
581
- const RawElementTemplateFinalization = (typeof FinalizationRegistry === 'undefined')
582
- ? { register: () => {}, unregister: () => {} }
583
- : new FinalizationRegistry(ptr => wasm.__wbg_rawelementtemplate_free(ptr >>> 0, 1));
584
356
  const RawStyleInfoFinalization = (typeof FinalizationRegistry === 'undefined')
585
357
  ? { register: () => {}, unregister: () => {} }
586
358
  : new FinalizationRegistry(ptr => wasm.__wbg_rawstyleinfo_free(ptr >>> 0, 1));
@@ -597,18 +369,77 @@ const StyleInfoDecoderFinalization = (typeof FinalizationRegistry === 'undefined
597
369
  ? { register: () => {}, unregister: () => {} }
598
370
  : new FinalizationRegistry(ptr => wasm.__wbg_styleinfodecoder_free(ptr >>> 0, 1));
599
371
 
600
- function addToExternrefTable0(obj) {
601
- const idx = wasm.__externref_table_alloc();
602
- wasm.__wbindgen_externrefs.set(idx, obj);
603
- return idx;
604
- }
605
-
606
372
  function _assertClass(instance, klass) {
607
373
  if (!(instance instanceof klass)) {
608
374
  throw new Error(`expected instance of ${klass.name}`);
609
375
  }
610
376
  }
611
377
 
378
+ function debugString(val) {
379
+ // primitive types
380
+ const type = typeof val;
381
+ if (type == 'number' || type == 'boolean' || val == null) {
382
+ return `${val}`;
383
+ }
384
+ if (type == 'string') {
385
+ return `"${val}"`;
386
+ }
387
+ if (type == 'symbol') {
388
+ const description = val.description;
389
+ if (description == null) {
390
+ return 'Symbol';
391
+ } else {
392
+ return `Symbol(${description})`;
393
+ }
394
+ }
395
+ if (type == 'function') {
396
+ const name = val.name;
397
+ if (typeof name == 'string' && name.length > 0) {
398
+ return `Function(${name})`;
399
+ } else {
400
+ return 'Function';
401
+ }
402
+ }
403
+ // objects
404
+ if (Array.isArray(val)) {
405
+ const length = val.length;
406
+ let debug = '[';
407
+ if (length > 0) {
408
+ debug += debugString(val[0]);
409
+ }
410
+ for(let i = 1; i < length; i++) {
411
+ debug += ', ' + debugString(val[i]);
412
+ }
413
+ debug += ']';
414
+ return debug;
415
+ }
416
+ // Test for built-in
417
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
418
+ let className;
419
+ if (builtInMatches && builtInMatches.length > 1) {
420
+ className = builtInMatches[1];
421
+ } else {
422
+ // Failed to match the standard '[object ClassName]'
423
+ return toString.call(val);
424
+ }
425
+ if (className == 'Object') {
426
+ // we're a user defined class or Object
427
+ // JSON.stringify avoids problems with cycles, and is generally much
428
+ // easier than looping through ownProperties of `val`.
429
+ try {
430
+ return 'Object(' + JSON.stringify(val) + ')';
431
+ } catch (_) {
432
+ return 'Object';
433
+ }
434
+ }
435
+ // errors
436
+ if (val instanceof Error) {
437
+ return `${val.name}: ${val.message}\n${val.stack}`;
438
+ }
439
+ // TODO we could test for more things here, like `Set`s and `Map`s.
440
+ return className;
441
+ }
442
+
612
443
  function getArrayU8FromWasm0(ptr, len) {
613
444
  ptr = ptr >>> 0;
614
445
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -639,16 +470,6 @@ function isLikeNone(x) {
639
470
  return x === undefined || x === null;
640
471
  }
641
472
 
642
- function passArrayJsValueToWasm0(array, malloc) {
643
- const ptr = malloc(array.length * 4, 4) >>> 0;
644
- for (let i = 0; i < array.length; i++) {
645
- const add = addToExternrefTable0(array[i]);
646
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
647
- }
648
- WASM_VECTOR_LEN = array.length;
649
- return ptr;
650
- }
651
-
652
473
  function passStringToWasm0(arg, malloc, realloc) {
653
474
  if (realloc === undefined) {
654
475
  const buf = cachedTextEncoder.encode(arg);
Binary file
@@ -1,34 +1,15 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_decodedstyledata_free: (a: number, b: number) => void;
5
- export const __wbg_elementtemplatesection_free: (a: number, b: number) => void;
6
- export const __wbg_operation_free: (a: number, b: number) => void;
7
- export const __wbg_rawelementtemplate_free: (a: number, b: number) => void;
8
4
  export const __wbg_rawstyleinfo_free: (a: number, b: number) => void;
9
5
  export const __wbg_rule_free: (a: number, b: number) => void;
10
6
  export const __wbg_ruleprelude_free: (a: number, b: number) => void;
11
7
  export const __wbg_selector_free: (a: number, b: number) => void;
12
8
  export const __wbg_styleinfodecoder_free: (a: number, b: number) => void;
13
- export const decodedstyledata_decode_into: (a: any, b: number, c: number, d: number) => [number, number, number];
14
- export const decodedstyledata_encode_from_raw_style_info: (a: number, b: number, c: number, d: number) => [number, number, number];
15
- export const decodedstyledata_font_face_content: (a: number) => [number, number];
16
- export const decodedstyledata_new: (a: any) => [number, number, number];
17
- export const decodedstyledata_query_css_og_declarations_by_css_id: (a: number, b: number, c: number, d: number) => [number, number];
18
- export const decodedstyledata_style_content: (a: number) => [number, number];
19
- export const elementtemplatesection_add_element_template: (a: number, b: number, c: number, d: number) => void;
20
- export const elementtemplatesection_encode: (a: number) => any;
21
- export const elementtemplatesection_from_encoded: (a: any) => [number, number, number];
22
- export const elementtemplatesection_new: () => number;
23
- export const rawelementtemplate_append_child: (a: number, b: number, c: number) => void;
24
- export const rawelementtemplate_append_element_slot: (a: number, b: number, c: number) => void;
25
- export const rawelementtemplate_append_to_root: (a: number, b: number) => void;
26
- export const rawelementtemplate_create_element: (a: number, b: number, c: number, d: number) => void;
27
- export const rawelementtemplate_new: () => number;
28
- export const rawelementtemplate_set_attribute: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
29
- export const rawelementtemplate_set_attribute_slot: (a: number, b: number, c: number, d: number, e: number) => void;
30
- export const rawelementtemplate_set_cross_thread_event: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
31
- export const rawelementtemplate_set_dataset: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
9
+ export const decode_style_info: (a: any, b: number, c: number, d: number) => [number, number, number];
10
+ export const encode_legacy_json_generated_raw_style_info: (a: number, b: number, c: number, d: number) => [number, number, number];
11
+ export const get_font_face_content: (a: any) => [number, number, number, number];
12
+ export const get_style_content: (a: any) => [number, number, number, number];
32
13
  export const rawstyleinfo_append_import: (a: number, b: number, c: number) => void;
33
14
  export const rawstyleinfo_encode: (a: number) => [number, number, number];
34
15
  export const rawstyleinfo_new: () => number;
@@ -46,5 +27,4 @@ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) =>
46
27
  export const __wbindgen_externrefs: WebAssembly.Table;
47
28
  export const __externref_table_dealloc: (a: number) => void;
48
29
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
49
- export const __externref_table_alloc: () => number;
50
30
  export const __wbindgen_start: () => void;
@@ -1,64 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
 
4
- export class DecodedStyleData {
5
- free(): void;
6
- [Symbol.dispose](): void;
7
- static decode_into(buffer: Uint8Array, entry_name: string | null | undefined, config_enable_css_selector: boolean): Uint8Array;
8
- static encode_from_raw_style_info(raw_style_info: RawStyleInfo, config_enable_css_selector: boolean, entry_name?: string | null): Uint8Array;
9
- constructor(buffer: Uint8Array);
10
- query_css_og_declarations_by_css_id(css_id: number, class_name: string[]): string;
11
- readonly font_face_content: string;
12
- readonly style_content: string;
13
- }
14
-
15
- export class ElementTemplateSection {
16
- free(): void;
17
- [Symbol.dispose](): void;
18
- add_element_template(id: string, raw_element_template: RawElementTemplate): void;
19
- encode(): Uint8Array;
20
- static from_encoded(buffer: Uint8Array): ElementTemplateSection;
21
- constructor();
22
- }
23
-
24
- export enum LEOAsmOpcode {
25
- SetAttribute = 1,
26
- RemoveChild = 3,
27
- AppendChild = 5,
28
- CreateElement = 6,
29
- SetAttributeSlot = 7,
30
- AppendElementSlot = 8,
31
- SetDataset = 10,
32
- AddEvent = 11,
33
- AppendToRoot = 12,
34
- }
35
-
36
- export class Operation {
37
- private constructor();
38
- free(): void;
39
- [Symbol.dispose](): void;
40
- }
41
-
42
- export class RawElementTemplate {
43
- free(): void;
44
- [Symbol.dispose](): void;
45
- append_child(parent_element_id: number, child_element_id: number): void;
46
- append_element_slot(parent_element_id: number, child_element_slot_id: number): void;
47
- append_to_root(element_id: number): void;
48
- create_element(tag_names: string, element_id: number): void;
49
- constructor();
50
- set_attribute(element_id: number, attr_name: string, attr_value: string): void;
51
- set_attribute_slot(element_id: number, attribute_slot_id: number, attr_name: string): void;
52
- set_cross_thread_event(element_id: number, event_type: string, event_name: string, event_value: string): void;
53
- set_dataset(element_id: number, data_name: string, data_value: string): void;
54
- }
55
-
56
- /**
57
- *
58
- * * key: cssId
59
- * * value: StyleSheet
60
- *
61
- */
62
4
  export class RawStyleInfo {
63
5
  free(): void;
64
6
  [Symbol.dispose](): void;
@@ -73,7 +15,7 @@ export class RawStyleInfo {
73
15
  append_import(css_id: number, import_css_id: number): void;
74
16
  /**
75
17
  *
76
- * * Encodes the RawStyleInfo into a Uint8Array using bincode serialization.
18
+ * * Encodes the RawStyleInfo into a Uint8Array using rkyv serialization.
77
19
  * * @returns A Uint8Array containing the serialized RawStyleInfo.
78
20
  *
79
21
  */
@@ -103,6 +45,7 @@ export class Rule {
103
45
  /**
104
46
  *
105
47
  * * Pushes a declaration to the rule's declaration block.
48
+ * * LynxJS doesn't support !important
106
49
  * * @param property_name - The property name.
107
50
  * * @param value - The property value.
108
51
  *
@@ -165,3 +108,11 @@ export class StyleInfoDecoder {
165
108
  free(): void;
166
109
  [Symbol.dispose](): void;
167
110
  }
111
+
112
+ export function decode_style_info(buffer: Uint8Array, entry_name: string | null | undefined, config_enable_css_selector: boolean): Uint8Array;
113
+
114
+ export function encode_legacy_json_generated_raw_style_info(raw_style_info: RawStyleInfo, config_enable_css_selector: boolean, entry_name?: string | null): Uint8Array;
115
+
116
+ export function get_font_face_content(buffer: Uint8Array): string;
117
+
118
+ export function get_style_content(buffer: Uint8Array): string;