@blocknote/core 0.21.0 → 0.22.0

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 (391) hide show
  1. package/dist/blocknote.js +1023 -999
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +7 -7
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/dist/webpack-stats.json +1 -1
  8. package/package.json +3 -3
  9. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraph.html +96 -0
  10. package/src/api/clipboard/__snapshots__/external/pasteEndOfParagraphText.html +96 -0
  11. package/src/api/clipboard/__snapshots__/external/pasteImage.html +111 -0
  12. package/src/api/clipboard/__snapshots__/external/pasteParagraphInCustomBlock.html +96 -0
  13. package/src/api/clipboard/__snapshots__/external/pasteTable.html +149 -0
  14. package/src/api/clipboard/__snapshots__/external/pasteTableInExistingTable.html +124 -0
  15. package/src/api/clipboard/__snapshots__/internal/paragraphInCustomBlock.html +1 -0
  16. package/src/api/clipboard/clipboardExternal.test.ts +161 -0
  17. package/src/api/clipboard/{clipboard.test.ts → clipboardInternal.test.ts} +60 -38
  18. package/src/api/clipboard/testUtil.ts +27 -0
  19. package/src/api/clipboard/toClipboard/copyExtension.ts +1 -0
  20. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +7 -1
  21. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +3 -1
  22. package/src/api/nodeConversions/nodeToBlock.ts +4 -1
  23. package/src/api/parsers/markdown/__snapshots__/pasted/styled.json +2 -2
  24. package/src/api/testUtil/partialBlockTestUtil.ts +4 -1
  25. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +3 -19
  26. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +3 -15
  27. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +11 -3
  28. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +25 -5
  29. package/src/editor/Block.css +3 -3
  30. package/src/editor/BlockNoteEditor.test.ts +21 -1
  31. package/src/editor/editor.css +6 -6
  32. package/src/editor/transformPasted.ts +57 -4
  33. package/src/schema/blocks/createSpec.ts +1 -1
  34. package/src/schema/blocks/internal.ts +16 -6
  35. package/src/schema/inlineContent/internal.ts +4 -1
  36. package/src/schema/propTypes.ts +41 -18
  37. package/types/src/api/blockManipulation/setupTestEnv.d.ts +8 -0
  38. package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
  39. package/types/src/api/clipboard/testUtil.d.ts +509 -0
  40. package/types/src/api/testUtil/cases/customBlocks.d.ts +8 -0
  41. package/types/src/api/testUtil/cases/customInlineContent.d.ts +8 -0
  42. package/types/src/api/testUtil/cases/customStyles.d.ts +8 -0
  43. package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +12 -0
  44. package/types/src/blocks/defaultBlocks.d.ts +16 -0
  45. package/types/src/editor/transformPasted.d.ts +8 -4
  46. package/types/src/schema/propTypes.d.ts +20 -2
  47. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js +0 -30
  48. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.js.map +0 -1
  49. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js +0 -99
  50. package/dist/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.js.map +0 -1
  51. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js +0 -97
  52. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.js.map +0 -1
  53. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js +0 -88
  54. package/dist/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.js.map +0 -1
  55. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js +0 -219
  56. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.js.map +0 -1
  57. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js +0 -175
  58. package/dist/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.js.map +0 -1
  59. package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js +0 -57
  60. package/dist/src/api/blockManipulation/commands/nestBlock/nestBlock.js.map +0 -1
  61. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js +0 -5
  62. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.js.map +0 -1
  63. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js +0 -31
  64. package/dist/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.js.map +0 -1
  65. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js +0 -71
  66. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.js.map +0 -1
  67. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js +0 -157
  68. package/dist/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.js.map +0 -1
  69. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js +0 -27
  70. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.js.map +0 -1
  71. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js +0 -67
  72. package/dist/src/api/blockManipulation/commands/splitBlock/splitBlock.test.js.map +0 -1
  73. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js +0 -148
  74. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.js.map +0 -1
  75. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js +0 -252
  76. package/dist/src/api/blockManipulation/commands/updateBlock/updateBlock.test.js.map +0 -1
  77. package/dist/src/api/blockManipulation/getBlock/getBlock.js +0 -56
  78. package/dist/src/api/blockManipulation/getBlock/getBlock.js.map +0 -1
  79. package/dist/src/api/blockManipulation/insertContentAt.js +0 -64
  80. package/dist/src/api/blockManipulation/insertContentAt.js.map +0 -1
  81. package/dist/src/api/blockManipulation/selections/selection.js +0 -149
  82. package/dist/src/api/blockManipulation/selections/selection.js.map +0 -1
  83. package/dist/src/api/blockManipulation/selections/selection.test.js +0 -39
  84. package/dist/src/api/blockManipulation/selections/selection.test.js.map +0 -1
  85. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js +0 -79
  86. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.js.map +0 -1
  87. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js +0 -33
  88. package/dist/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.js.map +0 -1
  89. package/dist/src/api/blockManipulation/setupTestEnv.js +0 -172
  90. package/dist/src/api/blockManipulation/setupTestEnv.js.map +0 -1
  91. package/dist/src/api/clipboard/clipboard.test.js +0 -249
  92. package/dist/src/api/clipboard/clipboard.test.js.map +0 -1
  93. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js +0 -8
  94. package/dist/src/api/clipboard/fromClipboard/acceptedMIMETypes.js.map +0 -1
  95. package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js +0 -38
  96. package/dist/src/api/clipboard/fromClipboard/fileDropExtension.js.map +0 -1
  97. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js +0 -111
  98. package/dist/src/api/clipboard/fromClipboard/handleFileInsertion.js.map +0 -1
  99. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js +0 -25
  100. package/dist/src/api/clipboard/fromClipboard/handleVSCodePaste.js.map +0 -1
  101. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js +0 -57
  102. package/dist/src/api/clipboard/fromClipboard/pasteExtension.js.map +0 -1
  103. package/dist/src/api/clipboard/toClipboard/copyExtension.js +0 -134
  104. package/dist/src/api/clipboard/toClipboard/copyExtension.js.map +0 -1
  105. package/dist/src/api/exporters/html/externalHTMLExporter.js +0 -35
  106. package/dist/src/api/exporters/html/externalHTMLExporter.js.map +0 -1
  107. package/dist/src/api/exporters/html/htmlConversion.test.js +0 -72
  108. package/dist/src/api/exporters/html/htmlConversion.test.js.map +0 -1
  109. package/dist/src/api/exporters/html/internalHTMLSerializer.js +0 -21
  110. package/dist/src/api/exporters/html/internalHTMLSerializer.js.map +0 -1
  111. package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js +0 -141
  112. package/dist/src/api/exporters/html/util/serializeBlocksExternalHTML.js.map +0 -1
  113. package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js +0 -96
  114. package/dist/src/api/exporters/html/util/serializeBlocksInternalHTML.js.map +0 -1
  115. package/dist/src/api/exporters/markdown/markdownExporter.js +0 -31
  116. package/dist/src/api/exporters/markdown/markdownExporter.js.map +0 -1
  117. package/dist/src/api/exporters/markdown/markdownExporter.test.js +0 -57
  118. package/dist/src/api/exporters/markdown/markdownExporter.test.js.map +0 -1
  119. package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js +0 -33
  120. package/dist/src/api/exporters/markdown/removeUnderlinesRehypePlugin.js.map +0 -1
  121. package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js +0 -37
  122. package/dist/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.js.map +0 -1
  123. package/dist/src/api/getBlockInfoFromPos.js +0 -165
  124. package/dist/src/api/getBlockInfoFromPos.js.map +0 -1
  125. package/dist/src/api/nodeConversions/blockToNode.js +0 -197
  126. package/dist/src/api/nodeConversions/blockToNode.js.map +0 -1
  127. package/dist/src/api/nodeConversions/fragmentToBlocks.js +0 -50
  128. package/dist/src/api/nodeConversions/fragmentToBlocks.js.map +0 -1
  129. package/dist/src/api/nodeConversions/nodeConversions.test.js +0 -54
  130. package/dist/src/api/nodeConversions/nodeConversions.test.js.map +0 -1
  131. package/dist/src/api/nodeConversions/nodeToBlock.js +0 -316
  132. package/dist/src/api/nodeConversions/nodeToBlock.js.map +0 -1
  133. package/dist/src/api/nodeUtil.js +0 -28
  134. package/dist/src/api/nodeUtil.js.map +0 -1
  135. package/dist/src/api/parsers/html/parseHTML.js +0 -19
  136. package/dist/src/api/parsers/html/parseHTML.js.map +0 -1
  137. package/dist/src/api/parsers/html/parseHTML.test.js +0 -470
  138. package/dist/src/api/parsers/html/parseHTML.test.js.map +0 -1
  139. package/dist/src/api/parsers/html/util/nestedLists.js +0 -106
  140. package/dist/src/api/parsers/html/util/nestedLists.js.map +0 -1
  141. package/dist/src/api/parsers/html/util/nestedLists.test.js +0 -166
  142. package/dist/src/api/parsers/html/util/nestedLists.test.js.map +0 -1
  143. package/dist/src/api/parsers/markdown/parseMarkdown.js +0 -52
  144. package/dist/src/api/parsers/markdown/parseMarkdown.js.map +0 -1
  145. package/dist/src/api/parsers/markdown/parseMarkdown.test.js +0 -112
  146. package/dist/src/api/parsers/markdown/parseMarkdown.test.js.map +0 -1
  147. package/dist/src/api/testUtil/cases/customBlocks.js +0 -313
  148. package/dist/src/api/testUtil/cases/customBlocks.js.map +0 -1
  149. package/dist/src/api/testUtil/cases/customInlineContent.js +0 -91
  150. package/dist/src/api/testUtil/cases/customInlineContent.js.map +0 -1
  151. package/dist/src/api/testUtil/cases/customStyles.js +0 -83
  152. package/dist/src/api/testUtil/cases/customStyles.js.map +0 -1
  153. package/dist/src/api/testUtil/cases/defaultSchema.js +0 -673
  154. package/dist/src/api/testUtil/cases/defaultSchema.js.map +0 -1
  155. package/dist/src/api/testUtil/index.js +0 -2
  156. package/dist/src/api/testUtil/index.js.map +0 -1
  157. package/dist/src/api/testUtil/partialBlockTestUtil.js +0 -114
  158. package/dist/src/api/testUtil/partialBlockTestUtil.js.map +0 -1
  159. package/dist/src/api/testUtil/paste.js +0 -29
  160. package/dist/src/api/testUtil/paste.js.map +0 -1
  161. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js +0 -104
  162. package/dist/src/blocks/AudioBlockContent/AudioBlockContent.js.map +0 -1
  163. package/dist/src/blocks/AudioBlockContent/parseAudioElement.js +0 -5
  164. package/dist/src/blocks/AudioBlockContent/parseAudioElement.js.map +0 -1
  165. package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js +0 -281
  166. package/dist/src/blocks/CodeBlockContent/CodeBlockContent.js.map +0 -1
  167. package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js +0 -110
  168. package/dist/src/blocks/CodeBlockContent/defaultSupportedLanguages.js.map +0 -1
  169. package/dist/src/blocks/FileBlockContent/FileBlockContent.js +0 -71
  170. package/dist/src/blocks/FileBlockContent/FileBlockContent.js.map +0 -1
  171. package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js +0 -5
  172. package/dist/src/blocks/FileBlockContent/helpers/parse/parseEmbedElement.js.map +0 -1
  173. package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js +0 -10
  174. package/dist/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.js.map +0 -1
  175. package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js +0 -39
  176. package/dist/src/blocks/FileBlockContent/helpers/render/createAddFileButton.js.map +0 -1
  177. package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js +0 -51
  178. package/dist/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.js.map +0 -1
  179. package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js +0 -17
  180. package/dist/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.js.map +0 -1
  181. package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js +0 -147
  182. package/dist/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.js.map +0 -1
  183. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js +0 -9
  184. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js.map +0 -1
  185. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js +0 -11
  186. package/dist/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js.map +0 -1
  187. package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js +0 -15
  188. package/dist/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.js.map +0 -1
  189. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js +0 -145
  190. package/dist/src/blocks/HeadingBlockContent/HeadingBlockContent.js.map +0 -1
  191. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js +0 -114
  192. package/dist/src/blocks/ImageBlockContent/ImageBlockContent.js.map +0 -1
  193. package/dist/src/blocks/ImageBlockContent/parseImageElement.js +0 -6
  194. package/dist/src/blocks/ImageBlockContent/parseImageElement.js.map +0 -1
  195. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js +0 -113
  196. package/dist/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.js.map +0 -1
  197. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js +0 -224
  198. package/dist/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.js.map +0 -1
  199. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js +0 -45
  200. package/dist/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.js.map +0 -1
  201. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js +0 -58
  202. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.js.map +0 -1
  203. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js +0 -130
  204. package/dist/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.js.map +0 -1
  205. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js +0 -52
  206. package/dist/src/blocks/ParagraphBlockContent/ParagraphBlockContent.js.map +0 -1
  207. package/dist/src/blocks/TableBlockContent/TableBlockContent.js +0 -129
  208. package/dist/src/blocks/TableBlockContent/TableBlockContent.js.map +0 -1
  209. package/dist/src/blocks/TableBlockContent/TableExtension.js +0 -64
  210. package/dist/src/blocks/TableBlockContent/TableExtension.js.map +0 -1
  211. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js +0 -114
  212. package/dist/src/blocks/VideoBlockContent/VideoBlockContent.js.map +0 -1
  213. package/dist/src/blocks/VideoBlockContent/parseVideoElement.js +0 -6
  214. package/dist/src/blocks/VideoBlockContent/parseVideoElement.js.map +0 -1
  215. package/dist/src/blocks/defaultBlockHelpers.js +0 -50
  216. package/dist/src/blocks/defaultBlockHelpers.js.map +0 -1
  217. package/dist/src/blocks/defaultBlockTypeGuards.js +0 -40
  218. package/dist/src/blocks/defaultBlockTypeGuards.js.map +0 -1
  219. package/dist/src/blocks/defaultBlocks.js +0 -50
  220. package/dist/src/blocks/defaultBlocks.js.map +0 -1
  221. package/dist/src/blocks/defaultProps.js +0 -19
  222. package/dist/src/blocks/defaultProps.js.map +0 -1
  223. package/dist/src/editor/BlockNoteEditor.js +0 -751
  224. package/dist/src/editor/BlockNoteEditor.js.map +0 -1
  225. package/dist/src/editor/BlockNoteEditor.test.js +0 -65
  226. package/dist/src/editor/BlockNoteEditor.test.js.map +0 -1
  227. package/dist/src/editor/BlockNoteExtensions.js +0 -192
  228. package/dist/src/editor/BlockNoteExtensions.js.map +0 -1
  229. package/dist/src/editor/BlockNoteSchema.js +0 -38
  230. package/dist/src/editor/BlockNoteSchema.js.map +0 -1
  231. package/dist/src/editor/BlockNoteTipTapEditor.js +0 -169
  232. package/dist/src/editor/BlockNoteTipTapEditor.js.map +0 -1
  233. package/dist/src/editor/cursorPositionTypes.js +0 -2
  234. package/dist/src/editor/cursorPositionTypes.js.map +0 -1
  235. package/dist/src/editor/defaultColors.js +0 -77
  236. package/dist/src/editor/defaultColors.js.map +0 -1
  237. package/dist/src/editor/selectionTypes.js +0 -2
  238. package/dist/src/editor/selectionTypes.js.map +0 -1
  239. package/dist/src/editor/transformPasted.js +0 -79
  240. package/dist/src/editor/transformPasted.js.map +0 -1
  241. package/dist/src/exporter/Exporter.js +0 -36
  242. package/dist/src/exporter/Exporter.js.map +0 -1
  243. package/dist/src/exporter/index.js +0 -3
  244. package/dist/src/exporter/index.js.map +0 -1
  245. package/dist/src/exporter/mapping.js +0 -12
  246. package/dist/src/exporter/mapping.js.map +0 -1
  247. package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js +0 -30
  248. package/dist/src/extensions/BackgroundColor/BackgroundColorExtension.js.map +0 -1
  249. package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js +0 -39
  250. package/dist/src/extensions/BackgroundColor/BackgroundColorMark.js.map +0 -1
  251. package/dist/src/extensions/FilePanel/FilePanelPlugin.js +0 -131
  252. package/dist/src/extensions/FilePanel/FilePanelPlugin.js.map +0 -1
  253. package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js +0 -197
  254. package/dist/src/extensions/FormattingToolbar/FormattingToolbarPlugin.js.map +0 -1
  255. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js +0 -341
  256. package/dist/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.js.map +0 -1
  257. package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js +0 -251
  258. package/dist/src/extensions/LinkToolbar/LinkToolbarPlugin.js.map +0 -1
  259. package/dist/src/extensions/LinkToolbar/protocols.js +0 -14
  260. package/dist/src/extensions/LinkToolbar/protocols.js.map +0 -1
  261. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js +0 -54
  262. package/dist/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.js.map +0 -1
  263. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js +0 -90
  264. package/dist/src/extensions/Placeholder/PlaceholderPlugin.js.map +0 -1
  265. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js +0 -187
  266. package/dist/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.js.map +0 -1
  267. package/dist/src/extensions/SideMenu/MultipleNodeSelection.js +0 -68
  268. package/dist/src/extensions/SideMenu/MultipleNodeSelection.js.map +0 -1
  269. package/dist/src/extensions/SideMenu/SideMenuPlugin.js +0 -347
  270. package/dist/src/extensions/SideMenu/SideMenuPlugin.js.map +0 -1
  271. package/dist/src/extensions/SideMenu/dragging.js +0 -135
  272. package/dist/src/extensions/SideMenu/dragging.js.map +0 -1
  273. package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js +0 -2
  274. package/dist/src/extensions/SuggestionMenu/DefaultGridSuggestionItem.js.map +0 -1
  275. package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js +0 -2
  276. package/dist/src/extensions/SuggestionMenu/DefaultSuggestionItem.js.map +0 -1
  277. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js +0 -245
  278. package/dist/src/extensions/SuggestionMenu/SuggestionPlugin.js.map +0 -1
  279. package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js +0 -26
  280. package/dist/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.js.map +0 -1
  281. package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js +0 -241
  282. package/dist/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.js.map +0 -1
  283. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js +0 -579
  284. package/dist/src/extensions/TableHandles/TableHandlesPlugin.js.map +0 -1
  285. package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js +0 -36
  286. package/dist/src/extensions/TextAlignment/TextAlignmentExtension.js.map +0 -1
  287. package/dist/src/extensions/TextColor/TextColorExtension.js +0 -29
  288. package/dist/src/extensions/TextColor/TextColorExtension.js.map +0 -1
  289. package/dist/src/extensions/TextColor/TextColorMark.js +0 -37
  290. package/dist/src/extensions/TextColor/TextColorMark.js.map +0 -1
  291. package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js +0 -58
  292. package/dist/src/extensions/TrailingNode/TrailingNodeExtension.js.map +0 -1
  293. package/dist/src/extensions/UniqueID/UniqueID.js +0 -283
  294. package/dist/src/extensions/UniqueID/UniqueID.js.map +0 -1
  295. package/dist/src/extensions/getDraggableBlockFromElement.js +0 -13
  296. package/dist/src/extensions/getDraggableBlockFromElement.js.map +0 -1
  297. package/dist/src/extensions-shared/UiElementPosition.js +0 -2
  298. package/dist/src/extensions-shared/UiElementPosition.js.map +0 -1
  299. package/dist/src/i18n/dictionary.js +0 -4
  300. package/dist/src/i18n/dictionary.js.map +0 -1
  301. package/dist/src/i18n/locales/ar.js +0 -298
  302. package/dist/src/i18n/locales/ar.js.map +0 -1
  303. package/dist/src/i18n/locales/de.js +0 -313
  304. package/dist/src/i18n/locales/de.js.map +0 -1
  305. package/dist/src/i18n/locales/en.js +0 -314
  306. package/dist/src/i18n/locales/en.js.map +0 -1
  307. package/dist/src/i18n/locales/es.js +0 -312
  308. package/dist/src/i18n/locales/es.js.map +0 -1
  309. package/dist/src/i18n/locales/fr.js +0 -313
  310. package/dist/src/i18n/locales/fr.js.map +0 -1
  311. package/dist/src/i18n/locales/hr.js +0 -308
  312. package/dist/src/i18n/locales/hr.js.map +0 -1
  313. package/dist/src/i18n/locales/index.js +0 -16
  314. package/dist/src/i18n/locales/index.js.map +0 -1
  315. package/dist/src/i18n/locales/is.js +0 -305
  316. package/dist/src/i18n/locales/is.js.map +0 -1
  317. package/dist/src/i18n/locales/ja.js +0 -333
  318. package/dist/src/i18n/locales/ja.js.map +0 -1
  319. package/dist/src/i18n/locales/ko.js +0 -326
  320. package/dist/src/i18n/locales/ko.js.map +0 -1
  321. package/dist/src/i18n/locales/nl.js +0 -313
  322. package/dist/src/i18n/locales/nl.js.map +0 -1
  323. package/dist/src/i18n/locales/pl.js +0 -297
  324. package/dist/src/i18n/locales/pl.js.map +0 -1
  325. package/dist/src/i18n/locales/pt.js +0 -305
  326. package/dist/src/i18n/locales/pt.js.map +0 -1
  327. package/dist/src/i18n/locales/ru.js +0 -340
  328. package/dist/src/i18n/locales/ru.js.map +0 -1
  329. package/dist/src/i18n/locales/vi.js +0 -312
  330. package/dist/src/i18n/locales/vi.js.map +0 -1
  331. package/dist/src/i18n/locales/zh.js +0 -346
  332. package/dist/src/i18n/locales/zh.js.map +0 -1
  333. package/dist/src/index.js +0 -63
  334. package/dist/src/index.js.map +0 -1
  335. package/dist/src/pm-nodes/BlockContainer.js +0 -72
  336. package/dist/src/pm-nodes/BlockContainer.js.map +0 -1
  337. package/dist/src/pm-nodes/BlockGroup.js +0 -43
  338. package/dist/src/pm-nodes/BlockGroup.js.map +0 -1
  339. package/dist/src/pm-nodes/Doc.js +0 -7
  340. package/dist/src/pm-nodes/Doc.js.map +0 -1
  341. package/dist/src/pm-nodes/index.js +0 -4
  342. package/dist/src/pm-nodes/index.js.map +0 -1
  343. package/dist/src/schema/blocks/createSpec.js +0 -126
  344. package/dist/src/schema/blocks/createSpec.js.map +0 -1
  345. package/dist/src/schema/blocks/internal.js +0 -147
  346. package/dist/src/schema/blocks/internal.js.map +0 -1
  347. package/dist/src/schema/blocks/types.js +0 -2
  348. package/dist/src/schema/blocks/types.js.map +0 -1
  349. package/dist/src/schema/index.js +0 -11
  350. package/dist/src/schema/index.js.map +0 -1
  351. package/dist/src/schema/inlineContent/createSpec.js +0 -64
  352. package/dist/src/schema/inlineContent/createSpec.js.map +0 -1
  353. package/dist/src/schema/inlineContent/internal.js +0 -52
  354. package/dist/src/schema/inlineContent/internal.js.map +0 -1
  355. package/dist/src/schema/inlineContent/types.js +0 -10
  356. package/dist/src/schema/inlineContent/types.js.map +0 -1
  357. package/dist/src/schema/propTypes.js +0 -2
  358. package/dist/src/schema/propTypes.js.map +0 -1
  359. package/dist/src/schema/styles/createSpec.js +0 -48
  360. package/dist/src/schema/styles/createSpec.js.map +0 -1
  361. package/dist/src/schema/styles/internal.js +0 -53
  362. package/dist/src/schema/styles/internal.js.map +0 -1
  363. package/dist/src/schema/styles/types.js +0 -2
  364. package/dist/src/schema/styles/types.js.map +0 -1
  365. package/dist/src/util/EventEmitter.js +0 -33
  366. package/dist/src/util/EventEmitter.js.map +0 -1
  367. package/dist/src/util/browser.js +0 -17
  368. package/dist/src/util/browser.js.map +0 -1
  369. package/dist/src/util/combineByGroup.js +0 -20
  370. package/dist/src/util/combineByGroup.js.map +0 -1
  371. package/dist/src/util/esmDependencies.js +0 -35
  372. package/dist/src/util/esmDependencies.js.map +0 -1
  373. package/dist/src/util/string.js +0 -14
  374. package/dist/src/util/string.js.map +0 -1
  375. package/dist/src/util/typescript.js +0 -12
  376. package/dist/src/util/typescript.js.map +0 -1
  377. /package/src/api/clipboard/__snapshots__/{childToParent.html → internal/childToParent.html} +0 -0
  378. /package/src/api/clipboard/__snapshots__/{childrenToNextParent.html → internal/childrenToNextParent.html} +0 -0
  379. /package/src/api/clipboard/__snapshots__/{childrenToNextParentsChildren.html → internal/childrenToNextParentsChildren.html} +0 -0
  380. /package/src/api/clipboard/__snapshots__/{image.html → internal/image.html} +0 -0
  381. /package/src/api/clipboard/__snapshots__/{multipleChildren.html → internal/multipleChildren.html} +0 -0
  382. /package/src/api/clipboard/__snapshots__/{multipleStyledText.html → internal/multipleStyledText.html} +0 -0
  383. /package/src/api/clipboard/__snapshots__/{nestedImage.html → internal/nestedImage.html} +0 -0
  384. /package/src/api/clipboard/__snapshots__/{partialChildToParent.html → internal/partialChildToParent.html} +0 -0
  385. /package/src/api/clipboard/__snapshots__/{styledText.html → internal/styledText.html} +0 -0
  386. /package/src/api/clipboard/__snapshots__/{tableAllCells.html → internal/tableAllCells.html} +0 -0
  387. /package/src/api/clipboard/__snapshots__/{tableCell.html → internal/tableCell.html} +0 -0
  388. /package/src/api/clipboard/__snapshots__/{tableCellText.html → internal/tableCellText.html} +0 -0
  389. /package/src/api/clipboard/__snapshots__/{tableRow.html → internal/tableRow.html} +0 -0
  390. /package/src/api/clipboard/__snapshots__/{unstyledText.html → internal/unstyledText.html} +0 -0
  391. /package/types/src/api/clipboard/{clipboard.test.d.ts → clipboardExternal.test.d.ts} +0 -0
