@atlaskit/editor-plugin-table 8.4.12 → 8.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +6 -3
- package/dist/cjs/nodeviews/TableCell.js +5 -0
- package/dist/cjs/nodeviews/TableComponent.js +92 -29
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +7 -1
- package/dist/cjs/nodeviews/TableContainer.js +16 -6
- package/dist/cjs/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/cjs/nodeviews/TableResizer.js +44 -15
- package/dist/cjs/nodeviews/TableRow.js +45 -1
- package/dist/cjs/nodeviews/TableStickyScrollbar.js +21 -2
- package/dist/cjs/nodeviews/lazy-node-views.js +16 -4
- package/dist/cjs/nodeviews/table.js +53 -18
- package/dist/cjs/pm-plugins/commands/clear.js +6 -0
- package/dist/cjs/pm-plugins/commands/column-resize.js +26 -17
- package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +39 -26
- package/dist/cjs/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/cjs/pm-plugins/commands/hover.js +17 -13
- package/dist/cjs/pm-plugins/commands/insert.js +27 -10
- package/dist/cjs/pm-plugins/commands/misc.js +29 -9
- package/dist/cjs/pm-plugins/commands/selection.js +4 -0
- package/dist/cjs/pm-plugins/commands/sort.js +10 -1
- package/dist/cjs/pm-plugins/commands/toggle.js +2 -0
- package/dist/cjs/pm-plugins/decorations/plugin.js +9 -4
- package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +19 -10
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +16 -7
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +21 -8
- package/dist/cjs/pm-plugins/handlers.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +103 -24
- package/dist/cjs/pm-plugins/main.js +22 -11
- package/dist/cjs/pm-plugins/table-resizing/commands.js +7 -6
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +39 -20
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +4 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +19 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +8 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +6 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/cjs/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/cjs/pm-plugins/table-width.js +9 -4
- package/dist/cjs/pm-plugins/transforms/column-width.js +8 -5
- package/dist/cjs/pm-plugins/transforms/delete-columns.js +2 -0
- package/dist/cjs/pm-plugins/transforms/fix-tables.js +24 -8
- package/dist/cjs/pm-plugins/transforms/merge.js +7 -0
- package/dist/cjs/pm-plugins/transforms/replace-table.js +6 -3
- package/dist/cjs/pm-plugins/transforms/split.js +6 -1
- package/dist/cjs/pm-plugins/utils/alignment.js +4 -1
- package/dist/cjs/pm-plugins/utils/analytics.js +3 -3
- package/dist/cjs/pm-plugins/utils/column-controls.js +4 -0
- package/dist/cjs/pm-plugins/utils/create.js +2 -2
- package/dist/cjs/pm-plugins/utils/decoration.js +24 -6
- package/dist/cjs/pm-plugins/utils/dom.js +4 -0
- package/dist/cjs/pm-plugins/utils/drag-menu.js +19 -7
- package/dist/cjs/pm-plugins/utils/nodes.js +3 -0
- package/dist/cjs/pm-plugins/utils/paste.js +4 -1
- package/dist/cjs/pm-plugins/utils/row-controls.js +4 -1
- package/dist/cjs/tablePlugin.js +24 -18
- package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/cjs/ui/DragHandle/HandleIconComponent.js +5 -3
- package/dist/cjs/ui/DragHandle/index.js +14 -7
- package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/cjs/ui/FloatingContextualButton/index.js +7 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +32 -15
- package/dist/cjs/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/cjs/ui/FloatingDeleteButton/index.js +27 -5
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +19 -7
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -1
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/cjs/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/cjs/ui/FloatingInsertButton/index.js +27 -3
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +30 -8
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +9 -5
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/cjs/ui/TableFloatingControls/FloatingControlsWithSelection.js +4 -4
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +8 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +9 -5
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +68 -41
- package/dist/cjs/ui/TableFloatingControls/index.js +19 -8
- package/dist/cjs/ui/common-styles.js +1 -1
- package/dist/cjs/ui/event-handlers.js +59 -32
- package/dist/cjs/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/cjs/ui/toolbar.js +42 -16
- package/dist/es2019/nodeviews/ExternalDropTargets.js +5 -2
- package/dist/es2019/nodeviews/TableCell.js +5 -0
- package/dist/es2019/nodeviews/TableComponent.js +77 -13
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +8 -1
- package/dist/es2019/nodeviews/TableContainer.js +14 -4
- package/dist/es2019/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/es2019/nodeviews/TableResizer.js +33 -4
- package/dist/es2019/nodeviews/TableRow.js +45 -1
- package/dist/es2019/nodeviews/TableStickyScrollbar.js +20 -2
- package/dist/es2019/nodeviews/lazy-node-views.js +16 -4
- package/dist/es2019/nodeviews/table.js +47 -12
- package/dist/es2019/pm-plugins/commands/clear.js +6 -0
- package/dist/es2019/pm-plugins/commands/column-resize.js +16 -7
- package/dist/es2019/pm-plugins/commands/commands-with-analytics.js +28 -9
- package/dist/es2019/pm-plugins/commands/delete.js +4 -1
- package/dist/es2019/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/es2019/pm-plugins/commands/hover.js +5 -1
- package/dist/es2019/pm-plugins/commands/insert.js +26 -6
- package/dist/es2019/pm-plugins/commands/misc.js +25 -5
- package/dist/es2019/pm-plugins/commands/selection.js +4 -0
- package/dist/es2019/pm-plugins/commands/sort.js +10 -1
- package/dist/es2019/pm-plugins/commands/toggle.js +2 -0
- package/dist/es2019/pm-plugins/decorations/plugin.js +7 -2
- package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +14 -5
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +17 -5
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +21 -5
- package/dist/es2019/pm-plugins/handlers.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +104 -24
- package/dist/es2019/pm-plugins/main.js +16 -5
- package/dist/es2019/pm-plugins/table-resizing/commands.js +3 -2
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +25 -6
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +4 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +23 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +12 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +9 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +18 -6
- package/dist/es2019/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/es2019/pm-plugins/table-width.js +7 -2
- package/dist/es2019/pm-plugins/transforms/column-width.js +12 -5
- package/dist/es2019/pm-plugins/transforms/delete-columns.js +6 -1
- package/dist/es2019/pm-plugins/transforms/fix-tables.js +20 -4
- package/dist/es2019/pm-plugins/transforms/merge.js +7 -0
- package/dist/es2019/pm-plugins/transforms/replace-table.js +5 -2
- package/dist/es2019/pm-plugins/transforms/split.js +6 -1
- package/dist/es2019/pm-plugins/utils/alignment.js +4 -1
- package/dist/es2019/pm-plugins/utils/analytics.js +2 -2
- package/dist/es2019/pm-plugins/utils/column-controls.js +4 -0
- package/dist/es2019/pm-plugins/utils/create.js +1 -1
- package/dist/es2019/pm-plugins/utils/decoration.js +24 -6
- package/dist/es2019/pm-plugins/utils/dom.js +4 -0
- package/dist/es2019/pm-plugins/utils/drag-menu.js +19 -4
- package/dist/es2019/pm-plugins/utils/nodes.js +3 -0
- package/dist/es2019/pm-plugins/utils/paste.js +8 -2
- package/dist/es2019/pm-plugins/utils/row-controls.js +4 -1
- package/dist/es2019/pm-plugins/utils/snapping.js +4 -1
- package/dist/es2019/tablePlugin.js +13 -4
- package/dist/es2019/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/es2019/ui/DragHandle/HandleIconComponent.js +3 -1
- package/dist/es2019/ui/DragHandle/index.js +10 -3
- package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/es2019/ui/FloatingContextualButton/index.js +7 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +23 -6
- package/dist/es2019/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/es2019/ui/FloatingDeleteButton/index.js +23 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +15 -3
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -1
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/es2019/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/es2019/ui/FloatingInsertButton/index.js +26 -2
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +28 -6
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +7 -2
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/FloatingControlsWithSelection.js +2 -2
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +7 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +7 -2
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +32 -6
- package/dist/es2019/ui/TableFloatingControls/index.js +14 -3
- package/dist/es2019/ui/common-styles.js +7 -0
- package/dist/es2019/ui/event-handlers.js +35 -5
- package/dist/es2019/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/es2019/ui/toolbar.js +58 -14
- package/dist/esm/nodeviews/ExternalDropTargets.js +5 -2
- package/dist/esm/nodeviews/TableCell.js +5 -0
- package/dist/esm/nodeviews/TableComponent.js +75 -11
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +8 -1
- package/dist/esm/nodeviews/TableContainer.js +14 -4
- package/dist/esm/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/esm/nodeviews/TableResizer.js +33 -4
- package/dist/esm/nodeviews/TableRow.js +45 -1
- package/dist/esm/nodeviews/TableStickyScrollbar.js +21 -2
- package/dist/esm/nodeviews/lazy-node-views.js +16 -4
- package/dist/esm/nodeviews/table.js +47 -12
- package/dist/esm/pm-plugins/commands/clear.js +6 -0
- package/dist/esm/pm-plugins/commands/column-resize.js +16 -7
- package/dist/esm/pm-plugins/commands/commands-with-analytics.js +20 -7
- package/dist/esm/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/esm/pm-plugins/commands/hover.js +5 -1
- package/dist/esm/pm-plugins/commands/insert.js +22 -5
- package/dist/esm/pm-plugins/commands/misc.js +25 -5
- package/dist/esm/pm-plugins/commands/selection.js +4 -0
- package/dist/esm/pm-plugins/commands/sort.js +10 -1
- package/dist/esm/pm-plugins/commands/toggle.js +2 -0
- package/dist/esm/pm-plugins/decorations/plugin.js +7 -2
- package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +14 -5
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +13 -4
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +17 -4
- package/dist/esm/pm-plugins/handlers.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +104 -24
- package/dist/esm/pm-plugins/main.js +16 -5
- package/dist/esm/pm-plugins/table-resizing/commands.js +3 -2
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +25 -6
- package/dist/esm/pm-plugins/table-resizing/plugin.js +4 -1
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +19 -1
- package/dist/esm/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/esm/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/esm/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +8 -1
- package/dist/esm/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +5 -2
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +2 -2
- package/dist/esm/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/esm/pm-plugins/table-width.js +7 -2
- package/dist/esm/pm-plugins/transforms/column-width.js +6 -4
- package/dist/esm/pm-plugins/transforms/delete-columns.js +2 -0
- package/dist/esm/pm-plugins/transforms/fix-tables.js +20 -4
- package/dist/esm/pm-plugins/transforms/merge.js +7 -0
- package/dist/esm/pm-plugins/transforms/replace-table.js +5 -2
- package/dist/esm/pm-plugins/transforms/split.js +6 -1
- package/dist/esm/pm-plugins/utils/alignment.js +4 -1
- package/dist/esm/pm-plugins/utils/analytics.js +2 -2
- package/dist/esm/pm-plugins/utils/column-controls.js +4 -0
- package/dist/esm/pm-plugins/utils/create.js +1 -1
- package/dist/esm/pm-plugins/utils/decoration.js +24 -6
- package/dist/esm/pm-plugins/utils/dom.js +4 -0
- package/dist/esm/pm-plugins/utils/drag-menu.js +15 -3
- package/dist/esm/pm-plugins/utils/nodes.js +3 -0
- package/dist/esm/pm-plugins/utils/paste.js +4 -1
- package/dist/esm/pm-plugins/utils/row-controls.js +4 -1
- package/dist/esm/tablePlugin.js +11 -4
- package/dist/esm/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/esm/ui/DragHandle/HandleIconComponent.js +3 -1
- package/dist/esm/ui/DragHandle/index.js +10 -3
- package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/esm/ui/FloatingContextualButton/index.js +7 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +23 -6
- package/dist/esm/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/esm/ui/FloatingDeleteButton/index.js +23 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +15 -3
- package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +4 -1
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/esm/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/esm/ui/FloatingInsertButton/index.js +26 -2
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +28 -6
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +6 -2
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/esm/ui/TableFloatingControls/FloatingControlsWithSelection.js +2 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +7 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +6 -2
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +65 -38
- package/dist/esm/ui/TableFloatingControls/index.js +14 -3
- package/dist/esm/ui/common-styles.js +1 -1
- package/dist/esm/ui/event-handlers.js +31 -4
- package/dist/esm/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/esm/ui/toolbar.js +34 -8
- package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/commands.d.ts +1 -1
- package/dist/types/pm-plugins/transforms/column-width.d.ts +1 -1
- package/dist/types/pm-plugins/utils/collapse.d.ts +2 -1
- package/dist/types/ui/FloatingContextualButton/FixedButton.d.ts +1 -1
- package/dist/types/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -4
- package/dist/types/ui/TableFloatingControls/index.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/collapse.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -4
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +3 -3
- package/package.json +3 -3
- package/src/nodeviews/ExternalDropTargets.tsx +3 -1
- package/src/nodeviews/TableCell.ts +4 -0
- package/src/nodeviews/TableComponent.tsx +63 -18
- package/src/nodeviews/TableComponentWithSharedState.tsx +4 -0
- package/src/nodeviews/TableContainer.tsx +7 -1
- package/src/nodeviews/TableNodeViewBase.ts +4 -0
- package/src/nodeviews/TableResizer.tsx +27 -4
- package/src/nodeviews/TableRow.ts +41 -1
- package/src/nodeviews/TableStickyScrollbar.ts +14 -0
- package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +2 -0
- package/src/nodeviews/__mocks__/OverridableMock.ts +6 -0
- package/src/nodeviews/lazy-node-views.ts +8 -0
- package/src/nodeviews/table.tsx +30 -4
- package/src/pm-plugins/commands/clear.ts +6 -0
- package/src/pm-plugins/commands/column-resize.ts +12 -9
- package/src/pm-plugins/commands/commands-with-analytics.ts +21 -4
- package/src/pm-plugins/commands/delete.ts +2 -0
- package/src/pm-plugins/commands/go-to-next-cell.ts +2 -0
- package/src/pm-plugins/commands/hover.ts +7 -5
- package/src/pm-plugins/commands/insert.ts +15 -1
- package/src/pm-plugins/commands/misc.ts +24 -3
- package/src/pm-plugins/commands/selection.ts +4 -0
- package/src/pm-plugins/commands/sort.ts +9 -1
- package/src/pm-plugins/commands/toggle.ts +2 -0
- package/src/pm-plugins/decorations/plugin.ts +5 -1
- package/src/pm-plugins/decorations/utils/column-resizing.ts +2 -0
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +8 -2
- package/src/pm-plugins/drag-and-drop/commands.ts +9 -1
- package/src/pm-plugins/drag-and-drop/plugin.ts +17 -2
- package/src/pm-plugins/handlers.ts +1 -1
- package/src/pm-plugins/keymap.ts +54 -0
- package/src/pm-plugins/main.ts +12 -5
- package/src/pm-plugins/table-resizing/commands.ts +4 -3
- package/src/pm-plugins/table-resizing/event-handlers.ts +24 -10
- package/src/pm-plugins/table-resizing/plugin.ts +3 -1
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +17 -1
- package/src/pm-plugins/table-resizing/utils/column-state.ts +4 -0
- package/src/pm-plugins/table-resizing/utils/content-width.ts +14 -0
- package/src/pm-plugins/table-resizing/utils/dom.ts +4 -0
- package/src/pm-plugins/table-resizing/utils/misc.ts +2 -0
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +9 -1
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +6 -0
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -1
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +10 -2
- package/src/pm-plugins/table-selection-keymap.ts +8 -0
- package/src/pm-plugins/table-width.ts +5 -1
- package/src/pm-plugins/transforms/column-width.ts +9 -7
- package/src/pm-plugins/transforms/delete-columns.ts +4 -0
- package/src/pm-plugins/transforms/fix-tables.ts +13 -6
- package/src/pm-plugins/transforms/merge.ts +6 -0
- package/src/pm-plugins/transforms/replace-table.ts +3 -1
- package/src/pm-plugins/transforms/split.ts +4 -0
- package/src/pm-plugins/utils/alignment.ts +2 -0
- package/src/pm-plugins/utils/analytics.ts +2 -2
- package/src/pm-plugins/utils/collapse.ts +3 -4
- package/src/pm-plugins/utils/column-controls.ts +4 -0
- package/src/pm-plugins/utils/create.ts +1 -1
- package/src/pm-plugins/utils/decoration.ts +12 -0
- package/src/pm-plugins/utils/dom.ts +4 -0
- package/src/pm-plugins/utils/drag-menu.ts +12 -1
- package/src/pm-plugins/utils/nodes.ts +2 -0
- package/src/pm-plugins/utils/paste.ts +4 -0
- package/src/pm-plugins/utils/row-controls.ts +2 -0
- package/src/pm-plugins/utils/snapping.ts +2 -0
- package/src/tablePlugin.tsx +13 -15
- package/src/tablePluginType.ts +10 -0
- package/src/ui/ColumnResizeWidget/index.tsx +2 -0
- package/src/ui/DragHandle/HandleIconComponent.tsx +3 -1
- package/src/ui/DragHandle/index.tsx +11 -2
- package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +6 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +5 -1
- package/src/ui/FloatingContextualButton/index.tsx +8 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +17 -7
- package/src/ui/FloatingContextualMenu/index.tsx +11 -1
- package/src/ui/FloatingDeleteButton/index.tsx +23 -4
- package/src/ui/FloatingDragMenu/DragMenu.tsx +13 -6
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +10 -0
- package/src/ui/FloatingDragMenu/index.tsx +3 -1
- package/src/ui/FloatingInsertButton/InsertButton.tsx +4 -0
- package/src/ui/FloatingInsertButton/getPopupOptions.ts +4 -0
- package/src/ui/FloatingInsertButton/index.tsx +21 -1
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +19 -2
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/index.tsx +8 -4
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +2 -0
- package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +2 -2
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +7 -1
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +11 -3
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +20 -1
- package/src/ui/TableFloatingControls/index.tsx +13 -4
- package/src/ui/common-styles.ts +7 -0
- package/src/ui/event-handlers.ts +28 -3
- package/src/ui/icons/SortingIconWrapper.tsx +2 -0
- package/src/ui/toolbar.tsx +43 -11
- package/tsconfig.json +0 -1
|
@@ -9,7 +9,8 @@ import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { clearHoverSelection, hoverCell, hoverColumns, selectColumn, selectColumns } from '../../../pm-plugins/commands';
|
|
11
11
|
import { toggleDragMenu } from '../../../pm-plugins/drag-and-drop/commands';
|
|
12
|
-
import { getRowsParams
|
|
12
|
+
import { getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
13
|
+
import { getSelectedColumnIndexes } from '../../../pm-plugins/utils/selection';
|
|
13
14
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
14
15
|
import { DragHandle } from '../../DragHandle';
|
|
15
16
|
const getSelectedColumns = selection => {
|
|
@@ -62,11 +63,19 @@ export const ColumnControls = ({
|
|
|
62
63
|
state,
|
|
63
64
|
dispatch
|
|
64
65
|
} = editorView;
|
|
65
|
-
const isClickOutsideSelectedCols =
|
|
66
|
+
const isClickOutsideSelectedCols =
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
69
|
+
selectedColIndexes.length >= 1 && !selectedColIndexes.includes(colIndex);
|
|
66
70
|
if (!selectedColIndexes || selectedColIndexes.length === 0 || isClickOutsideSelectedCols) {
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
67
73
|
selectColumn(colIndex, event.shiftKey)(state, dispatch);
|
|
68
74
|
}
|
|
69
|
-
if (selectedColIndexes.length > 1 &&
|
|
75
|
+
if (selectedColIndexes.length > 1 &&
|
|
76
|
+
// Ignored via go/ees005
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
78
|
+
selectedColIndexes.includes(colIndex) && !event.shiftKey) {
|
|
70
79
|
selectColumns(selectedColIndexes)(state, dispatch);
|
|
71
80
|
}
|
|
72
81
|
}, [colIndex, selectedColIndexes, editorView]);
|
|
@@ -75,6 +84,8 @@ export const ColumnControls = ({
|
|
|
75
84
|
state,
|
|
76
85
|
dispatch
|
|
77
86
|
} = editorView;
|
|
87
|
+
// Ignored via go/ees005
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
78
89
|
hoverColumns([colIndex])(state, dispatch);
|
|
79
90
|
}, [colIndex, editorView]);
|
|
80
91
|
const handleMouseMove = useCallback(e => {
|
|
@@ -119,13 +130,18 @@ export const ColumnControls = ({
|
|
|
119
130
|
toggleDragMenu(undefined, 'column', colIndex, trigger)(state, dispatch);
|
|
120
131
|
}, [editorView, colIndex]);
|
|
121
132
|
const colIndexes = useMemo(() => {
|
|
133
|
+
// Ignored via go/ees005
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
122
135
|
return [colIndex];
|
|
123
136
|
}, [colIndex]);
|
|
124
137
|
if (stickyTop && columnControlsRef.current) {
|
|
125
138
|
var _getScrollOffset;
|
|
126
139
|
columnControlsRef.current.scrollLeft = (_getScrollOffset = getScrollOffset === null || getScrollOffset === void 0 ? void 0 : getScrollOffset()) !== null && _getScrollOffset !== void 0 ? _getScrollOffset : 0;
|
|
127
140
|
}
|
|
128
|
-
const generateHandleByType = (type, appearance, gridColumn, indexes
|
|
141
|
+
const generateHandleByType = (type, appearance, gridColumn, indexes
|
|
142
|
+
// Ignored via go/ees005
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
144
|
+
) => {
|
|
129
145
|
var _rowHeights$reduce, _colWidths$reduce;
|
|
130
146
|
const isHover = type === 'hover';
|
|
131
147
|
const isPlaceholder = appearance === 'placeholder';
|
|
@@ -188,7 +204,10 @@ export const ColumnControls = ({
|
|
|
188
204
|
// always position placeholder in first column to avoid overflow issues
|
|
189
205
|
selectedAppearance === 'placeholder' ? '1 / span 1' : `${selectedColIndexes[0] + 1} / span ${selectedColIndexes.length}`, selectedColIndexes));
|
|
190
206
|
if (hoveredCell && isTableHovered && colIndex !== undefined && !selectedColIndexes.includes(colIndex)) {
|
|
191
|
-
handles.push(
|
|
207
|
+
handles.push(
|
|
208
|
+
// Ignored via go/ees005
|
|
209
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
210
|
+
generateHandleByType('hover', 'default', `${colIndex + 1} / span 1`, colIndexes));
|
|
192
211
|
}
|
|
193
212
|
return handles;
|
|
194
213
|
};
|
|
@@ -228,7 +247,10 @@ export const ColumnControls = ({
|
|
|
228
247
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
229
248
|
,
|
|
230
249
|
className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER,
|
|
231
|
-
contentEditable: false
|
|
250
|
+
contentEditable: false
|
|
251
|
+
// Ignored via go/ees005
|
|
252
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
253
|
+
,
|
|
232
254
|
key: index
|
|
233
255
|
}, /*#__PURE__*/React.createElement("div", {
|
|
234
256
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -28,7 +28,10 @@ export const ColumnDropTargets = ({
|
|
|
28
28
|
className: ClassName.DRAG_COLUMN_CONTROLS_INNER,
|
|
29
29
|
"data-testid": "table-floating-column-controls-drop-targets"
|
|
30
30
|
}, colWidths === null || colWidths === void 0 ? void 0 : colWidths.map((width, index) => {
|
|
31
|
-
return /*#__PURE__*/React.createElement(ColumnDropTarget
|
|
31
|
+
return /*#__PURE__*/React.createElement(ColumnDropTarget
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
34
|
+
, {
|
|
32
35
|
key: index,
|
|
33
36
|
index: index,
|
|
34
37
|
localId: localId,
|
|
@@ -2,7 +2,9 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
|
-
import {
|
|
5
|
+
import { getColumnsWidths } from '../../pm-plugins/utils/column-controls';
|
|
6
|
+
import { containsHeaderColumn } from '../../pm-plugins/utils/nodes';
|
|
7
|
+
import { getRowHeights } from '../../pm-plugins/utils/row-controls';
|
|
6
8
|
import { TableCssClassName as ClassName } from '../../types';
|
|
7
9
|
import { ColumnControls } from './ColumnControls';
|
|
8
10
|
import { ColumnDropTargets } from './ColumnDropTargets';
|
|
@@ -66,7 +68,10 @@ const TableFloatingColumnControls = ({
|
|
|
66
68
|
var _rowHeights$, _containerRef$current;
|
|
67
69
|
const columnControlTopOffsetFromParent = '-12px';
|
|
68
70
|
const headerRowHeight = hasHeaderRow && stickyTop !== undefined ? (_rowHeights$ = rowHeights === null || rowHeights === void 0 ? void 0 : rowHeights[0]) !== null && _rowHeights$ !== void 0 ? _rowHeights$ : 0 : 0;
|
|
69
|
-
containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.style.setProperty('top', fg('platform_editor_breakout_use_css') ? columnControlTopOffsetFromParent :
|
|
71
|
+
containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.style.setProperty('top', fg('platform_editor_breakout_use_css') ? columnControlTopOffsetFromParent :
|
|
72
|
+
// Ignored via go/ees005
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
74
|
+
`${stickyTop - headerRowHeight + 33}px` // 33px is padding and margin applied on tr.sticky
|
|
70
75
|
);
|
|
71
76
|
} else {
|
|
72
77
|
var _containerRef$current2;
|
|
@@ -8,6 +8,8 @@ import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import { clearHoverSelection, hoverTable } from '../../../pm-plugins/commands';
|
|
10
10
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
11
13
|
class CornerControlComponent extends Component {
|
|
12
14
|
constructor(...args) {
|
|
13
15
|
super(...args);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { CornerControls } from './CornerControls';
|
|
4
|
-
import { RowControls } from './RowControls';
|
|
3
|
+
import { CornerControls } from './CornerControls/ClassicCornerControls';
|
|
4
|
+
import { RowControls } from './RowControls/ClassicControls';
|
|
5
5
|
export const FloatingControlsWithSelection = ({
|
|
6
6
|
editorView,
|
|
7
7
|
tableRef,
|
|
@@ -5,9 +5,11 @@ import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
8
|
-
import { getRowHeights } from '../../../pm-plugins/utils';
|
|
8
|
+
import { getRowHeights } from '../../../pm-plugins/utils/row-controls';
|
|
9
9
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
10
10
|
import { tableBorderColor } from '../../consts';
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
11
13
|
export default class NumberColumn extends Component {
|
|
12
14
|
constructor(...args) {
|
|
13
15
|
super(...args);
|
|
@@ -107,6 +109,8 @@ export default class NumberColumn extends Component {
|
|
|
107
109
|
/*#__PURE__*/
|
|
108
110
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
109
111
|
React.createElement("div", {
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
110
114
|
key: `wrapper-${index}`
|
|
111
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
112
116
|
,
|
|
@@ -122,6 +126,8 @@ export default class NumberColumn extends Component {
|
|
|
122
126
|
/*#__PURE__*/
|
|
123
127
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
124
128
|
React.createElement("div", {
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
125
131
|
key: `wrapper-${index}`
|
|
126
132
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
127
133
|
,
|
|
@@ -4,9 +4,11 @@ import { injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
7
|
-
import { getRowClassNames, getRowHeights, getRowsParams } from '../../../pm-plugins/utils';
|
|
7
|
+
import { getRowClassNames, getRowHeights, getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
8
8
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
9
9
|
import { tableControlsSpacing, tableToolbarSize } from '../../consts';
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
10
12
|
class RowControlsComponent extends Component {
|
|
11
13
|
constructor(...args) {
|
|
12
14
|
super(...args);
|
|
@@ -68,7 +70,10 @@ class RowControlsComponent extends Component {
|
|
|
68
70
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
69
71
|
marginTop: `${marginTop}px`,
|
|
70
72
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
71
|
-
top: fg('platform_editor_breakout_use_css') ? thisRowSticky ? `3px` : undefined : thisRowSticky ?
|
|
73
|
+
top: fg('platform_editor_breakout_use_css') ? thisRowSticky ? `3px` : undefined : thisRowSticky ?
|
|
74
|
+
// Ignored via go/ees005
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
76
|
+
`${this.props.stickyTop + 3}px` : undefined,
|
|
72
77
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
73
78
|
paddingTop: thisRowSticky ? `${tableControlsSpacing}px` : undefined
|
|
74
79
|
}
|
|
@@ -8,7 +8,8 @@ import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/ad
|
|
|
8
8
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
9
9
|
import { toggleDragMenu } from '../../../pm-plugins/drag-and-drop/commands';
|
|
10
10
|
import { getPluginState as getTablePluginState } from '../../../pm-plugins/plugin-factory';
|
|
11
|
-
import { getRowHeights, getRowsParams
|
|
11
|
+
import { getRowHeights, getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
12
|
+
import { getSelectedRowIndexes } from '../../../pm-plugins/utils/selection';
|
|
12
13
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
13
14
|
import { dropTargetExtendedWidth } from '../../consts';
|
|
14
15
|
import { DragHandle } from '../../DragHandle';
|
|
@@ -101,21 +102,36 @@ const DragControlsComponent = ({
|
|
|
101
102
|
updateCellHoverLocation(Number(rowIndex));
|
|
102
103
|
}, [updateCellHoverLocation]);
|
|
103
104
|
const rowIndexes = useMemo(() => {
|
|
105
|
+
// Ignored via go/ees005
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
104
107
|
return [rowIndex];
|
|
105
108
|
}, [rowIndex]);
|
|
106
109
|
const handleMouseOver = useCallback(() => {
|
|
110
|
+
// Ignored via go/ees005
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
107
112
|
hoverRows([rowIndex]);
|
|
108
113
|
}, [hoverRows, rowIndex]);
|
|
109
114
|
const handleClick = useCallback(e => {
|
|
110
|
-
const isClickOutsideSelectedRows =
|
|
115
|
+
const isClickOutsideSelectedRows =
|
|
116
|
+
// Ignored via go/ees005
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
118
|
+
selectedRowIndexes.length >= 1 && !selectedRowIndexes.includes(rowIndex);
|
|
111
119
|
if (!selectedRowIndexes || selectedRowIndexes.length === 0 || isClickOutsideSelectedRows) {
|
|
120
|
+
// Ignored via go/ees005
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
112
122
|
selectRow(rowIndex, e.shiftKey);
|
|
113
123
|
}
|
|
124
|
+
|
|
125
|
+
// Ignored via go/ees005
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
127
|
if (selectedRowIndexes.length > 1 && selectedRowIndexes.includes(rowIndex) && !e.shiftKey) {
|
|
115
128
|
selectRows(selectedRowIndexes);
|
|
116
129
|
}
|
|
117
130
|
}, [rowIndex, selectRow, selectRows, selectedRowIndexes]);
|
|
118
|
-
const generateHandleByType = (type, appearance, gridRow, indexes
|
|
131
|
+
const generateHandleByType = (type, appearance, gridRow, indexes
|
|
132
|
+
// Ignored via go/ees005
|
|
133
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
134
|
+
) => {
|
|
119
135
|
const isHover = type === 'hover';
|
|
120
136
|
const previewHeight = rowHeights.reduce((sum, v, i) => sum + v * (indexes.includes(i) ? 1 : 0), 0);
|
|
121
137
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -196,7 +212,11 @@ const DragControlsComponent = ({
|
|
|
196
212
|
}, rowsParams.map(({
|
|
197
213
|
startIndex,
|
|
198
214
|
endIndex
|
|
199
|
-
}, index) =>
|
|
215
|
+
}, index) =>
|
|
216
|
+
/*#__PURE__*/
|
|
217
|
+
// Ignored via go/ees005
|
|
218
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
219
|
+
React.createElement(Fragment, {
|
|
200
220
|
key: index
|
|
201
221
|
}, /*#__PURE__*/React.createElement("div", {
|
|
202
222
|
style: {
|
|
@@ -209,11 +229,17 @@ const DragControlsComponent = ({
|
|
|
209
229
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
210
230
|
,
|
|
211
231
|
className: ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER,
|
|
212
|
-
contentEditable: false
|
|
232
|
+
contentEditable: false
|
|
233
|
+
// Ignored via go/ees005
|
|
234
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
235
|
+
,
|
|
213
236
|
key: `insert-dot-${index}`
|
|
214
237
|
}, /*#__PURE__*/React.createElement("div", {
|
|
215
238
|
className: ClassName.DRAG_ROW_FLOATING_INSERT_DOT
|
|
216
|
-
})), isDragging && /*#__PURE__*/React.createElement(RowDropTarget
|
|
239
|
+
})), isDragging && /*#__PURE__*/React.createElement(RowDropTarget
|
|
240
|
+
// Ignored via go/ees005
|
|
241
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
242
|
+
, {
|
|
217
243
|
key: `drop-target-${index}`,
|
|
218
244
|
index: index,
|
|
219
245
|
localId: currentNodeLocalId,
|
|
@@ -6,10 +6,12 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
|
6
6
|
import { hoverCell, hoverRows, selectRow, selectRows } from '../../pm-plugins/commands';
|
|
7
7
|
import { isTableNested } from '../../pm-plugins/utils/nodes';
|
|
8
8
|
import { TableCssClassName as ClassName } from '../../types';
|
|
9
|
-
import { CornerControls
|
|
9
|
+
import { CornerControls } from './CornerControls/ClassicCornerControls';
|
|
10
|
+
import { DragCornerControls, DragCornerControlsWithSelection } from './CornerControls/DragCornerControls';
|
|
10
11
|
import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
|
|
11
12
|
import NumberColumn from './NumberColumn';
|
|
12
|
-
import {
|
|
13
|
+
import { RowControls } from './RowControls/ClassicControls';
|
|
14
|
+
import { DragControls } from './RowControls/DragControls';
|
|
13
15
|
export const TableFloatingControls = ({
|
|
14
16
|
editorView,
|
|
15
17
|
tableRef,
|
|
@@ -38,6 +40,8 @@ export const TableFloatingControls = ({
|
|
|
38
40
|
} = editorView;
|
|
39
41
|
// fix for issue ED-4665
|
|
40
42
|
if (browser.ie_version === 11) {
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
41
45
|
editorView.dom.blur();
|
|
42
46
|
}
|
|
43
47
|
selectRow(row, expand)(state, dispatch);
|
|
@@ -49,6 +53,8 @@ export const TableFloatingControls = ({
|
|
|
49
53
|
} = editorView;
|
|
50
54
|
// fix for issue ED-4665
|
|
51
55
|
if (browser.ie_version === 11) {
|
|
56
|
+
// Ignored via go/ees005
|
|
57
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
52
58
|
editorView.dom.blur();
|
|
53
59
|
}
|
|
54
60
|
selectRows(rowIndexes)(state, dispatch);
|
|
@@ -84,6 +90,8 @@ export const TableFloatingControls = ({
|
|
|
84
90
|
const stickyTop = stickyHeader && stickyHeader.sticky && hasHeaderRow ? stickyHeader.top : undefined;
|
|
85
91
|
const wrapperClassName = isDragAndDropEnabled ? isChromelessEditor ? ClassName.DRAG_ROW_CONTROLS_WRAPPER + ' ' + ClassName.TABLE_CHROMELESS : ClassName.DRAG_ROW_CONTROLS_WRAPPER : ClassName.ROW_CONTROLS_WRAPPER;
|
|
86
92
|
const tablePos = (_findTable = findTable(editorView.state.selection)) === null || _findTable === void 0 ? void 0 : _findTable.pos;
|
|
93
|
+
// Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
87
95
|
const isNested = tablePos !== undefined && isTableNested(editorView.state, tablePos);
|
|
88
96
|
const shouldShowCornerControls = !(featureFlagsState !== null && featureFlagsState !== void 0 && featureFlagsState.elementDragAndDrop) || isNested && !editorExperiment('nested-dnd', true);
|
|
89
97
|
return (
|
|
@@ -125,7 +133,10 @@ export const TableFloatingControls = ({
|
|
|
125
133
|
editorView: editorView,
|
|
126
134
|
tableActive: tableActive,
|
|
127
135
|
isInDanger: isInDanger,
|
|
128
|
-
isResizing: isResizing
|
|
136
|
+
isResizing: isResizing
|
|
137
|
+
// Ignored via go/ees005
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
139
|
+
,
|
|
129
140
|
tableWidth: tableWrapperWidth,
|
|
130
141
|
hoverRows: _hoverRows,
|
|
131
142
|
selectRow: _selectRow,
|
|
@@ -821,6 +821,13 @@ export const baseTableStyles = props => {
|
|
|
821
821
|
color: ${`var(--ds-text-selected, ${N0})`};
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
|
+
|
|
825
|
+
// nested tables should be ignored when we apply border-left: 0 to the parent table
|
|
826
|
+
.${ClassName.TABLE_CONTAINER} {
|
|
827
|
+
.${ClassName.NUMBERED_COLUMN_BUTTON} {
|
|
828
|
+
border-left: 1px solid ${tableBorderColor};
|
|
829
|
+
}
|
|
830
|
+
}
|
|
824
831
|
}
|
|
825
832
|
:not(.${ClassName.IS_RESIZING}) .${ClassName.WITH_CONTROLS} {
|
|
826
833
|
.${ClassName.NUMBERED_COLUMN_BUTTON}:not(.${ClassName.NUMBERED_COLUMN_BUTTON_DISABLED}) {
|
|
@@ -9,8 +9,11 @@ import { addResizeHandleDecorations, clearHoverSelection, hideInsertColumnOrRowB
|
|
|
9
9
|
import { getPluginState as getDragDropPluginState } from '../pm-plugins/drag-and-drop/plugin-factory';
|
|
10
10
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
11
11
|
import { getPluginState as getResizePluginState } from '../pm-plugins/table-resizing/plugin-factory';
|
|
12
|
-
import { deleteColumns
|
|
13
|
-
import {
|
|
12
|
+
import { deleteColumns } from '../pm-plugins/transforms/delete-columns';
|
|
13
|
+
import { deleteRows } from '../pm-plugins/transforms/delete-rows';
|
|
14
|
+
import { getSelectedCellInfo } from '../pm-plugins/utils/analytics';
|
|
15
|
+
import { convertHTMLCellIndexToColumnIndex, getColumnIndexMappedToColumnIndexInFirstRow } from '../pm-plugins/utils/column-controls';
|
|
16
|
+
import { getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, hasResizeHandler, isCell, isColumnControlsDecorations, isCornerButton, isDragColumnFloatingInsertDot, isDragCornerButton, isDragRowFloatingInsertDot, isInsertRowButton, isResizeHandleDecoration, isRowControlsButton, isTableContainerOrWrapper, isTableControlsButton } from '../pm-plugins/utils/dom';
|
|
14
17
|
import { getAllowAddColumnCustomStep } from '../pm-plugins/utils/get-allow-add-column-custom-step';
|
|
15
18
|
import { TableCssClassName as ClassName, RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
|
|
16
19
|
const isFocusingCalendar = event => event instanceof FocusEvent && event.relatedTarget instanceof HTMLElement && event.relatedTarget.getAttribute('aria-label') === 'calendar';
|
|
@@ -45,8 +48,15 @@ export const handleClick = (view, event) => {
|
|
|
45
48
|
return false;
|
|
46
49
|
}
|
|
47
50
|
const element = event.target;
|
|
51
|
+
// Ignored via go/ees005
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
48
53
|
const table = findTable(view.state.selection);
|
|
54
|
+
|
|
55
|
+
// Ignored via go/ees005
|
|
56
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
49
57
|
if (event instanceof MouseEvent && isColumnControlsDecorations(element)) {
|
|
58
|
+
// Ignored via go/ees005
|
|
59
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
50
60
|
const [startIndex] = getColumnOrRowIndex(element);
|
|
51
61
|
const {
|
|
52
62
|
state,
|
|
@@ -57,14 +67,24 @@ export const handleClick = (view, event) => {
|
|
|
57
67
|
const matchfn = element.matches ? element.matches : element.msMatchesSelector;
|
|
58
68
|
|
|
59
69
|
// check if the table cell with an image is clicked and its not the image itself
|
|
60
|
-
if (!table ||
|
|
70
|
+
if (!table ||
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
73
|
+
!isElementInTableCell(element) || !matchfn || matchfn.call(element, 'table .image, table p, table .image div')) {
|
|
61
74
|
return false;
|
|
62
75
|
}
|
|
63
76
|
const map = TableMap.get(table.node);
|
|
64
77
|
|
|
65
78
|
/** Getting the offset of current item clicked */
|
|
66
|
-
|
|
79
|
+
// Ignored via go/ees005
|
|
80
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
81
|
+
const colElement = closestElement(element, 'td') ||
|
|
82
|
+
// Ignored via go/ees005
|
|
83
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
84
|
+
closestElement(element, 'th');
|
|
67
85
|
const colIndex = colElement && colElement.cellIndex;
|
|
86
|
+
// Ignored via go/ees005
|
|
87
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
68
88
|
const rowElement = closestElement(element, 'tr');
|
|
69
89
|
const rowIndex = rowElement && rowElement.rowIndex;
|
|
70
90
|
const cellIndex = map.width * rowIndex + colIndex;
|
|
@@ -353,7 +373,10 @@ export function handleTripleClick(view, pos) {
|
|
|
353
373
|
}
|
|
354
374
|
return false;
|
|
355
375
|
}
|
|
356
|
-
export const handleCut = (oldTr, oldState, newState, api, editorAnalyticsAPI, editorView, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false
|
|
376
|
+
export const handleCut = (oldTr, oldState, newState, api, editorAnalyticsAPI, editorView, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false
|
|
377
|
+
// Ignored via go/ees005
|
|
378
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
379
|
+
) => {
|
|
357
380
|
const oldSelection = oldState.tr.selection;
|
|
358
381
|
let {
|
|
359
382
|
tr
|
|
@@ -434,11 +457,16 @@ export const whenTableInFocus = (eventHandler, pluginInjectionApi) => (view, mou
|
|
|
434
457
|
const trackCellLocation = (view, mouseEvent) => {
|
|
435
458
|
var _tableElement$dataset;
|
|
436
459
|
const target = mouseEvent.target;
|
|
460
|
+
// Ignored via go/ees005
|
|
461
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
437
462
|
const maybeTableCell = isElementInTableCell(target);
|
|
438
463
|
const {
|
|
439
464
|
tableNode,
|
|
440
465
|
tableRef
|
|
441
466
|
} = getPluginState(view.state);
|
|
467
|
+
|
|
468
|
+
// Ignored via go/ees005
|
|
469
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
442
470
|
const tableElement = closestElement(target, 'table');
|
|
443
471
|
|
|
444
472
|
// hover will only trigger if target localId is the same with selected localId
|
|
@@ -449,6 +477,8 @@ const trackCellLocation = (view, mouseEvent) => {
|
|
|
449
477
|
return;
|
|
450
478
|
}
|
|
451
479
|
const htmlColIndex = maybeTableCell.cellIndex;
|
|
480
|
+
// Ignored via go/ees005
|
|
481
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
452
482
|
const rowElement = closestElement(target, 'tr');
|
|
453
483
|
const htmlRowIndex = rowElement && rowElement.rowIndex;
|
|
454
484
|
const tableMap = tableNode && TableMap.get(tableNode);
|
|
@@ -8,5 +8,7 @@ export const SortingIconWrapper = props => {
|
|
|
8
8
|
if ((editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'edit') {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
11
13
|
return /*#__PURE__*/React.createElement(SortingIcon, props);
|
|
12
14
|
};
|
|
@@ -31,18 +31,23 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
31
31
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from '../pm-plugins/commands';
|
|
32
32
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, setTableAlignmentWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleFixedColumnWidthsOptionAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
|
|
33
33
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
34
|
-
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
34
|
+
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing/plugin-key';
|
|
35
35
|
import { getStaticTableScalingPercent } from '../pm-plugins/table-resizing/utils/misc';
|
|
36
36
|
import { getNewResizeStateFromSelectedColumns } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
37
37
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
38
|
-
import { canMergeCells } from '../pm-plugins/transforms';
|
|
39
|
-
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes, isTableNested } from '../pm-plugins/utils';
|
|
38
|
+
import { canMergeCells } from '../pm-plugins/transforms/merge';
|
|
40
39
|
import { normaliseAlignment } from '../pm-plugins/utils/alignment';
|
|
40
|
+
import { isTableNested } from '../pm-plugins/utils/nodes';
|
|
41
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../pm-plugins/utils/selection';
|
|
42
|
+
import { getMergedCellsPositions } from '../pm-plugins/utils/table';
|
|
41
43
|
import { TableCssClassName } from '../types';
|
|
42
44
|
import { FloatingAlignmentButtons } from './FloatingAlignmentButtons/FloatingAlignmentButtons';
|
|
43
45
|
export const getToolbarMenuConfig = (config, state, {
|
|
44
46
|
formatMessage
|
|
45
|
-
}, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown = false, areTableColumnWidthsFixed = false
|
|
47
|
+
}, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown = false, areTableColumnWidthsFixed = false
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
50
|
+
) => {
|
|
46
51
|
const optionItem = 'item-checkbox';
|
|
47
52
|
const options = [{
|
|
48
53
|
id: 'editor.table.lockColumnWidths',
|
|
@@ -124,7 +129,10 @@ export const getToolbarMenuConfig = (config, state, {
|
|
|
124
129
|
// with native widgets. It's enabled via a plugin config.
|
|
125
130
|
export const getToolbarCellOptionsConfig = (editorState, editorView, initialSelectionRect, {
|
|
126
131
|
formatMessage
|
|
127
|
-
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
132
|
+
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
133
|
+
// Ignored via go/ees005
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
135
|
+
) => {
|
|
128
136
|
var _pluginState$pluginCo, _pluginState$pluginCo2;
|
|
129
137
|
const {
|
|
130
138
|
top,
|
|
@@ -323,7 +331,10 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
|
|
|
323
331
|
};
|
|
324
332
|
export const getClosestSelectionRect = state => {
|
|
325
333
|
const selection = state.selection;
|
|
326
|
-
return isSelectionType(selection, 'cell') ?
|
|
334
|
+
return isSelectionType(selection, 'cell') ?
|
|
335
|
+
// Ignored via go/ees005
|
|
336
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
337
|
+
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
327
338
|
};
|
|
328
339
|
const getClosestSelectionOrTableRect = state => {
|
|
329
340
|
const selection = state.selection;
|
|
@@ -333,9 +344,15 @@ const getClosestSelectionOrTableRect = state => {
|
|
|
333
344
|
}
|
|
334
345
|
const map = TableMap.get(tableObject.node);
|
|
335
346
|
const tableRect = new Rect(0, 0, map.width, map.height);
|
|
347
|
+
|
|
348
|
+
// Ignored via go/ees005
|
|
349
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
336
350
|
return isSelectionType(selection, 'cell') ? getSelectionRect(selection) : tableRect;
|
|
337
351
|
};
|
|
338
|
-
export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false
|
|
352
|
+
export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false
|
|
353
|
+
// Ignored via go/ees005
|
|
354
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
355
|
+
) => config => (state, intl) => {
|
|
339
356
|
const tableObject = findTable(state.selection);
|
|
340
357
|
const pluginState = getPluginState(state);
|
|
341
358
|
const resizeState = tableResizingPluginKey.getState(state);
|
|
@@ -358,7 +375,10 @@ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAP
|
|
|
358
375
|
const domAtPos = editorView.domAtPos.bind(editorView);
|
|
359
376
|
const parent = findParentDomRefOfType(nodeType, domAtPos)(state.selection);
|
|
360
377
|
if (parent) {
|
|
361
|
-
const tableRef =
|
|
378
|
+
const tableRef =
|
|
379
|
+
// Ignored via go/ees005
|
|
380
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
381
|
+
parent.querySelector('table') || undefined;
|
|
362
382
|
if (tableRef) {
|
|
363
383
|
element = closestElement(tableRef, `.${TableCssClassName.TABLE_NODE_WRAPPER}`) || undefined;
|
|
364
384
|
}
|
|
@@ -444,17 +464,25 @@ const separator = hidden => {
|
|
|
444
464
|
};
|
|
445
465
|
const getCellItems = (state, view, {
|
|
446
466
|
formatMessage
|
|
447
|
-
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
467
|
+
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
|
|
468
|
+
// Ignored via go/ees005
|
|
469
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
470
|
+
) => {
|
|
448
471
|
const initialSelectionRect = getClosestSelectionRect(state);
|
|
449
472
|
if (initialSelectionRect) {
|
|
450
473
|
const cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
|
|
451
474
|
formatMessage
|
|
452
475
|
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor);
|
|
476
|
+
// Ignored via go/ees005
|
|
477
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
453
478
|
return [cellOptions, separator(cellOptions.hidden)];
|
|
454
479
|
}
|
|
455
480
|
return [];
|
|
456
481
|
};
|
|
457
|
-
const getDistributeConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false
|
|
482
|
+
const getDistributeConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false
|
|
483
|
+
// Ignored via go/ees005
|
|
484
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
485
|
+
) => (state, dispatch, editorView) => {
|
|
458
486
|
const selectionOrTableRect = getClosestSelectionOrTableRect(state);
|
|
459
487
|
if (!editorView || !selectionOrTableRect) {
|
|
460
488
|
return false;
|
|
@@ -471,7 +499,10 @@ const getDistributeConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, i
|
|
|
471
499
|
// fixed column button should be in this function call in the future
|
|
472
500
|
const getColumnSettingItems = (editorState, editorView, {
|
|
473
501
|
formatMessage
|
|
474
|
-
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false
|
|
502
|
+
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false
|
|
503
|
+
// Ignored via go/ees005
|
|
504
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
505
|
+
) => {
|
|
475
506
|
var _newResizeStateWithAn2, _pluginState$pluginCo3;
|
|
476
507
|
const pluginState = getPluginState(editorState);
|
|
477
508
|
const selectionOrTableRect = getClosestSelectionOrTableRect(editorState);
|
|
@@ -501,7 +532,10 @@ const getColumnSettingItems = (editorState, editorView, {
|
|
|
501
532
|
};
|
|
502
533
|
const getColorPicker = (state, menu, {
|
|
503
534
|
formatMessage
|
|
504
|
-
}, editorAnalyticsAPI, getEditorView
|
|
535
|
+
}, editorAnalyticsAPI, getEditorView
|
|
536
|
+
// Ignored via go/ees005
|
|
537
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
538
|
+
) => {
|
|
505
539
|
var _node$attrs;
|
|
506
540
|
const {
|
|
507
541
|
targetCellPosition,
|
|
@@ -526,6 +560,8 @@ const getColorPicker = (state, menu, {
|
|
|
526
560
|
defaultValue: defaultPalette,
|
|
527
561
|
options: cellBackgroundColorPalette,
|
|
528
562
|
returnEscToButton: true,
|
|
563
|
+
// Ignored via go/ees005
|
|
564
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
529
565
|
onChange: option => setColorWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, option.value, getEditorView())
|
|
530
566
|
}, separator(menu.hidden)];
|
|
531
567
|
};
|
|
@@ -558,7 +594,10 @@ const highlightColumnsHandler = (state, dispatch) => {
|
|
|
558
594
|
};
|
|
559
595
|
const getAlignmentOptionsConfig = (editorState, {
|
|
560
596
|
formatMessage
|
|
561
|
-
}, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor, isCommentEditor
|
|
597
|
+
}, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor, isCommentEditor
|
|
598
|
+
// Ignored via go/ees005
|
|
599
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
600
|
+
) => {
|
|
562
601
|
const tableObject = findTable(editorState.selection);
|
|
563
602
|
if (!tableObject) {
|
|
564
603
|
return [];
|
|
@@ -611,6 +650,8 @@ const getAlignmentOptionsConfig = (editorState, {
|
|
|
611
650
|
render: props => {
|
|
612
651
|
return jsx(FloatingAlignmentButtons, _extends({
|
|
613
652
|
alignmentButtons: alignmentButtons
|
|
653
|
+
// Ignored via go/ees005
|
|
654
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
614
655
|
}, props));
|
|
615
656
|
},
|
|
616
657
|
width: 60,
|
|
@@ -631,7 +672,10 @@ const getSelectedAlignmentIcon = (alignmentIcons, selectedNode) => {
|
|
|
631
672
|
const selectedAlignment = selectedNode.attrs.layout;
|
|
632
673
|
return alignmentIcons.find(icon => icon.value === normaliseAlignment(selectedAlignment));
|
|
633
674
|
};
|
|
634
|
-
const isLayoutOptionDisabled = (selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor
|
|
675
|
+
const isLayoutOptionDisabled = (selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor
|
|
676
|
+
// Ignored via go/ees005
|
|
677
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
678
|
+
) => {
|
|
635
679
|
const {
|
|
636
680
|
lineLength
|
|
637
681
|
} = getEditorContainerWidth();
|