@blocknote/core 0.19.0 → 0.19.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 (97) hide show
  1. package/README.md +2 -0
  2. package/dist/blocknote.js +2549 -2497
  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/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js +5 -1
  7. package/dist/src/api/blockManipulation/commands/moveBlock/moveBlock.test.js.map +1 -1
  8. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +2 -40
  9. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +1 -1
  10. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +4 -0
  11. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +1 -1
  12. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +51 -9
  13. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +1 -1
  14. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +2 -2
  15. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +1 -1
  16. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +1 -1
  17. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +1 -1
  18. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +4 -2
  19. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +1 -1
  20. package/dist/src/api/getBlockInfoFromPos.js +19 -25
  21. package/dist/src/api/getBlockInfoFromPos.js.map +1 -1
  22. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +8 -4
  23. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +1 -1
  24. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +5 -3
  25. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +1 -1
  26. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +12 -6
  27. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +1 -1
  28. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +5 -1
  29. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +1 -1
  30. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +4 -2
  31. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +1 -1
  32. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +2 -1
  33. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +1 -1
  34. package/dist/src/blocks/TableBlockContent/TableBlockContent.js +0 -1
  35. package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +1 -1
  36. package/dist/src/editor/BlockNoteEditor.js +39 -43
  37. package/dist/src/editor/BlockNoteEditor.js.map +1 -1
  38. package/dist/src/editor/BlockNoteEditor.test.js +2 -2
  39. package/dist/src/editor/BlockNoteEditor.test.js.map +1 -1
  40. package/dist/src/editor/BlockNoteExtensions.js +52 -6
  41. package/dist/src/editor/BlockNoteExtensions.js.map +1 -1
  42. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +36 -6
  43. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +1 -1
  44. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +35 -32
  45. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +1 -1
  46. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +74 -71
  47. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +1 -1
  48. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +153 -149
  49. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +1 -1
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/dist/webpack-stats.json +1 -1
  52. package/package.json +2 -2
  53. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +0 -6
  54. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +0 -5
  55. package/src/api/blockManipulation/commands/moveBlock/__snapshots__/moveBlock.test.ts.snap +0 -8
  56. package/src/api/blockManipulation/commands/moveBlock/moveBlock.test.ts +7 -3
  57. package/src/api/blockManipulation/commands/removeBlocks/__snapshots__/removeBlocks.test.ts.snap +439 -2
  58. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.ts +6 -0
  59. package/src/api/blockManipulation/commands/removeBlocks/removeBlocks.ts +2 -82
  60. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +0 -8
  61. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +96 -20
  62. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +0 -6
  63. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +2 -5
  64. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +0 -490
  65. package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -1
  66. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +6 -5
  67. package/src/api/getBlockInfoFromPos.ts +20 -30
  68. package/src/api/parsers/html/__snapshots__/parse-notion-html.json +1 -2
  69. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +16 -4
  70. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +9 -3
  71. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +22 -6
  72. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +5 -3
  73. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +8 -2
  74. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +4 -1
  75. package/src/blocks/TableBlockContent/TableBlockContent.ts +0 -1
  76. package/src/editor/BlockNoteEditor.test.ts +2 -5
  77. package/src/editor/BlockNoteEditor.ts +71 -42
  78. package/src/editor/BlockNoteExtensions.ts +90 -14
  79. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +36 -9
  80. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
  81. package/src/extensions/Placeholder/PlaceholderPlugin.ts +94 -90
  82. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +173 -169
  83. package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +0 -3
  84. package/types/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.d.ts +4 -0
  85. package/types/src/api/blockManipulation/setupTestEnv.d.ts +0 -6
  86. package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
  87. package/types/src/api/getBlockInfoFromPos.d.ts +9 -34
  88. package/types/src/api/testUtil/cases/customBlocks.d.ts +0 -6
  89. package/types/src/api/testUtil/cases/customInlineContent.d.ts +0 -6
  90. package/types/src/api/testUtil/cases/customStyles.d.ts +0 -6
  91. package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +0 -9
  92. package/types/src/blocks/defaultBlocks.d.ts +0 -12
  93. package/types/src/editor/BlockNoteEditor.d.ts +19 -2
  94. package/types/src/editor/BlockNoteExtensions.d.ts +14 -7
  95. package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +4 -1
  96. package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +4 -1
  97. package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +4 -5
