sanity-plugin-media 2.3.1 → 2.4.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 (85) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +23 -0
  3. package/dist/index.d.mts +19 -0
  4. package/dist/index.d.ts +3 -5
  5. package/dist/index.js +4181 -10697
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +5341 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/package.json +18 -24
  10. package/src/components/AssetGridVirtualized/index.tsx +2 -2
  11. package/src/components/AssetMetadata/index.tsx +2 -2
  12. package/src/components/AssetTableVirtualized/index.tsx +2 -2
  13. package/src/components/Browser/index.tsx +2 -2
  14. package/src/components/ButtonAssetCopy/index.tsx +1 -1
  15. package/src/components/CardAsset/index.tsx +3 -3
  16. package/src/components/DebugControls/index.tsx +1 -1
  17. package/src/components/Dialog/index.tsx +1 -1
  18. package/src/components/DialogAssetEdit/index.tsx +22 -3
  19. package/src/components/DialogConfirm/index.tsx +2 -2
  20. package/src/components/DialogSearchFacets/index.tsx +2 -2
  21. package/src/components/DialogTagCreate/index.tsx +3 -3
  22. package/src/components/DialogTagEdit/index.tsx +3 -3
  23. package/src/components/DialogTags/index.tsx +2 -2
  24. package/src/components/Dialogs/index.tsx +1 -1
  25. package/src/components/DocumentList/index.tsx +1 -1
  26. package/src/components/FileAssetPreview/index.tsx +1 -1
  27. package/src/components/FileIcon/index.tsx +2 -2
  28. package/src/components/FormBuilderTool/index.tsx +2 -2
  29. package/src/components/FormFieldInputText/index.tsx +1 -1
  30. package/src/components/FormFieldInputTextarea/index.tsx +1 -1
  31. package/src/components/FormSubmitButton/index.tsx +1 -1
  32. package/src/components/Image/index.tsx +2 -2
  33. package/src/components/Items/index.tsx +1 -1
  34. package/src/components/ReduxProvider/index.tsx +4 -4
  35. package/src/components/SearchFacet/index.tsx +3 -3
  36. package/src/components/SearchFacetNumber/index.tsx +1 -1
  37. package/src/components/SearchFacetSelect/index.tsx +1 -1
  38. package/src/components/SearchFacetString/index.tsx +2 -2
  39. package/src/components/SearchFacetTags/index.tsx +1 -1
  40. package/src/components/SearchFacets/index.tsx +1 -1
  41. package/src/components/SearchFacetsControl/index.tsx +9 -1
  42. package/src/components/TableHeader/index.tsx +2 -2
  43. package/src/components/TableRowAsset/index.tsx +10 -2
  44. package/src/components/Tag/index.tsx +2 -2
  45. package/src/components/TagsVirtualized/index.tsx +2 -2
  46. package/src/components/TextInputNumber/index.tsx +1 -1
  47. package/src/components/TextInputSearch/index.tsx +1 -1
  48. package/src/components/UploadDropzone/index.tsx +2 -2
  49. package/src/config/searchFacets.ts +11 -1
  50. package/src/constants.ts +7 -1
  51. package/src/contexts/AssetSourceDispatchContext.tsx +1 -1
  52. package/src/contexts/DropzoneDispatchContext.tsx +1 -1
  53. package/src/contexts/ToolOptionsContext.tsx +25 -7
  54. package/src/formSchema/index.ts +1 -0
  55. package/src/hooks/useKeyPress.ts +1 -1
  56. package/src/hooks/useOnScreen.ts +1 -1
  57. package/src/hooks/usePortalPopoverProps.ts +1 -1
  58. package/src/hooks/useTypedSelector.ts +2 -2
  59. package/src/modules/assets/actions.ts +1 -1
  60. package/src/modules/assets/index.ts +7 -3
  61. package/src/modules/debug/index.ts +1 -1
  62. package/src/modules/dialog/index.ts +2 -2
  63. package/src/modules/index.ts +3 -3
  64. package/src/modules/notifications/index.ts +1 -1
  65. package/src/modules/search/index.ts +1 -1
  66. package/src/modules/selectors.ts +2 -2
  67. package/src/modules/tags/index.ts +2 -2
  68. package/src/modules/uploads/index.ts +2 -2
  69. package/src/operators/debugThrottle.ts +1 -1
  70. package/src/plugin.tsx +5 -3
  71. package/src/styled/react-select/creatable.tsx +2 -2
  72. package/src/styled/react-select/single.tsx +2 -2
  73. package/src/types/index.ts +8 -2
  74. package/src/utils/blocksToText.ts +1 -1
  75. package/src/utils/constructFilter.ts +2 -2
  76. package/src/utils/getAssetResolution.ts +1 -1
  77. package/src/utils/getSchemeColor.ts +1 -1
  78. package/src/utils/getTagSelectOptions.ts +1 -1
  79. package/src/utils/getUniqueDocuments.ts +1 -1
  80. package/src/utils/imageDprUrl.ts +1 -1
  81. package/src/utils/typeGuards.ts +1 -1
  82. package/src/utils/uploadSanityAsset.ts +1 -1
  83. package/dist/index.cjs.mjs +0 -5
  84. package/dist/index.esm.js +0 -11810
  85. package/dist/index.esm.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  SearchFacetDivider,
