@lvce-editor/renderer-process 23.3.0 → 23.5.0
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/rendererProcessMain.js +38 -1
- package/package.json +1 -1
|
@@ -242,12 +242,17 @@ const Code$2 = 'code';
|
|
|
242
242
|
const Label$2 = 'label';
|
|
243
243
|
const Dt$2 = 'dt';
|
|
244
244
|
const Iframe$1 = 'iframe';
|
|
245
|
+
const Em$1 = 'em';
|
|
246
|
+
const Strong$1 = 'strong';
|
|
245
247
|
const Style$1 = 'style';
|
|
246
248
|
const Html$1 = 'html';
|
|
247
249
|
const Head$1 = 'head';
|
|
248
250
|
const Title$1 = 'title';
|
|
249
251
|
const Meta$1 = 'meta';
|
|
250
252
|
const Canvas$1 = 'canvas';
|
|
253
|
+
const Form$1 = 'form';
|
|
254
|
+
const Quote$1$1 = 'quote';
|
|
255
|
+
const BlockQuote$1 = 'blockquote';
|
|
251
256
|
const Audio$1$1 = 0;
|
|
252
257
|
const Button$1 = 1;
|
|
253
258
|
const Col$1 = 2;
|
|
@@ -304,12 +309,17 @@ const Code$1 = 65;
|
|
|
304
309
|
const Label$1 = 66;
|
|
305
310
|
const Dt$1 = 67;
|
|
306
311
|
const Iframe = 68;
|
|
312
|
+
const Strong = 70;
|
|
313
|
+
const Em = 71;
|
|
307
314
|
const Style = 72;
|
|
308
315
|
const Html = 73;
|
|
309
316
|
const Head = 74;
|
|
310
317
|
const Title = 75;
|
|
311
318
|
const Meta = 76;
|
|
312
319
|
const Canvas = 77;
|
|
320
|
+
const Form = 78;
|
|
321
|
+
const BlockQuote = 79;
|
|
322
|
+
const Quote$2 = 80;
|
|
313
323
|
const Reference$1 = 100;
|
|
314
324
|
const VirtualDomElements$1 = {
|
|
315
325
|
__proto__: null,
|
|
@@ -325,6 +335,8 @@ const getElementTag$1 = type => {
|
|
|
325
335
|
return Aside$2;
|
|
326
336
|
case Audio$1$1:
|
|
327
337
|
return Audio$2;
|
|
338
|
+
case BlockQuote:
|
|
339
|
+
return BlockQuote$1;
|
|
328
340
|
case Br$1:
|
|
329
341
|
return Br$2;
|
|
330
342
|
case Button$1:
|
|
@@ -351,12 +363,16 @@ const getElementTag$1 = type => {
|
|
|
351
363
|
return Dl$2;
|
|
352
364
|
case Dt$1:
|
|
353
365
|
return Dt$2;
|
|
366
|
+
case Em:
|
|
367
|
+
return Em$1;
|
|
354
368
|
case Figcaption$1:
|
|
355
369
|
return Figcaption$2;
|
|
356
370
|
case Figure$1:
|
|
357
371
|
return Figure$2;
|
|
358
372
|
case Footer$1:
|
|
359
373
|
return Footer$2;
|
|
374
|
+
case Form:
|
|
375
|
+
return Form$1;
|
|
360
376
|
case H1$1:
|
|
361
377
|
return H1$2;
|
|
362
378
|
case H2$1:
|
|
@@ -405,6 +421,8 @@ const getElementTag$1 = type => {
|
|
|
405
421
|
return P$2;
|
|
406
422
|
case Pre$1:
|
|
407
423
|
return Pre$2;
|
|
424
|
+
case Quote$2:
|
|
425
|
+
return Quote$1$1;
|
|
408
426
|
case Search$1:
|
|
409
427
|
return Search$2;
|
|
410
428
|
case Section$1:
|
|
@@ -413,6 +431,8 @@ const getElementTag$1 = type => {
|
|
|
413
431
|
return Select$2;
|
|
414
432
|
case Span$1:
|
|
415
433
|
return Span$2;
|
|
434
|
+
case Strong:
|
|
435
|
+
return Strong$1;
|
|
416
436
|
case Style:
|
|
417
437
|
return Style$1;
|
|
418
438
|
case Table$1:
|
|
@@ -541,6 +561,7 @@ const getWrappedListener$1 = (listener, returnValue) => {
|
|
|
541
561
|
}
|
|
542
562
|
return get$9(listener);
|
|
543
563
|
};
|
|
564
|
+
const attachedListeners = new WeakMap();
|
|
544
565
|
const getOptions = fn => {
|
|
545
566
|
if (fn.passive) {
|
|
546
567
|
return {
|
|
@@ -556,11 +577,21 @@ const getOptions = fn => {
|
|
|
556
577
|
};
|
|
557
578
|
const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
|
|
558
579
|
const keyLower = key.toLowerCase();
|
|
580
|
+
const listenersByEvent = attachedListeners.get($Node) || new Map();
|
|
581
|
+
const previous = listenersByEvent.get(keyLower);
|
|
582
|
+
if (previous) {
|
|
583
|
+
$Node.removeEventListener(keyLower, previous.listener, previous.options);
|
|
584
|
+
}
|
|
559
585
|
if (newEventMap && newEventMap[value]) {
|
|
560
586
|
const fn = newEventMap[value];
|
|
561
587
|
const options = getOptions(fn);
|
|
562
588
|
// TODO support event listener options
|
|
563
589
|
$Node.addEventListener(keyLower, newEventMap[value], options);
|
|
590
|
+
listenersByEvent.set(keyLower, {
|
|
591
|
+
listener: newEventMap[value],
|
|
592
|
+
options
|
|
593
|
+
});
|
|
594
|
+
attachedListeners.set($Node, listenersByEvent);
|
|
564
595
|
return;
|
|
565
596
|
}
|
|
566
597
|
const listener = eventMap[value];
|
|
@@ -571,6 +602,11 @@ const attachEvent$1 = ($Node, eventMap, key, value, newEventMap) => {
|
|
|
571
602
|
const options = getEventListenerOptions$1(key, value);
|
|
572
603
|
const wrapped = getWrappedListener$1(listener, eventMap.returnValue);
|
|
573
604
|
$Node.addEventListener(keyLower, wrapped, options);
|
|
605
|
+
listenersByEvent.set(keyLower, {
|
|
606
|
+
listener: wrapped,
|
|
607
|
+
options
|
|
608
|
+
});
|
|
609
|
+
attachedListeners.set($Node, listenersByEvent);
|
|
574
610
|
};
|
|
575
611
|
const STYLE_REGEX = /([^:;]+):\s*([^;]+)/g;
|
|
576
612
|
const KEBAB_CASE_REGEX = /-([a-z])/g;
|
|
@@ -674,6 +710,7 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
|
|
|
674
710
|
case 'onPointerOver':
|
|
675
711
|
case 'onScroll':
|
|
676
712
|
case 'onSelectionChange':
|
|
713
|
+
case 'onSubmit':
|
|
677
714
|
case 'onWheel':
|
|
678
715
|
const eventName = key.slice(2).toLowerCase();
|
|
679
716
|
if (!eventMap || !value) {
|
|
@@ -994,7 +1031,7 @@ const getEventListenerArg = (param, event) => {
|
|
|
994
1031
|
case 'event.y':
|
|
995
1032
|
return event.y;
|
|
996
1033
|
default:
|
|
997
|
-
if (param.startsWith('event.target.dataset')) {
|
|
1034
|
+
if (typeof param === 'string' && param.startsWith('event.target.dataset')) {
|
|
998
1035
|
const rest = param.slice('event.target.dataset.'.length);
|
|
999
1036
|
return event.target.dataset[rest];
|
|
1000
1037
|
}
|