@pandacss/compiler-wasm 2.0.0-beta.9 → 2.0.0

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.
@@ -31,6 +31,24 @@ export class WasmCompiler {
31
31
  const ptr = this.__destroy_into_raw();
32
32
  wasm.__wbg_wasmcompiler_free(ptr, 0);
33
33
  }
34
+ /**
35
+ * Files whose folded imports changed since the last call. Clears on read.
36
+ * Re-parse each via `refreshFile`, then call again until empty.
37
+ * @returns {string[]}
38
+ */
39
+ affectedFiles() {
40
+ try {
41
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
42
+ wasm.wasmcompiler_affectedFiles(retptr, this.__wbg_ptr);
43
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
44
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
45
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
46
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
47
+ return v1;
48
+ } finally {
49
+ wasm.__wbindgen_add_to_stack_pointer(16);
50
+ }
51
+ }
34
52
  /**
35
53
  * Hydrate an external build info into this project (additive), optionally
36
54
  * restricted to imported modules (tree-shaking). Returns `false` on a
@@ -166,7 +184,7 @@ export class WasmCompiler {
166
184
  }
167
185
  }
168
186
  /**
169
- * Build a `panda.lib.json` value from host-supplied fields, stamping the
187
+ * Build a `panda/lib.json` value from host-supplied fields, stamping the
170
188
  * engine-owned schema version. Backs the `designSystem.create` JS namespace.
171
189
  *
172
190
  * # Errors
@@ -189,6 +207,30 @@ export class WasmCompiler {
189
207
  wasm.__wbindgen_add_to_stack_pointer(16);
190
208
  }
191
209
  }
210
+ /**
211
+ * Per-package import selections from one scan. Each entry is `null` = all,
212
+ * or export names to narrow.
213
+ *
214
+ * # Errors
215
+ * Returns a JS error when the scan fails or serialization fails.
216
+ * @param {any} packages
217
+ * @returns {any}
218
+ */
219
+ designSystemImportSelections(packages) {
220
+ try {
221
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
222
+ wasm.wasmcompiler_designSystemImportSelections(retptr, this.__wbg_ptr, addHeapObject(packages));
223
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
224
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
225
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
226
+ if (r2) {
227
+ throw takeObject(r1);
228
+ }
229
+ return takeObject(r0);
230
+ } finally {
231
+ wasm.__wbindgen_add_to_stack_pointer(16);
232
+ }
233
+ }
192
234
  /**
193
235
  * The manifest wire-format version this binding reads/writes.
194
236
  * @returns {number}
@@ -344,9 +386,6 @@ export class WasmCompiler {
344
386
  }
345
387
  /**
346
388
  * Generate artifacts affected by the provided config dependency names.
347
- *
348
- * # Errors
349
- * Returns a JS error if dependencies/options are invalid or serializing fails.
350
389
  * @param {any} dependencies
351
390
  * @param {any} options
352
391
  * @returns {any}
@@ -369,9 +408,6 @@ export class WasmCompiler {
369
408
  }
370
409
  /**
371
410
  * Generate one codegen artifact by id.
372
- *
373
- * # Errors
374
- * Returns a JS error if the id/options are invalid or serializing fails.
375
411
  * @param {string} id
376
412
  * @param {any} options
377
413
  * @returns {any}
@@ -396,9 +432,6 @@ export class WasmCompiler {
396
432
  }
397
433
  /**
398
434
  * Generate every codegen artifact from the resolved project state.
399
- *
400
- * # Errors
401
- * Returns a JS error if options are invalid or serializing fails.
402
435
  * @param {any} options
403
436
  * @returns {any}
404
437
  */
@@ -443,6 +476,26 @@ export class WasmCompiler {
443
476
  wasm.__wbindgen_add_to_stack_pointer(16);
444
477
  }
445
478
  }
