@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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +176 -103
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +177 -104
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/components/controls/replay.tsx +22 -2
- package/src/components/field.tsx +19 -0
- package/src/components/interaction-details.tsx +119 -131
- package/src/index.ts +1 -0
- package/src/init.ts +9 -0
- package/src/types.ts +2 -0
- package/src/ui/interactions-promotion-chip.tsx +39 -0
- package/src/utils/resolve-direction.ts +20 -0
package/dist/index.mjs
CHANGED
|
@@ -92,11 +92,11 @@ var PopupStateProvider = ({ children }) => {
|
|
|
92
92
|
|
|
93
93
|
// src/components/interactions-list.tsx
|
|
94
94
|
import * as React12 from "react";
|
|
95
|
-
import { useCallback as useCallback5, useEffect as useEffect2, useMemo as useMemo4, useRef as
|
|
95
|
+
import { useCallback as useCallback5, useEffect as useEffect2, useMemo as useMemo4, useRef as useRef3 } from "react";
|
|
96
96
|
import { Repeater } from "@elementor/editor-controls";
|
|
97
97
|
import { InfoCircleFilledIcon, PlayerPlayIcon } from "@elementor/icons";
|
|
98
|
-
import { Alert, AlertTitle, Box, IconButton, Tooltip } from "@elementor/ui";
|
|
99
|
-
import { __ as
|
|
98
|
+
import { Alert, AlertTitle, Box as Box2, IconButton, Tooltip } from "@elementor/ui";
|
|
99
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
100
100
|
|
|
101
101
|
// src/contexts/interactions-item-context.tsx
|
|
102
102
|
import * as React4 from "react";
|
|
@@ -339,14 +339,14 @@ var buildDisplayLabel = (item) => {
|
|
|
339
339
|
import * as React11 from "react";
|
|
340
340
|
import { useCallback as useCallback4 } from "react";
|
|
341
341
|
import { Divider as Divider2, Tab, TabPanel, Tabs, useTabs } from "@elementor/ui";
|
|
342
|
-
import { __ as
|
|
342
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
343
343
|
|
|
344
344
|
// src/components/interaction-details.tsx
|
|
345
345
|
import * as React9 from "react";
|
|
346
|
-
import { useMemo as useMemo2 } from "react";
|
|
347
|
-
import {
|
|
348
|
-
import { Divider, Grid } from "@elementor/ui";
|
|
349
|
-
import { __ as
|
|
346
|
+
import { useMemo as useMemo2, useRef as useRef2 } from "react";
|
|
347
|
+
import { PopoverContent } from "@elementor/editor-controls";
|
|
348
|
+
import { Box, Divider, Grid as Grid2 } from "@elementor/ui";
|
|
349
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
350
350
|
|
|
351
351
|
// src/interactions-controls-registry.ts
|
|
352
352
|
var controlsRegistry = /* @__PURE__ */ new Map();
|
|
@@ -361,6 +361,20 @@ function getInteractionsControl(type) {
|
|
|
361
361
|
return controlsRegistry.get(type);
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
// src/utils/resolve-direction.ts
|
|
365
|
+
var resolveDirection = (hasDirection, newEffect, newDirection, currentDirection, currentEffect) => {
|
|
366
|
+
if (newEffect === "slide" && !newDirection) {
|
|
367
|
+
return "top";
|
|
368
|
+
}
|
|
369
|
+
if (currentEffect === "slide" && hasDirection) {
|
|
370
|
+
return newDirection ?? "top";
|
|
371
|
+
}
|
|
372
|
+
if (hasDirection) {
|
|
373
|
+
return newDirection;
|
|
374
|
+
}
|
|
375
|
+
return currentDirection;
|
|
376
|
+
};
|
|
377
|
+
|
|
364
378
|
// src/components/controls/direction.tsx
|
|
365
379
|
import * as React5 from "react";
|
|
366
380
|
import { useMemo } from "react";
|
|
@@ -400,56 +414,30 @@ function Direction({ value, onChange, interactionType }) {
|
|
|
400
414
|
return /* @__PURE__ */ React5.createElement(ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value });
|
|
401
415
|
}
|
|
402
416
|
|
|
403
|
-
// src/components/controls/effect.tsx
|
|
404
|
-
import * as React6 from "react";
|
|
405
|
-
import { MenuListItem } from "@elementor/editor-ui";
|
|
406
|
-
import { Select } from "@elementor/ui";
|
|
407
|
-
import { __ as __3 } from "@wordpress/i18n";
|
|
408
|
-
function Effect({ value, onChange }) {
|
|
409
|
-
const availableEffects = [
|
|
410
|
-
{ key: "fade", label: __3("Fade", "elementor") },
|
|
411
|
-
{ key: "slide", label: __3("Slide", "elementor") },
|
|
412
|
-
{ key: "scale", label: __3("Scale", "elementor") }
|
|
413
|
-
];
|
|
414
|
-
return /* @__PURE__ */ React6.createElement(
|
|
415
|
-
Select,
|
|
416
|
-
{
|
|
417
|
-
fullWidth: true,
|
|
418
|
-
displayEmpty: true,
|
|
419
|
-
size: "tiny",
|
|
420
|
-
value,
|
|
421
|
-
onChange: (event) => onChange(event.target.value)
|
|
422
|
-
},
|
|
423
|
-
availableEffects.map((effect) => {
|
|
424
|
-
return /* @__PURE__ */ React6.createElement(MenuListItem, { key: effect.key, value: effect.key }, effect.label);
|
|
425
|
-
})
|
|
426
|
-
);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
417
|
// src/components/controls/effect-type.tsx
|
|
430
|
-
import * as
|
|
418
|
+
import * as React6 from "react";
|
|
431
419
|
import { ToggleButtonGroupUi as ToggleButtonGroupUi2 } from "@elementor/editor-controls";
|
|
432
|
-
import { __ as
|
|
420
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
433
421
|
function EffectType({ value, onChange }) {
|
|
434
422
|
const options = [
|
|
435
423
|
{
|
|
436
424
|
value: "in",
|
|
437
|
-
label:
|
|
438
|
-
renderContent: () =>
|
|
425
|
+
label: __3("In", "elementor"),
|
|
426
|
+
renderContent: () => __3("In", "elementor"),
|
|
439
427
|
showTooltip: true
|
|
440
428
|
},
|
|
441
429
|
{
|
|
442
430
|
value: "out",
|
|
443
|
-
label:
|
|
444
|
-
renderContent: () =>
|
|
431
|
+
label: __3("Out", "elementor"),
|
|
432
|
+
renderContent: () => __3("Out", "elementor"),
|
|
445
433
|
showTooltip: true
|
|
446
434
|
}
|
|
447
435
|
];
|
|
448
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ React6.createElement(ToggleButtonGroupUi2, { items: options, exclusive: true, onChange, value });
|
|
449
437
|
}
|
|
450
438
|
|
|
451
439
|
// src/components/controls/time-frame-indicator.tsx
|
|
452
|
-
import * as
|
|
440
|
+
import * as React7 from "react";
|
|
453
441
|
import { useCallback as useCallback2, useRef } from "react";
|
|
454
442
|
import { UnstableSizeField } from "@elementor/editor-controls";
|
|
455
443
|
|
|
@@ -491,7 +479,7 @@ function TimeFrameIndicator({
|
|
|
491
479
|
setValue(parseSizeValue(defaultValue, TIME_UNITS, void 0, DEFAULT_TIME_UNIT));
|
|
492
480
|
}
|
|
493
481
|
};
|
|
494
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ React7.createElement(
|
|
495
483
|
UnstableSizeField,
|
|
496
484
|
{
|
|
497
485
|
units: TIME_UNITS,
|
|
@@ -507,6 +495,14 @@ function TimeFrameIndicator({
|
|
|
507
495
|
);
|
|
508
496
|
}
|
|
509
497
|
|
|
498
|
+
// src/components/field.tsx
|
|
499
|
+
import * as React8 from "react";
|
|
500
|
+
import { ControlFormLabel, PopoverGridContainer } from "@elementor/editor-controls";
|
|
501
|
+
import { Grid } from "@elementor/ui";
|
|
502
|
+
var Field = ({ label, children }) => {
|
|
503
|
+
return /* @__PURE__ */ React8.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React8.createElement(PopoverGridContainer, null, /* @__PURE__ */ React8.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React8.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React8.createElement(Grid, { item: true, xs: 6 }, children)));
|
|
504
|
+
};
|
|
505
|
+
|
|
510
506
|
// src/components/interaction-details.tsx
|
|
511
507
|
var DEFAULT_VALUES = {
|
|
512
508
|
trigger: "load",
|
|
@@ -521,7 +517,7 @@ var DEFAULT_VALUES = {
|
|
|
521
517
|
offsetTop: 15,
|
|
522
518
|
offsetBottom: 85
|
|
523
519
|
};
|
|
524
|
-
var TRIGGERS_WITHOUT_REPLAY = ["load", "scrollOn"];
|
|
520
|
+
var TRIGGERS_WITHOUT_REPLAY = ["load", "scrollOn", "hover", "click"];
|
|
525
521
|
var controlVisibilityConfig = {
|
|
526
522
|
replay: (values) => !TRIGGERS_WITHOUT_REPLAY.includes(values.trigger),
|
|
527
523
|
relativeTo: (values) => values.trigger === "scrollOn",
|
|
@@ -573,6 +569,7 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
573
569
|
offsetBottom
|
|
574
570
|
};
|
|
575
571
|
const TriggerControl = useControlComponent("trigger", true);
|
|
572
|
+
const EffectControl = useControlComponent("effect");
|
|
576
573
|
const ReplayControl = useControlComponent("replay", controlVisibilityConfig.replay(interactionValues));
|
|
577
574
|
const RelativeToControl = useControlComponent(
|
|
578
575
|
"relativeTo",
|
|
@@ -584,17 +581,15 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
584
581
|
controlVisibilityConfig.offsetBottom(interactionValues)
|
|
585
582
|
);
|
|
586
583
|
const EasingControl = useControlComponent("easing");
|
|
587
|
-
const
|
|
588
|
-
if (newEffect === "slide" && !newDirection) {
|
|
589
|
-
return "top";
|
|
590
|
-
}
|
|
591
|
-
if (hasDirection) {
|
|
592
|
-
return newDirection;
|
|
593
|
-
}
|
|
594
|
-
return direction;
|
|
595
|
-
};
|
|
584
|
+
const containerRef = useRef2(null);
|
|
596
585
|
const updateInteraction = (updates) => {
|
|
597
|
-
const resolvedDirectionValue = resolveDirection(
|
|
586
|
+
const resolvedDirectionValue = resolveDirection(
|
|
587
|
+
"direction" in updates,
|
|
588
|
+
updates.effect,
|
|
589
|
+
updates.direction,
|
|
590
|
+
direction,
|
|
591
|
+
effect
|
|
592
|
+
);
|
|
598
593
|
const updatedInteraction = {
|
|
599
594
|
...interaction,
|
|
600
595
|
interaction_id: interaction.interaction_id,
|
|
@@ -618,53 +613,60 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
618
613
|
onPlayInteraction(interactionId);
|
|
619
614
|
}, 0);
|
|
620
615
|
};
|
|
621
|
-
return /* @__PURE__ */ React9.createElement(
|
|
616
|
+
return /* @__PURE__ */ React9.createElement(Box, { ref: containerRef }, /* @__PURE__ */ React9.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React9.createElement(Grid2, { container: true, spacing: 1.5 }, TriggerControl && /* @__PURE__ */ React9.createElement(Field, { label: __4("Trigger", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
617
|
+
TriggerControl,
|
|
618
|
+
{
|
|
619
|
+
value: trigger,
|
|
620
|
+
onChange: (v) => updateInteraction({ trigger: v })
|
|
621
|
+
}
|
|
622
|
+
)), ReplayControl && /* @__PURE__ */ React9.createElement(Field, { label: __4("Replay", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
622
623
|
ReplayControl,
|
|
623
624
|
{
|
|
624
625
|
value: replay,
|
|
625
626
|
onChange: (v) => updateInteraction({ replay: v }),
|
|
626
|
-
disabled: true
|
|
627
|
+
disabled: true,
|
|
628
|
+
anchorRef: containerRef
|
|
627
629
|
}
|
|
628
|
-
))), /* @__PURE__ */ React9.createElement(Divider, null), /* @__PURE__ */ React9.createElement(
|
|
630
|
+
))), /* @__PURE__ */ React9.createElement(Divider, null), /* @__PURE__ */ React9.createElement(Grid2, { container: true, spacing: 1.5 }, EffectControl && /* @__PURE__ */ React9.createElement(Field, { label: __4("Effect", "elementor") }, /* @__PURE__ */ React9.createElement(EffectControl, { value: effect, onChange: (v) => updateInteraction({ effect: v }) })), /* @__PURE__ */ React9.createElement(Field, { label: __4("Type", "elementor") }, /* @__PURE__ */ React9.createElement(EffectType, { value: type, onChange: (v) => updateInteraction({ type: v }) })), /* @__PURE__ */ React9.createElement(Field, { label: __4("Direction", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
629
631
|
Direction,
|
|
630
632
|
{
|
|
631
633
|
value: direction,
|
|
632
634
|
onChange: (v) => updateInteraction({ direction: v }),
|
|
633
635
|
interactionType: type
|
|
634
636
|
}
|
|
635
|
-
)), controlVisibilityConfig.duration(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label:
|
|
637
|
+
)), controlVisibilityConfig.duration(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: __4("Duration", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
636
638
|
TimeFrameIndicator,
|
|
637
639
|
{
|
|
638
640
|
value: String(duration),
|
|
639
641
|
onChange: (v) => updateInteraction({ duration: v }),
|
|
640
642
|
defaultValue: DEFAULT_VALUES.duration
|
|
641
643
|
}
|
|
642
|
-
)), controlVisibilityConfig.delay(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label:
|
|
644
|
+
)), controlVisibilityConfig.delay(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: __4("Delay", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
643
645
|
TimeFrameIndicator,
|
|
644
646
|
{
|
|
645
647
|
value: String(delay),
|
|
646
648
|
onChange: (v) => updateInteraction({ delay: v }),
|
|
647
649
|
defaultValue: DEFAULT_VALUES.delay
|
|
648
650
|
}
|
|
649
|
-
))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Divider, null), /* @__PURE__ */ React9.createElement(
|
|
651
|
+
))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(Divider, null), /* @__PURE__ */ React9.createElement(Grid2, { container: true, spacing: 1.5 }, /* @__PURE__ */ React9.createElement(Field, { label: __4("Relative To", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
650
652
|
RelativeToControl,
|
|
651
653
|
{
|
|
652
654
|
value: relativeTo,
|
|
653
655
|
onChange: (v) => updateInteraction({ relativeTo: v })
|
|
654
656
|
}
|
|
655
|
-
)), OffsetTopControl && /* @__PURE__ */ React9.createElement(Field, { label:
|
|
657
|
+
)), OffsetTopControl && /* @__PURE__ */ React9.createElement(Field, { label: __4("Offset Top", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
656
658
|
OffsetTopControl,
|
|
657
659
|
{
|
|
658
660
|
value: String(parseSizeValue(offsetTop, ["%"]).size),
|
|
659
661
|
onChange: (v) => updateInteraction({ offsetTop: v })
|
|
660
662
|
}
|
|
661
|
-
)), OffsetBottomControl && /* @__PURE__ */ React9.createElement(Field, { label:
|
|
663
|
+
)), OffsetBottomControl && /* @__PURE__ */ React9.createElement(Field, { label: __4("Offset Bottom", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
662
664
|
OffsetBottomControl,
|
|
663
665
|
{
|
|
664
666
|
value: String(parseSizeValue(offsetBottom, ["%"]).size),
|
|
665
667
|
onChange: (v) => updateInteraction({ offsetBottom: v })
|
|
666
668
|
}
|
|
667
|
-
))), /* @__PURE__ */ React9.createElement(Divider, null)), EasingControl && /* @__PURE__ */ React9.createElement(
|
|
669
|
+
))), /* @__PURE__ */ React9.createElement(Divider, null)), EasingControl && /* @__PURE__ */ React9.createElement(Grid2, { container: true, spacing: 1.5 }, /* @__PURE__ */ React9.createElement(Field, { label: __4("Easing", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
668
670
|
EasingControl,
|
|
669
671
|
{
|
|
670
672
|
value: easing,
|
|
@@ -672,19 +674,16 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
672
674
|
updateInteraction({ easing: v });
|
|
673
675
|
}
|
|
674
676
|
}
|
|
675
|
-
))));
|
|
677
|
+
)))));
|
|
676
678
|
};
|
|
677
|
-
function Field({ label, children }) {
|
|
678
|
-
return /* @__PURE__ */ React9.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React9.createElement(PopoverGridContainer, null, /* @__PURE__ */ React9.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React9.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React9.createElement(Grid, { item: true, xs: 6 }, children)));
|
|
679
|
-
}
|
|
680
679
|
|
|
681
680
|
// src/components/interaction-settings.tsx
|
|
682
681
|
import * as React10 from "react";
|
|
683
682
|
import { useCallback as useCallback3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
684
683
|
import { ControlFormLabel as ControlFormLabel2, PopoverContent as PopoverContent2 } from "@elementor/editor-controls";
|
|
685
684
|
import { useBreakpoints } from "@elementor/editor-responsive";
|
|
686
|
-
import { Autocomplete, Chip, Grid as
|
|
687
|
-
import { __ as
|
|
685
|
+
import { Autocomplete, Chip, Grid as Grid3, Stack as Stack2, TextField } from "@elementor/ui";
|
|
686
|
+
import { __ as __5 } from "@wordpress/i18n";
|
|
688
687
|
var SIZE = "tiny";
|
|
689
688
|
var InteractionSettings = ({ interaction, onChange }) => {
|
|
690
689
|
const breakpoints = useBreakpoints();
|
|
@@ -718,7 +717,7 @@ var InteractionSettings = ({ interaction, onChange }) => {
|
|
|
718
717
|
},
|
|
719
718
|
[interaction, availableBreakpoints, onChange]
|
|
720
719
|
);
|
|
721
|
-
return /* @__PURE__ */ React10.createElement(PopoverContent2, { p: 1.5 }, /* @__PURE__ */ React10.createElement(
|
|
720
|
+
return /* @__PURE__ */ React10.createElement(PopoverContent2, { p: 1.5 }, /* @__PURE__ */ React10.createElement(Grid3, { container: true, spacing: 1.5 }, /* @__PURE__ */ React10.createElement(Grid3, { item: true, xs: 12 }, /* @__PURE__ */ React10.createElement(Stack2, { direction: "column", gap: 1 }, /* @__PURE__ */ React10.createElement(ControlFormLabel2, { sx: { width: "100%" } }, __5("Trigger on", "elementor")), /* @__PURE__ */ React10.createElement(
|
|
722
721
|
Autocomplete,
|
|
723
722
|
{
|
|
724
723
|
fullWidth: true,
|
|
@@ -762,11 +761,11 @@ var InteractionsListItem = ({
|
|
|
762
761
|
{
|
|
763
762
|
size: "small",
|
|
764
763
|
variant: "fullWidth",
|
|
765
|
-
"aria-label":
|
|
764
|
+
"aria-label": __6("Interaction", "elementor"),
|
|
766
765
|
...getTabsProps()
|
|
767
766
|
},
|
|
768
|
-
/* @__PURE__ */ React11.createElement(Tab, { label:
|
|
769
|
-
/* @__PURE__ */ React11.createElement(Tab, { label:
|
|
767
|
+
/* @__PURE__ */ React11.createElement(Tab, { label: __6("Details", "elementor"), ...getTabProps("details") }),
|
|
768
|
+
/* @__PURE__ */ React11.createElement(Tab, { label: __6("Settings", "elementor"), ...getTabProps("settings") })
|
|
770
769
|
), /* @__PURE__ */ React11.createElement(Divider2, null), /* @__PURE__ */ React11.createElement(TabPanel, { sx: { p: 0 }, ...getTabPanelProps("details") }, /* @__PURE__ */ React11.createElement(
|
|
771
770
|
InteractionDetails,
|
|
772
771
|
{
|
|
@@ -789,7 +788,7 @@ var InteractionsListItem = ({
|
|
|
789
788
|
var MAX_NUMBER_OF_INTERACTIONS = 5;
|
|
790
789
|
function InteractionsList(props) {
|
|
791
790
|
const { interactions, onSelectInteractions, onPlayInteraction, triggerCreateOnShowEmpty } = props;
|
|
792
|
-
const hasInitializedRef =
|
|
791
|
+
const hasInitializedRef = useRef3(false);
|
|
793
792
|
const handleUpdateInteractions = useCallback5(
|
|
794
793
|
(newInteractions) => {
|
|
795
794
|
onSelectInteractions(newInteractions);
|
|
@@ -809,7 +808,7 @@ function InteractionsList(props) {
|
|
|
809
808
|
const isMaxNumberOfInteractionsReached = useMemo4(() => {
|
|
810
809
|
return interactions.items?.length >= MAX_NUMBER_OF_INTERACTIONS;
|
|
811
810
|
}, [interactions.items?.length]);
|
|
812
|
-
const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React12.createElement(Alert, { color: "secondary", icon: /* @__PURE__ */ React12.createElement(InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React12.createElement(AlertTitle, null,
|
|
811
|
+
const infotipContent = isMaxNumberOfInteractionsReached ? /* @__PURE__ */ React12.createElement(Alert, { color: "secondary", icon: /* @__PURE__ */ React12.createElement(InfoCircleFilledIcon, null), size: "small" }, /* @__PURE__ */ React12.createElement(AlertTitle, null, __7("Interactions", "elementor")), /* @__PURE__ */ React12.createElement(Box2, { component: "span" }, __7(
|
|
813
812
|
"You've reached the limit of 5 interactions for this element. Please remove an interaction before creating a new one.",
|
|
814
813
|
"elementor"
|
|
815
814
|
))) : void 0;
|
|
@@ -848,7 +847,7 @@ function InteractionsList(props) {
|
|
|
848
847
|
{
|
|
849
848
|
openOnAdd: true,
|
|
850
849
|
openItem: triggerCreateOnShowEmpty ? 0 : void 0,
|
|
851
|
-
label:
|
|
850
|
+
label: __7("Interactions", "elementor"),
|
|
852
851
|
values: interactions.items,
|
|
853
852
|
setValues: handleRepeaterChange,
|
|
854
853
|
showDuplicate: false,
|
|
@@ -861,10 +860,10 @@ function InteractionsList(props) {
|
|
|
861
860
|
Label: ({ value }) => buildDisplayLabel(value.value),
|
|
862
861
|
Icon: () => null,
|
|
863
862
|
Content: InteractionsListItem,
|
|
864
|
-
actions: (value) => /* @__PURE__ */ React12.createElement(Tooltip, { key: "preview", placement: "top", title:
|
|
863
|
+
actions: (value) => /* @__PURE__ */ React12.createElement(Tooltip, { key: "preview", placement: "top", title: __7("Preview", "elementor") }, /* @__PURE__ */ React12.createElement(
|
|
865
864
|
IconButton,
|
|
866
865
|
{
|
|
867
|
-
"aria-label":
|
|
866
|
+
"aria-label": __7("Play interaction", "elementor"),
|
|
868
867
|
size: "tiny",
|
|
869
868
|
onClick: () => onPlayInteraction(extractString(value.value.interaction_id))
|
|
870
869
|
},
|
|
@@ -1083,17 +1082,17 @@ var documentElementsInteractionsProvider = createInteractionsProvider({
|
|
|
1083
1082
|
|
|
1084
1083
|
// src/components/controls/easing.tsx
|
|
1085
1084
|
import * as React14 from "react";
|
|
1086
|
-
import { MenuListItem
|
|
1087
|
-
import { Select
|
|
1088
|
-
import { __ as
|
|
1085
|
+
import { MenuListItem } from "@elementor/editor-ui";
|
|
1086
|
+
import { Select } from "@elementor/ui";
|
|
1087
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1089
1088
|
var EASING_OPTIONS = {
|
|
1090
|
-
easeIn:
|
|
1091
|
-
easeInOut:
|
|
1092
|
-
easeOut:
|
|
1093
|
-
backIn:
|
|
1094
|
-
backInOut:
|
|
1095
|
-
backOut:
|
|
1096
|
-
linear:
|
|
1089
|
+
easeIn: __8("Ease In", "elementor"),
|
|
1090
|
+
easeInOut: __8("Ease In Out", "elementor"),
|
|
1091
|
+
easeOut: __8("Ease Out", "elementor"),
|
|
1092
|
+
backIn: __8("Back In", "elementor"),
|
|
1093
|
+
backInOut: __8("Back In Out", "elementor"),
|
|
1094
|
+
backOut: __8("Back Out", "elementor"),
|
|
1095
|
+
linear: __8("Linear", "elementor")
|
|
1097
1096
|
};
|
|
1098
1097
|
var DEFAULT_EASING = "easeIn";
|
|
1099
1098
|
function Easing({}) {
|
|
@@ -1101,51 +1100,120 @@ function Easing({}) {
|
|
|
1101
1100
|
key,
|
|
1102
1101
|
label
|
|
1103
1102
|
}));
|
|
1104
|
-
return /* @__PURE__ */ React14.createElement(
|
|
1103
|
+
return /* @__PURE__ */ React14.createElement(Select, { value: DEFAULT_EASING, onChange: () => {
|
|
1105
1104
|
}, fullWidth: true, displayEmpty: true, size: "tiny" }, availableOptions.map((option) => {
|
|
1106
1105
|
const isDisabled = DEFAULT_EASING !== option.key;
|
|
1107
|
-
return /* @__PURE__ */ React14.createElement(
|
|
1106
|
+
return /* @__PURE__ */ React14.createElement(MenuListItem, { key: option.key, value: option.key, disabled: isDisabled }, option.label);
|
|
1108
1107
|
}));
|
|
1109
1108
|
}
|
|
1110
1109
|
|
|
1111
|
-
// src/components/controls/
|
|
1110
|
+
// src/components/controls/effect.tsx
|
|
1112
1111
|
import * as React15 from "react";
|
|
1112
|
+
import { MenuListItem as MenuListItem2 } from "@elementor/editor-ui";
|
|
1113
|
+
import { Select as Select2 } from "@elementor/ui";
|
|
1114
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1115
|
+
function Effect({ value, onChange }) {
|
|
1116
|
+
const availableEffects = [
|
|
1117
|
+
{ key: "fade", label: __9("Fade", "elementor") },
|
|
1118
|
+
{ key: "slide", label: __9("Slide", "elementor") },
|
|
1119
|
+
{ key: "scale", label: __9("Scale", "elementor") }
|
|
1120
|
+
];
|
|
1121
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1122
|
+
Select2,
|
|
1123
|
+
{
|
|
1124
|
+
fullWidth: true,
|
|
1125
|
+
displayEmpty: true,
|
|
1126
|
+
size: "tiny",
|
|
1127
|
+
value,
|
|
1128
|
+
onChange: (event) => onChange(event.target.value)
|
|
1129
|
+
},
|
|
1130
|
+
availableEffects.map((effect) => {
|
|
1131
|
+
return /* @__PURE__ */ React15.createElement(MenuListItem2, { key: effect.key, value: effect.key }, effect.label);
|
|
1132
|
+
})
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// src/components/controls/replay.tsx
|
|
1137
|
+
import * as React17 from "react";
|
|
1113
1138
|
import { ToggleButtonGroupUi as ToggleButtonGroupUi3 } from "@elementor/editor-controls";
|
|
1114
1139
|
import { CheckIcon, MinusIcon } from "@elementor/icons";
|
|
1140
|
+
import { Box as Box4 } from "@elementor/ui";
|
|
1141
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1142
|
+
|
|
1143
|
+
// src/ui/interactions-promotion-chip.tsx
|
|
1144
|
+
import * as React16 from "react";
|
|
1145
|
+
import { useState as useState4 } from "react";
|
|
1146
|
+
import { PromotionChip, PromotionPopover, useCanvasClickHandler } from "@elementor/editor-ui";
|
|
1147
|
+
import { Box as Box3 } from "@elementor/ui";
|
|
1115
1148
|
import { __ as __10 } from "@wordpress/i18n";
|
|
1116
|
-
function
|
|
1149
|
+
function InteractionsPromotionChip({ content, upgradeUrl, anchorRef }) {
|
|
1150
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
1151
|
+
useCanvasClickHandler(isOpen, () => setIsOpen(false));
|
|
1152
|
+
const handleToggle = (e) => {
|
|
1153
|
+
e.stopPropagation();
|
|
1154
|
+
setIsOpen((prev) => !prev);
|
|
1155
|
+
};
|
|
1156
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1157
|
+
PromotionPopover,
|
|
1158
|
+
{
|
|
1159
|
+
open: isOpen,
|
|
1160
|
+
title: __10("Interactions", "elementor"),
|
|
1161
|
+
content,
|
|
1162
|
+
ctaText: __10("Upgrade now", "elementor"),
|
|
1163
|
+
ctaUrl: upgradeUrl,
|
|
1164
|
+
anchorRef,
|
|
1165
|
+
placement: anchorRef ? "right-start" : void 0,
|
|
1166
|
+
onClose: handleToggle
|
|
1167
|
+
},
|
|
1168
|
+
/* @__PURE__ */ React16.createElement(Box3, { onClick: handleToggle, sx: { cursor: "pointer", display: "inline-flex", mr: 1 } }, /* @__PURE__ */ React16.createElement(PromotionChip, null))
|
|
1169
|
+
);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
// src/components/controls/replay.tsx
|
|
1173
|
+
var OVERLAY_GRID = "1 / 1";
|
|
1174
|
+
var CHIP_OFFSET = "50%";
|
|
1175
|
+
function Replay({ onChange, anchorRef }) {
|
|
1117
1176
|
const options = [
|
|
1118
1177
|
{
|
|
1119
1178
|
value: false,
|
|
1120
1179
|
disabled: false,
|
|
1121
|
-
label:
|
|
1122
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1180
|
+
label: __11("No", "elementor"),
|
|
1181
|
+
renderContent: ({ size }) => /* @__PURE__ */ React17.createElement(MinusIcon, { fontSize: size }),
|
|
1182
|
+
showTooltip: true
|
|
1123
1183
|
},
|
|
1124
1184
|
{
|
|
1125
1185
|
value: true,
|
|
1126
1186
|
disabled: true,
|
|
1127
|
-
label:
|
|
1128
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1187
|
+
label: __11("Yes", "elementor"),
|
|
1188
|
+
renderContent: ({ size }) => /* @__PURE__ */ React17.createElement(CheckIcon, { fontSize: size }),
|
|
1189
|
+
showTooltip: true
|
|
1129
1190
|
}
|
|
1130
1191
|
];
|
|
1131
|
-
return /* @__PURE__ */
|
|
1192
|
+
return /* @__PURE__ */ React17.createElement(Box4, { sx: { display: "grid", alignItems: "center" } }, /* @__PURE__ */ React17.createElement(Box4, { sx: { gridArea: OVERLAY_GRID } }, /* @__PURE__ */ React17.createElement(ToggleButtonGroupUi3, { items: options, exclusive: true, onChange, value: false })), /* @__PURE__ */ React17.createElement(Box4, { sx: { gridArea: OVERLAY_GRID, marginInlineEnd: CHIP_OFFSET, justifySelf: "end" } }, /* @__PURE__ */ React17.createElement(
|
|
1193
|
+
InteractionsPromotionChip,
|
|
1194
|
+
{
|
|
1195
|
+
content: __11("Upgrade to run the animation every time its trigger occurs.", "elementor"),
|
|
1196
|
+
upgradeUrl: "https://go.elementor.com/go-pro-interactions-replay-modal/",
|
|
1197
|
+
anchorRef
|
|
1198
|
+
}
|
|
1199
|
+
)));
|
|
1132
1200
|
}
|
|
1133
1201
|
|
|
1134
1202
|
// src/components/controls/trigger.tsx
|
|
1135
|
-
import * as
|
|
1203
|
+
import * as React18 from "react";
|
|
1136
1204
|
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
1137
1205
|
import { Select as Select3 } from "@elementor/ui";
|
|
1138
|
-
import { __ as
|
|
1206
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1139
1207
|
function Trigger({ value, onChange }) {
|
|
1140
1208
|
const availableTriggers = Object.entries({
|
|
1141
|
-
load:
|
|
1142
|
-
scrollIn:
|
|
1143
|
-
scrollOn:
|
|
1209
|
+
load: __12("Page load", "elementor"),
|
|
1210
|
+
scrollIn: __12("Scroll into view", "elementor"),
|
|
1211
|
+
scrollOn: __12("While Scrolling", "elementor")
|
|
1144
1212
|
}).map(([key, label]) => ({
|
|
1145
1213
|
key,
|
|
1146
1214
|
label
|
|
1147
1215
|
}));
|
|
1148
|
-
return /* @__PURE__ */
|
|
1216
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1149
1217
|
Select3,
|
|
1150
1218
|
{
|
|
1151
1219
|
fullWidth: true,
|
|
@@ -1155,7 +1223,7 @@ function Trigger({ value, onChange }) {
|
|
|
1155
1223
|
value
|
|
1156
1224
|
},
|
|
1157
1225
|
availableTriggers.map((trigger) => {
|
|
1158
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ React18.createElement(MenuListItem3, { key: trigger.key, value: trigger.key }, trigger.label);
|
|
1159
1227
|
})
|
|
1160
1228
|
);
|
|
1161
1229
|
}
|
|
@@ -1218,6 +1286,11 @@ function init() {
|
|
|
1218
1286
|
component: Replay,
|
|
1219
1287
|
options: ["true", "false"]
|
|
1220
1288
|
});
|
|
1289
|
+
registerInteractionsControl({
|
|
1290
|
+
type: "effect",
|
|
1291
|
+
component: Effect,
|
|
1292
|
+
options: ["fade", "slide", "scale"]
|
|
1293
|
+
});
|
|
1221
1294
|
} catch (error) {
|
|
1222
1295
|
throw error;
|
|
1223
1296
|
}
|