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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lilact",
3
- "version": "0.26.2",
3
+ "version": "0.26.4",
4
4
  "description": "A Little React/JSX Runtime Implementation for Browser",
5
5
  "repository": "github:arashkazemi/lilact",
6
6
  "homepage": "https://arashkazemi.github.io/lilact/",
@@ -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: 10,
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/dfdsfds
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}`, is_inline=true)
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
- is_inline,
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);