@elementor/editor-interactions 4.0.0-552 → 4.0.0-573

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
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ComponentType } from 'react';
2
+ import { RefObject, ComponentType } from 'react';
3
3
  import { Unit } from '@elementor/editor-controls';
4
4
  import { ElementInteractions, InteractionItemPropValue } from '@elementor/editor-elements';
5
5
  export { AnimationPresetPropValue, BooleanPropValue, ConfigPropValue, ElementInteractions, ExcludedBreakpointsPropValue, InteractionBreakpointsPropValue, InteractionItemPropValue, NumberPropValue, StringPropValue, TimingConfigPropValue } from '@elementor/editor-elements';
@@ -36,6 +36,7 @@ type ReplayFieldProps = {
36
36
  value: boolean;
37
37
  onChange: (value: boolean) => void;
38
38
  disabled?: boolean;
39
+ anchorRef?: RefObject<HTMLElement | null>;
39
40
  };
40
41
  type DirectionFieldProps = FieldProps & {
41
42
  interactionType: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ComponentType } from 'react';
2
+ import { RefObject, ComponentType } from 'react';
3
3
  import { Unit } from '@elementor/editor-controls';
4
4
  import { ElementInteractions, InteractionItemPropValue } from '@elementor/editor-elements';
5
5
  export { AnimationPresetPropValue, BooleanPropValue, ConfigPropValue, ElementInteractions, ExcludedBreakpointsPropValue, InteractionBreakpointsPropValue, InteractionItemPropValue, NumberPropValue, StringPropValue, TimingConfigPropValue } from '@elementor/editor-elements';
@@ -36,6 +36,7 @@ type ReplayFieldProps = {
36
36
  value: boolean;
37
37
  onChange: (value: boolean) => void;
38
38
  disabled?: boolean;
39
+ anchorRef?: RefObject<HTMLElement | null>;
39
40
  };
