@elementor/editor-interactions 4.1.0-714 → 4.1.0-715

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
@@ -137,6 +137,15 @@ declare const EFFECT_OPTIONS: {
137
137
  };
138
138
  declare const BASE_EFFECTS: string[];
139
139
 
140
+ declare const REPEAT_OPTIONS: {
141
+ times: string;
142
+ loop: string;
143
+ };
144
+ declare const REPEAT_TOOLTIPS: {
145
+ times: string;
146
+ loop: string;
147
+ };
148
+
140
149
  type PlainKeyframeValue = {
141
150
  opacity?: number;
142
151
  scale?: {
@@ -236,4 +245,4 @@ declare const formatSizeValue: ({ size, unit }: SizeValue) => SizeStringValue;
236
245
 
237
246
  declare const useElementInteractions: (elementId: ElementID) => ElementInteractions;
238
247
 
239
- export { BASE_EASINGS, BASE_EFFECTS, BASE_REPLAY, BASE_TRIGGERS, type CreateInteractionsProviderOptions, EASING_OPTIONS, EFFECT_OPTIONS, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, EmptyState, type FieldProps, InteractionsTab, REPLAY_OPTIONS, type ReplayFieldProps, TRIGGER_OPTIONS, buildDisplayLabel, convertTimeUnit, createAnimationPreset, createBoolean, createConfig, createDefaultInteractionItem, createDefaultInteractions, createExcludedBreakpoints, createInteractionBreakpoints, createInteractionItem, createInteractionsProvider, createNumber, createString, createTimingConfig, extractBoolean, extractExcludedBreakpoints, extractSize, extractString, formatSizeValue, generateTempInteractionId, getInteractionsConfig, init, interactionsRepository, isTempId, parseSizeValue, registerInteractionsControl, resolveDirection, useElementInteractions };
248
+ export { BASE_EASINGS, BASE_EFFECTS, BASE_REPLAY, BASE_TRIGGERS, type CreateInteractionsProviderOptions, EASING_OPTIONS, EFFECT_OPTIONS, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, EmptyState, type FieldProps, InteractionsTab, REPEAT_OPTIONS, REPEAT_TOOLTIPS, REPLAY_OPTIONS, type ReplayFieldProps, TRIGGER_OPTIONS, buildDisplayLabel, convertTimeUnit, createAnimationPreset, createBoolean, createConfig, createDefaultInteractionItem, createDefaultInteractions, createExcludedBreakpoints, createInteractionBreakpoints, createInteractionItem, createInteractionsProvider, createNumber, createString, createTimingConfig, extractBoolean, extractExcludedBreakpoints, extractSize, extractString, formatSizeValue, generateTempInteractionId, getInteractionsConfig, init, interactionsRepository, isTempId, parseSizeValue, registerInteractionsControl, resolveDirection, useElementInteractions };
package/dist/index.d.ts CHANGED
@@ -137,6 +137,15 @@ declare const EFFECT_OPTIONS: {
137
137
  };
138
138
  declare const BASE_EFFECTS: string[];
139
139
 
140
+ declare const REPEAT_OPTIONS: {
141
+ times: string;
142
+ loop: string;
143
+ };
144
+ declare const REPEAT_TOOLTIPS: {
145
+ times: string;
146
+ loop: string;
147
+ };
148
+
140
149
  type PlainKeyframeValue = {
141
150
  opacity?: number;
142
151
  scale?: {
@@ -236,4 +245,4 @@ declare const formatSizeValue: ({ size, unit }: SizeValue) => SizeStringValue;
236
245
 
237
246
  declare const useElementInteractions: (elementId: ElementID) => ElementInteractions;
238
247
 
239
- export { BASE_EASINGS, BASE_EFFECTS, BASE_REPLAY, BASE_TRIGGERS, type CreateInteractionsProviderOptions, EASING_OPTIONS, EFFECT_OPTIONS, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, EmptyState, type FieldProps, InteractionsTab, REPLAY_OPTIONS, type ReplayFieldProps, TRIGGER_OPTIONS, buildDisplayLabel, convertTimeUnit, createAnimationPreset, createBoolean, createConfig, createDefaultInteractionItem, createDefaultInteractions, createExcludedBreakpoints, createInteractionBreakpoints, createInteractionItem, createInteractionsProvider, createNumber, createString, createTimingConfig, extractBoolean, extractExcludedBreakpoints, extractSize, extractString, formatSizeValue, generateTempInteractionId, getInteractionsConfig, init, interactionsRepository, isTempId, parseSizeValue, registerInteractionsControl, resolveDirection, useElementInteractions };
248
+ export { BASE_EASINGS, BASE_EFFECTS, BASE_REPLAY, BASE_TRIGGERS, type CreateInteractionsProviderOptions, EASING_OPTIONS, EFFECT_OPTIONS, ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX, EmptyState, type FieldProps, InteractionsTab, REPEAT_OPTIONS, REPEAT_TOOLTIPS, REPLAY_OPTIONS, type ReplayFieldProps, TRIGGER_OPTIONS, buildDisplayLabel, convertTimeUnit, createAnimationPreset, createBoolean, createConfig, createDefaultInteractionItem, createDefaultInteractions, createExcludedBreakpoints, createInteractionBreakpoints, createInteractionItem, createInteractionsProvider, createNumber, createString, createTimingConfig, extractBoolean, extractExcludedBreakpoints, extractSize, extractString, formatSizeValue, generateTempInteractionId, getInteractionsConfig, init, interactionsRepository, isTempId, parseSizeValue, registerInteractionsControl, resolveDirection, useElementInteractions };
package/dist/index.js CHANGED
@@ -39,6 +39,8 @@ __export(index_exports, {
39
39
  ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX: () => ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX,
40
40
  EmptyState: () => EmptyState,
41
41
  InteractionsTab: () => InteractionsTab,
42
+ REPEAT_OPTIONS: () => REPEAT_OPTIONS,
43
+ REPEAT_TOOLTIPS: () => REPEAT_TOOLTIPS,
42
44
  REPLAY_OPTIONS: () => REPLAY_OPTIONS,
43
45
  TRIGGER_OPTIONS: () => TRIGGER_OPTIONS,
44
46
  buildDisplayLabel: () => buildDisplayLabel,
@@ -864,7 +866,6 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
864
866
  controlVisibilityConfig.times(interactionValues)
865
867
  );
866
868
  const EasingControl = useControlComponent("easing");
867
- const containerRef = (0, import_react6.useRef)(null);
868
869
  const updateInteraction = (updates) => {
869
870
  const resolvedDirectionValue = resolveDirection(
870
871
  "direction" in updates,
@@ -899,19 +900,12 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
899
900
  onPlayInteraction(interactionId);
900
901
  }, 0);
901
902
  };
902
- return /* @__PURE__ */ React7.createElement(import_ui3.Box, { ref: containerRef }, /* @__PURE__ */ React7.createElement(import_editor_controls3.PopoverContent, { p: 1.5 }, /* @__PURE__ */ React7.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, TriggerControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Trigger", "elementor") }, /* @__PURE__ */ React7.createElement(
903
- TriggerControl,
904
- {
905
- value: trigger,
906
- onChange: (v) => updateInteraction({ trigger: v })
907
- }
908
- )), ReplayControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Replay", "elementor") }, /* @__PURE__ */ React7.createElement(
903
+ return /* @__PURE__ */ React7.createElement(import_editor_controls3.PopoverContent, { p: 1.5 }, /* @__PURE__ */ React7.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, TriggerControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Trigger", "elementor") }, /* @__PURE__ */ React7.createElement(TriggerControl, { value: trigger, onChange: (v) => updateInteraction({ trigger: v }) })), ReplayControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Replay", "elementor") }, /* @__PURE__ */ React7.createElement(
909
904
  ReplayControl,
910
905
  {
911
906
  value: replay,
912
907
  onChange: (v) => updateInteraction({ replay: v }),
913
- disabled: true,
914
- anchorRef: containerRef
908
+ disabled: true
915
909
  }
916
910
  ))), /* @__PURE__ */ React7.createElement(import_ui3.Divider, null), /* @__PURE__ */ React7.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, EffectControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Effect", "elementor") }, /* @__PURE__ */ React7.createElement(EffectControl, { value: effect, onChange: (v) => updateInteraction({ effect: v }) })), CustomEffectControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Custom Effect", "elementor") }, /* @__PURE__ */ React7.createElement(
917
911
  CustomEffectControl,
@@ -974,7 +968,7 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
974
968
  updateInteraction({ easing: v });
975
969
  }
