lilact 0.27.1 → 0.27.3
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 +413 -308
- package/dist/lilact.development.js.map +4 -4
- package/dist/lilact.development.min.js +59 -59
- package/dist/lilact.development.min.js.map +4 -4
- package/dist/lilact.production.min.js +58 -58
- package/docs/classes/accessories.ErrorBoundary.html +3 -3
- package/docs/classes/accessories.Suspense.html +2 -2
- package/docs/classes/components.Component.html +3 -3
- package/docs/classes/components.HTMLComponent.html +4 -4
- package/docs/classes/components.RootComponent.html +5 -5
- 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/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.useId.html +1 -1
- package/docs/functions/hooks.useImperativeHandle.html +1 -1
- package/docs/functions/hooks.useInsertionEffect.html +1 -1
- package/docs/functions/hooks.useLayoutEffect.html +1 -1
- package/docs/functions/hooks.useLocalStorage.html +1 -1
- package/docs/functions/hooks.useMemo.html +1 -1
- package/docs/functions/hooks.useReducer.html +1 -1
- package/docs/functions/hooks.useRef.html +1 -1
- package/docs/functions/hooks.useTransition.html +1 -1
- package/docs/functions/misc.Fragment.html +2 -2
- package/docs/functions/misc.Portal.html +2 -2
- package/docs/functions/misc.deepEqual.html +1 -1
- package/docs/functions/misc.findDOMNode.html +1 -1
- package/docs/functions/misc.forwardRef.html +1 -1
- package/docs/functions/misc.getComponentByPointer.html +1 -1
- package/docs/functions/misc.isAsync.html +1 -1
- package/docs/functions/misc.isClass.html +1 -1
- package/docs/functions/misc.isEmpty.html +1 -1
- package/docs/functions/misc.isError.html +1 -1
- package/docs/functions/misc.isThenable.html +1 -1
- package/docs/functions/misc.shallowEqual.html +1 -1
- package/docs/functions/misc.toBool.html +1 -1
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +1 -1
- package/docs/functions/run.run.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/timers.animationFramePromise.html +1 -1
- package/docs/functions/timers.clearInterval.html +1 -1
- package/docs/functions/timers.grabTimers.html +1 -1
- package/docs/functions/timers.releaseTimers.html +1 -1
- package/docs/functions/timers.timeoutPromise.html +14 -14
- package/docs/static/index.html +1 -1
- package/docs/static/lilact.development.js +413 -308
- package/docs/static/lilact.development.js.map +4 -4
- package/docs/static/lilact.development.min.js +59 -59
- package/docs/static/lilact.development.min.js.map +4 -4
- package/docs/static/lilact.production.min.js +58 -58
- package/docs/variables/components.cloneElement.html +1 -1
- package/docs/variables/misc.Children.html +10 -10
- package/docs/variables/misc.isValidElement.html +1 -1
- package/docs/variables/run.required_scripts.html +1 -1
- package/examples/index.html +1 -1
- package/examples/lilact.development.js +413 -308
- package/examples/lilact.development.js.map +4 -4
- package/examples/lilact.development.min.js +59 -59
- package/examples/lilact.development.min.js.map +4 -4
- package/examples/lilact.production.min.js +58 -58
- package/package.json +1 -1
- package/src/accessories.jsx +1 -1
- package/src/components.jsx +27 -16
- package/src/errors.jsx +310 -310
- package/src/expscan.js +2 -2
- package/src/hooks.jsx +52 -56
- package/src/lilact.jsx +7 -1
- package/src/misc.jsx +46 -18
- package/src/run.jsx +405 -290
- package/src/timers.jsx +2 -0
- package/src/transition.jsx +1 -1
|
@@ -1760,7 +1760,9 @@ var typeOf = (input) => {
|
|
|
1760
1760
|
return type;
|
|
1761
1761
|
};
|
|
1762
1762
|
var isValidComponent = (value) => {
|
|
1763
|
-
return
|
|
1763
|
+
return Boolean(
|
|
1764
|
+
value && (value[CORE] !== void 0 || value[TEXT] !== void 0)
|
|
1765
|
+
);
|
|
1764
1766
|
};
|
|
1765
1767
|
var isValidElement = isValidComponent;
|
|
1766
1768
|
var findDOMNode = (component) => {
|
|
@@ -1948,6 +1950,9 @@ function isEmpty(value) {
|
|
|
1948
1950
|
return true;
|
|
1949
1951
|
}
|
|
1950
1952
|
var shallowEqual = (source, target, ignore) => {
|
|
1953
|
+
if (Object.is(source, target)) {
|
|
1954
|
+
return true;
|
|
1955
|
+
}
|
|
1951
1956
|
if (typeOf(source) !== typeOf(target)) {
|
|
1952
1957
|
return false;
|
|
1953
1958
|
}
|
|
@@ -1955,13 +1960,24 @@ var shallowEqual = (source, target, ignore) => {
|
|
|
1955
1960
|
if (source.length !== target.length) {
|
|
1956
1961
|
return false;
|
|
1957
1962
|
}
|
|
1958
|
-
return source.every(
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
}
|
|
1963
|
+
return source.every(
|
|
1964
|
+
(value, index2) => index2 === ignore || Object.is(value, target[index2])
|
|
1965
|
+
);
|
|
1966
|
+
}
|
|
1967
|
+
if (typeOf(source) === "object") {
|
|
1968
|
+
const sourceKeys = Object.keys(source).filter((key) => key !== ignore);
|
|
1969
|
+
const targetKeys = Object.keys(target).filter((key) => key !== ignore);
|
|
1970
|
+
if (sourceKeys.length !== targetKeys.length) {
|
|
1971
|
+
return false;
|
|
1972
|
+
}
|
|
1973
|
+
return sourceKeys.every(
|
|
1974
|
+
(key) => Object.prototype.hasOwnProperty.call(target, key) && Object.is(source[key], target[key])
|
|
1975
|
+
);
|
|
1976
|
+
}
|
|
1977
|
+
if (typeOf(source) === "date") {
|
|
1962
1978
|
return source.getTime() === target.getTime();
|
|
1963
1979
|
}
|
|
1964
|
-
return source
|
|
1980
|
+
return Object.is(source, target);
|
|
1965
1981
|
};
|
|
1966
1982
|
function deepEqual(source, target) {
|
|
1967
1983
|
if (typeOf(source) !== typeOf(target)) {
|
|
@@ -2619,7 +2635,7 @@ var ComponentCore = class {
|
|
|
2619
2635
|
}
|
|
2620
2636
|
} else if (this.entity === "select") {
|
|
2621
2637
|
if ((patch == null ? void 0 : patch.value) !== this.element.value) {
|
|
2622
|
-
lilact_default.
|
|
2638
|
+
lilact_default._setTimeout(() => this.element.value = String(patch.value), 0);
|
|
2623
2639
|
}
|
|
2624
2640
|
}
|
|
2625
2641
|
for (let a in this.props) {
|
|
@@ -2990,11 +3006,16 @@ var Component = class {
|
|
|
2990
3006
|
* @type {string}
|
|
2991
3007
|
*/
|
|
2992
3008
|
displayName() {
|
|
2993
|
-
|
|
2994
|
-
if (
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
if (typeof
|
|
3009
|
+
const entity = this[CORE].entity;
|
|
3010
|
+
if (entity == null ? void 0 : entity.displayName) {
|
|
3011
|
+
return typeof entity.displayName === "function" ? entity.displayName() : entity.displayName;
|
|
3012
|
+
}
|
|
3013
|
+
if (typeof entity === "string") {
|
|
3014
|
+
return entity;
|
|
3015
|
+
}
|
|
3016
|
+
if (typeof entity === "function") {
|
|
3017
|
+
return entity.name || "Component";
|
|
3018
|
+
}
|
|
2998
3019
|
return "Component";
|
|
2999
3020
|
}
|
|
3000
3021
|
constructor(props) {
|
|
@@ -3006,10 +3027,10 @@ var Component = class {
|
|
|
3006
3027
|
* @returns {void}
|
|
3007
3028
|
*/
|
|
3008
3029
|
forceUpdate(callback) {
|
|
3009
|
-
lilact_default.
|
|
3030
|
+
lilact_default._clearTimeout(lilact_default.update_timeout);
|
|
3010
3031
|
lilact_default.update_set.add(this[CORE].container || this[CORE]);
|
|
3011
3032
|
if (callback) lilact_default.update_cbs.add(callback.bind(this));
|
|
3012
|
-
lilact_default.update_timeout = lilact_default.
|
|
3033
|
+
lilact_default.update_timeout = lilact_default._setTimeout(doUpdates, lilact_default.update_interval_margin);
|
|
3013
3034
|
}
|
|
3014
3035
|
/**
|
|
3015
3036
|
* Update component state.
|
|
@@ -3377,16 +3398,12 @@ function createContext(defaultValue) {
|
|
|
3377
3398
|
};
|
|
3378
3399
|
}
|
|
3379
3400
|
function useContext(context2) {
|
|
3380
|
-
var _a;
|
|
3381
|
-
let core = lilact_default.current_component[0].parent;
|
|
3382
|
-
while (core.entity !== context2.Provider
|
|
3401
|
+
var _a, _b, _c;
|
|
3402
|
+
let core = (_a = lilact_default.current_component[0]) == null ? void 0 : _a.parent;
|
|
3403
|
+
while (core && core.entity !== context2.Provider) {
|
|
3383
3404
|
core = core.parent;
|
|
3384
3405
|
}
|
|
3385
|
-
|
|
3386
|
-
let v = (_a = core.props) == null ? void 0 : _a.value;
|
|
3387
|
-
return v != null ? v : v = context2.default;
|
|
3388
|
-
}
|
|
3389
|
-
return context2.default;
|
|
3406
|
+
return core ? (_c = (_b = core.props) == null ? void 0 : _b.value) != null ? _c : context2.default : context2.default;
|
|
3390
3407
|
}
|
|
3391
3408
|
function useId(prefix2 = "N") {
|
|
3392
3409
|
const hk = useHook();
|
|
@@ -3404,10 +3421,13 @@ function useTransition() {
|
|
|
3404
3421
|
core.component.forceUpdate();
|
|
3405
3422
|
}
|
|
3406
3423
|
hk2.count++;
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3424
|
+
try {
|
|
3425
|
+
return await fn();
|
|
3426
|
+
} finally {
|
|
3427
|
+
hk2.count--;
|
|
3428
|
+
if (hk2.count === 0) {
|
|
3429
|
+
core.component.forceUpdate();
|
|
3430
|
+
}
|
|
3411
3431
|
}
|
|
3412
3432
|
}).bind(void 0, lilact_default.current_component[0], hk);
|
|
3413
3433
|
}
|
|
@@ -3460,8 +3480,8 @@ async function useLayoutEffect(effect, deps = void 0) {
|
|
|
3460
3480
|
lilact_default.layout_effects.add(async () => {
|
|
3461
3481
|
hk.cleanup = await effect();
|
|
3462
3482
|
});
|
|
3463
|
-
lilact_default.
|
|
3464
|
-
lilact_default.
|
|
3483
|
+
lilact_default._clearTimeout(lilact_default.effect_timeout);
|
|
3484
|
+
lilact_default._setTimeout(lilact_default.processEffects, 0);
|
|
3465
3485
|
}
|
|
3466
3486
|
async function useEffect(effect, deps = void 0) {
|
|
3467
3487
|
if (deps !== void 0 && !Array.isArray(deps) && deps !== null && typeof deps !== "object") {
|
|
@@ -3479,8 +3499,8 @@ async function useEffect(effect, deps = void 0) {
|
|
|
3479
3499
|
lilact_default.passive_effects.add(async () => {
|
|
3480
3500
|
hk.cleanup = await effect();
|
|
3481
3501
|
});
|
|
3482
|
-
lilact_default.
|
|
3483
|
-
lilact_default.
|
|
3502
|
+
lilact_default._clearTimeout(lilact_default.effect_timeout);
|
|
3503
|
+
lilact_default._setTimeout(lilact_default.processEffects, 0);
|
|
3484
3504
|
}
|
|
3485
3505
|
async function useInsertionEffect(effect, deps = void 0) {
|
|
3486
3506
|
if (deps !== void 0 && !Array.isArray(deps) && deps !== null && typeof deps !== "object") {
|
|
@@ -3498,8 +3518,8 @@ async function useInsertionEffect(effect, deps = void 0) {
|
|
|
3498
3518
|
lilact_default.insertion_effects.add(async () => {
|
|
3499
3519
|
hk.cleanup = await effect();
|
|
3500
3520
|
});
|
|
3501
|
-
lilact_default.
|
|
3502
|
-
lilact_default.
|
|
3521
|
+
lilact_default._clearTimeout(lilact_default.effect_timeout);
|
|
3522
|
+
lilact_default._setTimeout(lilact_default.processEffects, 0);
|
|
3503
3523
|
}
|
|
3504
3524
|
function useMemo(factory, deps = void 0) {
|
|
3505
3525
|
if (deps !== void 0 && !Array.isArray(deps) && deps !== null && typeof deps !== "object") {
|
|
@@ -3537,16 +3557,16 @@ function useActionState(action, initialState) {
|
|
|
3537
3557
|
function useReducer(reducer, initialArg, init) {
|
|
3538
3558
|
const hk = useHook();
|
|
3539
3559
|
if (isEmpty(hk)) {
|
|
3540
|
-
hk.reducer = reducer;
|
|
3541
3560
|
hk.state = init ? init(initialArg) : initialArg;
|
|
3542
3561
|
hk.dispatch = function(core, hk2, action) {
|
|
3543
|
-
const
|
|
3544
|
-
if (!lilact_default.defaultIsEqual(
|
|
3545
|
-
hk2.state =
|
|
3562
|
+
const newState = hk2.reducer(hk2.state, action);
|
|
3563
|
+
if (!lilact_default.defaultIsEqual(newState, hk2.state)) {
|
|
3564
|
+
hk2.state = newState;
|
|
3546
3565
|
core.component.forceUpdate();
|
|
3547
3566
|
}
|
|
3548
3567
|
}.bind(void 0, lilact_default.current_component[0], hk);
|
|
3549
3568
|
}
|
|
3569
|
+
hk.reducer = reducer;
|
|
3550
3570
|
return [hk.state, hk.dispatch];
|
|
3551
3571
|
}
|
|
3552
3572
|
function useDeferredValue(value, initialValue) {
|
|
@@ -3608,11 +3628,16 @@ __export(run_exports, {
|
|
|
3608
3628
|
function joinPaths(basePath, relativePath) {
|
|
3609
3629
|
const absolute = relativePath.startsWith("/");
|
|
3610
3630
|
const parts = (absolute ? "" : basePath).split("/").filter(Boolean);
|
|
3611
|
-
if (!absolute && !basePath.endsWith("/"))
|
|
3631
|
+
if (!absolute && !basePath.endsWith("/")) {
|
|
3632
|
+
parts.pop();
|
|
3633
|
+
}
|
|
3612
3634
|
for (const part of relativePath.split("/")) {
|
|
3613
3635
|
if (!part || part === ".") continue;
|
|
3614
|
-
if (part === "..")
|
|
3615
|
-
|
|
3636
|
+
if (part === "..") {
|
|
3637
|
+
parts.pop();
|
|
3638
|
+
} else {
|
|
3639
|
+
parts.push(part);
|
|
3640
|
+
}
|
|
3616
3641
|
}
|
|
3617
3642
|
return `${absolute ? "/" : ""}${parts.join("/")}`;
|
|
3618
3643
|
}
|
|
@@ -3626,7 +3651,9 @@ function asError(value, fallback = "Unknown error") {
|
|
|
3626
3651
|
if (value.name) error2.name = value.name;
|
|
3627
3652
|
if (value.stack) error2.stack = value.stack;
|
|
3628
3653
|
for (const key of Object.keys(value)) {
|
|
3629
|
-
if (!(key in error2))
|
|
3654
|
+
if (!(key in error2)) {
|
|
3655
|
+
error2[key] = value[key];
|
|
3656
|
+
}
|
|
3630
3657
|
}
|
|
3631
3658
|
}
|
|
3632
3659
|
return error2;
|
|
@@ -3640,7 +3667,9 @@ function markSource(value, path2) {
|
|
|
3640
3667
|
}
|
|
3641
3668
|
function report(value, path2) {
|
|
3642
3669
|
const error2 = markSource(value, path2);
|
|
3643
|
-
if (error2.isTraced)
|
|
3670
|
+
if (error2.isTraced) {
|
|
3671
|
+
return error2;
|
|
3672
|
+
}
|
|
3644
3673
|
if (typeof lilact_default.traceError === "function") {
|
|
3645
3674
|
return lilact_default.traceError(error2, path2);
|
|
3646
3675
|
}
|
|
@@ -3648,20 +3677,50 @@ function report(value, path2) {
|
|
|
3648
3677
|
return error2;
|
|
3649
3678
|
}
|
|
3650
3679
|
var required_scripts = {};
|
|
3680
|
+
function createModule(path2, {
|
|
3681
|
+
code: code2 = "",
|
|
3682
|
+
isInline: isInline2 = false,
|
|
3683
|
+
isModule: isModule2 = true
|
|
3684
|
+
} = {}) {
|
|
3685
|
+
const module2 = {
|
|
3686
|
+
path: path2,
|
|
3687
|
+
code: String(code2),
|
|
3688
|
+
mappings: [],
|
|
3689
|
+
exports: {},
|
|
3690
|
+
isInline: isInline2,
|
|
3691
|
+
isModule: isModule2,
|
|
3692
|
+
// True only after the module has been successfully evaluated.
|
|
3693
|
+
loaded: false,
|
|
3694
|
+
// The promise for the request currently loading this resource.
|
|
3695
|
+
// This is deliberately stored on the module to deduplicate requests.
|
|
3696
|
+
request: void 0,
|
|
3697
|
+
error: void 0
|
|
3698
|
+
};
|
|
3699
|
+
required_scripts[path2] = module2;
|
|
3700
|
+
return module2;
|
|
3701
|
+
}
|
|
3651
3702
|
function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
3652
3703
|
isInline = true,
|
|
3653
3704
|
isModule = true
|
|
3654
3705
|
} = {}) {
|
|
3655
3706
|
var _a, _b;
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
}
|
|
3664
|
-
|
|
3707
|
+
let module = required_scripts[path];
|
|
3708
|
+
if (!module) {
|
|
3709
|
+
module = createModule(path, {
|
|
3710
|
+
code: jsx,
|
|
3711
|
+
isInline,
|
|
3712
|
+
isModule
|
|
3713
|
+
});
|
|
3714
|
+
} else {
|
|
3715
|
+
module.path = path;
|
|
3716
|
+
module.code = String(jsx);
|
|
3717
|
+
module.mappings = [];
|
|
3718
|
+
module.exports = {};
|
|
3719
|
+
module.isInline = isInline;
|
|
3720
|
+
module.isModule = isModule;
|
|
3721
|
+
module.loaded = false;
|
|
3722
|
+
module.error = void 0;
|
|
3723
|
+
}
|
|
3665
3724
|
let processed;
|
|
3666
3725
|
try {
|
|
3667
3726
|
processed = lilact_default.transpileJSX(String(jsx), {
|
|
@@ -3691,6 +3750,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
|
3691
3750
|
globalThis.createComponent = lilact_default.createComponent;
|
|
3692
3751
|
globalThis.Fragment = lilact_default.Fragment;
|
|
3693
3752
|
const result = eval(processed);
|
|
3753
|
+
module.loaded = true;
|
|
3694
3754
|
return isEmpty(module.exports) ? result : module.exports;
|
|
3695
3755
|
} catch (value) {
|
|
3696
3756
|
const error2 = report(value, path);
|
|
@@ -3699,8 +3759,64 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
|
3699
3759
|
throw error2;
|
|
3700
3760
|
}
|
|
3701
3761
|
}
|
|
3762
|
+
function getOrCreateModule(path2, options = {}) {
|
|
3763
|
+
return required_scripts[path2] || createModule(path2, options);
|
|
3764
|
+
}
|
|
3765
|
+
function loadAsyncResource(path2, module2) {
|
|
3766
|
+
var _a, _b;
|
|
3767
|
+
let source;
|
|
3768
|
+
try {
|
|
3769
|
+
const resolved = (_b = (_a = lilact_default).resolver) == null ? void 0 : _b.call(_a, path2);
|
|
3770
|
+
if (resolved == null) {
|
|
3771
|
+
if (module2.code && !module2.loaded) {
|
|
3772
|
+
source = Promise.resolve(module2.code);
|
|
3773
|
+
} else {
|
|
3774
|
+
source = fetch(path2).then((response) => {
|
|
3775
|
+
if (!response.ok) {
|
|
3776
|
+
throw report(
|
|
3777
|
+
new Error(
|
|
3778
|
+
`Unable to load ${path2}: HTTP ${response.status}`
|
|
3779
|
+
),
|
|
3780
|
+
path2
|
|
3781
|
+
);
|
|
3782
|
+
}
|
|
3783
|
+
return response.text();
|
|
3784
|
+
});
|
|
3785
|
+
}
|
|
3786
|
+
} else {
|
|
3787
|
+
source = Promise.resolve(resolved);
|
|
3788
|
+
}
|
|
3789
|
+
} catch (value) {
|
|
3790
|
+
source = Promise.reject(report(value, path2));
|
|
3791
|
+
}
|
|
3792
|
+
let request;
|
|
3793
|
+
request = Promise.resolve(source).then((sourceText) => {
|
|
3794
|
+
module2.code = String(sourceText);
|
|
3795
|
+
if (path2.endsWith(".css")) {
|
|
3796
|
+
injectGlobal(module2.code);
|
|
3797
|
+
module2.loaded = true;
|
|
3798
|
+
return void 0;
|
|
3799
|
+
}
|
|
3800
|
+
return run(module2.code, path2, {
|
|
3801
|
+
isInline: false,
|
|
3802
|
+
isModule: true
|
|
3803
|
+
});
|
|
3804
|
+
}).then((result2) => {
|
|
3805
|
+
var _a2;
|
|
3806
|
+
return (_a2 = result2 == null ? void 0 : result2.default) != null ? _a2 : result2;
|
|
3807
|
+
}).catch((error2) => {
|
|
3808
|
+
module2.error = report(error2, path2);
|
|
3809
|
+
throw module2.error;
|
|
3810
|
+
}).finally(() => {
|
|
3811
|
+
if (module2.request === request) {
|
|
3812
|
+
module2.request = void 0;
|
|
3813
|
+
}
|
|
3814
|
+
});
|
|
3815
|
+
module2.request = request;
|
|
3816
|
+
return request;
|
|
3817
|
+
}
|
|
3702
3818
|
function require2(path2) {
|
|
3703
|
-
var _a, _b, _c, _d
|
|
3819
|
+
var _a, _b, _c, _d;
|
|
3704
3820
|
let options = {};
|
|
3705
3821
|
if (arguments.length === 2 && arguments[1] && typeof arguments[1] === "object") {
|
|
3706
3822
|
options = arguments[1];
|
|
@@ -3708,12 +3824,16 @@ function require2(path2) {
|
|
|
3708
3824
|
if ((_a = lilact_default.importObjectPaths) == null ? void 0 : _a[path2]) {
|
|
3709
3825
|
return lilact_default.importObjectPaths[path2];
|
|
3710
3826
|
}
|
|
3711
|
-
const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(options.isLazy);
|
|
3712
3827
|
if ((_b = options.requirer) == null ? void 0 : _b.path) {
|
|
3713
3828
|
path2 = joinPaths(options.requirer.path, path2);
|
|
3714
3829
|
}
|
|
3715
|
-
|
|
3716
|
-
|
|
3830
|
+
const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(options.isLazy);
|
|
3831
|
+
const module2 = getOrCreateModule(path2, {
|
|
3832
|
+
isInline: false,
|
|
3833
|
+
isModule: true
|
|
3834
|
+
});
|
|
3835
|
+
if (module2.loaded && !options.forceUpdate && !loadAsync) {
|
|
3836
|
+
return module2.exports;
|
|
3717
3837
|
}
|
|
3718
3838
|
if (path2.startsWith("#")) {
|
|
3719
3839
|
const element = document.getElementById(path2.slice(1));
|
|
@@ -3727,49 +3847,18 @@ function require2(path2) {
|
|
|
3727
3847
|
}
|
|
3728
3848
|
if (loadAsync) {
|
|
3729
3849
|
lilact_default[LAZY] = false;
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
if (required_scripts[path2] && !options.forceUpdate) {
|
|
3733
|
-
request2 = Promise.resolve(required_scripts[path2].code);
|
|
3734
|
-
} else {
|
|
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();
|
|
3745
|
-
});
|
|
3746
|
-
}
|
|
3747
|
-
} else {
|
|
3748
|
-
request2 = Promise.resolve(request2);
|
|
3850
|
+
if (module2.request) {
|
|
3851
|
+
return module2.request;
|
|
3749
3852
|
}
|
|
3750
|
-
return
|
|
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;
|
|
3763
|
-
}
|
|
3764
|
-
).catch((error2) => {
|
|
3765
|
-
throw report(error2, path2);
|
|
3766
|
-
});
|
|
3853
|
+
return loadAsyncResource(path2, module2);
|
|
3767
3854
|
}
|
|
3768
|
-
const resolved = (
|
|
3855
|
+
const resolved = (_d = (_c = lilact_default).resolver) == null ? void 0 : _d.call(_c, path2);
|
|
3769
3856
|
if (resolved != null) {
|
|
3770
3857
|
if (path2.endsWith(".css")) {
|
|
3771
3858
|
injectGlobal(String(resolved));
|
|
3772
|
-
|
|
3859
|
+
module2.code = String(resolved);
|
|
3860
|
+
module2.loaded = true;
|
|
3861
|
+
return void 0;
|
|
3773
3862
|
}
|
|
3774
3863
|
return run(String(resolved), path2, {
|
|
3775
3864
|
isInline: false,
|
|
@@ -3785,8 +3874,10 @@ function require2(path2) {
|
|
|
3785
3874
|
}
|
|
3786
3875
|
if (request.status >= 200 && request.status < 300) {
|
|
3787
3876
|
if (path2.endsWith(".css")) {
|
|
3788
|
-
|
|
3789
|
-
|
|
3877
|
+
module2.code = request.responseText;
|
|
3878
|
+
injectGlobal(module2.code);
|
|
3879
|
+
module2.loaded = true;
|
|
3880
|
+
return void 0;
|
|
3790
3881
|
}
|
|
3791
3882
|
return run(request.responseText, path2, {
|
|
3792
3883
|
isInline: false,
|
|
@@ -3794,7 +3885,9 @@ function require2(path2) {
|
|
|
3794
3885
|
});
|
|
3795
3886
|
}
|
|
3796
3887
|
throw report(
|
|
3797
|
-
new Error(
|
|
3888
|
+
new Error(
|
|
3889
|
+
`Unable to load ${path2}: HTTP ${request.status || 0}`
|
|
3890
|
+
),
|
|
3798
3891
|
path2
|
|
3799
3892
|
);
|
|
3800
3893
|
}
|
|
@@ -3823,8 +3916,12 @@ function lazy(factory) {
|
|
|
3823
3916
|
status = "success";
|
|
3824
3917
|
}
|
|
3825
3918
|
function LazyComponent(props) {
|
|
3826
|
-
if (status === "pending")
|
|
3827
|
-
|
|
3919
|
+
if (status === "pending") {
|
|
3920
|
+
throw result2;
|
|
3921
|
+
}
|
|
3922
|
+
if (status === "error") {
|
|
3923
|
+
throw result2;
|
|
3924
|
+
}
|
|
3828
3925
|
const Component2 = result2;
|
|
3829
3926
|
return createComponent(Component2, { ...props });
|
|
3830
3927
|
}
|
|
@@ -3840,8 +3937,11 @@ function scriptTags() {
|
|
|
3840
3937
|
}
|
|
3841
3938
|
async function runScripts() {
|
|
3842
3939
|
for (const script of scriptTags()) {
|
|
3843
|
-
if (script.src)
|
|
3844
|
-
|
|
3940
|
+
if (script.src) {
|
|
3941
|
+
await require2(script.src);
|
|
3942
|
+
} else if (script.content) {
|
|
3943
|
+
run(script.content);
|
|
3944
|
+
}
|
|
3845
3945
|
}
|
|
3846
3946
|
}
|
|
3847
3947
|
|
|
@@ -3853,167 +3953,6 @@ __export(transition_exports, {
|
|
|
3853
3953
|
Transition: () => Transition,
|
|
3854
3954
|
TransitionGroup: () => TransitionGroup
|
|
3855
3955
|
});
|
|
3856
|
-
|
|
3857
|
-
// .tmp/src/timers.jsx
|
|
3858
|
-
var timers_exports = {};
|
|
3859
|
-
__export(timers_exports, {
|
|
3860
|
-
animationFramePromise: () => animationFramePromise,
|
|
3861
|
-
clearInterval: () => clearInterval,
|
|
3862
|
-
clearTimeout: () => clearTimeout2,
|
|
3863
|
-
grabTimers: () => grabTimers,
|
|
3864
|
-
pauseTimers: () => pauseTimers,
|
|
3865
|
-
releaseTimers: () => releaseTimers,
|
|
3866
|
-
resetTimers: () => resetTimers,
|
|
3867
|
-
resumeTimers: () => resumeTimers,
|
|
3868
|
-
setInterval: () => setInterval,
|
|
3869
|
-
setTimeout: () => setTimeout2,
|
|
3870
|
-
timeoutPromise: () => timeoutPromise
|
|
3871
|
-
});
|
|
3872
|
-
var timer_pause_time = void 0;
|
|
3873
|
-
var current_timer_idx = -1;
|
|
3874
|
-
var timer_list = [];
|
|
3875
|
-
var timer_timeout = -1;
|
|
3876
|
-
var all_timers = {};
|
|
3877
|
-
var _setTimeout = window.setTimeout;
|
|
3878
|
-
var _setInterval = window.setInterval;
|
|
3879
|
-
var _clearTimeout = window.clearTimeout;
|
|
3880
|
-
var _clearInterval = window.clearInterval;
|
|
3881
|
-
function get_bucket(target) {
|
|
3882
|
-
let left = 0;
|
|
3883
|
-
let right = timer_list.length - 1;
|
|
3884
|
-
while (left <= right) {
|
|
3885
|
-
const mid = Math.floor((left + right) / 2);
|
|
3886
|
-
const mid_val = timer_list[mid][DUE];
|
|
3887
|
-
if (mid_val === target) {
|
|
3888
|
-
return [mid, timer_list[mid]];
|
|
3889
|
-
} else if (mid_val < target) {
|
|
3890
|
-
left = mid + 1;
|
|
3891
|
-
} else {
|
|
3892
|
-
right = mid - 1;
|
|
3893
|
-
}
|
|
3894
|
-
}
|
|
3895
|
-
const bucket = [];
|
|
3896
|
-
bucket[DUE] = target;
|
|
3897
|
-
timer_list.splice(left, 0, bucket);
|
|
3898
|
-
return [left, bucket];
|
|
3899
|
-
}
|
|
3900
|
-
function add_timer(t, is_repeat = false) {
|
|
3901
|
-
const [i2, bucket] = get_bucket(t[DUE]);
|
|
3902
|
-
if (!is_repeat) {
|
|
3903
|
-
current_timer_idx++;
|
|
3904
|
-
all_timers[current_timer_idx] = t;
|
|
3905
|
-
t[IDX] = current_timer_idx;
|
|
3906
|
-
}
|
|
3907
|
-
bucket.push(t);
|
|
3908
|
-
if (timer_list[0][0] === t) {
|
|
3909
|
-
_clearTimeout(timer_timeout);
|
|
3910
|
-
timer_timeout = _setTimeout(run_timer, t[INTERVAL]);
|
|
3911
|
-
}
|
|
3912
|
-
return current_timer_idx;
|
|
3913
|
-
}
|
|
3914
|
-
function run_timer() {
|
|
3915
|
-
const now = Date.now();
|
|
3916
|
-
let i2 = 0;
|
|
3917
|
-
let buck = timer_list[i2];
|
|
3918
|
-
while (buck && buck[DUE] - now <= 0) {
|
|
3919
|
-
for (const t of buck) {
|
|
3920
|
-
if (!t[CLEARED]) {
|
|
3921
|
-
t[CALLBACK](...t[ARGS]);
|
|
3922
|
-
if (t[REPEAT]) {
|
|
3923
|
-
t[DUE] = Date.now() + t[INTERVAL];
|
|
3924
|
-
add_timer(t, true);
|
|
3925
|
-
} else {
|
|
3926
|
-
delete all_timers[t[IDX]];
|
|
3927
|
-
}
|
|
3928
|
-
} else {
|
|
3929
|
-
delete all_timers[t[IDX]];
|
|
3930
|
-
}
|
|
3931
|
-
}
|
|
3932
|
-
i2++;
|
|
3933
|
-
buck = timer_list[i2];
|
|
3934
|
-
}
|
|
3935
|
-
timer_list.splice(0, i2);
|
|
3936
|
-
if (timer_list.length > 0) {
|
|
3937
|
-
_clearTimeout(timer_timeout);
|
|
3938
|
-
timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
|
|
3939
|
-
}
|
|
3940
|
-
}
|
|
3941
|
-
function resetTimers() {
|
|
3942
|
-
_clearTimeout(timer_timeout);
|
|
3943
|
-
timer_pause_time = void 0;
|
|
3944
|
-
current_timer_idx = -1;
|
|
3945
|
-
timer_list = [];
|
|
3946
|
-
timer_timeout = -1;
|
|
3947
|
-
all_timers = {};
|
|
3948
|
-
}
|
|
3949
|
-
function pauseTimers() {
|
|
3950
|
-
_clearTimeout(timer_timeout);
|
|
3951
|
-
timer_pause_time = Date.now();
|
|
3952
|
-
}
|
|
3953
|
-
function resumeTimers() {
|
|
3954
|
-
if (!timer_pause_time) return;
|
|
3955
|
-
if (timer_list.length > 0) {
|
|
3956
|
-
const now = Date.now();
|
|
3957
|
-
timer_pause_time -= now;
|
|
3958
|
-
for (const t of timer_list) {
|
|
3959
|
-
t[DUE] -= timer_pause_time;
|
|
3960
|
-
}
|
|
3961
|
-
timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
|
|
3962
|
-
}
|
|
3963
|
-
timer_pause_time = void 0;
|
|
3964
|
-
}
|
|
3965
|
-
function setTimeout2(callback, delay, ...args) {
|
|
3966
|
-
return add_timer({ [CALLBACK]: callback, [INTERVAL]: delay, [DUE]: Date.now() + delay, [REPEAT]: false, [ARGS]: args });
|
|
3967
|
-
}
|
|
3968
|
-
function setInterval(callback, interval, ...args) {
|
|
3969
|
-
return add_timer({ [CALLBACK]: callback, [INTERVAL]: interval, [DUE]: Date.now() + interval, [REPEAT]: true, [ARGS]: args });
|
|
3970
|
-
}
|
|
3971
|
-
function clearTimeout2(id) {
|
|
3972
|
-
if (all_timers[id]) all_timers[id][CLEARED] = true;
|
|
3973
|
-
}
|
|
3974
|
-
function clearInterval(id) {
|
|
3975
|
-
if (all_timers[id]) all_timers[id][CLEARED] = true;
|
|
3976
|
-
}
|
|
3977
|
-
function grabTimers() {
|
|
3978
|
-
globalThis.setTimeout = Lilact.setTimeout;
|
|
3979
|
-
globalThis.setInterval = Lilact.setInterval;
|
|
3980
|
-
globalThis.clearTimeout = Lilact.clearTimeout;
|
|
3981
|
-
globalThis.clearInterval = Lilact.clearInterval;
|
|
3982
|
-
}
|
|
3983
|
-
function releaseTimers() {
|
|
3984
|
-
globalThis.setTimeout = _setTimeout;
|
|
3985
|
-
globalThis.setInterval = _setInterval;
|
|
3986
|
-
globalThis.clearTimeout = _clearTimeout;
|
|
3987
|
-
globalThis.clearInterval = _clearInterval;
|
|
3988
|
-
}
|
|
3989
|
-
function timeoutPromise(duration = 0, timerSource = Lilact) {
|
|
3990
|
-
let id, resolve, reject;
|
|
3991
|
-
const promise = new Promise((res, rej) => {
|
|
3992
|
-
resolve = res;
|
|
3993
|
-
reject = rej;
|
|
3994
|
-
id = timerSource.setTimeout(() => {
|
|
3995
|
-
resolve();
|
|
3996
|
-
}, duration);
|
|
3997
|
-
});
|
|
3998
|
-
promise.proceed = () => {
|
|
3999
|
-
timerSource.clearTimeout(id);
|
|
4000
|
-
resolve();
|
|
4001
|
-
};
|
|
4002
|
-
promise.cancel = () => {
|
|
4003
|
-
timerSource.clearTimeout(id);
|
|
4004
|
-
reject();
|
|
4005
|
-
};
|
|
4006
|
-
return promise;
|
|
4007
|
-
}
|
|
4008
|
-
function animationFramePromise() {
|
|
4009
|
-
return new Promise((resolve) => {
|
|
4010
|
-
requestAnimationFrame(() => {
|
|
4011
|
-
resolve();
|
|
4012
|
-
});
|
|
4013
|
-
});
|
|
4014
|
-
}
|
|
4015
|
-
|
|
4016
|
-
// .tmp/src/transition.jsx
|
|
4017
3956
|
var UNMOUNTED = "unmounted";
|
|
4018
3957
|
var EXITED = "exited";
|
|
4019
3958
|
var ENTERING = "entering";
|
|
@@ -4051,15 +3990,15 @@ function Transition({
|
|
|
4051
3990
|
} else this[CORE].mount_state = EXITED;
|
|
4052
3991
|
}
|
|
4053
3992
|
useEffect(() => {
|
|
4054
|
-
return () =>
|
|
3993
|
+
return () => clearTimeout(this[CORE].timer);
|
|
4055
3994
|
}, []);
|
|
4056
3995
|
useEffect(() => {
|
|
4057
3996
|
if (!this[CORE].is_appeared && appear && this[CORE].mount_state === ENTERING && inProp) {
|
|
4058
3997
|
onEnter == null ? void 0 : onEnter();
|
|
4059
3998
|
requestAnimationFrame(() => {
|
|
4060
3999
|
onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
|
|
4061
|
-
|
|
4062
|
-
this[CORE].timer =
|
|
4000
|
+
clearTimeout(this[CORE].timer);
|
|
4001
|
+
this[CORE].timer = setTimeout(() => {
|
|
4063
4002
|
this[CORE].mount_state = ENTERED;
|
|
4064
4003
|
this.forceUpdate();
|
|
4065
4004
|
this[CORE].is_appeared = true;
|
|
@@ -4076,8 +4015,8 @@ function Transition({
|
|
|
4076
4015
|
this[CORE].mount_state = ENTERING;
|
|
4077
4016
|
this.forceUpdate(() => {
|
|
4078
4017
|
onEntering == null ? void 0 : onEntering(!this[CORE].is_appeared);
|
|
4079
|
-
|
|
4080
|
-
this[CORE].timer =
|
|
4018
|
+
clearTimeout(this[CORE].timer);
|
|
4019
|
+
this[CORE].timer = setTimeout(() => {
|
|
4081
4020
|
this[CORE].mount_state = ENTERED;
|
|
4082
4021
|
this.forceUpdate();
|
|
4083
4022
|
this[CORE].is_appeared = true;
|
|
@@ -4090,8 +4029,8 @@ function Transition({
|
|
|
4090
4029
|
this[CORE].mount_state = EXITING;
|
|
4091
4030
|
this.forceUpdate(() => {
|
|
4092
4031
|
onExiting == null ? void 0 : onExiting();
|
|
4093
|
-
|
|
4094
|
-
this[CORE].timer =
|
|
4032
|
+
clearTimeout(this[CORE].timer);
|
|
4033
|
+
this[CORE].timer = setTimeout(() => {
|
|
4095
4034
|
this[CORE].mount_state = EXITED;
|
|
4096
4035
|
this.forceUpdate();
|
|
4097
4036
|
onExited == null ? void 0 : onExited();
|
|
@@ -4507,6 +4446,167 @@ function combineReducers2(reducers) {
|
|
|
4507
4446
|
};
|
|
4508
4447
|
}
|
|
4509
4448
|
|
|
4449
|
+
// .tmp/src/timers.jsx
|
|
4450
|
+
var timers_exports = {};
|
|
4451
|
+
__export(timers_exports, {
|
|
4452
|
+
animationFramePromise: () => animationFramePromise,
|
|
4453
|
+
clearInterval: () => clearInterval,
|
|
4454
|
+
clearTimeout: () => clearTimeout2,
|
|
4455
|
+
grabTimers: () => grabTimers,
|
|
4456
|
+
pauseTimers: () => pauseTimers,
|
|
4457
|
+
releaseTimers: () => releaseTimers,
|
|
4458
|
+
resetTimers: () => resetTimers,
|
|
4459
|
+
resumeTimers: () => resumeTimers,
|
|
4460
|
+
setInterval: () => setInterval,
|
|
4461
|
+
setTimeout: () => setTimeout2,
|
|
4462
|
+
timeoutPromise: () => timeoutPromise
|
|
4463
|
+
});
|
|
4464
|
+
var timer_pause_time = void 0;
|
|
4465
|
+
var current_timer_idx = -1;
|
|
4466
|
+
var timer_list = [];
|
|
4467
|
+
var timer_timeout = -1;
|
|
4468
|
+
var all_timers = {};
|
|
4469
|
+
var _setTimeout = window.setTimeout;
|
|
4470
|
+
var _setInterval = window.setInterval;
|
|
4471
|
+
var _clearTimeout = window.clearTimeout;
|
|
4472
|
+
var _clearInterval = window.clearInterval;
|
|
4473
|
+
function get_bucket(target) {
|
|
4474
|
+
let left = 0;
|
|
4475
|
+
let right = timer_list.length - 1;
|
|
4476
|
+
while (left <= right) {
|
|
4477
|
+
const mid = Math.floor((left + right) / 2);
|
|
4478
|
+
const mid_val = timer_list[mid][DUE];
|
|
4479
|
+
if (mid_val === target) {
|
|
4480
|
+
return [mid, timer_list[mid]];
|
|
4481
|
+
} else if (mid_val < target) {
|
|
4482
|
+
left = mid + 1;
|
|
4483
|
+
} else {
|
|
4484
|
+
right = mid - 1;
|
|
4485
|
+
}
|
|
4486
|
+
}
|
|
4487
|
+
const bucket = [];
|
|
4488
|
+
bucket[DUE] = target;
|
|
4489
|
+
timer_list.splice(left, 0, bucket);
|
|
4490
|
+
return [left, bucket];
|
|
4491
|
+
}
|
|
4492
|
+
function add_timer(t, is_repeat = false) {
|
|
4493
|
+
const [i2, bucket] = get_bucket(t[DUE]);
|
|
4494
|
+
if (!is_repeat) {
|
|
4495
|
+
current_timer_idx++;
|
|
4496
|
+
all_timers[current_timer_idx] = t;
|
|
4497
|
+
t[IDX] = current_timer_idx;
|
|
4498
|
+
}
|
|
4499
|
+
bucket.push(t);
|
|
4500
|
+
if (timer_list[0][0] === t) {
|
|
4501
|
+
_clearTimeout(timer_timeout);
|
|
4502
|
+
timer_timeout = _setTimeout(run_timer, t[INTERVAL]);
|
|
4503
|
+
}
|
|
4504
|
+
return current_timer_idx;
|
|
4505
|
+
}
|
|
4506
|
+
function run_timer() {
|
|
4507
|
+
const now = Date.now();
|
|
4508
|
+
let i2 = 0;
|
|
4509
|
+
let buck = timer_list[i2];
|
|
4510
|
+
while (buck && buck[DUE] - now <= 0) {
|
|
4511
|
+
for (const t of buck) {
|
|
4512
|
+
if (!t[CLEARED]) {
|
|
4513
|
+
t[CALLBACK](...t[ARGS]);
|
|
4514
|
+
if (t[REPEAT]) {
|
|
4515
|
+
t[DUE] = Date.now() + t[INTERVAL];
|
|
4516
|
+
add_timer(t, true);
|
|
4517
|
+
} else {
|
|
4518
|
+
delete all_timers[t[IDX]];
|
|
4519
|
+
}
|
|
4520
|
+
} else {
|
|
4521
|
+
delete all_timers[t[IDX]];
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4524
|
+
i2++;
|
|
4525
|
+
buck = timer_list[i2];
|
|
4526
|
+
}
|
|
4527
|
+
timer_list.splice(0, i2);
|
|
4528
|
+
if (timer_list.length > 0) {
|
|
4529
|
+
_clearTimeout(timer_timeout);
|
|
4530
|
+
timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
|
|
4531
|
+
}
|
|
4532
|
+
}
|
|
4533
|
+
function resetTimers() {
|
|
4534
|
+
_clearTimeout(timer_timeout);
|
|
4535
|
+
timer_pause_time = void 0;
|
|
4536
|
+
current_timer_idx = -1;
|
|
4537
|
+
timer_list = [];
|
|
4538
|
+
timer_timeout = -1;
|
|
4539
|
+
all_timers = {};
|
|
4540
|
+
}
|
|
4541
|
+
function pauseTimers() {
|
|
4542
|
+
_clearTimeout(timer_timeout);
|
|
4543
|
+
timer_pause_time = Date.now();
|
|
4544
|
+
}
|
|
4545
|
+
function resumeTimers() {
|
|
4546
|
+
if (!timer_pause_time) return;
|
|
4547
|
+
if (timer_list.length > 0) {
|
|
4548
|
+
const now = Date.now();
|
|
4549
|
+
timer_pause_time -= now;
|
|
4550
|
+
for (const t of timer_list) {
|
|
4551
|
+
t[DUE] -= timer_pause_time;
|
|
4552
|
+
}
|
|
4553
|
+
timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
|
|
4554
|
+
}
|
|
4555
|
+
timer_pause_time = void 0;
|
|
4556
|
+
}
|
|
4557
|
+
function setTimeout2(callback, delay, ...args) {
|
|
4558
|
+
return add_timer({ [CALLBACK]: callback, [INTERVAL]: delay, [DUE]: Date.now() + delay, [REPEAT]: false, [ARGS]: args });
|
|
4559
|
+
}
|
|
4560
|
+
function setInterval(callback, interval, ...args) {
|
|
4561
|
+
return add_timer({ [CALLBACK]: callback, [INTERVAL]: interval, [DUE]: Date.now() + interval, [REPEAT]: true, [ARGS]: args });
|
|
4562
|
+
}
|
|
4563
|
+
function clearTimeout2(id) {
|
|
4564
|
+
if (all_timers[id]) all_timers[id][CLEARED] = true;
|
|
4565
|
+
else _clearTimeout(id);
|
|
4566
|
+
}
|
|
4567
|
+
function clearInterval(id) {
|
|
4568
|
+
if (all_timers[id]) all_timers[id][CLEARED] = true;
|
|
4569
|
+
else _clearInterval(id);
|
|
4570
|
+
}
|
|
4571
|
+
function grabTimers() {
|
|
4572
|
+
globalThis.setTimeout = Lilact.setTimeout;
|
|
4573
|
+
globalThis.setInterval = Lilact.setInterval;
|
|
4574
|
+
globalThis.clearTimeout = Lilact.clearTimeout;
|
|
4575
|
+
globalThis.clearInterval = Lilact.clearInterval;
|
|
4576
|
+
}
|
|
4577
|
+
function releaseTimers() {
|
|
4578
|
+
globalThis.setTimeout = _setTimeout;
|
|
4579
|
+
globalThis.setInterval = _setInterval;
|
|
4580
|
+
globalThis.clearTimeout = _clearTimeout;
|
|
4581
|
+
globalThis.clearInterval = _clearInterval;
|
|
4582
|
+
}
|
|
4583
|
+
function timeoutPromise(duration = 0, timerSource = Lilact) {
|
|
4584
|
+
let id, resolve, reject;
|
|
4585
|
+
const promise = new Promise((res, rej) => {
|
|
4586
|
+
resolve = res;
|
|
4587
|
+
reject = rej;
|
|
4588
|
+
id = timerSource.setTimeout(() => {
|
|
4589
|
+
resolve();
|
|
4590
|
+
}, duration);
|
|
4591
|
+
});
|
|
4592
|
+
promise.proceed = () => {
|
|
4593
|
+
timerSource.clearTimeout(id);
|
|
4594
|
+
resolve();
|
|
4595
|
+
};
|
|
4596
|
+
promise.cancel = () => {
|
|
4597
|
+
timerSource.clearTimeout(id);
|
|
4598
|
+
reject();
|
|
4599
|
+
};
|
|
4600
|
+
return promise;
|
|
4601
|
+
}
|
|
4602
|
+
function animationFramePromise() {
|
|
4603
|
+
return new Promise((resolve) => {
|
|
4604
|
+
requestAnimationFrame(() => {
|
|
4605
|
+
resolve();
|
|
4606
|
+
});
|
|
4607
|
+
});
|
|
4608
|
+
}
|
|
4609
|
+
|
|
4510
4610
|
// .tmp/src/errors.jsx
|
|
4511
4611
|
var errors_exports = {};
|
|
4512
4612
|
__export(errors_exports, {
|
|
@@ -4671,47 +4771,47 @@ function globalErrorHandler(eventOrError) {
|
|
|
4671
4771
|
error2.lineNumber
|
|
4672
4772
|
);
|
|
4673
4773
|
const className = css(`
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4774
|
+
background: linear-gradient(135deg, #fff2f2d4, #ffffffd4);
|
|
4775
|
+
backdrop-filter: blur(10px);
|
|
4776
|
+
border: 1px solid rgba(255,255,255,.25);
|
|
4777
|
+
border-radius: 5px;
|
|
4778
|
+
box-shadow: 0 10px 30px rgba(0,0,0,.35);
|
|
4779
|
+
overflow: hidden;
|
|
4780
|
+
min-width: 400px;
|
|
4781
|
+
width: 66%;
|
|
4682
4782
|
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4783
|
+
red {
|
|
4784
|
+
color: #d00;
|
|
4785
|
+
}
|
|
4686
4786
|
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4787
|
+
code {
|
|
4788
|
+
border: 1px solid #0003;
|
|
4789
|
+
overflow: auto;
|
|
4790
|
+
padding: 10px;
|
|
4791
|
+
display: block;
|
|
4792
|
+
}
|
|
4793
|
+
`);
|
|
4694
4794
|
const dialog = document.createElement("dialog");
|
|
4695
4795
|
dialog.className = className;
|
|
4696
4796
|
const location = error2.fileName ? `At ${escapeHtml(error2.fileName)}` : "";
|
|
4697
4797
|
const line2 = Number.isFinite(error2.lineNumber) ? `: Line ${error2.lineNumber + 1}` : "";
|
|
4698
4798
|
const componentStack = ((_a = error2._error) == null ? void 0 : _a.componentStackLog) || ((_b = error2._error) == null ? void 0 : _b.componentStack) || "";
|
|
4699
4799
|
dialog.innerHTML = `
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4800
|
+
<h3><red>Error!</red></h3>
|
|
4801
|
+
<b>${location}${line2}</b><br><br>
|
|
4802
|
+
<b>${escapeHtml(error2.name)}</b>:
|
|
4803
|
+
<span>${escapeHtml(error2.message)}</span>
|
|
4804
|
+
<br><br>
|
|
4705
4805
|
|
|
4706
|
-
|
|
4806
|
+
${excerpt ? "<code><pre></pre><red><pre></pre></red><pre></pre></code>" : ""}
|
|
4707
4807
|
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4808
|
+
${componentStack ? `
|
|
4809
|
+
<br>
|
|
4810
|
+
Component Stack:
|
|
4811
|
+
<br>
|
|
4812
|
+
<code><pre>${escapeHtml(componentStack)}</pre></code>
|
|
4813
|
+
` : ""}
|
|
4814
|
+
`;
|
|
4715
4815
|
if (excerpt) {
|
|
4716
4816
|
const pre = dialog.querySelectorAll("pre");
|
|
4717
4817
|
pre[0].innerText = excerpt.before;
|
|
@@ -5015,11 +5115,11 @@ var Suspense = class extends Component {
|
|
|
5015
5115
|
/** @ignore */
|
|
5016
5116
|
_clearTimers() {
|
|
5017
5117
|
if (this._delayTimer) {
|
|
5018
|
-
|
|
5118
|
+
clearTimeout(this._delayTimer);
|
|
5019
5119
|
this._delayTimer = null;
|
|
5020
5120
|
}
|
|
5021
5121
|
if (this._minShowTimer) {
|
|
5022
|
-
|
|
5122
|
+
clearTimeout(this._minShowTimer);
|
|
5023
5123
|
this._minShowTimer = null;
|
|
5024
5124
|
}
|
|
5025
5125
|
}
|
|
@@ -5030,10 +5130,10 @@ var Suspense = class extends Component {
|
|
|
5030
5130
|
if (this._pending.size === 1) {
|
|
5031
5131
|
const delay = Math.max(0, this.props.minDelay);
|
|
5032
5132
|
if (this._delayTimer) {
|
|
5033
|
-
|
|
5133
|
+
clearTimeout(this._delayTimer);
|
|
5034
5134
|
this._delayTimer = null;
|
|
5035
5135
|
}
|
|
5036
|
-
this._delayTimer =
|
|
5136
|
+
this._delayTimer = setTimeout(() => {
|
|
5037
5137
|
this._delayTimer = null;
|
|
5038
5138
|
this._fallbackShownAt = Date.now();
|
|
5039
5139
|
this.setState({ showingFallback: true });
|
|
@@ -5045,7 +5145,7 @@ var Suspense = class extends Component {
|
|
|
5045
5145
|
}
|
|
5046
5146
|
if (this._pending.size === 0) {
|
|
5047
5147
|
if (this._delayTimer) {
|
|
5048
|
-
|
|
5148
|
+
clearTimeout(this._delayTimer);
|
|
5049
5149
|
this._delayTimer = null;
|
|
5050
5150
|
this.setState({ showingFallback: false });
|
|
5051
5151
|
return;
|
|
@@ -5056,10 +5156,10 @@ var Suspense = class extends Component {
|
|
|
5056
5156
|
this.setState({ showingFallback: false });
|
|
5057
5157
|
} else {
|
|
5058
5158
|
if (this._minShowTimer) {
|
|
5059
|
-
|
|
5159
|
+
clearTimeout(this._minShowTimer);
|
|
5060
5160
|
this._minShowTimer = null;
|
|
5061
5161
|
}
|
|
5062
|
-
this._minShowTimer =
|
|
5162
|
+
this._minShowTimer = setTimeout(() => {
|
|
5063
5163
|
this._minShowTimer = null;
|
|
5064
5164
|
this.setState({ showingFallback: false });
|
|
5065
5165
|
}, remaining);
|
|
@@ -5739,11 +5839,11 @@ function processImportExports(node3, jsx2) {
|
|
|
5739
5839
|
node3.out[i2] = null;
|
|
5740
5840
|
}
|
|
5741
5841
|
let cjs = "";
|
|
5742
|
-
for (const s2 of
|
|
5842
|
+
for (const s2 of star_imports) {
|
|
5743
5843
|
cjs += `const ${s2} = require(${src},{requirer:module});
|
|
5744
5844
|
`;
|
|
5745
5845
|
}
|
|
5746
|
-
for (const s2 of
|
|
5846
|
+
for (const s2 of import_alls) {
|
|
5747
5847
|
cjs += `const ${s2} = require(${src},{requirer:module, checkExport: ['default']}).default;
|
|
5748
5848
|
`;
|
|
5749
5849
|
}
|
|
@@ -6791,7 +6891,11 @@ var Lilact2 = {
|
|
|
6791
6891
|
// Dependencies
|
|
6792
6892
|
PropTypes,
|
|
6793
6893
|
redux: redux_exports,
|
|
6794
|
-
emotion: emotion_css_esm_exports
|
|
6894
|
+
emotion: emotion_css_esm_exports,
|
|
6895
|
+
_setTimeout: window.setTimeout.bind(window),
|
|
6896
|
+
_setInterval: window.setInterval.bind(window),
|
|
6897
|
+
_clearTimeout: window.clearTimeout.bind(window),
|
|
6898
|
+
_clearInterval: window.clearInterval.bind(window)
|
|
6795
6899
|
};
|
|
6796
6900
|
Lilact2.default = Lilact2;
|
|
6797
6901
|
var lilact_default = Lilact2;
|
|
@@ -6805,6 +6909,7 @@ globalThis.createComponent = Lilact2.createComponent;
|
|
|
6805
6909
|
globalThis.Fragment = Lilact2.Fragment;
|
|
6806
6910
|
globalThis.require = Lilact2.require;
|
|
6807
6911
|
document.addEventListener("DOMContentLoaded", () => {
|
|
6912
|
+
Lilact2.grabTimers();
|
|
6808
6913
|
Lilact2.runScripts().catch((error2) => {
|
|
6809
6914
|
var _a;
|
|
6810
6915
|
(_a = Lilact2.globalErrorHandler) == null ? void 0 : _a.call(Lilact2, error2);
|