@elementor/editor-controls 3.32.0-90 → 3.32.0-91

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-controls",
3
3
  "description": "This package contains the controls model and utils for the Elementor editor",
4
- "version": "3.32.0-90",
4
+ "version": "3.32.0-91",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,21 +40,21 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "3.32.0-90",
44
- "@elementor/editor-elements": "3.32.0-90",
45
- "@elementor/editor-props": "3.32.0-90",
46
- "@elementor/editor-responsive": "3.32.0-90",
47
- "@elementor/editor-ui": "3.32.0-90",
48
- "@elementor/editor-v1-adapters": "3.32.0-90",
49
- "@elementor/env": "3.32.0-90",
50
- "@elementor/http-client": "3.32.0-90",
43
+ "@elementor/editor-current-user": "3.32.0-91",
44
+ "@elementor/editor-elements": "3.32.0-91",
45
+ "@elementor/editor-props": "3.32.0-91",
46
+ "@elementor/editor-responsive": "3.32.0-91",
47
+ "@elementor/editor-ui": "3.32.0-91",
48
+ "@elementor/editor-v1-adapters": "3.32.0-91",
49
+ "@elementor/env": "3.32.0-91",
50
+ "@elementor/http-client": "3.32.0-91",
51
51
  "@elementor/icons": "^1.51.1",
52
- "@elementor/locations": "3.32.0-90",
53
- "@elementor/query": "3.32.0-90",
54
- "@elementor/session": "3.32.0-90",
52
+ "@elementor/locations": "3.32.0-91",
53
+ "@elementor/query": "3.32.0-91",
54
+ "@elementor/session": "3.32.0-91",
55
55
  "@elementor/ui": "1.36.8",
56
- "@elementor/utils": "3.32.0-90",
57
- "@elementor/wp-media": "3.32.0-90",
56
+ "@elementor/utils": "3.32.0-91",
57
+ "@elementor/wp-media": "3.32.0-91",
58
58
  "@wordpress/i18n": "^5.13.0",
59
59
  "@monaco-editor/react": "^4.7.0"
60
60
  },
@@ -1,14 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { type PropsWithChildren } from 'react';
3
- import { Stack } from '@elementor/ui';
3
+ import { type FormLabelProps, Stack } from '@elementor/ui';
4
4
 
5
5
  import { ControlAdornments } from '../control-adornments/control-adornments';
6
6
  import { ControlFormLabel } from './control-form-label';
7
7
 
