lilact 0.31.11 → 0.31.13
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 +50 -156
- package/dist/lilact.development.js.map +3 -3
- package/dist/lilact.development.min.js +27 -26
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +27 -26
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +1 -1
- package/docs/functions/run.run.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/static/lilact.development.js +50 -156
- package/docs/static/lilact.development.js.map +3 -3
- package/docs/static/lilact.development.min.js +27 -26
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +27 -26
- package/examples/lilact.development.js +50 -156
- package/examples/lilact.development.js.map +3 -3
- package/examples/lilact.development.min.js +27 -26
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +27 -26
- package/package.json +1 -1
- package/src/events.jsx +60 -243
- package/src/jsx.js +4 -0
- package/src/run.jsx +2 -3
|
@@ -4385,177 +4385,69 @@ function TransitionGroup({ children }) {
|
|
|
4385
4385
|
// .tmp/src/events.jsx
|
|
4386
4386
|
var events_exports = {};
|
|
4387
4387
|
__export(events_exports, {
|
|
4388
|
+
SyntheticEvent: () => SyntheticEvent,
|
|
4388
4389
|
addWrappedEventListener: () => addWrappedEventListener,
|
|
4389
4390
|
createSyntheticEvent: () => createSyntheticEvent,
|
|
4390
4391
|
releaseSyntheticEvent: () => releaseSyntheticEvent,
|
|
4391
4392
|
wrapListener: () => wrapListener
|
|
4392
4393
|
});
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4394
|
+
var SyntheticEvent = class {
|
|
4395
|
+
constructor(nativeEvent, currentTarget) {
|
|
4396
|
+
this.nativeEvent = nativeEvent;
|
|
4397
|
+
this.type = nativeEvent.type;
|
|
4398
|
+
this.target = nativeEvent.target || nativeEvent.srcElement || null;
|
|
4399
|
+
this.currentTarget = currentTarget || nativeEvent.currentTarget || null;
|
|
4400
|
+
this.timeStamp = nativeEvent.timeStamp ?? Date.now();
|
|
4401
|
+
this.defaultPrevented = !!nativeEvent.defaultPrevented;
|
|
4402
|
+
let propagationStopped = false;
|
|
4403
|
+
this.isDefaultPrevented = () => this.defaultPrevented;
|
|
4404
|
+
this.isPropagationStopped = () => propagationStopped;
|
|
4405
|
+
this.preventDefault = () => {
|
|
4406
|
+
nativeEvent.preventDefault?.();
|
|
4407
|
+
this.defaultPrevented = true;
|
|
4408
|
+
};
|
|
4409
|
+
this.stopPropagation = () => {
|
|
4410
|
+
nativeEvent.stopPropagation?.();
|
|
4411
|
+
propagationStopped = true;
|
|
4412
|
+
};
|
|
4413
|
+
this.persist = () => {
|
|
4414
|
+
};
|
|
4415
|
+
this.isPersistent = () => true;
|
|
4416
|
+
for (let source = nativeEvent; source && source !== Object.prototype; source = Object.getPrototypeOf(source)) {
|
|
4417
|
+
for (const key of Object.getOwnPropertyNames(source)) {
|
|
4418
|
+
if (key === "constructor" || key in this) continue;
|
|
4419
|
+
Object.defineProperty(this, key, {
|
|
4420
|
+
configurable: true,
|
|
4421
|
+
enumerable: true,
|
|
4422
|
+
get() {
|
|
4423
|
+
const value = nativeEvent[key];
|
|
4424
|
+
return typeof value === "function" ? value.bind(nativeEvent) : value;
|
|
4425
|
+
}
|
|
4426
|
+
});
|
|
4427
|
+
}
|
|
4409
4428
|
}
|
|
4410
|
-
path2.push(window);
|
|
4411
|
-
return path2;
|
|
4412
|
-
};
|
|
4413
|
-
}
|
|
4414
|
-
var _pool = [];
|
|
4415
|
-
var MAX_POOL_SIZE = 10;
|
|
4416
|
-
var POINTER_TYPES = ["mouse", "pen", "touch"];
|
|
4417
|
-
function createSyntheticEvent(nativeEvent, currentTarget) {
|
|
4418
|
-
const e = _pool.length ? _pool.pop() : {};
|
|
4419
|
-
e.nativeEvent = nativeEvent;
|
|
4420
|
-
e.type = nativeEvent.type;
|
|
4421
|
-
e.target = nativeEvent.target || nativeEvent.srcElement || null;
|
|
4422
|
-
e.currentTarget = currentTarget || nativeEvent.currentTarget || null;
|
|
4423
|
-
e.timeStamp = nativeEvent.timeStamp || Date.now();
|
|
4424
|
-
e.defaultPrevented = !!nativeEvent.defaultPrevented;
|
|
4425
|
-
e.isPropagationStopped = false;
|
|
4426
|
-
e.isPersistent = false;
|
|
4427
|
-
e.bubbles = !!nativeEvent.bubbles;
|
|
4428
|
-
e.cancelable = !!nativeEvent.cancelable;
|
|
4429
|
-
e.composed = !!nativeEvent.composed;
|
|
4430
|
-
e.detail = nativeEvent.detail;
|
|
4431
|
-
e.relatedTarget = nativeEvent.relatedTarget || (nativeEvent.fromElement ? nativeEvent.fromElement : null) || (nativeEvent.toElement ? nativeEvent.toElement : null) || null;
|
|
4432
|
-
e.altKey = !!nativeEvent.altKey;
|
|
4433
|
-
e.ctrlKey = !!nativeEvent.ctrlKey;
|
|
4434
|
-
e.metaKey = !!nativeEvent.metaKey;
|
|
4435
|
-
e.shiftKey = !!nativeEvent.shiftKey;
|
|
4436
|
-
e.isDefaultPrevented = () => e.defaultPrevented;
|
|
4437
|
-
e.preventDefault = () => {
|
|
4438
|
-
if (nativeEvent.preventDefault) nativeEvent.preventDefault();
|
|
4439
|
-
e.defaultPrevented = true;
|
|
4440
|
-
};
|
|
4441
|
-
e.stopPropagation = () => {
|
|
4442
|
-
if (nativeEvent.stopPropagation) nativeEvent.stopPropagation();
|
|
4443
|
-
e.isPropagationStopped = true;
|
|
4444
|
-
};
|
|
4445
|
-
e.persist = () => {
|
|
4446
|
-
e.isPersistent = true;
|
|
4447
|
-
};
|
|
4448
|
-
e.key = nativeEvent.key || null;
|
|
4449
|
-
e.code = nativeEvent.code || null;
|
|
4450
|
-
e.which = nativeEvent.which ?? nativeEvent.keyCode ?? null;
|
|
4451
|
-
e.button = nativeEvent.button ?? null;
|
|
4452
|
-
e.buttons = nativeEvent.buttons ?? null;
|
|
4453
|
-
e.pointerId = nativeEvent.pointerId ?? null;
|
|
4454
|
-
e.pointerType = nativeEvent.pointerType ?? null;
|
|
4455
|
-
e.isPrimary = nativeEvent.isPrimary ?? null;
|
|
4456
|
-
e.clientX = nativeEvent.clientX ?? 0;
|
|
4457
|
-
e.clientY = nativeEvent.clientY ?? 0;
|
|
4458
|
-
e.screenX = nativeEvent.screenX ?? 0;
|
|
4459
|
-
e.screenY = nativeEvent.screenY ?? 0;
|
|
4460
|
-
e.pageX = nativeEvent.pageX ?? null;
|
|
4461
|
-
e.pageY = nativeEvent.pageY ?? null;
|
|
4462
|
-
e.movementX = nativeEvent.movementX ?? 0;
|
|
4463
|
-
e.movementY = nativeEvent.movementY ?? 0;
|
|
4464
|
-
e.pressure = nativeEvent.pressure ?? null;
|
|
4465
|
-
e.tiltX = nativeEvent.tiltX ?? null;
|
|
4466
|
-
e.tiltY = nativeEvent.tiltY ?? null;
|
|
4467
|
-
e.width = nativeEvent.width ?? null;
|
|
4468
|
-
e.height = nativeEvent.height ?? null;
|
|
4469
|
-
e.pointerEventsSupported = POINTER_TYPES.includes(e.pointerType);
|
|
4470
|
-
try {
|
|
4471
|
-
const tgt = e.target;
|
|
4472
|
-
e.value = tgt && "value" in tgt ? tgt.value : void 0;
|
|
4473
|
-
e.checked = tgt && "checked" in tgt ? tgt.checked : void 0;
|
|
4474
|
-
e.selectionStart = tgt && "selectionStart" in tgt ? tgt.selectionStart : void 0;
|
|
4475
|
-
e.selectionEnd = tgt && "selectionEnd" in tgt ? tgt.selectionEnd : void 0;
|
|
4476
|
-
} catch (err) {
|
|
4477
|
-
e.value = void 0;
|
|
4478
|
-
e.checked = void 0;
|
|
4479
|
-
e.selectionStart = void 0;
|
|
4480
|
-
e.selectionEnd = void 0;
|
|
4481
|
-
}
|
|
4482
|
-
e.touches = nativeEvent.touches || null;
|
|
4483
|
-
e.targetTouches = nativeEvent.targetTouches || null;
|
|
4484
|
-
e.changedTouches = nativeEvent.changedTouches || null;
|
|
4485
|
-
e.path = typeof nativeEvent.composedPath === "function" ? nativeEvent.composedPath() : [e.target];
|
|
4486
|
-
e.repeat = nativeEvent.repeat ?? false;
|
|
4487
|
-
e.location = nativeEvent.location ?? 0;
|
|
4488
|
-
return e;
|
|
4489
|
-
}
|
|
4490
|
-
function releaseSyntheticEvent(e) {
|
|
4491
|
-
if (e && !e.isPersistent) {
|
|
4492
|
-
e.nativeEvent = null;
|
|
4493
|
-
e.type = null;
|
|
4494
|
-
e.target = null;
|
|
4495
|
-
e.currentTarget = null;
|
|
4496
|
-
e.timeStamp = 0;
|
|
4497
|
-
e.defaultPrevented = false;
|
|
4498
|
-
e.isPropagationStopped = false;
|
|
4499
|
-
e.isPersistent = false;
|
|
4500
|
-
e.isDefaultPrevented = null;
|
|
4501
|
-
e.preventDefault = null;
|
|
4502
|
-
e.stopPropagation = null;
|
|
4503
|
-
e.persist = null;
|
|
4504
|
-
e.bubbles = false;
|
|
4505
|
-
e.cancelable = false;
|
|
4506
|
-
e.composed = false;
|
|
4507
|
-
e.detail = void 0;
|
|
4508
|
-
e.relatedTarget = null;
|
|
4509
|
-
e.altKey = false;
|
|
4510
|
-
e.ctrlKey = false;
|
|
4511
|
-
e.metaKey = false;
|
|
4512
|
-
e.shiftKey = false;
|
|
4513
|
-
e.key = null;
|
|
4514
|
-
e.code = null;
|
|
4515
|
-
e.which = null;
|
|
4516
|
-
e.button = null;
|
|
4517
|
-
e.buttons = null;
|
|
4518
|
-
e.pointerId = null;
|
|
4519
|
-
e.pointerType = null;
|
|
4520
|
-
e.isPrimary = null;
|
|
4521
|
-
e.clientX = 0;
|
|
4522
|
-
e.clientY = 0;
|
|
4523
|
-
e.screenX = 0;
|
|
4524
|
-
e.screenY = 0;
|
|
4525
|
-
e.pageX = null;
|
|
4526
|
-
e.pageY = null;
|
|
4527
|
-
e.movementX = 0;
|
|
4528
|
-
e.movementY = 0;
|
|
4529
|
-
e.pressure = null;
|
|
4530
|
-
e.tiltX = null;
|
|
4531
|
-
e.tiltY = null;
|
|
4532
|
-
e.width = null;
|
|
4533
|
-
e.height = null;
|
|
4534
|
-
e.value = void 0;
|
|
4535
|
-
e.checked = void 0;
|
|
4536
|
-
e.selectionStart = void 0;
|
|
4537
|
-
e.selectionEnd = void 0;
|
|
4538
|
-
e.touches = null;
|
|
4539
|
-
e.targetTouches = null;
|
|
4540
|
-
e.changedTouches = null;
|
|
4541
|
-
e.path = null;
|
|
4542
|
-
e.repeat = false;
|
|
4543
|
-
e.location = 0;
|
|
4544
|
-
if (_pool.length < MAX_POOL_SIZE) _pool.push(e);
|
|
4545
4429
|
}
|
|
4430
|
+
};
|
|
4431
|
+
function createSyntheticEvent(nativeEvent, currentTarget) {
|
|
4432
|
+
return new SyntheticEvent(nativeEvent, currentTarget);
|
|
4433
|
+
}
|
|
4434
|
+
function releaseSyntheticEvent(event) {
|
|
4435
|
+
if (event) event.currentTarget = null;
|
|
4546
4436
|
}
|
|
4547
4437
|
function wrapListener(fn, opts = {}) {
|
|
4548
4438
|
const { stopPropagationOnTrueReturn = false } = opts;
|
|
4549
4439
|
return function handler(nativeEvent) {
|
|
4550
|
-
const
|
|
4551
|
-
|
|
4440
|
+
const event = createSyntheticEvent(
|
|
4441
|
+
nativeEvent,
|
|
4442
|
+
this || nativeEvent.currentTarget || null
|
|
4443
|
+
);
|
|
4552
4444
|
try {
|
|
4553
|
-
const result2 = fn(
|
|
4445
|
+
const result2 = fn(event);
|
|
4554
4446
|
if (stopPropagationOnTrueReturn && result2 === true) {
|
|
4555
|
-
|
|
4447
|
+
event.stopPropagation();
|
|
4556
4448
|
}
|
|
4557
4449
|
} finally {
|
|
4558
|
-
releaseSyntheticEvent(
|
|
4450
|
+
releaseSyntheticEvent(event);
|
|
4559
4451
|
}
|
|
4560
4452
|
};
|
|
4561
4453
|
}
|
|
@@ -7006,6 +6898,7 @@ function transpileJSX(jsx2, {
|
|
|
7006
6898
|
} = {}) {
|
|
7007
6899
|
transpilerConfig.preprocessorDelimiter ?? (transpilerConfig.preprocessorDelimiter = "\u0294");
|
|
7008
6900
|
transpilerConfig.injectTraceLabels ?? (transpilerConfig.injectTraceLabels = injectTraceLabels);
|
|
6901
|
+
jsx2 += "\n";
|
|
7009
6902
|
const eols = scanEOLs(jsx2);
|
|
7010
6903
|
raiseError = ((eols2, msg, index2) => {
|
|
7011
6904
|
const rc = getRowCol(eols2, index2);
|
|
@@ -7258,6 +7151,7 @@ export {
|
|
|
7258
7151
|
SplitPane,
|
|
7259
7152
|
Suspense,
|
|
7260
7153
|
SwitchTransition,
|
|
7154
|
+
SyntheticEvent,
|
|
7261
7155
|
TEXT2 as TEXT,
|
|
7262
7156
|
Transition,
|
|
7263
7157
|
TransitionGroup,
|