sanity-plugin-cloudinary 1.4.0 → 2.0.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/utils.ts","../src/components/SecretsConfigView.tsx","../src/components/asset-source/CloudinaryAssetSource.tsx","../src/components/asset-source/Icon.tsx","../src/components/VideoPlayer.tsx","../src/components/AssetDiff.tsx","../src/components/AssetPreview.tsx","../src/components/WidgetInput.tsx","../src/components/CloudinaryInput.tsx","../src/schema/cloudinaryAsset.ts","../src/components/AssetListFunctions.tsx","../src/schema/cloudinaryAssetContext.ts","../src/schema/cloudinaryAssetContextCustom.ts","../src/schema/cloudinaryAssetDerived.ts","../src/index.ts"],"sourcesContent":["import type {\n CloudinaryAsset,\n CloudinaryAssetResponse,\n CloudinaryMediaLibrary,\n InsertHandlerParams,\n} from './types'\n\nconst widgetSrc = 'https://media-library.cloudinary.com/global/all.js'\n\nexport function assetUrl(asset: Partial<Pick<CloudinaryAsset, 'url' | 'secure_url' | 'derived'>>) {\n const [derived] = asset.derived ?? []\n if (derived) {\n if (derived.secure_url) {\n return derived.secure_url\n }\n return derived.url\n }\n if (asset.secure_url) {\n return asset.secure_url\n }\n return asset.url\n}\n\nexport const openMediaSelector = (\n cloudName: string,\n apiKey: string,\n multiple: boolean,\n insertHandler: (params: InsertHandlerParams) => void,\n selectedAsset?: CloudinaryAsset,\n) => {\n loadJS(widgetSrc, () => {\n const options: Record<string, any> = {\n cloud_name: cloudName,\n api_key: apiKey,\n insert_caption: 'Select',\n multiple,\n }\n\n if (selectedAsset) {\n options['asset'] = {\n public_id: selectedAsset.public_id,\n type: selectedAsset.type,\n resource_type: selectedAsset.resource_type,\n }\n }\n\n window.cloudinary.openMediaLibrary(options, {insertHandler})\n })\n}\n\nexport const createMediaLibrary = ({\n cloudName,\n apiKey,\n inlineContainer,\n libraryCreated,\n insertHandler,\n}: {\n cloudName: string\n apiKey: string\n inlineContainer: string\n libraryCreated: (library: CloudinaryMediaLibrary) => void\n insertHandler: (params: InsertHandlerParams) => void\n}) => {\n loadJS(widgetSrc, () => {\n const options: Record<string, any> = {\n cloud_name: cloudName,\n api_key: apiKey,\n insert_caption: 'Select',\n inline_container: inlineContainer,\n remove_header: true,\n }\n\n libraryCreated(window.cloudinary.createMediaLibrary(options, {insertHandler}))\n })\n}\n\nfunction loadJS(url: string, callback: () => void) {\n const existingScript = document.getElementById('damWidget')\n if (!existingScript) {\n const script = document.createElement('script')\n script.src = url\n script.id = 'damWidget'\n document.body.appendChild(script)\n script.addEventListener('load', () => {\n callback()\n })\n }\n if (existingScript && callback) {\n return callback()\n }\n return true\n}\n\nexport function encodeSourceId(asset: CloudinaryAssetResponse): string {\n const {resource_type, public_id, type} = asset\n return btoa(JSON.stringify({public_id, resource_type, type})) // Sort keys alphabetically!\n}\n\nexport function encodeFilename(asset: CloudinaryAssetResponse) {\n return `${asset.public_id.split('/').slice(-1)[0]}.${asset.format}`\n}\n\nexport function decodeSourceId(sourceId: string): CloudinaryAssetResponse | undefined {\n let sourceIdDecoded: any\n try {\n sourceIdDecoded = JSON.parse(atob(sourceId))\n } catch {\n // Do nothing\n }\n return sourceIdDecoded\n}\n","import {SettingsView} from '@sanity/studio-secrets'\n\nexport type Secrets = {\n cloudName: string\n apiKey: string\n}\n\nconst pluginConfigKeys = [\n {\n key: 'cloudName',\n title: 'Cloud name',\n description: '',\n },\n {\n key: 'apiKey',\n title: 'API key',\n description: '',\n },\n]\n\nexport const namespace = 'cloudinary'\n\ntype Props = {\n onClose: () => void\n}\n\nconst SecretsConfigView = (props: Props) => {\n return (\n <SettingsView\n title=\"Cloudinary config\"\n namespace={namespace}\n keys={pluginConfigKeys}\n onClose={props.onClose}\n />\n )\n}\n\nexport default SecretsConfigView\n","import {PlugIcon} from '@sanity/icons'\nimport {useSecrets} from '@sanity/studio-secrets'\nimport {Box, Button, Dialog, Flex, Spinner, Stack, Text} from '@sanity/ui'\nimport {useCallback, useEffect, useRef, useState} from 'react'\nimport type {AssetSourceComponentProps, ImageAsset} from 'sanity'\nimport {styled} from 'styled-components'\n\nimport type {CloudinaryMediaLibrary, InsertHandlerParams} from '../../types'\nimport {createMediaLibrary, decodeSourceId, encodeFilename, encodeSourceId} from '../../utils'\nimport SecretsConfigView, {namespace, type Secrets} from '../SecretsConfigView'\n\nconst Widget = styled.div`\n height: 70vh;\n`\n\nexport function CloudinaryAssetSource(props: AssetSourceComponentProps) {\n const {onClose, dialogHeaderTitle} = props\n\n const [loadingMessage, setLoadingMessage] = useState<string | undefined>(\n 'Loading Cloudinary Media Libary',\n )\n const library = useRef<CloudinaryMediaLibrary | undefined>(undefined)\n const contentRef = useRef<HTMLDivElement | null>(null)\n const {secrets} = useSecrets<Secrets>(namespace)\n const cloudName = secrets?.cloudName\n const apiKey = secrets?.apiKey\n const [widgetId] = useState(() => `cloundinaryWidget-${Date.now()}`)\n const [showSettings, setShowSettings] = useState(false)\n\n const propsRef = useRef(props)\n\n useEffect(() => {\n // because we have to access props after loading js in a callback,\n // we cannot pass props as dependecnies as that will cause infinite updates\n // this takes a snapshot of props, so we can access them later\n propsRef.current = props\n }, [props])\n\n const handleClose = useCallback(() => {\n if (library.current) {\n library.current.hide()\n }\n onClose()\n }, [onClose, library])\n\n useEffect(() => {\n if (!cloudName || !apiKey) {\n return\n }\n\n createMediaLibrary({\n cloudName,\n apiKey,\n inlineContainer: `#${widgetId}`,\n libraryCreated: (lib: CloudinaryMediaLibrary) => {\n library.current = lib\n const selectedAssets = propsRef.current.selectedAssets\n const firstSelectedAsset = selectedAssets ? selectedAssets[0] : null\n\n const iframe: ChildNode | null | undefined =\n contentRef.current && contentRef.current.firstChild\n if (iframe && iframe instanceof HTMLIFrameElement) {\n setLoadingMessage(undefined)\n let asset\n if (\n propsRef.current.selectionType === 'single' &&\n firstSelectedAsset &&\n firstSelectedAsset.source &&\n firstSelectedAsset.source.id\n ) {\n asset = decodeSourceId(firstSelectedAsset.source.id)\n }\n const folder = asset\n ? {\n path: asset.public_id.split('/').slice(0, -1).join('/'),\n resource_type: 'image',\n }\n : {path: '', resource_type: 'image'}\n if (lib && contentRef.current) {\n lib.show({folder, asset})\n contentRef.current.style.visibility = 'visible'\n }\n }\n },\n insertHandler: ({assets}: InsertHandlerParams) => {\n if (!library.current) {\n return\n }\n const imageAssets = assets.filter((asset) => asset.resource_type === 'image')\n if (imageAssets.length === 0) {\n throw new Error('The selection did not contain any images.')\n }\n library.current.hide()\n propsRef.current.onSelect(\n imageAssets.map((asset) => {\n const url =\n asset.derived && asset.derived[0] ? asset.derived[0].secure_url : asset.secure_url\n return {\n kind: 'url',\n value: url,\n assetDocumentProps: {\n _type: 'sanity.imageAsset',\n originalFilename: encodeFilename(asset),\n source: {\n id: encodeSourceId(asset),\n name: `cloudinary:${cloudName}`,\n },\n } as ImageAsset,\n }\n }),\n )\n },\n })\n }, [cloudName, apiKey, widgetId])\n\n const hasConfig = apiKey && cloudName\n return (\n <Dialog\n id=\"cloudinary-asset-source\"\n header={dialogHeaderTitle ?? 'Select image from Cloudinary'}\n onClose={handleClose}\n open\n width={4}\n >\n <Box padding={4}>\n {showSettings && <SecretsConfigView onClose={() => setShowSettings(false)} />}\n <Flex flex={1} justify=\"flex-end\">\n <Button\n color=\"primary\"\n icon={PlugIcon}\n mode=\"bleed\"\n title=\"Configure\"\n onClick={() => setShowSettings(true)}\n tabIndex={0}\n text={hasConfig ? undefined : 'Configure Cloudinary plugin'}\n />\n </Flex>\n\n {hasConfig && loadingMessage && (\n <Stack gap={3}>\n <Flex align=\"center\" justify=\"center\">\n <Spinner muted />\n </Flex>\n <Text size={1} muted align=\"center\">\n {loadingMessage}\n </Text>\n </Stack>\n )}\n\n <Widget style={{visibility: 'hidden'}} ref={contentRef} id={widgetId} />\n </Box>\n </Dialog>\n )\n}\n","export function CloudinaryIcon() {\n return (\n <svg\n version=\"1.1\"\n id=\"Layer_1\"\n x=\"0px\"\n y=\"0px\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 141.732 141.747\"\n enableBackground=\"new 0 0 141.732 141.747\"\n >\n <g>\n <path\n fill=\"#0071CE\"\n d=\"M115.585,109.242c-1.609,0-3.107-1.024-3.635-2.637c-0.657-2.008,0.438-4.169,2.447-4.826\n c7.278-2.382,11.98-8.761,11.98-16.252c0-9.487-7.718-17.206-17.205-17.206c-0.659,0-1.368,0.052-2.231,0.164l-3.741,0.485\n l-0.537-3.735c-2.299-16.016-16.251-28.094-32.454-28.094c-13.395,0-25.32,8.019-30.377,20.43l-0.952,2.335l-2.52,0.046\n c-11.581,0.213-21.003,9.804-21.003,21.379c0,8.45,4.906,16.156,12.498,19.631c1.921,0.88,2.766,3.15,1.886,5.071\n c-0.88,1.921-3.149,2.764-5.07,1.887C14.363,103.202,7.703,92.766,7.703,81.331c0-14.88,11.465-27.345,26.028-28.876\n c6.71-14.03,20.773-22.965,36.477-22.965c18.796,0,35.135,13.178,39.372,31.184c13.519,0.219,24.45,11.284,24.45,24.854\n c0,10.693-6.934,20.146-17.253,23.523C116.382,109.18,115.98,109.242,115.585,109.242z\"\n />\n <path\n fill=\"#DC8327\"\n d=\"M57.12,111.02c-0.001-0.001-0.001-0.001-0.002-0.001c-0.001,0-0.002-0.001-0.003-0.001h-0.001\n c0,0-0.001-0.001-0.001-0.001l-0.001-0.001c0,0-0.001,0-0.001-0.001h-0.001l-0.001-0.001c0.001-0.001-0.001-0.001-0.001-0.001\n l-0.001-0.001c0,0-0.001,0-0.001,0l-0.001-0.001c0.001,0.001-0.001-0.001-0.001-0.001s-0.002-0.001-0.003-0.001l-0.001-0.001H57.1\n c-0.001-0.001-0.001-0.001-0.001-0.001l-0.001-0.001c-0.003-0.001-0.002-0.001-0.003-0.001c-0.001,0.001-0.001-0.001-0.002-0.001\n l-0.001-0.001c0,0-0.001-0.001-0.002-0.001l-0.001-0.001c-0.001-0.001-0.003-0.001-0.004-0.001s-0.003-0.001-0.004-0.001\n c-0.001-0.001-0.001-0.001-0.002-0.001h-0.001c-0.001-0.001-0.002-0.001-0.003-0.001c-0.001-0.001-0.003-0.001-0.003-0.001\n c-0.001,0-0.001,0-0.001,0l-0.002-0.001c-0.001,0-0.001-0.001-0.001-0.001h-0.001c-0.059-0.021-0.122-0.034-0.188-0.037h-0.002\n h-0.002c-0.001,0-0.001,0-0.002,0c0,0,0,0-0.001,0c0,0-0.001,0-0.001,0h-0.001c-0.001-0.001-0.001-0.001-0.001-0.001\n c-0.001,0-0.002,0-0.002,0c-0.001,0-0.002,0-0.002,0h-0.001h-0.001h-0.001c-0.001,0-0.002,0-0.002,0h-0.001H56.86h-0.001h-0.001\n c-0.001,0-0.001,0-0.001,0h-0.001h-0.001h-0.001h-0.001c-0.001,0-0.001,0-0.001,0c-1.656,0-3.011-1.348-3.021-3V74.29h2.567\n c0.004,0,0.009,0,0.013,0c0.393,0.017,0.661-0.285,0.661-0.648c0-0.271-0.166-0.503-0.402-0.6l-12.379-8.544\n c-0.222-0.153-0.515-0.153-0.737,0l-12.476,8.611c-0.234,0.161-0.335,0.456-0.251,0.727c0.085,0.271,0.335,0.455,0.619,0.455h2.58\n l0.002,33.674c0.013,2.328,1.883,4.228,4.262,4.288c0.027,0.003,0.053,0.005,0.08,0.005h18.481c0.004,0,0.007,0,0.011,0\n c0.17-0.003,0.324-0.071,0.438-0.18c0,0,0,0,0.001-0.001c0.002-0.002,0.004-0.004,0.005-0.005c0.001-0.001,0.002-0.001,0.003-0.003\n c0,0,0.001-0.001,0.001-0.001l0.001-0.001l0.001-0.001l0.001-0.001l0.001-0.001c0.001-0.001,0.001-0.001,0.001-0.001\n c0.002-0.001,0.001-0.001,0.002-0.002c0,0,0,0,0.001-0.001l0.001-0.001c0,0,0,0,0.001-0.001c0.112-0.116,0.182-0.273,0.183-0.447\n v-0.002v-0.001v-0.001v-0.001v-0.001v-0.001v-0.001v-0.002C57.498,111.345,57.343,111.121,57.12,111.02z\"\n />\n <path\n fill=\"#F4B21B\"\n d=\"M83.889,111.02c0,0-0.001-0.001-0.002-0.001c-0.001,0-0.002-0.001-0.003-0.001h-0.001\n c-0.001-0.001-0.001-0.001-0.001-0.001l-0.001-0.001h-0.001c0,0-0.001-0.001-0.001-0.001c0,0-0.001-0.001-0.001-0.001\n c0.001-0.001-0.001-0.001-0.002-0.001l-0.001-0.001h-0.001c-0.001,0-0.001-0.001-0.001-0.001c-0.002,0.001-0.002-0.001-0.002-0.001\n l-0.002-0.001l-0.001-0.001h-0.001c0,0-0.001-0.001-0.001-0.001l-0.001-0.001c-0.001-0.001-0.002-0.001-0.002-0.001\n c-0.001,0.001-0.001-0.001-0.003-0.001l-0.001-0.001l-0.001-0.001c0,0-0.001,0-0.002-0.001c-0.001-0.001-0.003-0.001-0.004-0.001\n s-0.003-0.001-0.004-0.001c-0.001-0.001-0.001-0.001-0.002-0.001c-0.001,0-0.001,0-0.002-0.001c0,0-0.001,0-0.002-0.001\n c-0.003-0.001-0.001-0.001-0.002-0.001c-0.003,0-0.001,0-0.002-0.001c0,0-0.001-0.001-0.002-0.001l-0.001-0.001h-0.001\n c-0.059-0.021-0.122-0.034-0.188-0.037h-0.002c-0.001,0-0.001,0-0.001,0c-0.001,0-0.002,0-0.002,0s-0.001,0-0.001,0h-0.001h-0.001\n l-0.001-0.001c-0.001,0-0.002,0-0.002,0c-0.001,0-0.002,0-0.002,0h-0.001c-0.001,0-0.001,0-0.001,0h-0.001\n c-0.001,0-0.002,0-0.002,0s-0.001,0-0.002,0h-0.001c0,0-0.001,0-0.001,0h-0.001c-0.001,0-0.001,0-0.001,0h-0.001h-0.001h-0.001\n h-0.001c-0.001,0-0.001,0-0.001,0c-1.655,0-3.01-1.348-3.02-3V81.829h2.579c0.009-0.001,0.016-0.001,0.026,0\n c0.358,0,0.648-0.29,0.648-0.648c0-0.271-0.166-0.503-0.402-0.6l-12.38-8.544c-0.222-0.153-0.515-0.153-0.737,0L57.86,80.647\n c-0.234,0.161-0.335,0.456-0.251,0.727c0.085,0.271,0.335,0.455,0.619,0.455h2.568l0.002,26.135\n c0.011,2.329,1.884,4.23,4.264,4.289c0.026,0.003,0.052,0.004,0.078,0.004h18.481c0.004,0,0.007,0,0.011,0\n c0.17-0.003,0.324-0.071,0.438-0.18c0,0,0,0,0.001-0.001c0.002-0.002,0.006-0.004,0.005-0.005c0.001-0.001,0.002-0.001,0.003-0.003\n c0.001-0.001,0.001-0.001,0.001-0.001l0.001-0.001l0.001-0.001c0,0,0.001,0,0.001-0.001l0.001-0.001\n c0.001,0,0.001-0.001,0.001-0.001c0.003-0.001,0.002-0.001,0.002-0.002c0,0,0,0,0.001-0.001c0,0,0,0,0.001-0.001\n c0,0,0,0,0.001-0.001c0.112-0.116,0.182-0.273,0.183-0.447v-0.002v-0.001v-0.001v-0.001v-0.001v-0.001v-0.001v-0.002\n C84.267,111.345,84.112,111.121,83.889,111.02z\"\n />\n <path\n fill=\"#F2D864\"\n d=\"M110.667,111.02l-0.002-0.001c-0.001,0-0.002-0.001-0.003-0.001h-0.001\n c-0.001-0.001-0.001-0.001-0.001-0.001l-0.001-0.001c-0.001,0-0.001,0-0.001-0.001h-0.001l-0.001-0.001\n c-0.001-0.001-0.001-0.001-0.001-0.001s-0.001,0-0.001-0.001h-0.001c0,0-0.001-0.001-0.001-0.001\n c-0.001,0.001-0.001-0.001-0.002-0.001c0.001-0.001-0.001-0.001-0.002-0.001l-0.001-0.001c-0.001,0-0.001,0-0.001,0\n c-0.001-0.001-0.001-0.001-0.001-0.001l-0.001-0.001c-0.003-0.001-0.002-0.001-0.002-0.001c-0.001,0.001-0.001-0.001-0.003-0.001\n l-0.001-0.001c0.001-0.001-0.001-0.001-0.002-0.001c0,0-0.001,0-0.001-0.001c-0.001-0.001-0.003-0.001-0.004-0.001\n s-0.003-0.001-0.004-0.001l-0.002-0.001c0,0-0.001,0-0.002-0.001l-0.002-0.001c-0.003-0.001-0.003-0.001-0.002-0.001\n c-0.003,0-0.003,0-0.002-0.001c-0.001,0-0.001-0.001-0.001-0.001c-0.001,0-0.002-0.001-0.002-0.001h-0.001\n c-0.059-0.021-0.122-0.034-0.188-0.037h-0.001c-0.001,0-0.002,0-0.002,0c-0.001,0-0.002,0-0.003,0h-0.001h-0.001h-0.001\n c-0.001-0.001-0.001-0.001-0.002-0.001c0,0-0.001,0-0.002,0c0,0-0.001,0-0.002,0h-0.001c0,0-0.001,0-0.001,0h-0.001\n c-0.001,0-0.002,0-0.002,0h-0.002c0,0,0,0-0.001,0c0,0-0.001,0-0.001,0h-0.001c0,0-0.001,0-0.001,0h-0.001h-0.001h-0.001H110.4\n c0,0-0.001,0-0.001,0c-1.655,0-3.01-1.348-3.02-3V89.365h2.573c0.004,0,0.009,0,0.013,0c0.365-0.009,0.661-0.285,0.661-0.648\n c0-0.271-0.166-0.503-0.402-0.6l-12.38-8.544c-0.221-0.153-0.515-0.153-0.737,0l-12.476,8.61c-0.234,0.161-0.335,0.456-0.251,0.727\n c0.085,0.271,0.335,0.455,0.619,0.455h2.573l0.002,18.599c0.013,2.329,1.885,4.231,4.264,4.289\n c0.026,0.003,0.052,0.004,0.078,0.004h18.481c0.004,0,0.007,0,0.011,0c0.17-0.003,0.324-0.071,0.438-0.18l0.001-0.001\n c0.002-0.002,0.005-0.004,0.005-0.005c0.001-0.001,0.002-0.001,0.003-0.003c0,0,0.001-0.001,0.001-0.001l0.001-0.001l0.001-0.001\n l0.001-0.001l0.001-0.001l0.001-0.001c0.003-0.001,0.001-0.001,0.002-0.002c0,0,0,0,0.001-0.001l0.001-0.001c0,0,0,0,0.001-0.001\n c0.112-0.116,0.182-0.273,0.183-0.447v-0.002v-0.001v-0.001v-0.001v-0.001v-0.001v-0.001v-0.002\n C111.045,111.345,110.889,111.121,110.667,111.02z\"\n />\n </g>\n </svg>\n )\n}\n","import type {CSSProperties} from 'react'\n\ntype PlayerKind = 'player' | 'diff'\n\nexport type VideoPlayerProps = {\n src: string\n kind: PlayerKind\n}\n\nexport default function VideoPlayer(props: VideoPlayerProps) {\n const {src} = props\n\n const style: CSSProperties = {\n width: '100%',\n height: 'auto',\n }\n\n return (\n <video controls aria-label=\"Cloudinary video preview\" style={style}>\n <source src={src} type=\"video/mp4\" />\n <track kind=\"captions\" />\n </video>\n )\n}\n","import {DiffFromTo} from 'sanity'\n\nimport type {CloudinaryAsset} from '../types'\nimport {assetUrl} from '../utils'\nimport VideoPlayer from './VideoPlayer'\n\ntype Props = {\n value: CloudinaryAsset | undefined\n}\n\nconst CloudinaryDiffPreview = ({value}: Props) => {\n if (!value) {\n return null\n }\n\n const url = assetUrl(value)\n\n if (value.resource_type === 'video' && url) {\n return (\n <section\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n }}\n >\n <VideoPlayer src={url} kind=\"diff\" />\n </section>\n )\n }\n\n return <img alt=\"preview\" src={url} style={{maxWidth: '100%', height: 'auto'}} />\n}\n\ntype DiffProps = {\n diff: any\n schemaType: any\n}\n\nconst AssetDiff = ({diff, schemaType}: DiffProps) => {\n return <DiffFromTo diff={diff} schemaType={schemaType} previewComponent={CloudinaryDiffPreview} />\n}\n\nexport default AssetDiff\n","import {DocumentIcon} from '@sanity/icons'\nimport {Flex, Text} from '@sanity/ui'\n\nimport type {CloudinaryAsset} from '../types'\nimport {assetUrl} from '../utils'\nimport VideoPlayer from './VideoPlayer'\n\ninterface ComponentProps {\n layout?: 'default' | 'block'\n value: CloudinaryAsset | undefined\n}\n\nconst AssetPreview = ({value, layout}: ComponentProps) => {\n const url = value && assetUrl(value)\n if (!value || !url) {\n return null\n }\n\n switch (value.resource_type) {\n case 'video':\n return (\n <Flex\n align=\"center\"\n style={{\n maxWidth: layout === 'default' ? '80px' : '100%',\n }}\n >\n <VideoPlayer src={url} kind=\"player\" />\n </Flex>\n )\n case 'raw':\n return (\n <Flex align=\"center\">\n <DocumentIcon />\n <Text size={1} style={{marginLeft: '0.5em'}}>\n {value.display_name ?? 'Raw file'}\n </Text>\n </Flex>\n )\n default:\n return (\n <Flex align=\"center\">\n <img\n alt=\"preview\"\n src={\n // Cloudinary returns resource_type as \"image\" even for PDFs,\n // so we check the format to handle PDFs specifically.\n // If it's a PDF, convert the first page to JPG and overlay a \"PDF\" label for thumbnail clarity.\n value.format === 'pdf'\n ? url?.replace(\n 'image/upload',\n 'image/upload/f_jpg,pg_1,l_text:Verdana_75_letter_spacing_14:PDF',\n )\n : url\n }\n style={{\n maxWidth: layout === 'default' ? '80px' : '100%',\n height: 'auto',\n }}\n />\n </Flex>\n )\n }\n}\n\nexport default AssetPreview\n","import {PlugIcon} from '@sanity/icons'\nimport {Button, Flex, Grid, Stack} from '@sanity/ui'\nimport {useCallback} from 'react'\nimport {type ObjectInputProps, PatchEvent, unset} from 'sanity'\nimport {styled} from 'styled-components'\n\nimport type {CloudinaryAsset} from '../types'\nimport AssetPreview from './AssetPreview'\n\nconst SetupButtonContainer = styled.div`\n position: relative;\n display: block;\n font-size: 0.8em;\n transform: translate(0%, -10%);\n`\n\ntype WidgetInputProps = ObjectInputProps & {openMediaSelector: () => void; onSetup: () => void}\n\nconst WidgetInput = (props: WidgetInputProps) => {\n const {onChange, readOnly, value, openMediaSelector} = props\n\n const removeValue = useCallback(() => {\n onChange(PatchEvent.from([unset()]))\n }, [onChange])\n\n return (\n <Stack>\n <SetupButtonContainer>\n <Flex flex={1} justify=\"flex-end\">\n <Button\n color=\"primary\"\n icon={PlugIcon}\n mode=\"bleed\"\n title=\"Configure\"\n onClick={props.onSetup}\n tabIndex={0}\n />\n </Flex>\n </SetupButtonContainer>\n\n <Flex style={{textAlign: 'center', width: '100%'}} marginBottom={2}>\n <AssetPreview value={value as CloudinaryAsset} />\n </Flex>\n\n <Grid gap={1} style={{gridTemplateColumns: 'repeat(auto-fit, minmax(100px, 1fr))'}}>\n <Button\n disabled={readOnly}\n mode=\"ghost\"\n title=\"Select an asset\"\n tone=\"default\"\n onClick={openMediaSelector}\n text=\"Select…\"\n />\n <Button\n disabled={readOnly || !value}\n tone=\"critical\"\n mode=\"ghost\"\n title=\"Remove asset\"\n text=\"Remove\"\n onClick={removeValue}\n />\n </Grid>\n </Stack>\n )\n}\n\nexport default WidgetInput\n","import {useSecrets} from '@sanity/studio-secrets'\nimport {nanoid} from 'nanoid'\nimport {useCallback, useState} from 'react'\nimport {type ObjectInputProps, PatchEvent, set} from 'sanity'\n\nimport type {CloudinaryAsset, CloudinaryAssetResponse, InsertHandlerParams} from '../types'\nimport {openMediaSelector} from '../utils'\nimport SecretsConfigView, {namespace, type Secrets} from './SecretsConfigView'\nimport WidgetInput from './WidgetInput'\n\nconst CloudinaryInput = (props: ObjectInputProps) => {\n const [showSettings, setShowSettings] = useState(false)\n const {secrets} = useSecrets<Secrets>(namespace)\n const {onChange, schemaType: type} = props\n const value = (props.value as CloudinaryAsset) || undefined\n const valueKey = value?._key\n\n const handleSelect = useCallback(\n (payload: InsertHandlerParams) => {\n const [asset] = payload.assets\n\n if (!asset) {\n return\n }\n\n let updatedAsset = asset\n\n // Update the asset with the new custom values\n const assetWithoutNulls = Object.fromEntries(\n Object.entries(asset).filter(([_, assetValue]) => assetValue !== null),\n ) as CloudinaryAssetResponse\n\n // Ensure we preserve the required fields from the original asset\n const requiredFields = {\n public_id: asset.public_id,\n resource_type: asset.resource_type,\n type: asset.type,\n url: asset.url,\n secure_url: asset.secure_url,\n format: asset.format,\n width: asset.width,\n height: asset.height,\n bytes: asset.bytes,\n tags: asset.tags,\n }\n updatedAsset = {\n ...assetWithoutNulls,\n ...requiredFields,\n }\n\n //The metadata in Sanity Studio cannot contain special characters,\n //hence the cloudinary metadata (context) needs to be transformed to valid object keys\n if (asset.context) {\n const objectWithRenamedKeys = Object.fromEntries(\n Object.entries(asset.context.custom).map(([contextKey, contextValue]) => {\n return [contextKey.replace(/[^a-zA-Z0-9_]|-/g, '_'), contextValue]\n }),\n )\n\n // Update the asset with the new custom values\n updatedAsset = {\n ...updatedAsset,\n context: {\n ...asset.context,\n custom: objectWithRenamedKeys,\n },\n }\n }\n\n // Handle derived field - only include if not null\n if (asset.derived) {\n const derivedWithType = asset.derived.map((derivedItem) => ({\n _type: 'derived',\n url: derivedItem.url,\n secure_url: derivedItem.secure_url,\n raw_transformation: derivedItem.raw_transformation,\n }))\n\n updatedAsset = {\n ...updatedAsset,\n derived: derivedWithType,\n }\n }\n\n onChange(\n PatchEvent.from([\n set(\n Object.assign(\n {\n _type: type.name,\n _version: 1,\n _key: valueKey || nanoid(),\n },\n updatedAsset,\n ),\n ),\n ]),\n )\n },\n [onChange, type, valueKey],\n )\n\n const action = secrets\n ? () =>\n openMediaSelector(\n secrets.cloudName,\n secrets.apiKey,\n false, // single selection\n handleSelect,\n value,\n )\n : () => setShowSettings(true)\n\n return (\n <>\n {showSettings && <SecretsConfigView onClose={() => setShowSettings(false)} />}\n <WidgetInput onSetup={() => setShowSettings(true)} openMediaSelector={action} {...props} />\n </>\n )\n}\n\nexport default CloudinaryInput\n","import {defineType} from 'sanity'\n\nimport AssetDiff from '../components/AssetDiff'\nimport AssetPreview from '../components/AssetPreview'\nimport CloudinaryInput from '../components/CloudinaryInput'\n\nexport const cloudinaryAssetSchema = defineType({\n type: 'object',\n name: 'cloudinary.asset',\n fields: [\n {\n type: 'string',\n name: 'public_id',\n },\n {\n type: 'string',\n name: 'resource_type',\n // \"image\", \"?\"\n },\n {\n type: 'string',\n name: 'type',\n // \"upload\", \"?\"\n },\n {\n type: 'string',\n name: 'format',\n // \"jpg\"\n },\n {\n type: 'number',\n name: 'version',\n },\n {\n type: 'url',\n name: 'url',\n },\n {\n type: 'url',\n name: 'secure_url',\n },\n {\n type: 'number',\n name: 'width',\n },\n {\n type: 'number',\n name: 'height',\n },\n {\n type: 'number',\n name: 'bytes',\n },\n {\n type: 'number',\n name: 'duration',\n // can be null\n },\n {\n type: 'array',\n name: 'tags',\n of: [{type: 'string'}],\n },\n {\n type: 'datetime',\n name: 'created_at',\n },\n {\n type: 'array',\n name: 'derived',\n of: [{type: 'cloudinary.assetDerived', name: 'derived'}],\n },\n {\n type: 'string',\n name: 'access_mode',\n },\n {\n type: 'cloudinary.assetContext',\n name: 'context',\n },\n // metadata array of unknown content\n ],\n // The custom preview component receives legacy props that don't match the\n // PreviewProps type, so the components block is widened to keep type checking happy.\n ...({\n components: {\n input: CloudinaryInput,\n diff: AssetDiff,\n preview: AssetPreview,\n },\n } as {}),\n preview: {\n select: {\n url: 'url',\n resource_type: 'resource_type',\n derived: 'derived.0.url',\n },\n prepare({url, derived, resource_type}) {\n return {\n title: url,\n value: {\n title: url,\n resource_type,\n url: derived || url,\n },\n }\n },\n },\n})\n","import {PlugIcon} from '@sanity/icons'\nimport {useSecrets} from '@sanity/studio-secrets'\nimport {Box, Button, Flex} from '@sanity/ui'\nimport {useCallback, useState} from 'react'\nimport {\n type ArrayInputFunctionsProps,\n ArrayOfObjectsFunctions,\n type ArraySchemaType,\n insert,\n type ObjectSchemaType,\n PatchEvent,\n setIfMissing,\n} from 'sanity'\n\nimport {cloudinaryAssetSchema} from '../schema/cloudinaryAsset'\nimport type {InsertHandlerParams} from '../types'\nimport {openMediaSelector} from '../utils'\nimport SecretsConfigView, {namespace} from './SecretsConfigView'\n\ninterface ApiConfig {\n cloudName: string\n apiKey: string\n}\n\nexport const AssetListFunctions = (\n props: ArrayInputFunctionsProps<{_key: string}, ArraySchemaType>,\n) => {\n const {onValueCreate, onChange} = props\n\n const {secrets, loading} = useSecrets<ApiConfig>(namespace)\n const [showSettings, setShowSettings] = useState(false)\n\n const show = useCallback(() => setShowSettings(true), [setShowSettings])\n const hide = useCallback(() => setShowSettings(false), [setShowSettings])\n\n const cloudinaryType = props.schemaType.of.find(\n (t: {name: string}) => t.name === cloudinaryAssetSchema.name,\n ) as ObjectSchemaType | undefined\n\n if (!cloudinaryType) {\n throw new Error(`AssetListFunctions can only be used in array.of ${\n cloudinaryAssetSchema.name\n }, but it was array.of\n ${props.schemaType.of.map((t) => t.name).join(', ')}`)\n }\n\n const handleSelect = useCallback(\n (selected: InsertHandlerParams) => {\n const items = selected.assets.map((asset) =>\n Object.assign(\n {},\n asset,\n {\n // Schema version. In case we ever change our schema.\n _version: 1,\n },\n onValueCreate(cloudinaryType as any), // onValueCreate is mistyped\n ),\n )\n onChange(PatchEvent.from([setIfMissing([]), insert(items, 'after', [-1])]))\n },\n [onValueCreate, onChange, cloudinaryType],\n )\n\n const handleOpenSelector = useCallback(\n () =>\n secrets &&\n openMediaSelector(\n secrets.cloudName,\n secrets.apiKey,\n true, // multi-selection\n handleSelect,\n ),\n [secrets, handleSelect],\n )\n return (\n <Flex gap={2} flex={1}>\n {showSettings && <SecretsConfigView onClose={hide} />}\n <Box flex={1}>\n <ArrayOfObjectsFunctions {...props} />\n </Box>\n {cloudinaryType && (\n <>\n <Box flex={1}>\n <Button\n style={{width: '100%'}}\n disabled={props.readOnly || loading}\n mode=\"bleed\"\n text=\"Add multiple\"\n onClick={handleOpenSelector}\n />\n </Box>\n <Box>\n <Button onClick={show} icon={PlugIcon} mode=\"bleed\" title={'Configure'} />\n </Box>\n </>\n )}\n </Flex>\n )\n}\n","import {defineType} from 'sanity'\n\nexport interface CloudinaryAssetContext {\n custom: object\n}\n\nexport const cloudinaryAssetContext = defineType({\n type: 'object',\n name: 'cloudinary.assetContext',\n fields: [\n {\n type: 'cloudinary.assetContextCustom',\n name: 'custom',\n },\n ],\n})\n","import {defineType} from 'sanity'\n\nexport type CloudinaryAssetContextCustom = {\n alt: string\n caption: string\n}\n\nexport const cloudinaryAssetContextCustom = defineType({\n type: 'object',\n name: 'cloudinary.assetContextCustom',\n fields: [\n {\n type: 'string',\n name: 'alt',\n },\n {\n type: 'string',\n name: 'caption',\n },\n ],\n})\n","import {defineType} from 'sanity'\n\nexport type CloudinaryAssetDerived = {\n raw_transformation: string\n url: string\n secure_url: string\n}\n\nexport const cloudinaryAssetDerivedSchema = defineType({\n type: 'object',\n name: 'cloudinary.assetDerived',\n fields: [\n {\n type: 'string',\n name: 'raw_transformation',\n },\n {\n type: 'url',\n name: 'url',\n },\n {\n type: 'url',\n name: 'secure_url',\n },\n ],\n})\n","import {type AssetSource, definePlugin, isArrayOfObjectsInputProps} from 'sanity'\n\nimport {CloudinaryAssetSource} from './components/asset-source/CloudinaryAssetSource'\nimport {CloudinaryIcon} from './components/asset-source/Icon'\nimport {AssetListFunctions} from './components/AssetListFunctions'\nimport {cloudinaryAssetSchema} from './schema/cloudinaryAsset'\nimport {cloudinaryAssetContext} from './schema/cloudinaryAssetContext'\nimport {cloudinaryAssetContextCustom} from './schema/cloudinaryAssetContextCustom'\nimport {cloudinaryAssetDerivedSchema} from './schema/cloudinaryAssetDerived'\n\nexport {type CloudinaryAssetContext} from './schema/cloudinaryAssetContext'\nexport {type CloudinaryAssetDerived} from './schema/cloudinaryAssetDerived'\nexport {type CloudinaryAssetContextCustom} from './schema/cloudinaryAssetContextCustom'\n\nexport type {AssetDocument, CloudinaryAsset} from './types'\n\nexport {\n cloudinaryAssetSchema,\n cloudinaryAssetDerivedSchema,\n cloudinaryAssetContext,\n cloudinaryAssetContextCustom,\n}\n\nexport const cloudinarySchemaPlugin = definePlugin({\n name: 'cloudinary-schema',\n form: {\n components: {\n input: (props) => {\n if (isArrayOfObjectsInputProps(props)) {\n const cloudinaryType = props.schemaType.of.find(\n (t: {name: string}) => t.name === cloudinaryAssetSchema.name,\n )\n if (cloudinaryType) {\n return props.renderDefault({...props, arrayFunctions: AssetListFunctions})\n }\n }\n return props.renderDefault(props)\n },\n },\n },\n schema: {\n types: [\n cloudinaryAssetSchema,\n cloudinaryAssetDerivedSchema,\n cloudinaryAssetContext,\n cloudinaryAssetContextCustom,\n ],\n },\n})\n\nexport const cloudinaryImageSource: AssetSource = {\n name: 'cloudinary-image',\n title: 'Cloudinary',\n icon: CloudinaryIcon,\n component: CloudinaryAssetSource,\n}\n\nexport const cloudinaryAssetSourcePlugin = definePlugin({\n name: 'cloudinart-asset-source',\n form: {\n image: {\n assetSources: [cloudinaryImageSource],\n },\n },\n})\n"],"names":["widgetSrc","assetUrl","asset","derived","secure_url","url","openMediaSelector","cloudName","apiKey","multiple","insertHandler","selectedAsset","loadJS","options","cloud_name","api_key","insert_caption","public_id","type","resource_type","window","cloudinary","openMediaLibrary","createMediaLibrary","inlineContainer","libraryCreated","inline_container","remove_header","callback","existingScript","document","getElementById","script","createElement","src","id","body","appendChild","addEventListener","encodeSourceId","btoa","JSON","stringify","encodeFilename","split","slice","format","decodeSourceId","sourceId","sourceIdDecoded","parse","atob","pluginConfigKeys","key","title","description","namespace","SecretsConfigView","props","$","_c","t0","onClose","Widget","styled","div","withConfig","displayName","componentId","CloudinaryAssetSource","dialogHeaderTitle","loadingMessage","setLoadingMessage","useState","library","useRef","undefined","contentRef","secrets","useSecrets","widgetId","_temp","showSettings","setShowSettings","propsRef","t1","current","useEffect","t2","hide","handleClose","t3","t4","lib","selectedAssets","firstSelectedAsset","iframe","firstChild","HTMLIFrameElement","selectionType","source","folder","path","join","show","style","visibility","t5","assets","imageAssets","filter","_temp2","length","Error","onSelect","map","asset_1","kind","value","assetDocumentProps","_type","originalFilename","name","hasConfig","t6","t7","for","t8","t9","PlugIcon","t10","t11","t12","t13","t14","asset_0","Date","now","CloudinaryIcon","Symbol","VideoPlayer","width","height","CloudinaryDiffPreview","display","flexWrap","justifyContent","maxWidth","AssetDiff","diff","schemaType","AssetPreview","layout","marginLeft","display_name","replace","SetupButtonContainer","WidgetInput","onChange","readOnly","PatchEvent","from","unset","removeValue","onSetup","textAlign","gridTemplateColumns","CloudinaryInput","valueKey","_key","payload","updatedAsset","assetWithoutNulls","Object","fromEntries","entries","requiredFields","bytes","tags","context","objectWithRenamedKeys","custom","derivedWithType","_temp3","set","assign","_version","nanoid","handleSelect","action","assetValue","contextKey","contextValue","derivedItem","raw_transformation","cloudinaryAssetSchema","defineType","fields","of","components","input","preview","select","prepare","AssetListFunctions","onValueCreate","loading","find","cloudinaryType","selected","items","setIfMissing","insert","handleOpenSelector","t","t_0","cloudinaryAssetContext","cloudinaryAssetContextCustom","cloudinaryAssetDerivedSchema","cloudinarySchemaPlugin","definePlugin","form","isArrayOfObjectsInputProps","renderDefault","arrayFunctions","schema","types","cloudinaryImageSource","icon","component","cloudinaryAssetSourcePlugin","image","assetSources"],"mappings":";;;;;;;;;AAOA,MAAMA,YAAY;AAEX,SAASC,SAASC,OAAyE;AAChG,QAAM,CAACC,OAAO,IAAID,MAAMC,WAAW,CAAA;AACnC,SAAIA,UACEA,QAAQC,aACHD,QAAQC,aAEVD,QAAQE,MAEbH,MAAME,aACDF,MAAME,aAERF,MAAMG;AACf;AAEO,MAAMC,oBAAoBA,CAC/BC,WACAC,QACAC,UACAC,eACAC,kBACG;AACHC,SAAOZ,WAAW,MAAM;AACtB,UAAMa,UAA+B;AAAA,MACnCC,YAAYP;AAAAA,MACZQ,SAASP;AAAAA,MACTQ,gBAAgB;AAAA,MAChBP;AAAAA,IAAAA;AAGEE,sBACFE,QAAQ,QAAW;AAAA,MACjBI,WAAWN,cAAcM;AAAAA,MACzBC,MAAMP,cAAcO;AAAAA,MACpBC,eAAeR,cAAcQ;AAAAA,IAAAA,IAIjCC,OAAOC,WAAWC,iBAAiBT,SAAS;AAAA,MAACH;AAAAA,IAAAA,CAAc;AAAA,EAC7D,CAAC;AACH,GAEaa,qBAAqBA,CAAC;AAAA,EACjChB;AAAAA,EACAC;AAAAA,EACAgB;AAAAA,EACAC;AAAAA,EACAf;AAOF,MAAM;AACJE,SAAOZ,WAAW,MAAM;AACtB,UAAMa,UAA+B;AAAA,MACnCC,YAAYP;AAAAA,MACZQ,SAASP;AAAAA,MACTQ,gBAAgB;AAAA,MAChBU,kBAAkBF;AAAAA,MAClBG,eAAe;AAAA,IAAA;AAGjBF,mBAAeL,OAAOC,WAAWE,mBAAmBV,SAAS;AAAA,MAACH;AAAAA,IAAAA,CAAc,CAAC;AAAA,EAC/E,CAAC;AACH;AAEA,SAASE,OAAOP,KAAauB,UAAsB;AACjD,QAAMC,iBAAiBC,SAASC,eAAe,WAAW;AAC1D,MAAI,CAACF,gBAAgB;AACnB,UAAMG,SAASF,SAASG,cAAc,QAAQ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AAA,IACJU,OAAO;AAAA,MACLC,cAAc,CAACL,qBAAqB;AAAA,IAAA;AAAA,EACtC;AAEJ,CAAC;"}
package/package.json CHANGED
@@ -1,95 +1,60 @@
1
1
  {
2
2
  "name": "sanity-plugin-cloudinary",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "description": "Cloudinary integration for Sanity Studio V3.",
5
5
  "keywords": [
6
6
  "sanity",
7
7
  "sanity-plugin"
8
8
  ],
9
- "homepage": "https://github.com/sanity-io/sanity-plugin-cloudinary#readme",
9
+ "homepage": "https://github.com/sanity-io/plugins/tree/main/plugins/sanity-plugin-cloudinary#readme",
10
10
  "bugs": {
11
- "url": "https://github.com/sanity-io/sanity-plugin-cloudinary/issues"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "git@github.com:sanity-io/sanity-plugin-cloudinary.git"
11
+ "url": "https://github.com/sanity-io/plugins/issues"
16
12
  },
17
13
  "license": "MIT",
18
14
  "author": "Sanity.io <hello@sanity.io>",
19
- "exports": {
20
- ".": {
21
- "types": "./lib/index.d.ts",
22
- "source": "./src/index.ts",
23
- "require": "./lib/index.js",
24
- "import": "./lib/index.esm.js",
25
- "default": "./lib/index.esm.js"
26
- },
27
- "./package.json": "./package.json"
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+ssh://git@github.com/sanity-io/plugins.git",
18
+ "directory": "plugins/sanity-plugin-cloudinary"
28
19
  },
29
- "main": "./lib/index.js",
30
- "module": "./lib/index.esm.js",
31
- "source": "./src/index.ts",
32
- "types": "./lib/index.d.ts",
33
20
  "files": [
34
- "lib",
35
- "sanity.json",
36
- "src",
37
- "v2-incompatible.js"
21
+ "dist"
38
22
  ],
39
- "scripts": {
40
- "build": "run-s clean && plugin-kit verify-package --silent && pkg-utils build --strict && pkg-utils --strict",
41
- "clean": "rimraf lib",
42
- "link-watch": "plugin-kit link-watch",
43
- "lint": "eslint .",
44
- "prepare": "husky install",
45
- "prepublishOnly": "run-s build",
46
- "watch": "pkg-utils watch --strict",
47
- "format": "prettier --write --cache --ignore-unknown ."
23
+ "type": "module",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": "./dist/index.js",
27
+ "./package.json": "./package.json"
48
28
  },
49
29
  "dependencies": {
50
- "@sanity/icons": "^3.7.0",
51
- "@sanity/incompatible-plugin": "^1.0.5",
52
- "@sanity/studio-secrets": "^3.0.1",
53
- "@sanity/ui": "^2.15.2",
54
- "nanoid": "^4.0.0"
30
+ "@sanity/icons": "^3.7.4",
31
+ "@sanity/ui": "^3.2.0",
32
+ "nanoid": "^4.0.0",
33
+ "@sanity/studio-secrets": "^4.0.5"
55
34
  },
56
35
  "devDependencies": {
57
- "@commitlint/cli": "^17.8.1",
58
- "@commitlint/config-conventional": "^17.8.1",
59
- "@sanity/pkg-utils": "^2.4.10",
60
- "@sanity/plugin-kit": "^3.1.10",
61
- "@sanity/semantic-release-preset": "^4.1.6",
62
- "@types/react": "^19.0.10",
63
- "@typescript-eslint/eslint-plugin": "^5.62.0",
64
- "@typescript-eslint/parser": "^5.62.0",
65
- "eslint": "^8.52.0",
66
- "eslint-config-prettier": "^8.10.0",
67
- "eslint-config-sanity": "^6.0.0",
68
- "eslint-plugin-prettier": "^4.2.1",
69
- "eslint-plugin-react": "^7.33.2",
70
- "eslint-plugin-react-hooks": "^4.6.0",
71
- "husky": "^8.0.1",
72
- "lint-staged": "^13.0.3",
73
- "npm-run-all": "^4.1.5",
74
- "postcss": "^8.0.0",
75
- "prettier": "^2.8.8",
76
- "prettier-plugin-packagejson": "^2.4.6",
77
- "react": "^19.0.0",
78
- "react-dom": "^19.0.0",
79
- "react-is": "^19.0.0",
80
- "rimraf": "^5.0.0",
81
- "sanity": "^3.78.1",
82
- "semantic-release": "^22.0.12",
83
- "styled-components": "^6.1.15",
84
- "typescript": "^5.2.2"
36
+ "@sanity/pkg-utils": "^10.5.7",
37
+ "@types/react": "^19.2.17",
38
+ "@types/react-dom": "^19.2.3",
39
+ "babel-plugin-react-compiler": "^1.0.0",
40
+ "babel-plugin-styled-components": "^2.3.0",
41
+ "react": "^19.2.7",
42
+ "react-dom": "^19.2.7",
43
+ "sanity": "^6.1.0",
44
+ "styled-components": "^6.4.2",
45
+ "@repo/package.config": "0.0.0",
46
+ "@repo/tsconfig": "0.0.0"
85
47
  },
86
48
  "peerDependencies": {
87
- "react": "^18.3 || ^19",
88
- "react-dom": "^18.3 || ^19",
89
- "sanity": "^3 || ^4.0.0-0",
90
- "styled-components": "^6.0"
49
+ "react": "^19.2",
50
+ "react-dom": "^19.2",
51
+ "sanity": "^5 || ^6.0.0-0",
52
+ "styled-components": "^6.1"
91
53
  },
92
54
  "engines": {
93
- "node": ">=14"
55
+ "node": ">=20.19 <22 || >=22.12"
56
+ },
57
+ "scripts": {
58
+ "build": "pkg build --strict --check --clean"
94
59
  }
95
- }
60
+ }
package/lib/index.d.ts DELETED
@@ -1,93 +0,0 @@
1
- import {AssetSource} from 'sanity'
2
- import {ObjectDefinition} from 'sanity'
3
- import {Plugin as Plugin_2} from 'sanity'
4
- import {PreviewConfig} from 'sanity'
5
-
6
- export declare type AssetDocument = {
7
- _id: string
8
- label?: string
9
- title?: string
10
- description?: string
11
- source?: {
12
- id: string
13
- name: string
14
- url?: string
15
- }
16
- creditLine?: string
17
- originalFilename?: string
18
- }
19
-
20
- export declare type CloudinaryAsset = {
21
- _type: string
22
- _key?: string
23
- _version: number
24
- public_id: string
25
- resource_type: string
26
- type: string
27
- format: string
28
- version: number
29
- url: string
30
- secure_url: string
31
- derived?: CloudinaryAssetDerived[]
32
- display_name?: string
33
- }
34
-
35
- export declare interface CloudinaryAssetContext {
36
- custom: object
37
- }
38
-
39
- export declare const cloudinaryAssetContext: {
40
- type: 'object'
41
- name: 'cloudinary.assetContext'
42
- } & Omit<ObjectDefinition, 'preview'> & {
43
- preview?: PreviewConfig<Record<string, string>, Record<never, any>> | undefined
44
- }
45
-
46
- export declare type CloudinaryAssetContextCustom = {
47
- alt: string
48
- caption: string
49
- }
50
-
51
- export declare const cloudinaryAssetContextCustom: {
52
- type: 'object'
53
- name: 'cloudinary.assetContextCustom'
54
- } & Omit<ObjectDefinition, 'preview'> & {
55
- preview?: PreviewConfig<Record<string, string>, Record<never, any>> | undefined
56
- }
57
-
58
- export declare type CloudinaryAssetDerived = {
59
- raw_transformation: string
60
- url: string
61
- secure_url: string
62
- }
63
-
64
- export declare const cloudinaryAssetDerivedSchema: {
65
- type: 'object'
66
- name: 'cloudinary.assetDerived'
67
- } & Omit<ObjectDefinition, 'preview'> & {
68
- preview?: PreviewConfig<Record<string, string>, Record<never, any>> | undefined
69
- }
70
-
71
- export declare const cloudinaryAssetSchema: {
72
- type: 'object'
73
- name: 'cloudinary.asset'
74
- } & Omit<ObjectDefinition, 'preview'> & {
75
- preview?:
76
- | PreviewConfig<
77
- {
78
- url: string
79
- resource_type: string
80
- derived: string
81
- },
82
- Record<'url' | 'derived' | 'resource_type', any>
83
- >
84
- | undefined
85
- }
86
-
87
- export declare const cloudinaryAssetSourcePlugin: Plugin_2<void>
88
-
89
- export declare const cloudinaryImageSource: AssetSource
90
-
91
- export declare const cloudinarySchemaPlugin: Plugin_2<void>
92
-
93
- export {}