sanity-plugin-media 2.4.0 → 2.4.2-canary.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.
Files changed (64) hide show
  1. package/dist/index.d.mts +7 -2
  2. package/dist/index.d.ts +7 -2
  3. package/dist/index.js +135 -87
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +110 -61
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +17 -15
  8. package/src/components/AssetGridVirtualized/index.tsx +2 -2
  9. package/src/components/AssetMetadata/index.tsx +1 -1
  10. package/src/components/AssetTableVirtualized/index.tsx +1 -1
  11. package/src/components/Browser/index.tsx +3 -3
  12. package/src/components/ButtonAssetCopy/index.tsx +1 -1
  13. package/src/components/CardAsset/index.tsx +18 -14
  14. package/src/components/CardUpload/index.tsx +3 -4
  15. package/src/components/DialogAssetEdit/index.tsx +3 -3
  16. package/src/components/DialogConfirm/index.tsx +1 -1
  17. package/src/components/DialogSearchFacets/index.tsx +1 -1
  18. package/src/components/DialogTagCreate/index.tsx +1 -1
  19. package/src/components/DialogTagEdit/index.tsx +1 -1
  20. package/src/components/DialogTags/index.tsx +1 -1
  21. package/src/components/Dialogs/index.tsx +1 -1
  22. package/src/components/FileAssetPreview/index.tsx +1 -1
  23. package/src/components/FileIcon/index.tsx +1 -1
  24. package/src/components/FormFieldInputLabel/index.tsx +1 -1
  25. package/src/components/FormFieldInputTags/index.tsx +2 -3
  26. package/src/components/Image/index.tsx +1 -1
  27. package/src/components/PickedBar/index.tsx +2 -3
  28. package/src/components/SearchFacet/index.tsx +10 -5
  29. package/src/components/SearchFacetNumber/index.tsx +1 -1
  30. package/src/components/SearchFacetSelect/index.tsx +1 -1
  31. package/src/components/SearchFacetString/index.tsx +1 -1
  32. package/src/components/SearchFacetTags/index.tsx +4 -5
  33. package/src/components/SearchFacets/index.tsx +1 -1
  34. package/src/components/SearchFacetsControl/index.tsx +1 -1
  35. package/src/components/TableHeader/index.tsx +16 -12
  36. package/src/components/TableRowAsset/index.tsx +8 -4
  37. package/src/components/TableRowUpload/index.tsx +2 -3
  38. package/src/components/Tag/index.tsx +2 -2
  39. package/src/components/TagViewHeader/index.tsx +2 -3
  40. package/src/components/TagsVirtualized/index.tsx +1 -1
  41. package/src/components/UploadDropzone/index.tsx +1 -1
  42. package/src/config/searchFacets.ts +1 -1
  43. package/src/constants.ts +1 -1
  44. package/src/contexts/ToolOptionsContext.tsx +1 -1
  45. package/src/index.ts +1 -1
  46. package/src/modules/assets/index.ts +1 -1
  47. package/src/modules/dialog/index.ts +1 -1
  48. package/src/modules/notifications/index.ts +1 -1
  49. package/src/modules/search/index.ts +1 -1
  50. package/src/modules/selectors.ts +1 -1
  51. package/src/modules/tags/index.ts +1 -1
  52. package/src/modules/uploads/index.ts +1 -1
  53. package/src/operators/checkTagName.ts +1 -1
  54. package/src/plugin.tsx +1 -1
  55. package/src/styled/react-select/creatable.tsx +15 -1
  56. package/src/styled/react-select/single.tsx +14 -1
  57. package/src/types/sanity-ui.d.ts +6 -0
  58. package/src/utils/blocksToText.ts +1 -1
  59. package/src/utils/constructFilter.ts +1 -1
  60. package/src/utils/getAssetResolution.ts +1 -1
  61. package/src/utils/getTagSelectOptions.ts +1 -1
  62. package/src/utils/imageDprUrl.ts +1 -1
  63. package/src/utils/typeGuards.ts +1 -1
  64. package/src/utils/uploadSanityAsset.ts +1 -1
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import {AssetSourceComponentProps} from 'sanity'
2
- import {MediaToolOptions} from '@types'
3
2
  import {Plugin as Plugin_2} from 'sanity'
4
3
  import {default as React_2} from 'react'
5
4
 
@@ -14,6 +13,12 @@ export declare const mediaAssetSource: {
14
13
  title: string
15
14
  }
16
15
 
17
- export {MediaToolOptions}
16
+ export declare type MediaToolOptions = {
17
+ maximumUploadSize?: number
18
+ creditLine: {
19
+ enabled: boolean
20
+ excludeSources?: string | string[]
21
+ }
22
+ }
18
23
 
19
24
  export {}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import {AssetSourceComponentProps} from 'sanity'
2
- import {MediaToolOptions} from '@types'
3
2
  import {Plugin as Plugin_2} from 'sanity'
4
3
  import {default as React_2} from 'react'
5
4
 
@@ -14,6 +13,12 @@ export declare const mediaAssetSource: {
14
13
  title: string
15
14
  }
16
15
 
17
- export {MediaToolOptions}
16
+ export declare type MediaToolOptions = {
17
+ maximumUploadSize?: number
18
+ creditLine: {
19
+ enabled: boolean
20
+ excludeSources?: string | string[]
21
+ }
22
+ }
18
23
 
19
24
  export {}
