@blocknote/core 0.29.1 → 0.30.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 (182) hide show
  1. package/README.md +125 -0
  2. package/dist/blocknote.cjs +9 -9
  3. package/dist/blocknote.cjs.map +1 -1
  4. package/dist/blocknote.js +1501 -1359
  5. package/dist/blocknote.js.map +1 -1
  6. package/dist/comments.cjs.map +1 -1
  7. package/dist/comments.js.map +1 -1
  8. package/dist/locales.cjs +1 -1
  9. package/dist/locales.cjs.map +1 -1
  10. package/dist/locales.js +751 -9
  11. package/dist/locales.js.map +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/tsconfig.tsbuildinfo +1 -1
  14. package/dist/webpack-stats.json +1 -1
  15. package/package.json +7 -8
  16. package/src/api/README.md +1 -1
  17. package/src/api/blockManipulation/commands/insertBlocks/__snapshots__/insertBlocks.test.ts.snap +0 -7
  18. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +19 -14
  19. package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +5 -5
  20. package/src/api/blockManipulation/commands/mergeBlocks/__snapshots__/mergeBlocks.test.ts.snap +0 -5
  21. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +3 -3
  22. package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +12 -12
  23. package/src/api/blockManipulation/commands/moveBlocks/__snapshots__/moveBlocks.test.ts.snap +0 -20
  24. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +14 -14
  25. package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +16 -16
  26. package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +8 -8
  27. package/src/api/blockManipulation/commands/replaceBlocks/__snapshots__/replaceBlocks.test.ts.snap +0 -12
  28. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +12 -12
  29. package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +7 -7
  30. package/src/api/blockManipulation/commands/splitBlock/__snapshots__/splitBlock.test.ts.snap +0 -6
  31. package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +10 -10
  32. package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +2 -2
  33. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +0 -17
  34. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +42 -42
  35. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +18 -18
  36. package/src/api/blockManipulation/getBlock/getBlock.ts +9 -9
  37. package/src/api/blockManipulation/insertContentAt.ts +1 -1
  38. package/src/api/blockManipulation/selections/selection.ts +11 -11
  39. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +7 -7
  40. package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.ts +6 -6
  41. package/src/api/blockManipulation/tables/tables.test.ts +106 -106
  42. package/src/api/blockManipulation/tables/tables.ts +35 -35
  43. package/src/api/clipboard/fromClipboard/fileDropExtension.ts +2 -2
  44. package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +9 -9
  45. package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +3 -3
  46. package/src/api/clipboard/fromClipboard/pasteExtension.ts +21 -3
  47. package/src/api/clipboard/toClipboard/copyExtension.ts +22 -22
  48. package/src/api/exporters/html/externalHTMLExporter.ts +6 -6
  49. package/src/api/exporters/html/internalHTMLSerializer.ts +3 -3
  50. package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +16 -16
  51. package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +14 -14
  52. package/src/api/exporters/markdown/markdownExporter.ts +3 -3
  53. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +3 -3
  54. package/src/api/getBlockInfoFromPos.ts +6 -6
  55. package/src/api/nodeConversions/blockToNode.ts +26 -26
  56. package/src/api/nodeConversions/fragmentToBlocks.ts +1 -1
  57. package/src/api/nodeConversions/nodeToBlock.ts +37 -33
  58. package/src/api/nodeUtil.test.ts +16 -16
  59. package/src/api/nodeUtil.ts +10 -10
  60. package/src/api/parsers/html/parseHTML.ts +1 -1
  61. package/src/api/parsers/html/util/nestedLists.ts +2 -2
  62. package/src/api/parsers/markdown/parseMarkdown.ts +1 -1
  63. package/src/api/pmUtil.ts +4 -4
  64. package/src/api/positionMapping.test.ts +3 -3
  65. package/src/api/positionMapping.ts +5 -5
  66. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +9 -4
  67. package/src/blocks/CodeBlockContent/CodeBlockContent.ts +40 -26
  68. package/src/blocks/FileBlockContent/FileBlockContent.ts +7 -2
  69. package/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts +2 -2
  70. package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +5 -5
  71. package/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts +2 -2
  72. package/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts +1 -1
  73. package/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts +15 -8
  74. package/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts +1 -1
  75. package/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts +1 -1
  76. package/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts +2 -2
  77. package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +9 -6
  78. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +14 -6
  79. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +13 -29
  80. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +24 -13
  81. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +1 -1
  82. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +1 -1
  83. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +13 -30
  84. package/src/blocks/ListItemBlockContent/getListItemContent.ts +115 -0
  85. package/src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts +1 -1
  86. package/src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.ts +3 -3
  87. package/src/blocks/PageBreakBlockContent/schema.ts +2 -2
  88. package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +9 -5
  89. package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +10 -5
  90. package/src/blocks/README.md +1 -1
  91. package/src/blocks/TableBlockContent/TableBlockContent.ts +76 -19
  92. package/src/blocks/TableBlockContent/TableExtension.ts +3 -3
  93. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +14 -6
  94. package/src/blocks/defaultBlockHelpers.ts +24 -8
  95. package/src/blocks/defaultBlockTypeGuards.ts +16 -16
  96. package/src/blocks/defaultBlocks.ts +3 -3
  97. package/src/comments/threadstore/DefaultThreadStoreAuth.ts +3 -3
  98. package/src/comments/threadstore/ThreadStore.ts +1 -1
  99. package/src/comments/threadstore/TipTapThreadStore.ts +10 -10
  100. package/src/comments/threadstore/yjs/RESTYjsThreadStore.ts +4 -4
  101. package/src/comments/threadstore/yjs/YjsThreadStore.test.ts +2 -2
  102. package/src/comments/threadstore/yjs/YjsThreadStore.ts +14 -14
  103. package/src/comments/threadstore/yjs/YjsThreadStoreBase.ts +1 -1
  104. package/src/comments/threadstore/yjs/yjsHelpers.ts +6 -6
  105. package/src/editor/Block.css +10 -1
  106. package/src/editor/BlockNoteEditor.test.ts +3 -3
  107. package/src/editor/BlockNoteEditor.ts +110 -61
  108. package/src/editor/BlockNoteExtensions.ts +24 -15
  109. package/src/editor/BlockNoteSchema.ts +4 -4
  110. package/src/editor/BlockNoteTipTapEditor.ts +10 -10
  111. package/src/editor/README.md +1 -1
  112. package/src/editor/cursorPositionTypes.ts +1 -1
  113. package/src/editor/editor.css +15 -3
  114. package/src/editor/selectionTypes.ts +1 -1
  115. package/src/editor/transformPasted.ts +2 -2
  116. package/src/exporter/Exporter.ts +5 -5
  117. package/src/exporter/mapping.ts +7 -7
  118. package/src/extensions/BackgroundColor/BackgroundColorMark.ts +1 -1
  119. package/src/extensions/Collaboration/CursorPlugin.ts +152 -0
  120. package/src/extensions/Collaboration/SyncPlugin.ts +15 -0
  121. package/src/extensions/Collaboration/UndoPlugin.ts +14 -0
  122. package/src/extensions/Comments/CommentsPlugin.ts +9 -9
  123. package/src/extensions/Comments/userstore/UserStore.ts +2 -2
  124. package/src/extensions/FilePanel/FilePanelPlugin.ts +37 -28
  125. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +6 -8
  126. package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +29 -26
  127. package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +11 -11
  128. package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +4 -4
  129. package/src/extensions/Placeholder/PlaceholderPlugin.ts +10 -10
  130. package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +2 -2
  131. package/src/extensions/README.md +1 -1
  132. package/src/extensions/SideMenu/MultipleNodeSelection.ts +1 -1
  133. package/src/extensions/SideMenu/SideMenuPlugin.ts +31 -31
  134. package/src/extensions/SideMenu/dragging.ts +8 -8
  135. package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +17 -17
  136. package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +2 -2
  137. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +12 -12
  138. package/src/extensions/TableHandles/TableHandlesPlugin.ts +54 -53
  139. package/src/extensions/TrailingNode/TrailingNodeExtension.ts +1 -1
  140. package/src/extensions/UniqueID/UniqueID.ts +6 -6
  141. package/src/extensions/getDraggableBlockFromElement.ts +1 -1
  142. package/src/fonts/inter.css +18 -9
  143. package/src/i18n/locales/index.ts +2 -0
  144. package/src/i18n/locales/ru.ts +2 -2
  145. package/src/i18n/locales/sk.ts +355 -0
  146. package/src/i18n/locales/zh-tw.ts +390 -0
  147. package/src/locales.ts +1 -1
  148. package/src/pm-nodes/BlockContainer.ts +7 -6
  149. package/src/pm-nodes/BlockGroup.ts +1 -1
  150. package/src/pm-nodes/Doc.ts +4 -4
  151. package/src/schema/README.md +1 -1
  152. package/src/schema/blocks/createSpec.ts +15 -15
  153. package/src/schema/blocks/internal.ts +17 -18
  154. package/src/schema/blocks/types.ts +27 -26
  155. package/src/schema/inlineContent/createSpec.ts +16 -20
  156. package/src/schema/inlineContent/internal.ts +9 -9
  157. package/src/schema/inlineContent/types.ts +26 -26
  158. package/src/schema/propTypes.ts +8 -8
  159. package/src/schema/styles/createSpec.ts +2 -2
  160. package/src/schema/styles/internal.ts +7 -7
  161. package/src/schema/styles/types.ts +2 -2
  162. package/src/util/EventEmitter.ts +4 -4
  163. package/src/util/README.md +1 -1
  164. package/src/util/combineByGroup.ts +1 -1
  165. package/src/util/table.ts +33 -30
  166. package/types/src/api/blockManipulation/setupTestEnv.d.ts +8 -4
  167. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +8 -4
  168. package/types/src/blocks/ListItemBlockContent/getListItemContent.d.ts +28 -0
  169. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +8 -4
  170. package/types/src/blocks/defaultBlockHelpers.d.ts +1 -0
  171. package/types/src/blocks/defaultBlocks.d.ts +16 -8
  172. package/types/src/editor/BlockNoteEditor.d.ts +21 -2
  173. package/types/src/extensions/Collaboration/CursorPlugin.d.ts +31 -0
  174. package/types/src/extensions/Collaboration/SyncPlugin.d.ts +7 -0
  175. package/types/src/extensions/Collaboration/UndoPlugin.d.ts +6 -0
  176. package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +1 -1
  177. package/types/src/i18n/locales/index.d.ts +2 -0
  178. package/types/src/i18n/locales/sk.d.ts +313 -0
  179. package/types/src/i18n/locales/zh-tw.d.ts +2 -0
  180. package/types/src/schema/blocks/types.d.ts +2 -1
  181. package/src/extensions/Collaboration/createCollaborationExtensions.ts +0 -147
  182. package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +0 -17
