@strapi/upload 5.5.0 → 5.5.1

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.
@@ -39,7 +39,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
39
39
  });
40
40
  };
41
41
  const name$1 = "@strapi/upload";
42
- const version = "5.4.2";
42
+ const version = "5.5.0";
43
43
  const description = "Makes it easy to upload images and files to your Strapi Application.";
44
44
  const license = "SEE LICENSE IN LICENSE";
45
45
  const author = {
@@ -159,7 +159,6 @@ const strapi = {
159
159
  required: true,
160
160
  kind: "plugin"
161
161
  };
162
- const gitHead = "7d785703f52464577d077c4618cbe68b44f8a9cd";
163
162
  const pluginPkg = {
164
163
  name: name$1,
165
164
  version,
@@ -174,8 +173,7 @@ const pluginPkg = {
174
173
  devDependencies,
175
174
  peerDependencies,
176
175
  engines,
177
- strapi,
178
- gitHead
176
+ strapi
179
177
  };
180
178
  const pluginId = pluginPkg.name.replace(/^@strapi\//i, "");
181
179
  const useAssets = ({ skipWhen = false, query = {} } = {}) => {
@@ -1612,11 +1610,17 @@ const RemoveAssetDialog = ({ open, onClose, asset }) => {
1612
1610
  return /* @__PURE__ */ jsx(Dialog.Root, { open, onOpenChange: onClose, children: /* @__PURE__ */ jsx(ConfirmDialog, { onConfirm: handleConfirm }) });
1613
1611
  };
1614
1612
  const CardAsset$1 = styled(Flex)`
1613
+ min-height: 26.4rem;
1615
1614
  border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
1616
- background: linear-gradient(180deg, #ffffff 0%, #f6f6f9 121.48%);
1615
+ background: linear-gradient(
1616
+ 180deg,
1617
+ ${({ theme }) => theme.colors.neutral0} 0%,
1618
+ ${({ theme }) => theme.colors.neutral100} 121.48%
1619
+ );
1617
1620
  `;
1618
1621
  const AssetPreview = React.forwardRef(({ mime, url, name: name2, ...props }, ref) => {
1619
1622
  const theme = useTheme();
1623
+ const { formatMessage } = useIntl();
1620
1624
  if (mime.includes(AssetType.Image)) {
1621
1625
  return /* @__PURE__ */ jsx("img", { ref, src: url, alt: name2, ...props });
1622
1626
  }
@@ -1624,12 +1628,24 @@ const AssetPreview = React.forwardRef(({ mime, url, name: name2, ...props }, ref
1624
1628
  return /* @__PURE__ */ jsx(MuxPlayer, { src: url, accentColor: theme.colors.primary500 });
1625
1629
  }
1626
1630
  if (mime.includes(AssetType.Audio)) {
1627
- return /* @__PURE__ */ jsx("audio", { controls: true, src: url, ref, ...props, children: name2 });
1631
+ return /* @__PURE__ */ jsx(Box, { margin: "5", children: /* @__PURE__ */ jsx("audio", { controls: true, src: url, ref, ...props, children: name2 }) });
1628
1632
  }
1629
1633
  if (mime.includes("pdf")) {
1630
- return /* @__PURE__ */ jsx(CardAsset$1, { justifyContent: "center", ...props, children: /* @__PURE__ */ jsx(FilePdf, { "aria-label": name2 }) });
1634
+ return /* @__PURE__ */ jsx(CardAsset$1, { width: "100%", justifyContent: "center", ...props, children: /* @__PURE__ */ jsxs(Flex, { gap: 2, direction: "column", alignItems: "center", children: [
1635
+ /* @__PURE__ */ jsx(FilePdf, { "aria-label": name2, fill: "neutral500", width: 24, height: 24 }),
1636
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral500", variant: "pi", children: formatMessage({
1637
+ id: "noPreview",
1638
+ defaultMessage: "No preview available"
1639
+ }) })
1640
+ ] }) });
1631
1641
  }
1632
- return /* @__PURE__ */ jsx(CardAsset$1, { justifyContent: "center", ...props, children: /* @__PURE__ */ jsx(File$1, { "aria-label": name2 }) });
1642
+ return /* @__PURE__ */ jsx(CardAsset$1, { width: "100%", justifyContent: "center", ...props, children: /* @__PURE__ */ jsxs(Flex, { gap: 2, direction: "column", alignItems: "center", children: [
1643
+ /* @__PURE__ */ jsx(File$1, { "aria-label": name2, fill: "neutral500", width: 24, height: 24 }),
1644
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral500", variant: "pi", children: formatMessage({
1645
+ id: "noPreview",
1646
+ defaultMessage: "No preview available"
1647
+ }) })
1648
+ ] }) });
1633
1649
  });
1634
1650
  AssetPreview.displayName = "AssetPreview";
1635
1651
  const RelativeBox = styled(Box)`
@@ -1646,8 +1662,7 @@ const Wrapper$1 = styled.div`
1646
1662
  50% / 20px 20px;
1647
1663
 
