@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
|
@@ -9,13 +9,13 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
11
|
import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
|
|
12
|
-
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop';
|
|
12
|
+
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop/plugin-key';
|
|
13
13
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
14
14
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
15
|
-
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
16
|
-
import { generateColgroup } from '../pm-plugins/table-resizing/utils';
|
|
15
|
+
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing/plugin-key';
|
|
16
|
+
import { generateColgroup } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
17
17
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
18
|
-
import { isTableNested } from '../pm-plugins/utils';
|
|
18
|
+
import { isTableNested } from '../pm-plugins/utils/nodes';
|
|
19
19
|
import TableComponent from './TableComponent';
|
|
20
20
|
import { TableComponentWithSharedState } from './TableComponentWithSharedState';
|
|
21
21
|
const tableAttributes = node => {
|
|
@@ -28,7 +28,10 @@ const tableAttributes = node => {
|
|
|
28
28
|
'data-table-display-mode': node.attrs.displayMode
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
const getInlineWidth = (node, options, state, pos, allowTableResizing
|
|
31
|
+
const getInlineWidth = (node, options, state, pos, allowTableResizing
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
34
|
+
) => {
|
|
32
35
|
if (!node.attrs.width && options !== null && options !== void 0 && options.isCommentEditor && allowTableResizing) {
|
|
33
36
|
return;
|
|
34
37
|
}
|
|
@@ -89,6 +92,8 @@ export default class TableView extends ReactNodeView {
|
|
|
89
92
|
}
|
|
90
93
|
const attrs = tableAttributes(node);
|
|
91
94
|
Object.keys(attrs).forEach(attr => {
|
|
95
|
+
// Ignored via go/ees005
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
92
97
|
this.table.setAttribute(attr, attrs[attr]);
|
|
93
98
|
});
|
|
94
99
|
|
|
@@ -128,6 +133,8 @@ export default class TableView extends ReactNodeView {
|
|
|
128
133
|
const fakePluginKey = {
|
|
129
134
|
key: 'widthPlugin$',
|
|
130
135
|
getState: state => {
|
|
136
|
+
// Ignored via go/ees005
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
138
|
return state['widthPlugin$'];
|
|
132
139
|
}
|
|
133
140
|
};
|
|
@@ -138,6 +145,8 @@ export default class TableView extends ReactNodeView {
|
|
|
138
145
|
const fakeMediaPluginKey = {
|
|
139
146
|
key: 'mediaPlugin$',
|
|
140
147
|
getState: state => {
|
|
148
|
+
// Ignored via go/ees005
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
141
150
|
return state['mediaPlugin$'];
|
|
142
151
|
}
|
|
143
152
|
};
|
|
@@ -174,6 +183,9 @@ export default class TableView extends ReactNodeView {
|
|
|
174
183
|
} catch (e) {
|
|
175
184
|
tablePos = undefined;
|
|
176
185
|
}
|
|
186
|
+
|
|
187
|
+
// Ignored via go/ees005
|
|
188
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
177
189
|
const tableActive = tablePos === pluginState.tablePos && !isTableResizing;
|
|
178
190
|
return /*#__PURE__*/React.createElement(TableComponent, {
|
|
179
191
|
view: props.view,
|
|
@@ -181,19 +193,39 @@ export default class TableView extends ReactNodeView {
|
|
|
181
193
|
eventDispatcher: props.eventDispatcher,
|
|
182
194
|
getPos: props.getPos,
|
|
183
195
|
isMediaFullscreen: mediaState === null || mediaState === void 0 ? void 0 : mediaState.isFullscreen,
|
|
184
|
-
options: props.options
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
196
|
+
options: props.options
|
|
197
|
+
// Ignored via go/ees005
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
199
|
+
// Ignored via go/ees005
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
201
|
+
,
|
|
202
|
+
allowControls: pluginState.pluginConfig.allowControls
|
|
203
|
+
// Ignored via go/ees005
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
205
|
+
,
|
|
206
|
+
isHeaderRowEnabled: pluginState.isHeaderRowEnabled
|
|
207
|
+
// Ignored via go/ees005
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
209
|
+
,
|
|
210
|
+
isHeaderColumnEnabled: pluginState.isHeaderColumnEnabled
|
|
211
|
+
// Ignored via go/ees005
|
|
212
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
213
|
+
,
|
|
188
214
|
isDragAndDropEnabled: pluginState.isDragAndDropEnabled,
|
|
189
215
|
isTableScalingEnabled: (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.isTableScalingEnabled // this.options?.isTableScalingEnabled same as TableOptions.isTableScalingEnabled same as pluginState.isTableScalingEnabled
|
|
190
216
|
,
|
|
191
217
|
allowTableAlignment: props.allowTableAlignment,
|
|
192
218
|
allowTableResizing: props.allowTableResizing,
|
|
193
|
-
tableActive: tableActive
|
|
219
|
+
tableActive: tableActive
|
|
220
|
+
// Ignored via go/ees005
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
222
|
+
,
|
|
194
223
|
ordering: pluginState.ordering,
|
|
195
224
|
isResizing: isResizing,
|
|
196
|
-
getNode: this.getNode
|
|
225
|
+
getNode: this.getNode
|
|
226
|
+
// Ignored via go/ees005
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
228
|
+
,
|
|
197
229
|
containerWidth: containerWidth,
|
|
198
230
|
contentDOM: forwardRef,
|
|
199
231
|
getEditorFeatureFlags: props.getEditorFeatureFlags,
|
|
@@ -262,7 +294,10 @@ export default class TableView extends ReactNodeView {
|
|
|
262
294
|
super.destroy();
|
|
263
295
|
}
|
|
264
296
|
}
|
|
265
|
-
export const createTableView = (node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor
|
|
297
|
+
export const createTableView = (node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor
|
|
298
|
+
// Ignored via go/ees005
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
300
|
+
) => {
|
|
266
301
|
var _pluginInjectionApi$t;
|
|
267
302
|
const {
|
|
268
303
|
pluginConfig,
|
|
@@ -6,13 +6,19 @@ export const clearMultipleCells = targetCellPosition => (state, dispatch) => {
|
|
|
6
6
|
tr
|
|
7
7
|
} = state;
|
|
8
8
|
if (isSelectionType(tr.selection, 'cell')) {
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
11
|
const selection = tr.selection;
|
|
10
12
|
selection.forEachCell((_node, pos) => {
|
|
11
13
|
const $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
12
16
|
tr = emptyCell(findCellClosestToPos($pos), state.schema)(tr);
|
|
13
17
|
});
|
|
14
18
|
cursorPos = selection.$headCell.pos;
|
|
15
19
|
} else if (targetCellPosition) {
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
22
|
const cell = findCellClosestToPos(tr.doc.resolve(targetCellPosition + 1));
|
|
17
23
|
tr = emptyCell(cell, state.schema)(tr);
|
|
18
24
|
cursorPos = cell.pos;
|
|
@@ -4,18 +4,24 @@ import { TableMap } from '@atlaskit/editor-tables';
|
|
|
4
4
|
import { findCellClosestToPos, findCellRectClosestToPos, findTableClosestToPos, getSelectionRect, isSelectionType, nextCell } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { TableDecorations } from '../../types';
|
|
6
6
|
import { getDecorations } from '../decorations/plugin';
|
|
7
|
-
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils';
|
|
7
|
+
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils/column-resizing';
|
|
8
8
|
import { createCommand, getPluginState } from '../plugin-factory';
|
|
9
9
|
import { getPluginState as getTableResizingPluginState, createCommand as tableResizingPluginCreateCommand } from '../table-resizing/plugin-factory';
|
|
10
10
|
import { pluginKey as tableResizingPK } from '../table-resizing/plugin-key';
|
|
11
|
-
import {
|
|
12
|
-
import { getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '../table-resizing/utils/misc';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { updateControls } from '../table-resizing/utils/dom';
|
|
12
|
+
import { currentColWidth, getTableMaxWidth, getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '../table-resizing/utils/misc';
|
|
13
|
+
import { resizeColumn } from '../table-resizing/utils/resize-column';
|
|
14
|
+
import { getResizeState } from '../table-resizing/utils/resize-state';
|
|
15
|
+
import { updateColumnWidths } from '../transforms/column-width';
|
|
16
|
+
import { createColumnLineResize, updateDecorations } from '../utils/decoration';
|
|
17
|
+
import { getSelectedColumnIndexes } from '../utils/selection';
|
|
15
18
|
const getTablePluginCommand = (actionPayload, originalTr) => {
|
|
16
19
|
return createCommand(() => actionPayload, tr => (originalTr || tr).setMeta('addToHistory', false));
|
|
17
20
|
};
|
|
18
|
-
const updateResizeHandleAndStatePosition = (rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI
|
|
21
|
+
const updateResizeHandleAndStatePosition = (rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
24
|
+
) => (state, dispatch) => {
|
|
19
25
|
let customTr = state.tr;
|
|
20
26
|
const {
|
|
21
27
|
pluginConfig: {
|
|
@@ -67,7 +73,10 @@ export const initiateKeyboardColumnResizing = ({
|
|
|
67
73
|
const {
|
|
68
74
|
selection
|
|
69
75
|
} = state;
|
|
70
|
-
const selectionRect = isSelectionType(selection, 'cell') ?
|
|
76
|
+
const selectionRect = isSelectionType(selection, 'cell') ?
|
|
77
|
+
// Ignored via go/ees005
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
79
|
+
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
71
80
|
const cell = findCellClosestToPos(selection.$from);
|
|
72
81
|
if (ariaNotify && getIntl) {
|
|
73
82
|
ariaNotify(getIntl().formatMessage(messages.startedColumnResize), {
|
|
@@ -6,9 +6,10 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
6
6
|
import { findCellClosestToPos, findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
7
7
|
import { getPluginState } from '../plugin-factory';
|
|
8
8
|
import { distributeColumnsWidths } from '../table-resizing/commands';
|
|
9
|
-
import { deleteRows
|
|
10
|
-
import {
|
|
11
|
-
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
9
|
+
import { deleteRows } from '../transforms/delete-rows';
|
|
10
|
+
import { mergeCells } from '../transforms/merge';
|
|
11
|
+
import { withEditorAnalyticsAPI, getSelectedCellInfo, getSelectedTableInfo } from '../utils/analytics';
|
|
12
|
+
import { checkIfNumberColumnEnabled } from '../utils/nodes';
|
|
12
13
|
import { clearMultipleCells } from './clear';
|
|
13
14
|
import { wrapTableInExpand } from './collapse';
|
|
14
15
|
import { changeColumnWidthByStep } from './column-resize';
|
|
@@ -166,7 +167,10 @@ export const insertRowWithAnalytics = editorAnalyticsAPI => (inputMethod, option
|
|
|
166
167
|
eventType: EVENT_TYPE.TRACK
|
|
167
168
|
};
|
|
168
169
|
})(editorAnalyticsAPI)(insertRow(options.index, options.moveCursorToInsertedRow));
|
|
169
|
-
export const changeColumnWidthByStepWithAnalytics = (editorAnalyticsAPI, api) => (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl
|
|
170
|
+
export const changeColumnWidthByStepWithAnalytics = (editorAnalyticsAPI, api) => (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl
|
|
171
|
+
// Ignored via go/ees005
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
173
|
+
) => withEditorAnalyticsAPI(state => {
|
|
170
174
|
const {
|
|
171
175
|
table,
|
|
172
176
|
totalRowCount,
|
|
@@ -201,7 +205,10 @@ export const changeColumnWidthByStepWithAnalytics = (editorAnalyticsAPI, api) =>
|
|
|
201
205
|
getIntl: getIntl,
|
|
202
206
|
api
|
|
203
207
|
}));
|
|
204
|
-
export const insertColumnWithAnalytics = (api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
208
|
+
export const insertColumnWithAnalytics = (api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
209
|
+
// Ignored via go/ees005
|
|
210
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
211
|
+
) => (inputMethod, position) => withEditorAnalyticsAPI(state => {
|
|
205
212
|
const {
|
|
206
213
|
totalRowCount,
|
|
207
214
|
totalColumnCount
|
|
@@ -245,7 +252,10 @@ export const deleteRowsWithAnalytics = editorAnalyticsAPI => (inputMethod, rect,
|
|
|
245
252
|
}
|
|
246
253
|
return true;
|
|
247
254
|
});
|
|
248
|
-
export const deleteColumnsWithAnalytics = (editorAnalyticsAPI, api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
255
|
+
export const deleteColumnsWithAnalytics = (editorAnalyticsAPI, api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
256
|
+
// Ignored via go/ees005
|
|
257
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
258
|
+
) => (inputMethod, rect) => withEditorAnalyticsAPI(({
|
|
249
259
|
selection
|
|
250
260
|
}) => {
|
|
251
261
|
const {
|
|
@@ -266,7 +276,10 @@ export const deleteColumnsWithAnalytics = (editorAnalyticsAPI, api, isTableScali
|
|
|
266
276
|
eventType: EVENT_TYPE.TRACK
|
|
267
277
|
};
|
|
268
278
|
})(editorAnalyticsAPI)(deleteColumnsCommand(rect, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor));
|
|
269
|
-
export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = (editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent
|
|
279
|
+
export const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = (editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent
|
|
280
|
+
// Ignored via go/ees005
|
|
281
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
282
|
+
) => (state, dispatch) => {
|
|
270
283
|
const {
|
|
271
284
|
selection
|
|
272
285
|
} = state;
|
|
@@ -464,7 +477,10 @@ export const toggleFixedColumnWidthsOptionAnalytics = (editorAnalyticsAPI, input
|
|
|
464
477
|
eventType: EVENT_TYPE.TRACK
|
|
465
478
|
};
|
|
466
479
|
})(editorAnalyticsAPI)(editorCommandToPMCommand(setTableDisplayMode));
|
|
467
|
-
export const setTableAlignmentWithAnalytics = (editorAnalyticsAPI, isCommentEditor) => (newAlignment, previousAlignment, inputMethod, reason
|
|
480
|
+
export const setTableAlignmentWithAnalytics = (editorAnalyticsAPI, isCommentEditor) => (newAlignment, previousAlignment, inputMethod, reason
|
|
481
|
+
// Ignored via go/ees005
|
|
482
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
483
|
+
) => withEditorAnalyticsAPI(state => {
|
|
468
484
|
const {
|
|
469
485
|
table,
|
|
470
486
|
totalRowCount,
|
|
@@ -486,7 +502,10 @@ export const setTableAlignmentWithAnalytics = (editorAnalyticsAPI, isCommentEdit
|
|
|
486
502
|
}
|
|
487
503
|
};
|
|
488
504
|
})(editorAnalyticsAPI)(editorCommandToPMCommand(setTableAlignment(newAlignment, isCommentEditor)));
|
|
489
|
-
export const setTableAlignmentWithTableContentWithPosWithAnalytics = editorAnalyticsAPI => (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason
|
|
505
|
+
export const setTableAlignmentWithTableContentWithPosWithAnalytics = editorAnalyticsAPI => (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason
|
|
506
|
+
// Ignored via go/ees005
|
|
507
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
508
|
+
) => withEditorAnalyticsAPI(() => {
|
|
490
509
|
const map = TableMap.get(tableNodeWithPos.node);
|
|
491
510
|
const totalRowCount = map.height;
|
|
492
511
|
const totalColumnCount = map.width;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { deleteColumns } from '../transforms/delete-columns';
|
|
2
2
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
3
|
-
export const deleteColumnsCommand = (rect, api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
3
|
+
export const deleteColumnsCommand = (rect, api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
4
|
+
// Ignored via go/ees005
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
6
|
+
) => (state, dispatch, view) => {
|
|
4
7
|
const tr = deleteColumns(rect, getAllowAddColumnCustomStep(state), api, view, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(state.tr);
|
|
5
8
|
if (dispatch) {
|
|
6
9
|
dispatch(tr);
|
|
@@ -28,6 +28,8 @@ export const goToNextCell = (editorAnalyticsAPI, ariaNotify, getIntl) => directi
|
|
|
28
28
|
tableCell,
|
|
29
29
|
tableHeader
|
|
30
30
|
} = state.schema.nodes;
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
31
33
|
const cell = findParentNodeOfType([tableCell, tableHeader])(state.selection);
|
|
32
34
|
const firstCellPos = map.positionAt(0, 0, table.node) + table.start;
|
|
33
35
|
const lastCellPos = map.positionAt(map.height - 1, map.width - 1, table.node) + table.start;
|
|
@@ -3,7 +3,9 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
3
3
|
import { findTable, getCellsInColumn, getCellsInRow } from '@atlaskit/editor-tables/utils';
|
|
4
4
|
import { TableDecorations } from '../../types';
|
|
5
5
|
import { createCommand, getPluginState } from '../plugin-factory';
|
|
6
|
-
import { createCellHoverDecoration, createColumnLineResize, createControlsHoverDecoration
|
|
6
|
+
import { createCellHoverDecoration, createColumnLineResize, createControlsHoverDecoration } from '../utils/decoration';
|
|
7
|
+
import { getMergedCellsPositions } from '../utils/table';
|
|
8
|
+
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations';
|
|
7
9
|
const makeArray = n => Array.from(Array(n).keys());
|
|
8
10
|
export const hoverMergedCells = () => createCommand(state => {
|
|
9
11
|
const mergedCellsPositions = getMergedCellsPositions(state.tr);
|
|
@@ -17,6 +19,8 @@ export const hoverMergedCells = () => createCommand(state => {
|
|
|
17
19
|
const mergedCells = mergedCellsPositions.map(pos => ({
|
|
18
20
|
pos: pos + table.start,
|
|
19
21
|
start: pos + table.start + 1,
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
24
|
node: table.node.nodeAt(pos)
|
|
21
25
|
}));
|
|
22
26
|
const decorations = createCellHoverDecoration(mergedCells);
|
|
@@ -11,8 +11,10 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
11
11
|
import { updateRowOrColumnMovedTransform } from '../analytics/commands';
|
|
12
12
|
import { META_KEYS } from '../table-analytics';
|
|
13
13
|
import { rescaleColumns } from '../transforms/column-width';
|
|
14
|
-
import {
|
|
14
|
+
import { createTableWithWidth } from '../utils/create';
|
|
15
15
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
16
|
+
import { checkIfHeaderRowEnabled } from '../utils/nodes';
|
|
17
|
+
import { copyPreviousRow } from '../utils/row-controls';
|
|
16
18
|
function addColumnAtCustomStep(column) {
|
|
17
19
|
return tr => {
|
|
18
20
|
const table = findTable(tr.selection);
|
|
@@ -22,6 +24,9 @@ function addColumnAtCustomStep(column) {
|
|
|
22
24
|
return tr;
|
|
23
25
|
};
|
|
24
26
|
}
|
|
27
|
+
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
25
30
|
export function addColumnAt(api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor) {
|
|
26
31
|
return (column, allowAddColumnCustomStep = false, view) => {
|
|
27
32
|
return tr => {
|
|
@@ -51,7 +56,10 @@ export function addColumnAt(api, isTableScalingEnabled = false, isTableFixedColu
|
|
|
51
56
|
|
|
52
57
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
53
58
|
// Command to add a column before the column with the selection.
|
|
54
|
-
export const addColumnBefore = (api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
59
|
+
export const addColumnBefore = (api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
60
|
+
// Ignored via go/ees005
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
62
|
+
) => (state, dispatch, view) => {
|
|
55
63
|
const table = findTable(state.selection);
|
|
56
64
|
if (!table) {
|
|
57
65
|
return false;
|
|
@@ -65,7 +73,10 @@ export const addColumnBefore = (api, isTableScalingEnabled = false, isTableFixed
|
|
|
65
73
|
|
|
66
74
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
67
75
|
// Command to add a column after the column with the selection.
|
|
68
|
-
export const addColumnAfter = (api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
76
|
+
export const addColumnAfter = (api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
77
|
+
// Ignored via go/ees005
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
79
|
+
) => (state, dispatch, view) => {
|
|
69
80
|
const table = findTable(state.selection);
|
|
70
81
|
if (!table) {
|
|
71
82
|
return false;
|
|
@@ -76,7 +87,10 @@ export const addColumnAfter = (api, isTableScalingEnabled, isTableFixedColumnWid
|
|
|
76
87
|
}
|
|
77
88
|
return true;
|
|
78
89
|
};
|
|
79
|
-
export const insertColumn = (api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
90
|
+
export const insertColumn = (api, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
91
|
+
// Ignored via go/ees005
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
93
|
+
) => column => (state, dispatch, view) => {
|
|
80
94
|
let tr = addColumnAt(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(column, getAllowAddColumnCustomStep(state), view)(state.tr);
|
|
81
95
|
const table = findTable(tr.selection);
|
|
82
96
|
if (!table) {
|
|
@@ -128,7 +142,10 @@ export const insertRow = (row, moveCursorToTheNewRow) => (state, dispatch) => {
|
|
|
128
142
|
* @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
|
|
129
143
|
* (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
|
|
130
144
|
*/
|
|
131
|
-
export const createTable = (isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled
|
|
145
|
+
export const createTable = (isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled
|
|
146
|
+
// Ignored via go/ees005
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
148
|
+
) => (state, dispatch) => {
|
|
132
149
|
const table = createTableWithWidth({
|
|
133
150
|
isTableScalingEnabled,
|
|
134
151
|
isTableAlignmentEnabled,
|
|
@@ -160,7 +177,10 @@ export const createTable = (isTableScalingEnabled, isTableAlignmentEnabled, isFu
|
|
|
160
177
|
* @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
|
|
161
178
|
* (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
|
|
162
179
|
*/
|
|
163
|
-
export const insertTableWithSize = (isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor
|
|
180
|
+
export const insertTableWithSize = (isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor
|
|
181
|
+
// Ignored via go/ees005
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
183
|
+
) => (rowsCount, colsCount, inputMethod) => {
|
|
164
184
|
return ({
|
|
165
185
|
tr
|
|
166
186
|
}) => {
|
|
@@ -7,9 +7,9 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
7
7
|
import { findCellClosestToPos, findTable, getCellsInColumn, getCellsInRow, getSelectionRect, isSelectionType, isTableSelected, removeTable, selectColumns as selectColumnsTransform, selectColumn as selectColumnTransform, selectionCell, selectRows as selectRowsTransform, selectRow as selectRowTransform, setCellAttrs } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { TableCssClassName as ClassName, TableDecorations } from '../../types';
|
|
9
9
|
import { getDecorations } from '../decorations/plugin';
|
|
10
|
-
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils';
|
|
10
|
+
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils/column-resizing';
|
|
11
11
|
import { createCommand, getPluginState } from '../plugin-factory';
|
|
12
|
-
import { fixAutoSizedTable } from '../transforms';
|
|
12
|
+
import { fixAutoSizedTable } from '../transforms/fix-tables';
|
|
13
13
|
import { createColumnControlsDecoration, createColumnSelectedDecoration } from '../utils/decoration';
|
|
14
14
|
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isIsolating } from '../utils/nodes';
|
|
15
15
|
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations';
|
|
@@ -218,6 +218,9 @@ export const isInsideFirstCellOfRowOrColumn = (selection, type) => {
|
|
|
218
218
|
if (!table || !type) {
|
|
219
219
|
return false;
|
|
220
220
|
}
|
|
221
|
+
|
|
222
|
+
// Ignored via go/ees005
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
221
224
|
const map = TableMap.get(table.node);
|
|
222
225
|
const cell = findCellClosestToPos(selection.$anchor);
|
|
223
226
|
if (!cell) {
|
|
@@ -241,6 +244,8 @@ export const deleteTableIfSelected = (state, dispatch) => {
|
|
|
241
244
|
return false;
|
|
242
245
|
};
|
|
243
246
|
export const convertFirstRowToHeader = schema => tr => {
|
|
247
|
+
// Ignored via go/ees005
|
|
248
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
244
249
|
const table = findTable(tr.selection);
|
|
245
250
|
const map = TableMap.get(table.node);
|
|
246
251
|
for (let i = 0; i < map.width; i++) {
|
|
@@ -325,13 +330,19 @@ export const setMultipleCellAttrs = (attrs, editorView) => (state, dispatch) =>
|
|
|
325
330
|
targetCellPosition
|
|
326
331
|
} = getPluginState(state);
|
|
327
332
|
if (isSelectionType(tr.selection, 'cell')) {
|
|
333
|
+
// Ignored via go/ees005
|
|
334
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
328
335
|
const selection = tr.selection;
|
|
329
336
|
selection.forEachCell((_cell, pos) => {
|
|
330
337
|
const $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
338
|
+
// Ignored via go/ees005
|
|
339
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
331
340
|
tr = setCellAttrs(findCellClosestToPos($pos), attrs)(tr);
|
|
332
341
|
});
|
|
333
342
|
cursorPos = selection.$headCell.pos;
|
|
334
343
|
} else if (targetCellPosition) {
|
|
344
|
+
// Ignored via go/ees005
|
|
345
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
335
346
|
const cell = findCellClosestToPos(tr.doc.resolve(targetCellPosition + 1));
|
|
336
347
|
tr = setCellAttrs(cell, attrs)(tr);
|
|
337
348
|
cursorPos = cell.pos;
|
|
@@ -437,7 +448,10 @@ export const showInsertRowButton = rowIndex => createCommand(_ => rowIndex > -1
|
|
|
437
448
|
export const hideInsertColumnOrRowButton = () => createCommand({
|
|
438
449
|
type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON'
|
|
439
450
|
}, tr => tr.setMeta('addToHistory', false));
|
|
440
|
-
export const addResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize
|
|
451
|
+
export const addResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize
|
|
452
|
+
// Ignored via go/ees005
|
|
453
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
454
|
+
) => createCommand(state => {
|
|
441
455
|
const tableNode = findTable(state.selection);
|
|
442
456
|
const {
|
|
443
457
|
pluginConfig: {
|
|
@@ -462,7 +476,10 @@ export const addResizeHandleDecorations = (rowIndex, columnIndex, includeTooltip
|
|
|
462
476
|
}
|
|
463
477
|
};
|
|
464
478
|
}, tr => tr.setMeta('addToHistory', false));
|
|
465
|
-
export const updateResizeHandleDecorations = (nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip
|
|
479
|
+
export const updateResizeHandleDecorations = (nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip
|
|
480
|
+
// Ignored via go/ees005
|
|
481
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
482
|
+
) => createCommand(state => {
|
|
466
483
|
const tableNode = findTable(state.selection);
|
|
467
484
|
const {
|
|
468
485
|
resizeHandleRowIndex,
|
|
@@ -504,7 +521,10 @@ export const removeResizeHandleDecorations = () => createCommand(state => ({
|
|
|
504
521
|
})
|
|
505
522
|
}
|
|
506
523
|
}), tr => tr.setMeta('addToHistory', false));
|
|
507
|
-
export const autoSizeTable = (view, node, table, basePos, opts
|
|
524
|
+
export const autoSizeTable = (view, node, table, basePos, opts
|
|
525
|
+
// Ignored via go/ees005
|
|
526
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
527
|
+
) => {
|
|
508
528
|
if (typeof basePos !== 'number') {
|
|
509
529
|
return false;
|
|
510
530
|
}
|
|
@@ -265,9 +265,13 @@ const selectFullTable = editorSelectionAPI => ({
|
|
|
265
265
|
let fullTableSelection;
|
|
266
266
|
let selectionRelativeToNode;
|
|
267
267
|
if (dir === TableSelectionDirection.TopToBottom) {
|
|
268
|
+
// Ignored via go/ees005
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
268
270
|
fullTableSelection = new CellSelection($firstCell, $lastCell);
|
|
269
271
|
selectionRelativeToNode = RelativeSelectionPos.End;
|
|
270
272
|
} else {
|
|
273
|
+
// Ignored via go/ees005
|
|
274
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
271
275
|
fullTableSelection = new CellSelection($lastCell, $firstCell);
|
|
272
276
|
selectionRelativeToNode = RelativeSelectionPos.Start;
|
|
273
277
|
}
|
|
@@ -8,7 +8,11 @@ const createGetInlineCardTextFromStore = attrs => {
|
|
|
8
8
|
const {
|
|
9
9
|
data
|
|
10
10
|
} = attrs;
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
13
|
if (data && (data.name || data.title)) {
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
16
|
return data.name || data.title;
|
|
13
17
|
}
|
|
14
18
|
const {
|
|
@@ -25,11 +29,16 @@ export const sortByColumn = (columnIndex, order = SortOrder.DESC) => createComma
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
}), (tr, state) => {
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
34
|
const table = findTable(tr.selection);
|
|
29
35
|
if (!table || !table.node) {
|
|
30
36
|
return tr;
|
|
31
37
|
}
|
|
32
|
-
const selectionRect = isSelectionType(tr.selection, 'cell') ?
|
|
38
|
+
const selectionRect = isSelectionType(tr.selection, 'cell') ?
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
41
|
+
getSelectionRect(tr.selection) : findCellRectClosestToPos(tr.selection.$from);
|
|
33
42
|
if (!selectionRect) {
|
|
34
43
|
return tr;
|
|
35
44
|
}
|
|
@@ -4,10 +4,13 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
5
|
import { pluginKey as tablePluginKey } from '../plugin-key';
|
|
6
6
|
import { pluginKey as tableWidthPluginKey } from '../table-width';
|
|
7
|
-
import { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration } from './utils';
|
|
7
|
+
import { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration } from './utils/column-controls';
|
|
8
8
|
export const pluginKey = new PluginKey('tableDecorationsPlugin');
|
|
9
9
|
export const getDecorations = state => pluginKey.getState(state);
|
|
10
|
-
export const handleDocOrSelectionChanged = (tr, decorationSet, oldState, newState
|
|
10
|
+
export const handleDocOrSelectionChanged = (tr, decorationSet, oldState, newState
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
13
|
+
) => {
|
|
11
14
|
var _tableWidthPluginKey$, _tableWidthPluginKey$2;
|
|
12
15
|
const isResizing = (_tableWidthPluginKey$ = tableWidthPluginKey.getState(newState)) === null || _tableWidthPluginKey$ === void 0 ? void 0 : _tableWidthPluginKey$.resizing;
|
|
13
16
|
const wasResizing = (_tableWidthPluginKey$2 = tableWidthPluginKey.getState(oldState)) === null || _tableWidthPluginKey$2 === void 0 ? void 0 : _tableWidthPluginKey$2.resizing;
|
|
@@ -42,6 +45,8 @@ export const createPlugin = () => {
|
|
|
42
45
|
return new SafePlugin({
|
|
43
46
|
state: {
|
|
44
47
|
init: () => DecorationSet.empty,
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
50
|
apply: (tr, decorationSet, oldState, newState) => {
|
|
46
51
|
let pluginState = decorationSet;
|
|
47
52
|
// main table plugin --->
|
|
@@ -10,7 +10,10 @@ const updateLastCellElement = lastCellElementsDecorations => ({
|
|
|
10
10
|
decorationSet,
|
|
11
11
|
tr
|
|
12
12
|
}) => updateDecorations(tr.doc, decorationSet, lastCellElementsDecorations, TableDecorations.LAST_CELL_ELEMENT);
|
|
13
|
-
export const buildColumnResizingDecorations = (rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI
|
|
13
|
+
export const buildColumnResizingDecorations = (rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
16
|
+
) => ({
|
|
14
17
|
tr,
|
|
15
18
|
decorationSet
|
|
16
19
|
}) => {
|
|
@@ -2,11 +2,14 @@ import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_STATUS }
|
|
|
2
2
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
4
|
import { findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import {
|
|
6
|
-
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
5
|
+
import { getSelectedTableInfo, withEditorAnalyticsAPI } from '../utils/analytics';
|
|
7
6
|
import { canMove, getTargetIndex } from '../utils/drag-menu';
|
|
7
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../utils/selection';
|
|
8
8
|
import { clearDropTarget, cloneSource, moveSource } from './commands';
|
|
9
|
-
export const clearDropTargetWithAnalytics = editorAnalyticsAPI => (inputMethod, sourceType, sourceIndexes, status, tr
|
|
9
|
+
export const clearDropTargetWithAnalytics = editorAnalyticsAPI => (inputMethod, sourceType, sourceIndexes, status, tr
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
12
|
+
) => {
|
|
10
13
|
return withEditorAnalyticsAPI(({
|
|
11
14
|
selection
|
|
12
15
|
}) => {
|
|
@@ -36,7 +39,10 @@ export const clearDropTargetWithAnalytics = editorAnalyticsAPI => (inputMethod,
|
|
|
36
39
|
return true;
|
|
37
40
|
});
|
|
38
41
|
};
|
|
39
|
-
export const moveSourceWithAnalytics = (editorAnalyticsAPI, ariaNotify, getIntl) => (inputMethod, sourceType, sourceIndexes, targetIndex, tr
|
|
42
|
+
export const moveSourceWithAnalytics = (editorAnalyticsAPI, ariaNotify, getIntl) => (inputMethod, sourceType, sourceIndexes, targetIndex, tr
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
|
+
) => {
|
|
40
46
|
return withEditorAnalyticsAPI(({
|
|
41
47
|
selection
|
|
42
48
|
}) => {
|
|
@@ -107,7 +113,10 @@ export const moveSourceWithAnalyticsViaShortcut = (editorAnalyticsAPI, ariaNotif
|
|
|
107
113
|
const targetIndex = getTargetIndex(selectedIndexes, direction);
|
|
108
114
|
return moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotify, getIntl)(INPUT_METHOD.SHORTCUT, sourceType, selectedIndexes, targetIndex)(state, dispatch);
|
|
109
115
|
};
|
|
110
|
-
export const cloneSourceWithAnalytics = editorAnalyticsAPI => (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
116
|
+
export const cloneSourceWithAnalytics = editorAnalyticsAPI => (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
117
|
+
// Ignored via go/ees005
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
119
|
+
) => {
|
|
111
120
|
return withEditorAnalyticsAPI(({
|
|
112
121
|
selection
|
|
113
122
|
}) => {
|