@lvce-editor/renderer-process 30.10.0 → 30.10.1

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.
@@ -1399,9 +1399,7 @@ const setStyle = ($Element, styleString) => {
1399
1399
  }
1400
1400
  };
1401
1401
 
1402
- const optionalAttributeProps = new Map([['ariaActivedescendant', 'aria-activedescendant'], ['ariaOwns', 'aria-owns']]);
1403
- const mappedAttributeProps = new Map([['ariaControls', 'aria-controls'], ['ariaLabelledBy', 'aria-labelledby']]);
1404
- const removedAttributeProps = new Map([['ariaActivedescendant', 'aria-activedescendant'], ['ariaControls', 'aria-controls'], ['ariaLabelledBy', 'aria-labelledby'], ['ariaOwns', 'aria-owns'], ['className', 'class'], ['htmlFor', 'for'], ['inputType', 'type']]);
1402
+ 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']]);
1405
1403
  const pixelStyleProps = new Set(['height', 'left', 'marginTop', 'paddingLeft', 'paddingRight', 'top', 'width']);
1406
1404
  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']);
1407
1405
  const setOptionalAttribute = ($Element, attributeName, value) => {
@@ -1446,18 +1444,25 @@ const removeProp = ($Element, key) => {
1446
1444
  $Element.removeAttribute(attributeName);
1447
1445
  };
1448
1446
  const setProp = ($Element, key, value, eventMap, newEventMap) => {
1449
- const optionalAttributeName = optionalAttributeProps.get(key);
1450
- if (optionalAttributeName) {
1451
- setOptionalAttribute($Element, optionalAttributeName, value);
1452
- return;
1453
- }
1454
- const mappedAttributeName = mappedAttributeProps.get(key);
1455
- if (mappedAttributeName) {
1456
- $Element.setAttribute(mappedAttributeName, value);
1457
- return;
1458
- }
1459
- if (key === 'childCount' || key === 'type') {
1460
- return;
1447
+ switch (key) {
1448
+ case 'ariaActivedescendant':
1449
+ setOptionalAttribute($Element, 'aria-activedescendant', value);
1450
+ return;
1451
+ case 'ariaControls':
1452
+ $Element.setAttribute('aria-controls', value);
1453
+ return;
1454
+ case 'ariaDescribedBy':
1455
+ $Element.setAttribute('aria-describedby', value);
1456
+ return;
1457
+ case 'ariaInvalid':
1458
+ $Element.setAttribute('aria-invalid', value);
1459
+ return;
1460
+ case 'ariaLabelledBy':
1461
+ $Element.setAttribute('aria-labelledby', value);
1462
+ return;
1463
+ case 'ariaOwns':
1464
+ setOptionalAttribute($Element, 'aria-owns', value);
1465
+ return;
1461
1466
  }
1462
1467
  if (key === 'height' || key === 'width') {
1463
1468
  setDimension($Element, key, value);
@@ -1506,6 +1511,9 @@ const setProp = ($Element, key, value, eventMap, newEventMap) => {
1506
1511
 
1507
1512
  const setProps = ($Element, props, eventMap, newEventMap) => {
1508
1513
  for (const key in props) {
1514
+ if (key === 'childCount' || key === 'type') {
1515
+ continue;
1516
+ }
1509
1517
  setProp($Element, key, props[key], eventMap, newEventMap);
1510
1518
  }
1511
1519
  };
@@ -1620,7 +1628,7 @@ const handleNavigateChild = (state, patches, patchIndex) => {
1620
1628
  return true;
1621
1629
  }
1622
1630
  const nextPatch = patches[patchIndex + 1];
1623
- if (nextPatch && nextPatch.type === Replace && patch.index === $Children.length) {
1631
+ if (nextPatch && (nextPatch.type === Replace || nextPatch.type === SetReferenceNodeUid) && patch.index === $Children.length) {
1624
1632
  const $Placeholder = document.createComment('virtual-dom-placeholder');
1625
1633
  state.current.append($Placeholder);
1626
1634
  state.current = $Placeholder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.10.0",
3
+ "version": "30.10.1",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"