{
)}
resource={media}
src={staticImage}
- sizes={getSizesForImageSize()}
+ sizes="auto"
/>
{caption && (
diff --git a/src/endpoints/seed/blocks/media-blocks.ts b/src/endpoints/seed/blocks/media-blocks.ts
index 9e97e595..0d0131c9 100644
--- a/src/endpoints/seed/blocks/media-blocks.ts
+++ b/src/endpoints/seed/blocks/media-blocks.ts
@@ -2,6 +2,44 @@ import type { Media } from '@/payload-types'
import { RequiredDataFromCollectionSlug } from 'payload'
export const mediaBlocks = (image: Media): RequiredDataFromCollectionSlug<'pages'>['layout'] => [
+ {
+ media: image.id,
+ caption: {
+ root: {
+ children: [
+ {
+ children: [
+ {
+ detail: 0,
+ format: 0,
+ mode: 'normal',
+ style: '',
+ text: 'An extra-small media block with left alignment',
+ type: 'text',
+ version: 1,
+ },
+ ],
+ direction: 'ltr',
+ format: 'start',
+ indent: 0,
+ type: 'paragraph',
+ version: 1,
+ textFormat: 0,
+ textStyle: '',
+ },
+ ],
+ direction: 'ltr',
+ format: '',
+ indent: 0,
+ type: 'root',
+ version: 1,
+ },
+ },
+ backgroundColor: 'brand-100',
+ alignContent: 'left',
+ imageSize: 'xsmall',
+ blockType: 'mediaBlock',
+ },
{
media: image.id,
caption: {
diff --git a/src/fields/imageSize.ts b/src/fields/imageSize.ts
index ea75dd4e..f12d8c15 100644
--- a/src/fields/imageSize.ts
+++ b/src/fields/imageSize.ts
@@ -8,6 +8,7 @@ export const imageSizeField: (label: string) => Field = (label) => ({
defaultValue: 'original',
options: [
{ label: 'Original (Natural size)', value: 'original' },
+ { label: 'Extra small', value: 'xsmall' },
{ label: 'Small', value: 'small' },
{ label: 'Medium', value: 'medium' },
{ label: 'Large', value: 'large' },
diff --git a/src/payload-types.ts b/src/payload-types.ts
index f2d0a2ea..ce769d49 100644
--- a/src/payload-types.ts
+++ b/src/payload-types.ts
@@ -1427,7 +1427,7 @@ export interface MediaBlock {
/**
* Controls the maximum width of the image with responsive behavior. Original uses the image's natural size. Sizes automatically adapt for different screen sizes.
*/
- imageSize?: ('original' | 'small' | 'medium' | 'large' | 'full') | null;
+ imageSize?: ('original' | 'xsmall' | 'small' | 'medium' | 'large' | 'full') | null;
id?: string | null;
blockName?: string | null;
blockType: 'mediaBlock';