package/dist/index.js CHANGED
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var jsxRuntime = require("react/jsx-runtime"), sanity = require("sanity"), icons = require("@sanity/icons"), ui = require("@sanity/ui"), react = require("react"), isHotkey = require("is-hotkey"), groq = require("groq"), reactRedux = require("react-redux"), toolkit = require("@reduxjs/toolkit"), nanoid = require("nanoid"), reduxObservable = require("redux-observable"), rxjs = require("rxjs"), operators$1 = require("rxjs/operators"), uuid = require("@sanity/uuid"), styled = require("styled-components"), pluralize = require("pluralize"), reactNprogress = require("@tanem/react-nprogress"), color = require("@sanity/color"), Select = require("react-select"), reactVirtuoso = require("react-virtuoso"), zod = require("@hookform/resolvers/zod"), reactHookForm = require("react-hook-form"), z = require("zod"), format = require("date-fns/format"), filesize = require("filesize"), copy = require("copy-to-clipboard"), router = require("sanity/router"), reactFileIcon = require("react-file-icon"), CreatableSelect = require("react-select/creatable"), formatRelative = require("date-fns/formatRelative"), reactDropzone = require("react-dropzone");
3
+ var jsxRuntime = require("react/jsx-runtime"), sanity = require("sanity"), icons = require("@sanity/icons"), ui = require("@sanity/ui"), react = require("react"), isHotkey = require("is-hotkey"), groq = require("groq"), reactRedux = require("react-redux"), toolkit = require("@reduxjs/toolkit"), nanoid = require("nanoid"), reduxObservable = require("redux-observable"), rxjs = require("rxjs"), operators$1 = require("rxjs/operators"), uuid = require("@sanity/uuid"), styledComponents = require("styled-components"), pluralize = require("pluralize"), reactNprogress = require("@tanem/react-nprogress"), color = require("@sanity/color"), Select = require("react-select"), reactVirtuoso = require("react-virtuoso"), zod = require("@hookform/resolvers/zod"), reactHookForm = require("react-hook-form"), z = require("zod"), format = require("date-fns/format"), filesize = require("filesize"), copy = require("copy-to-clipboard"), router = require("sanity/router"), reactFileIcon = require("react-file-icon"), CreatableSelect = require("react-select/creatable"), formatRelative = require("date-fns/formatRelative"), reactDropzone = require("react-dropzone");
4
4
  function _interopDefaultCompat(e) {
5
5
  return e && typeof e == "object" && "default" in e ? e : { default: e };
6
6
  }
