@elementor/editor-interactions 4.5.0-1270 → 4.5.0-1272

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.d.mts CHANGED
@@ -216,7 +216,7 @@ declare const extractBoolean: (prop: BooleanPropValue | undefined, fallback?: bo
216
216
  declare const createExcludedBreakpoints: (breakpoints: string[]) => ExcludedBreakpointsPropValue;
217
217
  declare const createInteractionBreakpoints: (excluded: string[]) => InteractionBreakpointsPropValue;
218
218
  declare const extractExcludedBreakpoints: (breakpoints: InteractionBreakpointsPropValue | undefined) => string[];
219
- declare const createAnimationPreset: ({ effect, type, direction, duration, delay, replay, easing, relativeTo, repeat, times, start, end, customEffects, }: {
219
+ declare const createAnimationPreset: ({ effect, type, direction, duration, delay, replay, easing, relativeTo, repeat, times, start, end, customEffects, codeEffect, }: {
220
220
  effect: string;
221
221
  type: string;
222
222
  direction?: string;
@@ -230,8 +230,9 @@ declare const createAnimationPreset: ({ effect, type, direction, duration, delay
230
230
  start?: SizeStringValue;
231
231
  end?: SizeStringValue;
232
232
  customEffects?: PropValue | PlainCustomEffect;
233
+ codeEffect?: PropValue;
233
234
  }) => AnimationPresetPropValue;
234
- declare const createInteractionItem: ({ trigger, effect, type, direction, duration, delay, interactionId, replay, easing, relativeTo, repeat, times, start, end, excludedBreakpoints, customEffects, }: {
235
+ declare const createInteractionItem: ({ trigger, effect, type, direction, duration, delay, interactionId, replay, easing, relativeTo, repeat, times, start, end, excludedBreakpoints, customEffects, codeEffect, }: {
235
236
  trigger?: string;
236
237
  effect?: string;
237
238
  type?: string;
@@ -248,6 +249,7 @@ declare const createInteractionItem: ({ trigger, effect, type, direction, durati
248
249
  end?: number;
249
250
  excludedBreakpoints?: string[];
250
251
  customEffects?: PropValue | PlainCustomEffect;
252
+ codeEffect?: PropValue;
251
253
  }) => InteractionItemPropValue;
252
254
  declare const createDefaultInteractionItem: () => InteractionItemPropValue;
253
255
  declare const createDefaultInteractions: () => ElementInteractions;
package/dist/index.d.ts CHANGED
@@ -216,7 +216,7 @@ declare const extractBoolean: (prop: BooleanPropValue | undefined, fallback?: bo
216
216
  declare const createExcludedBreakpoints: (breakpoints: string[]) => ExcludedBreakpointsPropValue;
217
217
  declare const createInteractionBreakpoints: (excluded: string[]) => InteractionBreakpointsPropValue;
218
218
  declare const extractExcludedBreakpoints: (breakpoints: InteractionBreakpointsPropValue | undefined) => string[];
219
- declare const createAnimationPreset: ({ effect, type, direction, duration, delay, replay, easing, relativeTo, repeat, times, start, end, customEffects, }: {
219
+ declare const createAnimationPreset: ({ effect, type, direction, duration, delay, replay, easing, relativeTo, repeat, times, start, end, customEffects, codeEffect, }: {
220
220
  effect: string;
221
221
  type: string;
222
222
  direction?: string;
@@ -230,8 +230,9 @@ declare const createAnimationPreset: ({ effect, type, direction, duration, delay
230
230
  start?: SizeStringValue;
231
231
  end?: SizeStringValue;
232
232
  customEffects?: PropValue | PlainCustomEffect;
233
+ codeEffect?: PropValue;
233
234
  }) => AnimationPresetPropValue;
234
- declare const createInteractionItem: ({ trigger, effect, type, direction, duration, delay, interactionId, replay, easing, relativeTo, repeat, times, start, end, excludedBreakpoints, customEffects, }: {
235
+ declare const createInteractionItem: ({ trigger, effect, type, direction, duration, delay, interactionId, replay, easing, relativeTo, repeat, times, start, end, excludedBreakpoints, customEffects, codeEffect, }: {
235
236
  trigger?: string;
236
237
  effect?: string;
237
238
  type?: string;
@@ -248,6 +249,7 @@ declare const createInteractionItem: ({ trigger, effect, type, direction, durati
248
249
  end?: number;
249
250
  excludedBreakpoints?: string[];
250
251
  customEffects?: PropValue | PlainCustomEffect;
252
+ codeEffect?: PropValue;
251
253
  }) => InteractionItemPropValue;
252
254
  declare const createDefaultInteractionItem: () => InteractionItemPropValue;
253
255
  declare const createDefaultInteractions: () => ElementInteractions;
package/dist/index.js CHANGED
@@ -326,6 +326,7 @@ function isTempId(id) {
326
326
  }
327
327
 
328
328
  // src/utils/prop-value-utils.ts
329
+ var CODE_EFFECT = "code";
329
330
  var createString = (value) => ({
330
331
  $$type: "string",
331
332
  value
@@ -400,7 +401,8 @@ var createAnimationPreset = ({
400
401
  times,
401
402
  start,
402
403
  end,
403
- customEffects
404
+ customEffects,
405
+ codeEffect
404
406
  }) => {
405
407
  const customEffectProp = toCustomEffectPropValue(customEffects);
406
408
  return {
@@ -408,6 +410,7 @@ var createAnimationPreset = ({
408
410
  value: {
409
411
  effect: createString(effect),
410
412
  ...customEffectProp !== void 0 && { custom_effect: customEffectProp },
413
+ ...effect === CODE_EFFECT && codeEffect !== void 0 && { code_effect: codeEffect },
411
414
  type: createString(type),
412
415
  direction: createString(direction ?? ""),
413
416
  timing_config: createTimingConfig(duration, delay),
@@ -439,7 +442,8 @@ var createInteractionItem = ({
439
442
  start,
440
443
  end,
441
444
  excludedBreakpoints,
442
- customEffects
445
+ customEffects,
446
+ codeEffect
443
447
  }) => ({
444
448
  $$type: "interaction-item",
445
449
  value: {
@@ -458,7 +462,8 @@ var createInteractionItem = ({
458
462
  times,
459
463
  start,
460
464
  end,
461
- customEffects
465
+ customEffects,
466
+ codeEffect
462
467
  }),
463
468
  ...excludedBreakpoints && excludedBreakpoints.length > 0 && {
464
469
  breakpoints: createInteractionBreakpoints(excludedBreakpoints)
@@ -848,6 +853,7 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
848
853
  const trigger = extractString(interaction.trigger, DEFAULT_VALUES.trigger);
849
854
  const effect = extractString(interaction.animation.value.effect, DEFAULT_VALUES.effect);
850
855
  const customEffects = interaction.animation.value.custom_effect;
856
+ const codeEffect = interaction.animation.value.code_effect;
851
857
  const type = extractString(interaction.animation.value.type, DEFAULT_VALUES.type);
852
858
  const direction = extractString(interaction.animation.value.direction, DEFAULT_VALUES.direction);
853
859
  const duration = extractSize(interaction.animation.value.timing_config.value.duration);
@@ -928,7 +934,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
928
934
  times: updates.times ?? times,
929
935
  start: updates.start ?? start,
930
936
  end: updates.end ?? end,
931
- customEffects: updates.customEffects ?? customEffects
937
+ customEffects: updates.customEffects ?? customEffects,
938
+ codeEffect
932
939
  })
933
940
  };
934
941
  onChange(updatedInteraction);
@@ -1128,7 +1135,7 @@ var InteractionsListItem = ({
1128
1135
  };
1129
1136
 
1130
1137
  // src/components/interactions-list.tsx
1131
- var MAX_NUMBER_OF_INTERACTIONS = 5;
1138
+ var MAX_NUMBER_OF_INTERACTIONS = 10;
1132
1139
  function InteractionsList(props) {
1133
1140
  const { interactions, onSelectInteractions, onPlayInteraction, triggerCreateOnShowEmpty } = props;
1134
1141
  const { elementId } = useInteractionsContext();
@@ -1155,9 +1162,13 @@ function InteractionsList(props) {
1155
1162
  const isMaxNumberOfInteractionsReached = (0, import_react9.useMemo)(() => {
1156
1163
  return interactions.items?.length >= MAX_NUMBER_OF_INTERACTIONS;
1157
1164
  }, [interactions.items?.length]);
1158
- const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React10.createElement(import_ui6.Alert, { color: "secondary", icon: /* @__PURE__ */ React10.createElement(import_icons2.InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React10.createElement(import_ui6.AlertTitle, null, (0, import_i18n6.__)("Interactions", "elementor")), /* @__PURE__ */ React10.createElement(import_ui6.Box, { component: "span" }, (0, import_i18n6.__)(
1159
- "You've reached the limit of 5 interactions for this element. Please remove an interaction before creating a new one.",
1160
- "elementor"
1165
+ const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React10.createElement(import_ui6.Alert, { color: "secondary", icon: /* @__PURE__ */ React10.createElement(import_icons2.InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React10.createElement(import_ui6.AlertTitle, null, (0, import_i18n6.__)("Interactions", "elementor")), /* @__PURE__ */ React10.createElement(import_ui6.Box, { component: "span" }, (0, import_i18n6.sprintf)(
1166
+ /* translators: %d: maximum number of interactions per element */
1167
+ (0, import_i18n6.__)(
1168
+ "You've reached the limit of %d interactions for this element. Please remove an interaction before creating a new one.",
1169
+ "elementor"
1170
+ ),
1171
+ MAX_NUMBER_OF_INTERACTIONS
1161
1172
  ))) : void 0;
1162
1173
  const handleRepeaterChange = (0, import_react9.useCallback)(
1163
1174
  (newItems, _, meta) => {
@@ -2061,7 +2072,7 @@ var import_schema3 = require("@elementor/schema");
2061
2072
  var import_utils2 = require("@elementor/utils");
2062
2073
 
2063
2074
  // src/mcp/constants.ts
2064
- var MAX_INTERACTIONS_PER_ELEMENT = 5;
2075
+ var MAX_INTERACTIONS_PER_ELEMENT = 10;
2065
2076
  var EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION = `Everything related to V4 ( Atomic ) interactions.
2066
2077
  # Interactions
2067
2078
  - Create/update/delete interactions