@@ -344,7 +344,6 @@ exports[`Test updateBlock > Revert all props 1`] = `
344
344
  },
345
345
  "id": "table-0",
346
346
  "props": {
347
- "backgroundColor": "default",
348
347
  "textColor": "default",
349
348
  },
350
349
  "type": "table",
@@ -820,7 +819,6 @@ exports[`Test updateBlock > Revert single prop 1`] = `
820
819
  },
821
820
  "id": "table-0",
822
821
  "props": {
823
- "backgroundColor": "default",
824
822
  "textColor": "default",
825
823
  },
826
824
  "type": "table",
@@ -1296,7 +1294,6 @@ exports[`Test updateBlock > Update all props 1`] = `
1296
1294
  },
1297
1295
  "id": "table-0",
1298
1296
  "props": {
1299
- "backgroundColor": "default",
1300
1297
  "textColor": "default",
1301
1298
  },
1302
1299
  "type": "table",
@@ -1772,7 +1769,6 @@ exports[`Test updateBlock > Update children 1`] = `
1772
1769
  },
1773
1770
  "id": "table-0",
1774
1771
  "props": {
1775
- "backgroundColor": "default",
1776
1772
  "textColor": "default",
1777
1773
  },
1778
1774
  "type": "table",
@@ -1904,479 +1900,6 @@ exports[`Test updateBlock > Update children 1`] = `
1904
1900
  ]
1905
1901
  `;
1906
1902
 
