sanity-plugin-media 2.4.2-canary.2 → 3.0.0

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 CHANGED
@@ -2033,7 +2033,6 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
2033
2033
  radius: themeRadius$1,
2034
2034
  space: themeSpace$1
2035
2035
  } = ui.studioTheme, reactSelectStyles$1 = (scheme) => ({
2036
- // @ts-expect-error - fix typings later
2037
2036
  control: (styles, { isDisabled, isFocused }) => {
2038
2037
  let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
2039
2038
  return isFocused && (boxShadow = `inset 0 0 0 1px ${getSchemeColor(scheme, "inputEnabledBorder")},
@@ -2055,7 +2054,6 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
2055
2054
  }
2056
2055
  };
2057
2056
  },
2058
- // @ts-expect-error - fix typings later
2059
2057
  input: (styles) => ({
2060
2058
  ...styles,
2061
2059
  color: "var(--card-fg-color)",
@@ -2063,19 +2061,16 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
2063
2061
  fontSize: themeTextSizes[1].fontSize,
2064
2062
  marginLeft: ui.rem(themeSpace$1[2])
2065
2063
  }),
2066
- // @ts-expect-error - fix typings later
2067
2064
  menuList: (styles) => ({
2068
2065
  ...styles,
2069
2066
  padding: 0
2070
2067
  }),
2071
- // @ts-expect-error - fix typings later
2072
2068
  noOptionsMessage: (styles) => ({
2073
2069
  ...styles,
2074
2070
  fontFamily: ui.studioTheme.fonts.text.family,
2075
2071
  fontSize: themeTextSizes[1].fontSize,
2076
2072
  lineHeight: "1em"
2077
2073
  }),
2078
- // @ts-expect-error - fix typings later
2079
2074
  option: (styles, { isFocused }) => ({
2080
2075
  ...styles,
2081
2076
  backgroundColor: isFocused ? getSchemeColor(scheme, "spotBlue") : "transparent",
@@ -2090,14 +2085,12 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
2090
2085
  color: getSchemeColor(scheme, "bg")
2091
2086
  }
2092
2087
  }),
2093
- // @ts-expect-error - fix typings later
2094
2088
  placeholder: (styles) => ({
2095
2089
  ...styles,
2096
2090
  fontSize: themeTextSizes[1].fontSize,
2097
2091
  marginLeft: ui.rem(themeSpace$1[2]),
2098
2092
  paddingLeft: 0
2099
2093
  }),
2100
- // @ts-expect-error - fix typings later
2101
2094
  singleValue: (styles) => ({
2102
2095
  ...styles,
2103
2096
  alignItems: "center",
@@ -2105,28 +2098,21 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
2105
2098
  height: "100%",
2106
2099
  marginLeft: ui.rem(themeSpace$1[2])
2107
2100
  }),
2108
- // @ts-expect-error - fix typings later
2109
2101
  valueContainer: (styles) => ({
2110
2102
  ...styles,
2111
2103
  margin: 0,
2112
2104
  padding: 0
2113
2105
  })
2114
- }), ClearIndicator = (props) => (
2115
- // @ts-expect-error - fix typings later
2116
- /* @__PURE__ */ jsxRuntime.jsx(Select.components.ClearIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
2117
- ui.Box,
2118
- {
2119
- paddingRight: 1,
2120
- style: {
2121
- transform: "scale(0.85)"
2122
- },
2123
- children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, {}) })
2124
- }
2125
- ) })
2126
- ), Menu$1 = (props) => (
2127
- // @ts-expect-error - fix typings later
2128
- /* @__PURE__ */ jsxRuntime.jsx(Select.components.Menu, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { radius: 1, shadow: 2, children: props.children }) })
2129
- ), MenuList$1 = (props) => {
2106
+ }), ClearIndicator = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.ClearIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
2107
+ ui.Box,
2108
+ {
2109
+ paddingRight: 1,
2110
+ style: {
2111
+ transform: "scale(0.85)"
2112
+ },
2113
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, {}) })
2114
+ }
2115
+ ) }), Menu$1 = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.Menu, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { radius: 1, shadow: 2, children: props.children }) }), MenuList$1 = (props) => {
2130
2116
  const { children } = props, MAX_ROWS = 5, OPTION_HEIGHT = 33;
2131
2117
  if (Array.isArray(children)) {
2132
2118
  const height = children.length > MAX_ROWS ? OPTION_HEIGHT * MAX_ROWS : children.length * OPTION_HEIGHT;
@@ -2144,10 +2130,7 @@ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => style
2144
2130
  );
2145
2131
  }
2146
2132
  return /* @__PURE__ */ jsxRuntime.jsx(Select.components.MenuList, { ...props, children });
2147
- }, NoOptionsMessage = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.NoOptionsMessage, { ...props, children: props.children }), Option$1 = (props) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Select.components.Option, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingY: 1, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, style: { color: "inherit" }, textOverflow: "ellipsis", children: props.children }) }) }) }), SingleValue = (props) => (
2148
- // @ts-expect-error - fix typings later
2149
- /* @__PURE__ */ jsxRuntime.jsx(Select.components.SingleValue, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, textOverflow: "ellipsis", children: props.children }) })
2150
- ), reactSelectComponents$1 = {
2133
+ }, NoOptionsMessage = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.NoOptionsMessage, { ...props, children: props.children }), Option$1 = (props) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Select.components.Option, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingY: 1, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, style: { color: "inherit" }, textOverflow: "ellipsis", children: props.children }) }) }) }), SingleValue = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.SingleValue, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, textOverflow: "ellipsis", children: props.children }) }), reactSelectComponents$1 = {
2151
2134
  ClearIndicator,
2152
2135
  DropdownIndicator: null,
2153
2136
  IndicatorSeparator: null,
@@ -2706,7 +2689,6 @@ const imageDprUrl = (asset, options) => {
2706
2689
  }
2707
2690
  ) : /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { extension: asset.extension, width: "50%" });
2708
2691
  }, { radius: themeRadius, space: themeSpace } = ui.studioTheme, reactSelectStyles = (scheme) => ({
2709
- // @ts-expect-error - fix typings later
2710
2692
  control: (styles, { isFocused }) => {
2711
2693
  let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
2712
2694
  return isFocused && (boxShadow = `inset 0 0 0 1px ${getSchemeColor(scheme, "inputEnabledBorder")},
@@ -2728,12 +2710,10 @@ const imageDprUrl = (asset, options) => {
2728
2710
  }
2729
2711
  };
2730
2712
  },
2731
- // @ts-expect-error - fix typings later
2732
2713
  indicatorsContainer: (styles, { isDisabled }) => ({
2733
2714
  ...styles,
2734
2715
  opacity: isDisabled ? 0.25 : 1
2735
2716
  }),
2736
- // @ts-expect-error - fix typings later
2737
2717
  input: (styles) => ({
2738
2718
  ...styles,
2739
2719
  color: "var(--card-fg-color)",
@@ -2743,7 +2723,6 @@ const imageDprUrl = (asset, options) => {
2743
2723
  menuList: (styles) => ({
2744
2724
  ...styles
2745
2725
  }),
2746
- // @ts-expect-error - fix typings later
2747
2726
  multiValue: (styles, { isDisabled }) => ({
2748
2727
  ...styles,
2749
2728
  backgroundColor: getSchemeColor(scheme, "mutedHoveredBg"),
@@ -2755,7 +2734,6 @@ const imageDprUrl = (asset, options) => {
2755
2734
  fontSize: "inherit",
2756
2735
  padding: 0
2757
2736
  }),
2758
- // @ts-expect-error - fix typings later
2759
2737
  multiValueRemove: (styles) => ({
2760
2738
  ...styles,
2761
2739
  borderTopLeftRadius: 0,
@@ -2765,13 +2743,11 @@ const imageDprUrl = (asset, options) => {
2765
2743
  backgroundColor: getSchemeColor(scheme, "mutedSelectedBg")
2766
2744
  }
2767
2745
  }),
2768
- // @ts-expect-error - fix typings later
2769
2746
  noOptionsMessage: (styles) => ({
2770
2747
  ...styles,
2771
2748
  fontFamily: ui.studioTheme.fonts.text.family,
2772
2749
  lineHeight: "1em"
2773
2750
  }),
2774
- // @ts-expect-error - fix typings later
2775
2751
  option: (styles, { isFocused }) => ({
2776
2752
  ...styles,
2777
2753
  backgroundColor: isFocused ? getSchemeColor(scheme, "spotBlue") : "transparent",
@@ -2783,24 +2759,16 @@ const imageDprUrl = (asset, options) => {
2783
2759
  color: getSchemeColor(scheme, "bg")
2784
2760
  }
2785
2761
  }),
2786
- // @ts-expect-error - fix typings later
2787
2762
  placeholder: (styles) => ({
2788
2763
  ...styles,
2789
2764
  marginLeft: ui.rem(themeSpace[2])
2790
2765
  }),
2791
- // @ts-expect-error - fix typings later
2792
2766
  valueContainer: (styles) => ({
2793
2767
  ...styles,
2794
2768
  margin: 0,
2795
2769
  padding: 0
2796
2770
  })
2797
- }), DropdownIndicator = (props) => (
2798
- // @ts-expect-error - fix typings later
2799
- /* @__PURE__ */ jsxRuntime.jsx(Select.components.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingX: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}) }) }) })
2800
- ), Menu = (props) => (
2801
- // @ts-expect-error - fix typings later
2802
- /* @__PURE__ */ jsxRuntime.jsx(Select.components.Menu, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { radius: 1, shadow: 2, children: props.children }) })
2803
- ), MenuList = (props) => {
2771
+ }), DropdownIndicator = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingX: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}) }) }) }), Menu = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.Menu, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { radius: 1, shadow: 2, children: props.children }) }), MenuList = (props) => {
2804
2772
  const { children } = props, MAX_ROWS = 5, OPTION_HEIGHT = 37;
2805
2773
  if (Array.isArray(children)) {
2806
2774
  const height = children.length > MAX_ROWS ? OPTION_HEIGHT * MAX_ROWS : children.length * OPTION_HEIGHT;
@@ -2818,10 +2786,7 @@ const imageDprUrl = (asset, options) => {
2818
2786
  );
2819
2787
  }
2820
2788
  return /* @__PURE__ */ jsxRuntime.jsx(Select.components.MenuList, { ...props, children });
2821
- }, MultiValueLabel = (props) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 2, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, weight: "medium", children: /* @__PURE__ */ jsxRuntime.jsx(Select.components.MultiValueLabel, { ...props }) }) }), MultiValueRemove = (props) => (
2822
- // @ts-expect-error - fix typings later
2823
- /* @__PURE__ */ jsxRuntime.jsx(Select.components.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { color: "#1f2123" }) })
2824
- ), Option = (props) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Select.components.Option, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: "center", children: [
2789
+ }, MultiValueLabel = (props) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { padding: 2, paddingRight: 1, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, weight: "medium", children: /* @__PURE__ */ jsxRuntime.jsx(Select.components.MultiValueLabel, { ...props }) }) }), MultiValueRemove = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { color: "#1f2123" }) }), Option = (props) => /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Select.components.Option, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: "center", children: [
2825
2790
  props.data.__isNew__ && /* @__PURE__ */ jsxRuntime.jsx(icons.AddIcon, { style: { marginRight: "3px" } }),
2826
2791
  props.children
2827
2792
  ] }) }) }), reactSelectComponents = {