7
7
  function _interopNamespaceCompat(e) {
8
- if (e && typeof e == "object" && "default" in e)
9
- return e;
8
+ if (e && typeof e == "object" && "default" in e) return e;
10
9
  var n = /* @__PURE__ */ Object.create(null);
11
10
  return e && Object.keys(e).forEach(function(k) {
12
11
  if (k !== "default") {
@@ -20,7 +19,7 @@ function _interopNamespaceCompat(e) {
20
19
  }
21
20
  }), n.default = e, Object.freeze(n);
22
21
  }
23
- var isHotkey__default = /* @__PURE__ */ _interopDefaultCompat(isHotkey), groq__default = /* @__PURE__ */ _interopDefaultCompat(groq), styled__default = /* @__PURE__ */ _interopDefaultCompat(styled), pluralize__default = /* @__PURE__ */ _interopDefaultCompat(pluralize), Select__default = /* @__PURE__ */ _interopDefaultCompat(Select), z__namespace = /* @__PURE__ */ _interopNamespaceCompat(z), format__default = /* @__PURE__ */ _interopDefaultCompat(format), filesize__default = /* @__PURE__ */ _interopDefaultCompat(filesize), copy__default = /* @__PURE__ */ _interopDefaultCompat(copy), CreatableSelect__default = /* @__PURE__ */ _interopDefaultCompat(CreatableSelect), formatRelative__default = /* @__PURE__ */ _interopDefaultCompat(formatRelative);
22
+ var isHotkey__default = /* @__PURE__ */ _interopDefaultCompat(isHotkey), groq__default = /* @__PURE__ */ _interopDefaultCompat(groq), pluralize__default = /* @__PURE__ */ _interopDefaultCompat(pluralize), Select__default = /* @__PURE__ */ _interopDefaultCompat(Select), z__namespace = /* @__PURE__ */ _interopNamespaceCompat(z), format__default = /* @__PURE__ */ _interopDefaultCompat(format), filesize__default = /* @__PURE__ */ _interopDefaultCompat(filesize), copy__default = /* @__PURE__ */ _interopDefaultCompat(copy), CreatableSelect__default = /* @__PURE__ */ _interopDefaultCompat(CreatableSelect), formatRelative__default = /* @__PURE__ */ _interopDefaultCompat(formatRelative);
24
23
  const useKeyPress = (hotkey, onPress) => {
25
24
  const keyPressed = react.useRef(!1), downHandler = react.useCallback(
26
25
  (e) => {
@@ -1072,7 +1071,7 @@ const UPLOADS_ACTIONS = {
1072
1071
  },
1073
1072
  fetchComplete(state, action) {
1074
1073
  const assets = action.payload?.assets || [];
1075
- assets.forEach((asset) => {
1074
+ assets && assets.forEach((asset) => {
1076
1075
  state.allIds.includes(asset._id) || state.allIds.push(asset._id), state.byIds[asset._id] = {
1077
1076
  _type: "asset",
1078
1077
  asset,
@@ -1470,7 +1469,7 @@ const UPLOADS_ACTIONS = {
1470
1469
  (assetsPicked) => assetsPicked.length
1471
1470
  ), assetsActions = assetsSlice.actions;
1472
1471
  var assetsReducer = assetsSlice.reducer;
1473
- const customScrollbar = styled.css`
1472
+ const customScrollbar = styledComponents.css`
1474
1473
  ::-webkit-scrollbar {
1475
1474
  width: 14px;
1476
1475
  }
@@ -1486,7 +1485,7 @@ const customScrollbar = styled.css`
1486
1485
  background-clip: padding-box;
1487
1486
  }
1488
1487
  }
1489
- `, GlobalStyle = styled.createGlobalStyle`
1488
+ `, GlobalStyle = styledComponents.createGlobalStyle`
1490
1489
  .media__custom-scrollbar {
1491
1490
  ${customScrollbar}
1492
1491
  }
@@ -1805,29 +1804,36 @@ const OrderSelect = () => {
1805
1804
  function getSchemeColor(scheme, colorKey) {
1806
1805
  return SCHEME_COLORS[colorKey]?.[scheme];
1807
1806
  }
1808
- const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => styled.css`
1807
+ const Container$1 = styledComponents.styled(ui.Box)(({ scheme, theme }) => styledComponents.css`
1809
1808
  background: ${getSchemeColor(scheme, "bg")};
1810
1809
  border-radius: ${ui.rem(theme.sanity.radius[2])};
1811
1810
  `), SearchFacet = (props) => {
1812
- const { children, facet } = props, { scheme } = sanity.useColorScheme(), dispatch = reactRedux.useDispatch(), handleClose = () => {
1811
+ const { children, facet } = props, scheme = sanity.useColorSchemeValue(), dispatch = reactRedux.useDispatch(), handleClose = () => {
1813
1812
  dispatch(searchActions.facetsRemoveById({ facetId: facet.id }));
1814
1813
  };
1815
- return /* @__PURE__ */ jsxRuntime.jsx(Container$1, { padding: [2, 2, 1], scheme, children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: ["flex-start", "flex-start", "center"], direction: ["column", "column", "row"], children: [
1816
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingBottom: [3, 3, 0], paddingLeft: 1, paddingRight: 2, paddingTop: [1, 1, 0], children: /* @__PURE__ */ jsxRuntime.jsx(
1817
- ui.Label,
1818
- {
1819
- size: 0,
1820
- style: {
1821
- whiteSpace: "nowrap"
1822
- },
1823
- children: facet.title
1824
- }
1825
- ) }),
1826
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: "center", children: [
1827
- children,
1828
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { marginLeft: 1, paddingX: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { onClick: handleClose }) }) })
1829
- ] })
1830
- ] }) });
1814
+ return /* @__PURE__ */ jsxRuntime.jsx(
1815
+ Container$1,
1816
+ {
1817
+ padding: [2, 2, 1],
1818
+ scheme,
1819
+ children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: ["flex-start", "flex-start", "center"], direction: ["column", "column", "row"], children: [
1820
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { paddingBottom: [3, 3, 0], paddingLeft: 1, paddingRight: 2, paddingTop: [1, 1, 0], children: /* @__PURE__ */ jsxRuntime.jsx(
1821
+ ui.Label,
1822
+ {
1823
+ size: 0,
1824
+ style: {
1825
+ whiteSpace: "nowrap"
1826
+ },
1827
+ children: facet.title
1828
+ }
1829
+ ) }),
1830
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { align: "center", children: [
1831
+ children,
1832
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { marginLeft: 1, paddingX: 2, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { onClick: handleClose }) }) })
1833
+ ] })
1834
+ ] })
1835
+ }
1836
+ );
1831
1837
  }, TextInputNumber = (props) => {
1832
1838
  const { onValueChange, value, ...remainingProps } = props;
1833
1839
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -2029,6 +2035,7 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2029
2035
  radius: themeRadius$1,
2030
2036
  space: themeSpace$1
2031
2037
  } = ui.studioTheme, reactSelectStyles$1 = (scheme) => ({
2038
+ // @ts-expect-error - fix typings later
2032
2039
  control: (styles, { isDisabled, isFocused }) => {
2033
2040
  let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
2034
2041
  return isFocused && (boxShadow = `inset 0 0 0 1px ${getSchemeColor(scheme, "inputEnabledBorder")},
@@ -2050,6 +2057,7 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2050
2057
  }
2051
2058
  };
2052
2059
  },
2060
+ // @ts-expect-error - fix typings later
2053
2061
  input: (styles) => ({
2054
2062
  ...styles,
2055
2063
  color: "var(--card-fg-color)",
@@ -2057,16 +2065,19 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2057
2065
  fontSize: themeTextSizes[1].fontSize,
2058
2066
  marginLeft: ui.rem(themeSpace$1[2])
2059
2067
  }),
2068
+ // @ts-expect-error - fix typings later
2060
2069
  menuList: (styles) => ({
2061
2070
  ...styles,
2062
2071
  padding: 0
2063
2072
  }),
2073
+ // @ts-expect-error - fix typings later
2064
2074
  noOptionsMessage: (styles) => ({
2065
2075
  ...styles,
2066
2076
  fontFamily: ui.studioTheme.fonts.text.family,
2067
2077
  fontSize: themeTextSizes[1].fontSize,
2068
2078
  lineHeight: "1em"
2069
2079
  }),
2080
+ // @ts-expect-error - fix typings later
2070
2081
  option: (styles, { isFocused }) => ({
2071
2082
  ...styles,
2072
2083
  backgroundColor: isFocused ? getSchemeColor(scheme, "spotBlue") : "transparent",
@@ -2081,12 +2092,14 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2081
2092
  color: getSchemeColor(scheme, "bg")
2082
2093
  }
2083
2094
  }),
2095
+ // @ts-expect-error - fix typings later
2084
2096
  placeholder: (styles) => ({
2085
2097
  ...styles,
2086
2098
  fontSize: themeTextSizes[1].fontSize,
2087
2099
  marginLeft: ui.rem(themeSpace$1[2]),
2088
2100
  paddingLeft: 0
2089
2101
  }),
2102
+ // @ts-expect-error - fix typings later
2090
2103
  singleValue: (styles) => ({
2091
2104
  ...styles,
2092
2105
  alignItems: "center",
@@ -2094,21 +2107,28 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2094
2107
  height: "100%",
2095
2108
  marginLeft: ui.rem(themeSpace$1[2])
2096
2109
  }),
2110
+ // @ts-expect-error - fix typings later
2097
2111
  valueContainer: (styles) => ({
2098
2112
  ...styles,
2099
2113
  margin: 0,
2100
2114
  padding: 0
2101
2115
  })
2102
- }), ClearIndicator = (props) => /* @__PURE__ */ jsxRuntime.jsx(Select.components.ClearIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
2103
- ui.Box,
2104
- {
2105
- paddingRight: 1,
2106
- style: {
2107
- transform: "scale(0.85)"
2108
- },
2109
- children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, {}) })
2110
- }
2111
- ) }), 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) => {
2116
+ }), ClearIndicator = (props) => (
2117
+ // @ts-expect-error - fix typings later
2118
+ /* @__PURE__ */ jsxRuntime.jsx(Select.components.ClearIndicator, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
2119
+ ui.Box,
2120
+ {
2121
+ paddingRight: 1,
2122
+ style: {
2123
+ transform: "scale(0.85)"
2124
+ },
2125
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { muted: !0, size: 0, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, {}) })
2126
+ }
2127
+ ) })
2128
+ ), Menu$1 = (props) => (
2129
+ // @ts-expect-error - fix typings later
2130
+ /* @__PURE__ */ jsxRuntime.jsx(Select.components.Menu, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { radius: 1, shadow: 2, children: props.children }) })
2131
+ ), MenuList$1 = (props) => {
2112
2132
  const { children } = props, MAX_ROWS = 5, OPTION_HEIGHT = 33;
2113
2133
  if (Array.isArray(children)) {
2114
2134
  const height = children.length > MAX_ROWS ? OPTION_HEIGHT * MAX_ROWS : children.length * OPTION_HEIGHT;
@@ -2126,7 +2146,10 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2126
2146
  );
2127
2147
  }
2128
2148
  return /* @__PURE__ */ jsxRuntime.jsx(Select.components.MenuList, { ...props, children });
2129
- }, 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 = {
2149
+ }, 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) => (
2150
+ // @ts-expect-error - fix typings later
2151
+ /* @__PURE__ */ jsxRuntime.jsx(Select.components.SingleValue, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: 1, textOverflow: "ellipsis", children: props.children }) })
2152
+ ), reactSelectComponents$1 = {
2130
2153
  ClearIndicator,
2131
2154
  DropdownIndicator: null,
2132
2155
  IndicatorSeparator: null,
@@ -2136,7 +2159,7 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2136
2159
  Option: Option$1,
2137
2160
  SingleValue
2138
2161
  }, SearchFacetTags = ({ facet }) => {
2139
- const { scheme } = sanity.useColorScheme(), dispatch = reactRedux.useDispatch(), tags = useTypedSelector((state) => selectTags(state)), tagsFetching = useTypedSelector((state) => state.tags.fetching), allTagOptions = getTagSelectOptions(tags), popoverProps = usePortalPopoverProps(), handleChange = (option) => {
2162
+ const scheme = sanity.useColorSchemeValue(), dispatch = reactRedux.useDispatch(), tags = useTypedSelector((state) => selectTags(state)), tagsFetching = useTypedSelector((state) => state.tags.fetching), allTagOptions = getTagSelectOptions(tags), popoverProps = usePortalPopoverProps(), handleChange = (option) => {
2140
2163
  dispatch(
2141
2164
  searchActions.facetsUpdateById({
2142
2165
  id: facet.id,
@@ -2199,7 +2222,7 @@ const Container$1 = styled__default.default(ui.Box)(({ scheme, theme }) => style
2199
2222
  }
2200
2223
  ) })
2201
2224
  ] });
2202
- }, StackContainer = styled__default.default(ui.Flex)(({ theme }) => styled.css`
2225
+ }, StackContainer = styledComponents.styled(ui.Flex)(({ theme }) => styledComponents.css`
2203
2226
  > * {
2204
2227
  margin-bottom: ${ui.rem(theme.sanity.space[2])};
2205
2228
  }
@@ -2537,7 +2560,7 @@ const imageDprUrl = (asset, options) => {
2537
2560
  const val = formData[key];
2538
2561
  return typeof val == "object" && val !== null && val.constructor !== Array ? acc[key] = sanitizeFormData(val) : val === "" || typeof val > "u" || val?.length === 0 ? acc[key] = null : typeof val == "string" && val ? acc[key] = formData[key].trim() : acc[key] = formData[key], acc;
2539
2562
  }, {}), isFileAsset = (asset) => asset._type === "sanity.fileAsset", isImageAsset = (asset) => asset._type === "sanity.imageAsset", getAssetResolution = (asset) => `${asset.metadata.dimensions.width}x${asset.metadata.dimensions.height}px`, ButtonAssetCopy = ({ disabled, url }) => {
2540
- const popoverProps = usePortalPopoverProps(), refPopoverTimeout = react.useRef(), [popoverVisible, setPopoverVisible] = react.useState(!1), handleClick = () => {
2563
+ const popoverProps = usePortalPopoverProps(), refPopoverTimeout = react.useRef(null), [popoverVisible, setPopoverVisible] = react.useState(!1), handleClick = () => {
2541
2564
  refPopoverTimeout.current && clearTimeout(refPopoverTimeout.current), setPopoverVisible(!0), copy__default.default(url), refPopoverTimeout.current = setTimeout(() => {
2542
2565
  setPopoverVisible(!1);
2543
2566
  }, 1250);
@@ -2656,7 +2679,7 @@ const imageDprUrl = (asset, options) => {
2656
2679
  "A document of the unknown type ",
2657
2680
  /* @__PURE__ */ jsxRuntime.jsx("em", { children: doc._type })
2658
2681
  ] }) });
2659
- }, Container = styled__default.default(ui.Box)(({ theme }) => styled.css`
2682
+ }, Container = styledComponents.styled(ui.Box)(({ theme }) => styledComponents.css`
2660
2683
  text {
2661
2684
  font-family: ${theme.sanity.fonts.text.family} !important;
2662
2685
  font-size: 8px !important;
@@ -2685,6 +2708,7 @@ const imageDprUrl = (asset, options) => {
2685
2708
  }
2686
2709
  ) : /* @__PURE__ */ jsxRuntime.jsx(FileIcon, { extension: asset.extension, width: "50%" });
2687
2710
  }, { radius: themeRadius, space: themeSpace } = ui.studioTheme, reactSelectStyles = (scheme) => ({
2711
+ // @ts-expect-error - fix typings later
2688
2712
  control: (styles, { isFocused }) => {
2689
2713
  let boxShadow = "inset 0 0 0 1px var(--card-border-color)";
2690
2714
  return isFocused && (boxShadow = `inset 0 0 0 1px ${getSchemeColor(scheme, "inputEnabledBorder")},
@@ -2706,10 +2730,12 @@ const imageDprUrl = (asset, options) => {
2706
2730
  }
2707
2731
  };
2708
2732
  },
2733
+ // @ts-expect-error - fix typings later
2709
2734
  indicatorsContainer: (styles, { isDisabled }) => ({
2710
2735
  ...styles,
2711
2736
  opacity: isDisabled ? 0.25 : 1
2712
2737
  }),
2738
+ // @ts-expect-error - fix typings later
2713
2739
  input: (styles) => ({
2714
2740
  ...styles,
2715
2741
  color: "var(--card-fg-color)",
@@ -2719,6 +2745,7 @@ const imageDprUrl = (asset, options) => {
2719
2745
  menuList: (styles) => ({
2720
2746
  ...styles
2721
2747
  }),
2748
+ // @ts-expect-error - fix typings later
2722
2749
  multiValue: (styles, { isDisabled }) => ({
2723
2750
  ...styles,
2724
2751
  backgroundColor: getSchemeColor(scheme, "mutedHoveredBg"),
@@ -2730,6 +2757,7 @@ const imageDprUrl = (asset, options) => {
2730
2757
  fontSize: "inherit",
2731
2758
  padding: 0
2732
2759
  }),
2760
+ // @ts-expect-error - fix typings later
2733
2761
  multiValueRemove: (styles) => ({
2734
2762
  ...styles,
2735
2763
  borderTopLeftRadius: 0,
@@ -2739,11 +2767,13 @@ const imageDprUrl = (asset, options) => {
2739
2767
  backgroundColor: getSchemeColor(scheme, "mutedSelectedBg")
2740
2768
  }
2741
2769
  }),
2770
+ // @ts-expect-error - fix typings later
2742
2771
  noOptionsMessage: (styles) => ({
2743
2772
  ...styles,
2744
2773
  fontFamily: ui.studioTheme.fonts.text.family,
2745
2774
  lineHeight: "1em"
2746
2775
  }),
2776
+ // @ts-expect-error - fix typings later
2747
2777
  option: (styles, { isFocused }) => ({
2748
2778
  ...styles,
2749
2779
  backgroundColor: isFocused ? getSchemeColor(scheme, "spotBlue") : "transparent",
@@ -2755,16 +2785,24 @@ const imageDprUrl = (asset, options) => {
2755
2785
  color: getSchemeColor(scheme, "bg")
2756
2786
  }
2757
2787
  }),
2788
+ // @ts-expect-error - fix typings later
2758
2789
  placeholder: (styles) => ({
2759
2790
  ...styles,
2760
2791
  marginLeft: ui.rem(themeSpace[2])
2761
2792
  }),
2793
+ // @ts-expect-error - fix typings later
2762
2794
  valueContainer: (styles) => ({
2763
2795
  ...styles,
2764
2796
  margin: 0,
2765
2797
  padding: 0
2766
2798
  })
2767
- }), 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) => {
2799
+ }), DropdownIndicator = (props) => (
2800
+ // @ts-expect-error - fix typings later
2801
+ /* @__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, {}) }) }) })
2802
+ ), Menu = (props) => (
2803
+ // @ts-expect-error - fix typings later
2804
+ /* @__PURE__ */ jsxRuntime.jsx(Select.components.Menu, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { radius: 1, shadow: 2, children: props.children }) })
2805
+ ), MenuList = (props) => {
2768
2806
  const { children } = props, MAX_ROWS = 5, OPTION_HEIGHT = 37;
2769
2807
  if (Array.isArray(children)) {
2770
2808
  const height = children.length > MAX_ROWS ? OPTION_HEIGHT * MAX_ROWS : children.length * OPTION_HEIGHT;
@@ -2782,7 +2820,10 @@ const imageDprUrl = (asset, options) => {
2782
2820
  );
2783
2821
  }
2784
2822
  return /* @__PURE__ */ jsxRuntime.jsx(Select.components.MenuList, { ...props, children });
2785
- }, 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: [
2823
+ }, 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) => (
2824
+ // @ts-expect-error - fix typings later
2825
+ /* @__PURE__ */ jsxRuntime.jsx(Select.components.MultiValueRemove, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, { color: "#1f2123" }) })
2826
+ ), 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: [
2786
2827
  props.data.__isNew__ && /* @__PURE__ */ jsxRuntime.jsx(icons.AddIcon, { style: { marginRight: "3px" } }),
2787
2828
  props.children
2788
2829
  ] }) }) }), reactSelectComponents = {
@@ -2793,7 +2834,7 @@ const imageDprUrl = (asset, options) => {
2793
2834
  MultiValueLabel,
2794
2835
  MultiValueRemove,
2795
2836
  Option
2796
- }, StyledErrorOutlineIcon = styled__default.default(icons.ErrorOutlineIcon)(({ theme }) => ({
2837
+ }, StyledErrorOutlineIcon = styledComponents.styled(icons.ErrorOutlineIcon)(({ theme }) => ({
2797
2838
  color: theme.sanity.color.spot.red
2798
2839
  })), FormFieldInputLabel = (props) => {
2799
2840
  const { description, error, label, name } = props;
@@ -2828,7 +2869,7 @@ const imageDprUrl = (asset, options) => {
2828
2869
  options,
2829
2870
  placeholder,
2830
2871
  value
2831
- } = props, { scheme } = sanity.useColorScheme(), creating = useTypedSelector((state) => state.tags.creating), tagsFetching = useTypedSelector((state) => state.tags.fetching);
2872
+ } = props, scheme = sanity.useColorSchemeValue(), creating = useTypedSelector((state) => state.tags.creating), tagsFetching = useTypedSelector((state) => state.tags.fetching);
2832
2873
  return /* @__PURE__ */ jsxRuntime.jsxs(
2833
2874
  ui.Box,
2834
2875
  {
@@ -2934,7 +2975,7 @@ const imageDprUrl = (asset, options) => {
2934
2975
  ) })
2935
2976
  }
2936
2977
  );
2937
- }, Image$1 = styled__default.default.img`
2978
+ }, Image$1 = styledComponents.styled.img`
2938
2979
  --checkerboard-color: ${(props) => props.scheme ? getSchemeColor(props.scheme, "bg2") : "inherit"};
