@lvce-editor/renderer-process 30.13.1 → 30.13.2
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 +17 -11
- package/package.json +1 -1
|
@@ -443,6 +443,17 @@ const getTargetName = event => {
|
|
|
443
443
|
}
|
|
444
444
|
return namedTarget?.getAttribute?.('name') || namedTarget?.name || '';
|
|
445
445
|
};
|
|
446
|
+
const getNestedProperty = (value, path) => {
|
|
447
|
+
const parts = path.split('.');
|
|
448
|
+
let current = value;
|
|
449
|
+
for (const part of parts) {
|
|
450
|
+
if (current === undefined || current === null) {
|
|
451
|
+
return undefined;
|
|
452
|
+
}
|
|
453
|
+
current = current[part];
|
|
454
|
+
}
|
|
455
|
+
return current;
|
|
456
|
+
};
|
|
446
457
|
const getEventListenerArg = (param, event) => {
|
|
447
458
|
switch (param) {
|
|
448
459
|
case 'event.altKey':
|
|
@@ -507,17 +518,12 @@ const getEventListenerArg = (param, event) => {
|
|
|
507
518
|
return event.y;
|
|
508
519
|
default:
|
|
509
520
|
if (typeof param === 'string' && param.startsWith('event.currentTarget.')) {
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
let current = event.currentTarget;
|
|
513
|
-
for (const part of parts) {
|
|
514
|
-
current = current[part];
|
|
515
|
-
}
|
|
516
|
-
return current;
|
|
521
|
+
const path = param.slice('event.currentTarget.'.length);
|
|
522
|
+
return getNestedProperty(event.currentTarget, path);
|
|
517
523
|
}
|
|
518
|
-
if (typeof param === 'string' && param.startsWith('event.target.
|
|
519
|
-
const
|
|
520
|
-
return event.target
|
|
524
|
+
if (typeof param === 'string' && param.startsWith('event.target.')) {
|
|
525
|
+
const path = param.slice('event.target.'.length);
|
|
526
|
+
return getNestedProperty(event.target, path);
|
|
521
527
|
}
|
|
522
528
|
return param;
|
|
523
529
|
}
|
|
@@ -1414,7 +1420,7 @@ const setStyle = ($Element, styleString) => {
|
|
|
1414
1420
|
|
|
1415
1421
|
const removedAttributeProps = new Map([['ariaActivedescendant', 'aria-activedescendant'], ['ariaControls', 'aria-controls'], ['ariaDescribedBy', 'aria-describedby'], ['ariaInvalid', 'aria-invalid'], ['ariaLabelledBy', 'aria-labelledby'], ['ariaOwns', 'aria-owns'], ['className', 'class'], ['htmlFor', 'for'], ['inputType', 'type']]);
|
|
1416
1422
|
const pixelStyleProps = new Set(['height', 'left', 'marginTop', 'paddingLeft', 'paddingRight', 'top', 'width']);
|
|
1417
|
-
const eventProps = new Set(['onBlur', 'onChange', 'onClick', 'onContextMenu', 'onBeforeInput', 'onDblClick', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onFocus', 'onFocusIn', 'onFocusOut', 'onInput', 'onKeydown', 'onKeyDown', 'onKeyUp', 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onPointerDown', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onScroll', 'onSelectionChange', 'onSubmit', 'onWheel']);
|
|
1423
|
+
const eventProps = new Set(['onBlur', 'onChange', 'onClick', 'onContextMenu', 'onBeforeInput', 'onDblClick', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onError', 'onFocus', 'onFocusIn', 'onFocusOut', 'onInput', 'onKeydown', 'onKeyDown', 'onKeyUp', 'onLoadedData', 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onPointerDown', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onScroll', 'onSelectionChange', 'onSubmit', 'onTimeUpdate', 'onWheel']);
|
|
1418
1424
|
const setOptionalAttribute = ($Element, attributeName, value) => {
|
|
1419
1425
|
if (value) {
|
|
1420
1426
|
$Element.setAttribute(attributeName, value);
|