lilact 0.28.0 → 0.28.4
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 +2 -2
- package/dist/lilact.development.js +315 -280
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +38 -36
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +38 -36
- package/docs/classes/accessories.ErrorBoundary.html +6 -6
- package/docs/classes/accessories.Suspense.html +3 -3
- package/docs/functions/accessories.DragHandle.html +1 -1
- package/docs/functions/accessories.Spinner.html +1 -1
- package/docs/functions/errors.globalErrorHandler.html +1 -1
- package/docs/functions/errors.scanBlockLabels.html +1 -1
- package/docs/functions/errors.traceError.html +1 -1
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/timers.animationFramePromise.html +3 -3
- package/docs/functions/timers.clearInterval.html +5 -3
- package/docs/functions/timers.clearTimeout.html +5 -3
- package/docs/functions/timers.grabTimers.html +4 -3
- package/docs/functions/timers.pauseTimers.html +5 -2
- package/docs/functions/timers.releaseTimers.html +4 -2
- package/docs/functions/timers.resetTimers.html +4 -2
- package/docs/functions/timers.resumeTimers.html +4 -2
- package/docs/functions/timers.setInterval.html +8 -6
- package/docs/functions/timers.setTimeout.html +8 -6
- package/docs/functions/timers.timeoutPromise.html +8 -149
- package/docs/static/demos/error-nested-1.jsx +11 -0
- package/docs/static/demos/error-nested-2.jsx +12 -0
- package/docs/static/demos/error-nested-3.jsx +12 -0
- package/docs/static/demos/error-nested-4.jsx +12 -0
- package/docs/static/demos/error-nested-5.jsx +11 -0
- package/docs/static/index.html +45 -38
- package/docs/static/lilact.development.js +315 -280
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +38 -36
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +38 -36
- package/docs/variables/accessories.SplitPane.html +1 -1
- package/docs/variables/errors.blocks_info.html +1 -1
- package/docs/variables/errors.error.html +1 -1
- package/examples/demos/error-nested-1.jsx +11 -0
- package/examples/demos/error-nested-2.jsx +12 -0
- package/examples/demos/error-nested-3.jsx +12 -0
- package/examples/demos/error-nested-4.jsx +12 -0
- package/examples/demos/error-nested-5.jsx +11 -0
- package/examples/index.html +45 -40
- package/examples/lilact.development.js +315 -280
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +38 -36
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +38 -36
- package/package.json +1 -1
- package/scripts/build.mjs +1 -1
- package/src/accessories.jsx +1 -4
- package/src/components.jsx +4 -4
- package/src/errors.jsx +50 -27
- package/src/jsx.js +3 -1
- package/src/lilact.jsx +4 -4
- package/src/run.jsx +9 -17
- package/src/timers.jsx +377 -207
|
@@ -1561,13 +1561,13 @@ function insertWithoutScoping(cache2, serialized) {
|
|
|
1561
1561
|
return cache2.insert("", serialized, cache2.sheet, true);
|
|
1562
1562
|
}
|
|
1563
1563
|
}
|
|
1564
|
-
function merge(registered,
|
|
1564
|
+
function merge(registered, css2, className) {
|
|
1565
1565
|
var registeredStyles = [];
|
|
1566
1566
|
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
1567
1567
|
if (registeredStyles.length < 2) {
|
|
1568
1568
|
return className;
|
|
1569
1569
|
}
|
|
1570
|
-
return rawClassName +
|
|
1570
|
+
return rawClassName + css2(registeredStyles);
|
|
1571
1571
|
}
|
|
1572
1572
|
var createEmotion = function createEmotion2(options) {
|
|
1573
1573
|
var cache2 = createCache(options);
|
|
@@ -1575,7 +1575,7 @@ var createEmotion = function createEmotion2(options) {
|
|
|
1575
1575
|
this.isSpeedy = value;
|
|
1576
1576
|
};
|
|
1577
1577
|
cache2.compat = true;
|
|
1578
|
-
var
|
|
1578
|
+
var css2 = function css3() {
|
|
1579
1579
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1580
1580
|
args[_key] = arguments[_key];
|
|
1581
1581
|
}
|
|
@@ -1602,15 +1602,15 @@ var createEmotion = function createEmotion2(options) {
|
|
|
1602
1602
|
var serialized = serializeStyles(args, cache2.registered);
|
|
1603
1603
|
insertWithoutScoping(cache2, serialized);
|
|
1604
1604
|
};
|
|
1605
|
-
var
|
|
1605
|
+
var cx2 = function cx3() {
|
|
1606
1606
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
1607
1607
|
args[_key4] = arguments[_key4];
|
|
1608
1608
|
}
|
|
1609
|
-
return merge(cache2.registered,
|
|
1609
|
+
return merge(cache2.registered, css2, classnames(args));
|
|
1610
1610
|
};
|
|
1611
1611
|
return {
|
|
1612
|
-
css:
|
|
1613
|
-
cx:
|
|
1612
|
+
css: css2,
|
|
1613
|
+
cx: cx2,
|
|
1614
1614
|
injectGlobal: injectGlobal2,
|
|
1615
1615
|
keyframes: keyframes2,
|
|
1616
1616
|
hydrate: function hydrate2(ids) {
|
|
@@ -1626,7 +1626,7 @@ var createEmotion = function createEmotion2(options) {
|
|
|
1626
1626
|
sheet: cache2.sheet,
|
|
1627
1627
|
cache: cache2,
|
|
1628
1628
|
getRegisteredStyles: getRegisteredStyles.bind(null, cache2.registered),
|
|
1629
|
-
merge: merge.bind(null, cache2.registered,
|
|
1629
|
+
merge: merge.bind(null, cache2.registered, css2)
|
|
1630
1630
|
};
|
|
1631
1631
|
};
|
|
1632
1632
|
var classnames = function classnames2(args) {
|
|
@@ -1766,8 +1766,7 @@ var isValidComponent = (value) => {
|
|
|
1766
1766
|
};
|
|
1767
1767
|
var isValidElement = isValidComponent;
|
|
1768
1768
|
var findDOMNode = (component) => {
|
|
1769
|
-
|
|
1770
|
-
if (!((_b = (_a = component[CORE]) == null ? void 0 : _a.element) == null ? void 0 : _b.parentNode)) throw new Error("findDOMNode only works on mounted components.");
|
|
1769
|
+
if (!component[CORE]?.element?.parentNode) throw new Error("findDOMNode only works on mounted components.");
|
|
1771
1770
|
return component[CORE].element;
|
|
1772
1771
|
};
|
|
1773
1772
|
function Fragment2({ children }) {
|
|
@@ -2375,7 +2374,7 @@ var ComponentCache = class {
|
|
|
2375
2374
|
this.owner = owner;
|
|
2376
2375
|
}
|
|
2377
2376
|
pick(key, construct_func) {
|
|
2378
|
-
var _a
|
|
2377
|
+
var _a;
|
|
2379
2378
|
let comp;
|
|
2380
2379
|
let buck = this.current_map.get(key);
|
|
2381
2380
|
if (buck && buck.length > buck[IDX]) {
|
|
@@ -2399,7 +2398,7 @@ var ComponentCache = class {
|
|
|
2399
2398
|
this.new_map.set(key, buck);
|
|
2400
2399
|
buck[IDX] = 0;
|
|
2401
2400
|
}
|
|
2402
|
-
if (comp[CORE]) (
|
|
2401
|
+
if (comp[CORE]) (_a = comp[CORE]).parent ?? (_a.parent = this.owner);
|
|
2403
2402
|
}
|
|
2404
2403
|
return comp;
|
|
2405
2404
|
}
|
|
@@ -2453,18 +2452,17 @@ var ComponentCore = class {
|
|
|
2453
2452
|
*/
|
|
2454
2453
|
// TODO: should componentDidUpdate be called after arranging/appending the outlet or before?
|
|
2455
2454
|
apply(next_props = this.props, next_state = this.next_state || this.state) {
|
|
2456
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2457
2455
|
let do_rerender = true;
|
|
2458
|
-
if (this.outlet &&
|
|
2459
|
-
if (shallowEqual(this.props, next_props, "children") && shallowEqual(
|
|
2456
|
+
if (this.outlet && this?.[MEMOIZED]) {
|
|
2457
|
+
if (shallowEqual(this.props, next_props, "children") && shallowEqual(this.props?.children, next_props?.children)) {
|
|
2460
2458
|
do_rerender = false;
|
|
2461
2459
|
}
|
|
2462
2460
|
}
|
|
2463
2461
|
if (do_rerender) {
|
|
2464
2462
|
if (true) {
|
|
2465
|
-
if (
|
|
2463
|
+
if (this.entity?.propTypes) {
|
|
2466
2464
|
PropTypes.checkPropTypes(this.entity.propTypes, this.props, "prop", this.entity.name);
|
|
2467
|
-
} else if (
|
|
2465
|
+
} else if (this.component?.propTypes) {
|
|
2468
2466
|
PropTypes.checkPropTypes(this.component.propTypes, this.props, "prop", this.component.name);
|
|
2469
2467
|
}
|
|
2470
2468
|
}
|
|
@@ -2472,8 +2470,8 @@ var ComponentCore = class {
|
|
|
2472
2470
|
if (this.component.constructor.defaultProps) {
|
|
2473
2471
|
next_props = { ...this.component.constructor.defaultProps, ...next_props };
|
|
2474
2472
|
}
|
|
2475
|
-
if (
|
|
2476
|
-
this.context = { ...this.parent.component.context, ...
|
|
2473
|
+
if (this?.parent?.component?.context || this?.parent?.component?.getChildContext) {
|
|
2474
|
+
this.context = { ...this.parent.component.context, ...this.parent.component.getChildContext?.() };
|
|
2477
2475
|
if (this.component.constructor.contextTypes) {
|
|
2478
2476
|
PropTypes.checkPropTypes(this.component.constructor.contextTypes, this.context, "context", this.entity.name);
|
|
2479
2477
|
}
|
|
@@ -2487,8 +2485,8 @@ var ComponentCore = class {
|
|
|
2487
2485
|
} else {
|
|
2488
2486
|
this.element = document.createElement(this.entity);
|
|
2489
2487
|
}
|
|
2490
|
-
if (next_props
|
|
2491
|
-
if (next_props
|
|
2488
|
+
if (next_props?.defaultValue) this.element.value = String(next_props.defaultValue).slice(0, next_props?.maxLength);
|
|
2489
|
+
if (next_props?.defaultChecked) this.element.checked = next_props.defaultChecked;
|
|
2492
2490
|
}
|
|
2493
2491
|
this.element[COMPONENT] = this.component;
|
|
2494
2492
|
}
|
|
@@ -2531,10 +2529,10 @@ var ComponentCore = class {
|
|
|
2531
2529
|
renderErrorHandler(this, e);
|
|
2532
2530
|
}
|
|
2533
2531
|
}
|
|
2534
|
-
if (this
|
|
2532
|
+
if (this?.portal) {
|
|
2535
2533
|
this.element = this.portal;
|
|
2536
2534
|
}
|
|
2537
|
-
if (
|
|
2535
|
+
if (this.outlet?.constructor?.name !== "Array") {
|
|
2538
2536
|
this.outlet = [this.outlet];
|
|
2539
2537
|
}
|
|
2540
2538
|
this.outlet = [...this.outlet];
|
|
@@ -2576,10 +2574,9 @@ var ComponentCore = class {
|
|
|
2576
2574
|
}
|
|
2577
2575
|
}
|
|
2578
2576
|
async cleanup() {
|
|
2579
|
-
var _a, _b, _c;
|
|
2580
2577
|
try {
|
|
2581
2578
|
const promises = [];
|
|
2582
|
-
if (
|
|
2579
|
+
if (this.props?.ref) {
|
|
2583
2580
|
if (typeof this.props.ref === "function") {
|
|
2584
2581
|
this.props.ref(null);
|
|
2585
2582
|
} else {
|
|
@@ -2589,7 +2586,7 @@ var ComponentCore = class {
|
|
|
2589
2586
|
if (this.component.componentWillUnmount) {
|
|
2590
2587
|
this.component.componentWillUnmount();
|
|
2591
2588
|
}
|
|
2592
|
-
if (
|
|
2589
|
+
if (this?.element?.parentElement && !this.portal) {
|
|
2593
2590
|
this.element.parentElement.removeChild(this.element);
|
|
2594
2591
|
}
|
|
2595
2592
|
if (this.outlet !== void 0) {
|
|
@@ -2599,7 +2596,7 @@ var ComponentCore = class {
|
|
|
2599
2596
|
}
|
|
2600
2597
|
}
|
|
2601
2598
|
}
|
|
2602
|
-
if (
|
|
2599
|
+
if (this.props?.children !== void 0) {
|
|
2603
2600
|
for (let c of this.props.children) {
|
|
2604
2601
|
if (c.cleanup) {
|
|
2605
2602
|
promises.push(c.cleanup());
|
|
@@ -2619,29 +2616,29 @@ var ComponentCore = class {
|
|
|
2619
2616
|
}
|
|
2620
2617
|
}
|
|
2621
2618
|
updateElementProps(patch, force = false) {
|
|
2622
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2623
2619
|
if (this.entity === "input") {
|
|
2624
|
-
if (!
|
|
2620
|
+
if (!patch?.type) patch.type = "text";
|
|
2625
2621
|
if (patch.type !== this.element.type) {
|
|
2626
2622
|
this.element.type = patch.type;
|
|
2627
2623
|
}
|
|
2628
|
-
if (
|
|
2624
|
+
if (patch?.value !== void 0 && patch?.value !== this.element.value) {
|
|
2629
2625
|
if (patch.value === void 0) patch.value = "";
|
|
2630
|
-
this.element.value = String(patch.value).slice(0, patch
|
|
2626
|
+
this.element.value = String(patch.value).slice(0, patch?.maxLength);
|
|
2631
2627
|
}
|
|
2632
2628
|
} else if (this.entity === "textarea") {
|
|
2633
|
-
if (
|
|
2634
|
-
this.element.value = String(patch.value).slice(0, patch
|
|
2629
|
+
if (patch?.value !== this.element.value) {
|
|
2630
|
+
this.element.value = String(patch.value).slice(0, patch?.maxLength);
|
|
2635
2631
|
}
|
|
2636
2632
|
} else if (this.entity === "select") {
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2633
|
+
if (typeof patch.value === "string") {
|
|
2634
|
+
if (patch.value !== this.element.value) {
|
|
2635
|
+
this.element.value = patch.value;
|
|
2636
|
+
}
|
|
2640
2637
|
}
|
|
2641
2638
|
} else if (this.entity === "option") {
|
|
2642
|
-
if (
|
|
2639
|
+
if (this.container?.props?.value?.constructor?.name === "Array") {
|
|
2643
2640
|
patch.selected = this.container.props.value.indexOf(patch.value) !== -1;
|
|
2644
|
-
} else if (typeof
|
|
2641
|
+
} else if (typeof this.container?.props?.value === "string") {
|
|
2645
2642
|
patch.selected = this.container.props.value === patch.value;
|
|
2646
2643
|
}
|
|
2647
2644
|
}
|
|
@@ -2660,19 +2657,19 @@ var ComponentCore = class {
|
|
|
2660
2657
|
if (special_attributes.has(al)) continue;
|
|
2661
2658
|
if (patch === this.props || !lilact_default.defaultIsEqual(patch[a], this.props[a]) || force) {
|
|
2662
2659
|
if (events_set.has(al)) {
|
|
2663
|
-
|
|
2664
|
-
|
|
2660
|
+
this.event_detachers ?? (this.event_detachers = {});
|
|
2661
|
+
this.event_detachers[al]?.();
|
|
2665
2662
|
this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, al.substring(2), patch[a]);
|
|
2666
2663
|
} else if (capture_events_set.hasOwnProperty(al)) {
|
|
2667
2664
|
const alc = capture_events_set[al];
|
|
2668
|
-
|
|
2669
|
-
|
|
2665
|
+
this.event_detachers ?? (this.event_detachers = {});
|
|
2666
|
+
this.event_detachers[al]?.();
|
|
2670
2667
|
this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, alc.substring(2), patch[a], { capture: true });
|
|
2671
2668
|
} else if (a === "style") {
|
|
2672
2669
|
if (typeof patch.style === "string") {
|
|
2673
2670
|
this.element.style = patch.style;
|
|
2674
2671
|
} else {
|
|
2675
|
-
if (
|
|
2672
|
+
if (this.props?.style) {
|
|
2676
2673
|
if (typeof this.props.style === "string") {
|
|
2677
2674
|
this.element.style = "";
|
|
2678
2675
|
} else {
|
|
@@ -2706,7 +2703,7 @@ var ComponentCore = class {
|
|
|
2706
2703
|
}
|
|
2707
2704
|
}
|
|
2708
2705
|
}
|
|
2709
|
-
if (patch
|
|
2706
|
+
if (patch?.action) {
|
|
2710
2707
|
this.element.onsubmit = patch.action;
|
|
2711
2708
|
} else {
|
|
2712
2709
|
this.element.onsubmit = void 0;
|
|
@@ -2714,11 +2711,10 @@ var ComponentCore = class {
|
|
|
2714
2711
|
this.updateElementClass(patch);
|
|
2715
2712
|
}
|
|
2716
2713
|
updateElementClass(patch = this.props) {
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
cn += " " + ((_b = this == null ? void 0 : this.parent) == null ? void 0 : _b[CHILD_CLASS_ADDENDUM]);
|
|
2714
|
+
let cn = patch?.className;
|
|
2715
|
+
cn ?? (cn = patch?.class ? patch.class : "");
|
|
2716
|
+
if (this?.parent?.[CHILD_CLASS_ADDENDUM]) {
|
|
2717
|
+
cn += " " + this?.parent?.[CHILD_CLASS_ADDENDUM];
|
|
2722
2718
|
}
|
|
2723
2719
|
if (cn.length > 0) {
|
|
2724
2720
|
cn = cn.split(/\s+/g);
|
|
@@ -2743,15 +2739,14 @@ var ComponentCore = class {
|
|
|
2743
2739
|
}
|
|
2744
2740
|
}
|
|
2745
2741
|
appendElement(core) {
|
|
2746
|
-
var _a;
|
|
2747
2742
|
if (core.portal) return;
|
|
2748
2743
|
this.scanZombies(core.container, core.element);
|
|
2749
|
-
if (
|
|
2744
|
+
if (core?.element.parentNode === null) {
|
|
2750
2745
|
core.container.element.insertBefore(
|
|
2751
2746
|
core.element,
|
|
2752
2747
|
core.container.element.childNodes[core.container.insert_index] || null
|
|
2753
2748
|
);
|
|
2754
|
-
if (
|
|
2749
|
+
if (core?.component?.componentDidMount) {
|
|
2755
2750
|
core.component.componentDidMount();
|
|
2756
2751
|
}
|
|
2757
2752
|
} else {
|
|
@@ -2765,7 +2760,6 @@ var ComponentCore = class {
|
|
|
2765
2760
|
core.container.insert_index++;
|
|
2766
2761
|
}
|
|
2767
2762
|
arrangeOutlet() {
|
|
2768
|
-
var _a;
|
|
2769
2763
|
this.insert_index = 0;
|
|
2770
2764
|
for (const core of this.outlet) {
|
|
2771
2765
|
if (core) {
|
|
@@ -2774,9 +2768,9 @@ var ComponentCore = class {
|
|
|
2774
2768
|
core.container.appendElement(core);
|
|
2775
2769
|
} else {
|
|
2776
2770
|
if (core.arrangeOutlet) core.arrangeOutlet();
|
|
2777
|
-
if (!
|
|
2771
|
+
if (!core?.mounted) {
|
|
2778
2772
|
core.mounted = true;
|
|
2779
|
-
if (
|
|
2773
|
+
if (core?.component?.componentDidMount) {
|
|
2780
2774
|
core.component.componentDidMount();
|
|
2781
2775
|
}
|
|
2782
2776
|
}
|
|
@@ -2790,21 +2784,20 @@ var ComponentCore = class {
|
|
|
2790
2784
|
}
|
|
2791
2785
|
};
|
|
2792
2786
|
var renderErrorHandler = (c, e) => {
|
|
2793
|
-
var _a, _b, _c, _d;
|
|
2794
2787
|
const stack = [c];
|
|
2795
|
-
while (c && !
|
|
2788
|
+
while (c && !c.component?.componentDidCatch) {
|
|
2796
2789
|
c = c.parent;
|
|
2797
2790
|
if (c) stack.push(c);
|
|
2798
2791
|
}
|
|
2799
|
-
if (
|
|
2800
|
-
if (
|
|
2792
|
+
if (c?.component?.componentDidCatch) {
|
|
2793
|
+
if (c.entity?.getDerivedStateFromError) {
|
|
2801
2794
|
c.component.setState(c.entity.getDerivedStateFromError.call(c, e));
|
|
2802
2795
|
}
|
|
2803
2796
|
}
|
|
2804
2797
|
let stack_log = Array.prototype.map.call(stack, (x) => `in ${typeof x.component.displayName === "function" ? x.component.displayName() : x.component.displayName}`).join("\n");
|
|
2805
2798
|
e.componentStack = stack;
|
|
2806
2799
|
e.componentStackLog = stack_log;
|
|
2807
|
-
if (
|
|
2800
|
+
if (c?.component?.componentDidCatch) {
|
|
2808
2801
|
c.component.componentDidCatch(e, { componentStack: stack, componentStackLog: stack_log });
|
|
2809
2802
|
} else throw e;
|
|
2810
2803
|
};
|
|
@@ -2826,7 +2819,7 @@ function constructFunc(core, parent) {
|
|
|
2826
2819
|
comp = new HTMLComponent(entity, core.props);
|
|
2827
2820
|
} else {
|
|
2828
2821
|
if (isClass(entity)) {
|
|
2829
|
-
if (entity
|
|
2822
|
+
if (entity?.defaultProps) {
|
|
2830
2823
|
core.props = { ...entity.defaultProps, ...core.props };
|
|
2831
2824
|
}
|
|
2832
2825
|
comp = new entity(core.props);
|
|
@@ -2849,7 +2842,7 @@ function constructFunc(core, parent) {
|
|
|
2849
2842
|
}
|
|
2850
2843
|
}
|
|
2851
2844
|
} else if (typeof entity === "function") {
|
|
2852
|
-
if (entity
|
|
2845
|
+
if (entity?.defaultProps) {
|
|
2853
2846
|
core.props = { ...entity.defaultProps, ...core.props };
|
|
2854
2847
|
}
|
|
2855
2848
|
comp = new Component(core.props);
|
|
@@ -2870,16 +2863,15 @@ function constructFunc(core, parent) {
|
|
|
2870
2863
|
return comp;
|
|
2871
2864
|
}
|
|
2872
2865
|
function prepareCore(parent, core) {
|
|
2873
|
-
var _a, _b, _c;
|
|
2874
2866
|
try {
|
|
2875
|
-
|
|
2867
|
+
parent.cache ?? (parent.cache = new ComponentCache(parent));
|
|
2876
2868
|
core = parent.cache.pick(
|
|
2877
|
-
core[TEXT2] === void 0 ?
|
|
2869
|
+
core[TEXT2] === void 0 ? core?.props?.key : ":text:",
|
|
2878
2870
|
() => core[TEXT2] !== void 0 || core instanceof ComponentCore ? core : constructFunc(core, parent)[CORE]
|
|
2879
2871
|
);
|
|
2880
2872
|
return core;
|
|
2881
2873
|
} catch (e) {
|
|
2882
|
-
if (
|
|
2874
|
+
if (core?.component?.componentDidCatch) {
|
|
2883
2875
|
core.component.componentDidCatch(e);
|
|
2884
2876
|
} else throw e;
|
|
2885
2877
|
}
|
|
@@ -2921,7 +2913,7 @@ var generateComponentKey = (entity, props) => {
|
|
|
2921
2913
|
} else {
|
|
2922
2914
|
if (typeof entity === "string") {
|
|
2923
2915
|
key = ":t:" + entity;
|
|
2924
|
-
} else if (entity
|
|
2916
|
+
} else if (entity?.name) {
|
|
2925
2917
|
key = entity.name;
|
|
2926
2918
|
} else {
|
|
2927
2919
|
key = "::";
|
|
@@ -3012,7 +3004,7 @@ var Component = class {
|
|
|
3012
3004
|
*/
|
|
3013
3005
|
displayName() {
|
|
3014
3006
|
const entity = this[CORE].entity;
|
|
3015
|
-
if (entity
|
|
3007
|
+
if (entity?.displayName) {
|
|
3016
3008
|
return typeof entity.displayName === "function" ? entity.displayName() : entity.displayName;
|
|
3017
3009
|
}
|
|
3018
3010
|
if (typeof entity === "string") {
|
|
@@ -3150,7 +3142,7 @@ function createPortal(children, element) {
|
|
|
3150
3142
|
}
|
|
3151
3143
|
function cloneComponent(component, propsPatch, ...children) {
|
|
3152
3144
|
const cc = { entity: component.entity, props: { ...component.props, ...propsPatch }, [CORE]: null };
|
|
3153
|
-
if (children
|
|
3145
|
+
if (children?.length) {
|
|
3154
3146
|
cc.props.children = children;
|
|
3155
3147
|
}
|
|
3156
3148
|
return cc;
|
|
@@ -3383,11 +3375,11 @@ function useCallback(callback, deps = void 0) {
|
|
|
3383
3375
|
}
|
|
3384
3376
|
const hk = useHook();
|
|
3385
3377
|
if (!isEmpty(hk)) {
|
|
3386
|
-
if (deps !== void 0 &&
|
|
3378
|
+
if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) {
|
|
3387
3379
|
return hk.callback;
|
|
3388
3380
|
}
|
|
3389
3381
|
}
|
|
3390
|
-
if (hk
|
|
3382
|
+
if (hk?.cleanup) {
|
|
3391
3383
|
hk.cleanup();
|
|
3392
3384
|
}
|
|
3393
3385
|
hk.deps = deps;
|
|
@@ -3404,12 +3396,11 @@ function createContext(defaultValue) {
|
|
|
3404
3396
|
};
|
|
3405
3397
|
}
|
|
3406
3398
|
function useContext(context2) {
|
|
3407
|
-
|
|
3408
|
-
let core = (_a = lilact_default.current_component[0]) == null ? void 0 : _a.parent;
|
|
3399
|
+
let core = lilact_default.current_component[0]?.parent;
|
|
3409
3400
|
while (core && core.entity !== context2.Provider) {
|
|
3410
3401
|
core = core.parent;
|
|
3411
3402
|
}
|
|
3412
|
-
return core ?
|
|
3403
|
+
return core ? core.props?.value ?? context2.default : context2.default;
|
|
3413
3404
|
}
|
|
3414
3405
|
function useId(prefix2 = "N") {
|
|
3415
3406
|
const hk = useHook();
|
|
@@ -3476,9 +3467,9 @@ async function useLayoutEffect(effect, deps = void 0) {
|
|
|
3476
3467
|
}
|
|
3477
3468
|
const hk = useHook();
|
|
3478
3469
|
if (!isEmpty(hk)) {
|
|
3479
|
-
if (deps !== void 0 &&
|
|
3470
|
+
if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3480
3471
|
}
|
|
3481
|
-
if (hk
|
|
3472
|
+
if (hk?.cleanup) {
|
|
3482
3473
|
await hk.cleanup();
|
|
3483
3474
|
hk.cleanup = void 0;
|
|
3484
3475
|
}
|
|
@@ -3495,9 +3486,9 @@ async function useEffect(effect, deps = void 0) {
|
|
|
3495
3486
|
}
|
|
3496
3487
|
const hk = useHook();
|
|
3497
3488
|
if (!isEmpty(hk)) {
|
|
3498
|
-
if (deps !== void 0 &&
|
|
3489
|
+
if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3499
3490
|
}
|
|
3500
|
-
if (hk
|
|
3491
|
+
if (hk?.cleanup) {
|
|
3501
3492
|
await hk.cleanup();
|
|
3502
3493
|
hk.cleanup = void 0;
|
|
3503
3494
|
}
|
|
@@ -3514,9 +3505,9 @@ async function useInsertionEffect(effect, deps = void 0) {
|
|
|
3514
3505
|
}
|
|
3515
3506
|
const hk = useHook();
|
|
3516
3507
|
if (!isEmpty(hk)) {
|
|
3517
|
-
if (deps !== void 0 &&
|
|
3508
|
+
if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3518
3509
|
}
|
|
3519
|
-
if (hk
|
|
3510
|
+
if (hk?.cleanup) {
|
|
3520
3511
|
await hk.cleanup();
|
|
3521
3512
|
hk.cleanup = void 0;
|
|
3522
3513
|
}
|
|
@@ -3533,7 +3524,7 @@ function useMemo(factory, deps = void 0) {
|
|
|
3533
3524
|
}
|
|
3534
3525
|
const hk = useHook();
|
|
3535
3526
|
if (!isEmpty(hk)) {
|
|
3536
|
-
if (deps !== void 0 &&
|
|
3527
|
+
if (deps !== void 0 && hk?.deps !== void 0 && shallowEqual(deps, hk.deps)) {
|
|
3537
3528
|
return hk.value;
|
|
3538
3529
|
}
|
|
3539
3530
|
}
|
|
@@ -3606,9 +3597,9 @@ function useDeferredValue(value, initialValue) {
|
|
|
3606
3597
|
return deferred;
|
|
3607
3598
|
}
|
|
3608
3599
|
function useImperativeHandle(ref, factory, deps = void 0) {
|
|
3609
|
-
if (deps !== void 0 &&
|
|
3600
|
+
if (deps !== void 0 && ref?.deps !== void 0 && shallowEqual(deps, ref.deps)) return;
|
|
3610
3601
|
ref.deps = deps;
|
|
3611
|
-
if (typeof
|
|
3602
|
+
if (typeof ref?.current !== "object") {
|
|
3612
3603
|
ref.current = {};
|
|
3613
3604
|
}
|
|
3614
3605
|
Object.assign(ref.current, factory());
|
|
@@ -3649,9 +3640,9 @@ function joinPaths(basePath, relativePath) {
|
|
|
3649
3640
|
}
|
|
3650
3641
|
function asError(value, fallback = "Unknown error") {
|
|
3651
3642
|
if (value instanceof Error) return value;
|
|
3652
|
-
if (
|
|
3643
|
+
if (value?.error instanceof Error) return value.error;
|
|
3653
3644
|
const error2 = new Error(
|
|
3654
|
-
|
|
3645
|
+
value?.message == null ? fallback : String(value.message)
|
|
3655
3646
|
);
|
|
3656
3647
|
if (value && typeof value === "object") {
|
|
3657
3648
|
if (value.name) error2.name = value.name;
|
|
@@ -3709,7 +3700,6 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
|
3709
3700
|
isInline = true,
|
|
3710
3701
|
isModule = true
|
|
3711
3702
|
} = {}) {
|
|
3712
|
-
var _a, _b;
|
|
3713
3703
|
let module = required_scripts[path];
|
|
3714
3704
|
if (!module) {
|
|
3715
3705
|
module = createModule(path, {
|
|
@@ -3733,14 +3723,15 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
|
3733
3723
|
path,
|
|
3734
3724
|
mappings: module.mappings,
|
|
3735
3725
|
factory: "createComponent",
|
|
3736
|
-
appendSourcemap:
|
|
3726
|
+
appendSourcemap: true,
|
|
3737
3727
|
injectTraceLabels: true,
|
|
3738
3728
|
produceCJS: true,
|
|
3739
3729
|
blocks_info: lilact_default.blocks_info
|
|
3740
3730
|
});
|
|
3741
3731
|
} catch (value) {
|
|
3742
3732
|
const error2 = asError(value);
|
|
3743
|
-
|
|
3733
|
+
error2.fileName ?? (error2.fileName = path);
|
|
3734
|
+
error2.lilact_source ?? (error2.lilact_source = { path });
|
|
3744
3735
|
error2.sourcePhase = "transpile";
|
|
3745
3736
|
module.error = error2;
|
|
3746
3737
|
lilact_default.error = error2;
|
|
@@ -3749,9 +3740,8 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
|
3749
3740
|
if (typeof lilact_default.scanBlockLabels === "function") {
|
|
3750
3741
|
lilact_default.scanBlockLabels(processed, path);
|
|
3751
3742
|
}
|
|
3752
|
-
processed += `
|
|
3753
|
-
//# sourceURL=eval:/${path}`;
|
|
3754
3743
|
try {
|
|
3744
|
+
new Function(processed);
|
|
3755
3745
|
globalThis.Lilact = lilact_default;
|
|
3756
3746
|
globalThis.createComponent = lilact_default.createComponent;
|
|
3757
3747
|
globalThis.Fragment = lilact_default.Fragment;
|
|
@@ -3760,7 +3750,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
|
3760
3750
|
return isEmpty(module.exports) ? result : module.exports;
|
|
3761
3751
|
} catch (value) {
|
|
3762
3752
|
const error2 = report(value, path);
|
|
3763
|
-
|
|
3753
|
+
error2.sourcePhase ?? (error2.sourcePhase = "runtime");
|
|
3764
3754
|
module.error = error2;
|
|
3765
3755
|
throw error2;
|
|
3766
3756
|
}
|
|
@@ -3769,10 +3759,9 @@ function getOrCreateModule(path2, options = {}) {
|
|
|
3769
3759
|
return required_scripts[path2] || createModule(path2, options);
|
|
3770
3760
|
}
|
|
3771
3761
|
function loadAsyncResource(path2, module2) {
|
|
3772
|
-
var _a, _b;
|
|
3773
3762
|
let source;
|
|
3774
3763
|
try {
|
|
3775
|
-
const resolved =
|
|
3764
|
+
const resolved = lilact_default.resolver?.(path2);
|
|
3776
3765
|
if (resolved == null) {
|
|
3777
3766
|
if (module2.code && !module2.loaded) {
|
|
3778
3767
|
source = Promise.resolve(module2.code);
|
|
@@ -3807,10 +3796,7 @@ function loadAsyncResource(path2, module2) {
|
|
|
3807
3796
|
isInline: false,
|
|
3808
3797
|
isModule: true
|
|
3809
3798
|
});
|
|
3810
|
-
}).then((result2) => {
|
|
3811
|
-
var _a2;
|
|
3812
|
-
return (_a2 = result2 == null ? void 0 : result2.default) != null ? _a2 : result2;
|
|
3813
|
-
}).catch((error2) => {
|
|
3799
|
+
}).then((result2) => result2?.default ?? result2).catch((error2) => {
|
|
3814
3800
|
module2.error = report(error2, path2);
|
|
3815
3801
|
throw module2.error;
|
|
3816
3802
|
}).finally(() => {
|
|
@@ -3822,15 +3808,14 @@ function loadAsyncResource(path2, module2) {
|
|
|
3822
3808
|
return request;
|
|
3823
3809
|
}
|
|
3824
3810
|
function require2(path2) {
|
|
3825
|
-
var _a, _b, _c, _d;
|
|
3826
3811
|
let options = {};
|
|
3827
3812
|
if (arguments.length === 2 && arguments[1] && typeof arguments[1] === "object") {
|
|
3828
3813
|
options = arguments[1];
|
|
3829
3814
|
}
|
|
3830
|
-
if (
|
|
3815
|
+
if (lilact_default.importObjectPaths?.[path2]) {
|
|
3831
3816
|
return lilact_default.importObjectPaths[path2];
|
|
3832
3817
|
}
|
|
3833
|
-
if (
|
|
3818
|
+
if (options.requirer?.path) {
|
|
3834
3819
|
path2 = joinPaths(options.requirer.path, path2);
|
|
3835
3820
|
}
|
|
3836
3821
|
const loadAsync = Boolean(lilact_default[LAZY]) || Boolean(options.isLazy);
|
|
@@ -3858,7 +3843,7 @@ function require2(path2) {
|
|
|
3858
3843
|
}
|
|
3859
3844
|
return loadAsyncResource(path2, module2);
|
|
3860
3845
|
}
|
|
3861
|
-
const resolved =
|
|
3846
|
+
const resolved = lilact_default.resolver?.(path2);
|
|
3862
3847
|
if (resolved != null) {
|
|
3863
3848
|
if (path2.endsWith(".css")) {
|
|
3864
3849
|
injectGlobal(String(resolved));
|
|
@@ -3982,10 +3967,10 @@ function Transition({
|
|
|
3982
3967
|
// but the user should use CSSTransition itself.
|
|
3983
3968
|
_classNames: classNames
|
|
3984
3969
|
}) {
|
|
3985
|
-
var _a, _b, _c
|
|
3986
|
-
(
|
|
3987
|
-
(
|
|
3988
|
-
(
|
|
3970
|
+
var _a, _b, _c;
|
|
3971
|
+
(_a = this[CORE]).is_mounted ?? (_a.is_mounted = !mountOnEnter || inProp || appear);
|
|
3972
|
+
(_b = this[CORE]).is_appeared ?? (_b.is_appeared = inProp);
|
|
3973
|
+
(_c = this[CORE]).timer ?? (_c.timer = null);
|
|
3989
3974
|
this[CORE].childFunctionHandler = (func) => {
|
|
3990
3975
|
return func(this[CORE].mount_state);
|
|
3991
3976
|
};
|
|
@@ -4000,15 +3985,15 @@ function Transition({
|
|
|
4000
3985
|
}, []);
|
|
4001
3986
|
useEffect(() => {
|
|
4002
3987
|
if (!this[CORE].is_appeared && appear && this[CORE].mount_state === ENTERING && inProp) {
|
|
4003
|
-
onEnter
|
|
3988
|
+
onEnter?.();
|
|
4004
3989
|
requestAnimationFrame(() => {
|
|
4005
|
-
onEntering
|
|
3990
|
+
onEntering?.(!this[CORE].is_appeared);
|
|
4006
3991
|
clearTimeout(this[CORE].timer);
|
|
4007
3992
|
this[CORE].timer = setTimeout(() => {
|
|
4008
3993
|
this[CORE].mount_state = ENTERED;
|
|
4009
3994
|
this.forceUpdate();
|
|
4010
3995
|
this[CORE].is_appeared = true;
|
|
4011
|
-
onEntered
|
|
3996
|
+
onEntered?.(!this[CORE].is_appeared);
|
|
4012
3997
|
}, timeout);
|
|
4013
3998
|
});
|
|
4014
3999
|
}
|
|
@@ -4017,29 +4002,29 @@ function Transition({
|
|
|
4017
4002
|
if (inProp) {
|
|
4018
4003
|
this[CORE].is_mounted = true;
|
|
4019
4004
|
if (this[CORE].mount_state === ENTERING || this[CORE].mount_state === ENTERED) return;
|
|
4020
|
-
onEnter
|
|
4005
|
+
onEnter?.(!this[CORE].is_appeared);
|
|
4021
4006
|
this[CORE].mount_state = ENTERING;
|
|
4022
4007
|
this.forceUpdate(() => {
|
|
4023
|
-
onEntering
|
|
4008
|
+
onEntering?.(!this[CORE].is_appeared);
|
|
4024
4009
|
clearTimeout(this[CORE].timer);
|
|
4025
4010
|
this[CORE].timer = setTimeout(() => {
|
|
4026
4011
|
this[CORE].mount_state = ENTERED;
|
|
4027
4012
|
this.forceUpdate();
|
|
4028
4013
|
this[CORE].is_appeared = true;
|
|
4029
|
-
onEntered
|
|
4014
|
+
onEntered?.();
|
|
4030
4015
|
}, timeout);
|
|
4031
4016
|
});
|
|
4032
4017
|
} else {
|
|
4033
4018
|
if (this[CORE].mount_state === UNMOUNTED || this[CORE].mount_state === EXITING || this[CORE].mount_state === EXITED) return;
|
|
4034
|
-
onExit
|
|
4019
|
+
onExit?.();
|
|
4035
4020
|
this[CORE].mount_state = EXITING;
|
|
4036
4021
|
this.forceUpdate(() => {
|
|
4037
|
-
onExiting
|
|
4022
|
+
onExiting?.();
|
|
4038
4023
|
clearTimeout(this[CORE].timer);
|
|
4039
4024
|
this[CORE].timer = setTimeout(() => {
|
|
4040
4025
|
this[CORE].mount_state = EXITED;
|
|
4041
4026
|
this.forceUpdate();
|
|
4042
|
-
onExited
|
|
4027
|
+
onExited?.();
|
|
4043
4028
|
if (unmountOnExit) {
|
|
4044
4029
|
this[CORE].is_mounted = false;
|
|
4045
4030
|
this[CORE].mount_state = UNMOUNTED;
|
|
@@ -4161,8 +4146,7 @@ function SwitchTransition({
|
|
|
4161
4146
|
}
|
|
4162
4147
|
};
|
|
4163
4148
|
return createComponent("div", { "style": { position: "relative" } }, childArray.map((child, index2) => {
|
|
4164
|
-
|
|
4165
|
-
const key = ((_a = child == null ? void 0 : child.props) == null ? void 0 : _a.key) || index2;
|
|
4149
|
+
const key = child?.props?.key || index2;
|
|
4166
4150
|
const isIncoming = key === activeKey;
|
|
4167
4151
|
const isOutgoing = key === exitingKey;
|
|
4168
4152
|
const inProp = isIncoming ? enterAllowed : isOutgoing ? !exitStarted : false;
|
|
@@ -4206,7 +4190,6 @@ var _pool = [];
|
|
|
4206
4190
|
var MAX_POOL_SIZE = 10;
|
|
4207
4191
|
var POINTER_TYPES = ["mouse", "pen", "touch"];
|
|
4208
4192
|
function createSyntheticEvent(nativeEvent, currentTarget) {
|
|
4209
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
4210
4193
|
const e = _pool.length ? _pool.pop() : {};
|
|
4211
4194
|
e.nativeEvent = nativeEvent;
|
|
4212
4195
|
e.type = nativeEvent.type;
|
|
@@ -4239,25 +4222,25 @@ function createSyntheticEvent(nativeEvent, currentTarget) {
|
|
|
4239
4222
|
};
|
|
4240
4223
|
e.key = nativeEvent.key || null;
|
|
4241
4224
|
e.code = nativeEvent.code || null;
|
|
4242
|
-
e.which =
|
|
4243
|
-
e.button =
|
|
4244
|
-
e.buttons =
|
|
4245
|
-
e.pointerId =
|
|
4246
|
-
e.pointerType =
|
|
4247
|
-
e.isPrimary =
|
|
4248
|
-
e.clientX =
|
|
4249
|
-
e.clientY =
|
|
4250
|
-
e.screenX =
|
|
4251
|
-
e.screenY =
|
|
4252
|
-
e.pageX =
|
|
4253
|
-
e.pageY =
|
|
4254
|
-
e.movementX =
|
|
4255
|
-
e.movementY =
|
|
4256
|
-
e.pressure =
|
|
4257
|
-
e.tiltX =
|
|
4258
|
-
e.tiltY =
|
|
4259
|
-
e.width =
|
|
4260
|
-
e.height =
|
|
4225
|
+
e.which = nativeEvent.which ?? nativeEvent.keyCode ?? null;
|
|
4226
|
+
e.button = nativeEvent.button ?? null;
|
|
4227
|
+
e.buttons = nativeEvent.buttons ?? null;
|
|
4228
|
+
e.pointerId = nativeEvent.pointerId ?? null;
|
|
4229
|
+
e.pointerType = nativeEvent.pointerType ?? null;
|
|
4230
|
+
e.isPrimary = nativeEvent.isPrimary ?? null;
|
|
4231
|
+
e.clientX = nativeEvent.clientX ?? 0;
|
|
4232
|
+
e.clientY = nativeEvent.clientY ?? 0;
|
|
4233
|
+
e.screenX = nativeEvent.screenX ?? 0;
|
|
4234
|
+
e.screenY = nativeEvent.screenY ?? 0;
|
|
4235
|
+
e.pageX = nativeEvent.pageX ?? null;
|
|
4236
|
+
e.pageY = nativeEvent.pageY ?? null;
|
|
4237
|
+
e.movementX = nativeEvent.movementX ?? 0;
|
|
4238
|
+
e.movementY = nativeEvent.movementY ?? 0;
|
|
4239
|
+
e.pressure = nativeEvent.pressure ?? null;
|
|
4240
|
+
e.tiltX = nativeEvent.tiltX ?? null;
|
|
4241
|
+
e.tiltY = nativeEvent.tiltY ?? null;
|
|
4242
|
+
e.width = nativeEvent.width ?? null;
|
|
4243
|
+
e.height = nativeEvent.height ?? null;
|
|
4261
4244
|
e.pointerEventsSupported = POINTER_TYPES.includes(e.pointerType);
|
|
4262
4245
|
try {
|
|
4263
4246
|
const tgt = e.target;
|
|
@@ -4275,8 +4258,8 @@ function createSyntheticEvent(nativeEvent, currentTarget) {
|
|
|
4275
4258
|
e.targetTouches = nativeEvent.targetTouches || null;
|
|
4276
4259
|
e.changedTouches = nativeEvent.changedTouches || null;
|
|
4277
4260
|
e.path = typeof nativeEvent.composedPath === "function" ? nativeEvent.composedPath() : [e.target];
|
|
4278
|
-
e.repeat =
|
|
4279
|
-
e.location =
|
|
4261
|
+
e.repeat = nativeEvent.repeat ?? false;
|
|
4262
|
+
e.location = nativeEvent.location ?? 0;
|
|
4280
4263
|
return e;
|
|
4281
4264
|
}
|
|
4282
4265
|
function releaseSyntheticEvent(e) {
|
|
@@ -4369,7 +4352,7 @@ __export(redux_exports2, {
|
|
|
4369
4352
|
});
|
|
4370
4353
|
var ReduxContext;
|
|
4371
4354
|
function Provider({ store, children }) {
|
|
4372
|
-
ReduxContext
|
|
4355
|
+
ReduxContext ?? (ReduxContext = createContext(null));
|
|
4373
4356
|
return createComponent(ReduxContext.Provider, { "value": store }, children);
|
|
4374
4357
|
}
|
|
4375
4358
|
function useStore() {
|
|
@@ -4467,24 +4450,21 @@ __export(timers_exports, {
|
|
|
4467
4450
|
setTimeout: () => setTimeout2,
|
|
4468
4451
|
timeoutPromise: () => timeoutPromise
|
|
4469
4452
|
});
|
|
4470
|
-
var timer_pause_time
|
|
4471
|
-
var current_timer_idx =
|
|
4453
|
+
var timer_pause_time;
|
|
4454
|
+
var current_timer_idx = 0;
|
|
4472
4455
|
var timer_list = [];
|
|
4473
|
-
var timer_timeout =
|
|
4474
|
-
var all_timers =
|
|
4475
|
-
var _setTimeout = window.setTimeout;
|
|
4476
|
-
var _setInterval = window.setInterval;
|
|
4477
|
-
var _clearTimeout = window.clearTimeout;
|
|
4478
|
-
var _clearInterval = window.clearInterval;
|
|
4456
|
+
var timer_timeout = 0;
|
|
4457
|
+
var all_timers = /* @__PURE__ */ new Map();
|
|
4479
4458
|
function get_bucket(target) {
|
|
4480
4459
|
let left = 0;
|
|
4481
4460
|
let right = timer_list.length - 1;
|
|
4482
4461
|
while (left <= right) {
|
|
4483
4462
|
const mid = Math.floor((left + right) / 2);
|
|
4484
|
-
const
|
|
4485
|
-
if (
|
|
4463
|
+
const mid_value = timer_list[mid][DUE];
|
|
4464
|
+
if (mid_value === target) {
|
|
4486
4465
|
return [mid, timer_list[mid]];
|
|
4487
|
-
}
|
|
4466
|
+
}
|
|
4467
|
+
if (mid_value < target) {
|
|
4488
4468
|
left = mid + 1;
|
|
4489
4469
|
} else {
|
|
4490
4470
|
right = mid - 1;
|
|
@@ -4495,84 +4475,142 @@ function get_bucket(target) {
|
|
|
4495
4475
|
timer_list.splice(left, 0, bucket);
|
|
4496
4476
|
return [left, bucket];
|
|
4497
4477
|
}
|
|
4498
|
-
function
|
|
4499
|
-
|
|
4478
|
+
function schedule_next_timer() {
|
|
4479
|
+
if (timer_pause_time !== void 0 || timer_list.length === 0) {
|
|
4480
|
+
return;
|
|
4481
|
+
}
|
|
4482
|
+
Lilact._clearTimeout(timer_timeout);
|
|
4483
|
+
const delay = Math.max(
|
|
4484
|
+
0,
|
|
4485
|
+
timer_list[0][DUE] - Date.now()
|
|
4486
|
+
);
|
|
4487
|
+
timer_timeout = Lilact._setTimeout(run_timer, delay);
|
|
4488
|
+
}
|
|
4489
|
+
function add_timer(timer, is_repeat = false) {
|
|
4490
|
+
const [bucket_index, bucket] = get_bucket(timer[DUE]);
|
|
4500
4491
|
if (!is_repeat) {
|
|
4501
|
-
current_timer_idx
|
|
4502
|
-
|
|
4503
|
-
|
|
4492
|
+
current_timer_idx += 1;
|
|
4493
|
+
timer[IDX] = current_timer_idx;
|
|
4494
|
+
all_timers.set(timer[IDX], timer);
|
|
4504
4495
|
}
|
|
4505
|
-
bucket.push(
|
|
4506
|
-
if (
|
|
4507
|
-
|
|
4508
|
-
timer_timeout = _setTimeout(run_timer, t[INTERVAL]);
|
|
4496
|
+
bucket.push(timer);
|
|
4497
|
+
if (bucket_index === 0 && timer_pause_time === void 0) {
|
|
4498
|
+
schedule_next_timer();
|
|
4509
4499
|
}
|
|
4510
|
-
return
|
|
4500
|
+
return timer[IDX];
|
|
4511
4501
|
}
|
|
4512
4502
|
function run_timer() {
|
|
4503
|
+
timer_timeout = -1;
|
|
4513
4504
|
const now = Date.now();
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
add_timer(t, true);
|
|
4523
|
-
} else {
|
|
4524
|
-
delete all_timers[t[IDX]];
|
|
4525
|
-
}
|
|
4526
|
-
} else {
|
|
4527
|
-
delete all_timers[t[IDX]];
|
|
4528
|
-
}
|
|
4505
|
+
const due_buckets = [];
|
|
4506
|
+
while (timer_list.length > 0 && timer_list[0][DUE] - now <= 0) {
|
|
4507
|
+
due_buckets.push(timer_list.shift());
|
|
4508
|
+
}
|
|
4509
|
+
const due_timers = [];
|
|
4510
|
+
for (const bucket of due_buckets) {
|
|
4511
|
+
for (const timer of bucket) {
|
|
4512
|
+
due_timers.push(timer);
|
|
4529
4513
|
}
|
|
4530
|
-
i2++;
|
|
4531
|
-
buck = timer_list[i2];
|
|
4532
4514
|
}
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4515
|
+
let first_error;
|
|
4516
|
+
for (const timer of due_timers) {
|
|
4517
|
+
if (timer[CLEARED] || all_timers.get(timer[IDX]) !== timer) {
|
|
4518
|
+
all_timers.delete(timer[IDX]);
|
|
4519
|
+
continue;
|
|
4520
|
+
}
|
|
4521
|
+
try {
|
|
4522
|
+
timer[CALLBACK](...timer[ARGS]);
|
|
4523
|
+
} catch (error2) {
|
|
4524
|
+
first_error ?? (first_error = error2);
|
|
4525
|
+
}
|
|
4526
|
+
if (timer[CLEARED]) {
|
|
4527
|
+
all_timers.delete(timer[IDX]);
|
|
4528
|
+
continue;
|
|
4529
|
+
}
|
|
4530
|
+
if (all_timers.get(timer[IDX]) !== timer) {
|
|
4531
|
+
continue;
|
|
4532
|
+
}
|
|
4533
|
+
if (timer[REPEAT]) {
|
|
4534
|
+
timer[DUE] = Date.now() + timer[INTERVAL];
|
|
4535
|
+
add_timer(timer, true);
|
|
4536
|
+
} else {
|
|
4537
|
+
all_timers.delete(timer[IDX]);
|
|
4538
|
+
}
|
|
4539
|
+
}
|
|
4540
|
+
schedule_next_timer();
|
|
4541
|
+
if (first_error !== void 0) {
|
|
4542
|
+
Lilact._setTimeout(() => {
|
|
4543
|
+
throw first_error;
|
|
4544
|
+
}, 0);
|
|
4537
4545
|
}
|
|
4538
4546
|
}
|
|
4539
4547
|
function resetTimers() {
|
|
4540
|
-
_clearTimeout(timer_timeout);
|
|
4548
|
+
Lilact._clearTimeout(timer_timeout);
|
|
4549
|
+
for (const timer of all_timers.values()) {
|
|
4550
|
+
timer[CLEARED] = true;
|
|
4551
|
+
}
|
|
4541
4552
|
timer_pause_time = void 0;
|
|
4542
4553
|
current_timer_idx = -1;
|
|
4543
4554
|
timer_list = [];
|
|
4544
4555
|
timer_timeout = -1;
|
|
4545
|
-
all_timers =
|
|
4556
|
+
all_timers = /* @__PURE__ */ new Map();
|
|
4546
4557
|
}
|
|
4547
4558
|
function pauseTimers() {
|
|
4548
|
-
|
|
4559
|
+
if (timer_pause_time !== void 0) {
|
|
4560
|
+
return;
|
|
4561
|
+
}
|
|
4562
|
+
Lilact._clearTimeout(timer_timeout);
|
|
4563
|
+
timer_timeout = -1;
|
|
4549
4564
|
timer_pause_time = Date.now();
|
|
4550
4565
|
}
|
|
4551
4566
|
function resumeTimers() {
|
|
4552
|
-
if (
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
}
|
|
4559
|
-
timer_timeout = _setTimeout(run_timer, timer_list[0][DUE] - now);
|
|
4567
|
+
if (timer_pause_time === void 0) {
|
|
4568
|
+
return;
|
|
4569
|
+
}
|
|
4570
|
+
const elapsed = Date.now() - timer_pause_time;
|
|
4571
|
+
for (const bucket of timer_list) {
|
|
4572
|
+
bucket[DUE] += elapsed;
|
|
4560
4573
|
}
|
|
4561
4574
|
timer_pause_time = void 0;
|
|
4575
|
+
schedule_next_timer();
|
|
4576
|
+
}
|
|
4577
|
+
function setTimeout2(callback, delay = 0, ...args) {
|
|
4578
|
+
const milliseconds = Math.max(0, Number(delay) || 0);
|
|
4579
|
+
return add_timer({
|
|
4580
|
+
[CALLBACK]: callback,
|
|
4581
|
+
[INTERVAL]: milliseconds,
|
|
4582
|
+
[DUE]: Date.now() + milliseconds,
|
|
4583
|
+
[REPEAT]: false,
|
|
4584
|
+
[CLEARED]: false,
|
|
4585
|
+
[ARGS]: args
|
|
4586
|
+
});
|
|
4562
4587
|
}
|
|
4563
|
-
function
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4588
|
+
function setInterval(callback, interval = 0, ...args) {
|
|
4589
|
+
const milliseconds = Math.max(0, Number(interval) || 0);
|
|
4590
|
+
return add_timer({
|
|
4591
|
+
[CALLBACK]: callback,
|
|
4592
|
+
[INTERVAL]: milliseconds,
|
|
4593
|
+
[DUE]: Date.now() + milliseconds,
|
|
4594
|
+
[REPEAT]: true,
|
|
4595
|
+
[CLEARED]: false,
|
|
4596
|
+
[ARGS]: args
|
|
4597
|
+
});
|
|
4568
4598
|
}
|
|
4569
4599
|
function clearTimeout2(id) {
|
|
4570
|
-
|
|
4571
|
-
|
|
4600
|
+
const timer = all_timers.get(id);
|
|
4601
|
+
if (timer !== void 0) {
|
|
4602
|
+
timer[CLEARED] = true;
|
|
4603
|
+
} else {
|
|
4604
|
+
Lilact._clearTimeout(id);
|
|
4605
|
+
}
|
|
4572
4606
|
}
|
|
4573
4607
|
function clearInterval(id) {
|
|
4574
|
-
|
|
4575
|
-
|
|
4608
|
+
const timer = all_timers.get(id);
|
|
4609
|
+
if (timer !== void 0) {
|
|
4610
|
+
timer[CLEARED] = true;
|
|
4611
|
+
} else {
|
|
4612
|
+
Lilact._clearInterval(id);
|
|
4613
|
+
}
|
|
4576
4614
|
}
|
|
4577
4615
|
function grabTimers() {
|
|
4578
4616
|
globalThis.setTimeout = Lilact.setTimeout;
|
|
@@ -4581,27 +4619,29 @@ function grabTimers() {
|
|
|
4581
4619
|
globalThis.clearInterval = Lilact.clearInterval;
|
|
4582
4620
|
}
|
|
4583
4621
|
function releaseTimers() {
|
|
4584
|
-
globalThis.setTimeout = _setTimeout;
|
|
4585
|
-
globalThis.setInterval = _setInterval;
|
|
4586
|
-
globalThis.clearTimeout = _clearTimeout;
|
|
4587
|
-
globalThis.clearInterval = _clearInterval;
|
|
4622
|
+
globalThis.setTimeout = Lilact._setTimeout;
|
|
4623
|
+
globalThis.setInterval = Lilact._setInterval;
|
|
4624
|
+
globalThis.clearTimeout = Lilact._clearTimeout;
|
|
4625
|
+
globalThis.clearInterval = Lilact._clearInterval;
|
|
4588
4626
|
}
|
|
4589
4627
|
function timeoutPromise(duration = 0, timerSource = Lilact) {
|
|
4590
|
-
let id
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4628
|
+
let id;
|
|
4629
|
+
let resolve_promise;
|
|
4630
|
+
let reject_promise;
|
|
4631
|
+
const promise = new Promise((resolve, reject) => {
|
|
4632
|
+
resolve_promise = resolve;
|
|
4633
|
+
reject_promise = reject;
|
|
4594
4634
|
id = timerSource.setTimeout(() => {
|
|
4595
4635
|
resolve();
|
|
4596
4636
|
}, duration);
|
|
4597
4637
|
});
|
|
4598
4638
|
promise.proceed = () => {
|
|
4599
4639
|
timerSource.clearTimeout(id);
|
|
4600
|
-
|
|
4640
|
+
resolve_promise();
|
|
4601
4641
|
};
|
|
4602
4642
|
promise.cancel = () => {
|
|
4603
4643
|
timerSource.clearTimeout(id);
|
|
4604
|
-
|
|
4644
|
+
reject_promise();
|
|
4605
4645
|
};
|
|
4606
4646
|
return promise;
|
|
4607
4647
|
}
|
|
@@ -4622,15 +4662,19 @@ __export(errors_exports, {
|
|
|
4622
4662
|
scanBlockLabels: () => scanBlockLabels,
|
|
4623
4663
|
traceError: () => traceError
|
|
4624
4664
|
});
|
|
4665
|
+
function isSafari() {
|
|
4666
|
+
const userAgent = navigator.userAgent;
|
|
4667
|
+
return /Safari/.test(userAgent) && !/Chrome|Chromium|CriOS|FxiOS|EdgiOS|OPiOS/.test(userAgent);
|
|
4668
|
+
}
|
|
4625
4669
|
function number(value) {
|
|
4626
4670
|
const result2 = Number(value);
|
|
4627
4671
|
return Number.isFinite(result2) ? result2 : null;
|
|
4628
4672
|
}
|
|
4629
4673
|
function asError2(value) {
|
|
4630
4674
|
if (value instanceof Error) return value;
|
|
4631
|
-
if (
|
|
4675
|
+
if (value?.error instanceof Error) return value.error;
|
|
4632
4676
|
const error2 = new Error(
|
|
4633
|
-
|
|
4677
|
+
value?.message == null ? String(value) : String(value.message)
|
|
4634
4678
|
);
|
|
4635
4679
|
if (value && typeof value === "object") {
|
|
4636
4680
|
if (value.name) error2.name = value.name;
|
|
@@ -4642,7 +4686,7 @@ function asError2(value) {
|
|
|
4642
4686
|
return error2;
|
|
4643
4687
|
}
|
|
4644
4688
|
function isParserError(error2) {
|
|
4645
|
-
return
|
|
4689
|
+
return error2?.name === "JSXParserError";
|
|
4646
4690
|
}
|
|
4647
4691
|
function stackLocation(stack) {
|
|
4648
4692
|
if (typeof stack !== "string") return null;
|
|
@@ -4658,26 +4702,25 @@ function stackLocation(stack) {
|
|
|
4658
4702
|
return null;
|
|
4659
4703
|
}
|
|
4660
4704
|
function browserLocation(error2) {
|
|
4661
|
-
var _a, _b, _c, _d;
|
|
4662
4705
|
const line2 = number(
|
|
4663
|
-
|
|
4706
|
+
error2?.lineNumber ?? error2?.lineno ?? error2?.line
|
|
4664
4707
|
);
|
|
4665
4708
|
const column2 = number(
|
|
4666
|
-
|
|
4709
|
+
error2?.columnNumber ?? error2?.colno ?? error2?.column
|
|
4667
4710
|
);
|
|
4711
|
+
const lineOffset = isSafari() ? 0 : 1;
|
|
4668
4712
|
return {
|
|
4669
|
-
line: line2 == null ? null : Math.max(0, line2 -
|
|
4713
|
+
line: line2 == null ? null : Math.max(0, line2 - lineOffset),
|
|
4670
4714
|
column: column2 == null ? null : Math.max(0, column2 - 1)
|
|
4671
4715
|
};
|
|
4672
4716
|
}
|
|
4673
4717
|
function traceBlock(error2) {
|
|
4674
|
-
const trace = error2
|
|
4718
|
+
const trace = error2?.lilact_trace;
|
|
4675
4719
|
return Array.isArray(trace) ? trace[0] : trace;
|
|
4676
4720
|
}
|
|
4677
4721
|
function blockInfo(error2) {
|
|
4678
|
-
var _a, _b;
|
|
4679
4722
|
const trace = traceBlock(error2);
|
|
4680
|
-
return trace == null ? null :
|
|
4723
|
+
return trace == null ? null : lilact_default.blocks_info?.labels?.[trace];
|
|
4681
4724
|
}
|
|
4682
4725
|
function mapLocation(mappings, line2, column2) {
|
|
4683
4726
|
if (!Array.isArray(mappings) || !mappings.length || !Number.isFinite(line2) || !Number.isFinite(column2)) {
|
|
@@ -4709,8 +4752,7 @@ function mapLocation(mappings, line2, column2) {
|
|
|
4709
4752
|
};
|
|
4710
4753
|
}
|
|
4711
4754
|
function traceError(value, runPath) {
|
|
4712
|
-
|
|
4713
|
-
if (value == null ? void 0 : value.isTraced) return value;
|
|
4755
|
+
if (value?.isTraced) return value;
|
|
4714
4756
|
const error2 = asError2(value);
|
|
4715
4757
|
const source = error2.lilact_source;
|
|
4716
4758
|
const stack = isParserError(error2) ? null : stackLocation(error2.stack);
|
|
@@ -4718,9 +4760,10 @@ function traceError(value, runPath) {
|
|
|
4718
4760
|
line: number(error2.lineNumber),
|
|
4719
4761
|
column: number(error2.columnNumber)
|
|
4720
4762
|
} : browserLocation(error2);
|
|
4721
|
-
const fileName =
|
|
4722
|
-
|
|
4723
|
-
let
|
|
4763
|
+
const fileName = source?.path || stack?.path || error2.fileName || runPath || null;
|
|
4764
|
+
const sameSource = !source?.path || !stack?.path || source.path === stack.path;
|
|
4765
|
+
let line2 = sameSource ? stack?.line ?? browser.line ?? null : browser.line ?? null;
|
|
4766
|
+
let column2 = sameSource ? stack?.column ?? browser.column ?? null : browser.column ?? null;
|
|
4724
4767
|
const result2 = {
|
|
4725
4768
|
fileName,
|
|
4726
4769
|
lineNumber: line2,
|
|
@@ -4745,40 +4788,39 @@ function traceError(value, runPath) {
|
|
|
4745
4788
|
const block = blockInfo(error2);
|
|
4746
4789
|
if (block && (result2.lineNumber == null || result2.columnNumber == null || !result2.fileName)) {
|
|
4747
4790
|
result2.fileName || (result2.fileName = block.path || runPath || null);
|
|
4748
|
-
|
|
4749
|
-
|
|
4791
|
+
result2.lineNumber ?? (result2.lineNumber = block.line);
|
|
4792
|
+
result2.columnNumber ?? (result2.columnNumber = block.column);
|
|
4750
4793
|
result2.label = block.desc;
|
|
4751
4794
|
}
|
|
4752
4795
|
lilact_default.error = result2;
|
|
4753
4796
|
return result2;
|
|
4754
4797
|
}
|
|
4755
4798
|
function escapeHtml(value) {
|
|
4756
|
-
return String(value
|
|
4799
|
+
return String(value ?? "").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4757
4800
|
}
|
|
4758
4801
|
function sourceExcerpt(module2, line2) {
|
|
4759
|
-
var _a, _b, _c, _d;
|
|
4760
4802
|
if (!module2 || !Number.isFinite(line2)) return null;
|
|
4761
|
-
const lines = String(
|
|
4803
|
+
const lines = String(module2.code ?? "").split(/\r?\n/);
|
|
4762
4804
|
return {
|
|
4763
|
-
before:
|
|
4764
|
-
current:
|
|
4765
|
-
after:
|
|
4805
|
+
before: lines[line2 - 1] ?? "",
|
|
4806
|
+
current: lines[line2] ?? "",
|
|
4807
|
+
after: lines[line2 + 1] ?? ""
|
|
4766
4808
|
};
|
|
4767
4809
|
}
|
|
4768
4810
|
function globalErrorHandler(eventOrError) {
|
|
4769
|
-
|
|
4770
|
-
const value = (eventOrError == null ? void 0 : eventOrError.error) instanceof Error ? eventOrError.error : (eventOrError == null ? void 0 : eventOrError.reason) !== void 0 ? eventOrError.reason : eventOrError;
|
|
4811
|
+
const value = eventOrError?.error instanceof Error ? eventOrError.error : eventOrError?.reason !== void 0 ? eventOrError.reason : eventOrError;
|
|
4771
4812
|
const error2 = traceError(
|
|
4772
4813
|
value,
|
|
4773
|
-
|
|
4814
|
+
eventOrError?.fileName || null
|
|
4774
4815
|
);
|
|
4775
4816
|
const excerpt = sourceExcerpt(
|
|
4776
4817
|
required_scripts[error2.fileName],
|
|
4777
4818
|
error2.lineNumber
|
|
4778
4819
|
);
|
|
4779
4820
|
const className = css(`
|
|
4780
|
-
background:
|
|
4781
|
-
|
|
4821
|
+
background: #fff;
|
|
4822
|
+
text-shadow: 0 0 3px #fff;
|
|
4823
|
+
-backdrop-filter: blur(20px);
|
|
4782
4824
|
border: 1px solid rgba(255,255,255,.25);
|
|
4783
4825
|
border-radius: 5px;
|
|
4784
4826
|
box-shadow: 0 10px 30px rgba(0,0,0,.35);
|
|
@@ -4791,17 +4833,18 @@ function globalErrorHandler(eventOrError) {
|
|
|
4791
4833
|
}
|
|
4792
4834
|
|
|
4793
4835
|
code {
|
|
4794
|
-
|
|
4836
|
+
background: #0001;
|
|
4795
4837
|
overflow: auto;
|
|
4796
4838
|
padding: 10px;
|
|
4797
4839
|
display: block;
|
|
4840
|
+
border-radius: 3px;
|
|
4798
4841
|
}
|
|
4799
4842
|
`);
|
|
4800
4843
|
const dialog = document.createElement("dialog");
|
|
4801
4844
|
dialog.className = className;
|
|
4802
4845
|
const location = error2.fileName ? `At ${escapeHtml(error2.fileName)}` : "";
|
|
4803
4846
|
const line2 = Number.isFinite(error2.lineNumber) ? `: Line ${error2.lineNumber + 1}` : "";
|
|
4804
|
-
const componentStack =
|
|
4847
|
+
const componentStack = error2._error?.componentStackLog || error2._error?.componentStack || "";
|
|
4805
4848
|
dialog.innerHTML = `
|
|
4806
4849
|
<h3><red>Error!</red></h3>
|
|
4807
4850
|
<b>${location}${line2}</b><br><br>
|
|
@@ -4839,7 +4882,7 @@ function scanBlockLabels(code2, path2) {
|
|
|
4839
4882
|
lilact_default.blocks_info.labels[match2[1]] = {
|
|
4840
4883
|
path: path2,
|
|
4841
4884
|
line: Number(match2[2]),
|
|
4842
|
-
|
|
4885
|
+
column: Number(match2[3]),
|
|
4843
4886
|
desc: match2[4]
|
|
4844
4887
|
};
|
|
4845
4888
|
}
|
|
@@ -4867,7 +4910,6 @@ var createURL = (to) => typeof to === "string" ? to : (to.pathname || "") + (to.
|
|
|
4867
4910
|
var escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4868
4911
|
function HashRouter({ children, basename = "" }) {
|
|
4869
4912
|
const readLocation = () => {
|
|
4870
|
-
var _a;
|
|
4871
4913
|
const raw = window.location.hash || "#/";
|
|
4872
4914
|
const full = raw.slice(1);
|
|
4873
4915
|
const baseRe = new RegExp("^" + escapeRegExp(basename));
|
|
@@ -4878,7 +4920,7 @@ function HashRouter({ children, basename = "" }) {
|
|
|
4878
4920
|
pathname: path2 || "/",
|
|
4879
4921
|
search: search ? "?" + search : "",
|
|
4880
4922
|
hash: hashPart ? "#" + hashPart : "",
|
|
4881
|
-
state:
|
|
4923
|
+
state: history.state?.__state
|
|
4882
4924
|
};
|
|
4883
4925
|
};
|
|
4884
4926
|
const [location, setLocation] = useState(readLocation);
|
|
@@ -4901,7 +4943,7 @@ function HashRouter({ children, basename = "" }) {
|
|
|
4901
4943
|
done = true;
|
|
4902
4944
|
window.removeEventListener("popstate", onPop);
|
|
4903
4945
|
window.removeEventListener("hashchange", onHash);
|
|
4904
|
-
fn
|
|
4946
|
+
fn?.();
|
|
4905
4947
|
resolve();
|
|
4906
4948
|
};
|
|
4907
4949
|
const onPop = () => cleanup(() => setLocation(readLocation()));
|
|
@@ -5007,14 +5049,13 @@ function Route({ path: path2, element = null, children }) {
|
|
|
5007
5049
|
return null;
|
|
5008
5050
|
}
|
|
5009
5051
|
function Routes({ children }) {
|
|
5010
|
-
var _a;
|
|
5011
5052
|
const location = useLocation();
|
|
5012
5053
|
const pathname = location.pathname || "/";
|
|
5013
5054
|
const routes = Children.toArray(children);
|
|
5014
5055
|
for (let i2 = 0; i2 < routes.length; i2++) {
|
|
5015
5056
|
const route = routes[i2];
|
|
5016
5057
|
const path2 = route.props.path === void 0 ? null : route.props.path;
|
|
5017
|
-
const element =
|
|
5058
|
+
const element = route.props.element ?? null;
|
|
5018
5059
|
const childRoutes = route.props.children;
|
|
5019
5060
|
const { matched, params } = matchPath(path2, pathname);
|
|
5020
5061
|
if (matched) {
|
|
@@ -5039,7 +5080,6 @@ __export(accessories_exports, {
|
|
|
5039
5080
|
SplitPane: () => SplitPane,
|
|
5040
5081
|
Suspense: () => Suspense
|
|
5041
5082
|
});
|
|
5042
|
-
var { css: css2, cx: cx2 } = emotion_css_esm_exports;
|
|
5043
5083
|
function Spinner({
|
|
5044
5084
|
size = 48,
|
|
5045
5085
|
className,
|
|
@@ -5215,7 +5255,7 @@ function DragHandle({
|
|
|
5215
5255
|
}, []);
|
|
5216
5256
|
const endDrag = useCallback((reason = "up") => {
|
|
5217
5257
|
if (!draggingRef.current) return;
|
|
5218
|
-
onEnd
|
|
5258
|
+
onEnd?.(reason);
|
|
5219
5259
|
resetDrag();
|
|
5220
5260
|
}, [onEnd, resetDrag]);
|
|
5221
5261
|
const onPointerDown = useCallback((e) => {
|
|
@@ -5227,17 +5267,17 @@ function DragHandle({
|
|
|
5227
5267
|
lastClientXRef.current = e.clientX;
|
|
5228
5268
|
lastClientYRef.current = e.clientY;
|
|
5229
5269
|
setIsDragging(true);
|
|
5230
|
-
onStart
|
|
5270
|
+
onStart?.(data);
|
|
5231
5271
|
try {
|
|
5232
5272
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
5233
|
-
} catch
|
|
5273
|
+
} catch {
|
|
5234
5274
|
}
|
|
5235
5275
|
}, [onStart]);
|
|
5236
5276
|
const onPointerMove = useCallback((e) => {
|
|
5237
5277
|
if (!draggingRef.current) return;
|
|
5238
5278
|
if (activePointerIdRef.current !== e.pointerId) return;
|
|
5239
5279
|
const { dx, dy } = computeDeltaFromStart(e.clientX, e.clientY);
|
|
5240
|
-
onDelta
|
|
5280
|
+
onDelta?.(dx, dy, data);
|
|
5241
5281
|
lastClientXRef.current = e.clientX;
|
|
5242
5282
|
lastClientYRef.current = e.clientY;
|
|
5243
5283
|
}, [computeDeltaFromStart, onDelta]);
|
|
@@ -5249,7 +5289,7 @@ function DragHandle({
|
|
|
5249
5289
|
if (activePointerIdRef.current !== e.pointerId) return;
|
|
5250
5290
|
endDrag("cancel", data);
|
|
5251
5291
|
}, [endDrag]);
|
|
5252
|
-
return createComponent("div", { "role": "button", "tabIndex": 0, "style": { ...style, touchAction: "none" }, "className":
|
|
5292
|
+
return createComponent("div", { "role": "button", "tabIndex": 0, "style": { ...style, touchAction: "none" }, "className": `${className} ${isDragging ? "dragging" : ""}`, "onPointerDown": onPointerDown, "onPointerMove": onPointerMove, "onPointerUp": onPointerUp, "onPointerCancel": onPointerCancel }, children);
|
|
5253
5293
|
}
|
|
5254
5294
|
var SplitPane = forwardRef(function SplitPane2({
|
|
5255
5295
|
mode = "horizontal",
|
|
@@ -5305,21 +5345,18 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5305
5345
|
const { w: w2, h: h2 } = sizeRef.current;
|
|
5306
5346
|
if (modeNow === "vertical" ? h2 <= 0 : w2 <= 0) {
|
|
5307
5347
|
if (position2 == null) setInternalPos(next2);
|
|
5308
|
-
onSizeChange
|
|
5348
|
+
onSizeChange?.(next2);
|
|
5309
5349
|
return;
|
|
5310
5350
|
}
|
|
5311
5351
|
const clamped = clampWithSize(next2, modeNow, w2, h2);
|
|
5312
5352
|
if (position2 == null) setInternalPos(clamped);
|
|
5313
5353
|
effectivePosRef.current = clamped;
|
|
5314
|
-
onSizeChange
|
|
5354
|
+
onSizeChange?.(clamped);
|
|
5315
5355
|
};
|
|
5316
5356
|
useImperativeHandle(ref, () => ({
|
|
5317
5357
|
setPosition,
|
|
5318
5358
|
setMode: (nextMode) => setInternalMode(nextMode === "vertical" ? "vertical" : "horizontal"),
|
|
5319
|
-
getPosition: () =>
|
|
5320
|
-
var _a;
|
|
5321
|
-
return (_a = effectivePosRef.current) != null ? _a : posResolved;
|
|
5322
|
-
},
|
|
5359
|
+
getPosition: () => effectivePosRef.current ?? posResolved,
|
|
5323
5360
|
getMode: () => internalModeRef.current
|
|
5324
5361
|
}));
|
|
5325
5362
|
const didInitRef = useRef(false);
|
|
@@ -5327,7 +5364,6 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5327
5364
|
const el = containerRef.current;
|
|
5328
5365
|
if (!el) return;
|
|
5329
5366
|
const ro = new ResizeObserver((entries) => {
|
|
5330
|
-
var _a;
|
|
5331
5367
|
const rect = el.getBoundingClientRect();
|
|
5332
5368
|
const prev2 = sizeRef.current;
|
|
5333
5369
|
const nextSize = { w: rect.width, h: rect.height };
|
|
@@ -5341,11 +5377,11 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5341
5377
|
const clamped = clampWithSize(raw, modeNow, nextSize.w, nextSize.h);
|
|
5342
5378
|
if (position2 == null) setInternalPos(clamped);
|
|
5343
5379
|
effectivePosRef.current = clamped;
|
|
5344
|
-
onSizeChange
|
|
5380
|
+
onSizeChange?.(clamped);
|
|
5345
5381
|
return;
|
|
5346
5382
|
}
|
|
5347
5383
|
if (!hadSize || !hasSizeNow) return;
|
|
5348
|
-
const p2 =
|
|
5384
|
+
const p2 = effectivePosRef.current ?? posResolved;
|
|
5349
5385
|
const rp = resizePolicyRef.current;
|
|
5350
5386
|
const s = splitterSize;
|
|
5351
5387
|
if (rp === "fixFirst") {
|
|
@@ -5395,9 +5431,8 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5395
5431
|
if (!dragging) startPosRef.current = posResolved;
|
|
5396
5432
|
}, [posResolved, dragging]);
|
|
5397
5433
|
const handleStart = () => {
|
|
5398
|
-
var _a;
|
|
5399
5434
|
setDragging(true);
|
|
5400
|
-
startPosRef.current =
|
|
5435
|
+
startPosRef.current = effectivePosRef.current ?? posResolved;
|
|
5401
5436
|
};
|
|
5402
5437
|
const handleDelta = (x, y) => {
|
|
5403
5438
|
const modeNow = internalModeRef.current;
|
|
@@ -6122,14 +6157,14 @@ function preprocessPragmas(node, context) {
|
|
|
6122
6157
|
var scope_stack = [];
|
|
6123
6158
|
var last_block = null;
|
|
6124
6159
|
const clone_block = (i2, val) => {
|
|
6125
|
-
var _a
|
|
6160
|
+
var _a;
|
|
6126
6161
|
last_block = typeof all_nodes[i2] === "object" ? structuredClone(
|
|
6127
6162
|
{ ...all_nodes[i2], children: void 0, attributes: {} }
|
|
6128
6163
|
) : all_nodes[i2];
|
|
6129
6164
|
if (last_block.type === "directive") {
|
|
6130
6165
|
last_block.value = val;
|
|
6131
6166
|
}
|
|
6132
|
-
(
|
|
6167
|
+
(_a = scope_stack[0]).out ?? (_a.out = []);
|
|
6133
6168
|
scope_stack[0].out.push(last_block);
|
|
6134
6169
|
return last_block;
|
|
6135
6170
|
};
|
|
@@ -6660,13 +6695,12 @@ function generateSourceMap(json, path2, jsx_eols, out_eols, mappings = []) {
|
|
|
6660
6695
|
"mappings": ""
|
|
6661
6696
|
};
|
|
6662
6697
|
const scan_leaves = (node3) => {
|
|
6663
|
-
|
|
6664
|
-
if (((_a = node3 == null ? void 0 : node3.out) == null ? void 0 : _a.length) > 0) {
|
|
6698
|
+
if (node3?.out?.length > 0) {
|
|
6665
6699
|
for (const ch2 of node3.out) {
|
|
6666
6700
|
scan_leaves(ch2);
|
|
6667
6701
|
}
|
|
6668
6702
|
}
|
|
6669
|
-
if (
|
|
6703
|
+
if (node3?.begin !== void 0 && node3?.out_index !== void 0) {
|
|
6670
6704
|
mpps.push([...getRowCol(out_eols, node3.out_index), ...getRowCol(jsx_eols, node3.begin), node3]);
|
|
6671
6705
|
}
|
|
6672
6706
|
};
|
|
@@ -6697,7 +6731,10 @@ function generateSourceMap(json, path2, jsx_eols, out_eols, mappings = []) {
|
|
|
6697
6731
|
lc = m[3];
|
|
6698
6732
|
}
|
|
6699
6733
|
sourcemap.mappings = mstr.substring(1).replace(/;,/g, ";");
|
|
6700
|
-
|
|
6734
|
+
let out = "\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + btoa(JSON.stringify(sourcemap));
|
|
6735
|
+
out += `
|
|
6736
|
+
//# sourceURL=eval:/${path2}`;
|
|
6737
|
+
return out;
|
|
6701
6738
|
}
|
|
6702
6739
|
function transpileJSX(jsx2, {
|
|
6703
6740
|
factory = "createComponent",
|
|
@@ -6715,9 +6752,8 @@ function transpileJSX(jsx2, {
|
|
|
6715
6752
|
},
|
|
6716
6753
|
mappings = []
|
|
6717
6754
|
} = {}) {
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
(_b = transpilerConfig.injectTraceLabels) != null ? _b : transpilerConfig.injectTraceLabels = injectTraceLabels;
|
|
6755
|
+
transpilerConfig.preprocessorDelimiter ?? (transpilerConfig.preprocessorDelimiter = "\u0294");
|
|
6756
|
+
transpilerConfig.injectTraceLabels ?? (transpilerConfig.injectTraceLabels = injectTraceLabels);
|
|
6721
6757
|
const eols = scanEOLs(jsx2);
|
|
6722
6758
|
raiseError = ((eols2, msg, index2) => {
|
|
6723
6759
|
const rc = getRowCol(eols2, index2);
|
|
@@ -6814,7 +6850,7 @@ function transpileJSX(jsx2, {
|
|
|
6814
6850
|
if (is_attr) {
|
|
6815
6851
|
return out2.substring(1, out2.length - 1);
|
|
6816
6852
|
}
|
|
6817
|
-
if (node3
|
|
6853
|
+
if (node3?.is_xml_js) {
|
|
6818
6854
|
return jsx2.substring(node3.begin + 1, node3.end - 1);
|
|
6819
6855
|
}
|
|
6820
6856
|
return out2;
|
|
@@ -6898,10 +6934,10 @@ var Lilact2 = {
|
|
|
6898
6934
|
PropTypes,
|
|
6899
6935
|
redux: redux_exports,
|
|
6900
6936
|
emotion: emotion_css_esm_exports,
|
|
6901
|
-
_setTimeout:
|
|
6902
|
-
_setInterval:
|
|
6903
|
-
_clearTimeout:
|
|
6904
|
-
_clearInterval:
|
|
6937
|
+
_setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
6938
|
+
_setInterval: globalThis.setInterval.bind(globalThis),
|
|
6939
|
+
_clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
6940
|
+
_clearInterval: globalThis.clearInterval.bind(globalThis)
|
|
6905
6941
|
};
|
|
6906
6942
|
Lilact2.default = Lilact2;
|
|
6907
6943
|
var lilact_default = Lilact2;
|
|
@@ -6917,8 +6953,7 @@ globalThis.require = Lilact2.require;
|
|
|
6917
6953
|
document.addEventListener("DOMContentLoaded", () => {
|
|
6918
6954
|
Lilact2.grabTimers();
|
|
6919
6955
|
Lilact2.runScripts().catch((error2) => {
|
|
6920
|
-
|
|
6921
|
-
(_a = Lilact2.globalErrorHandler) == null ? void 0 : _a.call(Lilact2, error2);
|
|
6956
|
+
Lilact2.globalErrorHandler?.(error2);
|
|
6922
6957
|
});
|
|
6923
6958
|
});
|
|
6924
6959
|
if (true) {
|