8
- export const ControlLabel = ( { children }: PropsWithChildren< object > ) => {
8
+ type ControlLabelProps = FormLabelProps & PropsWithChildren< object >;
9
+
10
+ export const ControlLabel = ( { children, ...props }: ControlLabelProps ) => {
9
11
  return (
10
12
  <Stack direction="row" alignItems="center" justifyItems="start" gap={ 0.25 }>
11
- <ControlFormLabel>{ children }</ControlFormLabel>
13
+ <ControlFormLabel { ...props }>{ children }</ControlFormLabel>
12
14
  <ControlAdornments />
13
15
  </Stack>
14
16
  );
@@ -21,6 +21,7 @@ type SizeInputProps = {
21
21
  popupState: PopupState;
22
22
  disabled?: boolean;
23
23
  min?: number;
24
+ id?: string;
24
25
  };
25
26
 
26
27
  export const SizeInput = ( {
@@ -37,6 +38,7 @@ export const SizeInput = ( {
37
38
  popupState,
38
39
  disabled,
39
40
  min,
41
+ id,
40
42
  }: SizeInputProps ) => {
41
43
  const unitInputBufferRef = useRef( '' );
42
44
  const inputType = isUnitExtendedOption( unit ) ? 'text' : 'number';
@@ -115,6 +117,7 @@ export const SizeInput = ( {
115
117
  InputProps={ InputProps }
116
118
  inputProps={ { min, step: 'any' } }
117
119
  isPopoverOpen={ popupState.isOpen }
120
+ id={ id }
118
121
  />
119
122
  </Box>
120
123
  </ControlActions>
@@ -31,6 +31,7 @@ type TextFieldInnerSelectionProps = {
31
31
  inputProps?: TextFieldProps[ 'inputProps' ];
32
32
  disabled?: boolean;
33
33
  isPopoverOpen?: boolean;
34
+ id?: string;
34
35
  };
35
36
 
36
37
  export const TextFieldInnerSelection = forwardRef(
@@ -47,6 +48,7 @@ export const TextFieldInnerSelection = forwardRef(
47
48
  inputProps,
48
49
  disabled,
49
50
  isPopoverOpen,
51
+ id,
50
52
  }: TextFieldInnerSelectionProps,
51
53
  ref
52
54
  ) => {
@@ -73,6 +75,7 @@ export const TextFieldInnerSelection = forwardRef(
73
75
  placeholder={ placeholder ?? ( String( boundPropPlaceholder?.size ?? '' ) || undefined ) }
74
76
  InputProps={ InputProps }
75
77
  inputProps={ inputProps }
78
+ id={ id }
76
79
  />
77
80
  );
78
81
  }
@@ -11,6 +11,7 @@ import {
11
11
  UnstableSortableProvider,
12
12
  type UnstableSortableProviderProps,
13
13
  } from '@elementor/ui';
14
+ import { __ } from '@wordpress/i18n';
14
15
 
15
16
  export const SortableProvider = < T extends number >( props: UnstableSortableProviderProps< T > ) => {
16
17
  return (
@@ -40,7 +41,7 @@ export const SortableItem = ( { id, children, disabled }: SortableItemProps ): R
40
41
  dropIndicationStyle,
41
42
  }: UnstableSortableItemRenderProps ) => {
42
43
  return (
43
- <StyledListItem { ...itemProps } style={ itemStyle }>
44
+ <StyledListItem { ...itemProps } style={ itemStyle } tabIndex={ -1 }>
44
45
  { ! disabled && <SortableTrigger { ...triggerProps } style={ triggerStyle } /> }
45
46
  { children }
46
47
  { showDropIndication && <StyledDivider style={ dropIndicationStyle } /> }
@@ -74,7 +75,8 @@ const StyledListItem = styled( ListItem )`
74
75
  box-shadow: ${ ( { theme } ) => theme.shadows[ 3 ] };
75
76
  }
76
77
 
77
- &:hover {
78
+ &:hover,
79
+ &:focus-within {
78
80
  & .class-item-sortable-trigger {
79
81
  visibility: visible;
80
82
  }
@@ -82,7 +84,13 @@ const StyledListItem = styled( ListItem )`
82
84
  `;
83
85
 
84
86
  const SortableTrigger = ( props: React.HTMLAttributes< HTMLDivElement > ) => (
85
- <div { ...props } role="button" className="class-item-sortable-trigger">
87
+ <div
88
+ { ...props }
89
+ role="button"
90
+ className="class-item-sortable-trigger"
91
+ tabIndex={ 0 }
92
+ aria-label={ __( 'Drag item', 'elementor' ) }
93
+ >
86
94
  <GripVerticalIcon fontSize="tiny" />
87
95
  </div>
88
96
  );
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { PlusIcon } from '@elementor/icons';
3
3
  import { Box, IconButton, Infotip } from '@elementor/ui';
4
- import { __ } from '@wordpress/i18n';
4
+ import { __, sprintf } from '@wordpress/i18n';
5
5
 
6
6
  import { useRepeaterContext } from '../context/repeater-context';
7
7
 
@@ -12,6 +12,7 @@ export type TooltipAddItemActionProps = {
12
12
  enableTooltip?: boolean;
13
13
  tooltipContent?: React.ReactNode;
14
14
  newItemIndex?: number;
15
+ ariaLabel?: string;
15
16
  };
16
17
 
17
18
  export const TooltipAddItemAction = ( {
@@ -19,6 +20,7 @@ export const TooltipAddItemAction = ( {
19
20
  enableTooltip = false,
20
21
  tooltipContent = null,
21
22
  newItemIndex,
23
+ ariaLabel,
22
24
  }: TooltipAddItemActionProps ) => {
23
25
  const { addItem } = useRepeaterContext();
24
26
 
@@ -31,7 +33,8 @@ export const TooltipAddItemAction = ( {
31
33
  size={ SIZE }
32
34
  disabled={ disabled }
33
35
  onClick={ onClick }
34
- aria-label={ __( 'Add item', 'elementor' ) }
36
+ /* Translators: %s: Aria label. */
37
+ aria-label={ sprintf( __( 'Add %s item', 'elementor' ), ariaLabel?.toLowerCase() ) }
35
38
  >
36
39
  <PlusIcon fontSize={ SIZE } />
37
40
  </IconButton>
@@ -56,21 +56,29 @@ export const FilterRepeaterControl = createControl( ( { filterPropName = 'filter
56
56
  <Repeater
57
57
  propTypeUtil={ propTypeUtil as PropTypeUtil< string, RepeatablePropValue[] > }
58
58
  label={ label }
59
+ filterPropName={ filterPropName }
59
60
  />
60
61
  </PropProvider>
61
62
  </FilterConfigProvider>
62
63
  );
63
64
  } );
64
65
 
65
- type RepeaterProps = { propTypeUtil: PropTypeUtil< string, RepeatablePropValue[] >; label: string };
66
+ type RepeaterProps = {
67
+ propTypeUtil: PropTypeUtil< string, RepeatablePropValue[] >;
68
+ label: string;
69
+ filterPropName: string;
70
+ };
66
71
 
67
- const Repeater = ( { propTypeUtil, label }: RepeaterProps ) => {
72
+ const Repeater = ( { propTypeUtil, label, filterPropName }: RepeaterProps ) => {
68
73
  const { getInitialValue } = useFilterConfig();
69
74
 
70
75
  return (
71
76
  <UnstableRepeater initial={ getInitialValue() as RepeatablePropValue } propTypeUtil={ propTypeUtil }>
72
77
  <Header label={ label }>
73
- <TooltipAddItemAction newItemIndex={ 0 } />
78
+ <TooltipAddItemAction
79
+ newItemIndex={ 0 }
80
+ ariaLabel={ filterPropName === 'backdrop-filter' ? 'backdrop filter' : 'filter' }
81
+ />
74
82
  </Header>
75
83
  <ItemsContainer itemTemplate={ <Item Label={ FilterLabel } Icon={ FilterIcon } /> }>
76
84
  <DuplicateItemAction />
@@ -79,7 +79,11 @@ export const RepeatableControl = createControl(
79
79
  propTypeUtil={ childArrayPropTypeUtil as CollectionPropUtil< RepeatablePropValue > }
80
80
  >
81
81
  <Header label={ repeaterLabel }>
82
- <TooltipAddItemAction { ...addItemTooltipProps } newItemIndex={ 0 } />
82
+ <TooltipAddItemAction
83
+ { ...addItemTooltipProps }
84
+ newItemIndex={ 0 }
85
+ ariaLabel={ repeaterLabel }
86
+ />
83
87
  </Header>
84
88
  <ItemsContainer
85
89
  isSortable={ false }
@@ -41,6 +41,7 @@ type BaseSizeControlProps = {
41
41
  anchorRef?: RefObject< HTMLDivElement | null >;
42
42
  min?: number;
43
43
  enablePropTypeUnits?: boolean;
44
+ id?: string;
44
45
  };
45
46
 
46
47
  type LengthSizeControlProps = BaseSizeControlProps &
@@ -90,6 +91,7 @@ export const SizeControl = createControl(
90
91
  disableCustom,
91
92
  min = 0,
92
93
  enablePropTypeUnits = false,
94
+ id,
93
95
  }: Omit< SizeControlProps, 'variant' > & { variant?: SizeVariant } ) => {
94
96
  const {
95
97
  value: sizeValue,
@@ -219,6 +221,7 @@ export const SizeControl = createControl(
219
221
  onClick={ onInputClick }
220
222
  popupState={ popupState }
221
223
  min={ min }
224
+ id={ id }
222
225
  />
223
226
  { anchorRef?.current && popupState.isOpen && (
224
227
  <TextFieldPopover
@@ -18,11 +18,12 @@ type TransformAxisRowProps = {
18
18
  };
19
19
 
20
20
  export const AxisRow = ( { label, bind, startIcon, anchorRef, units, variant = 'angle' }: TransformAxisRowProps ) => {
21
+ const safeId = label.replace( /\s+/g, '-' ).toLowerCase();
21
22
  return (
22
23
  <Grid item xs={ 12 }>
23
24
  <PopoverGridContainer ref={ anchorRef }>
24
25
  <Grid item xs={ 6 }>
25
- <ControlLabel>{ label }</ControlLabel>
26
+ <ControlLabel htmlFor={ safeId }>{ label }</ControlLabel>
26
27
  </Grid>
27
28
  <Grid item xs={ 6 }>
28
29
  <PropKeyProvider bind={ bind }>
@@ -32,6 +33,7 @@ export const AxisRow = ( { label, bind, startIcon, anchorRef, units, variant = '
32
33
  units={ units }
33
34
  variant={ variant }
34
35
  min={ -Number.MAX_SAFE_INTEGER }
36
+ id={ safeId }
35
37
  />
36
38
  </PropKeyProvider>
37
39
  </Grid>
@@ -89,6 +89,7 @@ const Repeater = ( { headerRef, propType }: { headerRef: React.RefObject< HTMLDi
89
89
  disabled={ shouldDisableAddItem }
90
90
  tooltipContent={ ToolTip }
91
91
  enableTooltip={ shouldDisableAddItem }
92
+ ariaLabel={ 'transform' }
92
93
  />
93
94
  </Header>
94
95
  <ItemsContainer itemTemplate={ <Item Icon={ TransformIcon } Label={ TransformLabel } /> }>