@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-interactions",
3
- "version": "4.0.0-621",
3
+ "version": "4.0.0-manual",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,18 +39,18 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor-controls": "4.0.0-621",
43
- "@elementor/editor-elements": "4.0.0-621",
44
- "@elementor/editor-mcp": "4.0.0-621",
45
- "@elementor/editor-props": "4.0.0-621",
46
- "@elementor/editor-responsive": "4.0.0-621",
47
- "@elementor/editor-ui": "4.0.0-621",
48
- "@elementor/editor-v1-adapters": "4.0.0-621",
42
+ "@elementor/editor-controls": "4.0.0-manual",
43
+ "@elementor/editor-elements": "4.0.0-manual",
44
+ "@elementor/editor-mcp": "4.0.0-manual",
45
+ "@elementor/editor-props": "4.0.0-manual",
46
+ "@elementor/editor-responsive": "4.0.0-manual",
47
+ "@elementor/editor-ui": "4.0.0-manual",
48
+ "@elementor/editor-v1-adapters": "4.0.0-manual",
49
49
  "@elementor/icons": "^1.68.0",
50
- "@elementor/schema": "4.0.0-621",
51
- "@elementor/session": "4.0.0-621",
50
+ "@elementor/schema": "4.0.0-manual",
51
+ "@elementor/session": "4.0.0-manual",
52
52
  "@elementor/ui": "1.36.17",
53
- "@elementor/utils": "4.0.0-621",
53
+ "@elementor/utils": "4.0.0-manual",
54
54
  "@wordpress/i18n": "^5.13.0"
55
55
  },
