lilact 0.5.1 → 0.5.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.
Files changed (55) hide show
  1. package/dist/lilact.development.min.js +1 -1
  2. package/dist/lilact.development.min.js.map +1 -1
  3. package/dist/lilact.production.min.js +1 -1
  4. package/dist/lilact.production.min.js.map +1 -1
  5. package/docs/classes/accessories.ErrorBoundary.html +8 -8
  6. package/docs/classes/accessories.Suspense.html +7 -7
  7. package/docs/classes/components.Component.html +10 -10
  8. package/docs/classes/components.HTMLComponent.html +10 -10
  9. package/docs/classes/components.RootComponent.html +10 -10
  10. package/docs/functions/components.createComponent.html +1 -1
  11. package/docs/functions/components.createRoot.html +1 -1
  12. package/docs/functions/components.render.html +1 -1
  13. package/docs/functions/errors.globalErrorHandler.html +1 -1
  14. package/docs/functions/errors.traceError.html +2 -2
  15. package/docs/functions/misc.Fragment.html +1 -1
  16. package/docs/functions/misc.classNames.html +1 -1
  17. package/docs/functions/misc.deepEqual.html +1 -1
  18. package/docs/functions/misc.getComponentByPointer.html +1 -1
  19. package/docs/functions/misc.isAsync.html +1 -1
  20. package/docs/functions/misc.isClass.html +1 -1
  21. package/docs/functions/misc.isEmpty.html +1 -1
  22. package/docs/functions/misc.isError.html +1 -1
  23. package/docs/functions/misc.isThenable.html +1 -1
  24. package/docs/functions/misc.shallowEqual.html +1 -1
  25. package/docs/functions/misc.toBool.html +1 -1
  26. package/docs/functions/run.lazy.html +1 -1
  27. package/docs/functions/run.require.html +1 -1
  28. package/docs/functions/run.runScripts.html +1 -1
  29. package/{root/demos/error-3.jsx → docs/static/demos/error-callback.jsx} +9 -9
  30. package/docs/static/demos/error-component-stack.jsx +39 -0
  31. package/docs/static/demos/form-elements.jsx +9 -9
  32. package/docs/static/icon.png +0 -0
  33. package/docs/static/index.html +25 -21
  34. package/docs/static/lilact.development.min.js +1 -1
  35. package/docs/static/lilact.production.min.js +1 -1
  36. package/docs/variables/misc.Children.html +2 -2
  37. package/package.json +1 -1
  38. package/{docs/static/demos/error-3.jsx → root/demos/error-callback.jsx} +9 -9
  39. package/root/demos/error-component-stack.jsx +39 -0
  40. package/root/demos/form-elements.jsx +9 -9
  41. package/root/icon.png +0 -0
  42. package/root/index.html +25 -21
  43. package/root/lilact.development.min.js +1 -1
  44. package/root/lilact.production.min.js +1 -1
  45. package/src/components.jsx +3 -7
  46. package/src/errors.jsx +19 -11
  47. package/src/jsx.js +2 -2
  48. package/src/misc.jsx +0 -3
  49. package/src/run.jsx +0 -1
  50. package/root/demos/error-2.jsx +0 -7
  51. package/root/demos/error-4.jsx +0 -7
  52. /package/docs/static/demos/{error-2.jsx → error-init.jsx} +0 -0
  53. /package/docs/static/demos/{error-1.jsx → error-parser.jsx} +0 -0
  54. /package/{docs/static/demos/error-4.jsx → root/demos/error-init.jsx} +0 -0
  55. /package/root/demos/{error-1.jsx → error-parser.jsx} +0 -0
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
- </div>
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', '( ErrorBoundary, useState )'],
179
- ['error-1.jsx', '-- JSX Parser Error --'],
180
- ['error-2.jsx', '-- Error in Component initialization --'],
181
- // ['error-3.jsx', '-- Error in Callback --'],
182
- // ['error-4.jsx', '-- Error Component Stack --'],
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
- <h3>Lilact Demos</h3>
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 proptypes warnings.
195
- If you switch to production mode proptypes won't check anything.</p>
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>In many examples like boundary or proptypes you should have your browser console opened to see the logs.</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
  }