@elementor/editor-components 4.2.0-915 → 4.2.0-916

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/index.mjs CHANGED
@@ -1061,7 +1061,12 @@ import { DetachIcon } from "@elementor/icons";
1061
1061
  import { __ as __10 } from "@wordpress/i18n";
1062
1062
 
1063
1063
  // src/utils/detach-component-instance/detach-component-instance.ts
1064
- import { getContainer, replaceElement } from "@elementor/editor-elements";
1064
+ import { doAfterRender } from "@elementor/editor-canvas";
1065
+ import {
1066
+ getContainer,
1067
+ replaceElement,
1068
+ selectElement
1069
+ } from "@elementor/editor-elements";
1065
1070
  import { undoable } from "@elementor/editor-v1-adapters";
1066
1071
  import { __dispatch as dispatch2, __getState as getState3 } from "@elementor/store";
1067
1072
  import { __ as __9 } from "@wordpress/i18n";
@@ -1259,7 +1264,7 @@ function resolvePropValue(propValue, overrideMap, options) {
1259
1264
  return resolveOverridableOverride(matchingOverride, originValue);
1260
1265
  }
1261
1266
  const matchingOverrideValue = componentInstanceOverridePropTypeUtil.extract(matchingOverride)?.override_value;
1262
- return matchingOverrideValue;
1267
+ return matchingOverrideValue ?? originValue;
1263
1268
  }
1264
1269
  function resolveOverridableOverride(matchingOverride, originValue) {
1265
1270
  if (!originValue || !componentInstanceOverridePropTypeUtil.isValid(originValue)) {
@@ -1355,6 +1360,7 @@ async function detachComponentInstance({
1355
1360
  newElement: detachedInstanceElementData,
1356
1361
  withHistory: false
1357
1362
  });
1363
+ selectElement(detachedElement.id);
1358
1364
  const componentUid = selectComponent(getState3(), componentId)?.uid;
1359
1365
  trackComponentEvent({
1360
1366
  action: "detached",
@@ -1393,6 +1399,9 @@ async function detachComponentInstance({
1393
1399
  })
1394
1400
  );
1395
1401
  }
1402
+ doAfterRender([restoredInstance.id], () => {
1403
+ selectElement(restoredInstance.id);
1404
+ });
1396
1405
  return restoredInstance;
1397
1406
  },
1398
1407
  redo: (_, doReturn, restoredInstance) => {
@@ -1404,6 +1413,7 @@ async function detachComponentInstance({
1404
1413
  newElement: detachedInstanceElementData,
1405
1414
  withHistory: false
1406
1415
  });
1416
+ selectElement(detachedElement.id);
1407
1417
  return {
1408
1418
  ...doReturn,
1409
1419
  detachedElement,
@@ -2647,7 +2657,7 @@ function formatComponentElementsId(elements, path) {
2647
2657
 
2648
2658
  // src/utils/switch-to-component.ts
2649
2659
  import { invalidateDocumentData, switchToDocument } from "@elementor/editor-documents";
2650
- import { getCurrentDocumentContainer, selectElement } from "@elementor/editor-elements";
2660
+ import { getCurrentDocumentContainer, selectElement as selectElement2 } from "@elementor/editor-elements";
2651
2661
  import { __privateRunCommand as runCommand } from "@elementor/editor-v1-adapters";
2652
2662
  async function switchToComponent(componentId, componentInstanceId, element) {
2653
2663
  const selector = getSelector(element, componentInstanceId);
@@ -2661,7 +2671,7 @@ async function switchToComponent(componentId, componentInstanceId, element) {
2661
2671
  const currentDocumentContainer = getCurrentDocumentContainer();
2662
2672
  const topLevelElement = currentDocumentContainer?.children?.[0];
2663
2673
  if (topLevelElement) {
2664
- selectElement(topLevelElement.id);
2674
+ selectElement2(topLevelElement.id);
2665
2675
  expandNavigator();
2666
2676
  }
2667
2677
  }