1907
- exports[`Test updateBlock > Update inline content to empty table content 1`] = `
1908
- [
1909
- {
1910
- "children": [],
1911
- "content": {
1912
- "columnWidths": [],
1913
- "rows": [],
1914
- "type": "tableContent",
1915
- },
1916
- "id": "paragraph-0",
1917
- "props": {
1918
- "backgroundColor": "default",
1919
- "textColor": "default",
1920
- },
1921
- "type": "table",
1922
- },
1923
- {
1924
- "children": [],
1925
- "content": [
1926
- {
1927
- "styles": {},
1928
- "text": "Paragraph 1",
1929
- "type": "text",
1930
- },
1931
- ],
1932
- "id": "paragraph-1",
1933
- "props": {
1934
- "backgroundColor": "default",
1935
- "textAlignment": "left",
1936
- "textColor": "default",
1937
- },
1938
- "type": "paragraph",
1939
- },
1940
- {
1941
- "children": [
1942
- {
1943
- "children": [
1944
- {
1945
- "children": [],
1946
- "content": [
1947
- {
1948
- "styles": {},
1949
- "text": "Double Nested Paragraph 0",
1950
- "type": "text",
1951
- },
1952
- ],
1953
- "id": "double-nested-paragraph-0",
1954
- "props": {
1955
- "backgroundColor": "default",
1956
- "textAlignment": "left",
1957
- "textColor": "default",
1958
- },
1959
- "type": "paragraph",
1960
- },
1961
- ],
1962
- "content": [
1963
- {
1964
- "styles": {},
1965
- "text": "Nested Paragraph 0",
1966
- "type": "text",
1967
- },
1968
- ],
1969
- "id": "nested-paragraph-0",
1970
- "props": {
1971
- "backgroundColor": "default",
1972
- "textAlignment": "left",
1973
- "textColor": "default",
1974
- },
1975
- "type": "paragraph",
1976
- },
1977
- ],
1978
- "content": [
1979
- {
1980
- "styles": {},
1981
- "text": "Paragraph with children",
1982
- "type": "text",
1983
- },
1984
- ],
1985
- "id": "paragraph-with-children",
1986
- "props": {
1987
- "backgroundColor": "default",
1988
- "textAlignment": "left",
1989
- "textColor": "default",
1990
- },
1991
- "type": "paragraph",
1992
- },
1993
- {
1994
- "children": [],
1995
- "content": [
1996
- {
1997
- "styles": {},
1998
- "text": "Paragraph 2",
1999
- "type": "text",
2000
- },
2001
- ],
2002
- "id": "paragraph-2",
2003
- "props": {
2004
- "backgroundColor": "default",
2005
- "textAlignment": "left",
2006
- "textColor": "default",
2007
- },
2008
- "type": "paragraph",
2009
- },
2010
- {
2011
- "children": [],
2012
- "content": [
2013
- {
2014
- "styles": {},
2015
- "text": "Paragraph with props",
2016
- "type": "text",
2017
- },
2018
- ],
2019
- "id": "paragraph-with-props",
2020
- "props": {
2021
- "backgroundColor": "default",
2022
- "textAlignment": "center",
2023
- "textColor": "red",
2024
- },
2025
- "type": "paragraph",
2026
- },
2027
- {
2028
- "children": [],
2029
- "content": [
2030
- {
2031
- "styles": {},
2032
- "text": "Paragraph 3",
2033
- "type": "text",
2034
- },
2035
- ],
2036
- "id": "paragraph-3",
2037
- "props": {
2038
- "backgroundColor": "default",
2039
- "textAlignment": "left",
2040
- "textColor": "default",
2041
- },
2042
- "type": "paragraph",
2043
- },
2044
- {
2045
- "children": [],
2046
- "content": [
2047
- {
2048
- "styles": {
2049
- "bold": true,
2050
- },
2051
- "text": "Paragraph",
2052
- "type": "text",
2053
- },
2054
- {
2055
- "styles": {},
2056
- "text": " with styled ",
2057
- "type": "text",
2058
- },
2059
- {
2060
- "styles": {
2061
- "italic": true,
2062
- },
2063
- "text": "content",
2064
- "type": "text",
2065
- },
2066
- ],
2067
- "id": "paragraph-with-styled-content",
2068
- "props": {
2069
- "backgroundColor": "default",
2070
- "textAlignment": "left",
2071
- "textColor": "default",
2072
- },
2073
- "type": "paragraph",
2074
- },
2075
- {
2076
- "children": [],
2077
- "content": [
2078
- {
2079
- "styles": {},
2080
- "text": "Paragraph 4",
2081
- "type": "text",
2082
- },
2083
- ],
2084
- "id": "paragraph-4",
2085
- "props": {
2086
- "backgroundColor": "default",
2087
- "textAlignment": "left",
2088
- "textColor": "default",
2089
- },
2090
- "type": "paragraph",
2091
- },
2092
- {
2093
- "children": [],
2094
- "content": [
2095
- {
2096
- "styles": {},
2097
- "text": "Heading 1",
2098
- "type": "text",
2099
- },
2100
- ],
2101
- "id": "heading-0",
2102
- "props": {
2103
- "backgroundColor": "default",
2104
- "level": 1,
2105
- "textAlignment": "left",
2106
- "textColor": "default",
2107
- },
2108
- "type": "heading",
2109
- },
2110
- {
2111
- "children": [],
2112
- "content": [
2113
- {
2114
- "styles": {},
2115
- "text": "Paragraph 5",
2116
- "type": "text",
2117
- },
2118
- ],
2119
- "id": "paragraph-5",
2120
- "props": {
2121
- "backgroundColor": "default",
2122
- "textAlignment": "left",
2123
- "textColor": "default",
2124
- },
2125
- "type": "paragraph",
2126
- },
2127
- {
2128
- "children": [],
2129
- "content": undefined,
2130
- "id": "image-0",
2131
- "props": {
2132
- "backgroundColor": "default",
2133
- "caption": "",
2134
- "name": "",
2135
- "previewWidth": 512,
2136
- "showPreview": true,
2137
- "textAlignment": "left",
2138
- "url": "https://via.placeholder.com/150",
2139
- },
2140
- "type": "image",
2141
- },
2142
- {
2143
- "children": [],
2144
- "content": [
2145
- {
2146
- "styles": {},
2147
- "text": "Paragraph 6",
2148
- "type": "text",
2149
- },
2150
- ],
2151
- "id": "paragraph-6",
2152
- "props": {
2153
- "backgroundColor": "default",
2154
- "textAlignment": "left",
2155
- "textColor": "default",
2156
- },
2157
- "type": "paragraph",
2158
- },
2159
- {
2160
- "children": [],
2161
- "content": {
2162
- "columnWidths": [
2163
- undefined,
2164
- undefined,
2165
- undefined,
2166
- ],
2167
- "rows": [
2168
- {
2169
- "cells": [
2170
- [
2171
- {
2172
- "styles": {},
2173
- "text": "Cell 1",
2174
- "type": "text",
2175
- },
2176
- ],
2177
- [
2178
- {
2179
- "styles": {},
2180
- "text": "Cell 2",
2181
- "type": "text",
2182
- },
2183
- ],
2184
- [
2185
- {
2186
- "styles": {},
2187
- "text": "Cell 3",
2188
- "type": "text",
2189
- },
2190
- ],
2191
- ],
2192
- },
2193
- {
2194
- "cells": [
2195
- [
2196
- {
2197
- "styles": {},
2198
- "text": "Cell 4",
2199
- "type": "text",
2200
- },
2201
- ],
2202
- [
2203
- {
2204
- "styles": {},
2205
- "text": "Cell 5",
2206
- "type": "text",
2207
- },
2208
- ],
2209
- [
2210
- {
2211
- "styles": {},
2212
- "text": "Cell 6",
2213
- "type": "text",
2214
- },
2215
- ],
2216
- ],
2217
- },
2218
- {
2219
- "cells": [
2220
- [
2221
- {
2222
- "styles": {},
2223
- "text": "Cell 7",
2224
- "type": "text",
2225
- },
2226
- ],
2227
- [
2228
- {
2229
- "styles": {},
2230
- "text": "Cell 8",
2231
- "type": "text",
2232
- },
2233
- ],
2234
- [
2235
- {
2236
- "styles": {},
2237
- "text": "Cell 9",
2238
- "type": "text",
2239
- },
2240
- ],
2241
- ],
2242
- },
2243
- ],
2244
- "type": "tableContent",
2245
- },
2246
- "id": "table-0",
2247
- "props": {
2248
- "backgroundColor": "default",
2249
- "textColor": "default",
2250
- },
2251
- "type": "table",
2252
- },
2253
- {
2254
- "children": [],
2255
- "content": [
2256
- {
2257
- "styles": {},
2258
- "text": "Paragraph 7",
2259
- "type": "text",
2260
- },
2261
- ],
2262
- "id": "paragraph-7",
2263
- "props": {
2264
- "backgroundColor": "default",
2265
- "textAlignment": "left",
2266
- "textColor": "default",
2267
- },
2268
- "type": "paragraph",
2269
- },
2270
- {
2271
- "children": [],
2272
- "content": [],
2273
- "id": "empty-paragraph",
2274
- "props": {
2275
- "backgroundColor": "default",
2276
- "textAlignment": "left",
2277
- "textColor": "default",
2278
- },
2279
- "type": "paragraph",
2280
- },
2281
- {
2282
- "children": [],
2283
- "content": [
2284
- {
2285
- "styles": {},
2286
- "text": "Paragraph 8",
2287
- "type": "text",
2288
- },
2289
- ],
2290
- "id": "paragraph-8",
2291
- "props": {
2292
- "backgroundColor": "default",
2293
- "textAlignment": "left",
2294
- "textColor": "default",
2295
- },
2296
- "type": "paragraph",
2297
- },
2298
- {
2299
- "children": [
2300
- {
2301
- "children": [
2302
- {
2303
- "children": [],
2304
- "content": [
2305
- {
2306
- "styles": {},
2307
- "text": "Double Nested Paragraph 1",
2308
- "type": "text",
2309
- },
2310
- ],
2311
- "id": "double-nested-paragraph-1",
2312
- "props": {
2313
- "backgroundColor": "default",
2314
- "textAlignment": "left",
2315
- "textColor": "default",
2316
- },
2317
- "type": "paragraph",
2318
- },
2319
- ],
2320
- "content": [
2321
- {
2322
- "styles": {},
2323
- "text": "Nested Paragraph 1",
2324
- "type": "text",
2325
- },
2326
- ],
2327
- "id": "nested-paragraph-1",
2328
- "props": {
2329
- "backgroundColor": "default",
2330
- "textAlignment": "left",
2331
- "textColor": "default",
2332
- },
2333
- "type": "paragraph",
2334
- },
2335
- ],
2336
- "content": [
2337
- {
2338
- "styles": {
2339
- "bold": true,
2340
- },
2341
- "text": "Heading",
2342
- "type": "text",
2343
- },
2344
- {
2345
- "styles": {},
2346
- "text": " with styled ",
2347
- "type": "text",
2348
- },
2349
- {
2350
- "styles": {
2351
- "italic": true,
2352
- },
2353
- "text": "content",
2354
- "type": "text",
2355
- },
2356
- ],
2357
- "id": "heading-with-everything",
2358
- "props": {
2359
- "backgroundColor": "red",
2360
- "level": 2,
2361
- "textAlignment": "center",
2362
- "textColor": "red",
2363
- },
2364
- "type": "heading",
2365
- },
2366
- {
2367
- "children": [],
2368
- "content": [],
2369
- "id": "trailing-paragraph",
2370
- "props": {
2371
- "backgroundColor": "default",
2372
- "textAlignment": "left",
2373
- "textColor": "default",
2374
- },
2375
- "type": "paragraph",
2376
- },
2377
- ]
2378
- `;
2379
-
2380
1903
  exports[`Test updateBlock > Update inline content to no content 1`] = `
2381
1904
  [
2382
1905
  {
@@ -2719,7 +2242,6 @@ exports[`Test updateBlock > Update inline content to no content 1`] = `
2719
2242
  },
