sanity-plugin-media 3.0.0 → 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 +436 -265
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +455 -285
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -19
- package/src/components/AssetGridVirtualized/index.tsx +13 -2
- package/src/components/Browser/index.tsx +30 -41
- 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/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/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 +37 -45
- 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
|
@@ -47,49 +47,42 @@ type Props = {
|
|
|
47
47
|
selected: boolean
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
const ContainerGrid = styled
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
const ContainerGrid = styled<
|
|
51
|
+
typeof Grid,
|
|
52
|
+
{$selected?: boolean; $scheme: ThemeColorSchemeKey; $updating?: boolean}
|
|
53
|
+
>(Grid)(({$scheme, $selected, $updating}) => {
|
|
54
|
+
return css`
|
|
55
|
+
align-items: center;
|
|
56
|
+
cursor: ${$selected ? 'default' : 'pointer'};
|
|
57
|
+
height: 100%;
|
|
58
|
+
pointer-events: ${$updating ? 'none' : 'auto'};
|
|
59
|
+
user-select: none;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
|
|
62
|
+
${!$updating &&
|
|
63
|
+
css`
|
|
64
|
+
@media (hover: hover) and (pointer: fine) {
|
|
65
|
+
&:hover {
|
|
66
|
+
background: ${getSchemeColor($scheme, 'bg')};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`}
|
|
70
|
+
`
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const ContextActionContainer = styled<typeof Flex, {$scheme: ThemeColorSchemeKey}>(Flex)(
|
|
74
|
+
({$scheme}) => {
|
|
61
75
|
return css`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
user-select: none;
|
|
67
|
-
white-space: nowrap;
|
|
68
|
-
|
|
69
|
-
${!updating &&
|
|
70
|
-
css`
|
|
71
|
-
@media (hover: hover) and (pointer: fine) {
|
|
72
|
-
&:hover {
|
|
73
|
-
background: ${getSchemeColor(scheme, 'bg')};
|
|
74
|
-
}
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
@media (hover: hover) and (pointer: fine) {
|
|
78
|
+
&:hover {
|
|
79
|
+
background: ${getSchemeColor($scheme, 'bg2')};
|
|
75
80
|
}
|
|
76
|
-
|
|
81
|
+
}
|
|
77
82
|
`
|
|
78
83
|
}
|
|
79
84
|
)
|
|
80
85
|
|
|
81
|
-
// @ts-expect-error - fix typings later
|
|
82
|
-
const ContextActionContainer = styled(Flex)(({scheme}: {scheme: ThemeColorSchemeKey}) => {
|
|
83
|
-
return css`
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
@media (hover: hover) and (pointer: fine) {
|
|
86
|
-
&:hover {
|
|
87
|
-
background: ${getSchemeColor(scheme, 'bg2')};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
`
|
|
91
|
-
})
|
|
92
|
-
|
|
93
86
|
const StyledWarningIcon = styled(WarningFilledIcon)(({theme}) => {
|
|
94
87
|
return {
|
|
95
88
|
color: theme.sanity.color.spot.red
|
|
@@ -181,9 +174,8 @@ const TableRowAsset = (props: Props) => {
|
|
|
181
174
|
return (
|
|
182
175
|
<ContainerGrid
|
|
183
176
|
onClick={selected ? undefined : handleClick}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
selected={selected}
|
|
177
|
+
$scheme={scheme}
|
|
178
|
+
$selected={selected}
|
|
187
179
|
style={{
|
|
188
180
|
gridColumnGap: mediaIndex < 3 ? 0 : '16px',
|
|
189
181
|
gridRowGap: 0,
|
|
@@ -191,13 +183,12 @@ const TableRowAsset = (props: Props) => {
|
|
|
191
183
|
mediaIndex < 3 ? GRID_TEMPLATE_COLUMNS.SMALL : GRID_TEMPLATE_COLUMNS.LARGE,
|
|
192
184
|
gridTemplateRows: mediaIndex < 3 ? 'auto' : '1fr'
|
|
193
185
|
}}
|
|
194
|
-
updating={item.updating}
|
|
186
|
+
$updating={item.updating}
|
|
195
187
|
>
|
|
196
188
|
{/* Picked checkbox */}
|
|
197
189
|
<ContextActionContainer
|
|
198
190
|
onClick={handleContextActionClick}
|
|
199
|
-
|
|
200
|
-
scheme={scheme}
|
|
191
|
+
$scheme={scheme}
|
|
201
192
|
style={{
|
|
202
193
|
alignItems: 'center',
|
|
203
194
|
gridColumn: 1,
|
|
@@ -247,8 +238,8 @@ const TableRowAsset = (props: Props) => {
|
|
|
247
238
|
{isImageAsset(asset) && (
|
|
248
239
|
<Image
|
|
249
240
|
draggable={false}
|
|
250
|
-
scheme={scheme}
|
|
251
|
-
showCheckerboard={!isOpaque}
|
|
241
|
+
$scheme={scheme}
|
|
242
|
+
$showCheckerboard={!isOpaque}
|
|
252
243
|
src={imageDprUrl(asset, {height: 100, width: 100})}
|
|
253
244
|
/>
|
|
254
245
|
)}
|
|
@@ -405,6 +396,7 @@ const TableRowAsset = (props: Props) => {
|
|
|
405
396
|
{error && (
|
|
406
397
|
<Box padding={2}>
|
|
407
398
|
<Tooltip
|
|
399
|
+
animate
|
|
408
400
|
content={
|
|
409
401
|
<Container padding={2} width={0}>
|
|
410
402
|
<Text size={1}>{error}</Text>
|
|
@@ -93,7 +93,12 @@ const TableRowUpload = (props: Props) => {
|
|
|
93
93
|
>
|
|
94
94
|
<Box style={{height: '100%', position: 'relative'}}>
|
|
95
95
|
{item.assetType === 'image' && item?.objectUrl && (
|
|
96
|
-
<Image
|
|
96
|
+
<Image
|
|
97
|
+
draggable={false}
|
|
98
|
+
$scheme={scheme}
|
|
99
|
+
src={item.objectUrl}
|
|
100
|
+
style={{opacity: 0.25}}
|
|
101
|
+
/>
|
|
97
102
|
)}
|
|
98
103
|
|
|
99
104
|
{item.assetType === 'file' && (
|
package/src/plugin.tsx
CHANGED