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.
- package/bin/bundle.cjs +2 -2
- package/dist/lilact.development.js +312 -280
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +39 -37
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +39 -37
- package/docs/classes/accessories.ErrorBoundary.html +11 -11
- package/docs/classes/accessories.Suspense.html +10 -10
- package/docs/classes/components.Component.html +11 -11
- package/docs/classes/components.HTMLComponent.html +11 -11
- package/docs/classes/components.RootComponent.html +11 -11
- package/docs/functions/accessories.DragHandle.html +1 -1
- package/docs/functions/accessories.Spinner.html +1 -1
- package/docs/functions/components.cloneComponent.html +1 -1
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createPortal.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.memo.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/functions/errors.scanBlockLabels.html +1 -1
- package/docs/functions/timers.animationFramePromise.html +3 -3
- package/docs/functions/timers.clearInterval.html +5 -3
- package/docs/functions/timers.clearTimeout.html +5 -3
- package/docs/functions/timers.grabTimers.html +4 -3
- package/docs/functions/timers.pauseTimers.html +5 -2
- package/docs/functions/timers.releaseTimers.html +4 -2
- package/docs/functions/timers.resetTimers.html +4 -2
- package/docs/functions/timers.resumeTimers.html +4 -2
- package/docs/functions/timers.setInterval.html +8 -6
- package/docs/functions/timers.setTimeout.html +8 -6
- package/docs/functions/timers.timeoutPromise.html +8 -149
- package/docs/static/demos/error-nested-1.jsx +11 -0
- package/docs/static/demos/error-nested-2.jsx +12 -0
- package/docs/static/demos/error-nested-3.jsx +12 -0
- package/docs/static/demos/error-nested-4.jsx +12 -0
- package/docs/static/demos/error-nested-5.jsx +12 -0
- package/docs/static/index.html +44 -38
- package/docs/static/lilact.development.js +312 -280
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +39 -37
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +39 -37
- package/docs/variables/accessories.SplitPane.html +1 -1
- package/docs/variables/components.cloneElement.html +1 -1
- package/docs/variables/errors.blocks_info.html +1 -1
- package/docs/variables/errors.error.html +1 -1
- package/examples/demos/error-nested-1.jsx +11 -0
- package/examples/demos/error-nested-2.jsx +12 -0
- package/examples/demos/error-nested-3.jsx +12 -0
- package/examples/demos/error-nested-4.jsx +12 -0
- package/examples/demos/error-nested-5.jsx +12 -0
- package/examples/index.html +44 -38
- package/examples/lilact.development.js +312 -280
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +39 -37
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +39 -37
- package/package.json +1 -1
- package/scripts/build.mjs +1 -1
- package/src/accessories.jsx +1 -4
- package/src/components.jsx +20 -15
- package/src/errors.jsx +5 -3
- package/src/lilact.jsx +4 -4
- package/src/run.jsx +1 -1
- package/src/timers.jsx +377 -207
package/docs/static/index.html
CHANGED
|
@@ -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<>
|