lilact 0.26.4 → 0.26.6
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/dist/lilact.development.js +51 -30
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +27 -27
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +27 -27
- package/docs/functions/errors.globalErrorHandler.html +1 -1
- package/docs/functions/errors.traceError.html +1 -1
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/timers.timeoutPromise.html +3 -3
- package/docs/static/demos/lazy.jsx +2 -2
- package/docs/static/index.html +12 -12
- package/docs/static/lilact.development.js +51 -30
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +27 -27
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +27 -27
- package/examples/demos/lazy.jsx +2 -2
- package/examples/index.html +12 -12
- package/examples/lilact.development.js +51 -30
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +27 -27
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +27 -27
- package/package.json +1 -1
- package/src/errors.jsx +4 -2
- package/src/events.jsx +8 -4
- package/src/expscan.js +31 -18
- package/src/run.jsx +33 -21
|
@@ -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
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
}
|
|
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
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
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
|
}
|
|
@@ -5604,7 +5619,7 @@ function processImportExports(node3, jsx2) {
|
|
|
5604
5619
|
o += "}";
|
|
5605
5620
|
ls += "]";
|
|
5606
5621
|
cjs += `const ${o} = require(${src}, {checkExport: ${ls},requirer:module})`;
|
|
5607
|
-
} else {
|
|
5622
|
+
} else if (cjs.length === 0) {
|
|
5608
5623
|
cjs += `require(${src},{requirer:module})`;
|
|
5609
5624
|
}
|
|
5610
5625
|
node3.out[m.index].cjs = cjs;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
}
|
|
5652
|
+
node3.out[i2] = null;
|
|
5653
|
+
i2++;
|
|
5654
|
+
skip_spaces();
|
|
5655
|
+
node3.out[m.index].cjs = `${tp} ${name} = module.exports.${name} `;
|
|
5656
|
+
continue;
|
|
5657
|
+
}
|
|
5658
|
+
case "F": {
|
|
5659
|
+
const tp = node3.out[i2];
|
|
5660
|
+
node3.out[i2] = null;
|
|
5661
|
+
i2++;
|
|
5643
5662
|
skip_spaces();
|
|
5644
|
-
node3.out[
|
|
5663
|
+
const name = node3.out[i2];
|
|
5664
|
+
node3.out[m.index].cjs = `module.exports.${name} = ${tp} `;
|
|
5645
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
|
|
5673
|
-
while (sj[
|
|
5674
|
-
const prop = ps[
|
|
5675
|
-
|
|
5676
|
-
while (sj[
|
|
5677
|
-
if (sj[
|
|
5678
|
-
|
|
5679
|
-
while (sj[
|
|
5680
|
-
exports[ps[
|
|
5681
|
-
|
|
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
|
}
|