479
+ /**
480
+ * Theme `@keyframes` CSS only (no token vars or other layers).
481
+ * @param {any | null} [options]
482
+ * @returns {any}
483
+ */
484
+ getKeyframeCss(options) {
485
+ try {
486
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
487
+ wasm.wasmcompiler_getKeyframeCss(retptr, this.__wbg_ptr, isLikeNone(options) ? 0 : addHeapObject(options));
488
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
489
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
490
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
491
+ if (r2) {
492
+ throw takeObject(r1);
493
+ }
494
+ return takeObject(r0);
495
+ } finally {
496
+ wasm.__wbindgen_add_to_stack_pointer(16);
497
+ }
498
+ }
446
499
  /**
447
500
  * CSS for the named cascade layers, concatenated in order. Sliced in Rust
448
501
  * (byte offsets stay valid); unknown layer names are skipped.
@@ -654,8 +707,8 @@ export class WasmCompiler {
654
707
  }
655
708
  }
656
709
  /**
657
- * Read + parse source paths returned from `scan()`. Returns one report per
658
- * successfully parsed path.
710
+ * Read + parse source paths from `scan()`. One report per requested path;
711
+ * a read miss keeps last-good state and reports a warning diagnostic.
659
712
  *
660
713
  * # Errors
661
714
  * Returns a JS error when `paths` is malformed or serializing the report fails.
@@ -894,14 +947,15 @@ export class WasmCompiler {
894
947
  * # Errors
895
948
  * Returns a JS error if serializing the build info fails.
896
949
  * @param {string} panda
950
+ * @param {any} dependencies
897
951
  * @returns {any}
898
952
  */
