11import * as z from "zod/v4/core" ;
2- import type { Block , BlockNoteSchema , PartialBlock } from "../blocks/index.js" ;
2+ import type { Block , PartialBlock } from "../blocks/index.js" ;
33import { UniqueID } from "../extensions/UniqueID/UniqueID.js" ;
44import { mapTableCell } from "../util/table.js" ;
55import { UnreachableCaseError } from "../util/typescript.js" ;
@@ -204,7 +204,7 @@ function partialBlockContentToBlockContent(
204204 }
205205}
206206
207- export function partialBlockToFullBlock <
207+ export function partialBlockToBlock <
208208 BSchema extends BlockSchema ,
209209 I extends InlineContentSchema ,
210210 S extends StyleSchema ,
@@ -229,9 +229,8 @@ export function partialBlockToFullBlock<
229229 ) ;
230230
231231 const children =
232- partialBlock . children ?. map ( ( child ) =>
233- partialBlockToFullBlock ( schema , child ) ,
234- ) || [ ] ;
232+ partialBlock . children ?. map ( ( child ) => partialBlockToBlock ( schema , child ) ) ||
233+ [ ] ;
235234
236235 return {
237236 id,
@@ -242,17 +241,15 @@ export function partialBlockToFullBlock<
242241 } as Block < BSchema , I , S > ;
243242}
244243
245- export function partialBlocksToFullBlocks <
244+ export function partialBlocksToBlocks <
246245 BSchema extends BlockSchema ,
247246 I extends InlineContentSchema ,
248247 S extends StyleSchema ,
249248> (
250- // TODO: I think this should be a CustomBlockNoteSchema,
251- // but that breaks docxExporter etc
252- schema : BlockNoteSchema < BSchema , I , S > ,
249+ schema : CustomBlockNoteSchema < BSchema , I , S > ,
253250 partialBlocks : PartialBlock < BSchema , I , S > [ ] ,
254251) : Block < BSchema , I , S > [ ] {
255252 return partialBlocks . map ( ( partialBlock ) =>
256- partialBlockToFullBlock ( schema , partialBlock ) ,
253+ partialBlockToBlock ( schema , partialBlock ) ,
257254 ) ;
258255}
0 commit comments