2720
2243
  "id": "table-0",
2721
2244
  "props": {
2722
- "backgroundColor": "default",
2723
2245
  "textColor": "default",
2724
2246
  },
2725
2247
  "type": "table",
@@ -2942,7 +2464,6 @@ exports[`Test updateBlock > Update inline content to table content 1`] = `
2942
2464
  },
2943
2465
  "id": "paragraph-0",
2944
2466
  "props": {
2945
- "backgroundColor": "default",
2946
2467
  "textColor": "default",
2947
2468
  },
2948
2469
  "type": "table",
@@ -3272,7 +2793,6 @@ exports[`Test updateBlock > Update inline content to table content 1`] = `
3272
2793
  },
3273
2794
  "id": "table-0",
3274
2795
  "props": {
3275
- "backgroundColor": "default",
3276
2796
  "textColor": "default",
3277
2797
  },
3278
2798
  "type": "table",
@@ -3744,7 +3264,6 @@ exports[`Test updateBlock > Update no content to empty inline content 1`] = `
3744
3264
  },
3745
3265
  "id": "table-0",
3746
3266
  "props": {
3747
- "backgroundColor": "default",
3748
3267
  "textColor": "default",
3749
3268
  },
3750
3269
  "type": "table",
@@ -4108,7 +3627,6 @@ exports[`Test updateBlock > Update no content to empty table content 1`] = `
4108
3627
  },
