sanity 3.70.1-corel.541 → 3.70.1-corel.544
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/lib/_chunks-cjs/pane.js +2 -2
- package/lib/_chunks-cjs/pane.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/pane.mjs +2 -2
- package/lib/_chunks-es/pane.mjs.map +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/lib/_legacy/pane.esm.js +2 -2
- package/lib/_legacy/pane.esm.js.map +1 -1
- package/lib/_legacy/version.esm.js +1 -1
- package/package.json +10 -10
- package/src/structure/panes/document/DocumentPaneProvider.tsx +10 -10
package/lib/_chunks-es/pane.mjs
CHANGED
@@ -5867,9 +5867,9 @@ const DocumentPaneProvider = memo((props) => {
|
|
5867
5867
|
throw new Error("Attempted to patch the Sanity document during initial render or in an `useInsertionEffect`. Input components should only call `onChange()` in a useEffect or an event handler.");
|
5868
5868
|
}), handleChange = useCallback((event) => patchRef.current(event), []);
|
5869
5869
|
useInsertionEffect(() => {
|
5870
|
-
readOnly
|
5870
|
+
readOnly ? patchRef.current = () => {
|
5871
5871
|
throw new Error("Attempted to patch a read-only document");
|
5872
|
-
}
|
5872
|
+
} : patchRef.current = (event_0) => {
|
5873
5873
|
!editState.draft && !editState.published && telemetry.log(CreatedDraft), patch.execute(toMutationPatches(event_0.patches), initialValue.value);
|
5874
5874
|
};
|
5875
5875
|
}, [editState.draft, editState.published, initialValue.value, patch, telemetry, readOnly]);
|