@elementor/editor-interactions 4.0.0-551 → 4.0.0-564
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.js +132 -98
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +130 -96
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
- package/src/components/field.tsx +19 -0
- package/src/components/interaction-details.tsx +18 -38
- package/src/components/interactions-list-item.tsx +17 -3
- package/src/index.ts +1 -0
- package/src/init.ts +9 -0
- package/src/utils/resolve-direction.ts +20 -0
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
|
|
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
|
|
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
|
|
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
|
|
386
|
+
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
387
387
|
var import_ui3 = require("@elementor/ui");
|
|
388
|
-
var
|
|
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
|
|
457
|
+
var React6 = __toESM(require("react"));
|
|
470
458
|
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
471
|
-
var
|
|
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,
|
|
477
|
-
renderContent: () => (0,
|
|
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,
|
|
483
|
-
renderContent: () => (0,
|
|
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__ */
|
|
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
|
|
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__ */
|
|
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,14 @@ 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
|
-
};
|
|
635
623
|
const updateInteraction = (updates) => {
|
|
636
|
-
const resolvedDirectionValue = resolveDirection(
|
|
624
|
+
const resolvedDirectionValue = resolveDirection(
|
|
625
|
+
"direction" in updates,
|
|
626
|
+
updates.effect,
|
|
627
|
+
updates.direction,
|
|
628
|
+
direction,
|
|
629
|
+
effect
|
|
630
|
+
);
|
|
637
631
|
const updatedInteraction = {
|
|
638
632
|
...interaction,
|
|
639
633
|
interaction_id: interaction.interaction_id,
|
|
@@ -657,53 +651,53 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
657
651
|
onPlayInteraction(interactionId);
|
|
658
652
|
}, 0);
|
|
659
653
|
};
|
|
660
|
-
return /* @__PURE__ */ React9.createElement(
|
|
654
|
+
return /* @__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(TriggerControl, { value: trigger, onChange: (v) => updateInteraction({ trigger: v }) })), ReplayControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Replay", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
661
655
|
ReplayControl,
|
|
662
656
|
{
|
|
663
657
|
value: replay,
|
|
664
658
|
onChange: (v) => updateInteraction({ replay: v }),
|
|
665
659
|
disabled: true
|
|
666
660
|
}
|
|
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,
|
|
661
|
+
))), /* @__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
662
|
Direction,
|
|
669
663
|
{
|
|
670
664
|
value: direction,
|
|
671
665
|
onChange: (v) => updateInteraction({ direction: v }),
|
|
672
666
|
interactionType: type
|
|
673
667
|
}
|
|
674
|
-
)), controlVisibilityConfig.duration(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0,
|
|
668
|
+
)), controlVisibilityConfig.duration(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Duration", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
675
669
|
TimeFrameIndicator,
|
|
676
670
|
{
|
|
677
671
|
value: String(duration),
|
|
678
672
|
onChange: (v) => updateInteraction({ duration: v }),
|
|
679
673
|
defaultValue: DEFAULT_VALUES.duration
|
|
680
674
|
}
|
|
681
|
-
)), controlVisibilityConfig.delay(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0,
|
|
675
|
+
)), controlVisibilityConfig.delay(interactionValues) && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Delay", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
682
676
|
TimeFrameIndicator,
|
|
683
677
|
{
|
|
684
678
|
value: String(delay),
|
|
685
679
|
onChange: (v) => updateInteraction({ delay: v }),
|
|
686
680
|
defaultValue: DEFAULT_VALUES.delay
|
|
687
681
|
}
|
|
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,
|
|
682
|
+
))), 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
683
|
RelativeToControl,
|
|
690
684
|
{
|
|
691
685
|
value: relativeTo,
|
|
692
686
|
onChange: (v) => updateInteraction({ relativeTo: v })
|
|
693
687
|
}
|
|
694
|
-
)), OffsetTopControl && /* @__PURE__ */ React9.createElement(Field, { label: (0,
|
|
688
|
+
)), OffsetTopControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Offset Top", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
695
689
|
OffsetTopControl,
|
|
696
690
|
{
|
|
697
691
|
value: String(parseSizeValue(offsetTop, ["%"]).size),
|
|
698
692
|
onChange: (v) => updateInteraction({ offsetTop: v })
|
|
699
693
|
}
|
|
700
|
-
)), OffsetBottomControl && /* @__PURE__ */ React9.createElement(Field, { label: (0,
|
|
694
|
+
)), OffsetBottomControl && /* @__PURE__ */ React9.createElement(Field, { label: (0, import_i18n4.__)("Offset Bottom", "elementor") }, /* @__PURE__ */ React9.createElement(
|
|
701
695
|
OffsetBottomControl,
|
|
702
696
|
{
|
|
703
697
|
value: String(parseSizeValue(offsetBottom, ["%"]).size),
|
|
704
698
|
onChange: (v) => updateInteraction({ offsetBottom: v })
|
|
705
699
|
}
|
|
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,
|
|
700
|
+
))), /* @__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
701
|
EasingControl,
|
|
708
702
|
{
|
|
709
703
|
value: easing,
|
|
@@ -713,17 +707,14 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
713
707
|
}
|
|
714
708
|
))));
|
|
715
709
|
};
|
|
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
710
|
|
|
720
711
|
// src/components/interaction-settings.tsx
|
|
721
712
|
var React10 = __toESM(require("react"));
|
|
722
713
|
var import_react7 = require("react");
|
|
723
|
-
var
|
|
714
|
+
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
724
715
|
var import_editor_responsive = require("@elementor/editor-responsive");
|
|
725
716
|
var import_ui4 = require("@elementor/ui");
|
|
726
|
-
var
|
|
717
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
727
718
|
var SIZE = "tiny";
|
|
728
719
|
var InteractionSettings = ({ interaction, onChange }) => {
|
|
729
720
|
const breakpoints = (0, import_editor_responsive.useBreakpoints)();
|
|
@@ -757,7 +748,7 @@ var InteractionSettings = ({ interaction, onChange }) => {
|
|
|
757
748
|
},
|
|
758
749
|
[interaction, availableBreakpoints, onChange]
|
|
759
750
|
);
|
|
760
|
-
return /* @__PURE__ */ React10.createElement(
|
|
751
|
+
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
752
|
import_ui4.Autocomplete,
|
|
762
753
|
{
|
|
763
754
|
fullWidth: true,
|
|
@@ -777,7 +768,10 @@ var InteractionSettings = ({ interaction, onChange }) => {
|
|
|
777
768
|
};
|
|
778
769
|
|
|
779
770
|
// src/components/interactions-list-item.tsx
|
|
780
|
-
var InteractionsListItem = ({
|
|
771
|
+
var InteractionsListItem = ({
|
|
772
|
+
index,
|
|
773
|
+
value: interaction
|
|
774
|
+
}) => {
|
|
781
775
|
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui5.useTabs)("details");
|
|
782
776
|
const context = useInteractionItemContext();
|
|
783
777
|
const handleChange = (0, import_react8.useCallback)(
|
|
@@ -787,29 +781,38 @@ var InteractionsListItem = ({ index, value }) => {
|
|
|
787
781
|
[context, index]
|
|
788
782
|
);
|
|
789
783
|
const handlePlayInteraction = (0, import_react8.useCallback)(
|
|
790
|
-
(
|
|
791
|
-
context?.onPlayInteraction(
|
|
784
|
+
(interactionId2) => {
|
|
785
|
+
context?.onPlayInteraction(interactionId2);
|
|
792
786
|
},
|
|
793
787
|
[context]
|
|
794
788
|
);
|
|
789
|
+
const interactionId = extractString(interaction.value.interaction_id);
|
|
795
790
|
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
|
796
791
|
import_ui5.Tabs,
|
|
797
792
|
{
|
|
798
793
|
size: "small",
|
|
799
794
|
variant: "fullWidth",
|
|
800
|
-
"aria-label": (0,
|
|
795
|
+
"aria-label": (0, import_i18n6.__)("Interaction", "elementor"),
|
|
801
796
|
...getTabsProps()
|
|
802
797
|
},
|
|
803
|
-
/* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0,
|
|
804
|
-
/* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0,
|
|
798
|
+
/* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0, import_i18n6.__)("Details", "elementor"), ...getTabProps("details") }),
|
|
799
|
+
/* @__PURE__ */ React11.createElement(import_ui5.Tab, { label: (0, import_i18n6.__)("Settings", "elementor"), ...getTabProps("settings") })
|
|
805
800
|
), /* @__PURE__ */ React11.createElement(import_ui5.Divider, null), /* @__PURE__ */ React11.createElement(import_ui5.TabPanel, { sx: { p: 0 }, ...getTabPanelProps("details") }, /* @__PURE__ */ React11.createElement(
|
|
806
801
|
InteractionDetails,
|
|
807
802
|
{
|
|
808
|
-
|
|
803
|
+
key: interactionId,
|
|
804
|
+
interaction: interaction.value,
|
|
809
805
|
onChange: handleChange,
|
|
810
806
|
onPlayInteraction: handlePlayInteraction
|
|
811
807
|
}
|
|
812
|
-
)), /* @__PURE__ */ React11.createElement(import_ui5.TabPanel, { sx: { p: 0 }, ...getTabPanelProps("settings") }, /* @__PURE__ */ React11.createElement(
|
|
808
|
+
)), /* @__PURE__ */ React11.createElement(import_ui5.TabPanel, { sx: { p: 0 }, ...getTabPanelProps("settings") }, /* @__PURE__ */ React11.createElement(
|
|
809
|
+
InteractionSettings,
|
|
810
|
+
{
|
|
811
|
+
key: interactionId,
|
|
812
|
+
interaction: interaction.value,
|
|
813
|
+
onChange: handleChange
|
|
814
|
+
}
|
|
815
|
+
)));
|
|
813
816
|
};
|
|
814
817
|
|
|
815
818
|
// src/components/interactions-list.tsx
|
|
@@ -836,7 +839,7 @@ function InteractionsList(props) {
|
|
|
836
839
|
const isMaxNumberOfInteractionsReached = (0, import_react9.useMemo)(() => {
|
|
837
840
|
return interactions.items?.length >= MAX_NUMBER_OF_INTERACTIONS;
|
|
838
841
|
}, [interactions.items?.length]);
|
|
839
|
-
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,
|
|
842
|
+
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.__)(
|
|
840
843
|
"You've reached the limit of 5 interactions for this element. Please remove an interaction before creating a new one.",
|
|
841
844
|
"elementor"
|
|
842
845
|
))) : void 0;
|
|
@@ -871,11 +874,11 @@ function InteractionsList(props) {
|
|
|
871
874
|
[handleInteractionChange, onPlayInteraction]
|
|
872
875
|
);
|
|
873
876
|
return /* @__PURE__ */ React12.createElement(InteractionItemContextProvider, { value: contextValue }, /* @__PURE__ */ React12.createElement(
|
|
874
|
-
|
|
877
|
+
import_editor_controls7.Repeater,
|
|
875
878
|
{
|
|
876
879
|
openOnAdd: true,
|
|
877
880
|
openItem: triggerCreateOnShowEmpty ? 0 : void 0,
|
|
878
|
-
label: (0,
|
|
881
|
+
label: (0, import_i18n7.__)("Interactions", "elementor"),
|
|
879
882
|
values: interactions.items,
|
|
880
883
|
setValues: handleRepeaterChange,
|
|
881
884
|
showDuplicate: false,
|
|
@@ -888,10 +891,10 @@ function InteractionsList(props) {
|
|
|
888
891
|
Label: ({ value }) => buildDisplayLabel(value.value),
|
|
889
892
|
Icon: () => null,
|
|
890
893
|
Content: InteractionsListItem,
|
|
891
|
-
actions: (value) => /* @__PURE__ */ React12.createElement(import_ui6.Tooltip, { key: "preview", placement: "top", title: (0,
|
|
894
|
+
actions: (value) => /* @__PURE__ */ React12.createElement(import_ui6.Tooltip, { key: "preview", placement: "top", title: (0, import_i18n7.__)("Preview", "elementor") }, /* @__PURE__ */ React12.createElement(
|
|
892
895
|
import_ui6.IconButton,
|
|
893
896
|
{
|
|
894
|
-
"aria-label": (0,
|
|
897
|
+
"aria-label": (0, import_i18n7.__)("Play interaction", "elementor"),
|
|
895
898
|
size: "tiny",
|
|
896
899
|
onClick: () => onPlayInteraction(extractString(value.value.interaction_id))
|
|
897
900
|
},
|
|
@@ -1107,17 +1110,17 @@ var documentElementsInteractionsProvider = createInteractionsProvider({
|
|
|
1107
1110
|
|
|
1108
1111
|
// src/components/controls/easing.tsx
|
|
1109
1112
|
var React14 = __toESM(require("react"));
|
|
1110
|
-
var
|
|
1113
|
+
var import_editor_ui = require("@elementor/editor-ui");
|
|
1111
1114
|
var import_ui8 = require("@elementor/ui");
|
|
1112
|
-
var
|
|
1115
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1113
1116
|
var EASING_OPTIONS = {
|
|
1114
|
-
easeIn: (0,
|
|
1115
|
-
easeInOut: (0,
|
|
1116
|
-
easeOut: (0,
|
|
1117
|
-
backIn: (0,
|
|
1118
|
-
backInOut: (0,
|
|
1119
|
-
backOut: (0,
|
|
1120
|
-
linear: (0,
|
|
1117
|
+
easeIn: (0, import_i18n8.__)("Ease In", "elementor"),
|
|
1118
|
+
easeInOut: (0, import_i18n8.__)("Ease In Out", "elementor"),
|
|
1119
|
+
easeOut: (0, import_i18n8.__)("Ease Out", "elementor"),
|
|
1120
|
+
backIn: (0, import_i18n8.__)("Back In", "elementor"),
|
|
1121
|
+
backInOut: (0, import_i18n8.__)("Back In Out", "elementor"),
|
|
1122
|
+
backOut: (0, import_i18n8.__)("Back Out", "elementor"),
|
|
1123
|
+
linear: (0, import_i18n8.__)("Linear", "elementor")
|
|
1121
1124
|
};
|
|
1122
1125
|
var DEFAULT_EASING = "easeIn";
|
|
1123
1126
|
function Easing({}) {
|
|
@@ -1128,13 +1131,39 @@ function Easing({}) {
|
|
|
1128
1131
|
return /* @__PURE__ */ React14.createElement(import_ui8.Select, { value: DEFAULT_EASING, onChange: () => {
|
|
1129
1132
|
}, fullWidth: true, displayEmpty: true, size: "tiny" }, availableOptions.map((option) => {
|
|
1130
1133
|
const isDisabled = DEFAULT_EASING !== option.key;
|
|
1131
|
-
return /* @__PURE__ */ React14.createElement(
|
|
1134
|
+
return /* @__PURE__ */ React14.createElement(import_editor_ui.MenuListItem, { key: option.key, value: option.key, disabled: isDisabled }, option.label);
|
|
1132
1135
|
}));
|
|
1133
1136
|
}
|
|
1134
1137
|
|
|
1135
|
-
// src/components/controls/
|
|
1138
|
+
// src/components/controls/effect.tsx
|
|
1136
1139
|
var React15 = __toESM(require("react"));
|
|
1137
|
-
var
|
|
1140
|
+
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
1141
|
+
var import_ui9 = require("@elementor/ui");
|
|
1142
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1143
|
+
function Effect({ value, onChange }) {
|
|
1144
|
+
const availableEffects = [
|
|
1145
|
+
{ key: "fade", label: (0, import_i18n9.__)("Fade", "elementor") },
|
|
1146
|
+
{ key: "slide", label: (0, import_i18n9.__)("Slide", "elementor") },
|
|
1147
|
+
{ key: "scale", label: (0, import_i18n9.__)("Scale", "elementor") }
|
|
1148
|
+
];
|
|
1149
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1150
|
+
import_ui9.Select,
|
|
1151
|
+
{
|
|
1152
|
+
fullWidth: true,
|
|
1153
|
+
displayEmpty: true,
|
|
1154
|
+
size: "tiny",
|
|
1155
|
+
value,
|
|
1156
|
+
onChange: (event) => onChange(event.target.value)
|
|
1157
|
+
},
|
|
1158
|
+
availableEffects.map((effect) => {
|
|
1159
|
+
return /* @__PURE__ */ React15.createElement(import_editor_ui2.MenuListItem, { key: effect.key, value: effect.key }, effect.label);
|
|
1160
|
+
})
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// src/components/controls/replay.tsx
|
|
1165
|
+
var React16 = __toESM(require("react"));
|
|
1166
|
+
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
1138
1167
|
var import_icons4 = require("@elementor/icons");
|
|
1139
1168
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1140
1169
|
function Replay({ onChange }) {
|
|
@@ -1143,22 +1172,22 @@ function Replay({ onChange }) {
|
|
|
1143
1172
|
value: false,
|
|
1144
1173
|
disabled: false,
|
|
1145
1174
|
label: (0, import_i18n10.__)("No", "elementor"),
|
|
1146
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1175
|
+
renderContent: ({ size }) => /* @__PURE__ */ React16.createElement(import_icons4.MinusIcon, { fontSize: size })
|
|
1147
1176
|
},
|
|
1148
1177
|
{
|
|
1149
1178
|
value: true,
|
|
1150
1179
|
disabled: true,
|
|
1151
1180
|
label: (0, import_i18n10.__)("Yes", "elementor"),
|
|
1152
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1181
|
+
renderContent: ({ size }) => /* @__PURE__ */ React16.createElement(import_icons4.CheckIcon, { fontSize: size })
|
|
1153
1182
|
}
|
|
1154
1183
|
];
|
|
1155
|
-
return /* @__PURE__ */
|
|
1184
|
+
return /* @__PURE__ */ React16.createElement(import_editor_controls8.ToggleButtonGroupUi, { items: options, exclusive: true, onChange, value: false });
|
|
1156
1185
|
}
|
|
1157
1186
|
|
|
1158
1187
|
// src/components/controls/trigger.tsx
|
|
1159
|
-
var
|
|
1188
|
+
var React17 = __toESM(require("react"));
|
|
1160
1189
|
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1161
|
-
var
|
|
1190
|
+
var import_ui10 = require("@elementor/ui");
|
|
1162
1191
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1163
1192
|
function Trigger({ value, onChange }) {
|
|
1164
1193
|
const availableTriggers = Object.entries({
|
|
@@ -1169,8 +1198,8 @@ function Trigger({ value, onChange }) {
|
|
|
1169
1198
|
key,
|
|
1170
1199
|
label
|
|
1171
1200
|
}));
|
|
1172
|
-
return /* @__PURE__ */
|
|
1173
|
-
|
|
1201
|
+
return /* @__PURE__ */ React17.createElement(
|
|
1202
|
+
import_ui10.Select,
|
|
1174
1203
|
{
|
|
1175
1204
|
fullWidth: true,
|
|
1176
1205
|
displayEmpty: true,
|
|
@@ -1179,7 +1208,7 @@ function Trigger({ value, onChange }) {
|
|
|
1179
1208
|
value
|
|
1180
1209
|
},
|
|
1181
1210
|
availableTriggers.map((trigger) => {
|
|
1182
|
-
return /* @__PURE__ */
|
|
1211
|
+
return /* @__PURE__ */ React17.createElement(import_editor_ui3.MenuListItem, { key: trigger.key, value: trigger.key }, trigger.label);
|
|
1183
1212
|
})
|
|
1184
1213
|
);
|
|
1185
1214
|
}
|
|
@@ -1242,6 +1271,11 @@ function init() {
|
|
|
1242
1271
|
component: Replay,
|
|
1243
1272
|
options: ["true", "false"]
|
|
1244
1273
|
});
|
|
1274
|
+
registerInteractionsControl({
|
|
1275
|
+
type: "effect",
|
|
1276
|
+
component: Effect,
|
|
1277
|
+
options: ["fade", "slide", "scale"]
|
|
1278
|
+
});
|
|
1245
1279
|
} catch (error) {
|
|
1246
1280
|
throw error;
|
|
1247
1281
|
}
|