From e0d870d654736784b29941d6c041ae398f0e31e8 Mon Sep 17 00:00:00 2001 From: Peter Simonsson Date: Fri, 3 Jul 2026 11:44:46 +0100 Subject: [PATCH 1/5] Regenerate Sanity schema and types after dependency upgrade The Next.js 16 / next-sanity 12 upgrade bumped the Sanity toolchain but did not regenerate the extracted schema and query types, leaving them out of sync with the current CLI output. Regenerating brings them back in step so later typegen runs produce no incidental diff. --- apps/frontend/sanity.types.ts | 804 ++++++++++------------ apps/sanity/schema.json | 1213 +++++++++++++++++---------------- 2 files changed, 983 insertions(+), 1034 deletions(-) diff --git a/apps/frontend/sanity.types.ts b/apps/frontend/sanity.types.ts index 4db8f3e..cc1797a 100644 --- a/apps/frontend/sanity.types.ts +++ b/apps/frontend/sanity.types.ts @@ -13,61 +13,6 @@ */ // Source: schema.json -export type SanityImagePaletteSwatch = { - _type: 'sanity.imagePaletteSwatch'; - background?: string; - foreground?: string; - population?: number; - title?: string; -}; - -export type SanityImagePalette = { - _type: 'sanity.imagePalette'; - darkMuted?: SanityImagePaletteSwatch; - lightVibrant?: SanityImagePaletteSwatch; - darkVibrant?: SanityImagePaletteSwatch; - vibrant?: SanityImagePaletteSwatch; - dominant?: SanityImagePaletteSwatch; - lightMuted?: SanityImagePaletteSwatch; - muted?: SanityImagePaletteSwatch; -}; - -export type SanityImageDimensions = { - _type: 'sanity.imageDimensions'; - height?: number; - width?: number; - aspectRatio?: number; -}; - -export type SanityFileAsset = { - _id: string; - _type: 'sanity.fileAsset'; - _createdAt: string; - _updatedAt: string; - _rev: string; - originalFilename?: string; - label?: string; - title?: string; - description?: string; - altText?: string; - sha1hash?: string; - extension?: string; - mimeType?: string; - size?: number; - assetId?: string; - uploadId?: string; - path?: string; - url?: string; - source?: SanityAssetSourceData; -}; - -export type Geopoint = { - _type: 'geopoint'; - lat?: number; - lng?: number; - alt?: number; -}; - export type Settings = { _id: string; _type: 'settings'; @@ -115,6 +60,13 @@ export type Navigation = { }>; }; +export type SanityImageAssetReference = { + _ref: string; + _type: 'reference'; + _weak?: boolean; + [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; +}; + export type Post = { _id: string; _type: 'post'; @@ -125,12 +77,8 @@ export type Post = { slug?: Slug; type?: 'article' | 'project' | 'page' | 'artwork'; image?: { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; _type: 'image'; @@ -169,12 +117,8 @@ export type Post = { _key: string; } | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -215,9 +159,84 @@ export type SanityImageHotspot = { width?: number; }; -export type SanityImageAsset = { +export type Slug = { + _type: 'slug'; + current?: string; + source?: string; +}; + +export type MediaTag = { _id: string; - _type: 'sanity.imageAsset'; + _type: 'media.tag'; + _createdAt: string; + _updatedAt: string; + _rev: string; + name?: Slug; +}; + +export type Table = { + _type: 'table'; + rows?: Array< + { + _key: string; + } & TableRow + >; +}; + +export type TableRow = { + _type: 'tableRow'; + cells?: Array; +}; + +export type Code = { + _type: 'code'; + language?: string; + filename?: string; + code?: string; + highlightedLines?: Array; +}; + +export type SanityImagePaletteSwatch = { + _type: 'sanity.imagePaletteSwatch'; + background?: string; + foreground?: string; + population?: number; + title?: string; +}; + +export type SanityImagePalette = { + _type: 'sanity.imagePalette'; + darkMuted?: SanityImagePaletteSwatch; + lightVibrant?: SanityImagePaletteSwatch; + darkVibrant?: SanityImagePaletteSwatch; + vibrant?: SanityImagePaletteSwatch; + dominant?: SanityImagePaletteSwatch; + lightMuted?: SanityImagePaletteSwatch; + muted?: SanityImagePaletteSwatch; +}; + +export type SanityImageDimensions = { + _type: 'sanity.imageDimensions'; + height?: number; + width?: number; + aspectRatio?: number; +}; + +export type SanityImageMetadata = { + _type: 'sanity.imageMetadata'; + location?: Geopoint; + dimensions?: SanityImageDimensions; + palette?: SanityImagePalette; + lqip?: string; + blurHash?: string; + thumbHash?: string; + hasAlpha?: boolean; + isOpaque?: boolean; +}; + +export type SanityFileAsset = { + _id: string; + _type: 'sanity.fileAsset'; _createdAt: string; _updatedAt: string; _rev: string; @@ -234,7 +253,6 @@ export type SanityImageAsset = { uploadId?: string; path?: string; url?: string; - metadata?: SanityImageMetadata; source?: SanityAssetSourceData; }; @@ -245,218 +263,79 @@ export type SanityAssetSourceData = { url?: string; }; -export type SanityImageMetadata = { - _type: 'sanity.imageMetadata'; - location?: Geopoint; - dimensions?: SanityImageDimensions; - palette?: SanityImagePalette; - lqip?: string; - blurHash?: string; - hasAlpha?: boolean; - isOpaque?: boolean; -}; - -export type MediaTag = { +export type SanityImageAsset = { _id: string; - _type: 'media.tag'; + _type: 'sanity.imageAsset'; _createdAt: string; _updatedAt: string; _rev: string; - name?: Slug; -}; - -export type Slug = { - _type: 'slug'; - current?: string; - source?: string; -}; - -export type Table = { - _type: 'table'; - rows?: Array< - { - _key: string; - } & TableRow - >; -}; - -export type TableRow = { - _type: 'tableRow'; - cells?: Array; + originalFilename?: string; + label?: string; + title?: string; + description?: string; + altText?: string; + sha1hash?: string; + extension?: string; + mimeType?: string; + size?: number; + assetId?: string; + uploadId?: string; + path?: string; + url?: string; + metadata?: SanityImageMetadata; + source?: SanityAssetSourceData; }; -export type Code = { - _type: 'code'; - language?: string; - filename?: string; - code?: string; - highlightedLines?: Array; +export type Geopoint = { + _type: 'geopoint'; + lat?: number; + lng?: number; + alt?: number; }; export type AllSanitySchemaTypes = - | SanityImagePaletteSwatch - | SanityImagePalette - | SanityImageDimensions - | SanityFileAsset - | Geopoint | Settings | Navigation + | SanityImageAssetReference | Post | SanityImageCrop | SanityImageHotspot - | SanityImageAsset - | SanityAssetSourceData - | SanityImageMetadata - | MediaTag | Slug + | MediaTag | Table | TableRow - | Code; + | Code + | SanityImagePaletteSwatch + | SanityImagePalette + | SanityImageDimensions + | SanityImageMetadata + | SanityFileAsset + | SanityAssetSourceData + | SanityImageAsset + | Geopoint; + export declare const internalGroqTypeReferenceTo: unique symbol; -// Source: ../frontend/src/app/layout.tsx -// Variable: navigationQuery -// Query: *[_type == "navigation"][0] -export type NavigationQueryResult = { - _id: string; - _type: 'navigation'; - _createdAt: string; - _updatedAt: string; - _rev: string; - items?: Array<{ - title?: string; - href?: string; - _key: string; - }>; -} | null; -// Variable: layoutSettingsQuery -// Query: *[_type == "settings"][0] { socialMedia } -export type LayoutSettingsQueryResult = { - socialMedia: Array<{ - label?: string; - title?: string; - url?: string; - _key: string; - }> | null; -} | null; -// Source: ../frontend/src/app/page.tsx -// Variable: homeMetadataQuery -// Query: *[_type == "settings"][0] { websiteName, description, } -export type HomeMetadataQueryResult = { - websiteName: string | null; +// Source: ../frontend/src/app/[slug]/page.tsx +// Variable: postMetadataQuery +// Query: *[_type == "post" && slug.current == $slug][0] { title, description, slug, image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, } } +export type PostMetadataQueryResult = { + title: string | null; description: string | null; -} | null; -// Variable: homeSettingsQuery -// Query: *[_type == "settings"][0] { introMessage } -export type HomeSettingsQueryResult = { - introMessage: Array<{ - children?: Array<{ - marks?: Array; - text?: string; - _type: 'span'; - _key: string; - }>; - style?: 'blockquote' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'normal'; - listItem?: 'bullet' | 'number'; - markDefs?: Array<{ - href?: string; - _type: 'link'; - _key: string; - }>; - level?: number; - _type: 'block'; - _key: string; - }> | null; -} | null; -// Variable: homeArtworksQuery -// Query: *[_type == "post" && type == "artwork"][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } -export type HomeArtworksQueryResult = Array<{ - _id: string; - _type: 'post'; - _createdAt: string; - _updatedAt: string; - _rev: string; - title?: string; - slug?: Slug; - type?: 'article' | 'artwork' | 'page' | 'project'; + slug: Slug | null; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; color: string | null; } | null; - description?: string; - meta?: { - agency?: string; - client?: string; - date?: string; - }; - body?: Array< - | ({ - _key: string; - } & Code) - | ({ - _key: string; - } & Table) - | { - children?: Array<{ - marks?: Array; - text?: string; - _type: 'span'; - _key: string; - }>; - style?: - | 'blockquote' - | 'h1' - | 'h2' - | 'h3' - | 'h4' - | 'h5' - | 'h6' - | 'normal'; - listItem?: 'bullet' | 'number'; - markDefs?: Array<{ - href?: string; - _type: 'link'; - _key: string; - }>; - level?: number; - _type: 'block'; - _key: string; - } - | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; - hotspot?: SanityImageHotspot; - crop?: SanityImageCrop; - alt?: string; - caption?: string; - loading?: 'eager' | 'lazy'; - layout?: 'full-width' | 'text-width'; - _type: 'image'; - _key: string; - } - | { - url?: string; - layout?: 'full-width' | 'text-width'; - _type: 'videoEmbed'; - _key: string; - } - >; -}>; -// Variable: homePostsQuery -// Query: *[_type == "post" && type == "article"][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } -export type HomePostsQueryResult = Array<{ +} | null; + +// Source: ../frontend/src/app/[slug]/page.tsx +// Variable: postPageQuery +// Query: *[_type == "post" && slug.current == $slug][0] { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, body[] { ..., _type == 'image' => { ..., "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } } +export type PostPageQueryResult = { _id: string; _type: 'post'; _createdAt: string; @@ -466,12 +345,7 @@ export type HomePostsQueryResult = Array<{ slug?: Slug; type?: 'article' | 'artwork' | 'page' | 'project'; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; @@ -483,13 +357,7 @@ export type HomePostsQueryResult = Array<{ client?: string; date?: string; }; - body?: Array< - | ({ - _key: string; - } & Code) - | ({ - _key: string; - } & Table) + body: Array< | { children?: Array<{ marks?: Array; @@ -517,12 +385,16 @@ export type HomePostsQueryResult = Array<{ _key: string; } | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + _key: string; + _type: 'code'; + language?: string; + filename?: string; + code?: string; + highlightedLines?: Array; + } + | { + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -531,6 +403,18 @@ export type HomePostsQueryResult = Array<{ layout?: 'full-width' | 'text-width'; _type: 'image'; _key: string; + width: number | null; + height: number | null; + color: string | null; + } + | { + _key: string; + _type: 'table'; + rows?: Array< + { + _key: string; + } & TableRow + >; } | { url?: string; @@ -538,11 +422,13 @@ export type HomePostsQueryResult = Array<{ _type: 'videoEmbed'; _key: string; } - >; -}>; -// Variable: homeProjectsQuery -// Query: *[_type == "post" && type == "project"][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } -export type HomeProjectsQueryResult = Array<{ + > | null; +} | null; + +// Source: ../frontend/src/app/[slug]/page.tsx +// Variable: postPageOtherPostsQuery +// Query: *[_type == "post" && slug.current != $slug && type == $type][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } +export type PostPageOtherPostsQueryResult = Array<{ _id: string; _type: 'post'; _createdAt: string; @@ -552,12 +438,7 @@ export type HomeProjectsQueryResult = Array<{ slug?: Slug; type?: 'article' | 'artwork' | 'page' | 'project'; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; @@ -603,12 +484,8 @@ export type HomeProjectsQueryResult = Array<{ _key: string; } | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -627,37 +504,17 @@ export type HomeProjectsQueryResult = Array<{ >; }>; -// Source: ../frontend/src/app/sitemap.ts -// Variable: sitemapQuery -// Query: *[_type == "post"] { _updatedAt, slug, } -export type SitemapQueryResult = Array<{ - _updatedAt: string; +// Source: ../frontend/src/app/[slug]/page.tsx +// Variable: postsStaticParamsQuery +// Query: *[_type == "post"] { slug } +export type PostsStaticParamsQueryResult = Array<{ slug: Slug | null; }>; -// Source: ../frontend/src/app/[slug]/page.tsx -// Variable: postMetadataQuery -// Query: *[_type == "post" && slug.current == $slug][0] { title, description, slug, image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, } } -export type PostMetadataQueryResult = { - title: string | null; - description: string | null; - slug: Slug | null; - image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; - alt: null; - width: number | null; - height: number | null; - color: string | null; - } | null; -} | null; -// Variable: postPageQuery -// Query: *[_type == "post" && slug.current == $slug][0] { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, body[] { ..., _type == 'image' => { ..., "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } } -export type PostPageQueryResult = { +// Source: ../frontend/src/app/api/feed/[format]/route.ts +// Variable: feedQuery +// Query: *[_type == "post" && type != "page"][0...16] | order(_createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, body[] { ..., _type == 'image' => { ..., "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } } +export type FeedQueryResult = Array<{ _id: string; _type: 'post'; _createdAt: string; @@ -667,12 +524,7 @@ export type PostPageQueryResult = { slug?: Slug; type?: 'article' | 'artwork' | 'page' | 'project'; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; @@ -720,12 +572,8 @@ export type PostPageQueryResult = { highlightedLines?: Array; } | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -754,10 +602,12 @@ export type PostPageQueryResult = { _key: string; } > | null; -} | null; -// Variable: postPageOtherPostsQuery -// Query: *[_type == "post" && slug.current != $slug && type == $type][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } -export type PostPageOtherPostsQueryResult = Array<{ +}>; + +// Source: ../frontend/src/app/artworks/page.tsx +// Variable: artworksPageQuery +// Query: *[_type == "post" && type == "artwork"] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } +export type ArtworksPageQueryResult = Array<{ _id: string; _type: 'post'; _createdAt: string; @@ -765,14 +615,9 @@ export type PostPageOtherPostsQueryResult = Array<{ _rev: string; title?: string; slug?: Slug; - type?: 'article' | 'artwork' | 'page' | 'project'; + type: 'artwork'; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; @@ -818,12 +663,8 @@ export type PostPageOtherPostsQueryResult = Array<{ _key: string; } | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -841,16 +682,71 @@ export type PostPageOtherPostsQueryResult = Array<{ } >; }>; -// Variable: postsStaticParamsQuery -// Query: *[_type == "post"] { slug } -export type PostsStaticParamsQueryResult = Array<{ - slug: Slug | null; -}>; -// Source: ../frontend/src/app/artworks/page.tsx -// Variable: artworksPageQuery -// Query: *[_type == "post" && type == "artwork"] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } -export type ArtworksPageQueryResult = Array<{ +// Source: ../frontend/src/app/layout.tsx +// Variable: navigationQuery +// Query: *[_type == "navigation"][0] +export type NavigationQueryResult = { + _id: string; + _type: 'navigation'; + _createdAt: string; + _updatedAt: string; + _rev: string; + items?: Array<{ + title?: string; + href?: string; + _key: string; + }>; +} | null; + +// Source: ../frontend/src/app/layout.tsx +// Variable: layoutSettingsQuery +// Query: *[_type == "settings"][0] { socialMedia } +export type LayoutSettingsQueryResult = { + socialMedia: Array<{ + label?: string; + title?: string; + url?: string; + _key: string; + }> | null; +} | null; + +// Source: ../frontend/src/app/page.tsx +// Variable: homeMetadataQuery +// Query: *[_type == "settings"][0] { websiteName, description, } +export type HomeMetadataQueryResult = { + websiteName: string | null; + description: string | null; +} | null; + +// Source: ../frontend/src/app/page.tsx +// Variable: homeSettingsQuery +// Query: *[_type == "settings"][0] { introMessage } +export type HomeSettingsQueryResult = { + introMessage: Array<{ + children?: Array<{ + marks?: Array; + text?: string; + _type: 'span'; + _key: string; + }>; + style?: 'blockquote' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'normal'; + listItem?: 'bullet' | 'number'; + markDefs?: Array<{ + href?: string; + _type: 'link'; + _key: string; + }>; + level?: number; + _type: 'block'; + _key: string; + }> | null; +} | null; + +// Source: ../frontend/src/app/page.tsx +// Variable: homeArtworksQuery +// Query: *[_type == "post" && type == "artwork"][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } +export type HomeArtworksQueryResult = Array<{ _id: string; _type: 'post'; _createdAt: string; @@ -858,14 +754,9 @@ export type ArtworksPageQueryResult = Array<{ _rev: string; title?: string; slug?: Slug; - type?: 'article' | 'artwork' | 'page' | 'project'; + type: 'artwork'; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; @@ -911,12 +802,8 @@ export type ArtworksPageQueryResult = Array<{ _key: string; } | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -935,10 +822,10 @@ export type ArtworksPageQueryResult = Array<{ >; }>; -// Source: ../frontend/src/app/projects/page.tsx -// Variable: projectsPageQuery -// Query: *[_type == "post" && type == "project"] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, body[] { ..., _type == 'image' => { ..., "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } } -export type ProjectsPageQueryResult = Array<{ +// Source: ../frontend/src/app/page.tsx +// Variable: homePostsQuery +// Query: *[_type == "post" && type == "article"][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } +export type HomePostsQueryResult = Array<{ _id: string; _type: 'post'; _createdAt: string; @@ -946,14 +833,9 @@ export type ProjectsPageQueryResult = Array<{ _rev: string; title?: string; slug?: Slug; - type?: 'article' | 'artwork' | 'page' | 'project'; + type: 'article'; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; @@ -965,7 +847,13 @@ export type ProjectsPageQueryResult = Array<{ client?: string; date?: string; }; - body: Array< + body?: Array< + | ({ + _key: string; + } & Code) + | ({ + _key: string; + } & Table) | { children?: Array<{ marks?: Array; @@ -993,20 +881,8 @@ export type ProjectsPageQueryResult = Array<{ _key: string; } | { - _key: string; - _type: 'code'; - language?: string; - filename?: string; - code?: string; - highlightedLines?: Array; - } - | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -1015,18 +891,85 @@ export type ProjectsPageQueryResult = Array<{ layout?: 'full-width' | 'text-width'; _type: 'image'; _key: string; - width: number | null; - height: number | null; - color: string | null; } | { + url?: string; + layout?: 'full-width' | 'text-width'; + _type: 'videoEmbed'; + _key: string; + } + >; +}>; + +// Source: ../frontend/src/app/page.tsx +// Variable: homeProjectsQuery +// Query: *[_type == "post" && type == "project"][0...16] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } +export type HomeProjectsQueryResult = Array<{ + _id: string; + _type: 'post'; + _createdAt: string; + _updatedAt: string; + _rev: string; + title?: string; + slug?: Slug; + type: 'project'; + image: { + asset: SanityImageAssetReference | null; + alt: null; + width: number | null; + height: number | null; + color: string | null; + } | null; + description?: string; + meta?: { + agency?: string; + client?: string; + date?: string; + }; + body?: Array< + | ({ + _key: string; + } & Code) + | ({ + _key: string; + } & Table) + | { + children?: Array<{ + marks?: Array; + text?: string; + _type: 'span'; + _key: string; + }>; + style?: + | 'blockquote' + | 'h1' + | 'h2' + | 'h3' + | 'h4' + | 'h5' + | 'h6' + | 'normal'; + listItem?: 'bullet' | 'number'; + markDefs?: Array<{ + href?: string; + _type: 'link'; + _key: string; + }>; + level?: number; + _type: 'block'; + _key: string; + } + | { + asset?: SanityImageAssetReference; + media?: unknown; + hotspot?: SanityImageHotspot; + crop?: SanityImageCrop; + alt?: string; + caption?: string; + loading?: 'eager' | 'lazy'; + layout?: 'full-width' | 'text-width'; + _type: 'image'; _key: string; - _type: 'table'; - rows?: Array< - { - _key: string; - } & TableRow - >; } | { url?: string; @@ -1034,13 +977,13 @@ export type ProjectsPageQueryResult = Array<{ _type: 'videoEmbed'; _key: string; } - > | null; + >; }>; -// Source: ../frontend/src/app/api/feed/[format]/route.ts -// Variable: feedQuery -// Query: *[_type == "post" && type != "page"][0...16] | order(_createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, body[] { ..., _type == 'image' => { ..., "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } } -export type FeedQueryResult = Array<{ +// Source: ../frontend/src/app/projects/page.tsx +// Variable: projectsPageQuery +// Query: *[_type == "post" && type == "project"] | order(meta.date desc, _createdAt desc) { ..., image { asset, alt, "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, body[] { ..., _type == 'image' => { ..., "width": asset->metadata.dimensions.width, "height": asset->metadata.dimensions.height, "color": asset->metadata.palette.dominant.background, }, } } +export type ProjectsPageQueryResult = Array<{ _id: string; _type: 'post'; _createdAt: string; @@ -1048,14 +991,9 @@ export type FeedQueryResult = Array<{ _rev: string; title?: string; slug?: Slug; - type?: 'article' | 'artwork' | 'page' | 'project'; + type: 'project'; image: { - asset: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - } | null; + asset: SanityImageAssetReference | null; alt: null; width: number | null; height: number | null; @@ -1103,12 +1041,8 @@ export type FeedQueryResult = Array<{ highlightedLines?: Array; } | { - asset?: { - _ref: string; - _type: 'reference'; - _weak?: boolean; - [internalGroqTypeReferenceTo]?: 'sanity.imageAsset'; - }; + asset?: SanityImageAssetReference; + media?: unknown; hotspot?: SanityImageHotspot; crop?: SanityImageCrop; alt?: string; @@ -1139,10 +1073,24 @@ export type FeedQueryResult = Array<{ > | null; }>; +// Source: ../frontend/src/app/sitemap.ts +// Variable: sitemapQuery +// Query: *[_type == "post"] { _updatedAt, slug, } +export type SitemapQueryResult = Array<{ + _updatedAt: string; + slug: Slug | null; +}>; + // Query TypeMap import '@sanity/client'; declare module '@sanity/client' { interface SanityQueries { + '\n\t\t*[_type == "post" && slug.current == $slug][0] {\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tslug,\n\t\t\timage { \n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n }\n\t\t}\n\t': PostMetadataQueryResult; + '\n\t\t*[_type == "post" && slug.current == $slug][0] {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\tbody[] {\n\t\t...,\n\t\t_type == \'image\' => {\n\t\t\t...,\n\t\t\t"width": asset->metadata.dimensions.width,\n\t\t\t"height": asset->metadata.dimensions.height,\n\t\t\t"color": asset->metadata.palette.dominant.background,\n\t\t},\n\t}\n\n\t\t}\n\t': PostPageQueryResult; + '\n\t\t*[_type == "post" && slug.current != $slug && type == $type][0...16] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\n\t\t}\n\t': PostPageOtherPostsQueryResult; + '\n\t\t*[_type == "post"] { slug }\n\t': PostsStaticParamsQueryResult; + '\n\t\t*[_type == "post" && type != "page"][0...16] | order(_createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\tbody[] {\n\t\t...,\n\t\t_type == \'image\' => {\n\t\t\t...,\n\t\t\t"width": asset->metadata.dimensions.width,\n\t\t\t"height": asset->metadata.dimensions.height,\n\t\t\t"color": asset->metadata.palette.dominant.background,\n\t\t},\n\t}\n\n\t\t}\n\t': FeedQueryResult; + '\n\t\t*[_type == "post" && type == "artwork"] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\n\t\t}\n\t': ArtworksPageQueryResult; '\n\t\t*[_type == "navigation"][0]\n\t': NavigationQueryResult; '\n\t\t*[_type == "settings"][0] { socialMedia }\n\t': LayoutSettingsQueryResult; '\n\t\t*[_type == "settings"][0] {\n\t\t\twebsiteName,\n\t\t\tdescription,\n\t\t}\n\t': HomeMetadataQueryResult; @@ -1150,13 +1098,7 @@ declare module '@sanity/client' { '\n\t\t*[_type == "post" && type == "artwork"][0...16] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\n\t\t}\n\t': HomeArtworksQueryResult; '\n\t\t*[_type == "post" && type == "article"][0...16] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\n\t\t}\n\t': HomePostsQueryResult; '\n\t\t*[_type == "post" && type == "project"][0...16] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\n\t\t}\n\t': HomeProjectsQueryResult; - '\n\t\t*[_type == "post"] {\n\t\t\t_updatedAt,\n\t\t\tslug,\n\t\t}\n\t': SitemapQueryResult; - '\n\t\t*[_type == "post" && slug.current == $slug][0] {\n\t\t\ttitle,\n\t\t\tdescription,\n\t\t\tslug,\n\t\t\timage { \n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n }\n\t\t}\n\t': PostMetadataQueryResult; - '\n\t\t*[_type == "post" && slug.current == $slug][0] {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\tbody[] {\n\t\t...,\n\t\t_type == \'image\' => {\n\t\t\t...,\n\t\t\t"width": asset->metadata.dimensions.width,\n\t\t\t"height": asset->metadata.dimensions.height,\n\t\t\t"color": asset->metadata.palette.dominant.background,\n\t\t},\n\t}\n\n\t\t}\n\t': PostPageQueryResult; - '\n\t\t*[_type == "post" && slug.current != $slug && type == $type][0...16] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\n\t\t}\n\t': PostPageOtherPostsQueryResult; - '\n\t\t*[_type == "post"] { slug }\n\t': PostsStaticParamsQueryResult; - '\n\t\t*[_type == "post" && type == "artwork"] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\n\t\t}\n\t': ArtworksPageQueryResult; '\n\t\t*[_type == "post" && type == "project"] | order(meta.date desc, _createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\tbody[] {\n\t\t...,\n\t\t_type == \'image\' => {\n\t\t\t...,\n\t\t\t"width": asset->metadata.dimensions.width,\n\t\t\t"height": asset->metadata.dimensions.height,\n\t\t\t"color": asset->metadata.palette.dominant.background,\n\t\t},\n\t}\n\n\t\t}\n\t': ProjectsPageQueryResult; - '\n\t\t*[_type == "post" && type != "page"][0...16] | order(_createdAt desc) {\n\t\t\t\n\t...,\n\timage {\n\t\t\n\tasset,\n\talt,\n\t"width": asset->metadata.dimensions.width,\n\t"height": asset->metadata.dimensions.height,\n\t"color": asset->metadata.palette.dominant.background,\n\n\t},\n\tbody[] {\n\t\t...,\n\t\t_type == \'image\' => {\n\t\t\t...,\n\t\t\t"width": asset->metadata.dimensions.width,\n\t\t\t"height": asset->metadata.dimensions.height,\n\t\t\t"color": asset->metadata.palette.dominant.background,\n\t\t},\n\t}\n\n\t\t}\n\t': FeedQueryResult; + '\n\t\t*[_type == "post"] {\n\t\t\t_updatedAt,\n\t\t\tslug,\n\t\t}\n\t': SitemapQueryResult; } } diff --git a/apps/sanity/schema.json b/apps/sanity/schema.json index 5bd1fd8..6aea515 100644 --- a/apps/sanity/schema.json +++ b/apps/sanity/schema.json @@ -1,159 +1,6 @@ [ { - "name": "sanity.imagePaletteSwatch", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "sanity.imagePaletteSwatch" - } - }, - "background": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "foreground": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "population": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - }, - "title": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - } - } - } - }, - { - "name": "sanity.imagePalette", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "sanity.imagePalette" - } - }, - "darkMuted": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imagePaletteSwatch" - }, - "optional": true - }, - "lightVibrant": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imagePaletteSwatch" - }, - "optional": true - }, - "darkVibrant": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imagePaletteSwatch" - }, - "optional": true - }, - "vibrant": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imagePaletteSwatch" - }, - "optional": true - }, - "dominant": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imagePaletteSwatch" - }, - "optional": true - }, - "lightMuted": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imagePaletteSwatch" - }, - "optional": true - }, - "muted": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imagePaletteSwatch" - }, - "optional": true - } - } - } - }, - { - "name": "sanity.imageDimensions", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "sanity.imageDimensions" - } - }, - "height": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - }, - "width": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - }, - "aspectRatio": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - } - } - } - }, - { - "name": "sanity.fileAsset", + "name": "settings", "type": "document", "attributes": { "_id": { @@ -166,7 +13,7 @@ "type": "objectAttribute", "value": { "type": "string", - "value": "sanity.fileAsset" + "value": "settings" } }, "_createdAt": { @@ -187,187 +34,14 @@ "type": "string" } }, - "originalFilename": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "label": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "title": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "description": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "altText": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "sha1hash": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "extension": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "mimeType": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "size": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - }, - "assetId": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "uploadId": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "path": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "url": { + "websiteName": { "type": "objectAttribute", "value": { "type": "string" }, "optional": true }, - "source": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.assetSourceData" - }, - "optional": true - } - } - }, - { - "name": "geopoint", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "geopoint" - } - }, - "lat": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - }, - "lng": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - }, - "alt": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - } - } - } - }, - { - "name": "settings", - "type": "document", - "attributes": { - "_id": { - "type": "objectAttribute", - "value": { - "type": "string" - } - }, - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "settings" - } - }, - "_createdAt": { - "type": "objectAttribute", - "value": { - "type": "string" - } - }, - "_updatedAt": { - "type": "objectAttribute", - "value": { - "type": "string" - } - }, - "_rev": { - "type": "objectAttribute", - "value": { - "type": "string" - } - }, - "websiteName": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "introMessage": { + "introMessage": { "type": "objectAttribute", "value": { "type": "array", @@ -673,6 +347,36 @@ } } }, + { + "type": "type", + "name": "sanity.imageAsset.reference", + "value": { + "type": "object", + "attributes": { + "_ref": { + "type": "objectAttribute", + "value": { + "type": "string" + } + }, + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "reference" + } + }, + "_weak": { + "type": "objectAttribute", + "value": { + "type": "boolean" + }, + "optional": true + } + }, + "dereferencesTo": "sanity.imageAsset" + } + }, { "name": "post", "type": "document", @@ -756,30 +460,15 @@ "asset": { "type": "objectAttribute", "value": { - "type": "object", - "attributes": { - "_ref": { - "type": "objectAttribute", - "value": { - "type": "string" - } - }, - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "reference" - } - }, - "_weak": { - "type": "objectAttribute", - "value": { - "type": "boolean" - }, - "optional": true - } - }, - "dereferencesTo": "sanity.imageAsset" + "type": "inline", + "name": "sanity.imageAsset.reference" + }, + "optional": true + }, + "media": { + "type": "objectAttribute", + "value": { + "type": "unknown" }, "optional": true }, @@ -1032,30 +721,15 @@ "asset": { "type": "objectAttribute", "value": { - "type": "object", - "attributes": { - "_ref": { - "type": "objectAttribute", - "value": { - "type": "string" - } - }, - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "reference" - } - }, - "_weak": { - "type": "objectAttribute", - "value": { - "type": "boolean" - }, - "optional": true - } - }, - "dereferencesTo": "sanity.imageAsset" + "type": "inline", + "name": "sanity.imageAsset.reference" + }, + "optional": true + }, + "media": { + "type": "objectAttribute", + "value": { + "type": "unknown" }, "optional": true }, @@ -1228,7 +902,281 @@ } }, { - "name": "sanity.imageCrop", + "name": "sanity.imageCrop", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "sanity.imageCrop" + } + }, + "top": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + }, + "bottom": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + }, + "left": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + }, + "right": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + } + } + } + }, + { + "name": "sanity.imageHotspot", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "sanity.imageHotspot" + } + }, + "x": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + }, + "y": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + }, + "height": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + }, + "width": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + } + } + } + }, + { + "name": "slug", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "slug" + } + }, + "current": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "source": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + } + } + } + }, + { + "name": "media.tag", + "type": "document", + "attributes": { + "_id": { + "type": "objectAttribute", + "value": { + "type": "string" + } + }, + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "media.tag" + } + }, + "_createdAt": { + "type": "objectAttribute", + "value": { + "type": "string" + } + }, + "_updatedAt": { + "type": "objectAttribute", + "value": { + "type": "string" + } + }, + "_rev": { + "type": "objectAttribute", + "value": { + "type": "string" + } + }, + "name": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "slug" + }, + "optional": true + } + } + }, + { + "name": "table", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "table" + } + }, + "rows": { + "type": "objectAttribute", + "value": { + "type": "array", + "of": { + "type": "object", + "attributes": { + "_key": { + "type": "objectAttribute", + "value": { + "type": "string" + } + } + }, + "rest": { + "type": "inline", + "name": "tableRow" + } + } + }, + "optional": true + } + } + } + }, + { + "name": "tableRow", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "tableRow" + } + }, + "cells": { + "type": "objectAttribute", + "value": { + "type": "array", + "of": { + "type": "string" + } + }, + "optional": true + } + } + } + }, + { + "name": "code", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "code" + } + }, + "language": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "filename": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "code": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "highlightedLines": { + "type": "objectAttribute", + "value": { + "type": "array", + "of": { + "type": "number" + } + }, + "optional": true + } + } + } + }, + { + "name": "sanity.imagePaletteSwatch", "type": "type", "value": { "type": "object", @@ -1237,34 +1185,34 @@ "type": "objectAttribute", "value": { "type": "string", - "value": "sanity.imageCrop" + "value": "sanity.imagePaletteSwatch" } }, - "top": { + "background": { "type": "objectAttribute", "value": { - "type": "number" + "type": "string" }, "optional": true }, - "bottom": { + "foreground": { "type": "objectAttribute", "value": { - "type": "number" + "type": "string" }, "optional": true }, - "left": { + "population": { "type": "objectAttribute", "value": { "type": "number" }, "optional": true }, - "right": { + "title": { "type": "objectAttribute", "value": { - "type": "number" + "type": "string" }, "optional": true } @@ -1272,7 +1220,7 @@ } }, { - "name": "sanity.imageHotspot", + "name": "sanity.imagePalette", "type": "type", "value": { "type": "object", @@ -1281,22 +1229,80 @@ "type": "objectAttribute", "value": { "type": "string", - "value": "sanity.imageHotspot" + "value": "sanity.imagePalette" } }, - "x": { + "darkMuted": { "type": "objectAttribute", "value": { - "type": "number" + "type": "inline", + "name": "sanity.imagePaletteSwatch" }, "optional": true }, - "y": { + "lightVibrant": { "type": "objectAttribute", "value": { - "type": "number" + "type": "inline", + "name": "sanity.imagePaletteSwatch" + }, + "optional": true + }, + "darkVibrant": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imagePaletteSwatch" + }, + "optional": true + }, + "vibrant": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imagePaletteSwatch" + }, + "optional": true + }, + "dominant": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imagePaletteSwatch" + }, + "optional": true + }, + "lightMuted": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imagePaletteSwatch" + }, + "optional": true + }, + "muted": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imagePaletteSwatch" }, "optional": true + } + } + } + }, + { + "name": "sanity.imageDimensions", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "sanity.imageDimensions" + } }, "height": { "type": "objectAttribute", @@ -1311,12 +1317,94 @@ "type": "number" }, "optional": true + }, + "aspectRatio": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true } } } }, { - "name": "sanity.imageAsset", + "name": "sanity.imageMetadata", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { + "type": "objectAttribute", + "value": { + "type": "string", + "value": "sanity.imageMetadata" + } + }, + "location": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "geopoint" + }, + "optional": true + }, + "dimensions": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imageDimensions" + }, + "optional": true + }, + "palette": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imagePalette" + }, + "optional": true + }, + "lqip": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "blurHash": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "thumbHash": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "hasAlpha": { + "type": "objectAttribute", + "value": { + "type": "boolean" + }, + "optional": true + }, + "isOpaque": { + "type": "objectAttribute", + "value": { + "type": "boolean" + }, + "optional": true + } + } + } + }, + { + "name": "sanity.fileAsset", "type": "document", "attributes": { "_id": { @@ -1329,7 +1417,7 @@ "type": "objectAttribute", "value": { "type": "string", - "value": "sanity.imageAsset" + "value": "sanity.fileAsset" } }, "_createdAt": { @@ -1441,123 +1529,47 @@ }, "optional": true }, - "metadata": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imageMetadata" - }, - "optional": true - }, "source": { "type": "objectAttribute", "value": { "type": "inline", - "name": "sanity.assetSourceData" - }, - "optional": true - } - } - }, - { - "name": "sanity.assetSourceData", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "sanity.assetSourceData" - } - }, - "name": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "id": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "url": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - } - } - } - }, - { - "name": "sanity.imageMetadata", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "sanity.imageMetadata" - } - }, - "location": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "geopoint" - }, - "optional": true - }, - "dimensions": { - "type": "objectAttribute", - "value": { - "type": "inline", - "name": "sanity.imageDimensions" - }, - "optional": true + "name": "sanity.assetSourceData" }, - "palette": { + "optional": true + } + } + }, + { + "name": "sanity.assetSourceData", + "type": "type", + "value": { + "type": "object", + "attributes": { + "_type": { "type": "objectAttribute", "value": { - "type": "inline", - "name": "sanity.imagePalette" - }, - "optional": true + "type": "string", + "value": "sanity.assetSourceData" + } }, - "lqip": { + "name": { "type": "objectAttribute", "value": { "type": "string" }, "optional": true }, - "blurHash": { + "id": { "type": "objectAttribute", "value": { "type": "string" }, "optional": true }, - "hasAlpha": { - "type": "objectAttribute", - "value": { - "type": "boolean" - }, - "optional": true - }, - "isOpaque": { + "url": { "type": "objectAttribute", "value": { - "type": "boolean" + "type": "string" }, "optional": true } @@ -1565,7 +1577,7 @@ } }, { - "name": "media.tag", + "name": "sanity.imageAsset", "type": "document", "attributes": { "_id": { @@ -1578,7 +1590,7 @@ "type": "objectAttribute", "value": { "type": "string", - "value": "media.tag" + "value": "sanity.imageAsset" } }, "_createdAt": { @@ -1599,112 +1611,117 @@ "type": "string" } }, - "name": { + "originalFilename": { "type": "objectAttribute", "value": { - "type": "inline", - "name": "slug" + "type": "string" }, "optional": true - } - } - }, - { - "name": "slug", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "slug" - } + }, + "label": { + "type": "objectAttribute", + "value": { + "type": "string" }, - "current": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true + "optional": true + }, + "title": { + "type": "objectAttribute", + "value": { + "type": "string" }, - "source": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - } - } - } - }, - { - "name": "table", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "table" - } + "optional": true + }, + "description": { + "type": "objectAttribute", + "value": { + "type": "string" }, - "rows": { - "type": "objectAttribute", - "value": { - "type": "array", - "of": { - "type": "object", - "attributes": { - "_key": { - "type": "objectAttribute", - "value": { - "type": "string" - } - } - }, - "rest": { - "type": "inline", - "name": "tableRow" - } - } - }, - "optional": true - } - } - } - }, - { - "name": "tableRow", - "type": "type", - "value": { - "type": "object", - "attributes": { - "_type": { - "type": "objectAttribute", - "value": { - "type": "string", - "value": "tableRow" - } + "optional": true + }, + "altText": { + "type": "objectAttribute", + "value": { + "type": "string" }, - "cells": { - "type": "objectAttribute", - "value": { - "type": "array", - "of": { - "type": "string" - } - }, - "optional": true - } + "optional": true + }, + "sha1hash": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "extension": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "mimeType": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "size": { + "type": "objectAttribute", + "value": { + "type": "number" + }, + "optional": true + }, + "assetId": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "uploadId": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "path": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "url": { + "type": "objectAttribute", + "value": { + "type": "string" + }, + "optional": true + }, + "metadata": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.imageMetadata" + }, + "optional": true + }, + "source": { + "type": "objectAttribute", + "value": { + "type": "inline", + "name": "sanity.assetSourceData" + }, + "optional": true } } }, { - "name": "code", + "name": "geopoint", "type": "type", "value": { "type": "object", @@ -1713,37 +1730,27 @@ "type": "objectAttribute", "value": { "type": "string", - "value": "code" + "value": "geopoint" } }, - "language": { - "type": "objectAttribute", - "value": { - "type": "string" - }, - "optional": true - }, - "filename": { + "lat": { "type": "objectAttribute", "value": { - "type": "string" + "type": "number" }, "optional": true }, - "code": { + "lng": { "type": "objectAttribute", "value": { - "type": "string" + "type": "number" }, "optional": true }, - "highlightedLines": { + "alt": { "type": "objectAttribute", "value": { - "type": "array", - "of": { - "type": "number" - } + "type": "number" }, "optional": true } From c7447941fe46112a3b25291159437badd0c507b4 Mon Sep 17 00:00:00 2001 From: Peter Simonsson Date: Fri, 3 Jul 2026 11:45:27 +0100 Subject: [PATCH 2/5] Add uploaded-video block for streaming self-hosted animations Presenting 3D animation loops previously required a YouTube embed, whose player chrome and suggested-video overlays distract from the artwork. This adds a video block that streams a file uploaded to Sanity through a native