@blocknote/core 0.11.2 → 0.12.1

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.
Files changed (138) hide show
  1. package/README.md +13 -17
  2. package/dist/blocknote.js +1662 -1447
  3. package/dist/blocknote.js.map +1 -1
  4. package/dist/blocknote.umd.cjs +6 -6
  5. package/dist/blocknote.umd.cjs.map +1 -1
  6. package/dist/style.css +1 -1
  7. package/dist/webpack-stats.json +1 -1
  8. package/package.json +7 -3
  9. package/src/api/blockManipulation/blockManipulation.test.ts +19 -15
  10. package/src/api/blockManipulation/blockManipulation.ts +107 -17
  11. package/src/api/exporters/html/externalHTMLExporter.ts +3 -7
  12. package/src/api/exporters/html/htmlConversion.test.ts +6 -3
  13. package/src/api/exporters/html/internalHTMLSerializer.ts +3 -7
  14. package/src/api/exporters/html/util/sharedHTMLConversion.ts +3 -3
  15. package/src/api/exporters/markdown/markdownExporter.test.ts +7 -3
  16. package/src/api/exporters/markdown/markdownExporter.ts +2 -6
  17. package/src/api/getCurrentBlockContentType.ts +14 -0
  18. package/src/api/nodeConversions/nodeConversions.test.ts +14 -7
  19. package/src/api/nodeConversions/nodeConversions.ts +1 -2
  20. package/src/api/parsers/html/parseHTML.test.ts +5 -1
  21. package/src/api/parsers/html/parseHTML.ts +2 -6
  22. package/src/api/parsers/html/util/nestedLists.ts +11 -1
  23. package/src/api/parsers/markdown/parseMarkdown.test.ts +3 -0
  24. package/src/api/parsers/markdown/parseMarkdown.ts +2 -6
  25. package/src/api/testUtil/cases/customBlocks.ts +18 -16
  26. package/src/api/testUtil/cases/customInlineContent.ts +12 -13
  27. package/src/api/testUtil/cases/customStyles.ts +12 -10
  28. package/src/api/testUtil/index.ts +4 -2
  29. package/src/api/testUtil/partialBlockTestUtil.ts +2 -6
  30. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +50 -21
  31. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +1 -2
  32. package/src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts +8 -1
  33. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +18 -5
  34. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +7 -1
  35. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +18 -5
  36. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +14 -5
  37. package/src/blocks/defaultBlockHelpers.ts +3 -3
  38. package/src/blocks/defaultBlockTypeGuards.ts +84 -0
  39. package/src/blocks/defaultBlocks.ts +29 -3
  40. package/src/editor/Block.css +2 -31
  41. package/src/editor/BlockNoteEditor.ts +223 -267
  42. package/src/editor/BlockNoteExtensions.ts +5 -2
  43. package/src/editor/BlockNoteSchema.ts +98 -0
  44. package/src/editor/BlockNoteTipTapEditor.ts +162 -0
  45. package/src/editor/cursorPositionTypes.ts +2 -6
  46. package/src/editor/editor.css +0 -1
  47. package/src/editor/selectionTypes.ts +2 -6
  48. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +22 -29
  49. package/src/extensions/{ImageToolbar → ImagePanel}/ImageToolbarPlugin.ts +54 -60
  50. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +330 -0
  51. package/src/extensions/Placeholder/PlaceholderExtension.ts +81 -88
  52. package/src/extensions/SideMenu/SideMenuPlugin.ts +55 -56
  53. package/src/extensions/SuggestionMenu/DefaultSuggestionItem.ts +8 -0
  54. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +353 -0
  55. package/src/extensions/{SlashMenu/defaultSlashMenuItems.ts → SuggestionMenu/getDefaultSlashMenuItems.ts} +119 -89
  56. package/src/extensions/TableHandles/TableHandlesPlugin.ts +62 -45
  57. package/src/extensions-shared/UiElementPosition.ts +4 -0
  58. package/src/index.ts +8 -8
  59. package/src/pm-nodes/BlockContainer.ts +5 -5
  60. package/src/schema/blocks/types.ts +15 -15
  61. package/src/schema/inlineContent/createSpec.ts +2 -2
  62. package/src/schema/inlineContent/types.ts +1 -1
  63. package/src/util/browser.ts +6 -4
  64. package/src/util/typescript.ts +7 -4
  65. package/types/src/api/blockManipulation/blockManipulation.d.ts +6 -1
  66. package/types/src/api/exporters/html/externalHTMLExporter.d.ts +2 -1
  67. package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +2 -1
  68. package/types/src/api/exporters/markdown/markdownExporter.d.ts +2 -1
  69. package/types/src/api/getCurrentBlockContentType.d.ts +2 -0
  70. package/types/src/api/nodeConversions/nodeConversions.d.ts +2 -1
  71. package/types/src/api/parsers/html/parseHTML.d.ts +2 -1
  72. package/types/src/api/parsers/markdown/parseMarkdown.d.ts +2 -1
  73. package/types/src/api/testUtil/cases/customBlocks.d.ts +72 -13
  74. package/types/src/api/testUtil/cases/customInlineContent.d.ts +281 -6
  75. package/types/src/api/testUtil/cases/customStyles.d.ts +247 -13
  76. package/types/src/api/testUtil/index.d.ts +4 -2
  77. package/types/src/api/testUtil/partialBlockTestUtil.d.ts +2 -1
  78. package/types/src/blocks/ImageBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +6 -1
  79. package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
  80. package/types/src/blocks/defaultBlockTypeGuards.d.ts +24 -0
  81. package/types/src/blocks/defaultBlocks.d.ts +21 -15
  82. package/types/src/editor/BlockNoteEditor.d.ts +51 -56
  83. package/types/src/editor/BlockNoteExtensions.d.ts +1 -0
  84. package/types/src/editor/BlockNoteSchema.d.ts +34 -0
  85. package/types/src/editor/BlockNoteTipTapEditor.d.ts +28 -0
  86. package/types/src/editor/cursorPositionTypes.d.ts +2 -1
  87. package/types/src/editor/selectionTypes.d.ts +2 -1
  88. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +5 -6
  89. package/types/src/extensions/ImagePanel/ImageToolbarPlugin.d.ts +32 -0
  90. package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +40 -0
  91. package/types/src/extensions/Placeholder/PlaceholderExtension.d.ts +2 -15
  92. package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +8 -7
  93. package/types/src/extensions/SuggestionMenu/DefaultSuggestionItem.d.ts +8 -0
  94. package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +31 -0
  95. package/types/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.d.ts +10 -0
  96. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +7 -7
  97. package/types/src/extensions-shared/UiElementPosition.d.ts +4 -0
  98. package/types/src/index.d.ts +8 -8
  99. package/types/src/pm-nodes/BlockContainer.d.ts +3 -2
  100. package/types/src/pm-nodes/BlockGroup.d.ts +1 -1
  101. package/types/src/schema/blocks/types.d.ts +15 -15
  102. package/types/src/schema/inlineContent/types.d.ts +1 -1
  103. package/types/src/util/browser.d.ts +1 -0
  104. package/types/src/util/typescript.d.ts +1 -0
  105. package/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.ts +0 -335
  106. package/src/extensions/SlashMenu/BaseSlashMenuItem.ts +0 -12
  107. package/src/extensions/SlashMenu/SlashMenuPlugin.ts +0 -53
  108. package/src/extensions-shared/BaseUiElementTypes.ts +0 -8
  109. package/src/extensions-shared/README.md +0 -3
  110. package/src/extensions-shared/suggestion/SuggestionItem.ts +0 -3
  111. package/src/extensions-shared/suggestion/SuggestionPlugin.ts +0 -448
  112. package/types/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.d.ts +0 -38
  113. package/types/src/extensions/ImageToolbar/ImageToolbarPlugin.d.ts +0 -31
  114. package/types/src/extensions/SlashMenu/BaseSlashMenuItem.d.ts +0 -7
  115. package/types/src/extensions/SlashMenu/SlashMenuPlugin.d.ts +0 -13
  116. package/types/src/extensions/SlashMenu/defaultSlashMenuItems.d.ts +0 -3
  117. package/types/src/extensions-shared/BaseUiElementTypes.d.ts +0 -7
  118. package/types/src/extensions-shared/suggestion/SuggestionItem.d.ts +0 -3
  119. package/types/src/extensions-shared/suggestion/SuggestionPlugin.d.ts +0 -36
  120. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-100.woff +0 -0
  121. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-100.woff2 +0 -0
  122. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-200.woff +0 -0
  123. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-200.woff2 +0 -0
  124. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-300.woff +0 -0
  125. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-300.woff2 +0 -0
  126. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-500.woff +0 -0
  127. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-500.woff2 +0 -0
  128. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-600.woff +0 -0
  129. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-600.woff2 +0 -0
  130. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-700.woff +0 -0
  131. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-700.woff2 +0 -0
  132. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-800.woff +0 -0
  133. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-800.woff2 +0 -0
  134. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-900.woff +0 -0
  135. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-900.woff2 +0 -0
  136. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-regular.woff +0 -0
  137. /package/src/{assets → fonts}/inter-v12-latin/inter-v12-latin-regular.woff2 +0 -0
  138. /package/src/{assets/fonts-inter.css → fonts/inter.css} +0 -0