@@ -716,35 +716,35 @@ describe("Test getAbsoluteTableCellIndices", () => {
716
716
  row: 0,
717
717
  col: 0,
718
718
  cell: tableWithColspan.content.rows[0].cells[0],
719
- }
719
+ },
720
720
  );
721
721
  expect(getAbsoluteTableCells({ row: 0, col: 1 }, tableWithColspan)).toEqual(
722
722
  {
723
723
  row: 0,
724
724
  col: 2,
725
725
  cell: tableWithColspan.content.rows[0].cells[1],
726
- }
726
+ },
727
727
  );
728
728
  expect(getAbsoluteTableCells({ row: 1, col: 0 }, tableWithColspan)).toEqual(
729
729
  {
730
730
  row: 1,
731
731
  col: 0,
732
732
  cell: tableWithColspan.content.rows[1].cells[0],
733
- }
733
+ },
734
734
  );
735
735
  expect(getAbsoluteTableCells({ row: 1, col: 1 }, tableWithColspan)).toEqual(
736
736
  {
737
737
  row: 1,
738
738
  col: 1,
739
739
  cell: tableWithColspan.content.rows[1].cells[1],
740
- }
740
+ },
741
741
  );
742
742
  expect(getAbsoluteTableCells({ row: 1, col: 2 }, tableWithColspan)).toEqual(
743
743
  {
744
744
  row: 1,
745
745
  col: 2,
746
746
  cell: tableWithColspan.content.rows[1].cells[2],
747
- }
747
+ },
748
748
  );
