@elementor/editor-interactions 4.0.0-621 → 4.0.0-manual
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +36 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/components/interaction-details.tsx +34 -42
- package/src/interactions-controls-registry.ts +4 -4
- package/src/utils/prop-value-utils.ts +18 -18
package/dist/index.d.mts
CHANGED
|
@@ -71,7 +71,7 @@ declare const ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX = "document-elements-int
|
|
|
71
71
|
|
|
72
72
|
declare function init(): void;
|
|
73
73
|
|
|
74
|
-
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | '
|
|
74
|
+
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | 'start' | 'end' | 'customEffects';
|
|
75
75
|
type InteractionsControlPropsMap = {
|
|
76
76
|
trigger: FieldProps;
|
|
77
77
|
effect: FieldProps;
|
|
@@ -83,8 +83,8 @@ type InteractionsControlPropsMap = {
|
|
|
83
83
|
replay: ReplayFieldProps;
|
|
84
84
|
easing: FieldProps;
|
|
85
85
|
relativeTo: FieldProps;
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
start: FieldProps;
|
|
87
|
+
end: FieldProps;
|
|
88
88
|
};
|
|
89
89
|
type ControlOptions<T extends InteractionsControlType> = {
|
|
90
90
|
type: T;
|
package/dist/index.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ declare const ELEMENTS_INTERACTIONS_PROVIDER_KEY_PREFIX = "document-elements-int
|
|
|
71
71
|
|
|
72
72
|
declare function init(): void;
|
|
73
73
|
|
|
74
|
-
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | '
|
|
74
|
+
type InteractionsControlType = 'trigger' | 'effect' | 'effectType' | 'direction' | 'duration' | 'delay' | 'replay' | 'easing' | 'relativeTo' | 'start' | 'end' | 'customEffects';
|
|
75
75
|
type InteractionsControlPropsMap = {
|
|
76
76
|
trigger: FieldProps;
|
|
77
77
|
effect: FieldProps;
|
|
@@ -83,8 +83,8 @@ type InteractionsControlPropsMap = {
|
|
|
83
83
|
replay: ReplayFieldProps;
|
|
84
84
|
easing: FieldProps;
|
|
85
85
|
relativeTo: FieldProps;
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
start: FieldProps;
|
|
87
|
+
end: FieldProps;
|
|
88
88
|
};
|
|
89
89
|
type ControlOptions<T extends InteractionsControlType> = {
|
|
90
90
|
type: T;
|
package/dist/index.js
CHANGED
|
@@ -245,16 +245,16 @@ var createConfig = ({
|
|
|
245
245
|
replay,
|
|
246
246
|
easing = "easeIn",
|
|
247
247
|
relativeTo = "",
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
start = 85,
|
|
249
|
+
end = 15
|
|
250
250
|
}) => ({
|
|
251
251
|
$$type: "config",
|
|
252
252
|
value: {
|
|
253
253
|
replay: createBoolean(replay),
|
|
254
254
|
easing: createString(easing),
|
|
255
255
|
relativeTo: createString(relativeTo),
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
start: createSize(start, "%"),
|
|
257
|
+
end: createSize(end, "%")
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
var createSize = (value, defaultUnit, defaultValue) => {
|
|
@@ -288,8 +288,8 @@ var createAnimationPreset = ({
|
|
|
288
288
|
replay = false,
|
|
289
289
|
easing = "easeIn",
|
|
290
290
|
relativeTo,
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
start,
|
|
292
|
+
end,
|
|
293
293
|
customEffects
|
|
294
294
|
}) => ({
|
|
295
295
|
$$type: "animation-preset-props",
|
|
@@ -303,8 +303,8 @@ var createAnimationPreset = ({
|
|
|
303
303
|
replay,
|
|
304
304
|
easing,
|
|
305
305
|
relativeTo,
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
start,
|
|
307
|
+
end
|
|
308
308
|
})
|
|
309
309
|
}
|
|
310
310
|
});
|
|
@@ -319,8 +319,8 @@ var createInteractionItem = ({
|
|
|
319
319
|
replay = false,
|
|
320
320
|
easing = "easeIn",
|
|
321
321
|
relativeTo,
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
start,
|
|
323
|
+
end,
|
|
324
324
|
excludedBreakpoints,
|
|
325
325
|
customEffects
|
|
326
326
|
}) => ({
|
|
@@ -337,8 +337,8 @@ var createInteractionItem = ({
|
|
|
337
337
|
replay,
|
|
338
338
|
easing,
|
|
339
339
|
relativeTo,
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
start,
|
|
341
|
+
end,
|
|
342
342
|
customEffects
|
|
343
343
|
}),
|
|
344
344
|
...excludedBreakpoints && excludedBreakpoints.length > 0 && {
|
|
@@ -504,8 +504,8 @@ var DEFAULT_VALUES = {
|
|
|
504
504
|
replay: false,
|
|
505
505
|
easing: "easeIn",
|
|
506
506
|
relativeTo: "viewport",
|
|
507
|
-
|
|
508
|
-
|
|
507
|
+
start: 85,
|
|
508
|
+
end: 15
|
|
509
509
|
};
|
|
510
510
|
var TRIGGERS_WITHOUT_REPLAY = ["load", "scrollOn", "hover", "click"];
|
|
511
511
|
var controlVisibilityConfig = {
|
|
@@ -514,8 +514,8 @@ var controlVisibilityConfig = {
|
|
|
514
514
|
effectType: (values) => values.effect !== "custom",
|
|
515
515
|
direction: (values) => values.effect !== "custom",
|
|
516
516
|
relativeTo: (values) => values.trigger === "scrollOn",
|
|
517
|
-
|
|
518
|
-
|
|
517
|
+
start: (values) => values.trigger === "scrollOn",
|
|
518
|
+
end: (values) => values.trigger === "scrollOn",
|
|
519
519
|
duration: (values) => {
|
|
520
520
|
const isRelativeToVisible = values.trigger === "scrollOn";
|
|
521
521
|
return !isRelativeToVisible;
|
|
@@ -544,11 +544,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
544
544
|
const replay = extractBoolean(interaction.animation.value.config?.value.replay, DEFAULT_VALUES.replay);
|
|
545
545
|
const easing = extractString(interaction.animation.value.config?.value.easing, DEFAULT_VALUES.easing);
|
|
546
546
|
const relativeTo = extractString(interaction.animation.value.config?.value.relativeTo, DEFAULT_VALUES.relativeTo);
|
|
547
|
-
const
|
|
548
|
-
const
|
|
549
|
-
interaction.animation.value.config?.value.offsetBottom,
|
|
550
|
-
DEFAULT_VALUES.offsetBottom
|
|
551
|
-
);
|
|
547
|
+
const start = extractSize(interaction.animation.value.config?.value.start, DEFAULT_VALUES.start);
|
|
548
|
+
const end = extractSize(interaction.animation.value.config?.value.end, DEFAULT_VALUES.end);
|
|
552
549
|
const interactionValues = {
|
|
553
550
|
trigger,
|
|
554
551
|
effect,
|
|
@@ -559,8 +556,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
559
556
|
easing,
|
|
560
557
|
replay,
|
|
561
558
|
relativeTo,
|
|
562
|
-
|
|
563
|
-
|
|
559
|
+
start,
|
|
560
|
+
end,
|
|
564
561
|
customEffects
|
|
565
562
|
};
|
|
566
563
|
const TriggerControl = useControlComponent("trigger", true);
|
|
@@ -570,11 +567,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
570
567
|
"relativeTo",
|
|
571
568
|
controlVisibilityConfig.relativeTo(interactionValues)
|
|
572
569
|
);
|
|
573
|
-
const
|
|
574
|
-
const
|
|
575
|
-
"offsetBottom",
|
|
576
|
-
controlVisibilityConfig.offsetBottom(interactionValues)
|
|
577
|
-
);
|
|
570
|
+
const StartControl = useControlComponent("start", controlVisibilityConfig.start(interactionValues));
|
|
571
|
+
const EndControl = useControlComponent("end", controlVisibilityConfig.end(interactionValues));
|
|
578
572
|
const CustomEffectControl = useControlComponent(
|
|
579
573
|
"customEffects",
|
|
580
574
|
controlVisibilityConfig.custom(interactionValues)
|
|
@@ -607,8 +601,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
607
601
|
replay: updates.replay ?? replay,
|
|
608
602
|
easing: updates.easing ?? easing,
|
|
609
603
|
relativeTo: updates.relativeTo ?? relativeTo,
|
|
610
|
-
|
|
611
|
-
|
|
604
|
+
start: updates.start ?? start,
|
|
605
|
+
end: updates.end ?? end,
|
|
612
606
|
customEffects: updates.customEffects ?? customEffects
|
|
613
607
|
})
|
|
614
608
|
};
|
|
@@ -659,23 +653,23 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
659
653
|
onChange: (v) => updateInteraction({ delay: v }),
|
|
660
654
|
defaultValue: DEFAULT_VALUES.delay
|
|
661
655
|
}
|
|
662
|
-
))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(import_ui3.Divider, null), /* @__PURE__ */ React7.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("
|
|
663
|
-
|
|
656
|
+
))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(import_ui3.Divider, null), /* @__PURE__ */ React7.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, StartControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Start", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
657
|
+
StartControl,
|
|
664
658
|
{
|
|
665
|
-
value:
|
|
666
|
-
onChange: (v) => updateInteraction({
|
|
659
|
+
value: parseSizeValue(start, ["%"]).size?.toString() ?? "",
|
|
660
|
+
onChange: (v) => updateInteraction({ start: v })
|
|
667
661
|
}
|
|
668
|
-
)),
|
|
669
|
-
|
|
662
|
+
)), EndControl && /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("End", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
663
|
+
EndControl,
|
|
670
664
|
{
|
|
671
|
-
value:
|
|
672
|
-
onChange: (v) => updateInteraction({
|
|
665
|
+
value: parseSizeValue(end, ["%"]).size?.toString() ?? "",
|
|
666
|
+
onChange: (v) => updateInteraction({ end: v })
|
|
673
667
|
}
|
|
674
|
-
)),
|
|
675
|
-
|
|
668
|
+
)), /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Relative To", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
669
|
+
RelativeToControl,
|
|
676
670
|
{
|
|
677
|
-
value:
|
|
678
|
-
onChange: (v) => updateInteraction({
|
|
671
|
+
value: relativeTo,
|
|
672
|
+
onChange: (v) => updateInteraction({ relativeTo: v })
|
|
679
673
|
}
|
|
680
674
|
))), /* @__PURE__ */ React7.createElement(import_ui3.Divider, null)), EasingControl && /* @__PURE__ */ React7.createElement(import_ui3.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React7.createElement(Field, { label: (0, import_i18n2.__)("Easing", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
681
675
|
EasingControl,
|