@elementor/editor-interactions 4.5.0-1179 → 4.5.0-1181

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
@@ -1,9 +1,19 @@
1
1
  // src/components/empty-state.tsx
2
2
  import * as React from "react";
3
3
  import { SwipeIcon } from "@elementor/icons";
4
- import { Button, Stack, Typography } from "@elementor/ui";
4
+ import { Box, Button, Stack, Typography } from "@elementor/ui";
5
5
  import { __ } from "@wordpress/i18n";
6
- var EmptyState = ({ onCreateInteraction }) => {
6
+
7
+ // src/components/interactions-header-location.tsx
8
+ import { createLocation } from "@elementor/locations";
9
+ var {
10
+ Slot: InteractionsHeaderSlot,
11
+ inject: injectIntoInteractionsHeader,
12
+ useInjections: useInteractionsHeaderInjections
13
+ } = createLocation();
14
+
15
+ // src/components/empty-state.tsx
16
+ var EmptyState = ({ elementId, onCreateInteraction }) => {
7
17
  return /* @__PURE__ */ React.createElement(
8
18
  Stack,
9
19
  {
@@ -11,9 +21,10 @@ var EmptyState = ({ onCreateInteraction }) => {
11
21
  justifyContent: "center",
12
22
  height: "100%",
13
23
  color: "text.secondary",
14
- sx: { p: 2.5, pt: 8, pb: 5.5 },
24
+ sx: { position: "relative", p: 2.5, pt: 8, pb: 5.5 },
15
25
  gap: 1.5
16
26
  },
27
+ /* @__PURE__ */ React.createElement(Box, { sx: { position: "absolute", top: 8, insetInlineEnd: 8 } }, /* @__PURE__ */ React.createElement(InteractionsHeaderSlot, { elementId })),
17
28
  /* @__PURE__ */ React.createElement(SwipeIcon, { fontSize: "large" }),
18
29
  /* @__PURE__ */ React.createElement(Typography, { align: "center", variant: "subtitle2" }, __("Animate elements with Interactions", "elementor")),
19
30
  /* @__PURE__ */ React.createElement(Typography, { align: "center", variant: "caption", maxWidth: "170px" }, __(
@@ -564,7 +575,7 @@ import * as React10 from "react";
564
575
  import { useCallback as useCallback5, useEffect as useEffect2, useMemo as useMemo4, useRef } from "react";
565
576
  import { Repeater } from "@elementor/editor-controls";
566
577
  import { InfoCircleFilledIcon, PlayerPlayIcon } from "@elementor/icons";
567
- import { Alert, AlertTitle, Box, IconButton, Tooltip } from "@elementor/ui";
578
+ import { Alert, AlertTitle, Box as Box2, IconButton, Tooltip } from "@elementor/ui";
568
579
  import { __ as __6 } from "@wordpress/i18n";
569
580
 
570
581
  // src/contexts/interactions-item-context.tsx
@@ -1068,7 +1079,7 @@ function InteractionsList(props) {
1068
1079
  const isMaxNumberOfInteractionsReached = useMemo4(() => {
1069
1080
  return interactions.items?.length >= MAX_NUMBER_OF_INTERACTIONS;
1070
1081
  }, [interactions.items?.length]);
1071
- 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(Box, { component: "span" }, __6(
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" }, __6(
1072
1083
  "You've reached the limit of 5 interactions for this element. Please remove an interaction before creating a new one.",
1073
1084
  "elementor"
1074
1085
  ))) : void 0;
@@ -1114,6 +1125,7 @@ function InteractionsList(props) {
1114
1125
  openOnAdd: true,
1115
1126
  openItem: triggerCreateOnShowEmpty ? 0 : void 0,
1116
1127
  label: __6("Interactions", "elementor"),
1128
+ headerActions: /* @__PURE__ */ React10.createElement(InteractionsHeaderSlot, { elementId }),
1117
1129
  values: interactions.items,
1118
1130
  setValues: handleRepeaterChange,
1119
1131
  showDuplicate: false,
@@ -1166,6 +1178,7 @@ function InteractionsTabContent({ elementId }) {
1166
1178
  return /* @__PURE__ */ React11.createElement(SessionStorageProvider, { prefix: elementId }, hasInteractions ? /* @__PURE__ */ React11.createElement(InteractionsProvider, { elementId }, /* @__PURE__ */ React11.createElement(InteractionsContent, { firstInteractionState })) : /* @__PURE__ */ React11.createElement(
1167
1179
  EmptyState,
1168
1180
  {
1181
+ elementId,
1169
1182
  onCreateInteraction: () => {
1170
1183
  firstInteractionState[1](true);
1171
1184
  }
@@ -1516,7 +1529,7 @@ import * as React13 from "react";
1516
1529
  import { forwardRef, useCallback as useCallback7, useImperativeHandle, useState as useState5 } from "react";
1517
1530
  import { trackUpgradePromotionClick, trackViewPromotion } from "@elementor/editor-controls";
1518
1531
  import { PromotionChip, PromotionPopover, useCanvasClickHandler } from "@elementor/editor-ui";
1519
- import { Box as Box2 } from "@elementor/ui";
1532
+ import { Box as Box3 } from "@elementor/ui";
1520
1533
  import { __ as __9 } from "@wordpress/i18n";
1521
1534
  var InteractionsPromotionChip = forwardRef(
1522
1535
  ({ content, upgradeUrl, anchorRef, trackingData }, ref) => {
@@ -1552,7 +1565,7 @@ var InteractionsPromotionChip = forwardRef(
1552
1565
  onCtaClick: () => trackUpgradePromotionClick(trackingData)
1553
1566
  },
1554
1567
  /* @__PURE__ */ React13.createElement(
1555
- Box2,
1568
+ Box3,
1556
1569
  {
1557
1570
  onMouseDown: (e) => e.stopPropagation(),
1558
1571
  onClick: handleToggle,
@@ -1720,11 +1733,11 @@ import { __ as __14 } from "@wordpress/i18n";
1720
1733
  // src/ui/promotion-overlay-layout.tsx
1721
1734
  import * as React18 from "react";
1722
1735
  import { forwardRef as forwardRef2 } from "react";
1723
- import { Box as Box3 } from "@elementor/ui";
1736
+ import { Box as Box4 } from "@elementor/ui";
1724
1737
  var OVERLAY_GRID = "1 / 1";
1725
1738
  var CHIP_OFFSET = "50%";
1726
1739
  var PromotionOverlayLayout = forwardRef2(
1727
- ({ children, promotionChip }, ref) => /* @__PURE__ */ React18.createElement(Box3, { ref, sx: { display: "grid", alignItems: "center" } }, /* @__PURE__ */ React18.createElement(Box3, { sx: { gridArea: OVERLAY_GRID } }, children), /* @__PURE__ */ React18.createElement(Box3, { sx: { gridArea: OVERLAY_GRID, marginInlineEnd: CHIP_OFFSET, justifySelf: "end" } }, promotionChip))
1740
+ ({ children, promotionChip }, ref) => /* @__PURE__ */ React18.createElement(Box4, { ref, sx: { display: "grid", alignItems: "center" } }, /* @__PURE__ */ React18.createElement(Box4, { sx: { gridArea: OVERLAY_GRID } }, children), /* @__PURE__ */ React18.createElement(Box4, { sx: { gridArea: OVERLAY_GRID, marginInlineEnd: CHIP_OFFSET, justifySelf: "end" } }, promotionChip))
1728
1741
  );
1729
1742
 
1730
1743
  // src/components/controls/repeat.tsx
@@ -2299,6 +2312,7 @@ export {
2299
2312
  generateTempInteractionId,
2300
2313
  getInteractionsConfig,
2301
2314
  init,
2315
+ injectIntoInteractionsHeader,
2302
2316
  interactionsRepository,
2303
2317
  isTempId,
2304
2318
  parseSizeValue,