899
- serializeBuildInfo(panda) {
953
+ serializeBuildInfo(panda, dependencies) {
900
954
  try {
901
955
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
902
956
  const ptr0 = passStringToWasm0(panda, wasm.__wbindgen_export, wasm.__wbindgen_export2);
903
957
  const len0 = WASM_VECTOR_LEN;
904
- wasm.wasmcompiler_serializeBuildInfo(retptr, this.__wbg_ptr, ptr0, len0);
958
+ wasm.wasmcompiler_serializeBuildInfo(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(dependencies));
905
959
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
906
960
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
907
961
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1001,6 +1055,29 @@ export class WasmCompiler {
1001
1055
  wasm.__wbindgen_add_to_stack_pointer(16);
1002
1056
  }
1003
1057
  }
1058
+ /**
1059
+ * Remove Panda `@layer a, b;` order statements; leave unrelated ones.
1060
+ * @param {string} css
1061
+ * @returns {string}
1062
+ */
1063
+ stripLayerOrderStatements(css) {
1064
+ let deferred2_0;
1065
+ let deferred2_1;
1066
+ try {
1067
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1068
+ const ptr0 = passStringToWasm0(css, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1069
+ const len0 = WASM_VECTOR_LEN;
1070
+ wasm.wasmcompiler_stripLayerOrderStatements(retptr, this.__wbg_ptr, ptr0, len0);
1071
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1072
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1073
+ deferred2_0 = r0;
1074
+ deferred2_1 = r1;
1075
+ return getStringFromWasm0(r0, r1);
1076
+ } finally {
1077
+ wasm.__wbindgen_add_to_stack_pointer(16);
1078
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
1079
+ }
1080
+ }
1004
1081
  /**
1005
1082
  * Semantic tokens that carry the same value as a token path.
1006
1083
  *
@@ -1080,10 +1157,10 @@ export class WasmCompiler {
1080
1157
  * Rust-built token dictionary projected into the small JS interop shape.
1081
1158
  * @returns {any}
1082
1159
  */
1083
- token_dictionary() {
1160
+ tokenDictionary() {
1084
1161
  try {
1085
1162
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1086
- wasm.wasmcompiler_token_dictionary(retptr, this.__wbg_ptr);
1163
+ wasm.wasmcompiler_tokenDictionary(retptr, this.__wbg_ptr);
1087
1164
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1088
1165
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1089
1166
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1097,9 +1174,6 @@ export class WasmCompiler {
1097
1174
  }
1098
1175
  /**
1099
1176
  * Generate artifacts and write them under `outdir`.
1100
- *
1101
- * # Errors
1102
- * Returns a JS error if writing or serializing fails.
1103
1177
  * @param {any} options
1104
1178
  * @returns {any}
1105
1179
  */
@@ -1449,6 +1523,9 @@ function __wbg_get_imports() {
1449
1523
  __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
1450
1524
  throw new Error(getStringFromWasm0(arg0, arg1));
1451
1525
  },
1526
+ __wbg__wbg_cb_unref_3fa391f3fcdb55f8: function(arg0) {
1527
+ getObject(arg0)._wbg_cb_unref();
1528
+ },
1452
1529
  __wbg_call_13665d9f14390edc: function() { return handleError(function (arg0, arg1) {
1453
1530
  const ret = getObject(arg0).call(getObject(arg1));
1454
1531
  return addHeapObject(ret);
@@ -1596,10 +1673,6 @@ function __wbg_get_imports() {
1596
1673
  const ret = getObject(arg0).next();
1597
1674
  return addHeapObject(ret);
1598
1675
  }, arguments); },
1599
- __wbg_parse_2c1cad6215e84999: function() { return handleError(function (arg0, arg1) {
1600
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
1601
- return addHeapObject(ret);
1602
- }, arguments); },
1603
1676
  __wbg_prototypesetcall_5f9bdc8d75e07276: function(arg0, arg1, arg2) {
1604
1677
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
1605
1678
  },
@@ -1609,6 +1682,10 @@ function __wbg_get_imports() {
1609
1682
  __wbg_set_78ea6a19f4818587: function(arg0, arg1, arg2) {
1610
1683
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1611
1684
  },
1685
+ __wbg_set_a0e911be3da02782: function() { return handleError(function (arg0, arg1, arg2) {
1686
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
1687
+ return ret;
1688
+ }, arguments); },
1612
1689
  __wbg_set_facb7a5914e0fa39: function(arg0, arg1, arg2) {
1613
1690
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1614
1691
  return addHeapObject(ret);
@@ -1624,22 +1701,27 @@ function __wbg_get_imports() {
1624
1701
  const ret = getObject(arg0).value;
1625
1702
  return addHeapObject(ret);
1626
1703
  },
1627
- __wbindgen_cast_0000000000000001: function(arg0) {
1704
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1705
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 12, ret: Externref, inner_ret: Some(Externref) }, mutable: false }) -> Externref`.
1706
+ const ret = makeClosure(arg0, arg1, __wasm_bindgen_func_elem_504);
1707
+ return addHeapObject(ret);
1708
+ },
1709
+ __wbindgen_cast_0000000000000002: function(arg0) {
1628
1710
  // Cast intrinsic for `F64 -> Externref`.
1629
1711
  const ret = arg0;
1630
1712
  return addHeapObject(ret);
1631
1713
  },
1632
- __wbindgen_cast_0000000000000002: function(arg0) {
1714
+ __wbindgen_cast_0000000000000003: function(arg0) {
1633
1715
  // Cast intrinsic for `I64 -> Externref`.
1634
1716
  const ret = arg0;
1635
1717
  return addHeapObject(ret);
1636
1718
  },
1637
- __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1719
+ __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1638
1720
  // Cast intrinsic for `Ref(String) -> Externref`.
1639
1721
  const ret = getStringFromWasm0(arg0, arg1);
1640
1722
  return addHeapObject(ret);
1641
1723
  },
1642
- __wbindgen_cast_0000000000000004: function(arg0) {
1724
+ __wbindgen_cast_0000000000000005: function(arg0) {
1643
1725
  // Cast intrinsic for `U64 -> Externref`.
1644
1726
  const ret = BigInt.asUintN(64, arg0);
1645
1727
  return addHeapObject(ret);
@@ -1658,6 +1740,13 @@ function __wbg_get_imports() {
1658
1740
  };
1659
1741
  }
1660
1742
 
1743
+ function __wasm_bindgen_func_elem_504(arg0, arg1, arg2) {
1744
+ const ptr0 = passStringToWasm0(arg2, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1745
+ const len0 = WASM_VECTOR_LEN;
1746
+ const ret = wasm.__wasm_bindgen_func_elem_504(arg0, arg1, ptr0, len0);
1747
+ return takeObject(ret);
1748
+ }
1749
+
1661
1750
  const WasmCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
1662
1751
  ? { register: () => {}, unregister: () => {} }
1663
1752
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmcompiler_free(ptr, 1));
@@ -1689,6 +1778,10 @@ function addBorrowedObject(obj) {
1689
1778
  return stack_pointer;
1690
1779
  }
1691
1780
 
1781
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1782
+ ? { register: () => {}, unregister: () => {} }
1783
+ : new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
1784
+
1692
1785
  function debugString(val) {
1693
1786
  // primitive types
1694
1787
  const type = typeof val;
@@ -1760,6 +1853,16 @@ function dropObject(idx) {
1760
1853
  heap_next = idx;
1761
1854
  }
1762
1855
 
1856
+ function getArrayJsValueFromWasm0(ptr, len) {
1857
+ ptr = ptr >>> 0;
1858
+ const mem = getDataViewMemory0();
1859
+ const result = [];
1860
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1861
+ result.push(takeObject(mem.getUint32(i, true)));
1862
+ }
1863
+ return result;
1864
+ }
1865
+
1763
1866
  function getArrayU8FromWasm0(ptr, len) {
1764
1867
  ptr = ptr >>> 0;
1765
1868
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -1804,6 +1907,31 @@ function isLikeNone(x) {
1804
1907
  return x === undefined || x === null;
1805
1908
  }
1806
1909
 
1910
+ function makeClosure(arg0, arg1, f) {
1911
+ const state = { a: arg0, b: arg1, cnt: 1 };
1912
+ const real = (...args) => {
1913
+
1914
+ // First up with a closure we increment the internal reference
1915
+ // count. This ensures that the Rust closure environment won't
1916
+ // be deallocated while we're invoking it.
1917
+ state.cnt++;
1918
+ try {
1919
+ return f(state.a, state.b, ...args);
1920
+ } finally {
1921
+ real._wbg_cb_unref();
1922
+ }
1923
+ };
1924
+ real._wbg_cb_unref = () => {
1925
+ if (--state.cnt === 0) {
1926
+ wasm.__wbindgen_export5(state.a, state.b);
1927
+ state.a = 0;
1928
+ CLOSURE_DTORS.unregister(state);
1929
+ }
1930
+ };
1931
+ CLOSURE_DTORS.register(real, state, state);
1932
+ return real;
1933
+ }
1934
+
1807
1935
  function passStringToWasm0(arg, malloc, realloc) {
1808
1936
  if (realloc === undefined) {
1809
1937
  const buf = cachedTextEncoder.encode(arg);
Binary file
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
4
4
  export const __wbg_wasmcompiler_free: (a: number, b: number) => void;
5
5
  export const __wbg_wasmextractor_free: (a: number, b: number) => void;
6
6
  export const __wbg_wasmfilesystem_free: (a: number, b: number) => void;
7
+ export const wasmcompiler_affectedFiles: (a: number, b: number) => void;
7
8
  export const wasmcompiler_applyBuildInfo: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
8
9
  export const wasmcompiler_atoms: (a: number, b: number) => void;
9
10
  export const wasmcompiler_buildInfoSchemaVersion: (a: number) => number;
@@ -12,6 +13,7 @@ export const wasmcompiler_compile: (a: number, b: number, c: number) => void;
12
13
  export const wasmcompiler_config: (a: number, b: number) => void;
13
14
  export const wasmcompiler_configFingerprint: (a: number, b: number) => void;
14
15
  export const wasmcompiler_createDesignSystemManifest: (a: number, b: number, c: number) => void;
16
+ export const wasmcompiler_designSystemImportSelections: (a: number, b: number, c: number) => void;
15
17
  export const wasmcompiler_designSystemManifestSchemaVersion: (a: number) => number;
16
18
  export const wasmcompiler_diagnostics: (a: number, b: number) => void;
17
19
  export const wasmcompiler_dirname: (a: number, b: number, c: number, d: number) => void;
@@ -23,6 +25,7 @@ export const wasmcompiler_generateAffectedArtifacts: (a: number, b: number, c: n
23
25
  export const wasmcompiler_generateArtifact: (a: number, b: number, c: number, d: number, e: number) => void;
24
26
  export const wasmcompiler_generateArtifacts: (a: number, b: number, c: number) => void;
25
27
  export const wasmcompiler_getFile: (a: number, b: number, c: number, d: number) => void;
28
+ export const wasmcompiler_getKeyframeCss: (a: number, b: number, c: number) => void;
26
29
  export const wasmcompiler_getLayerCss: (a: number, b: number, c: number) => void;
27
30
  export const wasmcompiler_getSplitCss: (a: number, b: number, c: number) => void;
28
31
  export const wasmcompiler_hasLayerDeclaration: (a: number, b: number, c: number) => number;
@@ -45,15 +48,16 @@ export const wasmcompiler_removeFile: (a: number, b: number, c: number) => numbe
45
48
  export const wasmcompiler_resolvePath: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
46
49
  export const wasmcompiler_resolveUtilityValue: (a: number, b: number, c: number) => void;
47
50
  export const wasmcompiler_scan: (a: number, b: number, c: number) => void;
48
- export const wasmcompiler_serializeBuildInfo: (a: number, b: number, c: number, d: number) => void;
51
+ export const wasmcompiler_serializeBuildInfo: (a: number, b: number, c: number, d: number, e: number) => void;
49
52
  export const wasmcompiler_slotRecipes: (a: number, b: number) => void;
50
53
  export const wasmcompiler_sources: (a: number, b: number) => void;
51
54
  export const wasmcompiler_spec: (a: number, b: number) => void;
52
55
  export const wasmcompiler_staticPatternAtoms: (a: number, b: number) => void;
56
+ export const wasmcompiler_stripLayerOrderStatements: (a: number, b: number, c: number, d: number) => void;
53
57
  export const wasmcompiler_suggestSemanticTokens: (a: number, b: number, c: number, d: number) => void;
54
58
  export const wasmcompiler_suggestTokens: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
55
59
  export const wasmcompiler_summary: (a: number, b: number) => void;
56
- export const wasmcompiler_token_dictionary: (a: number, b: number) => void;
60
+ export const wasmcompiler_tokenDictionary: (a: number, b: number) => void;
57
61
  export const wasmcompiler_writeArtifacts: (a: number, b: number, c: number) => void;
58
62
  export const wasmcompiler_writeCss: (a: number, b: number, c: number) => void;
59
63
  export const wasmcompiler_writeLayerCss: (a: number, b: number, c: number) => void;
@@ -67,8 +71,10 @@ export const wasmfilesystem_new: () => number;
67
71
  export const wasmfilesystem_readFile: (a: number, b: number, c: number, d: number) => void;
68
72
  export const wasmfilesystem_removeFile: (a: number, b: number, c: number) => number;
69
73
  export const installPanicHook: () => void;
74
+ export const __wasm_bindgen_func_elem_504: (a: number, b: number, c: number, d: number) => number;
70
75
  export const __wbindgen_export: (a: number, b: number) => number;
71
76
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
72
77
  export const __wbindgen_export3: (a: number) => void;
73
78
  export const __wbindgen_export4: (a: number, b: number, c: number) => void;
79
+ export const __wbindgen_export5: (a: number, b: number) => void;
74
80
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;