sanity-plugin-markdown 8.0.5 → 8.0.6

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.
@@ -1,6 +1,6 @@
1
1
  import { Plugin, StringDefinition, StringInputProps } from "sanity";
2
- import { SimpleMDEReactProps } from "react-simplemde-editor";
3
2
  import { Options } from "easymde";
3
+ import { SimpleMDEReactProps } from "react-simplemde-editor";
4
4
  /**
5
5
  * Used to tag types that is set to `any` as a temporary measure, but should be replaced with proper typings in the future
6
6
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"commonExports.d.ts","names":["ClientPerspective","ClientPerspective_2","ContentSourceMapDocuments","ContentSourceMapDocuments_2","ContentSourceMapParsedPath","ContentSourceMapParsedPathKeyedSegment","HttpContext","Observable","Requester","ResolveStudioUrl","StudioBaseRoute","StudioBaseUrl","StudioUrl","adapter","unstable__adapter","environment","unstable__environment","Action","CreateAction","ReplaceDraftAction","EditAction","DeleteAction","DiscardAction","PublishAction","UnpublishAction","VersionAction","ReleaseAction","ActionError","ActionErrorItem","type","description","items","error","value","index","AgentActionAsync","async","AgentActionParam","TParamConfig","ConstantAgentActionParam","FieldAgentActionParam","DocumentAgentActionParam","GroqAgentActionParam","docIdRequired","AgentActionParams","Record","AgentActionPath","AgentActionPathSegment","_key","AgentActionRequestBase","AgentActionSchema","localeSettings","locale","timeZone","temperature","schemaId","forcePublishedWrite","conditionalPaths","defaultReadOnly","defaultHidden","paths","path","readOnly","hidden","AgentActionsClient","DocumentShape","SanityClient","HttpRequest","Any","GenerateInstruction","request","IdentifiedSanityDocumentStub","Promise","TransformDocument","TranslateDocument","PromptRequest","PatchDocument","private","constructor","client","httpRequest","generate","_id","transform","translate","prompt","patch","AgentActionSync","noWrite","AgentActionTarget","AgentActionTypeConfig","maxPathDepth","exclude","types","AgentActionTargetInclude","include","AllDocumentIdsMutationOptions","BaseMutationOptions","returnFirst","returnDocuments","AllDocumentsMutationOptions","AnimatedImageFormat","AnimatedTransformOptions","width","height","start","end","fps","format","AnyNonNullable","Exclude","ApiError","message","statusCode","ArchiveReleaseAction","actionType","releaseId","AssetMetadataType","AssetsClient","UploadBody","UploadClientConfig","SanityAssetDocument","SanityImageAssetDocument","upload","assetType","body","options","AttributeSet","key","AuthProvider","name","title","url","AuthProviderResponse","providers","BaseActionOptions","RequestOptions","transactionId","skipCrossDatasetReferenceValidation","dryRun","visibility","autoGenerateArrayKeys","BasePatch","PatchSelection","PatchOperations","PatchMutationOperation","selection","operations","set","attrs","setIfMissing","diffMatchPatch","unset","inc","dec","insert","at","selector","append","prepend","splice","deleteCount","ifRevisionId","rev","serialize","toJSON","reset","_assign","op","props","merge","_set","BaseTransaction","R","Mutation","SanityDocumentStub","trxId","create","doc","createIfNotExists","createOrReplace","delete","documentId","id","_add","mut","ChannelError","Error","data","ChannelErrorEvent","ClientConfig","ClientConfigResource","RegExp","Array","ResponseQueryOptions","StegaConfig","projectId","dataset","useCdn","token","resource","perspective","apiHost","apiVersion","proxy","requestTagPrefix","headers","ignoreBrowserTokenWarning","ignoreWarnings","withCredentials","allowReconfigure","timeout","maxRetries","retryDelay","attemptNumber","useProjectHostname","requester","resultSourceMap","fetch","cache","next","stega","lineage","ClientError","ErrorProps","response","responseBody","details","res","context","DeprecatedPreviewDrafts","StackablePerspective","ClientReturn","GroqString","Fallback","SanityQueries","connectEventSource","EventName","EventSourceInstance","ServerSentEvent","initEventSource","events","ConnectionFailedError","ContentSourceMap","ContentSourceMapMappings","ContentSourceMapPaths","mappings","documents","ContentSourceMapDocument","ContentSourceMapDocumentBase","_projectId","_dataset","_type","ContentSourceMapRemoteDocument","ContentSourceMapDocumentValueSource","document","ContentSourceMapLiteralSource","ContentSourceMapMapping","ContentSourceMapValueMapping","ContentSourceMapSource","ContentSourceMapUnknownSource","source","CorsOriginError","URL","addOriginUrl","publishedId","attributes","ifExists","createClient","config","CreateReleaseAction","ReleaseDocument","Partial","metadata","CreateVersionAction","baseId","versionId","ifBaseRevisionId","CurrentSanityUser","email","profileImage","role","provider","DatasetAclMode","DatasetResponse","datasetName","aclMode","DatasetsClient","DatasetsResponse","edit","deleted","list","createdAt","createdByUserId","addonFor","datasetProfile","features","tags","includeDrafts","purge","DeleteReleaseAction","deprecatedCreateClient","default","draftId","DiscardVersionAction","DisconnectError","ErrorOptions","reason","DisconnectEvent","DocIdParam","EditableReleaseDocument","PartialExcept","Omit","EditReleaseAction","EventSourceEvent","Name","globalThis","EventSource","InstanceType","EXPERIMENTAL_API_WARNING","FilterDefault","sourcePath","sourceDocument","resultPath","filterDefault","FilteredResponseQueryOptions","filterResponse","FirstDocumentIdMutationOptions","FirstDocumentMutationOptions","FitMode","formatQueryParseError","QueryParseError","tag","GenerateAsyncInstruction","T","GenerateExistingDocumentRequest","GenerateTargetDocumentRequest","GenerateRequestBase","targetDocument","GenerateSyncInstruction","GenerateOperation","GenerateTarget","instruction","instructionParams","target","GenerateTargetInclude","operation","GenerateTargetDocument","initialValues","query","params","HttpError","method","statusMessage","ReturnType","HttpRequestEvent","ResponseEvent","ProgressEvent_2","P","ImageDescriptionOperation","imageUrl","ImportReleaseAction","InitializedClientConfig","InitializedStegaConfig","isDefaultApi","cdnUrl","StegaConfigRequiredKeys","Pick","Required","InsertPatch","before","after","replace","isHttpError","isQueryParseError","_listen","ObservableSanityClient","ListenParams","MutationEvent","this","Opts","ListenOptions","ListenEventFromOptions","ListenEvent","ReconnectEvent","WelcomeEvent","OpenEvent","ListenEventName","MapListenEventNamesToListenEvents","includeResult","includeMutations","includePreviousRevision","includeAllVersions","effectFormat","LiveClient","_tag","LiveEvent","LiveEventRestart","LiveEventReconnect","LiveEventMessage","LiveEventWelcome","LiveEventGoAway","SyncTag","Logger","console","Events","E","MediaLibraryAssetInstanceIdentifier","SanityReference","MediaLibraryPlaybackInfoOptions","MediaLibraryVideoPlaybackTransformations","transformations","expiration","MediaLibraryVideoClient","VideoPlaybackInfo","getPlaybackInfo","assetIdentifier","ThumbnailTransformOptions","StoryboardTransformOptions","thumbnail","animated","storyboard","MessageError","MessageParseError","MultipleActionResult","MultipleMutationResult","MutationOperation","documentIds","results","MutationSelection","MutationError","MutationErrorItem","SanityDocument","eventId","identity","mutations","previousRev","resultRev","result","previous","effects","apply","revert","timestamp","transition","transactionTotalEvents","transactionCurrentEvent","MutationSelectionQueryParams","ObservableAgentsActionClient","ObservableAssetsClient","ObservableDatasetsClient","ObservableMediaLibraryVideoClient","ObservablePatch","SingleMutationResult","clone","commit","ObservablePatchBuilder","ObservableProjectsClient","SanityProject","includeMembers","organizationId","getById","ObservableReleasesClient","AbortSignal","SingleActionResult","publishAt","RawQueryResponse","get","signal","release","publish","archive","unarchive","schedule","unschedule","fetchDocuments","Q","G","ObservableUsersClient","QueryWithoutParams","QueryParams","UnfilteredResponseQueryOptions","UnfilteredResponseWithoutQuery","RawQuerylessQueryResponse","ObservableTransaction","RawRequestOptions","assets","datasets","live","mediaLibrary","video","projects","users","agent","action","releases","listen","newConfig","withConfig","getDocument","getDocuments","ids","createVersion","args","discardVersion","replaceVersion","unpublishVersion","mutate","transaction","getUrl","uri","canUseCdn","getDataUrl","TransactionFirstDocumentMutationOptions","TransactionAllDocumentsMutationOptions","TransactionFirstDocumentIdMutationOptions","TransactionAllDocumentIdsMutationOptions","patchOps","SanityUser","K","Patch","PatchBuilder","PatchDocumentSync","PatchDocumentAsync","PatchExistingDocumentRequest","PatchTargetDocumentRequest","PatchRequestBase","PatchOperation","ifRevisionID","PatchTarget","stage","percent","total","loaded","lengthComputable","ProgressEvent","ProjectsClient","PromptJsonResponse","PromptTextResponse","PromptRequestBase","ifDraftRevisionId","ifPublishedRevisionId","PublishReleaseAction","QueryOptions","RequestInit","returnQuery","lastLiveEventId","cacheMode","ms","syncTags","json","useGlobalApi","maxRedirects","UnarchiveReleaseAction","ScheduleReleaseAction","UnscheduleReleaseAction","ReleaseCardinality","ReleaseState","ReleaseType","_createdAt","_updatedAt","_rev","state","finalDocumentStates","publishedAt","intendedPublishAt","releaseType","cardinality","ReleaseId","ReleasesClient","ReplaceVersionAction","RequestObservableOptions","size","assetId","mimeType","sha1hash","extension","uploadId","originalFilename","UsersClient","Transaction","observable","dataRequest","endpoint","_originalId","SanityImagePalette","hasAlpha","isOpaque","lqip","blurHash","thumbHash","dimensions","aspectRatio","palette","darkMuted","darkVibrant","dominant","lightMuted","lightVibrant","muted","vibrant","image","exif","background","foreground","population","SanityProjectMember","displayName","studioHost","isBlocked","isDisabled","isDisabledByUser","pendingInvites","maxRetentionDays","members","cliInitializedAt","color","externalStudioHost","isRobot","isCurrentUser","_ref","familyName","givenName","middleName","updatedAt","ServerError","enabled","studioUrl","filter","logger","omitCrossDatasetReferenceData","Extract","StillImageFormat","time","fit","TransactionMutationOptions","TransformDocumentSync","TransformDocumentAsync","TransformRequestBase","TransformOperation","TransformTargetDocument","TransformTarget","TransformTargetInclude","TranslateDocumentSync","TranslateDocumentAsync","TranslateRequestBase","TranslateLanguage","TranslateTarget","fromLanguage","toLanguage","styleGuide","styleGuideParams","protectedPhrases","languageFieldPath","TranslateTargetInclude","UnpublishVersionAction","File","Blob","Buffer","NodeJS","ReadableStream","preserveFilename","filename","contentType","extract","label","creditLine","validateApiPerspective","VideoPlaybackInfoItem","stream","duration","VideoPlaybackInfoItemPublic","VideoPlaybackInfoItemSigned","VideoPlaybackInfoPublic","VideoPlaybackInfoSigned","VideoPlaybackTokens","listenerName"],"sources":["../../../../node_modules/.pnpm/@sanity+client@7.14.1_debug@4.4.3/node_modules/@sanity/client/dist/index.d.ts","../../src/schema.ts","../../src/components/MarkdownInput.tsx","../../src/plugin.tsx"],"x_google_ignoreList":[0],"mappings":";;;;;;;aAmZoBoE,GAAAA;;kBA0wIKqD,mBAAAA,SAA4BuT,cAAAA;EACnD5S,GAAAA;EACAvE,IAAAA;EACA+f,IAAAA;EACAC,OAAAA;EACAC,QAAAA;EACAC,QAAAA;EACAC,SAAAA;EACAC,QAAAA;EACAC,gBAAAA;AAAAA;;aAgxBkBlJ,cAAAA,W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AA,CAAA,gBAAA;AAAA,UCmCe,kBAAA,SAA2B,gBAAA;EF+TxBA;;;;;AA0wIpB;EElkJE,aAAA,GAAgB,IAAA,CAAK,mBAAA;AAAA;AAAA,cAGV,eAAA,EAAiB,OAAA;AAAA,iBAiBd,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAqB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,UC3GnD,cAAA;;;AH+YjB;;;;;AA0wIA;;;;;;;;;;;;;;;;AAyxBA;;;;;;;;;;;EG/4KE,KAAA,IAAS,KAAA,EAAO,gBAAA,KAAqB,KAAA,CAAM,YAAA;AAAA;AAAA,cAGhC,cAAA,EAAgB,MAAA,CAAO,cAAA"}
1
+ {"version":3,"file":"commonExports.d.ts","names":["ClientPerspective","ClientPerspective_2","ContentSourceMapDocuments","ContentSourceMapDocuments_2","ContentSourceMapParsedPath","ContentSourceMapParsedPathKeyedSegment","HttpContext","Observable","Requester","ResolveStudioUrl","StudioBaseRoute","StudioBaseUrl","StudioUrl","adapter","unstable__adapter","environment","unstable__environment","Action","CreateAction","ReplaceDraftAction","EditAction","DeleteAction","DiscardAction","PublishAction","UnpublishAction","VersionAction","ReleaseAction","ActionError","ActionErrorItem","type","description","items","error","value","index","AgentActionAsync","async","AgentActionParam","TParamConfig","ConstantAgentActionParam","FieldAgentActionParam","DocumentAgentActionParam","GroqAgentActionParam","docIdRequired","AgentActionParams","Record","AgentActionPath","AgentActionPathSegment","_key","AgentActionRequestBase","AgentActionSchema","localeSettings","locale","timeZone","temperature","schemaId","forcePublishedWrite","conditionalPaths","defaultReadOnly","defaultHidden","paths","path","readOnly","hidden","AgentActionsClient","DocumentShape","SanityClient","HttpRequest","Any","GenerateInstruction","request","IdentifiedSanityDocumentStub","Promise","TransformDocument","TranslateDocument","PromptRequest","PatchDocument","private","constructor","client","httpRequest","generate","_id","transform","translate","prompt","patch","AgentActionSync","noWrite","AgentActionTarget","AgentActionTypeConfig","maxPathDepth","exclude","types","AgentActionTargetInclude","include","AllDocumentIdsMutationOptions","BaseMutationOptions","returnFirst","returnDocuments","AllDocumentsMutationOptions","AnimatedImageFormat","AnimatedTransformOptions","width","height","start","end","fps","format","AnyNonNullable","Exclude","ApiError","message","statusCode","ArchiveReleaseAction","actionType","releaseId","AssetMetadataType","AssetsClient","UploadBody","UploadClientConfig","SanityAssetDocument","SanityImageAssetDocument","upload","assetType","body","options","AttributeSet","key","AuthProvider","name","title","url","AuthProviderResponse","providers","BaseActionOptions","RequestOptions","transactionId","skipCrossDatasetReferenceValidation","dryRun","visibility","autoGenerateArrayKeys","BasePatch","PatchSelection","PatchOperations","PatchMutationOperation","selection","operations","set","attrs","setIfMissing","diffMatchPatch","unset","inc","dec","insert","at","selector","append","prepend","splice","deleteCount","ifRevisionId","rev","serialize","toJSON","reset","_assign","op","props","merge","_set","BaseTransaction","R","Mutation","SanityDocumentStub","trxId","create","doc","createIfNotExists","createOrReplace","delete","documentId","id","_add","mut","ChannelError","Error","data","ChannelErrorEvent","ClientConfig","ClientConfigResource","RegExp","Array","ResponseQueryOptions","StegaConfig","RequestHandler","projectId","dataset","useCdn","token","resource","perspective","apiHost","apiVersion","proxy","requestTagPrefix","headers","ignoreBrowserTokenWarning","ignoreWarnings","withCredentials","allowReconfigure","timeout","maxRetries","retryDelay","attemptNumber","useProjectHostname","requester","resultSourceMap","fetch","cache","next","stega","lineage","_requestHandler","ClientError","ErrorProps","response","responseBody","details","res","context","DeprecatedPreviewDrafts","StackablePerspective","ClientReturn","GroqString","Fallback","SanityQueries","connectEventSource","EventName","EventSourceInstance","ServerSentEvent","initEventSource","events","ConnectionFailedError","ContentSourceMap","ContentSourceMapMappings","ContentSourceMapPaths","mappings","documents","ContentSourceMapDocument","ContentSourceMapDocumentBase","_projectId","_dataset","_type","ContentSourceMapRemoteDocument","ContentSourceMapDocumentValueSource","document","ContentSourceMapLiteralSource","ContentSourceMapMapping","ContentSourceMapValueMapping","ContentSourceMapSource","ContentSourceMapUnknownSource","source","CorsOriginError","URL","addOriginUrl","publishedId","attributes","ifExists","createClient","config","CreateReleaseAction","ReleaseDocument","Partial","metadata","CreateVersionAction","baseId","versionId","ifBaseRevisionId","CurrentSanityUser","email","profileImage","role","provider","DatasetAclMode","DatasetCreateOptions","aclMode","embeddings","enabled","projection","DatasetEditOptions","DatasetResponse","datasetName","DatasetsClient","DatasetsResponse","EmbeddingsSettings","EmbeddingsSettingsBody","edit","deleted","list","getEmbeddingsSettings","editEmbeddingsSettings","settings","createdAt","createdByUserId","addonFor","datasetProfile","features","tags","includeDrafts","purge","DeleteReleaseAction","deprecatedCreateClient","default","draftId","DiscardVersionAction","DisconnectError","ErrorOptions","reason","DisconnectEvent","DocIdParam","EditableReleaseDocument","PartialExcept","Omit","EditReleaseAction","status","EventSourceEvent","Name","globalThis","EventSource","InstanceType","EXPERIMENTAL_API_WARNING","FilterDefault","sourcePath","sourceDocument","resultPath","filterDefault","FilteredResponseQueryOptions","filterResponse","FirstDocumentIdMutationOptions","FirstDocumentMutationOptions","FitMode","formatQueryParseError","QueryParseError","tag","GenerateAsyncInstruction","T","GenerateExistingDocumentRequest","GenerateTargetDocumentRequest","GenerateRequestBase","targetDocument","GenerateSyncInstruction","GenerateOperation","GenerateTarget","instruction","instructionParams","target","GenerateTargetInclude","operation","GenerateTargetDocument","initialValues","query","params","HttpError","method","statusMessage","ReturnType","HttpRequestEvent","ResponseEvent","ProgressEvent_2","P","ImageDescriptionOperation","imageUrl","ImportReleaseAction","InitializedClientConfig","InitializedStegaConfig","isDefaultApi","cdnUrl","StegaConfigRequiredKeys","Pick","Required","InsertPatch","before","after","replace","isHttpError","isQueryParseError","_listen","ObservableSanityClient","ListenParams","MutationEvent","this","Opts","ListenOptions","ResumableListenOptions","ListenEventFromOptions","ListenEvent","ReconnectEvent","WelcomeBackEvent","ResetEvent","WelcomeEvent","OpenEvent","ResumableListenEventNames","ListenEventName","MapListenEventNamesToListenEvents","includeResult","includeMutations","includePreviousRevision","includeAllVersions","effectFormat","enableResume","ListOptions","includeMembers","includeFeatures","organizationId","onlyExplicitMembership","LiveClient","_tag","waitFor","LiveEvent","LiveEventRestart","LiveEventReconnect","LiveEventMessage","LiveEventWelcome","LiveEventGoAway","SyncTag","Logger","console","Events","E","MediaLibraryAssetInstanceIdentifier","SanityReference","MediaLibraryPlaybackInfoOptions","MediaLibraryVideoPlaybackTransformations","transformations","expiration","MediaLibraryVideoClient","VideoPlaybackInfo","getPlaybackInfo","assetIdentifier","ThumbnailTransformOptions","StoryboardTransformOptions","thumbnail","animated","storyboard","MessageError","MessageParseError","MultipleActionResult","MultipleMutationResult","MutationOperation","documentIds","results","MutationSelection","MutationError","MutationErrorItem","SanityDocument","eventId","identity","mutations","previousRev","resultRev","result","previous","effects","apply","revert","timestamp","transition","transactionTotalEvents","transactionCurrentEvent","MutationSelectionQueryParams","ObservableAgentsActionClient","ObservableAssetsClient","ObservableDatasetsClient","ObservableMediaLibraryVideoClient","ObservablePatch","SingleMutationResult","clone","commit","ObservablePatchBuilder","ObservableProjectsClient","SanityProject","OmittedProjectFields","getById","ObservableReleasesClient","AbortSignal","SingleActionResult","publishAt","RawQueryResponse","get","signal","release","publish","archive","unarchive","schedule","unschedule","fetchDocuments","Q","G","ObservableUsersClient","QueryWithoutParams","QueryParams","UnfilteredResponseQueryOptions","UnfilteredResponseWithoutQuery","RawQuerylessQueryResponse","ObservableTransaction","RawRequestOptions","assets","datasets","live","mediaLibrary","video","projects","users","agent","action","releases","listen","newConfig","withConfig","getDocument","getDocuments","ids","createVersion","args","discardVersion","replaceVersion","unpublishVersion","mutate","transaction","getUrl","uri","canUseCdn","getDataUrl","TransactionFirstDocumentMutationOptions","TransactionAllDocumentsMutationOptions","TransactionFirstDocumentIdMutationOptions","TransactionAllDocumentIdsMutationOptions","patchOps","SanityUser","K","Patch","PatchBuilder","PatchDocumentSync","PatchDocumentAsync","PatchExistingDocumentRequest","PatchTargetDocumentRequest","PatchRequestBase","PatchOperation","ifRevisionID","PatchTarget","stage","percent","total","loaded","lengthComputable","ProgressEvent","ProjectsClient","PromptJsonResponse","PromptTextResponse","PromptRequestBase","ifDraftRevisionId","ifPublishedRevisionId","PublishReleaseAction","QueryOptions","RequestInit","returnQuery","lastLiveEventId","cacheMode","ms","syncTags","json","useGlobalApi","maxRedirects","UnarchiveReleaseAction","ScheduleReleaseAction","UnscheduleReleaseAction","ReleaseCardinality","ReleaseState","ReleaseType","_createdAt","_updatedAt","_rev","state","finalDocumentStates","publishedAt","intendedPublishAt","releaseType","cardinality","ReleaseId","ReleasesClient","ReplaceVersionAction","defaultRequester","RequestObservableOptions","size","assetId","mimeType","sha1hash","extension","uploadId","originalFilename","UsersClient","Transaction","observable","dataRequest","endpoint","_originalId","SanityImagePalette","hasAlpha","isOpaque","lqip","blurHash","thumbHash","dimensions","aspectRatio","palette","darkMuted","darkVibrant","dominant","lightMuted","lightVibrant","muted","vibrant","image","exif","background","foreground","population","SanityProjectMember","displayName","studioHost","isBlocked","isDisabled","isDisabledByUser","pendingInvites","maxRetentionDays","members","cliInitializedAt","color","externalStudioHost","isRobot","isCurrentUser","_ref","familyName","givenName","middleName","updatedAt","ServerError","studioUrl","filter","logger","omitCrossDatasetReferenceData","Extract","StillImageFormat","time","fit","TransactionMutationOptions","TransformDocumentSync","TransformDocumentAsync","TransformRequestBase","TransformOperation","TransformTargetDocument","TransformTarget","TransformTargetInclude","TranslateDocumentSync","TranslateDocumentAsync","TranslateRequestBase","TranslateLanguage","TranslateTarget","fromLanguage","toLanguage","styleGuide","styleGuideParams","protectedPhrases","languageFieldPath","TranslateTargetInclude","UnpublishVersionAction","File","Blob","Buffer","NodeJS","ReadableStream","preserveFilename","filename","contentType","extract","label","creditLine","validateApiPerspective","S","VideoPlaybackInfoItem","VideoRenditionInfo","VideoPlaybackInfoItemSigned","VideoRenditionInfoSigned","VideoSubtitleInfo","VideoSubtitleInfoSigned","stream","duration","renditions","subtitles","VideoPlaybackInfoItemPublic","VideoPlaybackInfoPublic","VideoPlaybackInfoSigned","VideoPlaybackTokens","VideoRenditionInfoPublic","resolution","expiresAt","VideoSubtitleInfoPublic","trackId","languageCode","closedCaptions","listenerName"],"sources":["../../../../node_modules/.pnpm/@sanity+client@7.21.0/node_modules/@sanity/client/dist/index.d.ts","../../src/schema.ts","../../src/components/MarkdownInput.tsx","../../src/plugin.tsx"],"x_google_ignoreList":[0],"mappings":";;;;;;;aAmZoBoE,GAAAA;;kBAy7IKqD,mBAAAA,SAA4B+U,cAAAA;EACnDpU,GAAAA;EACAvE,IAAAA;EACAuhB,IAAAA;EACAC,OAAAA;EACAC,QAAAA;EACAC,QAAAA;EACAC,SAAAA;EACAC,QAAAA;EACAC,gBAAAA;AAAAA;;aAgxBkBlJ,cAAAA,WAAyB3Z,MAAAA,SAAeuB,GAAAA,IAAOvB,MAAAA,SAAeuB,GAAAA,mBACpEuR,CAAAA,GAAIA,CAAAA,CAAEwB,CAAAA;EAElBjS,GAAAA;EACAsf,IAAAA;EACA1U,KAAAA;EACAwU,UAAAA;EACAC,UAAAA;;;;EAIAyB,WAAAA;AAAAA;;kBAWuBte,wBAAAA,SAAiCD,mBAAAA;EACxD0J,QAAAA;IACErB,KAAAA;IACAoW,QAAAA;IACAC,QAAAA;IACAC,IAAAA;IACAC,QAAAA;IACAC,SAAAA;IACAC,UAAAA;MACEzW,KAAAA;MACA0W,WAAAA;MACAhgB,MAAAA;MACAD,KAAAA;IAAAA;IAEFkgB,OAAAA;MACE3W,KAAAA;MACA4W,SAAAA,GAAYT,kBAAAA;MACZU,WAAAA,GAAcV,kBAAAA;MACdW,QAAAA,GAAWX,kBAAAA;MACXY,UAAAA,GAAaZ,kBAAAA;MACba,YAAAA,GAAeb,kBAAAA;MACfc,KAAAA,GAAQd,kBAAAA;MACRe,OAAAA,GAAUf,kBAAAA;IAAAA;IAEZgB,KAAAA;MACEnX,KAAAA;MAAAA,CACC9H,GAAAA,WAAc5D,GAAAA;IAAAA;IAEjB8iB,IAAAA;MACEpX,KAAAA;MAAAA,CACC9H,GAAAA,WAAc5D,GAAAA;IAAAA;EAAAA;AAAAA;;kBAMI6hB,kBAAAA;EACvBkB,UAAAA;EACAC,UAAAA;EACAC,UAAAA;EACAlf,KAAAA;AAAAA;AAAAA,cC9pLW,gBAAA;AAAA,UAEI,eAAA;ED4YG/D;;;;;AAy7IpB;;;;;;;;;;;;ECnzJE,QAAA,IAAY,UAAA,EAAY,wBAAA;AAAA;;;AD4kL1B;UCtkLiB,kBAAA,SAA2B,IAAA,CAAK,gBAAA;EAC/C,IAAA,SAAa,gBAAA;EACb,OAAA,GAAU,eAAA;AAAA;AAAA;EAAA,UAKO,oBAAA;IACf,QAAA,EAAU,kBAAA;EAAA;AAAA;AAAA,cAID,kBAAA;;;IAKX,IAAA,CAAA,gBAAA;AAAA,UCmCe,kBAAA,SAA2B,gBAAA;EFgUxBA;;;;;AAy7IpB;EElvJE,aAAA,GAAgB,IAAA,CAAK,mBAAA;AAAA;AAAA,cAGV,eAAA,EAAiB,OAAA;AAAA,iBAiBd,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAqB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,UC1GnD,cAAA;;;AH+YjB;;;;;AAy7IA;;;;;;;;;;;;;;;;AAyxBA;;;;;;;;;;;EG9jLE,KAAA,IAAS,KAAA,EAAO,gBAAA,KAAqB,KAAA,CAAM,YAAA;AAAA;AAAA,cAGhC,cAAA,EAAgB,MAAA,CAAO,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/components/MarkdownInput.tsx","../src/schema.ts","../src/plugin.tsx"],"sourcesContent":["// TODO: when upgrading to @sanity/ui@4 start using the new tokens\n// oxlint-disable typescript/no-deprecated\n\n// dont import non-types here, it will break SSR on next\nimport type {SimpleMDEReactProps} from 'react-simplemde-editor'\n\nimport {Box, Text} from '@sanity/ui'\nimport {type Options as EasyMdeOptions} from 'easymde'\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {PatchEvent, set, type StringInputProps, unset, useClient} from 'sanity'\nimport {styled} from 'styled-components'\n\nimport type {MarkdownOptions} from '../schema'\n\nconst SimpleMdeReact = lazy(() => import('react-simplemde-editor'))\n\nconst MarkdownInputStyles = styled(Box)`\n & .CodeMirror.CodeMirror {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n background-color: inherit;\n }\n\n & .cm-s-easymde .CodeMirror-cursor {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar,\n .editor-preview-side {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n }\n\n & .CodeMirror-focused .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.selectable?.primary?.hovered?.bg};\n }\n\n & .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-toolbar > * {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar > .active,\n .editor-toolbar > button:hover,\n .editor-preview pre,\n .cm-s-easymde .cm-comment {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-preview {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n\n & h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: revert;\n }\n\n & ul,\n li {\n list-style: revert;\n padding: revert;\n }\n\n & a {\n text-decoration: revert;\n }\n }\n`\n\nexport interface MarkdownInputProps extends StringInputProps {\n /**\n * These are passed along directly to\n *\n * Note: MarkdownInput sets certain reactMdeProps.options by default.\n * These will be merged with any custom options.\n */\n reactMdeProps?: Omit<SimpleMDEReactProps, 'value' | 'onChange'>\n}\n\nexport const defaultMdeTools: EasyMdeOptions['toolbar'] = [\n 'heading',\n 'bold',\n 'italic',\n '|',\n 'quote',\n 'unordered-list',\n 'ordered-list',\n '|',\n 'link',\n 'image',\n 'code',\n '|',\n 'preview',\n 'side-by-side',\n]\n\nexport function MarkdownInput(props: MarkdownInputProps): React.JSX.Element {\n const {\n value = '',\n onChange,\n elementProps: {onBlur, onFocus, ref: elementRef},\n reactMdeProps: {options: mdeCustomOptions, ...reactMdeProps} = {},\n schemaType,\n focused,\n } = props\n const client = useClient({apiVersion: '2022-01-01'})\n // oxlint-disable-next-line no-unsafe-type-assertion\n const {imageUrl} = (schemaType.options as MarkdownOptions | undefined) ?? {}\n const [shouldAutoFocus, setShouldAutoFocus] = useState(false)\n const ref = useRef<HTMLDivElement>(null)\n\n // Forward ref to parent form state\n useImperativeHandle(elementRef, () => ref.current)\n\n const imageUpload = useCallback(\n (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => {\n client.assets\n .upload('image', file)\n .then((doc) => onSuccess(imageUrl ? imageUrl(doc) : `${doc.url}?w=450`))\n .catch((e) => {\n console.error(e)\n onError(e.message)\n })\n },\n [client, imageUrl],\n )\n\n const mdeOptions: EasyMdeOptions = useMemo(() => {\n return {\n spellChecker: false,\n sideBySideFullscreen: false,\n uploadImage: true,\n imageUploadFunction: imageUpload,\n toolbar: defaultMdeTools,\n status: false,\n ...mdeCustomOptions,\n autofocus: shouldAutoFocus,\n }\n }, [imageUpload, mdeCustomOptions, shouldAutoFocus])\n\n useEffect(() => {\n const node = ref.current\n if (!node) return undefined\n\n if (focused && !shouldAutoFocus) {\n // Do not set autofocus if the field already has focus\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(!node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n if (!focused && shouldAutoFocus) {\n // If `focused` is false, and the current active focus is no longer within the editor, reset autofocus state\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n return undefined\n }, [focused, shouldAutoFocus])\n\n const handleChange = useCallback(\n (newValue: string) => {\n onChange(PatchEvent.from(newValue ? set(newValue) : unset()))\n },\n [onChange],\n )\n\n return (\n <MarkdownInputStyles>\n <Suspense fallback={fallback}>\n <SimpleMdeReact\n {...reactMdeProps}\n ref={ref}\n value={value}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={onFocus}\n options={mdeOptions}\n spellCheck={false}\n />\n </Suspense>\n </MarkdownInputStyles>\n )\n}\n\nconst fallback = (\n <Box padding={3}>\n <Text>Loading editor...</Text>\n </Box>\n)\n","import type {SanityImageAssetDocument} from '@sanity/client'\n\nimport {defineType, type StringDefinition} from 'sanity'\n\nimport {MarkdownInput} from './components/MarkdownInput'\n\nexport const markdownTypeName = 'markdown'\n\nexport interface MarkdownOptions {\n /**\n * Used to create image url for any uploaded image.\n * The function will be invoked whenever an image is pasted or dragged into the\n * markdown editor, after upload completes.\n *\n * The default implementation uses\n * ```js\n * imageAsset => `${imageAsset.url}?w=450`\n * ```\n * ## Example\n * ```js\n * {\n * imageUrl: imageAsset => `${imageAsset.url}?w=400&h=400`\n * }\n * ```\n * @param imageAsset\n */\n imageUrl?: (imageAsset: SanityImageAssetDocument) => string\n}\n\n/**\n * @public\n */\nexport interface MarkdownDefinition extends Omit<StringDefinition, 'type' | 'fields' | 'options'> {\n type: typeof markdownTypeName\n options?: MarkdownOptions\n}\n\ndeclare module 'sanity' {\n // makes type: 'markdown' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n markdown: MarkdownDefinition\n }\n}\n\nexport const markdownSchemaType = defineType({\n type: 'string',\n name: markdownTypeName,\n title: 'Markdown',\n components: {input: MarkdownInput},\n})\n","import {definePlugin, type Plugin, type StringInputProps} from 'sanity'\n\nimport {markdownSchemaType} from './schema'\n\nexport interface MarkdownConfig {\n /**\n * When provided, will replace the default input component.\n *\n * Use this to customize MarkdownInput by wrapping it in a custom component,\n * and provide any custom props for https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * via the `reactMdeProps` prop.\n *\n * ### Example\n *\n * ```tsx\n * // CustomMarkdownInput.tsx\n * import { MarkdownInput, MarkdownInputProps } from 'sanity-plugin-markdown'\n *\n * export function CustomMarkdownInput(props) {\n * const reactMdeProps: MarkdownInputProps['reactMdeProps'] =\n * useMemo(() => {\n * return {\n * options: {\n * toolbar: ['bold', 'italic'],\n * // more options available, see:\n * // https://github.com/Ionaru/easy-markdown-editor#options-list\n * },\n * // more props available, see:\n * // https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * }\n * }, [])\n *\n * return <MarkdownInput {...props} reactMdeProps={reactMdeProps} />\n * }\n *\n * // studio.config.ts\n * markdownSchema({input: CustomMarkdownInput})\n * ```\n */\n input?: (props: StringInputProps) => React.ReactElement\n}\n\nexport const markdownSchema: Plugin<MarkdownConfig | void> = definePlugin(\n (config: MarkdownConfig | void) => {\n return {\n name: 'markdown-editor',\n schema: {\n types: [\n config && config.input\n ? {...markdownSchemaType, components: {input: config.input}}\n : markdownSchemaType,\n ],\n },\n }\n },\n)\n"],"names":["SimpleMdeReact","lazy","MarkdownInputStyles","styled","Box","withConfig","displayName","componentId","theme","sanity","color","card","enabled","fg","border","selectable","primary","hovered","bg","defaultMdeTools","MarkdownInput","props","$","_c","value","t0","onChange","elementProps","t1","reactMdeProps","t2","schemaType","focused","undefined","onBlur","onFocus","ref","elementRef","t3","mdeCustomOptions","options","t4","for","apiVersion","client","useClient","t5","imageUrl","shouldAutoFocus","setShouldAutoFocus","useState","useRef","t6","Symbol","current","useImperativeHandle","t7","file","onSuccess","onError","assets","upload","then","doc","url","catch","e","console","error","message","imageUpload","t8","spellChecker","sideBySideFullscreen","uploadImage","imageUploadFunction","toolbar","status","autofocus","mdeOptions","t10","t9","node","raf","requestAnimationFrame","contains","document","activeElement","cancelAnimationFrame","raf_0","useEffect","t11","newValue","PatchEvent","from","set","unset","handleChange","t12","jsx","Suspense","fallback","Text","markdownTypeName","markdownSchemaType","defineType","type","name","title","components","input","markdownSchema","definePlugin","config","schema","types"],"mappings":";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AA;AACtB,CAAC,GCPY2F,iBAAgDC,OAAAA,aAC1DC,CAAAA,YACQ;AAAA,EACLN,MAAM;AAAA,EACNO,QAAQ;AAAA,IACNC,OAAO,CACLF,UAAUA,OAAOH,QACb;AAAA,MAAC,GAAGN;AAAAA,MAAoBK,YAAY;AAAA,QAACC,OAAOG,OAAOH;AAAAA,MAAAA;AAAAA,IAAK,IACxDN,kBAAkB;AAAA,EAAA;AAG5B,EAEJ;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/components/MarkdownInput.tsx","../src/schema.ts","../src/plugin.tsx"],"sourcesContent":["// TODO: when upgrading to @sanity/ui@4 start using the new tokens\n// oxlint-disable typescript/no-deprecated\n\nimport {Box, Text} from '@sanity/ui'\nimport {type Options as EasyMdeOptions} from 'easymde'\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\n// dont import non-types here, it will break SSR on next\nimport type {SimpleMDEReactProps} from 'react-simplemde-editor'\nimport {PatchEvent, set, type StringInputProps, unset, useClient} from 'sanity'\nimport {styled} from 'styled-components'\n\nimport type {MarkdownOptions} from '../schema'\n\nconst SimpleMdeReact = lazy(() => import('react-simplemde-editor'))\n\nconst MarkdownInputStyles = styled(Box)`\n & .CodeMirror.CodeMirror {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n background-color: inherit;\n }\n\n & .cm-s-easymde .CodeMirror-cursor {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar,\n .editor-preview-side {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n }\n\n & .CodeMirror-focused .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.selectable?.primary?.hovered?.bg};\n }\n\n & .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-toolbar > * {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar > .active,\n .editor-toolbar > button:hover,\n .editor-preview pre,\n .cm-s-easymde .cm-comment {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-preview {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n\n & h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: revert;\n }\n\n & ul,\n li {\n list-style: revert;\n padding: revert;\n }\n\n & a {\n text-decoration: revert;\n }\n }\n`\n\nexport interface MarkdownInputProps extends StringInputProps {\n /**\n * These are passed along directly to\n *\n * Note: MarkdownInput sets certain reactMdeProps.options by default.\n * These will be merged with any custom options.\n */\n reactMdeProps?: Omit<SimpleMDEReactProps, 'value' | 'onChange'>\n}\n\nexport const defaultMdeTools: EasyMdeOptions['toolbar'] = [\n 'heading',\n 'bold',\n 'italic',\n '|',\n 'quote',\n 'unordered-list',\n 'ordered-list',\n '|',\n 'link',\n 'image',\n 'code',\n '|',\n 'preview',\n 'side-by-side',\n]\n\nexport function MarkdownInput(props: MarkdownInputProps): React.JSX.Element {\n const {\n value = '',\n onChange,\n elementProps: {onBlur, onFocus, ref: elementRef},\n reactMdeProps: {options: mdeCustomOptions, ...reactMdeProps} = {},\n schemaType,\n focused,\n } = props\n const client = useClient({apiVersion: '2022-01-01'})\n // oxlint-disable-next-line no-unsafe-type-assertion\n const {imageUrl} = (schemaType.options as MarkdownOptions | undefined) ?? {}\n const [shouldAutoFocus, setShouldAutoFocus] = useState(false)\n const ref = useRef<HTMLDivElement>(null)\n\n // Forward ref to parent form state\n useImperativeHandle(elementRef, () => ref.current)\n\n const imageUpload = useCallback(\n (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => {\n client.assets\n .upload('image', file)\n .then((doc) => onSuccess(imageUrl ? imageUrl(doc) : `${doc.url}?w=450`))\n .catch((e) => {\n console.error(e)\n onError(e.message)\n })\n },\n [client, imageUrl],\n )\n\n const mdeOptions: EasyMdeOptions = useMemo(() => {\n return {\n spellChecker: false,\n sideBySideFullscreen: false,\n uploadImage: true,\n imageUploadFunction: imageUpload,\n toolbar: defaultMdeTools,\n status: false,\n ...mdeCustomOptions,\n autofocus: shouldAutoFocus,\n }\n }, [imageUpload, mdeCustomOptions, shouldAutoFocus])\n\n useEffect(() => {\n const node = ref.current\n if (!node) return undefined\n\n if (focused && !shouldAutoFocus) {\n // Do not set autofocus if the field already has focus\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(!node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n if (!focused && shouldAutoFocus) {\n // If `focused` is false, and the current active focus is no longer within the editor, reset autofocus state\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n return undefined\n }, [focused, shouldAutoFocus])\n\n const handleChange = useCallback(\n (newValue: string) => {\n onChange(PatchEvent.from(newValue ? set(newValue) : unset()))\n },\n [onChange],\n )\n\n return (\n <MarkdownInputStyles>\n <Suspense fallback={fallback}>\n <SimpleMdeReact\n {...reactMdeProps}\n ref={ref}\n value={value}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={onFocus}\n options={mdeOptions}\n spellCheck={false}\n />\n </Suspense>\n </MarkdownInputStyles>\n )\n}\n\nconst fallback = (\n <Box padding={3}>\n <Text>Loading editor...</Text>\n </Box>\n)\n","import type {SanityImageAssetDocument} from '@sanity/client'\nimport {defineType, type StringDefinition} from 'sanity'\n\nimport {MarkdownInput} from './components/MarkdownInput'\n\nexport const markdownTypeName = 'markdown'\n\nexport interface MarkdownOptions {\n /**\n * Used to create image url for any uploaded image.\n * The function will be invoked whenever an image is pasted or dragged into the\n * markdown editor, after upload completes.\n *\n * The default implementation uses\n * ```js\n * imageAsset => `${imageAsset.url}?w=450`\n * ```\n * ## Example\n * ```js\n * {\n * imageUrl: imageAsset => `${imageAsset.url}?w=400&h=400`\n * }\n * ```\n * @param imageAsset\n */\n imageUrl?: (imageAsset: SanityImageAssetDocument) => string\n}\n\n/**\n * @public\n */\nexport interface MarkdownDefinition extends Omit<StringDefinition, 'type' | 'fields' | 'options'> {\n type: typeof markdownTypeName\n options?: MarkdownOptions\n}\n\ndeclare module 'sanity' {\n // makes type: 'markdown' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n markdown: MarkdownDefinition\n }\n}\n\nexport const markdownSchemaType = defineType({\n type: 'string',\n name: markdownTypeName,\n title: 'Markdown',\n components: {input: MarkdownInput},\n})\n","import {definePlugin, type Plugin, type StringInputProps} from 'sanity'\n\nimport {markdownSchemaType} from './schema'\n\nexport interface MarkdownConfig {\n /**\n * When provided, will replace the default input component.\n *\n * Use this to customize MarkdownInput by wrapping it in a custom component,\n * and provide any custom props for https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * via the `reactMdeProps` prop.\n *\n * ### Example\n *\n * ```tsx\n * // CustomMarkdownInput.tsx\n * import { MarkdownInput, MarkdownInputProps } from 'sanity-plugin-markdown'\n *\n * export function CustomMarkdownInput(props) {\n * const reactMdeProps: MarkdownInputProps['reactMdeProps'] =\n * useMemo(() => {\n * return {\n * options: {\n * toolbar: ['bold', 'italic'],\n * // more options available, see:\n * // https://github.com/Ionaru/easy-markdown-editor#options-list\n * },\n * // more props available, see:\n * // https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * }\n * }, [])\n *\n * return <MarkdownInput {...props} reactMdeProps={reactMdeProps} />\n * }\n *\n * // studio.config.ts\n * markdownSchema({input: CustomMarkdownInput})\n * ```\n */\n input?: (props: StringInputProps) => React.ReactElement\n}\n\nexport const markdownSchema: Plugin<MarkdownConfig | void> = definePlugin(\n (config: MarkdownConfig | void) => {\n return {\n name: 'markdown-editor',\n schema: {\n types: [\n config && config.input\n ? {...markdownSchemaType, components: {input: config.input}}\n : markdownSchemaType,\n ],\n },\n }\n },\n)\n"],"names":["SimpleMdeReact","lazy","MarkdownInputStyles","styled","Box","withConfig","displayName","componentId","theme","sanity","color","card","enabled","fg","border","selectable","primary","hovered","bg","defaultMdeTools","MarkdownInput","props","$","_c","value","t0","onChange","elementProps","t1","reactMdeProps","t2","schemaType","focused","undefined","onBlur","onFocus","ref","elementRef","t3","mdeCustomOptions","options","t4","for","apiVersion","client","useClient","t5","imageUrl","shouldAutoFocus","setShouldAutoFocus","useState","useRef","t6","Symbol","current","useImperativeHandle","t7","file","onSuccess","onError","assets","upload","then","doc","url","catch","e","console","error","message","imageUpload","t8","spellChecker","sideBySideFullscreen","uploadImage","imageUploadFunction","toolbar","status","autofocus","mdeOptions","t10","t9","node","raf","requestAnimationFrame","contains","document","activeElement","cancelAnimationFrame","raf_0","useEffect","t11","newValue","PatchEvent","from","set","unset","handleChange","t12","jsx","Suspense","fallback","Text","markdownTypeName","markdownSchemaType","defineType","type","name","title","components","input","markdownSchema","definePlugin","config","schema","types"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAMA,iBAAiBC,MAAAA,KAAK,MAAM,OAAO,wBAAwB,CAAC,GAE5DC,sBAAsBC,iBAAAA,OAAOC,MAAG,EAACC,WAAA;AAAA,EAAAC,aAAA;AAAA,EAAAC,aAAA;AAAA,CAAA,mCAE1B,CAAC;AAAA,EAACC;AAAK,MAAMA,MAAMC,OAAOC,MAAMC,KAAKC,QAAQC,EAAE,iBACxC,CAAC;AAAA,EAACL;AAAK,MAAMA,MAAMC,OAAOC,MAAMC,KAAKC,QAAQE,MAAM,8EAKnD,CAAC;AAAA,EAACN;AAAK,MAAMA,MAAMC,OAAOC,MAAMC,KAAKC,QAAQC,EAAE,yDAK/C,CAAC;AAAA,EAACL;AAAK,MAAMA,MAAMC,OAAOC,MAAMC,KAAKC,QAAQE,MAAM,yGAI/C,CAAC;AAAA,EAACN;AAAK,MAAMA,MAAMC,OAAOC,MAAMK,YAAYC,SAASC,SAASC,EAAE,qFAIhE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A,EAAA,MAAAE,SAGC0E,qCAAC,qBAAA,EACC,UAAAC,+BAACC,MAAAA,UAAA,EAAmBC,UAClB,yCAAC,gBAAA,KACKxE,eACCO,KACEZ,OACGyE,wBACF/D,QACCC,SACA4C,qBACG,YAAA,GAAA,CAAK,EAAA,CAErB,EAAA,CACF,GAAsBzD,QAAA2E,cAAA3E,QAAAyD,YAAAzD,QAAAY,QAAAZ,QAAAa,SAAAb,QAAAO,eAAAP,QAAAE,OAAAF,QAAA4E,OAAAA,MAAA5E,EAAA,EAAA,GAbtB4E;AAasB;AAI1B,MAAMG,0CACHjG,GAAAA,KAAA,EAAI,SAAS,GACZ,UAAA+F,2BAAAA,IAACG,GAAAA,MAAA,EAAK,+BAAiB,EAAA,CACzB,GCxMWC,mBAAmB,YAsCnBC,qBAAqBC,kBAAW;AAAA,EAC3CC,MAAM;AAAA,EACNC,MAAMJ;AAAAA,EACNK,OAAO;AAAA,EACPC,YAAY;AAAA,IAACC,OAAO1F;AAAAA,EAAAA;AACtB,CAAC,GCNY2F,iBAAgDC,OAAAA,aAC1DC,CAAAA,YACQ;AAAA,EACLN,MAAM;AAAA,EACNO,QAAQ;AAAA,IACNC,OAAO,CACLF,UAAUA,OAAOH,QACb;AAAA,MAAC,GAAGN;AAAAA,MAAoBK,YAAY;AAAA,QAACC,OAAOG,OAAOH;AAAAA,MAAAA;AAAAA,IAAK,IACxDN,kBAAkB;AAAA,EAAA;AAG5B,EAEJ;;;;;"}
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Plugin, StringDefinition, StringInputProps } from "sanity";
2
- import { SimpleMDEReactProps } from "react-simplemde-editor";
3
2
  import { Options } from "easymde";