2939
2980
 
2940
2981
  display: block;
@@ -2942,7 +2983,7 @@ const imageDprUrl = (asset, options) => {
2942
2983
  height: 100%;
2943
2984
  object-fit: contain;
2944
2985
 
2945
- ${(props) => props.showCheckerboard && styled.css`
2986
+ ${(props) => props.showCheckerboard && styledComponents.css`
2946
2987
  background-image: linear-gradient(45deg, var(--checkerboard-color) 25%, transparent 25%),
2947
2988
  linear-gradient(-45deg, var(--checkerboard-color) 25%, transparent 25%),
2948
2989
  linear-gradient(45deg, transparent 75%, var(--checkerboard-color) 75%),
@@ -2954,7 +2995,7 @@ const imageDprUrl = (asset, options) => {
2954
2995
  const {
2955
2996
  children,
2956
2997
  dialog: { assetId, id, lastCreatedTag, lastRemovedTagIds }
2957
- } = props, client = useVersionedClient(), { scheme } = sanity.useColorScheme(), documentStore = sanity.useDocumentStore(), dispatch = reactRedux.useDispatch(), assetItem = useTypedSelector((state) => selectAssetById(state, String(assetId))), tags = useTypedSelector(selectTags), assetUpdatedPrev = react.useRef(void 0), [assetSnapshot, setAssetSnapshot] = react.useState(assetItem?.asset), [tabSection, setTabSection] = react.useState("details"), currentAsset = assetItem ? assetItem?.asset : assetSnapshot, allTagOptions = getTagSelectOptions(tags), assetTagOptions = useTypedSelector(selectTagSelectOptions(currentAsset)), { creditLine } = useToolOptions(), generateDefaultValues = react.useCallback(
2998
+ } = props, client = useVersionedClient(), scheme = sanity.useColorSchemeValue(), documentStore = sanity.useDocumentStore(), dispatch = reactRedux.useDispatch(), assetItem = useTypedSelector((state) => selectAssetById(state, String(assetId))), tags = useTypedSelector(selectTags), assetUpdatedPrev = react.useRef(void 0), [assetSnapshot, setAssetSnapshot] = react.useState(assetItem?.asset), [tabSection, setTabSection] = react.useState("details"), currentAsset = assetItem ? assetItem?.asset : assetSnapshot, allTagOptions = getTagSelectOptions(tags), assetTagOptions = useTypedSelector(selectTagSelectOptions(currentAsset)), { creditLine } = useToolOptions(), generateDefaultValues = react.useCallback(
2958
2999
  (asset) => ({
2959
3000
  altText: asset?.altText || "",
2960
3001
  creditLine: asset?.creditLine || "",
@@ -3409,9 +3450,9 @@ const imageDprUrl = (asset, options) => {
3409
3450
  ] }),
3410
3451
  children
3411
3452
  ] }) : null;
3412
- }, TagContainer = styled__default.default(ui.Flex)`
3453
+ }, TagContainer = styledComponents.styled(ui.Flex)`
3413
3454
  height: ${PANEL_HEIGHT}px;
