sanity-plugin-media 2.4.0 → 2.4.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.
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +92 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/AssetGridVirtualized/index.tsx +3 -2
- package/src/components/AssetMetadata/index.tsx +1 -1
- package/src/components/AssetTableVirtualized/index.tsx +1 -1
- package/src/components/Browser/index.tsx +1 -1
- package/src/components/CardAsset/index.tsx +16 -12
- package/src/components/CardUpload/index.tsx +1 -1
- package/src/components/DialogAssetEdit/index.tsx +1 -1
- package/src/components/DialogConfirm/index.tsx +1 -1
- package/src/components/DialogSearchFacets/index.tsx +1 -1
- package/src/components/DialogTagCreate/index.tsx +1 -1
- package/src/components/DialogTagEdit/index.tsx +1 -1
- package/src/components/DialogTags/index.tsx +1 -1
- package/src/components/Dialogs/index.tsx +1 -1
- package/src/components/FileAssetPreview/index.tsx +1 -1
- package/src/components/FileIcon/index.tsx +1 -1
- package/src/components/FormFieldInputLabel/index.tsx +1 -1
- package/src/components/Image/index.tsx +1 -1
- package/src/components/SearchFacet/index.tsx +8 -3
- package/src/components/SearchFacetNumber/index.tsx +1 -1
- package/src/components/SearchFacetSelect/index.tsx +1 -1
- package/src/components/SearchFacetString/index.tsx +1 -1
- package/src/components/SearchFacetTags/index.tsx +1 -1
- package/src/components/SearchFacets/index.tsx +1 -1
- package/src/components/SearchFacetsControl/index.tsx +1 -1
- package/src/components/TableHeader/index.tsx +14 -10
- package/src/components/TableRowAsset/index.tsx +5 -1
- package/src/components/Tag/index.tsx +2 -2
- package/src/components/TagsVirtualized/index.tsx +1 -1
- package/src/components/UploadDropzone/index.tsx +1 -1
- package/src/config/searchFacets.ts +1 -1
- package/src/constants.ts +1 -1
- package/src/contexts/ToolOptionsContext.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/modules/assets/index.ts +1 -1
- package/src/modules/dialog/index.ts +1 -1
- package/src/modules/notifications/index.ts +1 -1
- package/src/modules/search/index.ts +1 -1
- package/src/modules/selectors.ts +1 -1
- package/src/modules/tags/index.ts +1 -1
- package/src/modules/uploads/index.ts +1 -1
- package/src/operators/checkTagName.ts +1 -1
- package/src/plugin.tsx +1 -1
- package/src/styled/react-select/creatable.tsx +9 -1
- package/src/styled/react-select/single.tsx +8 -1
- package/src/types/sanity-ui.d.ts +6 -0
- package/src/utils/blocksToText.ts +1 -1
- package/src/utils/constructFilter.ts +1 -1
- package/src/utils/getAssetResolution.ts +1 -1
- package/src/utils/getTagSelectOptions.ts +1 -1
- package/src/utils/imageDprUrl.ts +1 -1
- package/src/utils/typeGuards.ts +1 -1
- package/src/utils/uploadSanityAsset.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-media",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "This version of `sanity-plugin-media` is for Sanity Studio V3.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"v2-incompatible.js"
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
|
+
"dev": "sanity dev",
|
|
45
46
|
"build": "plugin-kit verify-package --silent && pkg-utils build --strict --check --clean",
|
|
46
47
|
"clean": "rimraf dist",
|
|
47
|
-
"dev": "npm run watch",
|
|
48
48
|
"format": "prettier --write --cache --ignore-unknown .",
|
|
49
49
|
"link-watch": "plugin-kit link-watch",
|
|
50
50
|
"lint": "eslint .",
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
"@sanity/pkg-utils": "^7.0.3",
|
|
87
87
|
"@sanity/plugin-kit": "^4.0.19",
|
|
88
88
|
"@sanity/semantic-release-preset": "^2.0.2",
|
|
89
|
+
"@sanity/vision": "^3.78.1",
|
|
89
90
|
"@types/is-hotkey": "^0.1.7",
|
|
90
91
|
"@types/pluralize": "^0.0.29",
|
|
91
92
|
"@types/react": "^18",
|
|
92
93
|
"@types/react-dom": "^18",
|
|
93
94
|
"@types/react-file-icon": "^1.0.1",
|
|
94
95
|
"@types/react-redux": "^7.1.24",
|
|
95
|
-
"@types/styled-components": "^5.1.7",
|
|
96
96
|
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
|
97
97
|
"@typescript-eslint/parser": "^5.42.0",
|
|
98
98
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
@@ -109,16 +109,16 @@
|
|
|
109
109
|
"react": "^18",
|
|
110
110
|
"react-dom": "^18",
|
|
111
111
|
"rimraf": "^3.0.2",
|
|
112
|
-
"sanity": "^3.
|
|
112
|
+
"sanity": "^3.78.1",
|
|
113
113
|
"standard-version": "^9.5.0",
|
|
114
|
-
"styled-components": "^
|
|
114
|
+
"styled-components": "^6.1.15",
|
|
115
115
|
"typescript": "5.7.3"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"@sanity/ui": "^1.0 || ^2.0",
|
|
119
119
|
"react": "^18",
|
|
120
120
|
"react-dom": "^18",
|
|
121
|
-
"sanity": "^3
|
|
121
|
+
"sanity": "^3",
|
|
122
122
|
"styled-components": "^5.0 || ^6.0"
|
|
123
123
|
},
|
|
124
124
|
"engines": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {CardAssetData, CardUploadData} from '
|
|
1
|
+
import type {CardAssetData, CardUploadData} from '../../types'
|
|
2
2
|
import {memo} from 'react'
|
|
3
3
|
import {VirtuosoGrid} from 'react-virtuoso'
|
|
4
|
-
import styled from 'styled-components'
|
|
4
|
+
import {styled} from 'styled-components'
|
|
5
5
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
6
6
|
import CardAsset from '../CardAsset'
|
|
7
7
|
import CardUpload from '../CardUpload'
|
|
@@ -63,6 +63,7 @@ const AssetGridVirtualized = (props: Props) => {
|
|
|
63
63
|
}}
|
|
64
64
|
components={{
|
|
65
65
|
Item: ItemContainer,
|
|
66
|
+
// @ts-expect-error - fix typings later
|
|
66
67
|
List: ListContainer
|
|
67
68
|
}}
|
|
68
69
|
endReached={onLoadMore}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {DownloadIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Button, Flex, Inline, Stack, Text} from '@sanity/ui'
|
|
3
|
-
import type {Asset, AssetItem} from '
|
|
3
|
+
import type {Asset, AssetItem} from '../../types'
|
|
4
4
|
import format from 'date-fns/format'
|
|
5
5
|
import filesize from 'filesize'
|
|
6
6
|
import {type ReactNode} from 'react'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {MutationEvent} from '@sanity/client'
|
|
2
2
|
import {Card, Flex, PortalProvider, studioTheme, ThemeProvider, ToastProvider} from '@sanity/ui'
|
|
3
|
-
import type {Asset, Tag} from '
|
|
3
|
+
import type {Asset, Tag} from '../../types'
|
|
4
4
|
import groq from 'groq'
|
|
5
5
|
import {useEffect, useState} from 'react'
|
|
6
6
|
import {useDispatch} from 'react-redux'
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {memo, type MouseEvent, type RefObject} from 'react'
|
|
14
14
|
import {useDispatch} from 'react-redux'
|
|
15
15
|
import {useColorScheme} from 'sanity'
|
|
16
|
-
import styled,
|
|
16
|
+
import {styled, css} from 'styled-components'
|
|
17
17
|
import {PANEL_HEIGHT} from '../../constants'
|
|
18
18
|
import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
|
|
19
19
|
import useKeyPress from '../../hooks/useKeyPress'
|
|
@@ -66,18 +66,21 @@ const CardContainer = styled(Flex)<{picked?: boolean; theme: Theme; updating?: b
|
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
|
|
69
|
-
const ContextActionContainer = styled(Flex)(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
const ContextActionContainer = styled(Flex)(
|
|
70
|
+
// @ts-expect-error - fix typings later
|
|
71
|
+
({scheme}: {scheme: ThemeColorSchemeKey}) => {
|
|
72
|
+
return css`
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
height: ${PANEL_HEIGHT}px;
|
|
75
|
+
transition: all 300ms;
|
|
76
|
+
@media (hover: hover) and (pointer: fine) {
|
|
77
|
+
&:hover {
|
|
78
|
+
background: ${getSchemeColor(scheme, 'bg')};
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
`
|
|
82
|
+
}
|
|
83
|
+
)
|
|
81
84
|
|
|
82
85
|
const StyledWarningOutlineIcon = styled(WarningFilledIcon)(({theme}) => {
|
|
83
86
|
return {
|
|
@@ -221,6 +224,7 @@ const CardAsset = (props: Props) => {
|
|
|
221
224
|
align="center"
|
|
222
225
|
onClick={handleContextActionClick}
|
|
223
226
|
paddingX={1}
|
|
227
|
+
// @ts-expect-error - fix typings later
|
|
224
228
|
scheme={scheme}
|
|
225
229
|
style={{opacity: opacityContainer}}
|
|
226
230
|
>
|
|
@@ -4,7 +4,7 @@ import filesize from 'filesize'
|
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
6
6
|
import {useColorScheme} from 'sanity'
|
|
7
|
-
import styled from 'styled-components'
|
|
7
|
+
import {styled} from 'styled-components'
|
|
8
8
|
import {PANEL_HEIGHT} from '../../constants'
|
|
9
9
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
10
10
|
import {selectUploadById, uploadsActions} from '../../modules/uploads'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {zodResolver} from '@hookform/resolvers/zod'
|
|
2
2
|
import type {MutationEvent} from '@sanity/client'
|
|
3
3
|
import {Box, Button, Card, Flex, Stack, Tab, TabList, TabPanel, Text} from '@sanity/ui'
|
|
4
|
-
import type {Asset, AssetFormData, DialogAssetEditProps, TagSelectOption} from '
|
|
4
|
+
import type {Asset, AssetFormData, DialogAssetEditProps, TagSelectOption} from '../../types'
|
|
5
5
|
import groq from 'groq'
|
|
6
6
|
import {type ReactNode, useCallback, useEffect, useRef, useState} from 'react'
|
|
7
7
|
import {type SubmitHandler, useForm} from 'react-hook-form'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {WarningOutlineIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Button, Flex, Stack, Text} from '@sanity/ui'
|
|
3
|
-
import type {DialogConfirmProps} from '
|
|
3
|
+
import type {DialogConfirmProps} from '../../types'
|
|
4
4
|
import {type ReactNode} from 'react'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
6
6
|
import {dialogActions} from '../../modules/dialog'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {Box} from '@sanity/ui'
|
|
2
|
-
import type {DialogSearchFacetsProps} from '
|
|
2
|
+
import type {DialogSearchFacetsProps} from '../../types'
|
|
3
3
|
import {type ReactNode, useCallback} from 'react'
|
|
4
4
|
import {useDispatch} from 'react-redux'
|
|
5
5
|
import {dialogActions} from '../../modules/dialog'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {zodResolver} from '@hookform/resolvers/zod'
|
|
2
2
|
import {Box, Flex} from '@sanity/ui'
|
|
3
|
-
import type {DialogTagCreateProps, TagFormData} from '
|
|
3
|
+
import type {DialogTagCreateProps, TagFormData} from '../../types'
|
|
4
4
|
import {type ReactNode, useEffect} from 'react'
|
|
5
5
|
import {type SubmitHandler, useForm} from 'react-hook-form'
|
|
6
6
|
import {useDispatch} from 'react-redux'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {zodResolver} from '@hookform/resolvers/zod'
|
|
2
2
|
import type {MutationEvent} from '@sanity/client'
|
|
3
3
|
import {Box, Button, Card, Flex, Text} from '@sanity/ui'
|
|
4
|
-
import type {DialogTagEditProps, Tag, TagFormData} from '
|
|
4
|
+
import type {DialogTagEditProps, Tag, TagFormData} from '../../types'
|
|
5
5
|
import groq from 'groq'
|
|
6
6
|
import {type ReactNode, useCallback, useEffect, useState} from 'react'
|
|
7
7
|
import {type SubmitHandler, useForm} from 'react-hook-form'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {Box} from '@sanity/ui'
|
|
2
|
-
import type {DialogTagsProps} from '
|
|
2
|
+
import type {DialogTagsProps} from '../../types'
|
|
3
3
|
import {type ReactNode, useCallback} from 'react'
|
|
4
4
|
import {useDispatch} from 'react-redux'
|
|
5
5
|
import {dialogActions} from '../../modules/dialog'
|
|
@@ -2,7 +2,7 @@ import {Box, Flex, type Theme} from '@sanity/ui'
|
|
|
2
2
|
import {type MouseEvent} from 'react'
|
|
3
3
|
import {defaultStyles, FileIcon as ReactFileIcon} from 'react-file-icon'
|
|
4
4
|
import type {DefaultExtensionType} from 'react-file-icon'
|
|
5
|
-
import styled,
|
|
5
|
+
import {styled, css} from 'styled-components'
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
extension?: string
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {CloseIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Flex, Label, rem, Text, type Theme, type ThemeColorSchemeKey} from '@sanity/ui'
|
|
3
|
-
import type {SearchFacetInputProps, WithId} from '
|
|
3
|
+
import type {SearchFacetInputProps, WithId} from '../../types'
|
|
4
4
|
import {type ReactNode} from 'react'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
6
6
|
import {useColorScheme} from 'sanity'
|
|
7
|
-
import styled,
|
|
7
|
+
import {styled, css} from 'styled-components'
|
|
8
8
|
import {searchActions} from '../../modules/search'
|
|
9
9
|
import {getSchemeColor} from '../../utils/getSchemeColor'
|
|
10
10
|
|
|
@@ -13,6 +13,7 @@ type Props = {
|
|
|
13
13
|
facet: WithId<SearchFacetInputProps>
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// @ts-expect-error - fix typings later
|
|
16
17
|
const Container = styled(Box)(({scheme, theme}: {scheme: ThemeColorSchemeKey; theme: Theme}) => {
|
|
17
18
|
return css`
|
|
18
19
|
background: ${getSchemeColor(scheme, 'bg')};
|
|
@@ -33,7 +34,11 @@ const SearchFacet = (props: Props) => {
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
return (
|
|
36
|
-
<Container
|
|
37
|
+
<Container
|
|
38
|
+
padding={[2, 2, 1]}
|
|
39
|
+
// @ts-expect-error - fix typings later
|
|
40
|
+
scheme={scheme}
|
|
41
|
+
>
|
|
37
42
|
<Flex align={['flex-start', 'flex-start', 'center']} direction={['column', 'column', 'row']}>
|
|
38
43
|
{/* Title */}
|
|
39
44
|
<Box paddingBottom={[3, 3, 0]} paddingLeft={1} paddingRight={2} paddingTop={[1, 1, 0]}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {SelectIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Button, Menu, MenuButton, MenuDivider, MenuItem, TextInput} from '@sanity/ui'
|
|
3
|
-
import type {SearchFacetInputStringProps, SearchFacetOperatorType, WithId} from '
|
|
3
|
+
import type {SearchFacetInputStringProps, SearchFacetOperatorType, WithId} from '../../types'
|
|
4
4
|
import {type ChangeEvent} from 'react'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Box, Flex, Inline, rem, type Theme} from '@sanity/ui'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import styled,
|
|
3
|
+
import {styled, css} from 'styled-components'
|
|
4
4
|
|
|
5
5
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
6
6
|
import SearchFacetNumber from '../SearchFacetNumber'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {AddIcon} from '@sanity/icons'
|
|
2
2
|
import {Button, Flex, Menu, MenuButton, MenuDivider, MenuGroup, MenuItem} from '@sanity/ui'
|
|
3
|
-
import type {SearchFacetDivider, SearchFacetGroup, SearchFacetInputProps} from '
|
|
3
|
+
import type {SearchFacetDivider, SearchFacetGroup, SearchFacetInputProps} from '../../types'
|
|
4
4
|
import React from 'react'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
6
6
|
import {FACETS} from '../../constants'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {Checkbox, Flex, Grid, type ThemeColorSchemeKey, useMediaIndex} from '@sanity/ui'
|
|
2
2
|
import {type MouseEvent} from 'react'
|
|
3
3
|
import {useDispatch} from 'react-redux'
|
|
4
|
-
import styled,
|
|
4
|
+
import {styled, css} from 'styled-components'
|
|
5
5
|
import {GRID_TEMPLATE_COLUMNS, PANEL_HEIGHT} from '../../constants'
|
|
6
6
|
import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
|
|
7
7
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
@@ -11,16 +11,19 @@ import {useColorScheme} from 'sanity'
|
|
|
11
11
|
import {getSchemeColor} from '../../utils/getSchemeColor'
|
|
12
12
|
|
|
13
13
|
// TODO: DRY
|
|
14
|
-
const ContextActionContainer = styled(Flex)(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const ContextActionContainer = styled(Flex)(
|
|
15
|
+
// @ts-expect-error - fix typings later
|
|
16
|
+
({scheme}: {scheme: ThemeColorSchemeKey}) => {
|
|
17
|
+
return css`
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
@media (hover: hover) and (pointer: fine) {
|
|
20
|
+
&:hover {
|
|
21
|
+
background: ${getSchemeColor(scheme, 'bg')};
|
|
22
|
+
}
|
|
20
23
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
`
|
|
25
|
+
}
|
|
26
|
+
)
|
|
24
27
|
|
|
25
28
|
const TableHeader = () => {
|
|
26
29
|
const {scheme} = useColorScheme()
|
|
@@ -75,6 +78,7 @@ const TableHeader = () => {
|
|
|
75
78
|
align="center"
|
|
76
79
|
justify="center"
|
|
77
80
|
onClick={handleContextActionClick}
|
|
81
|
+
// @ts-expect-error - fix typings later
|
|
78
82
|
scheme={scheme}
|
|
79
83
|
style={{
|
|
80
84
|
height: '100%',
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from 'react'
|
|
25
25
|
import {useDispatch} from 'react-redux'
|
|
26
26
|
import {WithReferringDocuments, useColorScheme} from 'sanity'
|
|
27
|
-
import styled,
|
|
27
|
+
import {styled, css} from 'styled-components'
|
|
28
28
|
import {GRID_TEMPLATE_COLUMNS} from '../../constants'
|
|
29
29
|
import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
|
|
30
30
|
import useKeyPress from '../../hooks/useKeyPress'
|
|
@@ -48,6 +48,7 @@ type Props = {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const ContainerGrid = styled(Grid)(
|
|
51
|
+
// @ts-expect-error - fix typings later
|
|
51
52
|
({
|
|
52
53
|
scheme,
|
|
53
54
|
selected,
|
|
@@ -77,6 +78,7 @@ const ContainerGrid = styled(Grid)(
|
|
|
77
78
|
}
|
|
78
79
|
)
|
|
79
80
|
|
|
81
|
+
// @ts-expect-error - fix typings later
|
|
80
82
|
const ContextActionContainer = styled(Flex)(({scheme}: {scheme: ThemeColorSchemeKey}) => {
|
|
81
83
|
return css`
|
|
82
84
|
cursor: pointer;
|
|
@@ -179,6 +181,7 @@ const TableRowAsset = (props: Props) => {
|
|
|
179
181
|
return (
|
|
180
182
|
<ContainerGrid
|
|
181
183
|
onClick={selected ? undefined : handleClick}
|
|
184
|
+
// @ts-expect-error - fix typings later
|
|
182
185
|
scheme={scheme}
|
|
183
186
|
selected={selected}
|
|
184
187
|
style={{
|
|
@@ -193,6 +196,7 @@ const TableRowAsset = (props: Props) => {
|
|
|
193
196
|
{/* Picked checkbox */}
|
|
194
197
|
<ContextActionContainer
|
|
195
198
|
onClick={handleContextActionClick}
|
|
199
|
+
// @ts-expect-error - fix typings later
|
|
196
200
|
scheme={scheme}
|
|
197
201
|
style={{
|
|
198
202
|
alignItems: 'center',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {ArrowDownIcon, ArrowUpIcon, CloseIcon, EditIcon, SearchIcon, TrashIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Button, Container, Flex, Text, Tooltip} from '@sanity/ui'
|
|
3
|
-
import type {SearchFacetInputSearchableProps, TagActions, TagItem} from '
|
|
3
|
+
import type {SearchFacetInputSearchableProps, TagActions, TagItem} from '../../types'
|
|
4
4
|
import {type ReactNode} from 'react'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
6
|
-
import styled from 'styled-components'
|
|
6
|
+
import {styled} from 'styled-components'
|
|
7
7
|
import {inputs} from '../../config/searchFacets'
|
|
8
8
|
import {PANEL_HEIGHT} from '../../constants'
|
|
9
9
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {Flex, Label} from '@sanity/ui'
|
|
2
|
-
import type {TagActions, TagItem} from '
|
|
2
|
+
import type {TagActions, TagItem} from '../../types'
|
|
3
3
|
import {memo, useState} from 'react'
|
|
4
4
|
import {Virtuoso} from 'react-virtuoso'
|
|
5
5
|
import {PANEL_HEIGHT} from '../../constants'
|
|
@@ -3,7 +3,7 @@ import {Flex, Text} from '@sanity/ui'
|
|
|
3
3
|
import {type ReactNode} from 'react'
|
|
4
4
|
import {type DropEvent, type DropzoneOptions, useDropzone} from 'react-dropzone'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
6
|
-
import styled from 'styled-components'
|
|
6
|
+
import {styled} from 'styled-components'
|
|
7
7
|
import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
|
|
8
8
|
import {DropzoneDispatchProvider} from '../../contexts/DropzoneDispatchContext'
|
|
9
9
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
package/src/constants.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {media, mediaAssetSource} from './plugin'
|
|
2
|
-
export type {MediaToolOptions} from '
|
|
2
|
+
export type {MediaToolOptions} from './types'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {createSlice, type PayloadAction} from '@reduxjs/toolkit'
|
|
2
|
-
import type {AssetItem, Dialog, MyEpic, Tag} from '
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import {type PayloadAction, createSlice} from '@reduxjs/toolkit'
|
|
2
|
-
import type {ImageAsset, MyEpic} from '
|
|
2
|
+
import type {ImageAsset, MyEpic} from '../../types'
|
|
3
3
|
import pluralize from 'pluralize'
|
|
4
4
|
import {ofType} from 'redux-observable'
|
|
5
5
|
import {of} from 'rxjs'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {type PayloadAction, createSelector, createSlice} from '@reduxjs/toolkit'
|
|
2
|
-
import type {MyEpic, SearchFacetInputProps, SearchFacetOperatorType, WithId} from '
|
|
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'
|
|
5
5
|
import {uuid} from '@sanity/uuid'
|
package/src/modules/selectors.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createSelector, createSlice, type PayloadAction} from '@reduxjs/toolkit'
|
|
2
2
|
import type {ClientError, Transaction} from '@sanity/client'
|
|
3
|
-
import type {Asset, HttpError, MyEpic, TagSelectOption, Tag, TagItem} from '
|
|
3
|
+
import type {Asset, HttpError, MyEpic, TagSelectOption, Tag, TagItem} from '../../types'
|
|
4
4
|
import groq from 'groq'
|
|
5
5
|
import type {Selector} from 'react-redux'
|
|
6
6
|
import {ofType} from 'redux-observable'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createSelector, createSlice, type PayloadAction} from '@reduxjs/toolkit'
|
|
2
2
|
import type {ClientError, SanityAssetDocument, SanityImageAssetDocument} from '@sanity/client'
|
|
3
|
-
import type {HttpError, MyEpic, SanityUploadProgressEvent, UploadItem} from '
|
|
3
|
+
import type {HttpError, MyEpic, SanityUploadProgressEvent, UploadItem} from '../../types'
|
|
4
4
|
import groq from 'groq'
|
|
5
5
|
import type {Selector} from 'react-redux'
|
|
6
6
|
import {empty, merge, of} from 'rxjs'
|
package/src/plugin.tsx
CHANGED
|
@@ -4,7 +4,7 @@ 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 type {MediaToolOptions} from '
|
|
7
|
+
import type {MediaToolOptions} from './types'
|
|
8
8
|
import {ToolOptionsProvider} from './contexts/ToolOptionsContext'
|
|
9
9
|
|
|
10
10
|
const plugin = {
|