@elementor/editor-interactions 4.1.0-720 → 4.1.0-722

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.1.0-720",
3
+ "version": "4.1.0-722",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,19 +39,19 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor-controls": "4.1.0-720",
43
- "@elementor/editor-elements": "4.1.0-720",
44
- "@elementor/editor-mcp": "4.1.0-720",
45
- "@elementor/editor-props": "4.1.0-720",
46
- "@elementor/editor-responsive": "4.1.0-720",
47
- "@elementor/editor-ui": "4.1.0-720",
48
- "@elementor/editor-v1-adapters": "4.1.0-720",
42
+ "@elementor/editor-controls": "4.1.0-722",
43
+ "@elementor/editor-elements": "4.1.0-722",
44
+ "@elementor/editor-mcp": "4.1.0-722",
45
+ "@elementor/editor-props": "4.1.0-722",
46
+ "@elementor/editor-responsive": "4.1.0-722",
47
+ "@elementor/editor-ui": "4.1.0-722",
48
+ "@elementor/editor-v1-adapters": "4.1.0-722",
49
49
  "@elementor/icons": "^1.68.0",
50
- "@elementor/schema": "4.1.0-720",
51
- "@elementor/session": "4.1.0-720",
50
+ "@elementor/schema": "4.1.0-722",
51
+ "@elementor/session": "4.1.0-722",
52
52
  "@elementor/ui": "1.36.17",
53
- "@elementor/utils": "4.1.0-720",
54
- "@elementor/events": "4.1.0-720",
53
+ "@elementor/utils": "4.1.0-722",
54
+ "@elementor/events": "4.1.0-722",
55
55
  "@wordpress/i18n": "^5.13.0"
56
56
  },
57
57
  "peerDependencies": {
package/src/init.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { getMCPByDomain } from '@elementor/editor-mcp';
2
+
1
3
  import { initPasteInteractionsCommand } from './commands/paste-interactions';
2
4
  import { Direction } from './components/controls/direction';
3
5
  import { Easing } from './components/controls/easing';
@@ -9,7 +11,7 @@ import { Trigger } from './components/controls/trigger';
9
11
  import { initCleanInteractionIdsOnDuplicate } from './hooks/on-duplicate';
10
12
  import { registerInteractionsControl } from './interactions-controls-registry';
11
13
  import { interactionsRepository } from './interactions-repository';
12
- import { initMcpInteractions } from './mcp';
14
+ import { EDITOR_INTERACTIONS_MCP_INSTRUCTIONS, initMcpInteractions } from './mcp';
13
15
  import { documentElementsInteractionsProvider } from './providers/document-elements-interactions-provider';
14
16
 
15
17
  export function init() {
@@ -60,7 +62,7 @@ export function init() {
60
62
  component: Repeat,
61
63
  } );
62
64
 
63
- initMcpInteractions();
65
+ initMcpInteractions( getMCPByDomain( 'interactions', { instructions: EDITOR_INTERACTIONS_MCP_INSTRUCTIONS } ) );
64
66
  } catch ( error ) {
65
67
  throw error;
66
68
  }
@@ -1 +1,59 @@
1
1
  export const MAX_INTERACTIONS_PER_ELEMENT = 5;
