@elementor/editor-controls 3.35.0-448 → 3.35.0-450
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.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/svg-media-control.tsx +5 -6
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.35.0-
|
|
4
|
+
"version": "3.35.0-450",
|
|
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": "3.35.0-
|
|
44
|
-
"@elementor/editor-elements": "3.35.0-
|
|
45
|
-
"@elementor/editor-props": "3.35.0-
|
|
46
|
-
"@elementor/editor-responsive": "3.35.0-
|
|
47
|
-
"@elementor/editor-ui": "3.35.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
49
|
-
"@elementor/env": "3.35.0-
|
|
50
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor-current-user": "3.35.0-450",
|
|
44
|
+
"@elementor/editor-elements": "3.35.0-450",
|
|
45
|
+
"@elementor/editor-props": "3.35.0-450",
|
|
46
|
+
"@elementor/editor-responsive": "3.35.0-450",
|
|
47
|
+
"@elementor/editor-ui": "3.35.0-450",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.35.0-450",
|
|
49
|
+
"@elementor/env": "3.35.0-450",
|
|
50
|
+
"@elementor/http-client": "3.35.0-450",
|
|
51
51
|
"@elementor/icons": "^1.63.0",
|
|
52
|
-
"@elementor/locations": "3.35.0-
|
|
53
|
-
"@elementor/mixpanel": "3.35.0-
|
|
54
|
-
"@elementor/query": "3.35.0-
|
|
55
|
-
"@elementor/session": "3.35.0-
|
|
52
|
+
"@elementor/locations": "3.35.0-450",
|
|
53
|
+
"@elementor/mixpanel": "3.35.0-450",
|
|
54
|
+
"@elementor/query": "3.35.0-450",
|
|
55
|
+
"@elementor/session": "3.35.0-450",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "3.35.0-
|
|
58
|
-
"@elementor/wp-media": "3.35.0-
|
|
57
|
+
"@elementor/utils": "3.35.0-450",
|
|
58
|
+
"@elementor/wp-media": "3.35.0-450",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -49,8 +49,7 @@ export const SvgMediaControl = createControl( () => {
|
|
|
49
49
|
const src = attachment?.url ?? url?.value ?? null;
|
|
50
50
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
51
51
|
const [ unfilteredModalOpenState, setUnfilteredModalOpenState ] = useState( false );
|
|
52
|
-
const {
|
|
53
|
-
const canManageOptions = canUser( 'manage_options' );
|
|
52
|
+
const { isAdmin } = useCurrentUserCapabilities();
|
|
54
53
|
|
|
55
54
|
const { open } = useWpMediaFrame( {
|
|
56
55
|
mediaTypes: [ 'svg' ],
|
|
@@ -92,7 +91,7 @@ export const SvgMediaControl = createControl( () => {
|
|
|
92
91
|
{ __( 'file uploads.', 'elementor' ) }
|
|
93
92
|
</>
|
|
94
93
|
),
|
|
95
|
-
isEnabled: !
|
|
94
|
+
isEnabled: ! isAdmin,
|
|
96
95
|
};
|
|
97
96
|
|
|
98
97
|
return (
|
|
@@ -131,14 +130,14 @@ export const SvgMediaControl = createControl( () => {
|
|
|
131
130
|
</Button>
|
|
132
131
|
<ConditionalControlInfotip { ...infotipProps }>
|
|
133
132
|
<span>
|
|
134
|
-
<ThemeProvider colorScheme={
|
|
133
|
+
<ThemeProvider colorScheme={ isAdmin ? 'light' : 'dark' }>
|
|
135
134
|
<Button
|
|
136
135
|
size="tiny"
|
|
137
136
|
variant="text"
|
|
138
137
|
color="inherit"
|
|
139
138
|
startIcon={ <UploadIcon /> }
|
|
140
|
-
disabled={
|
|
141
|
-
onClick={ () =>
|
|
139
|
+
disabled={ ! isAdmin }
|
|
140
|
+
onClick={ () => isAdmin && handleClick( MODE_UPLOAD ) }
|
|
142
141
|
aria-label="Upload SVG"
|
|
143
142
|
>
|
|
144
143
|
{ __( 'Upload', 'elementor' ) }
|