@elementor/editor-interactions 4.0.0-644 → 4.0.0-645

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.js CHANGED
@@ -1495,6 +1495,7 @@ var EMPTY_INTERACTIONS = {
1495
1495
  version: 1,
1496
1496
  items: []
1497
1497
  };
1498
+ var EFFECTS_WITHOUT_TYPE = ["custom"];
1498
1499
  var initManageElementInteractionTool = (reg) => {
1499
1500
  const { addTool } = reg;
1500
1501
  const extendedSchema = (0, import_utils2.isProActive)() ? { ...baseSchema, ...proSchema } : baseSchema;
@@ -1521,6 +1522,9 @@ var initManageElementInteractionTool = (reg) => {
1521
1522
  },
1522
1523
  handler: (input) => {
1523
1524
  const { elementId, action, interactionId, ...animationData } = input;
1525
+ const { effectType, ...restAnimationData } = animationData;
1526
+ const effect = restAnimationData.effect;
1527
+ const resolvedType = effectType ?? (effect && !EFFECTS_WITHOUT_TYPE.includes(effect) ? "in" : void 0);
1524
1528
  const allInteractions = interactionsRepository.all();
1525
1529
  const elementData = allInteractions.find((data) => data.elementId === elementId);
1526
1530
  const currentInteractions = elementData?.interactions ?? EMPTY_INTERACTIONS;
@@ -1560,7 +1564,8 @@ var initManageElementInteractionTool = (reg) => {
1560
1564
  }
1561
1565
  const newItem = createInteractionItem({
1562
1566
  interactionId: generateTempInteractionId(),
1563
- ...animationData
1567
+ ...restAnimationData,
1568
+ type: resolvedType
1564
1569
  });
1565
1570
  updatedItems = [...updatedItems, newItem];
1566
1571
  break;
@@ -1579,7 +1584,8 @@ var initManageElementInteractionTool = (reg) => {
1579
1584
  }
1580
1585
  const updatedItem = createInteractionItem({
1581
1586
  interactionId,
1582
- ...animationData
1587
+ ...restAnimationData,
1588
+ type: resolvedType
1583
1589
  });
1584
1590
  updatedItems = [
1585
1591
  ...updatedItems.slice(0, itemIndex),