749
749
  });
750
750
 
@@ -754,49 +754,49 @@ describe("Test getAbsoluteTableCellIndices", () => {
754
754
  row: 0,
755
755
  col: 0,
756
756
  cell: tableWithRowspan.content.rows[0].cells[0],
757
- }
757
+ },
758
758
  );
759
759
  expect(getAbsoluteTableCells({ row: 0, col: 1 }, tableWithRowspan)).toEqual(
760
760
  {
761
761
  row: 0,
762
762
  col: 1,
763
763
  cell: tableWithRowspan.content.rows[0].cells[1],
764
- }
764
+ },
765
765
  );
766
766
  expect(getAbsoluteTableCells({ row: 0, col: 2 }, tableWithRowspan)).toEqual(
767
767
  {
768
768
  row: 0,
769
769
  col: 2,
770
770
  cell: tableWithRowspan.content.rows[0].cells[2],
771
- }
771
+ },
772
772
  );
773
773
  expect(getAbsoluteTableCells({ row: 1, col: 0 }, tableWithRowspan)).toEqual(
774
774
  {
775
775
  row: 1,
776
776
  col: 1,
777
777
  cell: tableWithRowspan.content.rows[1].cells[0],
778
- }
778
+ },
779
779
  );
780
780
  expect(getAbsoluteTableCells({ row: 1, col: 1 }, tableWithRowspan)).toEqual(
781
781
  {
782
782
  row: 1,
783
783
  col: 2,
784
784
  cell: tableWithRowspan.content.rows[1].cells[1],
785
- }
785
+ },
786
786
  );
787
787
  expect(getAbsoluteTableCells({ row: 2, col: 0 }, tableWithRowspan)).toEqual(
788
788
  {
789
789
  row: 2,
790
790
  col: 0,
791
791
  cell: tableWithRowspan.content.rows[2].cells[0],
792
- }
792
+ },
793
793
  );
794
794
  expect(getAbsoluteTableCells({ row: 2, col: 1 }, tableWithRowspan)).toEqual(
795
795
  {
796
796
  row: 2,
797
797
  col: 1,
798
798
  cell: tableWithRowspan.content.rows[2].cells[1],
799
- }
799
+ },
800
800
  );
801
801
  });
802
802
 
