@atlaskit/editor-plugin-table 7.25.9 → 7.25.11
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 +24 -0
- package/dist/cjs/commands/clear.js +2 -14
- package/dist/cjs/commands/column-resize.js +11 -5
- package/dist/cjs/commands/delete.js +2 -1
- package/dist/cjs/commands/insert.js +8 -5
- package/dist/cjs/commands/selection.js +3 -3
- package/dist/cjs/commands-with-analytics.js +23 -52
- package/dist/cjs/nodeviews/TableComponent.js +29 -14
- package/dist/cjs/nodeviews/TableContainer.js +2 -2
- package/dist/cjs/nodeviews/TableResizer.js +1 -1
- package/dist/cjs/plugin.js +4 -2
- package/dist/cjs/pm-plugins/decorations/utils/index.js +1 -8
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +3 -3
- package/dist/cjs/pm-plugins/drag-and-drop/index.js +1 -14
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +4 -1
- package/dist/cjs/pm-plugins/drag-and-drop/utils/index.js +0 -7
- package/dist/cjs/pm-plugins/safari-delete-composition-text-issue-workaround.js +2 -2
- package/dist/cjs/pm-plugins/sticky-headers/index.js +1 -14
- package/dist/cjs/pm-plugins/table-analytics.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/commands.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +33 -15
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +15 -6
- package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +1 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +3 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/index.js +0 -103
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +23 -15
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +6 -7
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +23 -18
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +13 -8
- package/dist/cjs/pm-plugins/table-selection-keymap.js +1 -3
- package/dist/cjs/pm-plugins/view-mode-sort/utils.js +2 -2
- package/dist/cjs/toolbar.js +9 -9
- package/dist/cjs/transforms/column-width.js +3 -1
- package/dist/cjs/transforms/delete-columns.js +2 -1
- package/dist/cjs/transforms/index.js +0 -6
- package/dist/cjs/ui/DragHandle/index.js +3 -1
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/cjs/ui/FloatingDeleteButton/index.js +0 -1
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +5 -4
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -2
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +2 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -3
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/cjs/ui/icons/index.js +0 -7
- package/dist/cjs/utils/column-controls.js +1 -22
- package/dist/cjs/utils/dom.js +1 -4
- package/dist/cjs/utils/drag-menu.js +3 -2
- package/dist/cjs/utils/index.js +0 -108
- package/dist/cjs/utils/merged-cells.js +1 -60
- package/dist/cjs/utils/nodes.js +2 -2
- package/dist/cjs/utils/row-controls.js +1 -8
- package/dist/cjs/utils/selection.js +1 -60
- package/dist/cjs/utils/table.js +1 -11
- package/dist/es2019/commands/clear.js +1 -14
- package/dist/es2019/commands/column-resize.js +11 -5
- package/dist/es2019/commands/delete.js +2 -2
- package/dist/es2019/commands/insert.js +8 -8
- package/dist/es2019/commands/selection.js +2 -2
- package/dist/es2019/commands-with-analytics.js +6 -36
- package/dist/es2019/nodeviews/TableComponent.js +30 -15
- package/dist/es2019/nodeviews/TableContainer.js +1 -1
- package/dist/es2019/nodeviews/TableResizer.js +1 -1
- package/dist/es2019/plugin.js +4 -2
- package/dist/es2019/pm-plugins/decorations/utils/index.js +1 -2
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +2 -2
- package/dist/es2019/pm-plugins/drag-and-drop/index.js +1 -2
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +4 -1
- package/dist/es2019/pm-plugins/drag-and-drop/utils/index.js +0 -1
- package/dist/es2019/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/es2019/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/es2019/pm-plugins/table-analytics.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +32 -14
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +15 -7
- package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +0 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/index.js +5 -6
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +22 -14
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +6 -7
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +21 -15
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +10 -7
- package/dist/es2019/pm-plugins/table-selection-keymap.js +1 -2
- package/dist/es2019/pm-plugins/view-mode-sort/utils.js +1 -1
- package/dist/es2019/toolbar.js +8 -8
- package/dist/es2019/transforms/column-width.js +3 -2
- package/dist/es2019/transforms/delete-columns.js +2 -2
- package/dist/es2019/transforms/index.js +1 -1
- package/dist/es2019/ui/DragHandle/index.js +3 -1
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/es2019/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +4 -3
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -2
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +1 -1
- package/dist/es2019/ui/FloatingInsertButton/index.js +3 -2
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/es2019/ui/icons/index.js +0 -1
- package/dist/es2019/utils/column-controls.js +1 -19
- package/dist/es2019/utils/dom.js +0 -1
- package/dist/es2019/utils/drag-menu.js +3 -3
- package/dist/es2019/utils/index.js +8 -8
- package/dist/es2019/utils/merged-cells.js +0 -47
- package/dist/es2019/utils/nodes.js +1 -1
- package/dist/es2019/utils/row-controls.js +1 -8
- package/dist/es2019/utils/selection.js +0 -60
- package/dist/es2019/utils/table.js +0 -6
- package/dist/esm/commands/clear.js +1 -14
- package/dist/esm/commands/column-resize.js +11 -5
- package/dist/esm/commands/delete.js +2 -1
- package/dist/esm/commands/insert.js +8 -5
- package/dist/esm/commands/selection.js +2 -2
- package/dist/esm/commands-with-analytics.js +24 -52
- package/dist/esm/nodeviews/TableComponent.js +30 -15
- package/dist/esm/nodeviews/TableContainer.js +1 -1
- package/dist/esm/nodeviews/TableResizer.js +1 -1
- package/dist/esm/plugin.js +4 -2
- package/dist/esm/pm-plugins/decorations/utils/index.js +1 -2
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +2 -2
- package/dist/esm/pm-plugins/drag-and-drop/index.js +1 -2
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +4 -1
- package/dist/esm/pm-plugins/drag-and-drop/utils/index.js +0 -1
- package/dist/esm/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/esm/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/esm/pm-plugins/table-analytics.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +33 -15
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +15 -6
- package/dist/esm/pm-plugins/table-resizing/utils/consts.js +0 -1
- package/dist/esm/pm-plugins/table-resizing/utils/dom.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/index.js +5 -6
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +24 -14
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +6 -7
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +22 -17
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +12 -6
- package/dist/esm/pm-plugins/table-selection-keymap.js +1 -2
- package/dist/esm/pm-plugins/view-mode-sort/utils.js +1 -1
- package/dist/esm/toolbar.js +8 -8
- package/dist/esm/transforms/column-width.js +3 -1
- package/dist/esm/transforms/delete-columns.js +2 -1
- package/dist/esm/transforms/index.js +1 -1
- package/dist/esm/ui/DragHandle/index.js +3 -1
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/esm/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +4 -3
- package/dist/esm/ui/FloatingDragMenu/index.js +4 -2
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +3 -2
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
- package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/esm/ui/icons/index.js +0 -1
- package/dist/esm/utils/column-controls.js +1 -22
- package/dist/esm/utils/dom.js +0 -3
- package/dist/esm/utils/drag-menu.js +3 -2
- package/dist/esm/utils/index.js +8 -8
- package/dist/esm/utils/merged-cells.js +0 -59
- package/dist/esm/utils/nodes.js +1 -1
- package/dist/esm/utils/row-controls.js +1 -8
- package/dist/esm/utils/selection.js +0 -59
- package/dist/esm/utils/table.js +0 -9
- package/dist/types/commands/clear.d.ts +0 -1
- package/dist/types/commands/delete.d.ts +1 -1
- package/dist/types/commands/insert.d.ts +4 -4
- package/dist/types/commands/selection.d.ts +0 -4
- package/dist/types/commands-with-analytics.d.ts +2 -3
- package/dist/types/nodeviews/TableComponent.d.ts +1 -1
- package/dist/types/nodeviews/TableContainer.d.ts +0 -11
- package/dist/types/nodeviews/TableResizer.d.ts +1 -3
- package/dist/types/pm-plugins/analytics/actions.d.ts +3 -2
- package/dist/types/pm-plugins/decorations/utils/index.d.ts +0 -1
- package/dist/types/pm-plugins/decorations/utils/types.d.ts +2 -1
- package/dist/types/pm-plugins/drag-and-drop/actions.d.ts +5 -4
- package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +1 -6
- package/dist/types/pm-plugins/drag-and-drop/index.d.ts +0 -2
- package/dist/types/pm-plugins/drag-and-drop/utils/index.d.ts +0 -1
- package/dist/types/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -2
- package/dist/types/pm-plugins/sticky-headers/index.d.ts +0 -1
- package/dist/types/pm-plugins/sticky-headers/types.d.ts +3 -2
- package/dist/types/pm-plugins/table-analytics.d.ts +0 -12
- package/dist/types/pm-plugins/table-resizing/commands.d.ts +0 -5
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +3 -2
- package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +0 -1
- package/dist/types/pm-plugins/table-resizing/utils/dom.d.ts +0 -2
- package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +5 -8
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
- package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +3 -2
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -5
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -4
- package/dist/types/pm-plugins/table-selection-keymap.d.ts +0 -1
- package/dist/types/pm-plugins/view-mode-sort/types.d.ts +2 -1
- package/dist/types/pm-plugins/view-mode-sort/utils.d.ts +0 -6
- package/dist/types/toolbar.d.ts +1 -14
- package/dist/types/transforms/column-width.d.ts +1 -1
- package/dist/types/transforms/delete-columns.d.ts +1 -1
- package/dist/types/transforms/index.d.ts +1 -1
- package/dist/types/ui/FloatingContextualButton/FixedButton.d.ts +1 -2
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +2 -3
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +1 -2
- package/dist/types/ui/FloatingDragMenu/index.d.ts +3 -2
- package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +1 -2
- package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +2 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -1
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -1
- package/dist/types/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types/ui/icons/index.d.ts +0 -1
- package/dist/types/utils/column-controls.d.ts +0 -2
- package/dist/types/utils/dom.d.ts +0 -1
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types/utils/index.d.ts +8 -8
- package/dist/types/utils/merged-cells.d.ts +0 -2
- package/dist/types/utils/nodes.d.ts +0 -1
- package/dist/types/utils/row-controls.d.ts +0 -1
- package/dist/types/utils/selection.d.ts +0 -3
- package/dist/types/utils/table.d.ts +0 -2
- package/dist/types-ts4.5/commands/clear.d.ts +0 -1
- package/dist/types-ts4.5/commands/delete.d.ts +1 -1
- package/dist/types-ts4.5/commands/insert.d.ts +4 -4
- package/dist/types-ts4.5/commands/selection.d.ts +0 -4
- package/dist/types-ts4.5/commands-with-analytics.d.ts +2 -3
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +0 -11
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -3
- package/dist/types-ts4.5/pm-plugins/analytics/actions.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/decorations/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/decorations/utils/types.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/actions.d.ts +5 -4
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +1 -6
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/index.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/sticky-headers/index.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/sticky-headers/types.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/table-analytics.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/dom.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +5 -8
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -5
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -4
- package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/types.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/utils.d.ts +0 -6
- package/dist/types-ts4.5/toolbar.d.ts +1 -14
- package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
- package/dist/types-ts4.5/transforms/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +1 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +2 -3
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +1 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +1 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/icons/index.d.ts +0 -1
- package/dist/types-ts4.5/utils/column-controls.d.ts +0 -2
- package/dist/types-ts4.5/utils/dom.d.ts +0 -1
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/utils/index.d.ts +8 -8
- package/dist/types-ts4.5/utils/merged-cells.d.ts +0 -2
- package/dist/types-ts4.5/utils/nodes.d.ts +0 -1
- package/dist/types-ts4.5/utils/row-controls.d.ts +0 -1
- package/dist/types-ts4.5/utils/selection.d.ts +0 -3
- package/dist/types-ts4.5/utils/table.d.ts +0 -2
- package/package.json +3 -3
- package/src/commands/clear.ts +0 -14
- package/src/commands/column-resize.ts +19 -6
- package/src/commands/delete.ts +2 -0
- package/src/commands/insert.ts +8 -0
- package/src/commands/selection.ts +1 -1
- package/src/commands-with-analytics.ts +5 -40
- package/src/nodeviews/TableComponent.tsx +43 -9
- package/src/nodeviews/TableContainer.tsx +1 -1
- package/src/nodeviews/TableResizer.tsx +2 -4
- package/src/plugin.tsx +2 -0
- package/src/pm-plugins/analytics/actions.ts +2 -2
- package/src/pm-plugins/decorations/utils/index.ts +0 -1
- package/src/pm-plugins/decorations/utils/types.ts +1 -1
- package/src/pm-plugins/drag-and-drop/actions.ts +4 -4
- package/src/pm-plugins/drag-and-drop/commands.ts +2 -2
- package/src/pm-plugins/drag-and-drop/index.ts +0 -3
- package/src/pm-plugins/drag-and-drop/plugin.ts +4 -0
- package/src/pm-plugins/drag-and-drop/utils/index.ts +0 -2
- package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +1 -1
- package/src/pm-plugins/sticky-headers/index.ts +0 -1
- package/src/pm-plugins/sticky-headers/types.ts +2 -2
- package/src/pm-plugins/table-analytics.ts +1 -1
- package/src/pm-plugins/table-resizing/commands.ts +1 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +39 -15
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +18 -7
- package/src/pm-plugins/table-resizing/utils/consts.ts +0 -1
- package/src/pm-plugins/table-resizing/utils/dom.ts +2 -5
- package/src/pm-plugins/table-resizing/utils/index.ts +4 -30
- package/src/pm-plugins/table-resizing/utils/misc.ts +25 -17
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +14 -13
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +28 -21
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +18 -6
- package/src/pm-plugins/table-selection-keymap.ts +0 -2
- package/src/pm-plugins/view-mode-sort/types.ts +1 -1
- package/src/pm-plugins/view-mode-sort/utils.ts +1 -5
- package/src/toolbar.tsx +8 -5
- package/src/transforms/column-width.ts +2 -0
- package/src/transforms/delete-columns.ts +2 -0
- package/src/transforms/index.ts +1 -1
- package/src/ui/DragHandle/index.tsx +2 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +2 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +5 -2
- package/src/ui/FloatingContextualMenu/index.tsx +1 -1
- package/src/ui/FloatingDeleteButton/DeleteButton.tsx +1 -1
- package/src/ui/FloatingDeleteButton/index.tsx +2 -2
- package/src/ui/FloatingDragMenu/DragMenu.tsx +4 -1
- package/src/ui/FloatingDragMenu/index.tsx +4 -1
- package/src/ui/FloatingInsertButton/InsertButton.tsx +2 -2
- package/src/ui/FloatingInsertButton/index.tsx +3 -0
- package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +1 -1
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +1 -3
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +1 -1
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +1 -1
- package/src/ui/TableFloatingColumnControls/index.tsx +2 -2
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -1
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +2 -0
- package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -1
- package/src/ui/TableFloatingControls/index.tsx +1 -1
- package/src/ui/icons/index.ts +0 -1
- package/src/utils/column-controls.ts +2 -38
- package/src/utils/dom.ts +0 -4
- package/src/utils/drag-menu.ts +3 -0
- package/src/utils/index.ts +1 -22
- package/src/utils/merged-cells.ts +0 -62
- package/src/utils/nodes.ts +1 -1
- package/src/utils/row-controls.ts +1 -19
- package/src/utils/selection.ts +0 -84
- package/src/utils/table.ts +0 -8
- package/dist/cjs/utils/transforms.js +0 -11
- package/dist/es2019/utils/transforms.js +0 -5
- package/dist/esm/utils/transforms.js +0 -5
- package/dist/types/utils/transforms.d.ts +0 -2
- package/dist/types-ts4.5/utils/transforms.d.ts +0 -2
- package/src/utils/transforms.ts +0 -10
package/src/utils/index.ts
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
export {
|
|
2
|
-
getSelectedColumnIndexes,
|
|
3
|
-
getSelectedRowIndexes,
|
|
4
|
-
normalizeSelection,
|
|
5
|
-
isSelectionUpdated,
|
|
6
|
-
} from './selection';
|
|
1
|
+
export { getSelectedColumnIndexes, getSelectedRowIndexes } from './selection';
|
|
7
2
|
export {
|
|
8
3
|
findControlsHoverDecoration,
|
|
9
4
|
createControlsHoverDecoration,
|
|
10
|
-
createColumnControlsDecoration,
|
|
11
|
-
createColumnSelectedDecoration,
|
|
12
5
|
createCellHoverDecoration,
|
|
13
6
|
updateDecorations,
|
|
14
|
-
createResizeHandleDecoration,
|
|
15
7
|
createColumnInsertLine,
|
|
16
8
|
createColumnLineResize,
|
|
17
9
|
createRowInsertLine,
|
|
18
10
|
} from './decoration';
|
|
19
11
|
export {
|
|
20
|
-
isIsolating,
|
|
21
12
|
containsHeaderColumn,
|
|
22
13
|
containsHeaderRow,
|
|
23
14
|
checkIfHeaderColumnEnabled,
|
|
@@ -28,13 +19,8 @@ export {
|
|
|
28
19
|
tablesHaveDifferentNoOfColumns,
|
|
29
20
|
tablesHaveDifferentNoOfRows,
|
|
30
21
|
isTableNested,
|
|
31
|
-
anyChildCellMergedAcrossRow,
|
|
32
|
-
supportedHeaderRow,
|
|
33
22
|
} from './nodes';
|
|
34
23
|
export {
|
|
35
|
-
unwrapContentFromTable,
|
|
36
|
-
removeTableFromFirstChild,
|
|
37
|
-
removeTableFromLastChild,
|
|
38
24
|
transformSliceToRemoveOpenTable,
|
|
39
25
|
transformSliceToCorrectEmptyTableCells,
|
|
40
26
|
transformSliceToFixHardBreakProblemOnCopyFromCell,
|
|
@@ -47,7 +33,6 @@ export {
|
|
|
47
33
|
isTableControlsButton,
|
|
48
34
|
isTableContainerOrWrapper,
|
|
49
35
|
isRowControlsButton,
|
|
50
|
-
isDragRowControlsButton,
|
|
51
36
|
isDragColumnFloatingInsertDot,
|
|
52
37
|
isDragRowFloatingInsertDot,
|
|
53
38
|
isDragCornerButton,
|
|
@@ -61,14 +46,11 @@ export {
|
|
|
61
46
|
export {
|
|
62
47
|
convertHTMLCellIndexToColumnIndex,
|
|
63
48
|
getColumnsWidths,
|
|
64
|
-
isColumnDeleteButtonVisible,
|
|
65
49
|
getColumnDeleteButtonParams,
|
|
66
|
-
getColumnClassNames,
|
|
67
50
|
getColumnIndexMappedToColumnIndexInFirstRow,
|
|
68
51
|
} from './column-controls';
|
|
69
52
|
export {
|
|
70
53
|
getRowHeights,
|
|
71
|
-
isRowDeleteButtonVisible,
|
|
72
54
|
getRowDeleteButtonParams,
|
|
73
55
|
getRowsParams,
|
|
74
56
|
getRowClassNames,
|
|
@@ -79,11 +61,8 @@ export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
|
|
|
79
61
|
export { getMergedCellsPositions, getAssistiveMessage } from './table';
|
|
80
62
|
export { updatePluginStateDecorations } from './update-plugin-state-decorations';
|
|
81
63
|
export {
|
|
82
|
-
hasMergedCellsInColumn,
|
|
83
|
-
hasMergedCellsInRow,
|
|
84
64
|
hasMergedCellsInBetween,
|
|
85
65
|
hasMergedCellsInSelection,
|
|
86
66
|
findDuplicatePosition,
|
|
87
|
-
checkEdgeHasMergedCells,
|
|
88
67
|
} from './merged-cells';
|
|
89
68
|
export { createTableWithWidth } from './create';
|
|
@@ -1,70 +1,8 @@
|
|
|
1
1
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { Rect } from '@atlaskit/editor-tables';
|
|
3
2
|
import { findTable, TableMap } from '@atlaskit/editor-tables';
|
|
4
3
|
|
|
5
4
|
type MergeType = 'row' | 'column';
|
|
6
5
|
|
|
7
|
-
const hasMergedCells =
|
|
8
|
-
(indexes: number | number[], normalizeRect: (index: number, map: TableMap) => Rect) =>
|
|
9
|
-
(selection: Selection): boolean => {
|
|
10
|
-
const table = findTable(selection);
|
|
11
|
-
if (!table) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const map = TableMap.get(table.node);
|
|
16
|
-
const cellPositions = new Set<number>();
|
|
17
|
-
const mergedCells = new Set<number>();
|
|
18
|
-
|
|
19
|
-
map.map.forEach((value) => {
|
|
20
|
-
if (cellPositions.has(value)) {
|
|
21
|
-
mergedCells.add(value);
|
|
22
|
-
} else {
|
|
23
|
-
cellPositions.add(value);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if (!mergedCells.size) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (Array.isArray(indexes) ? indexes : [indexes])
|
|
32
|
-
.map((index) => normalizeRect(index, map))
|
|
33
|
-
.filter((rect) => rect.left < rect.right && rect.top < rect.bottom)
|
|
34
|
-
.some((rect) => {
|
|
35
|
-
const n = (rect.right - rect.left) * (rect.bottom - rect.top);
|
|
36
|
-
const cells = map.cellsInRect(rect);
|
|
37
|
-
if (cells.length !== n) {
|
|
38
|
-
// We can quickly assume that if the amount of cells from the map is different to what the rect says
|
|
39
|
-
// then there is most likely merged cells across this area which is removing cells
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
return cells.some((nodePos) => mergedCells.has(nodePos));
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const hasMergedCellsInColumn = (columnIndexes: number | number[]) =>
|
|
47
|
-
hasMergedCells(columnIndexes, (index: number, map: TableMap) => {
|
|
48
|
-
const x = Math.max(Math.min(index, map.width - 1), 0); // clamped index
|
|
49
|
-
return {
|
|
50
|
-
left: x,
|
|
51
|
-
right: x === index ? x + 1 : x,
|
|
52
|
-
top: 0,
|
|
53
|
-
bottom: map.height,
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
export const hasMergedCellsInRow = (rowIndexes: number | number[]) =>
|
|
58
|
-
hasMergedCells(rowIndexes, (index: number, map: TableMap) => {
|
|
59
|
-
const y = Math.max(Math.min(index, map.height - 1), 0); // clamped index
|
|
60
|
-
return {
|
|
61
|
-
left: 0,
|
|
62
|
-
right: map.width,
|
|
63
|
-
top: y,
|
|
64
|
-
bottom: y === index ? y + 1 : y,
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
|
|
68
6
|
const getRect = (index: number, type: MergeType, map: TableMap) => {
|
|
69
7
|
if (type === 'column') {
|
|
70
8
|
const x = Math.max(Math.min(index, map.width - 1), 0); // clamped index
|
package/src/utils/nodes.ts
CHANGED
|
@@ -136,7 +136,7 @@ export const isTableNested = (state: EditorState, tablePos = 0): boolean => {
|
|
|
136
136
|
);
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
const anyChildCellMergedAcrossRow = (node: PmNode): boolean =>
|
|
140
140
|
mapChildren(node, (child) => child.attrs.rowspan || 0).some((rowspan) => rowspan > 1);
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -2,14 +2,8 @@ import { parsePx } from '@atlaskit/editor-common/utils';
|
|
|
2
2
|
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
|
-
import {
|
|
8
|
-
findTable,
|
|
9
|
-
getSelectionRect,
|
|
10
|
-
isRowSelected,
|
|
11
|
-
isTableSelected,
|
|
12
|
-
} from '@atlaskit/editor-tables/utils';
|
|
6
|
+
import { findTable, getSelectionRect, isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
13
7
|
|
|
14
8
|
import { TableCssClassName as ClassName } from '../types';
|
|
15
9
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
@@ -41,18 +35,6 @@ export const getRowHeights = (tableRef: HTMLTableElement): number[] => {
|
|
|
41
35
|
return heights;
|
|
42
36
|
};
|
|
43
37
|
|
|
44
|
-
export const isRowDeleteButtonVisible = (selection: Selection): boolean => {
|
|
45
|
-
if (
|
|
46
|
-
!isTableSelected(selection) &&
|
|
47
|
-
selection instanceof CellSelection &&
|
|
48
|
-
selection.isRowSelection()
|
|
49
|
-
) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return false;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
38
|
export const getRowDeleteButtonParams = (
|
|
57
39
|
rowsHeights: Array<number | undefined>,
|
|
58
40
|
selection: Selection,
|
package/src/utils/selection.ts
CHANGED
|
@@ -1,88 +1,4 @@
|
|
|
1
|
-
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
3
1
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
|
-
import {
|
|
6
|
-
findTable,
|
|
7
|
-
getSelectionRangeInColumn,
|
|
8
|
-
getSelectionRangeInRow,
|
|
9
|
-
getSelectionRect,
|
|
10
|
-
isSelectionType,
|
|
11
|
-
} from '@atlaskit/editor-tables/utils';
|
|
12
|
-
|
|
13
|
-
export const isSelectionUpdated = (oldSelection: Selection, newSelection?: Selection) =>
|
|
14
|
-
!!(!newSelection && oldSelection) ||
|
|
15
|
-
isSelectionType(oldSelection, 'cell') !== isSelectionType(newSelection!, 'cell') ||
|
|
16
|
-
(isSelectionType(oldSelection, 'cell') &&
|
|
17
|
-
isSelectionType(newSelection!, 'cell') &&
|
|
18
|
-
oldSelection.ranges !== newSelection!.ranges);
|
|
19
|
-
|
|
20
|
-
const isRectangularCellSelection = (selection: Selection, rect: Rect): boolean => {
|
|
21
|
-
const table = findTable(selection);
|
|
22
|
-
if (!table) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
const { width, height, map } = TableMap.get(table.node);
|
|
26
|
-
|
|
27
|
-
let indexTop = rect.top * width + rect.left;
|
|
28
|
-
let indexLeft = indexTop;
|
|
29
|
-
let indexBottom = (rect.bottom - 1) * width + rect.left;
|
|
30
|
-
let indexRight = indexTop + (rect.right - rect.left - 1);
|
|
31
|
-
|
|
32
|
-
for (let i = rect.top; i < rect.bottom; i++) {
|
|
33
|
-
if (
|
|
34
|
-
(rect.left > 0 && map[indexLeft] === map[indexLeft - 1]) ||
|
|
35
|
-
(rect.right < width && map[indexRight] === map[indexRight + 1])
|
|
36
|
-
) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
indexLeft += width;
|
|
40
|
-
indexRight += width;
|
|
41
|
-
}
|
|
42
|
-
for (let i = rect.left; i < rect.right; i++) {
|
|
43
|
-
if (
|
|
44
|
-
(rect.top > 0 && map[indexTop] === map[indexTop - width]) ||
|
|
45
|
-
(rect.bottom < height && map[indexBottom] === map[indexBottom + width])
|
|
46
|
-
) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
indexTop++;
|
|
50
|
-
indexBottom++;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return true;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const normalizeSelection = (tr: Transaction): Transaction => {
|
|
57
|
-
const { selection } = tr;
|
|
58
|
-
const rect = getSelectionRect(selection);
|
|
59
|
-
|
|
60
|
-
if (
|
|
61
|
-
!rect ||
|
|
62
|
-
!(selection instanceof CellSelection) ||
|
|
63
|
-
isRectangularCellSelection(selection, rect)
|
|
64
|
-
) {
|
|
65
|
-
return tr;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (selection.isColSelection()) {
|
|
69
|
-
const $anchor = getSelectionRangeInColumn(rect.left)(tr)?.$anchor;
|
|
70
|
-
const $head = getSelectionRangeInColumn(rect.right - 1)(tr)?.$head;
|
|
71
|
-
if ($anchor && $head) {
|
|
72
|
-
return tr.setSelection(new CellSelection($anchor, $head) as any);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (selection.isRowSelection()) {
|
|
77
|
-
const $anchor = getSelectionRangeInRow(rect.top)(tr)?.$anchor;
|
|
78
|
-
const $head = getSelectionRangeInRow(rect.bottom - 1)(tr)?.$head;
|
|
79
|
-
if ($anchor && $head) {
|
|
80
|
-
return tr.setSelection(new CellSelection($anchor, $head) as any);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return tr;
|
|
85
|
-
};
|
|
86
2
|
|
|
87
3
|
export const getSelectedColumnIndexes = (selectionRect: Rect): number[] => {
|
|
88
4
|
const columnIndexes: number[] = [];
|
package/src/utils/table.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { IntlShape } from 'react-intl-next';
|
|
|
3
3
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
7
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
7
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
9
8
|
|
|
@@ -28,13 +27,6 @@ export const getMergedCellsPositions = (tr: Transaction): number[] => {
|
|
|
28
27
|
return mergedCells;
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
export const colsToRect = (cols: Array<number>, noOfRows: number): Rect => ({
|
|
32
|
-
left: Math.min(...cols),
|
|
33
|
-
right: Math.max(...cols) + 1,
|
|
34
|
-
top: 0,
|
|
35
|
-
bottom: noOfRows,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
30
|
export const getAssistiveMessage = (
|
|
39
31
|
prevTableNode: PmNode,
|
|
40
32
|
currentTableNode: PmNode,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.combineTransforms = void 0;
|
|
7
|
-
var combineTransforms = exports.combineTransforms = function combineTransforms(transforms, tr) {
|
|
8
|
-
return transforms.reduce(function (prev, curr) {
|
|
9
|
-
return curr(prev);
|
|
10
|
-
}, tr);
|
|
11
|
-
};
|
package/src/utils/transforms.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
|
|
3
|
-
export const combineTransforms = (
|
|
4
|
-
transforms: Array<(tr: Transaction) => Transaction>,
|
|
5
|
-
tr: Transaction,
|
|
6
|
-
) => {
|
|
7
|
-
return transforms.reduce((prev, curr) => {
|
|
8
|
-
return curr(prev);
|
|
9
|
-
}, tr);
|
|
10
|
-
};
|