40
41
  type DirectionFieldProps = FieldProps & {
41
42
  interactionType: string;
package/dist/index.js CHANGED
@@ -132,10 +132,10 @@ var PopupStateProvider = ({ children }) => {
132
132
  // src/components/interactions-list.tsx
133
133
  var React12 = __toESM(require("react"));
134
134
  var import_react9 = require("react");
135
- var import_editor_controls6 = require("@elementor/editor-controls");
135
+ var import_editor_controls7 = require("@elementor/editor-controls");
136
136
  var import_icons3 = require("@elementor/icons");
137
137
  var import_ui6 = require("@elementor/ui");
138
- var import_i18n8 = require("@wordpress/i18n");
138
+ var import_i18n7 = require("@wordpress/i18n");
139
139
 
140
140
  // src/contexts/interactions-item-context.tsx
141
141
  var React4 = __toESM(require("react"));
@@ -378,14 +378,14 @@ var buildDisplayLabel = (item) => {
378
378
  var React11 = __toESM(require("react"));
379
379
  var import_react8 = require("react");
380
380
  var import_ui5 = require("@elementor/ui");
381
- var import_i18n7 = require("@wordpress/i18n");
381
+ var import_i18n6 = require("@wordpress/i18n");
382
382
 
383
383
  // src/components/interaction-details.tsx
384
384
  var React9 = __toESM(require("react"));
385
385
  var import_react6 = require("react");
386
- var import_editor_controls4 = require("@elementor/editor-controls");
386
+ var import_editor_controls5 = require("@elementor/editor-controls");
387
387
  var import_ui3 = require("@elementor/ui");
388
- var import_i18n5 = require("@wordpress/i18n");
388
+ var import_i18n4 = require("@wordpress/i18n");
389
389
 
390
390
  // src/interactions-controls-registry.ts
391
391
  var controlsRegistry = /* @__PURE__ */ new Map();
@@ -400,6 +400,20 @@ function getInteractionsControl(type) {
400
400
  return controlsRegistry.get(type);
401
401
  }
402
402
 
403
+ // src/utils/resolve-direction.ts
404
+ var resolveDirection = (hasDirection, newEffect, newDirection, currentDirection, currentEffect) => {
405
+ if (newEffect === "slide" && !newDirection) {
406
+ return "top";
407
+ }
408
+ if (currentEffect === "slide" && hasDirection) {
409
+ return newDirection ?? "top";
410
+ }
411
+ if (hasDirection) {
412
+ return newDirection;
413
+ }
414
+ return currentDirection;
415
+ };
416
+
403
417
  // src/components/controls/direction.tsx
404
418
  var React5 = __toESM(require("react"));
405
419
  var import_react4 = require("react");
@@ -439,56 +453,30 @@ function Direction({ value, onChange, interactionType }) {
439
453
  return /* @__PURE__ */ React5.createElement(import_editor_controls.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value });
440
454
  }
441
455
 
442
- // src/components/controls/effect.tsx
443
- var React6 = __toESM(require("react"));
444
- var import_editor_ui = require("@elementor/editor-ui");
445
- var import_ui2 = require("@elementor/ui");
446
- var import_i18n3 = require("@wordpress/i18n");
447
- function Effect({ value, onChange }) {
448
- const availableEffects = [
449
- { key: "fade", label: (0, import_i18n3.__)("Fade", "elementor") },
450
- { key: "slide", label: (0, import_i18n3.__)("Slide", "elementor") },
451
- { key: "scale", label: (0, import_i18n3.__)("Scale", "elementor") }
452
- ];
453
- return /* @__PURE__ */ React6.createElement(
454
- import_ui2.Select,
455
- {
456
- fullWidth: true,
457
- displayEmpty: true,
458
- size: "tiny",
459
- value,
460
- onChange: (event) => onChange(event.target.value)
461
- },
462
- availableEffects.map((effect) => {
463
- return /* @__PURE__ */ React6.createElement(import_editor_ui.MenuListItem, { key: effect.key, value: effect.key }, effect.label);
464
- })
465
- );
466
- }
467
-
468
456
  // src/components/controls/effect-type.tsx
469
- var React7 = __toESM(require("react"));
457
+ var React6 = __toESM(require("react"));
470
458
  var import_editor_controls2 = require("@elementor/editor-controls");
471
- var import_i18n4 = require("@wordpress/i18n");
459
+ var import_i18n3 = require("@wordpress/i18n");
472
460
  function EffectType({ value, onChange }) {
473
461
  const options = [
474
462
  {
475
463
  value: "in",
476
- label: (0, import_i18n4.__)("In", "elementor"),
477
- renderContent: () => (0, import_i18n4.__)("In", "elementor"),
464
+ label: (0, import_i18n3.__)("In", "elementor"),
465
+ renderContent: () => (0, import_i18n3.__)("In", "elementor"),
478
466
  showTooltip: true
479
467
  },
480
468
  {
481
469
  value: "out",
482
- label: (0, import_i18n4.__)("Out", "elementor"),
483
- renderContent: () => (0, import_i18n4.__)("Out", "elementor"),
470
+ label: (0, import_i18n3.__)("Out", "elementor"),
471
+ renderContent: () => (0, import_i18n3.__)("Out", "elementor"),
484
472
  showTooltip: true
485
473
  }
486
474
  ];
487
- return /* @__PURE__ */ React7.createElement(import_editor_controls2.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value });
475
+ return /* @__PURE__ */ React6.createElement(import_editor_controls2.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value });
488
476
  }
489
477
 
490
478
  // src/components/controls/time-frame-indicator.tsx
491
- var React8 = __toESM(require("react"));
479
+ var React7 = __toESM(require("react"));
492
480
  var import_react5 = require("react");
493
481
  var import_editor_controls3 = require("@elementor/editor-controls");
494
482
 
@@ -530,7 +518,7 @@ function TimeFrameIndicator({
530
518
  setValue(parseSizeValue(defaultValue, TIME_UNITS, void 0, DEFAULT_TIME_UNIT));
531
519
  }
532
520
  };
