@elementor/editor-interactions 4.1.0-837 → 4.1.0-beta1

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.mjs CHANGED
@@ -1913,14 +1913,15 @@ var baseSchema = {
1913
1913
  ),
1914
1914
  duration: z.number().min(0).max(1e4).optional().describe("Animation duration in milliseconds"),
1915
1915
  delay: z.number().min(0).max(1e4).optional().describe("Animation delay in milliseconds"),
1916
- easing: z.string().optional().describe("Easing function. See interactions schema for options."),
1917
- excludedBreakpoints: z.array(z.string()).optional().describe(
1918
- 'Breakpoint IDs on which this interaction is disabled (e.g. ["mobile", "tablet"]). Omit to enable on all breakpoints.'
1916
+ easing: z.enum(["easeIn"]).optional().describe('Easing function for the animation. Use "easeIn" for free tier.'),
1917
+ excludedBreakpoints: z.array(z.enum(["widescreen", "desktop", "laptop", "tablet_extra", "tablet", "mobile_extra", "mobile"])).optional().describe(
1918
+ '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.'
1919
1919
  )
1920
1920
  };
1921
1921
  var proSchema = {
1922
1922
  trigger: z.enum(["load", "scrollIn", "scrollOut", "scrollOn", "hover", "click"]).optional().describe("Event that triggers the animation"),
1923
1923
  effect: z.enum(["fade", "slide", "scale", "custom"]).optional().describe("Animation effect type"),
1924
+ easing: z.enum(["easeIn", "easeInOut", "easeOut", "backIn", "backInOut", "backOut", "linear"]).optional().describe("Easing function for the animation."),
1924
1925
  customEffects: z.object({
1925
1926
  keyframes: z.array(
1926
1927
  z.object({
@@ -1983,7 +1984,13 @@ import { isProActive as isProActive2 } from "@elementor/utils";
1983
1984
 
1984
1985
  // src/mcp/constants.ts
1985
1986
  var MAX_INTERACTIONS_PER_ELEMENT = 5;
1986
- 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.
1987
+ var EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION = `Everything related to V4 ( Atomic ) interactions.
1988
+ # Interactions
1989
+ - Create/update/delete interactions
1990
+ - Get list of interactions
1991
+ - Get details of an interaction
1992
+ `;
1993
+ 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.
1987
1994
  ** IMPORTANT **
1988
1995
  Use the "interactions-schema" resource to get the schema of the interactions.
1989
1996
  Actions:
@@ -1992,7 +1999,7 @@ var EDITOR_INTERACTIONS_MCP_INSTRUCTIONS = `MCP server for managing element inte
1992
1999
  - update: Update an existing interaction by its interactionId.
1993
2000
  - delete: Remove a specific interaction by its interactionId.
1994
2001
  - clear: Remove all interactions from the element.
1995
-
2002
+
1996
2003
  For add/update, provide: trigger, effect, effectType, direction (required for slide effect), duration, delay, easing.
1997
2004
  Use excludedBreakpoints to disable the animation on specific responsive breakpoints (e.g. ["mobile", "tablet"]).
1998
2005
  Example Get Request:
@@ -2048,6 +2055,7 @@ var EMPTY_INTERACTIONS = {
2048
2055
  items: []
2049
2056
  };
2050
2057
  var EFFECTS_WITHOUT_TYPE = ["custom"];
2058
+ var BREAKPOINTS_SCHEMA_URI = "elementor://breakpoints/list";
2051
2059
  var initManageElementInteractionTool = (reg) => {
2052
2060
  const { addTool } = reg;
2053
2061
  const extendedSchema = isProActive2() ? { ...baseSchema, ...proSchema } : baseSchema;
@@ -2062,7 +2070,8 @@ var initManageElementInteractionTool = (reg) => {
2062
2070
  description: `Manage the element interaction.`,
2063
2071
  schema,
2064
2072
  requiredResources: [
2065
- { uri: INTERACTIONS_SCHEMA_URI, description: "Interactions schema with all available options" }
2073
+ { uri: INTERACTIONS_SCHEMA_URI, description: "Interactions schema with all available options" },
2074
+ { uri: BREAKPOINTS_SCHEMA_URI, description: "Available breakpoint IDs for excludedBreakpoints" }
2066
2075
  ],
2067
2076
  isDestructive: true,
2068
2077
  outputSchema: {
@@ -2242,7 +2251,12 @@ function init() {
2242
2251
  type: "repeat",
2243
2252
  component: Repeat
2244
2253
  });
2245
- initMcpInteractions(getMCPByDomain("interactions", { instructions: EDITOR_INTERACTIONS_MCP_INSTRUCTIONS }));
2254
+ initMcpInteractions(
2255
+ getMCPByDomain("interactions", {
2256
+ docs: EDITOR_INTERACTIONS_MCP_DESCRIPTION,
2257
+ instructions: EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION
2258
+ })
2259
+ );
2246
2260
  } catch (error) {
2247
2261
  throw error;
2248
2262
  }