@elementor/editor-interactions 4.0.0-676 → 4.0.0-678
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.js +33 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -11
- package/src/components/controls/easing.tsx +3 -0
- package/src/components/controls/effect.tsx +3 -0
- package/src/components/controls/replay.tsx +3 -0
- package/src/components/controls/trigger.tsx +3 -0
- package/src/ui/interactions-promotion-chip.tsx +14 -4
- package/src/ui/promotion-select.tsx +4 -0
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-678",
|
|
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-678",
|
|
43
|
+
"@elementor/editor-elements": "4.0.0-678",
|
|
44
|
+
"@elementor/editor-mcp": "4.0.0-678",
|
|
45
|
+
"@elementor/editor-props": "4.0.0-678",
|
|
46
|
+
"@elementor/editor-responsive": "4.0.0-678",
|
|
47
|
+
"@elementor/editor-ui": "4.0.0-678",
|
|
48
|
+
"@elementor/editor-v1-adapters": "4.0.0-678",
|
|
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-678",
|
|
51
|
+
"@elementor/session": "4.0.0-678",
|
|
52
52
|
"@elementor/ui": "1.36.17",
|
|
53
|
-
"@elementor/utils": "4.0.0-
|
|
53
|
+
"@elementor/utils": "4.0.0-678",
|
|
54
54
|
"@wordpress/i18n": "^5.13.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
@@ -5,6 +5,8 @@ import { type FieldProps } from '../../types';
|
|
|
5
5
|
import { PromotionSelect } from '../../ui/promotion-select';
|
|
6
6
|
import { DEFAULT_VALUES } from '../interaction-details';
|
|
7
7
|
|
|
8
|
+
const TRACKING_DATA = { target_name: 'interactions_easing', location_l2: 'interactions' } as const;
|
|
9
|
+
|
|
8
10
|
export const EASING_OPTIONS = {
|
|
9
11
|
easeIn: __( 'Ease In', 'elementor' ),
|
|
10
12
|
easeInOut: __( 'Ease In Out', 'elementor' ),
|
|
@@ -33,6 +35,7 @@ export function Easing( {}: FieldProps ) {
|
|
|
33
35
|
disabledOptions={ disabledOptions }
|
|
34
36
|
promotionContent={ __( 'Upgrade to control the smoothness of the interaction.', 'elementor' ) }
|
|
35
37
|
upgradeUrl="https://go.elementor.com/go-pro-interactions-easing-modal/"
|
|
38
|
+
trackingData={ TRACKING_DATA }
|
|
36
39
|
/>
|
|
37
40
|
);
|
|
38
41
|
}
|
|
@@ -5,6 +5,8 @@ import { type FieldProps } from '../../types';
|
|
|
5
5
|
import { PromotionSelect } from '../../ui/promotion-select';
|
|
6
6
|
import { DEFAULT_VALUES } from '../interaction-details';
|
|
7
7
|
|
|
8
|
+
const TRACKING_DATA = { target_name: 'interactions_effect', location_l2: 'interactions' } as const;
|
|
9
|
+
|
|
8
10
|
export const EFFECT_OPTIONS = {
|
|
9
11
|
fade: __( 'Fade', 'elementor' ),
|
|
10
12
|
slide: __( 'Slide', 'elementor' ),
|
|
@@ -35,6 +37,7 @@ export function Effect( { value, onChange }: FieldProps ) {
|
|
|
35
37
|
'elementor'
|
|
36
38
|
) }
|
|
37
39
|
upgradeUrl="https://go.elementor.com/go-pro-interactions-custom-effect-modal/"
|
|
40
|
+
trackingData={ TRACKING_DATA }
|
|
38
41
|
/>
|
|
39
42
|
);
|
|
40
43
|
}
|
|
@@ -7,6 +7,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
import { type ReplayFieldProps } from '../../types';
|
|
8
8
|
import { InteractionsPromotionChip } from '../../ui/interactions-promotion-chip';
|
|
9
9
|
|
|
10
|
+
const TRACKING_DATA = { target_name: 'interactions_replay', location_l2: 'interactions' } as const;
|
|
11
|
+
|
|
10
12
|
export const REPLAY_OPTIONS = {
|
|
11
13
|
no: __( 'No', 'elementor' ),
|
|
12
14
|
yes: __( 'Yes', 'elementor' ),
|
|
@@ -45,6 +47,7 @@ export function Replay( { onChange, anchorRef }: ReplayFieldProps ) {
|
|
|
45
47
|
content={ __( 'Upgrade to run the animation every time its trigger occurs.', 'elementor' ) }
|
|
46
48
|
upgradeUrl={ 'https://go.elementor.com/go-pro-interactions-replay-modal/' }
|
|
47
49
|
anchorRef={ anchorRef }
|
|
50
|
+
trackingData={ TRACKING_DATA }
|
|
48
51
|
/>
|
|
49
52
|
</Box>
|
|
50
53
|
</Box>
|
|
@@ -5,6 +5,8 @@ import { type FieldProps } from '../../types';
|
|
|
5
5
|
import { PromotionSelect } from '../../ui/promotion-select';
|
|
6
6
|
import { DEFAULT_VALUES } from '../interaction-details';
|
|
7
7
|
|
|
8
|
+
const TRACKING_DATA = { target_name: 'interactions_trigger', location_l2: 'interactions' } as const;
|
|
9
|
+
|
|
8
10
|
export const TRIGGER_OPTIONS = {
|
|
9
11
|
load: __( 'Page load', 'elementor' ),
|
|
10
12
|
scrollIn: __( 'Scroll into view', 'elementor' ),
|
|
@@ -33,6 +35,7 @@ export function Trigger( { value, onChange }: FieldProps ) {
|
|
|
33
35
|
promotionLabel={ __( 'PRO triggers', 'elementor' ) }
|
|
34
36
|
promotionContent={ __( 'Upgrade to unlock more interactions triggers.', 'elementor' ) }
|
|
35
37
|
upgradeUrl="https://go.elementor.com/go-pro-interactions-triggers-modal/"
|
|
38
|
+
trackingData={ TRACKING_DATA }
|
|
36
39
|
/>
|
|
37
40
|
);
|
|
38
41
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { forwardRef, type MouseEvent, type RefObject, useImperativeHandle, useState } from 'react';
|
|
2
|
+
import { forwardRef, type MouseEvent, type RefObject, useCallback, useImperativeHandle, useState } from 'react';
|
|
3
|
+
import { type PromotionTrackingData, trackUpgradePromotionClick, trackViewPromotion } from '@elementor/editor-controls';
|
|
3
4
|
import { PromotionChip, PromotionPopover, useCanvasClickHandler } from '@elementor/editor-ui';
|
|
4
5
|
import { Box } from '@elementor/ui';
|
|
5
6
|
import { __ } from '@wordpress/i18n';
|
|
@@ -8,6 +9,7 @@ export type InteractionsPromotionChipProps = {
|
|
|
8
9
|
content: string;
|
|
9
10
|
upgradeUrl: string;
|
|
10
11
|
anchorRef?: RefObject< HTMLElement | null >;
|
|
12
|
+
trackingData: PromotionTrackingData;
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
export type InteractionsPromotionChipRef = {
|
|
@@ -15,14 +17,21 @@ export type InteractionsPromotionChipRef = {
|
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
export const InteractionsPromotionChip = forwardRef< InteractionsPromotionChipRef, InteractionsPromotionChipProps >(
|
|
18
|
-
( { content, upgradeUrl, anchorRef }, ref ) => {
|
|
20
|
+
( { content, upgradeUrl, anchorRef, trackingData }, ref ) => {
|
|
19
21
|
const [ isOpen, setIsOpen ] = useState( false );
|
|
20
22
|
|
|
21
23
|
useCanvasClickHandler( isOpen, () => setIsOpen( false ) );
|
|
22
24
|
|
|
23
|
-
const toggle = (
|
|
25
|
+
const toggle = useCallback( () => {
|
|
26
|
+
setIsOpen( ( prev ) => {
|
|
27
|
+
if ( ! prev ) {
|
|
28
|
+
trackViewPromotion( trackingData );
|
|
29
|
+
}
|
|
30
|
+
return ! prev;
|
|
31
|
+
} );
|
|
32
|
+
}, [ trackingData ] );
|
|
24
33
|
|
|
25
|
-
useImperativeHandle( ref, () => ( { toggle } ), [] );
|
|
34
|
+
useImperativeHandle( ref, () => ( { toggle } ), [ toggle ] );
|
|
26
35
|
|
|
27
36
|
const handleToggle = ( e: MouseEvent ) => {
|
|
28
37
|
e.stopPropagation();
|
|
@@ -42,6 +51,7 @@ export const InteractionsPromotionChip = forwardRef< InteractionsPromotionChipRe
|
|
|
42
51
|
e.stopPropagation();
|
|
43
52
|
setIsOpen( false );
|
|
44
53
|
} }
|
|
54
|
+
onCtaClick={ () => trackUpgradePromotionClick( trackingData ) }
|
|
45
55
|
>
|
|
46
56
|
<Box
|
|
47
57
|
onMouseDown={ ( e: MouseEvent ) => e.stopPropagation() }
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type MouseEvent, useRef } from 'react';
|
|
3
|
+
import { type PromotionTrackingData } from '@elementor/editor-controls';
|
|
3
4
|
import { MenuListItem } from '@elementor/editor-ui';
|
|
4
5
|
import { MenuSubheader, Select, type SelectChangeEvent } from '@elementor/ui';
|
|
5
6
|
import { __ } from '@wordpress/i18n';
|
|
@@ -14,6 +15,7 @@ type PromotionSelectProps = {
|
|
|
14
15
|
promotionLabel?: string;
|
|
15
16
|
promotionContent: string;
|
|
16
17
|
upgradeUrl: string;
|
|
18
|
+
trackingData: PromotionTrackingData;
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
export function PromotionSelect( {
|
|
@@ -24,6 +26,7 @@ export function PromotionSelect( {
|
|
|
24
26
|
promotionLabel,
|
|
25
27
|
promotionContent,
|
|
26
28
|
upgradeUrl,
|
|
29
|
+
trackingData,
|
|
27
30
|
}: PromotionSelectProps ) {
|
|
28
31
|
const promotionRef = useRef< InteractionsPromotionChipRef >( null );
|
|
29
32
|
const anchorRef = useRef< HTMLElement >( null );
|
|
@@ -63,6 +66,7 @@ export function PromotionSelect( {
|
|
|
63
66
|
upgradeUrl={ upgradeUrl }
|
|
64
67
|
ref={ promotionRef }
|
|
65
68
|
anchorRef={ anchorRef }
|
|
69
|
+
trackingData={ trackingData }
|
|
66
70
|
/>
|
|
67
71
|
</MenuSubheader>
|
|
68
72
|
|