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:
Erik Tiekstra
2025-09-10 08:57:49 +00:00
parent ddd4b7c531
commit 15711cb3a4
47 changed files with 388 additions and 458 deletions

View File

@@ -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>>