2023-12-22 09:13:53 +01:00
|
|
|
import { z } from '../../../zod'
|
2023-11-08 15:34:16 +01:00
|
|
|
import { audioBubbleBlockSchema } from './audio'
|
|
|
|
import { embedBubbleBlockSchema } from './embed'
|
|
|
|
import { imageBubbleBlockSchema } from './image'
|
|
|
|
import { textBubbleBlockSchema } from './text'
|
|
|
|
import { videoBubbleBlockSchema } from './video'
|
|
|
|
|
|
|
|
export const bubbleBlockSchemas = [
|
|
|
|
textBubbleBlockSchema,
|
|
|
|
imageBubbleBlockSchema,
|
|
|
|
videoBubbleBlockSchema,
|
|
|
|
embedBubbleBlockSchema,
|
|
|
|
audioBubbleBlockSchema,
|
|
|
|
] as const
|
|
|
|
|
|
|
|
export const bubbleBlockSchema = z.discriminatedUnion('type', [
|
|
|
|
...bubbleBlockSchemas,
|
|
|
|
])
|
|
|
|
|
|
|
|
export type BubbleBlock = z.infer<typeof bubbleBlockSchema>
|
|
|
|
export type BubbleBlockContent = BubbleBlock['content']
|