@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
|
@@ -8,7 +8,7 @@ import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
|
|
10
10
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
11
|
-
import { getRowHeights } from '../../../pm-plugins/utils';
|
|
11
|
+
import { getRowHeights } from '../../../pm-plugins/utils/row-controls';
|
|
12
12
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
13
13
|
import { tableBorderColor } from '../../consts';
|
|
14
14
|
|
|
@@ -27,6 +27,8 @@ interface Props {
|
|
|
27
27
|
isDragAndDropEnabled?: boolean;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
30
32
|
export default class NumberColumn extends Component<Props, any> {
|
|
31
33
|
render() {
|
|
32
34
|
const { tableRef, hasHeaderRow, isDragAndDropEnabled, tableActive, updateCellHoverLocation } =
|
|
@@ -50,6 +52,8 @@ export default class NumberColumn extends Component<Props, any> {
|
|
|
50
52
|
isDragAndDropEnabled ? (
|
|
51
53
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
52
54
|
<div
|
|
55
|
+
// Ignored via go/ees005
|
|
56
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
53
57
|
key={`wrapper-${index}`}
|
|
54
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
55
59
|
className={this.getClassNames(index, true)}
|
|
@@ -64,6 +68,8 @@ export default class NumberColumn extends Component<Props, any> {
|
|
|
64
68
|
) : (
|
|
65
69
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
66
70
|
<div
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
67
73
|
key={`wrapper-${index}`}
|
|
68
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
69
75
|
className={this.getClassNames(index)}
|
|
@@ -9,8 +9,12 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
|
|
11
11
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
12
|
-
import type { RowParams } from '../../../pm-plugins/utils';
|
|
13
|
-
import {
|
|
12
|
+
import type { RowParams } from '../../../pm-plugins/utils/row-controls';
|
|
13
|
+
import {
|
|
14
|
+
getRowClassNames,
|
|
15
|
+
getRowHeights,
|
|
16
|
+
getRowsParams,
|
|
17
|
+
} from '../../../pm-plugins/utils/row-controls';
|
|
14
18
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
15
19
|
import { tableControlsSpacing, tableToolbarSize } from '../../consts';
|
|
16
20
|
|
|
@@ -27,6 +31,8 @@ export interface Props {
|
|
|
27
31
|
selection?: Selection;
|
|
28
32
|
}
|
|
29
33
|
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
30
36
|
class RowControlsComponent extends Component<Props & WrappedComponentProps> {
|
|
31
37
|
render() {
|
|
32
38
|
const {
|
|
@@ -84,7 +90,9 @@ class RowControlsComponent extends Component<Props & WrappedComponentProps> {
|
|
|
84
90
|
? `3px`
|
|
85
91
|
: undefined
|
|
86
92
|
: thisRowSticky
|
|
87
|
-
?
|
|
93
|
+
? // Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
95
|
+
`${this.props.stickyTop! + 3}px`
|
|
88
96
|
: undefined,
|
|
89
97
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
90
98
|
paddingTop: thisRowSticky ? `${tableControlsSpacing}px` : undefined,
|
|
@@ -17,7 +17,8 @@ import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
|
17
17
|
import { toggleDragMenu } from '../../../pm-plugins/drag-and-drop/commands';
|
|
18
18
|
import type { TriggerType } from '../../../pm-plugins/drag-and-drop/types';
|
|
19
19
|
import { getPluginState as getTablePluginState } from '../../../pm-plugins/plugin-factory';
|
|
20
|
-
import { getRowHeights, getRowsParams
|
|
20
|
+
import { getRowHeights, getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
21
|
+
import { getSelectedRowIndexes } from '../../../pm-plugins/utils/selection';
|
|
21
22
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
22
23
|
import type { CellHoverMeta, DraggableSourceData, HandleTypes } from '../../../types';
|
|
23
24
|
import { dropTargetExtendedWidth } from '../../consts';
|
|
@@ -142,21 +143,31 @@ const DragControlsComponent = ({
|
|
|
142
143
|
);
|
|
143
144
|
|
|
144
145
|
const rowIndexes = useMemo(() => {
|
|
146
|
+
// Ignored via go/ees005
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
145
148
|
return [rowIndex!];
|
|
146
149
|
}, [rowIndex]);
|
|
147
150
|
|
|
148
151
|
const handleMouseOver = useCallback(() => {
|
|
152
|
+
// Ignored via go/ees005
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
149
154
|
hoverRows([rowIndex!]);
|
|
150
155
|
}, [hoverRows, rowIndex]);
|
|
151
156
|
|
|
152
157
|
const handleClick = useCallback(
|
|
153
158
|
(e: MouseEvent) => {
|
|
154
159
|
const isClickOutsideSelectedRows =
|
|
160
|
+
// Ignored via go/ees005
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
155
162
|
selectedRowIndexes.length >= 1 && !selectedRowIndexes.includes(rowIndex!);
|
|
156
163
|
if (!selectedRowIndexes || selectedRowIndexes.length === 0 || isClickOutsideSelectedRows) {
|
|
164
|
+
// Ignored via go/ees005
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
157
166
|
selectRow(rowIndex!, e.shiftKey);
|
|
158
167
|
}
|
|
159
168
|
|
|
169
|
+
// Ignored via go/ees005
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
160
171
|
if (selectedRowIndexes.length > 1 && selectedRowIndexes.includes(rowIndex!) && !e.shiftKey) {
|
|
161
172
|
selectRows(selectedRowIndexes);
|
|
162
173
|
}
|
|
@@ -169,6 +180,8 @@ const DragControlsComponent = ({
|
|
|
169
180
|
appearance: DragHandleAppearance,
|
|
170
181
|
gridRow: string,
|
|
171
182
|
indexes: number[],
|
|
183
|
+
// Ignored via go/ees005
|
|
184
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
172
185
|
) => {
|
|
173
186
|
const isHover = type === 'hover';
|
|
174
187
|
|
|
@@ -284,6 +297,8 @@ const DragControlsComponent = ({
|
|
|
284
297
|
contentEditable={false}
|
|
285
298
|
>
|
|
286
299
|
{rowsParams.map(({ startIndex, endIndex }, index) => (
|
|
300
|
+
// Ignored via go/ees005
|
|
301
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
287
302
|
<Fragment key={index}>
|
|
288
303
|
<div
|
|
289
304
|
style={{
|
|
@@ -296,6 +311,8 @@ const DragControlsComponent = ({
|
|
|
296
311
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
297
312
|
className={ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER}
|
|
298
313
|
contentEditable={false}
|
|
314
|
+
// Ignored via go/ees005
|
|
315
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
299
316
|
key={`insert-dot-${index}`}
|
|
300
317
|
>
|
|
301
318
|
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 */}
|
|
@@ -303,6 +320,8 @@ const DragControlsComponent = ({
|
|
|
303
320
|
</div>
|
|
304
321
|
{isDragging && (
|
|
305
322
|
<RowDropTarget
|
|
323
|
+
// Ignored via go/ees005
|
|
324
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
306
325
|
key={`drop-target-${index}`}
|
|
307
326
|
index={index}
|
|
308
327
|
localId={currentNodeLocalId}
|
|
@@ -11,20 +11,21 @@ import { findTable } from '@atlaskit/editor-tables/utils';
|
|
|
11
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
12
|
|
|
13
13
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../pm-plugins/commands';
|
|
14
|
-
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
14
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
15
15
|
import { isTableNested } from '../../pm-plugins/utils/nodes';
|
|
16
16
|
import type { TablePlugin } from '../../tablePluginType';
|
|
17
17
|
import { TableCssClassName as ClassName } from '../../types';
|
|
18
18
|
import type { CellHoverMeta } from '../../types';
|
|
19
19
|
|
|
20
|
+
import { CornerControls } from './CornerControls/ClassicCornerControls';
|
|
20
21
|
import {
|
|
21
|
-
CornerControls,
|
|
22
22
|
DragCornerControls,
|
|
23
23
|
DragCornerControlsWithSelection,
|
|
24
|
-
} from './CornerControls';
|
|
24
|
+
} from './CornerControls/DragCornerControls';
|
|
25
25
|
import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
|
|
26
26
|
import NumberColumn from './NumberColumn';
|
|
27
|
-
import {
|
|
27
|
+
import { RowControls } from './RowControls/ClassicControls';
|
|
28
|
+
import { DragControls } from './RowControls/DragControls';
|
|
28
29
|
|
|
29
30
|
interface TableFloatingControlsProps {
|
|
30
31
|
editorView: EditorView;
|
|
@@ -75,6 +76,8 @@ export const TableFloatingControls = ({
|
|
|
75
76
|
const { state, dispatch } = editorView;
|
|
76
77
|
// fix for issue ED-4665
|
|
77
78
|
if (browser.ie_version === 11) {
|
|
79
|
+
// Ignored via go/ees005
|
|
80
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
78
81
|
(editorView.dom as HTMLElement).blur();
|
|
79
82
|
}
|
|
80
83
|
selectRow(row, expand)(state, dispatch);
|
|
@@ -87,6 +90,8 @@ export const TableFloatingControls = ({
|
|
|
87
90
|
const { state, dispatch } = editorView;
|
|
88
91
|
// fix for issue ED-4665
|
|
89
92
|
if (browser.ie_version === 11) {
|
|
93
|
+
// Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
90
95
|
(editorView.dom as HTMLElement).blur();
|
|
91
96
|
}
|
|
92
97
|
selectRows(rowIndexes)(state, dispatch);
|
|
@@ -134,6 +139,8 @@ export const TableFloatingControls = ({
|
|
|
134
139
|
: ClassName.ROW_CONTROLS_WRAPPER;
|
|
135
140
|
|
|
136
141
|
const tablePos = findTable(editorView.state.selection)?.pos;
|
|
142
|
+
// Ignored via go/ees005
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
137
144
|
const isNested = tablePos !== undefined && isTableNested(editorView.state, tablePos!);
|
|
138
145
|
const shouldShowCornerControls =
|
|
139
146
|
!featureFlagsState?.elementDragAndDrop || (isNested && !editorExperiment('nested-dnd', true));
|
|
@@ -190,6 +197,8 @@ export const TableFloatingControls = ({
|
|
|
190
197
|
tableActive={tableActive}
|
|
191
198
|
isInDanger={isInDanger}
|
|
192
199
|
isResizing={isResizing}
|
|
200
|
+
// Ignored via go/ees005
|
|
201
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
193
202
|
tableWidth={tableWrapperWidth!}
|
|
194
203
|
hoverRows={_hoverRows}
|
|
195
204
|
selectRow={_selectRow}
|
package/src/ui/common-styles.ts
CHANGED
|
@@ -901,6 +901,13 @@ export const baseTableStyles = (props: { featureFlags?: FeatureFlags }) => css`
|
|
|
901
901
|
color: ${token('color.text.selected', N0)};
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
+
|
|
905
|
+
// nested tables should be ignored when we apply border-left: 0 to the parent table
|
|
906
|
+
.${ClassName.TABLE_CONTAINER} {
|
|
907
|
+
.${ClassName.NUMBERED_COLUMN_BUTTON} {
|
|
908
|
+
border-left: 1px solid ${tableBorderColor};
|
|
909
|
+
}
|
|
910
|
+
}
|
|
904
911
|
}
|
|
905
912
|
:not(.${ClassName.IS_RESIZING}) .${ClassName.WITH_CONTROLS} {
|
|
906
913
|
.${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}) {
|
package/src/ui/event-handlers.ts
CHANGED
|
@@ -41,14 +41,17 @@ import {
|
|
|
41
41
|
import { getPluginState as getDragDropPluginState } from '../pm-plugins/drag-and-drop/plugin-factory';
|
|
42
42
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
43
43
|
import { getPluginState as getResizePluginState } from '../pm-plugins/table-resizing/plugin-factory';
|
|
44
|
-
import { deleteColumns
|
|
44
|
+
import { deleteColumns } from '../pm-plugins/transforms/delete-columns';
|
|
45
|
+
import { deleteRows } from '../pm-plugins/transforms/delete-rows';
|
|
46
|
+
import { getSelectedCellInfo } from '../pm-plugins/utils/analytics';
|
|
45
47
|
import {
|
|
46
48
|
convertHTMLCellIndexToColumnIndex,
|
|
47
49
|
getColumnIndexMappedToColumnIndexInFirstRow,
|
|
50
|
+
} from '../pm-plugins/utils/column-controls';
|
|
51
|
+
import {
|
|
48
52
|
getColumnOrRowIndex,
|
|
49
53
|
getMousePositionHorizontalRelativeByElement,
|
|
50
54
|
getMousePositionVerticalRelativeByElement,
|
|
51
|
-
getSelectedCellInfo,
|
|
52
55
|
hasResizeHandler,
|
|
53
56
|
isCell,
|
|
54
57
|
isColumnControlsDecorations,
|
|
@@ -61,7 +64,7 @@ import {
|
|
|
61
64
|
isRowControlsButton,
|
|
62
65
|
isTableContainerOrWrapper,
|
|
63
66
|
isTableControlsButton,
|
|
64
|
-
} from '../pm-plugins/utils';
|
|
67
|
+
} from '../pm-plugins/utils/dom';
|
|
65
68
|
import { getAllowAddColumnCustomStep } from '../pm-plugins/utils/get-allow-add-column-custom-step';
|
|
66
69
|
import { TableCssClassName as ClassName, RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
|
|
67
70
|
import type { PluginInjectionAPI } from '../types';
|
|
@@ -128,9 +131,15 @@ export const handleClick = (view: EditorView, event: Event): boolean => {
|
|
|
128
131
|
return false;
|
|
129
132
|
}
|
|
130
133
|
const element = event.target as HTMLElementIE9;
|
|
134
|
+
// Ignored via go/ees005
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
131
136
|
const table = findTable(view.state.selection)!;
|
|
132
137
|
|
|
138
|
+
// Ignored via go/ees005
|
|
139
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
133
140
|
if (event instanceof MouseEvent && isColumnControlsDecorations(element as HTMLElement)) {
|
|
141
|
+
// Ignored via go/ees005
|
|
142
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
134
143
|
const [startIndex] = getColumnOrRowIndex(element as HTMLElement);
|
|
135
144
|
const { state, dispatch } = view;
|
|
136
145
|
|
|
@@ -142,6 +151,8 @@ export const handleClick = (view: EditorView, event: Event): boolean => {
|
|
|
142
151
|
// check if the table cell with an image is clicked and its not the image itself
|
|
143
152
|
if (
|
|
144
153
|
!table ||
|
|
154
|
+
// Ignored via go/ees005
|
|
155
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
145
156
|
!isElementInTableCell(element as HTMLElement) ||
|
|
146
157
|
!matchfn ||
|
|
147
158
|
matchfn.call(element, 'table .image, table p, table .image div')
|
|
@@ -151,9 +162,15 @@ export const handleClick = (view: EditorView, event: Event): boolean => {
|
|
|
151
162
|
const map = TableMap.get(table.node);
|
|
152
163
|
|
|
153
164
|
/** Getting the offset of current item clicked */
|
|
165
|
+
// Ignored via go/ees005
|
|
166
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
154
167
|
const colElement = (closestElement(element as HTMLElement, 'td') ||
|
|
168
|
+
// Ignored via go/ees005
|
|
169
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
155
170
|
closestElement(element as HTMLElement, 'th')) as HTMLTableDataCellElement;
|
|
156
171
|
const colIndex = colElement && colElement.cellIndex;
|
|
172
|
+
// Ignored via go/ees005
|
|
173
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
157
174
|
const rowElement = closestElement(element as HTMLElement, 'tr') as HTMLTableRowElement;
|
|
158
175
|
const rowIndex = rowElement && rowElement.rowIndex;
|
|
159
176
|
const cellIndex = map.width * rowIndex + colIndex;
|
|
@@ -472,6 +489,8 @@ export const handleCut = (
|
|
|
472
489
|
isTableScalingEnabled = false,
|
|
473
490
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
474
491
|
shouldUseIncreasedScalingPercent = false,
|
|
492
|
+
// Ignored via go/ees005
|
|
493
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
475
494
|
): Transaction => {
|
|
476
495
|
const oldSelection = oldState.tr.selection;
|
|
477
496
|
let { tr } = newState;
|
|
@@ -563,9 +582,13 @@ export const whenTableInFocus =
|
|
|
563
582
|
|
|
564
583
|
const trackCellLocation = (view: EditorView, mouseEvent: Event) => {
|
|
565
584
|
const target = mouseEvent.target;
|
|
585
|
+
// Ignored via go/ees005
|
|
586
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
566
587
|
const maybeTableCell = isElementInTableCell(target as HTMLElement) as HTMLTableCellElement | null;
|
|
567
588
|
const { tableNode, tableRef } = getPluginState(view.state);
|
|
568
589
|
|
|
590
|
+
// Ignored via go/ees005
|
|
591
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
569
592
|
const tableElement = closestElement(target as HTMLElement, 'table') as HTMLTableElement;
|
|
570
593
|
|
|
571
594
|
// hover will only trigger if target localId is the same with selected localId
|
|
@@ -581,6 +604,8 @@ const trackCellLocation = (view: EditorView, mouseEvent: Event) => {
|
|
|
581
604
|
}
|
|
582
605
|
|
|
583
606
|
const htmlColIndex = maybeTableCell.cellIndex;
|
|
607
|
+
// Ignored via go/ees005
|
|
608
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
584
609
|
const rowElement = closestElement(target as HTMLElement, 'tr') as HTMLTableRowElement;
|
|
585
610
|
const htmlRowIndex = rowElement && rowElement.rowIndex;
|
|
586
611
|
|
|
@@ -16,5 +16,7 @@ export const SortingIconWrapper = (props: SortingIconWrapperProps) => {
|
|
|
16
16
|
if (editorViewModeState?.mode === 'edit') {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
19
21
|
return <SortingIcon {...props} />;
|
|
20
22
|
};
|
package/src/ui/toolbar.tsx
CHANGED
|
@@ -11,8 +11,8 @@ import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD } from '@atlaskit/editor-common/a
|
|
|
11
11
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
12
12
|
import commonMessages, { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
14
|
-
import type { typeOption } from '@atlaskit/editor-common/types';
|
|
15
14
|
import type {
|
|
15
|
+
typeOption,
|
|
16
16
|
Command,
|
|
17
17
|
CommandDispatch,
|
|
18
18
|
ConfirmDialogOptions,
|
|
@@ -86,18 +86,15 @@ import {
|
|
|
86
86
|
wrapTableInExpandWithAnalytics,
|
|
87
87
|
} from '../pm-plugins/commands/commands-with-analytics';
|
|
88
88
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
89
|
-
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
89
|
+
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing/plugin-key';
|
|
90
90
|
import { getStaticTableScalingPercent } from '../pm-plugins/table-resizing/utils/misc';
|
|
91
91
|
import { getNewResizeStateFromSelectedColumns } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
92
92
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
93
|
-
import { canMergeCells } from '../pm-plugins/transforms';
|
|
94
|
-
import {
|
|
95
|
-
getMergedCellsPositions,
|
|
96
|
-
getSelectedColumnIndexes,
|
|
97
|
-
getSelectedRowIndexes,
|
|
98
|
-
isTableNested,
|
|
99
|
-
} from '../pm-plugins/utils';
|
|
93
|
+
import { canMergeCells } from '../pm-plugins/transforms/merge';
|
|
100
94
|
import { normaliseAlignment } from '../pm-plugins/utils/alignment';
|
|
95
|
+
import { isTableNested } from '../pm-plugins/utils/nodes';
|
|
96
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../pm-plugins/utils/selection';
|
|
97
|
+
import { getMergedCellsPositions } from '../pm-plugins/utils/table';
|
|
101
98
|
import type { TablePluginOptions } from '../tablePluginType';
|
|
102
99
|
import type {
|
|
103
100
|
AlignmentOptions,
|
|
@@ -118,6 +115,8 @@ export const getToolbarMenuConfig = (
|
|
|
118
115
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
119
116
|
isTableScalingWithFixedColumnWidthsOptionShown = false,
|
|
120
117
|
areTableColumnWidthsFixed = false,
|
|
118
|
+
// Ignored via go/ees005
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
121
120
|
): FloatingToolbarItem<Command> => {
|
|
122
121
|
const optionItem: typeOption = 'item-checkbox';
|
|
123
122
|
|
|
@@ -210,6 +209,8 @@ export const getToolbarCellOptionsConfig = (
|
|
|
210
209
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
211
210
|
shouldUseIncreasedScalingPercent = false,
|
|
212
211
|
isCommentEditor = false,
|
|
212
|
+
// Ignored via go/ees005
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
213
214
|
): FloatingToolbarDropdown<Command> => {
|
|
214
215
|
const { top, bottom, right, left } = initialSelectionRect;
|
|
215
216
|
const numberOfColumns = right - left;
|
|
@@ -456,7 +457,9 @@ export const getToolbarCellOptionsConfig = (
|
|
|
456
457
|
export const getClosestSelectionRect = (state: EditorState): Rect | undefined => {
|
|
457
458
|
const selection = state.selection;
|
|
458
459
|
return isSelectionType(selection, 'cell')
|
|
459
|
-
?
|
|
460
|
+
? // Ignored via go/ees005
|
|
461
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
462
|
+
getSelectionRect(selection)!
|
|
460
463
|
: findCellRectClosestToPos(selection.$from);
|
|
461
464
|
};
|
|
462
465
|
|
|
@@ -469,6 +472,8 @@ const getClosestSelectionOrTableRect = (state: EditorState): Rect | undefined =>
|
|
|
469
472
|
const map = TableMap.get(tableObject.node);
|
|
470
473
|
const tableRect = new Rect(0, 0, map.width, map.height);
|
|
471
474
|
|
|
475
|
+
// Ignored via go/ees005
|
|
476
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
472
477
|
return isSelectionType(selection, 'cell') ? getSelectionRect(selection)! : tableRect;
|
|
473
478
|
};
|
|
474
479
|
|
|
@@ -482,6 +487,8 @@ export const getToolbarConfig =
|
|
|
482
487
|
options?: TablePluginOptions,
|
|
483
488
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
484
489
|
shouldUseIncreasedScalingPercent = false,
|
|
490
|
+
// Ignored via go/ees005
|
|
491
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
485
492
|
) =>
|
|
486
493
|
(config: PluginConfig): FloatingToolbarHandler =>
|
|
487
494
|
(state, intl) => {
|
|
@@ -518,6 +525,8 @@ export const getToolbarConfig =
|
|
|
518
525
|
const parent = findParentDomRefOfType(nodeType, domAtPos)(state.selection);
|
|
519
526
|
if (parent) {
|
|
520
527
|
const tableRef =
|
|
528
|
+
// Ignored via go/ees005
|
|
529
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
521
530
|
(parent as HTMLElement).querySelector<HTMLTableElement>('table') || undefined;
|
|
522
531
|
if (tableRef) {
|
|
523
532
|
element =
|
|
@@ -679,6 +688,8 @@ const getCellItems = (
|
|
|
679
688
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
680
689
|
shouldUseIncreasedScalingPercent = false,
|
|
681
690
|
isCommentEditor = false,
|
|
691
|
+
// Ignored via go/ees005
|
|
692
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
682
693
|
): Array<FloatingToolbarItem<Command>> => {
|
|
683
694
|
const initialSelectionRect = getClosestSelectionRect(state);
|
|
684
695
|
if (initialSelectionRect) {
|
|
@@ -695,6 +706,8 @@ const getCellItems = (
|
|
|
695
706
|
shouldUseIncreasedScalingPercent,
|
|
696
707
|
isCommentEditor,
|
|
697
708
|
);
|
|
709
|
+
// Ignored via go/ees005
|
|
710
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
698
711
|
return [cellOptions, separator(cellOptions.hidden!)];
|
|
699
712
|
}
|
|
700
713
|
return [];
|
|
@@ -708,6 +721,8 @@ const getDistributeConfig =
|
|
|
708
721
|
isTableScalingEnabled = false,
|
|
709
722
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
710
723
|
isCommentEditor = false,
|
|
724
|
+
// Ignored via go/ees005
|
|
725
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
711
726
|
): Command =>
|
|
712
727
|
(state, dispatch, editorView) => {
|
|
713
728
|
const selectionOrTableRect = getClosestSelectionOrTableRect(state);
|
|
@@ -747,6 +762,8 @@ const getColumnSettingItems = (
|
|
|
747
762
|
isTableScalingEnabled = false,
|
|
748
763
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
749
764
|
isCommentEditor = false,
|
|
765
|
+
// Ignored via go/ees005
|
|
766
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
750
767
|
): Array<FloatingToolbarItem<Command>> => {
|
|
751
768
|
const pluginState = getPluginState(editorState);
|
|
752
769
|
const selectionOrTableRect = getClosestSelectionOrTableRect(editorState);
|
|
@@ -802,6 +819,8 @@ const getColorPicker = (
|
|
|
802
819
|
{ formatMessage }: ToolbarMenuContext,
|
|
803
820
|
editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined,
|
|
804
821
|
getEditorView: () => EditorView | null,
|
|
822
|
+
// Ignored via go/ees005
|
|
823
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
805
824
|
): Array<FloatingToolbarItem<Command>> => {
|
|
806
825
|
const { targetCellPosition, pluginConfig } = getPluginState(state);
|
|
807
826
|
if (!pluginConfig.allowBackgroundColor) {
|
|
@@ -827,6 +846,8 @@ const getColorPicker = (
|
|
|
827
846
|
defaultValue: defaultPalette,
|
|
828
847
|
options: cellBackgroundColorPalette,
|
|
829
848
|
returnEscToButton: true,
|
|
849
|
+
// Ignored via go/ees005
|
|
850
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
830
851
|
onChange: (option: any) =>
|
|
831
852
|
setColorWithAnalytics(editorAnalyticsAPI)(
|
|
832
853
|
INPUT_METHOD.FLOATING_TB,
|
|
@@ -891,6 +912,8 @@ const getAlignmentOptionsConfig = (
|
|
|
891
912
|
shouldUseIncreasedScalingPercent: boolean,
|
|
892
913
|
isFullWidthEditor?: boolean,
|
|
893
914
|
isCommentEditor?: boolean,
|
|
915
|
+
// Ignored via go/ees005
|
|
916
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
894
917
|
): Array<FloatingToolbarDropdown<Command>> => {
|
|
895
918
|
const tableObject = findTable(editorState.selection);
|
|
896
919
|
|
|
@@ -962,7 +985,14 @@ const getAlignmentOptionsConfig = (
|
|
|
962
985
|
|
|
963
986
|
const alignmentItemOptions: DropdownOptions<Command> = {
|
|
964
987
|
render: (props) => {
|
|
965
|
-
return
|
|
988
|
+
return (
|
|
989
|
+
<FloatingAlignmentButtons
|
|
990
|
+
alignmentButtons={alignmentButtons}
|
|
991
|
+
// Ignored via go/ees005
|
|
992
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
993
|
+
{...props}
|
|
994
|
+
/>
|
|
995
|
+
);
|
|
966
996
|
},
|
|
967
997
|
width: 60,
|
|
968
998
|
height: 32,
|
|
@@ -997,6 +1027,8 @@ const isLayoutOptionDisabled = (
|
|
|
997
1027
|
editorView: EditorView | null,
|
|
998
1028
|
shouldUseIncreasedScalingPercent: boolean,
|
|
999
1029
|
isFullWidthEditor: boolean | undefined,
|
|
1030
|
+
// Ignored via go/ees005
|
|
1031
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
1000
1032
|
) => {
|
|
1001
1033
|
const { lineLength } = getEditorContainerWidth();
|
|
1002
1034
|
let tableContainerWidth = getTableContainerWidth(selectedNode);
|