533
- return /* @__PURE__ */ React8.createElement(
521
+ return /* @__PURE__ */ React7.createElement(
534
522
  import_editor_controls3.UnstableSizeField,
535
523
  {
536
524
  units: TIME_UNITS,
@@ -546,6 +534,14 @@ function TimeFrameIndicator({
546
534
  );
547
535
  }
548
536
 
537
+ // src/components/field.tsx
538
+ var React8 = __toESM(require("react"));
539
+ var import_editor_controls4 = require("@elementor/editor-controls");
540
+ var import_ui2 = require("@elementor/ui");
541
+ var Field = ({ label, children }) => {
542
+ return /* @__PURE__ */ React8.createElement(import_ui2.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React8.createElement(import_editor_controls4.PopoverGridContainer, null, /* @__PURE__ */ React8.createElement(import_ui2.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React8.createElement(import_editor_controls4.ControlFormLabel, null, label)), /* @__PURE__ */ React8.createElement(import_ui2.Grid, { item: true, xs: 6 }, children)));
543
+ };
544
+
549
545
  // src/components/interaction-details.tsx
550
546
  var DEFAULT_VALUES = {
551
547
  trigger: "load",
@@ -560,7 +556,7 @@ var DEFAULT_VALUES = {
560
556
  offsetTop: 15,
561
557
  offsetBottom: 85
562
558
  };
563
- var TRIGGERS_WITHOUT_REPLAY = ["load", "scrollOn"];
559
+ var TRIGGERS_WITHOUT_REPLAY = ["load", "scrollOn", "hover", "click"];
564
560
  var controlVisibilityConfig = {
565
561
  replay: (values) => !TRIGGERS_WITHOUT_REPLAY.includes(values.trigger),
566
562
  relativeTo: (values) => values.trigger === "scrollOn",
@@ -612,6 +608,7 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
612
608
  offsetBottom
613
609
  };
614
610
  const TriggerControl = useControlComponent("trigger", true);
611
+ const EffectControl = useControlComponent("effect");
615
612
  const ReplayControl = useControlComponent("replay", controlVisibilityConfig.replay(interactionValues));
616
613
  const RelativeToControl = useControlComponent(
617
614
  "relativeTo",
@@ -623,17 +620,15 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
623
620
  controlVisibilityConfig.offsetBottom(interactionValues)
624
621
  );
625
622
  const EasingControl = useControlComponent("easing");
626
- const resolveDirection = (hasDirection, newEffect, newDirection) => {
627
- if (newEffect === "slide" && !newDirection) {
628
- return "top";
629
- }
630
- if (hasDirection) {
631
- return newDirection;
632
- }
633
- return direction;
634
- };
623
+ const containerRef = (0, import_react6.useRef)(null);
635
624
  const updateInteraction = (updates) => {
636
- const resolvedDirectionValue = resolveDirection("direction" in updates, updates.effect, updates.direction);
625
+ const resolvedDirectionValue = resolveDirection(
626
+ "direction" in updates,
627
+ updates.effect,
628
+ updates.direction,
629
+ direction,
630
+ effect
631
+ );
637
632
  const updatedInteraction = {
638
633
  ...interaction,
639
634
  interaction_id: interaction.interaction_id,
@@ -657,53 +652,60 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
657
652
  onPlayInteraction(interactionId);
658
653
  }, 0);
659
654
  };
660
- return /* @__PURE__ */ React9.createElement(import_editor_controls4.PopoverContent, { p: 1.5 }, /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, TriggerControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Trigger", "elementor") }, /* @__PURE__ */ React9.createElement(TriggerControl, { value: trigger, onChange: (v) => updateInteraction({ trigger: v }) })), ReplayControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Replay", "elementor") }, /* @__PURE__ */ React9.createElement(
655
+ return /* @__PURE__ */ React9.createElement(import_ui3.Box, { ref: containerRef }, /* @__PURE__ */ React9.createElement(import_editor_controls5.PopoverContent, { p: 1.5 }, /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, TriggerControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Trigger", "elementor") }, /* @__PURE__ */ React9.createElement(
656
+ TriggerControl,
657
+ {
658
+ value: trigger,
659
+ onChange: (v) => updateInteraction({ trigger: v })
660
+ }
661
+ )), ReplayControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Replay", "elementor") }, /* @__PURE__ */ React9.createElement(
661
662
  ReplayControl,
662
663
  {
663
664
  value: replay,
664
665
  onChange: (v) => updateInteraction({ replay: v }),
665
- disabled: true
666
+ disabled: true,
667
+ anchorRef: containerRef
666
668
  }
667
- ))), /* @__PURE__ */ React9.createElement(import_ui3.Divider, null), /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Effect", "elementor") }, /* @__PURE__ */ React9.createElement(Effect, { value: effect, onChange: (v) => updateInteraction({ effect: v }) })), /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Type", "elementor") }, /* @__PURE__ */ React9.createElement(EffectType, { value: type, onChange: (v) => updateInteraction({ type: v }) })), /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Direction", "elementor") }, /* @__PURE__ */ React9.createElement(
669
+ ))), /* @__PURE__ */ React9.createElement(import_ui3.Divider, null), /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, EffectControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Effect", "elementor") }, /* @__PURE__ */ React9.createElement(EffectControl, { value: effect, onChange: (v) => updateInteraction({ effect: v }) })), /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Type", "elementor") }, /* @__PURE__ */ React9.createElement(EffectType, { value: type, onChange: (v) => updateInteraction({ type: v }) })), /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Direction", "elementor") }, /* @__PURE__ */ React9.createElement(
668
670
  Direction,
