diff --git a/src/block.tsx b/src/block.tsx index 04e0bce..d65d15f 100644 --- a/src/block.tsx +++ b/src/block.tsx @@ -246,7 +246,11 @@ export const Block: React.FC = props => { return (
diff --git a/src/components/asset.tsx b/src/components/asset.tsx index e5f9657..a52b75d 100644 --- a/src/components/asset.tsx +++ b/src/components/asset.tsx @@ -16,11 +16,11 @@ const Asset: React.FC<{ const format = value.format; const { - display_source, - block_aspect_ratio, - block_height, - block_width - } = format; + display_source = undefined, + block_aspect_ratio = undefined, + block_height = 1, + block_width = 1 + } = format ?? {}; const aspectRatio = block_aspect_ratio || block_height / block_width; diff --git a/src/types.ts b/src/types.ts index 3312728..71c89cf 100644 --- a/src/types.ts +++ b/src/types.ts @@ -196,7 +196,7 @@ export interface ContentValueType extends BaseValueType { source: string[][]; caption?: DecorationType[]; }; - format: { + format?: { block_width: number; block_height: number; display_source: string;