@@ -804,8 +804,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
804
804
  expect(
805
805
  getAbsoluteTableCells(
806
806
  { row: 0, col: 0 },
807
- tableWithComplexRowspansAndColspans
808
- )
807
+ tableWithComplexRowspansAndColspans,
808
+ ),
809
809
  ).toEqual({
810
810
  row: 0,
811
811
  col: 0,
@@ -814,8 +814,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
814
814
  expect(
815
815
  getAbsoluteTableCells(
816
816
  { row: 0, col: 1 },
817
- tableWithComplexRowspansAndColspans
818
- )
817
+ tableWithComplexRowspansAndColspans,
818
+ ),
819
819
  ).toEqual({
820
820
  row: 0,
821
821
  col: 2,
@@ -824,8 +824,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
824
824
  expect(
825
825
  getAbsoluteTableCells(
826
826
  { row: 0, col: 2 },
827
- tableWithComplexRowspansAndColspans
828
- )
827
+ tableWithComplexRowspansAndColspans,
828
+ ),
829
829
  ).toEqual({
830
830
  row: 0,
831
831
  col: 3,
@@ -834,8 +834,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
834
834
  expect(
835
835
  getAbsoluteTableCells(
836
836
  { row: 1, col: 0 },
837
- tableWithComplexRowspansAndColspans
838
- )
837
+ tableWithComplexRowspansAndColspans,
838
+ ),
839
839
  ).toEqual({
840
840
  row: 1,
841
841
  col: 2,
@@ -844,8 +844,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
844
844
  expect(
845
845
  getAbsoluteTableCells(
846
846
  { row: 1, col: 1 },
847
- tableWithComplexRowspansAndColspans
848
- )
847
+ tableWithComplexRowspansAndColspans,
848
+ ),
849
849
  ).toEqual({
850
850
  row: 1,
851
851
  col: 3,
@@ -854,8 +854,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
854
854
  expect(
855
855
  getAbsoluteTableCells(
856
856
  { row: 2, col: 0 },
857
- tableWithComplexRowspansAndColspans
858
- )
857
+ tableWithComplexRowspansAndColspans,
858
+ ),
859
859
  ).toEqual({
860
860
  row: 2,
861
861
  col: 0,
@@ -864,8 +864,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
864
864
  expect(
865
865
  getAbsoluteTableCells(
866
866
  { row: 2, col: 1 },
867
- tableWithComplexRowspansAndColspans
868
- )
867
+ tableWithComplexRowspansAndColspans,
868
+ ),
869
869
  ).toEqual({
870
870
  row: 2,
871
871
  col: 1,
@@ -874,8 +874,8 @@ describe("Test getAbsoluteTableCellIndices", () => {
874
874
  expect(
875
875
  getAbsoluteTableCells(
876
876
  { row: 2, col: 2 },
877
- tableWithComplexRowspansAndColspans
878
- )
877
+ tableWithComplexRowspansAndColspans,
878
+ ),
879
879
  ).toEqual({
880
880
  row: 2,
881
881
  col: 3,
@@ -914,42 +914,42 @@ describe("Test getRelativeTableCellIndices", () => {
914
914
  row: 0,
915
915
  col: 0,
916
916
  cell: tableWithColspan.content.rows[0].cells[0],
917
- }
917
+ },
918
918
  );
919
919
  expect(getRelativeTableCells({ row: 0, col: 1 }, tableWithColspan)).toEqual(
920
920
  {
921
921
  row: 0,
922
922
  col: 0,
923
923
  cell: tableWithColspan.content.rows[0].cells[0],
924
- }
924
+ },
925
925
  );
926
926
  expect(getRelativeTableCells({ row: 0, col: 2 }, tableWithColspan)).toEqual(
927
927
  {
928
928
  row: 0,
929
929
  col: 1,
930
930
  cell: tableWithColspan.content.rows[0].cells[1],
931
- }
931
+ },
932
932
  );
933
933
  expect(getRelativeTableCells({ row: 1, col: 0 }, tableWithColspan)).toEqual(
934
934
  {
935
935
  row: 1,
936
936
  col: 0,
937
937
  cell: tableWithColspan.content.rows[1].cells[0],
938
- }
938
+ },
939
939
  );
940
940
  expect(getRelativeTableCells({ row: 1, col: 1 }, tableWithColspan)).toEqual(
941
941
  {
942
942
  row: 1,
943
943
  col: 1,
944
944
  cell: tableWithColspan.content.rows[1].cells[1],
945
- }
945
+ },
946
946
  );
947
947
  expect(getRelativeTableCells({ row: 1, col: 2 }, tableWithColspan)).toEqual(
948
948
  {
949
949
  row: 1,
950
950
  col: 2,
951
951
  cell: tableWithColspan.content.rows[1].cells[2],
952
- }
952
+ },
953
953
  );
954
954
  });
955
955
 
@@ -959,125 +959,125 @@ describe("Test getRelativeTableCellIndices", () => {
959
959
  row: 0,
960
960
  col: 0,
961
961
  cell: tableWithRowspan.content.rows[0].cells[0],
962
- }
962
+ },
963
963
  );
964
964
  expect(getRelativeTableCells({ row: 0, col: 1 }, tableWithRowspan)).toEqual(
965
965
  {
966
966
  row: 0,
967
967
  col: 1,
968
968
  cell: tableWithRowspan.content.rows[0].cells[1],
969
- }
969
+ },
970
970
  );
971
971
  expect(getRelativeTableCells({ row: 0, col: 2 }, tableWithRowspan)).toEqual(
972
972
  {
973
973
  row: 0,
974
974
  col: 2,
975
975
  cell: tableWithRowspan.content.rows[0].cells[2],
976
- }
976
+ },
977
977
  );