669
671
  {
670
672
  value: direction,
671
673
  onChange: (v) => updateInteraction({ direction: v }),
672
674
  interactionType: type
673
675
  }
674
- )), controlVisibilityConfig.duration(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Duration", "elementor") }, /* @__PURE__ */ React9.createElement(
676
+ )), controlVisibilityConfig.duration(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Duration", "elementor") }, /* @__PURE__ */ React9.createElement(
675
677
  TimeFrameIndicator,
676
678
  {
677
679
  value: String(duration),
678
680
  onChange: (v) => updateInteraction({ duration: v }),
679
681
  defaultValue: DEFAULT_VALUES.duration
680
682
  }
681
- )), controlVisibilityConfig.delay(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Delay", "elementor") }, /* @__PURE__ */ React9.createElement(
683
+ )), controlVisibilityConfig.delay(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Delay", "elementor") }, /* @__PURE__ */ React9.createElement(
682
684
  TimeFrameIndicator,
683
685
  {
684
686
  value: String(delay),
685
687
  onChange: (v) => updateInteraction({ delay: v }),
686
688
  defaultValue: DEFAULT_VALUES.delay
687
689
  }
688
- ))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(import_ui3.Divider, null), /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Relative To", "elementor") }, /* @__PURE__ */ React9.createElement(
690
+ ))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(import_ui3.Divider, null), /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Relative To", "elementor") }, /* @__PURE__ */ React9.createElement(
689
691
  RelativeToControl,
690
692
  {
691
693
  value: relativeTo,
692
694
  onChange: (v) => updateInteraction({ relativeTo: v })
693
695
  }
694
- )), OffsetTopControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Offset Top", "elementor") }, /* @__PURE__ */ React9.createElement(
696
+ )), OffsetTopControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Offset Top", "elementor") }, /* @__PURE__ */ React9.createElement(
695
697
  OffsetTopControl,
696
698
  {
697
699
  value: String(parseSizeValue(offsetTop, ["%"]).size),
698
700
  onChange: (v) => updateInteraction({ offsetTop: v })
699
701
  }
700
- )), OffsetBottomControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Offset Bottom", "elementor") }, /* @__PURE__ */ React9.createElement(
702
+ )), OffsetBottomControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Offset Bottom", "elementor") }, /* @__PURE__ */ React9.createElement(
701
703
  OffsetBottomControl,
702
704
  {
703
705
  value: String(parseSizeValue(offsetBottom, ["%"]).size),
704
706
  onChange: (v) => updateInteraction({ offsetBottom: v })
705
707
  }
706
- ))), /* @__PURE__ */ React9.createElement(import_ui3.Divider, null)), EasingControl && /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n5.__)("Easing", "elementor") }, /* @__PURE__ */ React9.createElement(
708
+ ))), /* @__PURE__ */ React9.createElement(import_ui3.Divider, null)), EasingControl && /* @__PURE__ */ React9.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Easing", "elementor") }, /* @__PURE__ */ React9.createElement(
707
709
  EasingControl,
708
710
  {
709
711
  value: easing,
@@ -711,19 +713,16 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
711
713
  updateInteraction({ easing: v });
712
714
  }
713
715
  }
714
- ))));
716
+ )))));
715
717
  };
716
- function Field({ label, children }) {
717
- return /* @__PURE__ */ React9.createElement(import_ui3.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React9.createElement(import_editor_controls4.PopoverGridContainer, null, /* @__PURE__ */ React9.createElement(import_ui3.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(import_editor_controls4.ControlFormLabel, null, label)), /* @__PURE__ */ React9.createElement(import_ui3.Grid, { item: true, xs: 6 }, children)));
718
- }
719
718
 
720
719
  // src/components/interaction-settings.tsx
721
720
  var React10 = __toESM(require("react"));
722
721
  var import_react7 = require("react");
723
- var import_editor_controls5 = require("@elementor/editor-controls");
722
+ var import_editor_controls6 = require("@elementor/editor-controls");
724
723
  var import_editor_responsive = require("@elementor/editor-responsive");