@@ -1,18 +1,18 @@
1
1
  /** Define the main block types **/
2
- import { Extension, Node } from "@tiptap/core";
2
+ import type { Extension, Node } from "@tiptap/core";
3
3
 
4
4
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
5
- import {
5
+ import type {
6
6
  InlineContent,
7
7
  InlineContentSchema,
8
8
  PartialInlineContent,
9
9
  } from "../inlineContent/types";
10
- import { PropSchema, Props } from "../propTypes";
11
- import { StyleSchema } from "../styles/types";
10
+ import type { PropSchema, Props } from "../propTypes";
11
+ import type { StyleSchema } from "../styles/types";
12
12
 
13
13
  export type BlockNoteDOMElement =
14
14
  | "editor"
15
- | "blockContainer"
15
+ | "block"
16
16
  | "blockGroup"
17
17
  | "blockContent"
18
18
  | "inlineContent";
@@ -41,7 +41,7 @@ export type TiptapBlockImplementation<
41
41
  node: Node;
42
42
  toInternalHTML: (
43
43
  block: BlockFromConfigNoChildren<T, I, S> & {
44
- children: Block<B, I, S>[];
44
+ children: BlockNoDefaults<B, I, S>[];
45
45
  },
46
46
  editor: BlockNoteEditor<B, I, S>
47
47
  ) => {
@@ -50,7 +50,7 @@ export type TiptapBlockImplementation<
50
50
  };
51
51
  toExternalHTML: (
52
52
  block: BlockFromConfigNoChildren<T, I, S> & {
53
- children: Block<B, I, S>[];
53
+ children: BlockNoDefaults<B, I, S>[];
54
54
  },
55
55
  editor: BlockNoteEditor<B, I, S>
56
56
  ) => {
@@ -142,7 +142,7 @@ export type BlockFromConfig<
142
142
  I extends InlineContentSchema,
143
143
  S extends StyleSchema
144
144
  > = BlockFromConfigNoChildren<B, I, S> & {
145
- children: Block<BlockSchema, I, S>[];
145
+ children: BlockNoDefaults<BlockSchema, I, S>[];
146
146
  };
147
147
 
148
148
  // Converts each block spec into a Block object without children. We later merge
@@ -158,12 +158,12 @@ type BlocksWithoutChildren<
158
158
 
159
159
  // Converts each block spec into a Block object without children, merges them
160
160
  // into a union type, and adds a children property
161
- export type Block<
161
+ export type BlockNoDefaults<
162
162
  BSchema extends BlockSchema,
163
163
  I extends InlineContentSchema,
164
164
  S extends StyleSchema
165
165
  > = BlocksWithoutChildren<BSchema, I, S>[keyof BSchema] & {
166
- children: Block<BSchema, I, S>[];
166
+ children: BlockNoDefaults<BSchema, I, S>[];
167
167
  };
168
168
 
169
169
  export type SpecificBlock<
@@ -172,7 +172,7 @@ export type SpecificBlock<
172
172
  I extends InlineContentSchema,
173
173
  S extends StyleSchema
174
174
  > = BlocksWithoutChildren<BSchema, I, S>[BType] & {
175
- children: Block<BSchema, I, S>[];
175
+ children: BlockNoDefaults<BSchema, I, S>[];
176
176
  };
177
177
 
178
178
  /** CODE FOR PARTIAL BLOCKS, analogous to above
@@ -219,7 +219,7 @@ type PartialBlocksWithoutChildren<
219
219
  >;
220
220
  };
221
221
 
222
- export type PartialBlock<
222
+ export type PartialBlockNoDefaults<
223
223
  BSchema extends BlockSchema,
224
224
  I extends InlineContentSchema,
225
225
  S extends StyleSchema
@@ -229,7 +229,7 @@ export type PartialBlock<
229
229
  S
230
230
  >[keyof PartialBlocksWithoutChildren<BSchema, I, S>] &
231
231
  Partial<{
232
- children: PartialBlock<BSchema, I, S>[];
232
+ children: PartialBlockNoDefaults<BSchema, I, S>[];
233
233
  }>;
234
234
 
235
235
  export type SpecificPartialBlock<
@@ -238,7 +238,7 @@ export type SpecificPartialBlock<
238
238
  BType extends keyof BSchema,
239
239
  S extends StyleSchema
240
240
  > = PartialBlocksWithoutChildren<BSchema, I, S>[BType] & {
241
- children?: Block<BSchema, I, S>[];
241
+ children?: BlockNoDefaults<BSchema, I, S>[];
242
242
  };
243
243
 
244
244
  export type PartialBlockFromConfig<
@@ -246,7 +246,7 @@ export type PartialBlockFromConfig<
246
246
  I extends InlineContentSchema,
247
247
  S extends StyleSchema
248
248
  > = PartialBlockFromConfigNoChildren<B, I, S> & {
249
- children?: Block<BlockSchema, I, S>[];
249
+ children?: BlockNoDefaults<BlockSchema, I, S>[];
250
250
  };
251
251
 
252
252
  export type BlockIdentifier = { id: string } | string;
@@ -98,8 +98,8 @@ export function createInlineContentSpec<
98
98
  const output = inlineContentImplementation.render(
99
99
  nodeToCustomInlineContent(
100
100
  node,
101
- editor.inlineContentSchema,
102
- editor.styleSchema
101
+ editor.schema.inlineContentSchema,
102
+ editor.schema.styleSchema
103
103
  ) as any as InlineContentFromConfig<T, S> // TODO: fix cast
104
104
  );
105
105
 
@@ -74,7 +74,7 @@ export type PartialCustomInlineContentFromConfig<
74
74
  > = {
75
75
  type: I["type"];
76
76
  props?: Props<I["propSchema"]>;
77
- content: I["content"] extends "styled"
77
+ content?: I["content"] extends "styled"
78
78
  ? StyledText<S>[] | string
79
79
  : I["content"] extends "plain"
80
80
  ? string
@@ -1,8 +1,8 @@
1
1
  export const isAppleOS = () =>
2
- typeof navigator !== "undefined" &&
3
- (/Mac/.test(navigator.platform) ||
4
- (/AppleWebKit/.test(navigator.userAgent) &&
5
- /Mobile\/\w+/.test(navigator.userAgent)));
2
+ typeof navigator !== "undefined" &&
3
+ (/Mac/.test(navigator.platform) ||
4
+ (/AppleWebKit/.test(navigator.userAgent) &&
5
+ /Mobile\/\w+/.test(navigator.userAgent)));
6
6
 
7
7
  export function formatKeyboardShortcut(shortcut: string) {
8
8
  if (isAppleOS()) {
@@ -16,3 +16,5 @@ export function mergeCSSClasses(...classes: string[]) {
16
16
  return classes.filter((c) => c).join(" ");
17
17
  }
18
18
 
19
+ export const isSafari = () =>
20
+ /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
@@ -1,5 +1,8 @@
1
1
  export class UnreachableCaseError extends Error {
2
- constructor(val: never) {
3
- super(`Unreachable case: ${val}`);
4
- }
5
- }
2
+ constructor(val: never) {
3
+ super(`Unreachable case: ${val}`);
4
+ }
5
+ }
6
+
7
+ // TODO: change for built-in version of typescript 5.4 after upgrade
8
+ export type NoInfer<T> = [T][T extends any ? 0 : never];
@@ -1,5 +1,7 @@
1
+ import { Node } from "prosemirror-model";
2
+ import { Block, PartialBlock } from "../../blocks/defaultBlocks";
1
3
  import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
2
- import { Block, BlockIdentifier, BlockSchema, InlineContentSchema, PartialBlock, StyleSchema } from "../../schema";
4
+ import { BlockIdentifier, BlockSchema, InlineContentSchema, StyleSchema } from "../../schema";
3
5
  export declare function insertBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blocksToInsert: PartialBlock<BSchema, I, S>[], referenceBlock: BlockIdentifier, placement: "before" | "after" | "nested" | undefined, editor: BlockNoteEditor<BSchema, I, S>): Block<BSchema, I, S>[];
4
6
  export declare function updateBlock<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blockToUpdate: BlockIdentifier, update: PartialBlock<BSchema, I, S>, editor: BlockNoteEditor<BSchema, I, S>): Block<BSchema, I, S>;
5
7
  export declare function removeBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blocksToRemove: BlockIdentifier[], editor: BlockNoteEditor<BSchema, I, S>): Block<BSchema, I, S>[];
@@ -7,3 +9,6 @@ export declare function replaceBlocks<BSchema extends BlockSchema, I extends Inl
7
9
  insertedBlocks: Block<BSchema, I, S>[];
8
10
  removedBlocks: Block<BSchema, I, S>[];
9
11
  };
12
+ export declare function insertContentAt<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(position: any, nodes: Node[], editor: BlockNoteEditor<BSchema, I, S>, options?: {
13
+ updateSelection: boolean;
14
+ }): boolean;
@@ -1,6 +1,7 @@
1
1
  import { Fragment, Schema } from "prosemirror-model";
2
+ import { PartialBlock } from "../../../blocks/defaultBlocks";
2
3
  import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
3
- import { BlockSchema, InlineContentSchema, PartialBlock, StyleSchema } from "../../../schema";
4
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
4
5
  export interface ExternalHTMLExporter<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> {
5
6
  exportBlocks: (blocks: PartialBlock<BSchema, I, S>[]) => string;
6
7
  exportProseMirrorFragment: (fragment: Fragment) => string;
@@ -1,6 +1,7 @@
1
1
  import { Fragment, Schema } from "prosemirror-model";
2
+ import { PartialBlock } from "../../../blocks/defaultBlocks";
2
3
  import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
3
- import { BlockSchema, InlineContentSchema, PartialBlock, StyleSchema } from "../../../schema";
4
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
4
5
  export interface InternalHTMLSerializer<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema> {
5
6
  serializeProseMirrorFragment: (fragment: Fragment) => string;
6
7
  serializeBlocks: (blocks: PartialBlock<BSchema, I, S>[]) => string;
@@ -1,5 +1,6 @@
1
1
  import { Schema } from "prosemirror-model";
2
+ import { Block } from "../../../blocks/defaultBlocks";
2
3
  import type { BlockNoteEditor } from "../../../editor/BlockNoteEditor";
3
- import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
4
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
4
5
  export declare function cleanHTMLToMarkdown(cleanHTMLString: string): string;
5
6
  export declare function blocksToMarkdown<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(blocks: Block<BSchema, I, S>[], schema: Schema, editor: BlockNoteEditor<BSchema, I, S>): string;
@@ -0,0 +1,2 @@
1
+ import { Editor } from "@tiptap/core";
2
+ export declare const getCurrentBlockContentType: (editor: Editor) => string | undefined;
@@ -1,5 +1,6 @@
1
1
  import { Node, Schema } from "@tiptap/pm/model";
2
- import type { Block, BlockSchema, InlineContent, InlineContentSchema, PartialBlock, PartialInlineContent, PartialTableContent, StyleSchema } from "../../schema";
2
+ import type { BlockSchema, InlineContent, InlineContentSchema, PartialInlineContent, PartialTableContent, StyleSchema } from "../../schema";
3
+ import type { Block, PartialBlock } from "../../blocks/defaultBlocks";
3
4
  /**
4
5
  * converts an array of inline content elements to prosemirror nodes
5
6
  */
@@ -1,3 +1,4 @@
1
1
  import { Schema } from "prosemirror-model";
2
- import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
2
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
3
+ import { Block } from "../../../blocks/defaultBlocks";
3
4
  export declare function HTMLToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(html: string, blockSchema: BSchema, icSchema: I, styleSchema: S, pmSchema: Schema): Promise<Block<BSchema, I, S>[]>;
@@ -1,3 +1,4 @@
1
1
  import { Schema } from "prosemirror-model";
2
- import { Block, BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
2
+ import { Block } from "../../../blocks/defaultBlocks";
3
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../schema";
3
4
  export declare function markdownToBlocks<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(markdown: string, blockSchema: BSchema, icSchema: I, styleSchema: S, pmSchema: Schema): Promise<Block<BSchema, I, S>[]>;
@@ -1,7 +1,7 @@
1
1
  import { EditorTestCases } from "../index";
2
2
  import { DefaultInlineContentSchema, DefaultStyleSchema } from "../../../blocks/defaultBlocks";
3
- import { BlockSchemaFromSpecs } from "../../../schema/blocks/types";
4
- declare const customSpecs: {
3
+ import { BlockNoteSchema } from "../../../editor/BlockNoteSchema";
4
+ declare const schema: BlockNoteSchema<import("../../..").BlockSchemaFromSpecs<{
5
5
  simpleImage: {
6
6
  config: {
7
7
  type: "simpleImage";
@@ -25,7 +25,7 @@ declare const customSpecs: {
25
25
  };
26
26
  content: "none";
27
27
  };
28
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
28
+ implementation: import("../../..").TiptapBlockImplementation<{
29
29
  type: "simpleImage";
30
30
  propSchema: {
31
31
  textAlignment: {
@@ -65,7 +65,7 @@ declare const customSpecs: {
65
65
  };
66
66
  content: "inline";
67
67
  };
68
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
68
+ implementation: import("../../..").TiptapBlockImplementation<{
69
69
  type: "customParagraph";
70
70
  propSchema: {
71
71
  backgroundColor: {
@@ -99,7 +99,7 @@ declare const customSpecs: {
99
99
  };
100
100
  content: "inline";
101
101
  };
102
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
102
+ implementation: import("../../..").TiptapBlockImplementation<{
103
103
  type: "simpleCustomParagraph";
104
104
  propSchema: {
105
105
  backgroundColor: {
@@ -133,7 +133,7 @@ declare const customSpecs: {
133
133
  };
134
134
  };
135
135
  };
136
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
136
+ implementation: import("../../..").TiptapBlockImplementation<{
137
137
  type: "paragraph";
138
138
  content: "inline";
139
139
  propSchema: {
@@ -171,7 +171,7 @@ declare const customSpecs: {
171
171
  };
172
172
  };
173
173
  };
174
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
174
+ implementation: import("../../..").TiptapBlockImplementation<{
175
175
  type: "heading";
176
176
  content: "inline";
177
177
  propSchema: {
@@ -209,7 +209,7 @@ declare const customSpecs: {
209
209
  };
210
210
  };
211
211
  };
212
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
212
+ implementation: import("../../..").TiptapBlockImplementation<{
213
213
  type: "bulletListItem";
214
214
  content: "inline";
215
215
  propSchema: {
@@ -243,7 +243,7 @@ declare const customSpecs: {
243
243
  };
244
244
  };
245
245
  };
246
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
246
+ implementation: import("../../..").TiptapBlockImplementation<{
247
247
  type: "numberedListItem";
248
248
  content: "inline";
249
249
  propSchema: {
@@ -283,7 +283,7 @@ declare const customSpecs: {
283
283
  };
284
284
  content: "none";
285
285
  };
286
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
286
+ implementation: import("../../..").TiptapBlockImplementation<{
287
287
  type: "image";
288
288
  propSchema: {
289
289
  textAlignment: {
@@ -323,7 +323,7 @@ declare const customSpecs: {
323
323
  };
324
324
  };
325
325
  };
326
- implementation: import("../../../schema/blocks/types").TiptapBlockImplementation<{
326
+ implementation: import("../../..").TiptapBlockImplementation<{
327
327
  type: "table";
328
328
  content: "table";
329
329
  propSchema: {
@@ -340,6 +340,65 @@ declare const customSpecs: {
340
340
  };
341
341
  }, any, import("../../..").InlineContentSchema, import("../../..").StyleSchema>;
342
342
  };
343
- };
344
- export declare const customBlocksTestCases: EditorTestCases<BlockSchemaFromSpecs<typeof customSpecs>, DefaultInlineContentSchema, DefaultStyleSchema>;
343
+ }>, import("../../..").InlineContentSchemaFromSpecs<{
344
+ text: {
345
+ config: "text";
346
+ implementation: any;
347
+ };
348
+ link: {
349
+ config: "link";
350
+ implementation: any;
351
+ };
352
+ }>, import("../../..").StyleSchemaFromSpecs<{
353
+ bold: {
354
+ config: {
355
+ type: string;
356
+ propSchema: "boolean";
357
+ };
358
+ implementation: import("../../..").StyleImplementation;
359
+ };
360
+ italic: {
361
+ config: {
362
+ type: string;
363
+ propSchema: "boolean";
364
+ };
365
+ implementation: import("../../..").StyleImplementation;
366
+ };
367
+ underline: {
368
+ config: {
369
+ type: string;
370
+ propSchema: "boolean";
371
+ };
372
+ implementation: import("../../..").StyleImplementation;
373
+ };
374
+ strike: {
375
+ config: {
376
+ type: string;
377
+ propSchema: "boolean";
378
+ };
379
+ implementation: import("../../..").StyleImplementation;
380
+ };
381
+ code: {
382
+ config: {
383
+ type: string;
384
+ propSchema: "boolean";
385
+ };
386
+ implementation: import("../../..").StyleImplementation;
387
+ };
388
+ textColor: {
389
+ config: {
390
+ type: string;
391
+ propSchema: "string";
392
+ };
393
+ implementation: import("../../..").StyleImplementation;
394
+ };
395
+ backgroundColor: {
396
+ config: {
397
+ type: string;
398
+ propSchema: "string";
399
+ };
400
+ implementation: import("../../..").StyleImplementation;
401
+ };
402
+ }>>;
403
+ export declare const customBlocksTestCases: EditorTestCases<typeof schema.blockSchema, DefaultInlineContentSchema, DefaultStyleSchema>;
345
404
  export {};