lilact 0.26.3 → 0.26.5
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 +87 -30
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +32 -32
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +30 -30
- package/docs/functions/errors.globalErrorHandler.html +1 -1
- package/docs/functions/errors.traceError.html +1 -1
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/functions/timers.timeoutPromise.html +9 -9
- package/docs/static/demos/lazy.jsx +2 -2
- package/docs/static/index.html +12 -12
- package/docs/static/lilact.development.js +87 -30
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +32 -32
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +30 -30
- package/examples/demos/lazy.jsx +2 -2
- package/examples/index.html +12 -12
- package/examples/lilact.development.js +87 -30
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +32 -32
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +30 -30
- package/package.json +1 -1
- package/src/accessories.jsx +1 -1
- package/src/errors.jsx +4 -2
- package/src/events.jsx +8 -4
- package/src/expscan.js +30 -17
- package/src/lilact.jsx +3 -0
- package/src/run.jsx +35 -18
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/errors.jsx
CHANGED
|
@@ -62,7 +62,8 @@ function getErrorLocation(err) // works for both error and error-event, and also
|
|
|
62
62
|
// Firefox: fn@eval:xxx:LINE:COL
|
|
63
63
|
// Safari: @eval:xxx:LINE:COL (sometimes)
|
|
64
64
|
/** @ignore */
|
|
65
|
-
function parseEvalLocationFromStack(stack, urlPrefix = "eval:/")
|
|
65
|
+
function parseEvalLocationFromStack(stack, urlPrefix = "eval:/")
|
|
66
|
+
{
|
|
66
67
|
const raw = typeof stack === "string" ? stack : String(stack || "");
|
|
67
68
|
const lines = raw.split(/\r?\n/);
|
|
68
69
|
|
|
@@ -89,7 +90,8 @@ function parseEvalLocationFromStack(stack, urlPrefix = "eval:/") {
|
|
|
89
90
|
return { url: null, line: null, col: null, matched: null, stackPreview: lines.slice(0, 6).join("\n") };
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
function escapeRegExp(s)
|
|
93
|
+
function escapeRegExp(s)
|
|
94
|
+
{
|
|
93
95
|
return String(s).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
94
96
|
}
|
|
95
97
|
|
package/src/events.jsx
CHANGED
|
@@ -59,7 +59,8 @@ const _pool = [];
|
|
|
59
59
|
const MAX_POOL_SIZE = 10;
|
|
60
60
|
const POINTER_TYPES = ["mouse", "pen", "touch"];
|
|
61
61
|
|
|
62
|
-
export function createSyntheticEvent(nativeEvent, currentTarget)
|
|
62
|
+
export function createSyntheticEvent(nativeEvent, currentTarget)
|
|
63
|
+
{
|
|
63
64
|
const e = _pool.length ? _pool.pop() : {};
|
|
64
65
|
|
|
65
66
|
e.nativeEvent = nativeEvent;
|
|
@@ -181,7 +182,8 @@ export function createSyntheticEvent(nativeEvent, currentTarget) {
|
|
|
181
182
|
return e;
|
|
182
183
|
}
|
|
183
184
|
|
|
184
|
-
export function releaseSyntheticEvent(e)
|
|
185
|
+
export function releaseSyntheticEvent(e)
|
|
186
|
+
{
|
|
185
187
|
if (e && !e.isPersistent) {
|
|
186
188
|
e.nativeEvent = null;
|
|
187
189
|
e.type = null;
|
|
@@ -261,7 +263,8 @@ export function releaseSyntheticEvent(e) {
|
|
|
261
263
|
// Main wrapper factory
|
|
262
264
|
// fn: function(syntheticEvent) { ... }
|
|
263
265
|
// opts: { capture: bool, passive: bool, once: bool, stopPropagationOnTrueReturn: bool }
|
|
264
|
-
export function wrapListener(fn, opts = {})
|
|
266
|
+
export function wrapListener(fn, opts = {})
|
|
267
|
+
{
|
|
265
268
|
const { stopPropagationOnTrueReturn = false } = opts;
|
|
266
269
|
|
|
267
270
|
return function handler(nativeEvent) {
|
|
@@ -284,7 +287,8 @@ export function wrapListener(fn, opts = {}) {
|
|
|
284
287
|
}
|
|
285
288
|
|
|
286
289
|
// Convenience: add/remove wrapper-managed listener
|
|
287
|
-
export function addWrappedEventListener(target, type, fn, options = {})
|
|
290
|
+
export function addWrappedEventListener(target, type, fn, options = {})
|
|
291
|
+
{
|
|
288
292
|
const handler = wrapListener(fn, options);
|
|
289
293
|
|
|
290
294
|
target.addEventListener(type, handler, options);
|
package/src/expscan.js
CHANGED
|
@@ -72,7 +72,8 @@ function isValidIdentifierName(s) {
|
|
|
72
72
|
return !keywords.has(s);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export function labeler(custom_words, x)
|
|
75
|
+
export function labeler(custom_words, x)
|
|
76
|
+
{
|
|
76
77
|
if( typeof(x)==='string' ) {
|
|
77
78
|
if(custom_words && custom_words.hasOwnProperty(x)) return custom_words[x];
|
|
78
79
|
|
|
@@ -303,22 +304,34 @@ export function processImportExports(node, jsx)
|
|
|
303
304
|
node.out[m.index].cjs = 'module.exports.default =';
|
|
304
305
|
continue;
|
|
305
306
|
|
|
306
|
-
case 'V':
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
307
|
+
case 'V':{
|
|
308
|
+
const tp = node.out[i];
|
|
309
|
+
node.out[i] = null;
|
|
310
|
+
i++;
|
|
311
|
+
skip_spaces();
|
|
312
|
+
const name = node.out[i];
|
|
313
|
+
|
|
314
|
+
node.out[i] = null;
|
|
315
|
+
i++;
|
|
316
|
+
|
|
317
|
+
skip_spaces();
|
|
318
|
+
node.out[m.index].cjs = `${tp} ${name} = module.exports.${name} `;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
case 'F':{
|
|
322
|
+
const tp = node.out[i];
|
|
323
|
+
node.out[i] = null;
|
|
324
|
+
i++;
|
|
325
|
+
skip_spaces();
|
|
326
|
+
const name = node.out[i];
|
|
327
|
+
|
|
328
|
+
// node.out[i] = null;
|
|
329
|
+
// i++;
|
|
330
|
+
// skip_spaces();
|
|
331
|
+
|
|
332
|
+
node.out[m.index].cjs = `module.exports.${name} = ${tp} `;
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
322
335
|
case '*':
|
|
323
336
|
node.out[i] = null;
|
|
324
337
|
i++;
|
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("/");
|
|
@@ -180,28 +180,45 @@ export function require(path)
|
|
|
180
180
|
if(Lilact?.[LAZY] || isLazy) {
|
|
181
181
|
Lilact[LAZY]=false;
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
let p = Lilact.resolver?.(path);
|
|
184
|
+
|
|
185
|
+
if(p) {
|
|
186
|
+
p = Promise.resolve(p);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
p = fetch(path).then(res => {
|
|
185
190
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
186
191
|
return res.text();
|
|
187
|
-
})
|
|
188
|
-
.then(res => {
|
|
189
|
-
res = run(res, path, false);
|
|
190
|
-
return res?.default ?? res;
|
|
191
|
-
})
|
|
192
|
-
.catch(err => {
|
|
193
|
-
throw err;
|
|
194
192
|
});
|
|
193
|
+
}
|
|
194
|
+
return p.then(res => {
|
|
195
|
+
if(path.endsWith(".css")) {
|
|
196
|
+
injectGlobal(res);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
res = run(res, path, false);
|
|
200
|
+
return res?.default ?? res;
|
|
201
|
+
})
|
|
202
|
+
.catch(err => {
|
|
203
|
+
throw err;
|
|
204
|
+
});
|
|
195
205
|
}
|
|
196
206
|
else {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
207
|
+
const p = Lilact.resolver?.(path);
|
|
208
|
+
if(p) {
|
|
209
|
+
return run(p, path, false);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
const request = new XMLHttpRequest();
|
|
213
|
+
request.open("GET", path, {isInline:false});
|
|
214
|
+
request.send(null);
|
|
215
|
+
if (request.status === 200) {
|
|
216
|
+
if(path.endsWith(".css")) {
|
|
217
|
+
injectGlobal(res);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
return run(request.responseText, path, false);
|
|
221
|
+
}
|
|
205
222
|
}
|
|
206
223
|
}
|
|
207
224
|
}
|