@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.mjs CHANGED
@@ -3930,8 +3930,7 @@ var SvgMediaControl = createControl(() => {
3930
3930
  const src = attachment?.url ?? url?.value ?? null;
3931
3931
  const { data: allowSvgUpload } = useUnfilteredFilesUpload();
3932
3932
  const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState15(false);
3933
- const { canUser } = useCurrentUserCapabilities();
3934
- const canManageOptions = canUser("manage_options");
3933
+ const { isAdmin } = useCurrentUserCapabilities();
3935
3934
  const { open } = useWpMediaFrame2({
3936
3935
  mediaTypes: ["svg"],
3937
3936
  multiple: false,
@@ -3962,7 +3961,7 @@ var SvgMediaControl = createControl(() => {
3962
3961
  const infotipProps = {
3963
3962
  title: __28("Sorry, you can't upload that file yet.", "elementor"),
3964
3963
  description: /* @__PURE__ */ React71.createElement(React71.Fragment, null, __28("To upload them anyway, ask the site administrator to enable unfiltered", "elementor"), /* @__PURE__ */ React71.createElement("br", null), __28("file uploads.", "elementor")),
3965
- isEnabled: !canManageOptions
3964
+ isEnabled: !isAdmin
3966
3965
  };
3967
3966
  return /* @__PURE__ */ React71.createElement(Stack13, { 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(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React71.createElement(
3968
3967
  CardMedia2,
@@ -3991,15 +3990,15 @@ var SvgMediaControl = createControl(() => {
3991
3990
  "aria-label": "Select SVG"
3992
3991
  },
3993
3992
  __28("Select SVG", "elementor")
3994
- ), /* @__PURE__ */ React71.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ React71.createElement("span", null, /* @__PURE__ */ React71.createElement(ThemeProvider, { colorScheme: canManageOptions ? "light" : "dark" }, /* @__PURE__ */ React71.createElement(
3993
+ ), /* @__PURE__ */ React71.createElement(ConditionalControlInfotip, { ...infotipProps }, /* @__PURE__ */ React71.createElement("span", null, /* @__PURE__ */ React71.createElement(ThemeProvider, { colorScheme: isAdmin ? "light" : "dark" }, /* @__PURE__ */ React71.createElement(
3995
3994
  Button4,
3996
3995
  {
3997
3996
  size: "tiny",
3998
3997
  variant: "text",
3999
3998
  color: "inherit",
4000
3999
  startIcon: /* @__PURE__ */ React71.createElement(UploadIcon2, null),
4001
- disabled: canManageOptions ? false : true,
4002
- onClick: () => canManageOptions && handleClick(MODE_UPLOAD),
4000
+ disabled: !isAdmin,
4001
+ onClick: () => isAdmin && handleClick(MODE_UPLOAD),
4003
4002
  "aria-label": "Upload SVG"
4004
4003
  },
4005
4004
  __28("Upload", "elementor")