@blocknote/core 0.30.0 → 0.31.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.
- package/dist/blocknote.cjs +9 -9
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +2771 -2245
- package/dist/blocknote.js.map +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js.map +1 -1
- package/dist/{en-D4taoCs4.cjs → en-BXVKCwYt.cjs} +2 -2
- package/dist/en-BXVKCwYt.cjs.map +1 -0
- package/dist/{en-B7ycW7c8.js → en-qGo6sk9V.js} +2 -3
- package/dist/en-qGo6sk9V.js.map +1 -0
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +20 -39
- package/dist/locales.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +8 -7
- package/src/api/README.md +1 -1
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.test.ts +19 -14
- package/src/api/blockManipulation/commands/insertBlocks/insertBlocks.ts +7 -8
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.test.ts +3 -3
- package/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +12 -12
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.test.ts +14 -14
- package/src/api/blockManipulation/commands/moveBlocks/moveBlocks.ts +16 -16
- package/src/api/blockManipulation/commands/nestBlock/nestBlock.ts +8 -8
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.test.ts +12 -12
- package/src/api/blockManipulation/commands/replaceBlocks/replaceBlocks.ts +8 -8
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.test.ts +10 -10
- package/src/api/blockManipulation/commands/splitBlock/splitBlock.ts +2 -2
- package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +2816 -0
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +200 -42
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +104 -34
- package/src/api/blockManipulation/getBlock/getBlock.ts +9 -9
- package/src/api/blockManipulation/insertContentAt.ts +1 -1
- package/src/api/blockManipulation/selections/selection.ts +59 -12
- package/src/api/blockManipulation/selections/{textCursorPosition/textCursorPosition.ts → textCursorPosition.ts} +13 -13
- package/src/api/blockManipulation/tables/tables.test.ts +106 -106
- package/src/api/blockManipulation/tables/tables.ts +35 -35
- package/src/api/clipboard/fromClipboard/fileDropExtension.ts +2 -2
- package/src/api/clipboard/fromClipboard/handleFileInsertion.ts +9 -9
- package/src/api/clipboard/fromClipboard/handleVSCodePaste.ts +3 -3
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +3 -3
- package/src/api/clipboard/toClipboard/copyExtension.ts +22 -22
- package/src/api/exporters/html/externalHTMLExporter.ts +6 -6
- package/src/api/exporters/html/internalHTMLSerializer.ts +3 -3
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +16 -16
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +14 -14
- package/src/api/exporters/markdown/markdownExporter.ts +3 -3
- package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +3 -3
- package/src/api/getBlockInfoFromPos.ts +6 -6
- package/src/api/nodeConversions/blockToNode.ts +31 -28
- package/src/api/nodeConversions/fragmentToBlocks.ts +1 -1
- package/src/api/nodeConversions/nodeToBlock.ts +240 -41
- package/src/api/nodeUtil.test.ts +16 -16
- package/src/api/nodeUtil.ts +10 -10
- package/src/api/parsers/html/parseHTML.ts +1 -1
- package/src/api/parsers/html/util/nestedLists.ts +2 -2
- package/src/api/parsers/markdown/parseMarkdown.ts +1 -1
- package/src/api/pmUtil.ts +7 -7
- package/src/api/positionMapping.test.ts +3 -3
- package/src/api/positionMapping.ts +5 -5
- package/src/blocks/AudioBlockContent/AudioBlockContent.ts +4 -4
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +18 -18
- package/src/blocks/FileBlockContent/FileBlockContent.ts +2 -2
- package/src/blocks/FileBlockContent/helpers/parse/parseFigureElement.ts +2 -2
- package/src/blocks/FileBlockContent/helpers/render/createAddFileButton.ts +6 -6
- package/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.ts +2 -2
- package/src/blocks/FileBlockContent/helpers/render/createFileNameWithIcon.ts +1 -1
- package/src/blocks/FileBlockContent/helpers/render/createResizableFileBlockWrapper.ts +7 -7
- package/src/blocks/FileBlockContent/helpers/toExternalHTML/createFigureWithCaption.ts +1 -1
- package/src/blocks/FileBlockContent/helpers/toExternalHTML/createLinkWithCaption.ts +1 -1
- package/src/blocks/FileBlockContent/uploadToTmpFilesDotOrg_DEV_ONLY.ts +2 -2
- package/src/blocks/HeadingBlockContent/HeadingBlockContent.ts +6 -6
- package/src/blocks/ImageBlockContent/ImageBlockContent.ts +4 -4
- package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +4 -4
- package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +10 -10
- package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +1 -1
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListIndexingPlugin.ts +1 -1
- package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +4 -4
- package/src/blocks/ListItemBlockContent/getListItemContent.ts +5 -5
- package/src/blocks/PageBreakBlockContent/PageBreakBlockContent.ts +1 -1
- package/src/blocks/PageBreakBlockContent/getPageBreakSlashMenuItems.ts +3 -3
- package/src/blocks/PageBreakBlockContent/schema.ts +2 -2
- package/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +3 -3
- package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +4 -4
- package/src/blocks/README.md +1 -1
- package/src/blocks/TableBlockContent/TableBlockContent.ts +37 -7
- package/src/blocks/TableBlockContent/TableExtension.ts +3 -3
- package/src/blocks/VideoBlockContent/VideoBlockContent.ts +4 -4
- package/src/blocks/defaultBlockHelpers.ts +8 -8
- package/src/blocks/defaultBlockTypeGuards.ts +16 -16
- package/src/blocks/defaultBlocks.ts +3 -3
- package/src/comments/threadstore/DefaultThreadStoreAuth.ts +3 -3
- package/src/comments/threadstore/ThreadStore.ts +1 -1
- package/src/comments/threadstore/TipTapThreadStore.ts +10 -10
- package/src/comments/threadstore/yjs/RESTYjsThreadStore.ts +4 -4
- package/src/comments/threadstore/yjs/YjsThreadStore.test.ts +2 -2
- package/src/comments/threadstore/yjs/YjsThreadStore.ts +14 -14
- package/src/comments/threadstore/yjs/YjsThreadStoreBase.ts +1 -1
- package/src/comments/threadstore/yjs/yjsHelpers.ts +6 -6
- package/src/editor/Block.css +35 -1
- package/src/editor/BlockNoteEditor.test.ts +10 -3
- package/src/editor/BlockNoteEditor.ts +95 -38
- package/src/editor/BlockNoteExtension.ts +26 -0
- package/src/editor/BlockNoteExtensions.ts +38 -22
- package/src/editor/BlockNoteSchema.ts +4 -4
- package/src/editor/BlockNoteTipTapEditor.ts +33 -12
- package/src/editor/README.md +1 -1
- package/src/editor/cursorPositionTypes.ts +1 -1
- package/src/editor/editor.css +15 -3
- package/src/editor/selectionTypes.ts +1 -1
- package/src/editor/transformPasted.ts +2 -2
- package/src/exporter/Exporter.ts +5 -5
- package/src/exporter/mapping.ts +7 -7
- package/src/extensions/BackgroundColor/BackgroundColorMark.ts +1 -1
- package/src/extensions/Collaboration/CursorPlugin.ts +15 -9
- package/src/extensions/Collaboration/ForkYDocPlugin.test.ts +166 -0
- package/src/extensions/Collaboration/ForkYDocPlugin.ts +174 -0
- package/src/extensions/Collaboration/SyncPlugin.ts +7 -4
- package/src/extensions/Collaboration/UndoPlugin.ts +7 -4
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor-forked.json +30 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-editor.json +30 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap-forked.html +1 -0
- package/src/extensions/Collaboration/__snapshots__/fork-yjs-snap.html +1 -0
- package/src/extensions/Comments/CommentsPlugin.ts +80 -75
- package/src/extensions/Comments/userstore/UserStore.ts +2 -2
- package/src/extensions/FilePanel/FilePanelPlugin.ts +56 -55
- package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +60 -30
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +26 -26
- package/src/extensions/LinkToolbar/LinkToolbarPlugin.ts +33 -32
- package/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.ts +45 -42
- package/src/extensions/Placeholder/PlaceholderPlugin.ts +113 -110
- package/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.ts +179 -170
- package/src/extensions/README.md +1 -1
- package/src/extensions/ShowSelection/ShowSelectionPlugin.ts +22 -19
- package/src/extensions/SideMenu/MultipleNodeSelection.ts +1 -1
- package/src/extensions/SideMenu/SideMenuPlugin.ts +49 -48
- package/src/extensions/SideMenu/dragging.ts +8 -8
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +176 -176
- package/src/extensions/SuggestionMenu/getDefaultEmojiPickerItems.ts +2 -2
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +16 -16
- package/src/extensions/Suggestions/SuggestionMarks.ts +175 -0
- package/src/extensions/TableHandles/TableHandlesPlugin.ts +199 -195
- package/src/extensions/TrailingNode/TrailingNodeExtension.ts +1 -1
- package/src/extensions/UniqueID/UniqueID.ts +6 -6
- package/src/extensions/getDraggableBlockFromElement.ts +1 -1
- package/src/fonts/inter.css +18 -9
- package/src/i18n/locales/ar.ts +0 -1
- package/src/i18n/locales/de.ts +0 -1
- package/src/i18n/locales/en.ts +0 -1
- package/src/i18n/locales/es.ts +0 -1
- package/src/i18n/locales/fr.ts +0 -1
- package/src/i18n/locales/hr.ts +0 -1
- package/src/i18n/locales/is.ts +0 -1
- package/src/i18n/locales/it.ts +0 -1
- package/src/i18n/locales/ja.ts +0 -1
- package/src/i18n/locales/ko.ts +0 -1
- package/src/i18n/locales/nl.ts +0 -1
- package/src/i18n/locales/no.ts +0 -1
- package/src/i18n/locales/pl.ts +0 -1
- package/src/i18n/locales/pt.ts +0 -1
- package/src/i18n/locales/ru.ts +0 -1
- package/src/i18n/locales/sk.ts +0 -1
- package/src/i18n/locales/uk.ts +0 -1
- package/src/i18n/locales/vi.ts +0 -1
- package/src/i18n/locales/zh-tw.ts +0 -1
- package/src/i18n/locales/zh.ts +0 -1
- package/src/index.ts +18 -8
- package/src/locales.ts +1 -1
- package/src/pm-nodes/BlockContainer.ts +1 -1
- package/src/pm-nodes/BlockGroup.ts +2 -2
- package/src/pm-nodes/Doc.ts +5 -4
- package/src/schema/README.md +1 -1
- package/src/schema/blocks/createSpec.ts +14 -14
- package/src/schema/blocks/internal.ts +17 -17
- package/src/schema/blocks/types.ts +25 -25
- package/src/schema/inlineContent/createSpec.ts +16 -20
- package/src/schema/inlineContent/internal.ts +9 -9
- package/src/schema/inlineContent/types.ts +26 -26
- package/src/schema/propTypes.ts +8 -8
- package/src/schema/styles/createSpec.ts +2 -2
- package/src/schema/styles/internal.ts +7 -7
- package/src/schema/styles/types.ts +2 -2
- package/src/util/EventEmitter.ts +4 -4
- package/src/util/README.md +1 -1
- package/src/util/combineByGroup.ts +1 -1
- package/src/util/table.ts +33 -30
- package/types/src/api/blockManipulation/commands/insertBlocks/insertBlocks.d.ts +1 -1
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.d.ts +4 -0
- package/types/src/api/blockManipulation/commands/removeBlocks/removeBlocks.test.d.ts +1 -0
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +3 -1
- package/types/src/api/blockManipulation/selections/selection.d.ts +10 -0
- package/types/src/api/blockManipulation/selections/textCursorPosition.d.ts +5 -0
- package/types/src/api/blockManipulation/transactions.test.d.ts +0 -0
- package/types/src/api/clipboard/clipboardExternal.test.d.ts +1 -0
- package/types/src/api/clipboard/clipboardInternal.test.d.ts +1 -0
- package/types/src/api/clipboard/testUtil.d.ts +541 -0
- package/types/src/api/exporters/html/htmlConversion.test.d.ts +1 -0
- package/types/src/api/exporters/markdown/markdownExporter.test.d.ts +1 -0
- package/types/src/api/nodeConversions/nodeConversions.test.d.ts +1 -0
- package/types/src/api/nodeConversions/nodeToBlock.d.ts +39 -2
- package/types/src/api/parsers/html/parseHTML.test.d.ts +1 -0
- package/types/src/api/parsers/markdown/parseMarkdown.test.d.ts +1 -0
- package/types/src/api/pmUtil.d.ts +3 -3
- package/types/src/api/testUtil/cases/customBlocks.d.ts +670 -0
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +558 -0
- package/types/src/api/testUtil/cases/customStyles.d.ts +552 -0
- package/types/src/api/testUtil/cases/defaultSchema.d.ts +4 -0
- package/types/src/api/testUtil/index.d.ts +14 -0
- package/types/src/api/testUtil/partialBlockTestUtil.d.ts +9 -0
- package/types/src/api/testUtil/paste.d.ts +2 -0
- package/types/src/blocks/CodeBlockContent/defaultSupportedLanguages.d.ts +6 -0
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +9 -1
- package/types/src/editor/BlockNoteEditor.d.ts +58 -10
- package/types/src/editor/BlockNoteExtension.d.ts +9 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +2 -2
- package/types/src/editor/BlockNoteTipTapEditor.d.ts +2 -2
- package/types/src/extensions/Collaboration/CursorPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/ForkYDocPlugin.d.ts +41 -0
- package/types/src/extensions/Collaboration/ForkYDocPlugin.test.d.ts +1 -0
- package/types/src/extensions/Collaboration/SyncPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/UndoPlugin.d.ts +3 -3
- package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +17 -0
- package/types/src/extensions/Comments/CommentsPlugin.d.ts +2 -4
- package/types/src/extensions/FilePanel/FilePanelPlugin.d.ts +3 -4
- package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +5 -5
- package/types/src/extensions/LinkToolbar/LinkToolbarPlugin.d.ts +3 -4
- package/types/src/extensions/NodeSelectionKeyboard/NodeSelectionKeyboardPlugin.d.ts +2 -3
- package/types/src/extensions/Placeholder/PlaceholderPlugin.d.ts +2 -3
- package/types/src/extensions/PreviousBlockType/PreviousBlockTypePlugin.d.ts +2 -3
- package/types/src/extensions/ShowSelection/ShowSelectionPlugin.d.ts +2 -3
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +3 -4
- package/types/src/extensions/SuggestionMenu/SuggestionPlugin.d.ts +2 -4
- package/types/src/extensions/Suggestions/SuggestionMarks.d.ts +4 -0
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +5 -6
- package/types/src/i18n/locales/en.d.ts +0 -1
- package/types/src/i18n/locales/sk.d.ts +0 -1
- package/types/src/index.d.ts +15 -8
- package/dist/en-B7ycW7c8.js.map +0 -1
- package/dist/en-D4taoCs4.cjs.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/api/blockManipulation/selections/__snapshots__/selection.test.ts.snap +0 -844
- package/src/api/blockManipulation/selections/selection.test.ts +0 -72
- package/src/api/blockManipulation/selections/textCursorPosition/__snapshots__/textCursorPosition.test.ts.snap +0 -316
- package/src/api/blockManipulation/selections/textCursorPosition/textCursorPosition.test.ts +0 -74
|
@@ -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: [
|