@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.mjs CHANGED
@@ -198,16 +198,16 @@ var createConfig = ({
198
198
  replay,
199
199
  easing = "easeIn",
200
200
  relativeTo = "",
201
- offsetTop = 0,
202
- offsetBottom = 85
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
- offsetTop: createSize(offsetTop, "%"),
210
- offsetBottom: createSize(offsetBottom, "%")
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
- offsetTop,
245
- offsetBottom,
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
- offsetTop,
260
- offsetBottom
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
- offsetTop,
276
- offsetBottom,
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
- offsetTop,
294
- offsetBottom,
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
- offsetTop: 15,
461
- offsetBottom: 85
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
- offsetTop: (values) => values.trigger === "scrollOn",
471
- offsetBottom: (values) => values.trigger === "scrollOn",
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 offsetTop = extractSize(interaction.animation.value.config?.value.offsetTop, DEFAULT_VALUES.offsetTop);
501
- const offsetBottom = extractSize(
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
- offsetTop,
516
- offsetBottom,
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 OffsetTopControl = useControlComponent("offsetTop", controlVisibilityConfig.offsetTop(interactionValues));
527
- const OffsetBottomControl = useControlComponent(
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
- offsetTop: updates.offsetTop ?? offsetTop,
564
- offsetBottom: updates.offsetBottom ?? offsetBottom,
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("Relative To", "elementor") }, /* @__PURE__ */ React7.createElement(
616
- RelativeToControl,
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: relativeTo,
619
- onChange: (v) => updateInteraction({ relativeTo: v })
612
+ value: parseSizeValue(start, ["%"]).size?.toString() ?? "",
613
+ onChange: (v) => updateInteraction({ start: v })
620
614
  }
621
- )), OffsetTopControl && /* @__PURE__ */ React7.createElement(Field, { label: __2("Offset Top", "elementor") }, /* @__PURE__ */ React7.createElement(
622
- OffsetTopControl,
615
+ )), EndControl && /* @__PURE__ */ React7.createElement(Field, { label: __2("End", "elementor") }, /* @__PURE__ */ React7.createElement(
616
+ EndControl,
623
617
  {
624
- value: String(parseSizeValue(offsetTop, ["%"]).size),
625
- onChange: (v) => updateInteraction({ offsetTop: v })
618
+ value: parseSizeValue(end, ["%"]).size?.toString() ?? "",
619
+ onChange: (v) => updateInteraction({ end: v })
626
620
  }
627
- )), OffsetBottomControl && /* @__PURE__ */ React7.createElement(Field, { label: __2("Offset Bottom", "elementor") }, /* @__PURE__ */ React7.createElement(
628
- OffsetBottomControl,
621
+ )), /* @__PURE__ */ React7.createElement(Field, { label: __2("Relative To", "elementor") }, /* @__PURE__ */ React7.createElement(
622
+ RelativeToControl,
629
623
  {
630
- value: String(parseSizeValue(offsetBottom, ["%"]).size),
631
- onChange: (v) => updateInteraction({ offsetBottom: v })
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,