3
3
  SearchFacetInputProps,
4
4
  SearchFacetName,
@@ -19,6 +19,16 @@ export const inputs: Record<SearchFacetName, SearchFacetInputProps> = {
19
19
  type: 'string',
20
20
  value: ''
21
21
  },
22
+ creditLine: {
23
+ assetTypes: ['file', 'image'],
24
+ field: 'creditLine',
25
+ name: 'creditLine',
26
+ operatorType: 'empty',
27
+ operatorTypes: ['empty', 'notEmpty', null, 'includes', 'doesNotInclude'],
28
+ title: 'Credit',
29
+ type: 'string',
30
+ value: ''
31
+ },
22
32
  description: {
23
33
  assetTypes: ['file', 'image'],
24
34
  field: 'description',
package/src/constants.ts CHANGED
@@ -1,4 +1,9 @@
1
- import {SearchFacetInputProps, SearchFacetDivider, SearchFacetGroup, OrderDirection} from '@types'
1
+ import type {
2
+ SearchFacetInputProps,
3
+ SearchFacetDivider,
4
+ SearchFacetGroup,
5
+ OrderDirection
6
+ } from '@types'
2
7
  import {divider, inputs} from './config/searchFacets'
3
8
 
4
9
  // Sort order dropdown options
@@ -52,6 +57,7 @@ export const FACETS: (SearchFacetDivider | SearchFacetGroup | SearchFacetInputPr
52
57
  divider,
53
58
  inputs.title,
54
59
  inputs.altText,
60
+ inputs.creditLine,
55
61
  inputs.description,
56
62
  divider,
57
63
  inputs.isOpaque,
@@ -1,4 +1,4 @@
1
- import React, {ReactNode, createContext, useContext} from 'react'
1
+ import {type ReactNode, createContext, useContext} from 'react'
2
2
  import type {AssetSourceComponentProps} from 'sanity'
3
3
 
4
4
  type ContextProps = {
@@ -1,4 +1,4 @@
1
- import React, {ReactNode, createContext, useContext} from 'react'
1
+ import {type ReactNode, createContext, useContext} from 'react'
2
2
 
3
3
  type ContextProps = {
4
4
  open: () => void
@@ -1,9 +1,10 @@
1
- import {MediaToolOptions} from '@types'
2
- import React, {PropsWithChildren, createContext, useContext, useMemo} from 'react'
3
- import {DropzoneOptions} from 'react-dropzone'
1
+ import type {MediaToolOptions} from '@types'
2
+ import {type PropsWithChildren, createContext, useContext, useMemo} from 'react'
3
+ import type {DropzoneOptions} from 'react-dropzone'
4
4
 
5
5
  type ContextProps = {
6
6
  dropzone: Pick<DropzoneOptions, 'maxSize'>
7
+ creditLine: MediaToolOptions['creditLine']
7
8
  }
8
9
 
9
10
  const ToolOptionsContext = createContext<ContextProps | null>(null)
@@ -13,10 +14,27 @@ type Props = {
13
14
  }
14
15
 
15
16
  export const ToolOptionsProvider = ({options, children}: PropsWithChildren<Props>) => {
16
- const value = useMemo<ContextProps>(
17
- () => ({dropzone: {maxSize: options?.maximumUploadSize}}),
18
- [options?.maximumUploadSize]
19
- )
17
+ const value = useMemo<ContextProps>(() => {
18
+ let creditLineExcludeSources
19
+
20
+ if (options?.creditLine?.excludeSources) {
21
+ creditLineExcludeSources = Array.isArray(options?.creditLine?.excludeSources)
22
+ ? options.creditLine.excludeSources
23
+ : [options?.creditLine?.excludeSources]
24
+ }
25
+
26
+ return {
27
+ dropzone: {maxSize: options?.maximumUploadSize},
28
+ creditLine: {
29
+ enabled: options?.creditLine?.enabled || false,
30
+ excludeSources: creditLineExcludeSources
31
+ }
32
+ }
33
+ }, [
34
+ options?.creditLine?.enabled,
35
+ options?.creditLine?.excludeSources,
36
+ options?.maximumUploadSize
37
+ ])
20
38
 
21
39
  return <ToolOptionsContext.Provider value={value}>{children}</ToolOptionsContext.Provider>
22
40
  }
@@ -7,6 +7,7 @@ export const tagOptionSchema = z.object({
7
7
 
8
8
  export const assetFormSchema = z.object({
9
9
  altText: z.string().trim().optional(),
10
+ creditLine: z.string().trim().optional(),
10
11
  description: z.string().trim().optional(),
11
12
  opt: z.object({
12
13
  media: z.object({
@@ -1,5 +1,5 @@
1
1
  import isHotkey from 'is-hotkey'
2
- import {RefObject, useCallback, useEffect, useRef} from 'react'
2
+ import {type RefObject, useCallback, useEffect, useRef} from 'react'
3
3
 
4
4
  const useKeyPress = (hotkey: string, onPress?: () => void): RefObject<boolean> => {
5
5
  const keyPressed = useRef(false)
@@ -1,4 +1,4 @@
1
- import {RefObject, useEffect, useState} from 'react'
1
+ import {type RefObject, useEffect, useState} from 'react'
2
2
 
3
3
  const useOnScreen = (ref: RefObject<HTMLElement>, options = {}, once: boolean) => {
4
4
  const [isIntersecting, setIntersecting] = useState(false)
@@ -1,4 +1,4 @@
1
- import {PopoverProps, usePortal} from '@sanity/ui'
1
+ import {type PopoverProps, usePortal} from '@sanity/ui'
2
2
 
3
3
  export function usePortalPopoverProps(): PopoverProps {
4
4
  const portal = usePortal()
@@ -1,6 +1,6 @@
1
- import {TypedUseSelectorHook, useSelector} from 'react-redux'
1
+ import {type TypedUseSelectorHook, useSelector} from 'react-redux'
2
2
 
3
- import {RootReducerState} from '../modules/types'
3
+ import type {RootReducerState} from '../modules/types'
4
4
 
5
5
  const useTypedSelector: TypedUseSelectorHook<RootReducerState> = useSelector
6
6
 
@@ -1,5 +1,5 @@
1
1
  import {createAction} from '@reduxjs/toolkit'
2
- import {AssetItem, HttpError, Tag} from '../../types'
2
+ import type {AssetItem, HttpError, Tag} from '../../types'
3
3
 
4
4
  export const ASSETS_ACTIONS = {
5
5
  tagsAddComplete: createAction(
@@ -1,6 +1,6 @@
1
- import {createSelector, createSlice, PayloadAction} from '@reduxjs/toolkit'
1
+ import {createSelector, createSlice, type PayloadAction} from '@reduxjs/toolkit'
2
2
  import type {ClientError, Patch, Transaction} from '@sanity/client'
3
- import {
3
+ import type {
4
4
  Asset,
5
5
  AssetItem,
6
6
  AssetType,
@@ -13,7 +13,7 @@ import {
13
13
  } from '@types'
14
14
  import groq from 'groq'
15
15
  import {nanoid} from 'nanoid'
16
- import {Selector} from 'react-redux'
16
+ import type {Selector} from 'react-redux'
17
17
  import {ofType} from 'redux-observable'
18
18
  import {empty, from, of} from 'rxjs'
19
19
  import {
@@ -239,6 +239,7 @@ const assetsSlice = createSlice({
239
239
  _createdAt,
240
240
  _updatedAt,
241
241
  altText,
242
+ creditLine,
242
243
  description,
243
244
  extension,
244
245
  metadata {
@@ -252,6 +253,9 @@ const assetsSlice = createSlice({
252
253
  },
253
254
  originalFilename,
254
255
  size,
256
+ source {
257
+ name
258
+ },
255
259
  title,
256
260
  url
257
261
  } ${pipe} ${sort} ${selector},
@@ -1,4 +1,4 @@
1
- import {PayloadAction, createSlice} from '@reduxjs/toolkit'
1
+ import {type PayloadAction, createSlice} from '@reduxjs/toolkit'
2
2
 
3
3
  type DebugReducerState = {
4
4
  badConnection: boolean
@@ -1,5 +1,5 @@
1
- import {createSlice, PayloadAction} from '@reduxjs/toolkit'
2
- import {AssetItem, Dialog, MyEpic, Tag} from '@types'
1
+ import {createSlice, type PayloadAction} from '@reduxjs/toolkit'
2
+ import type {AssetItem, Dialog, MyEpic, Tag} from '@types'
3
3
  import pluralize from 'pluralize'
4
4
  import {ofType} from 'redux-observable'
5
5
  import {empty, of} from 'rxjs'
@@ -1,7 +1,7 @@
1
1
  import {
2
- ActionFromReducersMapObject,
3
- Reducer,
4
- StateFromReducersMapObject,
2
+ type ActionFromReducersMapObject,
3
+ type Reducer,
4
+ type StateFromReducersMapObject,
5
5
  combineReducers
6
6
  } from '@reduxjs/toolkit'
7
7
  import {combineEpics} from 'redux-observable'
@@ -1,4 +1,4 @@
1
- import {PayloadAction, createSlice} from '@reduxjs/toolkit'
1
+ import {type PayloadAction, createSlice} from '@reduxjs/toolkit'
2
2
  import type {ImageAsset, MyEpic} from '@types'
3
3
  import pluralize from 'pluralize'
4
4
  import {ofType} from 'redux-observable'
@@ -1,4 +1,4 @@
1
- import {PayloadAction, createSelector, createSlice} from '@reduxjs/toolkit'
1
+ import {type PayloadAction, createSelector, createSlice} from '@reduxjs/toolkit'
2
2
  import type {MyEpic, SearchFacetInputProps, SearchFacetOperatorType, WithId} from '@types'
3
3
  import {empty, of} from 'rxjs'
4
4
  import {filter, mergeMap, withLatestFrom} from 'rxjs/operators'
@@ -1,7 +1,7 @@
1
1
  import {createSelector} from '@reduxjs/toolkit'
2
- import {CardAssetData, CardUploadData} from '@types'
2
+ import type {CardAssetData, CardUploadData} from '@types'
3
3
 
4
- import {RootReducerState} from './types'
4
+ import type {RootReducerState} from './types'
5
5
 
6
6
  export const selectCombinedItems = createSelector(
7
7
  [
@@ -1,8 +1,8 @@
1
- import {createSelector, createSlice, PayloadAction} from '@reduxjs/toolkit'
1
+ import {createSelector, createSlice, type PayloadAction} from '@reduxjs/toolkit'
2
2
  import type {ClientError, Transaction} from '@sanity/client'
3
3
  import type {Asset, HttpError, MyEpic, TagSelectOption, Tag, TagItem} from '@types'
4
4
  import groq from 'groq'
5
- import {Selector} from 'react-redux'
5
+ import type {Selector} from 'react-redux'
6
6
  import {ofType} from 'redux-observable'
7
7
  import {from, Observable, of} from 'rxjs'
8
8
  import {bufferTime, catchError, filter, mergeMap, switchMap, withLatestFrom} from 'rxjs/operators'
@@ -1,8 +1,8 @@
1
- import {createSelector, createSlice, PayloadAction} from '@reduxjs/toolkit'
1
+ import {createSelector, createSlice, type PayloadAction} from '@reduxjs/toolkit'
2
2
  import type {ClientError, SanityAssetDocument, SanityImageAssetDocument} from '@sanity/client'
3
3
  import type {HttpError, MyEpic, SanityUploadProgressEvent, UploadItem} from '@types'
4
4
  import groq from 'groq'
5
- import {Selector} from 'react-redux'
5
+ import type {Selector} from 'react-redux'
6
6
  import {empty, merge, of} from 'rxjs'
7
7
  import {catchError, delay, filter, mergeMap, takeUntil, withLatestFrom} from 'rxjs/operators'
8
8
  import constructFilter from '../../utils/constructFilter'
@@ -1,4 +1,4 @@
1
- import {iif, Observable, of, throwError} from 'rxjs'
1
+ import {iif, type Observable, of, throwError} from 'rxjs'
2
2
  import {delay, mergeMap} from 'rxjs/operators'
3
3
 
4
4
  const debugThrottle = (throttled?: boolean) => {
package/src/plugin.tsx CHANGED
@@ -1,10 +1,10 @@
1
1
  import React from 'react'
2
- import {AssetSource, Tool as SanityTool, definePlugin} from 'sanity'
2
+ import {type AssetSource, type Tool as SanityTool, definePlugin} from 'sanity'
3
3
  import {ImageIcon} from '@sanity/icons'
4
4
  import FormBuilderTool from './components/FormBuilderTool'
5
5
  import Tool from './components/Tool'
6
6
  import mediaTag from './schemas/tag'
7
- import {MediaToolOptions} from '@types'
7
+ import type {MediaToolOptions} from '@types'
8
8
  import {ToolOptionsProvider} from './contexts/ToolOptionsContext'
9
9
 
10
10
  const plugin = {
@@ -20,7 +20,9 @@ export const mediaAssetSource = {
20
20
 
21
21
  const tool = {
22
22
  ...plugin,
23
- component: Tool
23
+ component: Tool,
24
+ // @ts-expect-error TS doesn't know about this internal field see https://github.com/sanity-io/sanity/pull/7980
25
+ __internalApplicationType: 'sanity/media'
24
26
  } satisfies SanityTool
25
27
 
26
28
  export const media = definePlugin<MediaToolOptions | void>(options => ({
@@ -1,7 +1,7 @@
1
1
  import {AddIcon, ChevronDownIcon, CloseIcon} from '@sanity/icons'
2
- import {Box, Card, Flex, rem, studioTheme, Text, ThemeColorSchemeKey} from '@sanity/ui'
2
+ import {Box, Card, Flex, rem, studioTheme, Text, type ThemeColorSchemeKey} from '@sanity/ui'
3
3
  import React from 'react'
4
- import {components, StylesConfig} from 'react-select'
4
+ import {components, type StylesConfig} from 'react-select'
5
5
  import {Virtuoso} from 'react-virtuoso'
6
6
  import {getSchemeColor} from '../../utils/getSchemeColor'
7
7
 
@@ -1,7 +1,7 @@
1
1
  import {CloseIcon} from '@sanity/icons'
2
- import {Box, Card, rem, studioTheme, Text, ThemeColorSchemeKey} from '@sanity/ui'
2
+ import {Box, Card, rem, studioTheme, Text, type ThemeColorSchemeKey} from '@sanity/ui'
3
3
  import React from 'react'
4
- import {components, StylesConfig} from 'react-select'
4
+ import {components, type StylesConfig} from 'react-select'
5
5
  import {Virtuoso} from 'react-virtuoso'
6
6
  import {getSchemeColor} from '../../utils/getSchemeColor'
7
7
 
@@ -1,4 +1,4 @@
1
- import {AnyAction} from '@reduxjs/toolkit'
1
+ import type {AnyAction} from '@reduxjs/toolkit'
2
2
  import type {
3
3
  SanityAssetDocument,
4
4
  SanityClient,
@@ -8,10 +8,14 @@ import type {
8
8
  import type {Epic} from 'redux-observable'
9
9
  import * as z from 'zod'
10
10
  import {assetFormSchema, tagFormSchema, tagOptionSchema} from '../formSchema'
11
- import {RootReducerState} from '../modules/types'
11
+ import type {RootReducerState} from '../modules/types'
12
12
 
13
13
  export type MediaToolOptions = {
14
14
  maximumUploadSize?: number
15
+ creditLine: {
16
+ enabled: boolean
17
+ excludeSources?: string | string[]
18
+ }
15
19
  }
16
20
 
17
21
  type CustomFields = {
@@ -152,6 +156,7 @@ export type FileAsset = SanityAssetDocument &
152
156
  export type ImageAsset = SanityImageAssetDocument &
153
157
  CustomFields & {
154
158
  _type: 'sanity.imageAsset'
159
+ creditLine?: string
155
160
  }
156
161
 
157
162
  export type MarkDef = {_key: string; _type: string}
@@ -238,6 +243,7 @@ export type SearchFacetInputStringProps = SearchFacetInputCommon & {
238
243
 
239
244
  export type SearchFacetName =
240
245
  | 'altText'
246
+ | 'creditLine'
241
247
  | 'description'
242
248
  | 'fileName'
243
249
  | 'height'
@@ -1,4 +1,4 @@
1
- import {Block} from '@types'
1
+ import type {Block} from '@types'
2
2
 
3
3
  const defaults = {nonTextBehavior: 'remove'}
4
4
 
@@ -1,4 +1,4 @@
1
- import {AssetType, SearchFacetInputProps} from '@types'
1
+ import type {AssetType, SearchFacetInputProps} from '@types'
2
2
  import groq from 'groq'
3
3
 
4
4
  import {operators} from '../config/searchFacets'
@@ -85,7 +85,7 @@ const constructFilter = ({
85
85
  // references(*[_type == "media.tag" && name.current == "${searchQuery.trim()}"]._id)
86
86
  ...(searchQuery
87
87
  ? [
88
- groq`[_id, altText, assetId, description, originalFilename, title, url] match '*${searchQuery.trim()}*'`
88
+ groq`[_id, altText, assetId, creditLine, description, originalFilename, title, url] match '*${searchQuery.trim()}*'`
89
89
  ]
90
90
  : []),
91
91
  // Search facets
@@ -1,4 +1,4 @@
1
- import {ImageAsset} from '@types'
1
+ import type {ImageAsset} from '@types'
2
2
 
3
3
  const getAssetResolution = (asset: ImageAsset) => {
4
4
  return `${asset.metadata.dimensions.width}x${asset.metadata.dimensions.height}px`
@@ -1,5 +1,5 @@
1
1
  import {hues} from '@sanity/color'
2
- import {ThemeColorSchemeKey, studioTheme} from '@sanity/ui'
2
+ import {type ThemeColorSchemeKey, studioTheme} from '@sanity/ui'
3
3
 
4
4
  const SCHEME_COLORS = {
5
5
  bg: {
@@ -1,4 +1,4 @@
1
- import {TagSelectOption, TagItem} from '@types'
1
+ import type {TagSelectOption, TagItem} from '@types'
2
2
 
3
3
  const getTagSelectOptions = (tags: TagItem[]): TagSelectOption[] => {
4
4
  return tags.reduce((acc: TagSelectOption[], val) => {
@@ -1,4 +1,4 @@
1
- import {SanityDocument} from '@sanity/client'
1
+ import type {SanityDocument} from '@sanity/client'
2
2
 
3
3
  export function getUniqueDocuments(documents: SanityDocument[]): SanityDocument[] {
4
4
  const draftIds = documents.reduce(
@@ -1,4 +1,4 @@
1
- import {ImageAsset} from '@types'
1
+ import type {ImageAsset} from '@types'
2
2
 
3
3
  const imageDprUrl = (
4
4
  asset: ImageAsset,
@@ -1,4 +1,4 @@
1
- import {Asset, FileAsset, ImageAsset} from '@types'
1
+ import type {Asset, FileAsset, ImageAsset} from '@types'
2
2
 
3
3
  export const isFileAsset = (asset: Asset): asset is FileAsset => {
4
4
  return (asset as FileAsset)._type === 'sanity.fileAsset'
@@ -2,7 +2,7 @@
2
2
  // https://github.com/sanity-io/sanity/blob/ccb777e115a8cdf20d81a9a2bc9d8c228568faff/packages/%40sanity/form-builder/src/sanity/inputs/client-adapters/assets.ts
3
3
 
4
4
  import type {SanityAssetDocument, SanityClient, SanityImageAssetDocument} from '@sanity/client'
5
- import {HttpError} from '@types'
5
+ import type {HttpError} from '@types'
6
6
  import {Observable, of, throwError} from 'rxjs'
7
7
  import {map, mergeMap} from 'rxjs/operators'
8
8
  import {withMaxConcurrency} from './withMaxConcurrency'
@@ -1,5 +0,0 @@
1
- import cjs from './index.js';
2
-
3
- export const media = cjs.media;
4
- export const mediaAssetSource = cjs.mediaAssetSource;
5
-