@elementor/editor-editing-panel 1.16.0 → 1.17.0

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-editing-panel",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,17 +39,17 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "0.18.1",
43
- "@elementor/editor-controls": "0.14.0",
44
- "@elementor/editor-elements": "0.6.0",
45
- "@elementor/editor-panels": "0.12.1",
46
- "@elementor/editor-props": "0.9.3",
47
- "@elementor/editor-responsive": "0.13.1",
48
- "@elementor/editor-styles": "0.6.0",
49
- "@elementor/editor-styles-repository": "0.7.3",
50
- "@elementor/editor-ui": "0.4.0",
51
- "@elementor/editor-v1-adapters": "0.10.1",
52
- "@elementor/icons": "1.31.0",
42
+ "@elementor/editor": "0.18.2",
43
+ "@elementor/editor-controls": "0.15.0",
44
+ "@elementor/editor-elements": "0.6.1",
45
+ "@elementor/editor-panels": "0.12.2",
46
+ "@elementor/editor-props": "0.9.4",
47
+ "@elementor/editor-responsive": "0.13.2",
48
+ "@elementor/editor-styles": "0.6.1",
49
+ "@elementor/editor-styles-repository": "0.7.4",
50
+ "@elementor/editor-ui": "0.4.1",
51
+ "@elementor/editor-v1-adapters": "0.10.2",
52
+ "@elementor/icons": "1.35.0",
53
53
  "@elementor/locations": "0.7.6",
54
54
  "@elementor/menus": "0.1.3",
55
55
  "@elementor/schema": "0.1.2",
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { ControlActionsProvider, ControlReplacementProvider } from '@elementor/editor-controls';
3
3
  import { useSelectedElement } from '@elementor/editor-elements';
4
4
  import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';
5
+ import { RocketIcon } from '@elementor/icons';
5
6
  import { SessionStorageProvider } from '@elementor/session';
6
7
  import { ErrorBoundary } from '@elementor/ui';
7
8
  import { __ } from '@wordpress/i18n';
