Skip to content

Commit 7b44f98

Browse files
committed
fix build
1 parent bbe2299 commit 7b44f98

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

packages/core/src/api/clipboard/toClipboard/copyExtension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function fragmentToExternalHTML<
8181

8282
// Wrap in table to ensure correct parsing by spreadsheet applications
8383
externalHTML = `<table>${externalHTMLExporter.exportInlineContent(
84-
ic as any,
84+
ic,
8585
{},
8686
)}</table>`;
8787
} else if (isWithinBlockContent) {

packages/core/src/api/exporters/html/externalHTMLExporter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
InlineContent,
88
InlineContentSchema,
99
StyleSchema,
10+
TableContent,
1011
} from "../../../schema/index.js";
1112
import {
1213
serializeBlocksExternalHTML,
@@ -57,7 +58,7 @@ export const createExternalHTMLExporter = <
5758
},
5859

5960
exportInlineContent: (
60-
inlineContent: InlineContent<I, S>[],
61+
inlineContent: InlineContent<I, S>[] | TableContent<I, S>,
6162
options: { document?: Document },
6263
) => {
6364
const domFragment = serializeInlineContentExternalHTML(

packages/core/src/api/exporters/html/util/serializeBlocksExternalHTML.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
44
import {
55
BlockImplementation,
66
BlockSchema,
7+
InlineContent,
78
InlineContentSchema,
89
StyleSchema,
10+
TableContent,
911
} from "../../../../schema/index.js";
1012
import { UnreachableCaseError } from "../../../../util/typescript.js";
1113
import {
@@ -34,7 +36,7 @@ export function serializeInlineContentExternalHTML<
3436
S extends StyleSchema,
3537
>(
3638
editor: BlockNoteEditor<BSchema, I, S>,
37-
blockContent: Block<BSchema, I, S>["content"],
39+
blockContent: InlineContent<I, S>[] | TableContent<I, S>,
3840
serializer: DOMSerializer,
3941
options?: { document?: Document },
4042
) {
@@ -43,8 +45,6 @@ export function serializeInlineContentExternalHTML<
4345
// TODO: reuse function from nodeconversions?
4446
if (!blockContent) {
4547
throw new Error("blockContent is required");
46-
} else if (typeof blockContent === "string") {
47-
nodes = inlineContentToNodes([blockContent], editor.pmSchema);
4848
} else if (Array.isArray(blockContent)) {
4949
nodes = inlineContentToNodes(blockContent, editor.pmSchema);
5050
} else if (blockContent.type === "tableContent") {

packages/core/src/api/exporters/html/util/serializeBlocksInternalHTML.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import { Block } from "../../../../blocks/defaultBlocks.js";
44
import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
55
import {
66
BlockSchema,
7+
InlineContent,
78
InlineContentSchema,
89
StyleSchema,
10+
TableContent,
911
} from "../../../../schema/index.js";
1012
import { UnreachableCaseError } from "../../../../util/typescript.js";
1113
import {
@@ -20,7 +22,7 @@ export function serializeInlineContentInternalHTML<
2022
S extends StyleSchema,
2123
>(
2224
editor: BlockNoteEditor<BSchema, I, S>,
23-
blockContent: Block<BSchema, I, S>["content"],
25+
blockContent: InlineContent<I, S>[] | TableContent<I, S>,
2426
serializer: DOMSerializer,
2527
blockType?: string,
2628
options?: { document?: Document },
@@ -30,8 +32,6 @@ export function serializeInlineContentInternalHTML<
3032
// TODO: reuse function from nodeconversions?
3133
if (!blockContent) {
3234
throw new Error("blockContent is required");
33-
} else if (typeof blockContent === "string") {
34-
nodes = inlineContentToNodes([blockContent], editor.pmSchema, blockType);
3535
} else if (Array.isArray(blockContent)) {
3636
nodes = inlineContentToNodes(blockContent, editor.pmSchema, blockType);
3737
} else if (blockContent.type === "tableContent") {
@@ -151,7 +151,7 @@ function serializeBlock<
151151
if (ret.contentDOM && block.content) {
152152
const ic = serializeInlineContentInternalHTML(
153153
editor,
154-
block.content, // TODO
154+
block.content,
155155
serializer,
156156
block.type,
157157
options,

0 commit comments

Comments
 (0)