@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
|
@@ -6,8 +6,8 @@ import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
6
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
|
|
8
8
|
import type { PluginInjectionAPI } from '../../../types';
|
|
9
|
-
import { updateColumnWidths } from '../../transforms';
|
|
10
|
-
import { getTableWidth } from '../../utils';
|
|
9
|
+
import { updateColumnWidths } from '../../transforms/column-width';
|
|
10
|
+
import { getTableWidth } from '../../utils/nodes';
|
|
11
11
|
import { getLayoutSize } from '../utils/misc';
|
|
12
12
|
import { reduceSpace } from '../utils/resize-logic';
|
|
13
13
|
import {
|
|
@@ -42,6 +42,8 @@ const scale = (
|
|
|
42
42
|
isTableScalingEnabledOnCurrentTable = false,
|
|
43
43
|
shouldUseIncreasedScalingPercent = false,
|
|
44
44
|
isCommentEditor = false,
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
47
|
): ResizeState | undefined => {
|
|
46
48
|
const {
|
|
47
49
|
node,
|
|
@@ -107,6 +109,8 @@ const scaleWithParent = (
|
|
|
107
109
|
isTableScalingEnabledOnCurrentTable = false,
|
|
108
110
|
shouldUseIncreasedScalingPercent = false,
|
|
109
111
|
isCommentEditor = false,
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
110
114
|
) => {
|
|
111
115
|
const resizeState = getResizeState({
|
|
112
116
|
minWidth: tableCellMinWidth,
|
|
@@ -159,6 +163,8 @@ export const previewScaleTable = (
|
|
|
159
163
|
isTableScalingEnabled: boolean = false,
|
|
160
164
|
isTableWithFixedColumnWidthsOptionEnabled: boolean = false,
|
|
161
165
|
isCommentEditor: boolean = false,
|
|
166
|
+
// Ignored via go/ees005
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
162
168
|
) => {
|
|
163
169
|
const { node, start, parentWidth } = options;
|
|
164
170
|
|
|
@@ -219,6 +225,8 @@ export const scaleTable =
|
|
|
219
225
|
isTableScalingEnabledOnCurrentTable = false,
|
|
220
226
|
shouldUseIncreasedScalingPercent = false,
|
|
221
227
|
isCommentEditor = false,
|
|
228
|
+
// Ignored via go/ees005
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
222
230
|
) =>
|
|
223
231
|
(tr: Transaction) => {
|
|
224
232
|
if (!tableRef) {
|
|
@@ -32,8 +32,12 @@ export function tableSelectionKeymapPlugin(
|
|
|
32
32
|
const editorSelectionAPI = pluginInjectionApi?.selection;
|
|
33
33
|
const ariaNotifyPlugin = pluginInjectionApi?.accessibilityUtils?.actions.ariaNotify;
|
|
34
34
|
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
35
37
|
bindKeymapWithCommand(moveRight.common!, arrowRightFromTable(editorSelectionAPI)(), list);
|
|
36
38
|
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
41
|
bindKeymapWithCommand(moveLeft.common!, arrowLeftFromTable(editorSelectionAPI)(), list);
|
|
38
42
|
|
|
39
43
|
bindKeymapArrayWithCommand(
|
|
@@ -48,8 +52,12 @@ export function tableSelectionKeymapPlugin(
|
|
|
48
52
|
list,
|
|
49
53
|
);
|
|
50
54
|
|
|
55
|
+
// Ignored via go/ees005
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
51
57
|
bindKeymapWithCommand(shiftArrowUp.common!, shiftArrowUpFromTable(editorSelectionAPI)(), list);
|
|
52
58
|
|
|
59
|
+
// Ignored via go/ees005
|
|
60
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
53
61
|
bindKeymapWithCommand(selectTable.common!, modASelectTable(editorSelectionAPI)(), list);
|
|
54
62
|
|
|
55
63
|
return keymap(list) as SafePlugin;
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
akEditorWideLayoutWidth,
|
|
17
17
|
} from '@atlaskit/editor-shared-styles';
|
|
18
18
|
|
|
19
|
-
import { TABLE_MAX_WIDTH } from './table-resizing/utils';
|
|
19
|
+
import { TABLE_MAX_WIDTH } from './table-resizing/utils/consts';
|
|
20
20
|
import { ALIGN_START } from './utils/alignment';
|
|
21
21
|
|
|
22
22
|
type __ReplaceStep = ReplaceStep & {
|
|
@@ -40,6 +40,8 @@ const createPlugin = (
|
|
|
40
40
|
isTableScalingEnabled: boolean,
|
|
41
41
|
isTableAlignmentEnabled: boolean,
|
|
42
42
|
isCommentEditor: boolean,
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
43
45
|
) => {
|
|
44
46
|
return new SafePlugin({
|
|
45
47
|
key: pluginKey,
|
|
@@ -157,6 +159,8 @@ const createPlugin = (
|
|
|
157
159
|
|
|
158
160
|
if (referentialityTr) {
|
|
159
161
|
referentialityTr.steps.forEach((step) => {
|
|
162
|
+
// Ignored via go/ees005
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
160
164
|
step.getMap().forEach((_, __, newStart, newEnd) => {
|
|
161
165
|
newState.doc.nodesBetween(newStart, newEnd, (node, pos) => {
|
|
162
166
|
if (node.type === table) {
|
|
@@ -9,15 +9,11 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
|
|
11
11
|
import type { PluginInjectionAPI } from '../../types';
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
getTableContainerElementWidth,
|
|
15
|
-
getTableElementWidth,
|
|
16
|
-
hasTableBeenResized,
|
|
17
|
-
} from '../table-resizing/utils';
|
|
18
|
-
import { isMinCellWidthTable } from '../table-resizing/utils/colgroup';
|
|
12
|
+
import { isMinCellWidthTable , hasTableBeenResized } from '../table-resizing/utils/colgroup';
|
|
13
|
+
import { getTableContainerElementWidth, getTableElementWidth } from '../table-resizing/utils/misc';
|
|
19
14
|
import { getResizeState } from '../table-resizing/utils/resize-state';
|
|
20
15
|
import { scaleTableTo } from '../table-resizing/utils/scale-table';
|
|
16
|
+
import type { ResizeState } from '../table-resizing/utils/types';
|
|
21
17
|
|
|
22
18
|
/**
|
|
23
19
|
* Given a new ResizeState object, create a transaction that replaces and updates the table node based on new state.
|
|
@@ -32,6 +28,8 @@ export const updateColumnWidths =
|
|
|
32
28
|
table: PMNode,
|
|
33
29
|
start: number,
|
|
34
30
|
api: PluginInjectionAPI | undefined | null,
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
35
33
|
) =>
|
|
36
34
|
(tr: Transaction): Transaction => {
|
|
37
35
|
const map = TableMap.get(table);
|
|
@@ -49,6 +47,8 @@ export const updateColumnWidths =
|
|
|
49
47
|
const mapIndex = rowIndex * map.width + columnIndex;
|
|
50
48
|
const cellPos = map.map[mapIndex];
|
|
51
49
|
const attrs = updatedCellsAttrs[cellPos] || {
|
|
50
|
+
// Ignored via go/ees005
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
52
52
|
...table.nodeAt(cellPos)!.attrs,
|
|
53
53
|
};
|
|
54
54
|
const colspan = attrs.colspan || 1;
|
|
@@ -134,6 +134,8 @@ export const rescaleColumns =
|
|
|
134
134
|
shouldUseIncreasedScalingPercent = false,
|
|
135
135
|
api: PluginInjectionAPI | undefined | null,
|
|
136
136
|
isCommentEditor = false,
|
|
137
|
+
// Ignored via go/ees005
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
137
139
|
) =>
|
|
138
140
|
(table: ContentNodeWithPos, view: EditorView | undefined) =>
|
|
139
141
|
(tr: Transaction): Transaction => {
|
|
@@ -35,6 +35,8 @@ const deleteColumnsCustomStep =
|
|
|
35
35
|
for (let i = rect.left; i < rect.right; i++) {
|
|
36
36
|
const step = AddColumnStep.create(originalDoc, table.pos, i, true);
|
|
37
37
|
deletedColumns.push(i);
|
|
38
|
+
// Ignored via go/ees005
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
38
40
|
tr.step(step.map(tr.mapping.slice(mapStart))!);
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -250,6 +252,8 @@ export const deleteColumns =
|
|
|
250
252
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
251
253
|
shouldUseIncreasedScalingPercent = false,
|
|
252
254
|
isCommentEditor = false,
|
|
255
|
+
// Ignored via go/ees005
|
|
256
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
253
257
|
) =>
|
|
254
258
|
(tr: Transaction) => {
|
|
255
259
|
let updatedTr = tr;
|
|
@@ -8,12 +8,9 @@ import {
|
|
|
8
8
|
} from '@atlaskit/editor-shared-styles';
|
|
9
9
|
|
|
10
10
|
import type { ReportInvalidNodeAttrs } from '../../types';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
getCellsRefsInColumn,
|
|
15
|
-
getLayoutSize,
|
|
16
|
-
} from '../table-resizing/utils';
|
|
11
|
+
import { calculateColumnWidth, getCellsRefsInColumn } from '../table-resizing/utils/column-state';
|
|
12
|
+
import { contentWidth } from '../table-resizing/utils/content-width';
|
|
13
|
+
import { getLayoutSize } from '../table-resizing/utils/misc';
|
|
17
14
|
|
|
18
15
|
const validateTableCellNodeAttrs = (
|
|
19
16
|
{ colspan, rowspan, tableLocalId }: { colspan?: number; rowspan?: number; tableLocalId: string },
|
|
@@ -53,6 +50,8 @@ export const removeExtraneousColumnWidths = (
|
|
|
53
50
|
basePos: number,
|
|
54
51
|
tr: Transaction,
|
|
55
52
|
reportInvalidTableCellSpanAttrs?: ReportInvalidNodeAttrs,
|
|
53
|
+
// Ignored via go/ees005
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
56
55
|
): boolean => {
|
|
57
56
|
let hasProblems = false;
|
|
58
57
|
|
|
@@ -127,6 +126,8 @@ export const fixAutoSizedTable = (
|
|
|
127
126
|
tableRef: HTMLTableElement,
|
|
128
127
|
tablePos: number,
|
|
129
128
|
opts: { containerWidth: number },
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
130
131
|
): Transaction => {
|
|
131
132
|
let { tr } = view.state;
|
|
132
133
|
const domAtPos = view.domAtPos.bind(view);
|
|
@@ -178,6 +179,8 @@ const getLayoutBasedOnWidth = (totalWidth: number) => {
|
|
|
178
179
|
}
|
|
179
180
|
};
|
|
180
181
|
|
|
182
|
+
// Ignored via go/ees005
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
181
184
|
function parseDOMColumnWidths(
|
|
182
185
|
domAtPos: (pos: number) => { node: Node; offset: number },
|
|
183
186
|
tableNode: PMNode,
|
|
@@ -199,6 +202,8 @@ function parseDOMColumnWidths(
|
|
|
199
202
|
const colIdx = col + span;
|
|
200
203
|
const cells = getCellsRefsInColumn(colIdx, tableNode, tableStart, domAtPos);
|
|
201
204
|
const colWidth = calculateColumnWidth(cells, (_, col) => {
|
|
205
|
+
// Ignored via go/ees005
|
|
206
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
202
207
|
return contentWidth(col as HTMLElement, tableRef).width;
|
|
203
208
|
});
|
|
204
209
|
|
|
@@ -215,6 +220,8 @@ const replaceCells = (
|
|
|
215
220
|
table: PMNode,
|
|
216
221
|
tablePos: number,
|
|
217
222
|
modifyCell: (cell: PMNode, rowIndex: number, colIndex: number) => PMNode,
|
|
223
|
+
// Ignored via go/ees005
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
218
225
|
): Transaction => {
|
|
219
226
|
const rows: PMNode[] = [];
|
|
220
227
|
let modifiedCells = 0;
|
|
@@ -15,7 +15,11 @@ export function mergeCells(tr: Transaction): Transaction {
|
|
|
15
15
|
return tr;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18
20
|
const rect = getSelectionRect(selection)!;
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
23
|
const table = findTable(selection)!;
|
|
20
24
|
const map = TableMap.get(table.node);
|
|
21
25
|
const seen: number[] = [];
|
|
@@ -70,6 +74,8 @@ export function mergeCells(tr: Transaction): Transaction {
|
|
|
70
74
|
content === Fragment.empty
|
|
71
75
|
? cell.type.createAndFill(attrs, content, cell.marks)
|
|
72
76
|
: cell.type.createChecked(attrs, content, cell.marks);
|
|
77
|
+
// Ignored via go/ees005
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
73
79
|
rowCells.push(newCell!);
|
|
74
80
|
} else if (selectedCells.indexOf(cellPos) === -1) {
|
|
75
81
|
// if its one of the selected cells, but not the merged cell, we get rid of it
|
|
@@ -5,13 +5,15 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
|
|
|
5
5
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
7
7
|
|
|
8
|
-
import { getSelectedTableInfo } from '../utils';
|
|
8
|
+
import { getSelectedTableInfo } from '../utils/analytics';
|
|
9
9
|
|
|
10
10
|
export const replaceSelectedTable = (
|
|
11
11
|
state: EditorState,
|
|
12
12
|
content: string | Slice,
|
|
13
13
|
inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.CLIPBOARD,
|
|
14
14
|
editorAnalyticsAPI?: EditorAnalyticsAPI,
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
15
17
|
): Transaction => {
|
|
16
18
|
if (isTableSelected(state.selection)) {
|
|
17
19
|
const table = findTable(state.selection);
|
|
@@ -10,6 +10,8 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
10
10
|
* @param columnStart - Start of the rect included (rect.left)
|
|
11
11
|
* @param columnEnd - End of the rect not included (rect.right)
|
|
12
12
|
*/
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
13
15
|
export function splitCellsInColumns(
|
|
14
16
|
tr: Transaction,
|
|
15
17
|
tablePos: number,
|
|
@@ -61,6 +63,8 @@ export function splitCellsInColumns(
|
|
|
61
63
|
const cellPos = map.positionAt(cellRowIndex, column + i, table);
|
|
62
64
|
tr.insert(
|
|
63
65
|
mapping.map(cellPos + tableStart),
|
|
66
|
+
// Ignored via go/ees005
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
68
|
cellNode.type.createAndFill({
|
|
65
69
|
...baseAttrs,
|
|
66
70
|
colwidth: colwidth ? [colwidth[i]] : undefined,
|
|
@@ -22,6 +22,8 @@ export const shouldChangeAlignmentToCenterResized = (
|
|
|
22
22
|
tableNode: PmNode,
|
|
23
23
|
lineLength: number | undefined,
|
|
24
24
|
updatedTableWidth: number,
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
25
27
|
) =>
|
|
26
28
|
Boolean(
|
|
27
29
|
isTableAlignmentEnabled &&
|
|
@@ -13,9 +13,9 @@ import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
13
13
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
14
14
|
import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
15
15
|
|
|
16
|
-
import { hasTableBeenResized } from '../table-resizing/utils';
|
|
16
|
+
import { hasTableBeenResized } from '../table-resizing/utils/colgroup';
|
|
17
17
|
|
|
18
|
-
import { getTableWidth } from './
|
|
18
|
+
import { getTableWidth } from './nodes';
|
|
19
19
|
|
|
20
20
|
export function getSelectedTableInfo(selection: Selection): {
|
|
21
21
|
table: ReturnType<typeof findTable> | undefined;
|
|
@@ -8,10 +8,9 @@ import { findTable } from '@atlaskit/editor-tables/utils';
|
|
|
8
8
|
interface IsTableCollapsibleResult {
|
|
9
9
|
tableIsCollapsible: boolean;
|
|
10
10
|
range?: NodeRange;
|
|
11
|
-
findWrappingRes?:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
| undefined;
|
|
11
|
+
findWrappingRes?: // Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
|
+
Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> | null | undefined;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
const bail = () => ({
|
|
@@ -25,8 +25,12 @@ export const getColumnsWidths = (view: EditorView): Array<number | undefined> =>
|
|
|
25
25
|
widths = Array.from({ length: map.width });
|
|
26
26
|
for (let i = 0; i < map.width; i++) {
|
|
27
27
|
if (!map.isCellMergedTopLeft(0, i)) {
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
30
|
const node = table.node.nodeAt(map.map[i])!;
|
|
29
31
|
const pos = map.map[i] + table.start;
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
30
34
|
const cellRef = findDomRefAtPos(pos, domAtPos) as HTMLElement;
|
|
31
35
|
const rect = cellRef.getBoundingClientRect();
|
|
32
36
|
widths[i] = (rect ? rect.width : cellRef.offsetWidth) + 1;
|
|
@@ -2,7 +2,7 @@ import type { TableAttributes } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
4
4
|
|
|
5
|
-
import { TABLE_MAX_WIDTH } from '../table-resizing/utils';
|
|
5
|
+
import { TABLE_MAX_WIDTH } from '../table-resizing/utils/consts';
|
|
6
6
|
const NESTED_TABLE_DEFAULT_ROWS = 2;
|
|
7
7
|
const NESTED_TABLE_DEFAULT_COLS = 2;
|
|
8
8
|
|
|
@@ -57,6 +57,8 @@ export const createControlsHoverDecoration = (
|
|
|
57
57
|
hoveredIndexes: number[],
|
|
58
58
|
danger?: boolean,
|
|
59
59
|
selected?: boolean,
|
|
60
|
+
// Ignored via go/ees005
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
60
62
|
): Decoration[] => {
|
|
61
63
|
const table = findTable(tr.selection);
|
|
62
64
|
if (!table) {
|
|
@@ -142,6 +144,8 @@ export const createControlsHoverDecoration = (
|
|
|
142
144
|
|
|
143
145
|
return Decoration.node(
|
|
144
146
|
pos,
|
|
147
|
+
// Ignored via go/ees005
|
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
145
149
|
pos + cell!.nodeSize,
|
|
146
150
|
{
|
|
147
151
|
class: classes.join(' '),
|
|
@@ -170,6 +174,8 @@ export const createColumnSelectedDecoration = (
|
|
|
170
174
|
|
|
171
175
|
return Decoration.node(
|
|
172
176
|
pos + table.start,
|
|
177
|
+
// Ignored via go/ees005
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
173
179
|
pos + table.start + cell!.nodeSize,
|
|
174
180
|
{
|
|
175
181
|
class: ClassName.COLUMN_SELECTED,
|
|
@@ -218,6 +224,8 @@ export const updateDecorations = (
|
|
|
218
224
|
decorationSet: DecorationSet,
|
|
219
225
|
decorations: Decoration[],
|
|
220
226
|
key: TableDecorations,
|
|
227
|
+
// Ignored via go/ees005
|
|
228
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
221
229
|
): DecorationSet => {
|
|
222
230
|
const filteredDecorations = filterDecorationByKey(key, decorationSet);
|
|
223
231
|
const decorationSetFiltered = decorationSet.remove(filteredDecorations);
|
|
@@ -312,6 +320,8 @@ export const createResizeHandleDecoration = (
|
|
|
312
320
|
includeTooltip: boolean = false,
|
|
313
321
|
getIntl: () => IntlShape,
|
|
314
322
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
323
|
+
// Ignored via go/ees005
|
|
324
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
315
325
|
): [Decoration[], Decoration[]] => {
|
|
316
326
|
const emptyResult: [Decoration[], Decoration[]] = [[], []];
|
|
317
327
|
const table = findTable(tr.selection);
|
|
@@ -330,6 +340,8 @@ export const createResizeHandleDecoration = (
|
|
|
330
340
|
rowIndex: number,
|
|
331
341
|
cellPos: number,
|
|
332
342
|
cellNode: PmNode,
|
|
343
|
+
// Ignored via go/ees005
|
|
344
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
333
345
|
): Decoration => {
|
|
334
346
|
const decorationRenderKey = uuid();
|
|
335
347
|
const position = cellPos + cellNode.nodeSize - 1;
|
|
@@ -241,7 +241,11 @@ export const findNearestCellIndexToPoint = (
|
|
|
241
241
|
return undefined;
|
|
242
242
|
}
|
|
243
243
|
return {
|
|
244
|
+
// Ignored via go/ees005
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
244
246
|
row: row!.rowIndex,
|
|
247
|
+
// Ignored via go/ees005
|
|
248
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
245
249
|
col: cell!.cellIndex,
|
|
246
250
|
};
|
|
247
251
|
};
|
|
@@ -51,7 +51,10 @@ import HipchatChevronDoubleUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-dou
|
|
|
51
51
|
import type { NewIconProps } from '@atlaskit/icon/types';
|
|
52
52
|
|
|
53
53
|
import type { DraggableData, DraggableType, PluginInjectionAPI, TableDirection } from '../../types';
|
|
54
|
-
import { AddColLeftIcon
|
|
54
|
+
import { AddColLeftIcon } from '../../ui/icons/AddColLeftIcon';
|
|
55
|
+
import { AddColRightIcon } from '../../ui/icons/AddColRightIcon';
|
|
56
|
+
import { AddRowAboveIcon } from '../../ui/icons/AddRowAboveIcon';
|
|
57
|
+
import { AddRowBelowIcon } from '../../ui/icons/AddRowBelowIcon';
|
|
55
58
|
import { getClosestSelectionRect } from '../../ui/toolbar';
|
|
56
59
|
import {
|
|
57
60
|
deleteColumnsWithAnalytics,
|
|
@@ -82,6 +85,8 @@ export const canMove = (
|
|
|
82
85
|
totalItemsOfSourceTypeCount: number,
|
|
83
86
|
selection: Selection,
|
|
84
87
|
selectionRect?: Rect,
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
85
90
|
) => {
|
|
86
91
|
if (!selectionRect) {
|
|
87
92
|
return false;
|
|
@@ -169,6 +174,8 @@ export const getDragMenuConfig = (
|
|
|
169
174
|
ariaLiveElementAttributes?: AriaLiveElementAttributes,
|
|
170
175
|
) => void,
|
|
171
176
|
isCommentEditor = false,
|
|
177
|
+
// Ignored via go/ees005
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
172
179
|
): DragMenuConfig[] => {
|
|
173
180
|
const { selection } = editorView.state;
|
|
174
181
|
const { getIntl } = getTablePluginState(editorView.state);
|
|
@@ -397,7 +404,11 @@ export const getDragMenuConfig = (
|
|
|
397
404
|
moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(
|
|
398
405
|
INPUT_METHOD.TABLE_CONTEXT_MENU,
|
|
399
406
|
`table-${direction}`,
|
|
407
|
+
// Ignored via go/ees005
|
|
408
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
400
409
|
getOriginIndexes(selectionRect!),
|
|
410
|
+
// Ignored via go/ees005
|
|
411
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
401
412
|
getTargetIndex(selectionRect!),
|
|
402
413
|
)(editorView.state, editorView.dispatch);
|
|
403
414
|
});
|
|
@@ -94,6 +94,8 @@ export const tablesHaveDifferentNoOfRows = (
|
|
|
94
94
|
return prevMap.height !== currentMap.height;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
// Ignored via go/ees005
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
97
99
|
function filterNearSelection<T, U>(
|
|
98
100
|
selection: Selection,
|
|
99
101
|
findNode: (selection: Selection) => { pos: number; node: PmNode } | undefined,
|
|
@@ -33,6 +33,8 @@ const unwrapNestedTables = (
|
|
|
33
33
|
schema: Schema,
|
|
34
34
|
unwrapNestDepth: number,
|
|
35
35
|
currentNestDepth = 0,
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
36
38
|
): PMNode[] => {
|
|
37
39
|
const flattenNested = (node: PMNode, tableDepth: number) => {
|
|
38
40
|
if (node.type === schema.nodes.table) {
|
|
@@ -218,6 +220,8 @@ export const transformSliceToRemoveOpenTable = (slice: Slice, schema: Schema): S
|
|
|
218
220
|
slice.openEnd >= 4 &&
|
|
219
221
|
// slice is a table node
|
|
220
222
|
slice.content.childCount === 1 &&
|
|
223
|
+
// Ignored via go/ees005
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
221
225
|
slice.content.firstChild!.type === schema.nodes.table
|
|
222
226
|
) {
|
|
223
227
|
// prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
|
|
@@ -92,6 +92,8 @@ export const getRowClassNames = (
|
|
|
92
92
|
hoveredRows: number[] = [],
|
|
93
93
|
isInDanger?: boolean,
|
|
94
94
|
isResizing?: boolean,
|
|
95
|
+
// Ignored via go/ees005
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
95
97
|
): string => {
|
|
96
98
|
const classNames: string[] = [];
|
|
97
99
|
if (isRowSelected(index)(selection) || (hoveredRows.indexOf(index) > -1 && !isResizing)) {
|
|
@@ -91,6 +91,8 @@ export const findClosestSnap = (
|
|
|
91
91
|
guidelines: GuidelineConfig[],
|
|
92
92
|
snapGap: number = 0,
|
|
93
93
|
tolerance: number = 0,
|
|
94
|
+
// Ignored via go/ees005
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
94
96
|
) => {
|
|
95
97
|
const closestGapIndex = snapWidths.reduce(
|
|
96
98
|
(prev, curr, index) =>
|
package/src/tablePlugin.tsx
CHANGED
|
@@ -43,34 +43,28 @@ import { pluginKey as tableAnalyticsPluginKey } from './pm-plugins/analytics/plu
|
|
|
43
43
|
import { insertTableWithNestingSupport, insertTableWithSize } from './pm-plugins/commands/insert';
|
|
44
44
|
import { pluginConfig } from './pm-plugins/create-plugin-config';
|
|
45
45
|
import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
|
|
46
|
-
import {
|
|
47
|
-
|
|
48
|
-
pluginKey as dragAndDropPluginKey,
|
|
49
|
-
} from './pm-plugins/drag-and-drop';
|
|
46
|
+
import { createPlugin as createDragAndDropPlugin } from './pm-plugins/drag-and-drop/plugin';
|
|
47
|
+
import { pluginKey as dragAndDropPluginKey } from './pm-plugins/drag-and-drop/plugin-key';
|
|
50
48
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
51
49
|
import { createPlugin } from './pm-plugins/main';
|
|
52
50
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
53
51
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
54
52
|
import { createPlugin as createTableSafariDeleteCompositionTextIssueWorkaroundPlugin } from './pm-plugins/safari-delete-composition-text-issue-workaround';
|
|
55
|
-
import {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
pluginKey as stickyHeadersPluginKey,
|
|
59
|
-
} from './pm-plugins/sticky-headers';
|
|
53
|
+
import { createPlugin as createStickyHeadersPlugin } from './pm-plugins/sticky-headers/plugin';
|
|
54
|
+
import { pluginKey as stickyHeadersPluginKey } from './pm-plugins/sticky-headers/plugin-key';
|
|
55
|
+
import { findStickyHeaderForTable } from './pm-plugins/sticky-headers/util';
|
|
60
56
|
import { createPlugin as createTableOverflowAnalyticsPlugin } from './pm-plugins/table-analytics';
|
|
61
57
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
62
|
-
import {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
pluginKey as tableResizingPluginKey,
|
|
66
|
-
} from './pm-plugins/table-resizing';
|
|
58
|
+
import { createPlugin as createFlexiResizingPlugin } from './pm-plugins/table-resizing/plugin';
|
|
59
|
+
import { getPluginState as getFlexiResizingPlugin } from './pm-plugins/table-resizing/plugin-factory';
|
|
60
|
+
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing/plugin-key';
|
|
67
61
|
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
68
62
|
import {
|
|
69
63
|
createPlugin as createTableWidthPlugin,
|
|
70
64
|
pluginKey as tableWidthPluginKey,
|
|
71
65
|
} from './pm-plugins/table-width';
|
|
72
66
|
import { createPlugin as createTableWidthInCommentFixPlugin } from './pm-plugins/table-width-in-comment-fix';
|
|
73
|
-
import { createTableWithWidth } from './pm-plugins/utils';
|
|
67
|
+
import { createTableWithWidth } from './pm-plugins/utils/create';
|
|
74
68
|
import { createPlugin as createViewModeSortPlugin } from './pm-plugins/view-mode-sort';
|
|
75
69
|
import type { TablePlugin, TablePluginOptions } from './tablePluginType';
|
|
76
70
|
import type { ColumnResizingPluginState } from './types';
|
|
@@ -78,6 +72,8 @@ import FloatingContextualButton from './ui/FloatingContextualButton';
|
|
|
78
72
|
import FloatingContextualMenu from './ui/FloatingContextualMenu';
|
|
79
73
|
import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
80
74
|
import FloatingDragMenu from './ui/FloatingDragMenu';
|
|
75
|
+
// Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
81
77
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
82
78
|
import { FloatingToolbarLabel } from './ui/FloatingToolbarLabel/FloatingToolbarLabel';
|
|
83
79
|
import { GlobalStylesWrapper } from './ui/global-styles';
|
|
@@ -559,6 +555,8 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
559
555
|
isDragAndDropEnabled,
|
|
560
556
|
tableWrapperTarget,
|
|
561
557
|
isCellMenuOpenByKeyboard,
|
|
558
|
+
// Ignored via go/ees005
|
|
559
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
562
560
|
} = tablePluginState!;
|
|
563
561
|
|
|
564
562
|
const { allowControls } = pluginConfig;
|
package/src/tablePluginType.ts
CHANGED
|
@@ -40,10 +40,20 @@ type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
|
40
40
|
type MediaPlugin = NextEditorPlugin<
|
|
41
41
|
'media',
|
|
42
42
|
{
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
45
|
pluginConfiguration: any;
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
48
|
dependencies: any;
|
|
49
|
+
// Ignored via go/ees005
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
51
|
sharedState: any;
|
|
52
|
+
// Ignored via go/ees005
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
54
|
actions: any;
|
|
55
|
+
// Ignored via go/ees005
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
57
|
commands: any;
|
|
48
58
|
}
|
|
49
59
|
>;
|
|
@@ -51,6 +51,8 @@ export const ColumnResizeWidget = ({ startIndex, endIndex, includeTooltip }: Pro
|
|
|
51
51
|
className={TableCssClassName.RESIZE_HANDLE_DECORATION}
|
|
52
52
|
data-start-index={startIndex}
|
|
53
53
|
data-end-index={endIndex}
|
|
54
|
+
// Ignored via go/ees005
|
|
55
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
54
56
|
{...tooltipProps}
|
|
55
57
|
/>
|
|
56
58
|
)}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { DragHandleDisabledIcon
|
|
3
|
+
import { DragHandleDisabledIcon } from '../icons/DragHandleDisabledIcon';
|
|
4
|
+
import { DragHandleIcon } from '../icons/DragHandleIcon';
|
|
5
|
+
import { MinimisedHandleIcon } from '../icons/MinimisedHandle';
|
|
4
6
|
|
|
5
7
|
type HandleIconProps = {
|
|
6
8
|
forceDefaultHandle: boolean;
|
|
@@ -18,7 +18,10 @@ import { token } from '@atlaskit/tokens';
|
|
|
18
18
|
import { getPluginState as getDnDPluginState } from '../../pm-plugins/drag-and-drop/plugin-factory';
|
|
19
19
|
import type { TriggerType } from '../../pm-plugins/drag-and-drop/types';
|
|
20
20
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
findDuplicatePosition,
|
|
23
|
+
hasMergedCellsInSelection,
|
|
24
|
+
} from '../../pm-plugins/utils/merged-cells';
|
|
22
25
|
import { TableCssClassName as ClassName } from '../../types';
|
|
23
26
|
import type { CellHoverMeta, TableDirection } from '../../types';
|
|
24
27
|
import { dragTableInsertColumnButtonSize } from '../consts';
|
|
@@ -262,11 +265,17 @@ const DragHandleComponent = ({
|
|
|
262
265
|
{appearance !== 'placeholder' ? (
|
|
263
266
|
// cannot block pointer events in Firefox as it breaks Dragging functionality
|
|
264
267
|
browser.gecko ? (
|
|
268
|
+
// Ignored via go/ees005
|
|
269
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
265
270
|
<HandleIconComponent {...handleIconProps} />
|
|
266
271
|
) : (
|
|
267
272
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
268
273
|
<span style={{ pointerEvents: 'none' }}>
|
|
269
|
-
<HandleIconComponent
|
|
274
|
+
<HandleIconComponent
|
|
275
|
+
// Ignored via go/ees005
|
|
276
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
277
|
+
{...handleIconProps}
|
|
278
|
+
/>
|
|
270
279
|
</span>
|
|
271
280
|
)
|
|
272
281
|
) : null}
|