2
+ export const EDITOR_INTERACTIONS_MCP_INSTRUCTIONS = `MCP server for managing element interactions and animations. Use this to add, modify, or remove animations and motion effects triggered by user events such as page load or scroll-into-view.
3
+ ** IMPORTANT **
4
+ Use the "interactions-schema" resource to get the schema of the interactions.
5
+ Actions:
6
+ - get: Read the current interactions on the element.
7
+ - add: Add a new interaction (max ${ MAX_INTERACTIONS_PER_ELEMENT } per element).
8
+ - update: Update an existing interaction by its interactionId.
9
+ - delete: Remove a specific interaction by its interactionId.
10
+ - clear: Remove all interactions from the element.
11
+
12
+ For add/update, provide: trigger, effect, effectType, direction (required for slide effect), duration, delay, easing.
13
+ Use excludedBreakpoints to disable the animation on specific responsive breakpoints (e.g. ["mobile", "tablet"]).
14
+ Example Get Request:
15
+ {
16
+ "elementId": "123",
17
+ "action": "get",
18
+ "interactionId": "123",
19
+ "animationData": {
20
+ "trigger": "click",
21
+ "effect": "fade",
22
+ }
23
+ }
24
+ Example Add Request:
25
+ {
26
+ "elementId": "123",
27
+ "action": "add",
28
+ "animationData": {
29
+ "effectType": "in",
30
+ "direction": "top",
31
+ "trigger": "click",
32
+ "effect": "fade",
33
+ "duration": 1000,
34
+ "delay": 0,
35
+ "easing": "easeIn",
36
+ "excludedBreakpoints": ["mobile", "tablet"],
37
+ }
38
+ }
39
+ Example Update Request:
40
+ {
41
+ "elementId": "123",
42
+ "action": "update",
43
+ "interactionId": "123",
44
+ "animationData": {
45
+ "trigger": "click",
46
+ "effect": "fade",
47
+ }
48
+ }
49
+ Example Delete Request:
50
+ {
51
+ "elementId": "123",
52
+ "action": "delete",
53
+ "interactionId": "123",
54
+ }
55
+ Example Clear Request:
56
+ {
57
+ "elementId": "123",
58
+ "action": "clear",
59
+ }`;
package/src/mcp/index.ts CHANGED
@@ -1,74 +1,20 @@
1
- import { getMCPByDomain } from '@elementor/editor-mcp';
1
+ import { type MCPRegistryEntry } from '@elementor/editor-mcp';
2
2
 
3
- import { MAX_INTERACTIONS_PER_ELEMENT } from './constants';
4
3
  import { initInteractionsSchemaResource } from './resources/interactions-schema-resource';
5
4
  import { initManageElementInteractionTool } from './tools/manage-element-interaction-tool';
6
5
 
7
- export const initMcpInteractions = () => {
8
- const reg = getMCPByDomain( 'interactions', {
9
- instructions: `
10
- MCP server for managing element interactions and animations. Use this to add, modify, or remove animations and motion effects triggered by user events such as page load or scroll-into-view.
11
- ** IMPORTANT **
12
- Use the "interactions-schema" resource to get the schema of the interactions.
13
- Actions:
14
- - get: Read the current interactions on the element.
15
- - add: Add a new interaction (max ${ MAX_INTERACTIONS_PER_ELEMENT } per element).
16
- - update: Update an existing interaction by its interactionId.
17
- - delete: Remove a specific interaction by its interactionId.
18
- - clear: Remove all interactions from the element.
19
-
20
- For add/update, provide: trigger, effect, effectType, direction (required for slide effect), duration, delay, easing.
21
- Use excludedBreakpoints to disable the animation on specific responsive breakpoints (e.g. ["mobile", "tablet"]).
22
- Example Get Request:
23
- {
24
- "elementId": "123",
25
- "action": "get",
26
- "interactionId": "123",
27
- "animationData": {
28
- "trigger": "click",
29
- "effect": "fade",
30
- }
31
- }
32
- Example Add Request:
33
- {
34
- "elementId": "123",
35
- "action": "add",
36
- "animationData": {
37
- "effectType": "in",
38
- "direction": "top",
39
- "trigger": "click",
40
- "effect": "fade",
41
- "duration": 1000,
42
- "delay": 0,
43
- "easing": "easeIn",
44
- "excludedBreakpoints": ["mobile", "tablet"],
45
- }
46
- }
47
- Example Update Request:
48
- {
49
- "elementId": "123",
50
- "action": "update",
51
- "interactionId": "123",
52
- "animationData": {
53
- "trigger": "click",
54
- "effect": "fade",
55
- }
56
- }
57
- Example Delete Request:
58
- {
59
- "elementId": "123",
60
- "action": "delete",
61
- "interactionId": "123",
62
- }
63
- Example Clear Request:
64
- {
65
- "elementId": "123",
66
- "action": "clear",
67
- }
68
- `,
69
- } );
70
- reg.waitForReady().then( () => {
71
- initInteractionsSchemaResource( reg );
72
- initManageElementInteractionTool( reg );
73
- } );
6
+ export * from './constants';
7
+
8
+ export const initMcpInteractions = ( reg: MCPRegistryEntry ) => {
9
+ const { setMCPDescription } = reg;
10
+ setMCPDescription(
11
+ `Everything related to V4 ( Atomic ) interactions.
12
+ # Interactions
13
+ - Create/update/delete interactions
14
+ - Get list of interactions
15
+ - Get details of an interaction
16
+ `
17
+ );
18
+ initInteractionsSchemaResource( reg );
19
+ initManageElementInteractionTool( reg );
74
20
  };