@atlaskit/editor-plugin-table 7.25.10 → 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 +15 -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/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/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/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/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/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/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 +2 -2
- 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/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/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
|
@@ -22,7 +22,7 @@ import type { ResizeState } from '../utils/types';
|
|
|
22
22
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
23
23
|
import { syncStickyRowToTable } from './dom';
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface ScaleOptions {
|
|
26
26
|
node: PMNode;
|
|
27
27
|
prevNode: PMNode;
|
|
28
28
|
start: number;
|
|
@@ -36,12 +36,13 @@ export interface ScaleOptions {
|
|
|
36
36
|
|
|
37
37
|
// Base function to trigger the actual scale on a table node.
|
|
38
38
|
// Will only resize/scale if a table has been previously resized.
|
|
39
|
-
|
|
39
|
+
const scale = (
|
|
40
40
|
tableRef: HTMLTableElement,
|
|
41
41
|
options: ScaleOptions,
|
|
42
42
|
domAtPos: DomAtPos,
|
|
43
43
|
isTableScalingEnabledOnCurrentTable = false,
|
|
44
44
|
shouldUseIncreasedScalingPercent = false,
|
|
45
|
+
isCommentEditor = false,
|
|
45
46
|
): ResizeState | undefined => {
|
|
46
47
|
const {
|
|
47
48
|
node,
|
|
@@ -92,12 +93,13 @@ export const scale = (
|
|
|
92
93
|
domAtPos,
|
|
93
94
|
isTableScalingEnabled: isTableScalingEnabledOnCurrentTable,
|
|
94
95
|
shouldUseIncreasedScalingPercent,
|
|
96
|
+
isCommentEditor,
|
|
95
97
|
});
|
|
96
98
|
|
|
97
99
|
return scaleTableTo(resizeState, newWidth);
|
|
98
100
|
};
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
const scaleWithParent = (
|
|
101
103
|
tableRef: HTMLTableElement,
|
|
102
104
|
parentWidth: number,
|
|
103
105
|
table: PMNode,
|
|
@@ -105,6 +107,7 @@ export const scaleWithParent = (
|
|
|
105
107
|
domAtPos: DomAtPos,
|
|
106
108
|
isTableScalingEnabledOnCurrentTable = false,
|
|
107
109
|
shouldUseIncreasedScalingPercent = false,
|
|
110
|
+
isCommentEditor = false,
|
|
108
111
|
) => {
|
|
109
112
|
const resizeState = getResizeState({
|
|
110
113
|
minWidth: tableCellMinWidth,
|
|
@@ -115,6 +118,7 @@ export const scaleWithParent = (
|
|
|
115
118
|
domAtPos,
|
|
116
119
|
isTableScalingEnabled: isTableScalingEnabledOnCurrentTable,
|
|
117
120
|
shouldUseIncreasedScalingPercent,
|
|
121
|
+
isCommentEditor,
|
|
118
122
|
});
|
|
119
123
|
|
|
120
124
|
if (table.attrs.isNumberColumnEnabled) {
|
|
@@ -205,7 +209,7 @@ export const previewScaleTable = (
|
|
|
205
209
|
: scale(tableRef, options, domAtPos, false, shouldUseIncreasedScalingPercent);
|
|
206
210
|
|
|
207
211
|
if (resizeState) {
|
|
208
|
-
updateColgroup(resizeState, tableRef, node, false,
|
|
212
|
+
updateColgroup(resizeState, tableRef, node, false, 1);
|
|
209
213
|
}
|
|
210
214
|
};
|
|
211
215
|
|
|
@@ -218,19 +222,27 @@ export const scaleTable =
|
|
|
218
222
|
api: PluginInjectionAPI | undefined | null,
|
|
219
223
|
isTableScalingEnabledOnCurrentTable = false,
|
|
220
224
|
shouldUseIncreasedScalingPercent = false,
|
|
225
|
+
isCommentEditor = false,
|
|
221
226
|
) =>
|
|
222
227
|
(tr: Transaction) => {
|
|
223
228
|
if (!tableRef) {
|
|
224
229
|
return tr;
|
|
225
230
|
}
|
|
226
|
-
|
|
227
231
|
const { node, start, parentWidth, layoutChanged } = options;
|
|
228
232
|
// If a table has not been resized yet, columns should be auto.
|
|
229
233
|
if (hasTableBeenResized(node) === false) {
|
|
230
234
|
// If its not a re-sized table, we still want to re-create cols
|
|
231
235
|
// To force reflow of columns upon delete.
|
|
232
236
|
if (!isTableScalingEnabledOnCurrentTable) {
|
|
233
|
-
|
|
237
|
+
const isTableScalingEnabled = false;
|
|
238
|
+
insertColgroupFromNode(
|
|
239
|
+
tableRef,
|
|
240
|
+
node,
|
|
241
|
+
isTableScalingEnabled,
|
|
242
|
+
undefined,
|
|
243
|
+
shouldUseIncreasedScalingPercent,
|
|
244
|
+
isCommentEditor,
|
|
245
|
+
);
|
|
234
246
|
}
|
|
235
247
|
tr.setMeta('scrollIntoView', false);
|
|
236
248
|
return tr;
|
|
@@ -23,11 +23,7 @@ export const unsort = (oldOrder: { index: number; value: number }[], tableElemen
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
tableNode: PMNode,
|
|
28
|
-
sortIndex: number,
|
|
29
|
-
direction: SortOrder,
|
|
30
|
-
) => {
|
|
26
|
+
const getSortOrderFromTable = (tableNode: PMNode, sortIndex: number, direction: SortOrder) => {
|
|
31
27
|
const tableArray = convertProsemirrorTableNodeToArrayOfRows(tableNode);
|
|
32
28
|
tableArray.shift(); // remove header row
|
|
33
29
|
|
package/src/toolbar.tsx
CHANGED
|
@@ -221,6 +221,7 @@ export const getToolbarCellOptionsConfig = (
|
|
|
221
221
|
isCellBackgroundDuplicated,
|
|
222
222
|
isTableFixedColumnWidthsOptionEnabled,
|
|
223
223
|
shouldUseIncreasedScalingPercent,
|
|
224
|
+
isCommentEditor,
|
|
224
225
|
)(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
|
|
225
226
|
}
|
|
226
227
|
return true;
|
|
@@ -263,6 +264,7 @@ export const getToolbarCellOptionsConfig = (
|
|
|
263
264
|
isTableScalingEnabled,
|
|
264
265
|
isTableFixedColumnWidthsOptionEnabled,
|
|
265
266
|
shouldUseIncreasedScalingPercent,
|
|
267
|
+
isCommentEditor,
|
|
266
268
|
)(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
|
|
267
269
|
}
|
|
268
270
|
return true;
|
|
@@ -449,7 +451,7 @@ export const getClosestSelectionRect = (state: EditorState): Rect | undefined =>
|
|
|
449
451
|
: findCellRectClosestToPos(selection.$from);
|
|
450
452
|
};
|
|
451
453
|
|
|
452
|
-
|
|
454
|
+
const getClosestSelectionOrTableRect = (state: EditorState): Rect | undefined => {
|
|
453
455
|
const selection = state.selection;
|
|
454
456
|
const tableObject = findTable(state.selection);
|
|
455
457
|
if (!tableObject) {
|
|
@@ -696,7 +698,7 @@ const getCellItems = (
|
|
|
696
698
|
return [];
|
|
697
699
|
};
|
|
698
700
|
|
|
699
|
-
|
|
701
|
+
const getDistributeConfig =
|
|
700
702
|
(
|
|
701
703
|
getEditorContainerWidth: GetEditorContainerWidth,
|
|
702
704
|
api: PluginInjectionAPI | undefined | null,
|
|
@@ -756,6 +758,7 @@ const getColumnSettingItems = (
|
|
|
756
758
|
getEditorContainerWidth,
|
|
757
759
|
isTableScalingEnabled,
|
|
758
760
|
isTableFixedColumnWidthsOptionEnabled,
|
|
761
|
+
isCommentEditor,
|
|
759
762
|
);
|
|
760
763
|
|
|
761
764
|
const wouldChange = newResizeStateWithAnalytics?.changed ?? false;
|
|
@@ -875,7 +878,7 @@ type AlignmentIcon = {
|
|
|
875
878
|
icon: React.ComponentClass<any>;
|
|
876
879
|
};
|
|
877
880
|
|
|
878
|
-
|
|
881
|
+
const getAlignmentOptionsConfig = (
|
|
879
882
|
editorState: EditorState,
|
|
880
883
|
{ formatMessage }: ToolbarMenuContext,
|
|
881
884
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
@@ -964,13 +967,13 @@ export const getAlignmentOptionsConfig = (
|
|
|
964
967
|
return alignmentToolbarItem;
|
|
965
968
|
};
|
|
966
969
|
|
|
967
|
-
|
|
970
|
+
const getSelectedAlignmentIcon = (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => {
|
|
968
971
|
const selectedAlignment = selectedNode.attrs.layout;
|
|
969
972
|
|
|
970
973
|
return alignmentIcons.find((icon) => icon.value === normaliseAlignment(selectedAlignment));
|
|
971
974
|
};
|
|
972
975
|
|
|
973
|
-
|
|
976
|
+
const isLayoutOptionDisabled = (
|
|
974
977
|
selectedNode: PMNode,
|
|
975
978
|
getEditorContainerWidth: GetEditorContainerWidth,
|
|
976
979
|
getDomRef: (editorView: EditorView) => HTMLElement | undefined,
|
|
@@ -115,6 +115,7 @@ export const rescaleColumns =
|
|
|
115
115
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
116
116
|
shouldUseIncreasedScalingPercent = false,
|
|
117
117
|
api: PluginInjectionAPI | undefined | null,
|
|
118
|
+
isCommentEditor = false,
|
|
118
119
|
) =>
|
|
119
120
|
(table: ContentNodeWithPos, view: EditorView | undefined) =>
|
|
120
121
|
(tr: Transaction): Transaction => {
|
|
@@ -215,6 +216,7 @@ export const rescaleColumns =
|
|
|
215
216
|
maxSize: previousTableInfo.possibleMaxWidth,
|
|
216
217
|
isTableScalingEnabled: shouldScale,
|
|
217
218
|
shouldUseIncreasedScalingPercent,
|
|
219
|
+
isCommentEditor,
|
|
218
220
|
});
|
|
219
221
|
// Two scenarios that require scaling:
|
|
220
222
|
// 1. If the new table width will result in the table going into overflow
|
|
@@ -249,6 +249,7 @@ export const deleteColumns =
|
|
|
249
249
|
isTableScalingEnabled = false,
|
|
250
250
|
isTableFixedColumnWidthsOptionEnabled = false,
|
|
251
251
|
shouldUseIncreasedScalingPercent = false,
|
|
252
|
+
isCommentEditor = false,
|
|
252
253
|
) =>
|
|
253
254
|
(tr: Transaction) => {
|
|
254
255
|
let updatedTr = tr;
|
|
@@ -268,6 +269,7 @@ export const deleteColumns =
|
|
|
268
269
|
isTableFixedColumnWidthsOptionEnabled,
|
|
269
270
|
shouldUseIncreasedScalingPercent,
|
|
270
271
|
api,
|
|
272
|
+
isCommentEditor,
|
|
271
273
|
)(
|
|
272
274
|
table,
|
|
273
275
|
view,
|
package/src/transforms/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { fixTables, fixAutoSizedTable } from './fix-tables';
|
|
2
|
-
export { mergeCells, canMergeCells
|
|
2
|
+
export { mergeCells, canMergeCells } from './merge';
|
|
3
3
|
export { deleteColumns } from './delete-columns';
|
|
4
4
|
export { deleteRows } from './delete-rows';
|
|
5
5
|
export { updateColumnWidths } from './column-width';
|
|
@@ -10,9 +10,9 @@ import type { RowStickyState } from '../../pm-plugins/sticky-headers';
|
|
|
10
10
|
import { TableCssClassName as ClassName } from '../../types';
|
|
11
11
|
import { insertColumnButtonOffset } from '../common-styles';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const BUTTON_WIDTH = 20;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface Props {
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
mountTo: HTMLElement;
|
|
18
18
|
offset: number;
|
|
@@ -87,7 +87,7 @@ import { AddColRightIcon, AddRowBelowIcon, MergeCellsIcon, SplitCellIcon } from
|
|
|
87
87
|
|
|
88
88
|
import { cellColourPreviewStyles, elementBeforeIconStyles } from './styles';
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
interface Props {
|
|
91
91
|
editorView: EditorView;
|
|
92
92
|
isOpen: boolean;
|
|
93
93
|
selectionRect: Rect;
|
|
@@ -106,7 +106,7 @@ export interface Props {
|
|
|
106
106
|
isCommentEditor?: boolean;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
interface State {
|
|
110
110
|
isSubmenuOpen: boolean;
|
|
111
111
|
isOpenAllowed: boolean;
|
|
112
112
|
}
|
|
@@ -721,6 +721,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
721
721
|
getEditorContainerWidth,
|
|
722
722
|
isTableScalingEnabled,
|
|
723
723
|
tableWithFixedColumnWidthsOption,
|
|
724
|
+
isCommentEditor,
|
|
724
725
|
);
|
|
725
726
|
|
|
726
727
|
if (newResizeStateWithAnalytics) {
|
|
@@ -746,6 +747,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
746
747
|
tableDuplicateCellColouring,
|
|
747
748
|
tableWithFixedColumnWidthsOption,
|
|
748
749
|
shouldUseIncreasedScalingPercent,
|
|
750
|
+
isCommentEditor,
|
|
749
751
|
)(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
|
|
750
752
|
this.toggleOpen();
|
|
751
753
|
break;
|
|
@@ -766,6 +768,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
766
768
|
isTableScalingEnabled,
|
|
767
769
|
tableWithFixedColumnWidthsOption,
|
|
768
770
|
shouldUseIncreasedScalingPercent,
|
|
771
|
+
isCommentEditor,
|
|
769
772
|
)(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
|
|
770
773
|
this.toggleOpen();
|
|
771
774
|
break;
|
|
@@ -6,7 +6,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
6
6
|
|
|
7
7
|
import { TableCssClassName as ClassName } from '../../types';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
interface ButtonProps {
|
|
10
10
|
removeLabel: MessageDescriptor;
|
|
11
11
|
style?: object;
|
|
12
12
|
onClick?: (event: SyntheticEvent) => void;
|
|
@@ -45,7 +45,7 @@ export interface Props {
|
|
|
45
45
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
interface State {
|
|
49
49
|
selectionType?: CellSelectionType;
|
|
50
50
|
left: number;
|
|
51
51
|
top: number;
|
|
@@ -54,7 +54,7 @@ export interface State {
|
|
|
54
54
|
scrollLeft: number;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
function getSelectionType(selection: Selection): TableDirection | undefined {
|
|
58
58
|
if (!isTableSelected(selection) && selection instanceof CellSelection) {
|
|
59
59
|
if (selection.isRowSelection()) {
|
|
60
60
|
return 'row';
|
|
@@ -102,6 +102,7 @@ type DragMenuProps = {
|
|
|
102
102
|
message: string,
|
|
103
103
|
ariaLiveElementAttributes?: AriaLiveElementAttributes,
|
|
104
104
|
) => void;
|
|
105
|
+
isCommentEditor?: boolean;
|
|
105
106
|
};
|
|
106
107
|
|
|
107
108
|
type PluralOptionType = 'noOfCols' | 'noOfRows' | 'noOfCells' | null;
|
|
@@ -261,7 +262,7 @@ const convertToDropdownItems = (
|
|
|
261
262
|
|
|
262
263
|
const ColorPaletteWithListeners = withOuterListeners(ColorPalette);
|
|
263
264
|
|
|
264
|
-
|
|
265
|
+
const DragMenu = React.memo(
|
|
265
266
|
({
|
|
266
267
|
direction = 'row',
|
|
267
268
|
index,
|
|
@@ -286,6 +287,7 @@ export const DragMenu = React.memo(
|
|
|
286
287
|
isTableFixedColumnWidthsOptionEnabled,
|
|
287
288
|
tableSortColumnReorder,
|
|
288
289
|
ariaNotifyPlugin,
|
|
290
|
+
isCommentEditor,
|
|
289
291
|
}: DragMenuProps & WrappedComponentProps) => {
|
|
290
292
|
const { state, dispatch } = editorView;
|
|
291
293
|
const { selection } = state;
|
|
@@ -318,6 +320,7 @@ export const DragMenu = React.memo(
|
|
|
318
320
|
shouldUseIncreasedScalingPercent,
|
|
319
321
|
tableSortColumnReorder,
|
|
320
322
|
ariaNotifyPlugin,
|
|
323
|
+
isCommentEditor,
|
|
321
324
|
);
|
|
322
325
|
|
|
323
326
|
const { menuItems, menuCallback } = convertToDropdownItems(
|
|
@@ -19,7 +19,7 @@ import { dragMenuDropdownWidth, tablePopupMenuFitHeight } from '../consts';
|
|
|
19
19
|
|
|
20
20
|
import DragMenu from './DragMenu';
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
interface Props {
|
|
23
23
|
editorView: EditorView;
|
|
24
24
|
isOpen: boolean;
|
|
25
25
|
tableRef?: HTMLTableElement;
|
|
@@ -41,6 +41,7 @@ export interface Props {
|
|
|
41
41
|
message: string,
|
|
42
42
|
ariaLiveElementAttributes?: AriaLiveElementAttributes,
|
|
43
43
|
) => void;
|
|
44
|
+
isCommentEditor?: boolean;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
const FloatingDragMenu = ({
|
|
@@ -61,6 +62,7 @@ const FloatingDragMenu = ({
|
|
|
61
62
|
getEditorFeatureFlags,
|
|
62
63
|
ariaNotifyPlugin,
|
|
63
64
|
api,
|
|
65
|
+
isCommentEditor,
|
|
64
66
|
}: Props) => {
|
|
65
67
|
if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
|
|
66
68
|
return null;
|
|
@@ -130,6 +132,7 @@ const FloatingDragMenu = ({
|
|
|
130
132
|
tableSortColumnReorder={tableSortColumnReorder}
|
|
131
133
|
ariaNotifyPlugin={ariaNotifyPlugin}
|
|
132
134
|
api={api}
|
|
135
|
+
isCommentEditor={isCommentEditor || false}
|
|
133
136
|
/>
|
|
134
137
|
</Popup>
|
|
135
138
|
);
|
|
@@ -18,7 +18,7 @@ import type { TableDirection } from '../../types';
|
|
|
18
18
|
import { TableCssClassName as ClassName } from '../../types';
|
|
19
19
|
import { tableToolbarSize } from '../consts';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
interface ButtonProps {
|
|
22
22
|
type: TableDirection;
|
|
23
23
|
tableRef: HTMLElement;
|
|
24
24
|
onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
|
|
@@ -96,7 +96,7 @@ const tooltipMessageByType = (type: TableDirection) => {
|
|
|
96
96
|
return type === 'row' ? messages.insertRow : messages.insertColumn;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
const InsertButtonForDragAndDrop = ({
|
|
100
100
|
onMouseDown,
|
|
101
101
|
tableRef,
|
|
102
102
|
type,
|
|
@@ -55,6 +55,7 @@ export interface Props {
|
|
|
55
55
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
56
56
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
57
57
|
isChromelessEditor?: boolean;
|
|
58
|
+
isCommentEditor?: boolean;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
export class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
|
|
@@ -267,6 +268,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
267
268
|
editorAnalyticsAPI,
|
|
268
269
|
getEditorFeatureFlags,
|
|
269
270
|
isTableScalingEnabled,
|
|
271
|
+
isCommentEditor,
|
|
270
272
|
} = this.props;
|
|
271
273
|
|
|
272
274
|
if (typeof insertColumnButtonIndex !== 'undefined') {
|
|
@@ -288,6 +290,7 @@ export class FloatingInsertButton extends React.Component<Props & WrappedCompone
|
|
|
288
290
|
tableDuplicateCellColouring,
|
|
289
291
|
tableWithFixedColumnWidthsOption,
|
|
290
292
|
shouldUseIncreasedScalingPercent,
|
|
293
|
+
isCommentEditor,
|
|
291
294
|
)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
|
|
292
295
|
}
|
|
293
296
|
}
|
|
@@ -27,7 +27,7 @@ import { getRowsParams, getSelectedColumnIndexes } from '../../../utils';
|
|
|
27
27
|
import type { DragHandleAppearance } from '../../DragHandle';
|
|
28
28
|
import { DragHandle } from '../../DragHandle';
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
interface ColumnControlsProps {
|
|
31
31
|
editorView: EditorView;
|
|
32
32
|
tableActive?: boolean;
|
|
33
33
|
isInDanger?: boolean;
|
|
@@ -339,5 +339,3 @@ export const ColumnControls = ({
|
|
|
339
339
|
</div>
|
|
340
340
|
);
|
|
341
341
|
};
|
|
342
|
-
|
|
343
|
-
export default ColumnControls;
|
|
@@ -9,7 +9,7 @@ import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element
|
|
|
9
9
|
import { getDragBehaviour } from '../../../pm-plugins/drag-and-drop/utils/getDragBehaviour';
|
|
10
10
|
import type { DraggableSourceData } from '../../../types';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface Props {
|
|
13
13
|
index: number;
|
|
14
14
|
localId?: string;
|
|
15
15
|
width?: number;
|
|
@@ -16,7 +16,7 @@ import { containsHeaderColumn, getColumnsWidths, getRowHeights } from '../../uti
|
|
|
16
16
|
import { ColumnControls } from './ColumnControls';
|
|
17
17
|
import { ColumnDropTargets } from './ColumnDropTargets';
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
interface Props {
|
|
20
20
|
editorView: EditorView;
|
|
21
21
|
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
22
22
|
selection?: Selection;
|
|
@@ -40,7 +40,7 @@ export interface Props {
|
|
|
40
40
|
isChromelessEditor?: boolean;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
const TableFloatingColumnControls = ({
|
|
44
44
|
editorView,
|
|
45
45
|
tableRef,
|
|
46
46
|
getNode,
|
|
@@ -11,7 +11,7 @@ import { TableCssClassName as ClassName } from '../../../types';
|
|
|
11
11
|
import { getRowHeights } from '../../../utils';
|
|
12
12
|
import { tableBorderColor } from '../../consts';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface Props {
|
|
15
15
|
editorView: EditorView;
|
|
16
16
|
tableRef: HTMLTableElement;
|
|
17
17
|
tableActive?: boolean;
|
|
@@ -9,7 +9,7 @@ import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element
|
|
|
9
9
|
import { getDragBehaviour } from '../../../pm-plugins/drag-and-drop/utils/getDragBehaviour';
|
|
10
10
|
import type { DraggableSourceData } from '../../../types';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
type RowDropTargetProps = {
|
|
13
13
|
index: number;
|
|
14
14
|
localId?: string;
|
|
15
15
|
style?: React.CSSProperties;
|
|
@@ -26,7 +26,7 @@ import { FloatingControlsWithSelection } from './FloatingControlsWithSelection';
|
|
|
26
26
|
import NumberColumn from './NumberColumn';
|
|
27
27
|
import { DragControls, RowControls } from './RowControls';
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
interface TableFloatingControlsProps {
|
|
30
30
|
editorView: EditorView;
|
|
31
31
|
selection?: Selection;
|
|
32
32
|
tableRef?: HTMLTableElement;
|
package/src/ui/icons/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { DragHandleIcon } from './DragHandleIcon';
|
|
2
|
-
export { DragInMotionIcon } from './DragInMotionIcon';
|
|
3
2
|
export { DragHandleDisabledIcon } from './DragHandleDisabledIcon';
|
|
4
3
|
export { MinimisedHandleIcon } from './MinimisedHandle';
|
|
5
4
|
export { MergeCellsIcon } from './MergeCellsIcon';
|
|
@@ -2,16 +2,9 @@ import { maphElem } from '@atlaskit/editor-common/utils';
|
|
|
2
2
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
getSelectionRect,
|
|
10
|
-
isColumnSelected,
|
|
11
|
-
isTableSelected,
|
|
12
|
-
} from '@atlaskit/editor-tables/utils';
|
|
13
|
-
|
|
14
|
-
import { TableCssClassName as ClassName } from '../types';
|
|
6
|
+
import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
|
|
15
8
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
16
9
|
|
|
17
10
|
interface CellWidthInfo {
|
|
@@ -44,18 +37,6 @@ export const getColumnsWidths = (view: EditorView): Array<number | undefined> =>
|
|
|
44
37
|
return widths;
|
|
45
38
|
};
|
|
46
39
|
|
|
47
|
-
export const isColumnDeleteButtonVisible = (selection: Selection): boolean => {
|
|
48
|
-
if (
|
|
49
|
-
!isTableSelected(selection) &&
|
|
50
|
-
selection instanceof CellSelection &&
|
|
51
|
-
selection.isColSelection()
|
|
52
|
-
) {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return false;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
40
|
export const getColumnDeleteButtonParams = (
|
|
60
41
|
columnsWidths: Array<number | undefined>,
|
|
61
42
|
selection: Selection,
|
|
@@ -87,23 +68,6 @@ export const getColumnDeleteButtonParams = (
|
|
|
87
68
|
return { left, indexes };
|
|
88
69
|
};
|
|
89
70
|
|
|
90
|
-
export const getColumnClassNames = (
|
|
91
|
-
index: number,
|
|
92
|
-
selection: Selection,
|
|
93
|
-
hoveredColumns: number[] = [],
|
|
94
|
-
isInDanger?: boolean,
|
|
95
|
-
isResizing?: boolean,
|
|
96
|
-
): string => {
|
|
97
|
-
const classNames: string[] = [];
|
|
98
|
-
if (isColumnSelected(index)(selection) || (hoveredColumns.indexOf(index) > -1 && !isResizing)) {
|
|
99
|
-
classNames.push(ClassName.HOVERED_CELL_ACTIVE);
|
|
100
|
-
if (isInDanger) {
|
|
101
|
-
classNames.push(ClassName.HOVERED_CELL_IN_DANGER);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return classNames.join(' ');
|
|
105
|
-
};
|
|
106
|
-
|
|
107
71
|
// give a row colspan and a colwidths
|
|
108
72
|
// and map to a row's colwidths
|
|
109
73
|
const mapTableColwidthsToRow = (rowColSpans: number[], tableColWidths: number[]) => {
|
package/src/utils/dom.ts
CHANGED
|
@@ -44,10 +44,6 @@ export const isTableContainerOrWrapper = (node: HTMLElement | null): boolean =>
|
|
|
44
44
|
containsClassName(node, ClassName.TABLE_NODE_WRAPPER);
|
|
45
45
|
|
|
46
46
|
/** drag-and-drop classes */
|
|
47
|
-
export const isDragRowControlsButton = (node: HTMLElement | null) =>
|
|
48
|
-
containsClassName(node, ClassName.DRAG_ROW_CONTROLS) ||
|
|
49
|
-
closestElement(node, `.${ClassName.DRAG_ROW_CONTROLS}`);
|
|
50
|
-
|
|
51
47
|
export const isDragRowFloatingInsertDot = (node: HTMLElement | null) =>
|
|
52
48
|
containsClassName(node, ClassName.DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER);
|
|
53
49
|
|
package/src/utils/drag-menu.ts
CHANGED
|
@@ -155,6 +155,7 @@ export const getDragMenuConfig = (
|
|
|
155
155
|
message: string,
|
|
156
156
|
ariaLiveElementAttributes?: AriaLiveElementAttributes,
|
|
157
157
|
) => void,
|
|
158
|
+
isCommentEditor = false,
|
|
158
159
|
): DragMenuConfig[] => {
|
|
159
160
|
const { selection } = editorView.state;
|
|
160
161
|
const { getIntl } = getTablePluginState(editorView.state);
|
|
@@ -303,6 +304,7 @@ export const getDragMenuConfig = (
|
|
|
303
304
|
getEditorContainerWidth,
|
|
304
305
|
isTableScalingEnabled,
|
|
305
306
|
isTableFixedColumnWidthsOptionEnabled,
|
|
307
|
+
isCommentEditor,
|
|
306
308
|
);
|
|
307
309
|
|
|
308
310
|
if (newResizeState) {
|
|
@@ -349,6 +351,7 @@ export const getDragMenuConfig = (
|
|
|
349
351
|
isTableScalingEnabled,
|
|
350
352
|
isTableFixedColumnWidthsOptionEnabled,
|
|
351
353
|
shouldUseIncreasedScalingPercent,
|
|
354
|
+
isCommentEditor,
|
|
352
355
|
)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect ?? defaultSelectionRect)(
|
|
353
356
|
state,
|
|
354
357
|
dispatch,
|