976
970
  }
977
- )))));
971
+ ))));
978
972
  };
979
973
 
980
974
  // src/components/interaction-settings.tsx
@@ -1573,7 +1567,6 @@ var InteractionsPromotionChip = (0, import_react12.forwardRef)(
1573
1567
  );
1574
1568
  }
1575
1569
  );
1576
- InteractionsPromotionChip.displayName = "InteractionsPromotionChip";
1577
1570
 
1578
1571
  // src/ui/promotion-select.tsx
1579
1572
  function PromotionSelect({
@@ -1721,58 +1714,128 @@ function EffectType({ value, onChange }) {
1721
1714
  return /* @__PURE__ */ React17.createElement(import_editor_controls8.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value });
1722
1715
  }
1723
1716
 
1724
- // src/components/controls/replay.tsx
1725
- var React18 = __toESM(require("react"));
1717
+ // src/components/controls/repeat.tsx
1718
+ var React19 = __toESM(require("react"));
1719
+ var import_react15 = require("react");
1726
1720
  var import_editor_controls9 = require("@elementor/editor-controls");
1727
1721
  var import_icons4 = require("@elementor/icons");
1728
- var import_ui11 = require("@elementor/ui");
1729
1722
  var import_i18n13 = require("@wordpress/i18n");
1730
- var TRACKING_DATA3 = { target_name: "interactions_replay", location_l2: "interactions" };
1723
+
1724
+ // src/ui/promotion-overlay-layout.tsx
1725
+ var React18 = __toESM(require("react"));
1726
+ var import_react14 = require("react");
1727
+ var import_ui11 = require("@elementor/ui");
1728
+ var OVERLAY_GRID = "1 / 1";
1729
+ var CHIP_OFFSET = "50%";
1730
+ var PromotionOverlayLayout = (0, import_react14.forwardRef)(
1731
+ ({ children, promotionChip }, ref) => /* @__PURE__ */ React18.createElement(import_ui11.Box, { ref, sx: { display: "grid", alignItems: "center" } }, /* @__PURE__ */ React18.createElement(import_ui11.Box, { sx: { gridArea: OVERLAY_GRID } }, children), /* @__PURE__ */ React18.createElement(import_ui11.Box, { sx: { gridArea: OVERLAY_GRID, marginInlineEnd: CHIP_OFFSET, justifySelf: "end" } }, promotionChip))
1732
+ );
1733
+
1734
+ // src/components/controls/repeat.tsx
1735
+ var TRACKING_DATA3 = { target_name: "interactions_repeat", location_l2: "interactions" };
1736
+ var REPEAT_OPTIONS = {
1737
+ times: (0, import_i18n13.__)("times", "elementor"),
1738
+ loop: (0, import_i18n13.__)("loop", "elementor")
1739
+ };
1740
+ var REPEAT_TOOLTIPS = {
1741
+ times: (0, import_i18n13.__)("Enable number", "elementor"),
1742
+ loop: (0, import_i18n13.__)("Infinite repeat", "elementor")
1743
+ };
1744
+ function Repeat() {
1745
+ const repeatContainerRef = (0, import_react15.useRef)(null);
1746
+ const options = [
1747
+ {
1748
+ value: REPEAT_OPTIONS.times,
1749
+ disabled: true,
1750
+ label: REPEAT_TOOLTIPS.times,
1751
+ renderContent: ({ size }) => /* @__PURE__ */ React19.createElement(import_icons4.Number123Icon, { fontSize: size }),
1752
+ showTooltip: true
1753
+ },
1754
+ {
1755
+ value: REPEAT_OPTIONS.loop,
1756
+ disabled: true,
1757
+ label: REPEAT_TOOLTIPS.loop,
1758
+ renderContent: ({ size }) => /* @__PURE__ */ React19.createElement(import_icons4.RepeatIcon, { fontSize: size }),
1759
+ showTooltip: true
1760
+ }
1761
+ ];
1762
+ return /* @__PURE__ */ React19.createElement(
1763
+ PromotionOverlayLayout,
1764
+ {
1765
+ ref: repeatContainerRef,
1766
+ promotionChip: /* @__PURE__ */ React19.createElement(
1767
+ InteractionsPromotionChip,
1768
+ {
1769
+ content: (0, import_i18n13.__)("Upgrade to control how many times the animation repeats.", "elementor"),
1770
+ upgradeUrl: "https://go.elementor.com/go-pro-interactions-repeat-modal/",
1771
+ anchorRef: repeatContainerRef,
1772
+ trackingData: TRACKING_DATA3
1773
+ }
1774
+ )
1775
+ },
1776
+ /* @__PURE__ */ React19.createElement(import_editor_controls9.ToggleButtonGroupUi, { items: options, exclusive: true, onChange: () => {
1777
+ }, value: "" })
1778
+ );
1779
+ }
1780
+
1781
+ // src/components/controls/replay.tsx
1782
+ var React20 = __toESM(require("react"));
1783
+ var import_react16 = require("react");
1784
+ var import_editor_controls10 = require("@elementor/editor-controls");
1785
+ var import_icons5 = require("@elementor/icons");
1786
+ var import_i18n14 = require("@wordpress/i18n");
1787
+ var TRACKING_DATA4 = { target_name: "interactions_replay", location_l2: "interactions" };
1731
1788
  var REPLAY_OPTIONS = {
1732
- no: (0, import_i18n13.__)("No", "elementor"),
1733
- yes: (0, import_i18n13.__)("Yes", "elementor")
1789
+ no: (0, import_i18n14.__)("No", "elementor"),
1790
+ yes: (0, import_i18n14.__)("Yes", "elementor")
1734
1791
  };
1735
1792
  var BASE_REPLAY = ["no"];
1736
- var OVERLAY_GRID = "1 / 1";
1737
- var CHIP_OFFSET = "50%";
1738
- function Replay({ onChange, anchorRef }) {
1793
+ function Replay({ onChange }) {
1794
+ const replayContainerRef = (0, import_react16.useRef)(null);
1739
1795
  const options = [
1740
1796
  {
1741
1797
  value: false,
1742
1798
  disabled: false,
1743
1799
  label: REPLAY_OPTIONS.no,
1744
- renderContent: ({ size }) => /* @__PURE__ */ React18.createElement(import_icons4.MinusIcon, { fontSize: size }),
1800
+ renderContent: ({ size }) => /* @__PURE__ */ React20.createElement(import_icons5.MinusIcon, { fontSize: size }),
1745
1801
  showTooltip: true
1746
1802
  },
1747
1803
  {
1748
1804
  value: true,
1749
1805
  disabled: true,
1750
1806
  label: REPLAY_OPTIONS.yes,
1751
- renderContent: ({ size }) => /* @__PURE__ */ React18.createElement(import_icons4.CheckIcon, { fontSize: size }),
1807
+ renderContent: ({ size }) => /* @__PURE__ */ React20.createElement(import_icons5.CheckIcon, { fontSize: size }),
1752
1808
  showTooltip: true
1753
1809
  }
1754
1810
  ];
1755
- return /* @__PURE__ */ React18.createElement(import_ui11.Box, { sx: { display: "grid", alignItems: "center" } }, /* @__PURE__ */ React18.createElement(import_ui11.Box, { sx: { gridArea: OVERLAY_GRID } }, /* @__PURE__ */ React18.createElement(import_editor_controls9.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value: false })), /* @__PURE__ */ React18.createElement(import_ui11.Box, { sx: { gridArea: OVERLAY_GRID, marginInlineEnd: CHIP_OFFSET, justifySelf: "end" } }, /* @__PURE__ */ React18.createElement(
1756
- InteractionsPromotionChip,
1811
+ return /* @__PURE__ */ React20.createElement(
1812
+ PromotionOverlayLayout,
1757
1813
  {
1758
- content: (0, import_i18n13.__)("Upgrade to run the animation every time its trigger occurs.", "elementor"),
1759
- upgradeUrl: "https://go.elementor.com/go-pro-interactions-replay-modal/",
1760
- anchorRef,
1761
- trackingData: TRACKING_DATA3
1762
- }
1763
- )));
1814
+ ref: replayContainerRef,
1815
+ promotionChip: /* @__PURE__ */ React20.createElement(
1816
+ InteractionsPromotionChip,
1817
+ {
1818
+ content: (0, import_i18n14.__)("Upgrade to run the animation every time its trigger occurs.", "elementor"),
1819
+ upgradeUrl: "https://go.elementor.com/go-pro-interactions-replay-modal/",
1820
+ anchorRef: replayContainerRef,
1821
+ trackingData: TRACKING_DATA4
1822
+ }
1823
+ )
1824
+ },
1825
+ /* @__PURE__ */ React20.createElement(import_editor_controls10.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value: false })
1826
+ );
1764
1827
  }
