@elementor/editor-components 3.35.0-377 → 3.35.0-379
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 +282 -217
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +266 -201
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -21
- package/src/components/component-panel-header/component-badge.tsx +25 -22
- package/src/components/component-panel-header/component-panel-header.tsx +18 -2
- package/src/components/components-tab/component-introduction.tsx +68 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-components",
|
|
3
3
|
"description": "Elementor editor components",
|
|
4
|
-
"version": "3.35.0-
|
|
4
|
+
"version": "3.35.0-379",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,29 +40,30 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor": "3.35.0-
|
|
44
|
-
"@elementor/editor-canvas": "3.35.0-
|
|
45
|
-
"@elementor/editor-controls": "3.35.0-
|
|
46
|
-
"@elementor/editor-documents": "3.35.0-
|
|
47
|
-
"@elementor/editor-editing-panel": "3.35.0-
|
|
48
|
-
"@elementor/editor-elements": "3.35.0-
|
|
49
|
-
"@elementor/editor-elements-panel": "3.35.0-
|
|
50
|
-
"@elementor/editor-mcp": "3.35.0-
|
|
51
|
-
"@elementor/editor-panels": "3.35.0-
|
|
52
|
-
"@elementor/editor-props": "3.35.0-
|
|
53
|
-
"@elementor/editor-styles-repository": "3.35.0-
|
|
54
|
-
"@elementor/editor-ui": "3.35.0-
|
|
55
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
56
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor": "3.35.0-379",
|
|
44
|
+
"@elementor/editor-canvas": "3.35.0-379",
|
|
45
|
+
"@elementor/editor-controls": "3.35.0-379",
|
|
46
|
+
"@elementor/editor-documents": "3.35.0-379",
|
|
47
|
+
"@elementor/editor-editing-panel": "3.35.0-379",
|
|
48
|
+
"@elementor/editor-elements": "3.35.0-379",
|
|
49
|
+
"@elementor/editor-elements-panel": "3.35.0-379",
|
|
50
|
+
"@elementor/editor-mcp": "3.35.0-379",
|
|
51
|
+
"@elementor/editor-panels": "3.35.0-379",
|
|
52
|
+
"@elementor/editor-props": "3.35.0-379",
|
|
53
|
+
"@elementor/editor-styles-repository": "3.35.0-379",
|
|
54
|
+
"@elementor/editor-ui": "3.35.0-379",
|
|
55
|
+
"@elementor/editor-v1-adapters": "3.35.0-379",
|
|
56
|
+
"@elementor/http-client": "3.35.0-379",
|
|
57
57
|
"@elementor/icons": "^1.63.0",
|
|
58
|
-
"@elementor/mixpanel": "3.35.0-
|
|
59
|
-
"@elementor/query": "3.35.0-
|
|
60
|
-
"@elementor/schema": "3.35.0-
|
|
61
|
-
"@elementor/store": "3.35.0-
|
|
58
|
+
"@elementor/mixpanel": "3.35.0-379",
|
|
59
|
+
"@elementor/query": "3.35.0-379",
|
|
60
|
+
"@elementor/schema": "3.35.0-379",
|
|
61
|
+
"@elementor/store": "3.35.0-379",
|
|
62
62
|
"@elementor/ui": "1.36.17",
|
|
63
|
-
"@elementor/utils": "3.35.0-
|
|
63
|
+
"@elementor/utils": "3.35.0-379",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/editor-notifications": "3.35.0-
|
|
65
|
+
"@elementor/editor-notifications": "3.35.0-379",
|
|
66
|
+
"@elementor/editor-current-user": "3.35.0-379"
|
|
66
67
|
},
|
|
67
68
|
"peerDependencies": {
|
|
68
69
|
"react": "^18.3.1",
|
|
@@ -4,30 +4,33 @@ import { ComponentPropListIcon } from '@elementor/icons';
|
|
|
4
4
|
import { Badge, Box, keyframes, styled, ToggleButton } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
|
-
export const ComponentsBadge =
|
|
8
|
-
|
|
7
|
+
export const ComponentsBadge = React.forwardRef< HTMLDivElement, { overridesCount: number } >(
|
|
8
|
+
( { overridesCount }, ref ) => {
|
|
9
|
+
const prevCount = usePrevious( overridesCount );
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const isFirstOverride = prevCount === 0 && overridesCount === 1;
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
return (
|
|
14
|
+
<StyledBadge
|
|
15
|
+
ref={ ref }
|
|
16
|
+
color="primary"
|
|
17
|
+
key={ overridesCount }
|
|
18
|
+
invisible={ overridesCount === 0 }
|
|
19
|
+
animate={ isFirstOverride }
|
|
20
|
+
anchorOrigin={ { vertical: 'top', horizontal: 'right' } }
|
|
21
|
+
badgeContent={
|
|
22
|
+
<Box sx={ { animation: ! isFirstOverride ? `${ slideUp } 300ms ease-out` : 'none' } }>
|
|
23
|
+
{ overridesCount }
|
|
24
|
+
</Box>
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
<ToggleButton value="overrides" size="tiny" aria-label={ __( 'View overrides', 'elementor' ) }>
|
|
28
|
+
<ComponentPropListIcon fontSize="tiny" />
|
|
29
|
+
</ToggleButton>
|
|
30
|
+
</StyledBadge>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
31
34
|
|
|
32
35
|
const StyledBadge = styled( Badge, { shouldForwardProp: ( prop ) => prop !== 'animate' } )(
|
|
33
36
|
( { theme, animate } ) => ( {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useSuppressedMessage } from '@elementor/editor-current-user';
|
|
2
3
|
import { getV1DocumentsManager } from '@elementor/editor-documents';
|
|
3
4
|
import { ArrowLeftIcon, ComponentsFilledIcon } from '@elementor/icons';
|
|
4
5
|
import { Box, Divider, IconButton, Stack, Tooltip, Typography } from '@elementor/ui';
|
|
@@ -6,21 +7,31 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
7
|
|
|
7
8
|
import { useNavigateBack } from '../../hooks/use-navigate-back';
|
|
8
9
|
import { useCurrentComponentId } from '../../store/store';
|
|
10
|
+
import { ComponentIntroduction } from '../components-tab/component-introduction';
|
|
9
11
|
import { ComponentsBadge } from './component-badge';
|
|
10
12
|
import { useOverridableProps } from './use-overridable-props';
|
|
11
13
|
|
|
14
|
+
const MESSAGE_KEY = 'components-properties-introduction';
|
|
15
|
+
|
|
12
16
|
export const ComponentPanelHeader = () => {
|
|
13
17
|
const currentComponentId = useCurrentComponentId();
|
|
14
18
|
const overridableProps = useOverridableProps( currentComponentId );
|
|
15
19
|
const onBack = useNavigateBack();
|
|
16
20
|
const componentName = getComponentName();
|
|
17
|
-
|
|
21
|
+
const [ isMessageSuppressed, suppressMessage ] = useSuppressedMessage( MESSAGE_KEY );
|
|
22
|
+
const [ shouldShowIntroduction, setShouldShowIntroduction ] = React.useState( ! isMessageSuppressed );
|
|
18
23
|
const overridesCount = overridableProps ? Object.keys( overridableProps.props ).length : 0;
|
|
24
|
+
const anchorRef = React.useRef< HTMLDivElement >( null );
|
|
19
25
|
|
|
20
26
|
if ( ! currentComponentId ) {
|
|
21
27
|
return null;
|
|
22
28
|
}
|
|
23
29
|
|
|
30
|
+
const handleCloseIntroduction = () => {
|
|
31
|
+
suppressMessage();
|
|
32
|
+
setShouldShowIntroduction( false );
|
|
33
|
+
};
|
|
34
|
+
|
|
24
35
|
return (
|
|
25
36
|
<Box>
|
|
26
37
|
<Stack
|
|
@@ -42,9 +53,14 @@ export const ComponentPanelHeader = () => {
|
|
|
42
53
|
</Typography>
|
|
43
54
|
</Stack>
|
|
44
55
|
</Stack>
|
|
45
|
-
<ComponentsBadge overridesCount={ overridesCount } />
|
|
56
|
+
<ComponentsBadge overridesCount={ overridesCount } ref={ anchorRef } />
|
|
46
57
|
</Stack>
|
|
47
58
|
<Divider />
|
|
59
|
+
<ComponentIntroduction
|
|
60
|
+
anchorRef={ anchorRef }
|
|
61
|
+
shouldShowIntroduction={ shouldShowIntroduction }
|
|
62
|
+
onClose={ handleCloseIntroduction }
|
|
63
|
+
/>
|
|
48
64
|
</Box>
|
|
49
65
|
);
|
|
50
66
|
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PopoverContent } from '@elementor/editor-controls';
|
|
3
|
+
import { PopoverHeader } from '@elementor/editor-ui';
|
|
4
|
+
import { Box, Button, Image, Popover, Stack, Typography } from '@elementor/ui';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
export const ComponentIntroduction = ( {
|
|
8
|
+
anchorRef,
|
|
9
|
+
shouldShowIntroduction,
|
|
10
|
+
onClose,
|
|
11
|
+
}: {
|
|
12
|
+
anchorRef: React.RefObject< HTMLDivElement >;
|
|
13
|
+
shouldShowIntroduction: boolean;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
} ) => {
|
|
16
|
+
if ( ! anchorRef.current || ! shouldShowIntroduction ) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Popover
|
|
22
|
+
anchorEl={ anchorRef.current }
|
|
23
|
+
open={ shouldShowIntroduction }
|
|
24
|
+
anchorOrigin={ {
|
|
25
|
+
vertical: 'top',
|
|
26
|
+
horizontal: 'right',
|
|
27
|
+
} }
|
|
28
|
+
transformOrigin={ {
|
|
29
|
+
vertical: 'top',
|
|
30
|
+
horizontal: -30,
|
|
31
|
+
} }
|
|
32
|
+
onClose={ onClose }
|
|
33
|
+
>
|
|
34
|
+
<Box sx={ { width: '296px' } }>
|
|
35
|
+
<PopoverHeader title={ __( 'Add your first property', 'elementor' ) } onClose={ onClose } />
|
|
36
|
+
<Image
|
|
37
|
+
sx={ { width: '296px', height: '160px' } }
|
|
38
|
+
src={ 'https://assets.elementor.com/packages/v1/images/components-properties-intro.png' }
|
|
39
|
+
alt={ '' }
|
|
40
|
+
/>
|
|
41
|
+
<PopoverContent>
|
|
42
|
+
<Stack gap={ 1 } sx={ { p: 2 } }>
|
|
43
|
+
<Typography variant={ 'body2' }>
|
|
44
|
+
{ __( 'Properties make instances flexible.', 'elementor' ) }
|
|
45
|
+
</Typography>
|
|
46
|
+
<Typography variant={ 'body2' }>
|
|
47
|
+
{ __(
|
|
48
|
+
'Click next to any setting you want users to customize - like text, images, or links.',
|
|
49
|
+
'elementor'
|
|
50
|
+
) }
|
|
51
|
+
</Typography>
|
|
52
|
+
<Typography variant={ 'body2' }>
|
|
53
|
+
{ __(
|
|
54
|
+
'Your properties will appear in the Properties panel, where you can organize and manage them anytime.',
|
|
55
|
+
'elementor'
|
|
56
|
+
) }
|
|
57
|
+
</Typography>
|
|
58
|
+
<Stack direction="row" alignItems="center" justifyContent="flex-end">
|
|
59
|
+
<Button size="medium" variant="contained" onClick={ onClose }>
|
|
60
|
+
{ __( 'Got it', 'elementor' ) }
|
|
61
|
+
</Button>
|
|
62
|
+
</Stack>
|
|
63
|
+
</Stack>
|
|
64
|
+
</PopoverContent>
|
|
65
|
+
</Box>
|
|
66
|
+
</Popover>
|
|
67
|
+
);
|
|
68
|
+
};
|