@ -0,0 +1,7 @@
|
||||
import { ImageBubbleBlock } from './schema'
|
||||
|
||||
export const defaultImageBubbleContent = {
|
||||
clickLink: {
|
||||
alt: 'Bubble image',
|
||||
},
|
||||
} as const satisfies ImageBubbleBlock['content']
|
1
packages/schemas/features/blocks/bubbles/image/index.ts
Normal file
1
packages/schemas/features/blocks/bubbles/image/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './schema'
|
22
packages/schemas/features/blocks/bubbles/image/schema.ts
Normal file
22
packages/schemas/features/blocks/bubbles/image/schema.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { z } from 'zod'
|
||||
import { BubbleBlockType } from '../constants'
|
||||
import { blockBaseSchema } from '../../shared'
|
||||
|
||||
export const imageBubbleContentSchema = z.object({
|
||||
url: z.string().optional(),
|
||||
clickLink: z
|
||||
.object({
|
||||
url: z.string().optional(),
|
||||
alt: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
||||
export const imageBubbleBlockSchema = blockBaseSchema.merge(
|
||||
z.object({
|
||||
type: z.enum([BubbleBlockType.IMAGE]),
|
||||
content: imageBubbleContentSchema.optional(),
|
||||
})
|
||||
)
|
||||
|
||||
export type ImageBubbleBlock = z.infer<typeof imageBubbleBlockSchema>
|
Reference in New Issue
Block a user