lilact 0.5.1 → 0.6.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/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/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/accessories.ErrorBoundary.html +13 -10
- package/docs/classes/accessories.Suspense.html +13 -10
- package/docs/classes/components.Component.html +14 -11
- package/docs/classes/components.HTMLComponent.html +14 -11
- package/docs/classes/components.RootComponent.html +13 -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/errors.globalErrorHandler.html +1 -1
- package/docs/functions/errors.traceError.html +2 -2
- package/docs/functions/misc.Fragment.html +1 -1
- package/docs/functions/misc.classNames.html +1 -1
- package/docs/functions/misc.deepEqual.html +1 -1
- 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 +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/{root/demos/error-3.jsx → docs/static/demos/error-callback.jsx} +9 -9
- package/docs/static/demos/error-component-stack.jsx +39 -0
- package/{root/demos/error-2.jsx → docs/static/demos/error-init.jsx} +1 -1
- package/docs/static/demos/form-elements.jsx +9 -9
- package/docs/static/icon.png +0 -0
- package/docs/static/index.html +25 -21
- package/docs/static/lilact.development.min.js +1 -1
- package/docs/static/lilact.production.min.js +1 -1
- package/docs/variables/misc.Children.html +2 -2
- package/package.json +1 -1
- package/{docs/static/demos/error-3.jsx → root/demos/error-callback.jsx} +9 -9
- package/root/demos/error-component-stack.jsx +39 -0
- package/{docs/static/demos/error-2.jsx → root/demos/error-init.jsx} +1 -1
- package/root/demos/form-elements.jsx +9 -9
- package/root/icon.png +0 -0
- package/root/index.html +25 -21
- package/root/lilact.development.min.js +1 -1
- package/root/lilact.production.min.js +1 -1
- package/src/accessories.jsx +2 -0
- package/src/components.jsx +27 -18
- package/src/errors.jsx +19 -11
- package/src/jsx.js +2 -2
- package/src/lilact.jsx +1 -1
- package/src/misc.jsx +0 -3
- package/src/pane.jsx +4 -0
- package/src/run.jsx +0 -1
- package/docs/static/demos/error-4.jsx +0 -7
- package/root/demos/error-4.jsx +0 -7
- /package/docs/static/demos/{error-1.jsx → error-parser.jsx} +0 -0
- /package/root/demos/{error-1.jsx → error-parser.jsx} +0 -0
|
@@ -2,7 +2,7 @@ module.exports = function() {
|
|
|
2
2
|
|
|
3
3
|
return <>
|
|
4
4
|
|
|
5
|
-
<p>Boolean attributes: literal JSX -> Lilact correct;
|
|
5
|
+
<p>Boolean attributes: literal JSX -> Lilact correct; HTML examples below intentionally look wrong</p>
|
|
6
6
|
<div style={{ fontFamily: "sans-serif" }}>
|
|
7
7
|
<h3>Boolean: disabled={false} (should NOT render disabled)</h3>
|
|
8
8
|
<input disabled={false} />
|
|
@@ -76,17 +76,17 @@ module.exports = function() {
|
|
|
76
76
|
<hr />
|
|
77
77
|
|
|
78
78
|
{/* JSX camelCase: works in Lilact; if pasted literally into HTML it’s “visibly wrong” because HTML won’t interpret JSX props */}
|
|
79
|
-
<h3>JSX attribute casing: className="..." (Lilact applies class;
|
|
79
|
+
<h3>JSX attribute casing: className="..." (Lilact applies class; HTML uses className literally)</h3>
|
|
80
80
|
<div className="demo" style={{ padding: 8, border: "1px solid #888" }}>
|
|
81
81
|
className target
|
|
82
82
|
</div>
|
|
83
83
|
|
|
84
|
-
<h3>HTML uses class; Lilact uses className (
|
|
84
|
+
<h3>HTML uses class; Lilact uses className (HTML would ignore className)</h3>
|
|
85
85
|
<div class="demo" style={{ padding: 8, border: "1px solid #888" }}>
|
|
86
|
-
(This one uses class, so
|
|
86
|
+
(This one uses class, so HTML is correct.)
|
|
87
87
|
</div>
|
|
88
88
|
|
|
89
|
-
<h3>JSX attribute casing: htmlFor="x" (Lilact links label;
|
|
89
|
+
<h3>JSX attribute casing: htmlFor="x" (Lilact links label; HTML uses htmlFor literally)</h3>
|
|
90
90
|
<label htmlFor="x_Lilact">Click label (Lilact should focus input)</label>
|
|
91
91
|
<input id="x_Lilact" type="text" placeholder="Focus target" />
|
|
92
92
|
|
|
@@ -94,16 +94,16 @@ module.exports = function() {
|
|
|
94
94
|
<label htmlFor="y_html">Click label (HTML should focus input)</label>
|
|
95
95
|
<input id="y_html" type="text" placeholder="Focus target" />
|
|
96
96
|
|
|
97
|
-
<h3>JSX: tabIndex={2} (Lilact sets focus order;
|
|
97
|
+
<h3>JSX: tabIndex={2} (Lilact sets focus order; HTML won’t)</h3>
|
|
98
98
|
<input tabIndex={2} defaultValue="tabIndex Lilact" />
|
|
99
99
|
|
|
100
|
-
<h3>JSX: readOnly={true} (Lilact makes readonly;
|
|
100
|
+
<h3>JSX: readOnly={true} (Lilact makes readonly; HTML won’t interpret readonly={true})</h3>
|
|
101
101
|
<input readOnly={true} defaultValue="readonly (Lilact)" />
|
|
102
102
|
|
|
103
|
-
<h3>JSX: maxLength={5} (Lilact enforces length;
|
|
103
|
+
<h3>JSX: maxLength={5} (Lilact enforces length; HTML won’t parse maxLength={5})</h3>
|
|
104
104
|
<input maxLength={5} defaultValue="123456789" />
|
|
105
105
|
<p style={{ margin: "4px 0 0" }}>
|
|
106
|
-
Type/try to enter more: Lilact will limit to 5 chars;
|
|
106
|
+
Type/try to enter more: Lilact will limit to 5 chars; HTML won’t.
|
|
107
107
|
</p>
|
|
108
108
|
</div>
|
|
109
109
|
</>
|
package/root/icon.png
ADDED
|
Binary file
|
package/root/index.html
CHANGED
|
@@ -65,7 +65,9 @@ injectGlobal({ code: { whiteSpace: "pre !important",
|
|
|
65
65
|
padding: "10px 0",
|
|
66
66
|
fontSize: "14px !important",
|
|
67
67
|
display: "block",
|
|
68
|
-
overflowWrap: "anywhere" }
|
|
68
|
+
overflowWrap: "anywhere" },
|
|
69
|
+
p: {padding: "10px"},
|
|
70
|
+
body: {padding: "20px"}
|
|
69
71
|
});
|
|
70
72
|
|
|
71
73
|
const outer = css({
|
|
@@ -125,7 +127,7 @@ function DemoView({ file })
|
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
return <>
|
|
128
|
-
<button onClick={()=>setOpen(!isOpen)} className={collapsible}>
|
|
130
|
+
<button onClick={()=>setOpen(!isOpen)} className={collapsible} type="button">
|
|
129
131
|
<span className={left}>{ (isOpen?'- ':'+ ') + file[0] + ' '}</span>
|
|
130
132
|
<b className={right}>{file[1]}</b>
|
|
131
133
|
</button>
|
|
@@ -145,14 +147,11 @@ function DemoView({ file })
|
|
|
145
147
|
|
|
146
148
|
function DemoBlock({file})
|
|
147
149
|
{
|
|
148
|
-
return
|
|
149
|
-
<div>
|
|
150
|
+
return <div key={file[0]}>
|
|
150
151
|
<Suspense fallback={<Spinner/>}>
|
|
151
152
|
<DemoView file={file} />
|
|
152
153
|
</Suspense>
|
|
153
|
-
|
|
154
|
-
</>
|
|
155
|
-
;
|
|
154
|
+
</div>
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
|
|
@@ -175,36 +174,41 @@ function App()
|
|
|
175
174
|
['transition.jsx', '( useState, Transition )'],
|
|
176
175
|
['lazy.jsx', '( lazy, require, Suspene, Spinner )'],
|
|
177
176
|
['form-elements.jsx', '()'],
|
|
178
|
-
['error-boundary.jsx',
|
|
179
|
-
['error-
|
|
180
|
-
['error-
|
|
181
|
-
|
|
182
|
-
|
|
177
|
+
['error-boundary.jsx', '( ErrorBoundary, useState )'],
|
|
178
|
+
['error-parser.jsx', '-- JSX Parser Error --'],
|
|
179
|
+
['error-init.jsx', '-- Error in Component initialization --'],
|
|
180
|
+
['error-component-stack.jsx', '-- Error Component Stack --'],
|
|
181
|
+
['error-callback.jsx', '-- Error in Callback --'],
|
|
183
182
|
];
|
|
184
183
|
|
|
185
184
|
return <>
|
|
186
|
-
<
|
|
187
|
-
|
|
185
|
+
<center>
|
|
186
|
+
<img src="icon.png" width="128"/><br/>
|
|
187
|
+
<h1>Lilact Demos</h1>
|
|
188
|
+
|
|
188
189
|
<p>These scripts are transpiled and run directly in your browser. You have already loaded Lilact completely!</p>
|
|
189
190
|
|
|
190
191
|
<p>These examples are not meant to be pretty.
|
|
191
192
|
|
|
192
193
|
These are bare minimum examples of the React API implemented in Lilact.</p>
|
|
193
194
|
|
|
194
|
-
<p>Note that we are using the development version here to have
|
|
195
|
-
If you switch to production mode
|
|
195
|
+
<p>Note that we are using the development version here to have PropTypes warnings.
|
|
196
|
+
If you switch to production mode PropTypes won't check anything.</p>
|
|
197
|
+
|
|
198
|
+
<p>In many examples like boundary or PropTypes you should have your browser console opened to see the logs.</p>
|
|
196
199
|
|
|
197
|
-
<p>
|
|
200
|
+
<p><b>Error examples other than ErrorBoundary demo will cause the page to stop working, as there is no
|
|
201
|
+
boundary in place.<br/>It is natural of course, and you should refresh the page to continue testing.</b></p>
|
|
198
202
|
|
|
199
203
|
<p>See the{" "}<a href="../">Lilact Documentation</a>{" "}for more info.</p>
|
|
200
|
-
|
|
204
|
+
</center>
|
|
201
205
|
{demos.map((x)=><DemoBlock file={x}/>)}
|
|
202
206
|
|
|
203
207
|
<hr/>
|
|
204
208
|
<p>
|
|
205
|
-
Copyright (C) 2024-2026 Arash Kazemi {" <contact.arash.kazemi@gmail.com>"}. All rights reserved.
|
|
206
|
-
<br/><br/>
|
|
207
|
-
Lilact project is subject to the terms of BSD-2-Clause License. See the `LICENSE.TXT` file for more details.
|
|
209
|
+
Copyright (C) 2024-2026 Arash Kazemi {" <contact.arash.kazemi@gmail.com>"}. All rights reserved.
|
|
210
|
+
<br/><br/>
|
|
211
|
+
Lilact project is subject to the terms of BSD-2-Clause License. See the `LICENSE.TXT` file for more details.
|
|
208
212
|
</p>
|
|
209
213
|
</>
|
|
210
214
|
}
|