@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-interactions",
3
- "version": "4.0.0-644",
3
+ "version": "4.0.0-645",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,18 +39,18 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor-controls": "4.0.0-644",
43
- "@elementor/editor-elements": "4.0.0-644",
44
- "@elementor/editor-mcp": "4.0.0-644",
45
- "@elementor/editor-props": "4.0.0-644",
46
- "@elementor/editor-responsive": "4.0.0-644",
47
- "@elementor/editor-ui": "4.0.0-644",
48
- "@elementor/editor-v1-adapters": "4.0.0-644",
42
+ "@elementor/editor-controls": "4.0.0-645",
43
+ "@elementor/editor-elements": "4.0.0-645",
44
+ "@elementor/editor-mcp": "4.0.0-645",
45
+ "@elementor/editor-props": "4.0.0-645",
46
+ "@elementor/editor-responsive": "4.0.0-645",
47
+ "@elementor/editor-ui": "4.0.0-645",
48
+ "@elementor/editor-v1-adapters": "4.0.0-645",
49
49
  "@elementor/icons": "^1.68.0",
50
- "@elementor/schema": "4.0.0-644",
51
- "@elementor/session": "4.0.0-644",
50
+ "@elementor/schema": "4.0.0-645",
51
+ "@elementor/session": "4.0.0-645",
52
52
  "@elementor/ui": "1.36.17",
53
- "@elementor/utils": "4.0.0-644",
53
+ "@elementor/utils": "4.0.0-645",
54
54
  "@wordpress/i18n": "^5.13.0"
55
55
  },
56
56
  "peerDependencies": {
@@ -21,6 +21,8 @@ const EMPTY_INTERACTIONS: ElementInteractions = {
21
21
  items: [],
22
22
  };
23
23
 
24
+ const EFFECTS_WITHOUT_TYPE = [ 'custom' ];
25
+
24
26
  export const initManageElementInteractionTool = ( reg: MCPRegistryEntry ) => {
25
27
  const { addTool } = reg;
26
28
  const extendedSchema = isProActive() ? { ...baseSchema, ...proSchema } : baseSchema;
@@ -60,6 +62,13 @@ export const initManageElementInteractionTool = ( reg: MCPRegistryEntry ) => {
60
62
  [ key: string ]: unknown;
61
63
  } ) => {
62
64
  const { elementId, action, interactionId, ...animationData } = input;
65
+ const { effectType, ...restAnimationData } = animationData as {
66
+ effectType?: string;
67
+ [ key: string ]: unknown;
68
+ };
69
+ const effect = restAnimationData.effect as string | undefined;
70
+ const resolvedType =
71
+ effectType ?? ( effect && ! EFFECTS_WITHOUT_TYPE.includes( effect ) ? 'in' : undefined );
63
72
 
64
73
  const allInteractions = interactionsRepository.all();
65
74
  const elementData = allInteractions.find( ( data ) => data.elementId === elementId );
@@ -106,7 +115,8 @@ export const initManageElementInteractionTool = ( reg: MCPRegistryEntry ) => {
106
115
 
107
116
  const newItem = createInteractionItem( {
108
117
  interactionId: generateTempInteractionId(),
109
- ...animationData,
118
+ ...restAnimationData,
119
+ type: resolvedType,
110
120
  } );
111
121
 
112
122
  updatedItems = [ ...updatedItems, newItem ];
@@ -130,7 +140,8 @@ export const initManageElementInteractionTool = ( reg: MCPRegistryEntry ) => {
130
140
 
131
141
  const updatedItem = createInteractionItem( {
132
142
  interactionId,
133
- ...animationData,
143
+ ...restAnimationData,
144
+ type: resolvedType,
134
145
  } );
135
146
 
136
147
  updatedItems = [