lilact 0.10.2 → 0.11.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/README.md +2 -1
- package/dist/lilact.development.js +165 -21
- package/dist/lilact.development.js.map +1 -1
- package/dist/lilact.development.min.js +1 -1
- package/dist/lilact.development.min.js.map +1 -1
- 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/functions/misc.deepEqual.html +1 -1
- package/docs/functions/misc.isAsync.html +1 -1
- package/docs/functions/misc.isClass.html +1 -1
- package/docs/functions/misc.isEmpty.html +1 -1
- package/docs/functions/misc.isError.html +1 -1
- package/docs/functions/misc.isThenable.html +1 -1
- package/docs/functions/misc.shallowEqual.html +1 -1
- package/docs/functions/misc.toBool.html +1 -1
- package/docs/functions/transition.CSSTransition.html +3 -3
- package/docs/functions/transition.SwitchTransition.html +22 -0
- package/docs/functions/transition.TransitionGroup.html +1 -1
- package/docs/index.html +2 -1
- package/docs/modules/misc.html +1 -1
- package/docs/modules/transition.html +1 -1
- package/docs/static/demos/switch-transition.jsx +38 -34
- package/docs/static/demos/transition.jsx +1 -1
- package/docs/static/index.html +6 -5
- package/docs/static/lilact.development.js +165 -21
- package/docs/static/lilact.development.min.js +1 -1
- package/docs/static/lilact.production.min.js +1 -1
- package/package.json +7 -3
- package/root/demos/switch-transition.jsx +38 -34
- package/root/demos/transition.jsx +1 -1
- package/root/index.html +6 -5
- package/root/lilact.development.js +165 -21
- package/root/lilact.development.min.js +1 -1
- package/root/lilact.production.min.js +1 -1
- package/src/lilact.jsx +1 -1
- package/src/misc.jsx +0 -13
- package/src/transition.jsx +180 -4
- package/docs/functions/misc.classNames.html +0 -3
|
@@ -1,50 +1,54 @@
|
|
|
1
1
|
const { useState, SwitchTransition } = Lilact;
|
|
2
2
|
|
|
3
3
|
Lilact.emotion.injectGlobal(`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.fadeSlide-exit-active { opacity: 0; transform: translateY(-6px); transition: opacity 300ms ease, transform 300ms ease; }
|
|
20
|
-
|
|
21
|
-
.on { background: #e8fff0; color: #0a7a2f; border-color: #a6efbb; }
|
|
22
|
-
.off { background: #fff1f1; color: #8a1f1f; border-color: #ffd0d0; }
|
|
4
|
+
.switch-enter,
|
|
5
|
+
.switch-exit {
|
|
6
|
+
opacity: 0;
|
|
7
|
+
transform: translateY(-10px) scale(0.98);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.switch-enter-active,
|
|
11
|
+
.switch-exit-active {
|
|
12
|
+
transition: opacity 300ms ease, transform 300ms ease;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.switch-enter-active, .switch-enter-done {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
transform: translateY(0) scale(1);
|
|
18
|
+
}
|
|
23
19
|
|
|
20
|
+
.switch-exit-active, .switch-exit-done {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transform: translateY(10px) scale(0.99);
|
|
23
|
+
}
|
|
24
24
|
`);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
function Demo() {
|
|
27
28
|
const [on, setOn] = useState(false);
|
|
28
29
|
|
|
29
30
|
return (
|
|
30
|
-
<div
|
|
31
|
-
<button
|
|
32
|
-
onClick={() => setOn((v) => !v)}
|
|
33
|
-
style={{ cursor: "pointer", marginBottom: 12 }}
|
|
34
|
-
>
|
|
31
|
+
<div>
|
|
32
|
+
<button onClick={()=>setOn(v => !v) }>
|
|
35
33
|
Toggle
|
|
36
34
|
</button>
|
|
37
35
|
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
<div style={{ position: "relative", height: 80 }}>
|
|
37
|
+
<SwitchTransition
|
|
38
|
+
activeKey={on ? "on" : "off"}
|
|
39
|
+
mode="out-in"
|
|
40
|
+
timeout={300}
|
|
41
|
+
>
|
|
42
|
+
<div key="off" style={{ padding: 12, background: "#fee", borderRadius: 5 }}>
|
|
43
|
+
OFF panel (state preserved)
|
|
45
44
|
</div>
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
<div key="on" style={{ padding: 12, background: "#eef", borderRadius: 5 }}>
|
|
46
|
+
ON panel (state preserved)
|
|
47
|
+
</div>
|
|
48
|
+
</SwitchTransition>
|
|
49
|
+
</div>
|
|
48
50
|
</div>
|
|
49
51
|
);
|
|
50
52
|
}
|
|
53
|
+
|
|
54
|
+
module.exports = Demo;
|
|
@@ -9,7 +9,7 @@ function Demo() {
|
|
|
9
9
|
|
|
10
10
|
return <>
|
|
11
11
|
<p>This example doesn't actually change the visibility, but emits the events and
|
|
12
|
-
|
|
12
|
+
updates a text according the transition state. See the console for logs.</p>
|
|
13
13
|
<div>
|
|
14
14
|
<button onClick={toggleVisibility}>
|
|
15
15
|
{inProp ? 'Hide Component' : 'Show Component'}
|
package/root/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
|
|
7
|
-
<title>Lilact
|
|
7
|
+
<title>Lilact Examples</title>
|
|
8
8
|
<script src='./lilact.development.min.js' type="module"></script>
|
|
9
9
|
|
|
10
10
|
<script src="prismjs/prism.min.js"></script>
|
|
@@ -72,7 +72,7 @@ injectGlobal({
|
|
|
72
72
|
overflowWrap: "anywhere"
|
|
73
73
|
},
|
|
74
74
|
p: {padding: "10px"},
|
|
75
|
-
body: { padding: "20px", background: "#
|
|
75
|
+
body: { padding: "20px", background: "#1a2d2c", color: "#e7e7e7" },
|
|
76
76
|
":visited": {color: "#c16480"},
|
|
77
77
|
|
|
78
78
|
});
|
|
@@ -95,7 +95,7 @@ const collapsible = css({
|
|
|
95
95
|
padding: "10px",
|
|
96
96
|
borderRadius: "10px",
|
|
97
97
|
border: "none",
|
|
98
|
-
margin: "4px",
|
|
98
|
+
margin: "3px 4px",
|
|
99
99
|
background:"#ece9ea",
|
|
100
100
|
color: "#222",
|
|
101
101
|
":hover": {
|
|
@@ -141,7 +141,7 @@ const pane = css({ flex: "1 1 0",
|
|
|
141
141
|
|
|
142
142
|
const left = css({ float: "left" });
|
|
143
143
|
const right = css({ float: "right" });
|
|
144
|
-
const demobox = css({ background: "#fff3", borderRadius: "
|
|
144
|
+
const demobox = css({ background: "#fff3", borderRadius: "15px", padding: "4px 2px", margin: "4px"});
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
@@ -217,6 +217,7 @@ function App()
|
|
|
217
217
|
['modal.jsx', '( useEffect, useRef, useState )'],
|
|
218
218
|
['pane.jsx', '( useRef, useState, ResizablePane )'],
|
|
219
219
|
['css-transition.jsx', '( CSSTransition, useState, useRef )'],
|
|
220
|
+
['switch-transition.jsx', '( SwitchTransition )'],
|
|
220
221
|
['suspense.jsx', '( Suspense, Spinner )'],
|
|
221
222
|
['form-elements.jsx', '()'],
|
|
222
223
|
"Error Report and Handling",
|
|
@@ -230,7 +231,7 @@ function App()
|
|
|
230
231
|
return<>
|
|
231
232
|
<center>
|
|
232
233
|
<img src="icon.png" width="128"/><br/>
|
|
233
|
-
<h1>Lilact
|
|
234
|
+
<h1>Lilact Examples</h1>
|
|
234
235
|
|
|
235
236
|
<p>These scripts are transpiled and run directly in your browser. You have already loaded Lilact completely!</p>
|
|
236
237
|
|
|
@@ -1404,13 +1404,13 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1404
1404
|
Routes: () => (/* reexport */ Routes),
|
|
1405
1405
|
Spinner: () => (/* reexport */ Spinner),
|
|
1406
1406
|
Suspense: () => (/* reexport */ Suspense),
|
|
1407
|
+
SwitchTransition: () => (/* reexport */ SwitchTransition),
|
|
1407
1408
|
Transition: () => (/* reexport */ Transition),
|
|
1408
1409
|
TransitionGroup: () => (/* reexport */ TransitionGroup),
|
|
1409
1410
|
addWrappedEventListener: () => (/* reexport */ addWrappedEventListener),
|
|
1410
1411
|
animationFramePromise: () => (/* reexport */ animationFramePromise),
|
|
1411
1412
|
blocks_info: () => (/* reexport */ blocks_info),
|
|
1412
1413
|
boolean_html_attributes_set: () => (/* reexport */ boolean_html_attributes_set),
|
|
1413
|
-
classNames: () => (/* reexport */ classNames),
|
|
1414
1414
|
clearInterval: () => (/* reexport */ timers_clearInterval),
|
|
1415
1415
|
clearTimeout: () => (/* reexport */ timers_clearTimeout),
|
|
1416
1416
|
combineReducers: () => (/* reexport */ redux_combineReducers),
|
|
@@ -1531,7 +1531,6 @@ __webpack_require__.d(misc_namespaceObject, {
|
|
|
1531
1531
|
Children: () => (Children),
|
|
1532
1532
|
Fragment: () => (misc_Fragment),
|
|
1533
1533
|
boolean_html_attributes_set: () => (boolean_html_attributes_set),
|
|
1534
|
-
classNames: () => (classNames),
|
|
1535
1534
|
current_component: () => (current_component),
|
|
1536
1535
|
deepEqual: () => (deepEqual),
|
|
1537
1536
|
eval_num: () => (eval_num),
|
|
@@ -1616,6 +1615,7 @@ var transition_namespaceObject = {};
|
|
|
1616
1615
|
__webpack_require__.r(transition_namespaceObject);
|
|
1617
1616
|
__webpack_require__.d(transition_namespaceObject, {
|
|
1618
1617
|
CSSTransition: () => (CSSTransition),
|
|
1618
|
+
SwitchTransition: () => (SwitchTransition),
|
|
1619
1619
|
Transition: () => (Transition),
|
|
1620
1620
|
TransitionGroup: () => (TransitionGroup)
|
|
1621
1621
|
});
|
|
@@ -4557,19 +4557,6 @@ function getComponentByPointer()
|
|
|
4557
4557
|
}
|
|
4558
4558
|
|
|
4559
4559
|
|
|
4560
|
-
/**
|
|
4561
|
-
* Utility for applying one or more class names to an element.
|
|
4562
|
-
*
|
|
4563
|
-
* @param classes - One or more class name values to combine.
|
|
4564
|
-
*/
|
|
4565
|
-
function classNames(classes) {
|
|
4566
|
-
return Object.entries(classes)
|
|
4567
|
-
.filter(([key, value]) => value)
|
|
4568
|
-
.map(([key, value]) => key)
|
|
4569
|
-
.join(' ');
|
|
4570
|
-
}
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
4560
|
/**
|
|
4574
4561
|
* Checks whether a collection/set/array is empty.
|
|
4575
4562
|
*
|
|
@@ -4779,7 +4766,7 @@ const boolean_html_attributes_set = new
|
|
|
4779
4766
|
"hidden","open","loop","muted","controls","playsInline","allowFullScreen"]);
|
|
4780
4767
|
|
|
4781
4768
|
|
|
4782
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
4769
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2FyYXNoL0Rlc2t0b3AvUHJvamVjdHMvTGlsYWN0L3NyYy9taXNjLmpzeCIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi9Vc2Vycy9hcmFzaC9EZXNrdG9wL1Byb2plY3RzL0xpbGFjdC9zcmMvbWlzYy5qc3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBaUNDOzs7Z0JBR2UsV0FBVztFQUN6QjtFQUNBOztrREFFZ0QsbUJBQW1CO3NCQUMvQzsrQkFDUzs7Ozs7O0NBTTlCOztDQUVBOzs7Ozs7K0JBTThCLFdBQVc7Ozs7Q0FJekM7Ozs7Ozs0QkFNMkIsYUFBYTs7RUFFdkM7Ozs7Ozs7Ozs7OztJQVlFLHVEQUF1RDs7OztDQUkxRDs7Ozs7a0NBS2tDLEFBQUQsYUFBYTs7O0NBRzlDOzs7Ozs7Ozt5QkFRd0I7O0NBRXhCOzs7Ozs7TUFNSyxXQUFX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7Ozs7O3dCQU11QixRQUFROzs7O0NBSS9COzs7Ozs7MkJBTTBCLFFBQVE7a0JBQ2pCOzs7Q0FHakI7Ozs7Ozt3QkFNdUIsUUFBUTtpRUFDaUM7OztDQUdoRTs7Ozs7O3VCQU1zQixRQUFRO0tBQzFCOztLQUVBOztLQUVBLDRCQUE0QjtxQkFDWixjQUFjO01BQzdCO01BQ0E7OztnQkFHVTs7OztDQUlmOztDQUVBO2lDQUNnQzs7Q0FFaEM7O0NBRUE7O0NBRUE7K0JBQzhCLFdBQVk7Q0FDMUM7eUJBQ3dCOzs7Q0FHeEI7Q0FDQTs7Q0FFQTs7Q0FFQTs7Q0FFQTs7Q0FFQTs7O0NBR0E7MENBQ3lDOzs7OztDQUt6QztrQ0FDaUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FtQmpDO2lEQUNnRDs7Ozs7Ozs7O0NBU2hEOztLQUVJIn0=
|
|
4783
4770
|
;// ./src/components.jsx
|
|
4784
4771
|
/*
|
|
4785
4772
|
|
|
@@ -6899,7 +6886,7 @@ function Transition({
|
|
|
6899
6886
|
*/
|
|
6900
6887
|
function CSSTransition({
|
|
6901
6888
|
in: inProp,
|
|
6902
|
-
timeout = defaultTransitionTimeout,
|
|
6889
|
+
timeout = Lilact.defaultTransitionTimeout,
|
|
6903
6890
|
classNames = "fade",
|
|
6904
6891
|
mountOnEnter = false,
|
|
6905
6892
|
unmountOnExit = false,
|
|
@@ -6928,6 +6915,163 @@ function CSSTransition({
|
|
|
6928
6915
|
}
|
|
6929
6916
|
|
|
6930
6917
|
|
|
6918
|
+
|
|
6919
|
+
/**
|
|
6920
|
+
* Switches between keyed children with `CSSTransition`.
|
|
6921
|
+
* Ensures each child key gets its own `CSSTransition` instance to avoid state loss.
|
|
6922
|
+
*
|
|
6923
|
+
* @param {object} props
|
|
6924
|
+
* @param {Array} props.children
|
|
6925
|
+
* The set of children to switch between. Each child should have a stable `key`
|
|
6926
|
+
* (or your `key` will fall back to its index).
|
|
6927
|
+
* @param {*} props.activeKey
|
|
6928
|
+
* The key of the currently active child.
|
|
6929
|
+
* @param {"out-in" | "in-out"} [props.mode="out-in"]
|
|
6930
|
+
* Controls sequencing when `activeKey` changes:
|
|
6931
|
+
* - `"out-in"`: outgoing transitions out first, incoming transitions in after exit completes.
|
|
6932
|
+
* - `"in-out"`: incoming transitions in first, outgoing transitions out after the incoming finishes entering
|
|
6933
|
+
* (relies on `onEntered`).
|
|
6934
|
+
* @param {number} [props.timeout=Lilact.defaultTransitionTimeout]
|
|
6935
|
+
* Transition timeout passed to each `CSSTransition`.
|
|
6936
|
+
* @param {string} [props.classNames="switch"]
|
|
6937
|
+
* Base className(s) used by `CSSTransition` to apply enter/exit classes.
|
|
6938
|
+
* @param {boolean} [props.mountOnEnter=false]
|
|
6939
|
+
* Whether to mount the transitioning child only when it begins entering.
|
|
6940
|
+
* @param {boolean} [props.unmountOnExit=false]
|
|
6941
|
+
* Whether to unmount the child after it finishes exiting.
|
|
6942
|
+
* @param {boolean} [props.appear=false]
|
|
6943
|
+
* Whether to run the initial transition on first mount.
|
|
6944
|
+
*
|
|
6945
|
+
* @param {(isAppearing: boolean) => void} [props.onExited]
|
|
6946
|
+
* Called when the outgoing child finishes exiting.
|
|
6947
|
+
* @param {(isAppearing: boolean) => void} [props.onEnter]
|
|
6948
|
+
* Called when a child begins entering.
|
|
6949
|
+
* @param {(isAppearing: boolean) => void} [props.onExiting]
|
|
6950
|
+
* Called when a child begins exiting.
|
|
6951
|
+
* @param {(isAppearing: boolean) => void} [props.onEntered]
|
|
6952
|
+
* Called when a child finishes entering. Used to implement `"in-out"` sequencing.
|
|
6953
|
+
*
|
|
6954
|
+
* @param {object} [props.csstProps]
|
|
6955
|
+
* Any additional props are forwarded to each `CSSTransition` instance.
|
|
6956
|
+
*/
|
|
6957
|
+
|
|
6958
|
+
|
|
6959
|
+
function SwitchTransition({
|
|
6960
|
+
children,
|
|
6961
|
+
activeKey,
|
|
6962
|
+
mode = "out-in", // "out-in" | "in-out"
|
|
6963
|
+
|
|
6964
|
+
timeout = Lilact.defaultTransitionTimeout,
|
|
6965
|
+
classNames = "switch",
|
|
6966
|
+
|
|
6967
|
+
mountOnEnter = false,
|
|
6968
|
+
unmountOnExit = false,
|
|
6969
|
+
appear = false,
|
|
6970
|
+
|
|
6971
|
+
// callbacks (optional)
|
|
6972
|
+
onExited,
|
|
6973
|
+
onEnter,
|
|
6974
|
+
onExiting,
|
|
6975
|
+
onEntered,
|
|
6976
|
+
|
|
6977
|
+
...csstProps
|
|
6978
|
+
}) {
|
|
6979
|
+
const childArray = useMemo(() => Children.toArray(children), [children]);
|
|
6980
|
+
|
|
6981
|
+
// Outgoing key (the one that should exit) and phase flags
|
|
6982
|
+
const [exitingKey, setExitingKey] = useState(null);
|
|
6983
|
+
const [exitStarted, setExitStarted] = useState(false);
|
|
6984
|
+
|
|
6985
|
+
// Controls whether the incoming (activeKey) is currently "in"
|
|
6986
|
+
const [enterAllowed, setEnterAllowed] = useState(true);
|
|
6987
|
+
|
|
6988
|
+
// Refs to avoid stale closures in callbacks
|
|
6989
|
+
const prevKeyRef = useRef(activeKey);
|
|
6990
|
+
const activeKeyRef = useRef(activeKey);
|
|
6991
|
+
const exitingKeyRef = useRef(exitingKey);
|
|
6992
|
+
|
|
6993
|
+
useLayoutEffect(() => {
|
|
6994
|
+
activeKeyRef.current = activeKey;
|
|
6995
|
+
}, [activeKey]);
|
|
6996
|
+
|
|
6997
|
+
useLayoutEffect(() => {
|
|
6998
|
+
exitingKeyRef.current = exitingKey;
|
|
6999
|
+
}, [exitingKey]);
|
|
7000
|
+
|
|
7001
|
+
useLayoutEffect(() => {
|
|
7002
|
+
const prevKey = prevKeyRef.current;
|
|
7003
|
+
if (prevKey === activeKey) return;
|
|
7004
|
+
|
|
7005
|
+
prevKeyRef.current = activeKey;
|
|
7006
|
+
|
|
7007
|
+
// Start a new switch
|
|
7008
|
+
setExitingKey(prevKey);
|
|
7009
|
+
|
|
7010
|
+
if (mode === "out-in") {
|
|
7011
|
+
// Incoming blocked; outgoing should exit immediately.
|
|
7012
|
+
setEnterAllowed(false);
|
|
7013
|
+
setExitStarted(true); // outgoing in: true -> false => triggers exit
|
|
7014
|
+
} else {
|
|
7015
|
+
// Incoming allowed immediately; outgoing should exit only after incoming has entered.
|
|
7016
|
+
setEnterAllowed(true);
|
|
7017
|
+
setExitStarted(false); // outgoing stays in:true until we flip it later
|
|
7018
|
+
}
|
|
7019
|
+
}, [activeKey, mode]);
|
|
7020
|
+
|
|
7021
|
+
const handleExited = (key) => (node, isAppearing) => {
|
|
7022
|
+
if (typeof onExited === "function") onExited(node, isAppearing);
|
|
7023
|
+
|
|
7024
|
+
if (key === exitingKeyRef.current) {
|
|
7025
|
+
setExitingKey(null);
|
|
7026
|
+
|
|
7027
|
+
// out-in: once outgoing is fully exited, allow incoming to start
|
|
7028
|
+
if (mode === "out-in") {
|
|
7029
|
+
setExitStarted(false);
|
|
7030
|
+
setEnterAllowed(true);
|
|
7031
|
+
}
|
|
7032
|
+
// in-out: incoming already entered; just clean up outgoing
|
|
7033
|
+
if (mode === "in-out") {
|
|
7034
|
+
setExitStarted(false);
|
|
7035
|
+
}
|
|
7036
|
+
}
|
|
7037
|
+
};
|
|
7038
|
+
|
|
7039
|
+
const handleEntered = (key) => (node, isAppearing) => {
|
|
7040
|
+
if (typeof onEntered === "function") onEntered(node, isAppearing);
|
|
7041
|
+
|
|
7042
|
+
if (mode === "in-out") {
|
|
7043
|
+
// Only start outgoing exit when the CURRENT incoming (activeKey) finishes entering.
|
|
7044
|
+
if (key === activeKeyRef.current && exitingKeyRef.current != null) {
|
|
7045
|
+
setExitStarted(true); // outgoing in:true -> false => triggers exit
|
|
7046
|
+
}
|
|
7047
|
+
}
|
|
7048
|
+
};
|
|
7049
|
+
|
|
7050
|
+
return (
|
|
7051
|
+
createComponent( "div", { "style": { position: "relative" } }, childArray.map((child, index) => {
|
|
7052
|
+
const key = child?.props?.key || index;
|
|
7053
|
+
|
|
7054
|
+
const isIncoming = key === activeKey;
|
|
7055
|
+
const isOutgoing = key === exitingKey;
|
|
7056
|
+
|
|
7057
|
+
// Core rule:
|
|
7058
|
+
// - Incoming: in = enterAllowed
|
|
7059
|
+
// - Outgoing: in = !exitStarted
|
|
7060
|
+
// - Others: in = false
|
|
7061
|
+
const inProp = isIncoming
|
|
7062
|
+
? enterAllowed
|
|
7063
|
+
: isOutgoing
|
|
7064
|
+
? !exitStarted
|
|
7065
|
+
: false;
|
|
7066
|
+
|
|
7067
|
+
return (
|
|
7068
|
+
createComponent( CSSTransition, { ...csstProps, "key": key, "in": inProp, "timeout": timeout, "classNames": classNames, "mountOnEnter": mountOnEnter, "unmountOnExit": unmountOnExit, "appear": appear, "onEnter": onEnter, "onExiting": onExiting, "onEntered": handleEntered(key), "onExited": handleExited(key) }, createComponent( "div", { "style": { position: "absolute", inset: 0 } }, child ) )
|
|
7069
|
+
);
|
|
7070
|
+
}) )
|
|
7071
|
+
);
|
|
7072
|
+
}
|
|
7073
|
+
|
|
7074
|
+
|
|
6931
7075
|
/**
|
|
6932
7076
|
* Lilact doesn't need TransitionGroup, so it is the same as a fragment.
|
|
6933
7077
|
* In Lilact all the transitions and timeouts are automatically grouped.
|
|
@@ -6940,7 +7084,7 @@ function TransitionGroup({ children }) {
|
|
|
6940
7084
|
}
|
|
6941
7085
|
|
|
6942
7086
|
|
|
6943
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
7087
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2FyYXNoL0Rlc2t0b3AvUHJvamVjdHMvTGlsYWN0L3NyYy90cmFuc2l0aW9uLmpzeCIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi9Vc2Vycy9hcmFzaC9EZXNrdG9wL1Byb2plY3RzL0xpbGFjdC9zcmMvdHJhbnNpdGlvbi5qc3giXSwibmFtZXMiOltdLCJtYXBwaW5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
8823
|
// Configuration
|
|
8680
8824
|
|
|
@@ -10289,13 +10433,13 @@ module.exports = ReactPropTypesSecret;
|
|
|
10289
10433
|
/******/ const __webpack_exports__Routes = __webpack_exports__.Routes;
|
|
10290
10434
|
/******/ const __webpack_exports__Spinner = __webpack_exports__.Spinner;
|
|
10291
10435
|
/******/ const __webpack_exports__Suspense = __webpack_exports__.Suspense;
|
|
10436
|
+
/******/ const __webpack_exports__SwitchTransition = __webpack_exports__.SwitchTransition;
|
|
10292
10437
|
/******/ const __webpack_exports__Transition = __webpack_exports__.Transition;
|
|
10293
10438
|
/******/ const __webpack_exports__TransitionGroup = __webpack_exports__.TransitionGroup;
|
|
10294
10439
|
/******/ const __webpack_exports__addWrappedEventListener = __webpack_exports__.addWrappedEventListener;
|
|
10295
10440
|
/******/ const __webpack_exports__animationFramePromise = __webpack_exports__.animationFramePromise;
|
|
10296
10441
|
/******/ const __webpack_exports__blocks_info = __webpack_exports__.blocks_info;
|
|
10297
10442
|
/******/ const __webpack_exports__boolean_html_attributes_set = __webpack_exports__.boolean_html_attributes_set;
|
|
10298
|
-
/******/ const __webpack_exports__classNames = __webpack_exports__.classNames;
|
|
10299
10443
|
/******/ const __webpack_exports__clearInterval = __webpack_exports__.clearInterval;
|
|
10300
10444
|
/******/ const __webpack_exports__clearTimeout = __webpack_exports__.clearTimeout;
|
|
10301
10445
|
/******/ const __webpack_exports__combineReducers = __webpack_exports__.combineReducers;
|
|
@@ -10374,7 +10518,7 @@ module.exports = ReactPropTypesSecret;
|
|
|
10374
10518
|
/******/ const __webpack_exports__useStore = __webpack_exports__.useStore;
|
|
10375
10519
|
/******/ const __webpack_exports__useTransition = __webpack_exports__.useTransition;
|
|
10376
10520
|
/******/ const __webpack_exports__wrapListener = __webpack_exports__.wrapListener;
|
|
10377
|
-
/******/ export { __webpack_exports__CSSTransition as CSSTransition, __webpack_exports__Children as Children, __webpack_exports__Component as Component, __webpack_exports__ErrorBoundary as ErrorBoundary, __webpack_exports__Fragment as Fragment, __webpack_exports__HTMLComponent as HTMLComponent, __webpack_exports__HashRouter as HashRouter, __webpack_exports__Lilact as Lilact, __webpack_exports__Link as Link, __webpack_exports__NavLink as NavLink, __webpack_exports__PropTypes as PropTypes, __webpack_exports__Provider as Provider, __webpack_exports__ResizablePane as ResizablePane, __webpack_exports__RootComponent as RootComponent, __webpack_exports__Route as Route, __webpack_exports__Routes as Routes, __webpack_exports__Spinner as Spinner, __webpack_exports__Suspense as Suspense, __webpack_exports__Transition as Transition, __webpack_exports__TransitionGroup as TransitionGroup, __webpack_exports__addWrappedEventListener as addWrappedEventListener, __webpack_exports__animationFramePromise as animationFramePromise, __webpack_exports__blocks_info as blocks_info, __webpack_exports__boolean_html_attributes_set as boolean_html_attributes_set,
|
|
10521
|
+
/******/ export { __webpack_exports__CSSTransition as CSSTransition, __webpack_exports__Children as Children, __webpack_exports__Component as Component, __webpack_exports__ErrorBoundary as ErrorBoundary, __webpack_exports__Fragment as Fragment, __webpack_exports__HTMLComponent as HTMLComponent, __webpack_exports__HashRouter as HashRouter, __webpack_exports__Lilact as Lilact, __webpack_exports__Link as Link, __webpack_exports__NavLink as NavLink, __webpack_exports__PropTypes as PropTypes, __webpack_exports__Provider as Provider, __webpack_exports__ResizablePane as ResizablePane, __webpack_exports__RootComponent as RootComponent, __webpack_exports__Route as Route, __webpack_exports__Routes as Routes, __webpack_exports__Spinner as Spinner, __webpack_exports__Suspense as Suspense, __webpack_exports__SwitchTransition as SwitchTransition, __webpack_exports__Transition as Transition, __webpack_exports__TransitionGroup as TransitionGroup, __webpack_exports__addWrappedEventListener as addWrappedEventListener, __webpack_exports__animationFramePromise as animationFramePromise, __webpack_exports__blocks_info as blocks_info, __webpack_exports__boolean_html_attributes_set as boolean_html_attributes_set, __webpack_exports__clearInterval as clearInterval, __webpack_exports__clearTimeout as clearTimeout, __webpack_exports__combineReducers as combineReducers, __webpack_exports__connect as connect, __webpack_exports__createComponent as createComponent, __webpack_exports__createContext as createContext, __webpack_exports__createElement as createElement, __webpack_exports__createRoot as createRoot, __webpack_exports__createSyntheticEvent as createSyntheticEvent, __webpack_exports__current_component as current_component, __webpack_exports__deepEqual as deepEqual, __webpack_exports__default as default, __webpack_exports__emotion as emotion, __webpack_exports__error as error, __webpack_exports__eval_num as eval_num, __webpack_exports__events_set as events_set, __webpack_exports__findDOMNode as findDOMNode, __webpack_exports__forwardRef as forwardRef, __webpack_exports__getComponentByPointer as getComponentByPointer, __webpack_exports__globalErrorHandler as globalErrorHandler, __webpack_exports__grabTimers as grabTimers, __webpack_exports__id_num as id_num, __webpack_exports__isAsync as isAsync, __webpack_exports__isClass as isClass, __webpack_exports__isEmpty as isEmpty, __webpack_exports__isError as isError, __webpack_exports__isThenable as isThenable, __webpack_exports__isValidElement as isValidElement, __webpack_exports__layout_effects as layout_effects, __webpack_exports__lazy as lazy, __webpack_exports__length_css_attributes_set as length_css_attributes_set, __webpack_exports__pauseTimers as pauseTimers, __webpack_exports__redux as redux, __webpack_exports__releaseSyntheticEvent as releaseSyntheticEvent, __webpack_exports__releaseTimers as releaseTimers, __webpack_exports__render as render, __webpack_exports__require as require, __webpack_exports__required_scripts as required_scripts, __webpack_exports__resetTimers as resetTimers, __webpack_exports__resumeTimers as resumeTimers, __webpack_exports__roots as roots, __webpack_exports__run as run, __webpack_exports__runScripts as runScripts, __webpack_exports__scanBlockLabels as scanBlockLabels, __webpack_exports__setInterval as setInterval, __webpack_exports__setTimeout as setTimeout, __webpack_exports__shallowEqual as shallowEqual, __webpack_exports__special_attributes as special_attributes, __webpack_exports__timeoutPromise as timeoutPromise, __webpack_exports__toBool as toBool, __webpack_exports__traceError as traceError, __webpack_exports__transpileJSX as transpileJSX, __webpack_exports__transpilerConfig as transpilerConfig, __webpack_exports__update_cbs as update_cbs, __webpack_exports__update_interval_margin as update_interval_margin, __webpack_exports__update_set as update_set, __webpack_exports__update_timeout as update_timeout, __webpack_exports__useActionState as useActionState, __webpack_exports__useCallback as useCallback, __webpack_exports__useContext as useContext, __webpack_exports__useDeferredValue as useDeferredValue, __webpack_exports__useDispatch as useDispatch, __webpack_exports__useEffect as useEffect, __webpack_exports__useHook as useHook, __webpack_exports__useId as useId, __webpack_exports__useImperativeHandle as useImperativeHandle, __webpack_exports__useLayoutEffect as useLayoutEffect, __webpack_exports__useLocalStorage as useLocalStorage, __webpack_exports__useLocation as useLocation, __webpack_exports__useMemo as useMemo, __webpack_exports__useNavigate as useNavigate, __webpack_exports__useReducer as useReducer, __webpack_exports__useRef as useRef, __webpack_exports__useSelector as useSelector, __webpack_exports__useState as useState, __webpack_exports__useStore as useStore, __webpack_exports__useTransition as useTransition, __webpack_exports__wrapListener as wrapListener };
|
|
10378
10522
|
/******/
|
|
10379
10523
|
|
|
10380
10524
|
//# sourceMappingURL=lilact.development.js.map
|