lilact 0.26.7 → 0.26.9
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/bin/bundle.cjs +3 -2
- package/dist/lilact.development.js +22 -14
- package/dist/lilact.development.js.map +2 -2
- package/dist/lilact.development.min.js +6 -6
- package/dist/lilact.development.min.js.map +2 -2
- package/dist/lilact.production.min.js +6 -6
- package/docs/functions/hooks.useInsertionEffect.html +2 -2
- 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/static/lilact.development.js +22 -14
- package/docs/static/lilact.development.js.map +2 -2
- package/docs/static/lilact.development.min.js +6 -6
- package/docs/static/lilact.development.min.js.map +2 -2
- package/docs/static/lilact.production.min.js +6 -6
- package/examples/lilact.development.js +22 -14
- package/examples/lilact.development.js.map +2 -2
- package/examples/lilact.development.min.js +6 -6
- package/examples/lilact.development.min.js.map +2 -2
- package/examples/lilact.production.min.js +6 -6
- package/package.json +1 -1
- package/src/hooks.jsx +9 -9
- package/src/jsx.js +1 -1
- package/src/lilact.jsx +4 -0
- package/src/run.jsx +7 -1
|
@@ -4,4 +4,4 @@ It is automatically attached to document.onload when Lilact is loaded.</p>
|
|
|
4
4
|
If element has inner content, it will be executed via <code>run</code>.</p>
|
|
5
5
|
<p>If both are present, first the src is loaded and then the inner content is executed.</p>
|
|
6
6
|
<p>Note that it won't detect such elements that are added after document.onload.</p>
|
|
7
|
-
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in run.jsx:
|
|
7
|
+
</div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><ul><li>Defined in run.jsx:312</li></ul></aside></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Lilact</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -3438,7 +3438,7 @@ function useRef(initialValue = null) {
|
|
|
3438
3438
|
}
|
|
3439
3439
|
return hk;
|
|
3440
3440
|
}
|
|
3441
|
-
function useLayoutEffect(effect, deps = void 0) {
|
|
3441
|
+
async function useLayoutEffect(effect, deps = void 0) {
|
|
3442
3442
|
if (deps !== void 0 && (typeof deps !== "object" || deps.constructor.name !== "Array")) {
|
|
3443
3443
|
throw new Error("Layout effect dependencies must be an array, object or omitted.");
|
|
3444
3444
|
}
|
|
@@ -3447,16 +3447,16 @@ function useLayoutEffect(effect, deps = void 0) {
|
|
|
3447
3447
|
if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3448
3448
|
}
|
|
3449
3449
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3450
|
-
hk.cleanup();
|
|
3450
|
+
await hk.cleanup();
|
|
3451
3451
|
}
|
|
3452
3452
|
hk.deps = deps;
|
|
3453
|
-
lilact_default.layout_effects.add(() => {
|
|
3454
|
-
hk.cleanup = effect();
|
|
3453
|
+
lilact_default.layout_effects.add(async () => {
|
|
3454
|
+
hk.cleanup = await effect();
|
|
3455
3455
|
});
|
|
3456
3456
|
lilact_default.clearTimeout(lilact_default.effect_timeout);
|
|
3457
3457
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
3458
3458
|
}
|
|
3459
|
-
function useEffect(effect, deps = void 0) {
|
|
3459
|
+
async function useEffect(effect, deps = void 0) {
|
|
3460
3460
|
if (deps !== void 0 && (typeof deps !== "object" || deps.constructor.name !== "Array")) {
|
|
3461
3461
|
throw new Error("Effect dependencies must be an array, object or omitted.");
|
|
3462
3462
|
}
|
|
@@ -3465,16 +3465,16 @@ function useEffect(effect, deps = void 0) {
|
|
|
3465
3465
|
if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3466
3466
|
}
|
|
3467
3467
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3468
|
-
hk.cleanup();
|
|
3468
|
+
await hk.cleanup();
|
|
3469
3469
|
}
|
|
3470
3470
|
hk.deps = deps;
|
|
3471
|
-
lilact_default.passive_effects.add(() => {
|
|
3472
|
-
hk.cleanup = effect();
|
|
3471
|
+
lilact_default.passive_effects.add(async () => {
|
|
3472
|
+
hk.cleanup = await effect();
|
|
3473
3473
|
});
|
|
3474
3474
|
lilact_default.clearTimeout(lilact_default.effect_timeout);
|
|
3475
3475
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
3476
3476
|
}
|
|
3477
|
-
function useInsertionEffect(effect, deps = void 0) {
|
|
3477
|
+
async function useInsertionEffect(effect, deps = void 0) {
|
|
3478
3478
|
if (deps !== void 0 && (typeof deps !== "object" || deps.constructor.name !== "Array")) {
|
|
3479
3479
|
throw new Error("Insertion effect dependencies must be an array, object, or omitted.");
|
|
3480
3480
|
}
|
|
@@ -3483,11 +3483,11 @@ function useInsertionEffect(effect, deps = void 0) {
|
|
|
3483
3483
|
if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3484
3484
|
}
|
|
3485
3485
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3486
|
-
hk.cleanup();
|
|
3486
|
+
await hk.cleanup();
|
|
3487
3487
|
}
|
|
3488
3488
|
hk.deps = deps;
|
|
3489
|
-
lilact_default.insertion_effects.add(() => {
|
|
3490
|
-
hk.cleanup = effect();
|
|
3489
|
+
lilact_default.insertion_effects.add(async () => {
|
|
3490
|
+
hk.cleanup = await effect();
|
|
3491
3491
|
});
|
|
3492
3492
|
lilact_default.clearTimeout(lilact_default.effect_timeout);
|
|
3493
3493
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
@@ -3633,9 +3633,9 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, { isInline, i
|
|
|
3633
3633
|
mappings,
|
|
3634
3634
|
factory: "createComponent",
|
|
3635
3635
|
appendSourcemap: false,
|
|
3636
|
-
blocks_info: lilact_default.blocks_info,
|
|
3637
3636
|
injectTraceLabels: true,
|
|
3638
|
-
produceCJS: true
|
|
3637
|
+
produceCJS: true,
|
|
3638
|
+
blocks_info: lilact_default.blocks_info
|
|
3639
3639
|
}
|
|
3640
3640
|
);
|
|
3641
3641
|
} catch (e) {
|
|
@@ -3675,6 +3675,7 @@ function require2(path2) {
|
|
|
3675
3675
|
if (el) {
|
|
3676
3676
|
return run(el.innerText, path2);
|
|
3677
3677
|
}
|
|
3678
|
+
throw new Error(`Required element not found (${path2})`);
|
|
3678
3679
|
} else {
|
|
3679
3680
|
if (requirer && requirer.path) {
|
|
3680
3681
|
path2 = joinPaths(requirer.path, path2);
|
|
@@ -3704,6 +3705,10 @@ function require2(path2) {
|
|
|
3704
3705
|
} else {
|
|
3705
3706
|
const p = (_j = (_i = lilact_default).resolver) == null ? void 0 : _j.call(_i, path2);
|
|
3706
3707
|
if (p) {
|
|
3708
|
+
if (path2.endsWith(".css")) {
|
|
3709
|
+
injectGlobal(p);
|
|
3710
|
+
return;
|
|
3711
|
+
}
|
|
3707
3712
|
return run(p, path2, false);
|
|
3708
3713
|
} else {
|
|
3709
3714
|
const request = new XMLHttpRequest();
|
|
@@ -6658,6 +6663,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
6658
6663
|
Lilact2.runScripts();
|
|
6659
6664
|
});
|
|
6660
6665
|
if (true) {
|
|
6666
|
+
window.addEventListener("unhandledrejection", (e) => {
|
|
6667
|
+
Lilact2.globalErrorHandler(e.reason);
|
|
6668
|
+
});
|
|
6661
6669
|
window.addEventListener("error", (e) => {
|
|
6662
6670
|
Lilact2.globalErrorHandler(e);
|
|
6663
6671
|
});
|