725
724
  var import_ui4 = require("@elementor/ui");
726
- var import_i18n6 = require("@wordpress/i18n");
725
+ var import_i18n5 = require("@wordpress/i18n");
727
726
  var SIZE = "tiny";
728
727
  var InteractionSettings = ({ interaction, onChange }) => {
729
728
  const breakpoints = (0, import_editor_responsive.useBreakpoints)();
@@ -757,7 +756,7 @@ var InteractionSettings = ({ interaction, onChange }) => {
757
756
  },
758
757
  [interaction, availableBreakpoints, onChange]
759
758
  );
760
- return /* @__PURE__ */ React10.createElement(import_editor_controls5.PopoverContent, { p: 1.5 }, /* @__PURE__ */ React10.createElement(import_ui4.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React10.createElement(import_ui4.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React10.createElement(import_ui4.Stack, { direction: "column", gap: 1 }, /* @__PURE__ */ React10.createElement(import_editor_controls5.ControlFormLabel, { sx: { width: "100%" } }, (0, import_i18n6.__)("Trigger on", "elementor")), /* @__PURE__ */ React10.createElement(
759
+ return /* @__PURE__ */ React10.createElement(import_editor_controls6.PopoverContent, { p: 1.5 }, /* @__PURE__ */ React10.createElement(import_ui4.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React10.createElement(import_ui4.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React10.createElement(import_ui4.Stack, { direction: "column", gap: 1 }, /* @__PURE__ */ React10.createElement(import_editor_controls6.ControlFormLabel, { sx: { width: "100%" } }, (0, import_i18n5.__)("Trigger on", "elementor")), /* @__PURE__ */ React10.createElement(
761
760
  import_ui4.Autocomplete,
762
761
  {
763
762
  fullWidth: true,
@@ -801,11 +800,11 @@ var InteractionsListItem = ({
801
800
  {
802
801
  size: "small",
803
802
  variant: "fullWidth",
804
- "aria-label": (0, import_i18n7.__)("Interaction", "elementor"),
803
+ "aria-label": (0, import_i18n6.__)("Interaction", "elementor"),
805
804
  ...getTabsProps()
806
805
  },
807
- /* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0, import_i18n7.__)("Details", "elementor"), ...getTabProps("details") }),
808
- /* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0, import_i18n7.__)("Settings", "elementor"), ...getTabProps("settings") })
806
+ /* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0, import_i18n6.__)("Details", "elementor"), ...getTabProps("details") }),
807
+ /* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0, import_i18n6.__)("Settings", "elementor"), ...getTabProps("settings") })
809
808
  ), /* @__PURE__ */ React11.createElement(import_ui5.Divider, null), /* @__PURE__ */ React11.createElement(import_ui5.TabPanel, { sx: { p: 0 }, ...getTabPanelProps("details") }, /* @__PURE__ */ React11.createElement(
810
809
  InteractionDetails,
811
810
  {
@@ -848,7 +847,7 @@ function InteractionsList(props) {
848
847
  const isMaxNumberOfInteractionsReached = (0, import_react9.useMemo)(() => {
849
848
  return interactions.items?.length >= MAX_NUMBER_OF_INTERACTIONS;
850
849
  }, [interactions.items?.length]);
851
- const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React12.createElement(import_ui6.Alert, { color: "secondary", icon: /* @__PURE__ */ React12.createElement(import_icons3.InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React12.createElement(import_ui6.AlertTitle, null, (0, import_i18n8.__)("Interactions", "elementor")), /* @__PURE__ */ React12.createElement(import_ui6.Box, { component: "span" }, (0, import_i18n8.__)(
850
+ const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React12.createElement(import_ui6.Alert, { color: "secondary", icon: /* @__PURE__ */ React12.createElement(import_icons3.InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React12.createElement(import_ui6.AlertTitle, null, (0, import_i18n7.__)("Interactions", "elementor")), /* @__PURE__ */ React12.createElement(import_ui6.Box, { component: "span" }, (0, import_i18n7.__)(
852
851
  "You've reached the limit of 5 interactions for this element. Please remove an interaction before creating a new one.",
853
852
  "elementor"
854
853
  ))) : void 0;
@@ -883,11 +882,11 @@ function InteractionsList(props) {
883
882
  [handleInteractionChange, onPlayInteraction]
884
883
  );
885
884
  return /* @__PURE__ */ React12.createElement(InteractionItemContextProvider, { value: contextValue }, /* @__PURE__ */ React12.createElement(
886
- import_editor_controls6.Repeater,
885
+ import_editor_controls7.Repeater,
887
886
  {
888
887
  openOnAdd: true,
889
888
  openItem: triggerCreateOnShowEmpty ? 0 : void 0,
890
- label: (0, import_i18n8.__)("Interactions", "elementor"),
889
+ label: (0, import_i18n7.__)("Interactions", "elementor"),
891
890
  values: interactions.items,
892
891
  setValues: handleRepeaterChange,
893
892
  showDuplicate: false,
@@ -900,10 +899,10 @@ function InteractionsList(props) {
900
899
  Label: ({ value }) => buildDisplayLabel(value.value),
901
900
  Icon: () => null,
902
901
  Content: InteractionsListItem,
903
- actions: (value) => /* @__PURE__ */ React12.createElement(import_ui6.Tooltip, { key: "preview", placement: "top", title: (0, import_i18n8.__)("Preview", "elementor") }, /* @__PURE__ */ React12.createElement(
902
+ actions: (value) => /* @__PURE__ */ React12.createElement(import_ui6.Tooltip, { key: "preview", placement: "top", title: (0, import_i18n7.__)("Preview", "elementor") }, /* @__PURE__ */ React12.createElement(
904
903
  import_ui6.IconButton,
905
904
  {
906
- "aria-label": (0, import_i18n8.__)("Play interaction", "elementor"),
905
+ "aria-label": (0, import_i18n7.__)("Play interaction", "elementor"),
907
906
  size: "tiny",
908
907
  onClick: () => onPlayInteraction(extractString(value.value.interaction_id))
909
908
  },
@@ -1119,17 +1118,17 @@ var documentElementsInteractionsProvider = createInteractionsProvider({
1119
1118
 
1120
1119
  // src/components/controls/easing.tsx
1121
1120
  var React14 = __toESM(require("react"));
1122
- var import_editor_ui2 = require("@elementor/editor-ui");
1121
+ var import_editor_ui = require("@elementor/editor-ui");
1123
1122
  var import_ui8 = require("@elementor/ui");
1124
- var import_i18n9 = require("@wordpress/i18n");
1123
+ var import_i18n8 = require("@wordpress/i18n");
1125
1124
  var EASING_OPTIONS = {
1126
- easeIn: (0, import_i18n9.__)("Ease In", "elementor"),
1127
- easeInOut: (0, import_i18n9.__)("Ease In Out", "elementor"),
1128
- easeOut: (0, import_i18n9.__)("Ease Out", "elementor"),
1129
- backIn: (0, import_i18n9.__)("Back In", "elementor"),
1130
- backInOut: (0, import_i18n9.__)("Back In Out", "elementor"),
1131
- backOut: (0, import_i18n9.__)("Back Out", "elementor"),
1132
- linear: (0, import_i18n9.__)("Linear", "elementor")
1125
+ easeIn: (0, import_i18n8.__)("Ease In", "elementor"),
1126
+ easeInOut: (0, import_i18n8.__)("Ease In Out", "elementor"),
1127
+ easeOut: (0, import_i18n8.__)("Ease Out", "elementor"),
1128
+ backIn: (0, import_i18n8.__)("Back In", "elementor"),
1129
+ backInOut: (0, import_i18n8.__)("Back In Out", "elementor"),
1130
+ backOut: (0, import_i18n8.__)("Back Out", "elementor"),
1131
+ linear: (0, import_i18n8.__)("Linear", "elementor")
1133
1132
  };
1134
1133
  var DEFAULT_EASING = "easeIn";
1135
1134
  function Easing({}) {
@@ -1140,49 +1139,118 @@ function Easing({}) {
1140
1139
  return /* @__PURE__ */ React14.createElement(import_ui8.Select, { value: DEFAULT_EASING, onChange: () => {
1141
1140
  }, fullWidth: true, displayEmpty: true, size: "tiny" }, availableOptions.map((option) => {
1142
1141
  const isDisabled = DEFAULT_EASING !== option.key;
1143
- return /* @__PURE__ */ React14.createElement(import_editor_ui2.MenuListItem, { key: option.key, value: option.key, disabled: isDisabled }, option.label);
1142
+ return /* @__PURE__ */ React14.createElement(import_editor_ui.MenuListItem, { key: option.key, value: option.key, disabled: isDisabled }, option.label);
1144
1143
  }));
1145
1144
  }
1146
1145
 
1147
- // src/components/controls/replay.tsx
1146
+ // src/components/controls/effect.tsx
1148
1147
  var React15 = __toESM(require("react"));
1149
- var import_editor_controls7 = require("@elementor/editor-controls");
1148
+ var import_editor_ui2 = require("@elementor/editor-ui");
1149
+ var import_ui9 = require("@elementor/ui");
1150
+ var import_i18n9 = require("@wordpress/i18n");
1151
+ function Effect({ value, onChange }) {
1152
+ const availableEffects = [
1153
+ { key: "fade", label: (0, import_i18n9.__)("Fade", "elementor") },
1154
+ { key: "slide", label: (0, import_i18n9.__)("Slide", "elementor") },
1155
+ { key: "scale", label: (0, import_i18n9.__)("Scale", "elementor") }
1156
+ ];
1157
+ return /* @__PURE__ */ React15.createElement(
1158
+ import_ui9.Select,
1159
+ {
1160
+ fullWidth: true,
1161
+ displayEmpty: true,
1162
+ size: "tiny",
1163
+ value,
1164
+ onChange: (event) => onChange(event.target.value)
1165
+ },
1166
+ availableEffects.map((effect) => {
1167
+ return /* @__PURE__ */ React15.createElement(import_editor_ui2.MenuListItem, { key: effect.key, value: effect.key }, effect.label);
1168
+ })
1169
+ );
1170
+ }
1171
+
1172
+ // src/components/controls/replay.tsx
1173
+ var React17 = __toESM(require("react"));
1174
+ var import_editor_controls8 = require("@elementor/editor-controls");
1150
1175
  var import_icons4 = require("@elementor/icons");
1176
+ var import_ui11 = require("@elementor/ui");
1177
+ var import_i18n11 = require("@wordpress/i18n");
1178
+
1179
+ // src/ui/interactions-promotion-chip.tsx
1180
+ var React16 = __toESM(require("react"));
1181
+ var import_react11 = require("react");
1182
+ var import_editor_ui3 = require("@elementor/editor-ui");
1183
+ var import_ui10 = require("@elementor/ui");
1151
1184
  var import_i18n10 = require("@wordpress/i18n");
1152
- function Replay({ onChange }) {
1185
+ function InteractionsPromotionChip({ content, upgradeUrl, anchorRef }) {
1186
+ const [isOpen, setIsOpen] = (0, import_react11.useState)(false);
1187
+ (0, import_editor_ui3.useCanvasClickHandler)(isOpen, () => setIsOpen(false));
1188
+ const handleToggle = (e) => {
1189
+ e.stopPropagation();
1190
+ setIsOpen((prev) => !prev);
1191
+ };
1192
+ return /* @__PURE__ */ React16.createElement(
1193
+ import_editor_ui3.PromotionPopover,
1194
+ {
1195
+ open: isOpen,
1196
+ title: (0, import_i18n10.__)("Interactions", "elementor"),
1197
+ content,
1198
+ ctaText: (0, import_i18n10.__)("Upgrade now", "elementor"),
1199
+ ctaUrl: upgradeUrl,
1200
+ anchorRef,
1201
+ placement: anchorRef ? "right-start" : void 0,
1202
+ onClose: handleToggle
1203
+ },
1204
+ /* @__PURE__ */ React16.createElement(import_ui10.Box, { onClick: handleToggle, sx: { cursor: "pointer", display: "inline-flex", mr: 1 } }, /* @__PURE__ */ React16.createElement(import_editor_ui3.PromotionChip, null))
1205
+ );
1206
+ }
1207
+
1208
+ // src/components/controls/replay.tsx
1209
+ var OVERLAY_GRID = "1 / 1";
1210
+ var CHIP_OFFSET = "50%";
1211
+ function Replay({ onChange, anchorRef }) {
1153
1212
  const options = [
1154
1213
  {
1155
1214
  value: false,
1156
1215
  disabled: false,
1157
- label: (0, import_i18n10.__)("No", "elementor"),
1158
- renderContent: ({ size }) => /* @__PURE__ */ React15.createElement(import_icons4.MinusIcon, { fontSize: size })
1216
+ label: (0, import_i18n11.__)("No", "elementor"),
1217
+ renderContent: ({ size }) => /* @__PURE__ */ React17.createElement(import_icons4.MinusIcon, { fontSize: size }),
1218
+ showTooltip: true
1159
1219
  },
1160
1220
  {
1161
1221
  value: true,
1162
1222
  disabled: true,
1163
- label: (0, import_i18n10.__)("Yes", "elementor"),
1164
- renderContent: ({ size }) => /* @__PURE__ */ React15.createElement(import_icons4.CheckIcon, { fontSize: size })
1223
+ label: (0, import_i18n11.__)("Yes", "elementor"),
1224
+ renderContent: ({ size }) => /* @__PURE__ */ React17.createElement(import_icons4.CheckIcon, { fontSize: size }),
1225
+ showTooltip: true
1165
1226
  }
1166
1227
  ];
1167
- return /* @__PURE__ */ React15.createElement(import_editor_controls7.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value: false });
1228
+ return /* @__PURE__ */ React17.createElement(import_ui11.Box, { sx: { display: "grid", alignItems: "center" } }, /* @__PURE__ */ React17.createElement(import_ui11.Box, { sx: { gridArea: OVERLAY_GRID } }, /* @__PURE__ */ React17.createElement(import_editor_controls8.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value: false })), /* @__PURE__ */ React17.createElement(import_ui11.Box, { sx: { gridArea: OVERLAY_GRID, marginInlineEnd: CHIP_OFFSET, justifySelf: "end" } }, /* @__PURE__ */ React17.createElement(
1229
+ InteractionsPromotionChip,
1230
+ {
1231
+ content: (0, import_i18n11.__)("Upgrade to run the animation every time its trigger occurs.", "elementor"),
1232
+ upgradeUrl: "https://go.elementor.com/go-pro-interactions-replay-modal/",
1233
+ anchorRef
1234
+ }
1235
+ )));
1168
1236
  }
1169
1237
 
1170
1238
  // src/components/controls/trigger.tsx
1171
- var React16 = __toESM(require("react"));
1172
- var import_editor_ui3 = require("@elementor/editor-ui");
1173
- var import_ui9 = require("@elementor/ui");
1174
- var import_i18n11 = require("@wordpress/i18n");
1239
+ var React18 = __toESM(require("react"));
1240
+ var import_editor_ui4 = require("@elementor/editor-ui");
1241
+ var import_ui12 = require("@elementor/ui");
1242
+ var import_i18n12 = require("@wordpress/i18n");
1175
1243
  function Trigger({ value, onChange }) {
1176
1244
  const availableTriggers = Object.entries({
1177
- load: (0, import_i18n11.__)("Page load", "elementor"),
1178
- scrollIn: (0, import_i18n11.__)("Scroll into view", "elementor"),
1179
- scrollOn: (0, import_i18n11.__)("While Scrolling", "elementor")
1245
+ load: (0, import_i18n12.__)("Page load", "elementor"),
1246
+ scrollIn: (0, import_i18n12.__)("Scroll into view", "elementor"),
1247
+ scrollOn: (0, import_i18n12.__)("While Scrolling", "elementor")
1180
1248
  }).map(([key, label]) => ({
1181
1249
  key,
1182
1250
  label
1183
1251
  }));
1184
- return /* @__PURE__ */ React16.createElement(
1185
- import_ui9.Select,
1252
+ return /* @__PURE__ */ React18.createElement(
1253
+ import_ui12.Select,
1186
1254
  {
1187
1255
  fullWidth: true,
1188
1256
  displayEmpty: true,
@@ -1191,7 +1259,7 @@ function Trigger({ value, onChange }) {
1191
1259
  value
1192
1260
  },
1193
1261
  availableTriggers.map((trigger) => {
1194
- return /* @__PURE__ */ React16.createElement(import_editor_ui3.MenuListItem, { key: trigger.key, value: trigger.key }, trigger.label);
1262
+ return /* @__PURE__ */ React18.createElement(import_editor_ui4.MenuListItem, { key: trigger.key, value: trigger.key }, trigger.label);
1195
1263
  })
1196
1264
  );
1197
1265
  }
@@ -1254,6 +1322,11 @@ function init() {
1254
1322
  component: Replay,
1255
1323
  options: ["true", "false"]
1256
1324
  });
1325
+ registerInteractionsControl({
1326
+ type: "effect",
1327
+ component: Effect,
1328
+ options: ["fade", "slide", "scale"]
1329
+ });
1257
1330
  } catch (error) {
1258
1331
  throw error;
1259
1332
  }