@sanity/assist 4.4.3 → 4.4.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.esm.js +11 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assistDocument/hooks/useAssistDocumentContextValue.tsx +11 -3
package/package.json
CHANGED
|
@@ -19,6 +19,15 @@ export function useAssistDocumentContextValue(documentId: string, documentType:
|
|
|
19
19
|
return schemaType
|
|
20
20
|
}, [documentType, schema])
|
|
21
21
|
|
|
22
|
+
const {fieldRefs, fieldRefsByTypePath} = useMemo(() => {
|
|
23
|
+
const fieldRefs = getFieldRefs(documentSchemaType)
|
|
24
|
+
const fieldRefsByTypePath = asFieldRefsByTypePath(fieldRefs)
|
|
25
|
+
return {
|
|
26
|
+
fieldRefs,
|
|
27
|
+
fieldRefsByTypePath,
|
|
28
|
+
}
|
|
29
|
+
}, [documentSchemaType])
|
|
30
|
+
|
|
22
31
|
const {
|
|
23
32
|
openInspector,
|
|
24
33
|
closeInspector,
|
|
@@ -54,9 +63,6 @@ export function useAssistDocumentContextValue(documentId: string, documentType:
|
|
|
54
63
|
const {syntheticTasks, addSyntheticTask, removeSyntheticTask} =
|
|
55
64
|
useSyntheticTasks(assistableDocumentId)
|
|
56
65
|
|
|
57
|
-
const fieldRefs = getFieldRefs(documentSchemaType)
|
|
58
|
-
const fieldRefsByTypePath = asFieldRefsByTypePath(fieldRefs)
|
|
59
|
-
|
|
60
66
|
const value: AssistDocumentContextValue = useMemo(() => {
|
|
61
67
|
const base = {
|
|
62
68
|
assistableDocumentId,
|
|
@@ -96,6 +102,8 @@ export function useAssistDocumentContextValue(documentId: string, documentType:
|
|
|
96
102
|
syntheticTasks,
|
|
97
103
|
addSyntheticTask,
|
|
98
104
|
removeSyntheticTask,
|
|
105
|
+
fieldRefs,
|
|
106
|
+
fieldRefsByTypePath,
|
|
99
107
|
])
|
|
100
108
|
|
|
101
109
|
return value
|