@blocknote/core 0.38.0 → 0.39.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 (228) hide show
  1. package/dist/BlockNoteSchema-DmZ6UQfY.cjs +11 -0
  2. package/dist/BlockNoteSchema-DmZ6UQfY.cjs.map +1 -0
  3. package/dist/BlockNoteSchema-oR047ACf.js +4275 -0
  4. package/dist/BlockNoteSchema-oR047ACf.js.map +1 -0
  5. package/dist/blocknote.cjs +4 -12
  6. package/dist/blocknote.cjs.map +1 -1
  7. package/dist/blocknote.js +3401 -7305
  8. package/dist/blocknote.js.map +1 -1
  9. package/dist/blocks.cjs +2 -0
  10. package/dist/blocks.cjs.map +1 -0
  11. package/dist/blocks.js +71 -0
  12. package/dist/blocks.js.map +1 -0
  13. package/dist/style.css +1 -1
  14. package/dist/tsconfig.tsbuildinfo +1 -1
  15. package/dist/webpack-stats.json +1 -1
  16. package/package.json +19 -16
  17. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +1 -1
  18. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +2 -2
  19. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +34 -25
  20. package/src/api/blockManipulation/setupTestEnv.ts +0 -1
  21. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +6 -10
  22. package/src/api/clipboard/fromClipboard/pasteExtension.ts +1 -1
  23. package/src/api/clipboard/toClipboard/copyExtension.ts +1 -1
  24. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +128 -28
  25. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +101 -41
  26. package/src/api/pmUtil.ts +1 -1
  27. package/src/api/positionMapping.test.ts +58 -15
  28. package/src/api/positionMapping.ts +2 -4
  29. package/src/blocks/Audio/block.ts +174 -0
  30. package/src/blocks/BlockNoteSchema.ts +59 -0
  31. package/src/blocks/Code/block.ts +303 -0
  32. package/src/blocks/Code/shiki.ts +73 -0
  33. package/src/blocks/File/block.ts +98 -0
  34. package/src/blocks/{FileBlockContent → File}/helpers/render/createAddFileButton.ts +5 -2
  35. package/src/blocks/{FileBlockContent → File}/helpers/render/createFileBlockWrapper.ts +15 -6
  36. package/src/blocks/{FileBlockContent → File}/helpers/render/createFileNameWithIcon.ts +15 -2
  37. package/src/blocks/{FileBlockContent → File}/helpers/render/createResizableFileBlockWrapper.ts +21 -2
  38. package/src/blocks/Heading/block.ts +138 -0
  39. package/src/blocks/Image/block.ts +190 -0
  40. package/src/blocks/ListItem/BulletListItem/block.ts +116 -0
  41. package/src/blocks/ListItem/CheckListItem/block.ts +175 -0
  42. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +173 -0
  43. package/src/blocks/ListItem/NumberedListItem/block.ts +133 -0
  44. package/src/blocks/ListItem/ToggleListItem/block.ts +78 -0
  45. package/src/blocks/PageBreak/block.ts +72 -0
  46. package/src/blocks/{PageBreakBlockContent → PageBreak}/getPageBreakSlashMenuItems.ts +9 -7
  47. package/src/blocks/Paragraph/block.ts +80 -0
  48. package/src/blocks/Quote/block.ts +90 -0
  49. package/src/blocks/{TableBlockContent/TableBlockContent.ts → Table/block.ts} +169 -51
  50. package/src/blocks/ToggleWrapper/createToggleWrapper.ts +1 -1
  51. package/src/blocks/Video/block.ts +143 -0
  52. package/src/blocks/defaultBlockHelpers.ts +2 -2
  53. package/src/blocks/defaultBlockTypeGuards.ts +143 -174
  54. package/src/blocks/defaultBlocks.ts +107 -35
  55. package/src/blocks/defaultProps.ts +145 -4
  56. package/src/blocks/index.ts +26 -0
  57. package/src/blocks/utils/listItemEnterHandler.ts +42 -0
  58. package/src/editor/Block.css +54 -18
  59. package/src/editor/BlockNoteEditor.ts +256 -211
  60. package/src/editor/BlockNoteExtension.ts +92 -0
  61. package/src/editor/BlockNoteExtensions.ts +18 -17
  62. package/src/editor/defaultColors.ts +2 -2
  63. package/src/exporter/Exporter.ts +1 -1
  64. package/src/exporter/mapping.ts +1 -1
  65. package/src/extensions/BackgroundColor/BackgroundColorExtension.ts +3 -20
  66. package/src/extensions/BackgroundColor/BackgroundColorMark.ts +6 -8
  67. package/src/extensions/BlockChange/BlockChangePlugin.ts +2 -1
  68. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +2 -2
  69. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +2 -2
  70. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -1
  71. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -1
  72. package/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts +52 -0
  73. package/src/extensions/Collaboration/schemaMigration/migrationRules/index.ts +4 -0
  74. package/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.ts +4 -0
  75. package/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts +78 -0
  76. package/src/extensions/Comments/CommentsPlugin.ts +1 -1
  77. package/src/extensions/FilePanel/FilePanelPlugin.ts +5 -10
  78. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +1 -1
  79. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +4 -3
  80. package/src/extensions/Placeholder/PlaceholderPlugin.ts +6 -6
  81. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +1 -23
  82. package/src/extensions/SideMenu/SideMenuPlugin.ts +1 -3
  83. package/src/extensions/SideMenu/dragging.ts +2 -2
  84. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +4 -7
  85. package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +6 -2
  86. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +24 -17
  87. package/src/extensions/TableHandles/TableHandlesPlugin.ts +8 -8
  88. package/src/extensions/TextAlignment/TextAlignmentExtension.ts +5 -11
  89. package/src/extensions/TextColor/TextColorExtension.ts +3 -17
  90. package/src/extensions/TextColor/TextColorMark.ts +4 -9
  91. package/src/extensions/UniqueID/UniqueID.ts +6 -13
  92. package/src/index.ts +2 -28
  93. package/src/schema/blocks/createSpec.ts +342 -169
  94. package/src/schema/blocks/internal.ts +77 -138
  95. package/src/schema/blocks/types.ts +264 -94
  96. package/src/schema/index.ts +1 -0
  97. package/src/schema/inlineContent/createSpec.ts +99 -21
  98. package/src/schema/inlineContent/internal.ts +16 -7
  99. package/src/schema/inlineContent/types.ts +24 -2
  100. package/src/schema/propTypes.ts +15 -9
  101. package/src/schema/schema.ts +209 -0
  102. package/src/schema/styles/createSpec.ts +79 -31
  103. package/src/schema/styles/internal.ts +61 -2
  104. package/src/schema/styles/types.ts +17 -3
  105. package/src/util/topo-sort.test.ts +125 -0
  106. package/src/util/topo-sort.ts +160 -0
  107. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.d.ts +2 -1
  108. package/types/src/api/blockManipulation/selections/selection.d.ts +1 -1
  109. package/types/src/api/blockManipulation/setupTestEnv.d.ts +29 -543
  110. package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +1 -1
  111. package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +1 -1
  112. package/types/src/api/pmUtil.d.ts +1 -1
  113. package/types/src/blocks/Audio/block.d.ts +58 -0
  114. package/types/src/blocks/BlockNoteSchema.d.ts +18 -0
  115. package/types/src/blocks/{CodeBlockContent/CodeBlockContent.d.ts → Code/block.d.ts} +25 -26
  116. package/types/src/blocks/Code/shiki.d.ts +4 -0
  117. package/types/src/blocks/File/block.d.ts +37 -0
  118. package/types/src/blocks/File/helpers/render/createAddFileButton.d.ts +6 -0
  119. package/types/src/blocks/File/helpers/render/createFileBlockWrapper.d.ts +25 -0
  120. package/types/src/blocks/{FileBlockContent → File}/helpers/render/createFileNameWithIcon.d.ts +6 -2
  121. package/types/src/blocks/File/helpers/render/createResizableFileBlockWrapper.d.ts +31 -0
  122. package/types/src/blocks/Heading/block.d.ts +71 -0
  123. package/types/src/blocks/Image/block.d.ts +102 -0
  124. package/types/src/blocks/ListItem/BulletListItem/block.d.ts +25 -0
  125. package/types/src/blocks/ListItem/CheckListItem/block.d.ts +33 -0
  126. package/types/src/blocks/ListItem/NumberedListItem/IndexingPlugin.d.ts +8 -0
  127. package/types/src/blocks/ListItem/NumberedListItem/block.d.ts +33 -0
  128. package/types/src/blocks/ListItem/ToggleListItem/block.d.ts +25 -0
  129. package/types/src/blocks/PageBreak/block.d.ts +11 -0
  130. package/types/src/blocks/{PageBreakBlockContent → PageBreak}/getPageBreakSlashMenuItems.d.ts +4 -2
  131. package/types/src/blocks/Paragraph/block.d.ts +25 -0
  132. package/types/src/blocks/Quote/block.d.ts +17 -0
  133. package/types/src/blocks/Table/block.d.ts +21 -0
  134. package/types/src/blocks/Video/block.d.ts +67 -0
  135. package/types/src/blocks/defaultBlockHelpers.d.ts +1 -1
  136. package/types/src/blocks/defaultBlockTypeGuards.d.ts +15 -36
  137. package/types/src/blocks/defaultBlocks.d.ts +221 -1060
  138. package/types/src/blocks/defaultProps.d.ts +17 -1
  139. package/types/src/blocks/index.d.ts +24 -0
  140. package/types/src/blocks/utils/listItemEnterHandler.d.ts +2 -0
  141. package/types/src/editor/BlockNoteEditor.d.ts +36 -67
  142. package/types/src/editor/BlockNoteExtension.d.ts +67 -0
  143. package/types/src/editor/BlockNoteExtensions.d.ts +1 -1
  144. package/types/src/editor/defaultColors.d.ts +8 -76
  145. package/types/src/exporter/Exporter.d.ts +1 -1
  146. package/types/src/exporter/mapping.d.ts +1 -1
  147. package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +4 -1
  148. package/types/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.d.ts +7 -0
  149. package/types/src/extensions/Collaboration/schemaMigration/migrationRules/index.d.ts +3 -0
  150. package/types/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.d.ts +3 -0
  151. package/types/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.d.ts +2 -0
  152. package/types/src/extensions/Comments/CommentsPlugin.d.ts +1 -1
  153. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +4 -4
  154. package/types/src/extensions/TextColor/TextColorMark.d.ts +4 -1
  155. package/types/src/index.d.ts +2 -25
  156. package/types/src/schema/blocks/createSpec.d.ts +16 -36
  157. package/types/src/schema/blocks/internal.d.ts +11 -33
  158. package/types/src/schema/blocks/types.d.ts +181 -57
  159. package/types/src/schema/index.d.ts +1 -0
  160. package/types/src/schema/inlineContent/createSpec.d.ts +36 -2
  161. package/types/src/schema/inlineContent/internal.d.ts +7 -15
  162. package/types/src/schema/inlineContent/types.d.ts +15 -1
  163. package/types/src/schema/propTypes.d.ts +4 -4
  164. package/types/src/schema/schema.d.ts +40 -0
  165. package/types/src/schema/styles/createSpec.d.ts +6 -4
  166. package/types/src/schema/styles/internal.d.ts +6 -3
  167. package/types/src/schema/styles/types.d.ts +11 -2
  168. package/types/src/util/topo-sort.d.ts +18 -0
  169. package/types/src/util/topo-sort.test.d.ts +1 -0
  170. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +0 -144
  171. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +0 -445
  172. package/src/blocks/FileBlockContent/FileBlockContent.ts +0 -100
  173. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +0 -159
  174. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +0 -159
  175. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +0 -134
  176. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +0 -299
  177. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +0 -86
  178. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +0 -172
  179. package/src/blocks/ListItemBlockContent/ToggleListItemBlockContent/ToggleListItemBlockContent.ts +0 -104
  180. package/src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts +0 -49
  181. package/src/blocks/PageBreakBlockContent/schema.ts +0 -40
  182. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +0 -78
  183. package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +0 -121
  184. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +0 -158
  185. package/src/editor/BlockNoteSchema.ts +0 -107
  186. package/src/editor/BlockNoteTipTapEditor.ts +0 -335
  187. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +0 -99
  188. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +0 -90
  189. package/types/src/blocks/FileBlockContent/helpers/render/createAddFileButton.d.ts +0 -6
  190. package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +0 -9
  191. package/types/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.d.ts +0 -9
  192. package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +0 -67
  193. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +0 -131
  194. package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +0 -46
  195. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +0 -55
  196. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.d.ts +0 -2
  197. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +0 -58
  198. package/types/src/blocks/ListItemBlockContent/ToggleListItemBlockContent/ToggleListItemBlockContent.d.ts +0 -46
  199. package/types/src/blocks/PageBreakBlockContent/PageBreakBlockContent.d.ts +0 -31
  200. package/types/src/blocks/PageBreakBlockContent/schema.d.ts +0 -86
  201. package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +0 -52
  202. package/types/src/blocks/QuoteBlockContent/QuoteBlockContent.d.ts +0 -52
  203. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +0 -39
  204. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +0 -131
  205. package/types/src/editor/BlockNoteSchema.d.ts +0 -34
  206. package/types/src/editor/BlockNoteTipTapEditor.d.ts +0 -43
  207. /package/src/blocks/{AudioBlockContent → Audio}/parseAudioElement.ts +0 -0
  208. /package/src/blocks/{FileBlockContent → File}/helpers/parse/parseEmbedElement.ts +0 -0
  209. /package/src/blocks/{FileBlockContent → File}/helpers/parse/parseFigureElement.ts +0 -0
  210. /package/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createFigureWithCaption.ts +0 -0
  211. /package/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createLinkWithCaption.ts +0 -0
  212. /package/src/blocks/{FileBlockContent → File/helpers}/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
  213. /package/src/blocks/{ImageBlockContent → Image}/parseImageElement.ts +0 -0
  214. /package/src/blocks/{ListItemBlockContent → ListItem}/ListItemKeyboardShortcuts.ts +0 -0
  215. /package/src/blocks/{ListItemBlockContent → ListItem}/getListItemContent.ts +0 -0
  216. /package/src/blocks/{TableBlockContent → Table}/TableExtension.ts +0 -0
  217. /package/src/blocks/{VideoBlockContent → Video}/parseVideoElement.ts +0 -0
  218. /package/types/src/blocks/{AudioBlockContent → Audio}/parseAudioElement.d.ts +0 -0
  219. /package/types/src/blocks/{FileBlockContent → File}/helpers/parse/parseEmbedElement.d.ts +0 -0
  220. /package/types/src/blocks/{FileBlockContent → File}/helpers/parse/parseFigureElement.d.ts +0 -0
  221. /package/types/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createFigureWithCaption.d.ts +0 -0
  222. /package/types/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createLinkWithCaption.d.ts +0 -0
  223. /package/types/src/blocks/{FileBlockContent → File/helpers}/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
  224. /package/types/src/blocks/{ImageBlockContent → Image}/parseImageElement.d.ts +0 -0
  225. /package/types/src/blocks/{ListItemBlockContent → ListItem}/ListItemKeyboardShortcuts.d.ts +0 -0
  226. /package/types/src/blocks/{ListItemBlockContent → ListItem}/getListItemContent.d.ts +0 -0
  227. /package/types/src/blocks/{TableBlockContent → Table}/TableExtension.d.ts +0 -0
  228. /package/types/src/blocks/{VideoBlockContent → Video}/parseVideoElement.d.ts +0 -0
