♻️ (models) Change to features-centric folder structure
This commit is contained in:
committed by
Baptiste Arnaud
parent
a9d04798bc
commit
a5c8a8a95c
25
packages/models/src/features/blocks/bubbles/text.ts
Normal file
25
packages/models/src/features/blocks/bubbles/text.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { blockBaseSchema, BubbleBlockType } from '../shared'
|
||||
import { z } from 'zod'
|
||||
|
||||
export const defaultTextBubbleContent: TextBubbleContent = {
|
||||
html: '',
|
||||
richText: [],
|
||||
plainText: '',
|
||||
}
|
||||
|
||||
export const textBubbleContentSchema = z.object({
|
||||
html: z.string(),
|
||||
richText: z.array(z.any()),
|
||||
plainText: z.string(),
|
||||
})
|
||||
|
||||
export type TextBubbleContent = z.infer<typeof textBubbleContentSchema>
|
||||
|
||||
export const textBubbleBlockSchema = blockBaseSchema.and(
|
||||
z.object({
|
||||
type: z.enum([BubbleBlockType.TEXT]),
|
||||
content: textBubbleContentSchema,
|
||||
})
|
||||
)
|
||||
|
||||
export type TextBubbleBlock = z.infer<typeof textBubbleBlockSchema>
|
Reference in New Issue
Block a user