@elementor/editor-controls 4.1.0-736 → 4.1.0-738
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 +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/svg-media-control.tsx +5 -4
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.1.0-
|
|
4
|
+
"version": "4.1.0-738",
|
|
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.1.0-
|
|
44
|
-
"@elementor/editor-elements": "4.1.0-
|
|
45
|
-
"@elementor/editor-props": "4.1.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.1.0-
|
|
47
|
-
"@elementor/editor-ui": "4.1.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.1.0-
|
|
49
|
-
"@elementor/env": "4.1.0-
|
|
50
|
-
"@elementor/http-client": "4.1.0-
|
|
43
|
+
"@elementor/editor-current-user": "4.1.0-738",
|
|
44
|
+
"@elementor/editor-elements": "4.1.0-738",
|
|
45
|
+
"@elementor/editor-props": "4.1.0-738",
|
|
46
|
+
"@elementor/editor-responsive": "4.1.0-738",
|
|
47
|
+
"@elementor/editor-ui": "4.1.0-738",
|
|
48
|
+
"@elementor/editor-v1-adapters": "4.1.0-738",
|
|
49
|
+
"@elementor/env": "4.1.0-738",
|
|
50
|
+
"@elementor/http-client": "4.1.0-738",
|
|
51
51
|
"@elementor/icons": "^1.68.0",
|
|
52
|
-
"@elementor/locations": "4.1.0-
|
|
53
|
-
"@elementor/events": "4.1.0-
|
|
54
|
-
"@elementor/query": "4.1.0-
|
|
55
|
-
"@elementor/session": "4.1.0-
|
|
52
|
+
"@elementor/locations": "4.1.0-738",
|
|
53
|
+
"@elementor/events": "4.1.0-738",
|
|
54
|
+
"@elementor/query": "4.1.0-738",
|
|
55
|
+
"@elementor/session": "4.1.0-738",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "4.1.0-
|
|
58
|
-
"@elementor/wp-media": "4.1.0-
|
|
57
|
+
"@elementor/utils": "4.1.0-738",
|
|
58
|
+
"@elementor/wp-media": "4.1.0-738",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useCurrentUserCapabilities } from '@elementor/editor-current-user';
|
|
4
|
-
import {
|
|
4
|
+
import { svgSrcPropTypeUtil, urlPropTypeUtil } from '@elementor/editor-props';
|
|
5
5
|
import { UploadIcon } from '@elementor/icons';
|
|
6
6
|
import { Button, Card, CardMedia, CardOverlay, CircularProgress, Stack, styled, ThemeProvider } from '@elementor/ui';
|
|
7
7
|
import { type OpenOptions, useWpMediaAttachment, useWpMediaFrame } from '@elementor/wp-media';
|
|
@@ -43,8 +43,9 @@ const MODE_BROWSE: OpenOptions = { mode: 'browse' };
|
|
|
43
43
|
const MODE_UPLOAD: OpenOptions = { mode: 'upload' };
|
|
44
44
|
|
|
45
45
|
export const SvgMediaControl = createControl( () => {
|
|
46
|
-
const { value, setValue } = useBoundProp(
|
|
47
|
-
const
|
|
46
|
+
const { value, setValue } = useBoundProp( svgSrcPropTypeUtil );
|
|
47
|
+
const id = value?.id;
|
|
48
|
+
const url = value?.url;
|
|
48
49
|
const { data: attachment, isFetching } = useWpMediaAttachment( id?.value || null );
|
|
49
50
|
const src = attachment?.url ?? url?.value ?? null;
|
|
50
51
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
@@ -61,7 +62,7 @@ export const SvgMediaControl = createControl( () => {
|
|
|
61
62
|
$$type: 'image-attachment-id',
|
|
62
63
|
value: selectedAttachment.id,
|
|
63
64
|
},
|
|
64
|
-
url:
|
|
65
|
+
url: urlPropTypeUtil.create( selectedAttachment.url ),
|
|
65
66
|
} );
|
|
66
67
|
},
|
|
67
68
|
} );
|