@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 CHANGED
@@ -1978,14 +1978,15 @@ var baseSchema = {
1978
1978
  ),
1979
1979
  duration: import_schema.z.number().min(0).max(1e4).optional().describe("Animation duration in milliseconds"),
1980
1980
  delay: import_schema.z.number().min(0).max(1e4).optional().describe("Animation delay in milliseconds"),
1981
- easing: import_schema.z.string().optional().describe("Easing function. See interactions schema for options."),
1982
- excludedBreakpoints: import_schema.z.array(import_schema.z.string()).optional().describe(
1983
- 'Breakpoint IDs on which this interaction is disabled (e.g. ["mobile", "tablet"]). Omit to enable on all breakpoints.'
1981
+ easing: import_schema.z.enum(["easeIn"]).optional().describe('Easing function for the animation. Use "easeIn" for free tier.'),
1982
+ excludedBreakpoints: import_schema.z.array(import_schema.z.enum(["widescreen", "desktop", "laptop", "tablet_extra", "tablet", "mobile_extra", "mobile"])).optional().describe(
1983
+ '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.'
1984
1984
  )
1985
1985
  };
1986
1986
  var proSchema = {
1987
1987
  trigger: import_schema.z.enum(["load", "scrollIn", "scrollOut", "scrollOn", "hover", "click"]).optional().describe("Event that triggers the animation"),
1988
1988
  effect: import_schema.z.enum(["fade", "slide", "scale", "custom"]).optional().describe("Animation effect type"),
1989
+ easing: import_schema.z.enum(["easeIn", "easeInOut", "easeOut", "backIn", "backInOut", "backOut", "linear"]).optional().describe("Easing function for the animation."),
1989
1990
  customEffects: import_schema.z.object({
1990
1991
  keyframes: import_schema.z.array(
1991
1992
  import_schema.z.object({
@@ -2048,7 +2049,13 @@ var import_utils2 = require("@elementor/utils");
2048
2049
 
2049
2050
  // src/mcp/constants.ts
2050
2051
  var MAX_INTERACTIONS_PER_ELEMENT = 5;
2051
- var 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.
2052
+ var EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION = `Everything related to V4 ( Atomic ) interactions.
2053
+ # Interactions
2054
+ - Create/update/delete interactions
2055
+ - Get list of interactions
2056
+ - Get details of an interaction
2057
+ `;
2058
+ var 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.
2052
2059
  ** IMPORTANT **
2053
2060
  Use the "interactions-schema" resource to get the schema of the interactions.
2054
2061
  Actions:
@@ -2057,7 +2064,7 @@ var EDITOR_INTERACTIONS_MCP_INSTRUCTIONS = `MCP server for managing element inte
2057
2064
  - update: Update an existing interaction by its interactionId.
2058
2065
  - delete: Remove a specific interaction by its interactionId.
2059
2066
  - clear: Remove all interactions from the element.
2060
-
2067
+
2061
2068
  For add/update, provide: trigger, effect, effectType, direction (required for slide effect), duration, delay, easing.
2062
2069
  Use excludedBreakpoints to disable the animation on specific responsive breakpoints (e.g. ["mobile", "tablet"]).
2063
2070
  Example Get Request:
@@ -2113,6 +2120,7 @@ var EMPTY_INTERACTIONS = {
2113
2120
  items: []
2114
2121
  };
2115
2122
  var EFFECTS_WITHOUT_TYPE = ["custom"];
2123
+ var BREAKPOINTS_SCHEMA_URI = "elementor://breakpoints/list";
2116
2124
  var initManageElementInteractionTool = (reg) => {
2117
2125
  const { addTool } = reg;
2118
2126
  const extendedSchema = (0, import_utils2.isProActive)() ? { ...baseSchema, ...proSchema } : baseSchema;
@@ -2127,7 +2135,8 @@ var initManageElementInteractionTool = (reg) => {
2127
2135
  description: `Manage the element interaction.`,
2128
2136
  schema,
2129
2137
  requiredResources: [
2130
- { uri: INTERACTIONS_SCHEMA_URI, description: "Interactions schema with all available options" }
2138
+ { uri: INTERACTIONS_SCHEMA_URI, description: "Interactions schema with all available options" },
2139
+ { uri: BREAKPOINTS_SCHEMA_URI, description: "Available breakpoint IDs for excludedBreakpoints" }
2131
2140
  ],
2132
2141
  isDestructive: true,
2133
2142
  outputSchema: {
@@ -2307,7 +2316,12 @@ function init() {
2307
2316
  type: "repeat",
2308
2317
  component: Repeat
2309
2318
  });
2310
- initMcpInteractions((0, import_editor_mcp.getMCPByDomain)("interactions", { instructions: EDITOR_INTERACTIONS_MCP_INSTRUCTIONS }));
2319
+ initMcpInteractions(
2320
+ (0, import_editor_mcp.getMCPByDomain)("interactions", {
2321
+ docs: EDITOR_INTERACTIONS_MCP_DESCRIPTION,
2322
+ instructions: EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION
2323
+ })
2324
+ );
2311
2325
  } catch (error) {
2312
2326
  throw error;
2313
2327
  }