@elementor/editor-controls 4.0.0-533 → 4.0.0-535
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +29 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/control-toggle-button-group.tsx +33 -23
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": "4.0.0-
|
|
4
|
+
"version": "4.0.0-535",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "4.0.0-
|
|
44
|
-
"@elementor/editor-elements": "4.0.0-
|
|
45
|
-
"@elementor/editor-props": "4.0.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.0.0-
|
|
47
|
-
"@elementor/editor-ui": "4.0.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.0.0-
|
|
49
|
-
"@elementor/env": "4.0.0-
|
|
50
|
-
"@elementor/http-client": "4.0.0-
|
|
43
|
+
"@elementor/editor-current-user": "4.0.0-535",
|
|
44
|
+
"@elementor/editor-elements": "4.0.0-535",
|
|
45
|
+
"@elementor/editor-props": "4.0.0-535",
|
|
46
|
+
"@elementor/editor-responsive": "4.0.0-535",
|
|
47
|
+
"@elementor/editor-ui": "4.0.0-535",
|
|
48
|
+
"@elementor/editor-v1-adapters": "4.0.0-535",
|
|
49
|
+
"@elementor/env": "4.0.0-535",
|
|
50
|
+
"@elementor/http-client": "4.0.0-535",
|
|
51
51
|
"@elementor/icons": "^1.63.0",
|
|
52
|
-
"@elementor/locations": "4.0.0-
|
|
53
|
-
"@elementor/mixpanel": "4.0.0-
|
|
54
|
-
"@elementor/query": "4.0.0-
|
|
55
|
-
"@elementor/session": "4.0.0-
|
|
52
|
+
"@elementor/locations": "4.0.0-535",
|
|
53
|
+
"@elementor/mixpanel": "4.0.0-535",
|
|
54
|
+
"@elementor/query": "4.0.0-535",
|
|
55
|
+
"@elementor/session": "4.0.0-535",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "4.0.0-
|
|
58
|
-
"@elementor/wp-media": "4.0.0-
|
|
57
|
+
"@elementor/utils": "4.0.0-535",
|
|
58
|
+
"@elementor/wp-media": "4.0.0-535",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -21,6 +21,7 @@ type RenderContentProps = { size: ToggleButtonProps[ 'size' ] };
|
|
|
21
21
|
|
|
22
22
|
export type ToggleButtonGroupItem< TValue > = {
|
|
23
23
|
value: TValue;
|
|
24
|
+
disabled?: boolean;
|
|
24
25
|
label: string;
|
|
25
26
|
renderContent: ( { size }: RenderContentProps ) => React.ReactNode;
|
|
26
27
|
showTooltip?: boolean;
|
|
@@ -165,30 +166,39 @@ export const ToggleButtonGroupUi = React.forwardRef(
|
|
|
165
166
|
width: `100%`,
|
|
166
167
|
} }
|
|
167
168
|
>
|
|
168
|
-
{ fixedItems.map(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
169
|
+
{ fixedItems.map(
|
|
170
|
+
( {
|
|
171
|
+
label,
|
|
172
|
+
value: buttonValue,
|
|
173
|
+
renderContent: Content,
|
|
174
|
+
showTooltip,
|
|
175
|
+
disabled: optionDisabled = false,
|
|
176
|
+
} ) => {
|
|
177
|
+
const isPlaceholder =
|
|
178
|
+
placeholderArray.length > 0 &&
|
|
179
|
+
placeholderArray.includes( buttonValue as string ) &&
|
|
180
|
+
( shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder );
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<ConditionalTooltip
|
|
184
|
+
key={ buttonValue as string }
|
|
185
|
+
label={ label }
|
|
186
|
+
showTooltip={ showTooltip || false }
|
|
186
187
|
>
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
<StyledToggleButton
|
|
189
|
+
value={ buttonValue }
|
|
190
|
+
aria-label={ label }
|
|
191
|
+
size={ size }
|
|
192
|
+
fullWidth={ fullWidth }
|
|
193
|
+
isPlaceholder={ isPlaceholder }
|
|
194
|
+
disabled={ optionDisabled }
|
|
195
|
+
>
|
|
196
|
+
<Content size={ size } />
|
|
197
|
+
</StyledToggleButton>
|
|
198
|
+
</ConditionalTooltip>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
) }
|
|
192
202
|
|
|
193
203
|
{ menuItems.length && exclusive && (
|
|
194
204
|
<SplitButtonGroup
|