978
978
  expect(getRelativeTableCells({ row: 1, col: 0 }, tableWithRowspan)).toEqual(
979
979
  {
980
980
  row: 0,
981
981
  col: 0,
982
982
  cell: tableWithRowspan.content.rows[0].cells[0],
983
- }
983
+ },
984
984
  );
985
985
  expect(getRelativeTableCells({ row: 1, col: 1 }, tableWithRowspan)).toEqual(
986
986
  {
987
987
  row: 1,
988
988
  col: 0,
989
989
  cell: tableWithRowspan.content.rows[1].cells[0],
990
- }
990
+ },
991
991
  );
992
992
  expect(getRelativeTableCells({ row: 1, col: 2 }, tableWithRowspan)).toEqual(
993
993
  {
994
994
  row: 1,
995
995
  col: 1,
996
996
  cell: tableWithRowspan.content.rows[1].cells[1],
997
- }
997
+ },
998
998
  );
999
999
  expect(getRelativeTableCells({ row: 2, col: 0 }, tableWithRowspan)).toEqual(
1000
1000
  {
1001
1001
  row: 2,
1002
1002
  col: 0,
1003
1003
  cell: tableWithRowspan.content.rows[2].cells[0],
1004
- }
1004
+ },
1005
1005
  );
1006
1006
  expect(getRelativeTableCells({ row: 2, col: 1 }, tableWithRowspan)).toEqual(
1007
1007
  {
1008
1008
  row: 2,
1009
1009
  col: 1,
1010
1010
  cell: tableWithRowspan.content.rows[2].cells[1],
1011
- }
1011
+ },
1012
1012
  );
1013
1013
  expect(getRelativeTableCells({ row: 2, col: 2 }, tableWithRowspan)).toEqual(
1014
1014
  {
1015
1015
  row: 2,
1016
1016
  col: 2,
1017
1017
  cell: tableWithRowspan.content.rows[2].cells[2],
1018
- }
1018
+ },
1019
1019
  );
1020
1020
  });
1021
1021
 
