sanity-plugin-media 3.0.2 → 3.0.3
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.js +6 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/AssetGridVirtualized/index.tsx +8 -7
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {CardAssetData, CardUploadData} from '../../types'
|
|
2
|
-
import {memo} from 'react'
|
|
2
|
+
import {memo, forwardRef} from 'react'
|
|
3
3
|
import {VirtuosoGrid} from 'react-virtuoso'
|
|
4
4
|
import {styled} from 'styled-components'
|
|
5
5
|
import useTypedSelector from '../../hooks/useTypedSelector'
|
|
@@ -33,11 +33,11 @@ const StyledItemContainer = styled.div`
|
|
|
33
33
|
width: ${CARD_WIDTH}px;
|
|
34
34
|
`
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const ItemContainer = forwardRef<HTMLDivElement, any>((props, ref) => {
|
|
37
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
38
|
const {context, ...rest} = props
|
|
39
|
-
return <StyledItemContainer {...rest} />
|
|
40
|
-
}
|
|
39
|
+
return <StyledItemContainer ref={ref} {...rest} />
|
|
40
|
+
})
|
|
41
41
|
|
|
42
42
|
const StyledListContainer = styled.div`
|
|
43
43
|
display: grid;
|
|
@@ -46,11 +46,12 @@ const StyledListContainer = styled.div`
|
|
|
46
46
|
justify-content: center;
|
|
47
47
|
margin: 0 auto;
|
|
48
48
|
`
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
const ListContainer = forwardRef<HTMLDivElement, any>((props, ref) => {
|
|
50
51
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- we're doing this to avoid sc warnings about `context` passed as an attribute
|
|
51
52
|
const {context, ...rest} = props
|
|
52
|
-
return <StyledListContainer {...rest} />
|
|
53
|
-
}
|
|
53
|
+
return <StyledListContainer ref={ref} {...rest} />
|
|
54
|
+
})
|
|
54
55
|
|
|
55
56
|
const AssetGridVirtualized = (props: Props) => {
|
|
56
57
|
const {items, onLoadMore} = props
|