lilact 0.27.3 → 0.28.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.
Files changed (65) hide show
  1. package/bin/bundle.cjs +2 -2
  2. package/dist/lilact.development.js +312 -280
  3. package/dist/lilact.development.js.map +3 -3
  4. package/dist/lilact.development.min.js +39 -37
  5. package/dist/lilact.development.min.js.map +3 -3
  6. package/dist/lilact.production.min.js +39 -37
  7. package/docs/classes/accessories.ErrorBoundary.html +11 -11
  8. package/docs/classes/accessories.Suspense.html +10 -10
  9. package/docs/classes/components.Component.html +11 -11
  10. package/docs/classes/components.HTMLComponent.html +11 -11
  11. package/docs/classes/components.RootComponent.html +11 -11
  12. package/docs/functions/accessories.DragHandle.html +1 -1
  13. package/docs/functions/accessories.Spinner.html +1 -1
  14. package/docs/functions/components.cloneComponent.html +1 -1
  15. package/docs/functions/components.createComponent.html +1 -1
  16. package/docs/functions/components.createPortal.html +1 -1
  17. package/docs/functions/components.createRoot.html +1 -1
  18. package/docs/functions/components.memo.html +1 -1
  19. package/docs/functions/components.render.html +1 -1
  20. package/docs/functions/errors.scanBlockLabels.html +1 -1
  21. package/docs/functions/timers.animationFramePromise.html +3 -3
  22. package/docs/functions/timers.clearInterval.html +5 -3
  23. package/docs/functions/timers.clearTimeout.html +5 -3
  24. package/docs/functions/timers.grabTimers.html +4 -3
  25. package/docs/functions/timers.pauseTimers.html +5 -2
  26. package/docs/functions/timers.releaseTimers.html +4 -2
  27. package/docs/functions/timers.resetTimers.html +4 -2
  28. package/docs/functions/timers.resumeTimers.html +4 -2
  29. package/docs/functions/timers.setInterval.html +8 -6
  30. package/docs/functions/timers.setTimeout.html +8 -6
  31. package/docs/functions/timers.timeoutPromise.html +8 -149
  32. package/docs/static/demos/error-nested-1.jsx +11 -0
  33. package/docs/static/demos/error-nested-2.jsx +12 -0
  34. package/docs/static/demos/error-nested-3.jsx +12 -0
  35. package/docs/static/demos/error-nested-4.jsx +12 -0
  36. package/docs/static/demos/error-nested-5.jsx +12 -0
  37. package/docs/static/index.html +44 -38
  38. package/docs/static/lilact.development.js +312 -280
  39. package/docs/static/lilact.development.js.map +3 -3
  40. package/docs/static/lilact.development.min.js +39 -37
  41. package/docs/static/lilact.development.min.js.map +3 -3
  42. package/docs/static/lilact.production.min.js +39 -37
  43. package/docs/variables/accessories.SplitPane.html +1 -1
  44. package/docs/variables/components.cloneElement.html +1 -1
  45. package/docs/variables/errors.blocks_info.html +1 -1
  46. package/docs/variables/errors.error.html +1 -1
  47. package/examples/demos/error-nested-1.jsx +11 -0
  48. package/examples/demos/error-nested-2.jsx +12 -0
  49. package/examples/demos/error-nested-3.jsx +12 -0
  50. package/examples/demos/error-nested-4.jsx +12 -0
  51. package/examples/demos/error-nested-5.jsx +12 -0
  52. package/examples/index.html +44 -38
  53. package/examples/lilact.development.js +312 -280
  54. package/examples/lilact.development.js.map +3 -3
  55. package/examples/lilact.development.min.js +39 -37
  56. package/examples/lilact.development.min.js.map +3 -3
  57. package/examples/lilact.production.min.js +39 -37
  58. package/package.json +1 -1
  59. package/scripts/build.mjs +1 -1
  60. package/src/accessories.jsx +1 -4
  61. package/src/components.jsx +20 -15
  62. package/src/errors.jsx +5 -3
  63. package/src/lilact.jsx +4 -4
  64. package/src/run.jsx +1 -1
  65. package/src/timers.jsx +377 -207