1022
1022
  it("should resolve absolute table cell indices to relative table cell indices with colspan and rowspan", () => {
1023
1023
  expect(
1024
- getRelativeTableCells({ row: 0, col: 0 }, tableWithColspanAndRowspan)
1024
+ getRelativeTableCells({ row: 0, col: 0 }, tableWithColspanAndRowspan),
1025
1025
  ).toEqual({
1026
1026
  row: 0,
1027
1027
  col: 0,
1028
1028
  cell: tableWithColspanAndRowspan.content.rows[0].cells[0],
1029
1029
  });
1030
1030
  expect(
1031
- getRelativeTableCells({ row: 0, col: 1 }, tableWithColspanAndRowspan)
1031
+ getRelativeTableCells({ row: 0, col: 1 }, tableWithColspanAndRowspan),
1032
1032
  ).toEqual({
1033
1033
  row: 0,
1034
1034
  col: 1,
1035
1035
  cell: tableWithColspanAndRowspan.content.rows[0].cells[1],
1036
1036
  });
1037
1037
  expect(
1038
- getRelativeTableCells({ row: 0, col: 2 }, tableWithColspanAndRowspan)
1038
+ getRelativeTableCells({ row: 0, col: 2 }, tableWithColspanAndRowspan),
1039
1039
  ).toEqual({
1040
1040
  row: 0,
1041
1041
  col: 2,
1042
1042
  cell: tableWithColspanAndRowspan.content.rows[0].cells[2],
1043
1043
  });
1044
1044
  expect(
1045
- getRelativeTableCells({ row: 1, col: 0 }, tableWithColspanAndRowspan)
1045
+ getRelativeTableCells({ row: 1, col: 0 }, tableWithColspanAndRowspan),
1046
1046
  ).toEqual({
1047
1047
  row: 0,
1048
1048
  col: 0,
1049
1049
  cell: tableWithColspanAndRowspan.content.rows[0].cells[0],
1050
1050
  });
1051
1051
  expect(
1052
- getRelativeTableCells({ row: 1, col: 1 }, tableWithColspanAndRowspan)
1052
+ getRelativeTableCells({ row: 1, col: 1 }, tableWithColspanAndRowspan),
1053
1053
  ).toEqual({
1054
1054
  row: 1,
1055
1055
  col: 0,
1056
1056
  cell: tableWithColspanAndRowspan.content.rows[1].cells[0],
1057
1057
  });
1058
1058
  expect(
1059
- getRelativeTableCells({ row: 1, col: 2 }, tableWithColspanAndRowspan)
1059
+ getRelativeTableCells({ row: 1, col: 2 }, tableWithColspanAndRowspan),
1060
1060
  ).toEqual({
1061
1061
  row: 1,
1062
1062
  col: 0,
1063
1063
  cell: tableWithColspanAndRowspan.content.rows[1].cells[0],
1064
1064
  });
1065
1065
  expect(
1066
- getRelativeTableCells({ row: 2, col: 0 }, tableWithColspanAndRowspan)
1066
+ getRelativeTableCells({ row: 2, col: 0 }, tableWithColspanAndRowspan),
1067
1067
  ).toEqual({
1068
1068
  row: 2,
1069
1069
  col: 0,
1070
1070
  cell: tableWithColspanAndRowspan.content.rows[2].cells[0],
1071
1071
  });
1072
1072
  expect(
1073
- getRelativeTableCells({ row: 2, col: 1 }, tableWithColspanAndRowspan)
1073
+ getRelativeTableCells({ row: 2, col: 1 }, tableWithColspanAndRowspan),
1074
1074
  ).toEqual({
1075
1075
  row: 2,
1076
1076
  col: 1,
1077
1077
  cell: tableWithColspanAndRowspan.content.rows[2].cells[1],
1078
1078
  });
1079
1079
  expect(
1080
- getRelativeTableCells({ row: 2, col: 2 }, tableWithColspanAndRowspan)
1080
+ getRelativeTableCells({ row: 2, col: 2 }, tableWithColspanAndRowspan),
1081
1081
  ).toEqual({
1082
1082
  row: 2,
1083
1083
  col: 2,
@@ -1087,63 +1087,63 @@ describe("Test getRelativeTableCellIndices", () => {
1087
1087
 
1088
1088
  it("should resolve absolute table cell indices to relative table cell indices with colspans and rowspans", () => {
1089
1089
  expect(
1090
- getRelativeTableCells({ row: 0, col: 0 }, tableWithColspansAndRowspans)
1090
+ getRelativeTableCells({ row: 0, col: 0 }, tableWithColspansAndRowspans),
1091
1091
  ).toEqual({
1092
1092
  row: 0,
1093
1093
  col: 0,
1094
1094
  cell: tableWithColspansAndRowspans.content.rows[0].cells[0],
1095
1095
  });
1096
1096
  expect(
1097
- getRelativeTableCells({ row: 0, col: 1 }, tableWithColspansAndRowspans)
1097
+ getRelativeTableCells({ row: 0, col: 1 }, tableWithColspansAndRowspans),
1098
1098
  ).toEqual({
1099
1099
  row: 0,
1100
1100
  col: 1,
1101
1101
  cell: tableWithColspansAndRowspans.content.rows[0].cells[1],
1102
1102
  });
1103
1103
  expect(
1104
- getRelativeTableCells({ row: 0, col: 2 }, tableWithColspansAndRowspans)
1104
+ getRelativeTableCells({ row: 0, col: 2 }, tableWithColspansAndRowspans),
1105
1105
  ).toEqual({
1106
1106
  row: 0,
1107
1107
  col: 1,
1108
1108
  cell: tableWithColspansAndRowspans.content.rows[0].cells[1],
1109
1109
  });
1110
1110
  expect(
1111
- getRelativeTableCells({ row: 1, col: 0 }, tableWithColspansAndRowspans)
1111
+ getRelativeTableCells({ row: 1, col: 0 }, tableWithColspansAndRowspans),
1112
1112
  ).toEqual({
1113
1113
  row: 0,
1114
1114
  col: 0,
1115
1115
  cell: tableWithColspansAndRowspans.content.rows[0].cells[0],
1116
1116
  });
1117
1117
  expect(
1118
- getRelativeTableCells({ row: 1, col: 1 }, tableWithColspansAndRowspans)
1118
+ getRelativeTableCells({ row: 1, col: 1 }, tableWithColspansAndRowspans),
1119
1119
  ).toEqual({
1120
1120
  row: 1,
1121
1121
  col: 0,
1122
1122
  cell: tableWithColspansAndRowspans.content.rows[1].cells[0],
1123
1123
  });
1124
1124
  expect(
1125
- getRelativeTableCells({ row: 1, col: 2 }, tableWithColspansAndRowspans)
1125
+ getRelativeTableCells({ row: 1, col: 2 }, tableWithColspansAndRowspans),
1126
1126
  ).toEqual({
1127
1127
  row: 1,
1128
1128
  col: 0,
1129
1129
  cell: tableWithColspansAndRowspans.content.rows[1].cells[0],
1130
1130
  });
1131
1131
  expect(
1132
- getRelativeTableCells({ row: 2, col: 0 }, tableWithColspansAndRowspans)
1132
+ getRelativeTableCells({ row: 2, col: 0 }, tableWithColspansAndRowspans),
1133
1133
  ).toEqual({
1134
1134
  row: 2,
1135
1135
  col: 0,
1136
1136
  cell: tableWithColspansAndRowspans.content.rows[2].cells[0],
1137
1137
  });
1138
1138
  expect(
1139
- getRelativeTableCells({ row: 2, col: 1 }, tableWithColspansAndRowspans)
1139
+ getRelativeTableCells({ row: 2, col: 1 }, tableWithColspansAndRowspans),
1140
1140
  ).toEqual({
1141
1141
  row: 1,
1142
1142
  col: 0,
1143
1143
  cell: tableWithColspansAndRowspans.content.rows[1].cells[0],
1144
1144
  });
1145
1145
  expect(
1146
- getRelativeTableCells({ row: 2, col: 2 }, tableWithColspansAndRowspans)
1146
+ getRelativeTableCells({ row: 2, col: 2 }, tableWithColspansAndRowspans),
1147
1147
  ).toEqual({
1148
1148
  row: 1,
1149
1149
  col: 0,
@@ -1163,8 +1163,8 @@ describe("resolveAbsoluteTableCellIndices and resolveRelativeTableCellIndices sh
1163
1163
  expect(
1164
1164
  getRelativeTableCells(
1165
1165
  getAbsoluteTableCells({ row, col }, simpleTable),
1166
- simpleTable
1167
- )
1166
+ simpleTable,
1167
+ ),
1168
1168
  ).toEqual({ row, col, cell: simpleTable.content.rows[row].cells[col] });
1169
1169
  }
1170
1170
  }
@@ -1179,8 +1179,8 @@ describe("resolveAbsoluteTableCellIndices and resolveRelativeTableCellIndices sh
1179
1179
  expect(
1180
1180
  getRelativeTableCells(
1181
1181
  getAbsoluteTableCells({ row, col }, tableWithColspan),
1182
- tableWithColspan
1183
- )
1182
+ tableWithColspan,
1183
+ ),
1184
1184
  ).toEqual({
1185
1185
  row,
1186
1186
  col,
@@ -1200,8 +1200,8 @@ describe("resolveAbsoluteTableCellIndices and resolveRelativeTableCellIndices sh
1200
1200
  expect(
1201
1201
  getRelativeTableCells(
1202
1202
  getAbsoluteTableCells({ row, col }, tableWithRowspan),
1203
- tableWithRowspan
1204
- )
1203
+ tableWithRowspan,
1204
+ ),
1205
1205
  ).toEqual({
1206
1206
  row,
1207
1207
  col,
@@ -1225,8 +1225,8 @@ describe("resolveAbsoluteTableCellIndices and resolveRelativeTableCellIndices sh
1225
1225
  expect(
1226
1226
  getRelativeTableCells(
1227
1227
  getAbsoluteTableCells({ row, col }, tableWithColspanAndRowspan),
1228
- tableWithColspanAndRowspan
1229
- )
1228
+ tableWithColspanAndRowspan,
1229
+ ),
1230
1230
  ).toEqual({
1231
1231
  row,
1232
1232
  col,
@@ -1252,10 +1252,10 @@ describe("resolveAbsoluteTableCellIndices and resolveRelativeTableCellIndices sh
1252
1252
  getRelativeTableCells(
1253
1253
  getAbsoluteTableCells(
1254
1254
  { row, col },
1255
- tableWithComplexRowspansAndColspans
1255
+ tableWithComplexRowspansAndColspans,
1256
1256
  ),
1257
- tableWithComplexRowspansAndColspans
1258
- )
1257
+ tableWithComplexRowspansAndColspans,
1258
+ ),
1259
1259
  ).toEqual({
1260
1260
  row,
1261
1261
  col,
@@ -1275,7 +1275,7 @@ describe("Test getRow", () => {
1275
1275
  row: 0,
1276
1276
  col,
1277
1277
  cell,
1278
- }))
1278
+ })),
1279
1279
  );
1280
1280
  });
1281
1281
 
@@ -1368,7 +1368,7 @@ describe("Test getRow", () => {
1368
1368
  col: 2,
1369
1369
  cell: tableWithComplexRowspansAndColspans.content.rows[0].cells[2],
1370
1370
  },
1371
- ]
1371
+ ],
1372
1372
  );
1373
1373
  expect(getCellsAtRowHandle(tableWithComplexRowspansAndColspans, 1)).toEqual(
1374
1374
  [
@@ -1392,10 +1392,10 @@ describe("Test getRow", () => {
1392
1392
  col: 2,
1393
1393
  cell: tableWithComplexRowspansAndColspans.content.rows[2].cells[2],
1394
1394
  },
1395
- ]
1395
+ ],
1396
1396
  );
1397
1397
  expect(getCellsAtRowHandle(tableWithComplexRowspansAndColspans, 2)).toEqual(
1398
- []
1398
+ [],
1399
1399
  );
1400
1400
  });
1401
1401
  });
@@ -1513,7 +1513,7 @@ describe("Test getColumn", () => {
1513
1513
 
1514
1514
  it("should get the column of the table with complex rowspans and colspans", () => {
1515
1515
  expect(
1516
- getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 0)
1516
+ getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 0),
1517
1517
  ).toEqual([
1518
1518
  {
1519
1519
  row: 0,
@@ -1527,7 +1527,7 @@ describe("Test getColumn", () => {
1527
1527
  },
1528
1528
  ]);
1529
1529
  expect(
1530
- getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 1)
1530
+ getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 1),
1531
1531
  ).toEqual([
1532
1532
  {
1533
1533
  row: 0,
@@ -1541,7 +1541,7 @@ describe("Test getColumn", () => {
1541
1541
  },
1542
1542
  ]);
1543
1543
  expect(
1544
- getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 2)
1544
+ getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 2),
1545
1545
  ).toEqual([
1546
1546
  {
1547
1547
  row: 0,
@@ -1560,7 +1560,7 @@ describe("Test getColumn", () => {
1560
1560
  },
1561
1561
  ]);
1562
1562
  expect(
1563
- getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 3)
1563
+ getCellsAtColumnHandle(tableWithComplexRowspansAndColspans, 3),
1564
1564
  ).toEqual([]);
1565
1565
  });
1566
1566
  });
@@ -1629,8 +1629,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1629
1629
  ]),