@@ -32,6 +33,7 @@ export const EditingPanel = () => {
32
33
  <Panel>
33
34
  <PanelHeader>
34
35
  <PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>
36
+ <RocketIcon fontSize="small" sx={ { color: 'text.disabled' } } />
35
37
  </PanelHeader>
36
38
  <PanelBody>
37
39
  <ControlActionsProvider items={ menuItems }>
@@ -60,6 +60,7 @@ export const BorderRadiusField = () => {
60
60
  items={ getCorners( isSiteRtl ) }
61
61
  label={ __( 'Border radius', 'elementor' ) }
62
62
  icon={ <BorderCornersIcon fontSize={ 'tiny' } /> }
63
+ tooltipLabel={ __( 'Adjust corners', 'elementor' ) }
63
64
  multiSizePropTypeUtil={ borderRadiusPropTypeUtil }
64
65
  />
65
66
  </StylesField>
@@ -2,40 +2,49 @@ import * as React from 'react';
2
2
  import { type EqualUnequalItems, EqualUnequalSizesControl } from '@elementor/editor-controls';
3
3
  import { borderWidthPropTypeUtil } from '@elementor/editor-props';
4
4
  import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from '@elementor/icons';
5
+ import { withDirection } from '@elementor/ui';
5
6
  import { __ } from '@wordpress/i18n';
6
7
 
7
8
  import { StylesField } from '../../../controls-registry/styles-field';
9
+ import { useDirection } from '../../../hooks/use-direction';
10
+ import { RotatedIcon } from '../layout-section/utils/rotated-icon';
8
11
 
9
- const edges: EqualUnequalItems = [
12
+ const InlineStartIcon = withDirection( SideRightIcon );
13
+ const InlineEndIcon = withDirection( SideLeftIcon );
14
+
15
+ const getEdges = ( isSiteRtl: boolean ): EqualUnequalItems => [
10
16
  {
11
17
  label: __( 'Top', 'elementor' ),
12
18
  icon: <SideTopIcon fontSize={ 'tiny' } />,
13
- bind: 'top',
19
+ bind: 'block-start',
14
20
  },
15
21
  {
16
- label: __( 'Right', 'elementor' ),
17
- icon: <SideRightIcon fontSize={ 'tiny' } />,
18
- bind: 'right',
22
+ label: isSiteRtl ? __( 'Left', 'elementor' ) : __( 'Right', 'elementor' ),
23
+ icon: <RotatedIcon icon={ InlineStartIcon } size="tiny" />,
24
+ bind: 'inline-end',
19
25
  },
20
26
  {
21
27
  label: __( 'Bottom', 'elementor' ),
22
28
  icon: <SideBottomIcon fontSize={ 'tiny' } />,
23
- bind: 'bottom',
29
+ bind: 'block-end',
24
30
  },
25
31
  {
26
- label: __( 'Left', 'elementor' ),
27
- icon: <SideLeftIcon fontSize={ 'tiny' } />,
28
- bind: 'left',
32
+ label: isSiteRtl ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' ),
33
+ icon: <RotatedIcon icon={ InlineEndIcon } size="tiny" />,
34
+ bind: 'inline-start',
29
35
  },
30
36
  ];
31
37
 
32
38
  export const BorderWidthField = () => {
39
+ const { isSiteRtl } = useDirection();
40
+
33
41
  return (
34
42
  <StylesField bind={ 'border-width' }>
35
43
  <EqualUnequalSizesControl
36
- items={ edges }
44
+ items={ getEdges( isSiteRtl ) }
37
45
  label={ __( 'Border width', 'elementor' ) }
38
46
  icon={ <SideAllIcon fontSize={ 'tiny' } /> }
47
+ tooltipLabel={ __( 'Adjust borders', 'elementor' ) }
39
48
  multiSizePropTypeUtil={ borderWidthPropTypeUtil }
40
49
  />
41
50
  </StylesField>
@@ -1,35 +1,47 @@
1
1
  import * as React from 'react';
2
2
  import { ControlLabel, SizeControl } from '@elementor/editor-controls';
3
3
  import { SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from '@elementor/icons';
4
- import { Grid, Stack } from '@elementor/ui';
4
+ import { Grid, Stack, withDirection } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { useDirection } from '../../../hooks/use-direction';
9
+ import { RotatedIcon } from '../layout-section/utils/rotated-icon';
8
10
 
9
- type Side = 'left' | 'right' | 'top' | 'bottom';
11
+ type Side = 'inset-inline-start' | 'inset-inline-end' | 'inset-block-start' | 'inset-block-end';
12
+
13
+ const InlineStartIcon = withDirection( SideLeftIcon );
14
+ const InlineEndIcon = withDirection( SideRightIcon );
10
15
 
11
16
  const sideIcons = {
12
- left: <SideLeftIcon fontSize={ 'tiny' } />,
13
- right: <SideRightIcon fontSize={ 'tiny' } />,
14
- top: <SideTopIcon fontSize={ 'tiny' } />,
15
- bottom: <SideBottomIcon fontSize={ 'tiny' } />,
17
+ 'inset-block-start': <SideTopIcon fontSize={ 'tiny' } />,
18
+ 'inset-block-end': <SideBottomIcon fontSize={ 'tiny' } />,
19
+ 'inset-inline-start': <RotatedIcon icon={ InlineStartIcon } size="tiny" />,
20
+ 'inset-inline-end': <RotatedIcon icon={ InlineEndIcon } size="tiny" />,
16
21
  };
17
22
 
23
+ const getInlineStartLabel = ( isSiteRtl: boolean ) =>
24
+ isSiteRtl ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' );
25
+
26
+ const getInlineEndLabel = ( isSiteRtl: boolean ) =>
27
+ isSiteRtl ? __( 'Left', 'elementor' ) : __( 'Right', 'elementor' );
28
+
18
29
  export const DimensionsField = () => {
30
+ const { isSiteRtl } = useDirection();
31
+
19
32
  return (
20
33
  <>
21
34
  <Stack direction="row" gap={ 2 } flexWrap="nowrap">
22
- <DimensionField side="top" label={ __( 'Top', 'elementor' ) } />
23
- <DimensionField side="right" label={ __( 'Right', 'elementor' ) } />
35
+ <DimensionField side="inset-block-start" label={ __( 'Top', 'elementor' ) } />
36
+ <DimensionField side="inset-inline-start" label={ getInlineStartLabel( isSiteRtl ) } />
24
37
  </Stack>
25
38
  <Stack direction="row" gap={ 2 } flexWrap="nowrap">
26
- <DimensionField side="bottom" label={ __( 'Bottom', 'elementor' ) } />
27
- <DimensionField side="left" label={ __( 'Left', 'elementor' ) } />
39
+ <DimensionField side="inset-block-end" label={ __( 'Bottom', 'elementor' ) } />
40
+ <DimensionField side="inset-inline-end" label={ getInlineEndLabel( isSiteRtl ) } />
28
41
  </Stack>
29
42
  </>
30
43
  );
31
44
  };
32
-
33
45
  const DimensionField = ( { side, label }: { side: Side; label: string } ) => {
34
46
  return (
35
47
  <Grid container gap={ 1 } alignItems="center">
@@ -19,19 +19,19 @@ type DimensionValue =
19
19
  | null;
20
20
 
21
21
  type DimensionsValues = {
22
- top: DimensionValue;
23
- bottom: DimensionValue;
24
- left: DimensionValue;
25
- right: DimensionValue;
22
+ 'inset-block-start': DimensionValue;
23
+ 'inset-block-end': DimensionValue;
24
+ 'inset-inline-start': DimensionValue;
25
+ 'inset-inline-end': DimensionValue;
26
26
  };
27
27
 
28
28
  export const PositionSection = () => {
29
29
  const [ positionValue ] = useStylesField< StringPropValue >( 'position' );
30
30
  const [ dimensionsValues, setDimensionsValues ] = useStylesFields< DimensionsValues >( [
31
- 'top',
32
- 'bottom',
33
- 'left',
34
- 'right',
31
+ 'inset-block-start',
32
+ 'inset-block-end',
33
+ 'inset-inline-start',
34
+ 'inset-inline-end',
35
35
  ] );
36
36
 
37
37
  const [ dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory ] = usePersistDimensions();
@@ -41,10 +41,10 @@ export const PositionSection = () => {
41
41
  if ( dimensionsValues ) {
42
42
  updateDimensionsHistory( dimensionsValues );
43
43
  setDimensionsValues( {
44
- top: undefined,
45
- bottom: undefined,
46
- left: undefined,
47
- right: undefined,
44
+ 'inset-block-start': undefined,
45
+ 'inset-block-end': undefined,
46
+ 'inset-inline-start': undefined,
47
+ 'inset-inline-end': undefined,
48
48
  } );
49
49
  }
50
50
  } else if ( previousPosition === 'static' ) {
@@ -3,18 +3,25 @@ import { LinkedDimensionsControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
5
  import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { useDirection } from '../../../hooks/use-direction';
6
7
  import { PanelDivider } from '../../panel-divider';
7
8
  import { SectionContent } from '../../section-content';
8
9
 
9
10
  export const SpacingSection = () => {
11
+ const { isSiteRtl } = useDirection();
12
+
10
13
  return (
11
14
  <SectionContent>
12
15
  <StylesField bind={ 'padding' }>
13
- <LinkedDimensionsControl label={ __( 'Padding', 'elementor' ) } />
16
+ <LinkedDimensionsControl label={ __( 'Padding', 'elementor' ) } isSiteRtl={ isSiteRtl } />
14
17
  </StylesField>
15
18
  <PanelDivider />
16
19
  <StylesField bind={ 'margin' }>
17
- <LinkedDimensionsControl label={ __( 'Margin', 'elementor' ) } extendedValues={ [ 'auto' ] } />
20
+ <LinkedDimensionsControl
21
+ label={ __( 'Margin', 'elementor' ) }
22
+ isSiteRtl={ isSiteRtl }
23
+ extendedValues={ [ 'auto' ] }
24
+ />
18
25
  </StylesField>
19
26
  </SectionContent>
20
27
  );
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { useMemo } from 'react';
2
3
  import { ControlLabel, FontFamilyControl } from '@elementor/editor-controls';
3
4
  import { Grid } from '@elementor/ui';
4
5
  import { __ } from '@wordpress/i18n';
@@ -6,10 +7,16 @@ import { __ } from '@wordpress/i18n';
6
7
  import { StylesField } from '../../../controls-registry/styles-field';
7
8
  import { getElementorConfig } from '../../../sync/get-elementor-config';
8
9
 
10
+ const supportedCategories: Record< string, string > = {
11
+ system: __( 'System', 'elementor' ),
12
+ custom: __( 'Custom Fonts', 'elementor' ),
13
+ googlefonts: __( 'Google Fonts', 'elementor' ),
14
+ };
15
+
9
16
  export const FontFamilyField = () => {
10
- const fontFamilies = getFontFamilies();
17
+ const fontFamilies = useFontFamilies();
11
18
 
12
- if ( ! fontFamilies ) {
19
+ if ( Object.keys( fontFamilies ).length === 0 ) {
13
20
  return null;
14
21
  }
15
22
 
@@ -38,3 +45,28 @@ const getFontFamilies = () => {
38
45
 
39
46
  return options;
40
47
  };
48
+
49
+ const useFontFamilies = () => {
50
+ const fontFamilies = getFontFamilies();
51
+
52
+ return useMemo(
53
+ () =>
54
+ Object.entries( fontFamilies || {} ).reduce< Record< string, string[] > >( ( acc, [ font, category ] ) => {
55
+ const categoryLabel = supportedCategories[ category as keyof typeof supportedCategories ];
56
+ const existingCategory = acc[ categoryLabel ];
57
+
58
+ if ( ! categoryLabel ) {
59
+ return acc;
60
+ }
61
+
62
+ if ( ! existingCategory ) {
63
+ acc[ categoryLabel ] = [];
64
+ }
65
+
66
+ acc[ categoryLabel ].push( font );
67
+
68
+ return acc;
69
+ }, {} ),
70
+ [ fontFamilies ]
71
+ );
72
+ };
@@ -11,13 +11,15 @@ type Direction = 'ltr' | 'rtl';
11
11
  const options: ToggleButtonGroupItem< Direction >[] = [
12
12
  {
13
13
  value: 'ltr',
14
- label: __( 'Left to Right', 'elementor' ),
14
+ label: __( 'Left to right', 'elementor' ),
15
15
  renderContent: ( { size } ) => <TextDirectionLtrIcon fontSize={ size } />,
16
+ showTooltip: true,
16
17
  },
17
18
  {
18
19
  value: 'rtl',
19
- label: __( 'Right to Left', 'elementor' ),
20
+ label: __( 'Right to left', 'elementor' ),
20
21
  renderContent: ( { size } ) => <TextDirectionRtlIcon fontSize={ size } />,
22
+ showTooltip: true,
21
23
  },
22
24
  ];
23
25
 
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Fragment, useState } from 'react';
3
3
  import { useBoundProp } from '@elementor/editor-controls';
4
- import { PhotoIcon, SearchIcon } from '@elementor/icons';
4
+ import { DatabaseIcon, SearchIcon } from '@elementor/icons';
5
5
  import {
6
6
  Box,
7
7
  Divider,
@@ -16,7 +16,6 @@ import {
16
16
  } from '@elementor/ui';
17
17
  import { __ } from '@wordpress/i18n';
18
18
 
19
- import { PopoverContent } from '../../components/popover-content';
20
19
  import { usePersistDynamicValue } from '../../hooks/use-persist-dynamic-value';
21
20
  import { usePropDynamicTags } from '../hooks/use-prop-dynamic-tags';
22
21
  import { getAtomicDynamicTags } from '../sync/get-atomic-dynamic-tags';
@@ -109,26 +108,34 @@ export const DynamicSelection = ( { onSelect }: DynamicSelectionProps ) => {
109
108
  ) ) }
110
109
  </MenuList>
111
110
  ) : (
112
- <PopoverContent alignItems="center" p={ 2.5 }>
113
- <PhotoIcon fontSize="large" />
114
- <Typography align="center" variant="caption" color="text.secondary">
111
+ <Stack
112
+ gap={ 1 }
113
+ alignItems="center"
114
+ justifyContent="center"
115
+ height="100%"
116
+ p={ 2.5 }
117
+ color="text.secondary"
118
+ sx={ { pb: 3.5 } }
119
+ >
120
+ <DatabaseIcon fontSize="large" />
121
+ <Typography align="center" variant="subtitle2">
115
122
  { __( 'Sorry, nothing matched', 'elementor' ) }
116
123
  <br />
117
124
  &ldquo;{ searchValue }&rdquo;.
118
125
  </Typography>
119
- <Typography align="center" variant="caption" color="text.secondary">
126
+ <Typography align="center" variant="caption">
127
+ { __( 'Try something else.', 'elementor' ) }
128
+ &nbsp;
120
129
  <Link
121
- color="secondary"
130
+ color="text.secondary"
122
131
  variant="caption"
123
132
  component="button"
124
133
  onClick={ () => setSearchValue( '' ) }
125
134
  >
126
- { __( 'Clear the filters', 'elementor' ) }
135
+ { __( 'Clear & try again', 'elementor' ) }
127
136
  </Link>
128
- &nbsp;
129
- { __( 'and try again.', 'elementor' ) }
130
137
  </Typography>
131
- </PopoverContent>
138
+ </Stack>
132
139
  ) }
133
140
  </Box>
134
141
  </Stack>