@@ -0,0 +1,11 @@
1
+ import { Suspense, Spinner, lazy } from "lilact";
2
+ import "./error-parser.jsx"
3
+
4
+ function NestedError({file})
5
+ {
6
+ return <center>
7
+ Parser Error example will throw an error upon import.
8
+ </center>
9
+ }
10
+
11
+ export default NestedError;
@@ -0,0 +1,12 @@
1
+ import { Suspense, Spinner, lazy } from "lilact";
2
+ import Demo from "./error-init.jsx"
3
+
4
+
5
+ function NestedError({file})
6
+ {
7
+ return <center>
8
+ <Demo/>
9
+ </center>
10
+ }
11
+
12
+ export default NestedError;
@@ -0,0 +1,12 @@
1
+ import { Suspense, Spinner, lazy } from "lilact";
2
+ import Demo from "./error-component-stack.jsx"
3
+
4
+
5
+ function NestedError({file})
6
+ {
7
+ return <center>
8
+ <Demo/>
9
+ </center>
10
+ }
11
+
12
+ export default NestedError;
@@ -0,0 +1,12 @@
1
+ import { Suspense, Spinner, lazy } from "lilact";
2
+ import Demo from "./error-callback.jsx"
3
+
4
+
5
+ function NestedError({file})
6
+ {
7
+ return <center>
8
+ <Demo/>
9
+ </center>
10
+ }
11
+
12
+ export default NestedError;
@@ -0,0 +1,12 @@
1
+ import { Suspense, Spinner, lazy } from "lilact";
2
+ import Demo from"./error-callback.jsx"
3
+
4
+
5
+ function NestedError({file})
6
+ {
7
+ return <center>
8
+ <Demo/>
9
+ </center>
10
+ }
11
+
12
+ export default NestedError;
@@ -24,44 +24,6 @@ import { useRef, useEffect, useState, Suspense, Spinner, run, render } from "lil
24
24
  import { css,cx,keyframes,injectGlobal } from "@emotion/css";
25
25
 
26
26
 
27
- const cache = new Map();
28
-
29
- function createResource(url) {
30
- let record = cache.get(url);
31
- if (!record) {
32
- record = {
33
- status: "pending",
34
- promise: null,
35
- data: null,
36
- error: null,
37
- };
38
-
39
- record.promise = fetch(url)
40
- .then(r => {
41
- if (!r.ok) throw new Error(`HTTP ${r.status}`);
42
- return r.text();
43
- })
44
- .then(data => {
45
- record.status = "success";
46
- record.data = data;
47
- })
48
- .catch(err => {
49
- record.status = "error";
50
- record.error = err;
51
- });
52
-
53
- cache.set(url, record);
54
- }
55
- return {
56
- read() {
57
- if (record.status === "pending") throw record.promise;
58
- if (record.status === "error") throw record.error;
59
- return record.data;
60
- }
61
- };
62
- }
63
-
64
-
65
27
 
66
28
  injectGlobal({"*:not(code):not(code *)" : {fontFamily: "Ubuntu, 'Segoe UI', 'Noto Sans', helvetica, sans", fontSize: "14px"}});
67
29
 
@@ -148,6 +110,46 @@ const demobox = css({ background: "#fff3", borderRadius: "15px", padding: "4px 2
148
110
 
149
111
 
150
112
 
113
+
114
+
115
+ const cache = new Map();
116
+
117
+ function createResource(url) {
118
+ let record = cache.get(url);
119
+ if (!record) {
120
+ record = {
121
+ status: "pending",
122
+ promise: null,
123
+ data: null,
124
+ error: null,
125
+ };
126
+
127
+ record.promise = fetch(url)
128
+ .then(r => {
129
+ if (!r.ok) throw new Error(`HTTP ${r.status}`);
130
+ return r.text();
131
+ })
132
+ .then(data => {
133
+ record.status = "success";
134
+ record.data = data;
135
+ })
136
+ .catch(err => {
137
+ record.status = "error";
138
+ record.error = err;
139
+ });
140
+
141
+ cache.set(url, record);
142
+ }
143
+ return {
144
+ read() {
145
+ if (record.status === "pending") throw record.promise;
146
+ if (record.status === "error") throw record.error;
147
+ return record.data;
148
+ }
149
+ };
150
+ }
151
+
152
+
151
153
  function DemoView({ entry })
152
154
  {
153
155
  const [isOpen, setOpen] = useState(false);
@@ -251,6 +253,10 @@ function App()
251
253
  ['error-init.jsx', 'Error in Component initialization'],
252
254
  ['error-component-stack.jsx', 'Error Component Stack'],
253
255
  ['error-callback.jsx', 'Error in Callback'],
256
+ ['error-nested-1.jsx', 'Error in Nested Imports - Parser'],
257
+ ['error-nested-2.jsx', 'Error in Nested Imports - Init'],
258
+ ['error-nested-3.jsx', 'Error in Nested Imports - Stack'],
259
+ ['error-nested-4.jsx', 'Error in Nested Imports - Callback'],
254
260
  ];
255
261
 
256
262
  return<>