feat(blocks): add typed personalization resolution
This commit is contained in:
1 parent
2428df6e78
commit
157eec7a78
9 files changed
+128
-12
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import type { BlockRegistry, ReadonlyBlockRegistry } from "./registry.ts";
|
||||
import type { DocumentKindDefinition } from "./kinds.ts";
|
||||
import { resolveDocumentVariables } from "./variables.ts";
|
||||
import {
|
||||
DEFAULT_LIMITS,
|
||||
type BlockDocument,
|
||||
@@ -68,6 +69,8 @@ export function validateDocument(
|
||||
});
|
||||
const meta = kind.metadata.parse(document.meta, "meta");
|
||||
if (!meta.ok) errors.push(...meta.errors);
|
||||
const variables = resolveDocumentVariables(document, kind.variables);
|
||||
if (!variables.ok) errors.push(...variables.errors);
|
||||
const ids = new Set<string>();
|
||||
let count = 0;
|
||||
walkBlocks(document.root, (node, depth) => {
|
||||
|
||||
Reference in new issue
Block a user