@elementor/editor-controls 4.4.0-1146 → 4.4.0-1148
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 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/svg-media-control.tsx +4 -7
- package/src/controls/svg-media-overlay.tsx +15 -19
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.4.0-
|
|
4
|
+
"version": "4.4.0-1148",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "4.4.0-
|
|
44
|
-
"@elementor/editor-elements": "4.4.0-
|
|
45
|
-
"@elementor/editor-props": "4.4.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.4.0-
|
|
47
|
-
"@elementor/editor-ui": "4.4.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.4.0-
|
|
49
|
-
"@elementor/env": "4.4.0-
|
|
50
|
-
"@elementor/events": "4.4.0-
|
|
51
|
-
"@elementor/http-client": "4.4.0-
|
|
43
|
+
"@elementor/editor-current-user": "4.4.0-1148",
|
|
44
|
+
"@elementor/editor-elements": "4.4.0-1148",
|
|
45
|
+
"@elementor/editor-props": "4.4.0-1148",
|
|
46
|
+
"@elementor/editor-responsive": "4.4.0-1148",
|
|
47
|
+
"@elementor/editor-ui": "4.4.0-1148",
|
|
48
|
+
"@elementor/editor-v1-adapters": "4.4.0-1148",
|
|
49
|
+
"@elementor/env": "4.4.0-1148",
|
|
50
|
+
"@elementor/events": "4.4.0-1148",
|
|
51
|
+
"@elementor/http-client": "4.4.0-1148",
|
|
52
52
|
"@elementor/icons": "~1.78.1",
|
|
53
|
-
"@elementor/locations": "4.4.0-
|
|
54
|
-
"@elementor/query": "4.4.0-
|
|
55
|
-
"@elementor/schema": "4.4.0-
|
|
56
|
-
"@elementor/session": "4.4.0-
|
|
53
|
+
"@elementor/locations": "4.4.0-1148",
|
|
54
|
+
"@elementor/query": "4.4.0-1148",
|
|
55
|
+
"@elementor/schema": "4.4.0-1148",
|
|
56
|
+
"@elementor/session": "4.4.0-1148",
|
|
57
57
|
"@elementor/ui": "1.41.4",
|
|
58
|
-
"@elementor/utils": "4.4.0-
|
|
59
|
-
"@elementor/wp-media": "4.4.0-
|
|
58
|
+
"@elementor/utils": "4.4.0-1148",
|
|
59
|
+
"@elementor/wp-media": "4.4.0-1148",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"@tanstack/react-virtual": "^3.13.3",
|
|
62
62
|
"@tiptap/extension-bold": "^3.11.1",
|
|
@@ -50,11 +50,10 @@ const MODE_BROWSE: OpenOptions = { mode: 'browse' };
|
|
|
50
50
|
const MODE_UPLOAD: OpenOptions = { mode: 'upload' };
|
|
51
51
|
|
|
52
52
|
type SvgMediaControlProps = {
|
|
53
|
-
showIconLibrary?: boolean;
|
|
54
53
|
label?: string;
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
export const SvgMediaControl = createControl( ( {
|
|
56
|
+
export const SvgMediaControl = createControl( ( { label }: SvgMediaControlProps ) => {
|
|
58
57
|
const groupLabel = label ?? __( 'SVG', 'elementor' );
|
|
59
58
|
const { value: svgValue, setValue: setSvgValue, placeholder: svgPlaceholder } = useBoundProp( svgSrcPropTypeUtil );
|
|
60
59
|
const { value: iconValue, setValue: setIconValue, placeholder: iconPlaceholder } = useBoundProp( iconPropTypeUtil );
|
|
@@ -79,10 +78,9 @@ export const SvgMediaControl = createControl( ( { showIconLibrary = false, label
|
|
|
79
78
|
const buttonGroupRef = useRef< HTMLDivElement >( null );
|
|
80
79
|
const [ iconLibraryAnchor, setIconLibraryAnchor ] = useState< IconLibraryAnchor | null >( null );
|
|
81
80
|
const { isAdmin } = useCurrentUserCapabilities();
|
|
82
|
-
const selectedIconClass =
|
|
83
|
-
showIconLibrary && typeof previewIconValue?.value?.value === 'string' ? previewIconValue.value.value : null;
|
|
81
|
+
const selectedIconClass = typeof previewIconValue?.value?.value === 'string' ? previewIconValue.value.value : null;
|
|
84
82
|
const selectedIconLibrary =
|
|
85
|
-
|
|
83
|
+
typeof previewIconValue?.library?.value === 'string' ? previewIconValue.library.value : null;
|
|
86
84
|
|
|
87
85
|
const { open } = useWpMediaFrame( {
|
|
88
86
|
mediaTypes: [ 'svg' ],
|
|
@@ -168,7 +166,7 @@ export const SvgMediaControl = createControl( ( { showIconLibrary = false, label
|
|
|
168
166
|
return (
|
|
169
167
|
<Stack gap={ 1 } aria-label={ __( 'SVG control', 'elementor' ) }>
|
|
170
168
|
<EnableUnfilteredModal open={ unfilteredModalOpenState } onClose={ handleCloseUnfilteredModal } />
|
|
171
|
-
{
|
|
169
|
+
{ iconLibraryAnchor ? (
|
|
172
170
|
<Popover
|
|
173
171
|
disableScrollLock
|
|
174
172
|
open={ iconLibraryPopoverState.isOpen }
|
|
@@ -222,7 +220,6 @@ export const SvgMediaControl = createControl( ( { showIconLibrary = false, label
|
|
|
222
220
|
<SvgMediaOverlay
|
|
223
221
|
label={ groupLabel }
|
|
224
222
|
isAdmin={ isAdmin }
|
|
225
|
-
showIconLibrary={ showIconLibrary }
|
|
226
223
|
buttonGroupRef={ buttonGroupRef }
|
|
227
224
|
onSelectSvg={ handleSelectSvg }
|
|
228
225
|
onUpload={ handleUpload }
|
|
@@ -15,7 +15,6 @@ const ICON_LIBRARY_PADDING = 0.625;
|
|
|
15
15
|
type SvgMediaOverlayProps = {
|
|
16
16
|
label: string;
|
|
17
17
|
isAdmin: boolean;
|
|
18
|
-
showIconLibrary: boolean;
|
|
19
18
|
buttonGroupRef: React.Ref< HTMLDivElement >;
|
|
20
19
|
onSelectSvg: () => void;
|
|
21
20
|
onUpload: () => void;
|
|
@@ -27,7 +26,6 @@ type SvgMediaOverlayProps = {
|
|
|
27
26
|
export const SvgMediaOverlay = ( {
|
|
28
27
|
label,
|
|
29
28
|
isAdmin,
|
|
30
|
-
showIconLibrary,
|
|
31
29
|
buttonGroupRef,
|
|
32
30
|
onSelectSvg,
|
|
33
31
|
onUpload,
|
|
@@ -53,23 +51,21 @@ export const SvgMediaOverlay = ( {
|
|
|
53
51
|
</ConditionalControlInfotip>
|
|
54
52
|
}
|
|
55
53
|
/>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
>
|
|
70
|
-
|
|
71
|
-
</Button>
|
|
72
|
-
) : null }
|
|
54
|
+
<Button
|
|
55
|
+
size="tiny"
|
|
56
|
+
color="inherit"
|
|
57
|
+
variant="text"
|
|
58
|
+
startIcon={ <LibraryIcon sx={ { height: '18px', width: '16px' } } /> }
|
|
59
|
+
aria-label={ __( 'Icon library', 'elementor' ) }
|
|
60
|
+
onClick={ onOpenIconLibrary }
|
|
61
|
+
sx={ {
|
|
62
|
+
height: '28px',
|
|
63
|
+
p: ICON_LIBRARY_PADDING,
|
|
64
|
+
'.MuiButton-icon': { ml: 0 },
|
|
65
|
+
} }
|
|
66
|
+
>
|
|
67
|
+
<Typography>{ __( 'Icon library', 'elementor' ) }</Typography>
|
|
68
|
+
</Button>
|
|
73
69
|
</Stack>
|
|
74
70
|
);
|
|
75
71
|
|