sanity-plugin-media 2.4.2 → 3.0.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 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +438 -285
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +457 -305
- package/dist/index.mjs.map +1 -1
- package/package.json +39 -33
- package/src/components/AssetGridVirtualized/index.tsx +13 -3
- package/src/components/Browser/index.tsx +30 -41
- package/src/components/ButtonAssetCopy/index.tsx +1 -1
- package/src/components/ButtonViewGroup/index.tsx +0 -1
- package/src/components/CardAsset/index.tsx +13 -14
- package/src/components/CardUpload/index.tsx +1 -1
- package/src/components/Controls/index.tsx +0 -1
- package/src/components/DebugControls/index.tsx +1 -0
- package/src/components/DialogAssetEdit/index.tsx +10 -3
- package/src/components/DialogConfirm/index.tsx +8 -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/DocumentList/index.tsx +1 -1
- package/src/components/FileAssetPreview/index.tsx +1 -1
- package/src/components/FormFieldInputLabel/index.tsx +2 -1
- package/src/components/FormSubmitButton/index.tsx +1 -0
- package/src/components/Header/index.tsx +1 -1
- package/src/components/Image/index.tsx +4 -4
- package/src/components/OrderSelect/index.tsx +0 -1
- package/src/components/Progress/index.tsx +0 -1
- package/src/components/ReduxProvider/index.tsx +0 -1
- package/src/components/SearchFacet/index.tsx +4 -9
- package/src/components/SearchFacetNumber/index.tsx +1 -1
- package/src/components/SearchFacetSelect/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 +4 -6
- package/src/components/TableHeaderItem/index.tsx +1 -1
- package/src/components/TableRowAsset/index.tsx +38 -46
- package/src/components/TableRowUpload/index.tsx +6 -1
- package/src/components/Tag/index.tsx +1 -0
- package/src/components/TagIcon/index.tsx +0 -2
- package/src/components/TagView/index.tsx +1 -1
- package/src/components/TagsPanel/index.tsx +1 -1
- package/src/components/Tool/index.tsx +1 -1
- package/src/hooks/usePortalPopoverProps.ts +1 -0
- package/src/plugin.tsx +0 -1
- package/src/styled/react-select/creatable.tsx +0 -9
- package/src/styled/react-select/single.tsx +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-media",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "This version of `sanity-plugin-media` is for Sanity Studio V3.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -59,54 +59,55 @@
|
|
|
59
59
|
"@sanity/color": "^3.0.6",
|
|
60
60
|
"@sanity/icons": "^3.7.0",
|
|
61
61
|
"@sanity/incompatible-plugin": "^1.0.5",
|
|
62
|
-
"@sanity/ui": "^
|
|
62
|
+
"@sanity/ui": "^2.15",
|
|
63
63
|
"@sanity/uuid": "^3.0.1",
|
|
64
|
-
"@tanem/react-nprogress": "^5.0.
|
|
64
|
+
"@tanem/react-nprogress": "^5.0.55",
|
|
65
65
|
"copy-to-clipboard": "^3.3.1",
|
|
66
66
|
"date-fns": "^2.27.0",
|
|
67
67
|
"filesize": "^9.0.0",
|
|
68
68
|
"groq": "^3.0.0",
|
|
69
|
-
"is-hotkey": "^0.
|
|
69
|
+
"is-hotkey-esm": "^1.0.0",
|
|
70
70
|
"nanoid": "^3.3.8",
|
|
71
71
|
"pluralize": "^8.0.0",
|
|
72
72
|
"react-dropzone": "^11.3.1",
|
|
73
|
-
"react-file-icon": "^1.
|
|
74
|
-
"react-hook-form": "^7.
|
|
75
|
-
"react-redux": "^
|
|
73
|
+
"react-file-icon": "^1.6.0",
|
|
74
|
+
"react-hook-form": "^7.54.2",
|
|
75
|
+
"react-redux": "^9.2.0",
|
|
76
76
|
"react-select": "^5.3.2",
|
|
77
|
-
"react-virtuoso": "^4.
|
|
77
|
+
"react-virtuoso": "^4.12.5",
|
|
78
78
|
"redux": "^5.0.1",
|
|
79
|
-
"redux-observable": "
|
|
79
|
+
"redux-observable": "3.0.0-rc.2",
|
|
80
80
|
"rxjs": "^7.8.1",
|
|
81
81
|
"zod": "^3.21.4"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@commitlint/cli": "^17.
|
|
85
|
-
"@commitlint/config-conventional": "^17.
|
|
86
|
-
"@sanity/pkg-utils": "^7.0.
|
|
84
|
+
"@commitlint/cli": "^17.8.1",
|
|
85
|
+
"@commitlint/config-conventional": "^17.8.1",
|
|
86
|
+
"@sanity/pkg-utils": "^7.0.4",
|
|
87
87
|
"@sanity/plugin-kit": "^4.0.19",
|
|
88
|
-
"@sanity/semantic-release-preset": "^2.0.
|
|
88
|
+
"@sanity/semantic-release-preset": "^2.0.5",
|
|
89
89
|
"@sanity/vision": "^3.78.1",
|
|
90
|
-
"@types/is-hotkey": "^0.1.
|
|
91
|
-
"@types/pluralize": "^0.0.
|
|
92
|
-
"@types/react": "^
|
|
93
|
-
"@types/react-dom": "^
|
|
94
|
-
"@types/react-file-icon": "^1.0.
|
|
95
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
96
|
-
"@typescript-eslint/parser": "^5.
|
|
90
|
+
"@types/is-hotkey": "^0.1.10",
|
|
91
|
+
"@types/pluralize": "^0.0.33",
|
|
92
|
+
"@types/react": "^19.0.10",
|
|
93
|
+
"@types/react-dom": "^19.0.4",
|
|
94
|
+
"@types/react-file-icon": "^1.0.4",
|
|
95
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
96
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
97
97
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
98
|
-
"eslint": "^8.
|
|
99
|
-
"eslint-config-prettier": "^8.
|
|
98
|
+
"eslint": "^8.57.1",
|
|
99
|
+
"eslint-config-prettier": "^8.10.0",
|
|
100
100
|
"eslint-config-sanity": "^6.0.0",
|
|
101
101
|
"eslint-plugin-prettier": "^4.2.1",
|
|
102
|
-
"eslint-plugin-react": "^7.
|
|
103
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
102
|
+
"eslint-plugin-react": "^7.37.4",
|
|
103
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
104
104
|
"husky": "^8.0.2",
|
|
105
105
|
"lint-staged": "^13.0.3",
|
|
106
|
-
"prettier": "^2.
|
|
107
|
-
"prettier-plugin-packagejson": "^2.
|
|
108
|
-
"react": "^
|
|
109
|
-
"react-dom": "^
|
|
106
|
+
"prettier": "^2.8.8",
|
|
107
|
+
"prettier-plugin-packagejson": "^2.5.10",
|
|
108
|
+
"react": "^19.0.0",
|
|
109
|
+
"react-dom": "^19.0.0",
|
|
110
|
+
"react-is": "^19.0.0",
|
|
110
111
|
"rimraf": "^3.0.2",
|
|
111
112
|
"sanity": "^3.78.1",
|
|
112
113
|
"standard-version": "^9.5.0",
|
|
@@ -114,11 +115,16 @@
|
|
|
114
115
|
"typescript": "5.7.3"
|
|
115
116
|
},
|
|
116
117
|
"peerDependencies": {
|
|
117
|
-
"@sanity/ui": "^
|
|
118
|
-
"react": "^18",
|
|
119
|
-
"react-dom": "^18",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
118
|
+
"@sanity/ui": "^2.15",
|
|
119
|
+
"react": "^18.3 || ^19",
|
|
120
|
+
"react-dom": "^18.3 || ^19",
|
|
121
|
+
"react-is": "^18.3 || ^19",
|
|
122
|
+
"sanity": "^3.78",
|
|
123
|
+
"styled-components": "^6.1"
|
|
124
|
+
},
|
|
125
|
+
"overrides": {
|
|
126
|
+
"react": "$react",
|
|
127
|
+
"react-dom": "$react-dom"
|
|
122
128
|
},
|
|
123
129
|
"engines": {
|
|
124
130
|
"node": ">=18"
|
|
@@ -28,18 +28,29 @@ const VirtualCell = memo(
|
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
const
|
|
31
|
+
const StyledItemContainer = styled.div`
|
|
32
32
|
height: ${CARD_HEIGHT}px;
|
|
33
33
|
width: ${CARD_WIDTH}px;
|
|
34
34
|
`
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
function ItemContainer(props: any) {
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- we're doing this to avoid sc warnings about `context` passed as an attribute
|
|
38
|
+
const {context, ...rest} = props
|
|
39
|
+
return <StyledItemContainer {...rest} />
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const StyledListContainer = styled.div`
|
|
37
43
|
display: grid;
|
|
38
44
|
grid-template-columns: repeat(auto-fill, ${CARD_WIDTH}px);
|
|
39
45
|
grid-template-rows: repeat(auto-fill, ${CARD_HEIGHT}px);
|
|
40
46
|
justify-content: center;
|
|
41
47
|
margin: 0 auto;
|
|
42
48
|
`
|
|
49
|
+
function ListContainer(props: any) {
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- we're doing this to avoid sc warnings about `context` passed as an attribute
|
|
51
|
+
const {context, ...rest} = props
|
|
52
|
+
return <StyledListContainer {...rest} />
|
|
53
|
+
}
|
|
43
54
|
|
|
44
55
|
const AssetGridVirtualized = (props: Props) => {
|
|
45
56
|
const {items, onLoadMore} = props
|
|
@@ -63,7 +74,6 @@ const AssetGridVirtualized = (props: Props) => {
|
|
|
63
74
|
}}
|
|
64
75
|
components={{
|
|
65
76
|
Item: ItemContainer,
|
|
66
|
-
// @ts-expect-error - fix typings later
|
|
67
77
|
List: ListContainer
|
|
68
78
|
}}
|
|
69
79
|
endReached={onLoadMore}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type {MutationEvent} from '@sanity/client'
|
|
2
|
-
import {Card, Flex, PortalProvider
|
|
2
|
+
import {Card, Flex, PortalProvider} from '@sanity/ui'
|
|
3
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'
|
|
7
|
-
import {
|
|
7
|
+
import {type AssetSourceComponentProps, type SanityDocument} from 'sanity'
|
|
8
8
|
import {TAG_DOCUMENT_NAME} from '../../constants'
|
|
9
9
|
import {AssetBrowserDispatchProvider} from '../../contexts/AssetSourceDispatchContext'
|
|
10
10
|
import useVersionedClient from '../../hooks/useVersionedClient'
|
|
@@ -32,47 +32,42 @@ type Props = {
|
|
|
32
32
|
|
|
33
33
|
const BrowserContent = ({onClose}: {onClose?: AssetSourceComponentProps['onClose']}) => {
|
|
34
34
|
const client = useVersionedClient()
|
|
35
|
-
|
|
36
35
|
const [portalElement, setPortalElement] = useState<HTMLDivElement | null>(null)
|
|
37
|
-
|
|
38
|
-
// Redux
|
|
39
36
|
const dispatch = useDispatch()
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const handleAssetUpdate = (update: MutationEvent) => {
|
|
40
|
+
const {documentId, result, transition} = update
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
if (transition === 'appear') {
|
|
43
|
+
dispatch(assetsActions.listenerCreateQueue({asset: result as Asset}))
|
|
44
|
+
}
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if (transition === 'disappear') {
|
|
47
|
+
dispatch(assetsActions.listenerDeleteQueue({assetId: documentId}))
|
|
48
|
+
}
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
if (transition === 'update') {
|
|
51
|
+
dispatch(assetsActions.listenerUpdateQueue({asset: result as Asset}))
|
|
52
|
+
}
|
|
55
53
|
}
|
|
56
|
-
}
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
const handleTagUpdate = (update: MutationEvent) => {
|
|
56
|
+
const {documentId, result, transition} = update
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
if (transition === 'appear') {
|
|
59
|
+
dispatch(tagsActions.listenerCreateQueue({tag: result as Tag}))
|
|
60
|
+
}
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
if (transition === 'disappear') {
|
|
63
|
+
dispatch(tagsActions.listenerDeleteQueue({tagId: documentId}))
|
|
64
|
+
}
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
if (transition === 'update') {
|
|
67
|
+
dispatch(tagsActions.listenerUpdateQueue({tag: result as Tag}))
|
|
68
|
+
}
|
|
71
69
|
}
|
|
72
|
-
}
|
|
73
70
|
|
|
74
|
-
// Effects
|
|
75
|
-
useEffect(() => {
|
|
76
71
|
// Fetch assets: first page
|
|
77
72
|
dispatch(assetsActions.loadPageIndex({pageIndex: 0}))
|
|
78
73
|
|
|
@@ -97,7 +92,7 @@ const BrowserContent = ({onClose}: {onClose?: AssetSourceComponentProps['onClose
|
|
|
97
92
|
subscriptionAsset?.unsubscribe()
|
|
98
93
|
subscriptionTag?.unsubscribe()
|
|
99
94
|
}
|
|
100
|
-
}, [])
|
|
95
|
+
}, [client, dispatch])
|
|
101
96
|
|
|
102
97
|
return (
|
|
103
98
|
<PortalProvider element={portalElement}>
|
|
@@ -132,7 +127,6 @@ const BrowserContent = ({onClose}: {onClose?: AssetSourceComponentProps['onClose
|
|
|
132
127
|
|
|
133
128
|
const Browser = (props: Props) => {
|
|
134
129
|
const client = useVersionedClient()
|
|
135
|
-
const scheme = useColorSchemeValue()
|
|
136
130
|
|
|
137
131
|
return (
|
|
138
132
|
<ReduxProvider
|
|
@@ -141,15 +135,10 @@ const Browser = (props: Props) => {
|
|
|
141
135
|
document={props?.document}
|
|
142
136
|
selectedAssets={props?.selectedAssets}
|
|
143
137
|
>
|
|
144
|
-
<
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<BrowserContent onClose={props?.onClose} />
|
|
150
|
-
</AssetBrowserDispatchProvider>
|
|
151
|
-
</ToastProvider>
|
|
152
|
-
</ThemeProvider>
|
|
138
|
+
<AssetBrowserDispatchProvider onSelect={props?.onSelect}>
|
|
139
|
+
<GlobalStyle />
|
|
140
|
+
<BrowserContent onClose={props?.onClose} />
|
|
141
|
+
</AssetBrowserDispatchProvider>
|
|
153
142
|
</ReduxProvider>
|
|
154
143
|
)
|
|
155
144
|
}
|
|
@@ -11,7 +11,7 @@ type Props = {
|
|
|
11
11
|
|
|
12
12
|
const ButtonAssetCopy = ({disabled, url}: Props) => {
|
|
13
13
|
const popoverProps = usePortalPopoverProps()
|
|
14
|
-
const refPopoverTimeout = useRef<ReturnType<typeof window.setTimeout>>()
|
|
14
|
+
const refPopoverTimeout = useRef<ReturnType<typeof window.setTimeout>>(null)
|
|
15
15
|
const [popoverVisible, setPopoverVisible] = useState(false)
|
|
16
16
|
|
|
17
17
|
const handleClick = () => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {ThLargeIcon, ThListIcon} from '@sanity/icons'
|
|
2
2
|
import {Button, Inline} from '@sanity/ui'
|
|
3
|
-
import React from 'react'
|
|
4
3
|
import {useDispatch} from 'react-redux'
|
|
5
4
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
6
5
|
import {assetsActions} from '../../modules/assets'
|
|
@@ -39,22 +39,22 @@ const CardWrapper = styled(Flex)`
|
|
|
39
39
|
width: 100%;
|
|
40
40
|
`
|
|
41
41
|
|
|
42
|
-
const CardContainer = styled(Flex)<{picked?: boolean; theme: Theme; updating?: boolean}>(
|
|
43
|
-
({picked, theme, updating}) => {
|
|
42
|
+
const CardContainer = styled(Flex)<{$picked?: boolean; theme: Theme; $updating?: boolean}>(
|
|
43
|
+
({$picked, theme, $updating}) => {
|
|
44
44
|
return css`
|
|
45
45
|
border: 1px solid transparent;
|
|
46
46
|
height: 100%;
|
|
47
|
-
pointer-events: ${updating ? 'none' : 'auto'};
|
|
47
|
+
pointer-events: ${$updating ? 'none' : 'auto'};
|
|
48
48
|
position: relative;
|
|
49
49
|
transition: all 300ms;
|
|
50
50
|
user-select: none;
|
|
51
51
|
width: 100%;
|
|
52
52
|
|
|
53
|
-
border: ${picked
|
|
53
|
+
border: ${$picked
|
|
54
54
|
? `1px solid ${theme.sanity.color.spot.orange} !important`
|
|
55
55
|
: '1px solid inherit'};
|
|
56
56
|
|
|
57
|
-
${
|
|
57
|
+
${!$updating &&
|
|
58
58
|
css`
|
|
59
59
|
@media (hover: hover) and (pointer: fine) {
|
|
60
60
|
&:hover {
|
|
@@ -66,16 +66,15 @@ const CardContainer = styled(Flex)<{picked?: boolean; theme: Theme; updating?: b
|
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
|
|
69
|
-
const ContextActionContainer = styled(Flex)(
|
|
70
|
-
|
|
71
|
-
({scheme}: {scheme: ThemeColorSchemeKey}) => {
|
|
69
|
+
const ContextActionContainer = styled<typeof Flex, {$scheme: ThemeColorSchemeKey}>(Flex)(
|
|
70
|
+
({$scheme}) => {
|
|
72
71
|
return css`
|
|
73
72
|
cursor: pointer;
|
|
74
73
|
height: ${PANEL_HEIGHT}px;
|
|
75
74
|
transition: all 300ms;
|
|
76
75
|
@media (hover: hover) and (pointer: fine) {
|
|
77
76
|
&:hover {
|
|
78
|
-
background: ${getSchemeColor(scheme, 'bg')};
|
|
77
|
+
background: ${getSchemeColor($scheme, 'bg')};
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
`
|
|
@@ -153,7 +152,7 @@ const CardAsset = (props: Props) => {
|
|
|
153
152
|
|
|
154
153
|
return (
|
|
155
154
|
<CardWrapper padding={1}>
|
|
156
|
-
<CardContainer direction="column" picked={picked} updating={item.updating}>
|
|
155
|
+
<CardContainer direction="column" $picked={picked} $updating={item.updating}>
|
|
157
156
|
{/* Image */}
|
|
158
157
|
<Box
|
|
159
158
|
flex={1}
|
|
@@ -170,8 +169,8 @@ const CardAsset = (props: Props) => {
|
|
|
170
169
|
{isImageAsset(asset) && (
|
|
171
170
|
<Image
|
|
172
171
|
draggable={false}
|
|
173
|
-
scheme={scheme}
|
|
174
|
-
showCheckerboard={!isOpaque}
|
|
172
|
+
$scheme={scheme}
|
|
173
|
+
$showCheckerboard={!isOpaque}
|
|
175
174
|
src={imageDprUrl(asset, {height: 250, width: 250})}
|
|
176
175
|
style={{
|
|
177
176
|
draggable: false,
|
|
@@ -224,8 +223,7 @@ const CardAsset = (props: Props) => {
|
|
|
224
223
|
align="center"
|
|
225
224
|
onClick={handleContextActionClick}
|
|
226
225
|
paddingX={1}
|
|
227
|
-
|
|
228
|
-
scheme={scheme}
|
|
226
|
+
$scheme={scheme}
|
|
229
227
|
style={{opacity: opacityContainer}}
|
|
230
228
|
>
|
|
231
229
|
{onSelect ? (
|
|
@@ -266,6 +264,7 @@ const CardAsset = (props: Props) => {
|
|
|
266
264
|
}}
|
|
267
265
|
>
|
|
268
266
|
<Tooltip
|
|
267
|
+
animate
|
|
269
268
|
content={
|
|
270
269
|
<Container padding={2} width={0}>
|
|
271
270
|
<Text size={1}>{error}</Text>
|
|
@@ -240,7 +240,14 @@ const DialogAssetEdit = (props: Props) => {
|
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
return (
|
|
243
|
-
<Dialog
|
|
243
|
+
<Dialog
|
|
244
|
+
animate
|
|
245
|
+
footer={<Footer />}
|
|
246
|
+
header="Asset details"
|
|
247
|
+
id={id}
|
|
248
|
+
onClose={handleClose}
|
|
249
|
+
width={3}
|
|
250
|
+
>
|
|
244
251
|
{/*
|
|
245
252
|
We reverse direction to ensure the download button doesn't appear (in the DOM) before other tabbable items.
|
|
246
253
|
This ensures that the dialog doesn't scroll down to the download button (which on smaller screens, can sometimes
|
|
@@ -395,8 +402,8 @@ const DialogAssetEdit = (props: Props) => {
|
|
|
395
402
|
{isImageAsset(currentAsset) && (
|
|
396
403
|
<Image
|
|
397
404
|
draggable={false}
|
|
398
|
-
scheme={scheme}
|
|
399
|
-
showCheckerboard={!currentAsset?.metadata?.isOpaque}
|
|
405
|
+
$scheme={scheme}
|
|
406
|
+
$showCheckerboard={!currentAsset?.metadata?.isOpaque}
|
|
400
407
|
src={imageDprUrl(currentAsset, {height: 600, width: 600})}
|
|
401
408
|
/>
|
|
402
409
|
)}
|
|
@@ -60,7 +60,14 @@ const DialogConfirm = (props: Props) => {
|
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<Dialog
|
|
63
|
+
<Dialog
|
|
64
|
+
animate
|
|
65
|
+
footer={<Footer />}
|
|
66
|
+
header={<Header />}
|
|
67
|
+
id="confirm"
|
|
68
|
+
onClose={handleClose}
|
|
69
|
+
width={1}
|
|
70
|
+
>
|
|
64
71
|
<Box paddingX={4} paddingY={4}>
|
|
65
72
|
<Stack space={3}>
|
|
66
73
|
{dialog?.title && <Text size={1}>{dialog.title}</Text>}
|
|
@@ -27,7 +27,7 @@ const DialogSearchFacets = (props: Props) => {
|
|
|
27
27
|
}, [])
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
<Dialog header="Filters" id={id} onClose={handleClose} width={1}>
|
|
30
|
+
<Dialog animate header="Filters" id={id} onClose={handleClose} width={1}>
|
|
31
31
|
<Box padding={3}>
|
|
32
32
|
<SearchFacets layout="stack" />
|
|
33
33
|
<SearchFacetsControl />
|
|
@@ -78,7 +78,7 @@ const DialogTagCreate = (props: Props) => {
|
|
|
78
78
|
)
|
|
79
79
|
|
|
80
80
|
return (
|
|
81
|
-
<Dialog footer={<Footer />} header="Create Tag" id={id} onClose={handleClose} width={1}>
|
|
81
|
+
<Dialog animate footer={<Footer />} header="Create Tag" id={id} onClose={handleClose} width={1}>
|
|
82
82
|
{/* Form fields */}
|
|
83
83
|
<Box as="form" padding={4} onSubmit={handleSubmit(onSubmit)}>
|
|
84
84
|
{/* Hidden button to enable enter key submissions */}
|
|
@@ -158,7 +158,7 @@ const DialogTagEdit = (props: Props) => {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
return (
|
|
161
|
-
<Dialog footer={<Footer />} header="Edit Tag" id={id} onClose={handleClose} width={1}>
|
|
161
|
+
<Dialog animate footer={<Footer />} header="Edit Tag" id={id} onClose={handleClose} width={1}>
|
|
162
162
|
{/* Form fields */}
|
|
163
163
|
<Box as="form" padding={4} onSubmit={handleSubmit(onSubmit)}>
|
|
164
164
|
{/* Deleted notification */}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ErrorOutlineIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Inline, Text, Tooltip} from '@sanity/ui'
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import {styled} from 'styled-components'
|
|
5
5
|
|
|
6
6
|
type Props = {
|
|
@@ -32,6 +32,7 @@ const FormFieldInputLabel = (props: Props) => {
|
|
|
32
32
|
{error && (
|
|
33
33
|
<Text size={1}>
|
|
34
34
|
<Tooltip
|
|
35
|
+
animate
|
|
35
36
|
content={
|
|
36
37
|
<Box padding={2}>
|
|
37
38
|
<Text muted size={1}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {CloseIcon, Icon, UploadIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Button, Flex, Inline, Text} from '@sanity/ui'
|
|
3
3
|
import pluralize from 'pluralize'
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import {useAssetSourceActions} from '../../contexts/AssetSourceDispatchContext'
|
|
6
6
|
import {useDropzoneActions} from '../../contexts/DropzoneDispatchContext'
|
|
7
7
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
@@ -5,15 +5,15 @@ import {getSchemeColor} from '../../utils/getSchemeColor'
|
|
|
5
5
|
|
|
6
6
|
type Props = {
|
|
7
7
|
onClick?: (e: MouseEvent) => void
|
|
8
|
-
showCheckerboard?: boolean
|
|
9
|
-
scheme?: ThemeColorSchemeKey
|
|
8
|
+
$showCheckerboard?: boolean
|
|
9
|
+
$scheme?: ThemeColorSchemeKey
|
|
10
10
|
src: string
|
|
11
11
|
style?: any
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const Image = styled.img<Props>`
|
|
15
15
|
--checkerboard-color: ${props =>
|
|
16
|
-
props
|
|
16
|
+
props.$scheme ? getSchemeColor(props.$scheme, 'bg2') : 'inherit'};
|
|
17
17
|
|
|
18
18
|
display: block;
|
|
19
19
|
width: 100%;
|
|
@@ -21,7 +21,7 @@ const Image = styled.img<Props>`
|
|
|
21
21
|
object-fit: contain;
|
|
22
22
|
|
|
23
23
|
${props =>
|
|
24
|
-
props
|
|
24
|
+
props.$showCheckerboard &&
|
|
25
25
|
css`
|
|
26
26
|
background-image: linear-gradient(45deg, var(--checkerboard-color) 25%, transparent 25%),
|
|
27
27
|
linear-gradient(-45deg, var(--checkerboard-color) 25%, transparent 25%),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {SortIcon} from '@sanity/icons'
|
|
2
2
|
import {Button, Menu, MenuButton, MenuDivider, MenuItem} from '@sanity/ui'
|
|
3
|
-
import React from 'react'
|
|
4
3
|
import {useDispatch} from 'react-redux'
|
|
5
4
|
import {getOrderTitle} from '../../config/orders'
|
|
6
5
|
import {ORDER_OPTIONS} from '../../constants'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {CloseIcon} from '@sanity/icons'
|
|
2
|
-
import {Box, Flex, Label, rem, Text, type
|
|
2
|
+
import {Box, Flex, Label, rem, Text, type ThemeColorSchemeKey} from '@sanity/ui'
|
|
3
3
|
import type {SearchFacetInputProps, WithId} from '../../types'
|
|
4
4
|
import {type ReactNode} from 'react'
|
|
5
5
|
import {useDispatch} from 'react-redux'
|
|
@@ -13,10 +13,9 @@ type Props = {
|
|
|
13
13
|
facet: WithId<SearchFacetInputProps>
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
const Container = styled(Box)(({scheme, theme}: {scheme: ThemeColorSchemeKey; theme: Theme}) => {
|
|
16
|
+
const Container = styled<typeof Box, {$scheme: ThemeColorSchemeKey}>(Box)(({$scheme, theme}) => {
|
|
18
17
|
return css`
|
|
19
|
-
background: ${getSchemeColor(scheme, 'bg')};
|
|
18
|
+
background: ${getSchemeColor($scheme, 'bg')};
|
|
20
19
|
border-radius: ${rem(theme.sanity.radius[2])};
|
|
21
20
|
`
|
|
22
21
|
})
|
|
@@ -34,11 +33,7 @@ const SearchFacet = (props: Props) => {
|
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
return (
|
|
37
|
-
<Container
|
|
38
|
-
padding={[2, 2, 1]}
|
|
39
|
-
// @ts-expect-error - fix typings later
|
|
40
|
-
scheme={scheme}
|
|
41
|
-
>
|
|
36
|
+
<Container padding={[2, 2, 1]} $scheme={scheme}>
|
|
42
37
|
<Flex align={['flex-start', 'flex-start', 'center']} direction={['column', 'column', 'row']}>
|
|
43
38
|
{/* Title */}
|
|
44
39
|
<Box paddingBottom={[3, 3, 0]} paddingLeft={1} paddingRight={2} paddingTop={[1, 1, 0]}>
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
SearchFacetOperatorType,
|
|
7
7
|
WithId
|
|
8
8
|
} from '../../types'
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
import {useDispatch} from 'react-redux'
|
|
11
11
|
import {operators} from '../../config/searchFacets'
|
|
12
12
|
import {usePortalPopoverProps} from '../../hooks/usePortalPopoverProps'
|