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-cjs/pane.js
CHANGED
@@ -5841,9 +5841,9 @@ const DocumentPaneProvider = React.memo((props) => {
|
|
5841
5841
|
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.");
|
5842
5842
|
}), handleChange = React.useCallback((event) => patchRef.current(event), []);
|
5843
5843
|
React.useInsertionEffect(() => {
|
5844
|
-
readOnly
|
5844
|
+
readOnly ? patchRef.current = () => {
|
5845
5845
|
throw new Error("Attempted to patch a read-only document");
|
5846
|
-
}
|
5846
|
+
} : patchRef.current = (event_0) => {
|
5847
5847
|
!editState.draft && !editState.published && telemetry2.log(CreatedDraft), patch.execute(sanity.toMutationPatches(event_0.patches), initialValue.value);
|
5848
5848
|
};
|
5849
5849
|
}, [editState.draft, editState.published, initialValue.value, patch, telemetry2, readOnly]);
|