lilact 0.26.15 → 0.27.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.
- package/dist/lilact.development.js +459 -324
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +63 -54
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +63 -54
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +11 -11
- package/docs/classes/components.HTMLComponent.html +11 -11
- package/docs/classes/components.RootComponent.html +11 -11
- package/docs/functions/components.cloneComponent.html +1 -1
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createPortal.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.memo.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/functions/errors.globalErrorHandler.html +1 -8
- package/docs/functions/errors.scanBlockLabels.html +1 -0
- package/docs/functions/errors.traceError.html +1 -7
- package/docs/functions/hooks.startTransition.html +1 -1
- package/docs/functions/hooks.useActionState.html +1 -1
- package/docs/functions/hooks.useDebugValue.html +1 -1
- package/docs/functions/hooks.useDeferredValue.html +1 -1
- package/docs/functions/hooks.useEffect.html +1 -1
- package/docs/functions/hooks.useImperativeHandle.html +1 -1
- package/docs/functions/hooks.useInsertionEffect.html +1 -1
- package/docs/functions/hooks.useMemo.html +1 -1
- package/docs/functions/hooks.useReducer.html +1 -1
- package/docs/functions/run.lazy.html +1 -13
- package/docs/functions/run.require.html +1 -9
- package/docs/functions/run.run.html +1 -5
- package/docs/functions/run.runScripts.html +1 -7
- package/docs/functions/timers.timeoutPromise.html +3 -3
- package/docs/modules/errors.html +1 -1
- package/docs/modules/run.html +1 -1
- package/docs/static/index.html +1 -1
- package/docs/static/lilact.development.js +459 -324
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +63 -54
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +63 -54
- package/docs/variables/components.cloneElement.html +1 -1
- package/docs/variables/errors.blocks_info.html +1 -0
- package/docs/variables/errors.error.html +1 -0
- package/docs/variables/run.required_scripts.html +1 -0
- package/examples/index.html +1 -1
- package/examples/lilact.development.js +459 -324
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +63 -54
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +63 -54
- package/package.json +1 -1
- package/src/components.jsx +10 -4
- package/src/errors.jsx +344 -245
- package/src/expscan.js +1 -1
- package/src/hooks.jsx +8 -5
- package/src/jsx.js +16 -16
- package/src/lilact.jsx +2 -2
- package/src/run.jsx +313 -267
|
@@ -1417,9 +1417,9 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
1417
1417
|
case "function": {
|
|
1418
1418
|
if (mergedProps !== void 0) {
|
|
1419
1419
|
var previousCursor = cursor;
|
|
1420
|
-
var
|
|
1420
|
+
var result2 = interpolation(mergedProps);
|
|
1421
1421
|
cursor = previousCursor;
|
|
1422
|
-
return handleInterpolation(mergedProps, registered,
|
|
1422
|
+
return handleInterpolation(mergedProps, registered, result2);
|
|
1423
1423
|
}
|
|
1424
1424
|
break;
|
|
1425
1425
|
}
|
|
@@ -1927,8 +1927,8 @@ var forwardRef = (render2) => {
|
|
|
1927
1927
|
};
|
|
1928
1928
|
function getComponentByPointer() {
|
|
1929
1929
|
let resolve_func;
|
|
1930
|
-
const pr = new Promise((
|
|
1931
|
-
resolve_func =
|
|
1930
|
+
const pr = new Promise((res, rej) => {
|
|
1931
|
+
resolve_func = res;
|
|
1932
1932
|
});
|
|
1933
1933
|
function click_handler(event2) {
|
|
1934
1934
|
event2.stopImmediatePropagation();
|
|
@@ -2528,8 +2528,8 @@ var ComponentCore = class {
|
|
|
2528
2528
|
this.outlet.splice(i2, 1);
|
|
2529
2529
|
i2--;
|
|
2530
2530
|
} else if (typeof item === "function") {
|
|
2531
|
-
const
|
|
2532
|
-
this.outlet.splice(i2, 1,
|
|
2531
|
+
const res = this.childFunctionHandler(item);
|
|
2532
|
+
this.outlet.splice(i2, 1, res);
|
|
2533
2533
|
i2--;
|
|
2534
2534
|
} else if (item.constructor.name === "Array") {
|
|
2535
2535
|
this.outlet.splice(i2, 1, ...item);
|
|
@@ -2579,24 +2579,25 @@ var ComponentCore = class {
|
|
|
2579
2579
|
if (this.outlet !== void 0) {
|
|
2580
2580
|
for (let c of this.outlet) {
|
|
2581
2581
|
if (c.cleanup) {
|
|
2582
|
-
c.cleanup();
|
|
2582
|
+
promises.push(c.cleanup());
|
|
2583
2583
|
}
|
|
2584
2584
|
}
|
|
2585
2585
|
}
|
|
2586
2586
|
if (((_c = this.props) == null ? void 0 : _c.children) !== void 0) {
|
|
2587
2587
|
for (let c of this.props.children) {
|
|
2588
2588
|
if (c.cleanup) {
|
|
2589
|
-
c.cleanup();
|
|
2589
|
+
promises.push(c.cleanup());
|
|
2590
2590
|
}
|
|
2591
2591
|
}
|
|
2592
2592
|
}
|
|
2593
2593
|
if (this.hooks !== void 0) {
|
|
2594
2594
|
for (let h of this.hooks) {
|
|
2595
2595
|
if (h.cleanup) {
|
|
2596
|
-
h.cleanup();
|
|
2596
|
+
promises.push(h.cleanup());
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
2599
|
}
|
|
2600
|
+
await Promise.all(promises);
|
|
2600
2601
|
} catch (e) {
|
|
2601
2602
|
throw e;
|
|
2602
2603
|
}
|
|
@@ -2627,7 +2628,7 @@ var ComponentCore = class {
|
|
|
2627
2628
|
if (events_set.has(al)) {
|
|
2628
2629
|
this.event_detachers[al]();
|
|
2629
2630
|
} else {
|
|
2630
|
-
this.element.
|
|
2631
|
+
this.element.removeAttribute(a);
|
|
2631
2632
|
}
|
|
2632
2633
|
}
|
|
2633
2634
|
}
|
|
@@ -2670,6 +2671,7 @@ var ComponentCore = class {
|
|
|
2670
2671
|
}
|
|
2671
2672
|
} else if (boolean_html_attributes_set.has(a)) {
|
|
2672
2673
|
this.element[a] = toBool(patch[a]);
|
|
2674
|
+
if (!this.element[a]) this.element.removeAttribute(a);
|
|
2673
2675
|
} else if (a === "autoFocus") {
|
|
2674
2676
|
this.element["autofocus"] = toBool(patch[a]);
|
|
2675
2677
|
} else if (a === "htmlFor") {
|
|
@@ -3443,7 +3445,7 @@ function useRef(initialValue = null) {
|
|
|
3443
3445
|
return hk;
|
|
3444
3446
|
}
|
|
3445
3447
|
async function useLayoutEffect(effect, deps = void 0) {
|
|
3446
|
-
if (deps !== void 0 && (typeof deps !== "object"
|
|
3448
|
+
if (deps !== void 0 && (typeof deps !== "object" && deps.constructor.name !== "Array")) {
|
|
3447
3449
|
throw new Error("Layout effect dependencies must be an array, object or omitted.");
|
|
3448
3450
|
}
|
|
3449
3451
|
const hk = useHook();
|
|
@@ -3452,6 +3454,7 @@ async function useLayoutEffect(effect, deps = void 0) {
|
|
|
3452
3454
|
}
|
|
3453
3455
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3454
3456
|
await hk.cleanup();
|
|
3457
|
+
hk.cleanup = void 0;
|
|
3455
3458
|
}
|
|
3456
3459
|
hk.deps = deps;
|
|
3457
3460
|
lilact_default.layout_effects.add(async () => {
|
|
@@ -3461,7 +3464,7 @@ async function useLayoutEffect(effect, deps = void 0) {
|
|
|
3461
3464
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
3462
3465
|
}
|
|
3463
3466
|
async function useEffect(effect, deps = void 0) {
|
|
3464
|
-
if (deps !== void 0 && (typeof deps !== "object"
|
|
3467
|
+
if (deps !== void 0 && (typeof deps !== "object" && deps.constructor.name !== "Array")) {
|
|
3465
3468
|
throw new Error("Effect dependencies must be an array, object or omitted.");
|
|
3466
3469
|
}
|
|
3467
3470
|
const hk = useHook();
|
|
@@ -3470,6 +3473,7 @@ async function useEffect(effect, deps = void 0) {
|
|
|
3470
3473
|
}
|
|
3471
3474
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3472
3475
|
await hk.cleanup();
|
|
3476
|
+
hk.cleanup = void 0;
|
|
3473
3477
|
}
|
|
3474
3478
|
hk.deps = deps;
|
|
3475
3479
|
lilact_default.passive_effects.add(async () => {
|
|
@@ -3479,7 +3483,7 @@ async function useEffect(effect, deps = void 0) {
|
|
|
3479
3483
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
3480
3484
|
}
|
|
3481
3485
|
async function useInsertionEffect(effect, deps = void 0) {
|
|
3482
|
-
if (deps !== void 0 && (typeof deps !== "object"
|
|
3486
|
+
if (deps !== void 0 && (typeof deps !== "object" && deps.constructor.name !== "Array")) {
|
|
3483
3487
|
throw new Error("Insertion effect dependencies must be an array, object, or omitted.");
|
|
3484
3488
|
}
|
|
3485
3489
|
const hk = useHook();
|
|
@@ -3488,6 +3492,7 @@ async function useInsertionEffect(effect, deps = void 0) {
|
|
|
3488
3492
|
}
|
|
3489
3493
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3490
3494
|
await hk.cleanup();
|
|
3495
|
+
hk.cleanup = void 0;
|
|
3491
3496
|
}
|
|
3492
3497
|
hk.deps = deps;
|
|
3493
3498
|
lilact_default.insertion_effects.add(async () => {
|
|
@@ -3497,7 +3502,7 @@ async function useInsertionEffect(effect, deps = void 0) {
|
|
|
3497
3502
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
3498
3503
|
}
|
|
3499
3504
|
function useMemo(factory, deps = void 0) {
|
|
3500
|
-
if (deps !== void 0 && (typeof deps !== "object"
|
|
3505
|
+
if (deps !== void 0 && (typeof deps !== "object" && deps.constructor.name !== "Array")) {
|
|
3501
3506
|
throw new Error("Memo dependencies must be an array or omitted.");
|
|
3502
3507
|
}
|
|
3503
3508
|
const hk = useHook();
|
|
@@ -3601,181 +3606,242 @@ __export(run_exports, {
|
|
|
3601
3606
|
runScripts: () => runScripts
|
|
3602
3607
|
});
|
|
3603
3608
|
function joinPaths(basePath, relativePath) {
|
|
3604
|
-
const
|
|
3605
|
-
const
|
|
3606
|
-
|
|
3607
|
-
for (const
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3609
|
+
const absolute = relativePath.startsWith("/");
|
|
3610
|
+
const parts = (absolute ? "" : basePath).split("/").filter(Boolean);
|
|
3611
|
+
if (!absolute && !basePath.endsWith("/")) parts.pop();
|
|
3612
|
+
for (const part of relativePath.split("/")) {
|
|
3613
|
+
if (!part || part === ".") continue;
|
|
3614
|
+
if (part === "..") parts.pop();
|
|
3615
|
+
else parts.push(part);
|
|
3616
|
+
}
|
|
3617
|
+
return `${absolute ? "/" : ""}${parts.join("/")}`;
|
|
3618
|
+
}
|
|
3619
|
+
function asError(value, fallback = "Unknown error") {
|
|
3620
|
+
if (value instanceof Error) return value;
|
|
3621
|
+
if ((value == null ? void 0 : value.error) instanceof Error) return value.error;
|
|
3622
|
+
const error2 = new Error(
|
|
3623
|
+
(value == null ? void 0 : value.message) == null ? fallback : String(value.message)
|
|
3624
|
+
);
|
|
3625
|
+
if (value && typeof value === "object") {
|
|
3626
|
+
if (value.name) error2.name = value.name;
|
|
3627
|
+
if (value.stack) error2.stack = value.stack;
|
|
3628
|
+
for (const key of Object.keys(value)) {
|
|
3629
|
+
if (!(key in error2)) error2[key] = value[key];
|
|
3616
3630
|
}
|
|
3617
3631
|
}
|
|
3618
|
-
return
|
|
3632
|
+
return error2;
|
|
3633
|
+
}
|
|
3634
|
+
function markSource(value, path2) {
|
|
3635
|
+
const error2 = asError(value);
|
|
3636
|
+
if (!error2.lilact_source) {
|
|
3637
|
+
error2.lilact_source = { path: path2 };
|
|
3638
|
+
}
|
|
3639
|
+
return error2;
|
|
3640
|
+
}
|
|
3641
|
+
function report(value, path2) {
|
|
3642
|
+
const error2 = markSource(value, path2);
|
|
3643
|
+
if (error2.isTraced) return error2;
|
|
3644
|
+
if (typeof lilact_default.traceError === "function") {
|
|
3645
|
+
return lilact_default.traceError(error2, path2);
|
|
3646
|
+
}
|
|
3647
|
+
lilact_default.error = error2;
|
|
3648
|
+
return error2;
|
|
3619
3649
|
}
|
|
3620
3650
|
var required_scripts = {};
|
|
3621
|
-
function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
3622
|
-
|
|
3651
|
+
function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
3652
|
+
isInline = true,
|
|
3653
|
+
isModule = true
|
|
3654
|
+
} = {}) {
|
|
3655
|
+
var _a, _b;
|
|
3623
3656
|
const module = {
|
|
3624
|
-
mappings,
|
|
3625
|
-
isInline,
|
|
3626
3657
|
path,
|
|
3627
|
-
code: jsx,
|
|
3628
|
-
|
|
3658
|
+
code: String(jsx),
|
|
3659
|
+
mappings: [],
|
|
3660
|
+
exports: {},
|
|
3661
|
+
isInline,
|
|
3662
|
+
isModule
|
|
3629
3663
|
};
|
|
3630
|
-
let processed;
|
|
3631
3664
|
required_scripts[path] = module;
|
|
3665
|
+
let processed;
|
|
3632
3666
|
try {
|
|
3633
|
-
processed = lilact_default.transpileJSX(
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
);
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3667
|
+
processed = lilact_default.transpileJSX(String(jsx), {
|
|
3668
|
+
path,
|
|
3669
|
+
mappings: module.mappings,
|
|
3670
|
+
factory: "createComponent",
|
|
3671
|
+
appendSourcemap: false,
|
|
3672
|
+
injectTraceLabels: true,
|
|
3673
|
+
produceCJS: true,
|
|
3674
|
+
blocks_info: lilact_default.blocks_info
|
|
3675
|
+
});
|
|
3676
|
+
} catch (value) {
|
|
3677
|
+
const error2 = asError(value);
|
|
3678
|
+
(_a = error2.fileName) != null ? _a : error2.fileName = path;
|
|
3679
|
+
error2.sourcePhase = "transpile";
|
|
3680
|
+
module.error = error2;
|
|
3681
|
+
lilact_default.error = error2;
|
|
3682
|
+
throw error2;
|
|
3648
3683
|
}
|
|
3649
|
-
if (
|
|
3650
|
-
|
|
3684
|
+
if (typeof lilact_default.scanBlockLabels === "function") {
|
|
3685
|
+
lilact_default.scanBlockLabels(processed, path);
|
|
3651
3686
|
}
|
|
3652
|
-
processed +=
|
|
3653
|
-
|
|
3687
|
+
processed += `
|
|
3688
|
+
//# sourceURL=eval:/${path}`;
|
|
3654
3689
|
try {
|
|
3655
3690
|
globalThis.Lilact = lilact_default;
|
|
3656
3691
|
globalThis.createComponent = lilact_default.createComponent;
|
|
3657
3692
|
globalThis.Fragment = lilact_default.Fragment;
|
|
3658
|
-
const
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3693
|
+
const result = eval(processed);
|
|
3694
|
+
return isEmpty(module.exports) ? result : module.exports;
|
|
3695
|
+
} catch (value) {
|
|
3696
|
+
const error2 = report(value, path);
|
|
3697
|
+
(_b = error2.sourcePhase) != null ? _b : error2.sourcePhase = "runtime";
|
|
3698
|
+
module.error = error2;
|
|
3699
|
+
throw error2;
|
|
3664
3700
|
}
|
|
3665
3701
|
}
|
|
3666
3702
|
function require2(path2) {
|
|
3667
|
-
var _a, _b, _c, _d, _e, _f
|
|
3668
|
-
let
|
|
3669
|
-
if (arguments.length === 2 && typeof
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
}
|
|
3675
|
-
|
|
3676
|
-
if (
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
if (
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3703
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3704
|
+
let options = {};
|
|
3705
|
+
if (arguments.length === 2 && arguments[1] && typeof arguments[1] === "object") {
|
|
3706
|
+
options = arguments[1];
|
|
3707
|
+
}
|
|
3708
|
+
if ((_a = lilact_default.importObjectPaths) == null ? void 0 : _a[path2]) {
|
|
3709
|
+
return lilact_default.importObjectPaths[path2];
|
|
3710
|
+
}
|
|
3711
|
+
const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(options.isLazy);
|
|
3712
|
+
if ((_b = options.requirer) == null ? void 0 : _b.path) {
|
|
3713
|
+
path2 = joinPaths(options.requirer.path, path2);
|
|
3714
|
+
}
|
|
3715
|
+
if (required_scripts[path2] && !options.forceUpdate && !loadAsync) {
|
|
3716
|
+
return required_scripts[path2].exports;
|
|
3717
|
+
}
|
|
3718
|
+
if (path2.startsWith("#")) {
|
|
3719
|
+
const element = document.getElementById(path2.slice(1));
|
|
3720
|
+
if (!element) {
|
|
3721
|
+
throw report(
|
|
3722
|
+
new Error(`Required element not found (${path2})`),
|
|
3723
|
+
path2
|
|
3724
|
+
);
|
|
3725
|
+
}
|
|
3726
|
+
return run(element.textContent || "", path2);
|
|
3727
|
+
}
|
|
3728
|
+
if (loadAsync) {
|
|
3729
|
+
lilact_default[LAZY] = false;
|
|
3730
|
+
let request2 = (_d = (_c = lilact_default).resolver) == null ? void 0 : _d.call(_c, path2);
|
|
3731
|
+
if (request2 == null) {
|
|
3732
|
+
if (required_scripts[path2] && !options.forceUpdate) {
|
|
3733
|
+
request2 = Promise.resolve(required_scripts[path2].code);
|
|
3692
3734
|
} else {
|
|
3693
|
-
|
|
3694
|
-
if (!
|
|
3695
|
-
|
|
3735
|
+
request2 = fetch(path2).then((response) => {
|
|
3736
|
+
if (!response.ok) {
|
|
3737
|
+
throw report(
|
|
3738
|
+
new Error(
|
|
3739
|
+
`Unable to load ${path2}: HTTP ${response.status}`
|
|
3740
|
+
),
|
|
3741
|
+
path2
|
|
3742
|
+
);
|
|
3743
|
+
}
|
|
3744
|
+
return response.text();
|
|
3696
3745
|
});
|
|
3697
3746
|
}
|
|
3698
|
-
return p.then((res2) => {
|
|
3699
|
-
var _a2;
|
|
3700
|
-
if (path2.endsWith(".css")) {
|
|
3701
|
-
injectGlobal(res2);
|
|
3702
|
-
return;
|
|
3703
|
-
}
|
|
3704
|
-
res2 = run(res2, path2, { isInline: false });
|
|
3705
|
-
return (_a2 = res2 == null ? void 0 : res2.default) != null ? _a2 : res2;
|
|
3706
|
-
}).catch((err) => {
|
|
3707
|
-
throw err;
|
|
3708
|
-
});
|
|
3709
3747
|
} else {
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
}
|
|
3726
|
-
return run(request.responseText, path2, { isInline: false });
|
|
3727
|
-
}
|
|
3748
|
+
request2 = Promise.resolve(request2);
|
|
3749
|
+
}
|
|
3750
|
+
return request2.then((source) => {
|
|
3751
|
+
if (path2.endsWith(".css")) {
|
|
3752
|
+
injectGlobal(String(source));
|
|
3753
|
+
return;
|
|
3754
|
+
}
|
|
3755
|
+
return run(String(source), path2, {
|
|
3756
|
+
isInline: false,
|
|
3757
|
+
isModule: true
|
|
3758
|
+
});
|
|
3759
|
+
}).then(
|
|
3760
|
+
(result2) => {
|
|
3761
|
+
var _a2;
|
|
3762
|
+
return (_a2 = result2 == null ? void 0 : result2.default) != null ? _a2 : result2;
|
|
3728
3763
|
}
|
|
3764
|
+
).catch((error2) => {
|
|
3765
|
+
throw report(error2, path2);
|
|
3766
|
+
});
|
|
3767
|
+
}
|
|
3768
|
+
const resolved = (_f = (_e = lilact_default).resolver) == null ? void 0 : _f.call(_e, path2);
|
|
3769
|
+
if (resolved != null) {
|
|
3770
|
+
if (path2.endsWith(".css")) {
|
|
3771
|
+
injectGlobal(String(resolved));
|
|
3772
|
+
return;
|
|
3729
3773
|
}
|
|
3774
|
+
return run(String(resolved), path2, {
|
|
3775
|
+
isInline: false,
|
|
3776
|
+
isModule: true
|
|
3777
|
+
});
|
|
3730
3778
|
}
|
|
3731
|
-
|
|
3779
|
+
const request = new XMLHttpRequest();
|
|
3780
|
+
try {
|
|
3781
|
+
request.open("GET", path2, false);
|
|
3782
|
+
request.send(null);
|
|
3783
|
+
} catch (value) {
|
|
3784
|
+
throw report(value, path2);
|
|
3785
|
+
}
|
|
3786
|
+
if (request.status >= 200 && request.status < 300) {
|
|
3787
|
+
if (path2.endsWith(".css")) {
|
|
3788
|
+
injectGlobal(request.responseText);
|
|
3789
|
+
return;
|
|
3790
|
+
}
|
|
3791
|
+
return run(request.responseText, path2, {
|
|
3792
|
+
isInline: false,
|
|
3793
|
+
isModule: true
|
|
3794
|
+
});
|
|
3795
|
+
}
|
|
3796
|
+
throw report(
|
|
3797
|
+
new Error(`Unable to load ${path2}: HTTP ${request.status || 0}`),
|
|
3798
|
+
path2
|
|
3799
|
+
);
|
|
3732
3800
|
}
|
|
3733
3801
|
function lazy(factory) {
|
|
3734
3802
|
let status = "pending";
|
|
3735
|
-
let
|
|
3803
|
+
let result2;
|
|
3736
3804
|
lilact_default[LAZY] = true;
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3805
|
+
try {
|
|
3806
|
+
result2 = factory();
|
|
3807
|
+
} catch (error2) {
|
|
3808
|
+
status = "error";
|
|
3809
|
+
result2 = error2;
|
|
3810
|
+
}
|
|
3811
|
+
if (lilact_default.isThenable(result2)) {
|
|
3812
|
+
result2.then(
|
|
3813
|
+
(value) => {
|
|
3741
3814
|
status = "success";
|
|
3742
|
-
|
|
3743
|
-
return result;
|
|
3815
|
+
result2 = value;
|
|
3744
3816
|
},
|
|
3745
|
-
(
|
|
3817
|
+
(error2) => {
|
|
3746
3818
|
status = "error";
|
|
3747
|
-
|
|
3748
|
-
throw err;
|
|
3819
|
+
result2 = error2;
|
|
3749
3820
|
}
|
|
3750
3821
|
);
|
|
3751
|
-
} else {
|
|
3822
|
+
} else if (status !== "error") {
|
|
3752
3823
|
status = "success";
|
|
3753
3824
|
}
|
|
3754
3825
|
function LazyComponent(props) {
|
|
3755
|
-
if (status === "pending") throw
|
|
3756
|
-
if (status === "error") throw
|
|
3757
|
-
const Component2 =
|
|
3826
|
+
if (status === "pending") throw result2;
|
|
3827
|
+
if (status === "error") throw result2;
|
|
3828
|
+
const Component2 = result2;
|
|
3758
3829
|
return createComponent(Component2, { ...props });
|
|
3759
3830
|
}
|
|
3760
3831
|
return LazyComponent;
|
|
3761
3832
|
}
|
|
3762
|
-
function
|
|
3763
|
-
|
|
3833
|
+
function scriptTags() {
|
|
3834
|
+
return Array.from(
|
|
3764
3835
|
document.querySelectorAll('script[type="text/jsx"]')
|
|
3765
|
-
)
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
src: (_a = el.getAttribute("src")) != null ? _a : null,
|
|
3770
|
-
content: (_b = el.textContent) != null ? _b : ""
|
|
3771
|
-
};
|
|
3772
|
-
});
|
|
3836
|
+
).map((element) => ({
|
|
3837
|
+
src: element.getAttribute("src"),
|
|
3838
|
+
content: element.textContent || ""
|
|
3839
|
+
}));
|
|
3773
3840
|
}
|
|
3774
3841
|
function runScripts() {
|
|
3775
|
-
const
|
|
3776
|
-
|
|
3777
|
-
if (
|
|
3778
|
-
if (s.content) run(s.content);
|
|
3842
|
+
for (const script of scriptTags()) {
|
|
3843
|
+
if (script.src) require2(script.src);
|
|
3844
|
+
if (script.content) run(script.content);
|
|
3779
3845
|
}
|
|
3780
3846
|
}
|
|
3781
3847
|
|
|
@@ -3922,8 +3988,8 @@ function releaseTimers() {
|
|
|
3922
3988
|
}
|
|
3923
3989
|
function timeoutPromise(duration = 0, timerSource = Lilact) {
|
|
3924
3990
|
let id, resolve, reject;
|
|
3925
|
-
const promise = new Promise((
|
|
3926
|
-
resolve =
|
|
3991
|
+
const promise = new Promise((res, rej) => {
|
|
3992
|
+
resolve = res;
|
|
3927
3993
|
reject = rej;
|
|
3928
3994
|
id = timerSource.setTimeout(() => {
|
|
3929
3995
|
resolve();
|
|
@@ -4331,8 +4397,8 @@ function wrapListener(fn, opts = {}) {
|
|
|
4331
4397
|
const currentTarget = this || nativeEvent.currentTarget || null;
|
|
4332
4398
|
const sEvent = createSyntheticEvent(nativeEvent, currentTarget);
|
|
4333
4399
|
try {
|
|
4334
|
-
const
|
|
4335
|
-
if (stopPropagationOnTrueReturn &&
|
|
4400
|
+
const result2 = fn(sEvent);
|
|
4401
|
+
if (stopPropagationOnTrueReturn && result2 === true) {
|
|
4336
4402
|
sEvent.stopPropagation();
|
|
4337
4403
|
}
|
|
4338
4404
|
} finally {
|
|
@@ -4450,163 +4516,232 @@ __export(errors_exports, {
|
|
|
4450
4516
|
scanBlockLabels: () => scanBlockLabels,
|
|
4451
4517
|
traceError: () => traceError
|
|
4452
4518
|
});
|
|
4453
|
-
function
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4519
|
+
function number(value) {
|
|
4520
|
+
const result2 = Number(value);
|
|
4521
|
+
return Number.isFinite(result2) ? result2 : null;
|
|
4522
|
+
}
|
|
4523
|
+
function asError2(value) {
|
|
4524
|
+
if (value instanceof Error) return value;
|
|
4525
|
+
if ((value == null ? void 0 : value.error) instanceof Error) return value.error;
|
|
4526
|
+
const error2 = new Error(
|
|
4527
|
+
(value == null ? void 0 : value.message) == null ? String(value) : String(value.message)
|
|
4528
|
+
);
|
|
4529
|
+
if (value && typeof value === "object") {
|
|
4530
|
+
if (value.name) error2.name = value.name;
|
|
4531
|
+
if (value.stack) error2.stack = value.stack;
|
|
4532
|
+
for (const key of Object.keys(value)) {
|
|
4533
|
+
if (!(key in error2)) error2[key] = value[key];
|
|
4534
|
+
}
|
|
4462
4535
|
}
|
|
4463
|
-
|
|
4464
|
-
|
|
4536
|
+
return error2;
|
|
4537
|
+
}
|
|
4538
|
+
function isParserError(error2) {
|
|
4539
|
+
return (error2 == null ? void 0 : error2.name) === "JSXParserError";
|
|
4540
|
+
}
|
|
4541
|
+
function stackLocation(stack) {
|
|
4542
|
+
if (typeof stack !== "string") return null;
|
|
4543
|
+
for (const line2 of stack.split(/\r?\n/)) {
|
|
4544
|
+
const match2 = line2.match(/(eval:\/.*):(\d+):(\d+)/);
|
|
4545
|
+
if (!match2) continue;
|
|
4546
|
+
return {
|
|
4547
|
+
path: match2[1].replace(/^eval:\/+/, ""),
|
|
4548
|
+
line: Number(match2[2]) - 1,
|
|
4549
|
+
column: Number(match2[3]) - 1
|
|
4550
|
+
};
|
|
4465
4551
|
}
|
|
4466
4552
|
return null;
|
|
4467
4553
|
}
|
|
4468
|
-
function
|
|
4469
|
-
|
|
4470
|
-
const
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4554
|
+
function browserLocation(error2) {
|
|
4555
|
+
var _a, _b, _c, _d;
|
|
4556
|
+
const line2 = number(
|
|
4557
|
+
(_b = (_a = error2 == null ? void 0 : error2.lineNumber) != null ? _a : error2 == null ? void 0 : error2.lineno) != null ? _b : error2 == null ? void 0 : error2.line
|
|
4558
|
+
);
|
|
4559
|
+
const column2 = number(
|
|
4560
|
+
(_d = (_c = error2 == null ? void 0 : error2.columnNumber) != null ? _c : error2 == null ? void 0 : error2.colno) != null ? _d : error2 == null ? void 0 : error2.column
|
|
4561
|
+
);
|
|
4562
|
+
return {
|
|
4563
|
+
line: line2 == null ? null : Math.max(0, line2 - 1),
|
|
4564
|
+
column: column2 == null ? null : Math.max(0, column2 - 1)
|
|
4565
|
+
};
|
|
4566
|
+
}
|
|
4567
|
+
function traceBlock(error2) {
|
|
4568
|
+
const trace = error2 == null ? void 0 : error2.lilact_trace;
|
|
4569
|
+
return Array.isArray(trace) ? trace[0] : trace;
|
|
4570
|
+
}
|
|
4571
|
+
function blockInfo(error2) {
|
|
4572
|
+
var _a, _b;
|
|
4573
|
+
const trace = traceBlock(error2);
|
|
4574
|
+
return trace == null ? null : (_b = (_a = lilact_default.blocks_info) == null ? void 0 : _a.labels) == null ? void 0 : _b[trace];
|
|
4575
|
+
}
|
|
4576
|
+
function mapLocation(mappings, line2, column2) {
|
|
4577
|
+
if (!Array.isArray(mappings) || !mappings.length || !Number.isFinite(line2) || !Number.isFinite(column2)) {
|
|
4578
|
+
return { line: line2, column: column2 };
|
|
4579
|
+
}
|
|
4580
|
+
const valid = mappings.filter(
|
|
4581
|
+
(mapping) => Array.isArray(mapping) && mapping.length >= 4 && mapping.slice(0, 4).every((value) => Number.isFinite(Number(value)))
|
|
4582
|
+
).sort(
|
|
4583
|
+
(a, b2) => Number(a[0]) - Number(b2[0]) || Number(a[1]) - Number(b2[1])
|
|
4584
|
+
);
|
|
4585
|
+
if (!valid.length) return { line: line2, column: column2 };
|
|
4586
|
+
let selected = valid[0];
|
|
4587
|
+
for (const mapping of valid) {
|
|
4588
|
+
const generatedLine2 = Number(mapping[0]);
|
|
4589
|
+
const generatedColumn2 = Number(mapping[1]);
|
|
4590
|
+
if (generatedLine2 < line2 || generatedLine2 === line2 && generatedColumn2 <= column2) {
|
|
4591
|
+
selected = mapping;
|
|
4592
|
+
} else {
|
|
4495
4593
|
break;
|
|
4496
4594
|
}
|
|
4497
4595
|
}
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
(
|
|
4505
|
-
|
|
4506
|
-
path: path2,
|
|
4507
|
-
desc: x[4]
|
|
4508
|
-
};
|
|
4509
|
-
}
|
|
4510
|
-
);
|
|
4596
|
+
const generatedLine = Number(selected[0]);
|
|
4597
|
+
const generatedColumn = Number(selected[1]);
|
|
4598
|
+
const sourceLine = Number(selected[2]);
|
|
4599
|
+
const sourceColumn = Number(selected[3]);
|
|
4600
|
+
return {
|
|
4601
|
+
line: sourceLine + (line2 === generatedLine ? 0 : line2 - generatedLine),
|
|
4602
|
+
column: line2 === generatedLine ? Math.max(0, sourceColumn + column2 - generatedColumn) : sourceColumn
|
|
4603
|
+
};
|
|
4511
4604
|
}
|
|
4512
|
-
function traceError(
|
|
4513
|
-
var _a;
|
|
4514
|
-
if (
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
const
|
|
4518
|
-
const
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4605
|
+
function traceError(value, runPath) {
|
|
4606
|
+
var _a, _b, _c, _d, _e, _f;
|
|
4607
|
+
if (value == null ? void 0 : value.isTraced) return value;
|
|
4608
|
+
const error2 = asError2(value);
|
|
4609
|
+
const source = error2.lilact_source;
|
|
4610
|
+
const stack = isParserError(error2) ? null : stackLocation(error2.stack);
|
|
4611
|
+
const browser = isParserError(error2) ? {
|
|
4612
|
+
line: number(error2.lineNumber),
|
|
4613
|
+
column: number(error2.columnNumber)
|
|
4614
|
+
} : browserLocation(error2);
|
|
4615
|
+
const fileName = (source == null ? void 0 : source.path) || (stack == null ? void 0 : stack.path) || error2.fileName || runPath || null;
|
|
4616
|
+
let line2 = (_b = (_a = stack == null ? void 0 : stack.line) != null ? _a : browser.line) != null ? _b : null;
|
|
4617
|
+
let column2 = (_d = (_c = stack == null ? void 0 : stack.column) != null ? _c : browser.column) != null ? _d : null;
|
|
4618
|
+
const result2 = {
|
|
4619
|
+
fileName,
|
|
4620
|
+
lineNumber: line2,
|
|
4621
|
+
columnNumber: column2,
|
|
4622
|
+
message: error2.message == null ? String(error2) : String(error2.message),
|
|
4623
|
+
name: error2.name || "Error",
|
|
4624
|
+
stack: error2.stack || null,
|
|
4625
|
+
lilact_source: source || null,
|
|
4525
4626
|
_error: error2,
|
|
4526
|
-
|
|
4627
|
+
isTraced: true
|
|
4527
4628
|
};
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4629
|
+
const module2 = fileName && required_scripts[fileName];
|
|
4630
|
+
if (module2) {
|
|
4631
|
+
const mapped = mapLocation(
|
|
4632
|
+
module2.mappings,
|
|
4633
|
+
result2.lineNumber,
|
|
4634
|
+
result2.columnNumber
|
|
4635
|
+
);
|
|
4636
|
+
result2.lineNumber = mapped.line;
|
|
4637
|
+
result2.columnNumber = mapped.column;
|
|
4638
|
+
}
|
|
4639
|
+
const block = blockInfo(error2);
|
|
4640
|
+
if (block && (result2.lineNumber == null || result2.columnNumber == null || !result2.fileName)) {
|
|
4641
|
+
result2.fileName || (result2.fileName = block.path || runPath || null);
|
|
4642
|
+
(_e = result2.lineNumber) != null ? _e : result2.lineNumber = block.line;
|
|
4643
|
+
(_f = result2.columnNumber) != null ? _f : result2.columnNumber = block.col;
|
|
4644
|
+
result2.label = block.desc;
|
|
4645
|
+
}
|
|
4646
|
+
lilact_default.error = result2;
|
|
4647
|
+
return result2;
|
|
4648
|
+
}
|
|
4649
|
+
function escapeHtml(value) {
|
|
4650
|
+
return String(value != null ? value : "").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4651
|
+
}
|
|
4652
|
+
function sourceExcerpt(module2, line2) {
|
|
4653
|
+
var _a, _b, _c, _d;
|
|
4654
|
+
if (!module2 || !Number.isFinite(line2)) return null;
|
|
4655
|
+
const lines = String((_a = module2.code) != null ? _a : "").split(/\r?\n/);
|
|
4656
|
+
return {
|
|
4657
|
+
before: (_b = lines[line2 - 1]) != null ? _b : "",
|
|
4658
|
+
current: (_c = lines[line2]) != null ? _c : "",
|
|
4659
|
+
after: (_d = lines[line2 + 1]) != null ? _d : ""
|
|
4660
|
+
};
|
|
4661
|
+
}
|
|
4662
|
+
function globalErrorHandler(eventOrError) {
|
|
4663
|
+
var _a, _b;
|
|
4664
|
+
const value = (eventOrError == null ? void 0 : eventOrError.error) instanceof Error ? eventOrError.error : (eventOrError == null ? void 0 : eventOrError.reason) !== void 0 ? eventOrError.reason : eventOrError;
|
|
4665
|
+
const error2 = traceError(
|
|
4666
|
+
value,
|
|
4667
|
+
(eventOrError == null ? void 0 : eventOrError.fileName) || null
|
|
4668
|
+
);
|
|
4669
|
+
const excerpt = sourceExcerpt(
|
|
4670
|
+
required_scripts[error2.fileName],
|
|
4671
|
+
error2.lineNumber
|
|
4672
|
+
);
|
|
4673
|
+
const className = css(`
|
|
4674
|
+
background: linear-gradient(135deg, #fff2f2d4, #ffffffd4);
|
|
4675
|
+
backdrop-filter: blur(10px);
|
|
4676
|
+
border: 1px solid rgba(255,255,255,.25);
|
|
4677
|
+
border-radius: 5px;
|
|
4678
|
+
box-shadow: 0 10px 30px rgba(0,0,0,.35);
|
|
4679
|
+
overflow: hidden;
|
|
4680
|
+
min-width: 400px;
|
|
4681
|
+
width: 66%;
|
|
4682
|
+
|
|
4683
|
+
red {
|
|
4684
|
+
color: #d00;
|
|
4555
4685
|
}
|
|
4686
|
+
|
|
4687
|
+
code {
|
|
4688
|
+
border: 1px solid #0003;
|
|
4689
|
+
overflow: auto;
|
|
4690
|
+
padding: 10px;
|
|
4691
|
+
display: block;
|
|
4692
|
+
}
|
|
4693
|
+
`);
|
|
4694
|
+
const dialog = document.createElement("dialog");
|
|
4695
|
+
dialog.className = className;
|
|
4696
|
+
const location = error2.fileName ? `At ${escapeHtml(error2.fileName)}` : "";
|
|
4697
|
+
const line2 = Number.isFinite(error2.lineNumber) ? `: Line ${error2.lineNumber + 1}` : "";
|
|
4698
|
+
const componentStack = ((_a = error2._error) == null ? void 0 : _a.componentStackLog) || ((_b = error2._error) == null ? void 0 : _b.componentStack) || "";
|
|
4699
|
+
dialog.innerHTML = `
|
|
4700
|
+
<h3><red>Error!</red></h3>
|
|
4701
|
+
<b>${location}${line2}</b><br><br>
|
|
4702
|
+
<b>${escapeHtml(error2.name)}</b>:
|
|
4703
|
+
<span>${escapeHtml(error2.message)}</span>
|
|
4704
|
+
<br><br>
|
|
4705
|
+
|
|
4706
|
+
${excerpt ? "<code><pre></pre><red><pre></pre></red><pre></pre></code>" : ""}
|
|
4707
|
+
|
|
4708
|
+
${componentStack ? `
|
|
4709
|
+
<br>
|
|
4710
|
+
Component Stack:
|
|
4711
|
+
<br>
|
|
4712
|
+
<code><pre>${escapeHtml(componentStack)}</pre></code>
|
|
4713
|
+
` : ""}
|
|
4714
|
+
`;
|
|
4715
|
+
if (excerpt) {
|
|
4716
|
+
const pre = dialog.querySelectorAll("pre");
|
|
4717
|
+
pre[0].innerText = excerpt.before;
|
|
4718
|
+
pre[1].innerText = excerpt.current;
|
|
4719
|
+
pre[2].innerText = excerpt.after;
|
|
4720
|
+
}
|
|
4721
|
+
document.body.appendChild(dialog);
|
|
4722
|
+
if (typeof dialog.showModal === "function") {
|
|
4723
|
+
dialog.showModal();
|
|
4556
4724
|
} else {
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
width: 66%;
|
|
4578
|
-
red {
|
|
4579
|
-
color:#d00;
|
|
4580
|
-
}
|
|
4581
|
-
code {
|
|
4582
|
-
border: 1px solid #0003;
|
|
4583
|
-
overflow: auto;
|
|
4584
|
-
padding: 10px;
|
|
4585
|
-
display: block;
|
|
4586
|
-
}
|
|
4587
|
-
`);
|
|
4588
|
-
const el = document.createElement("dialog");
|
|
4589
|
-
el.className = cls;
|
|
4590
|
-
el.innerHTML = `<h3 style=""><red>Error!</red></h3>
|
|
4591
|
-
<b>${error2.fileName ? "At " + error2.fileName : ""}
|
|
4592
|
-
${Number.isFinite(error2.lineNumber) ? ": Line " + (error2.lineNumber + 1) : ""}</b><br><br>
|
|
4593
|
-
<b>${error2.name}</b>: <span>${error2.message}</span><br><br>
|
|
4594
|
-
${required_scripts[error2.fileName] ? "<code><pre></pre><pre><red></red></pre><pre></pre></code>" : ""}
|
|
4595
|
-
${error2._error.componentStackLog ? "<br>Component Stack:<br><code><pre>" + error2._error.componentStackLog + "</pre></code>" : ""}
|
|
4596
|
-
`;
|
|
4597
|
-
document.body.appendChild(el);
|
|
4598
|
-
const pres = el.querySelectorAll("pre");
|
|
4599
|
-
if (required_scripts[error2.fileName]) {
|
|
4600
|
-
const lines = required_scripts[error2.fileName].code.split("\n");
|
|
4601
|
-
if (lines == null ? void 0 : lines[error2.lineNumber - 1])
|
|
4602
|
-
pres[0].innerText = lines[error2.lineNumber - 1];
|
|
4603
|
-
if (lines == null ? void 0 : lines[error2.lineNumber]) el.querySelector("pre red").innerText = lines[error2.lineNumber];
|
|
4604
|
-
if (lines == null ? void 0 : lines[error2.lineNumber + 1])
|
|
4605
|
-
pres[2].innerText = lines[error2.lineNumber + 1];
|
|
4606
|
-
}
|
|
4607
|
-
el.showModal();
|
|
4608
|
-
}
|
|
4609
|
-
var blocks_info = { counter: 0, labels: {} };
|
|
4725
|
+
dialog.setAttribute("open", "");
|
|
4726
|
+
}
|
|
4727
|
+
return error2;
|
|
4728
|
+
}
|
|
4729
|
+
function scanBlockLabels(code2, path2) {
|
|
4730
|
+
for (const match2 of String(code2).matchAll(
|
|
4731
|
+
/LILACTBLOCK(\d+):(\d+),(\d+):([^*]+)\*\//gm
|
|
4732
|
+
)) {
|
|
4733
|
+
lilact_default.blocks_info.labels[match2[1]] = {
|
|
4734
|
+
path: path2,
|
|
4735
|
+
line: Number(match2[2]),
|
|
4736
|
+
col: Number(match2[3]),
|
|
4737
|
+
desc: match2[4]
|
|
4738
|
+
};
|
|
4739
|
+
}
|
|
4740
|
+
}
|
|
4741
|
+
var blocks_info = {
|
|
4742
|
+
counter: 0,
|
|
4743
|
+
labels: {}
|
|
4744
|
+
};
|
|
4610
4745
|
var error = null;
|
|
4611
4746
|
|
|
4612
4747
|
// .tmp/src/router.jsx
|
|
@@ -4623,13 +4758,13 @@ __export(router_exports, {
|
|
|
4623
4758
|
var RouterContext = createContext(null);
|
|
4624
4759
|
var RouteContext = createContext({ params: {} });
|
|
4625
4760
|
var createURL = (to) => typeof to === "string" ? to : (to.pathname || "") + (to.search || "") + (to.hash || "");
|
|
4626
|
-
var
|
|
4761
|
+
var escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4627
4762
|
function HashRouter({ children, basename = "" }) {
|
|
4628
4763
|
const readLocation = () => {
|
|
4629
4764
|
var _a;
|
|
4630
4765
|
const raw = window.location.hash || "#/";
|
|
4631
4766
|
const full = raw.slice(1);
|
|
4632
|
-
const baseRe = new RegExp("^" +
|
|
4767
|
+
const baseRe = new RegExp("^" + escapeRegExp(basename));
|
|
4633
4768
|
const withoutBase = full.replace(baseRe, "") || "/";
|
|
4634
4769
|
const [pathAndSearch, hashPart] = withoutBase.split("#");
|
|
4635
4770
|
const [path2, search = ""] = pathAndSearch.split("?");
|
|
@@ -5306,14 +5441,14 @@ function encode(...value) {
|
|
|
5306
5441
|
if (typeof value === "number") {
|
|
5307
5442
|
return encode_integer(value);
|
|
5308
5443
|
}
|
|
5309
|
-
let
|
|
5444
|
+
let result2 = "";
|
|
5310
5445
|
for (let i2 = 0; i2 < value.length; i2 += 1) {
|
|
5311
|
-
|
|
5446
|
+
result2 += encode_integer(value[i2]);
|
|
5312
5447
|
}
|
|
5313
|
-
return
|
|
5448
|
+
return result2;
|
|
5314
5449
|
}
|
|
5315
5450
|
function encode_integer(num) {
|
|
5316
|
-
let
|
|
5451
|
+
let result2 = "";
|
|
5317
5452
|
if (num < 0) {
|
|
5318
5453
|
num = -num << 1 | 1;
|
|
5319
5454
|
} else {
|
|
@@ -5325,9 +5460,9 @@ function encode_integer(num) {
|
|
|
5325
5460
|
if (num > 0) {
|
|
5326
5461
|
clamped |= 32;
|
|
5327
5462
|
}
|
|
5328
|
-
|
|
5463
|
+
result2 += integer_to_char[clamped];
|
|
5329
5464
|
} while (num > 0);
|
|
5330
|
-
return
|
|
5465
|
+
return result2;
|
|
5331
5466
|
}
|
|
5332
5467
|
|
|
5333
5468
|
// .tmp/src/expscan.js
|
|
@@ -5477,7 +5612,7 @@ function labeler(custom_words, x) {
|
|
|
5477
5612
|
if (x.type === "comment") return "C";
|
|
5478
5613
|
if (x.type === "regexp") return "R";
|
|
5479
5614
|
if (x.type === "js") return "J";
|
|
5480
|
-
if (x.type === "
|
|
5615
|
+
if (x.type === "parenthesis") return "P";
|
|
5481
5616
|
if (x.type === "string") return "S";
|
|
5482
5617
|
if (x.type === "xml") return "X";
|
|
5483
5618
|
}
|
|
@@ -5776,7 +5911,7 @@ function lookAhead(f, code2, index2, ...args) {
|
|
|
5776
5911
|
function parseRegex(code, index, container) {
|
|
5777
5912
|
let i = index;
|
|
5778
5913
|
let dels = `;=,([{}!^~&|:?*%-+/<>${transpilerConfig.preprocessorDelimiter}`;
|
|
5779
|
-
while (--i
|
|
5914
|
+
while (--i >= 0) {
|
|
5780
5915
|
if (" \r".indexOf(code[i]) !== -1) continue;
|
|
5781
5916
|
if (code[i] === "\n") {
|
|
5782
5917
|
dels += ")]";
|
|
@@ -6122,8 +6257,8 @@ function parseXML(code2, index2, container2, look_behind = false) {
|
|
|
6122
6257
|
index2++;
|
|
6123
6258
|
skip_spaces();
|
|
6124
6259
|
while (code2[index2] === "/") {
|
|
6125
|
-
const
|
|
6126
|
-
if (
|
|
6260
|
+
const res2 = lookAhead(parseComment, code2, index2);
|
|
6261
|
+
if (res2[0] > index2) index2 = res2[0];
|
|
6127
6262
|
else index2++;
|
|
6128
6263
|
skip_spaces();
|
|
6129
6264
|
}
|
|
@@ -6172,8 +6307,8 @@ function parseXML(code2, index2, container2, look_behind = false) {
|
|
|
6172
6307
|
if (container2) container2.children.push(b2);
|
|
6173
6308
|
return b2;
|
|
6174
6309
|
}
|
|
6175
|
-
const
|
|
6176
|
-
if (
|
|
6310
|
+
const res = lookAhead(parseComment, code2, index2);
|
|
6311
|
+
if (res[0] > index2) index2 = res[0];
|
|
6177
6312
|
else index2++;
|
|
6178
6313
|
break;
|
|
6179
6314
|
case ">":
|
|
@@ -6198,10 +6333,10 @@ function parseXML(code2, index2, container2, look_behind = false) {
|
|
|
6198
6333
|
}
|
|
6199
6334
|
}
|
|
6200
6335
|
}
|
|
6201
|
-
function
|
|
6336
|
+
function parseParenthesis(code2, index2, container2) {
|
|
6202
6337
|
const b2 = {
|
|
6203
6338
|
// block
|
|
6204
|
-
type: "
|
|
6339
|
+
type: "parenthesis",
|
|
6205
6340
|
begin: index2,
|
|
6206
6341
|
cbegin: ++index2,
|
|
6207
6342
|
children: [],
|
|
@@ -6225,7 +6360,7 @@ function parseParanthesis(code2, index2, container2) {
|
|
|
6225
6360
|
[index2] = lookAhead(parseJS, code2, index2, true, b2);
|
|
6226
6361
|
break;
|
|
6227
6362
|
case "(":
|
|
6228
|
-
[index2] = lookAhead(
|
|
6363
|
+
[index2] = lookAhead(parseParenthesis, code2, index2, b2);
|
|
6229
6364
|
break;
|
|
6230
6365
|
case "}":
|
|
6231
6366
|
raiseError(`Unmatched curly bracket`, b2.begin);
|
|
@@ -6247,7 +6382,7 @@ function parseParanthesis(code2, index2, container2) {
|
|
|
6247
6382
|
break;
|
|
6248
6383
|
}
|
|
6249
6384
|
}
|
|
6250
|
-
raiseError(`Unterminated
|
|
6385
|
+
raiseError(`Unterminated parenthesis block`, b2.begin);
|
|
6251
6386
|
}
|
|
6252
6387
|
function parseJS(code2, index2 = 0, is_block = false, container2) {
|
|
6253
6388
|
const b2 = {
|
|
@@ -6277,10 +6412,10 @@ function parseJS(code2, index2 = 0, is_block = false, container2) {
|
|
|
6277
6412
|
break;
|
|
6278
6413
|
}
|
|
6279
6414
|
case "(":
|
|
6280
|
-
[index2] = lookAhead(
|
|
6415
|
+
[index2] = lookAhead(parseParenthesis, code2, index2, b2);
|
|
6281
6416
|
break;
|
|
6282
6417
|
case ")":
|
|
6283
|
-
raiseError(`Unmatched
|
|
6418
|
+
raiseError(`Unmatched parenthesis`, b2.begin);
|
|
6284
6419
|
break;
|
|
6285
6420
|
case "}":
|
|
6286
6421
|
if (is_block) {
|
|
@@ -6332,7 +6467,7 @@ function labelFunctions(node3, eols, blocks_info2) {
|
|
|
6332
6467
|
}
|
|
6333
6468
|
let i2, nxt, prev2;
|
|
6334
6469
|
for (let chi = 0; chi < node3.children.length; chi++) {
|
|
6335
|
-
if (typeof node3.children[chi] === "object" && node3.children[chi].type === "
|
|
6470
|
+
if (typeof node3.children[chi] === "object" && node3.children[chi].type === "parenthesis") {
|
|
6336
6471
|
[i2, prev2] = getNext(chi, -1);
|
|
6337
6472
|
if (prev2 === null) continue;
|
|
6338
6473
|
if (typeof prev2 !== "string" || ["switch", "catch", "try", "class"].find((x) => prev2.trim().endsWith(x)) !== void 0) continue;
|
|
@@ -6354,7 +6489,7 @@ function labelFunctions(node3, eols, blocks_info2) {
|
|
|
6354
6489
|
}
|
|
6355
6490
|
} else if (node3.children[chi] === "=>") {
|
|
6356
6491
|
[i2, prev2] = getNext(chi, -1);
|
|
6357
|
-
if (typeof prev2 === "object" && prev2.type === "
|
|
6492
|
+
if (typeof prev2 === "object" && prev2.type === "parenthesis") {
|
|
6358
6493
|
const begin = getRowCol(eols, prev2.begin);
|
|
6359
6494
|
[i2, nxt] = getNext(chi);
|
|
6360
6495
|
if (typeof nxt === "object" && nxt.type === "js") {
|
|
@@ -6408,7 +6543,7 @@ function getRowCol(eols, i2) {
|
|
|
6408
6543
|
}
|
|
6409
6544
|
return [eols.last - 1, i2 - eols[eols.last - 1]];
|
|
6410
6545
|
}
|
|
6411
|
-
function generateSourceMap(json, path2, jsx_eols, out_eols,
|
|
6546
|
+
function generateSourceMap(json, path2, jsx_eols, out_eols, mappings = []) {
|
|
6412
6547
|
let mpps = [];
|
|
6413
6548
|
const sourcemap = {
|
|
6414
6549
|
"version": 3,
|
|
@@ -6438,7 +6573,7 @@ function generateSourceMap(json, path2, jsx_eols, out_eols, mappings2 = []) {
|
|
|
6438
6573
|
return a[0] - b2[0];
|
|
6439
6574
|
}
|
|
6440
6575
|
);
|
|
6441
|
-
|
|
6576
|
+
mappings.push(...mpps);
|
|
6442
6577
|
let mstr = "";
|
|
6443
6578
|
let r = 0, oc = 0;
|
|
6444
6579
|
let lr = 0, lc = 0;
|
|
@@ -6472,7 +6607,7 @@ function transpileJSX(jsx2, {
|
|
|
6472
6607
|
labels: {},
|
|
6473
6608
|
counter: 0
|
|
6474
6609
|
},
|
|
6475
|
-
mappings
|
|
6610
|
+
mappings = []
|
|
6476
6611
|
} = {}) {
|
|
6477
6612
|
var _a, _b;
|
|
6478
6613
|
(_a = transpilerConfig.preprocessorDelimiter) != null ? _a : transpilerConfig.preprocessorDelimiter = "\u0294";
|
|
@@ -6483,7 +6618,7 @@ function transpileJSX(jsx2, {
|
|
|
6483
6618
|
const er = new Error(msg);
|
|
6484
6619
|
if (logErrors) console.error(`JSXParserError: ${msg} [file ${path2} at line ${rc[0]}]`);
|
|
6485
6620
|
[er.lineNumber, er.columnNumber] = rc;
|
|
6486
|
-
er.name = "
|
|
6621
|
+
er.name = "JSXParserError";
|
|
6487
6622
|
er.fileName = path2;
|
|
6488
6623
|
er.lilact_trace = "parse";
|
|
6489
6624
|
throw er;
|
|
@@ -6551,7 +6686,7 @@ function transpileJSX(jsx2, {
|
|
|
6551
6686
|
if (node3.type === "regex") return jsx2.substring(node3.begin, node3.end);
|
|
6552
6687
|
if (node3.type === "comment") return discardComments || is_attr ? "" : jsx2.substring(node3.begin, node3.end);
|
|
6553
6688
|
if (node3.type === "directive") return node3.value;
|
|
6554
|
-
if (node3.type === "
|
|
6689
|
+
if (node3.type === "parenthesis") {
|
|
6555
6690
|
let out2 = "(";
|
|
6556
6691
|
if (node3.out) {
|
|
6557
6692
|
if (produceCJS) processImportExports(node3, jsx2);
|
|
@@ -6624,7 +6759,7 @@ function transpileJSX(jsx2, {
|
|
|
6624
6759
|
out += `}catch(e){ if(typeof(e)!=='object') e=new Error(e);e.lilact_trace=${blocks_info2.counter};throw e}`;
|
|
6625
6760
|
}
|
|
6626
6761
|
}
|
|
6627
|
-
const inline_sm = generateSourceMap(json, path2, eols, scanEOLs(out),
|
|
6762
|
+
const inline_sm = generateSourceMap(json, path2, eols, scanEOLs(out), mappings);
|
|
6628
6763
|
if (appendSourcemap) {
|
|
6629
6764
|
out += inline_sm;
|
|
6630
6765
|
}
|
|
@@ -6633,7 +6768,7 @@ function transpileJSX(jsx2, {
|
|
|
6633
6768
|
|
|
6634
6769
|
// .tmp/src/lilact.jsx
|
|
6635
6770
|
var Lilact2 = {
|
|
6636
|
-
VERSION: "RC.
|
|
6771
|
+
VERSION: "RC.4",
|
|
6637
6772
|
// Configuration
|
|
6638
6773
|
defaultTransitionTimeout: 300,
|
|
6639
6774
|
defaultIsEqual: Object.is,
|
|
@@ -6674,7 +6809,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
6674
6809
|
});
|
|
6675
6810
|
if (true) {
|
|
6676
6811
|
window.addEventListener("unhandledrejection", (e) => {
|
|
6677
|
-
Lilact2.globalErrorHandler(e
|
|
6812
|
+
Lilact2.globalErrorHandler(e);
|
|
6678
6813
|
});
|
|
6679
6814
|
window.addEventListener("error", (e) => {
|
|
6680
6815
|
Lilact2.globalErrorHandler(e);
|