@elementor/editor-editing-panel 1.28.0 → 1.29.1

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.28.0",
3
+ "version": "1.29.1",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@elementor/editor": "0.18.6",
43
- "@elementor/editor-canvas": "0.18.0",
44
- "@elementor/editor-controls": "0.25.0",
43
+ "@elementor/editor-canvas": "0.18.1",
44
+ "@elementor/editor-controls": "0.26.0",
45
45
  "@elementor/editor-current-user": "0.3.0",
46
46
  "@elementor/editor-elements": "0.8.1",
47
47
  "@elementor/editor-panels": "0.14.1",
@@ -23,6 +23,7 @@ export const AddOrRemoveContent = ( { isAdded, label, onAdd, onRemove, children
23
23
  sx={ {
24
24
  justifyContent: 'space-between',
25
25
  alignItems: 'center',
26
+ marginInlineEnd: -0.75,
26
27
  } }
27
28
  >
28
29
  <ControlLabel>{ label }</ControlLabel>
@@ -76,7 +76,7 @@ export function CssClassSelector() {
76
76
  <MultiCombobox
77
77
  id={ ID }
78
78
  size="tiny"
79
- placeholder={ showPlaceholder ? __( 'Type to search/add global classes', 'elementor' ) : undefined }
79
+ placeholder={ showPlaceholder ? __( 'Type class name', 'elementor' ) : undefined }
80
80
  options={ options }
81
81
  selected={ applied }
82
82
  onSelect={ handleApply }
@@ -1,15 +1,6 @@
1
1
  import * as React from 'react';
2
- import { useId, useState } from 'react';
3
- import {
4
- Autocomplete,
5
- type AutocompleteProps,
6
- type AutocompleteRenderGroupParams,
7
- Box,
8
- createFilterOptions,
9
- styled,
10
- TextField,
11
- type Theme,
12
- } from '@elementor/ui';
2
+ import { useState } from 'react';
3
+ import { Autocomplete, type AutocompleteProps, createFilterOptions, TextField, type Theme } from '@elementor/ui';
13
4
 
14
5
  export type Option = {
15
6
  label: string;
@@ -65,7 +56,6 @@ export function MultiCombobox< TOption extends Option >( {
65
56
  disabled={ loading }
66
57
  value={ selected }
67
58
  options={ options }
68
- renderGroup={ ( params ) => <Group { ...params } /> }
69
59
  renderInput={ ( params ) => (
70
60
  <TextField
71
61
  { ...params }
@@ -123,8 +113,8 @@ export function MultiCombobox< TOption extends Option >( {
123
113
  ];
124
114
  } }
125
115
  groupBy={ ( option ) => option.group ?? '' }
126
- renderOption={ ( optionProps, { label } ) => (
127
- <li { ...optionProps } style={ { display: 'block', textOverflow: 'ellipsis' } }>
116
+ renderOption={ ( optionProps, { label, group } ) => (
117
+ <li { ...optionProps } style={ { display: 'block', textOverflow: 'ellipsis' } } data-group={ group }>
128
118
  { label }
129
119
  </li>
130
120
  ) }
@@ -132,34 +122,6 @@ export function MultiCombobox< TOption extends Option >( {
132
122
  );
133
123
  }
134
124
 
135
- const Group = ( params: Omit< AutocompleteRenderGroupParams, 'key' > ) => {
136
- const id = `combobox-group-${ useId().replace( /:/g, '_' ) }`;
137
-
138
- return (
139
- <StyledGroup role="group" aria-labelledby={ id }>
140
- <StyledGroupHeader id={ id }> { params.group }</StyledGroupHeader>
141
- <StyledGroupItems role="listbox">{ params.children }</StyledGroupItems>
142
- </StyledGroup>
143
- );
144
- };
145
-
146
- const StyledGroup = styled( 'li' )`
147
- &:not( :last-of-type ) {
148
- border-bottom: 1px solid ${ ( { theme } ) => theme.palette.divider };
149
- }
150
- `;
151
-
152
- const StyledGroupHeader = styled( Box )( ( { theme } ) => ( {
153
- position: 'sticky',
154
- top: '-8px',
155
- padding: theme.spacing( 1, 2 ),
156
- color: theme.palette.text.tertiary,
157
- } ) );
158
-
159
- const StyledGroupItems = styled( 'ul' )`
160
- padding: 0;
161
- `;
162
-
163
125
  function useFilterOptions< TOption extends Option >() {
164
126
  return useState( () => createFilterOptions< TOption >() )[ 0 ];
165
127
  }