@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/dist/index.js
CHANGED
|
@@ -3977,8 +3977,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
3977
3977
|
const src = attachment?.url ?? url?.value ?? null;
|
|
3978
3978
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
3979
3979
|
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react37.useState)(false);
|
|
3980
|
-
const {
|
|
3981
|
-
const canManageOptions = canUser("manage_options");
|
|
3980
|
+
const { isAdmin } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
3982
3981
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
3983
3982
|
mediaTypes: ["svg"],
|
|
3984
3983
|
multiple: false,
|
|
@@ -4009,7 +4008,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
4009
4008
|
const infotipProps = {
|
|
4010
4009
|
title: (0, import_i18n28.__)("Sorry, you can't upload that file yet.", "elementor"),
|
|
4011
4010
|
description: /* @__PURE__ */ React71.createElement(React71.Fragment, null, (0, import_i18n28.__)("To upload them anyway, ask the site administrator to enable unfiltered", "elementor"), /* @__PURE__ */ React71.createElement("br", null), (0, import_i18n28.__)("file uploads.", "elementor")),
|
|
4012
|
-
isEnabled: !
|
|
4011
|
+
isEnabled: !isAdmin
|
|
4013
4012
|
};
|
|
4014
4013
|
return /* @__PURE__ */ React71.createElement(import_ui56.Stack, { gap: 1, "aria-label": "SVG Control" }, /* @__PURE__ */ React71.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React71.createElement(ControlActions, null, /* @__PURE__ */ React71.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React71.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React71.createElement(import_ui56.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React71.createElement(
|
|
4015
4014
|
import_ui56.CardMedia,
|
|
@@ -4038,15 +4037,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
4038
4037
|
"aria-label": "Select SVG"
|
|
4039
4038
|
},
|
|
4040
4039
|
(0, import_i18n28.__)("Select SVG", "elementor")
|
|
4041
|
-
), /* @__PURE__ */ React71.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ React71.createElement("span", null, /* @__PURE__ */ React71.createElement(import_ui56.ThemeProvider, { colorScheme:
|
|
4040
|
+
), /* @__PURE__ */ React71.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ React71.createElement("span", null, /* @__PURE__ */ React71.createElement(import_ui56.ThemeProvider, { colorScheme: isAdmin ? "light" : "dark" }, /* @__PURE__ */ React71.createElement(
|
|
4042
4041
|
import_ui56.Button,
|
|
4043
4042
|
{
|
|
4044
4043
|
size: "tiny",
|
|
4045
4044
|
variant: "text",
|
|
4046
4045
|
color: "inherit",
|
|
4047
4046
|
startIcon: /* @__PURE__ */ React71.createElement(import_icons18.UploadIcon, null),
|
|
4048
|
-
disabled:
|
|
4049
|
-
onClick: () =>
|
|
4047
|
+
disabled: !isAdmin,
|
|
4048
|
+
onClick: () => isAdmin && handleClick(MODE_UPLOAD),
|
|
4050
4049
|
"aria-label": "Upload SVG"
|
|
4051
4050
|
},
|
|
4052
4051
|
(0, import_i18n28.__)("Upload", "elementor")
|