@elementor/editor-interactions 4.0.0-644 → 4.0.0-646
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 +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/mcp/tools/manage-element-interaction-tool.ts +13 -2
package/dist/index.mjs
CHANGED
|
@@ -1426,6 +1426,7 @@ var EMPTY_INTERACTIONS = {
|
|
|
1426
1426
|
version: 1,
|
|
1427
1427
|
items: []
|
|
1428
1428
|
};
|
|
1429
|
+
var EFFECTS_WITHOUT_TYPE = ["custom"];
|
|
1429
1430
|
var initManageElementInteractionTool = (reg) => {
|
|
1430
1431
|
const { addTool } = reg;
|
|
1431
1432
|
const extendedSchema = isProActive2() ? { ...baseSchema, ...proSchema } : baseSchema;
|
|
@@ -1452,6 +1453,9 @@ var initManageElementInteractionTool = (reg) => {
|
|
|
1452
1453
|
},
|
|
1453
1454
|
handler: (input) => {
|
|
1454
1455
|
const { elementId, action, interactionId, ...animationData } = input;
|
|
1456
|
+
const { effectType, ...restAnimationData } = animationData;
|
|
1457
|
+
const effect = restAnimationData.effect;
|
|
1458
|
+
const resolvedType = effectType ?? (effect && !EFFECTS_WITHOUT_TYPE.includes(effect) ? "in" : void 0);
|
|
1455
1459
|
const allInteractions = interactionsRepository.all();
|
|
1456
1460
|
const elementData = allInteractions.find((data) => data.elementId === elementId);
|
|
1457
1461
|
const currentInteractions = elementData?.interactions ?? EMPTY_INTERACTIONS;
|
|
@@ -1491,7 +1495,8 @@ var initManageElementInteractionTool = (reg) => {
|
|
|
1491
1495
|
}
|
|
1492
1496
|
const newItem = createInteractionItem({
|
|
1493
1497
|
interactionId: generateTempInteractionId(),
|
|
1494
|
-
...
|
|
1498
|
+
...restAnimationData,
|
|
1499
|
+
type: resolvedType
|
|
1495
1500
|
});
|
|
1496
1501
|
updatedItems = [...updatedItems, newItem];
|
|
1497
1502
|
break;
|
|
@@ -1510,7 +1515,8 @@ var initManageElementInteractionTool = (reg) => {
|
|
|
1510
1515
|
}
|
|
1511
1516
|
const updatedItem = createInteractionItem({
|
|
1512
1517
|
interactionId,
|
|
1513
|
-
...
|
|
1518
|
+
...restAnimationData,
|
|
1519
|
+
type: resolvedType
|
|
1514
1520
|
});
|
|
1515
1521
|
updatedItems = [
|
|
1516
1522
|
...updatedItems.slice(0, itemIndex),
|