1765
1828
 
1766
1829
  // src/components/controls/trigger.tsx
1767
- var React19 = __toESM(require("react"));
1768
- var import_i18n14 = require("@wordpress/i18n");
1769
- var TRACKING_DATA4 = { target_name: "interactions_trigger", location_l2: "interactions" };
1830
+ var React21 = __toESM(require("react"));
1831
+ var import_i18n15 = require("@wordpress/i18n");
1832
+ var TRACKING_DATA5 = { target_name: "interactions_trigger", location_l2: "interactions" };
1770
1833
  var TRIGGER_OPTIONS = {
1771
- load: (0, import_i18n14.__)("Page load", "elementor"),
1772
- scrollIn: (0, import_i18n14.__)("Scroll into view", "elementor"),
1773
- scrollOn: (0, import_i18n14.__)("While scrolling", "elementor"),
1774
- hover: (0, import_i18n14.__)("On hover", "elementor"),
1775
- click: (0, import_i18n14.__)("On click", "elementor")
1834
+ load: (0, import_i18n15.__)("Page load", "elementor"),
1835
+ scrollIn: (0, import_i18n15.__)("Scroll into view", "elementor"),
1836
+ scrollOn: (0, import_i18n15.__)("While scrolling", "elementor"),
1837
+ hover: (0, import_i18n15.__)("On hover", "elementor"),
1838
+ click: (0, import_i18n15.__)("On click", "elementor")
1776
1839
  };