1630
1630
  },
1631
1631
  },
1632
- "rows"
1633
- )
1632
+ "rows",
1633
+ ),
1634
1634
  ).toEqual([
1635
1635
  {
1636
1636
  cells: [
@@ -1661,8 +1661,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1661
1661
  ]),
1662
1662
  },
1663
1663
  },
1664
- "rows"
1665
- )
1664
+ "rows",
1665
+ ),
1666
1666
  ).toEqual(tableWithColspan.content.rows);
1667
1667
  });
1668
1668
 
@@ -1683,8 +1683,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1683
1683
  ],
1684
1684
  },
1685
1685
  },
1686
- "columns"
1687
- )
1686
+ "columns",
1687
+ ),
1688
1688
  ).toEqual(tableWithColspan.content.rows);
1689
1689
  });
1690
1690
 
@@ -1702,8 +1702,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1702
1702
  ]),
1703
1703
  },
1704
1704
  },
1705
- "rows"
1706
- )
1705
+ "rows",
1706
+ ),
1707
1707
  ).toEqual(tableWithRowspan.content.rows);
1708
1708
  });
1709
1709
 
@@ -1727,8 +1727,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1727
1727
  ],
1728
1728
  },
1729
1729
  },
1730
- "columns"
1731
- )
1730
+ "columns",
1731
+ ),
1732
1732
  ).toEqual(tableWithRowspan.content.rows);
