@blocknote/core 0.38.0 → 0.39.1-capitol

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 (239) hide show
  1. package/dist/BlockNoteSchema-Bsa_tSAC.cjs +11 -0
  2. package/dist/BlockNoteSchema-Bsa_tSAC.cjs.map +1 -0
  3. package/dist/BlockNoteSchema-CZez1nQf.js +4244 -0
  4. package/dist/BlockNoteSchema-CZez1nQf.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/webpack-stats.json +1 -1
  15. package/package.json +19 -17
  16. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +1 -1
  17. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +2 -2
  18. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +34 -25
  19. package/src/api/blockManipulation/setupTestEnv.ts +0 -1
  20. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +6 -10
  21. package/src/api/clipboard/fromClipboard/pasteExtension.ts +1 -1
  22. package/src/api/clipboard/toClipboard/copyExtension.ts +1 -1
  23. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +128 -28
  24. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +101 -41
  25. package/src/api/pmUtil.ts +1 -1
  26. package/src/api/positionMapping.test.ts +58 -15
  27. package/src/api/positionMapping.ts +2 -4
  28. package/src/blocks/Audio/block.ts +174 -0
  29. package/src/blocks/BlockNoteSchema.ts +59 -0
  30. package/src/blocks/Code/block.ts +299 -0
  31. package/src/blocks/File/block.ts +98 -0
  32. package/src/blocks/{FileBlockContent → File}/helpers/render/createAddFileButton.ts +5 -2
  33. package/src/blocks/{FileBlockContent → File}/helpers/render/createFileBlockWrapper.ts +15 -6
  34. package/src/blocks/{FileBlockContent → File}/helpers/render/createFileNameWithIcon.ts +15 -2
  35. package/src/blocks/{FileBlockContent → File}/helpers/render/createResizableFileBlockWrapper.ts +21 -2
  36. package/src/blocks/Heading/block.ts +138 -0
  37. package/src/blocks/Image/block.ts +190 -0
  38. package/src/blocks/ListItem/BulletListItem/block.ts +116 -0
  39. package/src/blocks/ListItem/CheckListItem/block.ts +175 -0
  40. package/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts +173 -0
  41. package/src/blocks/ListItem/NumberedListItem/block.ts +133 -0
  42. package/src/blocks/ListItem/ToggleListItem/block.ts +78 -0
  43. package/src/blocks/PageBreak/block.ts +72 -0
  44. package/src/blocks/{PageBreakBlockContent → PageBreak}/getPageBreakSlashMenuItems.ts +9 -7
  45. package/src/blocks/Paragraph/block.ts +80 -0
  46. package/src/blocks/Quote/block.ts +90 -0
  47. package/src/blocks/{TableBlockContent/TableBlockContent.ts → Table/block.ts} +169 -51
  48. package/src/blocks/ToggleWrapper/createToggleWrapper.ts +1 -1
  49. package/src/blocks/Video/block.ts +143 -0
  50. package/src/blocks/defaultBlockHelpers.ts +2 -2
  51. package/src/blocks/defaultBlockTypeGuards.ts +143 -174
  52. package/src/blocks/defaultBlocks.ts +107 -35
  53. package/src/blocks/defaultProps.ts +145 -4
  54. package/src/blocks/index.ts +26 -0
  55. package/src/blocks/utils/listItemEnterHandler.ts +42 -0
  56. package/src/editor/Block.css +54 -18
  57. package/src/editor/BlockNoteEditor.ts +256 -211
  58. package/src/editor/BlockNoteExtension.ts +92 -0
  59. package/src/editor/BlockNoteExtensions.ts +18 -17
  60. package/src/editor/defaultColors.ts +2 -2
  61. package/src/exporter/Exporter.ts +1 -1
  62. package/src/exporter/mapping.ts +1 -1
  63. package/src/extensions/BackgroundColor/BackgroundColorExtension.ts +3 -20
  64. package/src/extensions/BackgroundColor/BackgroundColorMark.ts +6 -8
  65. package/src/extensions/BlockChange/BlockChangePlugin.ts +2 -1
  66. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +2 -2
  67. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +2 -2
  68. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -1
  69. package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -1
  70. package/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.ts +52 -0
  71. package/src/extensions/Collaboration/schemaMigration/migrationRules/index.ts +4 -0
  72. package/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.ts +4 -0
  73. package/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.ts +78 -0
  74. package/src/extensions/Comments/CommentsPlugin.ts +1 -1
  75. package/src/extensions/FilePanel/FilePanelPlugin.ts +5 -10
  76. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +1 -1
  77. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +4 -3
  78. package/src/extensions/Placeholder/PlaceholderPlugin.ts +6 -6
  79. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +1 -23
  80. package/src/extensions/SideMenu/SideMenuPlugin.ts +1 -3
  81. package/src/extensions/SideMenu/dragging.ts +2 -2
  82. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +4 -7
  83. package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +6 -2
  84. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +24 -17
  85. package/src/extensions/TableHandles/TableHandlesPlugin.ts +8 -8
  86. package/src/extensions/TextAlignment/TextAlignmentExtension.ts +5 -11
  87. package/src/extensions/TextColor/TextColorExtension.ts +3 -17
  88. package/src/extensions/TextColor/TextColorMark.ts +4 -9
  89. package/src/extensions/UniqueID/UniqueID.ts +6 -13
  90. package/src/index.ts +2 -28
  91. package/src/schema/blocks/createSpec.ts +342 -169
  92. package/src/schema/blocks/internal.ts +77 -138
  93. package/src/schema/blocks/types.ts +264 -94
  94. package/src/schema/index.ts +1 -0
  95. package/src/schema/inlineContent/createSpec.ts +99 -21
  96. package/src/schema/inlineContent/internal.ts +16 -7
  97. package/src/schema/inlineContent/types.ts +24 -2
  98. package/src/schema/propTypes.ts +15 -9
  99. package/src/schema/schema.ts +209 -0
  100. package/src/schema/styles/createSpec.ts +79 -31
  101. package/src/schema/styles/internal.ts +61 -2
  102. package/src/schema/styles/types.ts +17 -3
  103. package/src/util/topo-sort.test.ts +125 -0
  104. package/src/util/topo-sort.ts +160 -0
  105. package/types/src/api/blockManipulation/commands/splitBlock/splitBlock.d.ts +2 -1
  106. package/types/src/api/blockManipulation/selections/selection.d.ts +1 -1
  107. package/types/src/api/blockManipulation/setupTestEnv.d.ts +29 -543
  108. package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +1 -1
  109. package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +1 -1
  110. package/types/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.d.ts +2 -0
  111. package/types/src/api/exporters/markdown/util/removeUnderlinesRehypePlugin.d.ts +6 -0
  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/Divider/block.d.ts +3 -0
  118. package/types/src/blocks/File/block.d.ts +37 -0
  119. package/types/src/blocks/File/helpers/render/createAddFileButton.d.ts +6 -0
  120. package/types/src/blocks/File/helpers/render/createFileBlockWrapper.d.ts +25 -0
  121. package/types/src/blocks/{FileBlockContent → File}/helpers/render/createFileNameWithIcon.d.ts +6 -2
  122. package/types/src/blocks/File/helpers/render/createResizableFileBlockWrapper.d.ts +31 -0
  123. package/types/src/blocks/Heading/block.d.ts +71 -0
  124. package/types/src/blocks/Image/block.d.ts +102 -0
  125. package/types/src/blocks/ListItem/BulletListItem/block.d.ts +25 -0
  126. package/types/src/blocks/ListItem/CheckListItem/block.d.ts +33 -0
  127. package/types/src/blocks/ListItem/NumberedListItem/IndexingPlugin.d.ts +8 -0
  128. package/types/src/blocks/ListItem/NumberedListItem/block.d.ts +33 -0
  129. package/types/src/blocks/ListItem/ToggleListItem/block.d.ts +25 -0
  130. package/types/src/blocks/PageBreak/block.d.ts +11 -0
  131. package/types/src/blocks/{PageBreakBlockContent → PageBreak}/getPageBreakSlashMenuItems.d.ts +4 -2
  132. package/types/src/blocks/Paragraph/block.d.ts +25 -0
  133. package/types/src/blocks/Quote/block.d.ts +17 -0
  134. package/types/src/blocks/Table/block.d.ts +21 -0
  135. package/types/src/blocks/Video/block.d.ts +67 -0
  136. package/types/src/blocks/defaultBlockHelpers.d.ts +1 -1
  137. package/types/src/blocks/defaultBlockTypeGuards.d.ts +15 -36
  138. package/types/src/blocks/defaultBlocks.d.ts +221 -1060
  139. package/types/src/blocks/defaultProps.d.ts +17 -1
  140. package/types/src/blocks/index.d.ts +24 -0
  141. package/types/src/blocks/utils/listItemEnterHandler.d.ts +2 -0
  142. package/types/src/editor/BlockNoteEditor.d.ts +36 -67
  143. package/types/src/editor/BlockNoteExtension.d.ts +67 -0
  144. package/types/src/editor/BlockNoteExtensions.d.ts +1 -1
  145. package/types/src/editor/defaultColors.d.ts +8 -76
  146. package/types/src/editor/managers/BlockManager.d.ts +114 -0
  147. package/types/src/editor/managers/CollaborationManager.d.ts +115 -0
  148. package/types/src/editor/managers/EventManager.d.ts +58 -0
  149. package/types/src/editor/managers/ExportManager.d.ts +64 -0
  150. package/types/src/editor/managers/ExtensionManager.d.ts +68 -0
  151. package/types/src/editor/managers/SelectionManager.d.ts +54 -0
  152. package/types/src/editor/managers/StateManager.d.ts +115 -0
  153. package/types/src/editor/managers/StyleManager.d.ts +48 -0
  154. package/types/src/editor/managers/index.d.ts +8 -0
  155. package/types/src/exporter/Exporter.d.ts +1 -1
  156. package/types/src/exporter/mapping.d.ts +1 -1
  157. package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +4 -1
  158. package/types/src/extensions/Collaboration/schemaMigration/SchemaMigrationPlugin.d.ts +7 -0
  159. package/types/src/extensions/Collaboration/schemaMigration/migrationRules/index.d.ts +3 -0
  160. package/types/src/extensions/Collaboration/schemaMigration/migrationRules/migrationRule.d.ts +3 -0
  161. package/types/src/extensions/Collaboration/schemaMigration/migrationRules/moveColorAttributes.d.ts +2 -0
  162. package/types/src/extensions/Comments/CommentsPlugin.d.ts +1 -1
  163. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +4 -4
  164. package/types/src/extensions/TextColor/TextColorMark.d.ts +4 -1
  165. package/types/src/index.d.ts +2 -25
  166. package/types/src/schema/blocks/createSpec.d.ts +16 -36
  167. package/types/src/schema/blocks/internal.d.ts +11 -33
  168. package/types/src/schema/blocks/types.d.ts +181 -57
  169. package/types/src/schema/index.d.ts +1 -0
  170. package/types/src/schema/inlineContent/createSpec.d.ts +36 -2
  171. package/types/src/schema/inlineContent/internal.d.ts +7 -15
  172. package/types/src/schema/inlineContent/types.d.ts +15 -1
  173. package/types/src/schema/propTypes.d.ts +4 -4
  174. package/types/src/schema/schema.d.ts +40 -0
  175. package/types/src/schema/styles/createSpec.d.ts +6 -4
  176. package/types/src/schema/styles/internal.d.ts +6 -3
  177. package/types/src/schema/styles/types.d.ts +11 -2
  178. package/types/src/util/topo-sort.d.ts +18 -0
  179. package/types/src/util/topo-sort.test.d.ts +1 -0
  180. package/dist/tsconfig.tsbuildinfo +0 -1
  181. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +0 -144
  182. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +0 -445
  183. package/src/blocks/FileBlockContent/FileBlockContent.ts +0 -100
  184. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +0 -159
  185. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +0 -159
  186. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +0 -134
  187. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +0 -299
  188. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +0 -86
  189. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +0 -172
  190. package/src/blocks/ListItemBlockContent/ToggleListItemBlockContent/ToggleListItemBlockContent.ts +0 -104
  191. package/src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts +0 -49
  192. package/src/blocks/PageBreakBlockContent/schema.ts +0 -40
  193. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +0 -78
  194. package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +0 -121
  195. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +0 -158
  196. package/src/editor/BlockNoteSchema.ts +0 -107
  197. package/src/editor/BlockNoteTipTapEditor.ts +0 -335
  198. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +0 -99
  199. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +0 -90
  200. package/types/src/blocks/FileBlockContent/helpers/render/createAddFileButton.d.ts +0 -6
  201. package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +0 -9
  202. package/types/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.d.ts +0 -9
  203. package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +0 -67
  204. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +0 -131
  205. package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +0 -46
  206. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +0 -55
  207. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.d.ts +0 -2
  208. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +0 -58
  209. package/types/src/blocks/ListItemBlockContent/ToggleListItemBlockContent/ToggleListItemBlockContent.d.ts +0 -46
  210. package/types/src/blocks/PageBreakBlockContent/PageBreakBlockContent.d.ts +0 -31
  211. package/types/src/blocks/PageBreakBlockContent/schema.d.ts +0 -86
  212. package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +0 -52
  213. package/types/src/blocks/QuoteBlockContent/QuoteBlockContent.d.ts +0 -52
  214. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +0 -39
  215. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +0 -131
  216. package/types/src/editor/BlockNoteSchema.d.ts +0 -34
  217. package/types/src/editor/BlockNoteTipTapEditor.d.ts +0 -43
  218. /package/src/blocks/{AudioBlockContent → Audio}/parseAudioElement.ts +0 -0
  219. /package/src/blocks/{FileBlockContent → File}/helpers/parse/parseEmbedElement.ts +0 -0
  220. /package/src/blocks/{FileBlockContent → File}/helpers/parse/parseFigureElement.ts +0 -0
  221. /package/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createFigureWithCaption.ts +0 -0
  222. /package/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createLinkWithCaption.ts +0 -0
  223. /package/src/blocks/{FileBlockContent → File/helpers}/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
  224. /package/src/blocks/{ImageBlockContent → Image}/parseImageElement.ts +0 -0
  225. /package/src/blocks/{ListItemBlockContent → ListItem}/ListItemKeyboardShortcuts.ts +0 -0
  226. /package/src/blocks/{ListItemBlockContent → ListItem}/getListItemContent.ts +0 -0
  227. /package/src/blocks/{TableBlockContent → Table}/TableExtension.ts +0 -0
  228. /package/src/blocks/{VideoBlockContent → Video}/parseVideoElement.ts +0 -0
  229. /package/types/src/blocks/{AudioBlockContent → Audio}/parseAudioElement.d.ts +0 -0
  230. /package/types/src/blocks/{FileBlockContent → File}/helpers/parse/parseEmbedElement.d.ts +0 -0
  231. /package/types/src/blocks/{FileBlockContent → File}/helpers/parse/parseFigureElement.d.ts +0 -0
  232. /package/types/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createFigureWithCaption.d.ts +0 -0
  233. /package/types/src/blocks/{FileBlockContent → File}/helpers/toExternalHTML/createLinkWithCaption.d.ts +0 -0
  234. /package/types/src/blocks/{FileBlockContent → File/helpers}/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
  235. /package/types/src/blocks/{ImageBlockContent → Image}/parseImageElement.d.ts +0 -0
  236. /package/types/src/blocks/{ListItemBlockContent → ListItem}/ListItemKeyboardShortcuts.d.ts +0 -0
  237. /package/types/src/blocks/{ListItemBlockContent → ListItem}/getListItemContent.d.ts +0 -0
  238. /package/types/src/blocks/{TableBlockContent → Table}/TableExtension.d.ts +0 -0
  239. /package/types/src/blocks/{VideoBlockContent → Video}/parseVideoElement.d.ts +0 -0
