@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
|
@@ -13,6 +13,8 @@ import type { PluginInjectionAPI, TableSharedStateInternal } from '../types';
|
|
|
13
13
|
import TableComponent from './TableComponent';
|
|
14
14
|
import type { TableOptions } from './types';
|
|
15
15
|
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
18
|
type ForwardRef = (node: HTMLElement | null) => any;
|
|
17
19
|
|
|
18
20
|
type TableComponentWithSharedStateProps = {
|
|
@@ -113,6 +115,8 @@ export const TableComponentWithSharedState = ({
|
|
|
113
115
|
ordering={ordering}
|
|
114
116
|
isResizing={isResizing}
|
|
115
117
|
getNode={getNode}
|
|
118
|
+
// Ignored via go/ees005
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
116
120
|
containerWidth={widthState!}
|
|
117
121
|
contentDOM={forwardRef}
|
|
118
122
|
getEditorFeatureFlags={getEditorFeatureFlags}
|
|
@@ -25,7 +25,7 @@ import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
|
25
25
|
import {
|
|
26
26
|
TABLE_MAX_WIDTH,
|
|
27
27
|
TABLE_OFFSET_IN_COMMENT_EDITOR,
|
|
28
|
-
} from '../pm-plugins/table-resizing/utils';
|
|
28
|
+
} from '../pm-plugins/table-resizing/utils/consts';
|
|
29
29
|
import { ALIGN_CENTER, ALIGN_START } from '../pm-plugins/utils/alignment';
|
|
30
30
|
import type { PluginInjectionAPI, TableSharedState } from '../types';
|
|
31
31
|
import { TableCssClassName as ClassName } from '../types';
|
|
@@ -371,6 +371,8 @@ export const ResizableTableContainer = React.memo(
|
|
|
371
371
|
{children}
|
|
372
372
|
</InnerContainer>
|
|
373
373
|
) : (
|
|
374
|
+
// Ignored via go/ees005
|
|
375
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
374
376
|
<TableResizer {...tableResizerProps}>
|
|
375
377
|
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766 */}
|
|
376
378
|
<InnerContainer className={className} node={node}>
|
|
@@ -433,7 +435,11 @@ export const TableContainer = ({
|
|
|
433
435
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
434
436
|
className={className}
|
|
435
437
|
node={node}
|
|
438
|
+
// Ignored via go/ees005
|
|
439
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
436
440
|
containerWidth={editorWidth!}
|
|
441
|
+
// Ignored via go/ees005
|
|
442
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
437
443
|
lineLength={lineLength!}
|
|
438
444
|
editorView={editorView}
|
|
439
445
|
getPos={getPos}
|
|
@@ -7,12 +7,16 @@ export default abstract class TableNodeView<T extends HTMLElement> implements No
|
|
|
7
7
|
/**
|
|
8
8
|
* @constructor
|
|
9
9
|
*/
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
12
|
constructor(
|
|
11
13
|
protected node: PmNode,
|
|
12
14
|
protected readonly view: EditorView,
|
|
13
15
|
protected readonly getPos: () => number | undefined,
|
|
14
16
|
protected readonly eventDispatcher: EventDispatcher,
|
|
15
17
|
) {
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
20
|
const { dom, contentDOM } = DOMSerializer.renderSpec(document, node.type.spec.toDOM!(node));
|
|
17
21
|
|
|
18
22
|
this.dom = dom as T;
|
|
@@ -31,14 +31,13 @@ import { token } from '@atlaskit/tokens';
|
|
|
31
31
|
import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
|
|
32
32
|
import { updateWidthToWidest } from '../pm-plugins/commands/misc';
|
|
33
33
|
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
34
|
+
import { getColgroupChildrenLength } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
34
35
|
import {
|
|
35
36
|
COLUMN_MIN_WIDTH,
|
|
36
|
-
getColgroupChildrenLength,
|
|
37
|
-
previewScaleTable,
|
|
38
|
-
scaleTable,
|
|
39
37
|
TABLE_MAX_WIDTH,
|
|
40
38
|
TABLE_OFFSET_IN_COMMENT_EDITOR,
|
|
41
|
-
} from '../pm-plugins/table-resizing/utils';
|
|
39
|
+
} from '../pm-plugins/table-resizing/utils/consts';
|
|
40
|
+
import { previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils/scale-table';
|
|
42
41
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
43
42
|
import {
|
|
44
43
|
ALIGN_CENTER,
|
|
@@ -153,6 +152,8 @@ const getVisibleGuidelines = (
|
|
|
153
152
|
lineLength: number,
|
|
154
153
|
isTableScalingEnabled: boolean,
|
|
155
154
|
isFullWidthModeEnabled: boolean,
|
|
155
|
+
// Ignored via go/ees005
|
|
156
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
156
157
|
) => {
|
|
157
158
|
let guidelineVisibleAdjustment = TABLE_GUIDELINE_VISIBLE_ADJUSTMENT;
|
|
158
159
|
if (isTableScalingEnabled) {
|
|
@@ -319,9 +320,13 @@ export const TableResizer = ({
|
|
|
319
320
|
(
|
|
320
321
|
pos: number,
|
|
321
322
|
node: PMNode,
|
|
323
|
+
// Ignored via go/ees005
|
|
324
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
322
325
|
newWidth: any,
|
|
323
326
|
state: EditorState,
|
|
324
327
|
dispatch: ((tr: Transaction) => void) | undefined,
|
|
328
|
+
// Ignored via go/ees005
|
|
329
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
325
330
|
) => {
|
|
326
331
|
if (
|
|
327
332
|
shouldChangeAlignmentToCenterResized(isTableAlignmentEnabled, node, lineLength, newWidth) &&
|
|
@@ -424,6 +429,8 @@ export const TableResizer = ({
|
|
|
424
429
|
]);
|
|
425
430
|
|
|
426
431
|
const handleResize = useCallback(
|
|
432
|
+
// Ignored via go/ees005
|
|
433
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
427
434
|
(originalState: any, delta: any) => {
|
|
428
435
|
countFrames();
|
|
429
436
|
const newWidth = originalState.width + delta.width;
|
|
@@ -591,6 +598,8 @@ export const TableResizer = ({
|
|
|
591
598
|
});
|
|
592
599
|
}
|
|
593
600
|
|
|
601
|
+
// Ignored via go/ees005
|
|
602
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
594
603
|
const newNode = tr.doc.nodeAt(pos)!;
|
|
595
604
|
tr = scaleTable(
|
|
596
605
|
tableRef,
|
|
@@ -610,6 +619,8 @@ export const TableResizer = ({
|
|
|
610
619
|
isCommentEditor,
|
|
611
620
|
)(tr);
|
|
612
621
|
|
|
622
|
+
// Ignored via go/ees005
|
|
623
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
613
624
|
const scaledNode = tr.doc.nodeAt(pos)!;
|
|
614
625
|
|
|
615
626
|
attachAnalyticsEvent(
|
|
@@ -746,12 +757,24 @@ export const TableResizer = ({
|
|
|
746
757
|
};
|
|
747
758
|
|
|
748
759
|
const editorViewDom = editorView?.dom as HTMLElement | undefined;
|
|
760
|
+
// Ignored via go/ees005
|
|
761
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
749
762
|
editorViewDom?.addEventListener('keydown', globalKeyDownHandler);
|
|
763
|
+
// Ignored via go/ees005
|
|
764
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
750
765
|
resizeHandleThumbEl?.addEventListener('keydown', handleKeyDown);
|
|
766
|
+
// Ignored via go/ees005
|
|
767
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
751
768
|
resizeHandleThumbEl?.addEventListener('keyup', handleKeyUp);
|
|
752
769
|
return () => {
|
|
770
|
+
// Ignored via go/ees005
|
|
771
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
753
772
|
editorViewDom?.removeEventListener('keydown', globalKeyDownHandler);
|
|
773
|
+
// Ignored via go/ees005
|
|
774
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
754
775
|
resizeHandleThumbEl?.removeEventListener('keydown', handleKeyDown);
|
|
776
|
+
// Ignored via go/ees005
|
|
777
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
755
778
|
resizeHandleThumbEl?.removeEventListener('keyup', handleKeyUp);
|
|
756
779
|
};
|
|
757
780
|
}, [resizerRef, editorView, handleResizeStop, isTableSelected, handleKeyDown, handleKeyUp]);
|
|
@@ -42,6 +42,8 @@ const HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
|
|
|
42
42
|
const HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT = 400;
|
|
43
43
|
|
|
44
44
|
export default class TableRow extends TableNodeView<HTMLTableRowElement> implements NodeView {
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
47
|
constructor(
|
|
46
48
|
node: PMNode,
|
|
47
49
|
view: EditorView,
|
|
@@ -104,6 +106,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
104
106
|
/**
|
|
105
107
|
* Methods: Nodeview Lifecycle
|
|
106
108
|
*/
|
|
109
|
+
// Ignored via go/ees005
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
111
|
update(node: PMNode, ..._args: any[]) {
|
|
108
112
|
// do nothing if nodes were identical
|
|
109
113
|
if (node === this.node) {
|
|
@@ -196,6 +200,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
196
200
|
}, HEADER_ROW_SCROLL_THROTTLE_TIMEOUT);
|
|
197
201
|
|
|
198
202
|
private subscribe() {
|
|
203
|
+
// Ignored via go/ees005
|
|
204
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
199
205
|
this.editorScrollableElement = findOverflowScrollParent(this.view.dom as HTMLElement) || window;
|
|
200
206
|
|
|
201
207
|
if (this.editorScrollableElement) {
|
|
@@ -205,13 +211,19 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
205
211
|
|
|
206
212
|
this.eventDispatcher.on('widthPlugin', this.updateStickyHeaderWidth.bind(this));
|
|
207
213
|
|
|
214
|
+
// Ignored via go/ees005
|
|
215
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
208
216
|
this.eventDispatcher.on((tablePluginKey as any).key, this.onTablePluginState.bind(this));
|
|
209
217
|
|
|
210
218
|
this.listening = true;
|
|
211
219
|
|
|
220
|
+
// Ignored via go/ees005
|
|
221
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
212
222
|
this.dom.addEventListener('wheel', this.headerRowMouseScroll.bind(this), {
|
|
213
223
|
passive: true,
|
|
214
224
|
});
|
|
225
|
+
// Ignored via go/ees005
|
|
226
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
215
227
|
this.dom.addEventListener('touchmove', this.headerRowMouseScroll.bind(this), { passive: true });
|
|
216
228
|
}
|
|
217
229
|
|
|
@@ -235,11 +247,17 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
235
247
|
}
|
|
236
248
|
|
|
237
249
|
this.eventDispatcher.off('widthPlugin', this.updateStickyHeaderWidth);
|
|
250
|
+
// Ignored via go/ees005
|
|
251
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
238
252
|
this.eventDispatcher.off((tablePluginKey as any).key, this.onTablePluginState);
|
|
239
253
|
|
|
240
254
|
this.listening = false;
|
|
241
255
|
|
|
256
|
+
// Ignored via go/ees005
|
|
257
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
242
258
|
this.dom.removeEventListener('wheel', this.headerRowMouseScroll);
|
|
259
|
+
// Ignored via go/ees005
|
|
260
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
243
261
|
this.dom.removeEventListener('touchmove', this.headerRowMouseScroll);
|
|
244
262
|
}
|
|
245
263
|
|
|
@@ -258,6 +276,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
258
276
|
|
|
259
277
|
this.resizeObserver.observe(this.dom);
|
|
260
278
|
if (this.editorScrollableElement) {
|
|
279
|
+
// Ignored via go/ees005
|
|
280
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
261
281
|
this.resizeObserver.observe(this.editorScrollableElement as HTMLElement);
|
|
262
282
|
}
|
|
263
283
|
|
|
@@ -267,9 +287,13 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
267
287
|
`.${TableCssClassName.NODEVIEW_WRAPPER}`,
|
|
268
288
|
);
|
|
269
289
|
if (tableContainer) {
|
|
290
|
+
// Ignored via go/ees005
|
|
291
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
270
292
|
this.sentinels.top = tableContainer
|
|
271
293
|
.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_TOP)
|
|
272
294
|
.item(0) as HTMLElement;
|
|
295
|
+
// Ignored via go/ees005
|
|
296
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
273
297
|
this.sentinels.bottom = tableContainer
|
|
274
298
|
.getElementsByClassName(ClassName.TABLE_STICKY_SENTINEL_BOTTOM)
|
|
275
299
|
.item(0) as HTMLElement;
|
|
@@ -277,6 +301,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
277
301
|
// skip if already observed for another row on this table
|
|
278
302
|
if (el && !el.dataset.isObserved) {
|
|
279
303
|
el.dataset.isObserved = 'true';
|
|
304
|
+
// Ignored via go/ees005
|
|
305
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
280
306
|
this.intersectionObserver!.observe(el);
|
|
281
307
|
}
|
|
282
308
|
});
|
|
@@ -296,12 +322,16 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
296
322
|
entries.forEach((entry) => {
|
|
297
323
|
// On resize of the parent scroll element we need to adjust the width
|
|
298
324
|
// of the sticky header
|
|
325
|
+
// Ignored via go/ees005
|
|
326
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
299
327
|
if (entry.target.className === (this.editorScrollableElement as HTMLElement)?.className) {
|
|
300
328
|
this.updateStickyHeaderWidth();
|
|
301
329
|
} else {
|
|
302
330
|
const newHeight = entry.contentRect
|
|
303
331
|
? entry.contentRect.height
|
|
304
|
-
:
|
|
332
|
+
: // Ignored via go/ees005
|
|
333
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
334
|
+
(entry.target as HTMLElement).offsetHeight;
|
|
305
335
|
|
|
306
336
|
if (
|
|
307
337
|
this.sentinels.bottom &&
|
|
@@ -471,11 +501,15 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
471
501
|
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
472
502
|
// move table a little out of the way
|
|
473
503
|
// to provide spacing for table controls
|
|
504
|
+
// Ignored via go/ees005
|
|
505
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
474
506
|
tableContentWrapper!.style.paddingLeft = '11px';
|
|
475
507
|
}
|
|
476
508
|
} else {
|
|
477
509
|
this.colControlsOffset = 0;
|
|
478
510
|
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
511
|
+
// Ignored via go/ees005
|
|
512
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
479
513
|
tableContentWrapper!.style.removeProperty('padding-left');
|
|
480
514
|
}
|
|
481
515
|
}
|
|
@@ -546,6 +580,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
546
580
|
* detaches from the table. This typically happens during a fast scroll by the user which causes
|
|
547
581
|
* the intersection observer logic to not fire as expected.
|
|
548
582
|
*/
|
|
583
|
+
// Ignored via go/ees005
|
|
584
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
549
585
|
this.editorScrollableElement?.addEventListener(
|
|
550
586
|
'scrollend',
|
|
551
587
|
this.refireIntersectionObservers,
|
|
@@ -612,6 +648,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
612
648
|
|
|
613
649
|
this.top = top;
|
|
614
650
|
this.padding = padding;
|
|
651
|
+
// Ignored via go/ees005
|
|
652
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
615
653
|
const pos = this.getPos()!;
|
|
616
654
|
|
|
617
655
|
if (Number.isFinite(pos)) {
|
|
@@ -631,6 +669,8 @@ export default class TableRow extends TableNodeView<HTMLTableRowElement> impleme
|
|
|
631
669
|
|
|
632
670
|
this.top = 0;
|
|
633
671
|
this.padding = 0;
|
|
672
|
+
// Ignored via go/ees005
|
|
673
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
634
674
|
const pos = this.getPos()!;
|
|
635
675
|
|
|
636
676
|
if (!isEditorDestroyed && Number.isFinite(pos)) {
|
|
@@ -36,6 +36,8 @@ export class TableStickyScrollbar {
|
|
|
36
36
|
|
|
37
37
|
dispose() {
|
|
38
38
|
if (this.stickyScrollbarContainerElement) {
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
39
41
|
this.stickyScrollbarContainerElement.removeEventListener('scroll', this.handleScroll);
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -58,6 +60,8 @@ export class TableStickyScrollbar {
|
|
|
58
60
|
);
|
|
59
61
|
|
|
60
62
|
if (this.stickyScrollbarContainerElement) {
|
|
63
|
+
// Ignored via go/ees005
|
|
64
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
61
65
|
this.stickyScrollbarContainerElement.addEventListener('scroll', this.handleScroll, {
|
|
62
66
|
passive: true,
|
|
63
67
|
});
|
|
@@ -68,6 +72,8 @@ export class TableStickyScrollbar {
|
|
|
68
72
|
|
|
69
73
|
private createIntersectionObserver() {
|
|
70
74
|
this.editorScrollableElement =
|
|
75
|
+
// Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
71
77
|
(findOverflowScrollParent(this.view.dom) as HTMLElement) || window.document;
|
|
72
78
|
|
|
73
79
|
if (!this.editorScrollableElement || !this.wrapper) {
|
|
@@ -81,6 +87,8 @@ export class TableStickyScrollbar {
|
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
entries.forEach((entry) => {
|
|
90
|
+
// Ignored via go/ees005
|
|
91
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
84
92
|
const target = entry.target as HTMLElement;
|
|
85
93
|
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
86
94
|
if (entry.rootBounds?.height === 0) {
|
|
@@ -99,15 +107,21 @@ export class TableStickyScrollbar {
|
|
|
99
107
|
{ root: this.editorScrollableElement },
|
|
100
108
|
);
|
|
101
109
|
|
|
110
|
+
// Ignored via go/ees005
|
|
111
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
102
112
|
this.sentinels.bottom = this.wrapper?.parentElement
|
|
103
113
|
?.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)
|
|
104
114
|
?.item(0) as HTMLElement;
|
|
105
115
|
|
|
116
|
+
// Ignored via go/ees005
|
|
117
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
106
118
|
this.sentinels.top = this.wrapper?.parentElement
|
|
107
119
|
?.getElementsByClassName(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)
|
|
108
120
|
?.item(0) as HTMLElement;
|
|
109
121
|
|
|
110
122
|
[this.sentinels.bottom, this.sentinels.top].forEach((el) =>
|
|
123
|
+
// Ignored via go/ees005
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
111
125
|
this.intersectionObserver!.observe(el),
|
|
112
126
|
);
|
|
113
127
|
}
|
|
@@ -3,6 +3,8 @@ import { OverridableMock } from './OverridableMock';
|
|
|
3
3
|
export class OverflowShadowsObserver extends OverridableMock {
|
|
4
4
|
leftShadowSentinel: HTMLElement | null = null;
|
|
5
5
|
rightShadowSentinel: HTMLElement | null = null;
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
8
|
constructor(...inputs: any[]) {
|
|
7
9
|
super(...inputs);
|
|
8
10
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export abstract class OverridableMock {
|
|
2
|
+
// Ignored via go/ees005
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
4
|
static mockOverrides: { [key: string]: any } = {};
|
|
3
5
|
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
8
|
constructor(...inputs: any[]) {
|
|
5
9
|
const constructorMock = OverridableMock.mockOverrides['constructor'] || jest.fn();
|
|
6
10
|
constructorMock(...inputs);
|
|
@@ -10,6 +14,8 @@ export abstract class OverridableMock {
|
|
|
10
14
|
return OverridableMock.mockOverrides[key] || jest.fn();
|
|
11
15
|
}
|
|
12
16
|
|
|
17
|
+
// Ignored via go/ees005
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
19
|
static setMock(thisKey: string, value: any) {
|
|
14
20
|
OverridableMock.mockOverrides[thisKey] = value;
|
|
15
21
|
}
|
|
@@ -55,6 +55,8 @@ export const lazyTableView = (options: TableViewOptions) => {
|
|
|
55
55
|
getPos: () => number | undefined,
|
|
56
56
|
decorations: readonly Decoration[],
|
|
57
57
|
getNodeViewOptions: () => TableViewOptions,
|
|
58
|
+
// Ignored via go/ees005
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
58
60
|
) => {
|
|
59
61
|
const {
|
|
60
62
|
portalProviderAPI,
|
|
@@ -120,6 +122,8 @@ export const lazyTableCellView = (options: TableCellViewOptions) => {
|
|
|
120
122
|
getPos: () => number | undefined,
|
|
121
123
|
decorations: readonly Decoration[],
|
|
122
124
|
getNodeViewOptions: () => TableCellViewOptions,
|
|
125
|
+
// Ignored via go/ees005
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
123
127
|
) => {
|
|
124
128
|
const { eventDispatcher, pluginInjectionApi } = getNodeViewOptions();
|
|
125
129
|
|
|
@@ -167,6 +171,8 @@ export const lazyTableHeaderView = (options: TableCellViewOptions) => {
|
|
|
167
171
|
getPos: () => number | undefined,
|
|
168
172
|
decorations: readonly Decoration[],
|
|
169
173
|
getNodeViewOptions: () => TableCellViewOptions,
|
|
174
|
+
// Ignored via go/ees005
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
170
176
|
) => {
|
|
171
177
|
const { eventDispatcher, pluginInjectionApi } = getNodeViewOptions();
|
|
172
178
|
|
|
@@ -208,6 +214,8 @@ export const lazyTableRowView = (options: TableCellViewOptions) => {
|
|
|
208
214
|
getPos: () => number | undefined,
|
|
209
215
|
decorations: readonly Decoration[],
|
|
210
216
|
getNodeViewOptions: () => TableCellViewOptions,
|
|
217
|
+
// Ignored via go/ees005
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
211
219
|
) => {
|
|
212
220
|
const { eventDispatcher } = getNodeViewOptions();
|
|
213
221
|
|
package/src/nodeviews/table.tsx
CHANGED
|
@@ -23,13 +23,13 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
23
23
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
24
24
|
|
|
25
25
|
import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
|
|
26
|
-
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop';
|
|
26
|
+
import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop/plugin-key';
|
|
27
27
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
28
28
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
29
|
-
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
30
|
-
import { generateColgroup } from '../pm-plugins/table-resizing/utils';
|
|
29
|
+
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing/plugin-key';
|
|
30
|
+
import { generateColgroup } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
31
31
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
32
|
-
import { isTableNested } from '../pm-plugins/utils';
|
|
32
|
+
import { isTableNested } from '../pm-plugins/utils/nodes';
|
|
33
33
|
import type { PluginInjectionAPI } from '../types';
|
|
34
34
|
|
|
35
35
|
import TableComponent from './TableComponent';
|
|
@@ -55,6 +55,8 @@ const getInlineWidth = (
|
|
|
55
55
|
state: EditorState,
|
|
56
56
|
pos: number | undefined,
|
|
57
57
|
allowTableResizing?: boolean,
|
|
58
|
+
// Ignored via go/ees005
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
58
60
|
): number | undefined => {
|
|
59
61
|
if (!node.attrs.width && options?.isCommentEditor && allowTableResizing) {
|
|
60
62
|
return;
|
|
@@ -154,6 +156,8 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
154
156
|
}
|
|
155
157
|
const attrs = tableAttributes(node);
|
|
156
158
|
(Object.keys(attrs) as Array<keyof typeof attrs>).forEach((attr) => {
|
|
159
|
+
// Ignored via go/ees005
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
157
161
|
this.table!.setAttribute(attr, attrs[attr]);
|
|
158
162
|
});
|
|
159
163
|
|
|
@@ -212,6 +216,8 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
212
216
|
const fakePluginKey = {
|
|
213
217
|
key: 'widthPlugin$',
|
|
214
218
|
getState: (state: EditorState) => {
|
|
219
|
+
// Ignored via go/ees005
|
|
220
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
215
221
|
return (state as any)['widthPlugin$'];
|
|
216
222
|
},
|
|
217
223
|
} as PluginKey;
|
|
@@ -222,6 +228,8 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
222
228
|
const fakeMediaPluginKey = {
|
|
223
229
|
key: 'mediaPlugin$',
|
|
224
230
|
getState: (state: EditorState) => {
|
|
231
|
+
// Ignored via go/ees005
|
|
232
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
225
233
|
return (state as any)['mediaPlugin$'];
|
|
226
234
|
},
|
|
227
235
|
} as PluginKey;
|
|
@@ -257,6 +265,8 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
257
265
|
tablePos = undefined;
|
|
258
266
|
}
|
|
259
267
|
|
|
268
|
+
// Ignored via go/ees005
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
260
270
|
const tableActive = tablePos === pluginState!.tablePos && !isTableResizing;
|
|
261
271
|
|
|
262
272
|
return (
|
|
@@ -267,17 +277,31 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
267
277
|
getPos={props.getPos}
|
|
268
278
|
isMediaFullscreen={mediaState?.isFullscreen}
|
|
269
279
|
options={props.options}
|
|
280
|
+
// Ignored via go/ees005
|
|
281
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
282
|
+
// Ignored via go/ees005
|
|
283
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
270
284
|
allowControls={pluginState!.pluginConfig.allowControls!}
|
|
285
|
+
// Ignored via go/ees005
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
271
287
|
isHeaderRowEnabled={pluginState!.isHeaderRowEnabled}
|
|
288
|
+
// Ignored via go/ees005
|
|
289
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
272
290
|
isHeaderColumnEnabled={pluginState!.isHeaderColumnEnabled}
|
|
291
|
+
// Ignored via go/ees005
|
|
292
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
273
293
|
isDragAndDropEnabled={pluginState!.isDragAndDropEnabled}
|
|
274
294
|
isTableScalingEnabled={props.options?.isTableScalingEnabled} // this.options?.isTableScalingEnabled same as TableOptions.isTableScalingEnabled same as pluginState.isTableScalingEnabled
|
|
275
295
|
allowTableAlignment={props.allowTableAlignment}
|
|
276
296
|
allowTableResizing={props.allowTableResizing}
|
|
277
297
|
tableActive={tableActive}
|
|
298
|
+
// Ignored via go/ees005
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
278
300
|
ordering={pluginState!.ordering as TableColumnOrdering}
|
|
279
301
|
isResizing={isResizing}
|
|
280
302
|
getNode={this.getNode}
|
|
303
|
+
// Ignored via go/ees005
|
|
304
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
281
305
|
containerWidth={containerWidth!}
|
|
282
306
|
contentDOM={forwardRef}
|
|
283
307
|
getEditorFeatureFlags={props.getEditorFeatureFlags}
|
|
@@ -375,6 +399,8 @@ export const createTableView = (
|
|
|
375
399
|
pluginInjectionApi?: PluginInjectionAPI,
|
|
376
400
|
isCommentEditor?: boolean,
|
|
377
401
|
isChromelessEditor?: boolean,
|
|
402
|
+
// Ignored via go/ees005
|
|
403
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
378
404
|
): NodeView => {
|
|
379
405
|
const {
|
|
380
406
|
pluginConfig,
|
|
@@ -10,13 +10,19 @@ export const clearMultipleCells =
|
|
|
10
10
|
let { tr } = state;
|
|
11
11
|
|
|
12
12
|
if (isSelectionType(tr.selection, 'cell')) {
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
15
|
const selection = tr.selection as any as CellSelection;
|
|
14
16
|
selection.forEachCell((_node, pos) => {
|
|
15
17
|
const $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
20
|
tr = emptyCell(findCellClosestToPos($pos)!, state.schema)(tr);
|
|
17
21
|
});
|
|
18
22
|
cursorPos = selection.$headCell.pos;
|
|
19
23
|
} else if (targetCellPosition) {
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
26
|
const cell = findCellClosestToPos(tr.doc.resolve(targetCellPosition + 1))!;
|
|
21
27
|
tr = emptyCell(cell, state.schema)(tr);
|
|
22
28
|
cursorPos = cell.pos;
|
|
@@ -23,26 +23,25 @@ import { getDecorations } from '../decorations/plugin';
|
|
|
23
23
|
import {
|
|
24
24
|
buildColumnResizingDecorations,
|
|
25
25
|
clearColumnResizingDecorations,
|
|
26
|
-
} from '../decorations/utils';
|
|
26
|
+
} from '../decorations/utils/column-resizing';
|
|
27
27
|
import { createCommand, getPluginState } from '../plugin-factory';
|
|
28
28
|
import {
|
|
29
29
|
getPluginState as getTableResizingPluginState,
|
|
30
30
|
createCommand as tableResizingPluginCreateCommand,
|
|
31
31
|
} from '../table-resizing/plugin-factory';
|
|
32
32
|
import { pluginKey as tableResizingPK } from '../table-resizing/plugin-key';
|
|
33
|
+
import { updateControls } from '../table-resizing/utils/dom';
|
|
33
34
|
import {
|
|
34
35
|
currentColWidth,
|
|
35
|
-
getResizeState,
|
|
36
36
|
getTableMaxWidth,
|
|
37
|
-
resizeColumn,
|
|
38
|
-
updateControls,
|
|
39
|
-
} from '../table-resizing/utils';
|
|
40
|
-
import {
|
|
41
37
|
getScalingPercentForTableWithoutWidth,
|
|
42
38
|
getTableScalingPercent,
|
|
43
39
|
} from '../table-resizing/utils/misc';
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
40
|
+
import { resizeColumn } from '../table-resizing/utils/resize-column';
|
|
41
|
+
import { getResizeState } from '../table-resizing/utils/resize-state';
|
|
42
|
+
import { updateColumnWidths } from '../transforms/column-width';
|
|
43
|
+
import { createColumnLineResize, updateDecorations } from '../utils/decoration';
|
|
44
|
+
import { getSelectedColumnIndexes } from '../utils/selection';
|
|
46
45
|
|
|
47
46
|
const getTablePluginCommand = (
|
|
48
47
|
actionPayload: TablePluginAction,
|
|
@@ -60,6 +59,8 @@ const updateResizeHandleAndStatePosition =
|
|
|
60
59
|
columnIndex: number,
|
|
61
60
|
nextResizeHandlePos: number,
|
|
62
61
|
nodeViewPortalProviderAPI: PortalProviderAPI,
|
|
62
|
+
// Ignored via go/ees005
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
63
64
|
): Command =>
|
|
64
65
|
(state, dispatch) => {
|
|
65
66
|
let customTr = state.tr;
|
|
@@ -142,7 +143,9 @@ export const initiateKeyboardColumnResizing =
|
|
|
142
143
|
(state, dispatch, view) => {
|
|
143
144
|
const { selection } = state;
|
|
144
145
|
const selectionRect = isSelectionType(selection, 'cell')
|
|
145
|
-
?
|
|
146
|
+
? // Ignored via go/ees005
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
148
|
+
getSelectionRect(selection)!
|
|
146
149
|
: findCellRectClosestToPos(selection.$from);
|
|
147
150
|
const cell = findCellClosestToPos(selection.$from);
|
|
148
151
|
|