lilact 0.21.1 → 0.23.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 +17 -4
- package/dist/lilact.development.js +498 -38
- package/dist/lilact.development.js.map +4 -4
- package/dist/lilact.development.min.js +34 -23
- package/dist/lilact.development.min.js.map +4 -4
- package/dist/lilact.production.min.js +33 -22
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +20 -20
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +11 -11
- package/docs/classes/components.HTMLComponent.html +12 -12
- package/docs/classes/components.RootComponent.html +12 -12
- package/docs/functions/components.cloneComponent.html +1 -0
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createPortal.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.memo.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/functions/run.lazy.html +7 -1
- package/docs/functions/run.require.html +5 -9
- package/docs/functions/run.run.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/timers.animationFramePromise.html +1 -1
- package/docs/functions/timers.clearInterval.html +1 -1
- package/docs/functions/timers.clearTimeout.html +1 -1
- package/docs/functions/timers.grabTimers.html +1 -1
- package/docs/functions/timers.pauseTimers.html +1 -1
- package/docs/functions/timers.releaseTimers.html +1 -1
- package/docs/functions/timers.resetTimers.html +1 -1
- package/docs/functions/timers.resumeTimers.html +1 -1
- package/docs/functions/timers.setInterval.html +1 -1
- package/docs/functions/timers.setTimeout.html +1 -1
- package/docs/functions/timers.timeoutPromise.html +6 -6
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +17 -10
- package/docs/modules/components.html +1 -1
- package/docs/static/demos/actionstate.jsx +2 -2
- package/docs/static/demos/capture.jsx +2 -2
- package/docs/static/demos/cloneelement.jsx +66 -0
- package/docs/static/demos/context.jsx +3 -3
- package/docs/static/demos/css-transition.jsx +3 -3
- package/docs/static/demos/error-boundary.jsx +2 -2
- package/docs/static/demos/error-callback.jsx +1 -1
- package/docs/static/demos/error-component-stack.jsx +2 -2
- package/docs/static/demos/error-init.jsx +1 -1
- package/docs/static/demos/error-parser.jsx +1 -1
- package/docs/static/demos/form-elements.jsx +1 -1
- package/docs/static/demos/forwardref.jsx +2 -2
- package/docs/static/demos/lazy.jsx +3 -3
- package/docs/static/demos/legacy-context.jsx +2 -2
- package/docs/static/demos/memo.jsx +2 -2
- package/docs/static/demos/modal.jsx +2 -2
- package/docs/static/demos/pane.jsx +2 -2
- package/docs/static/demos/portal.jsx +4 -2
- package/docs/static/demos/priorities.jsx +2 -2
- package/docs/static/demos/proptypes.jsx +2 -2
- package/docs/static/demos/reducer.jsx +4 -2
- package/docs/static/demos/redux.jsx +3 -3
- package/docs/static/demos/router.jsx +3 -3
- package/docs/static/demos/stopwatch.jsx +2 -2
- package/docs/static/demos/suspense.jsx +2 -2
- package/docs/static/demos/switch-transition.jsx +2 -2
- package/docs/static/demos/transition.jsx +2 -2
- package/docs/static/demos/usedefered.jsx +2 -2
- package/docs/static/demos/usetransition.jsx +3 -3
- package/docs/static/index.html +34 -33
- package/docs/static/lilact.development.js +498 -38
- package/docs/static/lilact.development.js.map +4 -4
- package/docs/static/lilact.development.min.js +34 -23
- package/docs/static/lilact.development.min.js.map +4 -4
- package/docs/static/lilact.production.min.js +33 -22
- package/docs/variables/accessories.SplitPane.html +1 -1
- package/docs/variables/components.cloneElement.html +1 -0
- package/examples/demos/actionstate.jsx +2 -2
- package/examples/demos/capture.jsx +2 -2
- package/examples/demos/cloneelement.jsx +66 -0
- package/examples/demos/context.jsx +3 -3
- package/examples/demos/css-transition.jsx +3 -3
- package/examples/demos/error-boundary.jsx +2 -2
- package/examples/demos/error-callback.jsx +1 -1
- package/examples/demos/error-component-stack.jsx +2 -2
- package/examples/demos/error-init.jsx +1 -1
- package/examples/demos/error-parser.jsx +1 -1
- package/examples/demos/form-elements.jsx +1 -1
- package/examples/demos/forwardref.jsx +2 -2
- package/examples/demos/lazy.jsx +3 -3
- package/examples/demos/legacy-context.jsx +2 -2
- package/examples/demos/memo.jsx +2 -2
- package/examples/demos/modal.jsx +2 -2
- package/examples/demos/pane.jsx +2 -2
- package/examples/demos/portal.jsx +4 -2
- package/examples/demos/priorities.jsx +2 -2
- package/examples/demos/proptypes.jsx +2 -2
- package/examples/demos/reducer.jsx +4 -2
- package/examples/demos/redux.jsx +3 -3
- package/examples/demos/router.jsx +3 -3
- package/examples/demos/stopwatch.jsx +2 -2
- package/examples/demos/suspense.jsx +2 -2
- package/examples/demos/switch-transition.jsx +2 -2
- package/examples/demos/transition.jsx +2 -2
- package/examples/demos/usedefered.jsx +2 -2
- package/examples/demos/usetransition.jsx +3 -3
- package/examples/index.html +34 -33
- package/examples/lilact.development.js +498 -38
- package/examples/lilact.development.js.map +4 -4
- package/examples/lilact.development.min.js +34 -23
- package/examples/lilact.development.min.js.map +4 -4
- package/examples/lilact.production.min.js +33 -22
- package/impexptest.js +51 -0
- package/package.json +4 -4
- package/src/components.jsx +7 -5
- package/src/expscan.js +408 -0
- package/src/jsx.js +26 -28
- package/src/lilact.jsx +12 -3
- package/src/run.jsx +92 -45
- package/src/timers.jsx +0 -5
- package/src/jsx.addons.js +0 -70
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { HashRouter, NavLink, Routes, Route, useNavigate, useLocation } from "lilact";
|
|
2
2
|
|
|
3
3
|
/* Simple pages */
|
|
4
4
|
function Home() {
|
|
@@ -79,7 +79,7 @@ function NavControls() {
|
|
|
79
79
|
}
|
|
80
80
|
style={{ marginLeft: 8 }}
|
|
81
81
|
>
|
|
82
|
-
Go Profile (replace + state)
|
|
82
|
+
Go Profile (replace + state) (Clears History)
|
|
83
83
|
</button>
|
|
84
84
|
<button onClick={() => navigate(-1)} style={{ marginLeft: 8 }}>
|
|
85
85
|
Back
|
|
@@ -143,4 +143,4 @@ function Demo() {
|
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
export default Demo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Suspense, Spinner } from "lilact";
|
|
2
2
|
|
|
3
3
|
// resource factory that throws its internal promise until resolved
|
|
4
4
|
function createResource(delay, value) {
|
|
@@ -43,4 +43,4 @@ function Demo() {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
export default Demo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { useState, Transition } from "lilact";
|
|
2
2
|
|
|
3
3
|
function Demo() {
|
|
4
4
|
const [inProp, setInProp] = useState(false);
|
|
@@ -38,4 +38,4 @@ function Demo() {
|
|
|
38
38
|
</>;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
export default Demo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { useState, useDeferredValue } from "lilact";
|
|
2
2
|
|
|
3
3
|
function ExpensiveList({ query }) {
|
|
4
4
|
const items = Array.from({ length: 5000 }, (_, i) => `${query} item ${i}`);
|
|
@@ -30,4 +30,4 @@ function Demo() {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
export default Demo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { useTransition, useState, useCallback, useId } from "lilact";
|
|
2
|
+
import { css, cx } from "@emotion/css";
|
|
3
3
|
|
|
4
4
|
const Demo = ()=>{
|
|
5
5
|
|
|
@@ -32,4 +32,4 @@ const Demo = ()=>{
|
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
export default Demo;
|
package/docs/static/index.html
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
<script type='text/jsx'>
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
import { useRef, useEffect, useState, Suspense, Spinner, run, render } from "lilact";
|
|
24
|
+
import { css,cx,keyframes,injectGlobal } from "@emotion/css";
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
const cache = new Map();
|
|
@@ -161,7 +161,7 @@ function DemoView({ entry })
|
|
|
161
161
|
//console.log(code);
|
|
162
162
|
if(isOpen) {
|
|
163
163
|
useEffect(() => {
|
|
164
|
-
const Comp = run(code, "demos/"+entry[0]);
|
|
164
|
+
const Comp = run(code, "demos/"+entry[0]).default;
|
|
165
165
|
Lilact.render(<Comp/>, viewRef.current);
|
|
166
166
|
});
|
|
167
167
|
|
|
@@ -172,8 +172,8 @@ function DemoView({ entry })
|
|
|
172
172
|
|
|
173
173
|
return <>
|
|
174
174
|
<button onClick={()=>setOpen(!isOpen)} className={collapsible} type="button">
|
|
175
|
-
<
|
|
176
|
-
<
|
|
175
|
+
<b className={left}>{ (isOpen?'- ':'+ ') + entry[1] + ' '}</b>
|
|
176
|
+
<span className={right}>{entry[0]}</span>
|
|
177
177
|
</button>
|
|
178
178
|
{isOpen &&
|
|
179
179
|
<div style={{width:"100%"}}>
|
|
@@ -216,40 +216,41 @@ function App()
|
|
|
216
216
|
{
|
|
217
217
|
const demos =[
|
|
218
218
|
"Hooks",
|
|
219
|
-
['stopwatch.jsx', '( useState, useRef )'],
|
|
220
|
-
['actionstate.jsx', '( useActionState, Spinner )'],
|
|
221
|
-
['usedefered.jsx', '( useState, useDeferredValue )'],
|
|
222
|
-
['usetransition.jsx', '( useTransition, useState, useCallback, useId ), emotion:( css, cx )'],
|
|
223
|
-
['reducer.jsx', '( useReducer )'],
|
|
224
|
-
['context.jsx', '( createContext, useContext, useState ), emotion:( css, cx )'],
|
|
219
|
+
['stopwatch.jsx', 'Stop Watch ( useState, useRef )'],
|
|
220
|
+
['actionstate.jsx', 'Action State ( useActionState, Spinner )'],
|
|
221
|
+
['usedefered.jsx', 'Deferred List Update ( useState, useDeferredValue )'],
|
|
222
|
+
['usetransition.jsx', 'Transition ( useTransition, useState, useCallback, useId ), emotion:( css, cx )'],
|
|
223
|
+
['reducer.jsx', 'Todo List: ( useReducer )'],
|
|
224
|
+
['context.jsx', 'Modern Context API ( createContext, useContext, useState ), emotion:( css, cx )'],
|
|
225
225
|
|
|
226
226
|
"API",
|
|
227
|
-
['capture.jsx', '
|
|
228
|
-
['priorities.jsx', '
|
|
229
|
-
['forwardref.jsx', '( forwardRef, useImperativeHandle, useRef )'],
|
|
230
|
-
['memo.jsx', '( memo, useState )'],
|
|
231
|
-
['lazy.jsx', '( lazy, require, Suspene, Spinner )'],
|
|
232
|
-
['proptypes.jsx', '
|
|
233
|
-
['legacy-context.jsx', '
|
|
234
|
-
['redux.jsx', '( Provider, useSelector, useDispatch, connect ), redux:( createStore )'],
|
|
235
|
-
['transition.jsx', '( useState, Transition )'],
|
|
227
|
+
['capture.jsx', 'Event Capture and Bubble'],
|
|
228
|
+
['priorities.jsx', 'Effect Priorities'],
|
|
229
|
+
['forwardref.jsx', 'ForwardRef with Function Refs ( forwardRef, useImperativeHandle, useRef )'],
|
|
230
|
+
['memo.jsx', 'Component Memoization ( memo, useState )'],
|
|
231
|
+
['lazy.jsx', 'Lazy Loading ( lazy, require, Suspene, Spinner )'],
|
|
232
|
+
['proptypes.jsx', 'PropTypes Validation'],
|
|
233
|
+
['legacy-context.jsx', 'Legacy Context API'],
|
|
234
|
+
['redux.jsx', 'Redux and Despatch ( Provider, useSelector, useDispatch, connect ), redux:( createStore )'],
|
|
235
|
+
['transition.jsx', 'Transition States ( useState, Transition )'],
|
|
236
|
+
['cloneelement.jsx', 'Cloning Components ( cloneElement, import as React )'],
|
|
236
237
|
|
|
237
238
|
"Components",
|
|
238
|
-
['router.jsx', '( HashRouter, NavLink, Routes, Route, useNavigate, useLocation )'],
|
|
239
|
-
['modal.jsx', '( useEffect, useRef, useState )'],
|
|
240
|
-
['portal.jsx', '(createPortal, useState )'],
|
|
241
|
-
['pane.jsx', '( useRef, useState, SplitPane )'],
|
|
242
|
-
['css-transition.jsx', '( CSSTransition, useState, useRef )'],
|
|
243
|
-
['switch-transition.jsx', '
|
|
244
|
-
['suspense.jsx', '
|
|
245
|
-
['form-elements.jsx', '
|
|
239
|
+
['router.jsx', 'Hash Router ( HashRouter, NavLink, Routes, Route, useNavigate, useLocation )'],
|
|
240
|
+
['modal.jsx', 'Simple Modal ( useEffect, useRef, useState )'],
|
|
241
|
+
['portal.jsx', 'Portal (createPortal, useState )'],
|
|
242
|
+
['pane.jsx', 'SplitPane ( useRef, useState, SplitPane )'],
|
|
243
|
+
['css-transition.jsx', 'CSSTransition ( CSSTransition, useState, useRef )'],
|
|
244
|
+
['switch-transition.jsx', 'SwitchTransition'],
|
|
245
|
+
['suspense.jsx', 'Suspense and Spinner'],
|
|
246
|
+
['form-elements.jsx', 'Form Elements'],
|
|
246
247
|
|
|
247
248
|
"Error Report and Handling",
|
|
248
|
-
['error-boundary.jsx', '
|
|
249
|
-
['error-parser.jsx', '
|
|
250
|
-
['error-init.jsx', '
|
|
251
|
-
['error-component-stack.jsx', '
|
|
252
|
-
['error-callback.jsx', '
|
|
249
|
+
['error-boundary.jsx', 'Error Boundary'],
|
|
250
|
+
['error-parser.jsx', 'JSX Parser Error'],
|
|
251
|
+
['error-init.jsx', 'Error in Component initialization'],
|
|
252
|
+
['error-component-stack.jsx', 'Error Component Stack'],
|
|
253
|
+
['error-callback.jsx', 'Error in Callback'],
|
|
253
254
|
];
|
|
254
255
|
|
|
255
256
|
return<>
|