@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 +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/components/interaction-details.tsx +2 -0
- package/src/components/interactions-list.tsx +9 -5
- package/src/mcp/constants.ts +1 -1
- package/src/utils/prop-value-utils.ts +8 -0
package/dist/index.mjs
CHANGED
|
@@ -250,6 +250,7 @@ function isTempId(id) {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
// src/utils/prop-value-utils.ts
|
|
253
|
+
var CODE_EFFECT = "code";
|
|
253
254
|
var createString = (value) => ({
|
|
254
255
|
$$type: "string",
|
|
255
256
|
value
|
|
@@ -324,7 +325,8 @@ var createAnimationPreset = ({
|
|
|
324
325
|
times,
|
|
325
326
|
start,
|
|
326
327
|
end,
|
|
327
|
-
customEffects
|
|
328
|
+
customEffects,
|
|
329
|
+
codeEffect
|
|
328
330
|
}) => {
|
|
329
331
|
const customEffectProp = toCustomEffectPropValue(customEffects);
|
|
330
332
|
return {
|
|
@@ -332,6 +334,7 @@ var createAnimationPreset = ({
|
|
|
332
334
|
value: {
|
|
333
335
|
effect: createString(effect),
|
|
334
336
|
...customEffectProp !== void 0 && { custom_effect: customEffectProp },
|
|
337
|
+
...effect === CODE_EFFECT && codeEffect !== void 0 && { code_effect: codeEffect },
|
|
335
338
|
type: createString(type),
|
|
336
339
|
direction: createString(direction ?? ""),
|
|
337
340
|
timing_config: createTimingConfig(duration, delay),
|
|
@@ -363,7 +366,8 @@ var createInteractionItem = ({
|
|
|
363
366
|
start,
|
|
364
367
|
end,
|
|
365
368
|
excludedBreakpoints,
|
|
366
|
-
customEffects
|
|
369
|
+
customEffects,
|
|
370
|
+
codeEffect
|
|
367
371
|
}) => ({
|
|
368
372
|
$$type: "interaction-item",
|
|
369
373
|
value: {
|
|
@@ -382,7 +386,8 @@ var createInteractionItem = ({
|
|
|
382
386
|
times,
|
|
383
387
|
start,
|
|
384
388
|
end,
|
|
385
|
-
customEffects
|
|
389
|
+
customEffects,
|
|
390
|
+
codeEffect
|
|
386
391
|
}),
|
|
387
392
|
...excludedBreakpoints && excludedBreakpoints.length > 0 && {
|
|
388
393
|
breakpoints: createInteractionBreakpoints(excludedBreakpoints)
|
|
@@ -576,7 +581,7 @@ import { useCallback as useCallback5, useEffect as useEffect2, useMemo as useMem
|
|
|
576
581
|
import { Repeater } from "@elementor/editor-controls";
|
|
577
582
|
import { InfoCircleFilledIcon, PlayerPlayIcon } from "@elementor/icons";
|
|
578
583
|
import { Alert, AlertTitle, Box as Box2, IconButton, Tooltip } from "@elementor/ui";
|
|
579
|
-
import { __ as __6 } from "@wordpress/i18n";
|
|
584
|
+
import { __ as __6, sprintf } from "@wordpress/i18n";
|
|
580
585
|
|
|
581
586
|
// src/contexts/interactions-item-context.tsx
|
|
582
587
|
import * as React4 from "react";
|
|
@@ -772,6 +777,7 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
772
777
|
const trigger = extractString(interaction.trigger, DEFAULT_VALUES.trigger);
|
|
773
778
|
const effect = extractString(interaction.animation.value.effect, DEFAULT_VALUES.effect);
|
|
774
779
|
const customEffects = interaction.animation.value.custom_effect;
|
|
780
|
+
const codeEffect = interaction.animation.value.code_effect;
|
|
775
781
|
const type = extractString(interaction.animation.value.type, DEFAULT_VALUES.type);
|
|
776
782
|
const direction = extractString(interaction.animation.value.direction, DEFAULT_VALUES.direction);
|
|
777
783
|
const duration = extractSize(interaction.animation.value.timing_config.value.duration);
|
|
@@ -852,7 +858,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
852
858
|
times: updates.times ?? times,
|
|
853
859
|
start: updates.start ?? start,
|
|
854
860
|
end: updates.end ?? end,
|
|
855
|
-
customEffects: updates.customEffects ?? customEffects
|
|
861
|
+
customEffects: updates.customEffects ?? customEffects,
|
|
862
|
+
codeEffect
|
|
856
863
|
})
|
|
857
864
|
};
|
|
858
865
|
onChange(updatedInteraction);
|
|
@@ -1052,7 +1059,7 @@ var InteractionsListItem = ({
|
|
|
1052
1059
|
};
|
|
1053
1060
|
|
|
1054
1061
|
// src/components/interactions-list.tsx
|
|
1055
|
-
var MAX_NUMBER_OF_INTERACTIONS =
|
|
1062
|
+
var MAX_NUMBER_OF_INTERACTIONS = 10;
|
|
1056
1063
|
function InteractionsList(props) {
|
|
1057
1064
|
const { interactions, onSelectInteractions, onPlayInteraction, triggerCreateOnShowEmpty } = props;
|
|
1058
1065
|
const { elementId } = useInteractionsContext();
|
|
@@ -1079,9 +1086,13 @@ function InteractionsList(props) {
|
|
|
1079
1086
|
const isMaxNumberOfInteractionsReached = useMemo4(() => {
|
|
1080
1087
|
return interactions.items?.length >= MAX_NUMBER_OF_INTERACTIONS;
|
|
1081
1088
|
}, [interactions.items?.length]);
|
|
1082
|
-
const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React10.createElement(Alert, { color: "secondary", icon: /* @__PURE__ */ React10.createElement(InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React10.createElement(AlertTitle, null, __6("Interactions", "elementor")), /* @__PURE__ */ React10.createElement(Box2, { component: "span" },
|
|
1083
|
-
|
|
1084
|
-
|
|
1089
|
+
const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React10.createElement(Alert, { color: "secondary", icon: /* @__PURE__ */ React10.createElement(InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React10.createElement(AlertTitle, null, __6("Interactions", "elementor")), /* @__PURE__ */ React10.createElement(Box2, { component: "span" }, sprintf(
|
|
1090
|
+
/* translators: %d: maximum number of interactions per element */
|
|
1091
|
+
__6(
|
|
1092
|
+
"You've reached the limit of %d interactions for this element. Please remove an interaction before creating a new one.",
|
|
1093
|
+
"elementor"
|
|
1094
|
+
),
|
|
1095
|
+
MAX_NUMBER_OF_INTERACTIONS
|
|
1085
1096
|
))) : void 0;
|
|
1086
1097
|
const handleRepeaterChange = useCallback5(
|
|
1087
1098
|
(newItems, _, meta) => {
|
|
@@ -1995,7 +2006,7 @@ import { z as z2 } from "@elementor/schema";
|
|
|
1995
2006
|
import { isProActive as isProActive2 } from "@elementor/utils";
|
|
1996
2007
|
|
|
1997
2008
|
// src/mcp/constants.ts
|
|
1998
|
-
var MAX_INTERACTIONS_PER_ELEMENT =
|
|
2009
|
+
var MAX_INTERACTIONS_PER_ELEMENT = 10;
|
|
1999
2010
|
var EDITOR_INTERACTIONS_MCP_SHORT_DESCRIPTION = `Everything related to V4 ( Atomic ) interactions.
|
|
2000
2011
|
# Interactions
|
|
2001
2012
|
- Create/update/delete interactions
|