lilact 0.26.2 → 0.26.4
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.js +41 -5
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +24 -24
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +22 -22
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +1 -1
- package/docs/functions/run.run.html +3 -4
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/timers.timeoutPromise.html +7 -7
- package/docs/static/lilact.development.js +41 -5
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +24 -24
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +22 -22
- package/examples/lilact.development.js +41 -5
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +24 -24
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +22 -22
- package/package.json +1 -1
- package/src/accessories.jsx +1 -1
- package/src/lilact.jsx +3 -0
- package/src/run.jsx +10 -7
package/package.json
CHANGED
package/src/accessories.jsx
CHANGED
|
@@ -693,7 +693,7 @@ export const SplitPane = forwardRef(function SplitPane(
|
|
|
693
693
|
const computedSplitterStyle = {
|
|
694
694
|
background: "rgba(0,0,0,0.08)",
|
|
695
695
|
boxShadow: "inset 0 0 2px rgba(0,0,0,0.25)",
|
|
696
|
-
zIndex:
|
|
696
|
+
zIndex: 1000000,
|
|
697
697
|
position: "absolute",
|
|
698
698
|
cursor: internalMode === "horizontal" ? "col-resize" : "row-resize",
|
|
699
699
|
touchAction: "none",
|
package/src/lilact.jsx
CHANGED
|
@@ -63,6 +63,7 @@ import * as misc from './misc.jsx';
|
|
|
63
63
|
import * as errors from './errors.jsx';
|
|
64
64
|
import * as router from './router.jsx';
|
|
65
65
|
import * as accessories from './accessories.jsx';
|
|
66
|
+
import * as symbols from './symbols.jsx';
|
|
66
67
|
import {transpileJSX, transpilerConfig} from "./jsx";
|
|
67
68
|
|
|
68
69
|
|
|
@@ -79,6 +80,7 @@ export * from './misc.jsx';
|
|
|
79
80
|
export * from './errors.jsx';
|
|
80
81
|
export * from './router.jsx';
|
|
81
82
|
export * from './accessories.jsx';
|
|
83
|
+
export * from './symbols.jsx';
|
|
82
84
|
export {transpileJSX, transpilerConfig} from "./jsx";
|
|
83
85
|
|
|
84
86
|
|
|
@@ -111,6 +113,7 @@ export const Lilact =
|
|
|
111
113
|
...timers,
|
|
112
114
|
...events,
|
|
113
115
|
...errors,
|
|
116
|
+
...symbols,
|
|
114
117
|
|
|
115
118
|
...router,
|
|
116
119
|
...accessories,
|
package/src/run.jsx
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import Lilact from './lilact.jsx';
|
|
31
31
|
|
|
32
32
|
import { CORE, COMPONENT, LAZY } from "./symbols.jsx"
|
|
33
|
-
|
|
33
|
+
import { injectGlobal } from "@emotion/css"
|
|
34
34
|
|
|
35
35
|
function joinPaths(basePath, relativePath) {
|
|
36
36
|
const isAbs = relativePath.startsWith("/");
|
|
@@ -56,7 +56,7 @@ function joinPaths(basePath, relativePath) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// Examples:
|
|
59
|
-
//console.log(joinPaths("a/b/c", "./../d")); // a/b/
|
|
59
|
+
//console.log(joinPaths("a/b/c", "./../d")); // a/b/d
|
|
60
60
|
//console.log(joinPaths("a/b/c", "../../d")); // a/d
|
|
61
61
|
|
|
62
62
|
/** @ignore */
|
|
@@ -68,16 +68,15 @@ export const required_scripts = {};
|
|
|
68
68
|
*
|
|
69
69
|
* @param jsx - The code to run.
|
|
70
70
|
* @param path - The optional path to be used in reporting errors.
|
|
71
|
-
* @param is_inline - To treat the code as inline. The main difference at the moment is that inline code doesn't include sourcemap.
|
|
72
71
|
*
|
|
73
72
|
* @returns An array representation of the children.
|
|
74
73
|
*/
|
|
75
|
-
export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`,
|
|
74
|
+
export function run(jsx, path=`InlineJSX-${++Lilact.eval_num}`, {isInline, isModule}={isInline:true, isModule:true})
|
|
76
75
|
{
|
|
77
76
|
const mappings = [];
|
|
78
77
|
const module = {
|
|
79
78
|
mappings,
|
|
80
|
-
|
|
79
|
+
isInline,
|
|
81
80
|
path,
|
|
82
81
|
code: jsx,
|
|
83
82
|
exports: {}
|
|
@@ -124,7 +123,7 @@ if(DEBUG) {
|
|
|
124
123
|
|
|
125
124
|
//const res = new Function( "module", processed )(module);
|
|
126
125
|
const res = eval(processed);
|
|
127
|
-
if(module.exports) return module.exports;
|
|
126
|
+
if(isModule && module.exports) return module.exports;
|
|
128
127
|
return res;
|
|
129
128
|
}
|
|
130
129
|
catch(e) {
|
|
@@ -187,6 +186,10 @@ export function require(path)
|
|
|
187
186
|
return res.text();
|
|
188
187
|
})
|
|
189
188
|
.then(res => {
|
|
189
|
+
if(path.endsWith(".css")) {
|
|
190
|
+
injectGlobal(res);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
190
193
|
res = run(res, path, false);
|
|
191
194
|
return res?.default ?? res;
|
|
192
195
|
})
|
|
@@ -199,7 +202,7 @@ export function require(path)
|
|
|
199
202
|
// but import should be sync. for an async solution use lazy and suspense.
|
|
200
203
|
|
|
201
204
|
const request = new XMLHttpRequest();
|
|
202
|
-
request.open("GET", path, false);
|
|
205
|
+
request.open("GET", path, {isInline:false});
|
|
203
206
|
request.send(null);
|
|
204
207
|
if (request.status === 200) {
|
|
205
208
|
return run(request.responseText, path, false);
|