@@ -1,45 +0,0 @@
1
- import { splitBlockCommand } from "../../api/blockManipulation/commands/splitBlock/splitBlock.js";
2
- import { updateBlockCommand } from "../../api/blockManipulation/commands/updateBlock/updateBlock.js";
3
- import { getBlockInfoFromSelection } from "../../api/getBlockInfoFromPos.js";
4
- export const handleEnter = (editor) => {
5
- const ttEditor = editor._tiptapEditor;
6
- const blockInfo = getBlockInfoFromSelection(ttEditor.state);
7
- if (!blockInfo.isBlockContainer) {
8
- return false;
9
- }
10
- const { bnBlock: blockContainer, blockContent } = blockInfo;
11
- const selectionEmpty = ttEditor.state.selection.anchor === ttEditor.state.selection.head;
12
- if (!(blockContent.node.type.name === "bulletListItem" ||
13
- blockContent.node.type.name === "numberedListItem" ||
14
- blockContent.node.type.name === "checkListItem") ||
15
- !selectionEmpty) {
16
- return false;
17
- }
18
- return ttEditor.commands.first(({ state, chain, commands }) => [
19
- () =>
20
- // Changes list item block to a paragraph block if the content is empty.
21
- commands.command(() => {
22
- if (blockContent.node.childCount === 0) {
23
- return commands.command(updateBlockCommand(editor, blockContainer.beforePos, {
24
- type: "paragraph",
25
- props: {},
26
- }));
27
- }
28
- return false;
29
- }),
30
- () =>
31
- // Splits the current block, moving content inside that's after the cursor
32
- // to a new block of the same type below.
33
- commands.command(() => {
34
- if (blockContent.node.childCount > 0) {
35
- chain()
36
- .deleteSelection()
37
- .command(splitBlockCommand(state.selection.from, true))
38
- .run();
39
- return true;
40
- }
41
- return false;
42
- }),
43
- ]);
44
- };
45
- //# sourceMappingURL=ListItemKeyboardShortcuts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItemKeyboardShortcuts.js","sourceRoot":"","sources":["../../../../src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MA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ACjB,KAAK,EAAE,EAAE;iBACV,CAAC,CACH,CAAC;YACJ,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QAEJ,GAAG,EAAE;QACH,0EAA0E;QAC1E,yCAAyC;QACzC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE;YACpB,IAAI,YAAY,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;gBACrC,KAAK,EAAE;qBACJ,eAAe,EAAE;qBACjB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;qBACtD,GAAG,EAAE,CAAC;gBAET,OAAO,IAAI,CAAC;YACd,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;KACL,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,58 +0,0 @@
1
- import { Plugin, PluginKey } from "prosemirror-state";
2
- import { getBlockInfo } from "../../../api/getBlockInfoFromPos.js";
3
- // ProseMirror Plugin which automatically assigns indices to ordered list items per nesting level.
4
- const PLUGIN_KEY = new PluginKey(`numbered-list-indexing`);
5
- export const NumberedListIndexingPlugin = () => {
6
- return new Plugin({
7
- key: PLUGIN_KEY,
8
- appendTransaction: (_transactions, _oldState, newState) => {
9
- const tr = newState.tr;
10
- tr.setMeta("numberedListIndexing", true);
11
- let modified = false;
12
- // Traverses each node the doc using DFS, so blocks which are on the same nesting level will be traversed in the
13
- // same order they appear. This means the index of each list item block can be calculated by incrementing the
14
- // index of the previous list item block.
15
- newState.doc.descendants((node, pos) => {
16
- if (node.type.name === "blockContainer" &&
17
- node.firstChild.type.name === "numberedListItem") {
18
- let newIndex = "1";
19
- const blockInfo = getBlockInfo({
20
- posBeforeNode: pos,
21
- node,
22
- });
23
- if (!blockInfo.isBlockContainer) {
24
- throw new Error("impossible");
25
- }
26
- // Checks if this block is the start of a new ordered list, i.e. if it's the first block in the document, the
27
- // first block in its nesting level, or the previous block is not an ordered list item.
28
- const prevBlock = tr.doc.resolve(blockInfo.bnBlock.beforePos).nodeBefore;
29
- if (prevBlock) {
30
- const prevBlockInfo = getBlockInfo({
31
- posBeforeNode: blockInfo.bnBlock.beforePos - prevBlock.nodeSize,
32
- node: prevBlock,
33
- });
34
- const isPrevBlockOrderedListItem = prevBlockInfo.blockNoteType === "numberedListItem";
35
- if (isPrevBlockOrderedListItem) {
36
- if (!prevBlockInfo.isBlockContainer) {
37
- throw new Error("impossible");
38
- }
39
- const prevBlockIndex = prevBlockInfo.blockContent.node.attrs["index"];
40
- newIndex = (parseInt(prevBlockIndex) + 1).toString();
41
- }
42
- }
43
- const contentNode = blockInfo.blockContent.node;
44
- const index = contentNode.attrs["index"];
45
- if (index !== newIndex) {
46
- modified = true;
47
- tr.setNodeMarkup(blockInfo.blockContent.beforePos, undefined, {
48
- ...contentNode.attrs,
49
- index: newIndex,
50
- });
51
- }
52
- }
53
- });
54
- return modified ? tr : null;
55
- },
56
- });
57
- };
58
- //# sourceMappingURL=NumberedListIndexingPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NumberedListIndexingPlugin.js","sourceRoot":"","sources":["../../../../../src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,kGAAkG;AAClG,MAAM,UAAU,GAAG,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,OAAO,IAAI,MAAM,CAAC;QAChB,GAAG,EAAE,UAAU;QACf,iBAAiB,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;YACxD,MAAM,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;YACvB,EAAE,CAAC,OAAO,CAAC,sBAA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AAG,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;wBACvD,CAAC;oBACH,CAAC;oBAED,MAAM,WAAW,GAAG,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC;oBAChD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBAEzC,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;wBACvB,QAAQ,GAAG,IAAI,CAAC;wBAEhB,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE;4BAC5D,GAAG,WAAW,CAAC,KAAK;4BACpB,KAAK,EAAE,QAAQ;yBAChB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9B,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,130 +0,0 @@
1
- import { InputRule } from "@tiptap/core";
2
- import { updateBlockCommand } from "../../../api/blockManipulation/commands/updateBlock/updateBlock.js";
3
- import { getBlockInfoFromSelection } from "../../../api/getBlockInfoFromPos.js";
4
- import { createBlockSpecFromStronglyTypedTiptapNode, createStronglyTypedTiptapNode, } from "../../../schema/index.js";
5
- import { createDefaultBlockDOMOutputSpec } from "../../defaultBlockHelpers.js";
6
- import { defaultProps } from "../../defaultProps.js";
7
- import { handleEnter } from "../ListItemKeyboardShortcuts.js";
8
- import { NumberedListIndexingPlugin } from "./NumberedListIndexingPlugin.js";
9
- export const numberedListItemPropSchema = {
10
- ...defaultProps,
11
- };
12
- const NumberedListItemBlockContent = createStronglyTypedTiptapNode({
13
- name: "numberedListItem",
14
- content: "inline*",
15
- group: "blockContent",
16
- priority: 90,
17
- addAttributes() {
18
- return {
19
- index: {
20
- default: null,
21
- parseHTML: (element) => element.getAttribute("data-index"),
22
- renderHTML: (attributes) => {
23
- return {
24
- "data-index": attributes.index,
25
- };
26
- },
27
- },
28
- };
29
- },
30
- addInputRules() {
31
- return [
32
- // Creates an ordered list when starting with "1.".
33
- new InputRule({
34
- find: new RegExp(`^1\\.\\s$`),
35
- handler: ({ state, chain, range }) => {
36
- const blockInfo = getBlockInfoFromSelection(state);
37
- if (!blockInfo.isBlockContainer ||
38
- blockInfo.blockContent.node.type.spec.content !== "inline*") {
39
- return;
40
- }
41
- chain()
42
- .command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
43
- type: "numberedListItem",
44
- props: {},
45
- }))
46
- // Removes the "1." characters used to set the list.
47
- .deleteRange({ from: range.from, to: range.to });
48
- },
49
- }),
50
- ];
51
- },
52
- addKeyboardShortcuts() {
53
- return {
54
- Enter: () => handleEnter(this.options.editor),
55
- "Mod-Shift-7": () => {
56
- const blockInfo = getBlockInfoFromSelection(this.editor.state);
57
- if (!blockInfo.isBlockContainer ||
58
- blockInfo.blockContent.node.type.spec.content !== "inline*") {
59
- return true;
60
- }
61
- return this.editor.commands.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
62
- type: "numberedListItem",
63
- props: {},
64
- }));
65
- },
66
- };
67
- },
68
- addProseMirrorPlugins() {
69
- return [NumberedListIndexingPlugin()];
70
- },
71
- parseHTML() {
72
- return [
73
- {
74
- tag: "div[data-content-type=" + this.name + "]", // TODO: remove if we can't come up with test case that needs this
75
- },
76
- // Case for regular HTML list structure.
77
- // (e.g.: when pasting from other apps)
78
- {
79
- tag: "li",
80
- getAttrs: (element) => {
81
- if (typeof element === "string") {
82
- return false;
83
- }
84
- const parent = element.parentElement;
85
- if (parent === null) {
86
- return false;
87
- }
88
- if (parent.tagName === "OL" ||
89
- (parent.tagName === "DIV" && parent.parentElement.tagName === "OL")) {
90
- return {};
91
- }
92
- return false;
93
- },
94
- node: "numberedListItem",
95
- },
96
- // Case for BlockNote list structure.
97
- // (e.g.: when pasting from blocknote)
98
- {
99
- tag: "p",
100
- getAttrs: (element) => {
101
- if (typeof element === "string") {
102
- return false;
103
- }
104
- const parent = element.parentElement;
105
- if (parent === null) {
106
- return false;
107
- }
108
- if (parent.getAttribute("data-content-type") === "numberedListItem") {
109
- return {};
110
- }
111
- return false;
112
- },
113
- priority: 300,
114
- node: "numberedListItem",
115
- },
116
- ];
117
- },
118
- renderHTML({ HTMLAttributes }) {
119
- return createDefaultBlockDOMOutputSpec(this.name,
120
- // We use a <p> tag, because for <li> tags we'd need an <ol> element to
121
- // put them in to be semantically correct, which we can't have due to the
122
- // schema.
123
- "p", {
124
- ...(this.options.domAttributes?.blockContent || {}),
125
- ...HTMLAttributes,
126
- }, this.options.domAttributes?.inlineContent || {});
127
- },
128
- });
129
- export const NumberedListItem = createBlockSpecFromStronglyTypedTiptapNode(NumberedListItemBlockContent, numberedListItemPropSchema);
130
- //# sourceMappingURL=NumberedListItemBlockContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NumberedListItemBlockContent.js","sourceRoot":"","sources":["../../../../../src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oEAAoE,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAEL,0CAA0C,EAC1C,6BAA6B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,GAAG,YAAY;CACK,CAAC;AAEvB,MAAM,4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AAO,KAAK,IAAI,CAAC,EACpE,CAAC;wBACD,OAAO,EAAE,CAAC;oBACZ,CAAC;oBAED,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,EAAE,kBAAkB;aACzB;YACD,qCAAqC;YACrC,sCAAsC;YACtC;gBACE,GAAG,EAAE,GAAG;gBACR,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;oBACpB,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;wBAChC,OAAO,KAAK,CAAC;oBACf,CAAC;oBAED,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;oBAErC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;wBACpB,OAAO,KAAK,CAAC;oBACf,CAAC;oBAED,IAAI,MAAM,CAAC,YAAY,CAAC,mBAAmB,CAAC,KAAK,kBAAkB,EAAE,CAAC;wBACpE,OAAO,EAAE,CAAC;oBACZ,CAAC;oBAED,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,QAAQ,EAAE,GAAG;gBACb,IAAI,EAAE,kBAAkB;aACzB;SACF,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,+BAA+B,CACpC,IAAI,CAAC,IAAI;QACT,uEAAuE;QACvE,yEAAyE;QACzE,UAAU;QACV,GAAG,EACH;YACE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,IAAI,EAAE,CAAC;YACnD,GAAG,cAAc;SAClB,EACD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,IAAI,EAAE,CAChD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,0CAA0C,CACxE,4BAA4B,EAC5B,0BAA0B,CAC3B,CAAC"}
@@ -1,52 +0,0 @@
1
- import { updateBlockCommand } from "../../api/blockManipulation/commands/updateBlock/updateBlock.js";
2
- import { getBlockInfoFromSelection } from "../../api/getBlockInfoFromPos.js";
3
- import { createBlockSpecFromStronglyTypedTiptapNode, createStronglyTypedTiptapNode, } from "../../schema/index.js";
4
- import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers.js";
5
- import { defaultProps } from "../defaultProps.js";
6
- export const paragraphPropSchema = {
7
- ...defaultProps,
8
- };
9
- export const ParagraphBlockContent = createStronglyTypedTiptapNode({
10
- name: "paragraph",
11
- content: "inline*",
12
- group: "blockContent",
13
- addKeyboardShortcuts() {
14
- return {
15
- "Mod-Alt-0": () => {
16
- const blockInfo = getBlockInfoFromSelection(this.editor.state);
17
- if (!blockInfo.isBlockContainer ||
18
- blockInfo.blockContent.node.type.spec.content !== "inline*") {
19
- return true;
20
- }
21
- return this.editor.commands.command(updateBlockCommand(this.options.editor, blockInfo.bnBlock.beforePos, {
22
- type: "paragraph",
23
- props: {},
24
- }));
25
- },
26
- };
27
- },
28
- parseHTML() {
29
- return [
30
- { tag: "div[data-content-type=" + this.name + "]" },
31
- {
32
- tag: "p",
33
- priority: 200,
34
- getAttrs: (element) => {
35
- if (typeof element === "string" || !element.textContent?.trim()) {
36
- return false;
37
- }
38
- return {};
39
- },
40
- node: "paragraph",
41
- },
42
- ];
43
- },
44
- renderHTML({ HTMLAttributes }) {
45
- return createDefaultBlockDOMOutputSpec(this.name, "p", {
46
- ...(this.options.domAttributes?.blockContent || {}),
47
- ...HTMLAttributes,
48
- }, this.options.domAttributes?.inlineContent || {});
49
- },
50
- });
51
- export const Paragraph = createBlockSpecFromStronglyTypedTiptapNode(ParagraphBlockContent, paragraphPropSchema);
52
- //# sourceMappingURL=ParagraphBlockContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParagraphBlockContent.js","sourceRoot":"","sources":["../../../../src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7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,OAAO,KAAK,CAAC;oBACf,CAAC;oBAED,OAAO,EAAE,CAAC;gBACZ,CAAC;gBACD,IAAI,EAAE,WAAW;aAClB;SACF,CAAC;IACJ,CAAC;IAED,UAAU,CAAC,EAAE,cAAc,EAAE;QAC3B,OAAO,+BAA+B,CACpC,IAAI,CAAC,IAAI,EACT,GAAG,EACH;YACE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,YAAY,IAAI,EAAE,CAAC;YACnD,GAAG,cAAc;SAClB,EACD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,IAAI,EAAE,CAChD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,0CAA0C,CACjE,qBAAqB,EACrB,mBAAmB,CACpB,CAAC"}
@@ -1,129 +0,0 @@
1
- import { Node } from "@tiptap/core";
2
- import { TableCell } from "@tiptap/extension-table-cell";
3
- import { TableHeader } from "@tiptap/extension-table-header";
4
- import { TableRow } from "@tiptap/extension-table-row";
5
- import { TableView } from "prosemirror-tables";
6
- import { createBlockSpecFromStronglyTypedTiptapNode, createStronglyTypedTiptapNode, } from "../../schema/index.js";
7
- import { mergeCSSClasses } from "../../util/browser.js";
8
- import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers.js";
9
- import { defaultProps } from "../defaultProps.js";
10
- import { EMPTY_CELL_WIDTH, TableExtension } from "./TableExtension.js";
11
- export const tablePropSchema = {
12
- textColor: defaultProps.textColor,
13
- };
14
- export const TableBlockContent = createStronglyTypedTiptapNode({
15
- name: "table",
16
- content: "tableRow+",
17
- group: "blockContent",
18
- tableRole: "table",
19
- isolating: true,
20
- parseHTML() {
21
- return [{ tag: "table" }];
22
- },
23
- renderHTML({ HTMLAttributes }) {
24
- return createDefaultBlockDOMOutputSpec(this.name, "table", {
25
- ...(this.options.domAttributes?.blockContent || {}),
26
- ...HTMLAttributes,
27
- }, this.options.domAttributes?.inlineContent || {});
28
- },
29
- // This node view is needed for the `columnResizing` plugin. By default, the
30
- // plugin adds its own node view, which overrides how the node is rendered vs
31
- // `renderHTML`. This means that the wrapping `blockContent` HTML element is
32
- // no longer rendered. The `columnResizing` plugin uses the `TableView` as its
33
- // default node view. `BlockNoteTableView` extends it by wrapping it in a
34
- // `blockContent` element, so the DOM structure is consistent with other block
35
- // types.
36
- addNodeView() {
37
- return ({ node, HTMLAttributes }) => {
38
- class BlockNoteTableView extends TableView {
39
- node;
40
- cellMinWidth;
41
- blockContentHTMLAttributes;
42
- constructor(node, cellMinWidth, blockContentHTMLAttributes) {
43
- super(node, cellMinWidth);
44
- this.node = node;
45
- this.cellMinWidth = cellMinWidth;
46
- this.blockContentHTMLAttributes = blockContentHTMLAttributes;
47
- const blockContent = document.createElement("div");
48
- blockContent.className = mergeCSSClasses("bn-block-content", blockContentHTMLAttributes.class);
49
- blockContent.setAttribute("data-content-type", "table");
50
- for (const [attribute, value] of Object.entries(blockContentHTMLAttributes)) {
51
- if (attribute !== "class") {
52
- blockContent.setAttribute(attribute, value);
53
- }
54
- }
55
- const tableWrapper = this.dom;
56
- const tableWrapperInner = document.createElement("div");
57
- tableWrapperInner.className = "tableWrapper-inner";
58
- tableWrapperInner.appendChild(tableWrapper.firstChild);
59
- tableWrapper.appendChild(tableWrapperInner);
60
- blockContent.appendChild(tableWrapper);
61
- const floatingContainer = document.createElement("div");
62
- floatingContainer.className = "table-widgets-container";
63
- floatingContainer.style.position = "relative";
64
- tableWrapper.appendChild(floatingContainer);
65
- this.dom = blockContent;
66
- }
67
- ignoreMutation(record) {
68
- return (!record.target.closest(".tableWrapper-inner") ||
69
- super.ignoreMutation(record));
70
- }
71
- }
72
- return new BlockNoteTableView(node, EMPTY_CELL_WIDTH, {
73
- ...(this.options.domAttributes?.blockContent || {}),
74
- ...HTMLAttributes,
75
- });
76
- };
77
- },
78
- });
79
- const TableParagraph = Node.create({
80
- name: "tableParagraph",
81
- group: "tableContent",
82
- content: "inline*",
83
- parseHTML() {
84
- return [
85
- {
86
- preserveWhitespace: "full",
87
- // set this rule as high priority so it takes precedence over the default paragraph rule,
88
- // but only if we're in the tableContent context
89
- priority: 210,
90
- context: "tableContent",
91
- tag: "p",
92
- getAttrs: (_element) => {
93
- return {};
94
- },
95
- },
96
- {
97
- tag: "p",
98
- getAttrs: (element) => {
99
- if (typeof element === "string" || !element.textContent) {
100
- return false;
101
- }
102
- const parent = element.parentElement;
103
- if (parent === null) {
104
- return false;
105
- }
106
- if (parent.tagName === "TD") {
107
- return {};
108
- }
109
- return false;
110
- },
111
- },
112
- ];
113
- },
114
- renderHTML({ HTMLAttributes }) {
115
- return ["p", HTMLAttributes, 0];
116
- },
117
- });
118
- export const Table = createBlockSpecFromStronglyTypedTiptapNode(TableBlockContent, tablePropSchema, [
119
- TableExtension,
120
- TableParagraph,
121
- TableHeader.extend({
122
- content: "tableContent",
123
- }),
124
- TableCell.extend({
125
- content: "tableContent",
126
- }),
127
- TableRow,
128
- ]);
129
- //# sourceMappingURL=TableBlockContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TableBlockContent.js","sourceRoot":"","sources":["../../../../src/blocks/TableBlockContent/TableBlockContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EACL,0CAA0C,EAC1C,6BAA6B,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAA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;QACjB,OAAO,EAAE,cAAc;KACxB,CAAC;IACF,SAAS,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,cAAc;KACxB,CAAC;IACF,QAAQ;CACT,CACF,CAAC"}
@@ -1,64 +0,0 @@
1
- import { callOrReturn, Extension, getExtensionField } from "@tiptap/core";
2
- import { columnResizing, goToNextCell, tableEditing } from "prosemirror-tables";
3
- export const RESIZE_MIN_WIDTH = 35;
4
- export const EMPTY_CELL_WIDTH = 120;
5
- export const EMPTY_CELL_HEIGHT = 31;
6
- export const TableExtension = Extension.create({
7
- name: "BlockNoteTableExtension",
8
- addProseMirrorPlugins: () => {
9
- return [
10
- columnResizing({
11
- cellMinWidth: RESIZE_MIN_WIDTH,
12
- defaultCellMinWidth: EMPTY_CELL_WIDTH,
13
- // We set this to null as we implement our own node view in the table
14
- // block content. This node view is the same as what's used by default,
15
- // but is wrapped in a `blockContent` HTML element.
16
- View: null,
17
- }),
18
- tableEditing(),
19
- ];
20
- },
21
- addKeyboardShortcuts() {
22
- return {
23
- // Makes enter create a new line within the cell.
24
- Enter: () => {
25
- if (this.editor.state.selection.empty &&
26
- this.editor.state.selection.$head.parent.type.name ===
27
- "tableParagraph") {
28
- this.editor.commands.setHardBreak();
29
- return true;
30
- }
31
- return false;
32
- },
33
- // Ensures that backspace won't delete the table if the text cursor is at
34
- // the start of a cell and the selection is empty.
35
- Backspace: () => {
36
- const selection = this.editor.state.selection;
37
- const selectionIsEmpty = selection.empty;
38
- const selectionIsAtStartOfNode = selection.$head.parentOffset === 0;
39
- const selectionIsInTableParagraphNode = selection.$head.node().type.name === "tableParagraph";
40
- return (selectionIsEmpty &&
41
- selectionIsAtStartOfNode &&
42
- selectionIsInTableParagraphNode);
43
- },
44
- // Enables navigating cells using the tab key.
45
- Tab: () => {
46
- return this.editor.commands.command(({ state, dispatch, view }) => goToNextCell(1)(state, dispatch, view));
47
- },
48
- "Shift-Tab": () => {
49
- return this.editor.commands.command(({ state, dispatch, view }) => goToNextCell(-1)(state, dispatch, view));
50
- },
51
- };
52
- },
53
- extendNodeSchema(extension) {
54
- const context = {
55
- name: extension.name,
56
- options: extension.options,
57
- storage: extension.storage,
58
- };
59
- return {
60
- tableRole: callOrReturn(getExtensionField(extension, "tableRole", context)),
61
- };
62
- },
63
- });
64
- //# sourceMappingURL=TableExtension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TableExtension.js","sourceRoot":"","sources":["../../../../src/blocks/TableBlockContent/TableExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEhF,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AACnC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,yBAAyB;IAE/B,qBAAqB,EAAE,GAAG,EAAE;QAC1B,OAAO;YACL,cAAc,CAAC;gBACb,YAAY,EAAE,gBAAgB;gBAC9B,mBAAmB,EAAE,gBAAgB;gBACrC,qEAAqE;gBACrE,uEAAuE;gBACvE,mDAAmD;gBACnD,IAAI,EAAE,IAAI;aACX,CAAC;YACF,YAAY,EAAE;SACf,CAAC;IACJ,CAAC;IAED,oBAAoB;QAClB,OAAO;YACL,iDAAiD;YACjD,KAAK,EAAE,GAAG,EAAE;gBACV,IACE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK;oBACjC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;wBAChD,gBAAgB,EAClB,CAAC;oBACD,IAAI,CAAC,MAAM,CA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O,EAAE,SAAS,CAAC,OAAO;SAC3B,CAAC;QAEF,OAAO;YACL,SAAS,EAAE,YAAY,CACrB,iBAAiB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CACnD;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,114 +0,0 @@
1
- import { createBlockSpec, } from "../../schema/index.js";
2
- import { defaultProps } from "../defaultProps.js";
3
- import { parseFigureElement } from "../FileBlockContent/helpers/parse/parseFigureElement.js";
4
- import { createFigureWithCaption } from "../FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.js";
5
- import { createLinkWithCaption } from "../FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.js";
6
- import { createResizableFileBlockWrapper } from "../FileBlockContent/helpers/render/createResizableFileBlockWrapper.js";
7
- import { parseVideoElement } from "./parseVideoElement.js";
8
- export const FILE_VIDEO_ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>';
9
- export const videoPropSchema = {
10
- textAlignment: defaultProps.textAlignment,
11
- backgroundColor: defaultProps.backgroundColor,
12
- // File name.
13
- name: {
14
- default: "",
15
- },
16
- // File url.
17
- url: {
18
- default: "",
19
- },
20
- // File caption.
21
- caption: {
22
- default: "",
23
- },
24
- showPreview: {
25
- default: true,
26
- },
27
- // File preview width in px.
28
- previewWidth: {
29
- default: 512,
30
- },
31
- };
32
- export const videoBlockConfig = {
33
- type: "video",
34
- propSchema: videoPropSchema,
35
- content: "none",
36
- isFileBlock: true,
37
- fileBlockAccept: ["video/*"],
38
- };
39
- export const videoRender = (block, editor) => {
40
- const icon = document.createElement("div");
41
- icon.innerHTML = FILE_VIDEO_ICON_SVG;
42
- const videoWrapper = document.createElement("div");
43
- videoWrapper.className = "bn-visual-media-wrapper";
44
- const video = document.createElement("video");
45
- video.className = "bn-visual-media";
46
- if (editor.resolveFileUrl) {
47
- editor.resolveFileUrl(block.props.url).then((downloadUrl) => {
48
- video.src = downloadUrl;
49
- });
50
- }
51
- else {
52
- video.src = block.props.url;
53
- }
54
- video.controls = true;
55
- video.contentEditable = "false";
56
- video.draggable = false;
57
- video.width = block.props.previewWidth;
58
- videoWrapper.appendChild(video);
59
- return createResizableFileBlockWrapper(block, editor, { dom: videoWrapper }, videoWrapper, editor.dictionary.file_blocks.video.add_button_text, icon.firstElementChild);
60
- };
61
- export const videoParse = (element) => {
62
- if (element.tagName === "VIDEO") {
63
- return parseVideoElement(element);
64
- }
65
- if (element.tagName === "FIGURE") {
66
- const parsedFigure = parseFigureElement(element, "video");
67
- if (!parsedFigure) {
68
- return undefined;
69
- }
70
- const { targetElement, caption } = parsedFigure;
71
- return {
72
- ...parseVideoElement(targetElement),
73
- caption,
74
- };
75
- }
76
- return undefined;
77
- };
78
- export const videoToExternalHTML = (block) => {
79
- if (!block.props.url) {
80
- const div = document.createElement("p");
81
- div.textContent = "Add video";
82
- return {
83
- dom: div,
84
- };
85
- }
86
- let video;
87
- if (block.props.showPreview) {
88
- video = document.createElement("video");
89
- video.src = block.props.url;
90
- video.width = block.props.previewWidth;
91
- }
92
- else {
93
- video = document.createElement("a");
94
- video.href = block.props.url;
95
- video.textContent = block.props.name || block.props.url;
96
- }
97
- if (block.props.caption) {
98
- if (block.props.showPreview) {
99
- return createFigureWithCaption(video, block.props.caption);
100
- }
101
- else {
102
- return createLinkWithCaption(video, block.props.caption);
103
- }
104
- }
105
- return {
106
- dom: video,
107
- };
108
- };
109
- export const VideoBlock = createBlockSpec(videoBlockConfig, {
110
- render: videoRender,
111
- parse: videoParse,
112
- toExternalHTML: videoToExternalHTML,
113
- });
114
- //# sourceMappingURL=VideoBlockContent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VideoBlockContent.js","sourceRoot":"","sources":["../../../../src/blocks/VideoBlockContent/VideoBlockContent.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yDAAyD,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAChH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,+BAA+B,EAAE,MAAM,uEAAuE,CAAC;AACxH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,CAAC,MAAM,mBAAmB,GAC9B,8ZAA8Z,CAAC;AAEja,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa,EAAE,YAAY,CAAC,aAAa;IACzC,eAAe,EAAE,YAAY,CAAC,eAAe;IAC7C,aAAa;IACb,IAAI,EAAE;QACJ,OAAO,EAAE,EAAW;KACrB;IACD,YAAY;IACZ,GAAG,EAAE;QACH,OAAO,EAAE,EAAW;KACrB;IACD,gBAAgB;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,EAAW;KACrB;IAED,WAAW,EAAE;QACX,OAAO,EAAE,IAAI;KACd;IACD,4BAA4B;IAC5B,YAAY,EAAE;QACZ,OAAO,EAAE,GAAG;KACb;CACmB,CAAC;AAEvB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,OAAgB;IACtB,UAAU,EAAE,eAAe;IAC3B,OAAO,EAAE,MAAM;IACf,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,CAAC,SAAS,CAAC;CACH,CAAC;AAE5B,MA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