@openeditor/custom-block 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["value","manifest","diagnostics"],"mappings":";;;;AAGO,IAAM,4BAAA,GAA+B;AA4E5C,IAAM,UAAA,GAAa,yCAAA;AACnB,IAAM,6BAAA,mBAAgC,MAAA,CAAO,GAAA,CAAI,qCAAqC,CAAA;AAE/E,IAAM,wCAAA,GAA2C;AACxD,IAAM,WAAA,GAAc,CAAC,KAAA,KAAqD,OAAA,CAAQ,KAAK,CAAA,IAAK,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA;AAC7I,IAAM,eAAA,GAAkB,CAAC,KAAA,KAAoC,OAAO,KAAA,KAAU,YAAY,MAAA,CAAO,SAAA,CAAU,KAAK,CAAA,IAAK,KAAA,GAAQ,CAAA;AAC7H,IAAM,KAAA,GAAQ,CAAI,KAAA,KAAgB,eAAA,CAAgB,KAAK,CAAA;AACvD,IAAM,UAAA,GAAa,CAAI,KAAA,KAAgB;AACrC,EAAA,IAAI,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA,EAAG;AACjE,IAAA,MAAA,CAAO,OAAO,KAAK,CAAA;AACnB,IAAA,KAAA,MAAW,SAAS,MAAA,CAAO,MAAA,CAAO,KAAgC,CAAA,aAAc,KAAK,CAAA;AAAA,EACvF;AACA,EAAA,OAAO,KAAA;AACT,CAAA;AAEA,IAAM,iBAAA,GAAoB,EAAE,KAAA,EAAO,EAAA,EAAI,MAAA,EAAQ,GAAA,EAAQ,YAAA,EAAc,GAAA,EAAW,WAAA,EAAa,GAAA,EAAQ,UAAA,EAAY,GAAA,EAAO;AAExH,IAAM,WAAA,GAAc,CAAC,KAAA,EAAgB,IAAA,GAAO,QAAA,EAAU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AAA;AAC/D,IAAA,MAAM,IAAA,GAAO,QAAA,CAAS,MAAA,CAAO,IAAI,CAAA;AACjC,IAAA,MAAM,IAAA,GAAO,QAAA,CAAS,MAAA,CAAO,IAAI,CAAA;AACjC,IAAA,IAAI,KAAK,QAAA,CAAS,8CAA8C,CAAA,IAAK,IAAA,KAAS,gBAAgB,UAAA,CAAW,EAAE,CAAA,yBAAA,CAAA,EAA6B,WAAA,CAAY,KAAK,EAAE,IAAA,EAAM,gBAAA,EAAkB,OAAA,EAAS,kDAAkD,CAAA;AAAA,EAChP,SAAS,KAAA,EAAO;AAAE,IAAA,WAAA,CAAY,IAAA,CAAK,EAAE,IAAA,EAAM,GAAA,EAAK,OAAA,EAAS,iBAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,kCAAA,EAAoC,CAAA;AAAA,EAAG;AACzI,EAAA,OAAO,WAAA;AACT","file":"index.js","sourcesContent":["import { validateDocument, type JsonObject, type JsonValue, type OpenEditorDocument, type ProseMirrorNode } from \"@openeditor/core\";\nimport { defaultDocumentContract } from \"@openeditor/extensions\";\n\nexport const OPENEDITOR_CUSTOM_BLOCK_NODE = \"customBlock\" as const;\nexport type { JsonObject as OpenEditorCustomBlockJsonObject, JsonValue as OpenEditorCustomBlockJsonValue, OpenEditorDocument } from \"@openeditor/core\";\n\nexport type OpenEditorCustomBlockId = `${string}.${string}`;\n/**\n * A block-owned data record. The portable schema and bounded JSON validator\n * enforce JSON at runtime. `unknown` values at this type boundary also allow\n * the structurally wider `OpenEditorDocument` type in declared document fields.\n */\nexport type OpenEditorCustomBlockData = Record<string, unknown>;\n/** Preserves a block's precise field types, including nested document fields. */\nexport type OpenEditorCustomBlockDataShape<TData extends object> = TData;\nexport type OpenEditorCustomBlockEnvelope<TData extends OpenEditorCustomBlockData = OpenEditorCustomBlockData> = {\n blockId: OpenEditorCustomBlockId;\n version: number;\n data: TData;\n};\nexport type OpenEditorCustomBlockNode<TData extends OpenEditorCustomBlockData = OpenEditorCustomBlockData> = ProseMirrorNode & {\n type: typeof OPENEDITOR_CUSTOM_BLOCK_NODE;\n attrs: OpenEditorCustomBlockEnvelope<TData> & Record<string, unknown>;\n};\n\nexport type OpenEditorCustomBlockDiagnostic = { path: string; message: string };\ntype PortableSchemaBase = { nullable?: boolean; enum?: readonly JsonValue[] };\nexport type OpenEditorCustomBlockDataSchema = PortableSchemaBase & (\n | { type: \"any\" }\n | { type: \"string\"; minLength?: number; maxLength?: number; format?: \"asset-id\" }\n | { type: \"number\"; integer?: boolean; minimum?: number; maximum?: number }\n | { type: \"boolean\" }\n | { type: \"null\" }\n | { type: \"oneOf\"; variants: readonly OpenEditorCustomBlockDataSchema[] }\n | { type: \"document\" }\n | { type: \"array\"; items?: OpenEditorCustomBlockDataSchema; minItems?: number; maxItems?: number }\n | { type: \"object\"; properties?: Readonly<Record<string, OpenEditorCustomBlockDataSchema>>; required?: readonly string[]; additionalProperties?: boolean | OpenEditorCustomBlockDataSchema }\n);\nexport type OpenEditorCustomBlockManifest = {\n id: OpenEditorCustomBlockId;\n label: string;\n version: number;\n dataSchema: OpenEditorCustomBlockDataSchema;\n constraints?: readonly OpenEditorCustomBlockConstraint[];\n};\nexport type OpenEditorCustomBlockConstraint =\n | { kind: \"unique\"; array: string }\n | { kind: \"uniqueBy\"; array: string; keys: readonly string[] }\n | { kind: \"keysIn\"; scope?: string; objects: string; keys: string; requireAll?: boolean }\n | { kind: \"reference\"; array: string; field: string; targetArray: string; targetField: string; nullable?: boolean }\n | { kind: \"acyclic\"; array: string; id: string; parent: string }\n | { kind: \"graph\"; array: string; id: string; parent: string; siblingKeys?: readonly string[] }\n | { kind: \"url\"; path: string; allowRelative?: boolean; requireSchemeSeparator?: boolean; schemes?: readonly string[]; denySchemes?: readonly string[]; when?: { field: string; equals: JsonValue } };\nexport type OpenEditorCustomBlockMigration = (data: Readonly<OpenEditorCustomBlockData>) => OpenEditorCustomBlockData;\nexport type OpenEditorCustomBlockStaticContext<TData extends OpenEditorCustomBlockData> = {\n data: Readonly<TData>;\n renderDocument: (document: OpenEditorDocument) => OpenEditorCustomBlockSafeHtml;\n documentToText: (document: OpenEditorDocument) => string;\n};\nexport type OpenEditorCustomBlockSafeHtml = string | number | null | false | {\n tag: \"div\" | \"span\" | \"p\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"article\" | \"section\" | \"aside\" | \"blockquote\" | \"figure\" | \"figcaption\" | \"ul\" | \"ol\" | \"li\" | \"dl\" | \"dt\" | \"dd\" | \"table\" | \"caption\" | \"thead\" | \"tbody\" | \"tr\" | \"th\" | \"td\" | \"strong\" | \"em\" | \"u\" | \"s\" | \"code\" | \"pre\" | \"a\" | \"img\" | \"br\" | \"hr\";\n attrs?: Readonly<Partial<Record<\"aria-label\" | \"aria-current\" | \"role\" | \"title\" | \"href\" | \"src\" | \"alt\" | \"width\" | \"height\" | \"start\" | \"colspan\" | \"rowspan\" | \"scope\", string | number | undefined>>>;\n children?: readonly OpenEditorCustomBlockSafeHtml[];\n};\nexport type OpenEditorCustomBlockDefinition<TData extends OpenEditorCustomBlockData = any> = {\n id: OpenEditorCustomBlockId;\n label: string;\n version: number;\n dataSchema: OpenEditorCustomBlockDataSchema;\n initialData: () => TData;\n /** Optional in-process refinement. This function is not included in the portable manifest. */\n validateData?: (data: Readonly<TData>) => string | readonly string[] | null | undefined;\n constraints?: readonly OpenEditorCustomBlockConstraint[];\n migrations?: Readonly<Record<number, OpenEditorCustomBlockMigration>>;\n toHtml: (context: OpenEditorCustomBlockStaticContext<TData>) => OpenEditorCustomBlockSafeHtml;\n toText: (context: OpenEditorCustomBlockStaticContext<TData>) => string;\n manifest: OpenEditorCustomBlockManifest;\n};\n\nconst ID_PATTERN = /^[a-z][a-z0-9-]*(?:\\.[a-z][a-z0-9-]*)+$/;\nconst CUSTOM_BLOCK_DEFINITION_BRAND = Symbol.for(\"@openeditor/custom-block/definition\");\n/** Opaque host asset IDs. URLs, paths, whitespace, and control characters are not valid. */\nexport const OPENEDITOR_CUSTOM_BLOCK_ASSET_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;\nconst plainObject = (value: unknown): value is Record<string, unknown> => Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\nconst positiveInteger = (value: unknown): value is number => typeof value === \"number\" && Number.isInteger(value) && value > 0;\nconst clone = <T>(value: T): T => structuredClone(value);\nconst deepFreeze = <T>(value: T): T => {\n if (value && typeof value === \"object\" && !Object.isFrozen(value)) {\n Object.freeze(value);\n for (const child of Object.values(value as Record<string, unknown>)) deepFreeze(child);\n }\n return value;\n};\n\nconst VALIDATION_LIMITS = { depth: 32, values: 10_000, stringLength: 1_000_000, arrayLength: 10_000, objectKeys: 10_000 } as const;\ntype ValidationBudget = { values: number };\nconst inspectJson = (value: unknown, path = \"$.data\", depth = 0, budget: ValidationBudget = { values: 0 }): OpenEditorCustomBlockDiagnostic[] => {\n budget.values += 1;\n if (budget.values > VALIDATION_LIMITS.values) return [{ path, message: \"Custom block data exceeds the value limit.\" }];\n if (depth > VALIDATION_LIMITS.depth) return [{ path, message: \"Custom block data exceeds the nesting limit.\" }];\n if (typeof value === \"string\" && value.length > VALIDATION_LIMITS.stringLength) return [{ path, message: \"String exceeds the size limit.\" }];\n if (value === null || [\"string\", \"boolean\"].includes(typeof value) || (typeof value === \"number\" && Number.isFinite(value))) return [];\n if (Array.isArray(value)) {\n if (value.length > VALIDATION_LIMITS.arrayLength) return [{ path, message: \"Array exceeds the size limit.\" }];\n return value.flatMap((item, index) => inspectJson(item, `${path}[${index}]`, depth + 1, budget));\n }\n if (plainObject(value)) {\n const entries = Object.entries(value);\n if (entries.length > VALIDATION_LIMITS.objectKeys) return [{ path, message: \"Object exceeds the key limit.\" }];\n return entries.flatMap(([key, item]) => inspectJson(item, `${path}.${key}`, depth + 1, budget));\n }\n return [{ path, message: \"Custom block data must contain only JSON values.\" }];\n};\nconst PORTABLE_SCHEMA_TYPES = new Set([\"any\", \"string\", \"number\", \"boolean\", \"null\", \"oneOf\", \"document\", \"array\", \"object\"]);\nconst PORTABLE_PATH_PATTERN = /^(?:[A-Za-z_][A-Za-z0-9_-]*|\\*)(?:\\.(?:[A-Za-z_][A-Za-z0-9_-]*|\\*))*$/;\nconst PORTABLE_FIELD_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)*$/;\nconst requirePortablePath = (value: unknown, label: string, allowWildcards = true) => {\n if (typeof value !== \"string\" || !(allowWildcards ? PORTABLE_PATH_PATTERN : PORTABLE_FIELD_PATTERN).test(value)) throw new Error(`Invalid portable constraint ${label}.`);\n};\nconst assertPortableSchema = (schema: unknown, path = \"$.dataSchema\", depth = 0): void => {\n if (depth > VALIDATION_LIMITS.depth || !plainObject(schema) || typeof schema.type !== \"string\" || !PORTABLE_SCHEMA_TYPES.has(schema.type)) throw new Error(`Invalid portable schema at ${path}: type is not supported.`);\n if (schema.nullable !== undefined && typeof schema.nullable !== \"boolean\") throw new Error(`Invalid portable schema at ${path}: nullable must be a boolean.`);\n if (schema.enum !== undefined && (!Array.isArray(schema.enum) || inspectJson(schema.enum, `${path}.enum`).length)) throw new Error(`Invalid portable schema at ${path}: enum must contain JSON values.`);\n const boundedInteger = (name: string) => { const value = schema[name]; if (value !== undefined && (!Number.isSafeInteger(value) || Number(value) < 0)) throw new Error(`Invalid portable schema at ${path}: ${name} must be a nonnegative integer.`); };\n if (schema.type === \"string\") {\n boundedInteger(\"minLength\"); boundedInteger(\"maxLength\");\n if (schema.minLength !== undefined && schema.maxLength !== undefined && Number(schema.minLength) > Number(schema.maxLength)) throw new Error(`Invalid portable schema at ${path}: string bounds are inconsistent.`);\n if (schema.format !== undefined && schema.format !== \"asset-id\") throw new Error(`Invalid portable schema at ${path}: format is not supported.`);\n } else if (schema.type === \"number\") {\n if (schema.integer !== undefined && typeof schema.integer !== \"boolean\") throw new Error(`Invalid portable schema at ${path}: integer must be a boolean.`);\n for (const name of [\"minimum\", \"maximum\"]) if (schema[name] !== undefined && (typeof schema[name] !== \"number\" || !Number.isFinite(schema[name]))) throw new Error(`Invalid portable schema at ${path}: ${name} must be finite.`);\n if (schema.minimum !== undefined && schema.maximum !== undefined && Number(schema.minimum) > Number(schema.maximum)) throw new Error(`Invalid portable schema at ${path}: number bounds are inconsistent.`);\n } else if (schema.type === \"array\") {\n boundedInteger(\"minItems\"); boundedInteger(\"maxItems\");\n if (schema.minItems !== undefined && schema.maxItems !== undefined && Number(schema.minItems) > Number(schema.maxItems)) throw new Error(`Invalid portable schema at ${path}: array bounds are inconsistent.`);\n if (schema.items !== undefined) assertPortableSchema(schema.items, `${path}.items`, depth + 1);\n } else if (schema.type === \"object\") {\n if (schema.properties !== undefined && !plainObject(schema.properties)) throw new Error(`Invalid portable schema at ${path}: properties must be an object.`);\n const properties = plainObject(schema.properties) ? schema.properties : {};\n for (const [key, child] of Object.entries(properties)) assertPortableSchema(child, `${path}.properties.${key}`, depth + 1);\n if (schema.required !== undefined && (!Array.isArray(schema.required) || schema.required.some((key) => typeof key !== \"string\") || new Set(schema.required).size !== schema.required.length)) throw new Error(`Invalid portable schema at ${path}: required must contain unique strings.`);\n if (Array.isArray(schema.required) && schema.required.some((key) => !(key in properties))) throw new Error(`Invalid portable schema at ${path}: required fields must have schemas.`);\n if (schema.additionalProperties !== undefined && typeof schema.additionalProperties !== \"boolean\") assertPortableSchema(schema.additionalProperties, `${path}.additionalProperties`, depth + 1);\n } else if (schema.type === \"oneOf\") {\n if (!Array.isArray(schema.variants) || schema.variants.length < 1) throw new Error(`Invalid portable schema at ${path}: variants must be a nonempty array.`);\n schema.variants.forEach((variant, index) => assertPortableSchema(variant, `${path}.variants[${index}]`, depth + 1));\n }\n};\nconst assertPortableConstraints = (constraints: unknown): void => {\n if (constraints === undefined) return;\n if (!Array.isArray(constraints)) throw new Error(\"Invalid portable constraints: expected an array.\");\n for (const constraint of constraints) {\n if (!plainObject(constraint) || typeof constraint.kind !== \"string\") throw new Error(\"Invalid portable constraint shape.\");\n if (constraint.kind === \"unique\") requirePortablePath(constraint.array, \"array path\");\n else if (constraint.kind === \"uniqueBy\") { requirePortablePath(constraint.array, \"array path\"); if (!Array.isArray(constraint.keys) || !constraint.keys.length || constraint.keys.some((key) => { try { requirePortablePath(key, \"key\", false); return false; } catch { return true; } })) throw new Error(\"Invalid portable constraint keys.\"); }\n else if (constraint.kind === \"keysIn\") { if (constraint.scope !== undefined) requirePortablePath(constraint.scope, \"scope path\"); requirePortablePath(constraint.objects, \"objects path\"); requirePortablePath(constraint.keys, \"keys path\"); if (constraint.requireAll !== undefined && typeof constraint.requireAll !== \"boolean\") throw new Error(\"Invalid portable constraint requireAll flag.\"); }\n else if (constraint.kind === \"reference\") { requirePortablePath(constraint.array, \"array path\"); requirePortablePath(constraint.field, \"field\", false); requirePortablePath(constraint.targetArray, \"target array path\"); requirePortablePath(constraint.targetField, \"target field\", false); if (constraint.nullable !== undefined && typeof constraint.nullable !== \"boolean\") throw new Error(\"Invalid portable constraint nullable flag.\"); }\n else if (constraint.kind === \"acyclic\" || constraint.kind === \"graph\") { requirePortablePath(constraint.array, \"array path\"); requirePortablePath(constraint.id, \"id\", false); requirePortablePath(constraint.parent, \"parent\", false); if (constraint.siblingKeys !== undefined && (!Array.isArray(constraint.siblingKeys) || constraint.siblingKeys.some((key) => { try { requirePortablePath(key, \"sibling key\", false); return false; } catch { return true; } }))) throw new Error(\"Invalid portable constraint sibling keys.\"); }\n else if (constraint.kind === \"url\") {\n requirePortablePath(constraint.path, \"URL path\");\n for (const flag of [\"allowRelative\", \"requireSchemeSeparator\"]) if (constraint[flag] !== undefined && typeof constraint[flag] !== \"boolean\") throw new Error(`Invalid portable constraint ${flag}.`);\n for (const name of [\"schemes\", \"denySchemes\"]) if (constraint[name] !== undefined && (!Array.isArray(constraint[name]) || constraint[name].some((scheme) => typeof scheme !== \"string\" || !/^[a-z][a-z\\d+.-]*$/.test(scheme)))) throw new Error(`Invalid portable constraint ${name} scheme.`);\n if (constraint.when !== undefined && (!plainObject(constraint.when) || (() => { try { requirePortablePath(constraint.when.field, \"condition field\", false); return false; } catch { return true; } })() || inspectJson(constraint.when.equals, \"$.when.equals\").length)) throw new Error(\"Invalid portable constraint condition.\");\n } else throw new Error(`Invalid portable constraint kind \"${constraint.kind}\".`);\n }\n};\nconst recursivelyFrozen = (value: unknown, seen = new Set<object>()): boolean => {\n if (!value || typeof value !== \"object\") return true;\n if (seen.has(value)) return true;\n seen.add(value);\n return Object.isFrozen(value) && Object.values(value).every((child) => recursivelyFrozen(child, seen));\n};\nconst validateValue = (value: unknown, schema: OpenEditorCustomBlockDataSchema, path: string, depth = 0, budget: ValidationBudget = { values: 0 }): OpenEditorCustomBlockDiagnostic[] => {\n budget.values += 1;\n if (budget.values > VALIDATION_LIMITS.values) return [{ path, message: \"Custom block data exceeds the value limit.\" }];\n if (depth > VALIDATION_LIMITS.depth) return [{ path, message: \"Custom block data exceeds the nesting limit.\" }];\n if (value === null && schema.nullable) return [];\n if (schema.enum && !schema.enum.some((item) => JSON.stringify(item) === JSON.stringify(value))) return [{ path, message: \"Value is not in the allowed set.\" }];\n const errors: OpenEditorCustomBlockDiagnostic[] = [];\n if (schema.type === \"any\") return errors;\n if (schema.type === \"oneOf\") {\n const results = schema.variants.map((variant) => validateValue(value, variant, path, depth + 1, { values: budget.values }));\n const matches = results.filter((result) => result.length === 0).length;\n return matches === 1 ? [] : [{ path, message: matches === 0 ? \"Value does not match an allowed variant.\" : \"Value matches more than one variant.\" }];\n }\n if (schema.type === \"null\") return value === null ? errors : [{ path, message: \"Expected null.\" }];\n if (schema.type === \"document\") {\n if (!plainObject(value) || value.type !== \"doc\" || value.version !== 1 || !Array.isArray(value.content)) return [{ path, message: \"Expected an OpenEditor document.\" }];\n const result = validateDocument(value, { contract: defaultDocumentContract, limits: { requireNodeIds: true } });\n return result.valid ? [] : result.issues.map((issue) => ({ path: `${path}${issue.path.slice(1)}`, message: issue.message }));\n }\n if (schema.type === \"string\") {\n if (typeof value !== \"string\") return [{ path, message: \"Expected a string.\" }];\n if (value.length > VALIDATION_LIMITS.stringLength) return [{ path, message: \"String exceeds the size limit.\" }];\n if (schema.minLength !== undefined && value.length < schema.minLength) errors.push({ path, message: `Expected at least ${schema.minLength} characters.` });\n if (schema.maxLength !== undefined && value.length > schema.maxLength) errors.push({ path, message: `Expected at most ${schema.maxLength} characters.` });\n if (schema.format === \"asset-id\" && !OPENEDITOR_CUSTOM_BLOCK_ASSET_ID_PATTERN.test(value)) errors.push({ path, message: \"Expected an opaque host asset ID.\" });\n } else if (schema.type === \"number\") {\n if (typeof value !== \"number\" || !Number.isFinite(value)) return [{ path, message: \"Expected a finite number.\" }];\n if (schema.integer && !Number.isInteger(value)) errors.push({ path, message: \"Expected an integer.\" });\n if (schema.minimum !== undefined && value < schema.minimum) errors.push({ path, message: `Expected ${schema.minimum} or more.` });\n if (schema.maximum !== undefined && value > schema.maximum) errors.push({ path, message: `Expected ${schema.maximum} or less.` });\n } else if (schema.type === \"boolean\") {\n if (typeof value !== \"boolean\") errors.push({ path, message: \"Expected a boolean.\" });\n } else if (schema.type === \"array\") {\n if (!Array.isArray(value)) return [{ path, message: \"Expected an array.\" }];\n if (value.length > VALIDATION_LIMITS.arrayLength) return [{ path, message: \"Array exceeds the size limit.\" }];\n if (schema.minItems !== undefined && value.length < schema.minItems) errors.push({ path, message: `Expected at least ${schema.minItems} items.` });\n if (schema.maxItems !== undefined && value.length > schema.maxItems) errors.push({ path, message: `Expected at most ${schema.maxItems} items.` });\n if (schema.items) value.forEach((item, index) => errors.push(...validateValue(item, schema.items!, `${path}[${index}]`, depth + 1, budget)));\n } else if (schema.type === \"object\") {\n if (!plainObject(value)) return [{ path, message: \"Expected an object.\" }];\n if (Object.keys(value).length > VALIDATION_LIMITS.objectKeys) return [{ path, message: \"Object exceeds the key limit.\" }];\n for (const key of schema.required ?? []) if (!(key in value)) errors.push({ path: `${path}.${key}`, message: \"Required value is missing.\" });\n for (const [key, item] of Object.entries(value)) {\n const property = schema.properties?.[key];\n if (property) errors.push(...validateValue(item, property, `${path}.${key}`, depth + 1, budget));\n else if (schema.additionalProperties === false) errors.push({ path: `${path}.${key}`, message: \"Additional values are not allowed.\" });\n else if (plainObject(schema.additionalProperties)) errors.push(...validateValue(item, schema.additionalProperties as OpenEditorCustomBlockDataSchema, `${path}.${key}`, depth + 1, budget));\n }\n }\n return errors;\n};\n\n/** Validates one value against a portable JSON-only custom-block schema. */\nexport const validateOpenEditorCustomBlockDataValue = (\n value: unknown,\n schema: OpenEditorCustomBlockDataSchema,\n): { valid: true; diagnostics: readonly [] } | { valid: false; diagnostics: readonly OpenEditorCustomBlockDiagnostic[] } => {\n const diagnostics = [...inspectJson(value, \"$\"), ...validateValue(value, schema, \"$\")].sort((a, b) => a.path.localeCompare(b.path));\n return diagnostics.length ? { valid: false, diagnostics } : { valid: true, diagnostics: [] };\n};\ntype LocatedValue = { value: unknown; path: string };\nconst valuesAt = (root: unknown, expression: string): LocatedValue[] => expression.split(\".\").filter(Boolean).reduce<LocatedValue[]>((current, segment) => current.flatMap((item) => {\n if (segment === \"*\") return Array.isArray(item.value) ? item.value.map((value, index) => ({ value, path: `${item.path}[${index}]` })) : [];\n return plainObject(item.value) && segment in item.value ? [{ value: item.value[segment], path: `${item.path}.${segment}` }] : [];\n}), [{ value: root, path: \"$.data\" }]);\nconst fieldAt = (value: unknown, field: string) => field.split(\".\").reduce<unknown>((current, key) => plainObject(current) ? current[key] : undefined, value);\nconst hasUnsafeUrlSyntax = (value: string) => {\n if (/[\\u0000-\\u001f\\u007f]/.test(value)) return true;\n const colon = value.indexOf(\":\");\n const path = value.indexOf(\"/\");\n const query = value.indexOf(\"?\");\n const firstPathOrQuery = Math.min(...[path, query].filter((index) => index >= 0), Number.POSITIVE_INFINITY);\n return colon >= 0 && colon < firstPathOrQuery && value.slice(0, colon).includes(\"&\");\n};\nconst validateConstraints = (data: OpenEditorCustomBlockData, constraints: readonly OpenEditorCustomBlockConstraint[] = []): OpenEditorCustomBlockDiagnostic[] => {\n const diagnostics: OpenEditorCustomBlockDiagnostic[] = [];\n for (const constraint of constraints) {\n if (constraint.kind === \"unique\") for (const located of valuesAt(data, constraint.array)) {\n if (!Array.isArray(located.value)) continue; const seen = new Set<string>(); located.value.forEach((item, index) => { const key = JSON.stringify(item); if (seen.has(key)) diagnostics.push({ path: `${located.path}[${index}]`, message: \"Array values must be unique.\" }); else seen.add(key); });\n } else if (constraint.kind === \"uniqueBy\") for (const located of valuesAt(data, constraint.array)) {\n if (!Array.isArray(located.value)) continue;\n const seen = new Map<string, number>();\n located.value.forEach((item, index) => {\n const key = JSON.stringify(constraint.keys.map((field) => fieldAt(item, field)));\n if (seen.has(key)) diagnostics.push({ path: `${located.path}[${index}]`, message: `Values must be unique by ${constraint.keys.join(\", \")}.` }); else seen.set(key, index);\n });\n } else if (constraint.kind === \"keysIn\") {\n const scopes = constraint.scope ? valuesAt(data, constraint.scope) : [{ value: data, path: \"$.data\" }];\n for (const scope of scopes) {\n const objects = valuesAt(scope.value, constraint.objects);\n const keySet = valuesAt(scope.value, constraint.keys)[0]?.value;\n const allowed = new Set(Array.isArray(keySet) ? keySet : []);\n for (const located of objects) {\n if (!plainObject(located.value)) continue;\n const objectPath = `${scope.path}${located.path.slice(\"$.data\".length)}`;\n for (const key of Object.keys(located.value)) if (!allowed.has(key)) diagnostics.push({ path: `${objectPath}.${key}`, message: \"Object key is not in the allowed key collection.\" });\n if (constraint.requireAll) for (const key of allowed) if (typeof key === \"string\" && !(key in located.value)) diagnostics.push({ path: `${objectPath}.${key}`, message: \"Required object key is missing.\" });\n }\n }\n } else if (constraint.kind === \"reference\") {\n const targets = new Set(valuesAt(data, constraint.targetArray).flatMap((item) => Array.isArray(item.value) ? item.value.map((target) => fieldAt(target, constraint.targetField)) : []));\n for (const located of valuesAt(data, constraint.array)) if (Array.isArray(located.value)) located.value.forEach((item, index) => {\n const reference = fieldAt(item, constraint.field);\n if ((reference === null || reference === undefined) && constraint.nullable) return;\n if (!targets.has(reference)) diagnostics.push({ path: `${located.path}[${index}].${constraint.field}`, message: \"Reference does not identify an available value.\" });\n });\n } else if (constraint.kind === \"acyclic\" || constraint.kind === \"graph\") for (const located of valuesAt(data, constraint.array)) {\n if (!Array.isArray(located.value)) continue;\n const parents = new Map(located.value.map((item) => [fieldAt(item, constraint.id), fieldAt(item, constraint.parent)]));\n if (constraint.kind === \"graph\") {\n const ids = new Set<unknown>(); const siblings = new Set<string>();\n located.value.forEach((item, index) => { const id = fieldAt(item, constraint.id); if (ids.has(id)) diagnostics.push({ path: `${located.path}[${index}].${constraint.id}`, message: \"Node identifiers must be unique in the collection.\" }); else ids.add(id); });\n located.value.forEach((item, index) => { const parent = fieldAt(item, constraint.parent); if (parent !== null && parent !== undefined && !ids.has(parent)) diagnostics.push({ path: `${located.path}[${index}].${constraint.parent}`, message: \"Parent must identify a value in the same collection.\" }); const sibling = JSON.stringify([parent, ...(constraint.siblingKeys ?? []).map((field) => fieldAt(item, field))]); if (siblings.has(sibling)) diagnostics.push({ path: `${located.path}[${index}]`, message: \"Sibling ordering values must be unique.\" }); else siblings.add(sibling); });\n }\n for (const [id] of parents) { const seen = new Set<unknown>(); let current: unknown = id; while (current !== null && current !== undefined) { if (seen.has(current)) { diagnostics.push({ path: located.path, message: \"Parent references must be acyclic.\" }); break; } seen.add(current); current = parents.get(current); } }\n } else if (constraint.kind === \"url\") for (const located of valuesAt(data, constraint.path)) {\n if (located.value === null || located.value === undefined) continue;\n if (typeof located.value !== \"string\") { diagnostics.push({ path: located.path, message: \"URL must be a string.\" }); continue; }\n if (constraint.when) { const parentPath = located.path.replace(/\\.[^.\\[]+$/, \"\"); const parentExpression = parentPath.replace(/^\\$\\.data\\.?/, \"\").replace(/\\[\\d+\\]/g, \".*\"); const parent = valuesAt(data, parentExpression).find((item) => item.path === parentPath)?.value; if (!plainObject(parent) || JSON.stringify(fieldAt(parent, constraint.when.field)) !== JSON.stringify(constraint.when.equals)) continue; }\n const normalized = located.value.trim(); const scheme = /^([a-z][a-z\\d+.-]*):/i.exec(normalized)?.[1]?.toLowerCase();\n const unsafeRelative = !scheme && (!normalized.startsWith(\"/\") || normalized.startsWith(\"//\") || normalized.includes(\"\\\\\"));\n if ((!scheme && (!constraint.allowRelative || unsafeRelative)) || (scheme && ((constraint.requireSchemeSeparator && !normalized.toLowerCase().startsWith(`${scheme}://`)) || (constraint.schemes && !constraint.schemes.includes(scheme)) || constraint.denySchemes?.includes(scheme))) || hasUnsafeUrlSyntax(normalized)) diagnostics.push({ path: located.path, message: \"URL is not allowed.\" });\n }\n }\n return diagnostics;\n};\n\nexport const defineOpenEditorCustomBlock = <TData extends OpenEditorCustomBlockData>(\n input: Omit<OpenEditorCustomBlockDefinition<TData>, \"manifest\">,\n): OpenEditorCustomBlockDefinition<TData> => {\n if (!ID_PATTERN.test(input.id)) throw new Error(`OpenEditor custom block IDs must be namespaced lowercase identifiers. Received \"${input.id}\".`);\n if (!Number.isSafeInteger(input.version) || input.version < 1) throw new Error(\"OpenEditor custom block versions must be positive integers.\");\n if (typeof input.label !== \"string\" || !input.label.trim() || input.label.length > 200) throw new Error(\"OpenEditor custom block labels must be nonempty strings of 200 characters or less.\");\n assertPortableSchema(input.dataSchema);\n assertPortableConstraints(input.constraints);\n if (input.dataSchema.type !== \"object\") throw new Error(\"OpenEditor custom block data schemas must have type \\\"object\\\".\");\n const dataSchema = deepFreeze(clone(input.dataSchema));\n const constraints = input.constraints ? deepFreeze(clone(input.constraints)) : undefined;\n const migrations = input.migrations ? Object.freeze({ ...input.migrations }) : undefined;\n const manifest = deepFreeze({ id: input.id, label: input.label, version: input.version, dataSchema, ...(constraints ? { constraints } : {}) });\n const definition = { ...input, dataSchema, ...(constraints ? { constraints } : {}), ...(migrations ? { migrations } : {}), manifest } as OpenEditorCustomBlockDefinition<TData> & { [CUSTOM_BLOCK_DEFINITION_BRAND]?: true };\n Object.defineProperty(definition, CUSTOM_BLOCK_DEFINITION_BRAND, { value: true });\n return Object.freeze(definition);\n};\n\ntype UnavailableStatus = \"missing\" | \"disabled\" | \"incompatible\" | \"invalid\";\nexport type OpenEditorResolvedCustomBlock<TData extends OpenEditorCustomBlockData = OpenEditorCustomBlockData> =\n | { status: \"ready\"; definition: OpenEditorCustomBlockDefinition<TData>; node: OpenEditorCustomBlockNode<TData>; data: TData; migrated: boolean }\n | { status: UnavailableStatus; node: ProseMirrorNode; blockId?: string; diagnostics: readonly OpenEditorCustomBlockDiagnostic[] };\n\nexport type OpenEditorCustomBlockRegistry = {\n definitions: readonly OpenEditorCustomBlockDefinition[];\n manifests: readonly OpenEditorCustomBlockManifest[];\n get: (id: string) => OpenEditorCustomBlockDefinition | undefined;\n isEnabled: (id: string) => boolean;\n resolve: (node: ProseMirrorNode) => OpenEditorResolvedCustomBlock;\n toHtml: (node: ProseMirrorNode) => string;\n toText: (node: ProseMirrorNode) => string;\n};\n\nconst envelopeFromNode = (node: ProseMirrorNode) => {\n const attrs = node.attrs;\n return attrs && typeof attrs.blockId === \"string\" && typeof attrs.version === \"number\" && plainObject(attrs.data)\n ? { blockId: attrs.blockId, version: attrs.version, data: attrs.data as OpenEditorCustomBlockData }\n : null;\n};\nexport const escapeOpenEditorCustomBlockHtml = (value: unknown): string => String(value).replace(/[&<>\"']/g, (character) => ({ \"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\", \"'\": \"&#39;\" })[character]!);\nconst SAFE_TAGS = new Set([\"div\", \"span\", \"p\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"article\", \"section\", \"aside\", \"blockquote\", \"figure\", \"figcaption\", \"ul\", \"ol\", \"li\", \"dl\", \"dt\", \"dd\", \"table\", \"caption\", \"thead\", \"tbody\", \"tr\", \"th\", \"td\", \"strong\", \"em\", \"u\", \"s\", \"code\", \"pre\", \"a\", \"img\", \"br\", \"hr\"]);\nconst SAFE_ATTRS = new Set([\"aria-label\", \"aria-current\", \"role\", \"title\", \"href\", \"src\", \"alt\", \"width\", \"height\", \"start\", \"colspan\", \"rowspan\", \"scope\"]);\nconst safeStaticUrl = (value: string, context: \"navigation\" | \"asset\") => {\n const normalized = value.trim();\n if (!normalized || hasUnsafeUrlSyntax(normalized)) return null;\n const scheme = /^([a-z][a-z\\d+.-]*):/i.exec(normalized)?.[1]?.toLowerCase();\n if (!scheme) {\n if (normalized.startsWith(\"//\") || normalized.includes(\"\\\\\")) return null;\n return normalized;\n }\n const schemes = context === \"asset\" ? [\"http\", \"https\"] : [\"http\", \"https\", \"mailto\", \"tel\"];\n return schemes.includes(scheme) ? normalized : null;\n};\nexport const renderOpenEditorCustomBlockSafeHtml = (value: OpenEditorCustomBlockSafeHtml): string => {\n const seen = new WeakSet<object>(); let nodes = 0; let stringBytes = 0;\n const countRendered = (rendered: string) => { stringBytes += rendered.length; if (stringBytes > VALIDATION_LIMITS.stringLength) throw new Error(\"Safe HTML output exceeds its text limit.\"); return rendered; };\n const render = (item: OpenEditorCustomBlockSafeHtml, depth: number): string => {\n nodes += 1;\n if (nodes > VALIDATION_LIMITS.values || depth > VALIDATION_LIMITS.depth) throw new Error(\"Safe HTML output exceeds its structural limit.\");\n if (item && typeof item === \"object\") { if (seen.has(item)) throw new Error(\"Safe HTML output must not contain cycles.\"); seen.add(item); }\n const value = item;\n if (value === null || value === false) return \"\";\n if (typeof value === \"string\" || typeof value === \"number\") return countRendered(escapeOpenEditorCustomBlockHtml(value));\n if (!plainObject(value) || typeof value.tag !== \"string\" || !SAFE_TAGS.has(value.tag)) return \"\";\n const attrs = Object.entries(value.attrs ?? {}).flatMap(([name, raw]) => {\n if (raw === undefined || !SAFE_ATTRS.has(name) || (name === \"href\" && value.tag !== \"a\") || (name === \"src\" && value.tag !== \"img\") || (name === \"start\" && value.tag !== \"ol\") || ([\"colspan\", \"rowspan\", \"scope\"].includes(name) && ![\"td\", \"th\"].includes(value.tag))) return [];\n const safe = name === \"href\" ? safeStaticUrl(String(raw), \"navigation\") : name === \"src\" ? safeStaticUrl(String(raw), \"asset\") : String(raw);\n return safe === null ? [] : [countRendered(` ${name}=\"${escapeOpenEditorCustomBlockHtml(safe)}\"`)];\n }).join(\"\");\n const children = (value.children ?? []).map((child) => render(child, depth + 1)).join(\"\");\n return [\"img\", \"br\", \"hr\"].includes(value.tag) ? `<${value.tag}${attrs}>` : `<${value.tag}${attrs}>${children}</${value.tag}>`;\n };\n return render(value, 0);\n};\n\nexport const createOpenEditorCustomBlockRegistry = (\n definitions: readonly OpenEditorCustomBlockDefinition[],\n options: { disabled?: readonly string[]; renderDocument?: (document: OpenEditorDocument) => OpenEditorCustomBlockSafeHtml; documentToText?: (document: OpenEditorDocument) => string } = {},\n): OpenEditorCustomBlockRegistry => {\n const byId = new Map<string, OpenEditorCustomBlockDefinition>();\n for (const definition of definitions) {\n try { assertPortableSchema(definition.dataSchema); assertPortableConstraints(definition.constraints); } catch { throw new Error(`Invalid custom block definition \"${definition.id ?? \"unknown\"}\".`); }\n if ((definition as OpenEditorCustomBlockDefinition & { [CUSTOM_BLOCK_DEFINITION_BRAND]?: true })[CUSTOM_BLOCK_DEFINITION_BRAND] !== true || !recursivelyFrozen(definition.dataSchema) || !recursivelyFrozen(definition.constraints) || !recursivelyFrozen(definition.manifest) || !recursivelyFrozen(definition.migrations) || !Object.isFrozen(definition) || !ID_PATTERN.test(definition.id) || !Number.isSafeInteger(definition.version) || definition.version < 1 || definition.dataSchema?.type !== \"object\" || definition.manifest?.id !== definition.id || definition.manifest?.version !== definition.version || definition.manifest?.dataSchema !== definition.dataSchema || definition.manifest?.constraints !== definition.constraints) throw new Error(`Invalid custom block definition \"${definition.id ?? \"unknown\"}\".`);\n if (byId.has(definition.id)) throw new Error(`Duplicate custom block ID \"${definition.id}\".`);\n byId.set(definition.id, definition);\n }\n const disabled = new Set(options.disabled ?? []);\n const resolve = (node: ProseMirrorNode): OpenEditorResolvedCustomBlock => {\n const envelope = envelopeFromNode(node);\n if (node.type !== OPENEDITOR_CUSTOM_BLOCK_NODE || !envelope) return { status: \"invalid\", node, diagnostics: [{ path: \"$\", message: \"Expected a valid OpenEditor custom block envelope.\" }] };\n if (typeof node.attrs?.[\"openeditor-id\"] !== \"string\" || !node.attrs[\"openeditor-id\"].trim()) return { status: \"invalid\", node, blockId: envelope.blockId, diagnostics: [{ path: \"$.attrs.openeditor-id\", message: \"Custom block instance ID is required.\" }] };\n const definition = byId.get(envelope.blockId);\n if (!definition) return { status: \"missing\", node, blockId: envelope.blockId, diagnostics: [] };\n if (disabled.has(envelope.blockId)) return { status: \"disabled\", node, blockId: envelope.blockId, diagnostics: [] };\n if (envelope.version > definition.version) return { status: \"incompatible\", node, blockId: envelope.blockId, diagnostics: [{ path: \"$.version\", message: `Stored version ${envelope.version} is newer than supported version ${definition.version}.` }] };\n let version = envelope.version;\n let data = clone(envelope.data);\n try {\n while (version < definition.version) {\n const migrate = definition.migrations?.[version];\n if (!migrate) return { status: \"incompatible\", node, blockId: envelope.blockId, diagnostics: [{ path: \"$.version\", message: `No migration exists from version ${version}.` }] };\n data = clone(migrate(Object.freeze(clone(data))));\n version += 1;\n }\n } catch (error) { return { status: \"invalid\", node, blockId: envelope.blockId, diagnostics: [{ path: \"$.data\", message: error instanceof Error ? error.message : \"Migration failed.\" }] }; }\n const diagnostics = [...inspectJson(data), ...validateValue(data, definition.dataSchema, \"$.data\"), ...validateConstraints(data, definition.constraints)].sort((a, b) => a.path.localeCompare(b.path));\n try {\n const refinement = definition.validateData?.(deepFreeze(clone(data)));\n if (typeof refinement === \"string\") diagnostics.push({ path: \"$.data\", message: refinement });\n else for (const message of refinement ?? []) diagnostics.push({ path: \"$.data\", message });\n } catch (error) { diagnostics.push({ path: \"$.data\", message: error instanceof Error ? error.message : \"Custom validation failed.\" }); }\n if (diagnostics.length) return { status: \"invalid\", node, blockId: envelope.blockId, diagnostics };\n const migrated = version !== envelope.version;\n const readyData = deepFreeze(clone(data));\n return { status: \"ready\", definition, data: readyData, migrated, node: migrated ? { ...node, attrs: { ...node.attrs, blockId: definition.id, version, data: readyData } } as OpenEditorCustomBlockNode : node as OpenEditorCustomBlockNode };\n };\n const defaultDocumentSafeTree = (document: OpenEditorDocument): OpenEditorCustomBlockSafeHtml => {\n let count = 0;\n const renderNode = (node: ProseMirrorNode, depth = 0): OpenEditorCustomBlockSafeHtml => {\n count += 1; if (count > VALIDATION_LIMITS.values || depth > VALIDATION_LIMITS.depth) return \"\";\n if (node.type === \"text\") {\n let output: OpenEditorCustomBlockSafeHtml = node.text ?? \"\";\n for (const mark of [...(node.marks ?? [])].reverse()) {\n if (mark.type === \"bold\") output = { tag: \"strong\", children: [output] };\n else if (mark.type === \"italic\") output = { tag: \"em\", children: [output] };\n else if (mark.type === \"underline\") output = { tag: \"u\", children: [output] };\n else if (mark.type === \"strike\") output = { tag: \"s\", children: [output] };\n else if (mark.type === \"code\") output = { tag: \"code\", children: [output] };\n else if (mark.type === \"link\" && typeof mark.attrs?.href === \"string\") output = { tag: \"a\", attrs: { href: mark.attrs.href }, children: [output] };\n }\n return output;\n }\n if (node.type === OPENEDITOR_CUSTOM_BLOCK_NODE) { const nested = resolve(node); return nested.status === \"ready\" ? exportNestedSafeTree(nested) : `[${envelopeFromNode(node)?.blockId ?? \"custom block\"}: ${nested.status}]`; }\n const children = node.content?.map((child) => renderNode(child, depth + 1)) ?? [];\n if (node.type === \"image\") return { tag: \"figure\", children: [{ tag: \"img\", attrs: { alt: typeof node.attrs?.alt === \"string\" ? node.attrs.alt : \"Image\" } }] };\n if (node.type === \"page\") return { tag: \"span\", children: children.length ? children : [typeof node.attrs?.title === \"string\" ? node.attrs.title : \"Untitled page\"] };\n if (node.type === \"attachment\") return { tag: \"span\", children: [typeof node.attrs?.name === \"string\" && node.attrs.name ? node.attrs.name : \"Attachment\"] };\n const heading = node.type === \"heading\" ? `h${Math.min(6, Math.max(1, Number(node.attrs?.level) || 2))}` : null;\n const tag = heading ?? (node.type === \"paragraph\" ? \"p\" : node.type === \"bulletList\" || node.type === \"taskList\" ? \"ul\" : node.type === \"orderedList\" ? \"ol\" : [\"listItem\", \"taskItem\", \"toggleListItem\"].includes(node.type) ? \"li\" : node.type === \"blockquote\" ? \"blockquote\" : node.type === \"codeBlock\" ? \"pre\" : node.type === \"table\" ? \"table\" : node.type === \"tableRow\" ? \"tr\" : node.type === \"tableHeader\" ? \"th\" : node.type === \"tableCell\" ? \"td\" : node.type === \"hardBreak\" ? \"br\" : node.type === \"divider\" || node.type === \"horizontalRule\" ? \"hr\" : node.type === \"callout\" ? \"aside\" : node.type === \"diagram\" || node.type === \"mermaidDiagram\" ? \"figure\" : \"div\");\n const attrs = node.type === \"orderedList\" && positiveInteger(node.attrs?.start) ? { start: Number(node.attrs?.start) } : node.type === \"tableHeader\" || node.type === \"tableCell\" ? { ...(positiveInteger(node.attrs?.colspan) ? { colspan: Number(node.attrs?.colspan) } : {}), ...(positiveInteger(node.attrs?.rowspan) ? { rowspan: Number(node.attrs?.rowspan) } : {}), ...(node.type === \"tableHeader\" && typeof node.attrs?.scope === \"string\" ? { scope: node.attrs.scope } : {}) } : undefined;\n return { tag, ...(attrs ? { attrs } : {}), children } as OpenEditorCustomBlockSafeHtml;\n };\n return { tag: \"div\", children: document.content.map((node) => renderNode(node)) };\n };\n const defaultDocumentText = (document: OpenEditorDocument): string => {\n let count = 0;\n const renderNode = (node: ProseMirrorNode, depth = 0): string => {\n count += 1; if (count > VALIDATION_LIMITS.values || depth > VALIDATION_LIMITS.depth) return \"\";\n if (node.type === OPENEDITOR_CUSTOM_BLOCK_NODE) { const nested = resolve(node); return nested.status === \"ready\" ? exportNestedText(nested) : \"\"; }\n if (node.type === \"image\") return typeof node.attrs?.alt === \"string\" ? node.attrs.alt : \"Image\";\n if (node.type === \"page\" && !node.content?.length) return typeof node.attrs?.title === \"string\" ? node.attrs.title : \"Untitled page\";\n if (node.type === \"attachment\") return typeof node.attrs?.name === \"string\" && node.attrs.name ? node.attrs.name : \"Attachment\";\n if (node.text) return node.text;\n const content = node.content?.map((child) => renderNode(child, depth + 1)).filter(Boolean) ?? [];\n return [\"doc\", \"paragraph\", \"heading\", \"listItem\", \"taskItem\", \"blockquote\", \"codeBlock\", \"tableRow\", \"callout\"].includes(node.type) ? content.join(\"\") : content.join(\"\\n\");\n };\n return renderNode(document).trim();\n };\n const fallbackLabel = (node: ProseMirrorNode, status: string) => `Custom block ${envelopeFromNode(node)?.blockId ?? \"unknown\"} is unavailable: ${status}.`;\n const fallback = (node: ProseMirrorNode, result: OpenEditorResolvedCustomBlock) => `<p role=\"status\" data-openeditor-custom-block-error=\"${escapeOpenEditorCustomBlockHtml(result.status)}\" data-block-id=\"${escapeOpenEditorCustomBlockHtml(envelopeFromNode(node)?.blockId ?? \"unknown\")}\">${escapeOpenEditorCustomBlockHtml(fallbackLabel(node, result.status))}</p>`;\n const exportReadySafeTree = (result: Extract<OpenEditorResolvedCustomBlock, { status: \"ready\" }>) => result.definition.toHtml({ data: result.data, renderDocument: options.renderDocument ?? defaultDocumentSafeTree, documentToText: options.documentToText ?? defaultDocumentText });\n const exportReadyText = (result: Extract<OpenEditorResolvedCustomBlock, { status: \"ready\" }>) => result.definition.toText({ data: result.data, renderDocument: options.renderDocument ?? defaultDocumentSafeTree, documentToText: options.documentToText ?? defaultDocumentText });\n const exportNestedSafeTree = (result: Extract<OpenEditorResolvedCustomBlock, { status: \"ready\" }>): OpenEditorCustomBlockSafeHtml => { try { const tree = exportReadySafeTree(result); renderOpenEditorCustomBlockSafeHtml(tree); return tree; } catch { return { tag: \"p\", attrs: { role: \"status\" }, children: [fallbackLabel(result.node, \"invalid\")] }; } };\n const exportNestedText = (result: Extract<OpenEditorResolvedCustomBlock, { status: \"ready\" }>): string => { try { return exportReadyText(result); } catch { return fallbackLabel(result.node, \"invalid\"); } };\n return Object.freeze({\n definitions: Object.freeze([...definitions]), manifests: Object.freeze(definitions.map((item) => item.manifest)), get: (id) => byId.get(id), isEnabled: (id) => byId.has(id) && !disabled.has(id), resolve,\n toHtml: (node) => { const result = resolve(node); if (result.status !== \"ready\") return fallback(node, result); try { const rendered = renderOpenEditorCustomBlockSafeHtml(exportReadySafeTree(result)); return rendered || fallback(node, { status: \"invalid\", node, blockId: result.definition.id, diagnostics: [{ path: \"$.toHtml\", message: \"Static HTML output is invalid.\" }] }); } catch { return fallback(node, { status: \"invalid\", node, blockId: result.definition.id, diagnostics: [{ path: \"$.toHtml\", message: \"Static HTML export failed.\" }] }); } },\n toText: (node) => { const result = resolve(node); if (result.status !== \"ready\") return fallbackLabel(node, result.status); try { return exportReadyText(result); } catch { return fallbackLabel(node, \"invalid\"); } },\n });\n};\n\nexport const createOpenEditorCustomBlockNode = <TData extends OpenEditorCustomBlockData>(\n registry: OpenEditorCustomBlockRegistry,\n id: string,\n data?: TData,\n options: { instanceId?: string; createInstanceId?: () => string } = {},\n): OpenEditorCustomBlockNode<TData> => {\n const definition = registry.get(id);\n if (!definition) throw new Error(`OpenEditor custom block \"${id}\" is not registered.`);\n const value = clone(data ?? definition.initialData()) as TData;\n const diagnostics = validateValue(value, definition.dataSchema, \"$.data\");\n if (diagnostics.length) throw new Error(`Invalid initial data for \"${id}\": ${diagnostics.map((item) => `${item.path}: ${item.message}`).join(\"; \")}`);\n const instanceId = options.instanceId ?? options.createInstanceId?.() ?? globalThis.crypto.randomUUID();\n if (!instanceId.trim()) throw new Error(\"OpenEditor custom block instance IDs must not be empty.\");\n const node = { type: OPENEDITOR_CUSTOM_BLOCK_NODE, attrs: { \"openeditor-id\": instanceId, blockId: definition.id, version: definition.version, data: value } } as OpenEditorCustomBlockNode<TData>;\n const resolved = registry.resolve(node);\n if (resolved.status !== \"ready\") throw new Error(`Invalid initial data for \"${id}\": ${resolved.diagnostics.map((item) => `${item.path}: ${item.message}`).join(\"; \") || resolved.status}`);\n return node;\n};\nexport const resolveOpenEditorCustomBlockNode = (registry: OpenEditorCustomBlockRegistry, node: ProseMirrorNode) => registry.resolve(node);\n\nexport const validateOpenEditorCustomBlockEnvelope = (\n value: unknown,\n manifests: readonly OpenEditorCustomBlockManifest[],\n options: { mode?: \"strict\" | \"preserve\"; disabled?: readonly string[] } = {},\n) => {\n const ids = new Set<string>();\n for (const manifest of manifests) {\n if (ids.has(manifest.id)) return { valid: false as const, diagnostics: [{ path: \"$.manifests\", message: `Duplicate custom block manifest \"${manifest.id}\".` }] };\n ids.add(manifest.id);\n if (!ID_PATTERN.test(manifest.id) || !Number.isSafeInteger(manifest.version) || manifest.version < 1) return { valid: false as const, diagnostics: [{ path: \"$.manifests\", message: \"Custom block manifest identity or version is invalid.\" }] };\n }\n if (!plainObject(value) || typeof value.blockId !== \"string\" || typeof value.version !== \"number\" || !plainObject(value.data)) return { valid: false as const, diagnostics: [{ path: \"$\", message: \"Expected a custom block envelope.\" }] };\n const manifest = manifests.find((item) => item.id === value.blockId);\n if (options.mode === \"preserve\" && (!manifest || options.disabled?.includes(value.blockId) || (manifest && value.version !== manifest.version))) {\n const diagnostics = inspectJson(value.data);\n return diagnostics.length ? { valid: false as const, diagnostics } : { valid: true as const, diagnostics: [] as const, status: \"preserved\" as const };\n }\n if (!manifest) return { valid: false as const, diagnostics: [{ path: \"$.blockId\", message: `Unknown custom block \"${value.blockId}\".` }] };\n if (value.version !== manifest.version) return { valid: false as const, diagnostics: [{ path: \"$.version\", message: `Expected version ${manifest.version}.` }] };\n const nestedDiagnostics: OpenEditorCustomBlockDiagnostic[] = [];\n const nestedSeen = new WeakSet<object>();\n const inspectNested = (input: unknown, path: string): void => {\n if (!plainObject(input) || nestedSeen.has(input)) return;\n nestedSeen.add(input);\n if (input.type === OPENEDITOR_CUSTOM_BLOCK_NODE && plainObject(input.attrs)) {\n const nested = validateOpenEditorCustomBlockEnvelope(input.attrs, manifests, options);\n if (!nested.valid) nestedDiagnostics.push(...nested.diagnostics.map((item) => ({ path: `${path}.attrs${item.path.slice(1)}`, message: item.message })));\n return;\n }\n if (Array.isArray(input.content)) input.content.forEach((item, index) => inspectNested(item, `${path}.content[${index}]`));\n };\n const inspectDeclaredDocuments = (input: unknown, schema: OpenEditorCustomBlockDataSchema, path: string): void => {\n if (schema.type === \"document\") { inspectNested(input, path); return; }\n if (schema.type === \"array\" && Array.isArray(input) && schema.items) input.forEach((item, index) => inspectDeclaredDocuments(item, schema.items!, `${path}[${index}]`));\n if (schema.type === \"object\" && plainObject(input)) for (const [key, item] of Object.entries(input)) {\n const property = schema.properties?.[key];\n if (property) inspectDeclaredDocuments(item, property, `${path}.${key}`);\n else if (plainObject(schema.additionalProperties)) inspectDeclaredDocuments(item, schema.additionalProperties as OpenEditorCustomBlockDataSchema, `${path}.${key}`);\n }\n if (schema.type === \"oneOf\") for (const variant of schema.variants) if (validateValue(input, variant, path).length === 0) inspectDeclaredDocuments(input, variant, path);\n };\n inspectDeclaredDocuments(value.data, manifest.dataSchema, \"$.data\");\n const diagnostics = [...inspectJson(value.data), ...validateValue(value.data, manifest.dataSchema, \"$.data\"), ...validateConstraints(value.data as OpenEditorCustomBlockData, manifest.constraints), ...nestedDiagnostics].sort((a, b) => a.path.localeCompare(b.path));\n if (options.mode === \"preserve\" && diagnostics.length && inspectJson(value.data).length === 0) return { valid: true as const, diagnostics, status: \"preserved-invalid\" as const };\n return diagnostics.length ? { valid: false as const, diagnostics } : { valid: true as const, diagnostics: [] as const };\n};\n\nexport type OpenEditorCustomBlockAssetReference = { id: string; path: string };\n/** Extracts host asset IDs from a portable manifest without loading extension code. */\nexport const extractOpenEditorCustomBlockAssetReferences = (\n value: unknown,\n manifests: readonly OpenEditorCustomBlockManifest[],\n): readonly OpenEditorCustomBlockAssetReference[] => {\n const byId = new Map<string, OpenEditorCustomBlockManifest>(manifests.map((manifest) => [manifest.id, manifest]));\n const references: OpenEditorCustomBlockAssetReference[] = [];\n const seen = new Set<string>();\n const visitSchema = (input: unknown, schema: OpenEditorCustomBlockDataSchema, path: string) => {\n if (input === null || input === undefined) return;\n if (schema.type === \"string\" && schema.format === \"asset-id\" && typeof input === \"string\" && OPENEDITOR_CUSTOM_BLOCK_ASSET_ID_PATTERN.test(input)) { const key = `${path}\\u0000${input}`; if (!seen.has(key)) { seen.add(key); references.push({ id: input, path }); } return; }\n if (schema.type === \"array\" && Array.isArray(input) && schema.items) input.forEach((item, index) => visitSchema(item, schema.items!, `${path}[${index}]`));\n if (schema.type === \"object\" && plainObject(input)) for (const [key, item] of Object.entries(input)) {\n const property = schema.properties?.[key];\n if (property) visitSchema(item, property, `${path}.${key}`);\n else if (plainObject(schema.additionalProperties)) visitSchema(item, schema.additionalProperties as OpenEditorCustomBlockDataSchema, `${path}.${key}`);\n }\n if (schema.type === \"document\" && plainObject(input)) visitNested(input, path);\n if (schema.type === \"oneOf\") for (const variant of schema.variants) {\n if (validateValue(input, variant, path).length === 0) visitSchema(input, variant, path);\n }\n };\n const visitNested = (input: unknown, path: string): void => {\n if (!plainObject(input)) return;\n if (input.type === OPENEDITOR_CUSTOM_BLOCK_NODE && plainObject(input.attrs)) {\n const manifest = typeof input.attrs.blockId === \"string\" ? byId.get(input.attrs.blockId) : undefined;\n if (manifest && plainObject(input.attrs.data) && validateOpenEditorCustomBlockEnvelope(input.attrs, manifests).valid) visitSchema(input.attrs.data, manifest.dataSchema, `${path}.attrs.data`);\n return;\n }\n if (Array.isArray(input.content)) input.content.forEach((item, index) => visitNested(item, `${path}.content[${index}]`));\n };\n if (plainObject(value) && typeof value.blockId === \"string\" && plainObject(value.data)) {\n const manifest = byId.get(value.blockId);\n if (manifest && validateOpenEditorCustomBlockEnvelope(value, manifests).valid) visitSchema(value.data, manifest.dataSchema, \"$.data\");\n }\n return references;\n};\n\nexport type OpenEditorCustomBlockIcon = { id: string; label: string };\nexport type OpenEditorCustomBlockAsset = { id: string; kind: \"raster\"; alt: string; width?: number; height?: number };\nexport type OpenEditorCustomBlockHost = {\n resolveUrl: (value: string, context: \"navigation\" | \"asset\") => string | null;\n links?: { resolve: (destination: { href: string; kind?: string }) => { href: string; external: boolean; label?: string } | null };\n navigate?: (url: string) => void | Promise<void>;\n icons?: { list: () => readonly OpenEditorCustomBlockIcon[]; render: (id: string) => unknown };\n assets?: { pick?: () => Promise<OpenEditorCustomBlockAsset | null>; resolve: (id: string) => Promise<{ src: string; alt: string } | null> };\n};\nexport type OpenEditorCustomBlockDocumentField = {\n value: OpenEditorDocument;\n onChange?: (value: OpenEditorDocument) => void;\n readOnly: boolean;\n};\n\n/** Runs portable checks that custom-block packages can include in their test suites. */\nexport const conformOpenEditorCustomBlock = (definition: OpenEditorCustomBlockDefinition): readonly OpenEditorCustomBlockDiagnostic[] => {\n const diagnostics: OpenEditorCustomBlockDiagnostic[] = [];\n try {\n const registry = createOpenEditorCustomBlockRegistry([definition]);\n const node = createOpenEditorCustomBlockNode(registry, definition.id, undefined, { instanceId: \"conformance-instance\" });\n const envelope = node.attrs as unknown;\n const validated = validateOpenEditorCustomBlockEnvelope(envelope, registry.manifests);\n if (!validated.valid) diagnostics.push(...validated.diagnostics);\n const html = registry.toHtml(node);\n const text = registry.toText(node);\n if (html.includes('data-openeditor-custom-block-error=\"invalid\"') || text === `Custom block ${definition.id} is unavailable: invalid.`) diagnostics.push({ path: \"$.staticExport\", message: \"Custom block static export failed conformance.\" });\n } catch (error) { diagnostics.push({ path: \"$\", message: error instanceof Error ? error.message : \"Custom block conformance failed.\" }); }\n return diagnostics;\n};\n"]}
@@ -0,0 +1,37 @@
1
+ import * as react from 'react';
2
+ import { ComponentType, ReactNode } from 'react';
3
+ import { OpenEditorDocument, ProseMirrorNode } from '@openeditor/core';
4
+ import { OpenEditorCustomBlockData, OpenEditorCustomBlockDefinition, OpenEditorCustomBlockHost, OpenEditorCustomBlockRegistry } from './index.js';
5
+
6
+ type OpenEditorCustomBlockDocumentViewerProps = {
7
+ value: OpenEditorDocument;
8
+ ariaLabel: string;
9
+ };
10
+ type OpenEditorCustomBlockViewerHost = OpenEditorCustomBlockHost & {
11
+ fields: {
12
+ document: ComponentType<OpenEditorCustomBlockDocumentViewerProps>;
13
+ };
14
+ };
15
+ type OpenEditorCustomBlockViewerContext<TData extends OpenEditorCustomBlockData> = {
16
+ data: Readonly<TData>;
17
+ instanceId: string;
18
+ host: OpenEditorCustomBlockViewerHost;
19
+ };
20
+ type OpenEditorCustomBlockViewerAdapter<TData extends OpenEditorCustomBlockData = any> = {
21
+ block: OpenEditorCustomBlockDefinition<TData>;
22
+ render: ComponentType<OpenEditorCustomBlockViewerContext<TData>>;
23
+ };
24
+ declare const defineOpenEditorCustomBlockViewer: <TData extends OpenEditorCustomBlockData>(adapter: OpenEditorCustomBlockViewerAdapter<TData>) => OpenEditorCustomBlockViewerAdapter<TData>;
25
+ type OpenEditorCustomBlockViewerSurfaceProps = {
26
+ node: ProseMirrorNode;
27
+ registry: OpenEditorCustomBlockRegistry;
28
+ adapters: readonly OpenEditorCustomBlockViewerAdapter[];
29
+ host: OpenEditorCustomBlockViewerHost;
30
+ fallback?: (input: {
31
+ node: ProseMirrorNode;
32
+ status: string;
33
+ }) => ReactNode;
34
+ };
35
+ declare const OpenEditorCustomBlockViewerSurface: ({ node, registry, adapters, host, fallback }: OpenEditorCustomBlockViewerSurfaceProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react.JSX.Element;
36
+
37
+ export { type OpenEditorCustomBlockDocumentViewerProps, type OpenEditorCustomBlockViewerAdapter, type OpenEditorCustomBlockViewerContext, type OpenEditorCustomBlockViewerHost, OpenEditorCustomBlockViewerSurface, type OpenEditorCustomBlockViewerSurfaceProps, defineOpenEditorCustomBlockViewer };
package/dist/viewer.js ADDED
@@ -0,0 +1,45 @@
1
+ import { useSyncExternalStore, Component } from 'react';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+
4
+ // src/viewer.tsx
5
+ var defineOpenEditorCustomBlockViewer = (adapter) => adapter;
6
+ var ViewerAdapterErrorBoundary = class extends Component {
7
+ state = { failed: false };
8
+ static getDerivedStateFromError() {
9
+ return { failed: true };
10
+ }
11
+ componentDidCatch() {
12
+ }
13
+ render() {
14
+ return this.state.failed ? /* @__PURE__ */ jsx("div", { "data-openeditor-custom-block-error": "viewer-error", role: "status", children: "Custom block Viewer unavailable." }) : this.props.children;
15
+ }
16
+ };
17
+ var subscribeClientReady = () => () => {
18
+ };
19
+ var ViewerAdapterIsland = ({ resolved, adapter, host }) => {
20
+ const clientReady = useSyncExternalStore(subscribeClientReady, () => true, () => false);
21
+ if (!clientReady) return /* @__PURE__ */ jsx("div", { "data-openeditor-custom-block-loading": "", role: "status", children: "Custom block loading." });
22
+ const Render = adapter.render;
23
+ return /* @__PURE__ */ jsx(ViewerAdapterErrorBoundary, { children: /* @__PURE__ */ jsx(Render, { data: resolved.data, host, instanceId: String(resolved.node.attrs?.["openeditor-id"]) }) }, `${String(resolved.node.attrs?.["openeditor-id"])}:${resolved.definition.id}`);
24
+ };
25
+ var OpenEditorCustomBlockViewerSurface = ({ node, registry, adapters, host, fallback }) => {
26
+ const ids = /* @__PURE__ */ new Set();
27
+ for (const adapter2 of adapters) {
28
+ if (ids.has(adapter2.block.id)) throw new Error(`Duplicate custom block Viewer adapter "${adapter2.block.id}".`);
29
+ ids.add(adapter2.block.id);
30
+ }
31
+ const resolved = registry.resolve(node);
32
+ if (resolved.status !== "ready") return fallback?.({ node, status: resolved.status }) ?? /* @__PURE__ */ jsxs("div", { "data-openeditor-custom-block-error": resolved.status, role: "status", children: [
33
+ "Custom block unavailable: ",
34
+ resolved.status,
35
+ "."
36
+ ] });
37
+ const adapter = adapters.find((item) => item.block.id === resolved.definition.id);
38
+ if (!adapter) return fallback?.({ node, status: "missing-viewer" }) ?? /* @__PURE__ */ jsx("div", { "data-openeditor-custom-block-error": "missing-viewer", role: "status", children: "Custom block Viewer unavailable." });
39
+ if (adapter.block !== resolved.definition) return fallback?.({ node, status: "incompatible-viewer" }) ?? /* @__PURE__ */ jsx("div", { "data-openeditor-custom-block-error": "incompatible-viewer", role: "status", children: "Custom block Viewer unavailable." });
40
+ return /* @__PURE__ */ jsx(ViewerAdapterIsland, { adapter, host, resolved });
41
+ };
42
+
43
+ export { OpenEditorCustomBlockViewerSurface, defineOpenEditorCustomBlockViewer };
44
+ //# sourceMappingURL=viewer.js.map
45
+ //# sourceMappingURL=viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/viewer.tsx"],"names":["adapter"],"mappings":";;;;AAsBO,IAAM,iCAAA,GAAoC,CAA0C,OAAA,KAAuD;AAUlJ,IAAM,0BAAA,GAAN,cAAyC,SAAA,CAAwD;AAAA,EAC/F,KAAA,GAAQ,EAAE,MAAA,EAAQ,KAAA,EAAM;AAAA,EACxB,OAAO,wBAAA,GAA2B;AAAE,IAAA,OAAO,EAAE,QAAQ,IAAA,EAAK;AAAA,EAAG;AAAA,EAC7D,iBAAA,GAAoB;AAAA,EAAC;AAAA,EACrB,MAAA,GAAS;AACP,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,MAAA,mBACd,GAAA,CAAC,KAAA,EAAA,EAAI,oCAAA,EAAmC,cAAA,EAAe,IAAA,EAAK,QAAA,EAAS,QAAA,EAAA,kCAAA,EAAgC,CAAA,GACrG,IAAA,CAAK,KAAA,CAAM,QAAA;AAAA,EACjB;AACF,CAAA;AAEA,IAAM,oBAAA,GAAuB,MAAM,MAAM;AAAC,CAAA;AAC1C,IAAM,sBAAsB,CAAC,EAAE,QAAA,EAAU,OAAA,EAAS,MAAK,KAIjD;AACJ,EAAA,MAAM,cAAc,oBAAA,CAAqB,oBAAA,EAAsB,MAAM,IAAA,EAAM,MAAM,KAAK,CAAA;AACtF,EAAA,IAAI,CAAC,aAAa,uBAAO,GAAA,CAAC,SAAI,sCAAA,EAAqC,EAAA,EAAG,IAAA,EAAK,QAAA,EAAS,QAAA,EAAA,uBAAA,EAAqB,CAAA;AACzG,EAAA,MAAM,SAAS,OAAA,CAAQ,MAAA;AACvB,EAAA,uBACE,GAAA,CAAC,0BAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,IAAA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A,KAAO,QAAA,CAAS,UAAA,CAAW,EAAE,CAAA;AAChF,EAAA,IAAI,CAAC,OAAA,EAAS,OAAO,QAAA,GAAW,EAAE,MAAM,MAAA,EAAQ,gBAAA,EAAkB,CAAA,wBAAM,KAAA,EAAA,EAAI,oCAAA,EAAmC,gBAAA,EAAiB,IAAA,EAAK,UAAS,QAAA,EAAA,kCAAA,EAAgC,CAAA;AAC9K,EAAA,IAAI,QAAQ,KAAA,KAAU,QAAA,CAAS,YAAY,OAAO,QAAA,GAAW,EAAE,IAAA,EAAM,MAAA,EAAQ,qBAAA,EAAuB,qBAAK,GAAA,CAAC,KAAA,EAAA,EAAI,sCAAmC,qBAAA,EAAsB,IAAA,EAAK,UAAS,QAAA,EAAA,kCAAA,EAAgC,CAAA;AACrN,EAAA,uBAAO,GAAA,CAAC,mBAAA,EAAA,EAAoB,OAAA,EAAkB,IAAA,EAAY,QAAA,EAAoB,CAAA;AAChF","file":"viewer.js","sourcesContent":["import type { OpenEditorDocument, ProseMirrorNode } from \"@openeditor/core\";\nimport {\n type OpenEditorCustomBlockData,\n type OpenEditorCustomBlockDefinition,\n type OpenEditorCustomBlockHost,\n type OpenEditorCustomBlockRegistry,\n} from \"./index\";\nimport { Component, useSyncExternalStore, type ComponentType, type ReactNode } from \"react\";\n\nexport type OpenEditorCustomBlockDocumentViewerProps = { value: OpenEditorDocument; ariaLabel: string };\nexport type OpenEditorCustomBlockViewerHost = OpenEditorCustomBlockHost & {\n fields: { document: ComponentType<OpenEditorCustomBlockDocumentViewerProps> };\n};\nexport type OpenEditorCustomBlockViewerContext<TData extends OpenEditorCustomBlockData> = {\n data: Readonly<TData>;\n instanceId: string;\n host: OpenEditorCustomBlockViewerHost;\n};\nexport type OpenEditorCustomBlockViewerAdapter<TData extends OpenEditorCustomBlockData = any> = {\n block: OpenEditorCustomBlockDefinition<TData>;\n render: ComponentType<OpenEditorCustomBlockViewerContext<TData>>;\n};\nexport const defineOpenEditorCustomBlockViewer = <TData extends OpenEditorCustomBlockData>(adapter: OpenEditorCustomBlockViewerAdapter<TData>) => adapter;\n\nexport type OpenEditorCustomBlockViewerSurfaceProps = {\n node: ProseMirrorNode;\n registry: OpenEditorCustomBlockRegistry;\n adapters: readonly OpenEditorCustomBlockViewerAdapter[];\n host: OpenEditorCustomBlockViewerHost;\n fallback?: (input: { node: ProseMirrorNode; status: string }) => ReactNode;\n};\n\nclass ViewerAdapterErrorBoundary extends Component<{ children: ReactNode }, { failed: boolean }> {\n state = { failed: false };\n static getDerivedStateFromError() { return { failed: true }; }\n componentDidCatch() {}\n render() {\n return this.state.failed\n ? <div data-openeditor-custom-block-error=\"viewer-error\" role=\"status\">Custom block Viewer unavailable.</div>\n : this.props.children;\n }\n}\n\nconst subscribeClientReady = () => () => {};\nconst ViewerAdapterIsland = ({ resolved, adapter, host }: {\n resolved: Extract<ReturnType<OpenEditorCustomBlockRegistry[\"resolve\"]>, { status: \"ready\" }>;\n adapter: OpenEditorCustomBlockViewerAdapter;\n host: OpenEditorCustomBlockViewerHost;\n}) => {\n const clientReady = useSyncExternalStore(subscribeClientReady, () => true, () => false);\n if (!clientReady) return <div data-openeditor-custom-block-loading=\"\" role=\"status\">Custom block loading.</div>;\n const Render = adapter.render;\n return (\n <ViewerAdapterErrorBoundary key={`${String(resolved.node.attrs?.[\"openeditor-id\"])}:${resolved.definition.id}`}>\n <Render data={resolved.data} host={host} instanceId={String(resolved.node.attrs?.[\"openeditor-id\"])} />\n </ViewerAdapterErrorBoundary>\n );\n};\n\nexport const OpenEditorCustomBlockViewerSurface = ({ node, registry, adapters, host, fallback }: OpenEditorCustomBlockViewerSurfaceProps) => {\n const ids = new Set<string>();\n for (const adapter of adapters) {\n if (ids.has(adapter.block.id)) throw new Error(`Duplicate custom block Viewer adapter \"${adapter.block.id}\".`);\n ids.add(adapter.block.id);\n }\n const resolved = registry.resolve(node);\n if (resolved.status !== \"ready\") return fallback?.({ node, status: resolved.status }) ?? <div data-openeditor-custom-block-error={resolved.status} role=\"status\">Custom block unavailable: {resolved.status}.</div>;\n const adapter = adapters.find((item) => item.block.id === resolved.definition.id);\n if (!adapter) return fallback?.({ node, status: \"missing-viewer\" }) ?? <div data-openeditor-custom-block-error=\"missing-viewer\" role=\"status\">Custom block Viewer unavailable.</div>;\n if (adapter.block !== resolved.definition) return fallback?.({ node, status: \"incompatible-viewer\" }) ?? <div data-openeditor-custom-block-error=\"incompatible-viewer\" role=\"status\">Custom block Viewer unavailable.</div>;\n return <ViewerAdapterIsland adapter={adapter} host={host} resolved={resolved} />;\n};\n"]}
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@openeditor/custom-block",
3
+ "version": "0.0.46",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/BaseBlocks-HQ/openeditor.git",
9
+ "directory": "packages/custom-block"
10
+ },
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md"
19
+ ],
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ },
25
+ "./editor": {
26
+ "types": "./dist/editor.d.ts",
27
+ "import": "./dist/editor.js"
28
+ },
29
+ "./viewer": {
30
+ "types": "./dist/viewer.d.ts",
31
+ "import": "./dist/viewer.js"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
35
+ "dependencies": {
36
+ "@openeditor/core": "0.0.46",
37
+ "@openeditor/extensions": "0.0.46"
38
+ },
39
+ "peerDependencies": {
40
+ "@tiptap/core": ">=3.29.2",
41
+ "@tiptap/react": ">=3.29.2",
42
+ "react": ">=19"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "@tiptap/core": {
46
+ "optional": true
47
+ },
48
+ "@tiptap/react": {
49
+ "optional": true
50
+ }
51
+ }
52
+ }