feat(SW-2541): Adjust for ImageVault custom field return types changes
Approved-by: Bianca Widstam Approved-by: Matilda Landström
This commit is contained in:
@@ -4,31 +4,15 @@ import { nodesToHtml } from './utils'
|
||||
|
||||
import styles from './jsontohtml.module.css'
|
||||
|
||||
import { ImageVaultAsset } from '@scandic-hotels/common/utils/imageVault'
|
||||
import { ContentBlockType } from './types/rte/enums'
|
||||
import type { RTENode } from './types/rte/node'
|
||||
import type { RenderOptions } from './types/rte/option'
|
||||
import { ContentBlockType } from './types/rte/enums'
|
||||
|
||||
export type Node<T> = {
|
||||
node: T
|
||||
}
|
||||
|
||||
type Image = {
|
||||
id: number
|
||||
title: string
|
||||
url: string
|
||||
focalPoint: {
|
||||
x: number
|
||||
y: number
|
||||
}
|
||||
dimensions?: {
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
meta: {
|
||||
alt?: string | null
|
||||
caption?: string | null
|
||||
}
|
||||
}
|
||||
export type Embeds =
|
||||
| {
|
||||
__typename: Exclude<ContentBlockType, 'ImageContainer'>
|
||||
@@ -38,11 +22,11 @@ export type Embeds =
|
||||
}
|
||||
| {
|
||||
__typename: 'ImageContainer'
|
||||
system?: { uid: string } | undefined | null
|
||||
url?: string | undefined | null
|
||||
title?: string | undefined | null
|
||||
image_left?: Image | undefined
|
||||
image_right?: Image | undefined
|
||||
system?: { uid: string } | null
|
||||
url?: string | null
|
||||
title?: string | null
|
||||
image_left?: ImageVaultAsset
|
||||
image_right?: ImageVaultAsset
|
||||
}
|
||||
|
||||
export type EmbedByUid = Record<string, Node<Embeds>>
|
||||
|
||||
Reference in New Issue
Block a user