adds cloudinaryReferencePlugin #90
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Cloudinary Reference Asset Plugin
Overview
This PR introduces a new plugin mode that allows storing Cloudinary assets as document references. This approach enables reusing the same assets across multiple documents and managing them centrally.
New Features
cloudinaryReferencePlugin
for registering all required schema typescloudinaryAssetDocument
type to store Cloudinary assets as documentscloudinaryAssetReference
type to reference these asset documentsChanges
openMediaSelector
utility to support showing/hiding callbacks, so the button is disabled and shows a loading state vs being able to click it multiple times.Benefits
Testing
Tested functionality with various asset types (images, videos) and verified that references are correctly created, updated, and displayed in the Sanity Studio interface.
Screenshots
No asset selected

Asset (as image) selected

View of component's data structure in article model

View of documents stored in sanity

Data model of stored document