1733
1733
  });
1734
1734
 
@@ -1746,8 +1746,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1746
1746
  ]),
1747
1747
  },
1748
1748
  },
1749
- "rows"
1750
- )
1749
+ "rows",
1750
+ ),
1751
1751
  ).toEqual(tableWithColspanAndRowspan.content.rows);
1752
1752
  });
1753
1753
 
@@ -1780,8 +1780,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1780
1780
  ],
1781
1781
  },
1782
1782
  },
1783
- "columns"
1784
- )
1783
+ "columns",
1784
+ ),
1785
1785
  ).toEqual(tableWithColspanAndRowspan.content.rows);
1786
1786
  });
1787
1787
 
@@ -1799,8 +1799,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1799
1799
  ]),
1800
1800
  },
1801
1801
  },
1802
- "rows"
1803
- )
1802
+ "rows",
1803
+ ),
1804
1804
  ).toEqual(tableWithComplexRowspansAndColspans.content.rows);
1805
1805
  });
1806
1806
 
@@ -1833,8 +1833,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1833
1833
  ],
1834
1834
  },
1835
1835
  },
1836
- "columns"
1837
- )
1836
+ "columns",
1837
+ ),
1838
1838
  ).toEqual(tableWithComplexRowspansAndColspans.content.rows);
1839
1839
  });
1840
1840
 
@@ -1855,8 +1855,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1855
1855
  ],
1856
1856
  },
1857
1857
  },
1858
- "rows"
1859
- )
1858
+ "rows",
1859
+ ),
1860
1860
  ).toEqual([
1861
1861
  {
1862
1862
  cells: [emptyCell, emptyCell],
@@ -1881,8 +1881,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1881
1881
  ],
1882
1882
  },
1883
1883
  },
1884
- "columns"
1885
- )
1884
+ "columns",
1885
+ ),
1886
1886
  ).toEqual([
1887
1887
  {
1888
1888
  cells: [emptyCell],
@@ -1919,8 +1919,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1919
1919
  ],
1920
1920
  },
1921
1921
  },
1922
- "rows"
1923
- )
1922
+ "rows",
1923
+ ),
1924
1924
  ).toEqual([
1925
1925
  {
1926
1926
  cells: [
@@ -1965,8 +1965,8 @@ describe("Test cropEmptyRowsOrColumns", () => {
1965
1965
  ],
1966
1966
  },
1967
1967
  },
1968
- "columns"
1969
- )
1968
+ "columns",
1969
+ ),
1970
1970
  ).toEqual([
1971
1971
  {
1972
1972
  cells: [