lilact 0.2.0 → 0.2.2
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 +4 -5
- package/dist/lilact.development.min.js +238 -278
- package/dist/lilact.development.min.js.map +1 -1
- package/dist/lilact.production.min.js +8139 -1
- package/dist/lilact.production.min.js.map +1 -1
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +10 -10
- package/docs/classes/components.HTMLComponent.html +10 -10
- package/docs/classes/components.RootComponent.html +10 -10
- 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.useActionState.html +3 -2
- package/docs/functions/hooks.useCallback.html +1 -1
- package/docs/functions/hooks.useContext.html +1 -1
- package/docs/functions/hooks.useEffect.html +4 -3
- package/docs/functions/hooks.useId.html +1 -1
- package/docs/functions/hooks.useImperativeHandle.html +1 -1
- package/docs/functions/hooks.useLayoutEffect.html +4 -3
- package/docs/functions/hooks.useLocalStorage.html +4 -3
- package/docs/functions/hooks.useMemo.html +4 -3
- package/docs/functions/hooks.useRef.html +4 -3
- package/docs/functions/hooks.useTransition.html +1 -1
- package/docs/index.html +4 -5
- package/docs/static/demos/pane.jsx +31 -0
- package/docs/static/demos/usetransition.jsx +1 -1
- package/docs/static/index.html +1 -0
- package/docs/static/lilact.development.min.js +238 -278
- package/docs/static/lilact.production.min.js +8139 -1
- package/package.json +1 -2
- package/root/demos/pane.jsx +31 -0
- package/root/demos/usetransition.jsx +1 -1
- package/root/index.html +1 -0
- package/root/lilact.development.min.js +238 -278
- package/root/lilact.production.min.js +8139 -1
- package/src/components.jsx +4 -1
- package/src/hooks.jsx +55 -55
- package/src/misc.jsx +13 -1
- package/src/pane.jsx +207 -269
- package/webpack.config.js +1 -1
- package/docs/static/index 2.html +0 -95
- package/root/index 2.html +0 -95
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lilact",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A Little JSX/React Runtime Implementation for Browser",
|
|
5
5
|
"repository": "github:arashkazemi/lilact",
|
|
6
6
|
"homepage": "https://arashkazemi.github.io/lilact/",
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@emotion/css": "^11.13.5",
|
|
35
|
-
"@reduxjs/toolkit": "^2.12.0",
|
|
36
35
|
"prop-types": "^15.8.1",
|
|
37
36
|
"redux": "^5.0.1"
|
|
38
37
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const { useRef, useState, ResizablePane } = Lilact;
|
|
2
|
+
|
|
3
|
+
module.exports = function Demo() {
|
|
4
|
+
const ref = useRef(null);
|
|
5
|
+
const [mode, setMode] = useState("horizontal");
|
|
6
|
+
const [position, setPosition] = useState(0.35);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<button onClick={() => ref.current?.setMode(ref.current?.getMode() === "horizontal" ? "vertical" : "horizontal")}>
|
|
11
|
+
Toggle mode
|
|
12
|
+
</button>
|
|
13
|
+
<button onClick={() => ref.current?.setPosition(0.5)}>Center</button>
|
|
14
|
+
|
|
15
|
+
<div style={{ height: "calc(100% - 2em)", width: "100% - 2em", border: "1px solid" }}>
|
|
16
|
+
<ResizablePane
|
|
17
|
+
ref={ref}
|
|
18
|
+
mode={mode}
|
|
19
|
+
position={position}
|
|
20
|
+
min={0.2}
|
|
21
|
+
max={0.8}
|
|
22
|
+
splitterSize={10}
|
|
23
|
+
onSizeChange={(p) => setPosition(p)}
|
|
24
|
+
>
|
|
25
|
+
<div style={{ padding: 12 }}>Left/Top</div>
|
|
26
|
+
<div style={{ padding: 12 }}>Right/Bottom</div>
|
|
27
|
+
</ResizablePane>
|
|
28
|
+
</div>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
}
|
package/root/index.html
CHANGED
|
@@ -160,6 +160,7 @@ function App()
|
|
|
160
160
|
{
|
|
161
161
|
const demos =[
|
|
162
162
|
['stopwatch.jsx', '( useState, useRef )'],
|
|
163
|
+
['pane.jsx', '( useRef, useState, ResizablePane )'],
|
|
163
164
|
['modal.jsx', '( useEffect, useRef, useState )'],
|
|
164
165
|
['actionstate.jsx', '( useActionState, useState )'],
|
|
165
166
|
['context.jsx', '( createContext, useContext, useState ), emotion:( css, cx )'],
|