4109
3628
  "id": "image-0",
4110
3629
  "props": {
4111
- "backgroundColor": "default",
4112
3630
  "textColor": "default",
4113
3631
  },
4114
3632
  "type": "table",
@@ -4219,7 +3737,6 @@ exports[`Test updateBlock > Update no content to empty table content 1`] = `
4219
3737
  },
4220
3738
  "id": "table-0",
4221
3739
  "props": {
4222
- "backgroundColor": "default",
4223
3740
  "textColor": "default",
4224
3741
  },
4225
3742
  "type": "table",
@@ -4697,7 +4214,6 @@ exports[`Test updateBlock > Update no content to inline content 1`] = `
4697
4214
  },
4698
4215
  "id": "table-0",
4699
4216
  "props": {
4700
- "backgroundColor": "default",
4701
4217
  "textColor": "default",
4702
4218
  },
4703
4219
  "type": "table",
@@ -5141,7 +4657,6 @@ exports[`Test updateBlock > Update no content to table content 1`] = `
5141
4657
  },
5142
4658
  "id": "image-0",
5143
4659
  "props": {
5144
- "backgroundColor": "default",
5145
4660
  "textColor": "default",
5146
4661
  },
5147
4662
  "type": "table",
@@ -5252,7 +4767,6 @@ exports[`Test updateBlock > Update no content to table content 1`] = `
5252
4767
  },