@@ -1,528 +1,5 @@
1
1
  import { BlockNoteEditor } from "../../editor/BlockNoteEditor.js";
2
- export declare function setupTestEnv(): () => BlockNoteEditor<import("../../index.js").BlockSchemaFromSpecs<{
3
- paragraph: {
4
- config: {
5
- type: "paragraph";
6
- content: "inline";
7
- propSchema: {
8
- backgroundColor: {
9
- default: "default";
10
- };
11
- textColor: {
12
- default: "default";
13
- };
14
- textAlignment: {
15
- default: "left";
16
- values: readonly ["left", "center", "right", "justify"];
17
- };
18
- };
19
- };
20
- implementation: import("../../index.js").TiptapBlockImplementation<{
21
- type: "paragraph";
22
- content: "inline";
23
- propSchema: {
24
- backgroundColor: {
25
- default: "default";
26
- };
27
- textColor: {
28
- default: "default";
29
- };
30
- textAlignment: {
31
- default: "left";
32
- values: readonly ["left", "center", "right", "justify"];
33
- };
34
- };
35
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
36
- };
37
- heading: {
38
- config: {
39
- type: "heading";
40
- content: "inline";
41
- propSchema: {
42
- level: {
43
- default: number;
44
- values: readonly [1, 2, 3, 4, 5, 6];
45
- };
46
- isToggleable: {
47
- default: false;
48
- };
49
- backgroundColor: {
50
- default: "default";
51
- };
52
- textColor: {
53
- default: "default";
54
- };
55
- textAlignment: {
56
- default: "left";
57
- values: readonly ["left", "center", "right", "justify"];
58
- };
59
- };
60
- };
61
- implementation: import("../../index.js").TiptapBlockImplementation<{
62
- type: "heading";
63
- content: "inline";
64
- propSchema: {
65
- level: {
66
- default: number;
67
- values: readonly [1, 2, 3, 4, 5, 6];
68
- };
69
- isToggleable: {
70
- default: false;
71
- };
72
- backgroundColor: {
73
- default: "default";
74
- };
75
- textColor: {
76
- default: "default";
77
- };
78
- textAlignment: {
79
- default: "left";
80
- values: readonly ["left", "center", "right", "justify"];
81
- };
82
- };
83
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
84
- };
85
- quote: {
86
- config: {
87
- type: "quote";
88
- content: "inline";
89
- propSchema: {
90
- backgroundColor: {
91
- default: "default";
92
- };
93
- textColor: {
94
- default: "default";
95
- };
96
- textAlignment: {
97
- default: "left";
98
- values: readonly ["left", "center", "right", "justify"];
99
- };
100
- };
101
- };
102
- implementation: import("../../index.js").TiptapBlockImplementation<{
103
- type: "quote";
104
- content: "inline";
105
- propSchema: {
106
- backgroundColor: {
107
- default: "default";
108
- };
109
- textColor: {
110
- default: "default";
111
- };
112
- textAlignment: {
113
- default: "left";
114
- values: readonly ["left", "center", "right", "justify"];
115
- };
116
- };
117
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
118
- };
119
- codeBlock: {
120
- config: {
121
- type: "codeBlock";
122
- content: "inline";
123
- propSchema: {
124
- language: {
125
- default: string;
126
- };
127
- };
128
- };
129
- implementation: import("../../index.js").TiptapBlockImplementation<{
130
- type: "codeBlock";
131
- content: "inline";
132
- propSchema: {
133
- language: {
134
- default: string;
135
- };
136
- };
137
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
138
- };
139
- toggleListItem: {
140
- config: {
141
- type: "toggleListItem";
142
- content: "inline";
143
- propSchema: {
144
- backgroundColor: {
145
- default: "default";
146
- };
147
- textColor: {
148
- default: "default";
149
- };
150
- textAlignment: {
151
- default: "left";
152
- values: readonly ["left", "center", "right", "justify"];
153
- };
154
- };
155
- };
156
- implementation: import("../../index.js").TiptapBlockImplementation<{
157
- type: "toggleListItem";
158
- content: "inline";
159
- propSchema: {
160
- backgroundColor: {
161
- default: "default";
162
- };
163
- textColor: {
164
- default: "default";
165
- };
166
- textAlignment: {
167
- default: "left";
168
- values: readonly ["left", "center", "right", "justify"];
169
- };
170
- };
171
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
172
- };
173
- bulletListItem: {
174
- config: {
175
- type: "bulletListItem";
176
- content: "inline";
177
- propSchema: {
178
- backgroundColor: {
179
- default: "default";
180
- };
181
- textColor: {
182
- default: "default";
183
- };
184
- textAlignment: {
185
- default: "left";
186
- values: readonly ["left", "center", "right", "justify"];
187
- };
188
- };
189
- };
190
- implementation: import("../../index.js").TiptapBlockImplementation<{
191
- type: "bulletListItem";
192
- content: "inline";
193
- propSchema: {
194
- backgroundColor: {
195
- default: "default";
196
- };
197
- textColor: {
198
- default: "default";
199
- };
200
- textAlignment: {
201
- default: "left";
202
- values: readonly ["left", "center", "right", "justify"];
203
- };
204
- };
205
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
206
- };
207
- numberedListItem: {
208
- config: {
209
- type: "numberedListItem";
210
- content: "inline";
211
- propSchema: {
212
- start: {
213
- default: undefined;
214
- type: "number";
215
- };
216
- backgroundColor: {
217
- default: "default";
218
- };
219
- textColor: {
220
- default: "default";
221
- };
222
- textAlignment: {
223
- default: "left";
224
- values: readonly ["left", "center", "right", "justify"];
225
- };
226
- };
227
- };
228
- implementation: import("../../index.js").TiptapBlockImplementation<{
229
- type: "numberedListItem";
230
- content: "inline";
231
- propSchema: {
232
- start: {
233
- default: undefined;
234
- type: "number";
235
- };
236
- backgroundColor: {
237
- default: "default";
238
- };
239
- textColor: {
240
- default: "default";
241
- };
242
- textAlignment: {
243
- default: "left";
244
- values: readonly ["left", "center", "right", "justify"];
245
- };
246
- };
247
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
248
- };
249
- checkListItem: {
250
- config: {
251
- type: "checkListItem";
252
- content: "inline";
253
- propSchema: {
254
- checked: {
255
- default: false;
256
- };
257
- backgroundColor: {
258
- default: "default";
259
- };
260
- textColor: {
261
- default: "default";
262
- };
263
- textAlignment: {
264
- default: "left";
265
- values: readonly ["left", "center", "right", "justify"];
266
- };
267
- };
268
- };
269
- implementation: import("../../index.js").TiptapBlockImplementation<{
270
- type: "checkListItem";
271
- content: "inline";
272
- propSchema: {
273
- checked: {
274
- default: false;
275
- };
276
- backgroundColor: {
277
- default: "default";
278
- };
279
- textColor: {
280
- default: "default";
281
- };
282
- textAlignment: {
283
- default: "left";
284
- values: readonly ["left", "center", "right", "justify"];
285
- };
286
- };
287
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
288
- };
289
- table: {
290
- config: {
291
- type: "table";
292
- content: "table";
293
- propSchema: {
294
- textColor: {
295
- default: "default";
296
- };
297
- };
298
- };
299
- implementation: import("../../index.js").TiptapBlockImplementation<{
300
- type: "table";
301
- content: "table";
302
- propSchema: {
303
- textColor: {
304
- default: "default";
305
- };
306
- };
307
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
308
- };
309
- file: {
310
- config: {
311
- type: "file";
312
- propSchema: {
313
- backgroundColor: {
314
- default: "default";
315
- };
316
- name: {
317
- default: "";
318
- };
319
- url: {
320
- default: "";
321
- };
322
- caption: {
323
- default: "";
324
- };
325
- };
326
- content: "none";
327
- isFileBlock: true;
328
- };
329
- implementation: import("../../index.js").TiptapBlockImplementation<{
330
- type: "file";
331
- propSchema: {
332
- backgroundColor: {
333
- default: "default";
334
- };
335
- name: {
336
- default: "";
337
- };
338
- url: {
339
- default: "";
340
- };
341
- caption: {
342
- default: "";
343
- };
344
- };
345
- content: "none";
346
- isFileBlock: true;
347
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
348
- };
349
- image: {
350
- config: {
351
- type: "image";
352
- propSchema: {
353
- textAlignment: {
354
- default: "left";
355
- values: readonly ["left", "center", "right", "justify"];
356
- };
357
- backgroundColor: {
358
- default: "default";
359
- };
360
- name: {
361
- default: "";
362
- };
363
- url: {
364
- default: "";
365
- };
366
- caption: {
367
- default: "";
368
- };
369
- showPreview: {
370
- default: true;
371
- };
372
- previewWidth: {
373
- default: undefined;
374
- type: "number";
375
- };
376
- };
377
- content: "none";
378
- isFileBlock: true;
379
- fileBlockAccept: string[];
380
- };
381
- implementation: import("../../index.js").TiptapBlockImplementation<{
382
- type: "image";
383
- propSchema: {
384
- textAlignment: {
385
- default: "left";
386
- values: readonly ["left", "center", "right", "justify"];
387
- };
388
- backgroundColor: {
389
- default: "default";
390
- };
391
- name: {
392
- default: "";
393
- };
394
- url: {
395
- default: "";
396
- };
397
- caption: {
398
- default: "";
399
- };
400
- showPreview: {
401
- default: true;
402
- };
403
- previewWidth: {
404
- default: undefined;
405
- type: "number";
406
- };
407
- };
408
- content: "none";
409
- isFileBlock: true;
410
- fileBlockAccept: string[];
411
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
412
- };
413
- video: {
414
- config: {
415
- type: "video";
416
- propSchema: {
417
- textAlignment: {
418
- default: "left";
419
- values: readonly ["left", "center", "right", "justify"];
420
- };
421
- backgroundColor: {
422
- default: "default";
423
- };
424
- name: {
425
- default: "";
426
- };
427
- url: {
428
- default: "";
429
- };
430
- caption: {
431
- default: "";
432
- };
433
- showPreview: {
434
- default: true;
435
- };
436
- previewWidth: {
437
- default: undefined;
438
- type: "number";
439
- };
440
- };
441
- content: "none";
442
- isFileBlock: true;
443
- fileBlockAccept: string[];
444
- };
445
- implementation: import("../../index.js").TiptapBlockImplementation<{
446
- type: "video";
447
- propSchema: {
448
- textAlignment: {
449
- default: "left";
450
- values: readonly ["left", "center", "right", "justify"];
451
- };
452
- backgroundColor: {
453
- default: "default";
454
- };
455
- name: {
456
- default: "";
457
- };
458
- url: {
459
- default: "";
460
- };
461
- caption: {
462
- default: "";
463
- };
464
- showPreview: {
465
- default: true;
466
- };
467
- previewWidth: {
468
- default: undefined;
469
- type: "number";
470
- };
471
- };
472
- content: "none";
473
- isFileBlock: true;
474
- fileBlockAccept: string[];
475
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
476
- };
477
- audio: {
478
- config: {
479
- type: "audio";
480
- propSchema: {
481
- backgroundColor: {
482
- default: "default";
483
- };
484
- name: {
485
- default: "";
486
- };
487
- url: {
488
- default: "";
489
- };
490
- caption: {
491
- default: "";
492
- };
493
- showPreview: {
494
- default: true;
495
- };
496
- };
497
- content: "none";
498
- isFileBlock: true;
499
- fileBlockAccept: string[];
500
- };
501
- implementation: import("../../index.js").TiptapBlockImplementation<{
502
- type: "audio";
503
- propSchema: {
504
- backgroundColor: {
505
- default: "default";
506
- };
507
- name: {
508
- default: "";
509
- };
510
- url: {
511
- default: "";
512
- };
513
- caption: {
514
- default: "";
515
- };
516
- showPreview: {
517
- default: true;
518
- };
519
- };
520
- content: "none";
521
- isFileBlock: true;
522
- fileBlockAccept: string[];
523
- }, any, import("../../index.js").InlineContentSchema, import("../../index.js").StyleSchema>;
524
- };
525
- }>, import("../../index.js").InlineContentSchemaFromSpecs<{
2
+ export declare function setupTestEnv(): () => BlockNoteEditor<import("../../index.js")._DefaultBlockSchema, import("../../index.js").InlineContentSchemaFromSpecs<{
526
3
  text: {
527
4
  config: "text";
528
5
  implementation: any;
@@ -537,48 +14,57 @@ export declare function setupTestEnv(): () => BlockNoteEditor<import("../../inde
537
14
  type: string;
538
15
  propSchema: "boolean";
539
16
  };
540
- implementation: import("../../index.js").StyleImplementation;
17
+ implementation: import("../../index.js").StyleImplementation<{
18
+ type: string;
19
+ propSchema: "boolean";
20
+ }>;
541
21
  };
542
22
  italic: {
543
23
  config: {
544
24
  type: string;
545
25
  propSchema: "boolean";
546
26
  };
547
- implementation: import("../../index.js").StyleImplementation;
27
+ implementation: import("../../index.js").StyleImplementation<{
28
+ type: string;
29
+ propSchema: "boolean";
30
+ }>;
548
31
  };
549
32
  underline: {
550
33
  config: {
551
34
  type: string;
552
35
  propSchema: "boolean";
553
36
  };
554
- implementation: import("../../index.js").StyleImplementation;
37
+ implementation: import("../../index.js").StyleImplementation<{
38
+ type: string;
39
+ propSchema: "boolean";
40
+ }>;
555
41
  };
556
42
  strike: {
557
43
  config: {
558
44
  type: string;
559
45
  propSchema: "boolean";
560
46
  };
561
- implementation: import("../../index.js").StyleImplementation;
562
- };
563
- code: {
564
- config: {
47
+ implementation: import("../../index.js").StyleImplementation<{
565
48
  type: string;
566
49
  propSchema: "boolean";
567
- };
568
- implementation: import("../../index.js").StyleImplementation;
50
+ }>;
569
51
  };
570
- textColor: {
52
+ code: {
571
53
  config: {
572
54
  type: string;
573
- propSchema: "string";
55
+ propSchema: "boolean";
574
56
  };
575
- implementation: import("../../index.js").StyleImplementation;
576
- };
577
- backgroundColor: {
578
- config: {
57
+ implementation: import("../../index.js").StyleImplementation<{
579
58
  type: string;
580
- propSchema: "string";
581
- };
582
- implementation: import("../../index.js").StyleImplementation;
583
- };
59
+ propSchema: "boolean";
60
+ }>;
61
+ };
62
+ textColor: import("../../index.js").StyleSpec<{
63
+ readonly type: "textColor";
64
+ readonly propSchema: "string";
65
+ }>;
66
+ backgroundColor: import("../../index.js").StyleSpec<{
67
+ readonly type: "backgroundColor";
68
+ readonly propSchema: "string";
69
+ }>;
584
70
  }>>;
@@ -4,7 +4,7 @@ import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
4
4
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../../schema/index.js";
5
5
  export declare function serializeInlineContentExternalHTML<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<any, I, S>, blockContent: PartialBlock<BSchema, I, S>["content"], serializer: DOMSerializer, options?: {
6
6
  document?: Document;
7
- }): HTMLElement | DocumentFragment;
7
+ }): DocumentFragment;
8
8
  export declare const serializeBlocksExternalHTML: <BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocks: PartialBlock<BSchema, I, S>[], serializer: DOMSerializer, orderedListItemBlockTypes: Set<string>, unorderedListItemBlockTypes: Set<string>, options?: {
9
9
  document?: Document;
10
10
  }) => DocumentFragment;
@@ -4,7 +4,7 @@ import type { BlockNoteEditor } from "../../../../editor/BlockNoteEditor.js";
4
4
  import { BlockSchema, InlineContentSchema, StyleSchema } from "../../../../schema/index.js";
5
5
  export declare function serializeInlineContentInternalHTML<BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<any, I, S>, blockContent: PartialBlock<BSchema, I, S>["content"], serializer: DOMSerializer, blockType?: string, options?: {
6
6
  document?: Document;
7
- }): HTMLElement | DocumentFragment;
7
+ }): DocumentFragment;
8
8
  export declare const serializeBlocksInternalHTML: <BSchema extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema>(editor: BlockNoteEditor<BSchema, I, S>, blocks: PartialBlock<BSchema, I, S>[], serializer: DOMSerializer, options?: {
9
9
  document?: Document;
10
10
  }) => HTMLElement;
@@ -0,0 +1,2 @@
1
+ import { Parent as HASTParent } from "hast";
2
+ export declare function convertVideoToMarkdown(): (tree: HASTParent) => void;
@@ -0,0 +1,6 @@
1
+ import { Parent as HASTParent } from "hast";
2
+ /**
3
+ * Rehype plugin which removes <u> tags. Used to remove underlines before converting HTML to markdown, as Markdown
4
+ * doesn't support underlines.
5
+ */
6
+ export declare function removeUnderlines(): (tree: HASTParent) => void;
@@ -1,6 +1,6 @@
1
1
  import type { Node, Schema } from "prosemirror-model";
2
2
  import { Transform } from "prosemirror-transform";
3
- import { BlockNoteSchema } from "../editor/BlockNoteSchema.js";
3
+ import { BlockNoteSchema } from "../blocks/BlockNoteSchema.js";
4
4
  import type { BlockSchema } from "../schema/blocks/types.js";
5
5
  import type { InlineContentSchema } from "../schema/inlineContent/types.js";
6
6
  import type { StyleSchema } from "../schema/styles/types.js";