@atlaskit/editor-plugin-table 8.4.11 → 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 +17 -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 +4 -4
- 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
|
@@ -37,10 +37,15 @@ import type {
|
|
|
37
37
|
} from '../../types';
|
|
38
38
|
import { getPluginState } from '../plugin-factory';
|
|
39
39
|
import { distributeColumnsWidths } from '../table-resizing/commands';
|
|
40
|
-
import type { ResizeStateWithAnalytics } from '../table-resizing/utils';
|
|
41
|
-
import { deleteRows
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
40
|
+
import type { ResizeStateWithAnalytics } from '../table-resizing/utils/types';
|
|
41
|
+
import { deleteRows } from '../transforms/delete-rows';
|
|
42
|
+
import { mergeCells } from '../transforms/merge';
|
|
43
|
+
import {
|
|
44
|
+
withEditorAnalyticsAPI,
|
|
45
|
+
getSelectedCellInfo,
|
|
46
|
+
getSelectedTableInfo,
|
|
47
|
+
} from '../utils/analytics';
|
|
48
|
+
import { checkIfNumberColumnEnabled } from '../utils/nodes';
|
|
44
49
|
|
|
45
50
|
import { clearMultipleCells } from './clear';
|
|
46
51
|
import { wrapTableInExpand } from './collapse';
|
|
@@ -235,6 +240,8 @@ export const changeColumnWidthByStepWithAnalytics =
|
|
|
235
240
|
inputMethod: INPUT_METHOD.SHORTCUT,
|
|
236
241
|
ariaNotify?: (message: string) => void,
|
|
237
242
|
getIntl?: () => IntlShape,
|
|
243
|
+
// Ignored via go/ees005
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
238
245
|
) =>
|
|
239
246
|
withEditorAnalyticsAPI((state) => {
|
|
240
247
|
const { table, totalRowCount, totalColumnCount } = getSelectedTableInfo(state.selection);
|
|
@@ -277,6 +284,8 @@ export const insertColumnWithAnalytics =
|
|
|
277
284
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
278
285
|
shouldUseIncreasedScalingPercent = false,
|
|
279
286
|
isCommentEditor = false,
|
|
287
|
+
// Ignored via go/ees005
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
280
289
|
) =>
|
|
281
290
|
(
|
|
282
291
|
inputMethod:
|
|
@@ -354,6 +363,8 @@ export const deleteColumnsWithAnalytics =
|
|
|
354
363
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
355
364
|
shouldUseIncreasedScalingPercent = false,
|
|
356
365
|
isCommentEditor = false,
|
|
366
|
+
// Ignored via go/ees005
|
|
367
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
357
368
|
) =>
|
|
358
369
|
(
|
|
359
370
|
inputMethod:
|
|
@@ -398,6 +409,8 @@ export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut =
|
|
|
398
409
|
isTableScalingEnabled?: boolean,
|
|
399
410
|
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
400
411
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
412
|
+
// Ignored via go/ees005
|
|
413
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
401
414
|
): Command =>
|
|
402
415
|
(state, dispatch) => {
|
|
403
416
|
const { selection } = state;
|
|
@@ -646,6 +659,8 @@ export const setTableAlignmentWithAnalytics =
|
|
|
646
659
|
previousAlignment: TableLayout,
|
|
647
660
|
inputMethod: INPUT_METHOD.FLOATING_TB,
|
|
648
661
|
reason: CHANGE_ALIGNMENT_REASON,
|
|
662
|
+
// Ignored via go/ees005
|
|
663
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
649
664
|
) =>
|
|
650
665
|
withEditorAnalyticsAPI((state) => {
|
|
651
666
|
const { table, totalRowCount, totalColumnCount } = getSelectedTableInfo(state.selection);
|
|
@@ -680,6 +695,8 @@ export const setTableAlignmentWithTableContentWithPosWithAnalytics =
|
|
|
680
695
|
tableNodeWithPos: NodeWithPos,
|
|
681
696
|
inputMethod: INPUT_METHOD.AUTO,
|
|
682
697
|
reason: CHANGE_ALIGNMENT_REASON,
|
|
698
|
+
// Ignored via go/ees005
|
|
699
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
683
700
|
) =>
|
|
684
701
|
withEditorAnalyticsAPI(() => {
|
|
685
702
|
const map = TableMap.get(tableNodeWithPos.node);
|
|
@@ -13,6 +13,8 @@ export const deleteColumnsCommand =
|
|
|
13
13
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
14
14
|
shouldUseIncreasedScalingPercent = false,
|
|
15
15
|
isCommentEditor = false,
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
16
18
|
): Command =>
|
|
17
19
|
(state, dispatch, view) => {
|
|
18
20
|
const tr = deleteColumns(
|
|
@@ -41,6 +41,8 @@ export const goToNextCell =
|
|
|
41
41
|
|
|
42
42
|
const map = TableMap.get(table.node);
|
|
43
43
|
const { tableCell, tableHeader } = state.schema.nodes;
|
|
44
|
+
// Ignored via go/ees005
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
46
|
const cell = findParentNodeOfType([tableCell, tableHeader])(state.selection)!;
|
|
45
47
|
const firstCellPos = map.positionAt(0, 0, table.node) + table.start;
|
|
46
48
|
const lastCellPos = map.positionAt(map.height - 1, map.width - 1, table.node) + table.start;
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
createCellHoverDecoration,
|
|
10
10
|
createColumnLineResize,
|
|
11
11
|
createControlsHoverDecoration,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from '../utils';
|
|
12
|
+
} from '../utils/decoration';
|
|
13
|
+
import { getMergedCellsPositions } from '../utils/table';
|
|
14
|
+
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations';
|
|
15
15
|
|
|
16
16
|
const makeArray = (n: number) => Array.from(Array(n).keys());
|
|
17
17
|
|
|
@@ -30,6 +30,8 @@ export const hoverMergedCells = () =>
|
|
|
30
30
|
const mergedCells: Cell[] = mergedCellsPositions.map((pos) => ({
|
|
31
31
|
pos: pos + table.start,
|
|
32
32
|
start: pos + table.start + 1,
|
|
33
|
+
// Ignored via go/ees005
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
33
35
|
node: table.node.nodeAt(pos)!,
|
|
34
36
|
}));
|
|
35
37
|
|
|
@@ -219,8 +221,8 @@ export const hoverCell = (rowIndex?: number, colIndex?: number) =>
|
|
|
219
221
|
// If no arguments have been passed then the intention it to reset the hover cell data
|
|
220
222
|
const clear = rowIndex === undefined && colIndex === undefined;
|
|
221
223
|
|
|
222
|
-
const nextRowIndex = clear ? undefined : rowIndex ?? prevHoveredCell.rowIndex;
|
|
223
|
-
const nextColIndex = clear ? undefined : colIndex ?? prevHoveredCell.colIndex;
|
|
224
|
+
const nextRowIndex = clear ? undefined : (rowIndex ?? prevHoveredCell.rowIndex);
|
|
225
|
+
const nextColIndex = clear ? undefined : (colIndex ?? prevHoveredCell.colIndex);
|
|
224
226
|
|
|
225
227
|
if (nextRowIndex === prevHoveredCell.rowIndex && nextColIndex === prevHoveredCell.colIndex) {
|
|
226
228
|
return false;
|
|
@@ -32,8 +32,10 @@ import type { PluginInjectionAPI } from '../../types';
|
|
|
32
32
|
import { updateRowOrColumnMovedTransform } from '../analytics/commands';
|
|
33
33
|
import { META_KEYS } from '../table-analytics';
|
|
34
34
|
import { rescaleColumns } from '../transforms/column-width';
|
|
35
|
-
import {
|
|
35
|
+
import { createTableWithWidth } from '../utils/create';
|
|
36
36
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
37
|
+
import { checkIfHeaderRowEnabled } from '../utils/nodes';
|
|
38
|
+
import { copyPreviousRow } from '../utils/row-controls';
|
|
37
39
|
|
|
38
40
|
type InsertTableWithNestingSupportCommand = (
|
|
39
41
|
options: {
|
|
@@ -62,6 +64,8 @@ function addColumnAtCustomStep(column: number) {
|
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
65
69
|
export function addColumnAt(
|
|
66
70
|
api: PluginInjectionAPI | undefined | null,
|
|
67
71
|
isTableScalingEnabled = false,
|
|
@@ -121,6 +125,8 @@ export const addColumnBefore =
|
|
|
121
125
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
122
126
|
shouldUseIncreasedScalingPercent = false,
|
|
123
127
|
isCommentEditor = false,
|
|
128
|
+
// Ignored via go/ees005
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
124
130
|
): Command =>
|
|
125
131
|
(state, dispatch, view) => {
|
|
126
132
|
const table = findTable(state.selection);
|
|
@@ -155,6 +161,8 @@ export const addColumnAfter =
|
|
|
155
161
|
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
156
162
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
157
163
|
isCommentEditor?: boolean,
|
|
164
|
+
// Ignored via go/ees005
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
158
166
|
): Command =>
|
|
159
167
|
(state, dispatch, view) => {
|
|
160
168
|
const table = findTable(state.selection);
|
|
@@ -188,6 +196,8 @@ export const insertColumn =
|
|
|
188
196
|
isTableFixedColumnWidthsOptionEnabled?: boolean,
|
|
189
197
|
shouldUseIncreasedScalingPercent?: boolean,
|
|
190
198
|
isCommentEditor?: boolean,
|
|
199
|
+
// Ignored via go/ees005
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
191
201
|
) =>
|
|
192
202
|
(column: number): Command =>
|
|
193
203
|
(state, dispatch, view) => {
|
|
@@ -272,6 +282,8 @@ export const createTable =
|
|
|
272
282
|
isCommentEditor?: boolean,
|
|
273
283
|
isChromelessEditor?: boolean,
|
|
274
284
|
isTableResizingEnabled?: boolean,
|
|
285
|
+
// Ignored via go/ees005
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
275
287
|
): Command =>
|
|
276
288
|
(state, dispatch) => {
|
|
277
289
|
const table = createTableWithWidth({
|
|
@@ -313,6 +325,8 @@ export const insertTableWithSize =
|
|
|
313
325
|
editorAnalyticsAPI?: EditorAnalyticsAPI,
|
|
314
326
|
isCommentEditor?: boolean,
|
|
315
327
|
isChromelessEditor?: boolean,
|
|
328
|
+
// Ignored via go/ees005
|
|
329
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
316
330
|
) =>
|
|
317
331
|
(rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER): EditorCommand => {
|
|
318
332
|
return ({ tr }) => {
|
|
@@ -40,9 +40,9 @@ import { getDecorations } from '../decorations/plugin';
|
|
|
40
40
|
import {
|
|
41
41
|
buildColumnResizingDecorations,
|
|
42
42
|
clearColumnResizingDecorations,
|
|
43
|
-
} from '../decorations/utils';
|
|
43
|
+
} from '../decorations/utils/column-resizing';
|
|
44
44
|
import { createCommand, getPluginState } from '../plugin-factory';
|
|
45
|
-
import { fixAutoSizedTable } from '../transforms';
|
|
45
|
+
import { fixAutoSizedTable } from '../transforms/fix-tables';
|
|
46
46
|
import {
|
|
47
47
|
createColumnControlsDecoration,
|
|
48
48
|
createColumnSelectedDecoration,
|
|
@@ -101,7 +101,12 @@ export const setTableRef = (ref?: HTMLTableElement) =>
|
|
|
101
101
|
);
|
|
102
102
|
|
|
103
103
|
export const setCellAttr =
|
|
104
|
-
(
|
|
104
|
+
(
|
|
105
|
+
name: string,
|
|
106
|
+
// Ignored via go/ees005
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
|
+
value: any,
|
|
109
|
+
): Command =>
|
|
105
110
|
(state, dispatch) => {
|
|
106
111
|
const { tr, selection } = state;
|
|
107
112
|
if (selection instanceof CellSelection) {
|
|
@@ -281,6 +286,8 @@ export const isInsideFirstCellOfRowOrColumn = (selection: Selection, type?: 'row
|
|
|
281
286
|
return false;
|
|
282
287
|
}
|
|
283
288
|
|
|
289
|
+
// Ignored via go/ees005
|
|
290
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
284
291
|
const map = TableMap.get(table.node!);
|
|
285
292
|
const cell = findCellClosestToPos(selection.$anchor);
|
|
286
293
|
if (!cell) {
|
|
@@ -310,6 +317,8 @@ export const deleteTableIfSelected: Command = (state, dispatch) => {
|
|
|
310
317
|
export const convertFirstRowToHeader =
|
|
311
318
|
(schema: Schema) =>
|
|
312
319
|
(tr: Transaction): Transaction => {
|
|
320
|
+
// Ignored via go/ees005
|
|
321
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
313
322
|
const table = findTable(tr.selection)!;
|
|
314
323
|
const map = TableMap.get(table.node);
|
|
315
324
|
for (let i = 0; i < map.width; i++) {
|
|
@@ -395,13 +404,19 @@ export const setMultipleCellAttrs =
|
|
|
395
404
|
const { targetCellPosition } = getPluginState(state);
|
|
396
405
|
|
|
397
406
|
if (isSelectionType(tr.selection, 'cell')) {
|
|
407
|
+
// Ignored via go/ees005
|
|
408
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
398
409
|
const selection = tr.selection as any as CellSelection;
|
|
399
410
|
selection.forEachCell((_cell, pos) => {
|
|
400
411
|
const $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
412
|
+
// Ignored via go/ees005
|
|
413
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
401
414
|
tr = setCellAttrs(findCellClosestToPos($pos)!, attrs)(tr);
|
|
402
415
|
});
|
|
403
416
|
cursorPos = selection.$headCell.pos;
|
|
404
417
|
} else if (targetCellPosition) {
|
|
418
|
+
// Ignored via go/ees005
|
|
419
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
405
420
|
const cell = findCellClosestToPos(tr.doc.resolve(targetCellPosition + 1))!;
|
|
406
421
|
tr = setCellAttrs(cell, attrs)(tr);
|
|
407
422
|
cursorPos = cell.pos;
|
|
@@ -563,6 +578,8 @@ export const addResizeHandleDecorations = (
|
|
|
563
578
|
includeTooltip: boolean,
|
|
564
579
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
565
580
|
isKeyboardResize?: boolean,
|
|
581
|
+
// Ignored via go/ees005
|
|
582
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
566
583
|
) =>
|
|
567
584
|
createCommand(
|
|
568
585
|
(state) => {
|
|
@@ -604,6 +621,8 @@ export const updateResizeHandleDecorations = (
|
|
|
604
621
|
rowIndex?: number,
|
|
605
622
|
columnIndex?: number,
|
|
606
623
|
includeTooltip?: boolean,
|
|
624
|
+
// Ignored via go/ees005
|
|
625
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
607
626
|
) =>
|
|
608
627
|
createCommand(
|
|
609
628
|
(state) => {
|
|
@@ -674,6 +693,8 @@ export const autoSizeTable = (
|
|
|
674
693
|
table: HTMLTableElement,
|
|
675
694
|
basePos: number | undefined,
|
|
676
695
|
opts: { containerWidth: number },
|
|
696
|
+
// Ignored via go/ees005
|
|
697
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
677
698
|
) => {
|
|
678
699
|
if (typeof basePos !== 'number') {
|
|
679
700
|
return false;
|
|
@@ -350,9 +350,13 @@ const selectFullTable =
|
|
|
350
350
|
let fullTableSelection: Selection;
|
|
351
351
|
let selectionRelativeToNode: RelativeSelectionPos;
|
|
352
352
|
if (dir === TableSelectionDirection.TopToBottom) {
|
|
353
|
+
// Ignored via go/ees005
|
|
354
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
353
355
|
fullTableSelection = new CellSelection($firstCell, $lastCell) as any;
|
|
354
356
|
selectionRelativeToNode = RelativeSelectionPos.End;
|
|
355
357
|
} else {
|
|
358
|
+
// Ignored via go/ees005
|
|
359
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
356
360
|
fullTableSelection = new CellSelection($lastCell, $firstCell) as any;
|
|
357
361
|
selectionRelativeToNode = RelativeSelectionPos.Start;
|
|
358
362
|
}
|
|
@@ -20,7 +20,11 @@ import { createCommand, getPluginState } from '../plugin-factory';
|
|
|
20
20
|
|
|
21
21
|
const createGetInlineCardTextFromStore = (attrs: CardAttributes): string | null => {
|
|
22
22
|
const { data } = attrs as DataType;
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
25
|
if (data && ((data as any).name || (data as any).title)) {
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
28
|
return (data as any).name || (data as any).title;
|
|
25
29
|
}
|
|
26
30
|
|
|
@@ -40,13 +44,17 @@ export const sortByColumn = (columnIndex: number, order: SortOrder = SortOrder.D
|
|
|
40
44
|
},
|
|
41
45
|
}),
|
|
42
46
|
(tr: Transaction, state: EditorState) => {
|
|
47
|
+
// Ignored via go/ees005
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
43
49
|
const table = findTable(tr.selection)!;
|
|
44
50
|
if (!table || !table.node) {
|
|
45
51
|
return tr;
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
const selectionRect = isSelectionType(tr.selection, 'cell')
|
|
49
|
-
?
|
|
55
|
+
? // Ignored via go/ees005
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
57
|
+
getSelectionRect(tr.selection)!
|
|
50
58
|
: findCellRectClosestToPos(tr.selection.$from);
|
|
51
59
|
|
|
52
60
|
if (!selectionRect) {
|
|
@@ -48,6 +48,8 @@ export const toggleHeaderColumn: Command = (state, dispatch): boolean =>
|
|
|
48
48
|
|
|
49
49
|
export const toggleNumberColumn: Command = (state, dispatch) => {
|
|
50
50
|
const { tr } = state;
|
|
51
|
+
// Ignored via go/ees005
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
51
53
|
const { node, pos } = findTable(state.selection)!;
|
|
52
54
|
const isNumberedColumnEnabled = node.attrs.isNumberColumnEnabled;
|
|
53
55
|
|
|
@@ -15,7 +15,7 @@ import { pluginKey as tableWidthPluginKey } from '../table-width';
|
|
|
15
15
|
import {
|
|
16
16
|
buildColumnControlsDecorations,
|
|
17
17
|
maybeUpdateColumnControlsSelectedDecoration,
|
|
18
|
-
} from './utils';
|
|
18
|
+
} from './utils/column-controls';
|
|
19
19
|
|
|
20
20
|
export const pluginKey = new PluginKey('tableDecorationsPlugin');
|
|
21
21
|
|
|
@@ -26,6 +26,8 @@ export const handleDocOrSelectionChanged = (
|
|
|
26
26
|
decorationSet: DecorationSet,
|
|
27
27
|
oldState: EditorState,
|
|
28
28
|
newState: EditorState,
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
29
31
|
): DecorationSet => {
|
|
30
32
|
const isResizing = tableWidthPluginKey.getState(newState)?.resizing;
|
|
31
33
|
const wasResizing = tableWidthPluginKey.getState(oldState)?.resizing;
|
|
@@ -62,6 +64,8 @@ export const createPlugin = () => {
|
|
|
62
64
|
state: {
|
|
63
65
|
init: () => DecorationSet.empty,
|
|
64
66
|
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
65
69
|
apply: (tr, decorationSet, oldState, newState) => {
|
|
66
70
|
let pluginState = decorationSet;
|
|
67
71
|
// main table plugin --->
|
|
@@ -38,6 +38,8 @@ export const buildColumnResizingDecorations =
|
|
|
38
38
|
includeTooltip: boolean,
|
|
39
39
|
getIntl: () => IntlShape,
|
|
40
40
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
41
|
+
// Ignored via go/ees005
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
41
43
|
): DecorationTransformer =>
|
|
42
44
|
({ tr, decorationSet }): DecorationSet => {
|
|
43
45
|
const [columnResizesDecorations, lastCellElementsDecorations] =
|
|
@@ -16,9 +16,9 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
16
16
|
import { findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
17
17
|
|
|
18
18
|
import type { DraggableData, DraggableType } from '../../types';
|
|
19
|
-
import {
|
|
20
|
-
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
19
|
+
import { getSelectedTableInfo , withEditorAnalyticsAPI } from '../utils/analytics';
|
|
21
20
|
import { canMove, getTargetIndex } from '../utils/drag-menu';
|
|
21
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../utils/selection';
|
|
22
22
|
|
|
23
23
|
import { clearDropTarget, cloneSource, moveSource } from './commands';
|
|
24
24
|
|
|
@@ -30,6 +30,8 @@ export const clearDropTargetWithAnalytics =
|
|
|
30
30
|
sourceIndexes: number[] | undefined,
|
|
31
31
|
status: TABLE_STATUS.CANCELLED | TABLE_STATUS.INVALID,
|
|
32
32
|
tr?: Transaction,
|
|
33
|
+
// Ignored via go/ees005
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
33
35
|
) => {
|
|
34
36
|
return withEditorAnalyticsAPI(({ selection }: EditorState) => {
|
|
35
37
|
const { totalRowCount, totalColumnCount } = getSelectedTableInfo(selection);
|
|
@@ -70,6 +72,8 @@ export const moveSourceWithAnalytics =
|
|
|
70
72
|
sourceIndexes: number[],
|
|
71
73
|
targetIndex: number,
|
|
72
74
|
tr?: Transaction,
|
|
75
|
+
// Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
73
77
|
) => {
|
|
74
78
|
return withEditorAnalyticsAPI(({ selection }: EditorState) => {
|
|
75
79
|
const direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|
|
@@ -190,6 +194,8 @@ export const cloneSourceWithAnalytics =
|
|
|
190
194
|
targetIndex: number,
|
|
191
195
|
targetDirection: 'start' | 'end',
|
|
192
196
|
tr?: Transaction,
|
|
197
|
+
// Ignored via go/ees005
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
193
199
|
) => {
|
|
194
200
|
return withEditorAnalyticsAPI(({ selection }: EditorState) => {
|
|
195
201
|
const direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|
|
@@ -5,7 +5,7 @@ import { cloneColumn, cloneRow, moveColumn, moveRow } from '@atlaskit/editor-tab
|
|
|
5
5
|
|
|
6
6
|
import type { DraggableType, TableDirection } from '../../types';
|
|
7
7
|
import { TableDecorations } from '../../types';
|
|
8
|
-
import { createColumnInsertLine, createRowInsertLine, updateDecorations } from '../utils';
|
|
8
|
+
import { createColumnInsertLine , createRowInsertLine , updateDecorations } from '../utils/decoration';
|
|
9
9
|
|
|
10
10
|
import { DragAndDropActionType } from './actions';
|
|
11
11
|
import { DropTargetType } from './consts';
|
|
@@ -29,6 +29,8 @@ export const setDropTarget = (
|
|
|
29
29
|
index: number,
|
|
30
30
|
hasMergedCells: boolean,
|
|
31
31
|
tr?: Transaction,
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
32
34
|
) =>
|
|
33
35
|
createCommand(
|
|
34
36
|
(state) => {
|
|
@@ -86,6 +88,8 @@ export const moveSource = (
|
|
|
86
88
|
sourceIndexes: number[],
|
|
87
89
|
targetIndex: number,
|
|
88
90
|
tr?: Transaction,
|
|
91
|
+
// Ignored via go/ees005
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
89
93
|
) =>
|
|
90
94
|
createCommand(
|
|
91
95
|
(state) => {
|
|
@@ -113,6 +117,8 @@ export const toggleDragMenu = (
|
|
|
113
117
|
direction?: TableDirection,
|
|
114
118
|
index?: number,
|
|
115
119
|
trigger: TriggerType = 'mouse',
|
|
120
|
+
// Ignored via go/ees005
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
116
122
|
) =>
|
|
117
123
|
createCommand(
|
|
118
124
|
(state) => {
|
|
@@ -170,6 +176,8 @@ export const cloneSource = (
|
|
|
170
176
|
targetIndex: number,
|
|
171
177
|
targetDirection: 'start' | 'end',
|
|
172
178
|
tr?: Transaction,
|
|
179
|
+
// Ignored via go/ees005
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
173
181
|
) =>
|
|
174
182
|
createCommand(
|
|
175
183
|
(state) => {
|
|
@@ -13,8 +13,9 @@ import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/ad
|
|
|
13
13
|
import type { DraggableSourceData } from '../../types';
|
|
14
14
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
15
15
|
import { pluginKey as tablePluginKey } from '../plugin-key';
|
|
16
|
-
import { insertColgroupFromNode } from '../table-resizing/utils';
|
|
17
|
-
import { findNearestCellIndexToPoint
|
|
16
|
+
import { insertColgroupFromNode } from '../table-resizing/utils/colgroup';
|
|
17
|
+
import { findNearestCellIndexToPoint } from '../utils/dom';
|
|
18
|
+
import { hasMergedCellsInBetween } from '../utils/merged-cells';
|
|
18
19
|
|
|
19
20
|
import { DragAndDropActionType } from './actions';
|
|
20
21
|
import { clearDropTarget, setDropTarget, toggleDragMenu } from './commands';
|
|
@@ -30,10 +31,14 @@ import { getDraggableDataFromEvent } from './utils/monitor';
|
|
|
30
31
|
|
|
31
32
|
const destroyFn = (
|
|
32
33
|
editorView: EditorView,
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
36
|
editorAnalyticsAPI: any,
|
|
34
37
|
isTableScalingEnabled: boolean,
|
|
35
38
|
isTableFixedColumnWidthsOptionEnabled: boolean,
|
|
36
39
|
isCommentEditor: boolean,
|
|
40
|
+
// Ignored via go/ees005
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
37
42
|
) => {
|
|
38
43
|
const editorPageScrollContainer = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
39
44
|
|
|
@@ -46,6 +51,8 @@ const destroyFn = (
|
|
|
46
51
|
},
|
|
47
52
|
onDragStart() {
|
|
48
53
|
// auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
|
|
54
|
+
// Ignored via go/ees005
|
|
55
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
49
56
|
(editorPageScrollContainer as HTMLElement).style.setProperty(
|
|
50
57
|
'scroll-behavior',
|
|
51
58
|
'unset',
|
|
@@ -53,10 +60,14 @@ const destroyFn = (
|
|
|
53
60
|
},
|
|
54
61
|
onDrop() {
|
|
55
62
|
// 'null' will remove the inline style
|
|
63
|
+
// Ignored via go/ees005
|
|
64
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
56
65
|
(editorPageScrollContainer as HTMLElement).style.setProperty('scroll-behavior', null);
|
|
57
66
|
},
|
|
58
67
|
}),
|
|
59
68
|
autoScrollForElements({
|
|
69
|
+
// Ignored via go/ees005
|
|
70
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
60
71
|
element: editorPageScrollContainer as HTMLElement,
|
|
61
72
|
canScroll: ({ source }) => {
|
|
62
73
|
const { type } = source.data as Partial<DraggableSourceData>;
|
|
@@ -254,6 +265,8 @@ export const createPlugin = (
|
|
|
254
265
|
isTableScalingEnabled = false,
|
|
255
266
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
256
267
|
isCommentEditor = false,
|
|
268
|
+
// Ignored via go/ees005
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
257
270
|
) => {
|
|
258
271
|
return new SafePlugin({
|
|
259
272
|
state: createPluginState(dispatch, (state) => ({
|
|
@@ -364,6 +377,8 @@ export const createPlugin = (
|
|
|
364
377
|
const isDragHandleFocused = [
|
|
365
378
|
'drag-handle-button-row',
|
|
366
379
|
'drag-handle-button-column',
|
|
380
|
+
// Ignored via go/ees005
|
|
381
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
367
382
|
].includes(((event.target as HTMLElement) || null)?.id);
|
|
368
383
|
const keysToTrap = ['Enter', ' '];
|
|
369
384
|
|
|
@@ -12,7 +12,7 @@ import { findTable } from '@atlaskit/editor-tables/utils';
|
|
|
12
12
|
import type { TablePluginState } from '../types';
|
|
13
13
|
|
|
14
14
|
import { defaultTableSelection } from './default-table-selection';
|
|
15
|
-
import { pluginKey as tableResizingPluginKey } from './table-resizing';
|
|
15
|
+
import { pluginKey as tableResizingPluginKey } from './table-resizing/plugin-key';
|
|
16
16
|
import { isTableCollapsible } from './utils/collapse';
|
|
17
17
|
import {
|
|
18
18
|
checkIfHeaderColumnEnabled,
|