5253
4768
  "id": "table-0",
5254
4769
  "props": {
5255
- "backgroundColor": "default",
5256
4770
  "textColor": "default",
5257
4771
  },
5258
4772
  "type": "table",
@@ -5728,7 +5242,6 @@ exports[`Test updateBlock > Update single prop 1`] = `
5728
5242
  },
5729
5243
  "id": "table-0",
5730
5244
  "props": {
5731
- "backgroundColor": "default",
5732
5245
  "textColor": "default",
5733
5246
  },
5734
5247
  "type": "table",
@@ -7393,7 +6906,6 @@ exports[`Test updateBlock > Update type 1`] = `
7393
6906
  },
7394
6907
  "id": "table-0",
7395
6908
  "props": {
7396
- "backgroundColor": "default",
7397
6909
  "textColor": "default",
7398
6910
  },
7399
6911
  "type": "table",
@@ -7868,7 +7380,6 @@ exports[`Test updateBlock > Update with plain content 1`] = `
7868
7380
  },
7869
7381
  "id": "table-0",
7870
7382
  "props": {
7871
- "backgroundColor": "default",
7872
7383
  "textColor": "default",
7873
7384
  },
7874
7385
  "type": "table",
@@ -8330,7 +7841,6 @@ exports[`Test updateBlock > Update with styled content 1`] = `
8330
7841
  },
8331
7842
  "id": "table-0",
8332
7843
  "props": {
8333
- "backgroundColor": "default",
8334
7844
  "textColor": "default",
8335
7845
  },
8336
7846
  "type": "table",
@@ -1,7 +1,7 @@
1
1
  export const acceptedMIMETypes = [
2
2
  "vscode-editor-data",
3
3
  "blocknote/html",
4
- "Files",
5
4
  "text/html",
6
5
  "text/plain",
6
+ "Files",
7
7
  ] as const;
@@ -6,10 +6,7 @@ import {
6
6
  InlineContentSchema,
7
7
  StyleSchema,
8
8
  } from "../../../schema/index.js";
9
- import {
10
- getBlockInfo,
11
- getNearestBlockContainerPos,
12
- } from "../../getBlockInfoFromPos.js";
9
+ import { getBlockInfo, getNearestBlockPos } from "../../getBlockInfoFromPos.js";
13
10
  import { acceptedMIMETypes } from "./acceptedMIMETypes.js";
14
11
 
15
12
  function checkFileExtensionsMatch(
@@ -50,6 +47,10 @@ export async function handleFileInsertion<
50
47
  S extends StyleSchema
51
48
  >(event: DragEvent | ClipboardEvent, editor: BlockNoteEditor<BSchema, I, S>) {
52
49
  if (!editor.uploadFile) {
50
+ // eslint-disable-next-line no-console
51
+ console.warn(
52
+ "Attempted ot insert file, but uploadFile is not set in the BlockNote editor options"
53
+ );
53
54
  return;
54
55
  }
55
56
 
@@ -135,7 +136,7 @@ export async function handleFileInsertion<
135
136
  return;
136
137
  }
137
138
 
138
- const posInfo = getNearestBlockContainerPos(
139
+ const posInfo = getNearestBlockPos(
139
140
  editor._tiptapEditor.state.doc,
140
141
  pos.pos
141
142
  );