lilact 0.29.2 → 0.29.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 +106 -71
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +23 -23
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +23 -23
- 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/run.lazy.html +1 -1
- package/docs/functions/run.run.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/static/index.html +1 -1
- package/docs/static/lilact.development.js +106 -71
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +23 -23
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +23 -23
- package/docs/variables/components.cloneElement.html +1 -1
- package/examples/index.html +1 -1
- package/examples/lilact.development.js +106 -71
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +23 -23
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +23 -23
- package/package.json +1 -1
- package/src/components.jsx +108 -44
- package/src/run.jsx +41 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>runScripts | Lilact</title><meta name="description" content="Documentation for Lilact"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Lilact</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/run.html">run</a></li><li><a href="" aria-current="page">runScripts</a></li></ul><h1>Function runScripts</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="runscripts"><span class="tsd-kind-call-signature">runScripts</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#runscripts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in run.jsx:
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>runScripts | Lilact</title><meta name="description" content="Documentation for Lilact"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Lilact</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/run.html">run</a></li><li><a href="" aria-current="page">runScripts</a></li></ul><h1>Function runScripts</h1></div><section class="tsd-panel"><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="runscripts"><span class="tsd-kind-call-signature">runScripts</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><a href="#runscripts" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4><aside class="tsd-sources"><ul><li>Defined in run.jsx:502</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>
|
package/docs/static/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
|
|
7
7
|
<title>Lilact Examples</title>
|
|
8
|
-
<script src='./lilact.development.js' type="module"></script>
|
|
8
|
+
<script src='./lilact.development.min.js' type="module"></script>
|
|
9
9
|
|
|
10
10
|
<script src="prismjs/prism.min.js"></script>
|
|
11
11
|
<script src="prismjs/prism-jsx.min.js"></script>
|
|
@@ -463,18 +463,18 @@ function sheetForTag(tag) {
|
|
|
463
463
|
}
|
|
464
464
|
return void 0;
|
|
465
465
|
}
|
|
466
|
-
function createStyleElement(
|
|
466
|
+
function createStyleElement(options2) {
|
|
467
467
|
var tag = document.createElement("style");
|
|
468
|
-
tag.setAttribute("data-emotion",
|
|
469
|
-
if (
|
|
470
|
-
tag.setAttribute("nonce",
|
|
468
|
+
tag.setAttribute("data-emotion", options2.key);
|
|
469
|
+
if (options2.nonce !== void 0) {
|
|
470
|
+
tag.setAttribute("nonce", options2.nonce);
|
|
471
471
|
}
|
|
472
472
|
tag.appendChild(document.createTextNode(""));
|
|
473
473
|
tag.setAttribute("data-s", "");
|
|
474
474
|
return tag;
|
|
475
475
|
}
|
|
476
476
|
var StyleSheet = /* @__PURE__ */ (function() {
|
|
477
|
-
function StyleSheet2(
|
|
477
|
+
function StyleSheet2(options2) {
|
|
478
478
|
var _this = this;
|
|
479
479
|
this._insertTag = function(tag) {
|
|
480
480
|
var before;
|
|
@@ -492,14 +492,14 @@ var StyleSheet = /* @__PURE__ */ (function() {
|
|
|
492
492
|
_this.container.insertBefore(tag, before);
|
|
493
493
|
_this.tags.push(tag);
|
|
494
494
|
};
|
|
495
|
-
this.isSpeedy =
|
|
495
|
+
this.isSpeedy = options2.speedy === void 0 ? !isDevelopment : options2.speedy;
|
|
496
496
|
this.tags = [];
|
|
497
497
|
this.ctr = 0;
|
|
498
|
-
this.nonce =
|
|
499
|
-
this.key =
|
|
500
|
-
this.container =
|
|
501
|
-
this.prepend =
|
|
502
|
-
this.insertionPoint =
|
|
498
|
+
this.nonce = options2.nonce;
|
|
499
|
+
this.key = options2.key;
|
|
500
|
+
this.container = options2.container;
|
|
501
|
+
this.prepend = options2.prepend;
|
|
502
|
+
this.insertionPoint = options2.insertionPoint;
|
|
503
503
|
this.before = null;
|
|
504
504
|
}
|
|
505
505
|
var _proto = StyleSheet2.prototype;
|
|
@@ -1187,8 +1187,8 @@ var prefixer = function prefixer2(element, index2, children, callback) {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
};
|
|
1189
1189
|
var defaultStylisPlugins = [prefixer];
|
|
1190
|
-
var createCache = function createCache2(
|
|
1191
|
-
var key =
|
|
1190
|
+
var createCache = function createCache2(options2) {
|
|
1191
|
+
var key = options2.key;
|
|
1192
1192
|
if (key === "css") {
|
|
1193
1193
|
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
1194
1194
|
Array.prototype.forEach.call(ssrStyles, function(node3) {
|
|
@@ -1200,12 +1200,12 @@ var createCache = function createCache2(options) {
|
|
|
1200
1200
|
node3.setAttribute("data-s", "");
|
|
1201
1201
|
});
|
|
1202
1202
|
}
|
|
1203
|
-
var stylisPlugins =
|
|
1203
|
+
var stylisPlugins = options2.stylisPlugins || defaultStylisPlugins;
|
|
1204
1204
|
var inserted = {};
|
|
1205
1205
|
var container2;
|
|
1206
1206
|
var nodesToHydrate = [];
|
|
1207
1207
|
{
|
|
1208
|
-
container2 =
|
|
1208
|
+
container2 = options2.container || document.head;
|
|
1209
1209
|
Array.prototype.forEach.call(
|
|
1210
1210
|
// this means we will ignore elements which don't have a space in them which
|
|
1211
1211
|
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
@@ -1243,12 +1243,12 @@ var createCache = function createCache2(options) {
|
|
|
1243
1243
|
sheet: new StyleSheet({
|
|
1244
1244
|
key,
|
|
1245
1245
|
container: container2,
|
|
1246
|
-
nonce:
|
|
1247
|
-
speedy:
|
|
1248
|
-
prepend:
|
|
1249
|
-
insertionPoint:
|
|
1246
|
+
nonce: options2.nonce,
|
|
1247
|
+
speedy: options2.speedy,
|
|
1248
|
+
prepend: options2.prepend,
|
|
1249
|
+
insertionPoint: options2.insertionPoint
|
|
1250
1250
|
}),
|
|
1251
|
-
nonce:
|
|
1251
|
+
nonce: options2.nonce,
|
|
1252
1252
|
inserted,
|
|
1253
1253
|
registered: {},
|
|
1254
1254
|
insert: _insert
|
|
@@ -1569,8 +1569,8 @@ function merge(registered, css2, className) {
|
|
|
1569
1569
|
}
|
|
1570
1570
|
return rawClassName + css2(registeredStyles);
|
|
1571
1571
|
}
|
|
1572
|
-
var createEmotion = function createEmotion2(
|
|
1573
|
-
var cache2 = createCache(
|
|
1572
|
+
var createEmotion = function createEmotion2(options2) {
|
|
1573
|
+
var cache2 = createCache(options2);
|
|
1574
1574
|
cache2.sheet.speedy = function(value) {
|
|
1575
1575
|
this.isSpeedy = value;
|
|
1576
1576
|
};
|
|
@@ -2365,6 +2365,32 @@ __export(components_exports, {
|
|
|
2365
2365
|
update_timeout: () => update_timeout
|
|
2366
2366
|
});
|
|
2367
2367
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
2368
|
+
function getComponentEntity(entity) {
|
|
2369
|
+
return entity?.[MEMOIZED] ? entity.component : entity;
|
|
2370
|
+
}
|
|
2371
|
+
function replaceComponentEntity(comp, nextEntity) {
|
|
2372
|
+
const core = comp?.[CORE];
|
|
2373
|
+
if (!core || typeof nextEntity !== "function") {
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
const oldEntity = getComponentEntity(core.entity);
|
|
2377
|
+
const newEntity = getComponentEntity(nextEntity);
|
|
2378
|
+
if (oldEntity === newEntity) {
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
2381
|
+
const oldIsClass = isClass(oldEntity);
|
|
2382
|
+
const newIsClass = isClass(newEntity);
|
|
2383
|
+
if (oldIsClass !== newIsClass) {
|
|
2384
|
+
return false;
|
|
2385
|
+
}
|
|
2386
|
+
if (newIsClass) {
|
|
2387
|
+
Object.setPrototypeOf(comp, newEntity.prototype);
|
|
2388
|
+
} else {
|
|
2389
|
+
comp.render = newEntity.bind(comp);
|
|
2390
|
+
}
|
|
2391
|
+
core.entity = newEntity;
|
|
2392
|
+
return true;
|
|
2393
|
+
}
|
|
2368
2394
|
var ComponentCache = class {
|
|
2369
2395
|
constructor(owner) {
|
|
2370
2396
|
__publicField(this, "owner");
|
|
@@ -2373,32 +2399,35 @@ var ComponentCache = class {
|
|
|
2373
2399
|
__publicField(this, "pick_index", 0);
|
|
2374
2400
|
this.owner = owner;
|
|
2375
2401
|
}
|
|
2376
|
-
pick(key, construct_func) {
|
|
2402
|
+
pick(key, construct_func, nextEntity) {
|
|
2377
2403
|
var _a;
|
|
2378
2404
|
let comp;
|
|
2379
|
-
let
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2405
|
+
let bucket = this.current_map.get(key);
|
|
2406
|
+
const reusable = bucket && bucket.length > bucket[IDX];
|
|
2407
|
+
if (reusable) {
|
|
2408
|
+
comp = bucket[bucket[IDX]];
|
|
2409
|
+
bucket[IDX]++;
|
|
2410
|
+
const oldEntity = getComponentEntity(comp?.[CORE]?.entity);
|
|
2411
|
+
const newEntity = getComponentEntity(nextEntity);
|
|
2412
|
+
const incompatible = typeof oldEntity === "function" && typeof newEntity === "function" && isClass(oldEntity) !== isClass(newEntity);
|
|
2413
|
+
if (incompatible) {
|
|
2414
|
+
comp = construct_func();
|
|
2386
2415
|
} else {
|
|
2387
|
-
|
|
2388
|
-
this.new_map.set(key, buck);
|
|
2389
|
-
buck[IDX] = 0;
|
|
2416
|
+
replaceComponentEntity(comp, nextEntity);
|
|
2390
2417
|
}
|
|
2391
2418
|
} else {
|
|
2392
2419
|
comp = construct_func();
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2420
|
+
}
|
|
2421
|
+
bucket = this.new_map.get(key);
|
|
2422
|
+
if (bucket !== void 0) {
|
|
2423
|
+
bucket.push(comp);
|
|
2424
|
+
} else {
|
|
2425
|
+
bucket = [comp];
|
|
2426
|
+
this.new_map.set(key, bucket);
|
|
2427
|
+
bucket[IDX] = 0;
|
|
2428
|
+
}
|
|
2429
|
+
if (comp[CORE]) {
|
|
2430
|
+
(_a = comp[CORE]).parent ?? (_a.parent = this.owner);
|
|
2402
2431
|
}
|
|
2403
2432
|
return comp;
|
|
2404
2433
|
}
|
|
@@ -2867,15 +2896,20 @@ function constructFunc(core, parent) {
|
|
|
2867
2896
|
function prepareCore(parent, core) {
|
|
2868
2897
|
try {
|
|
2869
2898
|
parent.cache ?? (parent.cache = new ComponentCache(parent));
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2899
|
+
const isText = core[TEXT2] !== void 0;
|
|
2900
|
+
const key = isText ? ":text:" : core.props?.key;
|
|
2901
|
+
const entity = isText || core instanceof ComponentCore ? void 0 : core.entity;
|
|
2902
|
+
return parent.cache.pick(
|
|
2903
|
+
key,
|
|
2904
|
+
() => isText || core instanceof ComponentCore ? core : constructFunc(core, parent)[CORE],
|
|
2905
|
+
entity
|
|
2873
2906
|
);
|
|
2874
|
-
return core;
|
|
2875
2907
|
} catch (e) {
|
|
2876
2908
|
if (core?.component?.componentDidCatch) {
|
|
2877
2909
|
core.component.componentDidCatch(e);
|
|
2878
|
-
} else
|
|
2910
|
+
} else {
|
|
2911
|
+
throw e;
|
|
2912
|
+
}
|
|
2879
2913
|
}
|
|
2880
2914
|
}
|
|
2881
2915
|
function doUpdates() {
|
|
@@ -3696,16 +3730,16 @@ function createModule(path2, {
|
|
|
3696
3730
|
required_scripts[path2] = module2;
|
|
3697
3731
|
return module2;
|
|
3698
3732
|
}
|
|
3699
|
-
function loadModule(path2,
|
|
3733
|
+
function loadModule(path2, options2 = {}) {
|
|
3700
3734
|
if (lilact_default.importObjectPaths?.[path2]) {
|
|
3701
3735
|
return lilact_default.importObjectPaths[path2];
|
|
3702
3736
|
}
|
|
3703
|
-
if (
|
|
3704
|
-
path2 = joinPaths(
|
|
3737
|
+
if (options2.requirer?.path) {
|
|
3738
|
+
path2 = joinPaths(options2.requirer.path, path2);
|
|
3705
3739
|
}
|
|
3706
|
-
const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(
|
|
3740
|
+
const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(options2.isLazy);
|
|
3707
3741
|
const module2 = getOrCreateModule(path2, {});
|
|
3708
|
-
if (module2.loaded && !
|
|
3742
|
+
if (module2.loaded && !options2.forceReload) {
|
|
3709
3743
|
return module2.exports;
|
|
3710
3744
|
}
|
|
3711
3745
|
if (path2.startsWith("#")) {
|
|
@@ -3719,15 +3753,15 @@ function loadModule(path2, options = {}) {
|
|
|
3719
3753
|
return run(
|
|
3720
3754
|
element.textContent || "",
|
|
3721
3755
|
path2,
|
|
3722
|
-
{ forceReload:
|
|
3756
|
+
{ forceReload: options2.forceReload }
|
|
3723
3757
|
);
|
|
3724
3758
|
}
|
|
3725
3759
|
if (loadAsync) {
|
|
3726
3760
|
lilact_default[LAZY] = false;
|
|
3727
|
-
if (module2.request) {
|
|
3761
|
+
if (module2.request && !options2.forceReload) {
|
|
3728
3762
|
return module2.request;
|
|
3729
3763
|
}
|
|
3730
|
-
return loadAsyncResource(path2, module2);
|
|
3764
|
+
return loadAsyncResource(path2, module2, options2);
|
|
3731
3765
|
}
|
|
3732
3766
|
const resolved = lilact_default.resolver?.(path2);
|
|
3733
3767
|
if (resolved != null) {
|
|
@@ -3740,7 +3774,7 @@ function loadModule(path2, options = {}) {
|
|
|
3740
3774
|
return run(
|
|
3741
3775
|
String(resolved),
|
|
3742
3776
|
path2,
|
|
3743
|
-
{ forceReload:
|
|
3777
|
+
{ forceReload: options2.forceReload }
|
|
3744
3778
|
);
|
|
3745
3779
|
}
|
|
3746
3780
|
const request = new XMLHttpRequest();
|
|
@@ -3771,18 +3805,19 @@ function loadModule(path2, options = {}) {
|
|
|
3771
3805
|
);
|
|
3772
3806
|
}
|
|
3773
3807
|
function require2(path2) {
|
|
3774
|
-
let
|
|
3808
|
+
let options2 = {};
|
|
3775
3809
|
if (arguments.length === 2 && arguments[1] && typeof arguments[1] === "object") {
|
|
3776
|
-
|
|
3810
|
+
options2 = arguments[1];
|
|
3777
3811
|
}
|
|
3778
|
-
return loadModule(path2,
|
|
3812
|
+
return loadModule(path2, options2);
|
|
3779
3813
|
}
|
|
3780
|
-
function makeImportsObject(mod) {
|
|
3814
|
+
function makeImportsObject(mod, options2 = {}) {
|
|
3781
3815
|
mod.importsObject = {};
|
|
3782
3816
|
for (const path2 in mod.meta.imports) {
|
|
3783
3817
|
const imps = mod.meta.imports[path2];
|
|
3784
3818
|
const exps = loadModule(path2, {
|
|
3785
|
-
requirer: mod
|
|
3819
|
+
requirer: mod,
|
|
3820
|
+
forceReload: options2.forceReload
|
|
3786
3821
|
});
|
|
3787
3822
|
for (const i2 in imps.named_imports) {
|
|
3788
3823
|
if (i2 === "") continue;
|
|
@@ -3807,7 +3842,7 @@ function makeImportsObject(mod) {
|
|
|
3807
3842
|
}
|
|
3808
3843
|
}
|
|
3809
3844
|
}
|
|
3810
|
-
function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`,
|
|
3845
|
+
function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, options = {}) {
|
|
3811
3846
|
let module = required_scripts[path];
|
|
3812
3847
|
if (!module) {
|
|
3813
3848
|
module = createModule(path, {
|
|
@@ -3852,7 +3887,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {} = {}) {
|
|
|
3852
3887
|
globalThis.Lilact = lilact_default;
|
|
3853
3888
|
globalThis.createComponent = lilact_default.createComponent;
|
|
3854
3889
|
globalThis.Fragment = lilact_default.Fragment;
|
|
3855
|
-
makeImportsObject(module);
|
|
3890
|
+
makeImportsObject(module, options);
|
|
3856
3891
|
lilact_default.scriptImportsObject = module.importsObject;
|
|
3857
3892
|
const result = eval(processed);
|
|
3858
3893
|
module.loaded = true;
|
|
@@ -3864,10 +3899,10 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {} = {}) {
|
|
|
3864
3899
|
throw error2;
|
|
3865
3900
|
}
|
|
3866
3901
|
}
|
|
3867
|
-
function getOrCreateModule(path2,
|
|
3868
|
-
return required_scripts[path2] || createModule(path2,
|
|
3902
|
+
function getOrCreateModule(path2, options2 = {}) {
|
|
3903
|
+
return required_scripts[path2] || createModule(path2, options2);
|
|
3869
3904
|
}
|
|
3870
|
-
function loadAsyncResource(path2, module2) {
|
|
3905
|
+
function loadAsyncResource(path2, module2, options2 = {}) {
|
|
3871
3906
|
let source;
|
|
3872
3907
|
try {
|
|
3873
3908
|
const resolved = lilact_default.resolver?.(path2);
|
|
@@ -3901,7 +3936,7 @@ function loadAsyncResource(path2, module2) {
|
|
|
3901
3936
|
module2.loaded = true;
|
|
3902
3937
|
return void 0;
|
|
3903
3938
|
}
|
|
3904
|
-
return run(module2.code, path2,
|
|
3939
|
+
return run(module2.code, path2, options2);
|
|
3905
3940
|
}).then((result2) => result2?.default ?? result2).catch((error2) => {
|
|
3906
3941
|
module2.error = report(error2, path2);
|
|
3907
3942
|
throw module2.error;
|
|
@@ -4365,10 +4400,10 @@ function wrapListener(fn, opts = {}) {
|
|
|
4365
4400
|
}
|
|
4366
4401
|
};
|
|
4367
4402
|
}
|
|
4368
|
-
function addWrappedEventListener(target, type, fn,
|
|
4369
|
-
const handler = wrapListener(fn,
|
|
4370
|
-
target.addEventListener(type, handler,
|
|
4371
|
-
return () => target.removeEventListener(type, handler,
|
|
4403
|
+
function addWrappedEventListener(target, type, fn, options2 = {}) {
|
|
4404
|
+
const handler = wrapListener(fn, options2);
|
|
4405
|
+
target.addEventListener(type, handler, options2);
|
|
4406
|
+
return () => target.removeEventListener(type, handler, options2);
|
|
4372
4407
|
}
|
|
4373
4408
|
|
|
4374
4409
|
// .tmp/src/redux.jsx
|