@elementor/editor-editing-panel 1.28.0 → 1.29.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/CHANGELOG.md +14 -0
- package/dist/index.js +3 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/add-or-remove-content.tsx +1 -0
- package/src/components/multi-combobox.tsx +4 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
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.
|
|
44
|
-
"@elementor/editor-controls": "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",
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
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
|
}
|