lilact 0.9.1 → 0.10.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/dist/lilact.development.js +279 -129
- 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/errors.globalErrorHandler.html +3 -2
- package/docs/functions/errors.traceError.html +4 -3
- package/docs/functions/hooks.useImperativeHandle.html +1 -1
- package/docs/functions/misc.classNames.html +1 -1
- package/docs/functions/misc.deepEqual.html +1 -1
- package/docs/functions/misc.forwardRef.html +4 -0
- package/docs/functions/misc.getComponentByPointer.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/run.lazy.html +1 -1
- package/docs/functions/run.require.html +2 -2
- package/docs/functions/timers.timeoutPromise.html +2 -2
- package/docs/modules/hooks.html +1 -1
- package/docs/modules/misc.html +1 -1
- package/docs/static/demos/css-transition.jsx +1 -1
- package/docs/static/demos/error-boundary.jsx +8 -1
- package/docs/static/demos/modal.jsx +2 -1
- package/docs/static/demos/reducer.jsx +30 -23
- package/docs/static/demos/transition.jsx +2 -1
- package/docs/static/demos/usedeffered.jsx +33 -0
- package/docs/static/index.html +59 -30
- package/docs/static/lilact.development.js +279 -129
- package/docs/static/lilact.development.min.js +1 -1
- package/docs/static/lilact.production.min.js +1 -1
- package/package.json +1 -1
- package/root/demos/css-transition.jsx +1 -1
- package/root/demos/error-boundary.jsx +8 -1
- package/root/demos/modal.jsx +2 -1
- package/root/demos/reducer.jsx +30 -23
- package/root/demos/transition.jsx +2 -1
- package/root/demos/usedeffered.jsx +33 -0
- package/root/index.html +59 -30
- package/root/lilact.development.js +279 -129
- package/root/lilact.development.min.js +1 -1
- package/root/lilact.production.min.js +1 -1
- package/src/errors.jsx +36 -32
- package/src/events.jsx +194 -66
- package/src/hooks.jsx +0 -15
- package/src/jsx.js +1 -1
- package/src/lilact.jsx +21 -2
- package/src/misc.jsx +14 -0
- package/src/pane.jsx +2 -2
- package/src/run.jsx +4 -4
- package/src/timers.jsx +4 -4
- package/docs/functions/hooks.forwardRef.html +0 -4
- package/docs/static/demos/use-deffered.jsx +0 -30
- package/root/demos/use-deffered.jsx +0 -30
package/docs/static/index.html
CHANGED
|
@@ -70,7 +70,9 @@ injectGlobal({
|
|
|
70
70
|
overflowWrap: "anywhere"
|
|
71
71
|
},
|
|
72
72
|
p: {padding: "10px"},
|
|
73
|
-
body: {padding: "20px"}
|
|
73
|
+
body: { padding: "20px", background: "#262d36", color: "#e7e7e7" },
|
|
74
|
+
":visited": {color: "#c16480"},
|
|
75
|
+
|
|
74
76
|
});
|
|
75
77
|
|
|
76
78
|
const outer = css({
|
|
@@ -78,15 +80,24 @@ const outer = css({
|
|
|
78
80
|
flexDirection: "row",
|
|
79
81
|
gap: 2,
|
|
80
82
|
alignItems: "stretch",
|
|
81
|
-
width: "100%",
|
|
83
|
+
width: "calc(100% - 8px)",
|
|
84
|
+
margin: "2px 4px;",
|
|
85
|
+
borderRadius: "10px",
|
|
86
|
+
overflow: "hidden"
|
|
82
87
|
});
|
|
83
88
|
|
|
84
89
|
const collapsible = css({
|
|
85
|
-
width: "100%",
|
|
90
|
+
width: "calc(100% - 8px)",
|
|
86
91
|
display: "block",
|
|
87
92
|
fontSize: "16px",
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
padding: "10px",
|
|
94
|
+
borderRadius: "10px",
|
|
95
|
+
border: "none",
|
|
96
|
+
margin: "4px",
|
|
97
|
+
background:"#ece9ea",
|
|
98
|
+
":hover": {
|
|
99
|
+
background:"#ffa7c2"
|
|
100
|
+
}
|
|
90
101
|
});
|
|
91
102
|
|
|
92
103
|
const responsiveOuter = css({
|
|
@@ -96,31 +107,44 @@ const responsiveOuter = css({
|
|
|
96
107
|
});
|
|
97
108
|
|
|
98
109
|
const pane = css({ flex: "1 1 0",
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
height: "400px",
|
|
111
|
+
minHeight: "400px",
|
|
112
|
+
overflowY: "auto",
|
|
113
|
+
padding: "10px",
|
|
114
|
+
background:"#fff",
|
|
115
|
+
color: "#222",
|
|
116
|
+
button: {
|
|
117
|
+
background:"#ece9ea",
|
|
118
|
+
padding: "10px",
|
|
119
|
+
border: "none",
|
|
120
|
+
borderRadius: "7px",
|
|
121
|
+
margin: "5px",
|
|
122
|
+
|
|
123
|
+
":hover": {
|
|
124
|
+
background:"#ffa7c2"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
105
128
|
|
|
106
129
|
const left = css({ float: "left" });
|
|
107
130
|
const right = css({ float: "right" });
|
|
131
|
+
const demobox = css({ background: "#fff3", borderRadius: "12px", padding: "2px", margin: "4px"});
|
|
108
132
|
|
|
109
133
|
|
|
110
134
|
|
|
111
|
-
function DemoView({
|
|
135
|
+
function DemoView({ entry })
|
|
112
136
|
{
|
|
113
137
|
const [isOpen, setOpen] = useState(false);
|
|
114
138
|
|
|
115
139
|
const viewRef = useRef();
|
|
116
140
|
const codeRef = useRef();
|
|
117
141
|
|
|
118
|
-
const resource = createResource("demos/"+
|
|
142
|
+
const resource = createResource("demos/"+entry[0]);
|
|
119
143
|
const code = resource.read(); // Suspense will handle the promise
|
|
120
144
|
|
|
121
145
|
if(isOpen) {
|
|
122
146
|
useEffect(() => {
|
|
123
|
-
const Comp = run(code, "demos/"+
|
|
147
|
+
const Comp = run(code, "demos/"+entry[0]);
|
|
124
148
|
Lilact.render(<Comp/>, viewRef.current);
|
|
125
149
|
});
|
|
126
150
|
|
|
@@ -131,8 +155,8 @@ function DemoView({ file })
|
|
|
131
155
|
|
|
132
156
|
return <>
|
|
133
157
|
<button onClick={()=>setOpen(!isOpen)} className={collapsible} type="button">
|
|
134
|
-
<span className={left}>{ (isOpen?'- ':'+ ') +
|
|
135
|
-
<b className={right}>{
|
|
158
|
+
<span className={left}>{ (isOpen?'- ':'+ ') + entry[0] + ' '}</span>
|
|
159
|
+
<b className={right}>{entry[1]}</b>
|
|
136
160
|
</button>
|
|
137
161
|
{isOpen &&
|
|
138
162
|
<div style={{width:"100%"}}>
|
|
@@ -148,11 +172,12 @@ function DemoView({ file })
|
|
|
148
172
|
}
|
|
149
173
|
|
|
150
174
|
|
|
151
|
-
function DemoBlock({
|
|
175
|
+
function DemoBlock({entry})
|
|
152
176
|
{
|
|
153
|
-
return <
|
|
177
|
+
if(typeof(entry)==='string') return <h3><br/><center>{entry}</center></h3>;
|
|
178
|
+
return <div key={entry[0]} className={demobox}>
|
|
154
179
|
<Suspense fallback={<Spinner/>}>
|
|
155
|
-
<DemoView
|
|
180
|
+
<DemoView entry={entry} />
|
|
156
181
|
</Suspense>
|
|
157
182
|
</div>
|
|
158
183
|
}
|
|
@@ -160,24 +185,28 @@ function DemoBlock({file})
|
|
|
160
185
|
|
|
161
186
|
function App()
|
|
162
187
|
{
|
|
163
|
-
const demos =[
|
|
188
|
+
const demos =[
|
|
189
|
+
"Hooks",
|
|
164
190
|
['stopwatch.jsx', '( useState, useRef )'],
|
|
165
|
-
['pane.jsx', '( useRef, useState, ResizablePane )'],
|
|
166
|
-
['modal.jsx', '( useEffect, useRef, useState )'],
|
|
167
191
|
['actionstate.jsx', '( useActionState, useState )'],
|
|
192
|
+
['usedeffered.jsx', '( useState, useDeferredValue )'],
|
|
193
|
+
['usetransition.jsx', '( useTransition, useState, useCallback, useId ), emotion:( css, cx )'],
|
|
194
|
+
['reducer.jsx', '( useReducer )'],
|
|
168
195
|
['context.jsx', '( createContext, useContext, useState ), emotion:( css, cx )'],
|
|
196
|
+
"API",
|
|
197
|
+
['lazy.jsx', '( lazy, require, Suspene, Spinner )'],
|
|
169
198
|
['proptypes.jsx', '( PropTypes )'],
|
|
199
|
+
['redux.jsx', '( Provider, useSelector, useDispatch, connect ), redux:( createStore )'],
|
|
200
|
+
['transition.jsx', '( useState, Transition )'],
|
|
201
|
+
"Components",
|
|
202
|
+
<!-- ['switch-transition.jsx', '( SwitchTransition, useState )'], -->
|
|
170
203
|
['router.jsx', '( HashRouter, NavLink, Routes, Route, useNavigate, useLocation )'],
|
|
171
|
-
['
|
|
204
|
+
['modal.jsx', '( useEffect, useRef, useState )'],
|
|
205
|
+
['pane.jsx', '( useRef, useState, ResizablePane )'],
|
|
172
206
|
['css-transition.jsx', '( CSSTransition, useState, useRef )'],
|
|
173
|
-
<!-- ['switch-transition.jsx', '( SwitchTransition, useState )'], -->
|
|
174
|
-
['usetransition.jsx', '( useTransition, useState, useCallback, useId ), emotion:( css, cx )'],
|
|
175
|
-
['transition.jsx', '( useState, Transition )'],
|
|
176
|
-
['reducer.jsx', '( useReducer )'],
|
|
177
|
-
['redux.jsx', '( Provider, useSelector, useDispatch, connect ), redux:( createStore )'],
|
|
178
207
|
['suspense.jsx', '( Suspense, Spinner )'],
|
|
179
|
-
['lazy.jsx', '( lazy, require, Suspene, Spinner )'],
|
|
180
208
|
['form-elements.jsx', '()'],
|
|
209
|
+
"Error Report and Handling",
|
|
181
210
|
['error-boundary.jsx', '( ErrorBoundary, useState )'],
|
|
182
211
|
['error-parser.jsx', '-- JSX Parser Error --'],
|
|
183
212
|
['error-init.jsx', '-- Error in Component initialization --'],
|
|
@@ -206,7 +235,7 @@ function App()
|
|
|
206
235
|
|
|
207
236
|
<p>See the{" "}<a href="../">Lilact Documentation</a>{" "}for more info.</p>
|
|
208
237
|
</center>
|
|
209
|
-
{demos.map((x)=><DemoBlock
|
|
238
|
+
{demos.map((x)=><DemoBlock entry={x}/>)}
|
|
210
239
|
|
|
211
240
|
<hr/>
|
|
212
241
|
<p>
|