56
56
  "peerDependencies": {
@@ -35,8 +35,8 @@ export const DEFAULT_VALUES = {
35
35
  replay: false,
36
36
  easing: 'easeIn',
37
37
  relativeTo: 'viewport',
38
- offsetTop: 15,
39
- offsetBottom: 85,
38
+ start: 85,
39
+ end: 15,
40
40
  };
41
41
 
42
42
  const TRIGGERS_WITHOUT_REPLAY = [ 'load', 'scrollOn', 'hover', 'click' ];
@@ -51,8 +51,8 @@ type InteractionsControlType =
51
51
  | 'replay'
52
52
  | 'easing'
53
53
  | 'relativeTo'
54
- | 'offsetTop'
55
- | 'offsetBottom'
54
+ | 'start'
55
+ | 'end'
56
56
  | 'customEffects';
57
57
 
58
58
  type InteractionValues = {
@@ -65,8 +65,8 @@ type InteractionValues = {
65
65
  replay: boolean;
66
66
  easing: string;
67
67
  relativeTo: string;
68
- offsetTop: SizeStringValue;
69
- offsetBottom: SizeStringValue;
68
+ start: SizeStringValue;
69
+ end: SizeStringValue;
70
70
  customEffects?: PropValue;
71
71
  };
72
72
 
@@ -80,8 +80,8 @@ const controlVisibilityConfig: ControlVisibilityConfig = {
80
80
  effectType: ( values ) => values.effect !== 'custom',
81
81
  direction: ( values ) => values.effect !== 'custom',
82
82
  relativeTo: ( values ) => values.trigger === 'scrollOn',
83
- offsetTop: ( values ) => values.trigger === 'scrollOn',
84
- offsetBottom: ( values ) => values.trigger === 'scrollOn',
83
+ start: ( values ) => values.trigger === 'scrollOn',
84
+ end: ( values ) => values.trigger === 'scrollOn',
85
85
 
86
86
  duration: ( values ) => {
87
87
  const isRelativeToVisible = values.trigger === 'scrollOn';
@@ -114,11 +114,8 @@ export const InteractionDetails = ( { interaction, onChange, onPlayInteraction }
114
114
  const easing = extractString( interaction.animation.value.config?.value.easing, DEFAULT_VALUES.easing );
115
115
  const relativeTo = extractString( interaction.animation.value.config?.value.relativeTo, DEFAULT_VALUES.relativeTo );
116
116
 
117
- const offsetTop = extractSize( interaction.animation.value.config?.value.offsetTop, DEFAULT_VALUES.offsetTop );
118
- const offsetBottom = extractSize(
119
- interaction.animation.value.config?.value.offsetBottom,
120
- DEFAULT_VALUES.offsetBottom
121
- );
117
+ const start = extractSize( interaction.animation.value.config?.value.start, DEFAULT_VALUES.start );
118
+ const end = extractSize( interaction.animation.value.config?.value.end, DEFAULT_VALUES.end );
122
119
 
123
120
  const interactionValues = {
124
121
  trigger,
@@ -130,8 +127,8 @@ export const InteractionDetails = ( { interaction, onChange, onPlayInteraction }
130
127
  easing,
131
128
  replay,
132
129
  relativeTo,
133
- offsetTop,
134
- offsetBottom,
130
+ start,
131
+ end,
135
132
  customEffects,
136
133
  };
137
134
 
@@ -142,11 +139,8 @@ export const InteractionDetails = ( { interaction, onChange, onPlayInteraction }
142
139
  'relativeTo',
143
140
  controlVisibilityConfig.relativeTo( interactionValues )
144
141
  );
145
- const OffsetTopControl = useControlComponent( 'offsetTop', controlVisibilityConfig.offsetTop( interactionValues ) );
146
- const OffsetBottomControl = useControlComponent(
147
- 'offsetBottom',
148
- controlVisibilityConfig.offsetBottom( interactionValues )
149
- );
142
+ const StartControl = useControlComponent( 'start', controlVisibilityConfig.start( interactionValues ) );
143
+ const EndControl = useControlComponent( 'end', controlVisibilityConfig.end( interactionValues ) );
150
144
  const CustomEffectControl = useControlComponent(
151
145
  'customEffects',
152
146
  controlVisibilityConfig.custom( interactionValues )
@@ -172,8 +166,8 @@ export const InteractionDetails = ( { interaction, onChange, onPlayInteraction }
172
166
  replay: boolean;
173
167
  easing?: string;
174
168
  relativeTo: string;
175
- offsetTop: SizeStringValue;
176
- offsetBottom: SizeStringValue;
169
+ start: SizeStringValue;
170
+ end: SizeStringValue;
177
171
  customEffects?: PropValue;
178
172
  } >
179
173
  ): void => {
@@ -198,8 +192,8 @@ export const InteractionDetails = ( { interaction, onChange, onPlayInteraction }
198
192
  replay: updates.replay ?? replay,
199
193
  easing: updates.easing ?? easing,
200
194
  relativeTo: updates.relativeTo ?? relativeTo,
201
- offsetTop: updates.offsetTop ?? offsetTop,
202
- offsetBottom: updates.offsetBottom ?? offsetBottom,
195
+ start: updates.start ?? start,
196
+ end: updates.end ?? end,
203
197
  customEffects: updates.customEffects ?? customEffects,
204
198
  } ),
205
199
  };
@@ -297,32 +291,30 @@ export const InteractionDetails = ( { interaction, onChange, onPlayInteraction }
297
291
  <>
298
292
  <Divider />
299
293
  <Grid container spacing={ 1.5 }>
300
- <Field label={ __( 'Relative To', 'elementor' ) }>
301
- <RelativeToControl
302
- value={ relativeTo }
303
- onChange={ ( v ) => updateInteraction( { relativeTo: v } ) }
304
- />
305
- </Field>
306
- { OffsetTopControl && (
307
- <Field label={ __( 'Offset Top', 'elementor' ) }>
308
- <OffsetTopControl
309
- value={ String( parseSizeValue( offsetTop, [ '%' ] ).size ) }
294
+ { StartControl && (
295
+ <Field label={ __( 'Start', 'elementor' ) }>
296
+ <StartControl
297
+ value={ parseSizeValue( start, [ '%' ] ).size?.toString() ?? '' }
310
298
  onChange={ ( v: string ) =>
311
- updateInteraction( { offsetTop: v as SizeStringValue } )
299
+ updateInteraction( { start: v as SizeStringValue } )
312
300
  }
313
301
  />
314
302
  </Field>
315
303
  ) }
316
- { OffsetBottomControl && (
317
- <Field label={ __( 'Offset Bottom', 'elementor' ) }>
318
- <OffsetBottomControl
319
- value={ String( parseSizeValue( offsetBottom, [ '%' ] ).size ) }
320
- onChange={ ( v: string ) =>
321
- updateInteraction( { offsetBottom: v as SizeStringValue } )
322
- }
304
+ { EndControl && (
305
+ <Field label={ __( 'End', 'elementor' ) }>
306
+ <EndControl
307
+ value={ parseSizeValue( end, [ '%' ] ).size?.toString() ?? '' }
308
+ onChange={ ( v: string ) => updateInteraction( { end: v as SizeStringValue } ) }
323
309
  />
324
310
  </Field>
325
311
  ) }
312
+ <Field label={ __( 'Relative To', 'elementor' ) }>
313
+ <RelativeToControl
314
+ value={ relativeTo }
315
+ onChange={ ( v ) => updateInteraction( { relativeTo: v } ) }
316
+ />
317
+ </Field>
326
318
  </Grid>
327
319
  <Divider />
328
320
  </>
@@ -13,8 +13,8 @@ type InteractionsControlType =
13
13
  | 'replay'
14
14
  | 'easing'
15
15
  | 'relativeTo'
16
- | 'offsetTop'
17
- | 'offsetBottom'
16
+ | 'start'
17
+ | 'end'
18
18
  | 'customEffects';
19
19
 
20
20
  type InteractionsControlPropsMap = {
@@ -28,8 +28,8 @@ type InteractionsControlPropsMap = {
28
28
  replay: ReplayFieldProps;
29
29
  easing: FieldProps;
30
30
  relativeTo: FieldProps;
31
- offsetTop: FieldProps;
32
- offsetBottom: FieldProps;
31
+ start: FieldProps;
32
+ end: FieldProps;
33
33
  };
34
34
 
35
35
  type ControlOptions< T extends InteractionsControlType > = {
@@ -46,22 +46,22 @@ export const createConfig = ( {
46
46
  replay,
47
47
  easing = 'easeIn',
48
48
  relativeTo = '',
49
- offsetTop = 0,
50
- offsetBottom = 85,
49
+ start = 85,
50
+ end = 15,
51
51
  }: {
52
52
  replay: boolean;
53
53
  easing?: string;
54
54
  relativeTo?: string;
55
- offsetTop?: SizeStringValue;
56
- offsetBottom?: SizeStringValue;
55
+ start?: SizeStringValue;
56
+ end?: SizeStringValue;
57
57
  } ): ConfigPropValue => ( {
58
58
  $$type: 'config',
59
59
  value: {
60
60
  replay: createBoolean( replay ),
61
61
  easing: createString( easing ),
62
62
  relativeTo: createString( relativeTo ),
63
- offsetTop: createSize( offsetTop, '%' ),
64
- offsetBottom: createSize( offsetBottom, '%' ),
63
+ start: createSize( start, '%' ),
64
+ end: createSize( end, '%' ),
65
65
  },
66
66
  } );
67
67
 
@@ -102,8 +102,8 @@ export const createAnimationPreset = ( {
102
102
  replay = false,
103
103
  easing = 'easeIn',
104
104
  relativeTo,
105
- offsetTop,
106
- offsetBottom,
105
+ start,
106
+ end,
107
107
  customEffects,
108
108
  }: {
109
109
  effect: string;
@@ -114,8 +114,8 @@ export const createAnimationPreset = ( {
114
114
  replay: boolean;
115
115
  easing?: string;
116
116
  relativeTo?: string;
117
- offsetTop?: SizeStringValue;
118
- offsetBottom?: SizeStringValue;
117
+ start?: SizeStringValue;
118
+ end?: SizeStringValue;
119
119
  customEffects?: PropValue;
120
120
  } ): AnimationPresetPropValue => ( {
121
121
  $$type: 'animation-preset-props',
@@ -129,8 +129,8 @@ export const createAnimationPreset = ( {
129
129
  replay,
130
130
  easing,
131
131
  relativeTo,
132
- offsetTop,
133
- offsetBottom,
132
+ start,
133
+ end,
134
134
  } ),
135
135
  },
136
136
  } );
@@ -146,8 +146,8 @@ export const createInteractionItem = ( {
146
146
  replay = false,
147
147
  easing = 'easeIn',
148
148
  relativeTo,
149
- offsetTop,
150
- offsetBottom,
149
+ start,
150
+ end,
151
151
  excludedBreakpoints,
152
152
  customEffects,
153
153
  }: {
@@ -161,8 +161,8 @@ export const createInteractionItem = ( {
161
161
  replay?: boolean;
162
162
  easing?: string;
163
163
  relativeTo?: string;
164
- offsetTop?: number;
165
- offsetBottom?: number;
164
+ start?: number;
165
+ end?: number;
166
166
  excludedBreakpoints?: string[];
167
167
  customEffects?: PropValue;
168
168
  } ): InteractionItemPropValue => ( {
@@ -179,8 +179,8 @@ export const createInteractionItem = ( {
179
179
  replay,
180
180
  easing,
181
181
  relativeTo,
182
- offsetTop,
183
- offsetBottom,
182
+ start,
183
+ end,
184
184
  customEffects,
185
185
  } ),
186
186
  ...( excludedBreakpoints &&