@atlaskit/editor-plugin-table 7.25.10 → 7.25.12
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/analytics/plugin.js +2 -1
- 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/analytics/plugin.js +2 -1
- 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/analytics/plugin.js +2 -1
- 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 +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/analytics/plugin.ts +2 -1
- 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
|
@@ -25,6 +25,7 @@ export const getResizeState = ({
|
|
|
25
25
|
domAtPos,
|
|
26
26
|
isTableScalingEnabled = false,
|
|
27
27
|
shouldUseIncreasedScalingPercent = false,
|
|
28
|
+
isCommentEditor = false,
|
|
28
29
|
}: {
|
|
29
30
|
minWidth: number;
|
|
30
31
|
maxSize: number;
|
|
@@ -34,13 +35,18 @@ export const getResizeState = ({
|
|
|
34
35
|
domAtPos: (pos: number) => { node: Node; offset: number };
|
|
35
36
|
isTableScalingEnabled: boolean;
|
|
36
37
|
shouldUseIncreasedScalingPercent: boolean;
|
|
38
|
+
isCommentEditor: boolean;
|
|
37
39
|
}): ResizeState => {
|
|
38
|
-
if (
|
|
40
|
+
if (
|
|
41
|
+
(isTableScalingEnabled && !isCommentEditor) ||
|
|
42
|
+
(isTableScalingEnabled && isCommentEditor && table.attrs?.width)
|
|
43
|
+
) {
|
|
39
44
|
const scalePercent = getTableScalingPercent(table, tableRef, shouldUseIncreasedScalingPercent);
|
|
40
45
|
minWidth = Math.ceil(minWidth / scalePercent);
|
|
41
46
|
}
|
|
42
|
-
|
|
47
|
+
|
|
43
48
|
if (hasTableBeenResized(table)) {
|
|
49
|
+
// If the table has been resized, we can use the column widths from the table node
|
|
44
50
|
const cols = calcTableColumnWidths(table).map((width, index) => ({
|
|
45
51
|
width: width === 0 ? tableNewColumnMinWidth : width,
|
|
46
52
|
minWidth: width === 0 ? tableNewColumnMinWidth : minWidth,
|
|
@@ -70,12 +76,16 @@ export const getResizeState = ({
|
|
|
70
76
|
isTableScalingEnabled,
|
|
71
77
|
shouldReinsertColgroup, // don't reinsert colgroup when preserving table width - this causes widths to jump
|
|
72
78
|
shouldUseIncreasedScalingPercent,
|
|
79
|
+
isCommentEditor,
|
|
73
80
|
);
|
|
74
81
|
const cols = Array.from(colgroupChildren).map((_, index) => {
|
|
75
82
|
// If the table hasn't been resized and we have a table width attribute, we can use it
|
|
76
83
|
// to calculate the widths of the columns
|
|
77
84
|
if (isTableScalingEnabled) {
|
|
78
|
-
|
|
85
|
+
// isCommentEditor when table cols were not resized,
|
|
86
|
+
// we want to use tableRef.parentElement.clientWidth, which is the same as maxSize
|
|
87
|
+
const tableNodeWidth =
|
|
88
|
+
isCommentEditor && !table.attrs?.width ? maxSize : getTableContainerWidth(table);
|
|
79
89
|
return {
|
|
80
90
|
index,
|
|
81
91
|
width: tableNodeWidth / colgroupChildren.length,
|
|
@@ -107,7 +117,7 @@ export const updateColgroup = (
|
|
|
107
117
|
tableRef: HTMLElement | null,
|
|
108
118
|
tableNode?: PMNode,
|
|
109
119
|
isTableScalingEnabled?: boolean,
|
|
110
|
-
|
|
120
|
+
scalePercent?: number,
|
|
111
121
|
): void => {
|
|
112
122
|
const cols = tableRef?.querySelectorAll('col');
|
|
113
123
|
const columnsCount = cols?.length;
|
|
@@ -117,16 +127,11 @@ export const updateColgroup = (
|
|
|
117
127
|
We need to remove !isColumnResizing if we handled auto scale table when mouseUp event.
|
|
118
128
|
* */
|
|
119
129
|
if (isTableScalingEnabled && tableNode) {
|
|
120
|
-
const scalePercent = getTableScalingPercent(
|
|
121
|
-
tableNode,
|
|
122
|
-
tableRef,
|
|
123
|
-
shouldUseIncreasedScalingPercent,
|
|
124
|
-
);
|
|
125
130
|
state.cols
|
|
126
131
|
.filter((column) => column && !!column.width) // if width is 0, we dont want to apply that.
|
|
127
132
|
.forEach((column, i) => {
|
|
128
133
|
const fixedColWidth = getColWidthFix(column.width, columnsCount ?? 0);
|
|
129
|
-
const scaledWidth = fixedColWidth * scalePercent;
|
|
134
|
+
const scaledWidth = fixedColWidth * (scalePercent || 1);
|
|
130
135
|
const finalWidth = Math.max(scaledWidth, tableCellMinWidth);
|
|
131
136
|
// we aren't handling the remaining pixels here when the 48px min width is reached
|
|
132
137
|
if (cols?.[i]) {
|
|
@@ -187,7 +192,7 @@ const getSpace = (columns: ColumnState[], start: number, end: number) =>
|
|
|
187
192
|
.map((col) => col.width)
|
|
188
193
|
.reduce((sum, width) => sum + width, 0);
|
|
189
194
|
|
|
190
|
-
|
|
195
|
+
const evenSelectedColumnsWidths = (resizeState: ResizeState, rect: Rect): ResizeState => {
|
|
191
196
|
const cols = resizeState.cols;
|
|
192
197
|
const selectedSpace = getSpace(cols, rect.left, rect.right);
|
|
193
198
|
const allSpace = getSpace(cols, 0, cols.length);
|
|
@@ -302,13 +307,8 @@ export const bulkColumnsResize = (
|
|
|
302
307
|
return adjustColumnsWidths(newState, resizeState.maxSize);
|
|
303
308
|
};
|
|
304
309
|
|
|
305
|
-
export const areColumnsEven = (resizeState: ResizeState): boolean => {
|
|
306
|
-
const newResizeState = evenAllColumnsWidths(resizeState);
|
|
307
|
-
return newResizeState.cols.every((col, i) => col.width === resizeState.cols[i].width);
|
|
308
|
-
};
|
|
309
|
-
|
|
310
310
|
// Get the layout
|
|
311
|
-
|
|
311
|
+
const normaliseTableLayout = (input: string | undefined | null) => {
|
|
312
312
|
switch (input) {
|
|
313
313
|
case 'wide':
|
|
314
314
|
return input;
|
|
@@ -373,6 +373,15 @@ export const getNewResizeStateFromSelectedColumns = (
|
|
|
373
373
|
isTableScalingEnabledOnCurrentTable = table.node.attrs.displayMode !== 'fixed';
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
let shouldUseIncreasedScalingPercent =
|
|
377
|
+
isTableScalingWithFixedColumnWidthsOptionEnabled &&
|
|
378
|
+
fg('platform.editor.table.use-increased-scaling-percent');
|
|
379
|
+
|
|
380
|
+
if (isTableScalingEnabled && isCommentEditor) {
|
|
381
|
+
isTableScalingEnabledOnCurrentTable = true;
|
|
382
|
+
shouldUseIncreasedScalingPercent = true;
|
|
383
|
+
}
|
|
384
|
+
|
|
376
385
|
resizeState = getResizeState({
|
|
377
386
|
minWidth: tableCellMinWidth,
|
|
378
387
|
maxSize,
|
|
@@ -381,10 +390,8 @@ export const getNewResizeStateFromSelectedColumns = (
|
|
|
381
390
|
start: table.start,
|
|
382
391
|
domAtPos,
|
|
383
392
|
isTableScalingEnabled: isTableScalingEnabledOnCurrentTable,
|
|
384
|
-
shouldUseIncreasedScalingPercent
|
|
385
|
-
|
|
386
|
-
fg('platform.editor.table.use-increased-scaling-percent')) ||
|
|
387
|
-
(isTableScalingEnabled && isCommentEditor),
|
|
393
|
+
shouldUseIncreasedScalingPercent,
|
|
394
|
+
isCommentEditor,
|
|
388
395
|
});
|
|
389
396
|
|
|
390
397
|
const newResizeState = evenSelectedColumnsWidths(resizeState, rect);
|
|
@@ -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';
|