@@ -0,0 +1,18 @@
1
+ import { BlockSchema, BlockSchemaFromSpecs, BlockSpecs, CustomBlockNoteSchema, InlineContentSchema, InlineContentSchemaFromSpecs, InlineContentSpecs, StyleSchema, StyleSchemaFromSpecs, StyleSpecs } from "../schema/index.js";
2
+ import { defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "./defaultBlocks.js";
3
+ export declare class BlockNoteSchema<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema> extends CustomBlockNoteSchema<BSchema, ISchema, SSchema> {
4
+ static create<BSpecs extends BlockSpecs | undefined = undefined, ISpecs extends InlineContentSpecs | undefined = undefined, SSpecs extends StyleSpecs | undefined = undefined>(options?: {
5
+ /**
6
+ * A list of custom block types that should be available in the editor.
7
+ */
8
+ blockSpecs?: BSpecs;
9
+ /**
10
+ * A list of custom InlineContent types that should be available in the editor.
11
+ */
12
+ inlineContentSpecs?: ISpecs;
13
+ /**
14
+ * A list of custom Styles that should be available in the editor.
15
+ */
16
+ styleSpecs?: SSpecs;
17
+ }): BlockNoteSchema<BSpecs extends undefined ? BlockSchemaFromSpecs<typeof defaultBlockSpecs> : BlockSchemaFromSpecs<NonNullable<BSpecs>>, ISpecs extends undefined ? InlineContentSchemaFromSpecs<typeof defaultInlineContentSpecs> : InlineContentSchemaFromSpecs<NonNullable<ISpecs>>, SSpecs extends undefined ? StyleSchemaFromSpecs<typeof defaultStyleSpecs> : StyleSchemaFromSpecs<NonNullable<SSpecs>>>;
18
+ }
@@ -27,7 +27,7 @@ export type CodeBlockOptions = {
27
27
  * },
28
28
  * }
