lilact 0.26.4 → 0.26.5

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.
@@ -3660,7 +3660,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, { isInline, i
3660
3660
  }
3661
3661
  }
3662
3662
  function require2(path2) {
3663
- var _a, _b, _c, _d, _e, _f;
3663
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3664
3664
  let forceUpdate, checkExport, requirer, isLazy;
3665
3665
  if (arguments.length === 2 && typeof (arguments[1] === "object")) {
3666
3666
  forceUpdate = (_a = arguments[1]) == null ? void 0 : _a.forceUpdate;
@@ -3681,10 +3681,16 @@ function require2(path2) {
3681
3681
  }
3682
3682
  if (((_f = lilact_default) == null ? void 0 : _f[LAZY]) || isLazy) {
3683
3683
  lilact_default[LAZY] = false;
3684
- return fetch(path2).then((res2) => {
3685
- if (!res2.ok) throw new Error(`HTTP ${res2.status}`);
3686
- return res2.text();
3687
- }).then((res2) => {
3684
+ let p = (_h = (_g = lilact_default).resolver) == null ? void 0 : _h.call(_g, path2);
3685
+ if (p) {
3686
+ p = Promise.resolve(p);
3687
+ } else {
3688
+ p = fetch(path2).then((res2) => {
3689
+ if (!res2.ok) throw new Error(`HTTP ${res2.status}`);
3690
+ return res2.text();
3691
+ });
3692
+ }
3693
+ return p.then((res2) => {
3688
3694
  var _a2;
3689
3695
  if (path2.endsWith(".css")) {
3690
3696
  injectGlobal(res2);
@@ -3696,11 +3702,20 @@ function require2(path2) {
3696
3702
  throw err;
3697
3703
  });
3698
3704
  } else {
3699
- const request = new XMLHttpRequest();
3700
- request.open("GET", path2, { isInline: false });
3701
- request.send(null);
3702
- if (request.status === 200) {
3703
- return run(request.responseText, path2, false);
3705
+ const p = (_j = (_i = lilact_default).resolver) == null ? void 0 : _j.call(_i, path2);
3706
+ if (p) {
3707
+ return run(p, path2, false);
3708
+ } else {
3709
+ const request = new XMLHttpRequest();
3710
+ request.open("GET", path2, { isInline: false });
3711
+ request.send(null);
3712
+ if (request.status === 200) {
3713
+ if (path2.endsWith(".css")) {
3714
+ injectGlobal(res);
3715
+ return;
3716
+ }
3717
+ return run(request.responseText, path2, false);
3718
+ }
3704
3719
  }
3705
3720
  }
3706
3721
  }
@@ -5628,21 +5643,27 @@ function processImportExports(node3, jsx2) {
5628
5643
  node3.out[i2] = null;
5629
5644
  node3.out[m.index].cjs = "module.exports.default =";
5630
5645
  continue;
5631
- case "V":
5632
- case "F":
5633
- const j = i2;
5634
- const type = s[i2] === "F" ? `= ${node3.out[i2]} ` : "";
5646
+ case "V": {
5647
+ const tp = node3.out[i2];
5635
5648
  node3.out[i2] = null;
5636
5649
  i2++;
5637
5650
  skip_spaces();
5638
5651
  const name = node3.out[i2];
5639
- if (s[j] === "V") {
5640
- node3.out[i2] = null;
5641
- i2++;
5642
- }
5652
+ node3.out[i2] = null;
5653
+ i2++;
5643
5654
  skip_spaces();
5644
- node3.out[m.index].cjs = `module.exports.${name} ${type}`;
5655
+ node3.out[m.index].cjs = `${tp} ${name} = module.exports.${name} `;
5645
5656
  continue;
5657
+ }
5658
+ case "F": {
5659
+ const tp = node3.out[i2];
5660
+ node3.out[i2] = null;
5661
+ i2++;
5662
+ skip_spaces();
5663
+ const name = node3.out[i2];
5664
+ node3.out[m.index].cjs = `module.exports.${name} = ${tp} `;
5665
+ continue;
5666
+ }
5646
5667
  case "*":
5647
5668
  node3.out[i2] = null;
5648
5669
  i2++;
@@ -5669,16 +5690,16 @@ function processImportExports(node3, jsx2) {
5669
5690
  props_regexp.lastIndex = -1;
5670
5691
  if (!props_regexp.test(sj)) throw "incorrect export properties definition.";
5671
5692
  const ps = node3.out[i2].out;
5672
- for (let j2 = 1; j2 < sj.length - 1; j2++) {
5673
- while (sj[j2] === " " || sj[j2] === "\n" || sj[j2] === "C" || sj[j2] === ",") j2++;
5674
- const prop = ps[j2];
5675
- j2++;
5676
- while (sj[j2] === " " || sj[j2] === "\n" || sj[j2] === "C") j2++;
5677
- if (sj[j2] === "a") {
5678
- j2++;
5679
- while (sj[j2] === " " || sj[j2] === "\n" || sj[j2] === "C") j2++;
5680
- exports[ps[j2]] = prop;
5681
- j2++;
5693
+ for (let j = 1; j < sj.length - 1; j++) {
5694
+ while (sj[j] === " " || sj[j] === "\n" || sj[j] === "C" || sj[j] === ",") j++;
5695
+ const prop = ps[j];
5696
+ j++;
5697
+ while (sj[j] === " " || sj[j] === "\n" || sj[j] === "C") j++;
5698
+ if (sj[j] === "a") {
5699
+ j++;
5700
+ while (sj[j] === " " || sj[j] === "\n" || sj[j] === "C") j++;
5701
+ exports[ps[j]] = prop;
5702
+ j++;
5682
5703
  } else {
5683
5704
  exports[prop] = prop;
5684
5705
  }