@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
|
@@ -29,11 +29,17 @@ export const FloatingAlignmentButtons = ({ alignmentButtons, dispatchCommand }:
|
|
|
29
29
|
{alignmentButtons.map((item, idx) => {
|
|
30
30
|
switch (item.type) {
|
|
31
31
|
case 'separator':
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
32
34
|
return <FloatingToolbarSeparator key={idx} />;
|
|
33
35
|
case 'button':
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
38
|
const ButtonIcon = item.icon as React.ComponentClass<any>;
|
|
35
39
|
return (
|
|
36
40
|
<Button
|
|
41
|
+
// Ignored via go/ees005
|
|
42
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
37
43
|
key={idx}
|
|
38
44
|
icon={item.icon ? <ButtonIcon label={item.title} /> : undefined}
|
|
39
45
|
title={item.title}
|
|
@@ -7,7 +7,7 @@ import { akEditorTableCellOnStickyHeaderZIndex } from '@atlaskit/editor-shared-s
|
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
import { token } from '@atlaskit/tokens';
|
|
9
9
|
|
|
10
|
-
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
10
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
11
11
|
import { TableCssClassName as ClassName } from '../../types';
|
|
12
12
|
import { insertColumnButtonOffset } from '../common-styles';
|
|
13
13
|
|
|
@@ -113,9 +113,13 @@ export const FixedButton = ({
|
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
observer.observe(observerTargetRefCurrent);
|
|
116
|
+
// Ignored via go/ees005
|
|
117
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
116
118
|
tableWrapper.addEventListener('scroll', handleScroll);
|
|
117
119
|
|
|
118
120
|
return () => {
|
|
121
|
+
// Ignored via go/ees005
|
|
122
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
119
123
|
tableWrapper.removeEventListener('scroll', handleScroll);
|
|
120
124
|
fixedButtonRefCurrent.style.transform = '';
|
|
121
125
|
observer.unobserve(observerTargetRefCurrent);
|
|
@@ -23,9 +23,11 @@ import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
23
23
|
import ExpandIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
24
24
|
|
|
25
25
|
import { toggleContextualMenu } from '../../pm-plugins/commands';
|
|
26
|
-
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
26
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
27
27
|
import { TableCssClassName as ClassName } from '../../types';
|
|
28
28
|
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
29
31
|
import FixedButton from './FixedButton';
|
|
30
32
|
import { tableFloatingCellButtonSelectedStyles, tableFloatingCellButtonStyles } from './styles';
|
|
31
33
|
|
|
@@ -157,7 +159,11 @@ export default function (props: Props) {
|
|
|
157
159
|
dispatchAnalyticsEvent={props.dispatchAnalyticsEvent}
|
|
158
160
|
fallbackComponent={null}
|
|
159
161
|
>
|
|
160
|
-
<FloatingContextualButton
|
|
162
|
+
<FloatingContextualButton
|
|
163
|
+
// Ignored via go/ees005
|
|
164
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
165
|
+
{...props}
|
|
166
|
+
/>
|
|
161
167
|
</ErrorBoundary>
|
|
162
168
|
);
|
|
163
169
|
}
|
|
@@ -78,12 +78,9 @@ import {
|
|
|
78
78
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
79
79
|
import { pluginKey as tablePluginKey } from '../../pm-plugins/plugin-key';
|
|
80
80
|
import { getNewResizeStateFromSelectedColumns } from '../../pm-plugins/table-resizing/utils/resize-state';
|
|
81
|
-
import { canMergeCells } from '../../pm-plugins/transforms';
|
|
82
|
-
import {
|
|
83
|
-
|
|
84
|
-
getSelectedColumnIndexes,
|
|
85
|
-
getSelectedRowIndexes,
|
|
86
|
-
} from '../../pm-plugins/utils';
|
|
81
|
+
import { canMergeCells } from '../../pm-plugins/transforms/merge';
|
|
82
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
|
|
83
|
+
import { getMergedCellsPositions } from '../../pm-plugins/utils/table';
|
|
87
84
|
import { TableCssClassName as ClassName } from '../../types';
|
|
88
85
|
import type { PluginInjectionAPI } from '../../types';
|
|
89
86
|
import {
|
|
@@ -91,7 +88,10 @@ import {
|
|
|
91
88
|
contextualMenuDropdownWidth,
|
|
92
89
|
contextualMenuDropdownWidthDnD,
|
|
93
90
|
} from '../consts';
|
|
94
|
-
import { AddColRightIcon
|
|
91
|
+
import { AddColRightIcon } from '../icons/AddColRightIcon';
|
|
92
|
+
import { AddRowBelowIcon } from '../icons/AddRowBelowIcon';
|
|
93
|
+
import { MergeCellsIcon } from '../icons/MergeCellsIcon';
|
|
94
|
+
import { SplitCellIcon } from '../icons/SplitCellIcon';
|
|
95
95
|
|
|
96
96
|
import { cellColourPreviewStyles } from './styles';
|
|
97
97
|
|
|
@@ -200,6 +200,8 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
200
200
|
|
|
201
201
|
private handleSubMenuRef = (ref: HTMLDivElement | null) => {
|
|
202
202
|
const parent = closestElement(
|
|
203
|
+
// Ignored via go/ees005
|
|
204
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
203
205
|
this.props.editorView.dom as HTMLElement,
|
|
204
206
|
'.fabric-editor-popup-scroll-parent',
|
|
205
207
|
);
|
|
@@ -233,6 +235,8 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
233
235
|
|
|
234
236
|
const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(
|
|
235
237
|
cellBackgroundColorPalette,
|
|
238
|
+
// Ignored via go/ees005
|
|
239
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
236
240
|
background!,
|
|
237
241
|
colorPalletteColumns,
|
|
238
242
|
);
|
|
@@ -288,6 +292,8 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
288
292
|
}
|
|
289
293
|
}}
|
|
290
294
|
isPopupPositioned={true}
|
|
295
|
+
// Ignored via go/ees005
|
|
296
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
291
297
|
isOpenedByKeyboard={isCellMenuOpenByKeyboard!}
|
|
292
298
|
>
|
|
293
299
|
<ColorPalette
|
|
@@ -834,6 +840,8 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
834
840
|
}
|
|
835
841
|
};
|
|
836
842
|
|
|
843
|
+
// Ignored via go/ees005
|
|
844
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
837
845
|
private handleItemMouseEnter = ({ item }: { item: any }) => {
|
|
838
846
|
const {
|
|
839
847
|
editorView: { state, dispatch },
|
|
@@ -862,6 +870,8 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
862
870
|
}
|
|
863
871
|
};
|
|
864
872
|
|
|
873
|
+
// Ignored via go/ees005
|
|
874
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
865
875
|
private handleItemMouseLeave = ({ item }: { item: any }) => {
|
|
866
876
|
const { state, dispatch } = this.props.editorView;
|
|
867
877
|
if (item.value.name === 'background') {
|
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
tablePopupMenuFitHeight,
|
|
30
30
|
} from '../consts';
|
|
31
31
|
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
32
34
|
import ContextualMenu from './ContextualMenu';
|
|
33
35
|
import { tablePopupStyles } from './styles';
|
|
34
36
|
|
|
@@ -70,7 +72,9 @@ const FloatingContextualMenu = ({
|
|
|
70
72
|
|
|
71
73
|
const { selection } = editorView.state;
|
|
72
74
|
const selectionRect = isSelectionType(selection, 'cell')
|
|
73
|
-
?
|
|
75
|
+
? // Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
77
|
+
getSelectionRect(selection)!
|
|
74
78
|
: findCellRectClosestToPos(selection.$from);
|
|
75
79
|
|
|
76
80
|
if (!selectionRect) {
|
|
@@ -89,6 +93,8 @@ const FloatingContextualMenu = ({
|
|
|
89
93
|
<Popup
|
|
90
94
|
alignX="right"
|
|
91
95
|
alignY="top"
|
|
96
|
+
// Ignored via go/ees005
|
|
97
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
92
98
|
target={targetCellRef as HTMLElement}
|
|
93
99
|
mountTo={mountPoint}
|
|
94
100
|
boundariesElement={boundariesElement}
|
|
@@ -110,7 +116,11 @@ const FloatingContextualMenu = ({
|
|
|
110
116
|
isOpen={isOpen}
|
|
111
117
|
targetCellPosition={targetCellPosition}
|
|
112
118
|
allowColumnSorting={pluginConfig && pluginConfig.allowColumnSorting}
|
|
119
|
+
// Ignored via go/ees005
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
113
121
|
allowMergeCells={pluginConfig!.allowMergeCells}
|
|
122
|
+
// Ignored via go/ees005
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
124
|
allowBackgroundColor={pluginConfig!.allowBackgroundColor}
|
|
115
125
|
selectionRect={selectionRect}
|
|
116
126
|
boundariesElement={boundariesElement}
|
|
@@ -20,13 +20,12 @@ import {
|
|
|
20
20
|
deleteRowsWithAnalytics,
|
|
21
21
|
} from '../../pm-plugins/commands/commands-with-analytics';
|
|
22
22
|
import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-factory';
|
|
23
|
-
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
23
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
24
24
|
import {
|
|
25
25
|
getColumnDeleteButtonParams,
|
|
26
26
|
getColumnsWidths,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} from '../../pm-plugins/utils';
|
|
27
|
+
} from '../../pm-plugins/utils/column-controls';
|
|
28
|
+
import { getRowDeleteButtonParams, getRowHeights } from '../../pm-plugins/utils/row-controls';
|
|
30
29
|
import type { PluginInjectionAPI, TableDirection } from '../../types';
|
|
31
30
|
import { TableCssClassName as ClassName } from '../../types';
|
|
32
31
|
import { stickyRowZIndex } from '../consts';
|
|
@@ -70,6 +69,8 @@ function getSelectionType(selection: Selection): TableDirection | undefined {
|
|
|
70
69
|
return;
|
|
71
70
|
}
|
|
72
71
|
|
|
72
|
+
// Ignored via go/ees005
|
|
73
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
73
74
|
class FloatingDeleteButton extends Component<Props, State> {
|
|
74
75
|
static displayName = 'FloatingDeleteButton';
|
|
75
76
|
|
|
@@ -108,6 +109,8 @@ class FloatingDeleteButton extends Component<Props, State> {
|
|
|
108
109
|
const tableWrapper = closestElement(this.props.tableRef, `.${ClassName.TABLE_NODE_WRAPPER}`);
|
|
109
110
|
if (tableWrapper) {
|
|
110
111
|
this.wrapper = tableWrapper;
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
111
114
|
this.wrapper.addEventListener('scroll', this.onWrapperScrolled);
|
|
112
115
|
|
|
113
116
|
this.setState({
|
|
@@ -116,6 +119,8 @@ class FloatingDeleteButton extends Component<Props, State> {
|
|
|
116
119
|
} else {
|
|
117
120
|
if (this.wrapper) {
|
|
118
121
|
// unsubscribe if we previously had one and it just went away
|
|
122
|
+
// Ignored via go/ees005
|
|
123
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
119
124
|
this.wrapper.removeEventListener('scroll', this.onWrapperScrolled);
|
|
120
125
|
|
|
121
126
|
// and reset scroll position
|
|
@@ -130,11 +135,15 @@ class FloatingDeleteButton extends Component<Props, State> {
|
|
|
130
135
|
|
|
131
136
|
componentWillUnmount() {
|
|
132
137
|
if (this.wrapper) {
|
|
138
|
+
// Ignored via go/ees005
|
|
139
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
133
140
|
this.wrapper.removeEventListener('scroll', this.onWrapperScrolled);
|
|
134
141
|
}
|
|
135
142
|
}
|
|
136
143
|
|
|
137
144
|
onWrapperScrolled = (e: Event) => {
|
|
145
|
+
// Ignored via go/ees005
|
|
146
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
138
147
|
const wrapper = e.target as HTMLElement;
|
|
139
148
|
this.setState({
|
|
140
149
|
scrollLeft: wrapper.scrollLeft,
|
|
@@ -177,6 +186,8 @@ class FloatingDeleteButton extends Component<Props, State> {
|
|
|
177
186
|
if (deleteBtnParams) {
|
|
178
187
|
return {
|
|
179
188
|
...deleteBtnParams,
|
|
189
|
+
// Ignored via go/ees005
|
|
190
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
180
191
|
top: inStickyMode ? nextProps.stickyHeaders!.top : 0,
|
|
181
192
|
position: inStickyMode ? 'sticky' : undefined,
|
|
182
193
|
selectionType,
|
|
@@ -229,9 +240,13 @@ class FloatingDeleteButton extends Component<Props, State> {
|
|
|
229
240
|
const { state, dispatch } = this.props.editorView;
|
|
230
241
|
switch (this.state.selectionType) {
|
|
231
242
|
case 'row': {
|
|
243
|
+
// Ignored via go/ees005
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
232
245
|
return hoverRows(this.state.indexes!, true)(state, dispatch, this.props.editorView);
|
|
233
246
|
}
|
|
234
247
|
case 'column': {
|
|
248
|
+
// Ignored via go/ees005
|
|
249
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
235
250
|
return hoverColumns(this.state.indexes!, true)(state, dispatch, this.props.editorView);
|
|
236
251
|
}
|
|
237
252
|
}
|
|
@@ -312,6 +327,8 @@ class FloatingDeleteButton extends Component<Props, State> {
|
|
|
312
327
|
if (this.state.position === 'sticky' && mountTo) {
|
|
313
328
|
const headerRow = tableRef.querySelector('tr.sticky');
|
|
314
329
|
if (headerRow) {
|
|
330
|
+
// Ignored via go/ees005
|
|
331
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
315
332
|
const rect = headerRow!.getBoundingClientRect();
|
|
316
333
|
|
|
317
334
|
const calculatePosition = popupOpts.onPositionCalculated || ((pos) => pos);
|
|
@@ -353,6 +370,8 @@ class FloatingDeleteButton extends Component<Props, State> {
|
|
|
353
370
|
scrollableElement={this.wrapper || undefined}
|
|
354
371
|
forcePlacement={true}
|
|
355
372
|
allowOutOfBounds
|
|
373
|
+
// Ignored via go/ees005
|
|
374
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
356
375
|
{...popupOpts}
|
|
357
376
|
>
|
|
358
377
|
{button}
|
|
@@ -57,15 +57,14 @@ import {
|
|
|
57
57
|
import { toggleDragMenu } from '../../pm-plugins/drag-and-drop/commands';
|
|
58
58
|
import { getPluginState } from '../../pm-plugins/drag-and-drop/plugin-factory';
|
|
59
59
|
import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-factory';
|
|
60
|
+
import type { DragMenuConfig, DragMenuOptionIdType } from '../../pm-plugins/utils/drag-menu';
|
|
61
|
+
import { getDragMenuConfig } from '../../pm-plugins/utils/drag-menu';
|
|
60
62
|
import {
|
|
61
63
|
checkIfHeaderColumnEnabled,
|
|
62
64
|
checkIfHeaderRowEnabled,
|
|
63
65
|
checkIfNumberColumnEnabled,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} from '../../pm-plugins/utils';
|
|
67
|
-
import type { DragMenuConfig, DragMenuOptionIdType } from '../../pm-plugins/utils/drag-menu';
|
|
68
|
-
import { getDragMenuConfig } from '../../pm-plugins/utils/drag-menu';
|
|
66
|
+
} from '../../pm-plugins/utils/nodes';
|
|
67
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
|
|
69
68
|
import { TableCssClassName as ClassName } from '../../types';
|
|
70
69
|
import type { PluginConfig, PluginInjectionAPI, TableDirection } from '../../types';
|
|
71
70
|
import { colorPalletteColumns } from '../consts';
|
|
@@ -291,7 +290,9 @@ const DragMenu = React.memo(
|
|
|
291
290
|
const { isKeyboardModeActive } = getPluginState(state);
|
|
292
291
|
|
|
293
292
|
const selectionRect = isSelectionType(selection, 'cell')
|
|
294
|
-
?
|
|
293
|
+
? // Ignored via go/ees005
|
|
294
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
295
|
+
getSelectionRect(selection)!
|
|
295
296
|
: findCellRectClosestToPos(selection.$from);
|
|
296
297
|
|
|
297
298
|
const hasMergedCellsInTable = tableMap?.hasMergedCells() ?? false;
|
|
@@ -324,6 +325,8 @@ const DragMenu = React.memo(
|
|
|
324
325
|
|
|
325
326
|
const handleSubMenuRef = (ref: HTMLDivElement | null) => {
|
|
326
327
|
const parent = closestElement(
|
|
328
|
+
// Ignored via go/ees005
|
|
329
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
327
330
|
editorView.dom as HTMLElement,
|
|
328
331
|
'.fabric-editor-popup-scroll-parent',
|
|
329
332
|
);
|
|
@@ -395,6 +398,8 @@ const DragMenu = React.memo(
|
|
|
395
398
|
bubbles: true,
|
|
396
399
|
});
|
|
397
400
|
setIsSubmenuOpen(false);
|
|
401
|
+
// Ignored via go/ees005
|
|
402
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
398
403
|
(target as HTMLElement)?.focus();
|
|
399
404
|
target?.dispatchEvent(keyboardEvent);
|
|
400
405
|
}}
|
|
@@ -570,6 +575,8 @@ const DragMenu = React.memo(
|
|
|
570
575
|
: hoverRows(getSelectedRowIndexes(selectionRect), true))(state, dispatch);
|
|
571
576
|
};
|
|
572
577
|
|
|
578
|
+
// Ignored via go/ees005
|
|
579
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
573
580
|
const handleItemMouseLeave = ({ item }: { item: any }) => {
|
|
574
581
|
if (item.value.name === 'background' && isSubmenuOpen) {
|
|
575
582
|
setIsSubmenuOpen(false);
|
|
@@ -19,6 +19,8 @@ import { dragMenuDropdownWidth } from '../consts';
|
|
|
19
19
|
|
|
20
20
|
const DropListWithOutsideClickTargetRef = (props: DropListProps) => {
|
|
21
21
|
const setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
22
24
|
return <DropList onDroplistRef={setOutsideClickTargetRef} {...props} />;
|
|
23
25
|
};
|
|
24
26
|
const DropListWithOutsideListeners = withReactEditorViewOuterListeners(
|
|
@@ -100,6 +102,8 @@ export const DropdownMenu = ({
|
|
|
100
102
|
<Section
|
|
101
103
|
hasSeparator={section?.hasSeparator && index > 0}
|
|
102
104
|
title={section?.title}
|
|
105
|
+
// Ignored via go/ees005
|
|
106
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
103
107
|
key={index}
|
|
104
108
|
>
|
|
105
109
|
{group.items.map((item) => (
|
|
@@ -125,6 +129,8 @@ export const DropdownMenu = ({
|
|
|
125
129
|
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 */}
|
|
126
130
|
<div className="drag-dropdown-menu-popup-ref" ref={handleRef}></div>
|
|
127
131
|
<Popup
|
|
132
|
+
// Ignored via go/ees005
|
|
133
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
128
134
|
target={targetRefDiv as HTMLElement}
|
|
129
135
|
mountTo={mountPoint}
|
|
130
136
|
boundariesElement={boundariesElement}
|
|
@@ -157,6 +163,8 @@ export const DropdownMenu = ({
|
|
|
157
163
|
const keys = ['row_numbers', 'header_row', 'header_column'];
|
|
158
164
|
let doubleItemCount = 0;
|
|
159
165
|
|
|
166
|
+
// Ignored via go/ees005
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
160
168
|
const firstIndex = results.findIndex((value) => keys.includes(value.key!));
|
|
161
169
|
|
|
162
170
|
if (firstIndex === -1 || index <= firstIndex) {
|
|
@@ -165,6 +173,8 @@ export const DropdownMenu = ({
|
|
|
165
173
|
}
|
|
166
174
|
|
|
167
175
|
for (let i = firstIndex; i < results.length; i += 1) {
|
|
176
|
+
// Ignored via go/ees005
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
168
178
|
if (keys.includes(results[i].key!)) {
|
|
169
179
|
doubleItemCount += 1;
|
|
170
180
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from '@atlaskit/editor-shared-styles';
|
|
13
13
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
14
14
|
|
|
15
|
-
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
15
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
16
16
|
import type { PluginConfig, PluginInjectionAPI, TableDirection } from '../../types';
|
|
17
17
|
import { dragMenuDropdownWidth, tablePopupMenuFitHeight } from '../consts';
|
|
18
18
|
|
|
@@ -88,6 +88,8 @@ const FloatingDragMenu = ({
|
|
|
88
88
|
<Popup
|
|
89
89
|
alignX={direction === 'row' ? 'right' : undefined}
|
|
90
90
|
alignY={direction === 'row' ? 'start' : undefined}
|
|
91
|
+
// Ignored via go/ees005
|
|
92
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
91
93
|
target={targetHandleRef as HTMLElement}
|
|
92
94
|
mountTo={mountPoint}
|
|
93
95
|
boundariesElement={boundariesElement}
|
|
@@ -76,7 +76,11 @@ const getInsertLineWidth = (
|
|
|
76
76
|
const LINE_OFFSET = 4;
|
|
77
77
|
const DRAG_LINE_OFFSET = isChromelessEditor ? 14 : 6;
|
|
78
78
|
const { parentElement, offsetWidth } = tableRef;
|
|
79
|
+
// Ignored via go/ees005
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
79
81
|
const parentOffsetWidth = parentElement!.offsetWidth;
|
|
82
|
+
// Ignored via go/ees005
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
80
84
|
const { scrollLeft } = parentElement!;
|
|
81
85
|
const diff = offsetWidth - parentOffsetWidth;
|
|
82
86
|
const toolbarSize = isDragAndDropEnabled ? 0 : getToolbarSize(tableRef);
|
|
@@ -54,6 +54,8 @@ function getRowOptions(index: number, isDragAndDropEnabled: boolean): Partial<Po
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// Ignored via go/ees005
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
57
59
|
function getColumnOptions(
|
|
58
60
|
index: number,
|
|
59
61
|
tableContainer: HTMLElement | null,
|
|
@@ -111,6 +113,8 @@ function getColumnOptions(
|
|
|
111
113
|
return options;
|
|
112
114
|
}
|
|
113
115
|
|
|
116
|
+
// Ignored via go/ees005
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
114
118
|
function getPopupOptions(
|
|
115
119
|
direction: TableDirection,
|
|
116
120
|
index: number,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
insertColumnWithAnalytics,
|
|
31
31
|
insertRowWithAnalytics,
|
|
32
32
|
} from '../../pm-plugins/commands/commands-with-analytics';
|
|
33
|
-
import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils';
|
|
33
|
+
import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
|
|
34
34
|
import { TableCssClassName as ClassName } from '../../types';
|
|
35
35
|
import type { PluginInjectionAPI } from '../../types';
|
|
36
36
|
|
|
@@ -60,6 +60,8 @@ export interface Props {
|
|
|
60
60
|
isCommentEditor?: boolean;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// Ignored via go/ees005
|
|
64
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
63
65
|
export class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
|
|
64
66
|
static displayName = 'FloatingInsertButton';
|
|
65
67
|
|
|
@@ -151,6 +153,8 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
151
153
|
selection: editorView.state.selection.toJSON(),
|
|
152
154
|
position: pos,
|
|
153
155
|
docSize: editorView.state.doc.nodeSize,
|
|
156
|
+
// Ignored via go/ees005
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
158
|
error: (error as any)?.toString(),
|
|
155
159
|
},
|
|
156
160
|
};
|
|
@@ -172,6 +176,8 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
172
176
|
const tableContainerWrapper = closestElement(targetCellRef, `.${ClassName.TABLE_CONTAINER}`);
|
|
173
177
|
const tableWrapper = closestElement(targetCellRef, `.${ClassName.TABLE_NODE_WRAPPER}`);
|
|
174
178
|
|
|
179
|
+
// Ignored via go/ees005
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
175
181
|
const index: number = type === 'column' ? insertColumnButtonIndex! : insertRowButtonIndex!;
|
|
176
182
|
|
|
177
183
|
const hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state.selection);
|
|
@@ -188,9 +194,13 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
188
194
|
target={targetCellRef}
|
|
189
195
|
mountTo={tableContainerWrapper || mountPoint}
|
|
190
196
|
boundariesElement={tableContainerWrapper || boundariesElement}
|
|
197
|
+
// Ignored via go/ees005
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
191
199
|
scrollableElement={tableWrapper!}
|
|
192
200
|
forcePlacement={true}
|
|
193
201
|
allowOutOfBounds
|
|
202
|
+
// Ignored via go/ees005
|
|
203
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
194
204
|
{...getPopupOptions(
|
|
195
205
|
type,
|
|
196
206
|
index,
|
|
@@ -222,23 +232,33 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
222
232
|
|
|
223
233
|
private getCellPosition(type: 'column' | 'row', tableNode: PmNode): number | null {
|
|
224
234
|
const { insertColumnButtonIndex, insertRowButtonIndex } = this.props;
|
|
235
|
+
// Ignored via go/ees005
|
|
236
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
225
237
|
const tableMap = TableMap.get(tableNode!);
|
|
226
238
|
|
|
227
239
|
if (type === 'column') {
|
|
240
|
+
// Ignored via go/ees005
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
228
242
|
const columnIndex = insertColumnButtonIndex === 0 ? 0 : insertColumnButtonIndex! - 1;
|
|
229
243
|
|
|
230
244
|
if (columnIndex > tableMap.width - 1) {
|
|
231
245
|
return null;
|
|
232
246
|
}
|
|
233
247
|
|
|
248
|
+
// Ignored via go/ees005
|
|
249
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
234
250
|
return tableMap.positionAt(0, columnIndex!, tableNode!);
|
|
235
251
|
} else {
|
|
252
|
+
// Ignored via go/ees005
|
|
253
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
236
254
|
const rowIndex = insertRowButtonIndex === 0 ? 0 : insertRowButtonIndex! - 1;
|
|
237
255
|
|
|
238
256
|
if (rowIndex > tableMap.height - 1) {
|
|
239
257
|
return null;
|
|
240
258
|
}
|
|
241
259
|
|
|
260
|
+
// Ignored via go/ees005
|
|
261
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
242
262
|
return tableMap.positionAt(rowIndex!, 0, tableNode!);
|
|
243
263
|
}
|
|
244
264
|
}
|
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
} from '../../../pm-plugins/commands';
|
|
22
22
|
import { toggleDragMenu } from '../../../pm-plugins/drag-and-drop/commands';
|
|
23
23
|
import type { TriggerType } from '../../../pm-plugins/drag-and-drop/types';
|
|
24
|
-
import { getRowsParams
|
|
24
|
+
import { getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
25
|
+
import { getSelectedColumnIndexes } from '../../../pm-plugins/utils/selection';
|
|
25
26
|
import type { TablePlugin } from '../../../tablePluginType';
|
|
26
27
|
import type { CellHoverMeta, HandleTypes } from '../../../types';
|
|
27
28
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
@@ -97,21 +98,27 @@ export const ColumnControls = ({
|
|
|
97
98
|
const hasHeaderRow = firstRow ? firstRow.getAttribute('data-header-row') : false;
|
|
98
99
|
|
|
99
100
|
const rowControlStickyTop = fg('platform_editor_breakout_use_css') ? 45 : rowHeights?.[0];
|
|
100
|
-
const marginTop = hasHeaderRow && stickyTop !== undefined ? rowControlStickyTop ?? 0 : 0;
|
|
101
|
+
const marginTop = hasHeaderRow && stickyTop !== undefined ? (rowControlStickyTop ?? 0) : 0;
|
|
101
102
|
|
|
102
103
|
const handleClick = useCallback(
|
|
103
104
|
(event: MouseEvent) => {
|
|
104
105
|
const { state, dispatch } = editorView;
|
|
105
106
|
|
|
106
107
|
const isClickOutsideSelectedCols =
|
|
108
|
+
// Ignored via go/ees005
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
107
110
|
selectedColIndexes.length >= 1 && !selectedColIndexes.includes(colIndex!);
|
|
108
111
|
|
|
109
112
|
if (!selectedColIndexes || selectedColIndexes.length === 0 || isClickOutsideSelectedCols) {
|
|
113
|
+
// Ignored via go/ees005
|
|
114
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
110
115
|
selectColumn(colIndex!, event.shiftKey)(state, dispatch);
|
|
111
116
|
}
|
|
112
117
|
|
|
113
118
|
if (
|
|
114
119
|
selectedColIndexes.length > 1 &&
|
|
120
|
+
// Ignored via go/ees005
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
115
122
|
selectedColIndexes.includes(colIndex!) &&
|
|
116
123
|
!event.shiftKey
|
|
117
124
|
) {
|
|
@@ -123,6 +130,8 @@ export const ColumnControls = ({
|
|
|
123
130
|
|
|
124
131
|
const handleMouseOver = useCallback(() => {
|
|
125
132
|
const { state, dispatch } = editorView;
|
|
133
|
+
// Ignored via go/ees005
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
126
135
|
hoverColumns([colIndex!])(state, dispatch);
|
|
127
136
|
}, [colIndex, editorView]);
|
|
128
137
|
|
|
@@ -173,6 +182,8 @@ export const ColumnControls = ({
|
|
|
173
182
|
);
|
|
174
183
|
|
|
175
184
|
const colIndexes = useMemo(() => {
|
|
185
|
+
// Ignored via go/ees005
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
176
187
|
return [colIndex!];
|
|
177
188
|
}, [colIndex]);
|
|
178
189
|
|
|
@@ -185,6 +196,8 @@ export const ColumnControls = ({
|
|
|
185
196
|
appearance: DragHandleAppearance,
|
|
186
197
|
gridColumn: string,
|
|
187
198
|
indexes: number[],
|
|
199
|
+
// Ignored via go/ees005
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
188
201
|
) => {
|
|
189
202
|
const isHover = type === 'hover';
|
|
190
203
|
const isPlaceholder = appearance === 'placeholder';
|
|
@@ -282,6 +295,8 @@ export const ColumnControls = ({
|
|
|
282
295
|
!selectedColIndexes.includes(colIndex)
|
|
283
296
|
) {
|
|
284
297
|
handles.push(
|
|
298
|
+
// Ignored via go/ees005
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
285
300
|
generateHandleByType('hover', 'default', `${colIndex! + 1} / span 1`, colIndexes),
|
|
286
301
|
);
|
|
287
302
|
}
|
|
@@ -327,6 +342,8 @@ export const ColumnControls = ({
|
|
|
327
342
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
328
343
|
className={ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER}
|
|
329
344
|
contentEditable={false}
|
|
345
|
+
// Ignored via go/ees005
|
|
346
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
330
347
|
key={index}
|
|
331
348
|
>
|
|
332
349
|
<div
|
|
@@ -9,8 +9,10 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
9
9
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
11
|
|
|
12
|
-
import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
13
|
-
import {
|
|
12
|
+
import type { RowStickyState } from '../../pm-plugins/sticky-headers/types';
|
|
13
|
+
import { getColumnsWidths } from '../../pm-plugins/utils/column-controls';
|
|
14
|
+
import { containsHeaderColumn } from '../../pm-plugins/utils/nodes';
|
|
15
|
+
import { getRowHeights } from '../../pm-plugins/utils/row-controls';
|
|
14
16
|
import type { CellHoverMeta, DraggableSourceData, PluginInjectionAPI } from '../../types';
|
|
15
17
|
import { TableCssClassName as ClassName } from '../../types';
|
|
16
18
|
|
|
@@ -100,12 +102,14 @@ const TableFloatingColumnControls = ({
|
|
|
100
102
|
|
|
101
103
|
if (stickyTop) {
|
|
102
104
|
const columnControlTopOffsetFromParent = '-12px';
|
|
103
|
-
const headerRowHeight = hasHeaderRow && stickyTop !== undefined ? rowHeights?.[0] ?? 0 : 0;
|
|
105
|
+
const headerRowHeight = hasHeaderRow && stickyTop !== undefined ? (rowHeights?.[0] ?? 0) : 0;
|
|
104
106
|
containerRef?.current?.style.setProperty(
|
|
105
107
|
'top',
|
|
106
108
|
fg('platform_editor_breakout_use_css')
|
|
107
109
|
? columnControlTopOffsetFromParent
|
|
108
|
-
:
|
|
110
|
+
: // Ignored via go/ees005
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
112
|
+
`${stickyTop! - headerRowHeight + 33}px`, // 33px is padding and margin applied on tr.sticky
|
|
109
113
|
);
|
|
110
114
|
} else {
|
|
111
115
|
containerRef?.current?.style.removeProperty('top');
|
|
@@ -14,6 +14,8 @@ import { TableCssClassName as ClassName } from '../../../types';
|
|
|
14
14
|
|
|
15
15
|
import type { CornerControlProps } from './types';
|
|
16
16
|
|
|
17
|
+
// Ignored via go/ees005
|
|
18
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
17
19
|
class CornerControlComponent extends Component<CornerControlProps & WrappedComponentProps, any> {
|
|
18
20
|
render() {
|
|
19
21
|
const {
|
|
@@ -6,8 +6,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
|
|
7
7
|
import type { TablePlugin } from '../../tablePluginType';
|
|
8
8
|
|
|
9
|
-
import { CornerControls } from './CornerControls';
|
|
10
|
-
import { RowControls } from './RowControls';
|
|
9
|
+
import { CornerControls } from './CornerControls/ClassicCornerControls';
|
|
10
|
+
import { RowControls } from './RowControls/ClassicControls';
|
|
11
11
|
|
|
12
12
|
type FloatingControlsWithSelectionProps = {
|
|
13
13
|
editorView: EditorView;
|