lilact 0.28.0 → 0.28.1
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 +300 -274
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +35 -33
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +35 -33
- 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.scanBlockLabels.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 +12 -0
- package/docs/static/index.html +44 -38
- package/docs/static/lilact.development.js +300 -274
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +35 -33
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +35 -33
- 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 +12 -0
- package/examples/index.html +44 -38
- package/examples/lilact.development.js +300 -274
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +35 -33
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +35 -33
- 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 +5 -3
- package/src/lilact.jsx +4 -4
- 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, {
|
|
@@ -3740,7 +3730,7 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, {
|
|
|
3740
3730
|
});
|
|
3741
3731
|
} catch (value) {
|
|
3742
3732
|
const error2 = asError(value);
|
|
3743
|
-
|
|
3733
|
+
error2.fileName ?? (error2.fileName = path);
|
|
3744
3734
|
error2.sourcePhase = "transpile";
|
|
3745
3735
|
module.error = error2;
|
|
3746
3736
|
lilact_default.error = error2;
|
|
@@ -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
|
}
|
|
@@ -4628,9 +4668,9 @@ function number(value) {
|
|
|
4628
4668
|
}
|
|
4629
4669
|
function asError2(value) {
|
|
4630
4670
|
if (value instanceof Error) return value;
|
|
4631
|
-
if (
|
|
4671
|
+
if (value?.error instanceof Error) return value.error;
|
|
4632
4672
|
const error2 = new Error(
|
|
4633
|
-
|
|
4673
|
+
value?.message == null ? String(value) : String(value.message)
|
|
4634
4674
|
);
|
|
4635
4675
|
if (value && typeof value === "object") {
|
|
4636
4676
|
if (value.name) error2.name = value.name;
|
|
@@ -4642,7 +4682,7 @@ function asError2(value) {
|
|
|
4642
4682
|
return error2;
|
|
4643
4683
|
}
|
|
4644
4684
|
function isParserError(error2) {
|
|
4645
|
-
return
|
|
4685
|
+
return error2?.name === "JSXParserError";
|
|
4646
4686
|
}
|
|
4647
4687
|
function stackLocation(stack) {
|
|
4648
4688
|
if (typeof stack !== "string") return null;
|
|
@@ -4658,12 +4698,11 @@ function stackLocation(stack) {
|
|
|
4658
4698
|
return null;
|
|
4659
4699
|
}
|
|
4660
4700
|
function browserLocation(error2) {
|
|
4661
|
-
var _a, _b, _c, _d;
|
|
4662
4701
|
const line2 = number(
|
|
4663
|
-
|
|
4702
|
+
error2?.lineNumber ?? error2?.lineno ?? error2?.line
|
|
4664
4703
|
);
|
|
4665
4704
|
const column2 = number(
|
|
4666
|
-
|
|
4705
|
+
error2?.columnNumber ?? error2?.colno ?? error2?.column
|
|
4667
4706
|
);
|
|
4668
4707
|
return {
|
|
4669
4708
|
line: line2 == null ? null : Math.max(0, line2 - 1),
|
|
@@ -4671,13 +4710,12 @@ function browserLocation(error2) {
|
|
|
4671
4710
|
};
|
|
4672
4711
|
}
|
|
4673
4712
|
function traceBlock(error2) {
|
|
4674
|
-
const trace = error2
|
|
4713
|
+
const trace = error2?.lilact_trace;
|
|
4675
4714
|
return Array.isArray(trace) ? trace[0] : trace;
|
|
4676
4715
|
}
|
|
4677
4716
|
function blockInfo(error2) {
|
|
4678
|
-
var _a, _b;
|
|
4679
4717
|
const trace = traceBlock(error2);
|
|
4680
|
-
return trace == null ? null :
|
|
4718
|
+
return trace == null ? null : lilact_default.blocks_info?.labels?.[trace];
|
|
4681
4719
|
}
|
|
4682
4720
|
function mapLocation(mappings, line2, column2) {
|
|
4683
4721
|
if (!Array.isArray(mappings) || !mappings.length || !Number.isFinite(line2) || !Number.isFinite(column2)) {
|
|
@@ -4709,8 +4747,7 @@ function mapLocation(mappings, line2, column2) {
|
|
|
4709
4747
|
};
|
|
4710
4748
|
}
|
|
4711
4749
|
function traceError(value, runPath) {
|
|
4712
|
-
|
|
4713
|
-
if (value == null ? void 0 : value.isTraced) return value;
|
|
4750
|
+
if (value?.isTraced) return value;
|
|
4714
4751
|
const error2 = asError2(value);
|
|
4715
4752
|
const source = error2.lilact_source;
|
|
4716
4753
|
const stack = isParserError(error2) ? null : stackLocation(error2.stack);
|
|
@@ -4718,9 +4755,9 @@ function traceError(value, runPath) {
|
|
|
4718
4755
|
line: number(error2.lineNumber),
|
|
4719
4756
|
column: number(error2.columnNumber)
|
|
4720
4757
|
} : browserLocation(error2);
|
|
4721
|
-
const fileName =
|
|
4722
|
-
let line2 =
|
|
4723
|
-
let column2 =
|
|
4758
|
+
const fileName = source?.path || stack?.path || error2.fileName || runPath || null;
|
|
4759
|
+
let line2 = stack?.line ?? browser.line ?? null;
|
|
4760
|
+
let column2 = stack?.column ?? browser.column ?? null;
|
|
4724
4761
|
const result2 = {
|
|
4725
4762
|
fileName,
|
|
4726
4763
|
lineNumber: line2,
|
|
@@ -4745,40 +4782,39 @@ function traceError(value, runPath) {
|
|
|
4745
4782
|
const block = blockInfo(error2);
|
|
4746
4783
|
if (block && (result2.lineNumber == null || result2.columnNumber == null || !result2.fileName)) {
|
|
4747
4784
|
result2.fileName || (result2.fileName = block.path || runPath || null);
|
|
4748
|
-
|
|
4749
|
-
|
|
4785
|
+
result2.lineNumber ?? (result2.lineNumber = block.line);
|
|
4786
|
+
result2.columnNumber ?? (result2.columnNumber = block.col);
|
|
4750
4787
|
result2.label = block.desc;
|
|
4751
4788
|
}
|
|
4752
4789
|
lilact_default.error = result2;
|
|
4753
4790
|
return result2;
|
|
4754
4791
|
}
|
|
4755
4792
|
function escapeHtml(value) {
|
|
4756
|
-
return String(value
|
|
4793
|
+
return String(value ?? "").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
4757
4794
|
}
|
|
4758
4795
|
function sourceExcerpt(module2, line2) {
|
|
4759
|
-
var _a, _b, _c, _d;
|
|
4760
4796
|
if (!module2 || !Number.isFinite(line2)) return null;
|
|
4761
|
-
const lines = String(
|
|
4797
|
+
const lines = String(module2.code ?? "").split(/\r?\n/);
|
|
4762
4798
|
return {
|
|
4763
|
-
before:
|
|
4764
|
-
current:
|
|
4765
|
-
after:
|
|
4799
|
+
before: lines[line2 - 1] ?? "",
|
|
4800
|
+
current: lines[line2] ?? "",
|
|
4801
|
+
after: lines[line2 + 1] ?? ""
|
|
4766
4802
|
};
|
|
4767
4803
|
}
|
|
4768
4804
|
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;
|
|
4805
|
+
const value = eventOrError?.error instanceof Error ? eventOrError.error : eventOrError?.reason !== void 0 ? eventOrError.reason : eventOrError;
|
|
4771
4806
|
const error2 = traceError(
|
|
4772
4807
|
value,
|
|
4773
|
-
|
|
4808
|
+
eventOrError?.fileName || null
|
|
4774
4809
|
);
|
|
4775
4810
|
const excerpt = sourceExcerpt(
|
|
4776
4811
|
required_scripts[error2.fileName],
|
|
4777
4812
|
error2.lineNumber
|
|
4778
4813
|
);
|
|
4779
4814
|
const className = css(`
|
|
4780
|
-
background:
|
|
4781
|
-
|
|
4815
|
+
background: #fff;
|
|
4816
|
+
text-shadow: 0 0 3px #fff;
|
|
4817
|
+
-backdrop-filter: blur(20px);
|
|
4782
4818
|
border: 1px solid rgba(255,255,255,.25);
|
|
4783
4819
|
border-radius: 5px;
|
|
4784
4820
|
box-shadow: 0 10px 30px rgba(0,0,0,.35);
|
|
@@ -4791,17 +4827,18 @@ function globalErrorHandler(eventOrError) {
|
|
|
4791
4827
|
}
|
|
4792
4828
|
|
|
4793
4829
|
code {
|
|
4794
|
-
|
|
4830
|
+
background: #0001;
|
|
4795
4831
|
overflow: auto;
|
|
4796
4832
|
padding: 10px;
|
|
4797
4833
|
display: block;
|
|
4834
|
+
border-radius: 3px;
|
|
4798
4835
|
}
|
|
4799
4836
|
`);
|
|
4800
4837
|
const dialog = document.createElement("dialog");
|
|
4801
4838
|
dialog.className = className;
|
|
4802
4839
|
const location = error2.fileName ? `At ${escapeHtml(error2.fileName)}` : "";
|
|
4803
4840
|
const line2 = Number.isFinite(error2.lineNumber) ? `: Line ${error2.lineNumber + 1}` : "";
|
|
4804
|
-
const componentStack =
|
|
4841
|
+
const componentStack = error2._error?.componentStackLog || error2._error?.componentStack || "";
|
|
4805
4842
|
dialog.innerHTML = `
|
|
4806
4843
|
<h3><red>Error!</red></h3>
|
|
4807
4844
|
<b>${location}${line2}</b><br><br>
|
|
@@ -4867,7 +4904,6 @@ var createURL = (to) => typeof to === "string" ? to : (to.pathname || "") + (to.
|
|
|
4867
4904
|
var escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4868
4905
|
function HashRouter({ children, basename = "" }) {
|
|
4869
4906
|
const readLocation = () => {
|
|
4870
|
-
var _a;
|
|
4871
4907
|
const raw = window.location.hash || "#/";
|
|
4872
4908
|
const full = raw.slice(1);
|
|
4873
4909
|
const baseRe = new RegExp("^" + escapeRegExp(basename));
|
|
@@ -4878,7 +4914,7 @@ function HashRouter({ children, basename = "" }) {
|
|
|
4878
4914
|
pathname: path2 || "/",
|
|
4879
4915
|
search: search ? "?" + search : "",
|
|
4880
4916
|
hash: hashPart ? "#" + hashPart : "",
|
|
4881
|
-
state:
|
|
4917
|
+
state: history.state?.__state
|
|
4882
4918
|
};
|
|
4883
4919
|
};
|
|
4884
4920
|
const [location, setLocation] = useState(readLocation);
|
|
@@ -4901,7 +4937,7 @@ function HashRouter({ children, basename = "" }) {
|
|
|
4901
4937
|
done = true;
|
|
4902
4938
|
window.removeEventListener("popstate", onPop);
|
|
4903
4939
|
window.removeEventListener("hashchange", onHash);
|
|
4904
|
-
fn
|
|
4940
|
+
fn?.();
|
|
4905
4941
|
resolve();
|
|
4906
4942
|
};
|
|
4907
4943
|
const onPop = () => cleanup(() => setLocation(readLocation()));
|
|
@@ -5007,14 +5043,13 @@ function Route({ path: path2, element = null, children }) {
|
|
|
5007
5043
|
return null;
|
|
5008
5044
|
}
|
|
5009
5045
|
function Routes({ children }) {
|
|
5010
|
-
var _a;
|
|
5011
5046
|
const location = useLocation();
|
|
5012
5047
|
const pathname = location.pathname || "/";
|
|
5013
5048
|
const routes = Children.toArray(children);
|
|
5014
5049
|
for (let i2 = 0; i2 < routes.length; i2++) {
|
|
5015
5050
|
const route = routes[i2];
|
|
5016
5051
|
const path2 = route.props.path === void 0 ? null : route.props.path;
|
|
5017
|
-
const element =
|
|
5052
|
+
const element = route.props.element ?? null;
|
|
5018
5053
|
const childRoutes = route.props.children;
|
|
5019
5054
|
const { matched, params } = matchPath(path2, pathname);
|
|
5020
5055
|
if (matched) {
|
|
@@ -5039,7 +5074,6 @@ __export(accessories_exports, {
|
|
|
5039
5074
|
SplitPane: () => SplitPane,
|
|
5040
5075
|
Suspense: () => Suspense
|
|
5041
5076
|
});
|
|
5042
|
-
var { css: css2, cx: cx2 } = emotion_css_esm_exports;
|
|
5043
5077
|
function Spinner({
|
|
5044
5078
|
size = 48,
|
|
5045
5079
|
className,
|
|
@@ -5215,7 +5249,7 @@ function DragHandle({
|
|
|
5215
5249
|
}, []);
|
|
5216
5250
|
const endDrag = useCallback((reason = "up") => {
|
|
5217
5251
|
if (!draggingRef.current) return;
|
|
5218
|
-
onEnd
|
|
5252
|
+
onEnd?.(reason);
|
|
5219
5253
|
resetDrag();
|
|
5220
5254
|
}, [onEnd, resetDrag]);
|
|
5221
5255
|
const onPointerDown = useCallback((e) => {
|
|
@@ -5227,17 +5261,17 @@ function DragHandle({
|
|
|
5227
5261
|
lastClientXRef.current = e.clientX;
|
|
5228
5262
|
lastClientYRef.current = e.clientY;
|
|
5229
5263
|
setIsDragging(true);
|
|
5230
|
-
onStart
|
|
5264
|
+
onStart?.(data);
|
|
5231
5265
|
try {
|
|
5232
5266
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
5233
|
-
} catch
|
|
5267
|
+
} catch {
|
|
5234
5268
|
}
|
|
5235
5269
|
}, [onStart]);
|
|
5236
5270
|
const onPointerMove = useCallback((e) => {
|
|
5237
5271
|
if (!draggingRef.current) return;
|
|
5238
5272
|
if (activePointerIdRef.current !== e.pointerId) return;
|
|
5239
5273
|
const { dx, dy } = computeDeltaFromStart(e.clientX, e.clientY);
|
|
5240
|
-
onDelta
|
|
5274
|
+
onDelta?.(dx, dy, data);
|
|
5241
5275
|
lastClientXRef.current = e.clientX;
|
|
5242
5276
|
lastClientYRef.current = e.clientY;
|
|
5243
5277
|
}, [computeDeltaFromStart, onDelta]);
|
|
@@ -5249,7 +5283,7 @@ function DragHandle({
|
|
|
5249
5283
|
if (activePointerIdRef.current !== e.pointerId) return;
|
|
5250
5284
|
endDrag("cancel", data);
|
|
5251
5285
|
}, [endDrag]);
|
|
5252
|
-
return createComponent("div", { "role": "button", "tabIndex": 0, "style": { ...style, touchAction: "none" }, "className":
|
|
5286
|
+
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
5287
|
}
|
|
5254
5288
|
var SplitPane = forwardRef(function SplitPane2({
|
|
5255
5289
|
mode = "horizontal",
|
|
@@ -5305,21 +5339,18 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5305
5339
|
const { w: w2, h: h2 } = sizeRef.current;
|
|
5306
5340
|
if (modeNow === "vertical" ? h2 <= 0 : w2 <= 0) {
|
|
5307
5341
|
if (position2 == null) setInternalPos(next2);
|
|
5308
|
-
onSizeChange
|
|
5342
|
+
onSizeChange?.(next2);
|
|
5309
5343
|
return;
|
|
5310
5344
|
}
|
|
5311
5345
|
const clamped = clampWithSize(next2, modeNow, w2, h2);
|
|
5312
5346
|
if (position2 == null) setInternalPos(clamped);
|
|
5313
5347
|
effectivePosRef.current = clamped;
|
|
5314
|
-
onSizeChange
|
|
5348
|
+
onSizeChange?.(clamped);
|
|
5315
5349
|
};
|
|
5316
5350
|
useImperativeHandle(ref, () => ({
|
|
5317
5351
|
setPosition,
|
|
5318
5352
|
setMode: (nextMode) => setInternalMode(nextMode === "vertical" ? "vertical" : "horizontal"),
|
|
5319
|
-
getPosition: () =>
|
|
5320
|
-
var _a;
|
|
5321
|
-
return (_a = effectivePosRef.current) != null ? _a : posResolved;
|
|
5322
|
-
},
|
|
5353
|
+
getPosition: () => effectivePosRef.current ?? posResolved,
|
|
5323
5354
|
getMode: () => internalModeRef.current
|
|
5324
5355
|
}));
|
|
5325
5356
|
const didInitRef = useRef(false);
|
|
@@ -5327,7 +5358,6 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5327
5358
|
const el = containerRef.current;
|
|
5328
5359
|
if (!el) return;
|
|
5329
5360
|
const ro = new ResizeObserver((entries) => {
|
|
5330
|
-
var _a;
|
|
5331
5361
|
const rect = el.getBoundingClientRect();
|
|
5332
5362
|
const prev2 = sizeRef.current;
|
|
5333
5363
|
const nextSize = { w: rect.width, h: rect.height };
|
|
@@ -5341,11 +5371,11 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5341
5371
|
const clamped = clampWithSize(raw, modeNow, nextSize.w, nextSize.h);
|
|
5342
5372
|
if (position2 == null) setInternalPos(clamped);
|
|
5343
5373
|
effectivePosRef.current = clamped;
|
|
5344
|
-
onSizeChange
|
|
5374
|
+
onSizeChange?.(clamped);
|
|
5345
5375
|
return;
|
|
5346
5376
|
}
|
|
5347
5377
|
if (!hadSize || !hasSizeNow) return;
|
|
5348
|
-
const p2 =
|
|
5378
|
+
const p2 = effectivePosRef.current ?? posResolved;
|
|
5349
5379
|
const rp = resizePolicyRef.current;
|
|
5350
5380
|
const s = splitterSize;
|
|
5351
5381
|
if (rp === "fixFirst") {
|
|
@@ -5395,9 +5425,8 @@ var SplitPane = forwardRef(function SplitPane2({
|
|
|
5395
5425
|
if (!dragging) startPosRef.current = posResolved;
|
|
5396
5426
|
}, [posResolved, dragging]);
|
|
5397
5427
|
const handleStart = () => {
|
|
5398
|
-
var _a;
|
|
5399
5428
|
setDragging(true);
|
|
5400
|
-
startPosRef.current =
|
|
5429
|
+
startPosRef.current = effectivePosRef.current ?? posResolved;
|
|
5401
5430
|
};
|
|
5402
5431
|
const handleDelta = (x, y) => {
|
|
5403
5432
|
const modeNow = internalModeRef.current;
|
|
@@ -6122,14 +6151,14 @@ function preprocessPragmas(node, context) {
|
|
|
6122
6151
|
var scope_stack = [];
|
|
6123
6152
|
var last_block = null;
|
|
6124
6153
|
const clone_block = (i2, val) => {
|
|
6125
|
-
var _a
|
|
6154
|
+
var _a;
|
|
6126
6155
|
last_block = typeof all_nodes[i2] === "object" ? structuredClone(
|
|
6127
6156
|
{ ...all_nodes[i2], children: void 0, attributes: {} }
|
|
6128
6157
|
) : all_nodes[i2];
|
|
6129
6158
|
if (last_block.type === "directive") {
|
|
6130
6159
|
last_block.value = val;
|
|
6131
6160
|
}
|
|
6132
|
-
(
|
|
6161
|
+
(_a = scope_stack[0]).out ?? (_a.out = []);
|
|
6133
6162
|
scope_stack[0].out.push(last_block);
|
|
6134
6163
|
return last_block;
|
|
6135
6164
|
};
|
|
@@ -6660,13 +6689,12 @@ function generateSourceMap(json, path2, jsx_eols, out_eols, mappings = []) {
|
|
|
6660
6689
|
"mappings": ""
|
|
6661
6690
|
};
|
|
6662
6691
|
const scan_leaves = (node3) => {
|
|
6663
|
-
|
|
6664
|
-
if (((_a = node3 == null ? void 0 : node3.out) == null ? void 0 : _a.length) > 0) {
|
|
6692
|
+
if (node3?.out?.length > 0) {
|
|
6665
6693
|
for (const ch2 of node3.out) {
|
|
6666
6694
|
scan_leaves(ch2);
|
|
6667
6695
|
}
|
|
6668
6696
|
}
|
|
6669
|
-
if (
|
|
6697
|
+
if (node3?.begin !== void 0 && node3?.out_index !== void 0) {
|
|
6670
6698
|
mpps.push([...getRowCol(out_eols, node3.out_index), ...getRowCol(jsx_eols, node3.begin), node3]);
|
|
6671
6699
|
}
|
|
6672
6700
|
};
|
|
@@ -6715,9 +6743,8 @@ function transpileJSX(jsx2, {
|
|
|
6715
6743
|
},
|
|
6716
6744
|
mappings = []
|
|
6717
6745
|
} = {}) {
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
(_b = transpilerConfig.injectTraceLabels) != null ? _b : transpilerConfig.injectTraceLabels = injectTraceLabels;
|
|
6746
|
+
transpilerConfig.preprocessorDelimiter ?? (transpilerConfig.preprocessorDelimiter = "\u0294");
|
|
6747
|
+
transpilerConfig.injectTraceLabels ?? (transpilerConfig.injectTraceLabels = injectTraceLabels);
|
|
6721
6748
|
const eols = scanEOLs(jsx2);
|
|
6722
6749
|
raiseError = ((eols2, msg, index2) => {
|
|
6723
6750
|
const rc = getRowCol(eols2, index2);
|
|
@@ -6814,7 +6841,7 @@ function transpileJSX(jsx2, {
|
|
|
6814
6841
|
if (is_attr) {
|
|
6815
6842
|
return out2.substring(1, out2.length - 1);
|
|
6816
6843
|
}
|
|
6817
|
-
if (node3
|
|
6844
|
+
if (node3?.is_xml_js) {
|
|
6818
6845
|
return jsx2.substring(node3.begin + 1, node3.end - 1);
|
|
6819
6846
|
}
|
|
6820
6847
|
return out2;
|
|
@@ -6898,10 +6925,10 @@ var Lilact2 = {
|
|
|
6898
6925
|
PropTypes,
|
|
6899
6926
|
redux: redux_exports,
|
|
6900
6927
|
emotion: emotion_css_esm_exports,
|
|
6901
|
-
_setTimeout:
|
|
6902
|
-
_setInterval:
|
|
6903
|
-
_clearTimeout:
|
|
6904
|
-
_clearInterval:
|
|
6928
|
+
_setTimeout: globalThis.setTimeout.bind(globalThis),
|
|
6929
|
+
_setInterval: globalThis.setInterval.bind(globalThis),
|
|
6930
|
+
_clearTimeout: globalThis.clearTimeout.bind(globalThis),
|
|
6931
|
+
_clearInterval: globalThis.clearInterval.bind(globalThis)
|
|
6905
6932
|
};
|
|
6906
6933
|
Lilact2.default = Lilact2;
|
|
6907
6934
|
var lilact_default = Lilact2;
|
|
@@ -6917,8 +6944,7 @@ globalThis.require = Lilact2.require;
|
|
|
6917
6944
|
document.addEventListener("DOMContentLoaded", () => {
|
|
6918
6945
|
Lilact2.grabTimers();
|
|
6919
6946
|
Lilact2.runScripts().catch((error2) => {
|
|
6920
|
-
|
|
6921
|
-
(_a = Lilact2.globalErrorHandler) == null ? void 0 : _a.call(Lilact2, error2);
|
|
6947
|
+
Lilact2.globalErrorHandler?.(error2);
|
|
6922
6948
|
});
|
|
6923
6949
|
});
|
|
6924
6950
|
if (true) {
|