29
29
  */
30
- supportedLanguages: Record<string, {
30
+ supportedLanguages?: Record<string, {
31
31
  /**
32
32
  * The display name of the language.
33
33
  */
@@ -42,30 +42,29 @@ export type CodeBlockOptions = {
42
42
  */
43
43
  createHighlighter?: () => Promise<HighlighterGeneric<any, any>>;
44
44
  };
45
- export declare const shikiParserSymbol: unique symbol;
46
- export declare const shikiHighlighterPromiseSymbol: unique symbol;
47
- export declare const defaultCodeBlockPropSchema: {
48
- language: {
49
- default: string;
45
+ export type CodeBlockConfig = ReturnType<typeof createCodeBlockConfig>;
46
+ export declare const createCodeBlockConfig: (options: CodeBlockOptions) => import("../../index.js").BlockConfig<"codeBlock", {
47
+ readonly language: {
48
+ readonly default: string;
50
49
  };
51
- };
52
- export declare const CodeBlock: {
53
- config: {
54
- type: "codeBlock";
55
- content: "inline";
56
- propSchema: {
57
- language: {
58
- default: string;
59
- };
60
- };
50
+ }, "inline">;
51
+ export declare const createCodeBlockSpec: (options?: Partial<{
52
+ indentLineWithTab: boolean;
53
+ defaultLanguage: string;
54
+ supportedLanguages: Record<string, {
55
+ /**
56
+ * The display name of the language.
57
+ */
58
+ name: string;
59
+ /**
60
+ * Aliases for this language.
61
+ */
62
+ aliases?: string[];
63
+ }>;
64
+ createHighlighter: () => Promise<HighlighterGeneric<any, any>>;
65
+ }> | undefined) => import("../../index.js").BlockSpec<"codeBlock", {
66
+ readonly language: {
67
+ readonly default: string;
61
68
  };
62
- implementation: import("../../index.js").TiptapBlockImplementation<{
63
- type: "codeBlock";
64
- content: "inline";
65
- propSchema: {
66
- language: {
67
- default: string;
68
- };
69
- };
70
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
71
- };
69
+ }, "inline">;
70
+ export declare function getLanguageId(options: CodeBlockOptions, languageName: string): string | undefined;
@@ -0,0 +1,4 @@
1
+ import { CodeBlockOptions } from "./block.js";
2
+ export declare const shikiParserSymbol: unique symbol;
3
+ export declare const shikiHighlighterPromiseSymbol: unique symbol;
4
+ export declare function lazyShikiPlugin(options: CodeBlockOptions): import("prosemirror-state").Plugin<import("prosemirror-highlight").HighlightPluginState>;
@@ -0,0 +1,37 @@
1
+ export type FileBlockConfig = ReturnType<typeof createFileBlockConfig>;
2
+ export declare const createFileBlockConfig: () => import("../../index.js").BlockConfig<"file", {
3
+ readonly backgroundColor: {
4
+ default: "default";
5
+ };
6
+ readonly name: {
7
+ readonly default: "";
8
+ };
9
+ readonly url: {
10
+ readonly default: "";
11
+ };
12
+ readonly caption: {
13
+ readonly default: "";
14
+ };
15
+ }, "none">;
16
+ export declare const fileParse: () => (element: HTMLElement) => {
17
+ backgroundColor: string | undefined;
18
+ url: string | undefined;
19
+ } | {
20
+ backgroundColor: string | undefined;
21
+ caption: string | undefined;
22
+ url: string | undefined;
23
+ } | undefined;
24
+ export declare const createFileBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../index.js").BlockSpec<"file", {
25
+ readonly backgroundColor: {
26
+ default: "default";
27
+ };
28
+ readonly name: {
29
+ readonly default: "";
30
+ };
31
+ readonly url: {
32
+ readonly default: "";
33
+ };
34
+ readonly caption: {
35
+ readonly default: "";
36
+ };
37
+ }, "none">;
@@ -0,0 +1,6 @@
1
+ import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
2
+ import { BlockConfig, BlockFromConfigNoChildren } from "../../../../schema/index.js";
3
+ export declare const createAddFileButton: (block: BlockFromConfigNoChildren<BlockConfig<string, any, "none">, any, any>, editor: BlockNoteEditor<any, any, any>, buttonIcon?: HTMLElement) => {
4
+ dom: HTMLDivElement;
5
+ destroy: () => void;
6
+ };
@@ -0,0 +1,25 @@
1
+ import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
2
+ import { BlockConfig, BlockFromConfigNoChildren } from "../../../../schema/index.js";
3
+ export declare const createFileBlockWrapper: (block: BlockFromConfigNoChildren<BlockConfig<string, {
4
+ backgroundColor: {
5
+ default: "default";
6
+ };
7
+ name: {
8
+ default: "";
9
+ };
10
+ url: {
11
+ default: "";
12
+ };
13
+ caption: {
14
+ default: "";
15
+ };
16
+ showPreview?: {
17
+ default: true;
18
+ };
19
+ }, "none">, any, any>, editor: BlockNoteEditor<any, any, any>, element?: {
20
+ dom: HTMLElement;
21
+ destroy?: () => void;
22
+ }, buttonIcon?: HTMLElement) => {
23
+ dom: HTMLElement;
24
+ destroy?: () => void;
25
+ };
@@ -1,6 +1,10 @@
1
- import { BlockFromConfig, FileBlockConfig } from "../../../../schema/index.js";
1
+ import { BlockConfig, BlockFromConfigNoChildren } from "../../../../schema/index.js";
2
2
  export declare const FILE_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z\"></path></svg>";
3
- export declare const createFileNameWithIcon: (block: BlockFromConfig<FileBlockConfig, any, any>) => {
3
+ export declare const createFileNameWithIcon: (block: BlockFromConfigNoChildren<BlockConfig<string, {
4
+ name: {
5
+ default: "";
6
+ };
7
+ }, "none">, any, any>) => {
4
8
  dom: HTMLElement;
5
9
  destroy?: () => void;
6
10
  };
@@ -0,0 +1,31 @@
1
+ import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
2
+ import { BlockConfig, BlockFromConfigNoChildren } from "../../../../schema/index.js";
3
+ export declare const createResizableFileBlockWrapper: (block: BlockFromConfigNoChildren<BlockConfig<string, {
4
+ backgroundColor: {
5
+ default: "default";
6
+ };
7
+ name: {
8
+ default: "";
9
+ };
10
+ url: {
11
+ default: "";
12
+ };
13
+ caption: {
14
+ default: "";
15
+ };
16
+ showPreview?: {
17
+ default: true;
18
+ };
19
+ previewWidth?: {
20
+ default: number;
21
+ };
22
+ textAlignment?: {
23
+ default: "left";
24
+ };
25
+ }, "none">, any, any>, editor: BlockNoteEditor<any, any, any>, element: {
26
+ dom: HTMLElement;
27
+ destroy?: () => void;
28
+ }, resizeHandlesContainerElement: HTMLElement, buttonIcon?: HTMLElement) => {
29
+ dom: HTMLElement;
30
+ destroy: () => void;
31
+ };
@@ -0,0 +1,71 @@
1
+ declare const HEADING_LEVELS: readonly [1, 2, 3, 4, 5, 6];
2
+ export interface HeadingOptions {
3
+ defaultLevel?: (typeof HEADING_LEVELS)[number];
4
+ levels?: readonly number[];
5
+ allowToggleHeadings?: boolean;
6
+ }
7
+ export type HeadingBlockConfig = ReturnType<typeof createHeadingBlockConfig>;
8
+ export declare const createHeadingBlockConfig: (() => import("../../index.js").BlockConfig<"heading", {
9
+ readonly isToggleable?: {
10
+ readonly default: false;
11
+ readonly optional: true;
12
+ } | undefined;
13
+ readonly level: {
14
+ readonly default: 1 | 2 | 4 | 3 | 5 | 6;
15
+ readonly values: readonly number[];
16
+ };
17
+ readonly backgroundColor: {
18
+ default: "default";
19
+ };
20
+ readonly textColor: {
21
+ default: "default";
22
+ };
23
+ readonly textAlignment: {
24
+ default: "left";
25
+ values: readonly ["left", "center", "right", "justify"];
26
+ };
27
+ }, "inline">) | ((options: HeadingOptions) => import("../../index.js").BlockConfig<"heading", {
28
+ readonly isToggleable?: {
29
+ readonly default: false;
30
+ readonly optional: true;
31
+ } | undefined;
32
+ readonly level: {
33
+ readonly default: 1 | 2 | 4 | 3 | 5 | 6;
34
+ readonly values: readonly number[];
35
+ };
36
+ readonly backgroundColor: {
37
+ default: "default";
38
+ };
39
+ readonly textColor: {
40
+ default: "default";
41
+ };
42
+ readonly textAlignment: {
43
+ default: "left";
44
+ values: readonly ["left", "center", "right", "justify"];
45
+ };
46
+ }, "inline">);
47
+ export declare const createHeadingBlockSpec: (options?: Partial<{
48
+ defaultLevel: (typeof HEADING_LEVELS)[number];
49
+ levels: readonly number[];
50
+ allowToggleHeadings: boolean;
51
+ }> | undefined) => import("../../index.js").BlockSpec<"heading", {
52
+ readonly isToggleable?: {
53
+ readonly default: false;
54
+ readonly optional: true;
55
+ } | undefined;
56
+ readonly level: {
57
+ readonly default: 1 | 2 | 4 | 3 | 5 | 6;
58
+ readonly values: readonly number[];
59
+ };
60
+ readonly backgroundColor: {
61
+ default: "default";
62
+ };
63
+ readonly textColor: {
64
+ default: "default";
65
+ };
66
+ readonly textAlignment: {
67
+ default: "left";
68
+ values: readonly ["left", "center", "right", "justify"];
69
+ };
70
+ }, "inline">;
71
+ export {};
@@ -0,0 +1,102 @@
1
+ import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
+ import { BlockFromConfig } from "../../schema/index.js";
3
+ export declare const FILE_IMAGE_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z\"></path></svg>";
4
+ export interface ImageOptions {
5
+ icon?: string;
6
+ }
7
+ export type ImageBlockConfig = ReturnType<typeof createImageBlockConfig>;
8
+ export declare const createImageBlockConfig: (() => import("../../index.js").BlockConfig<"image", {
9
+ readonly textAlignment: {
10
+ default: "left";
11
+ values: readonly ["left", "center", "right", "justify"];
12
+ };
13
+ readonly backgroundColor: {
14
+ default: "default";
15
+ };
16
+ readonly name: {
17
+ readonly default: "";
18
+ };
19
+ readonly url: {
20
+ readonly default: "";
21
+ };
22
+ readonly caption: {
23
+ readonly default: "";
24
+ };
25
+ readonly showPreview: {
26
+ readonly default: true;
27
+ };
28
+ readonly previewWidth: {
29
+ readonly default: undefined;
30
+ readonly type: "number";
31
+ };
32
+ }, "none">) | ((options: ImageOptions) => import("../../index.js").BlockConfig<"image", {
33
+ readonly textAlignment: {
34
+ default: "left";
35
+ values: readonly ["left", "center", "right", "justify"];
36
+ };
37
+ readonly backgroundColor: {
38
+ default: "default";
39
+ };
40
+ readonly name: {
41
+ readonly default: "";
42
+ };
43
+ readonly url: {
44
+ readonly default: "";
45
+ };
46
+ readonly caption: {
47
+ readonly default: "";
48
+ };
49
+ readonly showPreview: {
50
+ readonly default: true;
51
+ };
52
+ readonly previewWidth: {
53
+ readonly default: undefined;
54
+ readonly type: "number";
55
+ };
56
+ }, "none">);
57
+ export declare const imageParse: (_config?: ImageOptions) => (element: HTMLElement) => {
58
+ backgroundColor: string | undefined;
59
+ url: string | undefined;
60
+ previewWidth: number | undefined;
61
+ name: string | undefined;
62
+ } | {
63
+ backgroundColor: string | undefined;
64
+ caption: string | undefined;
65
+ url: string | undefined;
66
+ previewWidth: number | undefined;
67
+ name: string | undefined;
68
+ } | undefined;
69
+ export declare const imageRender: (config?: ImageOptions) => (block: BlockFromConfig<ReturnType<typeof createImageBlockConfig>, any, any>, editor: BlockNoteEditor<Record<"image", ReturnType<typeof createImageBlockConfig>>, any, any>) => {
70
+ dom: HTMLElement;
71
+ destroy: () => void;
72
+ };
73
+ export declare const imageToExternalHTML: (_config?: ImageOptions) => (block: BlockFromConfig<ReturnType<typeof createImageBlockConfig>, any, any>, _editor: BlockNoteEditor<Record<"image", ReturnType<typeof createImageBlockConfig>>, any, any>) => {
74
+ dom: HTMLElement;
75
+ };
76
+ export declare const createImageBlockSpec: (options?: Partial<{
77
+ icon: string;
78
+ }> | undefined) => import("../../index.js").BlockSpec<"image", {
79
+ readonly textAlignment: {
80
+ default: "left";
81
+ values: readonly ["left", "center", "right", "justify"];
82
+ };
83
+ readonly backgroundColor: {
84
+ default: "default";
85
+ };
86
+ readonly name: {
87
+ readonly default: "";
88
+ };
89
+ readonly url: {
90
+ readonly default: "";
91
+ };
92
+ readonly caption: {
93
+ readonly default: "";
94
+ };
95
+ readonly showPreview: {
96
+ readonly default: true;
97
+ };
98
+ readonly previewWidth: {
99
+ readonly default: undefined;
100
+ readonly type: "number";
101
+ };
102
+ }, "none">;
@@ -0,0 +1,25 @@
1
+ export type BulletListItemBlockConfig = ReturnType<typeof createBulletListItemBlockConfig>;
2
+ export declare const createBulletListItemBlockConfig: () => import("../../../index.js").BlockConfig<"bulletListItem", {
3
+ readonly backgroundColor: {
4
+ default: "default";
5
+ };
6
+ readonly textColor: {
7
+ default: "default";
8
+ };
9
+ readonly textAlignment: {
10
+ default: "left";
11
+ values: readonly ["left", "center", "right", "justify"];
12
+ };
13
+ }, "inline">;
14
+ export declare const createBulletListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"bulletListItem", {
15
+ readonly backgroundColor: {
16
+ default: "default";
17
+ };
18
+ readonly textColor: {
19
+ default: "default";
20
+ };
21
+ readonly textAlignment: {
22
+ default: "left";
23
+ values: readonly ["left", "center", "right", "justify"];
24
+ };
25
+ }, "inline">;
@@ -0,0 +1,33 @@
1
+ export type CheckListItemBlockConfig = ReturnType<typeof createCheckListItemConfig>;
2
+ export declare const createCheckListItemConfig: () => import("../../../index.js").BlockConfig<"checkListItem", {
3
+ readonly checked: {
4
+ readonly default: false;
5
+ readonly type: "boolean";
6
+ };
7
+ readonly backgroundColor: {
8
+ default: "default";
9
+ };
10
+ readonly textColor: {
11
+ default: "default";
12
+ };
13
+ readonly textAlignment: {
14
+ default: "left";
15
+ values: readonly ["left", "center", "right", "justify"];
16
+ };
17
+ }, "inline">;
18
+ export declare const createCheckListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"checkListItem", {
19
+ readonly checked: {
20
+ readonly default: false;
21
+ readonly type: "boolean";
22
+ };
23
+ readonly backgroundColor: {
24
+ default: "default";
25
+ };
26
+ readonly textColor: {
27
+ default: "default";
28
+ };
29
+ readonly textAlignment: {
30
+ default: "left";
31
+ values: readonly ["left", "center", "right", "justify"];
32
+ };
33
+ }, "inline">;
@@ -0,0 +1,8 @@
1
+ import { Plugin } from "@tiptap/pm/state";
2
+ import { DecorationSet } from "@tiptap/pm/view";
3
+ /**
4
+ * This plugin adds decorations to numbered list items to display their index.
5
+ */
6
+ export declare const NumberedListIndexingDecorationPlugin: () => Plugin<{
7
+ decorations: DecorationSet;
8
+ }>;
@@ -0,0 +1,33 @@
1
+ export type NumberedListItemBlockConfig = ReturnType<typeof createNumberedListItemBlockConfig>;
2
+ export declare const createNumberedListItemBlockConfig: () => import("../../../index.js").BlockConfig<"numberedListItem", {
3
+ readonly start: {
4
+ readonly default: undefined;
5
+ readonly type: "number";
6
+ };
7
+ readonly backgroundColor: {
8
+ default: "default";
9
+ };
10
+ readonly textColor: {
11
+ default: "default";
12
+ };
13
+ readonly textAlignment: {
14
+ default: "left";
15
+ values: readonly ["left", "center", "right", "justify"];
16
+ };
17
+ }, "inline">;
18
+ export declare const createNumberedListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"numberedListItem", {
19
+ readonly start: {
20
+ readonly default: undefined;
21
+ readonly type: "number";
22
+ };
23
+ readonly backgroundColor: {
24
+ default: "default";
25
+ };
26
+ readonly textColor: {
27
+ default: "default";
28
+ };
29
+ readonly textAlignment: {
30
+ default: "left";
31
+ values: readonly ["left", "center", "right", "justify"];
32
+ };
33
+ }, "inline">;
@@ -0,0 +1,25 @@
1
+ export type ToggleListItemBlockConfig = ReturnType<typeof createToggleListItemBlockConfig>;
2
+ export declare const createToggleListItemBlockConfig: () => import("../../../index.js").BlockConfig<"toggleListItem", {
3
+ readonly backgroundColor: {
4
+ default: "default";
5
+ };
6
+ readonly textColor: {
7
+ default: "default";
8
+ };
9
+ readonly textAlignment: {
10
+ default: "left";
11
+ values: readonly ["left", "center", "right", "justify"];
12
+ };
13
+ }, "inline">;
14
+ export declare const createToggleListItemBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../../index.js").BlockSpec<"toggleListItem", {
15
+ readonly backgroundColor: {
16
+ default: "default";
17
+ };
18
+ readonly textColor: {
19
+ default: "default";
20
+ };
21
+ readonly textAlignment: {
22
+ default: "left";
23
+ values: readonly ["left", "center", "right", "justify"];
24
+ };
25
+ }, "inline">;
@@ -0,0 +1,11 @@
1
+ import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
2
+ import { BlockNoteSchema } from "../BlockNoteSchema.js";
3
+ export type PageBreakBlockConfig = ReturnType<typeof createPageBreakBlockConfig>;
4
+ export declare const createPageBreakBlockConfig: () => import("../../index.js").BlockConfig<"pageBreak", {}, "none">;
5
+ export declare const createPageBreakBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../index.js").BlockSpec<"pageBreak", {}, "none">;
6
+ /**
7
+ * Adds page break support to the given schema.
8
+ */
9
+ export declare const withPageBreak: <B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(schema: BlockNoteSchema<B, I, S>) => import("../../index.js").CustomBlockNoteSchema<B & {
10
+ pageBreak: import("../../index.js").BlockConfig<"pageBreak", {}, "none">;
11
+ }, I, S>;
@@ -1,8 +1,10 @@
1
1
  import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
2
  import { DefaultSuggestionItem } from "../../extensions/SuggestionMenu/DefaultSuggestionItem.js";
3
3
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../schema/index.js";
4
- import { pageBreakSchema } from "./schema.js";
5
- export declare function checkPageBreakBlocksInSchema<I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<any, I, S>): editor is BlockNoteEditor<typeof pageBreakSchema.blockSchema, I, S>;
4
+ import { createPageBreakBlockConfig } from "./block.js";
5
+ export declare function checkPageBreakBlocksInSchema<I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<any, I, S>): editor is BlockNoteEditor<{
6
+ pageBreak: ReturnType<typeof createPageBreakBlockConfig>;
7
+ }, I, S>;
6
8
  export declare function getPageBreakSlashMenuItems<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>): (Omit<DefaultSuggestionItem, "key"> & {
7
9
  key: "page_break";
8
10
  })[];
@@ -0,0 +1,25 @@
1
+ export type ParagraphBlockConfig = ReturnType<typeof createParagraphBlockConfig>;
2
+ export declare const createParagraphBlockConfig: () => import("../../index.js").BlockConfig<"paragraph", {
3
+ backgroundColor: {
4
+ default: "default";
5
+ };
6
+ textColor: {
7
+ default: "default";
8
+ };
9
+ textAlignment: {
10
+ default: "left";
11
+ values: readonly ["left", "center", "right", "justify"];
12
+ };
13
+ }, "inline">;
14
+ export declare const createParagraphBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../index.js").BlockSpec<"paragraph", {
15
+ backgroundColor: {
16
+ default: "default";
17
+ };
18
+ textColor: {
19
+ default: "default";
20
+ };
21
+ textAlignment: {
22
+ default: "left";
23
+ values: readonly ["left", "center", "right", "justify"];
24
+ };
25
+ }, "inline">;
@@ -0,0 +1,17 @@
1
+ export type QuoteBlockConfig = ReturnType<typeof createQuoteBlockConfig>;
2
+ export declare const createQuoteBlockConfig: () => import("../../index.js").BlockConfig<"quote", {
3
+ readonly backgroundColor: {
4
+ default: "default";
5
+ };
6
+ readonly textColor: {
7
+ default: "default";
8
+ };
9
+ }, "inline">;
10
+ export declare const createQuoteBlockSpec: (options?: Partial<Partial<Record<string, any>>> | undefined) => import("../../index.js").BlockSpec<"quote", {
11
+ readonly backgroundColor: {
12
+ default: "default";
13
+ };
14
+ readonly textColor: {
15
+ default: "default";
16
+ };
17
+ }, "inline">;
@@ -0,0 +1,21 @@
1
+ import { BlockConfig } from "../../schema/index.js";
2
+ export declare const tablePropSchema: {
3
+ textColor: {
4
+ default: "default";
5
+ };
6
+ };
7
+ export type TableBlockConfig = BlockConfig<"table", {
8
+ textColor: {
9
+ default: "default";
10
+ };
11
+ }, "table">;
12
+ export declare const createTableBlockSpec: () => import("../../index.js").LooseBlockSpec<"table", {
13
+ textColor: {
14
+ default: "default";
15
+ };
16
+ }, "table">;
17
+ declare module "@tiptap/core" {
18
+ interface NodeConfig {
19
+ tableRole?: string;
20
+ }
21
+ }