2
0

feat(steps): Add Embed bubble

This commit is contained in:
Baptiste Arnaud
2022-03-23 12:01:35 +01:00
parent c01ffa3f0b
commit 953b95d254
15 changed files with 296 additions and 16 deletions

View File

@ -1,17 +1,23 @@
import { StepBase } from '.'
export type BubbleStep = TextBubbleStep | ImageBubbleStep | VideoBubbleStep
export type BubbleStep =
| TextBubbleStep
| ImageBubbleStep
| VideoBubbleStep
| EmbedBubbleStep
export enum BubbleStepType {
TEXT = 'text',
IMAGE = 'image',
VIDEO = 'video',
EMBED = 'embed',
}
export type BubbleStepContent =
| TextBubbleContent
| ImageBubbleContent
| VideoBubbleContent
| EmbedBubbleContent
export type TextBubbleStep = StepBase & {
type: BubbleStepType.TEXT
@ -28,6 +34,11 @@ export type VideoBubbleStep = StepBase & {
content: VideoBubbleContent
}
export type EmbedBubbleStep = StepBase & {
type: BubbleStepType.EMBED
content: EmbedBubbleContent
}
export type TextBubbleContent = {
html: string
richText: unknown[]
@ -38,6 +49,11 @@ export type ImageBubbleContent = {
url?: string
}
export type EmbedBubbleContent = {
url?: string
height: number
}
export enum VideoBubbleContentType {
URL = 'url',
YOUTUBE = 'youtube',
@ -59,3 +75,5 @@ export const defaultTextBubbleContent: TextBubbleContent = {
export const defaultImageBubbleContent: ImageBubbleContent = {}
export const defaultVideoBubbleContent: VideoBubbleContent = {}
export const defaultEmbedBubbleContent: EmbedBubbleContent = { height: 400 }