@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-interactions",
|
|
3
|
-
"version": "4.0.0-
|
|
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-
|
|
43
|
-
"@elementor/editor-elements": "4.0.0-
|
|
44
|
-
"@elementor/editor-mcp": "4.0.0-
|
|
45
|
-
"@elementor/editor-props": "4.0.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.0.0-
|
|
47
|
-
"@elementor/editor-ui": "4.0.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.0.0-
|
|
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-
|
|
51
|
-
"@elementor/session": "4.0.0-
|
|
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-
|
|
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
|
-
|
|
39
|
-
|
|
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
|
-
| '
|
|
55
|
-
| '
|
|
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
|
-
|
|
69
|
-
|
|
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
|
-
|
|
84
|
-
|
|
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
|
|
118
|
-
const
|
|
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
|
-
|
|
134
|
-
|
|
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
|
|
146
|
-
const
|
|
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
|
-
|
|
176
|
-
|
|
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
|
-
|
|
202
|
-
|
|
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
|
-
|
|
301
|
-
<
|
|
302
|
-
|
|
303
|
-
|
|
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( {
|
|
299
|
+
updateInteraction( { start: v as SizeStringValue } )
|
|
312
300
|
}
|
|
313
301
|
/>
|
|
314
302
|
</Field>
|
|
315
303
|
) }
|
|
316
|
-
{
|
|
317
|
-
<Field label={ __( '
|
|
318
|
-
<
|
|
319
|
-
value={
|
|
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
|
-
| '
|
|
17
|
-
| '
|
|
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
|
-
|
|
32
|
-
|
|
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
|
-
|
|
50
|
-
|
|
49
|
+
start = 85,
|
|
50
|
+
end = 15,
|
|
51
51
|
}: {
|
|
52
52
|
replay: boolean;
|
|
53
53
|
easing?: string;
|
|
54
54
|
relativeTo?: string;
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
64
|
-
|
|
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
|
-
|
|
106
|
-
|
|
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
|
-
|
|
118
|
-
|
|
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
|
-
|
|
133
|
-
|
|
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
|
-
|
|
150
|
-
|
|
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
|
-
|
|
165
|
-
|
|
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
|
-
|
|
183
|
-
|
|
182
|
+
start,
|
|
183
|
+
end,
|
|
184
184
|
customEffects,
|
|
185
185
|
} ),
|
|
186
186
|
...( excludedBreakpoints &&
|