lilact 0.1.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 +9 -0
- package/dist/lilact.development.min.js +9657 -2
- 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/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 -15
- 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 +5 -0
- package/docs/modules/hooks.html +1 -1
- package/docs/modules/jsx.html +1 -1
- package/docs/modules/transition.html +1 -1
- package/docs/static/demos/actionstate.jsx +4 -6
- package/docs/static/demos/context.jsx +1 -3
- package/docs/static/demos/lazy.jsx +5 -7
- package/docs/static/demos/modal.jsx +13 -15
- package/docs/static/demos/proptypes.jsx +5 -8
- package/docs/static/demos/reducer.jsx +21 -23
- package/docs/static/demos/suspense.jsx +4 -6
- package/docs/static/demos/transition.jsx +25 -25
- package/docs/static/demos/usetransition.jsx +1 -3
- package/docs/static/lilact.development.min.js +9657 -2
- package/docs/static/lilact.production.min.js +1 -1
- package/package.json +2 -1
- package/root/demos/actionstate.jsx +4 -6
- package/root/demos/context.jsx +1 -3
- package/root/demos/lazy.jsx +5 -7
- package/root/demos/modal.jsx +13 -15
- package/root/demos/proptypes.jsx +5 -8
- package/root/demos/reducer.jsx +21 -23
- package/root/demos/suspense.jsx +4 -6
- package/root/demos/transition.jsx +25 -25
- package/root/demos/usetransition.jsx +1 -3
- package/root/lilact.development.min.js +9657 -2
- package/root/lilact.production.min.js +1 -1
- package/src/accessories.jsx +12 -11
- package/src/components.jsx +9 -4
- 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 +3 -17
- package/src/transition.jsx +32 -21
- package/webpack.config.js +1 -1
- package/docs/classes/transition.Transition.html +0 -31
- package/docs/variables/jsx.transpilerConfig.html +0 -1
package/src/lilact.jsx
CHANGED
|
@@ -47,6 +47,7 @@ import * as misc from './misc.jsx';
|
|
|
47
47
|
|
|
48
48
|
import * as router from './router.jsx';
|
|
49
49
|
import * as accessories from './accessories.jsx';
|
|
50
|
+
import {ResizablePane} from './pane.jsx';
|
|
50
51
|
|
|
51
52
|
import {transpileJSX, transpilerConfig} from "./jsx";
|
|
52
53
|
|
|
@@ -61,7 +62,7 @@ import {transpileJSX, transpilerConfig} from "./jsx";
|
|
|
61
62
|
* @property emotion - Handle to Emotion’s CSS-in-JS package for styling (https://github.com/emotion-js/emotion).
|
|
62
63
|
*/
|
|
63
64
|
export const Lilact =
|
|
64
|
-
{
|
|
65
|
+
{
|
|
65
66
|
|
|
66
67
|
VERSION: "beta.0",
|
|
67
68
|
|
|
@@ -86,27 +87,24 @@ export const Lilact =
|
|
|
86
87
|
...router,
|
|
87
88
|
...accessories,
|
|
88
89
|
|
|
90
|
+
ResizablePane,
|
|
91
|
+
|
|
89
92
|
transpileJSX,
|
|
90
93
|
transpilerConfig,
|
|
91
94
|
|
|
92
95
|
// Dependencies ()
|
|
93
96
|
|
|
94
97
|
PropTypes,
|
|
98
|
+
//redux: {...redux, createSlice, createAsyncThunk},
|
|
95
99
|
redux,
|
|
96
100
|
emotion,
|
|
97
101
|
|
|
98
102
|
}
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
// or, if you prefer DOMContentLoaded:
|
|
102
104
|
document.addEventListener('DOMContentLoaded', () => {
|
|
103
105
|
Lilact.runScripts();
|
|
104
106
|
});
|
|
105
107
|
|
|
106
|
-
function yourFunctionHere() {
|
|
107
|
-
// ...
|
|
108
|
-
}
|
|
109
|
-
|
|
110
108
|
ʔ if(DEBUG) {
|
|
111
109
|
console.log(`Lilact (Version: ${Lilact.VERSION}) - Debug Mode`);
|
|
112
110
|
console.log(`Copyright(C) 2024-2026 Arash Kazemi <contact.arash.kazemi@gmail.com>`);
|
package/src/pane.jsx
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState, forwardRef, useImperativeHandle } from "./hooks.jsx";
|
|
2
|
+
import { Children } from "./misc.jsx";
|
|
3
|
+
|
|
4
|
+
function clamp(n, min, max) {
|
|
5
|
+
return Math.max(min, Math.min(max, n));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ResizablePane
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Supports "horizontal" (left/top size affects width) and "vertical" (affects height)
|
|
13
|
+
* - Initial position via props.position
|
|
14
|
+
* - Methods to set mode and position via ref:
|
|
15
|
+
* ref.current.setMode(mode)
|
|
16
|
+
* ref.current.setPosition(position)
|
|
17
|
+
* - Callback when size changes via onSizeChange
|
|
18
|
+
* - Children are rendered in two separate containers (no portals)
|
|
19
|
+
*/
|
|
20
|
+
export const ResizablePane = forwardRef(function Pane(
|
|
21
|
+
{
|
|
22
|
+
mode = "horizontal", // "horizontal" | "vertical"
|
|
23
|
+
initialPosition, // optional (alias-ish to position)
|
|
24
|
+
position, // controlled position (number)
|
|
25
|
+
defaultPosition = 0.5, // used if position/initialPosition not provided
|
|
26
|
+
min = 0.1, // clamp in "percent of container" units: 0..1
|
|
27
|
+
max = 0.9, // clamp in "percent of container" units: 0..1
|
|
28
|
+
splitterSize = 8, // px thickness of the drag handle
|
|
29
|
+
onSizeChange, // (newPosition: number) => void
|
|
30
|
+
style,
|
|
31
|
+
className,
|
|
32
|
+
leftPaneStyle,
|
|
33
|
+
rightPaneStyle,
|
|
34
|
+
splitterStyle,
|
|
35
|
+
children, // expects two children: [A, B]
|
|
36
|
+
},
|
|
37
|
+
ref
|
|
38
|
+
) {
|
|
39
|
+
const [internalMode, setInternalMode] = useState(mode);
|
|
40
|
+
const [pos, setPos] = useState(() => {
|
|
41
|
+
const start =
|
|
42
|
+
position ?? initialPosition ?? (defaultPosition != null ? defaultPosition : 0.5);
|
|
43
|
+
return clamp(start, min, max);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const containerRef = useRef(null);
|
|
47
|
+
const draggingRef = useRef(false);
|
|
48
|
+
|
|
49
|
+
const panes = Children.toArray(children);
|
|
50
|
+
const leftChild = panes[0] ?? null;
|
|
51
|
+
const rightChild = panes[1] ?? null;
|
|
52
|
+
|
|
53
|
+
const modeResolved = mode != null ? mode : internalMode;
|
|
54
|
+
|
|
55
|
+
// Keep internalMode aligned if mode is provided as a prop
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (mode != null) setInternalMode(mode);
|
|
58
|
+
}, [mode]);
|
|
59
|
+
|
|
60
|
+
// Controlled position: update state when prop changes
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (position == null) return;
|
|
63
|
+
setPos(clamp(position, min, max));
|
|
64
|
+
}, [position, min, max]);
|
|
65
|
+
|
|
66
|
+
const setPosition = (newPos) => {
|
|
67
|
+
const next = clamp(newPos, min, max);
|
|
68
|
+
if (position == null) setPos(next); // only update internal state if uncontrolled
|
|
69
|
+
onSizeChange?.(next);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const setMode = (nextMode) => {
|
|
73
|
+
const m = nextMode === "vertical" ? "vertical" : "horizontal";
|
|
74
|
+
if (mode == null) setInternalMode(m);
|
|
75
|
+
// If mode is controlled via prop, consumer should re-render with new prop.
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
useImperativeHandle(
|
|
79
|
+
ref,
|
|
80
|
+
() => ({
|
|
81
|
+
setPosition,
|
|
82
|
+
setMode,
|
|
83
|
+
getPosition: () => (position == null ? pos : clamp(position, min, max)),
|
|
84
|
+
getMode: () => modeResolved,
|
|
85
|
+
}),
|
|
86
|
+
[pos, position, min, max, modeResolved, onSizeChange, mode]
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const updateFromClientXorY = (clientX, clientY) => {
|
|
90
|
+
const el = containerRef.current;
|
|
91
|
+
if (!el) return;
|
|
92
|
+
|
|
93
|
+
const rect = el.getBoundingClientRect();
|
|
94
|
+
let next;
|
|
95
|
+
|
|
96
|
+
if (modeResolved === "horizontal") {
|
|
97
|
+
const usable = rect.width;
|
|
98
|
+
if (usable <= 0) return;
|
|
99
|
+
next = (clientX - rect.left) / usable;
|
|
100
|
+
} else {
|
|
101
|
+
const usable = rect.height;
|
|
102
|
+
if (usable <= 0) return;
|
|
103
|
+
next = (clientY - rect.top) / usable;
|
|
104
|
+
}
|
|
105
|
+
setPosition(next);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const onPointerDown = (e) => {
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
draggingRef.current = true;
|
|
111
|
+
|
|
112
|
+
// Capture pointer so we still get events outside the handle area.
|
|
113
|
+
try {
|
|
114
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
115
|
+
} catch {
|
|
116
|
+
// ignore
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
updateFromClientXorY(e.clientX, e.clientY);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const onPointerMove = (e) => {
|
|
123
|
+
if (!draggingRef.current) return;
|
|
124
|
+
updateFromClientXorY(e.clientX, e.clientY);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const stopDragging = () => {
|
|
128
|
+
draggingRef.current = false;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// Attach global listeners to ensure smooth dragging even if pointer capture fails
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
const handleMove = (e) => {
|
|
134
|
+
if (!draggingRef.current) return;
|
|
135
|
+
updateFromClientXorY(e.clientX, e.clientY);
|
|
136
|
+
};
|
|
137
|
+
const handleUp = () => stopDragging();
|
|
138
|
+
|
|
139
|
+
window.addEventListener("pointermove", handleMove, { passive: false });
|
|
140
|
+
window.addEventListener("pointerup", handleUp, { passive: true });
|
|
141
|
+
window.addEventListener("pointercancel", handleUp, { passive: true });
|
|
142
|
+
|
|
143
|
+
return () => {
|
|
144
|
+
window.removeEventListener("pointermove", handleMove);
|
|
145
|
+
window.removeEventListener("pointerup", handleUp);
|
|
146
|
+
window.removeEventListener("pointercancel", handleUp);
|
|
147
|
+
};
|
|
148
|
+
}, [modeResolved, min, max, position, onSizeChange]);
|
|
149
|
+
|
|
150
|
+
const posResolved = position == null ? pos : clamp(position, min, max);
|
|
151
|
+
|
|
152
|
+
const sizes = useMemo(() => {
|
|
153
|
+
if (modeResolved === "horizontal") {
|
|
154
|
+
// left width = pos, splitter width = splitterSize, right flexes
|
|
155
|
+
// We set left/right as percentages and keep splitter fixed in px.
|
|
156
|
+
return {
|
|
157
|
+
left: `${posResolved * 100}%`,
|
|
158
|
+
right: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
left: `${posResolved * 100}%`,
|
|
163
|
+
right: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
164
|
+
};
|
|
165
|
+
}, [modeResolved, posResolved, splitterSize]);
|
|
166
|
+
|
|
167
|
+
// Improve keyboard accessibility (arrow keys when handle is focused)
|
|
168
|
+
const onSplitterKeyDown = (e) => {
|
|
169
|
+
const step = 0.02;
|
|
170
|
+
let delta = 0;
|
|
171
|
+
if (modeResolved === "horizontal") {
|
|
172
|
+
if (e.key === "ArrowLeft") delta = -step;
|
|
173
|
+
if (e.key === "ArrowRight") delta = step;
|
|
174
|
+
} else {
|
|
175
|
+
if (e.key === "ArrowUp") delta = -step;
|
|
176
|
+
if (e.key === "ArrowDown") delta = step;
|
|
177
|
+
}
|
|
178
|
+
if (delta !== 0) {
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
setPosition(posResolved + delta);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// Ensure position clamps correctly if min/max change
|
|
185
|
+
useLayoutEffect(() => {
|
|
186
|
+
setPos((p) => clamp(p, min, max));
|
|
187
|
+
}, [min, max]);
|
|
188
|
+
|
|
189
|
+
const rootStyle = {
|
|
190
|
+
display: "flex",
|
|
191
|
+
width: "100%",
|
|
192
|
+
height: "100%",
|
|
193
|
+
overflow: "hidden",
|
|
194
|
+
touchAction: "none",
|
|
195
|
+
...(style || {}),
|
|
196
|
+
flexDirection: modeResolved === "horizontal" ? "row" : "column",
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const leftPaneComputed =
|
|
200
|
+
modeResolved === "horizontal"
|
|
201
|
+
? {
|
|
202
|
+
width: sizes.left,
|
|
203
|
+
flex: `0 0 ${sizes.left}`,
|
|
204
|
+
overflow: "auto",
|
|
205
|
+
...(leftPaneStyle || {}),
|
|
206
|
+
}
|
|
207
|
+
: {
|
|
208
|
+
height: sizes.left,
|
|
209
|
+
flex: `0 0 ${sizes.left}`,
|
|
210
|
+
overflow: "auto",
|
|
211
|
+
...(leftPaneStyle || {}),
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const rightPaneComputed =
|
|
215
|
+
modeResolved === "horizontal"
|
|
216
|
+
? {
|
|
217
|
+
width: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
218
|
+
flex: `1 1 auto`,
|
|
219
|
+
overflow: "auto",
|
|
220
|
+
...(rightPaneStyle || {}),
|
|
221
|
+
}
|
|
222
|
+
: {
|
|
223
|
+
height: `calc(${100 - posResolved * 100}% - ${splitterSize}px)`,
|
|
224
|
+
flex: `1 1 auto`,
|
|
225
|
+
overflow: "auto",
|
|
226
|
+
...(rightPaneStyle || {}),
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
const splitterComputed =
|
|
230
|
+
modeResolved === "horizontal"
|
|
231
|
+
? {
|
|
232
|
+
width: `${splitterSize}px`,
|
|
233
|
+
flex: `0 0 ${splitterSize}px`,
|
|
234
|
+
cursor: "col-resize",
|
|
235
|
+
background: "transparent",
|
|
236
|
+
...(splitterStyle || {}),
|
|
237
|
+
}
|
|
238
|
+
: {
|
|
239
|
+
height: `${splitterSize}px`,
|
|
240
|
+
flex: `0 0 ${splitterSize}px`,
|
|
241
|
+
cursor: "row-resize",
|
|
242
|
+
background: "transparent",
|
|
243
|
+
...(splitterStyle || {}),
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
const dividerVisualStyle =
|
|
247
|
+
modeResolved === "horizontal"
|
|
248
|
+
? {
|
|
249
|
+
height: "100%",
|
|
250
|
+
width: "100%",
|
|
251
|
+
background: "rgba(0,0,0,0.08)",
|
|
252
|
+
}
|
|
253
|
+
: {
|
|
254
|
+
width: "100%",
|
|
255
|
+
height: "100%",
|
|
256
|
+
background: "rgba(0,0,0,0.08)",
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<div
|
|
261
|
+
ref={containerRef}
|
|
262
|
+
className={className}
|
|
263
|
+
style={rootStyle}
|
|
264
|
+
onPointerMove={onPointerMove}
|
|
265
|
+
>
|
|
266
|
+
<div style={leftPaneComputed}>{leftChild}</div>
|
|
267
|
+
|
|
268
|
+
<div
|
|
269
|
+
role="separator"
|
|
270
|
+
aria-orientation={modeResolved === "horizontal" ? "vertical" : "horizontal"}
|
|
271
|
+
aria-valuemin={min}
|
|
272
|
+
aria-valuemax={max}
|
|
273
|
+
aria-valuenow={posResolved}
|
|
274
|
+
tabIndex={0}
|
|
275
|
+
onPointerDown={onPointerDown}
|
|
276
|
+
onPointerUp={stopDragging}
|
|
277
|
+
onPointerCancel={stopDragging}
|
|
278
|
+
onKeyDown={onSplitterKeyDown}
|
|
279
|
+
style={splitterComputed}
|
|
280
|
+
>
|
|
281
|
+
<div style={dividerVisualStyle} />
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<div style={rightPaneComputed}>{rightChild}</div>
|
|
285
|
+
</div>
|
|
286
|
+
);
|
|
287
|
+
});
|
package/src/run.jsx
CHANGED
|
@@ -180,21 +180,7 @@ export function require(path, force_update)
|
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
182
|
* Wrapper that enables async, code-split component loading. `lazy` should be used
|
|
183
|
-
* outside the component definintion
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* @example
|
|
187
|
-
* ```jsx
|
|
188
|
-
* const LazyWidget = lazy(() => Lilact.require("./Widget"));
|
|
189
|
-
*
|
|
190
|
-
* export function Page() {
|
|
191
|
-
* return (
|
|
192
|
-
* <Suspense fallback={<Spinner/>}>
|
|
193
|
-
* <LazyWidget />
|
|
194
|
-
* </Suspense>
|
|
195
|
-
* );
|
|
196
|
-
* }
|
|
197
|
-
* ```
|
|
183
|
+
* outside the component definintion or it will produce new components on each rerender.
|
|
198
184
|
*
|
|
199
185
|
* @param factory - A function with **no arguments** that returns a `Promise`.
|
|
200
186
|
* The promise must resolve to a module whose module.exports.default is a Lilact component
|
|
@@ -202,12 +188,12 @@ export function require(path, force_update)
|
|
|
202
188
|
*
|
|
203
189
|
* @returns A Lilact component that should be rendered inside a {@link Suspense} boundary.
|
|
204
190
|
*/
|
|
205
|
-
export function lazy(
|
|
191
|
+
export function lazy(factory) {
|
|
206
192
|
let status = "pending"; // pending | success | error
|
|
207
193
|
let result; // component | error
|
|
208
194
|
|
|
209
195
|
Lilact[LAZY] = true;
|
|
210
|
-
result =
|
|
196
|
+
result = factory();
|
|
211
197
|
|
|
212
198
|
if(Lilact.isThenable(result)) {
|
|
213
199
|
result.then(
|
package/src/transition.jsx
CHANGED
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
|
|
33
33
|
/* States */
|
|
34
34
|
const UNMOUNTED = "unmounted";
|
|
35
|
-
const EXITED =
|
|
36
|
-
const ENTERING =
|
|
37
|
-
const ENTERED =
|
|
38
|
-
const EXITING =
|
|
35
|
+
const EXITED = "exited";
|
|
36
|
+
const ENTERING = "entering";
|
|
37
|
+
const ENTERED = "entered";
|
|
38
|
+
const EXITING = "exiting";
|
|
39
39
|
|
|
40
40
|
import {setTimeout, clearTimeout} from "./timers.jsx"
|
|
41
41
|
import {Children} from "./misc.jsx"
|
|
@@ -81,12 +81,16 @@ export function Transition({
|
|
|
81
81
|
this[CORE].is_appeared ??= inProp;
|
|
82
82
|
this[CORE].timer ??= null;
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
this[CORE].childFunctionHandler = (func)=>{
|
|
85
|
+
return func(this[CORE].mount_state);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if(!this[CORE].mount_state) {
|
|
89
|
+
if (!this[CORE].is_mounted) this[CORE].mount_state = UNMOUNTED;
|
|
86
90
|
if (inProp) {
|
|
87
|
-
this.
|
|
91
|
+
this[CORE].mount_state = appear && !this[CORE].is_appeared ? ENTERING : ENTERED;
|
|
88
92
|
}
|
|
89
|
-
this.
|
|
93
|
+
else this[CORE].mount_state = EXITED;
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
useEffect(() => {
|
|
@@ -94,13 +98,14 @@ export function Transition({
|
|
|
94
98
|
}, []);
|
|
95
99
|
|
|
96
100
|
useEffect(() => {
|
|
97
|
-
if (!this[CORE].is_appeared && appear && this.
|
|
101
|
+
if (!this[CORE].is_appeared && appear && this[CORE].mount_state === ENTERING && inProp) {
|
|
98
102
|
onEnter?.();
|
|
99
103
|
requestAnimationFrame(() => {
|
|
100
104
|
onEntering?.(!this[CORE].is_appeared);
|
|
101
105
|
clearTimeout(this[CORE].timer);
|
|
102
106
|
this[CORE].timer = setTimeout(() => {
|
|
103
|
-
this.
|
|
107
|
+
this[CORE].mount_state = ENTERED;
|
|
108
|
+
this.forceUpdate();
|
|
104
109
|
this[CORE].is_appeared = true;
|
|
105
110
|
onEntered?.(!this[CORE].is_appeared);
|
|
106
111
|
}, timeout);
|
|
@@ -112,32 +117,38 @@ export function Transition({
|
|
|
112
117
|
if (inProp) {
|
|
113
118
|
this[CORE].is_mounted = true;
|
|
114
119
|
// If we are already entering/entered, no-op
|
|
115
|
-
if (this.
|
|
120
|
+
if (this[CORE].mount_state === ENTERING || this[CORE].mount_state === ENTERED) return;
|
|
116
121
|
|
|
117
122
|
onEnter?.(!this[CORE].is_appeared);
|
|
118
|
-
this.
|
|
123
|
+
this[CORE].mount_state = ENTERING;
|
|
124
|
+
this.forceUpdate(() => {
|
|
119
125
|
onEntering?.(!this[CORE].is_appeared);
|
|
120
126
|
clearTimeout(this[CORE].timer);
|
|
127
|
+
|
|
121
128
|
this[CORE].timer = setTimeout(() => {
|
|
122
|
-
this.
|
|
129
|
+
this[CORE].mount_state = ENTERED;
|
|
130
|
+
this.forceUpdate();
|
|
123
131
|
this[CORE].is_appeared = true;
|
|
124
132
|
onEntered?.();
|
|
125
133
|
}, timeout);
|
|
126
134
|
});
|
|
127
135
|
}
|
|
128
136
|
else {
|
|
129
|
-
if (this.
|
|
137
|
+
if (this[CORE].mount_state === UNMOUNTED || this[CORE].mount_state === EXITING || this[CORE].mount_state === EXITED) return;
|
|
130
138
|
|
|
131
139
|
onExit?.();
|
|
132
|
-
this.
|
|
140
|
+
this[CORE].mount_state = EXITING;
|
|
141
|
+
this.forceUpdate( () => {
|
|
133
142
|
onExiting?.();
|
|
134
143
|
clearTimeout(this[CORE].timer);
|
|
135
144
|
this[CORE].timer = setTimeout(() => {
|
|
136
|
-
this.
|
|
145
|
+
this[CORE].mount_state = EXITED;
|
|
146
|
+
this.forceUpdate();
|
|
137
147
|
onExited?.();
|
|
138
148
|
if (unmountOnExit) {
|
|
139
149
|
this[CORE].is_mounted = false;
|
|
140
|
-
this.
|
|
150
|
+
this[CORE].mount_state = UNMOUNTED;
|
|
151
|
+
this.forceUpdate();
|
|
141
152
|
}
|
|
142
153
|
}, timeout);
|
|
143
154
|
});
|
|
@@ -147,20 +158,20 @@ export function Transition({
|
|
|
147
158
|
if (!this[CORE].is_mounted) return null;
|
|
148
159
|
|
|
149
160
|
if(classNames) {
|
|
150
|
-
if (this.
|
|
161
|
+
if (this[CORE].mount_state === ENTERING) {
|
|
151
162
|
if(this[CORE].is_appeared)
|
|
152
163
|
this[CORE][CHILD_CLASS_ADDENDUM] = classNames.appearActive;
|
|
153
164
|
else
|
|
154
165
|
this[CORE][CHILD_CLASS_ADDENDUM] = classNames.enterActive;
|
|
155
166
|
}
|
|
156
|
-
else if (this.
|
|
167
|
+
else if (this[CORE].mount_state === ENTERED) {
|
|
157
168
|
if(this[CORE].is_appeared)
|
|
158
169
|
this[CORE][CHILD_CLASS_ADDENDUM] = classNames.appearDone;
|
|
159
170
|
else
|
|
160
171
|
this[CORE][CHILD_CLASS_ADDENDUM] = classNames.enterDone;
|
|
161
172
|
}
|
|
162
|
-
else if (this.
|
|
163
|
-
else if (this.
|
|
173
|
+
else if (this[CORE].mount_state === EXITING) this[CORE][CHILD_CLASS_ADDENDUM] = classNames.exitActive;
|
|
174
|
+
else if (this[CORE].mount_state === EXITED) this[CORE][CHILD_CLASS_ADDENDUM] = classNames.exitDone;
|
|
164
175
|
}
|
|
165
176
|
return children;
|
|
166
177
|
}
|
package/webpack.config.js
CHANGED
|
@@ -56,7 +56,7 @@ export default (env, argv) => {
|
|
|
56
56
|
optimization: {
|
|
57
57
|
concatenateModules: true, // scope hoisting
|
|
58
58
|
moduleIds: 'deterministic', // smaller stable ids (or 'hashed')
|
|
59
|
-
minimize:
|
|
59
|
+
minimize: mode === 'production',
|
|
60
60
|
},
|
|
61
61
|
experiments: {
|
|
62
62
|
outputModule: true // enable module output
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Transition | Lilact</title><meta name="description" content="Documentation for Lilact"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Lilact</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/transition.html">transition</a></li><li><a href="" aria-current="page">Transition</a></li></ul><h1>Class Transition</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Transition component that manages enter/exit lifecycle and calls callbacks based on state changes.</p>
|
|
2
|
-
</div><div class="tsd-comment tsd-typography"><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-props">Param: props<a href="#param-props" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Component props.</p>
|
|
3
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsin">Param: props.in<a href="#param-propsin" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Boolean/flag indicating whether the component should be entered/shown.</p>
|
|
4
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propstimeout">Param: props.timeout<a href="#param-propstimeout" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Duration (or durations) for the transition.</p>
|
|
5
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsmountonenter">Param: props.mountOnEnter<a href="#param-propsmountonenter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If true, mount the child only when entering.</p>
|
|
6
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsunmountonexit">Param: props.unmountOnExit<a href="#param-propsunmountonexit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If true, unmount the child after exiting.</p>
|
|
7
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsappear">Param: props.appear<a href="#param-propsappear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>If true, run the enter transition on initial mount.</p>
|
|
8
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsonenter">Param: props.onEnter<a href="#param-propsonenter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Called when entering begins.</p>
|
|
9
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsonentering">Param: props.onEntering<a href="#param-propsonentering" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Called while the component is entering.</p>
|
|
10
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsonentered">Param: props.onEntered<a href="#param-propsonentered" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Called when entering completes.</p>
|
|
11
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsonexit">Param: props.onExit<a href="#param-propsonexit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Called when exiting begins.</p>
|
|
12
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsonexiting">Param: props.onExiting<a href="#param-propsonexiting" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Called while the component is exiting.</p>
|
|
13
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propsonexited">Param: props.onExited<a href="#param-propsonexited" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Called when exiting completes.</p>
|
|
14
|
-
</div><div class="tsd-tag-param"><h4 class="tsd-anchor-link" id="param-propschildren">Param: props.children<a href="#param-propschildren" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>Render prop receiving transition state/props.</p>
|
|
15
|
-
</div></div></section><aside class="tsd-sources"><ul><li>Defined in transition.js:61</li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
|
|
16
|
-
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#state" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>state</span></a>
|
|
17
|
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Constructors</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructor"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructortransition"><span class="tsd-signature-keyword">new</span> <span class="tsd-kind-constructor-signature">Transition</span><span class="tsd-signature-symbol">(</span><br/> <span class="tsd-kind-parameter">props</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">_classNames</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">appear</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">children</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">in</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">mountOnEnter</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onEnter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onEntered</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onEntering</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onExit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onExited</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onExiting</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">timeout</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">unmountOnExit</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">,</span><br/><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <a href="" class="tsd-signature-type tsd-kind-class">Transition</a><a href="#constructortransition" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Transition component that manages enter/exit lifecycle and calls callbacks based on state changes.</p>
|
|
18
|
-
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">props</span>: <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">_classNames</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">appear</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">children</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">in</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">mountOnEnter</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onEnter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onEntered</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onEntering</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onExit</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onExited</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">onExiting</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">timeout</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">unmountOnExit</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Component props.</p>
|
|
19
|
-
</div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">_classNames</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">appear</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If true, run the enter transition on initial mount.</p>
|
|
20
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">children</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Render prop receiving transition state/props.</p>
|
|
21
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">in</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Boolean/flag indicating whether the component should be entered/shown.</p>
|
|
22
|
-
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">mountOnEnter</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If true, mount the child only when entering.</p>
|
|
23
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">onEnter</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Called when entering begins.</p>
|
|
24
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">onEntered</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Called when entering completes.</p>
|
|
25
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">onEntering</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Called while the component is entering.</p>
|
|
26
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">onExit</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Called when exiting begins.</p>
|
|
27
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">onExited</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Called when exiting completes.</p>
|
|
28
|
-
</div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">onExiting</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Called while the component is exiting.</p>
|
|
29
|
-
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">timeout</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span></h5><div class="tsd-comment tsd-typography"><p>Duration (or durations) for the transition.</p>
|
|
30
|
-
</div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">unmountOnExit</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>If true, unmount the child after exiting.</p>
|
|
31
|
-
</div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <a href="" class="tsd-signature-type tsd-kind-class">Transition</a></h4><aside class="tsd-sources"><ul><li>Defined in transition.js:61</li></ul></aside></div></li></ul></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h2>Properties</h2></summary><section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="state"><span>state</span><a href="#state" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">state</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><ul><li>Defined in transition.js:85</li><li>Defined in transition.js:87</li><li>Defined in transition.js:89</li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="section-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#state"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>state</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Lilact</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>transpilerConfig | Lilact</title><meta name="description" content="Documentation for Lilact"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">Lilact</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/jsx.html">jsx</a></li><li><a href="" aria-current="page">transpilerConfig</a></li></ul><h1>Variable transpilerConfig<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">transpilerConfig</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{</span><br/> <span class="tsd-kind-property">addons</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">__module</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">enableLabelStack</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">func_labels</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">func_num</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">injectLabels</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">preprocessorDelimiter</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">required</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{}</span><span class="tsd-signature-symbol">;</span><br/> <span class="tsd-kind-property">setFunctionLabels</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">;</span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = ...</span></div><div class="tsd-type-declaration"><h4>Type Declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5 id="addons"><span class="tsd-kind-property">addons</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">__module</span></h5></li><li class="tsd-parameter"><h5 id="enablelabelstack"><span class="tsd-kind-property">enableLabelStack</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li><li class="tsd-parameter"><h5 id="func_labels"><span class="tsd-kind-property">func_labels</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{}</span></h5></li><li class="tsd-parameter"><h5 id="func_num"><span class="tsd-kind-property">func_num</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></h5></li><li class="tsd-parameter"><h5 id="injectlabels"><span class="tsd-kind-property">injectLabels</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li><li class="tsd-parameter"><h5 id="preprocessordelimiter"><span class="tsd-kind-property">preprocessorDelimiter</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5></li><li class="tsd-parameter"><h5 id="required"><span class="tsd-kind-property">required</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{}</span></h5></li><li class="tsd-parameter"><h5 id="setfunctionlabels"><span class="tsd-kind-property">setFunctionLabels</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></h5></li></ul></div><aside class="tsd-sources"><ul><li>Defined in jsx.js:54</li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">Lilact</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|