sanity-plugin-media 3.0.2 → 3.0.4
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 +4 -4
- package/src/components/AssetGridVirtualized/index.tsx +8 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sanity-plugin-media",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "This version of `sanity-plugin-media` is for Sanity Studio V3.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "git@github.com:sanity-io/sanity-plugin-media.git"
|
|
22
22
|
},
|
|
23
|
-
"type": "commonjs",
|
|
24
23
|
"license": "MIT",
|
|
25
24
|
"author": "Sanity.io <hello@sanity.io>",
|
|
25
|
+
"type": "commonjs",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
28
|
"source": "./src/index.ts",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"v2-incompatible.js"
|
|
43
43
|
],
|
|
44
44
|
"scripts": {
|
|
45
|
-
"dev": "sanity dev",
|
|
46
45
|
"build": "plugin-kit verify-package --silent && pkg-utils build --strict --check --clean",
|
|
47
46
|
"clean": "rimraf dist",
|
|
47
|
+
"dev": "sanity dev",
|
|
48
48
|
"format": "prettier --write --cache --ignore-unknown .",
|
|
49
49
|
"link-watch": "plugin-kit link-watch",
|
|
50
50
|
"lint": "eslint .",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"react": "^18.3 || ^19",
|
|
120
120
|
"react-dom": "^18.3 || ^19",
|
|
121
121
|
"react-is": "^18.3 || ^19",
|
|
122
|
-
"sanity": "^3.78",
|
|
122
|
+
"sanity": "^3.78 || ^4.0.0-0",
|
|
123
123
|
"styled-components": "^6.1"
|
|
124
124
|
},
|
|
125
125
|
"engines": {
|
|
@@ -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
|