@elementor/editor-interactions 4.1.0-838 → 4.1.0-beta2
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 +21 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/init.ts +11 -2
- package/src/mcp/constants.ts +8 -2
- package/src/mcp/tools/manage-element-interaction-tool.ts +3 -0
- package/src/mcp/tools/schema.ts +10 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-interactions",
|
|
3
|
-
"version": "4.1.0-
|
|
3
|
+
"version": "4.1.0-beta2",
|
|
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-
|
|
43
|
-
"@elementor/editor-elements": "4.1.0-
|
|
44
|
-
"@elementor/editor-mcp": "4.1.0-
|
|
45
|
-
"@elementor/editor-props": "4.1.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.1.0-
|
|
47
|
-
"@elementor/editor-ui": "4.1.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.1.0-
|
|
42
|
+
"@elementor/editor-controls": "4.1.0-beta2",
|
|
43
|
+
"@elementor/editor-elements": "4.1.0-beta2",
|
|
44
|
+
"@elementor/editor-mcp": "4.1.0-beta2",
|
|
45
|
+
"@elementor/editor-props": "4.1.0-beta2",
|
|
46
|
+
"@elementor/editor-responsive": "4.1.0-beta2",
|
|
47
|
+
"@elementor/editor-ui": "4.1.0-beta2",
|
|
48
|
+
"@elementor/editor-v1-adapters": "4.1.0-beta2",
|
|
49
49
|
"@elementor/icons": "~1.75.1",
|
|
50
|
-
"@elementor/schema": "4.1.0-
|
|
51
|
-
"@elementor/session": "4.1.0-
|
|
50
|
+
"@elementor/schema": "4.1.0-beta2",
|
|
51
|
+
"@elementor/session": "4.1.0-beta2",
|
|
52
52
|
"@elementor/ui": "1.37.5",
|
|
53
|
-
"@elementor/utils": "4.1.0-
|
|
54
|
-
"@elementor/events": "4.1.0-
|
|
53
|
+
"@elementor/utils": "4.1.0-beta2",
|
|
54
|
+
"@elementor/events": "4.1.0-beta2",
|
|
55
55
|
"@wordpress/i18n": "^5.13.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
package/src/init.ts
CHANGED
|
@@ -11,7 +11,11 @@ import { Trigger } from './components/controls/trigger';
|
|
|
11
11
|
import { initCleanInteractionIdsOnDuplicate } from './hooks/on-duplicate';
|
|
12
12
|
import { registerInteractionsControl } from './interactions-controls-registry';
|
|
13
13
|
import { interactionsRepository } from './interactions-repository';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
EDITOR_INTERACTIONS_MCP_DESCRIPTION,
|
|
16
|
+
EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION,
|
|
17
|
+
initMcpInteractions,
|
|
18
|
+
} from './mcp';
|
|
15
19
|
import { documentElementsInteractionsProvider } from './providers/document-elements-interactions-provider';
|
|
16
20
|
|
|
17
21
|
export function init() {
|
|
@@ -62,7 +66,12 @@ export function init() {
|
|
|
62
66
|
component: Repeat,
|
|
63
67
|
} );
|
|
64
68
|
|
|
65
|
-
initMcpInteractions(
|
|
69
|
+
initMcpInteractions(
|
|
70
|
+
getMCPByDomain( 'interactions', {
|
|
71
|
+
docs: EDITOR_INTERACTIONS_MCP_DESCRIPTION,
|
|
72
|
+
instructions: EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION,
|
|
73
|
+
} )
|
|
74
|
+
);
|
|
66
75
|
} catch ( error ) {
|
|
67
76
|
throw error;
|
|
68
77
|
}
|
package/src/mcp/constants.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export const MAX_INTERACTIONS_PER_ELEMENT = 5;
|
|
2
|
-
export const
|
|
2
|
+
export const EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION = `Everything related to V4 ( Atomic ) interactions.
|
|
3
|
+
# Interactions
|
|
4
|
+
- Create/update/delete interactions
|
|
5
|
+
- Get list of interactions
|
|
6
|
+
- Get details of an interaction
|
|
7
|
+
`;
|
|
8
|
+
export const EDITOR_INTERACTIONS_MCP_DESCRIPTION = `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
9
|
** IMPORTANT **
|
|
4
10
|
Use the "interactions-schema" resource to get the schema of the interactions.
|
|
5
11
|
Actions:
|
|
@@ -8,7 +14,7 @@ export const EDITOR_INTERACTIONS_MCP_INSTRUCTIONS = `MCP server for managing ele
|
|
|
8
14
|
- update: Update an existing interaction by its interactionId.
|
|
9
15
|
- delete: Remove a specific interaction by its interactionId.
|
|
10
16
|
- clear: Remove all interactions from the element.
|
|
11
|
-
|
|
17
|
+
|
|
12
18
|
For add/update, provide: trigger, effect, effectType, direction (required for slide effect), duration, delay, easing.
|
|
13
19
|
Use excludedBreakpoints to disable the animation on specific responsive breakpoints (e.g. ["mobile", "tablet"]).
|
|
14
20
|
Example Get Request:
|
|
@@ -23,6 +23,8 @@ const EMPTY_INTERACTIONS: ElementInteractions = {
|
|
|
23
23
|
|
|
24
24
|
const EFFECTS_WITHOUT_TYPE = [ 'custom' ];
|
|
25
25
|
|
|
26
|
+
const BREAKPOINTS_SCHEMA_URI = 'elementor://breakpoints/list';
|
|
27
|
+
|
|
26
28
|
export const initManageElementInteractionTool = ( reg: MCPRegistryEntry ) => {
|
|
27
29
|
const { addTool } = reg;
|
|
28
30
|
const extendedSchema = isProActive() ? { ...baseSchema, ...proSchema } : baseSchema;
|
|
@@ -44,6 +46,7 @@ export const initManageElementInteractionTool = ( reg: MCPRegistryEntry ) => {
|
|
|
44
46
|
schema,
|
|
45
47
|
requiredResources: [
|
|
46
48
|
{ uri: INTERACTIONS_SCHEMA_URI, description: 'Interactions schema with all available options' },
|
|
49
|
+
{ uri: BREAKPOINTS_SCHEMA_URI, description: 'Available breakpoint IDs for excludedBreakpoints' },
|
|
47
50
|
],
|
|
48
51
|
isDestructive: true,
|
|
49
52
|
outputSchema: {
|
package/src/mcp/tools/schema.ts
CHANGED
|
@@ -12,12 +12,15 @@ export const baseSchema = {
|
|
|
12
12
|
),
|
|
13
13
|
duration: z.number().min( 0 ).max( 10000 ).optional().describe( 'Animation duration in milliseconds' ),
|
|
14
14
|
delay: z.number().min( 0 ).max( 10000 ).optional().describe( 'Animation delay in milliseconds' ),
|
|
15
|
-
easing: z
|
|
15
|
+
easing: z
|
|
16
|
+
.enum( [ 'easeIn' ] )
|
|
17
|
+
.optional()
|
|
18
|
+
.describe( 'Easing function for the animation. Use "easeIn" for free tier.' ),
|
|
16
19
|
excludedBreakpoints: z
|
|
17
|
-
.array( z.
|
|
20
|
+
.array( z.enum( [ 'widescreen', 'desktop', 'laptop', 'tablet_extra', 'tablet', 'mobile_extra', 'mobile' ] ) )
|
|
18
21
|
.optional()
|
|
19
22
|
.describe(
|
|
20
|
-
'Breakpoint IDs on which this interaction is disabled (e.g. ["mobile", "tablet"]). Omit to enable on all breakpoints.'
|
|
23
|
+
'Breakpoint IDs on which this interaction is disabled (e.g. ["mobile", "tablet"]). Fetch the "elementor://breakpoints/list" resource to get the valid IDs for the current site. Omit to enable on all breakpoints.'
|
|
21
24
|
),
|
|
22
25
|
};
|
|
23
26
|
|
|
@@ -27,6 +30,10 @@ export const proSchema = {
|
|
|
27
30
|
.optional()
|
|
28
31
|
.describe( 'Event that triggers the animation' ),
|
|
29
32
|
effect: z.enum( [ 'fade', 'slide', 'scale', 'custom' ] ).optional().describe( 'Animation effect type' ),
|
|
33
|
+
easing: z
|
|
34
|
+
.enum( [ 'easeIn', 'easeInOut', 'easeOut', 'backIn', 'backInOut', 'backOut', 'linear' ] )
|
|
35
|
+
.optional()
|
|
36
|
+
.describe( 'Easing function for the animation.' ),
|
|
30
37
|
customEffects: z
|
|
31
38
|
.object( {
|
|
32
39
|
keyframes: z
|