@prismicio/client 7.21.7-pr.444.5136044 → 7.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Client.cjs +263 -190
- package/dist/Client.cjs.map +1 -1
- package/dist/Client.d.cts +241 -175
- package/dist/Client.d.cts.map +1 -1
- package/dist/Client.d.ts +241 -175
- package/dist/Client.d.ts.map +1 -1
- package/dist/Client.js +263 -190
- package/dist/Client.js.map +1 -1
- package/dist/Migration.cjs +86 -54
- package/dist/Migration.cjs.map +1 -1
- package/dist/Migration.d.cts +84 -50
- package/dist/Migration.d.cts.map +1 -1
- package/dist/Migration.d.ts +84 -50
- package/dist/Migration.d.ts.map +1 -1
- package/dist/Migration.js +86 -54
- package/dist/Migration.js.map +1 -1
- package/dist/WriteClient.cjs +77 -39
- package/dist/WriteClient.cjs.map +1 -1
- package/dist/WriteClient.d.cts +63 -24
- package/dist/WriteClient.d.cts.map +1 -1
- package/dist/WriteClient.d.ts +63 -24
- package/dist/WriteClient.d.ts.map +1 -1
- package/dist/WriteClient.js +77 -39
- package/dist/WriteClient.js.map +1 -1
- package/dist/buildQueryURL.cjs +22 -15
- package/dist/buildQueryURL.cjs.map +1 -1
- package/dist/buildQueryURL.d.cts +63 -53
- package/dist/buildQueryURL.d.cts.map +1 -1
- package/dist/buildQueryURL.d.ts +63 -53
- package/dist/buildQueryURL.d.ts.map +1 -1
- package/dist/buildQueryURL.js +22 -15
- package/dist/buildQueryURL.js.map +1 -1
- package/dist/cookie.cjs +4 -1
- package/dist/cookie.cjs.map +1 -1
- package/dist/cookie.d.cts +4 -1
- package/dist/cookie.d.cts.map +1 -1
- package/dist/cookie.d.ts +4 -1
- package/dist/cookie.d.ts.map +1 -1
- package/dist/cookie.js +4 -1
- package/dist/cookie.js.map +1 -1
- package/dist/createClient.cjs +14 -10
- package/dist/createClient.cjs.map +1 -1
- package/dist/createClient.d.cts +18 -11
- package/dist/createClient.d.cts.map +1 -1
- package/dist/createClient.d.ts +18 -11
- package/dist/createClient.d.ts.map +1 -1
- package/dist/createClient.js +14 -10
- package/dist/createClient.js.map +1 -1
- package/dist/createMigration.cjs +7 -4
- package/dist/createMigration.cjs.map +1 -1
- package/dist/createMigration.d.cts +11 -5
- package/dist/createMigration.d.cts.map +1 -1
- package/dist/createMigration.d.ts +11 -5
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +7 -4
- package/dist/createMigration.js.map +1 -1
- package/dist/createWriteClient.cjs +13 -8
- package/dist/createWriteClient.cjs.map +1 -1
- package/dist/createWriteClient.d.cts +15 -10
- package/dist/createWriteClient.d.cts.map +1 -1
- package/dist/createWriteClient.d.ts +15 -10
- package/dist/createWriteClient.d.ts.map +1 -1
- package/dist/createWriteClient.js +13 -8
- package/dist/createWriteClient.js.map +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/filter.cjs +18 -5
- package/dist/filter.cjs.map +1 -1
- package/dist/filter.d.cts +63 -59
- package/dist/filter.d.cts.map +1 -1
- package/dist/filter.d.ts +63 -59
- package/dist/filter.d.ts.map +1 -1
- package/dist/filter.js +18 -5
- package/dist/filter.js.map +1 -1
- package/dist/getGraphQLEndpoint.cjs +2 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -1
- package/dist/getGraphQLEndpoint.d.cts +2 -0
- package/dist/getGraphQLEndpoint.d.cts.map +1 -1
- package/dist/getGraphQLEndpoint.d.ts +2 -0
- package/dist/getGraphQLEndpoint.d.ts.map +1 -1
- package/dist/getGraphQLEndpoint.js +2 -0
- package/dist/getGraphQLEndpoint.js.map +1 -1
- package/dist/getRepositoryEndpoint.cjs +8 -4
- package/dist/getRepositoryEndpoint.cjs.map +1 -1
- package/dist/getRepositoryEndpoint.d.cts +8 -4
- package/dist/getRepositoryEndpoint.d.cts.map +1 -1
- package/dist/getRepositoryEndpoint.d.ts +8 -4
- package/dist/getRepositoryEndpoint.d.ts.map +1 -1
- package/dist/getRepositoryEndpoint.js +8 -4
- package/dist/getRepositoryEndpoint.js.map +1 -1
- package/dist/getRepositoryName.cjs +5 -2
- package/dist/getRepositoryName.cjs.map +1 -1
- package/dist/getRepositoryName.d.cts +5 -2
- package/dist/getRepositoryName.d.cts.map +1 -1
- package/dist/getRepositoryName.d.ts +5 -2
- package/dist/getRepositoryName.d.ts.map +1 -1
- package/dist/getRepositoryName.js +5 -2
- package/dist/getRepositoryName.js.map +1 -1
- package/dist/getToolbarSrc.cjs +19 -17
- package/dist/getToolbarSrc.cjs.map +1 -1
- package/dist/getToolbarSrc.d.cts +19 -17
- package/dist/getToolbarSrc.d.cts.map +1 -1
- package/dist/getToolbarSrc.d.ts +19 -17
- package/dist/getToolbarSrc.d.ts.map +1 -1
- package/dist/getToolbarSrc.js +19 -17
- package/dist/getToolbarSrc.js.map +1 -1
- package/dist/helpers/asDate.cjs +9 -6
- package/dist/helpers/asDate.cjs.map +1 -1
- package/dist/helpers/asDate.d.cts +10 -5
- package/dist/helpers/asDate.d.cts.map +1 -1
- package/dist/helpers/asDate.d.ts +10 -5
- package/dist/helpers/asDate.d.ts.map +1 -1
- package/dist/helpers/asDate.js +9 -6
- package/dist/helpers/asDate.js.map +1 -1
- package/dist/helpers/asHTML.cjs +26 -25
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.cts +55 -29
- package/dist/helpers/asHTML.d.cts.map +1 -1
- package/dist/helpers/asHTML.d.ts +55 -29
- package/dist/helpers/asHTML.d.ts.map +1 -1
- package/dist/helpers/asHTML.js +26 -25
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +27 -21
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts +36 -25
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +36 -25
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.js +27 -21
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -1
- package/dist/helpers/asImageSrc.cjs +12 -7
- package/dist/helpers/asImageSrc.cjs.map +1 -1
- package/dist/helpers/asImageSrc.d.cts +15 -8
- package/dist/helpers/asImageSrc.d.cts.map +1 -1
- package/dist/helpers/asImageSrc.d.ts +15 -8
- package/dist/helpers/asImageSrc.d.ts.map +1 -1
- package/dist/helpers/asImageSrc.js +12 -7
- package/dist/helpers/asImageSrc.js.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs +32 -25
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.cts +41 -29
- package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +41 -29
- package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.js +32 -25
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLink.cjs.map +1 -1
- package/dist/helpers/asLink.d.cts +32 -15
- package/dist/helpers/asLink.d.cts.map +1 -1
- package/dist/helpers/asLink.d.ts +32 -15
- package/dist/helpers/asLink.d.ts.map +1 -1
- package/dist/helpers/asLink.js.map +1 -1
- package/dist/helpers/asLinkAttrs.cjs +11 -8
- package/dist/helpers/asLinkAttrs.cjs.map +1 -1
- package/dist/helpers/asLinkAttrs.d.cts +14 -9
- package/dist/helpers/asLinkAttrs.d.cts.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +14 -9
- package/dist/helpers/asLinkAttrs.d.ts.map +1 -1
- package/dist/helpers/asLinkAttrs.js +11 -8
- package/dist/helpers/asLinkAttrs.js.map +1 -1
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.d.cts +23 -10
- package/dist/helpers/asText.d.cts.map +1 -1
- package/dist/helpers/asText.d.ts +23 -10
- package/dist/helpers/asText.d.ts.map +1 -1
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/documentToLinkField.cjs +7 -2
- package/dist/helpers/documentToLinkField.cjs.map +1 -1
- package/dist/helpers/documentToLinkField.d.cts +5 -1
- package/dist/helpers/documentToLinkField.d.cts.map +1 -1
- package/dist/helpers/documentToLinkField.d.ts +5 -1
- package/dist/helpers/documentToLinkField.d.ts.map +1 -1
- package/dist/helpers/documentToLinkField.js +7 -2
- package/dist/helpers/documentToLinkField.js.map +1 -1
- package/dist/helpers/isFilled.cjs +35 -8
- package/dist/helpers/isFilled.cjs.map +1 -1
- package/dist/helpers/isFilled.d.cts +32 -8
- package/dist/helpers/isFilled.d.cts.map +1 -1
- package/dist/helpers/isFilled.d.ts +32 -8
- package/dist/helpers/isFilled.d.ts.map +1 -1
- package/dist/helpers/isFilled.js +35 -8
- package/dist/helpers/isFilled.js.map +1 -1
- package/dist/helpers/mapSliceZone.cjs +10 -8
- package/dist/helpers/mapSliceZone.cjs.map +1 -1
- package/dist/helpers/mapSliceZone.d.cts +63 -35
- package/dist/helpers/mapSliceZone.d.cts.map +1 -1
- package/dist/helpers/mapSliceZone.d.ts +63 -35
- package/dist/helpers/mapSliceZone.d.ts.map +1 -1
- package/dist/helpers/mapSliceZone.js +10 -8
- package/dist/helpers/mapSliceZone.js.map +1 -1
- package/dist/index.cjs +17 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -36
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +50 -36
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -11
- package/dist/index.js.map +1 -1
- package/dist/isRepositoryEndpoint.cjs +4 -3
- package/dist/isRepositoryEndpoint.cjs.map +1 -1
- package/dist/isRepositoryEndpoint.d.cts +4 -3
- package/dist/isRepositoryEndpoint.d.cts.map +1 -1
- package/dist/isRepositoryEndpoint.d.ts +4 -3
- package/dist/isRepositoryEndpoint.d.ts.map +1 -1
- package/dist/isRepositoryEndpoint.js +4 -3
- package/dist/isRepositoryEndpoint.js.map +1 -1
- package/dist/isRepositoryName.cjs +2 -1
- package/dist/isRepositoryName.cjs.map +1 -1
- package/dist/isRepositoryName.d.cts +2 -1
- package/dist/isRepositoryName.d.cts.map +1 -1
- package/dist/isRepositoryName.d.ts +2 -1
- package/dist/isRepositoryName.d.ts.map +1 -1
- package/dist/isRepositoryName.js +2 -1
- package/dist/isRepositoryName.js.map +1 -1
- package/dist/lib/devMsg.cjs +8 -6
- package/dist/lib/devMsg.cjs.map +1 -1
- package/dist/lib/devMsg.js +8 -6
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/lib/getOptionalLinkProperties.cjs +6 -5
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -1
- package/dist/lib/getOptionalLinkProperties.js +6 -5
- package/dist/lib/getOptionalLinkProperties.js.map +1 -1
- package/dist/lib/getPreviewCookie.cjs +3 -1
- package/dist/lib/getPreviewCookie.cjs.map +1 -1
- package/dist/lib/getPreviewCookie.js +3 -1
- package/dist/lib/getPreviewCookie.js.map +1 -1
- package/dist/lib/isInternalURL.cjs +1 -0
- package/dist/lib/isInternalURL.cjs.map +1 -1
- package/dist/lib/isInternalURL.js +1 -0
- package/dist/lib/isInternalURL.js.map +1 -1
- package/dist/lib/isMigrationValue.cjs +17 -7
- package/dist/lib/isMigrationValue.cjs.map +1 -1
- package/dist/lib/isMigrationValue.js +17 -7
- package/dist/lib/isMigrationValue.js.map +1 -1
- package/dist/lib/isValue.cjs +16 -2
- package/dist/lib/isValue.cjs.map +1 -1
- package/dist/lib/isValue.js +16 -2
- package/dist/lib/isValue.js.map +1 -1
- package/dist/lib/pLimit.cjs +7 -5
- package/dist/lib/pLimit.cjs.map +1 -1
- package/dist/lib/pLimit.js +7 -5
- package/dist/lib/pLimit.js.map +1 -1
- package/dist/lib/request.cjs +23 -12
- package/dist/lib/request.cjs.map +1 -1
- package/dist/lib/request.d.cts +20 -7
- package/dist/lib/request.d.cts.map +1 -1
- package/dist/lib/request.d.ts +20 -7
- package/dist/lib/request.d.ts.map +1 -1
- package/dist/lib/request.js +23 -12
- package/dist/lib/request.js.map +1 -1
- package/dist/lib/resolveMigrationDocumentData.cjs +15 -7
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -1
- package/dist/lib/resolveMigrationDocumentData.js +15 -7
- package/dist/lib/resolveMigrationDocumentData.js.map +1 -1
- package/dist/lib/serializerHelpers.cjs.map +1 -1
- package/dist/lib/serializerHelpers.js.map +1 -1
- package/dist/lib/throttledWarn.cjs +4 -3
- package/dist/lib/throttledWarn.cjs.map +1 -1
- package/dist/lib/throttledWarn.js +4 -3
- package/dist/lib/throttledWarn.js.map +1 -1
- package/dist/lib/validateAssetMetadata.cjs +18 -6
- package/dist/lib/validateAssetMetadata.cjs.map +1 -1
- package/dist/lib/validateAssetMetadata.js +18 -6
- package/dist/lib/validateAssetMetadata.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/richtext/asText.cjs +2 -0
- package/dist/richtext/asText.cjs.map +1 -1
- package/dist/richtext/asText.d.cts +2 -0
- package/dist/richtext/asText.d.cts.map +1 -1
- package/dist/richtext/asText.d.ts +2 -0
- package/dist/richtext/asText.d.ts.map +1 -1
- package/dist/richtext/asText.js +2 -0
- package/dist/richtext/asText.js.map +1 -1
- package/dist/richtext/asTree.cjs +4 -2
- package/dist/richtext/asTree.cjs.map +1 -1
- package/dist/richtext/asTree.d.cts +4 -2
- package/dist/richtext/asTree.d.cts.map +1 -1
- package/dist/richtext/asTree.d.ts +4 -2
- package/dist/richtext/asTree.d.ts.map +1 -1
- package/dist/richtext/asTree.js +4 -2
- package/dist/richtext/asTree.js.map +1 -1
- package/dist/richtext/composeSerializers.cjs +7 -4
- package/dist/richtext/composeSerializers.cjs.map +1 -1
- package/dist/richtext/composeSerializers.d.cts +7 -4
- package/dist/richtext/composeSerializers.d.cts.map +1 -1
- package/dist/richtext/composeSerializers.d.ts +7 -4
- package/dist/richtext/composeSerializers.d.ts.map +1 -1
- package/dist/richtext/composeSerializers.js +7 -4
- package/dist/richtext/composeSerializers.js.map +1 -1
- package/dist/richtext/serialize.cjs +6 -2
- package/dist/richtext/serialize.cjs.map +1 -1
- package/dist/richtext/serialize.d.cts +6 -2
- package/dist/richtext/serialize.d.cts.map +1 -1
- package/dist/richtext/serialize.d.ts +6 -2
- package/dist/richtext/serialize.d.ts.map +1 -1
- package/dist/richtext/serialize.js +6 -2
- package/dist/richtext/serialize.js.map +1 -1
- package/dist/richtext/types.cjs.map +1 -1
- package/dist/richtext/types.d.cts +7 -3
- package/dist/richtext/types.d.cts.map +1 -1
- package/dist/richtext/types.d.ts +7 -3
- package/dist/richtext/types.d.ts.map +1 -1
- package/dist/richtext/types.js.map +1 -1
- package/dist/richtext/wrapMapSerializer.cjs +5 -2
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -1
- package/dist/richtext/wrapMapSerializer.d.cts +5 -2
- package/dist/richtext/wrapMapSerializer.d.cts.map +1 -1
- package/dist/richtext/wrapMapSerializer.d.ts +5 -2
- package/dist/richtext/wrapMapSerializer.d.ts.map +1 -1
- package/dist/richtext/wrapMapSerializer.js +5 -2
- package/dist/richtext/wrapMapSerializer.js.map +1 -1
- package/dist/types/api/asset/asset.d.cts +70 -17
- package/dist/types/api/asset/asset.d.cts.map +1 -1
- package/dist/types/api/asset/asset.d.ts +70 -17
- package/dist/types/api/asset/asset.d.ts.map +1 -1
- package/dist/types/api/asset/tag.d.cts +23 -5
- package/dist/types/api/asset/tag.d.cts.map +1 -1
- package/dist/types/api/asset/tag.d.ts +23 -5
- package/dist/types/api/asset/tag.d.ts.map +1 -1
- package/dist/types/api/integration.d.cts +4 -2
- package/dist/types/api/integration.d.cts.map +1 -1
- package/dist/types/api/integration.d.ts +4 -2
- package/dist/types/api/integration.d.ts.map +1 -1
- package/dist/types/api/query.d.cts +27 -10
- package/dist/types/api/query.d.cts.map +1 -1
- package/dist/types/api/query.d.ts +27 -10
- package/dist/types/api/query.d.ts.map +1 -1
- package/dist/types/api/ref.d.cts +16 -6
- package/dist/types/api/ref.d.cts.map +1 -1
- package/dist/types/api/ref.d.ts +16 -6
- package/dist/types/api/ref.d.ts.map +1 -1
- package/dist/types/api/release.d.cts +2 -1
- package/dist/types/api/release.d.cts.map +1 -1
- package/dist/types/api/release.d.ts +2 -1
- package/dist/types/api/release.d.ts.map +1 -1
- package/dist/types/api/repository.d.cts +45 -18
- package/dist/types/api/repository.d.cts.map +1 -1
- package/dist/types/api/repository.d.ts +45 -18
- package/dist/types/api/repository.d.ts.map +1 -1
- package/dist/types/api/tags.d.cts +3 -2
- package/dist/types/api/tags.d.cts.map +1 -1
- package/dist/types/api/tags.d.ts +3 -2
- package/dist/types/api/tags.d.ts.map +1 -1
- package/dist/types/migration/Asset.cjs +13 -4
- package/dist/types/migration/Asset.cjs.map +1 -1
- package/dist/types/migration/Asset.d.cts +66 -20
- package/dist/types/migration/Asset.d.cts.map +1 -1
- package/dist/types/migration/Asset.d.ts +66 -20
- package/dist/types/migration/Asset.d.ts.map +1 -1
- package/dist/types/migration/Asset.js +13 -4
- package/dist/types/migration/Asset.js.map +1 -1
- package/dist/types/migration/ContentRelationship.d.cts +3 -1
- package/dist/types/migration/ContentRelationship.d.cts.map +1 -1
- package/dist/types/migration/ContentRelationship.d.ts +3 -1
- package/dist/types/migration/ContentRelationship.d.ts.map +1 -1
- package/dist/types/migration/Document.cjs +19 -10
- package/dist/types/migration/Document.cjs.map +1 -1
- package/dist/types/migration/Document.d.cts +31 -12
- package/dist/types/migration/Document.d.cts.map +1 -1
- package/dist/types/migration/Document.d.ts +31 -12
- package/dist/types/migration/Document.d.ts.map +1 -1
- package/dist/types/migration/Document.js +19 -10
- package/dist/types/migration/Document.js.map +1 -1
- package/dist/types/model/contentRelationship.d.cts +15 -5
- package/dist/types/model/contentRelationship.d.cts.map +1 -1
- package/dist/types/model/contentRelationship.d.ts +15 -5
- package/dist/types/model/contentRelationship.d.ts.map +1 -1
- package/dist/types/model/customType.d.cts +17 -6
- package/dist/types/model/customType.d.cts.map +1 -1
- package/dist/types/model/customType.d.ts +17 -6
- package/dist/types/model/customType.d.ts.map +1 -1
- package/dist/types/model/image.d.cts.map +1 -1
- package/dist/types/model/image.d.ts.map +1 -1
- package/dist/types/model/linkToMedia.d.cts.map +1 -1
- package/dist/types/model/linkToMedia.d.ts.map +1 -1
- package/dist/types/model/range.d.cts +3 -1
- package/dist/types/model/range.d.cts.map +1 -1
- package/dist/types/model/range.d.ts +3 -1
- package/dist/types/model/range.d.ts.map +1 -1
- package/dist/types/model/separator.d.cts +3 -1
- package/dist/types/model/separator.d.cts.map +1 -1
- package/dist/types/model/separator.d.ts +3 -1
- package/dist/types/model/separator.d.ts.map +1 -1
- package/dist/types/model/sharedSliceVariation.d.cts.map +1 -1
- package/dist/types/model/sharedSliceVariation.d.ts.map +1 -1
- package/dist/types/model/slice.cjs.map +1 -1
- package/dist/types/model/slice.d.cts +3 -1
- package/dist/types/model/slice.d.cts.map +1 -1
- package/dist/types/model/slice.d.ts +3 -1
- package/dist/types/model/slice.d.ts.map +1 -1
- package/dist/types/model/slice.js.map +1 -1
- package/dist/types/model/sliceZone.cjs.map +1 -1
- package/dist/types/model/sliceZone.d.cts.map +1 -1
- package/dist/types/model/sliceZone.d.ts.map +1 -1
- package/dist/types/model/sliceZone.js.map +1 -1
- package/dist/types/model/types.cjs +3 -1
- package/dist/types/model/types.cjs.map +1 -1
- package/dist/types/model/types.d.cts +31 -9
- package/dist/types/model/types.d.cts.map +1 -1
- package/dist/types/model/types.d.ts +31 -9
- package/dist/types/model/types.d.ts.map +1 -1
- package/dist/types/model/types.js +3 -1
- package/dist/types/model/types.js.map +1 -1
- package/dist/types/value/color.d.cts +1 -0
- package/dist/types/value/color.d.cts.map +1 -1
- package/dist/types/value/color.d.ts +1 -0
- package/dist/types/value/color.d.ts.map +1 -1
- package/dist/types/value/contentRelationship.d.cts +5 -3
- package/dist/types/value/contentRelationship.d.cts.map +1 -1
- package/dist/types/value/contentRelationship.d.ts +5 -3
- package/dist/types/value/contentRelationship.d.ts.map +1 -1
- package/dist/types/value/date.d.cts +1 -0
- package/dist/types/value/date.d.cts.map +1 -1
- package/dist/types/value/date.d.ts +1 -0
- package/dist/types/value/date.d.ts.map +1 -1
- package/dist/types/value/document.d.cts +50 -23
- package/dist/types/value/document.d.cts.map +1 -1
- package/dist/types/value/document.d.ts +50 -23
- package/dist/types/value/document.d.ts.map +1 -1
- package/dist/types/value/embed.cjs +1 -1
- package/dist/types/value/embed.cjs.map +1 -1
- package/dist/types/value/embed.d.cts +95 -28
- package/dist/types/value/embed.d.cts.map +1 -1
- package/dist/types/value/embed.d.ts +95 -28
- package/dist/types/value/embed.d.ts.map +1 -1
- package/dist/types/value/embed.js +1 -1
- package/dist/types/value/embed.js.map +1 -1
- package/dist/types/value/geoPoint.d.cts +1 -0
- package/dist/types/value/geoPoint.d.cts.map +1 -1
- package/dist/types/value/geoPoint.d.ts +1 -0
- package/dist/types/value/geoPoint.d.ts.map +1 -1
- package/dist/types/value/group.d.cts.map +1 -1
- package/dist/types/value/group.d.ts.map +1 -1
- package/dist/types/value/image.d.cts +8 -5
- package/dist/types/value/image.d.cts.map +1 -1
- package/dist/types/value/image.d.ts +8 -5
- package/dist/types/value/image.d.ts.map +1 -1
- package/dist/types/value/integration.d.cts +1 -0
- package/dist/types/value/integration.d.cts.map +1 -1
- package/dist/types/value/integration.d.ts +1 -0
- package/dist/types/value/integration.d.ts.map +1 -1
- package/dist/types/value/keyText.d.cts +1 -0
- package/dist/types/value/keyText.d.cts.map +1 -1
- package/dist/types/value/keyText.d.ts +1 -0
- package/dist/types/value/keyText.d.ts.map +1 -1
- package/dist/types/value/link.cjs +3 -1
- package/dist/types/value/link.cjs.map +1 -1
- package/dist/types/value/link.d.cts +12 -8
- package/dist/types/value/link.d.cts.map +1 -1
- package/dist/types/value/link.d.ts +12 -8
- package/dist/types/value/link.d.ts.map +1 -1
- package/dist/types/value/link.js +3 -1
- package/dist/types/value/link.js.map +1 -1
- package/dist/types/value/linkToMedia.d.cts.map +1 -1
- package/dist/types/value/linkToMedia.d.ts.map +1 -1
- package/dist/types/value/number.d.cts +1 -0
- package/dist/types/value/number.d.cts.map +1 -1
- package/dist/types/value/number.d.ts +1 -0
- package/dist/types/value/number.d.ts.map +1 -1
- package/dist/types/value/richText.cjs.map +1 -1
- package/dist/types/value/richText.d.cts +77 -26
- package/dist/types/value/richText.d.cts.map +1 -1
- package/dist/types/value/richText.d.ts +77 -26
- package/dist/types/value/richText.d.ts.map +1 -1
- package/dist/types/value/richText.js.map +1 -1
- package/dist/types/value/select.d.cts +1 -0
- package/dist/types/value/select.d.cts.map +1 -1
- package/dist/types/value/select.d.ts +1 -0
- package/dist/types/value/select.d.ts.map +1 -1
- package/dist/types/value/sharedSliceVariation.d.cts +3 -1
- package/dist/types/value/sharedSliceVariation.d.cts.map +1 -1
- package/dist/types/value/sharedSliceVariation.d.ts +3 -1
- package/dist/types/value/sharedSliceVariation.d.ts.map +1 -1
- package/dist/types/value/slice.d.cts.map +1 -1
- package/dist/types/value/slice.d.ts.map +1 -1
- package/dist/types/value/sliceZone.d.cts +4 -3
- package/dist/types/value/sliceZone.d.cts.map +1 -1
- package/dist/types/value/sliceZone.d.ts +4 -3
- package/dist/types/value/sliceZone.d.ts.map +1 -1
- package/dist/types/value/table.d.cts +63 -14
- package/dist/types/value/table.d.cts.map +1 -1
- package/dist/types/value/table.d.ts +63 -14
- package/dist/types/value/table.d.ts.map +1 -1
- package/dist/types/value/timestamp.d.cts.map +1 -1
- package/dist/types/value/timestamp.d.ts.map +1 -1
- package/dist/types/value/title.d.cts +1 -1
- package/dist/types/value/title.d.cts.map +1 -1
- package/dist/types/value/title.d.ts +1 -1
- package/dist/types/value/title.d.ts.map +1 -1
- package/dist/types/value/types.d.cts +24 -11
- package/dist/types/value/types.d.cts.map +1 -1
- package/dist/types/value/types.d.ts +24 -11
- package/dist/types/value/types.d.ts.map +1 -1
- package/dist/types/webhook/apiUpdate.d.cts +3 -1
- package/dist/types/webhook/apiUpdate.d.cts.map +1 -1
- package/dist/types/webhook/apiUpdate.d.ts +3 -1
- package/dist/types/webhook/apiUpdate.d.ts.map +1 -1
- package/package.json +35 -33
- package/src/Client.ts +399 -236
- package/src/Migration.ts +139 -80
- package/src/WriteClient.ts +174 -64
- package/src/buildQueryURL.ts +100 -68
- package/src/cookie.ts +4 -1
- package/src/createClient.ts +20 -12
- package/src/createMigration.ts +16 -8
- package/src/createWriteClient.ts +19 -11
- package/src/errors.ts +15 -5
- package/src/filter.ts +122 -79
- package/src/getGraphQLEndpoint.ts +3 -0
- package/src/getRepositoryEndpoint.ts +9 -4
- package/src/getRepositoryName.ts +5 -2
- package/src/getToolbarSrc.ts +20 -17
- package/src/helpers/asDate.ts +18 -13
- package/src/helpers/asHTML.ts +102 -55
- package/src/helpers/asImagePixelDensitySrcSet.ts +49 -29
- package/src/helpers/asImageSrc.ts +16 -8
- package/src/helpers/asImageWidthSrcSet.ts +52 -33
- package/src/helpers/asLink.ts +54 -26
- package/src/helpers/asLinkAttrs.ts +29 -14
- package/src/helpers/asText.ts +31 -15
- package/src/helpers/documentToLinkField.ts +15 -4
- package/src/helpers/isFilled.ts +51 -14
- package/src/helpers/mapSliceZone.ts +84 -42
- package/src/index.ts +68 -18
- package/src/isRepositoryEndpoint.ts +4 -3
- package/src/isRepositoryName.ts +2 -1
- package/src/lib/devMsg.ts +8 -6
- package/src/lib/getOptionalLinkProperties.ts +6 -5
- package/src/lib/getPreviewCookie.ts +3 -1
- package/src/lib/isInternalURL.ts +1 -0
- package/src/lib/isMigrationValue.ts +22 -9
- package/src/lib/isValue.ts +38 -9
- package/src/lib/pLimit.ts +16 -9
- package/src/lib/request.ts +40 -15
- package/src/lib/resolveMigrationDocumentData.ts +27 -8
- package/src/lib/serializerHelpers.ts +29 -9
- package/src/lib/throttledWarn.ts +8 -4
- package/src/lib/validateAssetMetadata.ts +43 -17
- package/src/richtext/asText.ts +8 -2
- package/src/richtext/asTree.ts +26 -8
- package/src/richtext/composeSerializers.ts +11 -5
- package/src/richtext/serialize.ts +12 -4
- package/src/richtext/types.ts +57 -13
- package/src/richtext/wrapMapSerializer.ts +8 -4
- package/src/types/api/asset/asset.ts +77 -26
- package/src/types/api/asset/tag.ts +18 -6
- package/src/types/api/integration.ts +10 -4
- package/src/types/api/migration/document.ts +27 -11
- package/src/types/api/query.ts +27 -10
- package/src/types/api/ref.ts +16 -6
- package/src/types/api/release.ts +2 -1
- package/src/types/api/repository.ts +45 -18
- package/src/types/api/tags.ts +3 -2
- package/src/types/migration/Asset.ts +82 -26
- package/src/types/migration/ContentRelationship.ts +12 -5
- package/src/types/migration/Document.ts +52 -26
- package/src/types/migration/Link.ts +9 -7
- package/src/types/model/contentRelationship.ts +20 -7
- package/src/types/model/customType.ts +21 -7
- package/src/types/model/image.ts +5 -4
- package/src/types/model/linkToMedia.ts +2 -1
- package/src/types/model/range.ts +3 -1
- package/src/types/model/separator.ts +3 -1
- package/src/types/model/sharedSliceVariation.ts +4 -4
- package/src/types/model/slice.ts +12 -7
- package/src/types/model/sliceZone.ts +11 -4
- package/src/types/model/types.ts +31 -10
- package/src/types/value/color.ts +3 -3
- package/src/types/value/contentRelationship.ts +13 -8
- package/src/types/value/date.ts +3 -1
- package/src/types/value/document.ts +52 -24
- package/src/types/value/embed.ts +80 -33
- package/src/types/value/geoPoint.ts +8 -6
- package/src/types/value/group.ts +4 -1
- package/src/types/value/image.ts +14 -10
- package/src/types/value/integration.ts +1 -0
- package/src/types/value/keyText.ts +3 -3
- package/src/types/value/link.ts +22 -14
- package/src/types/value/linkToMedia.ts +5 -2
- package/src/types/value/number.ts +3 -3
- package/src/types/value/richText.ts +82 -30
- package/src/types/value/select.ts +1 -0
- package/src/types/value/sharedSliceVariation.ts +11 -3
- package/src/types/value/slice.ts +8 -2
- package/src/types/value/sliceZone.ts +6 -4
- package/src/types/value/table.ts +64 -25
- package/src/types/value/timestamp.ts +2 -3
- package/src/types/value/title.ts +18 -16
- package/src/types/value/types.ts +21 -8
- package/src/types/webhook/apiUpdate.ts +3 -1
package/src/types/value/image.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { FieldState, Simplify } from "./types"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* An individual image within an image field. The base image and each thumbnail
|
|
4
|
+
* An individual image within an image field. The base image and each thumbnail
|
|
5
|
+
* uses this type.
|
|
5
6
|
*
|
|
6
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
+
*
|
|
7
9
|
* @see {@link ImageField} for a full image field type.
|
|
8
10
|
*/
|
|
9
|
-
export type ImageFieldImage<State extends FieldState = FieldState> =
|
|
10
|
-
? EmptyImageFieldImage
|
|
11
|
-
: FilledImageFieldImage
|
|
11
|
+
export type ImageFieldImage<State extends FieldState = FieldState> =
|
|
12
|
+
State extends "empty" ? EmptyImageFieldImage : FilledImageFieldImage
|
|
12
13
|
|
|
13
14
|
export interface FilledImageFieldImage {
|
|
14
15
|
id: string
|
|
@@ -39,12 +40,13 @@ export interface EmptyImageFieldImage {
|
|
|
39
40
|
/**
|
|
40
41
|
* An image field.
|
|
41
42
|
*
|
|
42
|
-
* **Note**: Passing `null` to the `ThumbnailNames` parameter is deprecated and
|
|
43
|
-
* future version. Use `never` instead.
|
|
43
|
+
* **Note**: Passing `null` to the `ThumbnailNames` parameter is deprecated and
|
|
44
|
+
* will be removed in a future version. Use `never` instead.
|
|
44
45
|
*
|
|
45
|
-
* @typeParam ThumbnailNames - Names of thumbnails. If the field does not
|
|
46
|
-
* `never` can be used to "disable" thumbnail fields.
|
|
46
|
+
* @typeParam ThumbnailNames - Names of thumbnails. If the field does not
|
|
47
|
+
* contain thumbnails, `never` can be used to "disable" thumbnail fields.
|
|
47
48
|
* @typeParam State - State of the field which determines its shape.
|
|
49
|
+
*
|
|
48
50
|
* @see Image field documentation: {@link https://prismic.io/docs/image}
|
|
49
51
|
*/
|
|
50
52
|
export type ImageField<
|
|
@@ -69,6 +71,8 @@ export type ImageField<
|
|
|
69
71
|
// version written below. This version leads to a better code
|
|
70
72
|
// editor experience.
|
|
71
73
|
State extends "filled"
|
|
72
|
-
? ImageFieldImage<State> &
|
|
73
|
-
|
|
74
|
+
? ImageFieldImage<State> &
|
|
75
|
+
Record<Extract<ThumbnailNames, string>, ImageFieldImage<State>>
|
|
76
|
+
: ImageFieldImage<State> &
|
|
77
|
+
Record<Extract<ThumbnailNames, string>, ImageFieldImage<State>>
|
|
74
78
|
>
|
|
@@ -5,6 +5,7 @@ import type { FieldState } from "./types"
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam Data - Data from the integrated API.
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
+
*
|
|
8
9
|
* @see More details: {@link https://prismic.io/docs/fields/integration}
|
|
9
10
|
*/
|
|
10
11
|
export type IntegrationField<
|
|
@@ -4,8 +4,8 @@ import type { FieldState } from "./types"
|
|
|
4
4
|
* A key text field
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
+
*
|
|
7
8
|
* @see More details: {@link https://prismic.io/docs/key-text}
|
|
8
9
|
*/
|
|
9
|
-
export type KeyTextField<State extends FieldState = FieldState> =
|
|
10
|
-
? null | ""
|
|
11
|
-
: string
|
|
10
|
+
export type KeyTextField<State extends FieldState = FieldState> =
|
|
11
|
+
State extends "empty" ? null | "" : string
|
package/src/types/value/link.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { AnyRegularField, FieldState } from "./types"
|
|
2
|
+
|
|
1
3
|
import type { FilledContentRelationshipField } from "./contentRelationship"
|
|
2
4
|
import type { GroupField } from "./group"
|
|
3
5
|
import type { FilledLinkToMediaField } from "./linkToMedia"
|
|
4
6
|
import type { SliceZone } from "./sliceZone"
|
|
5
|
-
import type { AnyRegularField, FieldState } from "./types"
|
|
6
7
|
|
|
7
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Link types
|
|
10
|
+
*/
|
|
8
11
|
export const LinkType = {
|
|
9
12
|
Any: "Any",
|
|
10
13
|
Document: "Document",
|
|
@@ -17,16 +20,17 @@ export const LinkType = {
|
|
|
17
20
|
*
|
|
18
21
|
* @typeParam TypeEnum - Type API ID of the document.
|
|
19
22
|
* @typeParam LangEnum - Language API ID of the document.
|
|
20
|
-
* @typeParam DataInterface - Data fields for the document (filled via the
|
|
21
|
-
* `graphQuery` query parameter).
|
|
23
|
+
* @typeParam DataInterface - Data fields for the document (filled via the
|
|
24
|
+
* `fetchLinks` or `graphQuery` query parameter).
|
|
22
25
|
* @typeParam State - State of the field which determines its shape.
|
|
23
26
|
* @typeParam Variant - Variants of the link.
|
|
24
27
|
*/
|
|
25
28
|
export type LinkField<
|
|
26
29
|
TypeEnum = string,
|
|
27
30
|
LangEnum = string,
|
|
28
|
-
DataInterface extends
|
|
29
|
-
|
|
31
|
+
DataInterface extends
|
|
32
|
+
| Record<string, AnyRegularField | GroupField | SliceZone>
|
|
33
|
+
| unknown = unknown,
|
|
30
34
|
State extends FieldState = FieldState,
|
|
31
35
|
Variant = string,
|
|
32
36
|
> = State extends "empty"
|
|
@@ -38,15 +42,16 @@ export type LinkField<
|
|
|
38
42
|
*
|
|
39
43
|
* @typeParam TypeEnum - Type API ID of the document.
|
|
40
44
|
* @typeParam LangEnum - Language API ID of the document.
|
|
41
|
-
* @typeParam DataInterface - Data fields for the document (filled via the
|
|
42
|
-
* `graphQuery` query parameter).
|
|
45
|
+
* @typeParam DataInterface - Data fields for the document (filled via the
|
|
46
|
+
* `fetchLinks` or `graphQuery` query parameter).
|
|
43
47
|
* @typeParam Variant - Variants of the link.
|
|
44
48
|
*/
|
|
45
49
|
export type FilledLinkField<
|
|
46
50
|
TypeEnum = string,
|
|
47
51
|
LangEnum = string,
|
|
48
|
-
DataInterface extends
|
|
49
|
-
|
|
52
|
+
DataInterface extends
|
|
53
|
+
| Record<string, AnyRegularField | GroupField | SliceZone>
|
|
54
|
+
| unknown = unknown,
|
|
50
55
|
Variant = string,
|
|
51
56
|
> =
|
|
52
57
|
| (FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface> &
|
|
@@ -58,11 +63,12 @@ export type FilledLinkField<
|
|
|
58
63
|
* A link field that is not filled.
|
|
59
64
|
*
|
|
60
65
|
* @typeParam _Unused - THIS PARAMETER IS NOT USED. If you are passing a type,
|
|
61
|
-
*
|
|
66
|
+
* **please remove it**.
|
|
62
67
|
* @typeParam Variant - Variants of the link.
|
|
63
68
|
*/
|
|
64
69
|
export type EmptyLinkField<
|
|
65
|
-
_Unused extends
|
|
70
|
+
_Unused extends
|
|
71
|
+
(typeof LinkType)[keyof typeof LinkType] = typeof LinkType.Any,
|
|
66
72
|
Variant = string,
|
|
67
73
|
> = {
|
|
68
74
|
link_type: "Any"
|
|
@@ -80,10 +86,12 @@ export type FilledLinkToWebField<Variant = string> = {
|
|
|
80
86
|
} & OptionalLinkProperties<Variant>
|
|
81
87
|
|
|
82
88
|
/**
|
|
83
|
-
* Optional properties available to link fields. It is used to augment existing
|
|
84
|
-
* (like content relationship fields) with field-specific
|
|
89
|
+
* Optional properties available to link fields. It is used to augment existing
|
|
90
|
+
* link-like fields (like content relationship fields) with field-specific
|
|
91
|
+
* properties.
|
|
85
92
|
*
|
|
86
93
|
* @typeParam Variant - Variants of the link.
|
|
94
|
+
*
|
|
87
95
|
* @internal
|
|
88
96
|
*/
|
|
89
97
|
// Remember to update the `getOptionalLinkProperties()` function when updating
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { OptionalLinkProperties } from "./link"
|
|
2
1
|
import type { FieldState } from "./types"
|
|
3
2
|
|
|
3
|
+
import type { OptionalLinkProperties } from "./link"
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* A link field that points to media.
|
|
6
7
|
*
|
|
@@ -10,7 +11,9 @@ import type { FieldState } from "./types"
|
|
|
10
11
|
export type LinkToMediaField<
|
|
11
12
|
State extends FieldState = FieldState,
|
|
12
13
|
Variant = string,
|
|
13
|
-
> = State extends "empty"
|
|
14
|
+
> = State extends "empty"
|
|
15
|
+
? EmptyLinkToMediaField<Variant>
|
|
16
|
+
: FilledLinkToMediaField<Variant>
|
|
14
17
|
|
|
15
18
|
type EmptyLinkToMediaField<Variant = string> = {
|
|
16
19
|
link_type: "Any"
|
|
@@ -4,8 +4,8 @@ import type { FieldState } from "./types"
|
|
|
4
4
|
* A number field.
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
|
+
*
|
|
7
8
|
* @see More details: {@link https://prismic.io/docs/number}
|
|
8
9
|
*/
|
|
9
|
-
export type NumberField<State extends FieldState = FieldState> =
|
|
10
|
-
? null
|
|
11
|
-
: number
|
|
10
|
+
export type NumberField<State extends FieldState = FieldState> =
|
|
11
|
+
State extends "empty" ? null : number
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { FieldState } from "./types"
|
|
2
|
+
|
|
1
3
|
import type { EmbedField } from "./embed"
|
|
2
4
|
import type { FilledLinkField } from "./link"
|
|
3
|
-
import type { FieldState } from "./types"
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Types enum for RichTextNodes
|
|
@@ -34,85 +35,116 @@ export const RichTextNodeType = {
|
|
|
34
35
|
*
|
|
35
36
|
* @see More details: {@link https://prismic.io/docs/rich-text-title}
|
|
36
37
|
*/
|
|
37
|
-
export type RichTextNodeTypes =
|
|
38
|
+
export type RichTextNodeTypes =
|
|
39
|
+
(typeof RichTextNodeType)[keyof typeof RichTextNodeType]
|
|
38
40
|
|
|
39
41
|
// Text nodes
|
|
40
42
|
|
|
41
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Base to be extended by other rich text nodes.
|
|
45
|
+
*/
|
|
42
46
|
export interface RTTextNodeBase {
|
|
43
47
|
text: string
|
|
44
48
|
spans: RTInlineNode[]
|
|
45
49
|
direction?: "ltr" | "rtl"
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Rich text `heading1` node
|
|
54
|
+
*/
|
|
49
55
|
export interface RTHeading1Node extends RTTextNodeBase {
|
|
50
56
|
type: typeof RichTextNodeType.heading1
|
|
51
57
|
}
|
|
52
58
|
|
|
53
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Rich text `heading2` node
|
|
61
|
+
*/
|
|
54
62
|
export interface RTHeading2Node extends RTTextNodeBase {
|
|
55
63
|
type: typeof RichTextNodeType.heading2
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Rich text `heading3` node
|
|
68
|
+
*/
|
|
59
69
|
export interface RTHeading3Node extends RTTextNodeBase {
|
|
60
70
|
type: typeof RichTextNodeType.heading3
|
|
61
71
|
}
|
|
62
72
|
|
|
63
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Rich text `heading4` node
|
|
75
|
+
*/
|
|
64
76
|
export interface RTHeading4Node extends RTTextNodeBase {
|
|
65
77
|
type: typeof RichTextNodeType.heading4
|
|
66
78
|
}
|
|
67
79
|
|
|
68
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Rich text `heading5` node
|
|
82
|
+
*/
|
|
69
83
|
export interface RTHeading5Node extends RTTextNodeBase {
|
|
70
84
|
type: typeof RichTextNodeType.heading5
|
|
71
85
|
}
|
|
72
86
|
|
|
73
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Rich text `heading6` node
|
|
89
|
+
*/
|
|
74
90
|
export interface RTHeading6Node extends RTTextNodeBase {
|
|
75
91
|
type: typeof RichTextNodeType.heading6
|
|
76
92
|
}
|
|
77
93
|
|
|
78
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Rich text `paragraph` node
|
|
96
|
+
*/
|
|
79
97
|
export interface RTParagraphNode extends RTTextNodeBase {
|
|
80
98
|
type: typeof RichTextNodeType.paragraph
|
|
81
99
|
}
|
|
82
100
|
|
|
83
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Rich text `preformatted` node
|
|
103
|
+
*/
|
|
84
104
|
export interface RTPreformattedNode extends RTTextNodeBase {
|
|
85
105
|
type: typeof RichTextNodeType.preformatted
|
|
86
106
|
}
|
|
87
107
|
|
|
88
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Rich text `list-item` node
|
|
110
|
+
*/
|
|
89
111
|
export interface RTListItemNode extends RTTextNodeBase {
|
|
90
112
|
type: typeof RichTextNodeType.listItem
|
|
91
113
|
}
|
|
92
114
|
|
|
93
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Rich text `o-list-item` node for ordered lists
|
|
117
|
+
*/
|
|
94
118
|
export interface RTOListItemNode extends RTTextNodeBase {
|
|
95
119
|
type: typeof RichTextNodeType.oListItem
|
|
96
120
|
}
|
|
97
121
|
|
|
98
122
|
// Span nodes
|
|
99
123
|
|
|
100
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* @internal Span Node base to be extended for other Span nodes
|
|
126
|
+
*/
|
|
101
127
|
export interface RTSpanNodeBase {
|
|
102
128
|
start: number
|
|
103
129
|
end: number
|
|
104
130
|
}
|
|
105
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Rich text `strong` node
|
|
133
|
+
*/
|
|
106
134
|
export interface RTStrongNode extends RTSpanNodeBase {
|
|
107
135
|
type: typeof RichTextNodeType.strong
|
|
108
136
|
}
|
|
109
137
|
|
|
110
|
-
/**
|
|
138
|
+
/**
|
|
139
|
+
* Rich text `embed` node
|
|
140
|
+
*/
|
|
111
141
|
export interface RTEmNode extends RTSpanNodeBase {
|
|
112
142
|
type: typeof RichTextNodeType.em
|
|
113
143
|
}
|
|
114
144
|
|
|
115
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Rich text `label` node
|
|
147
|
+
*/
|
|
116
148
|
export interface RTLabelNode extends RTSpanNodeBase {
|
|
117
149
|
type: typeof RichTextNodeType.label
|
|
118
150
|
data: {
|
|
@@ -122,7 +154,10 @@ export interface RTLabelNode extends RTSpanNodeBase {
|
|
|
122
154
|
|
|
123
155
|
// Media nodes
|
|
124
156
|
|
|
125
|
-
/**
|
|
157
|
+
/**
|
|
158
|
+
* Rich text `image` nodes. They could link to other documents, external web
|
|
159
|
+
* links and media fields
|
|
160
|
+
*/
|
|
126
161
|
export type RTImageNode = {
|
|
127
162
|
type: typeof RichTextNodeType.image
|
|
128
163
|
id: string
|
|
@@ -142,7 +177,9 @@ export type RTImageNode = {
|
|
|
142
177
|
linkTo?: FilledLinkField
|
|
143
178
|
}
|
|
144
179
|
|
|
145
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* Rich text `embed` node
|
|
182
|
+
*/
|
|
146
183
|
export type RTEmbedNode = {
|
|
147
184
|
type: typeof RichTextNodeType.embed
|
|
148
185
|
oembed: EmbedField
|
|
@@ -162,27 +199,35 @@ export interface RTLinkNode extends RTSpanNodeBase {
|
|
|
162
199
|
|
|
163
200
|
// Serialization related nodes
|
|
164
201
|
|
|
165
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* Rich text `list` node
|
|
204
|
+
*/
|
|
166
205
|
export interface RTListNode {
|
|
167
206
|
type: typeof RichTextNodeType.list
|
|
168
207
|
items: RTListItemNode[]
|
|
169
208
|
}
|
|
170
209
|
|
|
171
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* Rich text o-lost node
|
|
212
|
+
*/
|
|
172
213
|
export interface RTOListNode {
|
|
173
214
|
type: typeof RichTextNodeType.oList
|
|
174
215
|
items: RTOListItemNode[]
|
|
175
216
|
}
|
|
176
217
|
|
|
177
218
|
// This one is confusing but it's actually the inner content of a block
|
|
178
|
-
/**
|
|
219
|
+
/**
|
|
220
|
+
* Rich text `span` node
|
|
221
|
+
*/
|
|
179
222
|
export interface RTSpanNode extends RTTextNodeBase {
|
|
180
223
|
type: typeof RichTextNodeType.span
|
|
181
224
|
}
|
|
182
225
|
|
|
183
226
|
// Helpers
|
|
184
227
|
|
|
185
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Nodes from a rich text field
|
|
230
|
+
*/
|
|
186
231
|
export type RTNode =
|
|
187
232
|
| RTHeading1Node
|
|
188
233
|
| RTHeading2Node
|
|
@@ -197,7 +242,9 @@ export type RTNode =
|
|
|
197
242
|
| RTImageNode
|
|
198
243
|
| RTEmbedNode
|
|
199
244
|
|
|
200
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* Rich text nodes with text
|
|
247
|
+
*/
|
|
201
248
|
export type RTTextNode =
|
|
202
249
|
| RTHeading1Node
|
|
203
250
|
| RTHeading2Node
|
|
@@ -210,7 +257,9 @@ export type RTTextNode =
|
|
|
210
257
|
| RTListItemNode
|
|
211
258
|
| RTOListItemNode
|
|
212
259
|
|
|
213
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* Rich text block nodes
|
|
262
|
+
*/
|
|
214
263
|
export type RTBlockNode =
|
|
215
264
|
| RTHeading1Node
|
|
216
265
|
| RTHeading2Node
|
|
@@ -227,10 +276,14 @@ export type RTBlockNode =
|
|
|
227
276
|
| RTImageNode
|
|
228
277
|
| RTEmbedNode
|
|
229
278
|
|
|
230
|
-
/**
|
|
279
|
+
/**
|
|
280
|
+
* Inline rich text nodes
|
|
281
|
+
*/
|
|
231
282
|
export type RTInlineNode = RTStrongNode | RTEmNode | RTLabelNode | RTLinkNode
|
|
232
283
|
|
|
233
|
-
/**
|
|
284
|
+
/**
|
|
285
|
+
* All rich text nodes
|
|
286
|
+
*/
|
|
234
287
|
export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode
|
|
235
288
|
|
|
236
289
|
/**
|
|
@@ -238,6 +291,5 @@ export type RTAnyNode = RTBlockNode | RTInlineNode | RTSpanNode
|
|
|
238
291
|
*
|
|
239
292
|
* @see Rich text field documentation: {@link https://prismic.io/docs/rich-text-title}
|
|
240
293
|
*/
|
|
241
|
-
export type RichTextField<State extends FieldState = FieldState> =
|
|
242
|
-
? []
|
|
243
|
-
: [RTNode, ...RTNode[]]
|
|
294
|
+
export type RichTextField<State extends FieldState = FieldState> =
|
|
295
|
+
State extends "empty" ? [] : [RTNode, ...RTNode[]]
|
|
@@ -5,6 +5,7 @@ import type { FieldState } from "./types"
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam Enum - Selectable options for the field.
|
|
7
7
|
* @typeParam State - State of the field which determines its shape.
|
|
8
|
+
*
|
|
8
9
|
* @see More details: {@link https://prismic.io/docs/select}
|
|
9
10
|
*/
|
|
10
11
|
export type SelectField<
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { AnyRegularField, AnySlicePrimaryField } from "./types"
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* A shared Slice variation.
|
|
5
|
+
*/
|
|
4
6
|
export interface SharedSliceVariation<
|
|
5
7
|
Variation = string,
|
|
6
|
-
PrimaryFields extends Record<string, AnySlicePrimaryField> = Record<
|
|
7
|
-
|
|
8
|
+
PrimaryFields extends Record<string, AnySlicePrimaryField> = Record<
|
|
9
|
+
string,
|
|
10
|
+
AnySlicePrimaryField
|
|
11
|
+
>,
|
|
12
|
+
ItemsFields extends Record<string, AnyRegularField> = Record<
|
|
13
|
+
string,
|
|
14
|
+
AnyRegularField
|
|
15
|
+
>,
|
|
8
16
|
> {
|
|
9
17
|
variation: Variation
|
|
10
18
|
version: string
|
package/src/types/value/slice.ts
CHANGED
|
@@ -7,8 +7,14 @@ import type { AnyRegularField } from "./types"
|
|
|
7
7
|
*/
|
|
8
8
|
export interface Slice<
|
|
9
9
|
SliceType = string,
|
|
10
|
-
PrimaryFields extends Record<string, AnyRegularField> = Record<
|
|
11
|
-
|
|
10
|
+
PrimaryFields extends Record<string, AnyRegularField> = Record<
|
|
11
|
+
string,
|
|
12
|
+
AnyRegularField
|
|
13
|
+
>,
|
|
14
|
+
ItemsFields extends Record<string, AnyRegularField> = Record<
|
|
15
|
+
string,
|
|
16
|
+
AnyRegularField
|
|
17
|
+
>,
|
|
12
18
|
> {
|
|
13
19
|
slice_type: SliceType
|
|
14
20
|
slice_label: string | null
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import type { FieldState } from "./types"
|
|
2
|
+
|
|
1
3
|
import type { SharedSlice } from "./sharedSlice"
|
|
2
4
|
import type { Slice } from "./slice"
|
|
3
|
-
import type { FieldState } from "./types"
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
* Prismic Slices are sections of your website. Prismic documents contain a
|
|
7
|
-
* that allows content creators to add, edit, and rearrange
|
|
8
|
-
* any page design, such as blog posts,
|
|
7
|
+
* Prismic Slices are sections of your website. Prismic documents contain a
|
|
8
|
+
* dynamic "Slice Zone" that allows content creators to add, edit, and rearrange
|
|
9
|
+
* Slices to compose dynamic layouts for any page design, such as blog posts,
|
|
10
|
+
* landing pages, case studies, and tutorials.
|
|
9
11
|
*
|
|
10
12
|
* @see More details: {@link https://prismic.io/docs/slice}
|
|
11
13
|
*/
|
package/src/types/value/table.ts
CHANGED
|
@@ -1,70 +1,109 @@
|
|
|
1
|
-
import type { RichTextField } from "./richText"
|
|
2
1
|
import type { FieldState } from "./types"
|
|
3
2
|
|
|
3
|
+
import type { RichTextField } from "./richText"
|
|
4
|
+
|
|
4
5
|
/**
|
|
5
6
|
* A table field.
|
|
6
7
|
*
|
|
7
8
|
* @typeParam State - State of the field which determines its shape.
|
|
9
|
+
*
|
|
8
10
|
* @see More details: {@link https://prismic.io/docs/table}
|
|
9
11
|
*/
|
|
10
|
-
export type TableField<State extends FieldState = FieldState> =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export type TableField<State extends FieldState = FieldState> =
|
|
13
|
+
State extends "empty"
|
|
14
|
+
? null
|
|
15
|
+
: {
|
|
16
|
+
/**
|
|
17
|
+
* The head of the table.
|
|
18
|
+
*/
|
|
19
|
+
head?: TableFieldHead
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The body of the table.
|
|
23
|
+
*/
|
|
24
|
+
body: TableFieldBody
|
|
25
|
+
}
|
|
19
26
|
|
|
20
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Represents a table head.
|
|
29
|
+
*/
|
|
21
30
|
export type TableFieldHead = {
|
|
22
31
|
rows: TableFieldHeadRow[]
|
|
23
32
|
}
|
|
24
33
|
|
|
25
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Represents a table body.
|
|
36
|
+
*/
|
|
26
37
|
export type TableFieldBody = {
|
|
27
38
|
rows: TableFieldBodyRow[]
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Represents a row in a table head.
|
|
43
|
+
*/
|
|
31
44
|
export type TableFieldHeadRow = {
|
|
32
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Unique key of the row.
|
|
47
|
+
*/
|
|
33
48
|
key: string
|
|
34
49
|
|
|
35
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Cells in the row.
|
|
52
|
+
*/
|
|
36
53
|
cells: TableFieldHeaderCell[]
|
|
37
54
|
}
|
|
38
55
|
|
|
39
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Represents a table header cell.
|
|
58
|
+
*/
|
|
40
59
|
export type TableFieldHeaderCell = {
|
|
41
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Unique key of the cell.
|
|
62
|
+
*/
|
|
42
63
|
key: string
|
|
43
64
|
|
|
44
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* The type of the cell.
|
|
67
|
+
*/
|
|
45
68
|
type: "header"
|
|
46
69
|
|
|
47
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* The content of the cell.
|
|
72
|
+
*/
|
|
48
73
|
content: RichTextField
|
|
49
74
|
}
|
|
50
75
|
|
|
51
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Represents a row in a table body.
|
|
78
|
+
*/
|
|
52
79
|
export type TableFieldBodyRow = {
|
|
53
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Unique key of the row.
|
|
82
|
+
*/
|
|
54
83
|
key: string
|
|
55
84
|
|
|
56
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Cells in the row.
|
|
87
|
+
*/
|
|
57
88
|
cells: (TableFieldHeaderCell | TableFieldDataCell)[]
|
|
58
89
|
}
|
|
59
90
|
|
|
60
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Represents a table data cell.
|
|
93
|
+
*/
|
|
61
94
|
export type TableFieldDataCell = {
|
|
62
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Unique key of the cell.
|
|
97
|
+
*/
|
|
63
98
|
key: string
|
|
64
99
|
|
|
65
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* The type of the cell.
|
|
102
|
+
*/
|
|
66
103
|
type: "data"
|
|
67
104
|
|
|
68
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* The content of the cell.
|
|
107
|
+
*/
|
|
69
108
|
content: RichTextField
|
|
70
109
|
}
|
|
@@ -5,6 +5,5 @@ import type { FieldState } from "./types"
|
|
|
5
5
|
*
|
|
6
6
|
* @typeParam State - State of the field which determines its shape.
|
|
7
7
|
*/
|
|
8
|
-
export type TimestampField<State extends FieldState = FieldState> =
|
|
9
|
-
? null
|
|
10
|
-
: string
|
|
8
|
+
export type TimestampField<State extends FieldState = FieldState> =
|
|
9
|
+
State extends "empty" ? null : string
|