@atlaskit/editor-plugin-table 8.4.12 → 8.4.13
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/CHANGELOG.md +11 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +6 -3
- package/dist/cjs/nodeviews/TableCell.js +5 -0
- package/dist/cjs/nodeviews/TableComponent.js +92 -29
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +7 -1
- package/dist/cjs/nodeviews/TableContainer.js +16 -6
- package/dist/cjs/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/cjs/nodeviews/TableResizer.js +44 -15
- package/dist/cjs/nodeviews/TableRow.js +45 -1
- package/dist/cjs/nodeviews/TableStickyScrollbar.js +21 -2
- package/dist/cjs/nodeviews/lazy-node-views.js +16 -4
- package/dist/cjs/nodeviews/table.js +53 -18
- package/dist/cjs/pm-plugins/commands/clear.js +6 -0
- package/dist/cjs/pm-plugins/commands/column-resize.js +26 -17
- package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +39 -26
- package/dist/cjs/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/cjs/pm-plugins/commands/hover.js +17 -13
- package/dist/cjs/pm-plugins/commands/insert.js +27 -10
- package/dist/cjs/pm-plugins/commands/misc.js +29 -9
- package/dist/cjs/pm-plugins/commands/selection.js +4 -0
- package/dist/cjs/pm-plugins/commands/sort.js +10 -1
- package/dist/cjs/pm-plugins/commands/toggle.js +2 -0
- package/dist/cjs/pm-plugins/decorations/plugin.js +9 -4
- package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +19 -10
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +16 -7
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +21 -8
- package/dist/cjs/pm-plugins/handlers.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +103 -24
- package/dist/cjs/pm-plugins/main.js +22 -11
- package/dist/cjs/pm-plugins/table-resizing/commands.js +7 -6
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +39 -20
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +4 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +19 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +8 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +6 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/cjs/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/cjs/pm-plugins/table-width.js +9 -4
- package/dist/cjs/pm-plugins/transforms/column-width.js +8 -5
- package/dist/cjs/pm-plugins/transforms/delete-columns.js +2 -0
- package/dist/cjs/pm-plugins/transforms/fix-tables.js +24 -8
- package/dist/cjs/pm-plugins/transforms/merge.js +7 -0
- package/dist/cjs/pm-plugins/transforms/replace-table.js +6 -3
- package/dist/cjs/pm-plugins/transforms/split.js +6 -1
- package/dist/cjs/pm-plugins/utils/alignment.js +4 -1
- package/dist/cjs/pm-plugins/utils/analytics.js +3 -3
- package/dist/cjs/pm-plugins/utils/column-controls.js +4 -0
- package/dist/cjs/pm-plugins/utils/create.js +2 -2
- package/dist/cjs/pm-plugins/utils/decoration.js +24 -6
- package/dist/cjs/pm-plugins/utils/dom.js +4 -0
- package/dist/cjs/pm-plugins/utils/drag-menu.js +19 -7
- package/dist/cjs/pm-plugins/utils/nodes.js +3 -0
- package/dist/cjs/pm-plugins/utils/paste.js +4 -1
- package/dist/cjs/pm-plugins/utils/row-controls.js +4 -1
- package/dist/cjs/tablePlugin.js +24 -18
- package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/cjs/ui/DragHandle/HandleIconComponent.js +5 -3
- package/dist/cjs/ui/DragHandle/index.js +14 -7
- package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/cjs/ui/FloatingContextualButton/index.js +7 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +32 -15
- package/dist/cjs/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/cjs/ui/FloatingDeleteButton/index.js +27 -5
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +19 -7
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -1
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/cjs/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/cjs/ui/FloatingInsertButton/index.js +27 -3
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +30 -8
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +9 -5
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/cjs/ui/TableFloatingControls/FloatingControlsWithSelection.js +4 -4
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +8 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +9 -5
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +68 -41
- package/dist/cjs/ui/TableFloatingControls/index.js +19 -8
- package/dist/cjs/ui/common-styles.js +1 -1
- package/dist/cjs/ui/event-handlers.js +59 -32
- package/dist/cjs/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/cjs/ui/toolbar.js +42 -16
- package/dist/es2019/nodeviews/ExternalDropTargets.js +5 -2
- package/dist/es2019/nodeviews/TableCell.js +5 -0
- package/dist/es2019/nodeviews/TableComponent.js +77 -13
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +8 -1
- package/dist/es2019/nodeviews/TableContainer.js +14 -4
- package/dist/es2019/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/es2019/nodeviews/TableResizer.js +33 -4
- package/dist/es2019/nodeviews/TableRow.js +45 -1
- package/dist/es2019/nodeviews/TableStickyScrollbar.js +20 -2
- package/dist/es2019/nodeviews/lazy-node-views.js +16 -4
- package/dist/es2019/nodeviews/table.js +47 -12
- package/dist/es2019/pm-plugins/commands/clear.js +6 -0
- package/dist/es2019/pm-plugins/commands/column-resize.js +16 -7
- package/dist/es2019/pm-plugins/commands/commands-with-analytics.js +28 -9
- package/dist/es2019/pm-plugins/commands/delete.js +4 -1
- package/dist/es2019/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/es2019/pm-plugins/commands/hover.js +5 -1
- package/dist/es2019/pm-plugins/commands/insert.js +26 -6
- package/dist/es2019/pm-plugins/commands/misc.js +25 -5
- package/dist/es2019/pm-plugins/commands/selection.js +4 -0
- package/dist/es2019/pm-plugins/commands/sort.js +10 -1
- package/dist/es2019/pm-plugins/commands/toggle.js +2 -0
- package/dist/es2019/pm-plugins/decorations/plugin.js +7 -2
- package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +14 -5
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +17 -5
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +21 -5
- package/dist/es2019/pm-plugins/handlers.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +104 -24
- package/dist/es2019/pm-plugins/main.js +16 -5
- package/dist/es2019/pm-plugins/table-resizing/commands.js +3 -2
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +25 -6
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +4 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +23 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +12 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +9 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +18 -6
- package/dist/es2019/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/es2019/pm-plugins/table-width.js +7 -2
- package/dist/es2019/pm-plugins/transforms/column-width.js +12 -5
- package/dist/es2019/pm-plugins/transforms/delete-columns.js +6 -1
- package/dist/es2019/pm-plugins/transforms/fix-tables.js +20 -4
- package/dist/es2019/pm-plugins/transforms/merge.js +7 -0
- package/dist/es2019/pm-plugins/transforms/replace-table.js +5 -2
- package/dist/es2019/pm-plugins/transforms/split.js +6 -1
- package/dist/es2019/pm-plugins/utils/alignment.js +4 -1
- package/dist/es2019/pm-plugins/utils/analytics.js +2 -2
- package/dist/es2019/pm-plugins/utils/column-controls.js +4 -0
- package/dist/es2019/pm-plugins/utils/create.js +1 -1
- package/dist/es2019/pm-plugins/utils/decoration.js +24 -6
- package/dist/es2019/pm-plugins/utils/dom.js +4 -0
- package/dist/es2019/pm-plugins/utils/drag-menu.js +19 -4
- package/dist/es2019/pm-plugins/utils/nodes.js +3 -0
- package/dist/es2019/pm-plugins/utils/paste.js +8 -2
- package/dist/es2019/pm-plugins/utils/row-controls.js +4 -1
- package/dist/es2019/pm-plugins/utils/snapping.js +4 -1
- package/dist/es2019/tablePlugin.js +13 -4
- package/dist/es2019/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/es2019/ui/DragHandle/HandleIconComponent.js +3 -1
- package/dist/es2019/ui/DragHandle/index.js +10 -3
- package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/es2019/ui/FloatingContextualButton/index.js +7 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +23 -6
- package/dist/es2019/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/es2019/ui/FloatingDeleteButton/index.js +23 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +15 -3
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -1
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/es2019/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/es2019/ui/FloatingInsertButton/index.js +26 -2
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +28 -6
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +7 -2
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/FloatingControlsWithSelection.js +2 -2
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +7 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +7 -2
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +32 -6
- package/dist/es2019/ui/TableFloatingControls/index.js +14 -3
- package/dist/es2019/ui/common-styles.js +7 -0
- package/dist/es2019/ui/event-handlers.js +35 -5
- package/dist/es2019/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/es2019/ui/toolbar.js +58 -14
- package/dist/esm/nodeviews/ExternalDropTargets.js +5 -2
- package/dist/esm/nodeviews/TableCell.js +5 -0
- package/dist/esm/nodeviews/TableComponent.js +75 -11
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +8 -1
- package/dist/esm/nodeviews/TableContainer.js +14 -4
- package/dist/esm/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/esm/nodeviews/TableResizer.js +33 -4
- package/dist/esm/nodeviews/TableRow.js +45 -1
- package/dist/esm/nodeviews/TableStickyScrollbar.js +21 -2
- package/dist/esm/nodeviews/lazy-node-views.js +16 -4
- package/dist/esm/nodeviews/table.js +47 -12
- package/dist/esm/pm-plugins/commands/clear.js +6 -0
- package/dist/esm/pm-plugins/commands/column-resize.js +16 -7
- package/dist/esm/pm-plugins/commands/commands-with-analytics.js +20 -7
- package/dist/esm/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/esm/pm-plugins/commands/hover.js +5 -1
- package/dist/esm/pm-plugins/commands/insert.js +22 -5
- package/dist/esm/pm-plugins/commands/misc.js +25 -5
- package/dist/esm/pm-plugins/commands/selection.js +4 -0
- package/dist/esm/pm-plugins/commands/sort.js +10 -1
- package/dist/esm/pm-plugins/commands/toggle.js +2 -0
- package/dist/esm/pm-plugins/decorations/plugin.js +7 -2
- package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +14 -5
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +13 -4
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +17 -4
- package/dist/esm/pm-plugins/handlers.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +104 -24
- package/dist/esm/pm-plugins/main.js +16 -5
- package/dist/esm/pm-plugins/table-resizing/commands.js +3 -2
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +25 -6
- package/dist/esm/pm-plugins/table-resizing/plugin.js +4 -1
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +19 -1
- package/dist/esm/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/esm/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/esm/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +8 -1
- package/dist/esm/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +5 -2
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +2 -2
- package/dist/esm/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/esm/pm-plugins/table-width.js +7 -2
- package/dist/esm/pm-plugins/transforms/column-width.js +6 -4
- package/dist/esm/pm-plugins/transforms/delete-columns.js +2 -0
- package/dist/esm/pm-plugins/transforms/fix-tables.js +20 -4
- package/dist/esm/pm-plugins/transforms/merge.js +7 -0
- package/dist/esm/pm-plugins/transforms/replace-table.js +5 -2
- package/dist/esm/pm-plugins/transforms/split.js +6 -1
- package/dist/esm/pm-plugins/utils/alignment.js +4 -1
- package/dist/esm/pm-plugins/utils/analytics.js +2 -2
- package/dist/esm/pm-plugins/utils/column-controls.js +4 -0
- package/dist/esm/pm-plugins/utils/create.js +1 -1
- package/dist/esm/pm-plugins/utils/decoration.js +24 -6
- package/dist/esm/pm-plugins/utils/dom.js +4 -0
- package/dist/esm/pm-plugins/utils/drag-menu.js +15 -3
- package/dist/esm/pm-plugins/utils/nodes.js +3 -0
- package/dist/esm/pm-plugins/utils/paste.js +4 -1
- package/dist/esm/pm-plugins/utils/row-controls.js +4 -1
- package/dist/esm/tablePlugin.js +11 -4
- package/dist/esm/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/esm/ui/DragHandle/HandleIconComponent.js +3 -1
- package/dist/esm/ui/DragHandle/index.js +10 -3
- package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/esm/ui/FloatingContextualButton/index.js +7 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +23 -6
- package/dist/esm/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/esm/ui/FloatingDeleteButton/index.js +23 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +15 -3
- package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +4 -1
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/esm/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/esm/ui/FloatingInsertButton/index.js +26 -2
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +28 -6
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +6 -2
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/esm/ui/TableFloatingControls/FloatingControlsWithSelection.js +2 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +7 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +6 -2
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +65 -38
- package/dist/esm/ui/TableFloatingControls/index.js +14 -3
- package/dist/esm/ui/common-styles.js +1 -1
- package/dist/esm/ui/event-handlers.js +31 -4
- package/dist/esm/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/esm/ui/toolbar.js +34 -8
- package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/commands.d.ts +1 -1
- package/dist/types/pm-plugins/transforms/column-width.d.ts +1 -1
- package/dist/types/pm-plugins/utils/collapse.d.ts +2 -1
- package/dist/types/ui/FloatingContextualButton/FixedButton.d.ts +1 -1
- package/dist/types/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -4
- package/dist/types/ui/TableFloatingControls/index.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/collapse.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -4
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +3 -3
- package/package.json +3 -3
- package/src/nodeviews/ExternalDropTargets.tsx +3 -1
- package/src/nodeviews/TableCell.ts +4 -0
- package/src/nodeviews/TableComponent.tsx +63 -18
- package/src/nodeviews/TableComponentWithSharedState.tsx +4 -0
- package/src/nodeviews/TableContainer.tsx +7 -1
- package/src/nodeviews/TableNodeViewBase.ts +4 -0
- package/src/nodeviews/TableResizer.tsx +27 -4
- package/src/nodeviews/TableRow.ts +41 -1
- package/src/nodeviews/TableStickyScrollbar.ts +14 -0
- package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +2 -0
- package/src/nodeviews/__mocks__/OverridableMock.ts +6 -0
- package/src/nodeviews/lazy-node-views.ts +8 -0
- package/src/nodeviews/table.tsx +30 -4
- package/src/pm-plugins/commands/clear.ts +6 -0
- package/src/pm-plugins/commands/column-resize.ts +12 -9
- package/src/pm-plugins/commands/commands-with-analytics.ts +21 -4
- package/src/pm-plugins/commands/delete.ts +2 -0
- package/src/pm-plugins/commands/go-to-next-cell.ts +2 -0
- package/src/pm-plugins/commands/hover.ts +7 -5
- package/src/pm-plugins/commands/insert.ts +15 -1
- package/src/pm-plugins/commands/misc.ts +24 -3
- package/src/pm-plugins/commands/selection.ts +4 -0
- package/src/pm-plugins/commands/sort.ts +9 -1
- package/src/pm-plugins/commands/toggle.ts +2 -0
- package/src/pm-plugins/decorations/plugin.ts +5 -1
- package/src/pm-plugins/decorations/utils/column-resizing.ts +2 -0
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +8 -2
- package/src/pm-plugins/drag-and-drop/commands.ts +9 -1
- package/src/pm-plugins/drag-and-drop/plugin.ts +17 -2
- package/src/pm-plugins/handlers.ts +1 -1
- package/src/pm-plugins/keymap.ts +54 -0
- package/src/pm-plugins/main.ts +12 -5
- package/src/pm-plugins/table-resizing/commands.ts +4 -3
- package/src/pm-plugins/table-resizing/event-handlers.ts +24 -10
- package/src/pm-plugins/table-resizing/plugin.ts +3 -1
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +17 -1
- package/src/pm-plugins/table-resizing/utils/column-state.ts +4 -0
- package/src/pm-plugins/table-resizing/utils/content-width.ts +14 -0
- package/src/pm-plugins/table-resizing/utils/dom.ts +4 -0
- package/src/pm-plugins/table-resizing/utils/misc.ts +2 -0
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +9 -1
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +6 -0
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -1
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +10 -2
- package/src/pm-plugins/table-selection-keymap.ts +8 -0
- package/src/pm-plugins/table-width.ts +5 -1
- package/src/pm-plugins/transforms/column-width.ts +9 -7
- package/src/pm-plugins/transforms/delete-columns.ts +4 -0
- package/src/pm-plugins/transforms/fix-tables.ts +13 -6
- package/src/pm-plugins/transforms/merge.ts +6 -0
- package/src/pm-plugins/transforms/replace-table.ts +3 -1
- package/src/pm-plugins/transforms/split.ts +4 -0
- package/src/pm-plugins/utils/alignment.ts +2 -0
- package/src/pm-plugins/utils/analytics.ts +2 -2
- package/src/pm-plugins/utils/collapse.ts +3 -4
- package/src/pm-plugins/utils/column-controls.ts +4 -0
- package/src/pm-plugins/utils/create.ts +1 -1
- package/src/pm-plugins/utils/decoration.ts +12 -0
- package/src/pm-plugins/utils/dom.ts +4 -0
- package/src/pm-plugins/utils/drag-menu.ts +12 -1
- package/src/pm-plugins/utils/nodes.ts +2 -0
- package/src/pm-plugins/utils/paste.ts +4 -0
- package/src/pm-plugins/utils/row-controls.ts +2 -0
- package/src/pm-plugins/utils/snapping.ts +2 -0
- package/src/tablePlugin.tsx +13 -15
- package/src/tablePluginType.ts +10 -0
- package/src/ui/ColumnResizeWidget/index.tsx +2 -0
- package/src/ui/DragHandle/HandleIconComponent.tsx +3 -1
- package/src/ui/DragHandle/index.tsx +11 -2
- package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +6 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +5 -1
- package/src/ui/FloatingContextualButton/index.tsx +8 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +17 -7
- package/src/ui/FloatingContextualMenu/index.tsx +11 -1
- package/src/ui/FloatingDeleteButton/index.tsx +23 -4
- package/src/ui/FloatingDragMenu/DragMenu.tsx +13 -6
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +10 -0
- package/src/ui/FloatingDragMenu/index.tsx +3 -1
- package/src/ui/FloatingInsertButton/InsertButton.tsx +4 -0
- package/src/ui/FloatingInsertButton/getPopupOptions.ts +4 -0
- package/src/ui/FloatingInsertButton/index.tsx +21 -1
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +19 -2
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/index.tsx +8 -4
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +2 -0
- package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +2 -2
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +7 -1
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +11 -3
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +20 -1
- package/src/ui/TableFloatingControls/index.tsx +13 -4
- package/src/ui/common-styles.ts +7 -0
- package/src/ui/event-handlers.ts +28 -3
- package/src/ui/icons/SortingIconWrapper.tsx +2 -0
- package/src/ui/toolbar.tsx +43 -11
- package/tsconfig.json +0 -1
|
@@ -31,7 +31,10 @@ export const defaultTablePreserveSnappingWidths = (lengthOffset, editorContainer
|
|
|
31
31
|
/**
|
|
32
32
|
* Returns keys of guidelines that are closest to the table and within the snapGap
|
|
33
33
|
*/
|
|
34
|
-
export const findClosestSnap = (currentWidth, snapWidths, guidelines, snapGap = 0, tolerance = 0
|
|
34
|
+
export const findClosestSnap = (currentWidth, snapWidths, guidelines, snapGap = 0, tolerance = 0
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
37
|
+
) => {
|
|
35
38
|
const closestGapIndex = snapWidths.reduce((prev, curr, index) => Math.abs(curr - currentWidth) < Math.abs(snapWidths[prev] - currentWidth) ? index : prev, 0);
|
|
36
39
|
const gap = Math.abs(snapWidths[closestGapIndex] - currentWidth);
|
|
37
40
|
if (gap < snapGap) {
|
|
@@ -21,25 +21,32 @@ import { pluginKey as tableAnalyticsPluginKey } from './pm-plugins/analytics/plu
|
|
|
21
21
|
import { insertTableWithNestingSupport, insertTableWithSize } from './pm-plugins/commands/insert';
|
|
22
22
|
import { pluginConfig } from './pm-plugins/create-plugin-config';
|
|
23
23
|
import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
|
|
24
|
-
import { createPlugin as createDragAndDropPlugin
|
|
24
|
+
import { createPlugin as createDragAndDropPlugin } from './pm-plugins/drag-and-drop/plugin';
|
|
25
|
+
import { pluginKey as dragAndDropPluginKey } from './pm-plugins/drag-and-drop/plugin-key';
|
|
25
26
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
26
27
|
import { createPlugin } from './pm-plugins/main';
|
|
27
28
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
28
29
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
29
30
|
import { createPlugin as createTableSafariDeleteCompositionTextIssueWorkaroundPlugin } from './pm-plugins/safari-delete-composition-text-issue-workaround';
|
|
30
|
-
import { createPlugin as createStickyHeadersPlugin
|
|
31
|
+
import { createPlugin as createStickyHeadersPlugin } from './pm-plugins/sticky-headers/plugin';
|
|
32
|
+
import { pluginKey as stickyHeadersPluginKey } from './pm-plugins/sticky-headers/plugin-key';
|
|
33
|
+
import { findStickyHeaderForTable } from './pm-plugins/sticky-headers/util';
|
|
31
34
|
import { createPlugin as createTableOverflowAnalyticsPlugin } from './pm-plugins/table-analytics';
|
|
32
35
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
33
|
-
import { createPlugin as createFlexiResizingPlugin
|
|
36
|
+
import { createPlugin as createFlexiResizingPlugin } from './pm-plugins/table-resizing/plugin';
|
|
37
|
+
import { getPluginState as getFlexiResizingPlugin } from './pm-plugins/table-resizing/plugin-factory';
|
|
38
|
+
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing/plugin-key';
|
|
34
39
|
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
35
40
|
import { createPlugin as createTableWidthPlugin, pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
36
41
|
import { createPlugin as createTableWidthInCommentFixPlugin } from './pm-plugins/table-width-in-comment-fix';
|
|
37
|
-
import { createTableWithWidth } from './pm-plugins/utils';
|
|
42
|
+
import { createTableWithWidth } from './pm-plugins/utils/create';
|
|
38
43
|
import { createPlugin as createViewModeSortPlugin } from './pm-plugins/view-mode-sort';
|
|
39
44
|
import FloatingContextualButton from './ui/FloatingContextualButton';
|
|
40
45
|
import FloatingContextualMenu from './ui/FloatingContextualMenu';
|
|
41
46
|
import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
42
47
|
import FloatingDragMenu from './ui/FloatingDragMenu';
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
43
50
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
44
51
|
import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
|
|
45
52
|
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
@@ -437,6 +444,8 @@ const tablesPlugin = ({
|
|
|
437
444
|
isDragAndDropEnabled,
|
|
438
445
|
tableWrapperTarget,
|
|
439
446
|
isCellMenuOpenByKeyboard
|
|
447
|
+
// Ignored via go/ees005
|
|
448
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
440
449
|
} = tablePluginState;
|
|
441
450
|
const {
|
|
442
451
|
allowControls
|
|
@@ -40,5 +40,7 @@ export const ColumnResizeWidget = ({
|
|
|
40
40
|
className: TableCssClassName.RESIZE_HANDLE_DECORATION,
|
|
41
41
|
"data-start-index": startIndex,
|
|
42
42
|
"data-end-index": endIndex
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
43
45
|
}, tooltipProps)));
|
|
44
46
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DragHandleDisabledIcon
|
|
2
|
+
import { DragHandleDisabledIcon } from '../icons/DragHandleDisabledIcon';
|
|
3
|
+
import { DragHandleIcon } from '../icons/DragHandleIcon';
|
|
4
|
+
import { MinimisedHandleIcon } from '../icons/MinimisedHandle';
|
|
3
5
|
export const HandleIconComponent = props => {
|
|
4
6
|
const {
|
|
5
7
|
forceDefaultHandle,
|
|
@@ -10,7 +10,7 @@ import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
|
10
10
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
11
11
|
import { getPluginState as getDnDPluginState } from '../../pm-plugins/drag-and-drop/plugin-factory';
|
|
12
12
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
13
|
-
import { findDuplicatePosition, hasMergedCellsInSelection } from '../../pm-plugins/utils';
|
|
13
|
+
import { findDuplicatePosition, hasMergedCellsInSelection } from '../../pm-plugins/utils/merged-cells';
|
|
14
14
|
import { TableCssClassName as ClassName } from '../../types';
|
|
15
15
|
import { dragTableInsertColumnButtonSize } from '../consts';
|
|
16
16
|
import { DragPreview } from '../DragPreview';
|
|
@@ -219,14 +219,21 @@ const DragHandleComponent = ({
|
|
|
219
219
|
}
|
|
220
220
|
}, appearance !== 'placeholder' ?
|
|
221
221
|
// cannot block pointer events in Firefox as it breaks Dragging functionality
|
|
222
|
-
browser.gecko ?
|
|
222
|
+
browser.gecko ?
|
|
223
|
+
/*#__PURE__*/
|
|
224
|
+
// Ignored via go/ees005
|
|
225
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
226
|
+
React.createElement(HandleIconComponent, handleIconProps) :
|
|
223
227
|
/*#__PURE__*/
|
|
224
228
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
225
229
|
React.createElement("span", {
|
|
226
230
|
style: {
|
|
227
231
|
pointerEvents: 'none'
|
|
228
232
|
}
|
|
229
|
-
}, /*#__PURE__*/React.createElement(HandleIconComponent
|
|
233
|
+
}, /*#__PURE__*/React.createElement(HandleIconComponent
|
|
234
|
+
// Ignored via go/ees005
|
|
235
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
236
|
+
, handleIconProps)) : null), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(DragPreview, {
|
|
230
237
|
direction: direction,
|
|
231
238
|
width: previewWidth,
|
|
232
239
|
height: previewHeight
|
|
@@ -19,12 +19,19 @@ export const FloatingAlignmentButtons = ({
|
|
|
19
19
|
}, jsx(ButtonGroup, null, alignmentButtons.map((item, idx) => {
|
|
20
20
|
switch (item.type) {
|
|
21
21
|
case 'separator':
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
22
24
|
return jsx(FloatingToolbarSeparator, {
|
|
23
25
|
key: idx
|
|
24
26
|
});
|
|
25
27
|
case 'button':
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
30
|
const ButtonIcon = item.icon;
|
|
27
|
-
return jsx(Button
|
|
31
|
+
return jsx(Button
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
34
|
+
, {
|
|
28
35
|
key: idx,
|
|
29
36
|
icon: item.icon ? jsx(ButtonIcon, {
|
|
30
37
|
label: item.title
|
|
@@ -73,8 +73,12 @@ export const FixedButton = ({
|
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
observer.observe(observerTargetRefCurrent);
|
|
76
|
+
// Ignored via go/ees005
|
|
77
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
76
78
|
tableWrapper.addEventListener('scroll', handleScroll);
|
|
77
79
|
return () => {
|
|
80
|
+
// Ignored via go/ees005
|
|
81
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
78
82
|
tableWrapper.removeEventListener('scroll', handleScroll);
|
|
79
83
|
fixedButtonRefCurrent.style.transform = '';
|
|
80
84
|
observer.unobserve(observerTargetRefCurrent);
|
|
@@ -18,6 +18,9 @@ import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
18
18
|
import ExpandIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
19
19
|
import { toggleContextualMenu } from '../../pm-plugins/commands';
|
|
20
20
|
import { TableCssClassName as ClassName } from '../../types';
|
|
21
|
+
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
21
24
|
import FixedButton from './FixedButton';
|
|
22
25
|
import { tableFloatingCellButtonSelectedStyles, tableFloatingCellButtonStyles } from './styles';
|
|
23
26
|
const BUTTON_OFFSET = 3;
|
|
@@ -119,5 +122,8 @@ export default function (props) {
|
|
|
119
122
|
component: ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON,
|
|
120
123
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
121
124
|
fallbackComponent: null
|
|
122
|
-
}, jsx(FloatingContextualButton
|
|
125
|
+
}, jsx(FloatingContextualButton
|
|
126
|
+
// Ignored via go/ees005
|
|
127
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
128
|
+
, props));
|
|
123
129
|
}
|
|
@@ -36,11 +36,15 @@ import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsW
|
|
|
36
36
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
37
37
|
import { pluginKey as tablePluginKey } from '../../pm-plugins/plugin-key';
|
|
38
38
|
import { getNewResizeStateFromSelectedColumns } from '../../pm-plugins/table-resizing/utils/resize-state';
|
|
39
|
-
import { canMergeCells } from '../../pm-plugins/transforms';
|
|
40
|
-
import {
|
|
39
|
+
import { canMergeCells } from '../../pm-plugins/transforms/merge';
|
|
40
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
|
|
41
|
+
import { getMergedCellsPositions } from '../../pm-plugins/utils/table';
|
|
41
42
|
import { TableCssClassName as ClassName } from '../../types';
|
|
42
43
|
import { colorPalletteColumns, contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD } from '../consts';
|
|
43
|
-
import { AddColRightIcon
|
|
44
|
+
import { AddColRightIcon } from '../icons/AddColRightIcon';
|
|
45
|
+
import { AddRowBelowIcon } from '../icons/AddRowBelowIcon';
|
|
46
|
+
import { MergeCellsIcon } from '../icons/MergeCellsIcon';
|
|
47
|
+
import { SplitCellIcon } from '../icons/SplitCellIcon';
|
|
44
48
|
import { cellColourPreviewStyles } from './styles';
|
|
45
49
|
const arrowsList = new Set(['ArrowRight', 'ArrowLeft']);
|
|
46
50
|
const elementBeforeIconStyles = xcss({
|
|
@@ -57,7 +61,10 @@ export class ContextualMenu extends Component {
|
|
|
57
61
|
});
|
|
58
62
|
_defineProperty(this, "dropdownMenuRef", /*#__PURE__*/React.createRef());
|
|
59
63
|
_defineProperty(this, "handleSubMenuRef", ref => {
|
|
60
|
-
const parent = closestElement(
|
|
64
|
+
const parent = closestElement(
|
|
65
|
+
// Ignored via go/ees005
|
|
66
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
67
|
+
this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
|
|
61
68
|
if (!(parent && ref)) {
|
|
62
69
|
return;
|
|
63
70
|
}
|
|
@@ -93,7 +100,10 @@ export class ContextualMenu extends Component {
|
|
|
93
100
|
const background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
|
|
94
101
|
let selectedRowIndex;
|
|
95
102
|
let selectedColumnIndex;
|
|
96
|
-
const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette,
|
|
103
|
+
const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette,
|
|
104
|
+
// Ignored via go/ees005
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
106
|
+
background, colorPalletteColumns);
|
|
97
107
|
selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
98
108
|
selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
99
109
|
return {
|
|
@@ -138,7 +148,10 @@ export class ContextualMenu extends Component {
|
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
150
|
},
|
|
141
|
-
isPopupPositioned: true
|
|
151
|
+
isPopupPositioned: true
|
|
152
|
+
// Ignored via go/ees005
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
154
|
+
,
|
|
142
155
|
isOpenedByKeyboard: isCellMenuOpenByKeyboard
|
|
143
156
|
}, jsx(ColorPalette, {
|
|
144
157
|
cols: 7,
|
|
@@ -653,6 +666,8 @@ export class ContextualMenu extends Component {
|
|
|
653
666
|
}
|
|
654
667
|
}
|
|
655
668
|
});
|
|
669
|
+
// Ignored via go/ees005
|
|
670
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
656
671
|
_defineProperty(this, "handleItemMouseEnter", ({
|
|
657
672
|
item
|
|
658
673
|
}) => {
|
|
@@ -680,6 +695,8 @@ export class ContextualMenu extends Component {
|
|
|
680
695
|
hoverMergedCells()(state, dispatch);
|
|
681
696
|
}
|
|
682
697
|
});
|
|
698
|
+
// Ignored via go/ees005
|
|
699
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
683
700
|
_defineProperty(this, "handleItemMouseLeave", ({
|
|
684
701
|
item
|
|
685
702
|
}) => {
|
|
@@ -10,6 +10,9 @@ import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from
|
|
|
10
10
|
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
11
11
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
12
12
|
import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
|
|
13
|
+
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
13
16
|
import ContextualMenu from './ContextualMenu';
|
|
14
17
|
import { tablePopupStyles } from './styles';
|
|
15
18
|
const FloatingContextualMenu = ({
|
|
@@ -37,7 +40,10 @@ const FloatingContextualMenu = ({
|
|
|
37
40
|
const {
|
|
38
41
|
selection
|
|
39
42
|
} = editorView.state;
|
|
40
|
-
const selectionRect = isSelectionType(selection, 'cell') ?
|
|
43
|
+
const selectionRect = isSelectionType(selection, 'cell') ?
|
|
44
|
+
// Ignored via go/ees005
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
|
+
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
41
47
|
if (!selectionRect) {
|
|
42
48
|
return null;
|
|
43
49
|
}
|
|
@@ -49,7 +55,10 @@ const FloatingContextualMenu = ({
|
|
|
49
55
|
const parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
|
|
50
56
|
return jsx(Popup, {
|
|
51
57
|
alignX: "right",
|
|
52
|
-
alignY: "top"
|
|
58
|
+
alignY: "top"
|
|
59
|
+
// Ignored via go/ees005
|
|
60
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
61
|
+
,
|
|
53
62
|
target: targetCellRef,
|
|
54
63
|
mountTo: mountPoint,
|
|
55
64
|
boundariesElement: boundariesElement,
|
|
@@ -70,8 +79,14 @@ const FloatingContextualMenu = ({
|
|
|
70
79
|
offset: [contextualMenuTriggerSize / 2, -contextualMenuTriggerSize],
|
|
71
80
|
isOpen: isOpen,
|
|
72
81
|
targetCellPosition: targetCellPosition,
|
|
73
|
-
allowColumnSorting: pluginConfig && pluginConfig.allowColumnSorting
|
|
74
|
-
|
|
82
|
+
allowColumnSorting: pluginConfig && pluginConfig.allowColumnSorting
|
|
83
|
+
// Ignored via go/ees005
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
85
|
+
,
|
|
86
|
+
allowMergeCells: pluginConfig.allowMergeCells
|
|
87
|
+
// Ignored via go/ees005
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
89
|
+
,
|
|
75
90
|
allowBackgroundColor: pluginConfig.allowBackgroundColor,
|
|
76
91
|
selectionRect: selectionRect,
|
|
77
92
|
boundariesElement: boundariesElement,
|
|
@@ -12,7 +12,8 @@ import { getSelectionRect, isTableSelected } from '@atlaskit/editor-tables/utils
|
|
|
12
12
|
import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
|
|
13
13
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
14
14
|
import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-factory';
|
|
15
|
-
import { getColumnDeleteButtonParams, getColumnsWidths
|
|
15
|
+
import { getColumnDeleteButtonParams, getColumnsWidths } from '../../pm-plugins/utils/column-controls';
|
|
16
|
+
import { getRowDeleteButtonParams, getRowHeights } from '../../pm-plugins/utils/row-controls';
|
|
16
17
|
import { TableCssClassName as ClassName } from '../../types';
|
|
17
18
|
import { stickyRowZIndex } from '../consts';
|
|
18
19
|
import DeleteButton from './DeleteButton';
|
|
@@ -28,6 +29,9 @@ function getSelectionType(selection) {
|
|
|
28
29
|
}
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
32
|
+
|
|
33
|
+
// Ignored via go/ees005
|
|
34
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
35
|
class FloatingDeleteButton extends Component {
|
|
32
36
|
constructor(props) {
|
|
33
37
|
super(props);
|
|
@@ -36,6 +40,8 @@ class FloatingDeleteButton extends Component {
|
|
|
36
40
|
const tableWrapper = closestElement(this.props.tableRef, `.${ClassName.TABLE_NODE_WRAPPER}`);
|
|
37
41
|
if (tableWrapper) {
|
|
38
42
|
this.wrapper = tableWrapper;
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
39
45
|
this.wrapper.addEventListener('scroll', this.onWrapperScrolled);
|
|
40
46
|
this.setState({
|
|
41
47
|
scrollLeft: tableWrapper.scrollLeft
|
|
@@ -43,6 +49,8 @@ class FloatingDeleteButton extends Component {
|
|
|
43
49
|
} else {
|
|
44
50
|
if (this.wrapper) {
|
|
45
51
|
// unsubscribe if we previously had one and it just went away
|
|
52
|
+
// Ignored via go/ees005
|
|
53
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
46
54
|
this.wrapper.removeEventListener('scroll', this.onWrapperScrolled);
|
|
47
55
|
|
|
48
56
|
// and reset scroll position
|
|
@@ -54,6 +62,8 @@ class FloatingDeleteButton extends Component {
|
|
|
54
62
|
}
|
|
55
63
|
});
|
|
56
64
|
_defineProperty(this, "onWrapperScrolled", e => {
|
|
65
|
+
// Ignored via go/ees005
|
|
66
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
57
67
|
const wrapper = e.target;
|
|
58
68
|
this.setState({
|
|
59
69
|
scrollLeft: wrapper.scrollLeft
|
|
@@ -67,10 +77,14 @@ class FloatingDeleteButton extends Component {
|
|
|
67
77
|
switch (this.state.selectionType) {
|
|
68
78
|
case 'row':
|
|
69
79
|
{
|
|
80
|
+
// Ignored via go/ees005
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
70
82
|
return hoverRows(this.state.indexes, true)(state, dispatch, this.props.editorView);
|
|
71
83
|
}
|
|
72
84
|
case 'column':
|
|
73
85
|
{
|
|
86
|
+
// Ignored via go/ees005
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
74
88
|
return hoverColumns(this.state.indexes, true)(state, dispatch, this.props.editorView);
|
|
75
89
|
}
|
|
76
90
|
}
|
|
@@ -143,6 +157,8 @@ class FloatingDeleteButton extends Component {
|
|
|
143
157
|
}
|
|
144
158
|
componentWillUnmount() {
|
|
145
159
|
if (this.wrapper) {
|
|
160
|
+
// Ignored via go/ees005
|
|
161
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
146
162
|
this.wrapper.removeEventListener('scroll', this.onWrapperScrolled);
|
|
147
163
|
}
|
|
148
164
|
}
|
|
@@ -172,6 +188,8 @@ class FloatingDeleteButton extends Component {
|
|
|
172
188
|
if (deleteBtnParams) {
|
|
173
189
|
return {
|
|
174
190
|
...deleteBtnParams,
|
|
191
|
+
// Ignored via go/ees005
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
175
193
|
top: inStickyMode ? nextProps.stickyHeaders.top : 0,
|
|
176
194
|
position: inStickyMode ? 'sticky' : undefined,
|
|
177
195
|
selectionType
|
|
@@ -242,6 +260,8 @@ class FloatingDeleteButton extends Component {
|
|
|
242
260
|
if (this.state.position === 'sticky' && mountTo) {
|
|
243
261
|
const headerRow = tableRef.querySelector('tr.sticky');
|
|
244
262
|
if (headerRow) {
|
|
263
|
+
// Ignored via go/ees005
|
|
264
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
245
265
|
const rect = headerRow.getBoundingClientRect();
|
|
246
266
|
const calculatePosition = popupOpts.onPositionCalculated || (pos => pos);
|
|
247
267
|
const pos = calculatePosition({
|
|
@@ -271,6 +291,8 @@ class FloatingDeleteButton extends Component {
|
|
|
271
291
|
scrollableElement: this.wrapper || undefined,
|
|
272
292
|
forcePlacement: true,
|
|
273
293
|
allowOutOfBounds: true
|
|
294
|
+
// Ignored via go/ees005
|
|
295
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
274
296
|
}, popupOpts), button);
|
|
275
297
|
}
|
|
276
298
|
}
|
|
@@ -29,8 +29,9 @@ import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRow
|
|
|
29
29
|
import { toggleDragMenu } from '../../pm-plugins/drag-and-drop/commands';
|
|
30
30
|
import { getPluginState } from '../../pm-plugins/drag-and-drop/plugin-factory';
|
|
31
31
|
import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-factory';
|
|
32
|
-
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils';
|
|
33
32
|
import { getDragMenuConfig } from '../../pm-plugins/utils/drag-menu';
|
|
33
|
+
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
|
|
34
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
|
|
34
35
|
import { TableCssClassName as ClassName } from '../../types';
|
|
35
36
|
import { colorPalletteColumns } from '../consts';
|
|
36
37
|
import { DropdownMenu } from './DropdownMenu';
|
|
@@ -215,7 +216,10 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
215
216
|
const {
|
|
216
217
|
isKeyboardModeActive
|
|
217
218
|
} = getPluginState(state);
|
|
218
|
-
const selectionRect = isSelectionType(selection, 'cell') ?
|
|
219
|
+
const selectionRect = isSelectionType(selection, 'cell') ?
|
|
220
|
+
// Ignored via go/ees005
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
222
|
+
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
219
223
|
const hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
|
|
220
224
|
const allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
221
225
|
const dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor);
|
|
@@ -224,7 +228,10 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
224
228
|
menuCallback
|
|
225
229
|
} = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect);
|
|
226
230
|
const handleSubMenuRef = ref => {
|
|
227
|
-
const parent = closestElement(
|
|
231
|
+
const parent = closestElement(
|
|
232
|
+
// Ignored via go/ees005
|
|
233
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
234
|
+
editorView.dom, '.fabric-editor-popup-scroll-parent');
|
|
228
235
|
if (!(parent && ref)) {
|
|
229
236
|
return;
|
|
230
237
|
}
|
|
@@ -295,6 +302,8 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
295
302
|
bubbles: true
|
|
296
303
|
});
|
|
297
304
|
setIsSubmenuOpen(false);
|
|
305
|
+
// Ignored via go/ees005
|
|
306
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
298
307
|
target === null || target === void 0 ? void 0 : target.focus();
|
|
299
308
|
target === null || target === void 0 ? void 0 : target.dispatchEvent(keyboardEvent);
|
|
300
309
|
},
|
|
@@ -451,6 +460,9 @@ const DragMenu = /*#__PURE__*/React.memo(({
|
|
|
451
460
|
}
|
|
452
461
|
(item.value.name === 'delete_column' ? hoverColumns(getSelectedColumnIndexes(selectionRect), true) : hoverRows(getSelectedRowIndexes(selectionRect), true))(state, dispatch);
|
|
453
462
|
};
|
|
463
|
+
|
|
464
|
+
// Ignored via go/ees005
|
|
465
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
454
466
|
const handleItemMouseLeave = ({
|
|
455
467
|
item
|
|
456
468
|
}) => {
|
|
@@ -9,6 +9,8 @@ import { MenuGroup, Section } from '@atlaskit/menu';
|
|
|
9
9
|
import { dragMenuDropdownWidth } from '../consts';
|
|
10
10
|
const DropListWithOutsideClickTargetRef = props => {
|
|
11
11
|
const setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
12
14
|
return /*#__PURE__*/React.createElement(DropList, _extends({
|
|
13
15
|
onDroplistRef: setOutsideClickTargetRef
|
|
14
16
|
}, props));
|
|
@@ -65,7 +67,10 @@ export const DropdownMenu = ({
|
|
|
65
67
|
role: "menu"
|
|
66
68
|
}, items.map((group, index) => /*#__PURE__*/React.createElement(Section, {
|
|
67
69
|
hasSeparator: (section === null || section === void 0 ? void 0 : section.hasSeparator) && index > 0,
|
|
68
|
-
title: section === null || section === void 0 ? void 0 : section.title
|
|
70
|
+
title: section === null || section === void 0 ? void 0 : section.title
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
73
|
+
,
|
|
69
74
|
key: index
|
|
70
75
|
}, group.items.map(item => {
|
|
71
76
|
var _item$key;
|
|
@@ -87,7 +92,10 @@ export const DropdownMenu = ({
|
|
|
87
92
|
}, /*#__PURE__*/React.createElement("div", {
|
|
88
93
|
className: "drag-dropdown-menu-popup-ref",
|
|
89
94
|
ref: handleRef
|
|
90
|
-
}), /*#__PURE__*/React.createElement(Popup
|
|
95
|
+
}), /*#__PURE__*/React.createElement(Popup
|
|
96
|
+
// Ignored via go/ees005
|
|
97
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
98
|
+
, {
|
|
91
99
|
target: targetRefDiv,
|
|
92
100
|
mountTo: mountPoint,
|
|
93
101
|
boundariesElement: boundariesElement,
|
|
@@ -115,6 +123,9 @@ export const DropdownMenu = ({
|
|
|
115
123
|
// the correct menu item is sent in onItemActivated callback
|
|
116
124
|
const keys = ['row_numbers', 'header_row', 'header_column'];
|
|
117
125
|
let doubleItemCount = 0;
|
|
126
|
+
|
|
127
|
+
// Ignored via go/ees005
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
118
129
|
const firstIndex = results.findIndex(value => keys.includes(value.key));
|
|
119
130
|
if (firstIndex === -1 || index <= firstIndex) {
|
|
120
131
|
onItemActivated && onItemActivated({
|
|
@@ -123,6 +134,8 @@ export const DropdownMenu = ({
|
|
|
123
134
|
return;
|
|
124
135
|
}
|
|
125
136
|
for (let i = firstIndex; i < results.length; i += 1) {
|
|
137
|
+
// Ignored via go/ees005
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
126
139
|
if (keys.includes(results[i].key)) {
|
|
127
140
|
doubleItemCount += 1;
|
|
128
141
|
}
|
|
@@ -40,7 +40,10 @@ const FloatingDragMenu = ({
|
|
|
40
40
|
const shouldUseIncreasedScalingPercent = isTableScalingEnabled && (tableWithFixedColumnWidthsOption || isCommentEditor);
|
|
41
41
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
42
42
|
alignX: direction === 'row' ? 'right' : undefined,
|
|
43
|
-
alignY: direction === 'row' ? 'start' : undefined
|
|
43
|
+
alignY: direction === 'row' ? 'start' : undefined
|
|
44
|
+
// Ignored via go/ees005
|
|
45
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
46
|
+
,
|
|
44
47
|
target: targetHandleRef,
|
|
45
48
|
mountTo: mountPoint,
|
|
46
49
|
boundariesElement: boundariesElement,
|
|
@@ -43,7 +43,11 @@ const getInsertLineWidth = (tableRef, isDragAndDropEnabled, isChromelessEditor)
|
|
|
43
43
|
parentElement,
|
|
44
44
|
offsetWidth
|
|
45
45
|
} = tableRef;
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
48
|
const parentOffsetWidth = parentElement.offsetWidth;
|
|
49
|
+
// Ignored via go/ees005
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
47
51
|
const {
|
|
48
52
|
scrollLeft
|
|
49
53
|
} = parentElement;
|
|
@@ -32,6 +32,9 @@ function getRowOptions(index, isDragAndDropEnabled) {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
35
38
|
function getColumnOptions(index, tableContainer, hasNumberedColumns, isDragAndDropEnabled) {
|
|
36
39
|
const options = {
|
|
37
40
|
alignX: 'end',
|
|
@@ -77,6 +80,9 @@ function getColumnOptions(index, tableContainer, hasNumberedColumns, isDragAndDr
|
|
|
77
80
|
}
|
|
78
81
|
return options;
|
|
79
82
|
}
|
|
83
|
+
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
86
|
function getPopupOptions(direction, index, hasNumberedColumns, isDragAndDropEnabled, tableContainer) {
|
|
81
87
|
switch (direction) {
|
|
82
88
|
case 'column':
|
|
@@ -11,10 +11,12 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
11
11
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
12
12
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
13
13
|
import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
14
|
-
import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils';
|
|
14
|
+
import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
|
|
15
15
|
import { TableCssClassName as ClassName } from '../../types';
|
|
16
16
|
import getPopupOptions from './getPopupOptions';
|
|
17
17
|
import InsertButton, { DragAndDropInsertButton } from './InsertButton';
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
18
20
|
export class FloatingInsertButton extends React.Component {
|
|
19
21
|
constructor(props) {
|
|
20
22
|
super(props);
|
|
@@ -88,6 +90,8 @@ export class FloatingInsertButton extends React.Component {
|
|
|
88
90
|
selection: editorView.state.selection.toJSON(),
|
|
89
91
|
position: pos,
|
|
90
92
|
docSize: editorView.state.doc.nodeSize,
|
|
93
|
+
// Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
95
|
error: error === null || error === void 0 ? void 0 : error.toString()
|
|
92
96
|
}
|
|
93
97
|
};
|
|
@@ -103,6 +107,9 @@ export class FloatingInsertButton extends React.Component {
|
|
|
103
107
|
}
|
|
104
108
|
const tableContainerWrapper = closestElement(targetCellRef, `.${ClassName.TABLE_CONTAINER}`);
|
|
105
109
|
const tableWrapper = closestElement(targetCellRef, `.${ClassName.TABLE_NODE_WRAPPER}`);
|
|
110
|
+
|
|
111
|
+
// Ignored via go/ees005
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
106
113
|
const index = type === 'column' ? insertColumnButtonIndex : insertRowButtonIndex;
|
|
107
114
|
const hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state.selection);
|
|
108
115
|
|
|
@@ -114,10 +121,15 @@ export class FloatingInsertButton extends React.Component {
|
|
|
114
121
|
return /*#__PURE__*/React.createElement(Popup, _extends({
|
|
115
122
|
target: targetCellRef,
|
|
116
123
|
mountTo: tableContainerWrapper || mountPoint,
|
|
117
|
-
boundariesElement: tableContainerWrapper || boundariesElement
|
|
124
|
+
boundariesElement: tableContainerWrapper || boundariesElement
|
|
125
|
+
// Ignored via go/ees005
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
127
|
+
,
|
|
118
128
|
scrollableElement: tableWrapper,
|
|
119
129
|
forcePlacement: true,
|
|
120
130
|
allowOutOfBounds: true
|
|
131
|
+
// Ignored via go/ees005
|
|
132
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
121
133
|
}, getPopupOptions(type, index, hasNumberedColumns, !!isDragAndDropEnabled, tableContainerWrapper), {
|
|
122
134
|
zIndex: zIndex
|
|
123
135
|
}), isDragAndDropEnabled ? /*#__PURE__*/React.createElement(DragAndDropInsertButton, {
|
|
@@ -138,18 +150,30 @@ export class FloatingInsertButton extends React.Component {
|
|
|
138
150
|
insertColumnButtonIndex,
|
|
139
151
|
insertRowButtonIndex
|
|
140
152
|
} = this.props;
|
|
153
|
+
// Ignored via go/ees005
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
141
155
|
const tableMap = TableMap.get(tableNode);
|
|
142
156
|
if (type === 'column') {
|
|
157
|
+
// Ignored via go/ees005
|
|
158
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
143
159
|
const columnIndex = insertColumnButtonIndex === 0 ? 0 : insertColumnButtonIndex - 1;
|
|
144
160
|
if (columnIndex > tableMap.width - 1) {
|
|
145
161
|
return null;
|
|
146
162
|
}
|
|
163
|
+
|
|
164
|
+
// Ignored via go/ees005
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
147
166
|
return tableMap.positionAt(0, columnIndex, tableNode);
|
|
148
167
|
} else {
|
|
168
|
+
// Ignored via go/ees005
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
149
170
|
const rowIndex = insertRowButtonIndex === 0 ? 0 : insertRowButtonIndex - 1;
|
|
150
171
|
if (rowIndex > tableMap.height - 1) {
|
|
151
172
|
return null;
|
|
152
173
|
}
|
|
174
|
+
|
|
175
|
+
// Ignored via go/ees005
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
153
177
|
return tableMap.positionAt(rowIndex, 0, tableNode);
|
|
154
178
|
}
|
|
155
179
|
}
|