3414
- `, ButtonContainer = styled__default.default(ui.Flex)`
3455
+ `, ButtonContainer = styledComponents.styled(ui.Flex)`
3415
3456
  @media (pointer: fine) {
3416
3457
  visibility: hidden;
3417
3458
  }
@@ -3606,7 +3647,7 @@ const imageDprUrl = (asset, options) => {
3606
3647
  }
3607
3648
  );
3608
3649
  }, TagViewHeader = ({ allowCreate, light, title }) => {
3609
- const { scheme } = sanity.useColorScheme(), dispatch = reactRedux.useDispatch(), tagsCreating = useTypedSelector((state) => state.tags.creating), tagsFetching = useTypedSelector((state) => state.tags.fetching), handleTagCreate = () => {
3650
+ const scheme = sanity.useColorSchemeValue(), dispatch = reactRedux.useDispatch(), tagsCreating = useTypedSelector((state) => state.tags.creating), tagsFetching = useTypedSelector((state) => state.tags.fetching), handleTagCreate = () => {
3610
3651
  dispatch(DIALOG_ACTIONS.showTagCreate());
3611
3652
  };
3612
3653
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3765,14 +3806,14 @@ const imageDprUrl = (asset, options) => {
3765
3806
  const assetItems = assetIds.map((id) => ({ id, type: "asset" }));
3766
3807
  return [...uploadIds.map((id) => ({ id, type: "upload" })), ...assetItems];
3767
3808
  }
3768
- ), CardWrapper$1 = styled__default.default(ui.Flex)`
3809
+ ), CardWrapper$1 = styledComponents.styled(ui.Flex)`
3769
3810
  box-sizing: border-box;
3770
3811
  height: 100%;
3771
3812
  overflow: hidden;
3772
3813
  position: relative;
3773
3814
  width: 100%;
3774
- `, CardContainer = styled__default.default(ui.Flex)(
3775
- ({ picked, theme, updating }) => styled.css`
3815
+ `, CardContainer = styledComponents.styled(ui.Flex)(
3816
+ ({ picked, theme, updating }) => styledComponents.css`
3776
3817
  border: 1px solid transparent;
3777
3818
  height: 100%;
3778
3819
  pointer-events: ${updating ? "none" : "auto"};
@@ -3783,7 +3824,7 @@ const imageDprUrl = (asset, options) => {
3783
3824
 
3784
3825
  border: ${picked ? `1px solid ${theme.sanity.color.spot.orange} !important` : "1px solid inherit"};
3785
3826
 
3786
- ${!updating && styled.css`
3827
+ ${!updating && styledComponents.css`
3787
3828
  @media (hover: hover) and (pointer: fine) {
3788
3829
  &:hover {
3789
3830
  border: 1px solid var(--card-border-color);
@@ -3791,19 +3832,22 @@ const imageDprUrl = (asset, options) => {
3791
3832
  }
3792
3833
  `}
3793
3834
  `
3794
- ), ContextActionContainer$2 = styled__default.default(ui.Flex)(({ scheme }) => styled.css`
3795
- cursor: pointer;
3796
- height: ${PANEL_HEIGHT}px;
3797
- transition: all 300ms;
3798
- @media (hover: hover) and (pointer: fine) {
3799
- &:hover {
3800
- background: ${getSchemeColor(scheme, "bg")};
3835
+ ), ContextActionContainer$2 = styledComponents.styled(ui.Flex)(
3836
+ // @ts-expect-error - fix typings later
3837
+ ({ scheme }) => styledComponents.css`
3838
+ cursor: pointer;
3839
+ height: ${PANEL_HEIGHT}px;
3840
+ transition: all 300ms;
3841
+ @media (hover: hover) and (pointer: fine) {
3842
+ &:hover {
3843
+ background: ${getSchemeColor(scheme, "bg")};
3844
+ }
3801
3845
  }
3802
- }
3803
- `), StyledWarningOutlineIcon = styled__default.default(icons.WarningFilledIcon)(({ theme }) => ({
3846
+ `
3847
+ ), StyledWarningOutlineIcon = styledComponents.styled(icons.WarningFilledIcon)(({ theme }) => ({
3804
3848
  color: theme.sanity.color.spot.red
3805
3849
  })), CardAsset = (props) => {
3806
- const { id, selected } = props, { scheme } = sanity.useColorScheme(), shiftPressed = useKeyPress("shift"), dispatch = reactRedux.useDispatch(), lastPicked = useTypedSelector((state) => state.assets.lastPicked), item = useTypedSelector((state) => selectAssetById(state, id)), asset = item?.asset, error = item?.error, isOpaque = item?.asset?.metadata?.isOpaque, picked = item?.picked, updating = item?.updating, { onSelect } = useAssetSourceActions();
3850
+ const { id, selected } = props, scheme = sanity.useColorSchemeValue(), shiftPressed = useKeyPress("shift"), dispatch = reactRedux.useDispatch(), lastPicked = useTypedSelector((state) => state.assets.lastPicked), item = useTypedSelector((state) => selectAssetById(state, id)), asset = item?.asset, error = item?.error, isOpaque = item?.asset?.metadata?.isOpaque, picked = item?.picked, updating = item?.updating, { onSelect } = useAssetSourceActions();
3807
3851
  if (!asset)
3808
3852
  return null;
3809
3853
  const handleAssetClick = (e) => {
@@ -4181,14 +4225,14 @@ toolkit.createSelector(
4181
4225
  );
4182
4226
  const uploadsActions = uploadsSlice.actions;
4183
4227
  var uploadsReducer = uploadsSlice.reducer;
4184
- const CardWrapper = styled__default.default(ui.Flex)`
4228
+ const CardWrapper = styledComponents.styled(ui.Flex)`
4185
4229
  box-sizing: border-box;
4186
4230
  height: 100%;
4187
4231
  overflow: hidden;
4188
4232
  position: relative;
4189
4233
  width: 100%;
4190
4234
  `, CardUpload = (props) => {
4191
- const { id } = props, { scheme } = sanity.useColorScheme(), dispatch = reactRedux.useDispatch(), item = useTypedSelector((state) => selectUploadById(state, id));
4235
+ const { id } = props, scheme = sanity.useColorSchemeValue(), dispatch = reactRedux.useDispatch(), item = useTypedSelector((state) => selectUploadById(state, id));
4192
4236
  if (!item)
4193
4237
  return null;
4194
4238
  const fileSize = filesize__default.default(item.size, { base: 10, round: 0 }), percentLoaded = Math.round(item.percent || 0), isComplete = item.status === "complete", isUploading = item.status === "uploading", isQueued = item.status === "queued";
@@ -4289,10 +4333,10 @@ const CardWrapper = styled__default.default(ui.Flex)`
4289
4333
  ) });
4290
4334
  }, CARD_HEIGHT = 220, CARD_WIDTH = 240, VirtualCell = react.memo(
4291
4335
  ({ item, selected }) => item?.type === "asset" ? /* @__PURE__ */ jsxRuntime.jsx(CardAsset$1, { id: item.id, selected }) : item?.type === "upload" ? /* @__PURE__ */ jsxRuntime.jsx(CardUpload, { id: item.id }) : null
4292
- ), ItemContainer = styled__default.default.div`
4336
+ ), ItemContainer = styledComponents.styled.div`
4293
4337
  height: ${CARD_HEIGHT}px;
4294
4338
  width: ${CARD_WIDTH}px;
4295
- `, ListContainer = styled__default.default.div`
4339
+ `, ListContainer = styledComponents.styled.div`
4296
4340
  display: grid;
4297
4341
  grid-template-columns: repeat(auto-fill, ${CARD_WIDTH}px);
4298
4342
  grid-template-rows: repeat(auto-fill, ${CARD_HEIGHT}px);
@@ -4352,15 +4396,18 @@ const CardWrapper = styled__default.default(ui.Flex)`
4352
4396
  ]
4353
4397
  }
4354
4398
  ) });
4355
- }, ContextActionContainer$1 = styled__default.default(ui.Flex)(({ scheme }) => styled.css`
4356
- cursor: pointer;
4357
- @media (hover: hover) and (pointer: fine) {
4358
- &:hover {
4359
- background: ${getSchemeColor(scheme, "bg")};
4399
+ }, ContextActionContainer$1 = styledComponents.styled(ui.Flex)(
4400
+ // @ts-expect-error - fix typings later
4401
+ ({ scheme }) => styledComponents.css`
4402
+ cursor: pointer;
4403
+ @media (hover: hover) and (pointer: fine) {
4404
+ &:hover {
4405
+ background: ${getSchemeColor(scheme, "bg")};
4406
+ }
4360
4407
  }
4361
- }
4362
- `), TableHeader = () => {
4363
- const { scheme } = sanity.useColorScheme(), dispatch = reactRedux.useDispatch(), fetching = useTypedSelector((state) => state.assets.fetching), itemsLength = useTypedSelector(selectAssetsLength), numPickedAssets = useTypedSelector(selectAssetsPickedLength), mediaIndex = ui.useMediaIndex(), { onSelect } = useAssetSourceActions(), allSelected = numPickedAssets === itemsLength, handleContextActionClick = (e) => {
4408
+ `
4409
+ ), TableHeader = () => {
4410
+ const scheme = sanity.useColorSchemeValue(), dispatch = reactRedux.useDispatch(), fetching = useTypedSelector((state) => state.assets.fetching), itemsLength = useTypedSelector(selectAssetsLength), numPickedAssets = useTypedSelector(selectAssetsPickedLength), mediaIndex = ui.useMediaIndex(), { onSelect } = useAssetSourceActions(), allSelected = numPickedAssets === itemsLength, handleContextActionClick = (e) => {
4364
4411
  e.stopPropagation(), dispatch(allSelected ? assetsActions.pickClear() : assetsActions.pickAll());
4365
4412
  };
4366
4413
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4419,12 +4466,13 @@ const CardWrapper = styled__default.default(ui.Flex)`
4419
4466
  ]
4420
4467
  }
4421
4468
  );
4422
- }, REFERENCE_COUNT_VISIBILITY_DELAY = 750, ContainerGrid = styled__default.default(ui.Grid)(
4469
+ }, REFERENCE_COUNT_VISIBILITY_DELAY = 750, ContainerGrid = styledComponents.styled(ui.Grid)(
4470
+ // @ts-expect-error - fix typings later
4423
4471
  ({
4424
4472
  scheme,
4425
4473
  selected,
4426
4474
  updating
4427
- }) => styled.css`
4475
+ }) => styledComponents.css`
4428
4476
  align-items: center;
4429
4477
  cursor: ${selected ? "default" : "pointer"};
4430
4478
  height: 100%;
@@ -4432,7 +4480,7 @@ const CardWrapper = styled__default.default(ui.Flex)`
4432
4480
  user-select: none;
4433
4481
  white-space: nowrap;
4434
4482
 
4435
- ${!updating && styled.css`
4483
+ ${!updating && styledComponents.css`
4436
4484
  @media (hover: hover) and (pointer: fine) {
4437
4485
  &:hover {
4438
4486
  background: ${getSchemeColor(scheme, "bg")};
@@ -4440,17 +4488,17 @@ const CardWrapper = styled__default.default(ui.Flex)`
4440
4488
  }
4441
4489
  `}
4442
4490
  `
4443
- ), ContextActionContainer = styled__default.default(ui.Flex)(({ scheme }) => styled.css`
4491
+ ), ContextActionContainer = styledComponents.styled(ui.Flex)(({ scheme }) => styledComponents.css`
4444
4492
  cursor: pointer;
4445
4493
  @media (hover: hover) and (pointer: fine) {
4446
4494
  &:hover {
4447
4495
  background: ${getSchemeColor(scheme, "bg2")};
4448
4496
  }
4449
4497
  }
4450
- `), StyledWarningIcon = styled__default.default(icons.WarningFilledIcon)(({ theme }) => ({
4498
+ `), StyledWarningIcon = styledComponents.styled(icons.WarningFilledIcon)(({ theme }) => ({
4451
4499
  color: theme.sanity.color.spot.red
4452
4500
  })), TableRowAsset = (props) => {
4453
- const { id, selected } = props, { scheme } = sanity.useColorScheme(), shiftPressed = useKeyPress("shift"), [referenceCountVisible, setReferenceCountVisible] = react.useState(!1), refCountVisibleTimeout = react.useRef(), dispatch = reactRedux.useDispatch(), lastPicked = useTypedSelector((state) => state.assets.lastPicked), item = useTypedSelector((state) => selectAssetById(state, id)), mediaIndex = ui.useMediaIndex(), asset = item?.asset, error = item?.error, isOpaque = item?.asset?.metadata?.isOpaque, picked = item?.picked, updating = item?.updating, { onSelect } = useAssetSourceActions(), handleContextActionClick = react.useCallback(
4501
+ const { id, selected } = props, scheme = sanity.useColorSchemeValue(), shiftPressed = useKeyPress("shift"), [referenceCountVisible, setReferenceCountVisible] = react.useState(!1), refCountVisibleTimeout = react.useRef(null), dispatch = reactRedux.useDispatch(), lastPicked = useTypedSelector((state) => state.assets.lastPicked), item = useTypedSelector((state) => selectAssetById(state, id)), mediaIndex = ui.useMediaIndex(), asset = item?.asset, error = item?.error, isOpaque = item?.asset?.metadata?.isOpaque, picked = item?.picked, updating = item?.updating, { onSelect } = useAssetSourceActions(), handleContextActionClick = react.useCallback(
4454
4502
  (e) => {
4455
4503
  e.stopPropagation(), asset && (onSelect ? dispatch(dialogActions.showAssetEdit({ assetId: asset._id })) : shiftPressed.current && !picked ? dispatch(assetsActions.pickRange({ startId: lastPicked || asset._id, endId: asset._id })) : dispatch(assetsActions.pick({ assetId: asset._id, picked: !picked })));
4456
4504
  },
@@ -4676,7 +4724,7 @@ const CardWrapper = styled__default.default(ui.Flex)`
4676
4724
  };
4677
4725
  var TableRowAsset$1 = react.memo(TableRowAsset);
4678
4726
  const TableRowUpload = (props) => {
4679
- const { id } = props, { scheme } = sanity.useColorScheme(), dispatch = reactRedux.useDispatch(), item = useTypedSelector((state) => selectUploadById(state, id)), mediaIndex = ui.useMediaIndex();
4727
+ const { id } = props, scheme = sanity.useColorSchemeValue(), dispatch = reactRedux.useDispatch(), item = useTypedSelector((state) => selectUploadById(state, id)), mediaIndex = ui.useMediaIndex();
4680
4728
  if (!item)
4681
4729
  return null;
4682
4730
  const fileSize = filesize__default.default(item.size, { base: 10, round: 0 }), percentLoaded = Math.round(item.percent || 0), isComplete = item.status === "complete", isUploading = item.status === "uploading", isQueued = item.status === "queued";
@@ -4821,7 +4869,7 @@ const TableRowUpload = (props) => {
4821
4869
  }
4822
4870
  }, [items.length]), null;
4823
4871
  }, PickedBar = () => {
4824
- const { scheme } = sanity.useColorScheme(), dispatch = reactRedux.useDispatch(), assetsPicked = useTypedSelector(selectAssetsPicked), handlePickClear = () => {
4872
+ const scheme = sanity.useColorSchemeValue(), dispatch = reactRedux.useDispatch(), assetsPicked = useTypedSelector(selectAssetsPicked), handlePickClear = () => {
4825
4873
  dispatch(assetsActions.pickClear());
4826
4874
  }, handleDeletePicked = () => {
4827
4875
  dispatch(dialogActions.showConfirmDeleteAssets({ assets: assetsPicked }));
@@ -5112,7 +5160,7 @@ const TagsPanel = () => useTypedSelector((state) => state.tags.panelVisible) ? /
5112
5160
  }
5113
5161
  )
5114
5162
  }
5115
- ) : null, UploadContainer = styled__default.default.div`
5163
+ ) : null, UploadContainer = styledComponents.styled.div`
5116
5164
  color: white;
5117
5165
  height: 100%;
5118
5166
  min-height: 100%;
@@ -5123,7 +5171,7 @@ const TagsPanel = () => useTypedSelector((state) => state.tags.panelVisible) ? /
5123
5171
  &:focus {
5124
5172
  outline: none;
5125
5173
  }
5126
- `, DragActiveContainer = styled__default.default.div`
5174
+ `, DragActiveContainer = styledComponents.styled.div`
5127
5175
  align-items: center;
5128
5176
  background: rgba(0, 0, 0, 0.75);
5129
5177
  display: flex;
@@ -5227,7 +5275,7 @@ const UploadDropzone = (props) => {
5227
5275
  ] }) })
5228
5276
  ] }) });
5229
5277
  }, Browser = (props) => {
5230
- const client = useVersionedClient(), { scheme } = sanity.useColorScheme();
5278
+ const client = useVersionedClient(), scheme = sanity.useColorSchemeValue();
5231
5279
  return /* @__PURE__ */ jsxRuntime.jsx(
5232
5280
  ReduxProvider,
5233
5281
  {