@sanity/assist 1.0.11 → 1.0.12
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/README.md +1 -1
- package/dist/index.esm.js +78 -43
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +78 -43
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/assistInspector/AssistInspector.tsx +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/assist",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"react": "^18.2.0",
|
|
82
82
|
"react-dom": "^18.2.0",
|
|
83
83
|
"rimraf": "^4.4.0",
|
|
84
|
-
"sanity": "^3.
|
|
84
|
+
"sanity": "^3.14.5",
|
|
85
85
|
"semantic-release": "^21.0.5",
|
|
86
86
|
"styled-components": "^5.3.9",
|
|
87
87
|
"typescript": "^5.1.3",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "^18",
|
|
92
|
-
"sanity": "^3.
|
|
92
|
+
"sanity": "^3.14.5",
|
|
93
93
|
"styled-components": "^5.2"
|
|
94
94
|
},
|
|
95
95
|
"engines": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ArrowRightIcon, CloseIcon, PlayIcon, RetryIcon} from '@sanity/icons'
|
|
2
2
|
import {Box, Button, Card, Flex, Spinner, Stack, Text} from '@sanity/ui'
|
|
3
|
-
import {useCallback, useMemo,
|
|
3
|
+
import {useCallback, useMemo, useRef} from 'react'
|
|
4
4
|
import {
|
|
5
5
|
DocumentInspectorProps,
|
|
6
6
|
PresenceOverlay,
|
|
@@ -187,7 +187,7 @@ export function AssistInspectorWrapper(props: DocumentInspectorProps) {
|
|
|
187
187
|
export function AssistInspector(props: DocumentInspectorProps) {
|
|
188
188
|
const {params} = useAiPaneRouter()
|
|
189
189
|
|
|
190
|
-
const
|
|
190
|
+
const boundary = useRef<HTMLDivElement | null>(null)
|
|
191
191
|
const pathKey = params?.[fieldPathParam]
|
|
192
192
|
const instructionKey = params?.[instructionParam]
|
|
193
193
|
const documentPane = useDocumentPane()
|
|
@@ -275,7 +275,7 @@ export function AssistInspector(props: DocumentInspectorProps) {
|
|
|
275
275
|
|
|
276
276
|
return (
|
|
277
277
|
<Flex
|
|
278
|
-
ref={
|
|
278
|
+
ref={boundary}
|
|
279
279
|
direction="column"
|
|
280
280
|
height="fill"
|
|
281
281
|
overflow="hidden"
|
|
@@ -290,7 +290,10 @@ export function AssistInspector(props: DocumentInspectorProps) {
|
|
|
290
290
|
<PresenceOverlay>
|
|
291
291
|
<Box padding={4}>
|
|
292
292
|
{selectedField && (
|
|
293
|
-
<VirtualizerScrollInstanceProvider
|
|
293
|
+
<VirtualizerScrollInstanceProvider
|
|
294
|
+
scrollElement={boundary.current}
|
|
295
|
+
containerElement={boundary}
|
|
296
|
+
>
|
|
294
297
|
<DocumentPaneProvider
|
|
295
298
|
paneKey={documentPane.paneKey}
|
|
296
299
|
index={documentPane.index}
|