1648
1664
  svg {
1649
- font-size: 4.8rem;
1650
- height: 26.4rem;
1665
+ height: 26px;
1651
1666
  }
1652
1667
 
1653
1668
  img,
@@ -2765,16 +2780,15 @@ const AudioAssetCard = ({
2765
2780
  selected = false,
2766
2781
  ...restProps
2767
2782
  }) => {
2768
- return /* @__PURE__ */ jsx(AssetCardBase, { name: name2, selected, ...restProps, variant: "Audio", children: /* @__PURE__ */ jsx(CardAsset$2, { size, children: /* @__PURE__ */ jsx(AudioPreviewWrapper$1, { size, children: /* @__PURE__ */ jsx(AudioPreview, { url, alt: name2 }) }) }) });
2783
+ return /* @__PURE__ */ jsx(AssetCardBase, { name: name2, selected, ...restProps, variant: "Audio", children: /* @__PURE__ */ jsx(CardAsset$2, { size, children: /* @__PURE__ */ jsx(Flex, { alignItems: "center", children: /* @__PURE__ */ jsx(AudioPreviewWrapper$1, { size, children: /* @__PURE__ */ jsx(AudioPreview, { url, alt: name2 }) }) }) }) });
2769
2784
  };
2770
- const IconWrapper$1 = styled.span`
2771
- svg {
2772
- font-size: 4.8rem;
2773
- }
2774
- `;
2775
2785
  const CardAsset = styled(Flex)`
2776
2786
  border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
2777
- background: linear-gradient(180deg, #ffffff 0%, #f6f6f9 121.48%);
2787
+ background: linear-gradient(
2788
+ 180deg,
2789
+ ${({ theme }) => theme.colors.neutral0} 0%,
2790
+ ${({ theme }) => theme.colors.neutral100} 121.48%
2791
+ );
2778
2792
  `;
2779
2793
  const DocAssetCard = ({
2780
2794
  name: name2,
@@ -2783,6 +2797,7 @@ const DocAssetCard = ({
2783
2797
  selected = false,
2784
2798
  ...restProps
2785
2799
  }) => {
2800
+ const { formatMessage } = useIntl();
2786
2801
  return /* @__PURE__ */ jsx(
2787
2802
  AssetCardBase,
2788
2803
  {
@@ -2791,7 +2806,13 @@ const DocAssetCard = ({
2791
2806
  selected,
2792
2807
  ...restProps,
2793
2808
  variant: "Doc",
2794
- children: /* @__PURE__ */ jsx(CardAsset, { width: "100%", height: size === "S" ? `8.8rem` : `16.4rem`, justifyContent: "center", children: /* @__PURE__ */ jsx(IconWrapper$1, { children: extension === "pdf" ? /* @__PURE__ */ jsx(FilePdf, { "aria-label": name2 }) : /* @__PURE__ */ jsx(File$1, { "aria-label": name2 }) }) })
2809
+ children: /* @__PURE__ */ jsx(CardAsset, { width: "100%", height: size === "S" ? `8.8rem` : `16.4rem`, justifyContent: "center", children: /* @__PURE__ */ jsxs(Flex, { gap: 2, direction: "column", alignItems: "center", children: [
2810
+ extension === "pdf" ? /* @__PURE__ */ jsx(FilePdf, { "aria-label": name2, fill: "neutral500", width: 24, height: 24 }) : /* @__PURE__ */ jsx(File$1, { "aria-label": name2, fill: "neutral500", width: 24, height: 24 }),
2811
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral500", variant: "pi", children: formatMessage({
2812
+ id: "noPreview",
2813
+ defaultMessage: "No preview available"
2814
+ }) })
2815
+ ] }) })
2795
2816
  }
2796
2817
  );
2797
2818
  };
@@ -6006,7 +6027,7 @@ const admin = {
6006
6027
  defaultMessage: "Media Library"
6007
6028
  },
6008
6029
  permissions: PERMISSIONS.main,
6009
- Component: () => import("./App-CnKRJSFI.mjs").then((mod) => ({ default: mod.Upload })),
6030
+ Component: () => import("./App-YGEZKoYI.mjs").then((mod) => ({ default: mod.Upload })),
6010
6031
  position: 4
6011
6032
  });
6012
6033
  app.addSettingsLink("global", {
@@ -6017,7 +6038,7 @@ const admin = {
6017
6038
  defaultMessage: "Media Library"
6018
6039
  },
6019
6040
  async Component() {
6020
- const { ProtectedSettingsPage } = await import("./SettingsPage-B0kz2mu3.mjs");
6041
+ const { ProtectedSettingsPage } = await import("./SettingsPage-Ca1_e_5V.mjs");
6021
6042
  return { default: ProtectedSettingsPage };
6022
6043
  },
6023
6044
  permissions: PERMISSIONS.settings
@@ -6095,4 +6116,4 @@ export {
6095
6116
  localStorageKeys as y,
6096
6117
  useConfig as z
6097
6118
  };
6098
- //# sourceMappingURL=index-B2N2JGA2.mjs.map
6119
+ //# sourceMappingURL=index-B2-z7eWa.mjs.map