lilact 0.0.0 → 0.2.0
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/README.md +13 -2
- package/dist/{lilact.development.js → lilact.development.min.js} +690 -315
- package/dist/lilact.development.min.js.LICENSE.txt +77 -0
- package/dist/lilact.development.min.js.map +1 -0
- package/dist/lilact.production.min.js +1 -1
- package/dist/lilact.production.min.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/accessories.ErrorBoundary.html +11 -10
- package/docs/classes/accessories.Suspense.html +12 -22
- package/docs/classes/components.Component.html +11 -10
- package/docs/classes/components.HTMLComponent.html +11 -10
- package/docs/classes/components.RootComponent.html +11 -10
- package/docs/functions/accessories.Spinner.html +1 -1
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/functions/hooks.createContext.html +1 -1
- package/docs/functions/hooks.forwardRef.html +4 -0
- package/docs/functions/hooks.useActionState.html +1 -1
- package/docs/functions/hooks.useImperativeHandle.html +7 -0
- package/docs/functions/hooks.useReducer.html +1 -1
- package/docs/functions/hooks.useState.html +2 -2
- package/docs/functions/hooks.useTransition.html +1 -1
- package/docs/functions/jsx.transpileJSX.html +1 -1
- package/docs/functions/run.lazy.html +7 -0
- package/docs/functions/run.require.html +11 -11
- package/docs/functions/run.run.html +3 -5
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/run.traceError.html +1 -1
- package/docs/functions/transition.CSSTransition.html +1 -1
- package/docs/functions/transition.Transition.html +15 -0
- package/docs/functions/transition.TransitionGroup.html +1 -1
- package/docs/index.html +8 -2
- package/docs/modules/hooks.html +1 -1
- package/docs/modules/jsx.html +1 -1
- package/docs/modules/run.html +1 -1
- package/docs/modules/transition.html +1 -1
- package/docs/static/demos/actionstate.jsx +5 -7
- package/docs/static/demos/context.jsx +2 -4
- package/docs/static/demos/css-transition.jsx +1 -1
- package/docs/static/demos/lazy.jsx +14 -0
- package/docs/static/demos/modal.jsx +14 -16
- package/docs/static/demos/proptypes.jsx +6 -9
- package/docs/static/demos/reducer.jsx +22 -24
- package/docs/static/demos/redux.jsx +1 -1
- package/docs/static/demos/router.jsx +1 -8
- package/docs/static/demos/stopwatch.jsx +1 -1
- package/docs/static/demos/suspense.jsx +5 -7
- package/docs/static/demos/transition.jsx +25 -25
- package/{root/demos/use-differed.jsx → docs/static/demos/use-deffered.jsx} +1 -1
- package/docs/static/demos/usetransition.jsx +2 -4
- package/docs/static/index 2.html +95 -0
- package/docs/static/index.html +27 -29
- package/docs/static/{lilact.development.js → lilact.development.min.js} +690 -315
- package/docs/static/lilact.production.min.js +1 -1
- package/package.json +2 -2
- package/root/demos/actionstate.jsx +5 -7
- package/root/demos/context.jsx +2 -4
- package/root/demos/css-transition.jsx +1 -1
- package/root/demos/lazy.jsx +14 -0
- package/root/demos/modal.jsx +14 -16
- package/root/demos/proptypes.jsx +6 -9
- package/root/demos/reducer.jsx +22 -24
- package/root/demos/redux.jsx +1 -1
- package/root/demos/router.jsx +1 -8
- package/root/demos/stopwatch.jsx +1 -1
- package/root/demos/suspense.jsx +5 -7
- package/root/demos/transition.jsx +25 -25
- package/{docs/static/demos/use-differed.jsx → root/demos/use-deffered.jsx} +1 -1
- package/root/demos/usetransition.jsx +2 -4
- package/root/index 2.html +95 -0
- package/root/index.html +27 -29
- package/root/{lilact.development.js → lilact.development.min.js} +690 -315
- package/root/lilact.production.min.js +1 -1
- package/src/accessories.jsx +12 -11
- package/src/components.jsx +11 -5
- package/src/hooks.jsx +47 -6
- package/src/jsx.js +1 -0
- package/src/lilact.jsx +5 -7
- package/src/pane.jsx +287 -0
- package/src/run.jsx +91 -43
- package/src/transition.jsx +32 -21
- package/webpack.config.js +2 -12
- package/dist/lilact.development.js.map +0 -1
- package/docs/classes/transition.Transition.html +0 -31
- package/docs/variables/jsx.transpilerConfig.html +0 -1
|
@@ -127,6 +127,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
|
|
130
|
+
/** @ignore */
|
|
130
131
|
const transpilerConfig = {
|
|
131
132
|
addons: _jsx_addons_js__WEBPACK_IMPORTED_MODULE_0__,
|
|
132
133
|
setFunctionLabels: true,
|
|
@@ -1348,227 +1349,9 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
1348
1349
|
|
|
1349
1350
|
/***/ }),
|
|
1350
1351
|
|
|
1351
|
-
/***/
|
|
1352
|
-
/*!****************************************!*\
|
|
1353
|
-
!*** ./node_modules/react-is/index.js ***!
|
|
1354
|
-
\****************************************/
|
|
1355
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
if (false) // removed by dead control flow
|
|
1360
|
-
{} else {
|
|
1361
|
-
module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ 413);
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
/***/ }),
|
|
1366
|
-
|
|
1367
|
-
/***/ 376:
|
|
1368
|
-
/*!********************************************!*\
|
|
1369
|
-
!*** ./node_modules/prop-types/lib/has.js ***!
|
|
1370
|
-
\********************************************/
|
|
1371
|
-
/***/ ((module) => {
|
|
1372
|
-
|
|
1373
|
-
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
/***/ }),
|
|
1377
|
-
|
|
1378
|
-
/***/ 413:
|
|
1379
|
-
/*!***********************************************************!*\
|
|
1380
|
-
!*** ./node_modules/react-is/cjs/react-is.development.js ***!
|
|
1381
|
-
\***********************************************************/
|
|
1382
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
1383
|
-
|
|
1384
|
-
/** @license React v16.13.1
|
|
1385
|
-
* react-is.development.js
|
|
1386
|
-
*
|
|
1387
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1388
|
-
*
|
|
1389
|
-
* This source code is licensed under the MIT license found in the
|
|
1390
|
-
* LICENSE file in the root directory of this source tree.
|
|
1391
|
-
*/
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
if (true) {
|
|
1398
|
-
(function() {
|
|
1399
|
-
'use strict';
|
|
1400
|
-
|
|
1401
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
1402
|
-
// nor polyfill, then a plain number is used for performance.
|
|
1403
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
1404
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
1405
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
1406
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
1407
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
1408
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
1409
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
1410
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
1411
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
1412
|
-
|
|
1413
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
1414
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
1415
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
1416
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
1417
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
1418
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
1419
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
1420
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
1421
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
1422
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
1423
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
1424
|
-
|
|
1425
|
-
function isValidElementType(type) {
|
|
1426
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1427
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
function typeOf(object) {
|
|
1431
|
-
if (typeof object === 'object' && object !== null) {
|
|
1432
|
-
var $$typeof = object.$$typeof;
|
|
1433
|
-
|
|
1434
|
-
switch ($$typeof) {
|
|
1435
|
-
case REACT_ELEMENT_TYPE:
|
|
1436
|
-
var type = object.type;
|
|
1437
|
-
|
|
1438
|
-
switch (type) {
|
|
1439
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
1440
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
1441
|
-
case REACT_FRAGMENT_TYPE:
|
|
1442
|
-
case REACT_PROFILER_TYPE:
|
|
1443
|
-
case REACT_STRICT_MODE_TYPE:
|
|
1444
|
-
case REACT_SUSPENSE_TYPE:
|
|
1445
|
-
return type;
|
|
1446
|
-
|
|
1447
|
-
default:
|
|
1448
|
-
var $$typeofType = type && type.$$typeof;
|
|
1449
|
-
|
|
1450
|
-
switch ($$typeofType) {
|
|
1451
|
-
case REACT_CONTEXT_TYPE:
|
|
1452
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1453
|
-
case REACT_LAZY_TYPE:
|
|
1454
|
-
case REACT_MEMO_TYPE:
|
|
1455
|
-
case REACT_PROVIDER_TYPE:
|
|
1456
|
-
return $$typeofType;
|
|
1457
|
-
|
|
1458
|
-
default:
|
|
1459
|
-
return $$typeof;
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
case REACT_PORTAL_TYPE:
|
|
1465
|
-
return $$typeof;
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
return undefined;
|
|
1470
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
1471
|
-
|
|
1472
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
1473
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
1474
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
1475
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1476
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
1477
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
1478
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
1479
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
1480
|
-
var Memo = REACT_MEMO_TYPE;
|
|
1481
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
1482
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
1483
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1484
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
1485
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
1486
|
-
|
|
1487
|
-
function isAsyncMode(object) {
|
|
1488
|
-
{
|
|
1489
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
1490
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1491
|
-
|
|
1492
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
1497
|
-
}
|
|
1498
|
-
function isConcurrentMode(object) {
|
|
1499
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
1500
|
-
}
|
|
1501
|
-
function isContextConsumer(object) {
|
|
1502
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
1503
|
-
}
|
|
1504
|
-
function isContextProvider(object) {
|
|
1505
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
1506
|
-
}
|
|
1507
|
-
function isElement(object) {
|
|
1508
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1509
|
-
}
|
|
1510
|
-
function isForwardRef(object) {
|
|
1511
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
1512
|
-
}
|
|
1513
|
-
function isFragment(object) {
|
|
1514
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
1515
|
-
}
|
|
1516
|
-
function isLazy(object) {
|
|
1517
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
1518
|
-
}
|
|
1519
|
-
function isMemo(object) {
|
|
1520
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
1521
|
-
}
|
|
1522
|
-
function isPortal(object) {
|
|
1523
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
1524
|
-
}
|
|
1525
|
-
function isProfiler(object) {
|
|
1526
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
1527
|
-
}
|
|
1528
|
-
function isStrictMode(object) {
|
|
1529
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
1530
|
-
}
|
|
1531
|
-
function isSuspense(object) {
|
|
1532
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
exports.AsyncMode = AsyncMode;
|
|
1536
|
-
exports.ConcurrentMode = ConcurrentMode;
|
|
1537
|
-
exports.ContextConsumer = ContextConsumer;
|
|
1538
|
-
exports.ContextProvider = ContextProvider;
|
|
1539
|
-
exports.Element = Element;
|
|
1540
|
-
exports.ForwardRef = ForwardRef;
|
|
1541
|
-
exports.Fragment = Fragment;
|
|
1542
|
-
exports.Lazy = Lazy;
|
|
1543
|
-
exports.Memo = Memo;
|
|
1544
|
-
exports.Portal = Portal;
|
|
1545
|
-
exports.Profiler = Profiler;
|
|
1546
|
-
exports.StrictMode = StrictMode;
|
|
1547
|
-
exports.Suspense = Suspense;
|
|
1548
|
-
exports.isAsyncMode = isAsyncMode;
|
|
1549
|
-
exports.isConcurrentMode = isConcurrentMode;
|
|
1550
|
-
exports.isContextConsumer = isContextConsumer;
|
|
1551
|
-
exports.isContextProvider = isContextProvider;
|
|
1552
|
-
exports.isElement = isElement;
|
|
1553
|
-
exports.isForwardRef = isForwardRef;
|
|
1554
|
-
exports.isFragment = isFragment;
|
|
1555
|
-
exports.isLazy = isLazy;
|
|
1556
|
-
exports.isMemo = isMemo;
|
|
1557
|
-
exports.isPortal = isPortal;
|
|
1558
|
-
exports.isProfiler = isProfiler;
|
|
1559
|
-
exports.isStrictMode = isStrictMode;
|
|
1560
|
-
exports.isSuspense = isSuspense;
|
|
1561
|
-
exports.isValidElementType = isValidElementType;
|
|
1562
|
-
exports.typeOf = typeOf;
|
|
1563
|
-
})();
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
/***/ }),
|
|
1568
|
-
|
|
1569
|
-
/***/ 491:
|
|
1352
|
+
/***/ 237:
|
|
1570
1353
|
/*!*************************************!*\
|
|
1571
|
-
!*** ./src/lilact.jsx +
|
|
1354
|
+
!*** ./src/lilact.jsx + 28 modules ***!
|
|
1572
1355
|
\*************************************/
|
|
1573
1356
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1574
1357
|
|
|
@@ -1664,6 +1447,7 @@ var hooks_namespaceObject = {};
|
|
|
1664
1447
|
__webpack_require__.r(hooks_namespaceObject);
|
|
1665
1448
|
__webpack_require__.d(hooks_namespaceObject, {
|
|
1666
1449
|
createContext: () => (createContext),
|
|
1450
|
+
forwardRef: () => (forwardRef),
|
|
1667
1451
|
useActionState: () => (useActionState),
|
|
1668
1452
|
useCallback: () => (useCallback),
|
|
1669
1453
|
useContext: () => (useContext),
|
|
@@ -1671,6 +1455,7 @@ __webpack_require__.d(hooks_namespaceObject, {
|
|
|
1671
1455
|
useEffect: () => (useEffect),
|
|
1672
1456
|
useHook: () => (useHook),
|
|
1673
1457
|
useId: () => (useId),
|
|
1458
|
+
useImperativeHandle: () => (useImperativeHandle),
|
|
1674
1459
|
useLayoutEffect: () => (useLayoutEffect),
|
|
1675
1460
|
useLocalStorage: () => (useLocalStorage),
|
|
1676
1461
|
useMemo: () => (useMemo),
|
|
@@ -4883,6 +4668,7 @@ let events_set = new Set([
|
|
|
4883
4668
|
const [components_CORE,components_COMPONENT,components_TEXT,IS_ZOMBIE,IDX,CHILD_CLASS_ADDENDUM,components_MEMOIZED]=[Symbol.for('LILACT:CORE'),Symbol.for('LILACT:COMPONENT'),Symbol.for('LILACT:TEXT'),Symbol.for('LILACT:IS_ZOMBIE'),Symbol.for('LILACT:IDX'),Symbol.for('LILACT:CHILD_CLASS_ADDENDUM'),Symbol.for('LILACT:MEMOIZED')];
|
|
4884
4669
|
|
|
4885
4670
|
|
|
4671
|
+
|
|
4886
4672
|
/*
|
|
4887
4673
|
ComponentCache is for internal use. It is the heart of the JSX runtime,
|
|
4888
4674
|
it holds child components and detects which one is being rendered or updated.
|
|
@@ -5065,8 +4851,12 @@ class ComponentCore
|
|
|
5065
4851
|
}
|
|
5066
4852
|
this.props = next_props;
|
|
5067
4853
|
|
|
5068
|
-
if(this.
|
|
5069
|
-
|
|
4854
|
+
if(typeof this.next_state==='object') {
|
|
4855
|
+
if(!this.state) this.state = {...next_state};
|
|
4856
|
+
else Object.assign( this.state, next_state );
|
|
4857
|
+
}
|
|
4858
|
+
else if(this.next_state!==undefined) throw 'Component.setState only accepts objects or functions is new state.';
|
|
4859
|
+
|
|
5070
4860
|
|
|
5071
4861
|
if(this.next_state) delete this.next_state;
|
|
5072
4862
|
|
|
@@ -5125,7 +4915,7 @@ class ComponentCore
|
|
|
5125
4915
|
}
|
|
5126
4916
|
else {
|
|
5127
4917
|
if(!core.element) {
|
|
5128
|
-
core.element = document.createTextNode(
|
|
4918
|
+
core.element = document.createTextNode(item[components_TEXT]);
|
|
5129
4919
|
core[components_TEXT] = item[components_TEXT];
|
|
5130
4920
|
}
|
|
5131
4921
|
else if(core[components_TEXT]!==item[components_TEXT]) {
|
|
@@ -5379,7 +5169,7 @@ const renderErrorHandler = (c, e) =>
|
|
|
5379
5169
|
}
|
|
5380
5170
|
if(c?.component?.componentDidCatch) {
|
|
5381
5171
|
if(c.entity?.getDerivedStateFromError) {
|
|
5382
|
-
c.component.setState(
|
|
5172
|
+
c.component.setState(c.entity.getDerivedStateFromError.call(c, e));
|
|
5383
5173
|
}
|
|
5384
5174
|
|
|
5385
5175
|
if(Lilact.isError(e)) {
|
|
@@ -5678,7 +5468,7 @@ class Component
|
|
|
5678
5468
|
Lilact.clearTimeout(Lilact.update_timeout);
|
|
5679
5469
|
|
|
5680
5470
|
Lilact.update_set.add(this[components_CORE].container || this[components_CORE]);
|
|
5681
|
-
if(callback) Lilact.update_cbs.add(callback);
|
|
5471
|
+
if(callback) Lilact.update_cbs.add(callback.bind(this));
|
|
5682
5472
|
Lilact.update_timeout = Lilact.setTimeout( doUpdates, Lilact.update_interval_margin );
|
|
5683
5473
|
}
|
|
5684
5474
|
|
|
@@ -5686,6 +5476,7 @@ class Component
|
|
|
5686
5476
|
* Update component state.
|
|
5687
5477
|
* Accepts a partial state (or a function returning partial state) and schedules a re-render.
|
|
5688
5478
|
* @param {any} new state
|
|
5479
|
+
* @param {any} callback to called after updates.
|
|
5689
5480
|
* @returns {void}
|
|
5690
5481
|
*/
|
|
5691
5482
|
setState(next_state, callback)
|
|
@@ -5962,10 +5753,10 @@ function useHook()
|
|
|
5962
5753
|
}
|
|
5963
5754
|
|
|
5964
5755
|
/**
|
|
5965
|
-
* Adds state to a component using a
|
|
5756
|
+
* Adds state to a component using a [value, setter] pattern.
|
|
5966
5757
|
*
|
|
5967
5758
|
* @param {any} initialValue - Initial state value.
|
|
5968
|
-
* @returns {any} Hook result
|
|
5759
|
+
* @returns {any} Hook result `[state, setState]`.
|
|
5969
5760
|
*/
|
|
5970
5761
|
function useState(val)
|
|
5971
5762
|
{
|
|
@@ -6020,7 +5811,7 @@ function useCallback(callback, deps=[{}])
|
|
|
6020
5811
|
* Creates a context object for sharing a value through the component tree.
|
|
6021
5812
|
*
|
|
6022
5813
|
* @param {any} [defaultValue] - Initial context value when no Provider is present.
|
|
6023
|
-
* @returns {any} A context object
|
|
5814
|
+
* @returns {any} A context object
|
|
6024
5815
|
*/
|
|
6025
5816
|
function createContext(val)
|
|
6026
5817
|
{
|
|
@@ -6076,7 +5867,7 @@ function useId(prefix="N")
|
|
|
6076
5867
|
/**
|
|
6077
5868
|
* Starts a transition and returns helpers for pending updates vs immediate ones.
|
|
6078
5869
|
*
|
|
6079
|
-
* @returns {any}
|
|
5870
|
+
* @returns {any} `[isPending, startTransition]`
|
|
6080
5871
|
*/
|
|
6081
5872
|
function useTransition()
|
|
6082
5873
|
{
|
|
@@ -6260,7 +6051,7 @@ function useMemo(fn,deps=[])
|
|
|
6260
6051
|
*
|
|
6261
6052
|
* @param {Function} action - The async/queued action function.
|
|
6262
6053
|
* @param {any} initialState - Initial state for the hook.
|
|
6263
|
-
* @returns {any} Hook result
|
|
6054
|
+
* @returns {any} Hook result
|
|
6264
6055
|
*/
|
|
6265
6056
|
function useActionState(fn, initial_state)
|
|
6266
6057
|
{
|
|
@@ -6295,7 +6086,7 @@ function useActionState(fn, initial_state)
|
|
|
6295
6086
|
* @param {Function} reducer - Reducer function.
|
|
6296
6087
|
* @param {any} initialArg - Initial state value (or initializer arg).
|
|
6297
6088
|
* @param {Function} [init] - Optional initializer function for lazy initial state.
|
|
6298
|
-
* @returns {any} Hook result
|
|
6089
|
+
* @returns {any} Hook result `[state, dispatch]`.
|
|
6299
6090
|
*/
|
|
6300
6091
|
function useReducer(reducer, initialArg, init)
|
|
6301
6092
|
{
|
|
@@ -6371,6 +6162,47 @@ function useDeferredValue(value, initialValue)
|
|
|
6371
6162
|
}
|
|
6372
6163
|
|
|
6373
6164
|
|
|
6165
|
+
/**
|
|
6166
|
+
* Wraps a render function so that a parent can pass a `ref` into it.
|
|
6167
|
+
* The forwarded `ref` is provided as the second argument to the render function: `(props, ref)`.
|
|
6168
|
+
*
|
|
6169
|
+
* @param {function(props: any, ref: any)} render
|
|
6170
|
+
* The component render function that receives the props and the forwarded ref.
|
|
6171
|
+
* @returns {}
|
|
6172
|
+
*/
|
|
6173
|
+
function forwardRef(render)
|
|
6174
|
+
{
|
|
6175
|
+
return (props)=>render({...props, ref: undefined}, props.ref);
|
|
6176
|
+
}
|
|
6177
|
+
|
|
6178
|
+
|
|
6179
|
+
/**
|
|
6180
|
+
* Customizes the value that is exposed to the parent when it uses a `ref` on a component created with `forwardRef`.
|
|
6181
|
+
* The object returned by `factory` becomes the value of `ref.current` for object refs.
|
|
6182
|
+
*
|
|
6183
|
+
* @param {Ref<any>} ref
|
|
6184
|
+
* The ref that was received in your component (typically via `forwardRef` as the second argument).
|
|
6185
|
+
* @param {function(): any} factory
|
|
6186
|
+
* Function that returns the value to expose to the parent. Commonly an object with methods,
|
|
6187
|
+
* or a DOM node reference.
|
|
6188
|
+
* @param {Array<any>} [deps]
|
|
6189
|
+
* Dependency list that controls when the exposed value is recalculated.
|
|
6190
|
+
* @returns {void}
|
|
6191
|
+
*/
|
|
6192
|
+
function useImperativeHandle(ref, factory, deps)
|
|
6193
|
+
{
|
|
6194
|
+
Lilact.setTimeout( ()=>{
|
|
6195
|
+
if( !Lilact.defaultIsEqual(deps[d],hk.deps[d]) ) {
|
|
6196
|
+
|
|
6197
|
+
hk.deps = deps;
|
|
6198
|
+
if(typeof ref.current !== object) {
|
|
6199
|
+
ref.current = {};
|
|
6200
|
+
}
|
|
6201
|
+
Object.assign( ref.current, factory(), 0 );
|
|
6202
|
+
}
|
|
6203
|
+
});
|
|
6204
|
+
}
|
|
6205
|
+
|
|
6374
6206
|
|
|
6375
6207
|
|
|
6376
6208
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2FyYXNoL0Rlc2t0b3AvUHJvamVjdHMvTGlsYWN0L3NyYy9ob29rcy5qc3giLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIvVXNlcnMvYXJhc2gvRGVza3RvcC9Qcm9qZWN0cy9MaWxhY3Qvc3JjL2hvb2tzLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
|
@@ -6728,10 +6560,10 @@ const [transition_CORE,transition_COMPONENT,transition_CHILD_CLASS_ADDENDUM]=[Sy
|
|
|
6728
6560
|
|
|
6729
6561
|
/* States */
|
|
6730
6562
|
const UNMOUNTED = "unmounted";
|
|
6731
|
-
const EXITED =
|
|
6732
|
-
const ENTERING =
|
|
6733
|
-
const ENTERED =
|
|
6734
|
-
const EXITING =
|
|
6563
|
+
const EXITED = "exited";
|
|
6564
|
+
const ENTERING = "entering";
|
|
6565
|
+
const ENTERED = "entered";
|
|
6566
|
+
const EXITING = "exiting";
|
|
6735
6567
|
|
|
6736
6568
|
|
|
6737
6569
|
|
|
@@ -6777,12 +6609,16 @@ function Transition({
|
|
|
6777
6609
|
this[transition_CORE].is_appeared ??= inProp;
|
|
6778
6610
|
this[transition_CORE].timer ??= null;
|
|
6779
6611
|
|
|
6780
|
-
|
|
6781
|
-
|
|
6612
|
+
this[transition_CORE].childFunctionHandler = (func)=>{
|
|
6613
|
+
return func(this[transition_CORE].mount_state);
|
|
6614
|
+
}
|
|
6615
|
+
|
|
6616
|
+
if(!this[transition_CORE].mount_state) {
|
|
6617
|
+
if (!this[transition_CORE].is_mounted) this[transition_CORE].mount_state = UNMOUNTED;
|
|
6782
6618
|
if (inProp) {
|
|
6783
|
-
this.
|
|
6619
|
+
this[transition_CORE].mount_state = appear && !this[transition_CORE].is_appeared ? ENTERING : ENTERED;
|
|
6784
6620
|
}
|
|
6785
|
-
this.
|
|
6621
|
+
else this[transition_CORE].mount_state = EXITED;
|
|
6786
6622
|
}
|
|
6787
6623
|
|
|
6788
6624
|
useEffect(() => {
|
|
@@ -6790,13 +6626,14 @@ function Transition({
|
|
|
6790
6626
|
}, []);
|
|
6791
6627
|
|
|
6792
6628
|
useEffect(() => {
|
|
6793
|
-
if (!this[transition_CORE].is_appeared && appear && this.
|
|
6629
|
+
if (!this[transition_CORE].is_appeared && appear && this[transition_CORE].mount_state === ENTERING && inProp) {
|
|
6794
6630
|
onEnter?.();
|
|
6795
6631
|
requestAnimationFrame(() => {
|
|
6796
6632
|
onEntering?.(!this[transition_CORE].is_appeared);
|
|
6797
6633
|
timers_clearTimeout(this[transition_CORE].timer);
|
|
6798
6634
|
this[transition_CORE].timer = timers_setTimeout(() => {
|
|
6799
|
-
this.
|
|
6635
|
+
this[transition_CORE].mount_state = ENTERED;
|
|
6636
|
+
this.forceUpdate();
|
|
6800
6637
|
this[transition_CORE].is_appeared = true;
|
|
6801
6638
|
onEntered?.(!this[transition_CORE].is_appeared);
|
|
6802
6639
|
}, timeout);
|
|
@@ -6808,32 +6645,38 @@ function Transition({
|
|
|
6808
6645
|
if (inProp) {
|
|
6809
6646
|
this[transition_CORE].is_mounted = true;
|
|
6810
6647
|
// If we are already entering/entered, no-op
|
|
6811
|
-
if (this.
|
|
6648
|
+
if (this[transition_CORE].mount_state === ENTERING || this[transition_CORE].mount_state === ENTERED) return;
|
|
6812
6649
|
|
|
6813
6650
|
onEnter?.(!this[transition_CORE].is_appeared);
|
|
6814
|
-
this.
|
|
6651
|
+
this[transition_CORE].mount_state = ENTERING;
|
|
6652
|
+
this.forceUpdate(() => {
|
|
6815
6653
|
onEntering?.(!this[transition_CORE].is_appeared);
|
|
6816
6654
|
timers_clearTimeout(this[transition_CORE].timer);
|
|
6655
|
+
|
|
6817
6656
|
this[transition_CORE].timer = timers_setTimeout(() => {
|
|
6818
|
-
this.
|
|
6657
|
+
this[transition_CORE].mount_state = ENTERED;
|
|
6658
|
+
this.forceUpdate();
|
|
6819
6659
|
this[transition_CORE].is_appeared = true;
|
|
6820
6660
|
onEntered?.();
|
|
6821
6661
|
}, timeout);
|
|
6822
6662
|
});
|
|
6823
6663
|
}
|
|
6824
6664
|
else {
|
|
6825
|
-
if (this.
|
|
6665
|
+
if (this[transition_CORE].mount_state === UNMOUNTED || this[transition_CORE].mount_state === EXITING || this[transition_CORE].mount_state === EXITED) return;
|
|
6826
6666
|
|
|
6827
6667
|
onExit?.();
|
|
6828
|
-
this.
|
|
6668
|
+
this[transition_CORE].mount_state = EXITING;
|
|
6669
|
+
this.forceUpdate( () => {
|
|
6829
6670
|
onExiting?.();
|
|
6830
6671
|
timers_clearTimeout(this[transition_CORE].timer);
|
|
6831
6672
|
this[transition_CORE].timer = timers_setTimeout(() => {
|
|
6832
|
-
this.
|
|
6673
|
+
this[transition_CORE].mount_state = EXITED;
|
|
6674
|
+
this.forceUpdate();
|
|
6833
6675
|
onExited?.();
|
|
6834
6676
|
if (unmountOnExit) {
|
|
6835
6677
|
this[transition_CORE].is_mounted = false;
|
|
6836
|
-
this.
|
|
6678
|
+
this[transition_CORE].mount_state = UNMOUNTED;
|
|
6679
|
+
this.forceUpdate();
|
|
6837
6680
|
}
|
|
6838
6681
|
}, timeout);
|
|
6839
6682
|
});
|
|
@@ -6843,20 +6686,20 @@ function Transition({
|
|
|
6843
6686
|
if (!this[transition_CORE].is_mounted) return null;
|
|
6844
6687
|
|
|
6845
6688
|
if(classNames) {
|
|
6846
|
-
if (this.
|
|
6689
|
+
if (this[transition_CORE].mount_state === ENTERING) {
|
|
6847
6690
|
if(this[transition_CORE].is_appeared)
|
|
6848
6691
|
this[transition_CORE][transition_CHILD_CLASS_ADDENDUM] = classNames.appearActive;
|
|
6849
6692
|
else
|
|
6850
6693
|
this[transition_CORE][transition_CHILD_CLASS_ADDENDUM] = classNames.enterActive;
|
|
6851
6694
|
}
|
|
6852
|
-
else if (this.
|
|
6695
|
+
else if (this[transition_CORE].mount_state === ENTERED) {
|
|
6853
6696
|
if(this[transition_CORE].is_appeared)
|
|
6854
6697
|
this[transition_CORE][transition_CHILD_CLASS_ADDENDUM] = classNames.appearDone;
|
|
6855
6698
|
else
|
|
6856
6699
|
this[transition_CORE][transition_CHILD_CLASS_ADDENDUM] = classNames.enterDone;
|
|
6857
6700
|
}
|
|
6858
|
-
else if (this.
|
|
6859
|
-
else if (this.
|
|
6701
|
+
else if (this[transition_CORE].mount_state === EXITING) this[transition_CORE][transition_CHILD_CLASS_ADDENDUM] = classNames.exitActive;
|
|
6702
|
+
else if (this[transition_CORE].mount_state === EXITED) this[transition_CORE][transition_CHILD_CLASS_ADDENDUM] = classNames.exitDone;
|
|
6860
6703
|
}
|
|
6861
6704
|
return children;
|
|
6862
6705
|
}
|
|
@@ -7622,17 +7465,6 @@ function Routes({ children }) {
|
|
|
7622
7465
|
|
|
7623
7466
|
|
|
7624
7467
|
|
|
7625
|
-
/*
|
|
7626
|
-
type SpinnerProps = {
|
|
7627
|
-
size?: number; // px
|
|
7628
|
-
className?: string;
|
|
7629
|
-
style?: React.CSSProperties;
|
|
7630
|
-
color?: string; // stroke/fill color
|
|
7631
|
-
strokeWidth?: number; // px
|
|
7632
|
-
"aria-label"?: string;
|
|
7633
|
-
};
|
|
7634
|
-
*/
|
|
7635
|
-
|
|
7636
7468
|
/**
|
|
7637
7469
|
* A CSS-only loading spinner component.
|
|
7638
7470
|
*
|
|
@@ -7736,15 +7568,21 @@ class Suspense extends Component
|
|
|
7736
7568
|
constructor(props) {
|
|
7737
7569
|
|
|
7738
7570
|
super(props);
|
|
7571
|
+
/** @ignore */
|
|
7739
7572
|
this.state = { showingFallback: false };
|
|
7740
7573
|
|
|
7574
|
+
/** @ignore */
|
|
7741
7575
|
this._pending = new Set();
|
|
7742
7576
|
|
|
7577
|
+
/** @ignore */
|
|
7743
7578
|
this._delayTimer = null;
|
|
7579
|
+
/** @ignore */
|
|
7744
7580
|
this._minShowTimer = null;
|
|
7581
|
+
/** @ignore */
|
|
7745
7582
|
this._fallbackShownAt = 0;
|
|
7746
7583
|
}
|
|
7747
7584
|
|
|
7585
|
+
/** @ignore */
|
|
7748
7586
|
static getDerivedStateFromError(error) {
|
|
7749
7587
|
if (Lilact.isThenable(error)) {
|
|
7750
7588
|
// signal to call componentDidCatch where we handle the thenable
|
|
@@ -7754,6 +7592,7 @@ class Suspense extends Component
|
|
|
7754
7592
|
throw error;
|
|
7755
7593
|
}
|
|
7756
7594
|
|
|
7595
|
+
/** @ignore */
|
|
7757
7596
|
componentDidCatch(error) {
|
|
7758
7597
|
if (!Lilact.isThenable(error)) return;
|
|
7759
7598
|
|
|
@@ -7780,11 +7619,13 @@ class Suspense extends Component
|
|
|
7780
7619
|
}
|
|
7781
7620
|
}
|
|
7782
7621
|
|
|
7622
|
+
/** @ignore */
|
|
7783
7623
|
componentWillUnmount() {
|
|
7784
7624
|
this._clearTimers();
|
|
7785
7625
|
this._pending.clear();
|
|
7786
7626
|
}
|
|
7787
7627
|
|
|
7628
|
+
/** @ignore */
|
|
7788
7629
|
_clearTimers() {
|
|
7789
7630
|
if (this._delayTimer) {
|
|
7790
7631
|
Lilact.clearTimeout(this._delayTimer);
|
|
@@ -7796,6 +7637,7 @@ class Suspense extends Component
|
|
|
7796
7637
|
}
|
|
7797
7638
|
}
|
|
7798
7639
|
|
|
7640
|
+
/** @ignore */
|
|
7799
7641
|
_attachPromise(promise) {
|
|
7800
7642
|
if (this._pending.has(promise)) return;
|
|
7801
7643
|
this._pending.add(promise);
|
|
@@ -7852,11 +7694,13 @@ class Suspense extends Component
|
|
|
7852
7694
|
promise.then(onSettled, onSettled);
|
|
7853
7695
|
}
|
|
7854
7696
|
|
|
7697
|
+
/** @ignore */
|
|
7855
7698
|
componentDidCatch(error, info) {
|
|
7856
7699
|
if (!Lilact.isThenable(error)) return;
|
|
7857
7700
|
this._attachPromise(error);
|
|
7858
7701
|
}
|
|
7859
7702
|
|
|
7703
|
+
/** @ignore */
|
|
7860
7704
|
render() {
|
|
7861
7705
|
if (this.state.showingFallback) {
|
|
7862
7706
|
return Lilact.createComponent( null, { }, this.props.fallback );
|
|
@@ -7868,6 +7712,272 @@ class Suspense extends Component
|
|
|
7868
7712
|
|
|
7869
7713
|
|
|
7870
7714
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2FyYXNoL0Rlc2t0b3AvUHJvamVjdHMvTGlsYWN0L3NyYy9hY2Nlc3Nvcmllcy5qc3giLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIvVXNlcnMvYXJhc2gvRGVza3RvcC9Qcm9qZWN0cy9MaWxhY3Qvc3JjL2FjY2Vzc29yaWVzLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
|
7715
|
+
;// ./src/pane.jsx
|
|
7716
|
+
|
|
7717
|
+
|
|
7718
|
+
|
|
7719
|
+
function clamp(n, min, max) {
|
|
7720
|
+
return Math.max(min, Math.min(max, n));
|
|
7721
|
+
}
|
|
7722
|
+
|
|
7723
|
+
/**
|
|
7724
|
+
* ResizablePane
|
|
7725
|
+
*
|
|
7726
|
+
* Features:
|
|
7727
|
+
* - Supports "horizontal" (left/top size affects width) and "vertical" (affects height)
|
|
7728
|
+
* - Initial position via props.position
|
|
7729
|
+
* - Methods to set mode and position via ref:
|
|
7730
|
+
* ref.current.setMode(mode)
|
|
7731
|
+
* ref.current.setPosition(position)
|
|
7732
|
+
* - Callback when size changes via onSizeChange
|
|
7733
|
+
* - Children are rendered in two separate containers (no portals)
|
|
7734
|
+
*/
|
|
7735
|
+
const ResizablePane = forwardRef(function Pane(
|
|
7736
|
+
{
|
|
7737
|
+
mode = "horizontal", // "horizontal" | "vertical"
|
|
7738
|
+
initialPosition, // optional (alias-ish to position)
|
|
7739
|
+
position, // controlled position (number)
|
|
7740
|
+
defaultPosition = 0.5, // used if position/initialPosition not provided
|
|
7741
|
+
min = 0.1, // clamp in "percent of container" units: 0..1
|
|
7742
|
+
max = 0.9, // clamp in "percent of container" units: 0..1
|
|
7743
|
+
splitterSize = 8, // px thickness of the drag handle
|
|
7744
|
+
onSizeChange, // (newPosition: number) => void
|
|
7745
|
+
style,
|
|
7746
|
+
className,
|
|
7747
|
+
leftPaneStyle,
|
|
7748
|
+
rightPaneStyle,
|
|
7749
|
+
splitterStyle,
|
|
7750
|
+
children, // expects two children: [A, B]
|
|
7751
|
+
},
|
|
7752
|
+
ref
|
|
7753
|
+
) {
|
|
7754
|
+
const [internalMode, setInternalMode] = useState(mode);
|
|
7755
|
+
const [pos, setPos] = useState(() => {
|
|
7756
|
+
const start =
|
|
7757
|
+
position ?? initialPosition ?? (defaultPosition != null ? defaultPosition : 0.5);
|
|
7758
|
+
return clamp(start, min, max);
|
|
7759
|
+
});
|
|
7760
|
+
|
|
7761
|
+
const containerRef = useRef(null);
|
|
7762
|
+
const draggingRef = useRef(false);
|
|
7763
|
+
|
|
7764
|
+
const panes = Children.toArray(children);
|
|
7765
|
+
const leftChild = panes[0] ?? null;
|
|
7766
|
+
const rightChild = panes[1] ?? null;
|
|
7767
|
+
|
|
7768
|
+
const modeResolved = mode != null ? mode : internalMode;
|
|
7769
|
+
|
|
7770
|
+
// Keep internalMode aligned if mode is provided as a prop
|
|
7771
|
+
useEffect(() => {
|
|
7772
|
+
if (mode != null) setInternalMode(mode);
|
|
7773
|
+
}, [mode]);
|
|
7774
|
+
|
|
7775
|
+
// Controlled position: update state when prop changes
|
|
7776
|
+
useEffect(() => {
|
|
7777
|
+
if (position == null) return;
|
|
7778
|
+
setPos(clamp(position, min, max));
|
|
7779
|
+
}, [position, min, max]);
|
|
7780
|
+
|
|
7781
|
+
const setPosition = (newPos) => {
|
|
7782
|
+
const next = clamp(newPos, min, max);
|
|
7783
|
+
if (position == null) setPos(next); // only update internal state if uncontrolled
|
|
7784
|
+
onSizeChange?.(next);
|
|
7785
|
+
};
|
|
7786
|
+
|
|
7787
|
+
const setMode = (nextMode) => {
|
|
7788
|
+
const m = nextMode === "vertical" ? "vertical" : "horizontal";
|
|
7789
|
+
if (mode == null) setInternalMode(m);
|
|
7790
|
+
// If mode is controlled via prop, consumer should re-render with new prop.
|
|
7791
|
+
};
|
|
7792
|
+
|
|
7793
|
+
useImperativeHandle(
|
|
7794
|
+
ref,
|
|
7795
|
+
() => ({
|
|
7796
|
+
setPosition,
|
|
7797
|
+
setMode,
|
|
7798
|
+
getPosition: () => (position == null ? pos : clamp(position, min, max)),
|
|
7799
|
+
getMode: () => modeResolved,
|
|
7800
|
+
}),
|
|
7801
|
+
[pos, position, min, max, modeResolved, onSizeChange, mode]
|
|
7802
|
+
);
|
|
7803
|
+
|
|
7804
|
+
const updateFromClientXorY = (clientX, clientY) => {
|
|
7805
|
+
const el = containerRef.current;
|
|
7806
|
+
if (!el) return;
|
|
7807
|
+
|
|
7808
|
+
const rect = el.getBoundingClientRect();
|
|
7809
|
+
let next;
|
|
7810
|
+
|
|
7811
|
+
if (modeResolved === "horizontal") {
|
|
7812
|
+
const usable = rect.width;
|
|
7813
|
+
if (usable <= 0) return;
|
|
7814
|
+
next = (clientX - rect.left) / usable;
|
|
7815
|
+
} else {
|
|
7816
|
+
const usable = rect.height;
|
|
7817
|
+
if (usable <= 0) return;
|
|
7818
|
+
next = (clientY - rect.top) / usable;
|
|
7819
|
+
}
|
|
7820
|
+
setPosition(next);
|
|
7821
|
+
};
|
|
7822
|
+
|
|
7823
|
+
const onPointerDown = (e) => {
|
|
7824
|
+
e.preventDefault();
|
|
7825
|
+
draggingRef.current = true;
|
|
7826
|
+
|
|
7827
|
+
// Capture pointer so we still get events outside the handle area.
|
|
7828
|
+
try {
|
|
7829
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
7830
|
+
} catch {
|
|
7831
|
+
// ignore
|
|
7832
|
+
}
|
|
7833
|
+
|
|
7834
|
+
updateFromClientXorY(e.clientX, e.clientY);
|
|
7835
|
+
};
|
|
7836
|
+
|
|
7837
|
+
const onPointerMove = (e) => {
|
|
7838
|
+
if (!draggingRef.current) return;
|
|
7839
|
+
updateFromClientXorY(e.clientX, e.clientY);
|
|
7840
|
+
};
|
|
7841
|
+
|
|
7842
|
+
const stopDragging = () => {
|
|
7843
|
+
draggingRef.current = false;
|
|
7844
|
+
};
|
|
7845
|
+
|
|
7846
|
+
// Attach global listeners to ensure smooth dragging even if pointer capture fails
|
|
7847
|
+
useEffect(() => {
|
|
7848
|
+
const handleMove = (e) => {
|
|
7849
|
+
if (!draggingRef.current) return;
|
|
7850
|
+
updateFromClientXorY(e.clientX, e.clientY);
|
|
7851
|
+
};
|
|
7852
|
+
const handleUp = () => stopDragging();
|
|
7853
|
+
|
|
7854
|
+
window.addEventListener("pointermove", handleMove, { passive: false });
|
|
7855
|
+
window.addEventListener("pointerup", handleUp, { passive: true });
|
|
7856
|
+
window.addEventListener("pointercancel", handleUp, { passive: true });
|
|
7857
|
+
|
|
7858
|
+
return () => {
|
|
7859
|
+
window.removeEventListener("pointermove", handleMove);
|
|
7860
|
+
window.removeEventListener("pointerup", handleUp);
|
|
7861
|
+
window.removeEventListener("pointercancel", handleUp);
|
|
7862
|
+
};
|
|
7863
|
+
}, [modeResolved, min, max, position, onSizeChange]);
|
|
7864
|
+
|
|
7865
|
+
const posResolved = position == null ? pos : clamp(position, min, max);
|
|
7866
|
+
|
|
7867
|
+
const sizes = useMemo(() => {
|
|
7868
|
+
if (modeResolved === "horizontal") {
|
|
7869
|
+
// left width = pos, splitter width = splitterSize, right flexes
|
|
7870
|
+
// We set left/right as percentages and keep splitter fixed in px.
|
|
7871
|
+
return {
|
|
7872
|
+
left: `${posResolved * 100}%`,
|
|
7873
|
+
right: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
7874
|
+
};
|
|
7875
|
+
}
|
|
7876
|
+
return {
|
|
7877
|
+
left: `${posResolved * 100}%`,
|
|
7878
|
+
right: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
7879
|
+
};
|
|
7880
|
+
}, [modeResolved, posResolved, splitterSize]);
|
|
7881
|
+
|
|
7882
|
+
// Improve keyboard accessibility (arrow keys when handle is focused)
|
|
7883
|
+
const onSplitterKeyDown = (e) => {
|
|
7884
|
+
const step = 0.02;
|
|
7885
|
+
let delta = 0;
|
|
7886
|
+
if (modeResolved === "horizontal") {
|
|
7887
|
+
if (e.key === "ArrowLeft") delta = -step;
|
|
7888
|
+
if (e.key === "ArrowRight") delta = step;
|
|
7889
|
+
} else {
|
|
7890
|
+
if (e.key === "ArrowUp") delta = -step;
|
|
7891
|
+
if (e.key === "ArrowDown") delta = step;
|
|
7892
|
+
}
|
|
7893
|
+
if (delta !== 0) {
|
|
7894
|
+
e.preventDefault();
|
|
7895
|
+
setPosition(posResolved + delta);
|
|
7896
|
+
}
|
|
7897
|
+
};
|
|
7898
|
+
|
|
7899
|
+
// Ensure position clamps correctly if min/max change
|
|
7900
|
+
useLayoutEffect(() => {
|
|
7901
|
+
setPos((p) => clamp(p, min, max));
|
|
7902
|
+
}, [min, max]);
|
|
7903
|
+
|
|
7904
|
+
const rootStyle = {
|
|
7905
|
+
display: "flex",
|
|
7906
|
+
width: "100%",
|
|
7907
|
+
height: "100%",
|
|
7908
|
+
overflow: "hidden",
|
|
7909
|
+
touchAction: "none",
|
|
7910
|
+
...(style || {}),
|
|
7911
|
+
flexDirection: modeResolved === "horizontal" ? "row" : "column",
|
|
7912
|
+
};
|
|
7913
|
+
|
|
7914
|
+
const leftPaneComputed =
|
|
7915
|
+
modeResolved === "horizontal"
|
|
7916
|
+
? {
|
|
7917
|
+
width: sizes.left,
|
|
7918
|
+
flex: `0 0 ${sizes.left}`,
|
|
7919
|
+
overflow: "auto",
|
|
7920
|
+
...(leftPaneStyle || {}),
|
|
7921
|
+
}
|
|
7922
|
+
: {
|
|
7923
|
+
height: sizes.left,
|
|
7924
|
+
flex: `0 0 ${sizes.left}`,
|
|
7925
|
+
overflow: "auto",
|
|
7926
|
+
...(leftPaneStyle || {}),
|
|
7927
|
+
};
|
|
7928
|
+
|
|
7929
|
+
const rightPaneComputed =
|
|
7930
|
+
modeResolved === "horizontal"
|
|
7931
|
+
? {
|
|
7932
|
+
width: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
7933
|
+
flex: `1 1 auto`,
|
|
7934
|
+
overflow: "auto",
|
|
7935
|
+
...(rightPaneStyle || {}),
|
|
7936
|
+
}
|
|
7937
|
+
: {
|
|
7938
|
+
height: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
7939
|
+
flex: `1 1 auto`,
|
|
7940
|
+
overflow: "auto",
|
|
7941
|
+
...(rightPaneStyle || {}),
|
|
7942
|
+
};
|
|
7943
|
+
|
|
7944
|
+
const splitterComputed =
|
|
7945
|
+
modeResolved === "horizontal"
|
|
7946
|
+
? {
|
|
7947
|
+
width: `${splitterSize}px`,
|
|
7948
|
+
flex: `0 0 ${splitterSize}px`,
|
|
7949
|
+
cursor: "col-resize",
|
|
7950
|
+
background: "transparent",
|
|
7951
|
+
...(splitterStyle || {}),
|
|
7952
|
+
}
|
|
7953
|
+
: {
|
|
7954
|
+
height: `${splitterSize}px`,
|
|
7955
|
+
flex: `0 0 ${splitterSize}px`,
|
|
7956
|
+
cursor: "row-resize",
|
|
7957
|
+
background: "transparent",
|
|
7958
|
+
...(splitterStyle || {}),
|
|
7959
|
+
};
|
|
7960
|
+
|
|
7961
|
+
const dividerVisualStyle =
|
|
7962
|
+
modeResolved === "horizontal"
|
|
7963
|
+
? {
|
|
7964
|
+
height: "100%",
|
|
7965
|
+
width: "100%",
|
|
7966
|
+
background: "rgba(0,0,0,0.08)",
|
|
7967
|
+
}
|
|
7968
|
+
: {
|
|
7969
|
+
width: "100%",
|
|
7970
|
+
height: "100%",
|
|
7971
|
+
background: "rgba(0,0,0,0.08)",
|
|
7972
|
+
};
|
|
7973
|
+
|
|
7974
|
+
return (
|
|
7975
|
+
Lilact.createComponent( "div", { "ref": containerRef, "className": className, "style": rootStyle, "onPointerMove": onPointerMove }, Lilact.createComponent( "div", { "style": leftPaneComputed }, leftChild ), Lilact.createComponent( "div", { "role": "separator", "aria-orientation": modeResolved === "horizontal" ? "vertical" : "horizontal", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": posResolved, "tabIndex": 0, "onPointerDown": onPointerDown, "onPointerUp": stopDragging, "onPointerCancel": stopDragging, "onKeyDown": onSplitterKeyDown, "style": splitterComputed }, Lilact.createComponent( "div", { "style": dividerVisualStyle } ) ), Lilact.createComponent( "div", { "style": rightPaneComputed }, rightChild ) )
|
|
7976
|
+
);
|
|
7977
|
+
});
|
|
7978
|
+
|
|
7979
|
+
|
|
7980
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2FyYXNoL0Rlc2t0b3AvUHJvamVjdHMvTGlsYWN0L3NyYy9wYW5lLmpzeCIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi9Vc2Vycy9hcmFzaC9EZXNrdG9wL1Byb2plY3RzL0xpbGFjdC9zcmMvcGFuZS5qc3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEifQ==
|
|
7871
7981
|
// EXTERNAL MODULE: ./src/jsx.js
|
|
7872
7982
|
var jsx = __webpack_require__(207);
|
|
7873
7983
|
;// ./src/lilact.jsx
|
|
@@ -7921,6 +8031,7 @@ var jsx = __webpack_require__(207);
|
|
|
7921
8031
|
|
|
7922
8032
|
|
|
7923
8033
|
|
|
8034
|
+
|
|
7924
8035
|
|
|
7925
8036
|
|
|
7926
8037
|
//import '../node_modules/@dragdroptouch/drag-drop-touch/dist/drag-drop-touch.esm.min.js';
|
|
@@ -7934,7 +8045,7 @@ var jsx = __webpack_require__(207);
|
|
|
7934
8045
|
* @property emotion - Handle to Emotion’s CSS-in-JS package for styling (https://github.com/emotion-js/emotion).
|
|
7935
8046
|
*/
|
|
7936
8047
|
const lilact_Lilact =
|
|
7937
|
-
{
|
|
8048
|
+
{
|
|
7938
8049
|
|
|
7939
8050
|
VERSION: "beta.0",
|
|
7940
8051
|
|
|
@@ -7959,27 +8070,24 @@ const lilact_Lilact =
|
|
|
7959
8070
|
...router_namespaceObject,
|
|
7960
8071
|
...accessories_namespaceObject,
|
|
7961
8072
|
|
|
8073
|
+
ResizablePane: ResizablePane,
|
|
8074
|
+
|
|
7962
8075
|
transpileJSX: jsx.transpileJSX,
|
|
7963
8076
|
transpilerConfig: jsx.transpilerConfig,
|
|
7964
8077
|
|
|
7965
8078
|
// Dependencies ()
|
|
7966
8079
|
|
|
7967
8080
|
PropTypes: (prop_types_default()),
|
|
8081
|
+
//redux: {...redux, createSlice, createAsyncThunk},
|
|
7968
8082
|
redux: redux_namespaceObject,
|
|
7969
8083
|
emotion: emotion_css_development_esm_namespaceObject,
|
|
7970
8084
|
|
|
7971
8085
|
}
|
|
7972
8086
|
|
|
7973
|
-
|
|
7974
|
-
// or, if you prefer DOMContentLoaded:
|
|
7975
8087
|
document.addEventListener('DOMContentLoaded', () => {
|
|
7976
8088
|
lilact_Lilact.runScripts();
|
|
7977
8089
|
});
|
|
7978
8090
|
|
|
7979
|
-
function yourFunctionHere() {
|
|
7980
|
-
// ...
|
|
7981
|
-
}
|
|
7982
|
-
|
|
7983
8091
|
console.log(`Lilact (Version: ${lilact_Lilact.VERSION}) - Debug Mode`);
|
|
7984
8092
|
console.log(`Copyright(C) 2024-2026 Arash Kazemi <contact.arash.kazemi@gmail.com>`);
|
|
7985
8093
|
|
|
@@ -7987,6 +8095,224 @@ function yourFunctionHere() {
|
|
|
7987
8095
|
|
|
7988
8096
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2FyYXNoL0Rlc2t0b3AvUHJvamVjdHMvTGlsYWN0L3NyYy9saWxhY3QuanN4Iiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiL1VzZXJzL2FyYXNoL0Rlc2t0b3AvUHJvamVjdHMvTGlsYWN0L3NyYy9saWxhY3QuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
|
|
7989
8097
|
|
|
8098
|
+
/***/ }),
|
|
8099
|
+
|
|
8100
|
+
/***/ 363:
|
|
8101
|
+
/*!****************************************!*\
|
|
8102
|
+
!*** ./node_modules/react-is/index.js ***!
|
|
8103
|
+
\****************************************/
|
|
8104
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
8105
|
+
|
|
8106
|
+
|
|
8107
|
+
|
|
8108
|
+
if (false) // removed by dead control flow
|
|
8109
|
+
{} else {
|
|
8110
|
+
module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ 413);
|
|
8111
|
+
}
|
|
8112
|
+
|
|
8113
|
+
|
|
8114
|
+
/***/ }),
|
|
8115
|
+
|
|
8116
|
+
/***/ 376:
|
|
8117
|
+
/*!********************************************!*\
|
|
8118
|
+
!*** ./node_modules/prop-types/lib/has.js ***!
|
|
8119
|
+
\********************************************/
|
|
8120
|
+
/***/ ((module) => {
|
|
8121
|
+
|
|
8122
|
+
module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
8123
|
+
|
|
8124
|
+
|
|
8125
|
+
/***/ }),
|
|
8126
|
+
|
|
8127
|
+
/***/ 413:
|
|
8128
|
+
/*!***********************************************************!*\
|
|
8129
|
+
!*** ./node_modules/react-is/cjs/react-is.development.js ***!
|
|
8130
|
+
\***********************************************************/
|
|
8131
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
8132
|
+
|
|
8133
|
+
/** @license React v16.13.1
|
|
8134
|
+
* react-is.development.js
|
|
8135
|
+
*
|
|
8136
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8137
|
+
*
|
|
8138
|
+
* This source code is licensed under the MIT license found in the
|
|
8139
|
+
* LICENSE file in the root directory of this source tree.
|
|
8140
|
+
*/
|
|
8141
|
+
|
|
8142
|
+
|
|
8143
|
+
|
|
8144
|
+
|
|
8145
|
+
|
|
8146
|
+
if (true) {
|
|
8147
|
+
(function() {
|
|
8148
|
+
'use strict';
|
|
8149
|
+
|
|
8150
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
8151
|
+
// nor polyfill, then a plain number is used for performance.
|
|
8152
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
8153
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
8154
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
8155
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
8156
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
8157
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
8158
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
8159
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
8160
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
8161
|
+
|
|
8162
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
8163
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
8164
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
8165
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
8166
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
8167
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
8168
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
8169
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
8170
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
8171
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
8172
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
8173
|
+
|
|
8174
|
+
function isValidElementType(type) {
|
|
8175
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
8176
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
8177
|
+
}
|
|
8178
|
+
|
|
8179
|
+
function typeOf(object) {
|
|
8180
|
+
if (typeof object === 'object' && object !== null) {
|
|
8181
|
+
var $$typeof = object.$$typeof;
|
|
8182
|
+
|
|
8183
|
+
switch ($$typeof) {
|
|
8184
|
+
case REACT_ELEMENT_TYPE:
|
|
8185
|
+
var type = object.type;
|
|
8186
|
+
|
|
8187
|
+
switch (type) {
|
|
8188
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
8189
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
8190
|
+
case REACT_FRAGMENT_TYPE:
|
|
8191
|
+
case REACT_PROFILER_TYPE:
|
|
8192
|
+
case REACT_STRICT_MODE_TYPE:
|
|
8193
|
+
case REACT_SUSPENSE_TYPE:
|
|
8194
|
+
return type;
|
|
8195
|
+
|
|
8196
|
+
default:
|
|
8197
|
+
var $$typeofType = type && type.$$typeof;
|
|
8198
|
+
|
|
8199
|
+
switch ($$typeofType) {
|
|
8200
|
+
case REACT_CONTEXT_TYPE:
|
|
8201
|
+
case REACT_FORWARD_REF_TYPE:
|
|
8202
|
+
case REACT_LAZY_TYPE:
|
|
8203
|
+
case REACT_MEMO_TYPE:
|
|
8204
|
+
case REACT_PROVIDER_TYPE:
|
|
8205
|
+
return $$typeofType;
|
|
8206
|
+
|
|
8207
|
+
default:
|
|
8208
|
+
return $$typeof;
|
|
8209
|
+
}
|
|
8210
|
+
|
|
8211
|
+
}
|
|
8212
|
+
|
|
8213
|
+
case REACT_PORTAL_TYPE:
|
|
8214
|
+
return $$typeof;
|
|
8215
|
+
}
|
|
8216
|
+
}
|
|
8217
|
+
|
|
8218
|
+
return undefined;
|
|
8219
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
8220
|
+
|
|
8221
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
8222
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
8223
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
8224
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
8225
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
8226
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
8227
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
8228
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
8229
|
+
var Memo = REACT_MEMO_TYPE;
|
|
8230
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
8231
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
8232
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
8233
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
8234
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
8235
|
+
|
|
8236
|
+
function isAsyncMode(object) {
|
|
8237
|
+
{
|
|
8238
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
8239
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
8240
|
+
|
|
8241
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
8242
|
+
}
|
|
8243
|
+
}
|
|
8244
|
+
|
|
8245
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
8246
|
+
}
|
|
8247
|
+
function isConcurrentMode(object) {
|
|
8248
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
8249
|
+
}
|
|
8250
|
+
function isContextConsumer(object) {
|
|
8251
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
8252
|
+
}
|
|
8253
|
+
function isContextProvider(object) {
|
|
8254
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
8255
|
+
}
|
|
8256
|
+
function isElement(object) {
|
|
8257
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
8258
|
+
}
|
|
8259
|
+
function isForwardRef(object) {
|
|
8260
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
8261
|
+
}
|
|
8262
|
+
function isFragment(object) {
|
|
8263
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
8264
|
+
}
|
|
8265
|
+
function isLazy(object) {
|
|
8266
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
8267
|
+
}
|
|
8268
|
+
function isMemo(object) {
|
|
8269
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
8270
|
+
}
|
|
8271
|
+
function isPortal(object) {
|
|
8272
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
8273
|
+
}
|
|
8274
|
+
function isProfiler(object) {
|
|
8275
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
8276
|
+
}
|
|
8277
|
+
function isStrictMode(object) {
|
|
8278
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
8279
|
+
}
|
|
8280
|
+
function isSuspense(object) {
|
|
8281
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
8282
|
+
}
|
|
8283
|
+
|
|
8284
|
+
exports.AsyncMode = AsyncMode;
|
|
8285
|
+
exports.ConcurrentMode = ConcurrentMode;
|
|
8286
|
+
exports.ContextConsumer = ContextConsumer;
|
|
8287
|
+
exports.ContextProvider = ContextProvider;
|
|
8288
|
+
exports.Element = Element;
|
|
8289
|
+
exports.ForwardRef = ForwardRef;
|
|
8290
|
+
exports.Fragment = Fragment;
|
|
8291
|
+
exports.Lazy = Lazy;
|
|
8292
|
+
exports.Memo = Memo;
|
|
8293
|
+
exports.Portal = Portal;
|
|
8294
|
+
exports.Profiler = Profiler;
|
|
8295
|
+
exports.StrictMode = StrictMode;
|
|
8296
|
+
exports.Suspense = Suspense;
|
|
8297
|
+
exports.isAsyncMode = isAsyncMode;
|
|
8298
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
8299
|
+
exports.isContextConsumer = isContextConsumer;
|
|
8300
|
+
exports.isContextProvider = isContextProvider;
|
|
8301
|
+
exports.isElement = isElement;
|
|
8302
|
+
exports.isForwardRef = isForwardRef;
|
|
8303
|
+
exports.isFragment = isFragment;
|
|
8304
|
+
exports.isLazy = isLazy;
|
|
8305
|
+
exports.isMemo = isMemo;
|
|
8306
|
+
exports.isPortal = isPortal;
|
|
8307
|
+
exports.isProfiler = isProfiler;
|
|
8308
|
+
exports.isStrictMode = isStrictMode;
|
|
8309
|
+
exports.isSuspense = isSuspense;
|
|
8310
|
+
exports.isValidElementType = isValidElementType;
|
|
8311
|
+
exports.typeOf = typeOf;
|
|
8312
|
+
})();
|
|
8313
|
+
}
|
|
8314
|
+
|
|
8315
|
+
|
|
7990
8316
|
/***/ }),
|
|
7991
8317
|
|
|
7992
8318
|
/***/ 556:
|
|
@@ -8756,12 +9082,13 @@ module.exports = checkPropTypes;
|
|
|
8756
9082
|
|
|
8757
9083
|
__webpack_require__.r(__webpack_exports__);
|
|
8758
9084
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9085
|
+
/* harmony export */ lazy: () => (/* binding */ lazy),
|
|
8759
9086
|
/* harmony export */ require: () => (/* binding */ require),
|
|
8760
9087
|
/* harmony export */ run: () => (/* binding */ run),
|
|
8761
9088
|
/* harmony export */ runScripts: () => (/* binding */ runScripts),
|
|
8762
9089
|
/* harmony export */ traceError: () => (/* binding */ traceError)
|
|
8763
9090
|
/* harmony export */ });
|
|
8764
|
-
/* harmony import */ var _lilact_jsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lilact.jsx */
|
|
9091
|
+
/* harmony import */ var _lilact_jsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lilact.jsx */ 237);
|
|
8765
9092
|
/*
|
|
8766
9093
|
|
|
8767
9094
|
Lilact
|
|
@@ -8774,10 +9101,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8774
9101
|
modification, are permitted provided that the following conditions are met:
|
|
8775
9102
|
|
|
8776
9103
|
* Redistributions of source code must retain the above copyright
|
|
8777
|
-
|
|
9104
|
+
notice, this list of conditions and the following disclaimer.
|
|
8778
9105
|
* Redistributions in binary form must reproduce the above copyright
|
|
8779
|
-
|
|
8780
|
-
|
|
9106
|
+
notice, this list of conditions and the following disclaimer in the
|
|
9107
|
+
documentation and/or other materials provided with the distribution.
|
|
8781
9108
|
|
|
8782
9109
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
8783
9110
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
@@ -8792,7 +9119,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8792
9119
|
|
|
8793
9120
|
*/
|
|
8794
9121
|
|
|
8795
|
-
const [CORE,COMPONENT]=[Symbol.for('LILACT:CORE'),Symbol.for('LILACT:COMPONENT')];
|
|
9122
|
+
const [CORE,COMPONENT,LAZY]=[Symbol.for('LILACT:CORE'),Symbol.for('LILACT:COMPONENT'),Symbol.for('LILACT:LAZY')];
|
|
9123
|
+
|
|
8796
9124
|
|
|
8797
9125
|
|
|
8798
9126
|
|
|
@@ -8800,10 +9128,8 @@ const [CORE,COMPONENT]=[Symbol.for('LILACT:CORE'),Symbol.for('LILACT:COMPONENT')
|
|
|
8800
9128
|
* Runs a jsx script. All scripts can access Lilact namespace as a global object.
|
|
8801
9129
|
*
|
|
8802
9130
|
* Notice that `run` uses eval internally. There is no standard way of getting the error location when
|
|
8803
|
-
* running it with eval. Lilact has its own experimental workarounds for this
|
|
8804
|
-
*
|
|
8805
|
-
* inline, because that way the generated sourcemap will be used by the browser and the exceptions will be
|
|
8806
|
-
* located automatically. When an inline script raises exception, the original exception does not report
|
|
9131
|
+
* running it with eval. Lilact has its own experimental workarounds for this.
|
|
9132
|
+
* When an inline script raises an exception, the original exception does not report
|
|
8807
9133
|
* which eval has caused the error, so Lilact should guess it from some labels, and for the sake of
|
|
8808
9134
|
* efficiency, it is block based and not exact.
|
|
8809
9135
|
*
|
|
@@ -8873,50 +9199,62 @@ function run(jsx, path=`<string input ${++_lilact_jsx__WEBPACK_IMPORTED_MODULE_0
|
|
|
8873
9199
|
}
|
|
8874
9200
|
}
|
|
8875
9201
|
|
|
8876
|
-
// export async function importAsync(path)
|
|
8877
|
-
// {
|
|
8878
|
-
// const res = await fetch(path);
|
|
8879
|
-
// const text = await res.text();
|
|
8880
|
-
|
|
8881
|
-
// return Lilact.run(text, path, false);
|
|
8882
|
-
// }
|
|
8883
9202
|
|
|
8884
9203
|
/**
|
|
8885
9204
|
* Loads a jsx script from a path. All scripts can access Lilact namespace as a global object.
|
|
8886
9205
|
*
|
|
8887
|
-
* Lilact
|
|
8888
|
-
*
|
|
9206
|
+
* `Lilact.require` loads synchronously, as it is expected to be loaded on the next instruction.
|
|
9207
|
+
*
|
|
9208
|
+
* As running the transpiled scripts rely on `eval`, it is not possible to use module imports
|
|
9209
|
+
* and exports. So to import you should use `const {useState} = Lilact` convention. And to
|
|
9210
|
+
* export, you should use `module.exports = ...`. `Lilact.require` returns `module.exports` value
|
|
9211
|
+
* so you can import different modules using the convention above.
|
|
9212
|
+
*
|
|
9213
|
+
* If the path is in the format #id, it will query the document for a script element with the given
|
|
9214
|
+
* id and run its contents.
|
|
9215
|
+
*
|
|
9216
|
+
* If require is called inside the function given to lazy, it will run async. See `lazy`.
|
|
9217
|
+
*
|
|
9218
|
+
* @param path - The path to the required file. Must be either absolute path or relative to the current
|
|
9219
|
+
* document’s URL (the page/location that initiated the request).
|
|
8889
9220
|
*
|
|
8890
|
-
* Notice that run uses eval internally. There is no standard way of getting the error location when
|
|
8891
|
-
* running it with eval. Lilact has its own experimental workarounds for this, but generally speaking it
|
|
8892
|
-
* works better when an script is loaded from a file (using <script type='text/jsx' src=''.../> and is not
|
|
8893
|
-
* inline, because that way the generated sourcemap will be used by the browser and the exceptions will be
|
|
8894
|
-
* located automatically. When an inline script raises exception, the original exception does not report
|
|
8895
|
-
* which eval has caused the error, so Lilact should guess it from some labels, and for the sake of
|
|
8896
|
-
* efficiency, it is block based and not exact.
|
|
8897
|
-
*
|
|
8898
|
-
* @param path - The path to the required file.
|
|
8899
9221
|
* @param force_update - To treat the code as inline. The main difference at the moment is that inline code doesn't include sourcemap.
|
|
8900
9222
|
*
|
|
8901
9223
|
* @returns An array representation of the children.
|
|
8902
9224
|
*/
|
|
8903
9225
|
function require(path, force_update)
|
|
8904
9226
|
{
|
|
8905
|
-
if(
|
|
9227
|
+
//if(Lilact.transpilerConfig.required[path]!==undefined && !force_update) return Lilact.transpilerConfig.required[path].module;
|
|
8906
9228
|
|
|
8907
9229
|
if(path[0]==='#') {
|
|
8908
9230
|
|
|
8909
|
-
const el = document.
|
|
9231
|
+
const el = document.getElementById(path);
|
|
8910
9232
|
|
|
8911
9233
|
if(el) {
|
|
8912
9234
|
return _lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"].run(el.innerText, path);
|
|
8913
9235
|
}
|
|
8914
9236
|
|
|
8915
9237
|
}
|
|
8916
|
-
else {
|
|
9238
|
+
else if(_lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"]?.[LAZY]) {
|
|
9239
|
+
_lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"][LAZY]=false;
|
|
8917
9240
|
|
|
9241
|
+
return fetch(path)
|
|
9242
|
+
.then(res => {
|
|
9243
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
9244
|
+
return res.text();
|
|
9245
|
+
})
|
|
9246
|
+
.then(res => {
|
|
9247
|
+
res = _lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"].run(res, path, false);
|
|
9248
|
+
// todo: this is for the lazy, so we detect default, should we do it in sync mode too?
|
|
9249
|
+
return res?.default ?? res;
|
|
9250
|
+
})
|
|
9251
|
+
.catch(err => {
|
|
9252
|
+
throw err;
|
|
9253
|
+
});
|
|
9254
|
+
}
|
|
9255
|
+
else {
|
|
8918
9256
|
// note: this makes a sync request. this is not advised,
|
|
8919
|
-
// but import should be sync. for an async solution use
|
|
9257
|
+
// but import should be sync. for an async solution use lazy and suspense.
|
|
8920
9258
|
|
|
8921
9259
|
const request = new XMLHttpRequest();
|
|
8922
9260
|
request.open("GET", path, false);
|
|
@@ -8931,6 +9269,48 @@ function require(path, force_update)
|
|
|
8931
9269
|
}
|
|
8932
9270
|
|
|
8933
9271
|
|
|
9272
|
+
/**
|
|
9273
|
+
* Wrapper that enables async, code-split component loading. `lazy` should be used
|
|
9274
|
+
* outside the component definintion or it will produce new components on each rerender.
|
|
9275
|
+
*
|
|
9276
|
+
* @param factory - A function with **no arguments** that returns a `Promise`.
|
|
9277
|
+
* The promise must resolve to a module whose module.exports.default is a Lilact component
|
|
9278
|
+
* or otherwise it will be whatever the module.exports is set to.
|
|
9279
|
+
*
|
|
9280
|
+
* @returns A Lilact component that should be rendered inside a {@link Suspense} boundary.
|
|
9281
|
+
*/
|
|
9282
|
+
function lazy(factory) {
|
|
9283
|
+
let status = "pending"; // pending | success | error
|
|
9284
|
+
let result; // component | error
|
|
9285
|
+
|
|
9286
|
+
_lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"][LAZY] = true;
|
|
9287
|
+
result = factory();
|
|
9288
|
+
|
|
9289
|
+
if(_lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"].isThenable(result)) {
|
|
9290
|
+
result.then(
|
|
9291
|
+
(mod) => {
|
|
9292
|
+
status = "success";
|
|
9293
|
+
result = mod;
|
|
9294
|
+
return result;
|
|
9295
|
+
},
|
|
9296
|
+
(err) => {
|
|
9297
|
+
status = "error";
|
|
9298
|
+
result = err;
|
|
9299
|
+
throw err;
|
|
9300
|
+
}
|
|
9301
|
+
);
|
|
9302
|
+
}
|
|
9303
|
+
|
|
9304
|
+
function LazyComponent(props) {
|
|
9305
|
+
if (status === "pending") throw result;
|
|
9306
|
+
if (status === "error") throw result;
|
|
9307
|
+
const Component = result;
|
|
9308
|
+
return _lilact_jsx__WEBPACK_IMPORTED_MODULE_0__["default"].createComponent( Component, { ...props } );
|
|
9309
|
+
}
|
|
9310
|
+
|
|
9311
|
+
return LazyComponent;
|
|
9312
|
+
}
|
|
9313
|
+
|
|
8934
9314
|
/**
|
|
8935
9315
|
* Debug tool to get the Lilact traced location of an error. It can also produce some block based stack trace
|
|
8936
9316
|
* if `Lilact.transpilerConfig.enableLabelStack` is set to `true` before loading the script. This is `false`
|
|
@@ -9000,21 +9380,16 @@ function traceError(err)
|
|
|
9000
9380
|
}
|
|
9001
9381
|
|
|
9002
9382
|
function scanScriptTagsWithType() {
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9383
|
+
const scripts = Array.from(
|
|
9384
|
+
document.querySelectorAll('script[type="text/jsx"]')
|
|
9385
|
+
);
|
|
9006
9386
|
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9387
|
+
return scripts.map((el) => ({
|
|
9388
|
+
src: el.getAttribute("src") ?? null,
|
|
9389
|
+
content: el.textContent ?? ""
|
|
9390
|
+
}));
|
|
9011
9391
|
}
|
|
9012
9392
|
|
|
9013
|
-
// usage (in browser):
|
|
9014
|
-
// const result = scanScriptTagsWithType();
|
|
9015
|
-
// console.log(result);
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
9393
|
/**
|
|
9019
9394
|
* Scans the whole documents and runs all the script elements with type `text/jsx`.
|
|
9020
9395
|
* It is automatically attached to document.onload when Lilact is loaded.
|
|
@@ -9335,10 +9710,10 @@ module.exports = ReactPropTypesSecret;
|
|
|
9335
9710
|
/******/ // startup
|
|
9336
9711
|
/******/ // Load entry module and return exports
|
|
9337
9712
|
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
9338
|
-
/******/ var __webpack_exports__ = __webpack_require__(
|
|
9713
|
+
/******/ var __webpack_exports__ = __webpack_require__(237);
|
|
9339
9714
|
/******/ const __webpack_exports__Lilact = __webpack_exports__.Lilact;
|
|
9340
9715
|
/******/ const __webpack_exports__default = __webpack_exports__["default"];
|
|
9341
9716
|
/******/ export { __webpack_exports__Lilact as Lilact, __webpack_exports__default as default };
|
|
9342
9717
|
/******/
|
|
9343
9718
|
|
|
9344
|
-
//# sourceMappingURL=lilact.development.js.map
|
|
9719
|
+
//# sourceMappingURL=lilact.development.min.js.map
|