@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
|
@@ -14,7 +14,10 @@ export var lazyTableView = function lazyTableView(options) {
|
|
|
14
14
|
var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
|
|
15
15
|
'./table').then(function (_ref) {
|
|
16
16
|
var createTableView = _ref.createTableView;
|
|
17
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
17
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
|
+
) {
|
|
18
21
|
var _getNodeViewOptions = getNodeViewOptions(),
|
|
19
22
|
portalProviderAPI = _getNodeViewOptions.portalProviderAPI,
|
|
20
23
|
eventDispatcher = _getNodeViewOptions.eventDispatcher,
|
|
@@ -48,7 +51,10 @@ export var lazyTableCellView = function lazyTableCellView(options) {
|
|
|
48
51
|
var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
|
|
49
52
|
'./TableCell').then(function (_ref2) {
|
|
50
53
|
var TableCell = _ref2.default;
|
|
51
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
54
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
55
|
+
// Ignored via go/ees005
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
57
|
+
) {
|
|
52
58
|
var _pluginInjectionApi$a;
|
|
53
59
|
var _getNodeViewOptions2 = getNodeViewOptions(),
|
|
54
60
|
eventDispatcher = _getNodeViewOptions2.eventDispatcher,
|
|
@@ -77,7 +83,10 @@ export var lazyTableHeaderView = function lazyTableHeaderView(options) {
|
|
|
77
83
|
var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-cell_nodeview" */
|
|
78
84
|
'./TableCell').then(function (_ref3) {
|
|
79
85
|
var TableCell = _ref3.default;
|
|
80
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
86
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
87
|
+
// Ignored via go/ees005
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
89
|
+
) {
|
|
81
90
|
var _pluginInjectionApi$a2;
|
|
82
91
|
var _getNodeViewOptions3 = getNodeViewOptions(),
|
|
83
92
|
eventDispatcher = _getNodeViewOptions3.eventDispatcher,
|
|
@@ -105,7 +114,10 @@ export var lazyTableRowView = function lazyTableRowView(options) {
|
|
|
105
114
|
var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-row_nodeview" */
|
|
106
115
|
'./TableRow').then(function (_ref4) {
|
|
107
116
|
var TableRow = _ref4.default;
|
|
108
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
117
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
118
|
+
// Ignored via go/ees005
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
120
|
+
) {
|
|
109
121
|
var _getNodeViewOptions4 = getNodeViewOptions(),
|
|
110
122
|
eventDispatcher = _getNodeViewOptions4.eventDispatcher;
|
|
111
123
|
return new TableRow(node, view, getPos, eventDispatcher);
|
|
@@ -20,13 +20,13 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
20
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
22
|
import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
|
|
23
|
-
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop';
|
|
23
|
+
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop/plugin-key';
|
|
24
24
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
25
25
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
26
|
-
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
27
|
-
import { generateColgroup } from '../pm-plugins/table-resizing/utils';
|
|
26
|
+
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing/plugin-key';
|
|
27
|
+
import { generateColgroup } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
28
28
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
29
|
-
import { isTableNested } from '../pm-plugins/utils';
|
|
29
|
+
import { isTableNested } from '../pm-plugins/utils/nodes';
|
|
30
30
|
import TableComponent from './TableComponent';
|
|
31
31
|
import { TableComponentWithSharedState } from './TableComponentWithSharedState';
|
|
32
32
|
var tableAttributes = function tableAttributes(node) {
|
|
@@ -39,7 +39,10 @@ var tableAttributes = function tableAttributes(node) {
|
|
|
39
39
|
'data-table-display-mode': node.attrs.displayMode
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
var getInlineWidth = function getInlineWidth(node, options, state, pos, allowTableResizing
|
|
42
|
+
var getInlineWidth = function getInlineWidth(node, options, state, pos, allowTableResizing
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
|
+
) {
|
|
43
46
|
if (!node.attrs.width && options !== null && options !== void 0 && options.isCommentEditor && allowTableResizing) {
|
|
44
47
|
return;
|
|
45
48
|
}
|
|
@@ -111,6 +114,8 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
111
114
|
}
|
|
112
115
|
var attrs = tableAttributes(node);
|
|
113
116
|
Object.keys(attrs).forEach(function (attr) {
|
|
117
|
+
// Ignored via go/ees005
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
119
|
_this2.table.setAttribute(attr, attrs[attr]);
|
|
115
120
|
});
|
|
116
121
|
|
|
@@ -153,6 +158,8 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
153
158
|
var fakePluginKey = {
|
|
154
159
|
key: 'widthPlugin$',
|
|
155
160
|
getState: function getState(state) {
|
|
161
|
+
// Ignored via go/ees005
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
163
|
return state['widthPlugin$'];
|
|
157
164
|
}
|
|
158
165
|
};
|
|
@@ -163,6 +170,8 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
163
170
|
var fakeMediaPluginKey = {
|
|
164
171
|
key: 'mediaPlugin$',
|
|
165
172
|
getState: function getState(state) {
|
|
173
|
+
// Ignored via go/ees005
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
175
|
return state['mediaPlugin$'];
|
|
167
176
|
}
|
|
168
177
|
};
|
|
@@ -197,6 +206,9 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
197
206
|
} catch (e) {
|
|
198
207
|
tablePos = undefined;
|
|
199
208
|
}
|
|
209
|
+
|
|
210
|
+
// Ignored via go/ees005
|
|
211
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
200
212
|
var tableActive = tablePos === pluginState.tablePos && !isTableResizing;
|
|
201
213
|
return /*#__PURE__*/React.createElement(TableComponent, {
|
|
202
214
|
view: props.view,
|
|
@@ -204,19 +216,39 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
204
216
|
eventDispatcher: props.eventDispatcher,
|
|
205
217
|
getPos: props.getPos,
|
|
206
218
|
isMediaFullscreen: mediaState === null || mediaState === void 0 ? void 0 : mediaState.isFullscreen,
|
|
207
|
-
options: props.options
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
219
|
+
options: props.options
|
|
220
|
+
// Ignored via go/ees005
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
222
|
+
// Ignored via go/ees005
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
224
|
+
,
|
|
225
|
+
allowControls: pluginState.pluginConfig.allowControls
|
|
226
|
+
// Ignored via go/ees005
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
228
|
+
,
|
|
229
|
+
isHeaderRowEnabled: pluginState.isHeaderRowEnabled
|
|
230
|
+
// Ignored via go/ees005
|
|
231
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
232
|
+
,
|
|
233
|
+
isHeaderColumnEnabled: pluginState.isHeaderColumnEnabled
|
|
234
|
+
// Ignored via go/ees005
|
|
235
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
236
|
+
,
|
|
211
237
|
isDragAndDropEnabled: pluginState.isDragAndDropEnabled,
|
|
212
238
|
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
|
|
213
239
|
,
|
|
214
240
|
allowTableAlignment: props.allowTableAlignment,
|
|
215
241
|
allowTableResizing: props.allowTableResizing,
|
|
216
|
-
tableActive: tableActive
|
|
242
|
+
tableActive: tableActive
|
|
243
|
+
// Ignored via go/ees005
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
245
|
+
,
|
|
217
246
|
ordering: pluginState.ordering,
|
|
218
247
|
isResizing: isResizing,
|
|
219
|
-
getNode: _this3.getNode
|
|
248
|
+
getNode: _this3.getNode
|
|
249
|
+
// Ignored via go/ees005
|
|
250
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
251
|
+
,
|
|
220
252
|
containerWidth: containerWidth,
|
|
221
253
|
contentDOM: forwardRef,
|
|
222
254
|
getEditorFeatureFlags: props.getEditorFeatureFlags,
|
|
@@ -289,7 +321,10 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
289
321
|
}]);
|
|
290
322
|
}(ReactNodeView);
|
|
291
323
|
export { TableView as default };
|
|
292
|
-
export var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor
|
|
324
|
+
export var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor
|
|
325
|
+
// Ignored via go/ees005
|
|
326
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
327
|
+
) {
|
|
293
328
|
var _pluginInjectionApi$t;
|
|
294
329
|
var _getPluginState2 = getPluginState(view.state),
|
|
295
330
|
pluginConfig = _getPluginState2.pluginConfig,
|
|
@@ -5,13 +5,19 @@ export var clearMultipleCells = function clearMultipleCells(targetCellPosition)
|
|
|
5
5
|
var cursorPos;
|
|
6
6
|
var tr = state.tr;
|
|
7
7
|
if (isSelectionType(tr.selection, 'cell')) {
|
|
8
|
+
// Ignored via go/ees005
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
10
|
var selection = tr.selection;
|
|
9
11
|
selection.forEachCell(function (_node, pos) {
|
|
10
12
|
var $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11
15
|
tr = emptyCell(findCellClosestToPos($pos), state.schema)(tr);
|
|
12
16
|
});
|
|
13
17
|
cursorPos = selection.$headCell.pos;
|
|
14
18
|
} else if (targetCellPosition) {
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
21
|
var cell = findCellClosestToPos(tr.doc.resolve(targetCellPosition + 1));
|
|
16
22
|
tr = emptyCell(cell, state.schema)(tr);
|
|
17
23
|
cursorPos = cell.pos;
|
|
@@ -4,14 +4,17 @@ 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
|
var getTablePluginCommand = function getTablePluginCommand(actionPayload, originalTr) {
|
|
16
19
|
return createCommand(function () {
|
|
17
20
|
return actionPayload;
|
|
@@ -19,7 +22,10 @@ var getTablePluginCommand = function getTablePluginCommand(actionPayload, origin
|
|
|
19
22
|
return (originalTr || tr).setMeta('addToHistory', false);
|
|
20
23
|
});
|
|
21
24
|
};
|
|
22
|
-
var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI
|
|
25
|
+
var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
|
+
) {
|
|
23
29
|
return function (state, dispatch) {
|
|
24
30
|
var customTr = state.tr;
|
|
25
31
|
var _getPluginState = getPluginState(state),
|
|
@@ -68,7 +74,10 @@ export var initiateKeyboardColumnResizing = function initiateKeyboardColumnResiz
|
|
|
68
74
|
nodeViewPortalProviderAPI = _ref.nodeViewPortalProviderAPI;
|
|
69
75
|
return function (state, dispatch, view) {
|
|
70
76
|
var selection = state.selection;
|
|
71
|
-
var selectionRect = isSelectionType(selection, 'cell') ?
|
|
77
|
+
var selectionRect = isSelectionType(selection, 'cell') ?
|
|
78
|
+
// Ignored via go/ees005
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
80
|
+
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
72
81
|
var cell = findCellClosestToPos(selection.$from);
|
|
73
82
|
if (ariaNotify && getIntl) {
|
|
74
83
|
ariaNotify(getIntl().formatMessage(messages.startedColumnResize), {
|
|
@@ -9,9 +9,10 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
9
9
|
import { findCellClosestToPos, findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
10
10
|
import { getPluginState } from '../plugin-factory';
|
|
11
11
|
import { distributeColumnsWidths } from '../table-resizing/commands';
|
|
12
|
-
import { deleteRows
|
|
13
|
-
import {
|
|
14
|
-
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
12
|
+
import { deleteRows } from '../transforms/delete-rows';
|
|
13
|
+
import { mergeCells } from '../transforms/merge';
|
|
14
|
+
import { withEditorAnalyticsAPI, getSelectedCellInfo, getSelectedTableInfo } from '../utils/analytics';
|
|
15
|
+
import { checkIfNumberColumnEnabled } from '../utils/nodes';
|
|
15
16
|
import { clearMultipleCells } from './clear';
|
|
16
17
|
import { wrapTableInExpand } from './collapse';
|
|
17
18
|
import { changeColumnWidthByStep } from './column-resize';
|
|
@@ -182,7 +183,10 @@ export var insertRowWithAnalytics = function insertRowWithAnalytics(editorAnalyt
|
|
|
182
183
|
};
|
|
183
184
|
};
|
|
184
185
|
export var changeColumnWidthByStepWithAnalytics = function changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api) {
|
|
185
|
-
return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl
|
|
186
|
+
return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl
|
|
187
|
+
// Ignored via go/ees005
|
|
188
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
189
|
+
) {
|
|
186
190
|
return withEditorAnalyticsAPI(function (state) {
|
|
187
191
|
var _getSelectedTableInfo2 = getSelectedTableInfo(state.selection),
|
|
188
192
|
table = _getSelectedTableInfo2.table,
|
|
@@ -296,7 +300,10 @@ export var deleteColumnsWithAnalytics = function deleteColumnsWithAnalytics(edit
|
|
|
296
300
|
})(editorAnalyticsAPI)(deleteColumnsCommand(rect, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor));
|
|
297
301
|
};
|
|
298
302
|
};
|
|
299
|
-
export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent
|
|
303
|
+
export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent
|
|
304
|
+
// Ignored via go/ees005
|
|
305
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
306
|
+
) {
|
|
300
307
|
return function (state, dispatch) {
|
|
301
308
|
var selection = state.selection;
|
|
302
309
|
var isCellSelection = selection instanceof CellSelection;
|
|
@@ -507,7 +514,10 @@ export var toggleFixedColumnWidthsOptionAnalytics = function toggleFixedColumnWi
|
|
|
507
514
|
})(editorAnalyticsAPI)(editorCommandToPMCommand(setTableDisplayMode));
|
|
508
515
|
};
|
|
509
516
|
export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalytics(editorAnalyticsAPI, isCommentEditor) {
|
|
510
|
-
return function (newAlignment, previousAlignment, inputMethod, reason
|
|
517
|
+
return function (newAlignment, previousAlignment, inputMethod, reason
|
|
518
|
+
// Ignored via go/ees005
|
|
519
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
520
|
+
) {
|
|
511
521
|
return withEditorAnalyticsAPI(function (state) {
|
|
512
522
|
var _getSelectedTableInfo13 = getSelectedTableInfo(state.selection),
|
|
513
523
|
table = _getSelectedTableInfo13.table,
|
|
@@ -532,7 +542,10 @@ export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalyt
|
|
|
532
542
|
};
|
|
533
543
|
};
|
|
534
544
|
export var setTableAlignmentWithTableContentWithPosWithAnalytics = function setTableAlignmentWithTableContentWithPosWithAnalytics(editorAnalyticsAPI) {
|
|
535
|
-
return function (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason
|
|
545
|
+
return function (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason
|
|
546
|
+
// Ignored via go/ees005
|
|
547
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
548
|
+
) {
|
|
536
549
|
return withEditorAnalyticsAPI(function () {
|
|
537
550
|
var map = TableMap.get(tableNodeWithPos.node);
|
|
538
551
|
var totalRowCount = map.height;
|
|
@@ -29,6 +29,8 @@ export var goToNextCell = function goToNextCell(editorAnalyticsAPI, ariaNotify,
|
|
|
29
29
|
var _state$schema$nodes = state.schema.nodes,
|
|
30
30
|
tableCell = _state$schema$nodes.tableCell,
|
|
31
31
|
tableHeader = _state$schema$nodes.tableHeader;
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
32
34
|
var cell = findParentNodeOfType([tableCell, tableHeader])(state.selection);
|
|
33
35
|
var firstCellPos = map.positionAt(0, 0, table.node) + table.start;
|
|
34
36
|
var 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
|
var makeArray = function makeArray(n) {
|
|
8
10
|
return Array.from(Array(n).keys());
|
|
9
11
|
};
|
|
@@ -21,6 +23,8 @@ export var hoverMergedCells = function hoverMergedCells() {
|
|
|
21
23
|
return {
|
|
22
24
|
pos: pos + table.start,
|
|
23
25
|
start: pos + table.start + 1,
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
24
28
|
node: table.node.nodeAt(pos)
|
|
25
29
|
};
|
|
26
30
|
});
|
|
@@ -14,8 +14,10 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
14
14
|
import { updateRowOrColumnMovedTransform } from '../analytics/commands';
|
|
15
15
|
import { META_KEYS } from '../table-analytics';
|
|
16
16
|
import { rescaleColumns } from '../transforms/column-width';
|
|
17
|
-
import {
|
|
17
|
+
import { createTableWithWidth } from '../utils/create';
|
|
18
18
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
19
|
+
import { checkIfHeaderRowEnabled } from '../utils/nodes';
|
|
20
|
+
import { copyPreviousRow } from '../utils/row-controls';
|
|
19
21
|
function addColumnAtCustomStep(column) {
|
|
20
22
|
return function (tr) {
|
|
21
23
|
var table = findTable(tr.selection);
|
|
@@ -25,6 +27,9 @@ function addColumnAtCustomStep(column) {
|
|
|
25
27
|
return tr;
|
|
26
28
|
};
|
|
27
29
|
}
|
|
30
|
+
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
33
|
export function addColumnAt(api) {
|
|
29
34
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
30
35
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -80,7 +85,10 @@ export var addColumnBefore = function addColumnBefore(api) {
|
|
|
80
85
|
|
|
81
86
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
82
87
|
// Command to add a column after the column with the selection.
|
|
83
|
-
export var addColumnAfter = function addColumnAfter(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
88
|
+
export var addColumnAfter = function addColumnAfter(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
89
|
+
// Ignored via go/ees005
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
91
|
+
) {
|
|
84
92
|
return function (state, dispatch, view) {
|
|
85
93
|
var table = findTable(state.selection);
|
|
86
94
|
if (!table) {
|
|
@@ -97,7 +105,10 @@ export var insertColumn = function insertColumn(api) {
|
|
|
97
105
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
98
106
|
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
|
|
99
107
|
var shouldUseIncreasedScalingPercent = arguments.length > 3 ? arguments[3] : undefined;
|
|
100
|
-
var isCommentEditor
|
|
108
|
+
var isCommentEditor
|
|
109
|
+
// Ignored via go/ees005
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
111
|
+
= arguments.length > 4 ? arguments[4] : undefined;
|
|
101
112
|
return function (column) {
|
|
102
113
|
return function (state, dispatch, view) {
|
|
103
114
|
var tr = addColumnAt(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(column, getAllowAddColumnCustomStep(state), view)(state.tr);
|
|
@@ -153,7 +164,10 @@ export var insertRow = function insertRow(row, moveCursorToTheNewRow) {
|
|
|
153
164
|
* @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
|
|
154
165
|
* (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
|
|
155
166
|
*/
|
|
156
|
-
export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled
|
|
167
|
+
export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled
|
|
168
|
+
// Ignored via go/ees005
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
170
|
+
) {
|
|
157
171
|
return function (state, dispatch) {
|
|
158
172
|
var table = createTableWithWidth({
|
|
159
173
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
@@ -187,7 +201,10 @@ export var createTable = function createTable(isTableScalingEnabled, isTableAlig
|
|
|
187
201
|
* @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
|
|
188
202
|
* (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
|
|
189
203
|
*/
|
|
190
|
-
export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor
|
|
204
|
+
export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor
|
|
205
|
+
// Ignored via go/ees005
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
207
|
+
) {
|
|
191
208
|
return function (rowsCount, colsCount, inputMethod) {
|
|
192
209
|
return function (_ref) {
|
|
193
210
|
var tr = _ref.tr;
|
|
@@ -11,9 +11,9 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
11
11
|
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';
|
|
12
12
|
import { TableCssClassName as ClassName, TableDecorations } from '../../types';
|
|
13
13
|
import { getDecorations } from '../decorations/plugin';
|
|
14
|
-
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils';
|
|
14
|
+
import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils/column-resizing';
|
|
15
15
|
import { createCommand, getPluginState } from '../plugin-factory';
|
|
16
|
-
import { fixAutoSizedTable } from '../transforms';
|
|
16
|
+
import { fixAutoSizedTable } from '../transforms/fix-tables';
|
|
17
17
|
import { createColumnControlsDecoration, createColumnSelectedDecoration } from '../utils/decoration';
|
|
18
18
|
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isIsolating } from '../utils/nodes';
|
|
19
19
|
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations';
|
|
@@ -205,6 +205,9 @@ export var isInsideFirstCellOfRowOrColumn = function isInsideFirstCellOfRowOrCol
|
|
|
205
205
|
if (!table || !type) {
|
|
206
206
|
return false;
|
|
207
207
|
}
|
|
208
|
+
|
|
209
|
+
// Ignored via go/ees005
|
|
210
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
208
211
|
var map = TableMap.get(table.node);
|
|
209
212
|
var cell = findCellClosestToPos(selection.$anchor);
|
|
210
213
|
if (!cell) {
|
|
@@ -231,6 +234,8 @@ export var deleteTableIfSelected = function deleteTableIfSelected(state, dispatc
|
|
|
231
234
|
};
|
|
232
235
|
export var convertFirstRowToHeader = function convertFirstRowToHeader(schema) {
|
|
233
236
|
return function (tr) {
|
|
237
|
+
// Ignored via go/ees005
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
234
239
|
var table = findTable(tr.selection);
|
|
235
240
|
var map = TableMap.get(table.node);
|
|
236
241
|
for (var i = 0; i < map.width; i++) {
|
|
@@ -309,13 +314,19 @@ export var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, editorVie
|
|
|
309
314
|
var _getPluginState2 = getPluginState(state),
|
|
310
315
|
targetCellPosition = _getPluginState2.targetCellPosition;
|
|
311
316
|
if (isSelectionType(tr.selection, 'cell')) {
|
|
317
|
+
// Ignored via go/ees005
|
|
318
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
312
319
|
var selection = tr.selection;
|
|
313
320
|
selection.forEachCell(function (_cell, pos) {
|
|
314
321
|
var $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
322
|
+
// Ignored via go/ees005
|
|
323
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
315
324
|
tr = setCellAttrs(findCellClosestToPos($pos), attrs)(tr);
|
|
316
325
|
});
|
|
317
326
|
cursorPos = selection.$headCell.pos;
|
|
318
327
|
} else if (targetCellPosition) {
|
|
328
|
+
// Ignored via go/ees005
|
|
329
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
319
330
|
var cell = findCellClosestToPos(tr.doc.resolve(targetCellPosition + 1));
|
|
320
331
|
tr = setCellAttrs(cell, attrs)(tr);
|
|
321
332
|
cursorPos = cell.pos;
|
|
@@ -462,7 +473,10 @@ export var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton()
|
|
|
462
473
|
return tr.setMeta('addToHistory', false);
|
|
463
474
|
});
|
|
464
475
|
};
|
|
465
|
-
export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize
|
|
476
|
+
export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize
|
|
477
|
+
// Ignored via go/ees005
|
|
478
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
479
|
+
) {
|
|
466
480
|
return createCommand(function (state) {
|
|
467
481
|
var tableNode = findTable(state.selection);
|
|
468
482
|
var _getPluginState3 = getPluginState(state),
|
|
@@ -488,7 +502,10 @@ export var addResizeHandleDecorations = function addResizeHandleDecorations(rowI
|
|
|
488
502
|
return tr.setMeta('addToHistory', false);
|
|
489
503
|
});
|
|
490
504
|
};
|
|
491
|
-
export var updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip
|
|
505
|
+
export var updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip
|
|
506
|
+
// Ignored via go/ees005
|
|
507
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
508
|
+
) {
|
|
492
509
|
return createCommand(function (state) {
|
|
493
510
|
var tableNode = findTable(state.selection);
|
|
494
511
|
var _getPluginState4 = getPluginState(state),
|
|
@@ -537,7 +554,10 @@ export var removeResizeHandleDecorations = function removeResizeHandleDecoration
|
|
|
537
554
|
return tr.setMeta('addToHistory', false);
|
|
538
555
|
});
|
|
539
556
|
};
|
|
540
|
-
export var autoSizeTable = function autoSizeTable(view, node, table, basePos, opts
|
|
557
|
+
export var autoSizeTable = function autoSizeTable(view, node, table, basePos, opts
|
|
558
|
+
// Ignored via go/ees005
|
|
559
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
560
|
+
) {
|
|
541
561
|
if (typeof basePos !== 'number') {
|
|
542
562
|
return false;
|
|
543
563
|
}
|
|
@@ -286,9 +286,13 @@ var selectFullTable = function selectFullTable(editorSelectionAPI) {
|
|
|
286
286
|
var fullTableSelection;
|
|
287
287
|
var selectionRelativeToNode;
|
|
288
288
|
if (dir === TableSelectionDirection.TopToBottom) {
|
|
289
|
+
// Ignored via go/ees005
|
|
290
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
289
291
|
fullTableSelection = new CellSelection($firstCell, $lastCell);
|
|
290
292
|
selectionRelativeToNode = RelativeSelectionPos.End;
|
|
291
293
|
} else {
|
|
294
|
+
// Ignored via go/ees005
|
|
295
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
296
|
fullTableSelection = new CellSelection($lastCell, $firstCell);
|
|
293
297
|
selectionRelativeToNode = RelativeSelectionPos.Start;
|
|
294
298
|
}
|
|
@@ -7,7 +7,11 @@ import { createCommand, getPluginState } from '../plugin-factory';
|
|
|
7
7
|
var createGetInlineCardTextFromStore = function createGetInlineCardTextFromStore(attrs) {
|
|
8
8
|
var _ref = attrs,
|
|
9
9
|
data = _ref.data;
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
12
|
if (data && (data.name || data.title)) {
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
15
|
return data.name || data.title;
|
|
12
16
|
}
|
|
13
17
|
var _ref2 = attrs,
|
|
@@ -27,11 +31,16 @@ export var sortByColumn = function sortByColumn(columnIndex) {
|
|
|
27
31
|
}
|
|
28
32
|
};
|
|
29
33
|
}, function (tr, state) {
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
30
36
|
var table = findTable(tr.selection);
|
|
31
37
|
if (!table || !table.node) {
|
|
32
38
|
return tr;
|
|
33
39
|
}
|
|
34
|
-
var selectionRect = isSelectionType(tr.selection, 'cell') ?
|
|
40
|
+
var selectionRect = isSelectionType(tr.selection, 'cell') ?
|
|
41
|
+
// Ignored via go/ees005
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
43
|
+
getSelectionRect(tr.selection) : findCellRectClosestToPos(tr.selection.$from);
|
|
35
44
|
if (!selectionRect) {
|
|
36
45
|
return tr;
|
|
37
46
|
}
|
|
@@ -49,6 +49,8 @@ export var toggleHeaderColumn = function toggleHeaderColumn(state, dispatch) {
|
|
|
49
49
|
};
|
|
50
50
|
export var toggleNumberColumn = function toggleNumberColumn(state, dispatch) {
|
|
51
51
|
var tr = state.tr;
|
|
52
|
+
// Ignored via go/ees005
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
52
54
|
var _ref = findTable(state.selection),
|
|
53
55
|
node = _ref.node,
|
|
54
56
|
pos = _ref.pos;
|
|
@@ -4,12 +4,15 @@ 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 var pluginKey = new PluginKey('tableDecorationsPlugin');
|
|
9
9
|
export var getDecorations = function getDecorations(state) {
|
|
10
10
|
return pluginKey.getState(state);
|
|
11
11
|
};
|
|
12
|
-
export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState
|
|
12
|
+
export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
15
|
+
) {
|
|
13
16
|
var _tableWidthPluginKey$, _tableWidthPluginKey$2;
|
|
14
17
|
var isResizing = (_tableWidthPluginKey$ = tableWidthPluginKey.getState(newState)) === null || _tableWidthPluginKey$ === void 0 ? void 0 : _tableWidthPluginKey$.resizing;
|
|
15
18
|
var wasResizing = (_tableWidthPluginKey$2 = tableWidthPluginKey.getState(oldState)) === null || _tableWidthPluginKey$2 === void 0 ? void 0 : _tableWidthPluginKey$2.resizing;
|
|
@@ -46,6 +49,8 @@ export var createPlugin = function createPlugin() {
|
|
|
46
49
|
init: function init() {
|
|
47
50
|
return DecorationSet.empty;
|
|
48
51
|
},
|
|
52
|
+
// Ignored via go/ees005
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
49
54
|
apply: function apply(tr, decorationSet, oldState, newState) {
|
|
50
55
|
var pluginState = decorationSet;
|
|
51
56
|
// main table plugin --->
|
|
@@ -17,7 +17,10 @@ var updateLastCellElement = function updateLastCellElement(lastCellElementsDecor
|
|
|
17
17
|
return updateDecorations(tr.doc, decorationSet, lastCellElementsDecorations, TableDecorations.LAST_CELL_ELEMENT);
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI
|
|
20
|
+
export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
|
+
) {
|
|
21
24
|
return function (_ref3) {
|
|
22
25
|
var tr = _ref3.tr,
|
|
23
26
|
decorationSet = _ref3.decorationSet;
|
|
@@ -3,12 +3,15 @@ import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_STATUS }
|
|
|
3
3
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
5
|
import { findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import {
|
|
7
|
-
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
6
|
+
import { getSelectedTableInfo, withEditorAnalyticsAPI } from '../utils/analytics';
|
|
8
7
|
import { canMove, getTargetIndex } from '../utils/drag-menu';
|
|
8
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../utils/selection';
|
|
9
9
|
import { clearDropTarget, cloneSource, moveSource } from './commands';
|
|
10
10
|
export var clearDropTargetWithAnalytics = function clearDropTargetWithAnalytics(editorAnalyticsAPI) {
|
|
11
|
-
return function (inputMethod, sourceType, sourceIndexes, status, tr
|
|
11
|
+
return function (inputMethod, sourceType, sourceIndexes, status, tr
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
14
|
+
) {
|
|
12
15
|
return withEditorAnalyticsAPI(function (_ref) {
|
|
13
16
|
var _sourceIndexes$length;
|
|
14
17
|
var selection = _ref.selection;
|
|
@@ -38,7 +41,10 @@ export var clearDropTargetWithAnalytics = function clearDropTargetWithAnalytics(
|
|
|
38
41
|
};
|
|
39
42
|
};
|
|
40
43
|
export var moveSourceWithAnalytics = function moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotify, getIntl) {
|
|
41
|
-
return function (inputMethod, sourceType, sourceIndexes, targetIndex, tr
|
|
44
|
+
return function (inputMethod, sourceType, sourceIndexes, targetIndex, tr
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
47
|
+
) {
|
|
42
48
|
return withEditorAnalyticsAPI(function (_ref2) {
|
|
43
49
|
var selection = _ref2.selection;
|
|
44
50
|
var direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|
|
@@ -111,7 +117,10 @@ export var moveSourceWithAnalyticsViaShortcut = function moveSourceWithAnalytics
|
|
|
111
117
|
};
|
|
112
118
|
};
|
|
113
119
|
export var cloneSourceWithAnalytics = function cloneSourceWithAnalytics(editorAnalyticsAPI) {
|
|
114
|
-
return function (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
120
|
+
return function (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
121
|
+
// Ignored via go/ees005
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
123
|
+
) {
|
|
115
124
|
return withEditorAnalyticsAPI(function (_ref3) {
|
|
116
125
|
var selection = _ref3.selection;
|
|
117
126
|
var direction = sourceIndexes[0] > targetIndex ? -1 : 1;
|