@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.mjs
CHANGED
|
@@ -198,16 +198,16 @@ var createConfig = ({
|
|
|
198
198
|
replay,
|
|
199
199
|
easing = "easeIn",
|
|
200
200
|
relativeTo = "",
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
start = 85,
|
|
202
|
+
end = 15
|
|
203
203
|
}) => ({
|
|
204
204
|
$$type: "config",
|
|
205
205
|
value: {
|
|
206
206
|
replay: createBoolean(replay),
|
|
207
207
|
easing: createString(easing),
|
|
208
208
|
relativeTo: createString(relativeTo),
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
start: createSize(start, "%"),
|
|
210
|
+
end: createSize(end, "%")
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
var createSize = (value, defaultUnit, defaultValue) => {
|
|
@@ -241,8 +241,8 @@ var createAnimationPreset = ({
|
|
|
241
241
|
replay = false,
|
|
242
242
|
easing = "easeIn",
|
|
243
243
|
relativeTo,
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
start,
|
|
245
|
+
end,
|
|
246
246
|
customEffects
|
|
247
247
|
}) => ({
|
|
248
248
|
$$type: "animation-preset-props",
|
|
@@ -256,8 +256,8 @@ var createAnimationPreset = ({
|
|
|
256
256
|
replay,
|
|
257
257
|
easing,
|
|
258
258
|
relativeTo,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
start,
|
|
260
|
+
end
|
|
261
261
|
})
|
|
262
262
|
}
|
|
263
263
|
});
|
|
@@ -272,8 +272,8 @@ var createInteractionItem = ({
|
|
|
272
272
|
replay = false,
|
|
273
273
|
easing = "easeIn",
|
|
274
274
|
relativeTo,
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
start,
|
|
276
|
+
end,
|
|
277
277
|
excludedBreakpoints,
|
|
278
278
|
customEffects
|
|
279
279
|
}) => ({
|
|
@@ -290,8 +290,8 @@ var createInteractionItem = ({
|
|
|
290
290
|
replay,
|
|
291
291
|
easing,
|
|
292
292
|
relativeTo,
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
start,
|
|
294
|
+
end,
|
|
295
295
|
customEffects
|
|
296
296
|
}),
|
|
297
297
|
...excludedBreakpoints && excludedBreakpoints.length > 0 && {
|
|
@@ -457,8 +457,8 @@ var DEFAULT_VALUES = {
|
|
|
457
457
|
replay: false,
|
|
458
458
|
easing: "easeIn",
|
|
459
459
|
relativeTo: "viewport",
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
start: 85,
|
|
461
|
+
end: 15
|
|
462
462
|
};
|
|
463
463
|
var TRIGGERS_WITHOUT_REPLAY = ["load", "scrollOn", "hover", "click"];
|
|
464
464
|
var controlVisibilityConfig = {
|
|
@@ -467,8 +467,8 @@ var controlVisibilityConfig = {
|
|
|
467
467
|
effectType: (values) => values.effect !== "custom",
|
|
468
468
|
direction: (values) => values.effect !== "custom",
|
|
469
469
|
relativeTo: (values) => values.trigger === "scrollOn",
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
start: (values) => values.trigger === "scrollOn",
|
|
471
|
+
end: (values) => values.trigger === "scrollOn",
|
|
472
472
|
duration: (values) => {
|
|
473
473
|
const isRelativeToVisible = values.trigger === "scrollOn";
|
|
474
474
|
return !isRelativeToVisible;
|
|
@@ -497,11 +497,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
497
497
|
const replay = extractBoolean(interaction.animation.value.config?.value.replay, DEFAULT_VALUES.replay);
|
|
498
498
|
const easing = extractString(interaction.animation.value.config?.value.easing, DEFAULT_VALUES.easing);
|
|
499
499
|
const relativeTo = extractString(interaction.animation.value.config?.value.relativeTo, DEFAULT_VALUES.relativeTo);
|
|
500
|
-
const
|
|
501
|
-
const
|
|
502
|
-
interaction.animation.value.config?.value.offsetBottom,
|
|
503
|
-
DEFAULT_VALUES.offsetBottom
|
|
504
|
-
);
|
|
500
|
+
const start = extractSize(interaction.animation.value.config?.value.start, DEFAULT_VALUES.start);
|
|
501
|
+
const end = extractSize(interaction.animation.value.config?.value.end, DEFAULT_VALUES.end);
|
|
505
502
|
const interactionValues = {
|
|
506
503
|
trigger,
|
|
507
504
|
effect,
|
|
@@ -512,8 +509,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
512
509
|
easing,
|
|
513
510
|
replay,
|
|
514
511
|
relativeTo,
|
|
515
|
-
|
|
516
|
-
|
|
512
|
+
start,
|
|
513
|
+
end,
|
|
517
514
|
customEffects
|
|
518
515
|
};
|
|
519
516
|
const TriggerControl = useControlComponent("trigger", true);
|
|
@@ -523,11 +520,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
523
520
|
"relativeTo",
|
|
524
521
|
controlVisibilityConfig.relativeTo(interactionValues)
|
|
525
522
|
);
|
|
526
|
-
const
|
|
527
|
-
const
|
|
528
|
-
"offsetBottom",
|
|
529
|
-
controlVisibilityConfig.offsetBottom(interactionValues)
|
|
530
|
-
);
|
|
523
|
+
const StartControl = useControlComponent("start", controlVisibilityConfig.start(interactionValues));
|
|
524
|
+
const EndControl = useControlComponent("end", controlVisibilityConfig.end(interactionValues));
|
|
531
525
|
const CustomEffectControl = useControlComponent(
|
|
532
526
|
"customEffects",
|
|
533
527
|
controlVisibilityConfig.custom(interactionValues)
|
|
@@ -560,8 +554,8 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
560
554
|
replay: updates.replay ?? replay,
|
|
561
555
|
easing: updates.easing ?? easing,
|
|
562
556
|
relativeTo: updates.relativeTo ?? relativeTo,
|
|
563
|
-
|
|
564
|
-
|
|
557
|
+
start: updates.start ?? start,
|
|
558
|
+
end: updates.end ?? end,
|
|
565
559
|
customEffects: updates.customEffects ?? customEffects
|
|
566
560
|
})
|
|
567
561
|
};
|
|
@@ -612,23 +606,23 @@ var InteractionDetails = ({ interaction, onChange, onPlayInteraction }) => {
|
|
|
612
606
|
onChange: (v) => updateInteraction({ delay: v }),
|
|
613
607
|
defaultValue: DEFAULT_VALUES.delay
|
|
614
608
|
}
|
|
615
|
-
))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Divider, null), /* @__PURE__ */ React7.createElement(Grid2, { container: true, spacing: 1.5 }, /* @__PURE__ */ React7.createElement(Field, { label: __2("
|
|
616
|
-
|
|
609
|
+
))), controlVisibilityConfig.relativeTo(interactionValues) && RelativeToControl && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Divider, null), /* @__PURE__ */ React7.createElement(Grid2, { container: true, spacing: 1.5 }, StartControl && /* @__PURE__ */ React7.createElement(Field, { label: __2("Start", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
610
|
+
StartControl,
|
|
617
611
|
{
|
|
618
|
-
value:
|
|
619
|
-
onChange: (v) => updateInteraction({
|
|
612
|
+
value: parseSizeValue(start, ["%"]).size?.toString() ?? "",
|
|
613
|
+
onChange: (v) => updateInteraction({ start: v })
|
|
620
614
|
}
|
|
621
|
-
)),
|
|
622
|
-
|
|
615
|
+
)), EndControl && /* @__PURE__ */ React7.createElement(Field, { label: __2("End", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
616
|
+
EndControl,
|
|
623
617
|
{
|
|
624
|
-
value:
|
|
625
|
-
onChange: (v) => updateInteraction({
|
|
618
|
+
value: parseSizeValue(end, ["%"]).size?.toString() ?? "",
|
|
619
|
+
onChange: (v) => updateInteraction({ end: v })
|
|
626
620
|
}
|
|
627
|
-
)),
|
|
628
|
-
|
|
621
|
+
)), /* @__PURE__ */ React7.createElement(Field, { label: __2("Relative To", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
622
|
+
RelativeToControl,
|
|
629
623
|
{
|
|
630
|
-
value:
|
|
631
|
-
onChange: (v) => updateInteraction({
|
|
624
|
+
value: relativeTo,
|
|
625
|
+
onChange: (v) => updateInteraction({ relativeTo: v })
|
|
632
626
|
}
|
|
633
627
|
))), /* @__PURE__ */ React7.createElement(Divider, null)), EasingControl && /* @__PURE__ */ React7.createElement(Grid2, { container: true, spacing: 1.5 }, /* @__PURE__ */ React7.createElement(Field, { label: __2("Easing", "elementor") }, /* @__PURE__ */ React7.createElement(
|
|
634
628
|
EasingControl,
|