Skip to content

Commit 1ddef1b

Browse files
committed
build: get things building again
1 parent e41c137 commit 1ddef1b

File tree

6 files changed

+34
-14
lines changed

6 files changed

+34
-14
lines changed

examples/03-ui-components/11-uppy-file-panel/src/FileReplaceButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const FileReplaceButton = () => {
4141

4242
if (
4343
block === undefined ||
44-
!blockHasType(block, editor, { url: "string" }) ||
44+
!blockHasType(block, editor, "file", { url: "string" }) ||
4545
!editor.isEditable
4646
) {
4747
return null;

examples/vanilla-js/react-vanilla-custom-blocks/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ const bracketsParagraphBlock = createBlockSpec(
181181
const schema = BlockNoteSchema.create({
182182
blockSpecs: {
183183
...defaultBlockSpecs,
184-
alert: alertBlock,
185-
bracketsParagraph: bracketsParagraphBlock,
186-
simpleImage: simpleImageBlock,
184+
alert: alertBlock(),
185+
bracketsParagraph: bracketsParagraphBlock(),
186+
simpleImage: simpleImageBlock(),
187187
},
188188
});
189189

packages/xl-ai/src/api/schema/schemaToJSONSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function schemaOps(
256256
removeFileBlocks() {
257257
clone.blockSchema = Object.fromEntries(
258258
Object.entries(clone.blockSchema).filter(
259-
([_key, val]) => !val.isFileBlock,
259+
([_key, val]) => !val.meta?.fileBlockAccept,
260260
),
261261
);
262262
return this;

packages/xl-docx-exporter/src/docx/defaultSchema/blocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export const docxBlockMappingForDefaultSchema: BlockMapping<
129129
return new Paragraph({
130130
...blockPropsToStyles(block.props, exporter.options.colors),
131131
children: exporter.transformInlineContent(block.content),
132-
heading: `Heading${block.props.level}`,
132+
heading: `Heading${block.props.level as 1 | 2 | 3 | 4 | 5 | 6}`,
133133
});
134134
},
135135
quote: (block, exporter) => {

packages/xl-docx-exporter/src/docx/docxExporter.test.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { BlockNoteSchema, defaultBlockSpecs, PageBreak } from "@blocknote/core";
1+
import {
2+
BlockNoteSchema,
3+
defaultBlockSpecs,
4+
createPageBreakBlockSpec,
5+
} from "@blocknote/core";
26
import { testDocument } from "@shared/testDocument.js";
37
import { BlobReader, Entry, TextWriter, ZipReader } from "@zip.js/zip.js";
48
import { Packer, Paragraph, TextRun } from "docx";
@@ -24,7 +28,10 @@ describe("exporter", () => {
2428
it("should export a document", { timeout: 10000 }, async () => {
2529
const exporter = new DOCXExporter(
2630
BlockNoteSchema.create({
27-
blockSpecs: { ...defaultBlockSpecs, pageBreak: PageBreak },
31+
blockSpecs: {
32+
...defaultBlockSpecs,
33+
pageBreak: createPageBreakBlockSpec(),
34+
},
2835
}),
2936
docxDefaultSchemaMappings,
3037
);
@@ -54,7 +61,10 @@ describe("exporter", () => {
5461
async () => {
5562
const exporter = new DOCXExporter(
5663
BlockNoteSchema.create({
57-
blockSpecs: { ...defaultBlockSpecs, pageBreak: PageBreak },
64+
blockSpecs: {
65+
...defaultBlockSpecs,
66+
pageBreak: createPageBreakBlockSpec(),
67+
},
5868
}),
5969
docxDefaultSchemaMappings,
6070
);
@@ -124,7 +134,7 @@ describe("exporter", () => {
124134
const schema = BlockNoteSchema.create({
125135
blockSpecs: {
126136
...defaultBlockSpecs,
127-
pageBreak: PageBreak,
137+
pageBreak: createPageBreakBlockSpec(),
128138
column: ColumnBlock,
129139
columnList: ColumnListBlock,
130140
},

packages/xl-odt-exporter/src/odt/odtExporter.test.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { BlockNoteSchema, defaultBlockSpecs, PageBreak } from "@blocknote/core";
1+
import {
2+
BlockNoteSchema,
3+
createPageBreakBlockSpec,
4+
defaultBlockSpecs,
5+
} from "@blocknote/core";
26
import { testDocument } from "@shared/testDocument.js";
37
import { BlobReader, TextWriter, ZipReader } from "@zip.js/zip.js";
48
import { beforeAll, describe, expect, it } from "vitest";
@@ -17,7 +21,10 @@ describe("exporter", () => {
1721
it("should export a document", { timeout: 10000 }, async () => {
1822
const exporter = new ODTExporter(
1923
BlockNoteSchema.create({
20-
blockSpecs: { ...defaultBlockSpecs, pageBreak: PageBreak },
24+
blockSpecs: {
25+
...defaultBlockSpecs,
26+
pageBreak: createPageBreakBlockSpec(),
27+
},
2128
}),
2229
odtDefaultSchemaMappings,
2330
);
@@ -34,7 +41,10 @@ describe("exporter", () => {
3441
async () => {
3542
const exporter = new ODTExporter(
3643
BlockNoteSchema.create({
37-
blockSpecs: { ...defaultBlockSpecs, pageBreak: PageBreak },
44+
blockSpecs: {
45+
...defaultBlockSpecs,
46+
pageBreak: createPageBreakBlockSpec(),
47+
},
3848
}),
3949
odtDefaultSchemaMappings,
4050
);
@@ -61,7 +71,7 @@ describe("exporter", () => {
6171
const schema = BlockNoteSchema.create({
6272
blockSpecs: {
6373
...defaultBlockSpecs,
64-
pageBreak: PageBreak,
74+
pageBreak: createPageBreakBlockSpec(),
6575
column: ColumnBlock,
6676
columnList: ColumnListBlock,
6777
},

0 commit comments

Comments
 (0)