diff --git a/packages/core/src/types/index.ts b/packages/core/src/types/index.ts index 1cd3a2eb..ca9c88b7 100644 --- a/packages/core/src/types/index.ts +++ b/packages/core/src/types/index.ts @@ -84,6 +84,7 @@ const baseFieldSchema = z.object({ type: fieldTypes, displayName: z.string(), required: z.boolean(), + defaultValue: z.union([z.string(), z.number(), z.boolean()]).optional(), }); const optionsSchema = z.array( diff --git a/packages/react-sdk/src/components/ArticleRenderer/PantheonTreeV2Renderer.ts b/packages/react-sdk/src/components/ArticleRenderer/PantheonTreeV2Renderer.ts index cb5c2a0b..6f605f17 100644 --- a/packages/react-sdk/src/components/ArticleRenderer/PantheonTreeV2Renderer.ts +++ b/packages/react-sdk/src/components/ArticleRenderer/PantheonTreeV2Renderer.ts @@ -26,10 +26,7 @@ const PantheonTreeRenderer = ({ ) ?? []; if (element.tag === "component") { - const componentType = - (element.attrs?.type as string | undefined)?.toUpperCase() ?? - // Backwards compatibility - element.type?.toUpperCase(); + const componentType = element.type?.toUpperCase(); if (!componentType) { return null;