3
+ import { SimpleMDEReactProps } from "react-simplemde-editor";
4
4
  /**
5
5
  * Used to tag types that is set to `any` as a temporary measure, but should be replaced with proper typings in the future
6
6
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["ClientPerspective","ClientPerspective_2","ContentSourceMapDocuments","ContentSourceMapDocuments_2","ContentSourceMapParsedPath","ContentSourceMapParsedPathKeyedSegment","HttpContext","Observable","Requester","ResolveStudioUrl","StudioBaseRoute","StudioBaseUrl","StudioUrl","adapter","unstable__adapter","environment","unstable__environment","Action","CreateAction","ReplaceDraftAction","EditAction","DeleteAction","DiscardAction","PublishAction","UnpublishAction","VersionAction","ReleaseAction","ActionError","ActionErrorItem","type","description","items","error","value","index","AgentActionAsync","async","AgentActionParam","TParamConfig","ConstantAgentActionParam","FieldAgentActionParam","DocumentAgentActionParam","GroqAgentActionParam","docIdRequired","AgentActionParams","Record","AgentActionPath","AgentActionPathSegment","_key","AgentActionRequestBase","AgentActionSchema","localeSettings","locale","timeZone","temperature","schemaId","forcePublishedWrite","conditionalPaths","defaultReadOnly","defaultHidden","paths","path","readOnly","hidden","AgentActionsClient","DocumentShape","SanityClient","HttpRequest","Any","GenerateInstruction","request","IdentifiedSanityDocumentStub","Promise","TransformDocument","TranslateDocument","PromptRequest","PatchDocument","private","constructor","client","httpRequest","generate","_id","transform","translate","prompt","patch","AgentActionSync","noWrite","AgentActionTarget","AgentActionTypeConfig","maxPathDepth","exclude","types","AgentActionTargetInclude","include","AllDocumentIdsMutationOptions","BaseMutationOptions","returnFirst","returnDocuments","AllDocumentsMutationOptions","AnimatedImageFormat","AnimatedTransformOptions","width","height","start","end","fps","format","AnyNonNullable","Exclude","ApiError","message","statusCode","ArchiveReleaseAction","actionType","releaseId","AssetMetadataType","AssetsClient","UploadBody","UploadClientConfig","SanityAssetDocument","SanityImageAssetDocument","upload","assetType","body","options","AttributeSet","key","AuthProvider","name","title","url","AuthProviderResponse","providers","BaseActionOptions","RequestOptions","transactionId","skipCrossDatasetReferenceValidation","dryRun","visibility","autoGenerateArrayKeys","BasePatch","PatchSelection","PatchOperations","PatchMutationOperation","selection","operations","set","attrs","setIfMissing","diffMatchPatch","unset","inc","dec","insert","at","selector","append","prepend","splice","deleteCount","ifRevisionId","rev","serialize","toJSON","reset","_assign","op","props","merge","_set","BaseTransaction","R","Mutation","SanityDocumentStub","trxId","create","doc","createIfNotExists","createOrReplace","delete","documentId","id","_add","mut","ChannelError","Error","data","ChannelErrorEvent","ClientConfig","ClientConfigResource","RegExp","Array","ResponseQueryOptions","StegaConfig","projectId","dataset","useCdn","token","resource","perspective","apiHost","apiVersion","proxy","requestTagPrefix","headers","ignoreBrowserTokenWarning","ignoreWarnings","withCredentials","allowReconfigure","timeout","maxRetries","retryDelay","attemptNumber","useProjectHostname","requester","resultSourceMap","fetch","cache","next","stega","lineage","ClientError","ErrorProps","response","responseBody","details","res","context","DeprecatedPreviewDrafts","StackablePerspective","ClientReturn","GroqString","Fallback","SanityQueries","connectEventSource","EventName","EventSourceInstance","ServerSentEvent","initEventSource","events","ConnectionFailedError","ContentSourceMap","ContentSourceMapMappings","ContentSourceMapPaths","mappings","documents","ContentSourceMapDocument","ContentSourceMapDocumentBase","_projectId","_dataset","_type","ContentSourceMapRemoteDocument","ContentSourceMapDocumentValueSource","document","ContentSourceMapLiteralSource","ContentSourceMapMapping","ContentSourceMapValueMapping","ContentSourceMapSource","ContentSourceMapUnknownSource","source","CorsOriginError","URL","addOriginUrl","publishedId","attributes","ifExists","createClient","config","CreateReleaseAction","ReleaseDocument","Partial","metadata","CreateVersionAction","baseId","versionId","ifBaseRevisionId","CurrentSanityUser","email","profileImage","role","provider","DatasetAclMode","DatasetResponse","datasetName","aclMode","DatasetsClient","DatasetsResponse","edit","deleted","list","createdAt","createdByUserId","addonFor","datasetProfile","features","tags","includeDrafts","purge","DeleteReleaseAction","deprecatedCreateClient","default","draftId","DiscardVersionAction","DisconnectError","ErrorOptions","reason","DisconnectEvent","DocIdParam","EditableReleaseDocument","PartialExcept","Omit","EditReleaseAction","EventSourceEvent","Name","globalThis","EventSource","InstanceType","EXPERIMENTAL_API_WARNING","FilterDefault","sourcePath","sourceDocument","resultPath","filterDefault","FilteredResponseQueryOptions","filterResponse","FirstDocumentIdMutationOptions","FirstDocumentMutationOptions","FitMode","formatQueryParseError","QueryParseError","tag","GenerateAsyncInstruction","T","GenerateExistingDocumentRequest","GenerateTargetDocumentRequest","GenerateRequestBase","targetDocument","GenerateSyncInstruction","GenerateOperation","GenerateTarget","instruction","instructionParams","target","GenerateTargetInclude","operation","GenerateTargetDocument","initialValues","query","params","HttpError","method","statusMessage","ReturnType","HttpRequestEvent","ResponseEvent","ProgressEvent_2","P","ImageDescriptionOperation","imageUrl","ImportReleaseAction","InitializedClientConfig","InitializedStegaConfig","isDefaultApi","cdnUrl","StegaConfigRequiredKeys","Pick","Required","InsertPatch","before","after","replace","isHttpError","isQueryParseError","_listen","ObservableSanityClient","ListenParams","MutationEvent","this","Opts","ListenOptions","ListenEventFromOptions","ListenEvent","ReconnectEvent","WelcomeEvent","OpenEvent","ListenEventName","MapListenEventNamesToListenEvents","includeResult","includeMutations","includePreviousRevision","includeAllVersions","effectFormat","LiveClient","_tag","LiveEvent","LiveEventRestart","LiveEventReconnect","LiveEventMessage","LiveEventWelcome","LiveEventGoAway","SyncTag","Logger","console","Events","E","MediaLibraryAssetInstanceIdentifier","SanityReference","MediaLibraryPlaybackInfoOptions","MediaLibraryVideoPlaybackTransformations","transformations","expiration","MediaLibraryVideoClient","VideoPlaybackInfo","getPlaybackInfo","assetIdentifier","ThumbnailTransformOptions","StoryboardTransformOptions","thumbnail","animated","storyboard","MessageError","MessageParseError","MultipleActionResult","MultipleMutationResult","MutationOperation","documentIds","results","MutationSelection","MutationError","MutationErrorItem","SanityDocument","eventId","identity","mutations","previousRev","resultRev","result","previous","effects","apply","revert","timestamp","transition","transactionTotalEvents","transactionCurrentEvent","MutationSelectionQueryParams","ObservableAgentsActionClient","ObservableAssetsClient","ObservableDatasetsClient","ObservableMediaLibraryVideoClient","ObservablePatch","SingleMutationResult","clone","commit","ObservablePatchBuilder","ObservableProjectsClient","SanityProject","includeMembers","organizationId","getById","ObservableReleasesClient","AbortSignal","SingleActionResult","publishAt","RawQueryResponse","get","signal","release","publish","archive","unarchive","schedule","unschedule","fetchDocuments","Q","G","ObservableUsersClient","QueryWithoutParams","QueryParams","UnfilteredResponseQueryOptions","UnfilteredResponseWithoutQuery","RawQuerylessQueryResponse","ObservableTransaction","RawRequestOptions","assets","datasets","live","mediaLibrary","video","projects","users","agent","action","releases","listen","newConfig","withConfig","getDocument","getDocuments","ids","createVersion","args","discardVersion","replaceVersion","unpublishVersion","mutate","transaction","getUrl","uri","canUseCdn","getDataUrl","TransactionFirstDocumentMutationOptions","TransactionAllDocumentsMutationOptions","TransactionFirstDocumentIdMutationOptions","TransactionAllDocumentIdsMutationOptions","patchOps","SanityUser","K","Patch","PatchBuilder","PatchDocumentSync","PatchDocumentAsync","PatchExistingDocumentRequest","PatchTargetDocumentRequest","PatchRequestBase","PatchOperation","ifRevisionID","PatchTarget","stage","percent","total","loaded","lengthComputable","ProgressEvent","ProjectsClient","PromptJsonResponse","PromptTextResponse","PromptRequestBase","ifDraftRevisionId","ifPublishedRevisionId","PublishReleaseAction","QueryOptions","RequestInit","returnQuery","lastLiveEventId","cacheMode","ms","syncTags","json","useGlobalApi","maxRedirects","UnarchiveReleaseAction","ScheduleReleaseAction","UnscheduleReleaseAction","ReleaseCardinality","ReleaseState","ReleaseType","_createdAt","_updatedAt","_rev","state","finalDocumentStates","publishedAt","intendedPublishAt","releaseType","cardinality","ReleaseId","ReleasesClient","ReplaceVersionAction","RequestObservableOptions","size","assetId","mimeType","sha1hash","extension","uploadId","originalFilename","UsersClient","Transaction","observable","dataRequest","endpoint","_originalId","SanityImagePalette","hasAlpha","isOpaque","lqip","blurHash","thumbHash","dimensions","aspectRatio","palette","darkMuted","darkVibrant","dominant","lightMuted","lightVibrant","muted","vibrant","image","exif","background","foreground","population","SanityProjectMember","displayName","studioHost","isBlocked","isDisabled","isDisabledByUser","pendingInvites","maxRetentionDays","members","cliInitializedAt","color","externalStudioHost","isRobot","isCurrentUser","_ref","familyName","givenName","middleName","updatedAt","ServerError","enabled","studioUrl","filter","logger","omitCrossDatasetReferenceData","Extract","StillImageFormat","time","fit","TransactionMutationOptions","TransformDocumentSync","TransformDocumentAsync","TransformRequestBase","TransformOperation","TransformTargetDocument","TransformTarget","TransformTargetInclude","TranslateDocumentSync","TranslateDocumentAsync","TranslateRequestBase","TranslateLanguage","TranslateTarget","fromLanguage","toLanguage","styleGuide","styleGuideParams","protectedPhrases","languageFieldPath","TranslateTargetInclude","UnpublishVersionAction","File","Blob","Buffer","NodeJS","ReadableStream","preserveFilename","filename","contentType","extract","label","creditLine","validateApiPerspective","VideoPlaybackInfoItem","stream","duration","VideoPlaybackInfoItemPublic","VideoPlaybackInfoItemSigned","VideoPlaybackInfoPublic","VideoPlaybackInfoSigned","VideoPlaybackTokens","listenerName"],"sources":["../../../node_modules/.pnpm/@sanity+client@7.14.1_debug@4.4.3/node_modules/@sanity/client/dist/index.d.ts","../src/schema.ts","../src/components/MarkdownInput.tsx","../src/plugin.tsx"],"x_google_ignoreList":[0],"mappings":";;;;;;;aAmZoBoE,GAAAA;;kBA0wIKqD,mBAAAA,SAA4BuT,cAAAA;EACnD5S,GAAAA;EACAvE,IAAAA;EACA+f,IAAAA;EACAC,OAAAA;EACAC,QAAAA;EACAC,QAAAA;EACAC,SAAAA;EACAC,QAAAA;EACAC,gBAAAA;AAAAA;;aAgxBkBlJ,cAAAA,WAAyBnY,MAAAA,SAAeuB,GAAAA,IAAOvB,MAAAA,SAAeuB,GAAAA,mBACpE0Q,CAAAA,GAAIA,CAAAA,CAAEwB,CAAAA;EAElBpR,GAAAA;EACA+d,IAAAA;EACArT,KAAAA;EACAmT,UAAAA;EACAC,UAAAA;;;;EAIAwB,WAAAA;AAAAA;;kBAWuB9c,wBAAAA,SAAiCD,mBAAAA;EACxDwJ,QAAAA;IACErB,KAAAA;IACA8U,QAAAA;IACAC,QAAAA;IACAC,IAAAA;IACAC,QAAAA;IACAC,SAAAA;IACAC,UAAAA;MACEnV,KAAAA;MACAoV,WAAAA;MACAxe,MAAAA;MACAD,KAAAA;IAAAA;IAEF0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O,cAAA"}
1
+ {"version":3,"file":"index.d.cts","names":["ClientPerspective","ClientPerspective_2","ContentSourceMapDocuments","ContentSourceMapDocuments_2","ContentSourceMapParsedPath","ContentSourceMapParsedPathKeyedSegment","HttpContext","Observable","Requester","ResolveStudioUrl","StudioBaseRoute","StudioBaseUrl","StudioUrl","adapter","unstable__adapter","environment","unstable__environment","Action","CreateAction","ReplaceDraftAction","EditAction","DeleteAction","DiscardAction","PublishAction","UnpublishAction","VersionAction","ReleaseAction","ActionError","ActionErrorItem","type","description","items","error","value","index","AgentActionAsync","async","AgentActionParam","TParamConfig","ConstantAgentActionParam","FieldAgentActionParam","DocumentAgentActionParam","GroqAgentActionParam","docIdRequired","AgentActionParams","Record","AgentActionPath","AgentActionPathSegment","_key","AgentActionRequestBase","AgentActionSchema","localeSettings","locale","timeZone","temperature","schemaId","forcePublishedWrite","conditionalPaths","defaultReadOnly","defaultHidden","paths","path","readOnly","hidden","AgentActionsClient","DocumentShape","SanityClient","HttpRequest","Any","GenerateInstruction","request","IdentifiedSanityDocumentStub","Promise","TransformDocument","TranslateDocument","PromptRequest","PatchDocument","private","constructor","client","httpRequest","generate","_id","transform","translate","prompt","patch","AgentActionSync","noWrite","AgentActionTarget","AgentActionTypeConfig","maxPathDepth","exclude","types","AgentActionTargetInclude","include","AllDocumentIdsMutationOptions","BaseMutationOptions","returnFirst","returnDocuments","AllDocumentsMutationOptions","AnimatedImageFormat","AnimatedTransformOptions","width","height","start","end","fps","format","AnyNonNullable","Exclude","ApiError","message","statusCode","ArchiveReleaseAction","actionType","releaseId","AssetMetadataType","AssetsClient","UploadBody","UploadClientConfig","SanityAssetDocument","SanityImageAssetDocument","upload","assetType","body","options","AttributeSet","key","AuthProvider","name","title","url","AuthProviderResponse","providers","BaseActionOptions","RequestOptions","transactionId","skipCrossDatasetReferenceValidation","dryRun","visibility","autoGenerateArrayKeys","BasePatch","PatchSelection","PatchOperations","PatchMutationOperation","selection","operations","set","attrs","setIfMissing","diffMatchPatch","unset","inc","dec","insert","at","selector","append","prepend","splice","deleteCount","ifRevisionId","rev","serialize","toJSON","reset","_assign","op","props","merge","_set","BaseTransaction","R","Mutation","SanityDocumentStub","trxId","create","doc","createIfNotExists","createOrReplace","delete","documentId","id","_add","mut","ChannelError","Error","data","ChannelErrorEvent","ClientConfig","ClientConfigResource","RegExp","Array","ResponseQueryOptions","StegaConfig","RequestHandler","projectId","dataset","useCdn","token","resource","perspective","apiHost","apiVersion","proxy","requestTagPrefix","headers","ignoreBrowserTokenWarning","ignoreWarnings","withCredentials","allowReconfigure","timeout","maxRetries","retryDelay","attemptNumber","useProjectHostname","requester","resultSourceMap","fetch","cache","next","stega","lineage","_requestHandler","ClientError","ErrorProps","response","responseBody","details","res","context","DeprecatedPreviewDrafts","StackablePerspective","ClientReturn","GroqString","Fallback","SanityQueries","connectEventSource","EventName","EventSourceInstance","ServerSentEvent","initEventSource","events","ConnectionFailedError","ContentSourceMap","ContentSourceMapMappings","ContentSourceMapPaths","mappings","documents","ContentSourceMapDocument","ContentSourceMapDocumentBase","_projectId","_dataset","_type","ContentSourceMapRemoteDocument","ContentSourceMapDocumentValueSource","document","ContentSourceMapLiteralSource","ContentSourceMapMapping","ContentSourceMapValueMapping","ContentSourceMapSource","ContentSourceMapUnknownSource","source","CorsOriginError","URL","addOriginUrl","publishedId","attributes","ifExists","createClient","config","CreateReleaseAction","ReleaseDocument","Partial","metadata","CreateVersionAction","baseId","versionId","ifBaseRevisionId","CurrentSanityUser","email","profileImage","role","provider","DatasetAclMode","DatasetCreateOptions","aclMode","embeddings","enabled","projection","DatasetEditOptions","DatasetResponse","datasetName","DatasetsClient","DatasetsResponse","EmbeddingsSettings","EmbeddingsSettingsBody","edit","deleted","list","getEmbeddingsSettings","editEmbeddingsSettings","settings","createdAt","createdByUserId","addonFor","datasetProfile","features","tags","includeDrafts","purge","DeleteReleaseAction","deprecatedCreateClient","default","draftId","DiscardVersionAction","DisconnectError","ErrorOptions","reason","DisconnectEvent","DocIdParam","EditableReleaseDocument","PartialExcept","Omit","EditReleaseAction","status","EventSourceEvent","Name","globalThis","EventSource","InstanceType","EXPERIMENTAL_API_WARNING","FilterDefault","sourcePath","sourceDocument","resultPath","filterDefault","FilteredResponseQueryOptions","filterResponse","FirstDocumentIdMutationOptions","FirstDocumentMutationOptions","FitMode","formatQueryParseError","QueryParseError","tag","GenerateAsyncInstruction","T","GenerateExistingDocumentRequest","GenerateTargetDocumentRequest","GenerateRequestBase","targetDocument","GenerateSyncInstruction","GenerateOperation","GenerateTarget","instruction","instructionParams","target","GenerateTargetInclude","operation","GenerateTargetDocument","initialValues","query","params","HttpError","method","statusMessage","ReturnType","HttpRequestEvent","ResponseEvent","ProgressEvent_2","P","ImageDescriptionOperation","imageUrl","ImportReleaseAction","InitializedClientConfig","InitializedStegaConfig","isDefaultApi","cdnUrl","StegaConfigRequiredKeys","Pick","Required","InsertPatch","before","after","replace","isHttpError","isQueryParseError","_listen","ObservableSanityClient","ListenParams","MutationEvent","this","Opts","ListenOptions","ResumableListenOptions","ListenEventFromOptions","ListenEvent","ReconnectEvent","WelcomeBackEvent","ResetEvent","WelcomeEvent","OpenEvent","ResumableListenEventNames","ListenEventName","MapListenEventNamesToListenEvents","includeResult","includeMutations","includePreviousRevision","includeAllVersions","effectFormat","enableResume","ListOptions","includeMembers","includeFeatures","organizationId","onlyExplicitMembership","LiveClient","_tag","waitFor","LiveEvent","LiveEventRestart","LiveEventReconnect","LiveEventMessage","LiveEventWelcome","LiveEventGoAway","SyncTag","Logger","console","Events","E","MediaLibraryAssetInstanceIdentifier","SanityReference","MediaLibraryPlaybackInfoOptions","MediaLibraryVideoPlaybackTransformations","transformations","expiration","MediaLibraryVideoClient","VideoPlaybackInfo","getPlaybackInfo","assetIdentifier","ThumbnailTransformOptions","StoryboardTransformOptions","thumbnail","animated","storyboard","MessageError","MessageParseError","MultipleActionResult","MultipleMutationResult","MutationOperation","documentIds","results","MutationSelection","MutationError","MutationErrorItem","SanityDocument","eventId","identity","mutations","previousRev","resultRev","result","previous","effects","apply","revert","timestamp","transition","transactionTotalEvents","transactionCurrentEvent","MutationSelectionQueryParams","ObservableAgentsActionClient","ObservableAssetsClient","ObservableDatasetsClient","ObservableMediaLibraryVideoClient","ObservablePatch","SingleMutationResult","clone","commit","ObservablePatchBuilder","ObservableProjectsClient","SanityProject","OmittedProjectFields","getById","ObservableReleasesClient","AbortSignal","SingleActionResult","publishAt","RawQueryResponse","get","signal","release","publish","archive","unarchive","schedule","unschedule","fetchDocuments","Q","G","ObservableUsersClient","QueryWithoutParams","QueryParams","UnfilteredResponseQueryOptions","UnfilteredResponseWithoutQuery","RawQuerylessQueryResponse","ObservableTransaction","RawRequestOptions","assets","datasets","live","mediaLibrary","video","projects","users","agent","action","releases","listen","newConfig","withConfig","getDocument","getDocuments","ids","createVersion","args","discardVersion","replaceVersion","unpublishVersion","mutate","transaction","getUrl","uri","canUseCdn","getDataUrl","TransactionFirstDocumentMutationOptions","TransactionAllDocumentsMutationOptions","TransactionFirstDocumentIdMutationOptions","TransactionAllDocumentIdsMutationOptions","patchOps","SanityUser","K","Patch","PatchBuilder","PatchDocumentSync","PatchDocumentAsync","PatchExistingDocumentRequest","PatchTargetDocumentRequest","PatchRequestBase","PatchOperation","ifRevisionID","PatchTarget","stage","percent","total","loaded","lengthComputable","ProgressEvent","ProjectsClient","PromptJsonResponse","PromptTextResponse","PromptRequestBase","ifDraftRevisionId","ifPublishedRevisionId","PublishReleaseAction","QueryOptions","RequestInit","returnQuery","lastLiveEventId","cacheMode","ms","syncTags","json","useGlobalApi","maxRedirects","UnarchiveReleaseAction","ScheduleReleaseAction","UnscheduleReleaseAction","ReleaseCardinality","ReleaseState","ReleaseType","_createdAt","_updatedAt","_rev","state","finalDocumentStates","publishedAt","intendedPublishAt","releaseType","cardinality","ReleaseId","ReleasesClient","ReplaceVersionAction","defaultRequester","RequestObservableOptions","size","assetId","mimeType","sha1hash","extension","uploadId","originalFilename","UsersClient","Transaction","observable","dataRequest","endpoint","_originalId","SanityImagePalette","hasAlpha","isOpaque","lqip","blurHash","thumbHash","dimensions","aspectRatio","palette","darkMuted","darkVibrant","dominant","lightMuted","lightVibrant","muted","vibrant","image","exif","background","foreground","population","SanityProjectMember","displayName","studioHost","isBlocked","isDisabled","isDisabledByUser","pendingInvites","maxRetentionDays","members","cliInitializedAt","color","externalStudioHost","isRobot","isCurrentUser","_ref","familyName","givenName","middleName","updatedAt","ServerError","studioUrl","filter","logger","omitCrossDatasetReferenceData","Extract","StillImageFormat","time","fit","TransactionMutationOptions","TransformDocumentSync","TransformDocumentAsync","TransformRequestBase","TransformOperation","TransformTargetDocument","TransformTarget","TransformTargetInclude","TranslateDocumentSync","TranslateDocumentAsync","TranslateRequestBase","TranslateLanguage","TranslateTarget","fromLanguage","toLanguage","styleGuide","styleGuideParams","protectedPhrases","languageFieldPath","TranslateTargetInclude","UnpublishVersionAction","File","Blob","Buffer","NodeJS","ReadableStream","preserveFilename","filename","contentType","extract","label","creditLine","validateApiPerspective","S","VideoPlaybackInfoItem","VideoRenditionInfo","VideoPlaybackInfoItemSigned","VideoRenditionInfoSigned","VideoSubtitleInfo","VideoSubtitleInfoSigned","stream","duration","renditions","subtitles","VideoPlaybackInfoItemPublic","VideoPlaybackInfoPublic","VideoPlaybackInfoSigned","VideoPlaybackTokens","VideoRenditionInfoPublic","resolution","expiresAt","VideoSubtitleInfoPublic","trackId","languageCode","closedCaptions","listenerName"],"sources":["../../../node_modules/.pnpm/@sanity+client@7.21.0/node_modules/@sanity/client/dist/index.d.ts","../src/schema.ts","../src/components/MarkdownInput.tsx","../src/plugin.tsx"],"x_google_ignoreList":[0],"mappings":";;;;;;;aAmZoBoE,GAAAA;;kBAy7IKqD,mBAAAA,SAA4B+U,cAAAA;EACnDpU,GAAAA;EACAvE,IAAAA;EACAuhB,IAAAA;EACAC,OAAAA;EACAC,QAAAA;EACAC,QAAAA;EACAC,SAAAA;EACAC,QAAAA;EACAC,gBAAAA;AAAAA;;aAgxBkBlJ,c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;;;IAKX,IAAA,CAAA,gBAAA;AAAA,UCmCe,kBAAA,SAA2B,gBAAA;EFgUxBA;;;;;AAy7IpB;EElvJE,aAAA,GAAgB,IAAA,CAAK,mBAAA;AAAA;AAAA,cAGV,eAAA,EAAiB,OAAA;AAAA,iBAiBd,aAAA,CAAc,KAAA,EAAO,kBAAA,GAAqB,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,UC1GnD,cAAA;;;AH+YjB;;;;;AAy7IA;;;;;;;;;;;;;;;;AAyxBA;;;;;;;;;;;EG9jLE,KAAA,IAAS,KAAA,EAAO,gBAAA,KAAqB,KAAA,CAAM,YAAA;AAAA;AAAA,cAGhC,cAAA,EAAgB,MAAA,CAAO,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"indexNext.js","sources":["../src/components/MarkdownInput.tsx","../src/schema.ts","../src/plugin.tsx"],"sourcesContent":["// TODO: when upgrading to @sanity/ui@4 start using the new tokens\n// oxlint-disable typescript/no-deprecated\n\n// dont import non-types here, it will break SSR on next\nimport type {SimpleMDEReactProps} from 'react-simplemde-editor'\n\nimport {Box, Text} from '@sanity/ui'\nimport {type Options as EasyMdeOptions} from 'easymde'\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {PatchEvent, set, type StringInputProps, unset, useClient} from 'sanity'\nimport {styled} from 'styled-components'\n\nimport type {MarkdownOptions} from '../schema'\n\nconst SimpleMdeReact = lazy(() => import('react-simplemde-editor'))\n\nconst MarkdownInputStyles = styled(Box)`\n & .CodeMirror.CodeMirror {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n background-color: inherit;\n }\n\n & .cm-s-easymde .CodeMirror-cursor {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar,\n .editor-preview-side {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n }\n\n & .CodeMirror-focused .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.selectable?.primary?.hovered?.bg};\n }\n\n & .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-toolbar > * {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar > .active,\n .editor-toolbar > button:hover,\n .editor-preview pre,\n .cm-s-easymde .cm-comment {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-preview {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n\n & h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: revert;\n }\n\n & ul,\n li {\n list-style: revert;\n padding: revert;\n }\n\n & a {\n text-decoration: revert;\n }\n }\n`\n\nexport interface MarkdownInputProps extends StringInputProps {\n /**\n * These are passed along directly to\n *\n * Note: MarkdownInput sets certain reactMdeProps.options by default.\n * These will be merged with any custom options.\n */\n reactMdeProps?: Omit<SimpleMDEReactProps, 'value' | 'onChange'>\n}\n\nexport const defaultMdeTools: EasyMdeOptions['toolbar'] = [\n 'heading',\n 'bold',\n 'italic',\n '|',\n 'quote',\n 'unordered-list',\n 'ordered-list',\n '|',\n 'link',\n 'image',\n 'code',\n '|',\n 'preview',\n 'side-by-side',\n]\n\nexport function MarkdownInput(props: MarkdownInputProps): React.JSX.Element {\n const {\n value = '',\n onChange,\n elementProps: {onBlur, onFocus, ref: elementRef},\n reactMdeProps: {options: mdeCustomOptions, ...reactMdeProps} = {},\n schemaType,\n focused,\n } = props\n const client = useClient({apiVersion: '2022-01-01'})\n // oxlint-disable-next-line no-unsafe-type-assertion\n const {imageUrl} = (schemaType.options as MarkdownOptions | undefined) ?? {}\n const [shouldAutoFocus, setShouldAutoFocus] = useState(false)\n const ref = useRef<HTMLDivElement>(null)\n\n // Forward ref to parent form state\n useImperativeHandle(elementRef, () => ref.current)\n\n const imageUpload = useCallback(\n (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => {\n client.assets\n .upload('image', file)\n .then((doc) => onSuccess(imageUrl ? imageUrl(doc) : `${doc.url}?w=450`))\n .catch((e) => {\n console.error(e)\n onError(e.message)\n })\n },\n [client, imageUrl],\n )\n\n const mdeOptions: EasyMdeOptions = useMemo(() => {\n return {\n spellChecker: false,\n sideBySideFullscreen: false,\n uploadImage: true,\n imageUploadFunction: imageUpload,\n toolbar: defaultMdeTools,\n status: false,\n ...mdeCustomOptions,\n autofocus: shouldAutoFocus,\n }\n }, [imageUpload, mdeCustomOptions, shouldAutoFocus])\n\n useEffect(() => {\n const node = ref.current\n if (!node) return undefined\n\n if (focused && !shouldAutoFocus) {\n // Do not set autofocus if the field already has focus\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(!node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n if (!focused && shouldAutoFocus) {\n // If `focused` is false, and the current active focus is no longer within the editor, reset autofocus state\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n return undefined\n }, [focused, shouldAutoFocus])\n\n const handleChange = useCallback(\n (newValue: string) => {\n onChange(PatchEvent.from(newValue ? set(newValue) : unset()))\n },\n [onChange],\n )\n\n return (\n <MarkdownInputStyles>\n <Suspense fallback={fallback}>\n <SimpleMdeReact\n {...reactMdeProps}\n ref={ref}\n value={value}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={onFocus}\n options={mdeOptions}\n spellCheck={false}\n />\n </Suspense>\n </MarkdownInputStyles>\n )\n}\n\nconst fallback = (\n <Box padding={3}>\n <Text>Loading editor...</Text>\n </Box>\n)\n","import type {SanityImageAssetDocument} from '@sanity/client'\n\nimport {defineType, type StringDefinition} from 'sanity'\n\nimport {MarkdownInput} from './components/MarkdownInput'\n\nexport const markdownTypeName = 'markdown'\n\nexport interface MarkdownOptions {\n /**\n * Used to create image url for any uploaded image.\n * The function will be invoked whenever an image is pasted or dragged into the\n * markdown editor, after upload completes.\n *\n * The default implementation uses\n * ```js\n * imageAsset => `${imageAsset.url}?w=450`\n * ```\n * ## Example\n * ```js\n * {\n * imageUrl: imageAsset => `${imageAsset.url}?w=400&h=400`\n * }\n * ```\n * @param imageAsset\n */\n imageUrl?: (imageAsset: SanityImageAssetDocument) => string\n}\n\n/**\n * @public\n */\nexport interface MarkdownDefinition extends Omit<StringDefinition, 'type' | 'fields' | 'options'> {\n type: typeof markdownTypeName\n options?: MarkdownOptions\n}\n\ndeclare module 'sanity' {\n // makes type: 'markdown' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n markdown: MarkdownDefinition\n }\n}\n\nexport const markdownSchemaType = defineType({\n type: 'string',\n name: markdownTypeName,\n title: 'Markdown',\n components: {input: MarkdownInput},\n})\n","import {definePlugin, type Plugin, type StringInputProps} from 'sanity'\n\nimport {markdownSchemaType} from './schema'\n\nexport interface MarkdownConfig {\n /**\n * When provided, will replace the default input component.\n *\n * Use this to customize MarkdownInput by wrapping it in a custom component,\n * and provide any custom props for https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * via the `reactMdeProps` prop.\n *\n * ### Example\n *\n * ```tsx\n * // CustomMarkdownInput.tsx\n * import { MarkdownInput, MarkdownInputProps } from 'sanity-plugin-markdown'\n *\n * export function CustomMarkdownInput(props) {\n * const reactMdeProps: MarkdownInputProps['reactMdeProps'] =\n * useMemo(() => {\n * return {\n * options: {\n * toolbar: ['bold', 'italic'],\n * // more options available, see:\n * // https://github.com/Ionaru/easy-markdown-editor#options-list\n * },\n * // more props available, see:\n * // https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * }\n * }, [])\n *\n * return <MarkdownInput {...props} reactMdeProps={reactMdeProps} />\n * }\n *\n * // studio.config.ts\n * markdownSchema({input: CustomMarkdownInput})\n * ```\n */\n input?: (props: StringInputProps) => React.ReactElement\n}\n\nexport const markdownSchema: Plugin<MarkdownConfig | void> = definePlugin(\n (config: MarkdownConfig | void) => {\n return {\n name: 'markdown-editor',\n schema: {\n types: [\n config && config.input\n ? {...markdownSchemaType, components: {input: config.input}}\n : markdownSchemaType,\n ],\n },\n }\n },\n)\n"],"names":["SimpleMdeReact","lazy","MarkdownInputStyles","styled","Box","withConfig","displayName","componentId","theme","sanity","color","card","enabled","fg","border","selectable","primary","hovered","bg","defaultMdeTools","MarkdownInput","props","$","_c","value","t0","onChange","elementProps","t1","reactMdeProps","t2","schemaType","focused","undefined","onBlur","onFocus","ref","elementRef","t3","mdeCustomOptions","options","t4","for","apiVersion","client","useClient","t5","imageUrl","shouldAutoFocus","setShouldAutoFocus","useState","useRef","t6","Symbol","current","useImperativeHandle","t7","file","onSuccess","onError","assets","upload","then","doc","url","catch","e","console","error","message","imageUpload","t8","spellChecker","sideBySideFullscreen","uploadImage","imageUploadFunction","toolbar","status","autofocus","mdeOptions","t10","t9","node","raf","requestAnimationFrame","contains","document","activeElement","cancelAnimationFrame","raf_0","useEffect","t11","newValue","PatchEvent","from","set","unset","handleChange","t12","fallback","markdownTypeName","markdownSchemaType","defineType","type","name","title","components","input","markdownSchema","definePlugin","config","schema","types"],"mappings":";;;;;;AAuBA,MAAMA,iBAAiBC,KAAK,MAAM,OAAO,wBAAwB,CAAC,GAE5DC,sBAAsBC,OAAOC,GAAG,EAACC,WAAA;AAAA,EAAAC,aAAA;AAAA,EAAAC,aAAA;AAAA,CAAA,mCAE1B,CAAC;AAAA,EAACC;AAAK,MAAMA,MAAMC,OAAOC,MAAMC,KAAKC,QAAQC,EAAE,iBACxC,CAAC;AAAA,EAACL;AAAK,MAAMA,MAAMC,OAAOC,MAAMC,KAAKC,QAAQE,MAAM,8EAKnD,CAAC;AAAA,EAACN;AAAK,MAAMA,MAAMC,OAAOC,MAAMC,KAAKC,QAAQC,EAAE,yDAK/C,CAAC;AAAA,EAACL;AAAK,MAAMA,MAAMC,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zD,EAAA,EAAA,MAAAY,UAAAZ,EAAA,EAAA,MAAAa,WAAAb,UAAAO,iBAAAP,EAAA,EAAA,MAAAE,SAGC0E,0BAAC,qBAAA,EACC,UAAA,oBAAC,UAAA,EAAmBC,UAClB,8BAAC,gBAAA,KACKtE,eACCO,KACEZ,OACGyE,wBACF/D,QACCC,SACA4C,qBACG,YAAA,GAAA,CAAK,EAAA,CAErB,EAAA,CACF,GAAsBzD,QAAA2E,cAAA3E,QAAAyD,YAAAzD,QAAAY,QAAAZ,QAAAa,SAAAb,QAAAO,eAAAP,QAAAE,OAAAF,QAAA4E,OAAAA,MAAA5E,EAAA,EAAA,GAbtB4E;AAasB;AAI1B,MAAMC,+BACH,KAAA,EAAI,SAAS,GACZ,UAAA,oBAAC,MAAA,EAAK,+BAAiB,EAAA,CACzB,GCxMWC,mBAAmB,YAsCnBC,qBAAqBC,WAAW;AAAA,EAC3CC,MAAM;AAAA,EACNC,MAAMJ;AAAAA,EACNK,OAAO;AAAA,EACPC,YAAY;AAAA,IAACC,OAAOvF;AAAAA,EAAAA;AACtB,CAAC,GCPYwF,iBAAgDC,aAC1DC,CAAAA,YACQ;AAAA,EACLN,MAAM;AAAA,EACNO,QAAQ;AAAA,IACNC,OAAO,CACLF,UAAUA,OAAOH,QACb;AAAA,MAAC,GAAGN;AAAAA,MAAoBK,YAAY;AAAA,QAACC,OAAOG,OAAOH;AAAAA,MAAAA;AAAAA,IAAK,IACxDN,kBAAkB;AAAA,EAAA;AAG5B,EAEJ;"}
1
+ {"version":3,"file":"indexNext.js","sources":["../src/components/MarkdownInput.tsx","../src/schema.ts","../src/plugin.tsx"],"sourcesContent":["// TODO: when upgrading to @sanity/ui@4 start using the new tokens\n// oxlint-disable typescript/no-deprecated\n\nimport {Box, Text} from '@sanity/ui'\nimport {type Options as EasyMdeOptions} from 'easymde'\nimport {\n lazy,\n Suspense,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\n// dont import non-types here, it will break SSR on next\nimport type {SimpleMDEReactProps} from 'react-simplemde-editor'\nimport {PatchEvent, set, type StringInputProps, unset, useClient} from 'sanity'\nimport {styled} from 'styled-components'\n\nimport type {MarkdownOptions} from '../schema'\n\nconst SimpleMdeReact = lazy(() => import('react-simplemde-editor'))\n\nconst MarkdownInputStyles = styled(Box)`\n & .CodeMirror.CodeMirror {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n background-color: inherit;\n }\n\n & .cm-s-easymde .CodeMirror-cursor {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar,\n .editor-preview-side {\n border-color: ${({theme}) => theme.sanity.color.card.enabled.border};\n }\n\n & .CodeMirror-focused .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.selectable?.primary?.hovered?.bg};\n }\n\n & .CodeMirror-selected.CodeMirror-selected.CodeMirror-selected {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-toolbar > * {\n color: ${({theme}) => theme.sanity.color.card.enabled.fg};\n }\n\n & .editor-toolbar > .active,\n .editor-toolbar > button:hover,\n .editor-preview pre,\n .cm-s-easymde .cm-comment {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n }\n\n & .editor-preview {\n background-color: ${({theme}) => theme.sanity.color.card.enabled.bg};\n\n & h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: revert;\n }\n\n & ul,\n li {\n list-style: revert;\n padding: revert;\n }\n\n & a {\n text-decoration: revert;\n }\n }\n`\n\nexport interface MarkdownInputProps extends StringInputProps {\n /**\n * These are passed along directly to\n *\n * Note: MarkdownInput sets certain reactMdeProps.options by default.\n * These will be merged with any custom options.\n */\n reactMdeProps?: Omit<SimpleMDEReactProps, 'value' | 'onChange'>\n}\n\nexport const defaultMdeTools: EasyMdeOptions['toolbar'] = [\n 'heading',\n 'bold',\n 'italic',\n '|',\n 'quote',\n 'unordered-list',\n 'ordered-list',\n '|',\n 'link',\n 'image',\n 'code',\n '|',\n 'preview',\n 'side-by-side',\n]\n\nexport function MarkdownInput(props: MarkdownInputProps): React.JSX.Element {\n const {\n value = '',\n onChange,\n elementProps: {onBlur, onFocus, ref: elementRef},\n reactMdeProps: {options: mdeCustomOptions, ...reactMdeProps} = {},\n schemaType,\n focused,\n } = props\n const client = useClient({apiVersion: '2022-01-01'})\n // oxlint-disable-next-line no-unsafe-type-assertion\n const {imageUrl} = (schemaType.options as MarkdownOptions | undefined) ?? {}\n const [shouldAutoFocus, setShouldAutoFocus] = useState(false)\n const ref = useRef<HTMLDivElement>(null)\n\n // Forward ref to parent form state\n useImperativeHandle(elementRef, () => ref.current)\n\n const imageUpload = useCallback(\n (file: File, onSuccess: (url: string) => void, onError: (error: string) => void) => {\n client.assets\n .upload('image', file)\n .then((doc) => onSuccess(imageUrl ? imageUrl(doc) : `${doc.url}?w=450`))\n .catch((e) => {\n console.error(e)\n onError(e.message)\n })\n },\n [client, imageUrl],\n )\n\n const mdeOptions: EasyMdeOptions = useMemo(() => {\n return {\n spellChecker: false,\n sideBySideFullscreen: false,\n uploadImage: true,\n imageUploadFunction: imageUpload,\n toolbar: defaultMdeTools,\n status: false,\n ...mdeCustomOptions,\n autofocus: shouldAutoFocus,\n }\n }, [imageUpload, mdeCustomOptions, shouldAutoFocus])\n\n useEffect(() => {\n const node = ref.current\n if (!node) return undefined\n\n if (focused && !shouldAutoFocus) {\n // Do not set autofocus if the field already has focus\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(!node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n if (!focused && shouldAutoFocus) {\n // If `focused` is false, and the current active focus is no longer within the editor, reset autofocus state\n const raf = requestAnimationFrame(() =>\n setShouldAutoFocus(node.contains(document.activeElement)),\n )\n return () => cancelAnimationFrame(raf)\n }\n\n return undefined\n }, [focused, shouldAutoFocus])\n\n const handleChange = useCallback(\n (newValue: string) => {\n onChange(PatchEvent.from(newValue ? set(newValue) : unset()))\n },\n [onChange],\n )\n\n return (\n <MarkdownInputStyles>\n <Suspense fallback={fallback}>\n <SimpleMdeReact\n {...reactMdeProps}\n ref={ref}\n value={value}\n onChange={handleChange}\n onBlur={onBlur}\n onFocus={onFocus}\n options={mdeOptions}\n spellCheck={false}\n />\n </Suspense>\n </MarkdownInputStyles>\n )\n}\n\nconst fallback = (\n <Box padding={3}>\n <Text>Loading editor...</Text>\n </Box>\n)\n","import type {SanityImageAssetDocument} from '@sanity/client'\nimport {defineType, type StringDefinition} from 'sanity'\n\nimport {MarkdownInput} from './components/MarkdownInput'\n\nexport const markdownTypeName = 'markdown'\n\nexport interface MarkdownOptions {\n /**\n * Used to create image url for any uploaded image.\n * The function will be invoked whenever an image is pasted or dragged into the\n * markdown editor, after upload completes.\n *\n * The default implementation uses\n * ```js\n * imageAsset => `${imageAsset.url}?w=450`\n * ```\n * ## Example\n * ```js\n * {\n * imageUrl: imageAsset => `${imageAsset.url}?w=400&h=400`\n * }\n * ```\n * @param imageAsset\n */\n imageUrl?: (imageAsset: SanityImageAssetDocument) => string\n}\n\n/**\n * @public\n */\nexport interface MarkdownDefinition extends Omit<StringDefinition, 'type' | 'fields' | 'options'> {\n type: typeof markdownTypeName\n options?: MarkdownOptions\n}\n\ndeclare module 'sanity' {\n // makes type: 'markdown' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n markdown: MarkdownDefinition\n }\n}\n\nexport const markdownSchemaType = defineType({\n type: 'string',\n name: markdownTypeName,\n title: 'Markdown',\n components: {input: MarkdownInput},\n})\n","import {definePlugin, type Plugin, type StringInputProps} from 'sanity'\n\nimport {markdownSchemaType} from './schema'\n\nexport interface MarkdownConfig {\n /**\n * When provided, will replace the default input component.\n *\n * Use this to customize MarkdownInput by wrapping it in a custom component,\n * and provide any custom props for https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * via the `reactMdeProps` prop.\n *\n * ### Example\n *\n * ```tsx\n * // CustomMarkdownInput.tsx\n * import { MarkdownInput, MarkdownInputProps } from 'sanity-plugin-markdown'\n *\n * export function CustomMarkdownInput(props) {\n * const reactMdeProps: MarkdownInputProps['reactMdeProps'] =\n * useMemo(() => {\n * return {\n * options: {\n * toolbar: ['bold', 'italic'],\n * // more options available, see:\n * // https://github.com/Ionaru/easy-markdown-editor#options-list\n * },\n * // more props available, see:\n * // https://github.com/RIP21/react-simplemde-editor#react-simplemde-easymde-markdown-editor\n * }\n * }, [])\n *\n * return <MarkdownInput {...props} reactMdeProps={reactMdeProps} />\n * }\n *\n * // studio.config.ts\n * markdownSchema({input: CustomMarkdownInput})\n * ```\n */\n input?: (props: StringInputProps) => React.ReactElement\n}\n\nexport const markdownSchema: Plugin<MarkdownConfig | void> = definePlugin(\n (config: MarkdownConfig | void) => {\n return {\n name: 'markdown-editor',\n schema: {\n types: [\n config && config.input\n ? {...markdownSchemaType, components: {input: config.input}}\n : markdownSchemaType,\n ],\n },\n }\n },\n)\n"],"names":["SimpleMdeReact","lazy","MarkdownInputStyles","styled","Box","withConfig","displayName","componentId","theme","sanity","color","card","enabled","fg","border","selectable","primary","hovered","bg","defaultMdeTools","MarkdownInput","props","$","_c","value","t0","onChange","elementProps","t1","reactMdeProps","t2","schemaType","focused","undefined","onBlur","onFocus","ref","elementRef","t3","mdeCustomOptions","options","t4","for","apiVersion","client","useClient","t5","imageUrl","shouldAutoFocus","setShouldAutoFocus","useState","useRef","t6","Symbol","current","useImperativeHandle","t7","file","onSuccess","onError","assets","upload","then","doc","url","catch","e","console","error","message","imageUpload","t8","spellChecker","sideBySideFullscreen","uploadImage","imageUploadFunction","toolbar","status","autofocus","mdeOptions","t10","t9","node","raf","requestAnimationFrame","contains","document","activeElement","cancelAnimationFrame","raf_0","useEffect","t11","newValue","PatchEvent","from","set","unset","handleChange","t12","fallback","markdownTypeName","markdownSchemaType","defineType","type","name","title","components","input","markdownSchema","defin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NC,OAAO,CACLF,UAAUA,OAAOH,QACb;AAAA,MAAC,GAAGN;AAAAA,MAAoBK,YAAY;AAAA,QAACC,OAAOG,OAAOH;AAAAA,MAAAA;AAAAA,IAAK,IACxDN,kBAAkB;AAAA,EAAA;AAG5B,EAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity-plugin-markdown",
3
- "version": "8.0.5",
3
+ "version": "8.0.6",
4
4
  "description": "Markdown fields in Sanity Studio. Supports Github flavored Markdown and image uploads.",
5
5
  "keywords": [
6
6
  "github flavored markdown",
@@ -34,35 +34,33 @@
34
34
  "./package.json": "./package.json"
35
35
  },
36
36
  "dependencies": {
37
- "@sanity/ui": "^3.1.11",
37
+ "@sanity/ui": "^3.2.0",
38
38
  "react-simplemde-editor": "^5.2.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@sanity/client": "7.14.1",
42
- "@sanity/pkg-utils": "^10.4.1",
43
- "@types/react": "^19.2.10",
41
+ "@sanity/client": "^7.21.0",
42
+ "@sanity/pkg-utils": "^10.5.0",
43
+ "@types/node": "^24.12.4",
44
+ "@types/react": "^19.2.14",
44
45
  "babel-plugin-react-compiler": "^1.0.0",
45
46
  "babel-plugin-styled-components": "^2.1.4",
46
47
  "easymde": "^2.20.0",
47
- "eslint": "^9.39.2",
48
- "react": "^19.2.4",
49
- "sanity": "^5.7.0",
50
- "styled-components": "^6.3.8",
51
- "@repo/eslint-config": "0.0.0",
48
+ "react": "^19.2.5",
49
+ "sanity": "^5.21.0",
50
+ "styled-components": "^6.4.1",
52
51
  "@repo/package.config": "0.0.0",
53
52
  "@repo/tsconfig": "0.0.0"
54
53
  },
55
54
  "peerDependencies": {
56
55
  "easymde": "^2.18",
57
56
  "react": "^19.2",
58
- "sanity": "^5",
57
+ "sanity": "^5 || ^6.0.0-0",
59
58
  "styled-components": "^6.1"
60
59
  },
61
60
  "engines": {
62
61
  "node": ">=20.19 <22 || >=22.12"
63
62
  },
64
63
  "scripts": {
65
- "build": "pkg build --strict --check --clean",
66
- "lint": "eslint ."
64
+ "build": "pkg build --strict --check --clean"
67
65
  }
68
66
  }