1777
1840
  var BASE_TRIGGERS = ["load", "scrollIn"];
1778
1841
  function Trigger({ value, onChange }) {
@@ -1782,17 +1845,17 @@ function Trigger({ value, onChange }) {
1782
1845
  const disabledOptions = Object.fromEntries(
1783
1846
  Object.entries(TRIGGER_OPTIONS).filter(([key]) => !BASE_TRIGGERS.includes(key))
1784
1847
  );
1785
- return /* @__PURE__ */ React19.createElement(
1848
+ return /* @__PURE__ */ React21.createElement(
1786
1849
  PromotionSelect,
1787
1850
  {
1788
1851
  value: value in baseOptions ? value : DEFAULT_VALUES.trigger,
1789
1852
  onChange,
1790
1853
  baseOptions,
1791
1854
  disabledOptions,
1792
- promotionLabel: (0, import_i18n14.__)("PRO triggers", "elementor"),
1793
- promotionContent: (0, import_i18n14.__)("Upgrade to unlock more interactions triggers.", "elementor"),
1855
+ promotionLabel: (0, import_i18n15.__)("PRO triggers", "elementor"),
1856
+ promotionContent: (0, import_i18n15.__)("Upgrade to unlock more interactions triggers.", "elementor"),
1794
1857
  upgradeUrl: "https://go.elementor.com/go-pro-interactions-triggers-modal/",
1795
- trackingData: TRACKING_DATA4
1858
+ trackingData: TRACKING_DATA5
1796
1859
  }
1797
1860
  );
1798
1861
  }
@@ -2172,6 +2235,10 @@ function init() {
2172
2235
  component: Effect,
2173
2236
  options: ["fade", "slide", "scale"]
2174
2237
  });
2238
+ registerInteractionsControl({
2239
+ type: "repeat",
2240
+ component: Repeat
2241
+ });
2175
2242
  initMcpInteractions();
2176
2243
  } catch (error) {
2177
2244
  throw error;
@@ -2188,6 +2255,8 @@ function init() {
2188
2255
  ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX,
2189
2256
  EmptyState,
2190
2257
  InteractionsTab,
2258
+ REPEAT_OPTIONS,
2259
+ REPEAT_TOOLTIPS,
2191
2260
  REPLAY_OPTIONS,
2192
2261
  TRIGGER_OPTIONS,
2193
2262
  buildDisplayLabel,