@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
|
@@ -18,6 +18,9 @@ import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles';
|
|
|
18
18
|
import ExpandIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
|
19
19
|
import { toggleContextualMenu } from '../../pm-plugins/commands';
|
|
20
20
|
import { TableCssClassName as ClassName } from '../../types';
|
|
21
|
+
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
21
24
|
import FixedButton from './FixedButton';
|
|
22
25
|
import { tableFloatingCellButtonSelectedStyles, tableFloatingCellButtonStyles } from './styles';
|
|
23
26
|
var BUTTON_OFFSET = 3;
|
|
@@ -111,5 +114,8 @@ export default function (props) {
|
|
|
111
114
|
component: ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON,
|
|
112
115
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
113
116
|
fallbackComponent: null
|
|
114
|
-
}, jsx(FloatingContextualButton
|
|
117
|
+
}, jsx(FloatingContextualButton
|
|
118
|
+
// Ignored via go/ees005
|
|
119
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
120
|
+
, props));
|
|
115
121
|
}
|
|
@@ -46,11 +46,15 @@ import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsW
|
|
|
46
46
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
47
47
|
import { pluginKey as tablePluginKey } from '../../pm-plugins/plugin-key';
|
|
48
48
|
import { getNewResizeStateFromSelectedColumns } from '../../pm-plugins/table-resizing/utils/resize-state';
|
|
49
|
-
import { canMergeCells } from '../../pm-plugins/transforms';
|
|
50
|
-
import {
|
|
49
|
+
import { canMergeCells } from '../../pm-plugins/transforms/merge';
|
|
50
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
|
|
51
|
+
import { getMergedCellsPositions } from '../../pm-plugins/utils/table';
|
|
51
52
|
import { TableCssClassName as ClassName } from '../../types';
|
|
52
53
|
import { colorPalletteColumns, contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD } from '../consts';
|
|
53
|
-
import { AddColRightIcon
|
|
54
|
+
import { AddColRightIcon } from '../icons/AddColRightIcon';
|
|
55
|
+
import { AddRowBelowIcon } from '../icons/AddRowBelowIcon';
|
|
56
|
+
import { MergeCellsIcon } from '../icons/MergeCellsIcon';
|
|
57
|
+
import { SplitCellIcon } from '../icons/SplitCellIcon';
|
|
54
58
|
import { cellColourPreviewStyles } from './styles';
|
|
55
59
|
var arrowsList = new Set(['ArrowRight', 'ArrowLeft']);
|
|
56
60
|
var elementBeforeIconStyles = xcss({
|
|
@@ -72,7 +76,10 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
72
76
|
});
|
|
73
77
|
_defineProperty(_this, "dropdownMenuRef", /*#__PURE__*/React.createRef());
|
|
74
78
|
_defineProperty(_this, "handleSubMenuRef", function (ref) {
|
|
75
|
-
var parent = closestElement(
|
|
79
|
+
var parent = closestElement(
|
|
80
|
+
// Ignored via go/ees005
|
|
81
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
82
|
+
_this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
|
|
76
83
|
if (!(parent && ref)) {
|
|
77
84
|
return;
|
|
78
85
|
}
|
|
@@ -100,7 +107,10 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
100
107
|
var background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
|
|
101
108
|
var selectedRowIndex;
|
|
102
109
|
var selectedColumnIndex;
|
|
103
|
-
var selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette,
|
|
110
|
+
var selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette,
|
|
111
|
+
// Ignored via go/ees005
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
113
|
+
background, colorPalletteColumns);
|
|
104
114
|
selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
105
115
|
selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
106
116
|
return {
|
|
@@ -145,7 +155,10 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
145
155
|
}
|
|
146
156
|
}
|
|
147
157
|
},
|
|
148
|
-
isPopupPositioned: true
|
|
158
|
+
isPopupPositioned: true
|
|
159
|
+
// Ignored via go/ees005
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
161
|
+
,
|
|
149
162
|
isOpenedByKeyboard: isCellMenuOpenByKeyboard
|
|
150
163
|
}, jsx(ColorPalette, {
|
|
151
164
|
cols: 7,
|
|
@@ -602,6 +615,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
602
615
|
}
|
|
603
616
|
}
|
|
604
617
|
});
|
|
618
|
+
// Ignored via go/ees005
|
|
619
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
605
620
|
_defineProperty(_this, "handleItemMouseEnter", function (_ref4) {
|
|
606
621
|
var item = _ref4.item;
|
|
607
622
|
var _this$props13 = _this.props,
|
|
@@ -626,6 +641,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
626
641
|
hoverMergedCells()(state, dispatch);
|
|
627
642
|
}
|
|
628
643
|
});
|
|
644
|
+
// Ignored via go/ees005
|
|
645
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
629
646
|
_defineProperty(_this, "handleItemMouseLeave", function (_ref5) {
|
|
630
647
|
var item = _ref5.item;
|
|
631
648
|
var _this$props$editorVie = _this.props.editorView,
|
|
@@ -10,6 +10,9 @@ import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from
|
|
|
10
10
|
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
11
11
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
12
12
|
import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
|
|
13
|
+
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
13
16
|
import ContextualMenu from './ContextualMenu';
|
|
14
17
|
import { tablePopupStyles } from './styles';
|
|
15
18
|
var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
@@ -33,7 +36,10 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
33
36
|
return null;
|
|
34
37
|
}
|
|
35
38
|
var selection = editorView.state.selection;
|
|
36
|
-
var selectionRect = isSelectionType(selection, 'cell') ?
|
|
39
|
+
var selectionRect = isSelectionType(selection, 'cell') ?
|
|
40
|
+
// Ignored via go/ees005
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
42
|
+
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
37
43
|
if (!selectionRect) {
|
|
38
44
|
return null;
|
|
39
45
|
}
|
|
@@ -45,7 +51,10 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
45
51
|
var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
|
|
46
52
|
return jsx(Popup, {
|
|
47
53
|
alignX: "right",
|
|
48
|
-
alignY: "top"
|
|
54
|
+
alignY: "top"
|
|
55
|
+
// Ignored via go/ees005
|
|
56
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
57
|
+
,
|
|
49
58
|
target: targetCellRef,
|
|
50
59
|
mountTo: mountPoint,
|
|
51
60
|
boundariesElement: boundariesElement,
|
|
@@ -66,8 +75,14 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
66
75
|
offset: [contextualMenuTriggerSize / 2, -contextualMenuTriggerSize],
|
|
67
76
|
isOpen: isOpen,
|
|
68
77
|
targetCellPosition: targetCellPosition,
|
|
69
|
-
allowColumnSorting: pluginConfig && pluginConfig.allowColumnSorting
|
|
70
|
-
|
|
78
|
+
allowColumnSorting: pluginConfig && pluginConfig.allowColumnSorting
|
|
79
|
+
// Ignored via go/ees005
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
81
|
+
,
|
|
82
|
+
allowMergeCells: pluginConfig.allowMergeCells
|
|
83
|
+
// Ignored via go/ees005
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
85
|
+
,
|
|
71
86
|
allowBackgroundColor: pluginConfig.allowBackgroundColor,
|
|
72
87
|
selectionRect: selectionRect,
|
|
73
88
|
boundariesElement: boundariesElement,
|
|
@@ -21,7 +21,8 @@ import { getSelectionRect, isTableSelected } from '@atlaskit/editor-tables/utils
|
|
|
21
21
|
import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
|
|
22
22
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
23
23
|
import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-factory';
|
|
24
|
-
import { getColumnDeleteButtonParams, getColumnsWidths
|
|
24
|
+
import { getColumnDeleteButtonParams, getColumnsWidths } from '../../pm-plugins/utils/column-controls';
|
|
25
|
+
import { getRowDeleteButtonParams, getRowHeights } from '../../pm-plugins/utils/row-controls';
|
|
25
26
|
import { TableCssClassName as ClassName } from '../../types';
|
|
26
27
|
import { stickyRowZIndex } from '../consts';
|
|
27
28
|
import DeleteButton from './DeleteButton';
|
|
@@ -37,6 +38,9 @@ function getSelectionType(selection) {
|
|
|
37
38
|
}
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
// Ignored via go/ees005
|
|
43
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
40
44
|
var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
41
45
|
function FloatingDeleteButton(props) {
|
|
42
46
|
var _this;
|
|
@@ -47,6 +51,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
47
51
|
var tableWrapper = closestElement(_this.props.tableRef, ".".concat(ClassName.TABLE_NODE_WRAPPER));
|
|
48
52
|
if (tableWrapper) {
|
|
49
53
|
_this.wrapper = tableWrapper;
|
|
54
|
+
// Ignored via go/ees005
|
|
55
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
50
56
|
_this.wrapper.addEventListener('scroll', _this.onWrapperScrolled);
|
|
51
57
|
_this.setState({
|
|
52
58
|
scrollLeft: tableWrapper.scrollLeft
|
|
@@ -54,6 +60,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
54
60
|
} else {
|
|
55
61
|
if (_this.wrapper) {
|
|
56
62
|
// unsubscribe if we previously had one and it just went away
|
|
63
|
+
// Ignored via go/ees005
|
|
64
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
57
65
|
_this.wrapper.removeEventListener('scroll', _this.onWrapperScrolled);
|
|
58
66
|
|
|
59
67
|
// and reset scroll position
|
|
@@ -65,6 +73,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
65
73
|
}
|
|
66
74
|
});
|
|
67
75
|
_defineProperty(_this, "onWrapperScrolled", function (e) {
|
|
76
|
+
// Ignored via go/ees005
|
|
77
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
68
78
|
var wrapper = e.target;
|
|
69
79
|
_this.setState({
|
|
70
80
|
scrollLeft: wrapper.scrollLeft
|
|
@@ -77,10 +87,14 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
77
87
|
switch (_this.state.selectionType) {
|
|
78
88
|
case 'row':
|
|
79
89
|
{
|
|
90
|
+
// Ignored via go/ees005
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
80
92
|
return hoverRows(_this.state.indexes, true)(state, dispatch, _this.props.editorView);
|
|
81
93
|
}
|
|
82
94
|
case 'column':
|
|
83
95
|
{
|
|
96
|
+
// Ignored via go/ees005
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
84
98
|
return hoverColumns(_this.state.indexes, true)(state, dispatch, _this.props.editorView);
|
|
85
99
|
}
|
|
86
100
|
}
|
|
@@ -155,6 +169,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
155
169
|
key: "componentWillUnmount",
|
|
156
170
|
value: function componentWillUnmount() {
|
|
157
171
|
if (this.wrapper) {
|
|
172
|
+
// Ignored via go/ees005
|
|
173
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
158
174
|
this.wrapper.removeEventListener('scroll', this.onWrapperScrolled);
|
|
159
175
|
}
|
|
160
176
|
}
|
|
@@ -186,6 +202,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
186
202
|
if (this.state.position === 'sticky' && mountTo) {
|
|
187
203
|
var headerRow = tableRef.querySelector('tr.sticky');
|
|
188
204
|
if (headerRow) {
|
|
205
|
+
// Ignored via go/ees005
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
189
207
|
var rect = headerRow.getBoundingClientRect();
|
|
190
208
|
var calculatePosition = popupOpts.onPositionCalculated || function (pos) {
|
|
191
209
|
return pos;
|
|
@@ -217,6 +235,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
217
235
|
scrollableElement: this.wrapper || undefined,
|
|
218
236
|
forcePlacement: true,
|
|
219
237
|
allowOutOfBounds: true
|
|
238
|
+
// Ignored via go/ees005
|
|
239
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
220
240
|
}, popupOpts), button);
|
|
221
241
|
}
|
|
222
242
|
}], [{
|
|
@@ -247,6 +267,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
247
267
|
var deleteBtnParams = getColumnDeleteButtonParams(columnsWidths, nextProps.editorView.state.selection);
|
|
248
268
|
if (deleteBtnParams) {
|
|
249
269
|
return _objectSpread(_objectSpread({}, deleteBtnParams), {}, {
|
|
270
|
+
// Ignored via go/ees005
|
|
271
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
250
272
|
top: inStickyMode ? nextProps.stickyHeaders.top : 0,
|
|
251
273
|
position: inStickyMode ? 'sticky' : undefined,
|
|
252
274
|
selectionType: selectionType
|
|
@@ -31,8 +31,9 @@ import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRow
|
|
|
31
31
|
import { toggleDragMenu } from '../../pm-plugins/drag-and-drop/commands';
|
|
32
32
|
import { getPluginState } from '../../pm-plugins/drag-and-drop/plugin-factory';
|
|
33
33
|
import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-factory';
|
|
34
|
-
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils';
|
|
35
34
|
import { getDragMenuConfig } from '../../pm-plugins/utils/drag-menu';
|
|
35
|
+
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
|
|
36
|
+
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
|
|
36
37
|
import { TableCssClassName as ClassName } from '../../types';
|
|
37
38
|
import { colorPalletteColumns } from '../consts';
|
|
38
39
|
import { DropdownMenu } from './DropdownMenu';
|
|
@@ -215,7 +216,10 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
215
216
|
setIsSubmenuOpen = _useState2[1];
|
|
216
217
|
var _getPluginState = getPluginState(state),
|
|
217
218
|
isKeyboardModeActive = _getPluginState.isKeyboardModeActive;
|
|
218
|
-
var selectionRect = isSelectionType(selection, 'cell') ?
|
|
219
|
+
var selectionRect = isSelectionType(selection, 'cell') ?
|
|
220
|
+
// Ignored via go/ees005
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
222
|
+
getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
219
223
|
var hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
|
|
220
224
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
221
225
|
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor);
|
|
@@ -223,7 +227,10 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
223
227
|
menuItems = _convertToDropdownIte.menuItems,
|
|
224
228
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
225
229
|
var handleSubMenuRef = function handleSubMenuRef(ref) {
|
|
226
|
-
var parent = closestElement(
|
|
230
|
+
var parent = closestElement(
|
|
231
|
+
// Ignored via go/ees005
|
|
232
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
233
|
+
editorView.dom, '.fabric-editor-popup-scroll-parent');
|
|
227
234
|
if (!(parent && ref)) {
|
|
228
235
|
return;
|
|
229
236
|
}
|
|
@@ -290,6 +297,8 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
290
297
|
bubbles: true
|
|
291
298
|
});
|
|
292
299
|
setIsSubmenuOpen(false);
|
|
300
|
+
// Ignored via go/ees005
|
|
301
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
293
302
|
target === null || target === void 0 || target.focus();
|
|
294
303
|
target === null || target === void 0 || target.dispatchEvent(keyboardEvent);
|
|
295
304
|
},
|
|
@@ -442,6 +451,9 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
442
451
|
}
|
|
443
452
|
(item.value.name === 'delete_column' ? hoverColumns(getSelectedColumnIndexes(selectionRect), true) : hoverRows(getSelectedRowIndexes(selectionRect), true))(state, dispatch);
|
|
444
453
|
};
|
|
454
|
+
|
|
455
|
+
// Ignored via go/ees005
|
|
456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
445
457
|
var handleItemMouseLeave = function handleItemMouseLeave(_ref4) {
|
|
446
458
|
var item = _ref4.item;
|
|
447
459
|
if (item.value.name === 'background' && isSubmenuOpen) {
|
|
@@ -10,6 +10,8 @@ import { MenuGroup, Section } from '@atlaskit/menu';
|
|
|
10
10
|
import { dragMenuDropdownWidth } from '../consts';
|
|
11
11
|
var DropListWithOutsideClickTargetRef = function DropListWithOutsideClickTargetRef(props) {
|
|
12
12
|
var setOutsideClickTargetRef = React.useContext(OutsideClickTargetRefContext);
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
13
15
|
return /*#__PURE__*/React.createElement(DropList, _extends({
|
|
14
16
|
onDroplistRef: setOutsideClickTargetRef
|
|
15
17
|
}, props));
|
|
@@ -74,7 +76,10 @@ export var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
74
76
|
}, items.map(function (group, index) {
|
|
75
77
|
return /*#__PURE__*/React.createElement(Section, {
|
|
76
78
|
hasSeparator: (section === null || section === void 0 ? void 0 : section.hasSeparator) && index > 0,
|
|
77
|
-
title: section === null || section === void 0 ? void 0 : section.title
|
|
79
|
+
title: section === null || section === void 0 ? void 0 : section.title
|
|
80
|
+
// Ignored via go/ees005
|
|
81
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
82
|
+
,
|
|
78
83
|
key: index
|
|
79
84
|
}, group.items.map(function (item) {
|
|
80
85
|
var _item$key;
|
|
@@ -97,7 +102,10 @@ export var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
97
102
|
}, /*#__PURE__*/React.createElement("div", {
|
|
98
103
|
className: "drag-dropdown-menu-popup-ref",
|
|
99
104
|
ref: handleRef
|
|
100
|
-
}), /*#__PURE__*/React.createElement(Popup
|
|
105
|
+
}), /*#__PURE__*/React.createElement(Popup
|
|
106
|
+
// Ignored via go/ees005
|
|
107
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
108
|
+
, {
|
|
101
109
|
target: targetRefDiv,
|
|
102
110
|
mountTo: mountPoint,
|
|
103
111
|
boundariesElement: boundariesElement,
|
|
@@ -129,6 +137,9 @@ export var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
129
137
|
// the correct menu item is sent in onItemActivated callback
|
|
130
138
|
var keys = ['row_numbers', 'header_row', 'header_column'];
|
|
131
139
|
var doubleItemCount = 0;
|
|
140
|
+
|
|
141
|
+
// Ignored via go/ees005
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
132
143
|
var firstIndex = results.findIndex(function (value) {
|
|
133
144
|
return keys.includes(value.key);
|
|
134
145
|
});
|
|
@@ -139,6 +150,8 @@ export var DropdownMenu = function DropdownMenu(_ref) {
|
|
|
139
150
|
return;
|
|
140
151
|
}
|
|
141
152
|
for (var i = firstIndex; i < results.length; i += 1) {
|
|
153
|
+
// Ignored via go/ees005
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
142
155
|
if (keys.includes(results[i].key)) {
|
|
143
156
|
doubleItemCount += 1;
|
|
144
157
|
}
|
|
@@ -39,7 +39,10 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
39
39
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (tableWithFixedColumnWidthsOption || isCommentEditor);
|
|
40
40
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
41
41
|
alignX: direction === 'row' ? 'right' : undefined,
|
|
42
|
-
alignY: direction === 'row' ? 'start' : undefined
|
|
42
|
+
alignY: direction === 'row' ? 'start' : undefined
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
45
|
+
,
|
|
43
46
|
target: targetHandleRef,
|
|
44
47
|
mountTo: mountPoint,
|
|
45
48
|
boundariesElement: boundariesElement,
|
|
@@ -42,7 +42,11 @@ var getInsertLineWidth = function getInsertLineWidth(tableRef, isDragAndDropEnab
|
|
|
42
42
|
var DRAG_LINE_OFFSET = isChromelessEditor ? 14 : 6;
|
|
43
43
|
var parentElement = tableRef.parentElement,
|
|
44
44
|
offsetWidth = tableRef.offsetWidth;
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
45
47
|
var parentOffsetWidth = parentElement.offsetWidth;
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
50
|
var _ref = parentElement,
|
|
47
51
|
scrollLeft = _ref.scrollLeft;
|
|
48
52
|
var diff = offsetWidth - parentOffsetWidth;
|
|
@@ -32,6 +32,9 @@ function getRowOptions(index, isDragAndDropEnabled) {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
35
38
|
function getColumnOptions(index, tableContainer, hasNumberedColumns, isDragAndDropEnabled) {
|
|
36
39
|
var options = {
|
|
37
40
|
alignX: 'end',
|
|
@@ -72,6 +75,9 @@ function getColumnOptions(index, tableContainer, hasNumberedColumns, isDragAndDr
|
|
|
72
75
|
}
|
|
73
76
|
return options;
|
|
74
77
|
}
|
|
78
|
+
|
|
79
|
+
// Ignored via go/ees005
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
75
81
|
function getPopupOptions(direction, index, hasNumberedColumns, isDragAndDropEnabled, tableContainer) {
|
|
76
82
|
switch (direction) {
|
|
77
83
|
case 'column':
|
|
@@ -18,10 +18,12 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
18
18
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
19
19
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
20
20
|
import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
21
|
-
import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils';
|
|
21
|
+
import { checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
|
|
22
22
|
import { TableCssClassName as ClassName } from '../../types';
|
|
23
23
|
import getPopupOptions from './getPopupOptions';
|
|
24
24
|
import InsertButton, { DragAndDropInsertButton } from './InsertButton';
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
25
27
|
export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
26
28
|
function FloatingInsertButton(props) {
|
|
27
29
|
var _this;
|
|
@@ -96,6 +98,8 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
96
98
|
selection: editorView.state.selection.toJSON(),
|
|
97
99
|
position: pos,
|
|
98
100
|
docSize: editorView.state.doc.nodeSize,
|
|
101
|
+
// Ignored via go/ees005
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
103
|
error: error === null || error === void 0 ? void 0 : error.toString()
|
|
100
104
|
}
|
|
101
105
|
};
|
|
@@ -111,6 +115,9 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
111
115
|
}
|
|
112
116
|
var tableContainerWrapper = closestElement(targetCellRef, ".".concat(ClassName.TABLE_CONTAINER));
|
|
113
117
|
var tableWrapper = closestElement(targetCellRef, ".".concat(ClassName.TABLE_NODE_WRAPPER));
|
|
118
|
+
|
|
119
|
+
// Ignored via go/ees005
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
121
|
var index = type === 'column' ? insertColumnButtonIndex : insertRowButtonIndex;
|
|
115
122
|
var hasNumberedColumns = checkIfNumberColumnEnabled(editorView.state.selection);
|
|
116
123
|
|
|
@@ -122,10 +129,15 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
122
129
|
return /*#__PURE__*/React.createElement(Popup, _extends({
|
|
123
130
|
target: targetCellRef,
|
|
124
131
|
mountTo: tableContainerWrapper || mountPoint,
|
|
125
|
-
boundariesElement: tableContainerWrapper || boundariesElement
|
|
132
|
+
boundariesElement: tableContainerWrapper || boundariesElement
|
|
133
|
+
// Ignored via go/ees005
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
135
|
+
,
|
|
126
136
|
scrollableElement: tableWrapper,
|
|
127
137
|
forcePlacement: true,
|
|
128
138
|
allowOutOfBounds: true
|
|
139
|
+
// Ignored via go/ees005
|
|
140
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
129
141
|
}, getPopupOptions(type, index, hasNumberedColumns, !!isDragAndDropEnabled, tableContainerWrapper), {
|
|
130
142
|
zIndex: zIndex
|
|
131
143
|
}), isDragAndDropEnabled ? /*#__PURE__*/React.createElement(DragAndDropInsertButton, {
|
|
@@ -147,18 +159,30 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
147
159
|
var _this$props2 = this.props,
|
|
148
160
|
insertColumnButtonIndex = _this$props2.insertColumnButtonIndex,
|
|
149
161
|
insertRowButtonIndex = _this$props2.insertRowButtonIndex;
|
|
162
|
+
// Ignored via go/ees005
|
|
163
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
150
164
|
var tableMap = TableMap.get(tableNode);
|
|
151
165
|
if (type === 'column') {
|
|
166
|
+
// Ignored via go/ees005
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
152
168
|
var columnIndex = insertColumnButtonIndex === 0 ? 0 : insertColumnButtonIndex - 1;
|
|
153
169
|
if (columnIndex > tableMap.width - 1) {
|
|
154
170
|
return null;
|
|
155
171
|
}
|
|
172
|
+
|
|
173
|
+
// Ignored via go/ees005
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
156
175
|
return tableMap.positionAt(0, columnIndex, tableNode);
|
|
157
176
|
} else {
|
|
177
|
+
// Ignored via go/ees005
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
158
179
|
var rowIndex = insertRowButtonIndex === 0 ? 0 : insertRowButtonIndex - 1;
|
|
159
180
|
if (rowIndex > tableMap.height - 1) {
|
|
160
181
|
return null;
|
|
161
182
|
}
|
|
183
|
+
|
|
184
|
+
// Ignored via go/ees005
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
162
186
|
return tableMap.positionAt(rowIndex, 0, tableNode);
|
|
163
187
|
}
|
|
164
188
|
}
|
|
@@ -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
|
var getSelectedColumns = function getSelectedColumns(selection) {
|
|
@@ -61,17 +62,27 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
61
62
|
var handleClick = useCallback(function (event) {
|
|
62
63
|
var state = editorView.state,
|
|
63
64
|
dispatch = editorView.dispatch;
|
|
64
|
-
var isClickOutsideSelectedCols =
|
|
65
|
+
var isClickOutsideSelectedCols =
|
|
66
|
+
// Ignored via go/ees005
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
68
|
+
selectedColIndexes.length >= 1 && !selectedColIndexes.includes(colIndex);
|
|
65
69
|
if (!selectedColIndexes || selectedColIndexes.length === 0 || isClickOutsideSelectedCols) {
|
|
70
|
+
// Ignored via go/ees005
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
66
72
|
selectColumn(colIndex, event.shiftKey)(state, dispatch);
|
|
67
73
|
}
|
|
68
|
-
if (selectedColIndexes.length > 1 &&
|
|
74
|
+
if (selectedColIndexes.length > 1 &&
|
|
75
|
+
// Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
77
|
+
selectedColIndexes.includes(colIndex) && !event.shiftKey) {
|
|
69
78
|
selectColumns(selectedColIndexes)(state, dispatch);
|
|
70
79
|
}
|
|
71
80
|
}, [colIndex, selectedColIndexes, editorView]);
|
|
72
81
|
var handleMouseOver = useCallback(function () {
|
|
73
82
|
var state = editorView.state,
|
|
74
83
|
dispatch = editorView.dispatch;
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
75
86
|
hoverColumns([colIndex])(state, dispatch);
|
|
76
87
|
}, [colIndex, editorView]);
|
|
77
88
|
var handleMouseMove = useCallback(function (e) {
|
|
@@ -110,13 +121,18 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
110
121
|
toggleDragMenu(undefined, 'column', colIndex, trigger)(state, dispatch);
|
|
111
122
|
}, [editorView, colIndex]);
|
|
112
123
|
var colIndexes = useMemo(function () {
|
|
124
|
+
// Ignored via go/ees005
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
113
126
|
return [colIndex];
|
|
114
127
|
}, [colIndex]);
|
|
115
128
|
if (stickyTop && columnControlsRef.current) {
|
|
116
129
|
var _getScrollOffset;
|
|
117
130
|
columnControlsRef.current.scrollLeft = (_getScrollOffset = getScrollOffset === null || getScrollOffset === void 0 ? void 0 : getScrollOffset()) !== null && _getScrollOffset !== void 0 ? _getScrollOffset : 0;
|
|
118
131
|
}
|
|
119
|
-
var generateHandleByType = function generateHandleByType(type, appearance, gridColumn, indexes
|
|
132
|
+
var generateHandleByType = function generateHandleByType(type, appearance, gridColumn, indexes
|
|
133
|
+
// Ignored via go/ees005
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
135
|
+
) {
|
|
120
136
|
var _rowHeights$reduce, _colWidths$reduce;
|
|
121
137
|
var isHover = type === 'hover';
|
|
122
138
|
var isPlaceholder = appearance === 'placeholder';
|
|
@@ -183,7 +199,10 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
183
199
|
// always position placeholder in first column to avoid overflow issues
|
|
184
200
|
selectedAppearance === 'placeholder' ? '1 / span 1' : "".concat(selectedColIndexes[0] + 1, " / span ").concat(selectedColIndexes.length), selectedColIndexes));
|
|
185
201
|
if (hoveredCell && isTableHovered && colIndex !== undefined && !selectedColIndexes.includes(colIndex)) {
|
|
186
|
-
handles.push(
|
|
202
|
+
handles.push(
|
|
203
|
+
// Ignored via go/ees005
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
205
|
+
generateHandleByType('hover', 'default', "".concat(colIndex + 1, " / span 1"), colIndexes));
|
|
187
206
|
}
|
|
188
207
|
return handles;
|
|
189
208
|
};
|
|
@@ -223,7 +242,10 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
223
242
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
224
243
|
,
|
|
225
244
|
className: ClassName.DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER,
|
|
226
|
-
contentEditable: false
|
|
245
|
+
contentEditable: false
|
|
246
|
+
// Ignored via go/ees005
|
|
247
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
248
|
+
,
|
|
227
249
|
key: index
|
|
228
250
|
}, /*#__PURE__*/React.createElement("div", {
|
|
229
251
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -27,7 +27,10 @@ export var ColumnDropTargets = function ColumnDropTargets(_ref) {
|
|
|
27
27
|
className: ClassName.DRAG_COLUMN_CONTROLS_INNER,
|
|
28
28
|
"data-testid": "table-floating-column-controls-drop-targets"
|
|
29
29
|
}, colWidths === null || colWidths === void 0 ? void 0 : colWidths.map(function (width, index) {
|
|
30
|
-
return /*#__PURE__*/React.createElement(ColumnDropTarget
|
|
30
|
+
return /*#__PURE__*/React.createElement(ColumnDropTarget
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
33
|
+
, {
|
|
31
34
|
key: index,
|
|
32
35
|
index: index,
|
|
33
36
|
localId: localId,
|
|
@@ -3,7 +3,9 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
5
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
|
-
import {
|
|
6
|
+
import { getColumnsWidths } from '../../pm-plugins/utils/column-controls';
|
|
7
|
+
import { containsHeaderColumn } from '../../pm-plugins/utils/nodes';
|
|
8
|
+
import { getRowHeights } from '../../pm-plugins/utils/row-controls';
|
|
7
9
|
import { TableCssClassName as ClassName } from '../../types';
|
|
8
10
|
import { ColumnControls } from './ColumnControls';
|
|
9
11
|
import { ColumnDropTargets } from './ColumnDropTargets';
|
|
@@ -67,7 +69,9 @@ var TableFloatingColumnControls = function TableFloatingColumnControls(_ref) {
|
|
|
67
69
|
var _rowHeights$, _containerRef$current;
|
|
68
70
|
var columnControlTopOffsetFromParent = '-12px';
|
|
69
71
|
var headerRowHeight = hasHeaderRow && stickyTop !== undefined ? (_rowHeights$ = rowHeights === null || rowHeights === void 0 ? void 0 : rowHeights[0]) !== null && _rowHeights$ !== void 0 ? _rowHeights$ : 0 : 0;
|
|
70
|
-
containerRef === null || containerRef === void 0 || (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 || _containerRef$current.style.setProperty('top', fg('platform_editor_breakout_use_css') ? columnControlTopOffsetFromParent :
|
|
72
|
+
containerRef === null || containerRef === void 0 || (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 || _containerRef$current.style.setProperty('top', fg('platform_editor_breakout_use_css') ? columnControlTopOffsetFromParent : // Ignored via go/ees005
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
74
|
+
"".concat(stickyTop - headerRowHeight + 33, "px") // 33px is padding and margin applied on tr.sticky
|
|
71
75
|
);
|
|
72
76
|
} else {
|
|
73
77
|
var _containerRef$current2;
|
|
@@ -15,6 +15,8 @@ import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables
|
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import { clearHoverSelection, hoverTable } from '../../../pm-plugins/commands';
|
|
17
17
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
18
20
|
var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
19
21
|
function CornerControlComponent() {
|
|
20
22
|
var _this;
|
|
@@ -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 var FloatingControlsWithSelection = function FloatingControlsWithSelection(_ref) {
|
|
6
6
|
var editorView = _ref.editorView,
|
|
7
7
|
tableRef = _ref.tableRef,
|
|
@@ -12,9 +12,11 @@ import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
|
12
12
|
import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
15
|
-
import { getRowHeights } from '../../../pm-plugins/utils';
|
|
15
|
+
import { getRowHeights } from '../../../pm-plugins/utils/row-controls';
|
|
16
16
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
17
17
|
import { tableBorderColor } from '../../consts';
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components, @typescript-eslint/no-explicit-any
|
|
18
20
|
var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
19
21
|
function NumberColumn() {
|
|
20
22
|
var _this;
|
|
@@ -114,6 +116,8 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
114
116
|
/*#__PURE__*/
|
|
115
117
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
116
118
|
React.createElement("div", {
|
|
119
|
+
// Ignored via go/ees005
|
|
120
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
117
121
|
key: "wrapper-".concat(index)
|
|
118
122
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
119
123
|
,
|
|
@@ -131,6 +135,8 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
131
135
|
/*#__PURE__*/
|
|
132
136
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
133
137
|
React.createElement("div", {
|
|
138
|
+
// Ignored via go/ees005
|
|
139
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
134
140
|
key: "wrapper-".concat(index)
|
|
135
141
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
136
142
|
,
|