@atlaskit/editor-plugin-table 7.25.9 → 7.25.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/commands/clear.js +2 -14
- package/dist/cjs/commands/column-resize.js +11 -5
- package/dist/cjs/commands/delete.js +2 -1
- package/dist/cjs/commands/insert.js +8 -5
- package/dist/cjs/commands/selection.js +3 -3
- package/dist/cjs/commands-with-analytics.js +23 -52
- package/dist/cjs/nodeviews/TableComponent.js +29 -14
- package/dist/cjs/nodeviews/TableContainer.js +2 -2
- package/dist/cjs/nodeviews/TableResizer.js +1 -1
- package/dist/cjs/plugin.js +4 -2
- package/dist/cjs/pm-plugins/decorations/utils/index.js +1 -8
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +3 -3
- package/dist/cjs/pm-plugins/drag-and-drop/index.js +1 -14
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +4 -1
- package/dist/cjs/pm-plugins/drag-and-drop/utils/index.js +0 -7
- package/dist/cjs/pm-plugins/safari-delete-composition-text-issue-workaround.js +2 -2
- package/dist/cjs/pm-plugins/sticky-headers/index.js +1 -14
- package/dist/cjs/pm-plugins/table-analytics.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/commands.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +33 -15
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +15 -6
- package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +1 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +3 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/index.js +0 -103
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +23 -15
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +6 -7
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +23 -18
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +13 -8
- package/dist/cjs/pm-plugins/table-selection-keymap.js +1 -3
- package/dist/cjs/pm-plugins/view-mode-sort/utils.js +2 -2
- package/dist/cjs/toolbar.js +9 -9
- package/dist/cjs/transforms/column-width.js +3 -1
- package/dist/cjs/transforms/delete-columns.js +2 -1
- package/dist/cjs/transforms/index.js +0 -6
- package/dist/cjs/ui/DragHandle/index.js +3 -1
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/cjs/ui/FloatingDeleteButton/index.js +0 -1
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +5 -4
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -2
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +2 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -3
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/cjs/ui/icons/index.js +0 -7
- package/dist/cjs/utils/column-controls.js +1 -22
- package/dist/cjs/utils/dom.js +1 -4
- package/dist/cjs/utils/drag-menu.js +3 -2
- package/dist/cjs/utils/index.js +0 -108
- package/dist/cjs/utils/merged-cells.js +1 -60
- package/dist/cjs/utils/nodes.js +2 -2
- package/dist/cjs/utils/row-controls.js +1 -8
- package/dist/cjs/utils/selection.js +1 -60
- package/dist/cjs/utils/table.js +1 -11
- package/dist/es2019/commands/clear.js +1 -14
- package/dist/es2019/commands/column-resize.js +11 -5
- package/dist/es2019/commands/delete.js +2 -2
- package/dist/es2019/commands/insert.js +8 -8
- package/dist/es2019/commands/selection.js +2 -2
- package/dist/es2019/commands-with-analytics.js +6 -36
- package/dist/es2019/nodeviews/TableComponent.js +30 -15
- package/dist/es2019/nodeviews/TableContainer.js +1 -1
- package/dist/es2019/nodeviews/TableResizer.js +1 -1
- package/dist/es2019/plugin.js +4 -2
- package/dist/es2019/pm-plugins/decorations/utils/index.js +1 -2
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +2 -2
- package/dist/es2019/pm-plugins/drag-and-drop/index.js +1 -2
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +4 -1
- package/dist/es2019/pm-plugins/drag-and-drop/utils/index.js +0 -1
- package/dist/es2019/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/es2019/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/es2019/pm-plugins/table-analytics.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +32 -14
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +15 -7
- package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +0 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/index.js +5 -6
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +22 -14
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +6 -7
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +21 -15
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +10 -7
- package/dist/es2019/pm-plugins/table-selection-keymap.js +1 -2
- package/dist/es2019/pm-plugins/view-mode-sort/utils.js +1 -1
- package/dist/es2019/toolbar.js +8 -8
- package/dist/es2019/transforms/column-width.js +3 -2
- package/dist/es2019/transforms/delete-columns.js +2 -2
- package/dist/es2019/transforms/index.js +1 -1
- package/dist/es2019/ui/DragHandle/index.js +3 -1
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/es2019/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +4 -3
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -2
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +1 -1
- package/dist/es2019/ui/FloatingInsertButton/index.js +3 -2
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/es2019/ui/icons/index.js +0 -1
- package/dist/es2019/utils/column-controls.js +1 -19
- package/dist/es2019/utils/dom.js +0 -1
- package/dist/es2019/utils/drag-menu.js +3 -3
- package/dist/es2019/utils/index.js +8 -8
- package/dist/es2019/utils/merged-cells.js +0 -47
- package/dist/es2019/utils/nodes.js +1 -1
- package/dist/es2019/utils/row-controls.js +1 -8
- package/dist/es2019/utils/selection.js +0 -60
- package/dist/es2019/utils/table.js +0 -6
- package/dist/esm/commands/clear.js +1 -14
- package/dist/esm/commands/column-resize.js +11 -5
- package/dist/esm/commands/delete.js +2 -1
- package/dist/esm/commands/insert.js +8 -5
- package/dist/esm/commands/selection.js +2 -2
- package/dist/esm/commands-with-analytics.js +24 -52
- package/dist/esm/nodeviews/TableComponent.js +30 -15
- package/dist/esm/nodeviews/TableContainer.js +1 -1
- package/dist/esm/nodeviews/TableResizer.js +1 -1
- package/dist/esm/plugin.js +4 -2
- package/dist/esm/pm-plugins/decorations/utils/index.js +1 -2
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +2 -2
- package/dist/esm/pm-plugins/drag-and-drop/index.js +1 -2
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +4 -1
- package/dist/esm/pm-plugins/drag-and-drop/utils/index.js +0 -1
- package/dist/esm/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/esm/pm-plugins/sticky-headers/index.js +1 -2
- package/dist/esm/pm-plugins/table-analytics.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +33 -15
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +15 -6
- package/dist/esm/pm-plugins/table-resizing/utils/consts.js +0 -1
- package/dist/esm/pm-plugins/table-resizing/utils/dom.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/index.js +5 -6
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +24 -14
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +6 -7
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +22 -17
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +12 -6
- package/dist/esm/pm-plugins/table-selection-keymap.js +1 -2
- package/dist/esm/pm-plugins/view-mode-sort/utils.js +1 -1
- package/dist/esm/toolbar.js +8 -8
- package/dist/esm/transforms/column-width.js +3 -1
- package/dist/esm/transforms/delete-columns.js +2 -1
- package/dist/esm/transforms/index.js +1 -1
- package/dist/esm/ui/DragHandle/index.js +3 -1
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/esm/ui/FloatingDeleteButton/index.js +1 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +4 -3
- package/dist/esm/ui/FloatingDragMenu/index.js +4 -2
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +3 -2
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +1 -2
- package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/esm/ui/icons/index.js +0 -1
- package/dist/esm/utils/column-controls.js +1 -22
- package/dist/esm/utils/dom.js +0 -3
- package/dist/esm/utils/drag-menu.js +3 -2
- package/dist/esm/utils/index.js +8 -8
- package/dist/esm/utils/merged-cells.js +0 -59
- package/dist/esm/utils/nodes.js +1 -1
- package/dist/esm/utils/row-controls.js +1 -8
- package/dist/esm/utils/selection.js +0 -59
- package/dist/esm/utils/table.js +0 -9
- package/dist/types/commands/clear.d.ts +0 -1
- package/dist/types/commands/delete.d.ts +1 -1
- package/dist/types/commands/insert.d.ts +4 -4
- package/dist/types/commands/selection.d.ts +0 -4
- package/dist/types/commands-with-analytics.d.ts +2 -3
- package/dist/types/nodeviews/TableComponent.d.ts +1 -1
- package/dist/types/nodeviews/TableContainer.d.ts +0 -11
- package/dist/types/nodeviews/TableResizer.d.ts +1 -3
- package/dist/types/pm-plugins/analytics/actions.d.ts +3 -2
- package/dist/types/pm-plugins/decorations/utils/index.d.ts +0 -1
- package/dist/types/pm-plugins/decorations/utils/types.d.ts +2 -1
- package/dist/types/pm-plugins/drag-and-drop/actions.d.ts +5 -4
- package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +1 -6
- package/dist/types/pm-plugins/drag-and-drop/index.d.ts +0 -2
- package/dist/types/pm-plugins/drag-and-drop/utils/index.d.ts +0 -1
- package/dist/types/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -2
- package/dist/types/pm-plugins/sticky-headers/index.d.ts +0 -1
- package/dist/types/pm-plugins/sticky-headers/types.d.ts +3 -2
- package/dist/types/pm-plugins/table-analytics.d.ts +0 -12
- package/dist/types/pm-plugins/table-resizing/commands.d.ts +0 -5
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +3 -2
- package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +0 -1
- package/dist/types/pm-plugins/table-resizing/utils/dom.d.ts +0 -2
- package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +5 -8
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
- package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +3 -2
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -5
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -4
- package/dist/types/pm-plugins/table-selection-keymap.d.ts +0 -1
- package/dist/types/pm-plugins/view-mode-sort/types.d.ts +2 -1
- package/dist/types/pm-plugins/view-mode-sort/utils.d.ts +0 -6
- package/dist/types/toolbar.d.ts +1 -14
- package/dist/types/transforms/column-width.d.ts +1 -1
- package/dist/types/transforms/delete-columns.d.ts +1 -1
- package/dist/types/transforms/index.d.ts +1 -1
- package/dist/types/ui/FloatingContextualButton/FixedButton.d.ts +1 -2
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +2 -3
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +1 -2
- package/dist/types/ui/FloatingDragMenu/index.d.ts +3 -2
- package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +1 -2
- package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +2 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -1
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -1
- package/dist/types/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types/ui/icons/index.d.ts +0 -1
- package/dist/types/utils/column-controls.d.ts +0 -2
- package/dist/types/utils/dom.d.ts +0 -1
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types/utils/index.d.ts +8 -8
- package/dist/types/utils/merged-cells.d.ts +0 -2
- package/dist/types/utils/nodes.d.ts +0 -1
- package/dist/types/utils/row-controls.d.ts +0 -1
- package/dist/types/utils/selection.d.ts +0 -3
- package/dist/types/utils/table.d.ts +0 -2
- package/dist/types-ts4.5/commands/clear.d.ts +0 -1
- package/dist/types-ts4.5/commands/delete.d.ts +1 -1
- package/dist/types-ts4.5/commands/insert.d.ts +4 -4
- package/dist/types-ts4.5/commands/selection.d.ts +0 -4
- package/dist/types-ts4.5/commands-with-analytics.d.ts +2 -3
- package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +0 -11
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -3
- package/dist/types-ts4.5/pm-plugins/analytics/actions.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/decorations/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/decorations/utils/types.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/actions.d.ts +5 -4
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +1 -6
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/index.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/sticky-headers/index.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/sticky-headers/types.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/table-analytics.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/dom.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +5 -8
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -5
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -4
- package/dist/types-ts4.5/pm-plugins/table-selection-keymap.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/types.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/utils.d.ts +0 -6
- package/dist/types-ts4.5/toolbar.d.ts +1 -14
- package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
- package/dist/types-ts4.5/transforms/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +1 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +2 -3
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +1 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +1 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/RowDropTarget/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/icons/index.d.ts +0 -1
- package/dist/types-ts4.5/utils/column-controls.d.ts +0 -2
- package/dist/types-ts4.5/utils/dom.d.ts +0 -1
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/utils/index.d.ts +8 -8
- package/dist/types-ts4.5/utils/merged-cells.d.ts +0 -2
- package/dist/types-ts4.5/utils/nodes.d.ts +0 -1
- package/dist/types-ts4.5/utils/row-controls.d.ts +0 -1
- package/dist/types-ts4.5/utils/selection.d.ts +0 -3
- package/dist/types-ts4.5/utils/table.d.ts +0 -2
- package/package.json +3 -3
- package/src/commands/clear.ts +0 -14
- package/src/commands/column-resize.ts +19 -6
- package/src/commands/delete.ts +2 -0
- package/src/commands/insert.ts +8 -0
- package/src/commands/selection.ts +1 -1
- package/src/commands-with-analytics.ts +5 -40
- package/src/nodeviews/TableComponent.tsx +43 -9
- package/src/nodeviews/TableContainer.tsx +1 -1
- package/src/nodeviews/TableResizer.tsx +2 -4
- package/src/plugin.tsx +2 -0
- package/src/pm-plugins/analytics/actions.ts +2 -2
- package/src/pm-plugins/decorations/utils/index.ts +0 -1
- package/src/pm-plugins/decorations/utils/types.ts +1 -1
- package/src/pm-plugins/drag-and-drop/actions.ts +4 -4
- package/src/pm-plugins/drag-and-drop/commands.ts +2 -2
- package/src/pm-plugins/drag-and-drop/index.ts +0 -3
- package/src/pm-plugins/drag-and-drop/plugin.ts +4 -0
- package/src/pm-plugins/drag-and-drop/utils/index.ts +0 -2
- package/src/pm-plugins/safari-delete-composition-text-issue-workaround.ts +1 -1
- package/src/pm-plugins/sticky-headers/index.ts +0 -1
- package/src/pm-plugins/sticky-headers/types.ts +2 -2
- package/src/pm-plugins/table-analytics.ts +1 -1
- package/src/pm-plugins/table-resizing/commands.ts +1 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +39 -15
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +18 -7
- package/src/pm-plugins/table-resizing/utils/consts.ts +0 -1
- package/src/pm-plugins/table-resizing/utils/dom.ts +2 -5
- package/src/pm-plugins/table-resizing/utils/index.ts +4 -30
- package/src/pm-plugins/table-resizing/utils/misc.ts +25 -17
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +14 -13
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +28 -21
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +18 -6
- package/src/pm-plugins/table-selection-keymap.ts +0 -2
- package/src/pm-plugins/view-mode-sort/types.ts +1 -1
- package/src/pm-plugins/view-mode-sort/utils.ts +1 -5
- package/src/toolbar.tsx +8 -5
- package/src/transforms/column-width.ts +2 -0
- package/src/transforms/delete-columns.ts +2 -0
- package/src/transforms/index.ts +1 -1
- package/src/ui/DragHandle/index.tsx +2 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +2 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +5 -2
- package/src/ui/FloatingContextualMenu/index.tsx +1 -1
- package/src/ui/FloatingDeleteButton/DeleteButton.tsx +1 -1
- package/src/ui/FloatingDeleteButton/index.tsx +2 -2
- package/src/ui/FloatingDragMenu/DragMenu.tsx +4 -1
- package/src/ui/FloatingDragMenu/index.tsx +4 -1
- package/src/ui/FloatingInsertButton/InsertButton.tsx +2 -2
- package/src/ui/FloatingInsertButton/index.tsx +3 -0
- package/src/ui/FloatingToolbarLabel/FloatingToolbarLabel.tsx +1 -1
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +1 -3
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +1 -1
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +1 -1
- package/src/ui/TableFloatingColumnControls/index.tsx +2 -2
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -1
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +2 -0
- package/src/ui/TableFloatingControls/RowDropTarget/index.tsx +1 -1
- package/src/ui/TableFloatingControls/index.tsx +1 -1
- package/src/ui/icons/index.ts +0 -1
- package/src/utils/column-controls.ts +2 -38
- package/src/utils/dom.ts +0 -4
- package/src/utils/drag-menu.ts +3 -0
- package/src/utils/index.ts +1 -22
- package/src/utils/merged-cells.ts +0 -62
- package/src/utils/nodes.ts +1 -1
- package/src/utils/row-controls.ts +1 -19
- package/src/utils/selection.ts +0 -84
- package/src/utils/table.ts +0 -8
- package/dist/cjs/utils/transforms.js +0 -11
- package/dist/es2019/utils/transforms.js +0 -5
- package/dist/esm/utils/transforms.js +0 -5
- package/dist/types/utils/transforms.d.ts +0 -2
- package/dist/types-ts4.5/utils/transforms.d.ts +0 -2
- package/src/utils/transforms.ts +0 -10
|
@@ -1,64 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { findTable, TableMap } from '@atlaskit/editor-tables';
|
|
3
|
-
var hasMergedCells = function hasMergedCells(indexes, normalizeRect) {
|
|
4
|
-
return function (selection) {
|
|
5
|
-
var table = findTable(selection);
|
|
6
|
-
if (!table) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
var map = TableMap.get(table.node);
|
|
10
|
-
var cellPositions = new Set();
|
|
11
|
-
var mergedCells = new Set();
|
|
12
|
-
map.map.forEach(function (value) {
|
|
13
|
-
if (cellPositions.has(value)) {
|
|
14
|
-
mergedCells.add(value);
|
|
15
|
-
} else {
|
|
16
|
-
cellPositions.add(value);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
if (!mergedCells.size) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return (Array.isArray(indexes) ? indexes : [indexes]).map(function (index) {
|
|
23
|
-
return normalizeRect(index, map);
|
|
24
|
-
}).filter(function (rect) {
|
|
25
|
-
return rect.left < rect.right && rect.top < rect.bottom;
|
|
26
|
-
}).some(function (rect) {
|
|
27
|
-
var n = (rect.right - rect.left) * (rect.bottom - rect.top);
|
|
28
|
-
var cells = map.cellsInRect(rect);
|
|
29
|
-
if (cells.length !== n) {
|
|
30
|
-
// We can quickly assume that if the amount of cells from the map is different to what the rect says
|
|
31
|
-
// then there is most likely merged cells across this area which is removing cells
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
return cells.some(function (nodePos) {
|
|
35
|
-
return mergedCells.has(nodePos);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export var hasMergedCellsInColumn = function hasMergedCellsInColumn(columnIndexes) {
|
|
41
|
-
return hasMergedCells(columnIndexes, function (index, map) {
|
|
42
|
-
var x = Math.max(Math.min(index, map.width - 1), 0); // clamped index
|
|
43
|
-
return {
|
|
44
|
-
left: x,
|
|
45
|
-
right: x === index ? x + 1 : x,
|
|
46
|
-
top: 0,
|
|
47
|
-
bottom: map.height
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export var hasMergedCellsInRow = function hasMergedCellsInRow(rowIndexes) {
|
|
52
|
-
return hasMergedCells(rowIndexes, function (index, map) {
|
|
53
|
-
var y = Math.max(Math.min(index, map.height - 1), 0); // clamped index
|
|
54
|
-
return {
|
|
55
|
-
left: 0,
|
|
56
|
-
right: map.width,
|
|
57
|
-
top: y,
|
|
58
|
-
bottom: y === index ? y + 1 : y
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
3
|
var getRect = function getRect(index, type, map) {
|
|
63
4
|
if (type === 'column') {
|
|
64
5
|
var x = Math.max(Math.min(index, map.width - 1), 0); // clamped index
|
package/dist/esm/utils/nodes.js
CHANGED
|
@@ -99,7 +99,7 @@ export var isTableNested = function isTableNested(state) {
|
|
|
99
99
|
var nodeTypes = state.schema.nodes;
|
|
100
100
|
return parent.type === nodeTypes.layoutColumn || parent.type === nodeTypes.expand || parent.type === nodeTypes.bodiedExtension || parent.type === nodeTypes.extensionFrame;
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
var anyChildCellMergedAcrossRow = function anyChildCellMergedAcrossRow(node) {
|
|
103
103
|
return mapChildren(node, function (child) {
|
|
104
104
|
return child.attrs.rowspan || 0;
|
|
105
105
|
}).some(function (rowspan) {
|
|
@@ -3,9 +3,8 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { parsePx } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
|
-
import { findTable, getSelectionRect, isRowSelected
|
|
7
|
+
import { findTable, getSelectionRect, isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
9
8
|
import { TableCssClassName as ClassName } from '../types';
|
|
10
9
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
11
10
|
export var getRowHeights = function getRowHeights(tableRef) {
|
|
@@ -27,12 +26,6 @@ export var getRowHeights = function getRowHeights(tableRef) {
|
|
|
27
26
|
}
|
|
28
27
|
return heights;
|
|
29
28
|
};
|
|
30
|
-
export var isRowDeleteButtonVisible = function isRowDeleteButtonVisible(selection) {
|
|
31
|
-
if (!isTableSelected(selection) && selection instanceof CellSelection && selection.isRowSelection()) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
};
|
|
36
29
|
export var getRowDeleteButtonParams = function getRowDeleteButtonParams(rowsHeights, selection) {
|
|
37
30
|
var offsetTop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
38
31
|
var rect = getSelectionRect(selection);
|
|
@@ -1,62 +1,3 @@
|
|
|
1
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
|
-
import { findTable, getSelectionRangeInColumn, getSelectionRangeInRow, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
export var isSelectionUpdated = function isSelectionUpdated(oldSelection, newSelection) {
|
|
5
|
-
return !!(!newSelection && oldSelection) || isSelectionType(oldSelection, 'cell') !== isSelectionType(newSelection, 'cell') || isSelectionType(oldSelection, 'cell') && isSelectionType(newSelection, 'cell') && oldSelection.ranges !== newSelection.ranges;
|
|
6
|
-
};
|
|
7
|
-
var isRectangularCellSelection = function isRectangularCellSelection(selection, rect) {
|
|
8
|
-
var table = findTable(selection);
|
|
9
|
-
if (!table) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
var _TableMap$get = TableMap.get(table.node),
|
|
13
|
-
width = _TableMap$get.width,
|
|
14
|
-
height = _TableMap$get.height,
|
|
15
|
-
map = _TableMap$get.map;
|
|
16
|
-
var indexTop = rect.top * width + rect.left;
|
|
17
|
-
var indexLeft = indexTop;
|
|
18
|
-
var indexBottom = (rect.bottom - 1) * width + rect.left;
|
|
19
|
-
var indexRight = indexTop + (rect.right - rect.left - 1);
|
|
20
|
-
for (var i = rect.top; i < rect.bottom; i++) {
|
|
21
|
-
if (rect.left > 0 && map[indexLeft] === map[indexLeft - 1] || rect.right < width && map[indexRight] === map[indexRight + 1]) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
indexLeft += width;
|
|
25
|
-
indexRight += width;
|
|
26
|
-
}
|
|
27
|
-
for (var _i = rect.left; _i < rect.right; _i++) {
|
|
28
|
-
if (rect.top > 0 && map[indexTop] === map[indexTop - width] || rect.bottom < height && map[indexBottom] === map[indexBottom + width]) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
indexTop++;
|
|
32
|
-
indexBottom++;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
};
|
|
36
|
-
export var normalizeSelection = function normalizeSelection(tr) {
|
|
37
|
-
var selection = tr.selection;
|
|
38
|
-
var rect = getSelectionRect(selection);
|
|
39
|
-
if (!rect || !(selection instanceof CellSelection) || isRectangularCellSelection(selection, rect)) {
|
|
40
|
-
return tr;
|
|
41
|
-
}
|
|
42
|
-
if (selection.isColSelection()) {
|
|
43
|
-
var _getSelectionRangeInC, _getSelectionRangeInC2;
|
|
44
|
-
var $anchor = (_getSelectionRangeInC = getSelectionRangeInColumn(rect.left)(tr)) === null || _getSelectionRangeInC === void 0 ? void 0 : _getSelectionRangeInC.$anchor;
|
|
45
|
-
var $head = (_getSelectionRangeInC2 = getSelectionRangeInColumn(rect.right - 1)(tr)) === null || _getSelectionRangeInC2 === void 0 ? void 0 : _getSelectionRangeInC2.$head;
|
|
46
|
-
if ($anchor && $head) {
|
|
47
|
-
return tr.setSelection(new CellSelection($anchor, $head));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (selection.isRowSelection()) {
|
|
51
|
-
var _getSelectionRangeInR, _getSelectionRangeInR2;
|
|
52
|
-
var _$anchor = (_getSelectionRangeInR = getSelectionRangeInRow(rect.top)(tr)) === null || _getSelectionRangeInR === void 0 ? void 0 : _getSelectionRangeInR.$anchor;
|
|
53
|
-
var _$head = (_getSelectionRangeInR2 = getSelectionRangeInRow(rect.bottom - 1)(tr)) === null || _getSelectionRangeInR2 === void 0 ? void 0 : _getSelectionRangeInR2.$head;
|
|
54
|
-
if (_$anchor && _$head) {
|
|
55
|
-
return tr.setSelection(new CellSelection(_$anchor, _$head));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return tr;
|
|
59
|
-
};
|
|
60
1
|
export var getSelectedColumnIndexes = function getSelectedColumnIndexes(selectionRect) {
|
|
61
2
|
var columnIndexes = [];
|
|
62
3
|
for (var i = selectionRect.left; i < selectionRect.right; i++) {
|
package/dist/esm/utils/table.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
3
2
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
3
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
@@ -19,14 +18,6 @@ export var getMergedCellsPositions = function getMergedCellsPositions(tr) {
|
|
|
19
18
|
});
|
|
20
19
|
return mergedCells;
|
|
21
20
|
};
|
|
22
|
-
export var colsToRect = function colsToRect(cols, noOfRows) {
|
|
23
|
-
return {
|
|
24
|
-
left: Math.min.apply(Math, _toConsumableArray(cols)),
|
|
25
|
-
right: Math.max.apply(Math, _toConsumableArray(cols)) + 1,
|
|
26
|
-
top: 0,
|
|
27
|
-
bottom: noOfRows
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
21
|
export var getAssistiveMessage = function getAssistiveMessage(prevTableNode, currentTableNode, intl) {
|
|
31
22
|
var formatMessage = intl.formatMessage;
|
|
32
23
|
var prevTableMap = TableMap.get(prevTableNode);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
3
3
|
import type { PluginInjectionAPI } from '../types';
|
|
4
|
-
export declare const deleteColumnsCommand: (rect: Rect, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
4
|
+
export declare const deleteColumnsCommand: (rect: Rect, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Command;
|
|
@@ -4,10 +4,10 @@ import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { PluginInjectionAPI } from '../types';
|
|
7
|
-
export declare function addColumnAt(api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
8
|
-
export declare const addColumnBefore: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
|
-
export declare const addColumnAfter: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
10
|
-
export declare const insertColumn: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
|
|
7
|
+
export declare function addColumnAt(api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
8
|
+
export declare const addColumnBefore: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Command;
|
|
9
|
+
export declare const addColumnAfter: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Command;
|
|
10
|
+
export declare const insertColumn: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (column: number) => Command;
|
|
11
11
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
12
12
|
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
|
|
13
13
|
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -2,10 +2,6 @@ import { type IntlShape } from 'react-intl-next/src/types';
|
|
|
2
2
|
import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessibility-utils';
|
|
4
4
|
import type tablePlugin from '../plugin';
|
|
5
|
-
export declare enum TableSelectionDirection {
|
|
6
|
-
TopToBottom = "TopToBottom",
|
|
7
|
-
BottomToTop = "BottomToTop"
|
|
8
|
-
}
|
|
9
5
|
export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
|
|
10
6
|
export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
|
|
11
7
|
export declare const selectColumns: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined, ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, getIntl?: () => IntlShape) => (triggeredByKeyboard?: boolean) => Command;
|
|
@@ -17,16 +17,15 @@ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalytics
|
|
|
17
17
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
18
18
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
19
19
|
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, isCommentEditor: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
|
|
20
|
-
export declare const insertColumnWithAnalytics: (api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
20
|
+
export declare const insertColumnWithAnalytics: (api: PluginInjectionAPI | undefined | null, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
21
21
|
export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
|
|
22
|
-
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
22
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
23
23
|
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
24
24
|
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
25
25
|
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
26
26
|
export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
27
27
|
export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
28
28
|
export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
29
|
-
export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
30
29
|
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
31
30
|
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, api: PluginInjectionAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
32
31
|
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -8,7 +8,7 @@ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
8
8
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { CellHoverMeta, PluginInjectionAPI } from '../types';
|
|
10
10
|
import type { TableOptions } from './types';
|
|
11
|
-
|
|
11
|
+
interface ComponentProps {
|
|
12
12
|
view: EditorView;
|
|
13
13
|
getNode: () => PmNode;
|
|
14
14
|
allowColumnResizing?: boolean;
|
|
@@ -4,17 +4,6 @@ import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { PluginInjectionAPI } from '../types';
|
|
7
|
-
type InnerContainerProps = {
|
|
8
|
-
className: string;
|
|
9
|
-
style?: {
|
|
10
|
-
width: number | 'inherit';
|
|
11
|
-
marginLeft?: number;
|
|
12
|
-
};
|
|
13
|
-
node: PMNode;
|
|
14
|
-
};
|
|
15
|
-
export declare const InnerContainer: React.ForwardRefExoticComponent<InnerContainerProps & {
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
7
|
type ResizableTableContainerProps = {
|
|
19
8
|
containerWidth: number;
|
|
20
9
|
lineLength: number;
|
|
@@ -26,10 +26,8 @@ interface TableResizerProps {
|
|
|
26
26
|
isFullWidthModeEnabled?: boolean;
|
|
27
27
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
28
28
|
isCommentEditor?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export interface TableResizerImprovementProps extends TableResizerProps {
|
|
31
29
|
onResizeStop?: () => void;
|
|
32
30
|
onResizeStart?: () => void;
|
|
33
31
|
}
|
|
34
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, }: PropsWithChildren<
|
|
32
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, isCommentEditor, }: PropsWithChildren<TableResizerProps>) => JSX.Element;
|
|
35
33
|
export {};
|
|
@@ -6,12 +6,13 @@ export declare enum AnalyticPluginTypes {
|
|
|
6
6
|
RemoveOverFlowTriggerNameAction = 3,
|
|
7
7
|
UpdateRowOrColumnMovedAndOverflowTrigger = 4
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
type UpdateRowOrColumnMovedAction = {
|
|
10
10
|
type: AnalyticPluginTypes.UpdateRowOrColumnMovedAction;
|
|
11
11
|
data: RowOrColumnMovedState;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type RemoveRowOrColumnMovedAction = {
|
|
14
14
|
type: AnalyticPluginTypes.RemoveRowOrColumnMovedAction;
|
|
15
15
|
data: undefined;
|
|
16
16
|
};
|
|
17
17
|
export type AnalyticPluginAction = UpdateRowOrColumnMovedAction | RemoveRowOrColumnMovedAction;
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration, } from './column-controls';
|
|
2
2
|
export { buildColumnResizingDecorations, clearColumnResizingDecorations } from './column-resizing';
|
|
3
|
-
export { composeDecorations } from './compose-decorations';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
export type DecorationTransformer = (params: DecorationTransformerParams) => DecorationSet;
|
|
4
|
-
|
|
4
|
+
type DecorationTransformerParams = {
|
|
5
5
|
decorationSet: DecorationSet;
|
|
6
6
|
tr: Transaction | ReadonlyTransaction;
|
|
7
7
|
};
|
|
@@ -10,3 +10,4 @@ export type BuildDecorationTransformerParams = DecorationTransformerParams & {
|
|
|
10
10
|
isDragAndDropEnabled: boolean;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import type { TableDirection } from '../../types';
|
|
3
3
|
import type { DropTargetType } from './consts';
|
|
4
|
-
|
|
4
|
+
interface DragAndDropAction<T, D> {
|
|
5
5
|
type: T;
|
|
6
6
|
data: D;
|
|
7
7
|
}
|
|
@@ -10,18 +10,19 @@ export declare const DragAndDropActionType: {
|
|
|
10
10
|
readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
|
|
11
11
|
readonly TOGGLE_DRAG_MENU: "TOGGLE_DRAG_MENU";
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
|
|
14
14
|
type: DropTargetType;
|
|
15
15
|
index: number;
|
|
16
16
|
decorationSet: DecorationSet;
|
|
17
17
|
}>;
|
|
18
|
-
|
|
18
|
+
type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, {
|
|
19
19
|
decorationSet: DecorationSet;
|
|
20
20
|
}>;
|
|
21
|
-
|
|
21
|
+
type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDropActionType.TOGGLE_DRAG_MENU, {
|
|
22
22
|
isDragMenuOpen: boolean;
|
|
23
23
|
direction: TableDirection;
|
|
24
24
|
index: number;
|
|
25
25
|
isKeyboardModeActive: boolean;
|
|
26
26
|
}>;
|
|
27
27
|
export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
|
|
28
|
+
export {};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
2
|
import type { DraggableType, TableDirection } from '../../types';
|
|
5
|
-
import { TableDecorations } from '../../types';
|
|
6
3
|
import { DropTargetType } from './consts';
|
|
7
4
|
import type { TriggerType } from './types';
|
|
8
|
-
export declare const getDecorations: (state: EditorState) => DecorationSet;
|
|
9
|
-
export declare const updatePluginStateDecorations: (state: EditorState, decorations: Decoration[], key: TableDecorations) => DecorationSet;
|
|
10
5
|
export declare const setDropTarget: (type: DropTargetType, index: number, hasMergedCells: boolean, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
11
6
|
export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
12
7
|
export declare const moveSource: (sourceType: DraggableType, sourceIndexes: number[], targetIndex: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
* We will remove this plugin when Webkit fix the problem itself.
|
|
5
5
|
*/
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
7
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
8
|
interface SafariDeleteCompositionTextIssueWorkaroundPluginState {
|
|
10
9
|
renderSpan: boolean;
|
|
11
10
|
decorations: DecorationSet;
|
|
12
11
|
}
|
|
13
|
-
export declare const tableSafariDeleteCompositionTextIssueWorkaroundKey: PluginKey<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
14
12
|
export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
|
|
15
13
|
export {};
|
|
@@ -5,12 +5,13 @@ export type RowStickyState = {
|
|
|
5
5
|
sticky: boolean;
|
|
6
6
|
};
|
|
7
7
|
export type StickyPluginState = RowStickyState[];
|
|
8
|
-
|
|
8
|
+
type UpdateSticky = {
|
|
9
9
|
name: 'UPDATE';
|
|
10
10
|
state: RowStickyState;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type RemoveSticky = {
|
|
13
13
|
name: 'REMOVE';
|
|
14
14
|
pos: number;
|
|
15
15
|
};
|
|
16
16
|
export type StickyPluginAction = UpdateSticky | RemoveSticky;
|
|
17
|
+
export {};
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A plugin is created for collecting payload data for tableOverflowChanged analytics event
|
|
3
|
-
*/
|
|
4
|
-
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
5
1
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
6
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
7
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
-
interface LastTrigger {
|
|
10
|
-
name: TABLE_OVERFLOW_CHANGE_TRIGGER;
|
|
11
|
-
}
|
|
12
|
-
type TableAnalyticsPluginState = {
|
|
13
|
-
lastTrigger: LastTrigger | undefined;
|
|
14
|
-
};
|
|
15
|
-
export declare const pluginKey: PluginKey<TableAnalyticsPluginState>;
|
|
16
4
|
export declare const META_KEYS: {
|
|
17
5
|
OVERFLOW_TRIGGER: string;
|
|
18
6
|
OVERFLOW_STATE_CHANGED: string;
|
|
@@ -18,8 +18,3 @@ export declare const setDragging: (dragging: {
|
|
|
18
18
|
startX: number;
|
|
19
19
|
startWidth: number;
|
|
20
20
|
} | null, tr?: Transaction) => Command;
|
|
21
|
-
export declare const setLastClick: (lastClick: {
|
|
22
|
-
x: number;
|
|
23
|
-
y: number;
|
|
24
|
-
time: number;
|
|
25
|
-
} | null, transform?: ((tr: Transaction) => Transaction) | undefined) => Command;
|
|
@@ -9,9 +9,10 @@ type Col = Array<string | {
|
|
|
9
9
|
* overflow.
|
|
10
10
|
*/
|
|
11
11
|
export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
|
|
12
|
-
export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean) => Col[];
|
|
13
|
-
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean) => HTMLCollection;
|
|
12
|
+
export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Col[];
|
|
13
|
+
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => HTMLCollection;
|
|
14
14
|
export declare const hasTableBeenResized: (table: PmNode) => boolean;
|
|
15
|
+
export declare const hasTableColumnBeenResized: (table: PmNode) => boolean;
|
|
15
16
|
/**
|
|
16
17
|
* Check if a table has all the column width set to tableCellMinWidth(48px) or null
|
|
17
18
|
*
|
|
@@ -7,6 +7,4 @@ export declare const isClickNear: (event: MouseEvent, click: {
|
|
|
7
7
|
}) => boolean;
|
|
8
8
|
export declare const getResizeCellPos: (view: EditorView, event: MouseEvent) => number | null;
|
|
9
9
|
export declare const updateStickyMargins: (table: HTMLElement) => void;
|
|
10
|
-
export declare const applyColWidthsToStickyRow: (colGroup: HTMLTableColElement | null, headerRow: HTMLTableRowElement) => void;
|
|
11
10
|
export declare const syncStickyRowToTable: (tableRef?: HTMLElement | null) => void;
|
|
12
|
-
export declare const applyTableWidthToStickyRow: (tableRef: HTMLElement, headerRow: HTMLTableRowElement) => void;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export { generateColgroup, insertColgroupFromNode, hasTableBeenResized, getColgroupChildrenLength, } from './colgroup';
|
|
2
2
|
export { contentWidth } from './content-width';
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export { getResizeState, updateColgroup, getTotalWidth, evenAllColumnsWidths, bulkColumnsResize, areColumnsEven, adjustColumnsWidths, } from './resize-state';
|
|
7
|
-
export { getLayoutSize, getDefaultLayoutMaxWidth, pointsAtCell, currentColWidth, domCellAround, getTableMaxWidth, getTableElementWidth, getTableContainerElementWidth, } from './misc';
|
|
3
|
+
export { getCellsRefsInColumn, calculateColumnWidth } from './column-state';
|
|
4
|
+
export { getResizeState, updateColgroup, evenAllColumnsWidths } from './resize-state';
|
|
5
|
+
export { getLayoutSize, pointsAtCell, currentColWidth, getTableMaxWidth, getTableElementWidth, getTableContainerElementWidth, } from './misc';
|
|
8
6
|
export { updateControls, isClickNear, getResizeCellPos } from './dom';
|
|
9
|
-
export {
|
|
10
|
-
export type { ScaleOptions } from './scale-table';
|
|
7
|
+
export { scaleTable, previewScaleTable } from './scale-table';
|
|
11
8
|
export type { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
12
9
|
export { resizeColumn, resizeColumnAndTable } from './resize-column';
|
|
13
|
-
export { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH,
|
|
10
|
+
export { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from './consts';
|
|
@@ -5,10 +5,8 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { TableOptions } from '../../../nodeviews/types';
|
|
7
7
|
export declare function getLayoutSize(tableLayout: 'default' | 'wide' | 'full-width', containerWidth: number | undefined, options: TableOptions): number;
|
|
8
|
-
export declare function getDefaultLayoutMaxWidth(containerWidth?: number): number;
|
|
9
8
|
export declare function pointsAtCell($pos: ResolvedPos): false | PMNode | null;
|
|
10
9
|
export declare function currentColWidth(view: EditorView, cellPos: number, { colspan, colwidth }: CellAttributes): number;
|
|
11
|
-
export declare function domCellAround(target: HTMLElement | null): HTMLElement | null;
|
|
12
10
|
interface getTableMaxWidthProps {
|
|
13
11
|
table: PMNode;
|
|
14
12
|
tableStart: number;
|
|
@@ -25,5 +23,6 @@ export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getE
|
|
|
25
23
|
export declare const getTableElementWidth: (table: PMNode) => number;
|
|
26
24
|
export declare const getTableContainerElementWidth: (table: PMNode) => number;
|
|
27
25
|
export declare const getTableScalingPercent: (table: PMNode, tableRef: HTMLElement | null, shouldUseIncreasedScalingPercent?: boolean) => number;
|
|
26
|
+
export declare const getScalingPercentForTableWithoutWidth: (table: PMNode, tableRef: HTMLElement | null) => number;
|
|
28
27
|
export declare const getStaticTableScalingPercent: (table: PMNode, tableRenderWidth: number, shouldUseIncreasedScalingPercent?: boolean) => number;
|
|
29
28
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { ResizeState } from './types';
|
|
4
|
-
export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement | null, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean,
|
|
4
|
+
export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement | null, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean, scalePercent?: number) => ResizeState;
|
|
5
5
|
type ResizeInformation = {
|
|
6
6
|
resizeState: ResizeState;
|
|
7
7
|
colIndex: number;
|
|
@@ -19,8 +19,9 @@ export declare const resizeColumnAndTable: ({ resizeState, colIndex, amount, tab
|
|
|
19
19
|
/**
|
|
20
20
|
* Apply a scaling factor to resize state
|
|
21
21
|
*/
|
|
22
|
-
export declare const scaleResizeState: ({ resizeState, tableRef, tableNode, editorWidth, }: TableReferences & {
|
|
22
|
+
export declare const scaleResizeState: ({ resizeState, tableRef, tableNode, editorWidth, shouldUseIncreasedScalingPercent, }: TableReferences & {
|
|
23
23
|
resizeState: ResizeState;
|
|
24
24
|
editorWidth: number;
|
|
25
|
+
shouldUseIncreasedScalingPercent: boolean;
|
|
25
26
|
}) => ResizeState;
|
|
26
27
|
export {};
|
|
@@ -3,7 +3,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
5
5
|
import type { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
6
|
-
export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, isTableScalingEnabled, shouldUseIncreasedScalingPercent, }: {
|
|
6
|
+
export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: {
|
|
7
7
|
minWidth: number;
|
|
8
8
|
maxSize: number;
|
|
9
9
|
table: PMNode;
|
|
@@ -15,15 +15,13 @@ export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, star
|
|
|
15
15
|
};
|
|
16
16
|
isTableScalingEnabled: boolean;
|
|
17
17
|
shouldUseIncreasedScalingPercent: boolean;
|
|
18
|
+
isCommentEditor: boolean;
|
|
18
19
|
}) => ResizeState;
|
|
19
|
-
export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement | null, tableNode?: PMNode, isTableScalingEnabled?: boolean,
|
|
20
|
+
export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement | null, tableNode?: PMNode, isTableScalingEnabled?: boolean, scalePercent?: number) => void;
|
|
20
21
|
export declare const getTotalWidth: ({ cols }: ResizeState) => number;
|
|
21
22
|
export declare const adjustColumnsWidths: (resizeState: ResizeState, maxSize: number) => ResizeState;
|
|
22
23
|
export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeState;
|
|
23
|
-
export declare const evenSelectedColumnsWidths: (resizeState: ResizeState, rect: Rect) => ResizeState;
|
|
24
24
|
export declare const bulkColumnsResize: (resizeState: ResizeState, columnsIndexes: number[], sourceColumnIndex: number) => ResizeState;
|
|
25
|
-
export declare const areColumnsEven: (resizeState: ResizeState) => boolean;
|
|
26
|
-
export declare const normaliseTableLayout: (input: string | undefined | null) => "wide" | "default" | "full-width";
|
|
27
25
|
export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
|
|
28
26
|
node: Node;
|
|
29
27
|
offset: number;
|
|
@@ -3,7 +3,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
4
|
import type { PluginInjectionAPI } from '../../../types';
|
|
5
5
|
import type { ResizeState } from '../utils/types';
|
|
6
|
-
|
|
6
|
+
interface ScaleOptions {
|
|
7
7
|
node: PMNode;
|
|
8
8
|
prevNode: PMNode;
|
|
9
9
|
start: number;
|
|
@@ -14,8 +14,7 @@ export interface ScaleOptions {
|
|
|
14
14
|
isFullWidthModeEnabled?: boolean;
|
|
15
15
|
isTableResizingEnabled?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState | undefined;
|
|
18
|
-
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState;
|
|
19
17
|
export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
|
|
20
18
|
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => void;
|
|
21
|
-
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, api: PluginInjectionAPI | undefined | null, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
19
|
+
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, api: PluginInjectionAPI | undefined | null, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (tr: Transaction) => Transaction;
|
|
20
|
+
export {};
|
|
@@ -2,4 +2,3 @@ import { type IntlShape } from 'react-intl-next/src/types';
|
|
|
2
2
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { type PluginInjectionAPI } from '../types';
|
|
4
4
|
export declare function tableSelectionKeymapPlugin(pluginInjectionApi?: PluginInjectionAPI, getIntl?: () => IntlShape): SafePlugin;
|
|
5
|
-
export default tableSelectionKeymapPlugin;
|