@atlaskit/editor-plugin-table 8.4.11 → 8.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +6 -3
- package/dist/cjs/nodeviews/TableCell.js +5 -0
- package/dist/cjs/nodeviews/TableComponent.js +92 -29
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +7 -1
- package/dist/cjs/nodeviews/TableContainer.js +16 -6
- package/dist/cjs/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/cjs/nodeviews/TableResizer.js +44 -15
- package/dist/cjs/nodeviews/TableRow.js +45 -1
- package/dist/cjs/nodeviews/TableStickyScrollbar.js +21 -2
- package/dist/cjs/nodeviews/lazy-node-views.js +16 -4
- package/dist/cjs/nodeviews/table.js +53 -18
- package/dist/cjs/pm-plugins/commands/clear.js +6 -0
- package/dist/cjs/pm-plugins/commands/column-resize.js +26 -17
- package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +39 -26
- package/dist/cjs/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/cjs/pm-plugins/commands/hover.js +17 -13
- package/dist/cjs/pm-plugins/commands/insert.js +27 -10
- package/dist/cjs/pm-plugins/commands/misc.js +29 -9
- package/dist/cjs/pm-plugins/commands/selection.js +4 -0
- package/dist/cjs/pm-plugins/commands/sort.js +10 -1
- package/dist/cjs/pm-plugins/commands/toggle.js +2 -0
- package/dist/cjs/pm-plugins/decorations/plugin.js +9 -4
- package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +19 -10
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +16 -7
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +21 -8
- package/dist/cjs/pm-plugins/handlers.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +103 -24
- package/dist/cjs/pm-plugins/main.js +22 -11
- package/dist/cjs/pm-plugins/table-resizing/commands.js +7 -6
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +39 -20
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +4 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +19 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +8 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +6 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/cjs/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/cjs/pm-plugins/table-width.js +9 -4
- package/dist/cjs/pm-plugins/transforms/column-width.js +8 -5
- package/dist/cjs/pm-plugins/transforms/delete-columns.js +2 -0
- package/dist/cjs/pm-plugins/transforms/fix-tables.js +24 -8
- package/dist/cjs/pm-plugins/transforms/merge.js +7 -0
- package/dist/cjs/pm-plugins/transforms/replace-table.js +6 -3
- package/dist/cjs/pm-plugins/transforms/split.js +6 -1
- package/dist/cjs/pm-plugins/utils/alignment.js +4 -1
- package/dist/cjs/pm-plugins/utils/analytics.js +3 -3
- package/dist/cjs/pm-plugins/utils/column-controls.js +4 -0
- package/dist/cjs/pm-plugins/utils/create.js +2 -2
- package/dist/cjs/pm-plugins/utils/decoration.js +24 -6
- package/dist/cjs/pm-plugins/utils/dom.js +4 -0
- package/dist/cjs/pm-plugins/utils/drag-menu.js +19 -7
- package/dist/cjs/pm-plugins/utils/nodes.js +3 -0
- package/dist/cjs/pm-plugins/utils/paste.js +4 -1
- package/dist/cjs/pm-plugins/utils/row-controls.js +4 -1
- package/dist/cjs/tablePlugin.js +24 -18
- package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/cjs/ui/DragHandle/HandleIconComponent.js +5 -3
- package/dist/cjs/ui/DragHandle/index.js +14 -7
- package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/cjs/ui/FloatingContextualButton/index.js +7 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +32 -15
- package/dist/cjs/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/cjs/ui/FloatingDeleteButton/index.js +27 -5
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +19 -7
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -1
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/cjs/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/cjs/ui/FloatingInsertButton/index.js +27 -3
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +30 -8
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/cjs/ui/TableFloatingColumnControls/index.js +9 -5
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/cjs/ui/TableFloatingControls/FloatingControlsWithSelection.js +4 -4
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +8 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +9 -5
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +68 -41
- package/dist/cjs/ui/TableFloatingControls/index.js +19 -8
- package/dist/cjs/ui/common-styles.js +1 -1
- package/dist/cjs/ui/event-handlers.js +59 -32
- package/dist/cjs/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/cjs/ui/toolbar.js +42 -16
- package/dist/es2019/nodeviews/ExternalDropTargets.js +5 -2
- package/dist/es2019/nodeviews/TableCell.js +5 -0
- package/dist/es2019/nodeviews/TableComponent.js +77 -13
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +8 -1
- package/dist/es2019/nodeviews/TableContainer.js +14 -4
- package/dist/es2019/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/es2019/nodeviews/TableResizer.js +33 -4
- package/dist/es2019/nodeviews/TableRow.js +45 -1
- package/dist/es2019/nodeviews/TableStickyScrollbar.js +20 -2
- package/dist/es2019/nodeviews/lazy-node-views.js +16 -4
- package/dist/es2019/nodeviews/table.js +47 -12
- package/dist/es2019/pm-plugins/commands/clear.js +6 -0
- package/dist/es2019/pm-plugins/commands/column-resize.js +16 -7
- package/dist/es2019/pm-plugins/commands/commands-with-analytics.js +28 -9
- package/dist/es2019/pm-plugins/commands/delete.js +4 -1
- package/dist/es2019/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/es2019/pm-plugins/commands/hover.js +5 -1
- package/dist/es2019/pm-plugins/commands/insert.js +26 -6
- package/dist/es2019/pm-plugins/commands/misc.js +25 -5
- package/dist/es2019/pm-plugins/commands/selection.js +4 -0
- package/dist/es2019/pm-plugins/commands/sort.js +10 -1
- package/dist/es2019/pm-plugins/commands/toggle.js +2 -0
- package/dist/es2019/pm-plugins/decorations/plugin.js +7 -2
- package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +14 -5
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +17 -5
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +21 -5
- package/dist/es2019/pm-plugins/handlers.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +104 -24
- package/dist/es2019/pm-plugins/main.js +16 -5
- package/dist/es2019/pm-plugins/table-resizing/commands.js +3 -2
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +25 -6
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +4 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +23 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +12 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +9 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +18 -6
- package/dist/es2019/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/es2019/pm-plugins/table-width.js +7 -2
- package/dist/es2019/pm-plugins/transforms/column-width.js +12 -5
- package/dist/es2019/pm-plugins/transforms/delete-columns.js +6 -1
- package/dist/es2019/pm-plugins/transforms/fix-tables.js +20 -4
- package/dist/es2019/pm-plugins/transforms/merge.js +7 -0
- package/dist/es2019/pm-plugins/transforms/replace-table.js +5 -2
- package/dist/es2019/pm-plugins/transforms/split.js +6 -1
- package/dist/es2019/pm-plugins/utils/alignment.js +4 -1
- package/dist/es2019/pm-plugins/utils/analytics.js +2 -2
- package/dist/es2019/pm-plugins/utils/column-controls.js +4 -0
- package/dist/es2019/pm-plugins/utils/create.js +1 -1
- package/dist/es2019/pm-plugins/utils/decoration.js +24 -6
- package/dist/es2019/pm-plugins/utils/dom.js +4 -0
- package/dist/es2019/pm-plugins/utils/drag-menu.js +19 -4
- package/dist/es2019/pm-plugins/utils/nodes.js +3 -0
- package/dist/es2019/pm-plugins/utils/paste.js +8 -2
- package/dist/es2019/pm-plugins/utils/row-controls.js +4 -1
- package/dist/es2019/pm-plugins/utils/snapping.js +4 -1
- package/dist/es2019/tablePlugin.js +13 -4
- package/dist/es2019/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/es2019/ui/DragHandle/HandleIconComponent.js +3 -1
- package/dist/es2019/ui/DragHandle/index.js +10 -3
- package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/es2019/ui/FloatingContextualButton/index.js +7 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +23 -6
- package/dist/es2019/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/es2019/ui/FloatingDeleteButton/index.js +23 -1
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +15 -3
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -1
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/es2019/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/es2019/ui/FloatingInsertButton/index.js +26 -2
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +28 -6
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/es2019/ui/TableFloatingColumnControls/index.js +7 -2
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/FloatingControlsWithSelection.js +2 -2
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +7 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +7 -2
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +32 -6
- package/dist/es2019/ui/TableFloatingControls/index.js +14 -3
- package/dist/es2019/ui/common-styles.js +7 -0
- package/dist/es2019/ui/event-handlers.js +35 -5
- package/dist/es2019/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/es2019/ui/toolbar.js +58 -14
- package/dist/esm/nodeviews/ExternalDropTargets.js +5 -2
- package/dist/esm/nodeviews/TableCell.js +5 -0
- package/dist/esm/nodeviews/TableComponent.js +75 -11
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +8 -1
- package/dist/esm/nodeviews/TableContainer.js +14 -4
- package/dist/esm/nodeviews/TableNodeViewBase.js +4 -0
- package/dist/esm/nodeviews/TableResizer.js +33 -4
- package/dist/esm/nodeviews/TableRow.js +45 -1
- package/dist/esm/nodeviews/TableStickyScrollbar.js +21 -2
- package/dist/esm/nodeviews/lazy-node-views.js +16 -4
- package/dist/esm/nodeviews/table.js +47 -12
- package/dist/esm/pm-plugins/commands/clear.js +6 -0
- package/dist/esm/pm-plugins/commands/column-resize.js +16 -7
- package/dist/esm/pm-plugins/commands/commands-with-analytics.js +20 -7
- package/dist/esm/pm-plugins/commands/go-to-next-cell.js +2 -0
- package/dist/esm/pm-plugins/commands/hover.js +5 -1
- package/dist/esm/pm-plugins/commands/insert.js +22 -5
- package/dist/esm/pm-plugins/commands/misc.js +25 -5
- package/dist/esm/pm-plugins/commands/selection.js +4 -0
- package/dist/esm/pm-plugins/commands/sort.js +10 -1
- package/dist/esm/pm-plugins/commands/toggle.js +2 -0
- package/dist/esm/pm-plugins/decorations/plugin.js +7 -2
- package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +4 -1
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +14 -5
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +13 -4
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +17 -4
- package/dist/esm/pm-plugins/handlers.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +104 -24
- package/dist/esm/pm-plugins/main.js +16 -5
- package/dist/esm/pm-plugins/table-resizing/commands.js +3 -2
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +25 -6
- package/dist/esm/pm-plugins/table-resizing/plugin.js +4 -1
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +19 -1
- package/dist/esm/pm-plugins/table-resizing/utils/column-state.js +6 -1
- package/dist/esm/pm-plugins/table-resizing/utils/content-width.js +17 -0
- package/dist/esm/pm-plugins/table-resizing/utils/dom.js +4 -0
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -0
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +8 -1
- package/dist/esm/pm-plugins/table-resizing/utils/resize-logic.js +10 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +5 -2
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +2 -2
- package/dist/esm/pm-plugins/table-selection-keymap.js +12 -0
- package/dist/esm/pm-plugins/table-width.js +7 -2
- package/dist/esm/pm-plugins/transforms/column-width.js +6 -4
- package/dist/esm/pm-plugins/transforms/delete-columns.js +2 -0
- package/dist/esm/pm-plugins/transforms/fix-tables.js +20 -4
- package/dist/esm/pm-plugins/transforms/merge.js +7 -0
- package/dist/esm/pm-plugins/transforms/replace-table.js +5 -2
- package/dist/esm/pm-plugins/transforms/split.js +6 -1
- package/dist/esm/pm-plugins/utils/alignment.js +4 -1
- package/dist/esm/pm-plugins/utils/analytics.js +2 -2
- package/dist/esm/pm-plugins/utils/column-controls.js +4 -0
- package/dist/esm/pm-plugins/utils/create.js +1 -1
- package/dist/esm/pm-plugins/utils/decoration.js +24 -6
- package/dist/esm/pm-plugins/utils/dom.js +4 -0
- package/dist/esm/pm-plugins/utils/drag-menu.js +15 -3
- package/dist/esm/pm-plugins/utils/nodes.js +3 -0
- package/dist/esm/pm-plugins/utils/paste.js +4 -1
- package/dist/esm/pm-plugins/utils/row-controls.js +4 -1
- package/dist/esm/tablePlugin.js +11 -4
- package/dist/esm/ui/ColumnResizeWidget/index.js +2 -0
- package/dist/esm/ui/DragHandle/HandleIconComponent.js +3 -1
- package/dist/esm/ui/DragHandle/index.js +10 -3
- package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +8 -1
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +4 -0
- package/dist/esm/ui/FloatingContextualButton/index.js +7 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +23 -6
- package/dist/esm/ui/FloatingContextualMenu/index.js +19 -4
- package/dist/esm/ui/FloatingDeleteButton/index.js +23 -1
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +15 -3
- package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +15 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +4 -1
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +4 -0
- package/dist/esm/ui/FloatingInsertButton/getPopupOptions.js +6 -0
- package/dist/esm/ui/FloatingInsertButton/index.js +26 -2
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +28 -6
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/index.js +4 -1
- package/dist/esm/ui/TableFloatingColumnControls/index.js +6 -2
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +2 -0
- package/dist/esm/ui/TableFloatingControls/FloatingControlsWithSelection.js +2 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +7 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +6 -2
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +65 -38
- package/dist/esm/ui/TableFloatingControls/index.js +14 -3
- package/dist/esm/ui/common-styles.js +1 -1
- package/dist/esm/ui/event-handlers.js +31 -4
- package/dist/esm/ui/icons/SortingIconWrapper.js +2 -0
- package/dist/esm/ui/toolbar.js +34 -8
- package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/commands.d.ts +1 -1
- package/dist/types/pm-plugins/transforms/column-width.d.ts +1 -1
- package/dist/types/pm-plugins/utils/collapse.d.ts +2 -1
- package/dist/types/ui/FloatingContextualButton/FixedButton.d.ts +1 -1
- package/dist/types/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +1 -1
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -4
- package/dist/types/ui/TableFloatingControls/index.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/collapse.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -4
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +3 -3
- package/package.json +4 -4
- package/src/nodeviews/ExternalDropTargets.tsx +3 -1
- package/src/nodeviews/TableCell.ts +4 -0
- package/src/nodeviews/TableComponent.tsx +63 -18
- package/src/nodeviews/TableComponentWithSharedState.tsx +4 -0
- package/src/nodeviews/TableContainer.tsx +7 -1
- package/src/nodeviews/TableNodeViewBase.ts +4 -0
- package/src/nodeviews/TableResizer.tsx +27 -4
- package/src/nodeviews/TableRow.ts +41 -1
- package/src/nodeviews/TableStickyScrollbar.ts +14 -0
- package/src/nodeviews/__mocks__/OverflowShadowsObserver.ts +2 -0
- package/src/nodeviews/__mocks__/OverridableMock.ts +6 -0
- package/src/nodeviews/lazy-node-views.ts +8 -0
- package/src/nodeviews/table.tsx +30 -4
- package/src/pm-plugins/commands/clear.ts +6 -0
- package/src/pm-plugins/commands/column-resize.ts +12 -9
- package/src/pm-plugins/commands/commands-with-analytics.ts +21 -4
- package/src/pm-plugins/commands/delete.ts +2 -0
- package/src/pm-plugins/commands/go-to-next-cell.ts +2 -0
- package/src/pm-plugins/commands/hover.ts +7 -5
- package/src/pm-plugins/commands/insert.ts +15 -1
- package/src/pm-plugins/commands/misc.ts +24 -3
- package/src/pm-plugins/commands/selection.ts +4 -0
- package/src/pm-plugins/commands/sort.ts +9 -1
- package/src/pm-plugins/commands/toggle.ts +2 -0
- package/src/pm-plugins/decorations/plugin.ts +5 -1
- package/src/pm-plugins/decorations/utils/column-resizing.ts +2 -0
- package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +8 -2
- package/src/pm-plugins/drag-and-drop/commands.ts +9 -1
- package/src/pm-plugins/drag-and-drop/plugin.ts +17 -2
- package/src/pm-plugins/handlers.ts +1 -1
- package/src/pm-plugins/keymap.ts +54 -0
- package/src/pm-plugins/main.ts +12 -5
- package/src/pm-plugins/table-resizing/commands.ts +4 -3
- package/src/pm-plugins/table-resizing/event-handlers.ts +24 -10
- package/src/pm-plugins/table-resizing/plugin.ts +3 -1
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +17 -1
- package/src/pm-plugins/table-resizing/utils/column-state.ts +4 -0
- package/src/pm-plugins/table-resizing/utils/content-width.ts +14 -0
- package/src/pm-plugins/table-resizing/utils/dom.ts +4 -0
- package/src/pm-plugins/table-resizing/utils/misc.ts +2 -0
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +9 -1
- package/src/pm-plugins/table-resizing/utils/resize-logic.ts +6 -0
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -1
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +10 -2
- package/src/pm-plugins/table-selection-keymap.ts +8 -0
- package/src/pm-plugins/table-width.ts +5 -1
- package/src/pm-plugins/transforms/column-width.ts +9 -7
- package/src/pm-plugins/transforms/delete-columns.ts +4 -0
- package/src/pm-plugins/transforms/fix-tables.ts +13 -6
- package/src/pm-plugins/transforms/merge.ts +6 -0
- package/src/pm-plugins/transforms/replace-table.ts +3 -1
- package/src/pm-plugins/transforms/split.ts +4 -0
- package/src/pm-plugins/utils/alignment.ts +2 -0
- package/src/pm-plugins/utils/analytics.ts +2 -2
- package/src/pm-plugins/utils/collapse.ts +3 -4
- package/src/pm-plugins/utils/column-controls.ts +4 -0
- package/src/pm-plugins/utils/create.ts +1 -1
- package/src/pm-plugins/utils/decoration.ts +12 -0
- package/src/pm-plugins/utils/dom.ts +4 -0
- package/src/pm-plugins/utils/drag-menu.ts +12 -1
- package/src/pm-plugins/utils/nodes.ts +2 -0
- package/src/pm-plugins/utils/paste.ts +4 -0
- package/src/pm-plugins/utils/row-controls.ts +2 -0
- package/src/pm-plugins/utils/snapping.ts +2 -0
- package/src/tablePlugin.tsx +13 -15
- package/src/tablePluginType.ts +10 -0
- package/src/ui/ColumnResizeWidget/index.tsx +2 -0
- package/src/ui/DragHandle/HandleIconComponent.tsx +3 -1
- package/src/ui/DragHandle/index.tsx +11 -2
- package/src/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.tsx +6 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +5 -1
- package/src/ui/FloatingContextualButton/index.tsx +8 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +17 -7
- package/src/ui/FloatingContextualMenu/index.tsx +11 -1
- package/src/ui/FloatingDeleteButton/index.tsx +23 -4
- package/src/ui/FloatingDragMenu/DragMenu.tsx +13 -6
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +10 -0
- package/src/ui/FloatingDragMenu/index.tsx +3 -1
- package/src/ui/FloatingInsertButton/InsertButton.tsx +4 -0
- package/src/ui/FloatingInsertButton/getPopupOptions.ts +4 -0
- package/src/ui/FloatingInsertButton/index.tsx +21 -1
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +19 -2
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/index.tsx +8 -4
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +2 -0
- package/src/ui/TableFloatingControls/FloatingControlsWithSelection.tsx +2 -2
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +7 -1
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +11 -3
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +20 -1
- package/src/ui/TableFloatingControls/index.tsx +13 -4
- package/src/ui/common-styles.ts +7 -0
- package/src/ui/event-handlers.ts +28 -3
- package/src/ui/icons/SortingIconWrapper.tsx +2 -0
- package/src/ui/toolbar.tsx +43 -11
- package/tsconfig.json +0 -1
|
@@ -32,7 +32,10 @@ var _layoutThreeEqual = _interopRequireDefault(require("@atlaskit/icon/glyph/edi
|
|
|
32
32
|
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
33
33
|
var _chevronDoubleDown = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-double-down"));
|
|
34
34
|
var _chevronDoubleUp = _interopRequireDefault(require("@atlaskit/icon/glyph/hipchat/chevron-double-up"));
|
|
35
|
-
var
|
|
35
|
+
var _AddColLeftIcon = require("../../ui/icons/AddColLeftIcon");
|
|
36
|
+
var _AddColRightIcon = require("../../ui/icons/AddColRightIcon");
|
|
37
|
+
var _AddRowAboveIcon = require("../../ui/icons/AddRowAboveIcon");
|
|
38
|
+
var _AddRowBelowIcon = require("../../ui/icons/AddRowBelowIcon");
|
|
36
39
|
var _toolbar = require("../../ui/toolbar");
|
|
37
40
|
var _commandsWithAnalytics = require("../commands/commands-with-analytics");
|
|
38
41
|
var _commandsWithAnalytics2 = require("../drag-and-drop/commands-with-analytics");
|
|
@@ -43,7 +46,10 @@ var _selection = require("./selection");
|
|
|
43
46
|
var getTargetIndex = exports.getTargetIndex = function getTargetIndex(selectedIndexes, direction) {
|
|
44
47
|
return Math[direction < 0 ? 'min' : 'max'].apply(Math, (0, _toConsumableArray2.default)(selectedIndexes)) + direction;
|
|
45
48
|
};
|
|
46
|
-
var canMove = exports.canMove = function canMove(sourceType, direction, totalItemsOfSourceTypeCount, selection, selectionRect
|
|
49
|
+
var canMove = exports.canMove = function canMove(sourceType, direction, totalItemsOfSourceTypeCount, selection, selectionRect
|
|
50
|
+
// Ignored via go/ees005
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
52
|
+
) {
|
|
47
53
|
if (!selectionRect) {
|
|
48
54
|
return false;
|
|
49
55
|
}
|
|
@@ -96,25 +102,25 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
96
102
|
label: 'above',
|
|
97
103
|
offset: 0,
|
|
98
104
|
icon: _tableRowAddAbove.default,
|
|
99
|
-
iconFallback:
|
|
105
|
+
iconFallback: _AddRowAboveIcon.AddRowAboveIcon,
|
|
100
106
|
keymap: _keymaps.addRowBefore
|
|
101
107
|
}, {
|
|
102
108
|
label: 'below',
|
|
103
109
|
offset: 1,
|
|
104
110
|
icon: _tableRowAddBelow.default,
|
|
105
|
-
iconFallback:
|
|
111
|
+
iconFallback: _AddRowBelowIcon.AddRowBelowIcon,
|
|
106
112
|
keymap: _keymaps.addRowAfter
|
|
107
113
|
}] : [{
|
|
108
114
|
label: 'left',
|
|
109
115
|
offset: 0,
|
|
110
116
|
icon: _tableColumnAddLeft.default,
|
|
111
|
-
iconFallback:
|
|
117
|
+
iconFallback: _AddColLeftIcon.AddColLeftIcon,
|
|
112
118
|
keymap: _keymaps.addColumnBefore
|
|
113
119
|
}, {
|
|
114
120
|
label: 'right',
|
|
115
121
|
offset: 1,
|
|
116
122
|
icon: _tableColumnAddRight.default,
|
|
117
|
-
iconFallback:
|
|
123
|
+
iconFallback: _AddColRightIcon.AddColRightIcon,
|
|
118
124
|
keymap: _keymaps.addColumnAfter
|
|
119
125
|
}];
|
|
120
126
|
var moveOptions = direction === 'row' ? [{
|
|
@@ -269,7 +275,13 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
269
275
|
onClick: function onClick(state, dispatch) {
|
|
270
276
|
if (canMove) {
|
|
271
277
|
requestAnimationFrame(function () {
|
|
272
|
-
(0, _commandsWithAnalytics2.moveSourceWithAnalytics)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(_analytics.INPUT_METHOD.TABLE_CONTEXT_MENU, "table-".concat(direction),
|
|
278
|
+
(0, _commandsWithAnalytics2.moveSourceWithAnalytics)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(_analytics.INPUT_METHOD.TABLE_CONTEXT_MENU, "table-".concat(direction),
|
|
279
|
+
// Ignored via go/ees005
|
|
280
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
281
|
+
getOriginIndexes(selectionRect),
|
|
282
|
+
// Ignored via go/ees005
|
|
283
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
284
|
+
getTargetIndex(selectionRect))(editorView.state, editorView.dispatch);
|
|
273
285
|
});
|
|
274
286
|
return true;
|
|
275
287
|
}
|
|
@@ -80,6 +80,9 @@ var tablesHaveDifferentNoOfRows = exports.tablesHaveDifferentNoOfRows = function
|
|
|
80
80
|
var currentMap = _tableMap.TableMap.get(currentTable);
|
|
81
81
|
return prevMap.height !== currentMap.height;
|
|
82
82
|
};
|
|
83
|
+
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
83
86
|
function filterNearSelection(selection, findNode, predicate, defaultValue) {
|
|
84
87
|
var found = findNode(selection);
|
|
85
88
|
if (!found) {
|
|
@@ -178,7 +178,10 @@ var transformSliceToRemoveOpenTable = exports.transformSliceToRemoveOpenTable =
|
|
|
178
178
|
// starts and ends inside of a cell
|
|
179
179
|
slice.openStart >= 4 && slice.openEnd >= 4 &&
|
|
180
180
|
// slice is a table node
|
|
181
|
-
slice.content.childCount === 1 &&
|
|
181
|
+
slice.content.childCount === 1 &&
|
|
182
|
+
// Ignored via go/ees005
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
184
|
+
slice.content.firstChild.type === schema.nodes.table) {
|
|
182
185
|
var _slice$content$firstC2;
|
|
183
186
|
// prosemirror-view has a bug that it duplicates table entry when selecting multiple paragraphs in a table cell.
|
|
184
187
|
// https://github.com/ProseMirror/prosemirror/issues/1270
|
|
@@ -88,7 +88,10 @@ var getRowsParams = exports.getRowsParams = function getRowsParams(rowsHeights)
|
|
|
88
88
|
var getRowClassNames = exports.getRowClassNames = function getRowClassNames(index, selection) {
|
|
89
89
|
var hoveredRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
90
90
|
var isInDanger = arguments.length > 3 ? arguments[3] : undefined;
|
|
91
|
-
var isResizing
|
|
91
|
+
var isResizing
|
|
92
|
+
// Ignored via go/ees005
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
94
|
+
= arguments.length > 4 ? arguments[4] : undefined;
|
|
92
95
|
var classNames = [];
|
|
93
96
|
if ((0, _utils3.isRowSelected)(index)(selection) || hoveredRows.indexOf(index) > -1 && !isResizing) {
|
|
94
97
|
classNames.push(_types.TableCssClassName.HOVERED_CELL_ACTIVE);
|
package/dist/cjs/tablePlugin.js
CHANGED
|
@@ -29,20 +29,25 @@ var _pluginKey = require("./pm-plugins/analytics/plugin-key");
|
|
|
29
29
|
var _insert = require("./pm-plugins/commands/insert");
|
|
30
30
|
var _createPluginConfig = require("./pm-plugins/create-plugin-config");
|
|
31
31
|
var _plugin2 = require("./pm-plugins/decorations/plugin");
|
|
32
|
-
var
|
|
32
|
+
var _plugin3 = require("./pm-plugins/drag-and-drop/plugin");
|
|
33
|
+
var _pluginKey2 = require("./pm-plugins/drag-and-drop/plugin-key");
|
|
33
34
|
var _keymap = require("./pm-plugins/keymap");
|
|
34
35
|
var _main = require("./pm-plugins/main");
|
|
35
36
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
36
|
-
var
|
|
37
|
+
var _pluginKey3 = require("./pm-plugins/plugin-key");
|
|
37
38
|
var _safariDeleteCompositionTextIssueWorkaround = require("./pm-plugins/safari-delete-composition-text-issue-workaround");
|
|
38
|
-
var
|
|
39
|
+
var _plugin4 = require("./pm-plugins/sticky-headers/plugin");
|
|
40
|
+
var _pluginKey4 = require("./pm-plugins/sticky-headers/plugin-key");
|
|
41
|
+
var _util = require("./pm-plugins/sticky-headers/util");
|
|
39
42
|
var _tableAnalytics = require("./pm-plugins/table-analytics");
|
|
40
43
|
var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
41
|
-
var
|
|
44
|
+
var _plugin5 = require("./pm-plugins/table-resizing/plugin");
|
|
45
|
+
var _pluginFactory2 = require("./pm-plugins/table-resizing/plugin-factory");
|
|
46
|
+
var _pluginKey5 = require("./pm-plugins/table-resizing/plugin-key");
|
|
42
47
|
var _tableSelectionKeymap = require("./pm-plugins/table-selection-keymap");
|
|
43
48
|
var _tableWidth = require("./pm-plugins/table-width");
|
|
44
49
|
var _tableWidthInCommentFix = require("./pm-plugins/table-width-in-comment-fix");
|
|
45
|
-
var
|
|
50
|
+
var _create = require("./pm-plugins/utils/create");
|
|
46
51
|
var _viewModeSort = require("./pm-plugins/view-mode-sort");
|
|
47
52
|
var _FloatingContextualButton = _interopRequireDefault(require("./ui/FloatingContextualButton"));
|
|
48
53
|
var _FloatingContextualMenu = _interopRequireDefault(require("./ui/FloatingContextualMenu"));
|
|
@@ -54,7 +59,8 @@ var _globalStyles = require("./ui/global-styles");
|
|
|
54
59
|
var _TableFullWidthLabel = require("./ui/TableFullWidthLabel");
|
|
55
60
|
var _toolbar = require("./ui/toolbar");
|
|
56
61
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
57
|
-
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) { (0, _defineProperty2.default)(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; }
|
|
62
|
+
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) { (0, _defineProperty2.default)(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; } // Ignored via go/ees005
|
|
63
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
58
64
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
59
65
|
return {};
|
|
60
66
|
};
|
|
@@ -90,7 +96,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
90
96
|
return undefined;
|
|
91
97
|
}
|
|
92
98
|
var tablePluginState = (0, _pluginFactory.getPluginState)(editorState);
|
|
93
|
-
var tableResizingPluginState = (0,
|
|
99
|
+
var tableResizingPluginState = (0, _pluginFactory2.getPluginState)(editorState);
|
|
94
100
|
var tableWidthResizingPluginState = _tableWidth.pluginKey.getState(editorState);
|
|
95
101
|
return {
|
|
96
102
|
isFullWidthModeEnabled: !!(options !== null && options !== void 0 && options.fullWidthEnabled),
|
|
@@ -125,7 +131,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
125
131
|
}, api, analyticsPayload))(state, dispatch);
|
|
126
132
|
} else {
|
|
127
133
|
var _api$contentInsertion, _api$contentInsertion2;
|
|
128
|
-
var node = (0,
|
|
134
|
+
var node = (0, _create.createTableWithWidth)({
|
|
129
135
|
isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
|
|
130
136
|
isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment,
|
|
131
137
|
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
|
|
@@ -252,7 +258,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
252
258
|
var _pluginConfig2 = (0, _createPluginConfig.pluginConfig)(tableOptions),
|
|
253
259
|
allowColumnResizing = _pluginConfig2.allowColumnResizing,
|
|
254
260
|
allowTableAlignment = _pluginConfig2.allowTableAlignment;
|
|
255
|
-
return allowColumnResizing ? (0,
|
|
261
|
+
return allowColumnResizing ? (0, _plugin5.createPlugin)(dispatch, {
|
|
256
262
|
lastColumnResizable: !fullWidthEnabled
|
|
257
263
|
}, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled, allowTableAlignment, !!(options !== null && options !== void 0 && options.isCommentEditor)) : undefined;
|
|
258
264
|
}
|
|
@@ -315,7 +321,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
315
321
|
plugin: function plugin(_ref11) {
|
|
316
322
|
var dispatch = _ref11.dispatch,
|
|
317
323
|
eventDispatcher = _ref11.eventDispatcher;
|
|
318
|
-
return options && options.tableOptions.stickyHeaders ? (0,
|
|
324
|
+
return options && options.tableOptions.stickyHeaders ? (0, _plugin4.createPlugin)(dispatch, function () {
|
|
319
325
|
return [];
|
|
320
326
|
}) : undefined;
|
|
321
327
|
}
|
|
@@ -323,7 +329,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
323
329
|
name: 'tableDragAndDrop',
|
|
324
330
|
plugin: function plugin(_ref12) {
|
|
325
331
|
var dispatch = _ref12.dispatch;
|
|
326
|
-
return options !== null && options !== void 0 && options.dragAndDropEnabled ? (0,
|
|
332
|
+
return options !== null && options !== void 0 && options.dragAndDropEnabled ? (0, _plugin3.createPlugin)(dispatch, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options.isCommentEditor) : undefined;
|
|
327
333
|
}
|
|
328
334
|
}, {
|
|
329
335
|
name: 'tableViewModeSort',
|
|
@@ -413,11 +419,11 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
413
419
|
}), /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
|
|
414
420
|
plugins: {
|
|
415
421
|
tableAnalyticsPluginState: _pluginKey.pluginKey,
|
|
416
|
-
tablePluginState:
|
|
422
|
+
tablePluginState: _pluginKey3.pluginKey,
|
|
417
423
|
tableWidthPluginState: _tableWidth.pluginKey,
|
|
418
|
-
tableResizingPluginState:
|
|
419
|
-
stickyHeadersState:
|
|
420
|
-
dragAndDropState:
|
|
424
|
+
tableResizingPluginState: _pluginKey5.pluginKey,
|
|
425
|
+
stickyHeadersState: _pluginKey4.pluginKey,
|
|
426
|
+
dragAndDropState: _pluginKey2.pluginKey
|
|
421
427
|
},
|
|
422
428
|
render: function render(_ref20) {
|
|
423
429
|
var resizingPluginState = _ref20.tableResizingPluginState,
|
|
@@ -446,7 +452,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
446
452
|
tableWrapperTarget = _ref21.tableWrapperTarget,
|
|
447
453
|
isCellMenuOpenByKeyboard = _ref21.isCellMenuOpenByKeyboard;
|
|
448
454
|
var allowControls = pluginConfig.allowControls;
|
|
449
|
-
var stickyHeader = stickyHeadersState ? (0,
|
|
455
|
+
var stickyHeader = stickyHeadersState ? (0, _util.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
450
456
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, targetCellPosition && (tableRef || isCellMenuOpenByKeyboard) && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/_react.default.createElement(_FloatingContextualButton.default, {
|
|
451
457
|
isNumberColumnEnabled: tableNode && tableNode.attrs.isNumberColumnEnabled,
|
|
452
458
|
editorView: editorView,
|
|
@@ -561,7 +567,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
561
567
|
isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
|
|
562
568
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing
|
|
563
569
|
};
|
|
564
|
-
var tableNode = (0,
|
|
570
|
+
var tableNode = (0, _create.createTableWithWidth)(tableNodeProps)(state.schema);
|
|
565
571
|
var tr = state.tr;
|
|
566
572
|
// If the cursor is inside a table
|
|
567
573
|
if ((0, _utils.hasParentNodeOfType)(state.schema.nodes.table)(state.selection) && (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes')) {
|
|
@@ -575,7 +581,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
575
581
|
tr.scrollIntoView();
|
|
576
582
|
} else {
|
|
577
583
|
// Table can be nested in parent table
|
|
578
|
-
tableNode = (0,
|
|
584
|
+
tableNode = (0, _create.createTableWithWidth)(_objectSpread(_objectSpread({}, tableNodeProps), {}, {
|
|
579
585
|
isNestedTable: true
|
|
580
586
|
}))(state.schema);
|
|
581
587
|
tr = insert(tableNode);
|
|
@@ -47,6 +47,8 @@ var ColumnResizeWidget = exports.ColumnResizeWidget = function ColumnResizeWidge
|
|
|
47
47
|
className: _types.TableCssClassName.RESIZE_HANDLE_DECORATION,
|
|
48
48
|
"data-start-index": startIndex,
|
|
49
49
|
"data-end-index": endIndex
|
|
50
|
+
// Ignored via go/ees005
|
|
51
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
50
52
|
}, tooltipProps));
|
|
51
53
|
});
|
|
52
54
|
};
|
|
@@ -6,13 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.HandleIconComponent = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _DragHandleDisabledIcon = require("../icons/DragHandleDisabledIcon");
|
|
10
|
+
var _DragHandleIcon = require("../icons/DragHandleIcon");
|
|
11
|
+
var _MinimisedHandle = require("../icons/MinimisedHandle");
|
|
10
12
|
var HandleIconComponent = exports.HandleIconComponent = function HandleIconComponent(props) {
|
|
11
13
|
var forceDefaultHandle = props.forceDefaultHandle,
|
|
12
14
|
isHandleHovered = props.isHandleHovered,
|
|
13
15
|
hasMergedCells = props.hasMergedCells;
|
|
14
16
|
if (isHandleHovered || forceDefaultHandle) {
|
|
15
|
-
return hasMergedCells ? /*#__PURE__*/_react.default.createElement(
|
|
17
|
+
return hasMergedCells ? /*#__PURE__*/_react.default.createElement(_DragHandleDisabledIcon.DragHandleDisabledIcon, null) : /*#__PURE__*/_react.default.createElement(_DragHandleIcon.DragHandleIcon, null);
|
|
16
18
|
}
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_MinimisedHandle.MinimisedHandleIcon, null);
|
|
18
20
|
};
|
|
@@ -20,7 +20,7 @@ var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
|
20
20
|
var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview");
|
|
21
21
|
var _pluginFactory = require("../../pm-plugins/drag-and-drop/plugin-factory");
|
|
22
22
|
var _pluginFactory2 = require("../../pm-plugins/plugin-factory");
|
|
23
|
-
var
|
|
23
|
+
var _mergedCells = require("../../pm-plugins/utils/merged-cells");
|
|
24
24
|
var _types = require("../../types");
|
|
25
25
|
var _consts = require("../consts");
|
|
26
26
|
var _DragPreview = require("../DragPreview");
|
|
@@ -82,8 +82,8 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
82
82
|
if (hoveredCell && hoveredCell.rowIndex !== undefined && hoveredCell.colIndex !== undefined && selection instanceof _state.TextSelection) {
|
|
83
83
|
var rowIndex = hoveredCell.rowIndex,
|
|
84
84
|
colIndex = hoveredCell.colIndex;
|
|
85
|
-
var mergedPositionInRow = (0,
|
|
86
|
-
var mergedPositionInCol = (0,
|
|
85
|
+
var mergedPositionInRow = (0, _mergedCells.findDuplicatePosition)(mapByRow[rowIndex]);
|
|
86
|
+
var mergedPositionInCol = (0, _mergedCells.findDuplicatePosition)(mapByColumn[colIndex]);
|
|
87
87
|
var hasMergedCellsInFirstRowOrColumn = direction === 'column' ? mergedPositionInRow.includes(mapByRow[0][colIndex]) : mergedPositionInCol.includes(mapByColumn[0][rowIndex]);
|
|
88
88
|
var isHoveredOnFirstRowOrColumn = direction === 'column' ? hoveredCell.rowIndex === 0 && hasMergedCellsInFirstRowOrColumn : hoveredCell.colIndex === 0 && hasMergedCellsInFirstRowOrColumn;
|
|
89
89
|
if (isHoveredOnFirstRowOrColumn) {
|
|
@@ -92,11 +92,11 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
92
92
|
}).length : mapByColumn[0].filter(function (el) {
|
|
93
93
|
return el === mapByColumn[0][rowIndex];
|
|
94
94
|
}).length;
|
|
95
|
-
var mergedSelection = (0,
|
|
95
|
+
var mergedSelection = (0, _mergedCells.hasMergedCellsInSelection)(direction === 'column' ? [colIndex, colIndex + mergedSizes - 1] : [rowIndex, rowIndex + mergedSizes - 1], direction)(selection);
|
|
96
96
|
return mergedSelection;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
return (0,
|
|
99
|
+
return (0, _mergedCells.hasMergedCellsInSelection)(indexes, direction)(selection);
|
|
100
100
|
}, [indexes, selection, direction, hoveredCell]);
|
|
101
101
|
var handleIconProps = {
|
|
102
102
|
forceDefaultHandle: forceDefaultHandle,
|
|
@@ -224,14 +224,21 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
224
224
|
}
|
|
225
225
|
}, appearance !== 'placeholder' ?
|
|
226
226
|
// cannot block pointer events in Firefox as it breaks Dragging functionality
|
|
227
|
-
_browser.browser.gecko ?
|
|
227
|
+
_browser.browser.gecko ?
|
|
228
|
+
/*#__PURE__*/
|
|
229
|
+
// Ignored via go/ees005
|
|
230
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
231
|
+
_react.default.createElement(_HandleIconComponent.HandleIconComponent, handleIconProps) :
|
|
228
232
|
/*#__PURE__*/
|
|
229
233
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
230
234
|
_react.default.createElement("span", {
|
|
231
235
|
style: {
|
|
232
236
|
pointerEvents: 'none'
|
|
233
237
|
}
|
|
234
|
-
}, /*#__PURE__*/_react.default.createElement(_HandleIconComponent.HandleIconComponent
|
|
238
|
+
}, /*#__PURE__*/_react.default.createElement(_HandleIconComponent.HandleIconComponent
|
|
239
|
+
// Ignored via go/ees005
|
|
240
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
241
|
+
, handleIconProps)) : null), previewContainer && previewWidth !== undefined && previewHeight !== undefined && /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_DragPreview.DragPreview, {
|
|
235
242
|
direction: direction,
|
|
236
243
|
width: previewWidth,
|
|
237
244
|
height: previewHeight
|
|
@@ -25,12 +25,19 @@ var FloatingAlignmentButtons = exports.FloatingAlignmentButtons = function Float
|
|
|
25
25
|
}, (0, _react.jsx)(_button.ButtonGroup, null, alignmentButtons.map(function (item, idx) {
|
|
26
26
|
switch (item.type) {
|
|
27
27
|
case 'separator':
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
28
30
|
return (0, _react.jsx)(_ui.FloatingToolbarSeparator, {
|
|
29
31
|
key: idx
|
|
30
32
|
});
|
|
31
33
|
case 'button':
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
36
|
var ButtonIcon = item.icon;
|
|
33
|
-
return (0, _react.jsx)(_ui.FloatingToolbarButton
|
|
37
|
+
return (0, _react.jsx)(_ui.FloatingToolbarButton
|
|
38
|
+
// Ignored via go/ees005
|
|
39
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
40
|
+
, {
|
|
34
41
|
key: idx,
|
|
35
42
|
icon: item.icon ? (0, _react.jsx)(ButtonIcon, {
|
|
36
43
|
label: item.title
|
|
@@ -81,8 +81,12 @@ var FixedButton = exports.FixedButton = function FixedButton(_ref2) {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
observer.observe(observerTargetRefCurrent);
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
84
86
|
tableWrapper.addEventListener('scroll', handleScroll);
|
|
85
87
|
return function () {
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
86
90
|
tableWrapper.removeEventListener('scroll', handleScroll);
|
|
87
91
|
fixedButtonRefCurrent.style.transform = '';
|
|
88
92
|
observer.unobserve(observerTargetRefCurrent);
|
|
@@ -31,6 +31,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
31
31
|
|
|
32
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
33
33
|
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
36
|
+
|
|
34
37
|
var BUTTON_OFFSET = 3;
|
|
35
38
|
var FloatingContextualButtonInner = /*#__PURE__*/_react.default.memo(function (props) {
|
|
36
39
|
var editorView = props.editorView,
|
|
@@ -122,5 +125,8 @@ function _default(props) {
|
|
|
122
125
|
component: _analytics.ACTION_SUBJECT.FLOATING_CONTEXTUAL_BUTTON,
|
|
123
126
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
124
127
|
fallbackComponent: null
|
|
125
|
-
}, (0, _react2.jsx)(FloatingContextualButton
|
|
128
|
+
}, (0, _react2.jsx)(FloatingContextualButton
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
131
|
+
, props));
|
|
126
132
|
}
|
|
@@ -44,11 +44,15 @@ var _commandsWithAnalytics = require("../../pm-plugins/commands/commands-with-an
|
|
|
44
44
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
45
45
|
var _pluginKey = require("../../pm-plugins/plugin-key");
|
|
46
46
|
var _resizeState = require("../../pm-plugins/table-resizing/utils/resize-state");
|
|
47
|
-
var
|
|
48
|
-
var
|
|
47
|
+
var _merge = require("../../pm-plugins/transforms/merge");
|
|
48
|
+
var _selection = require("../../pm-plugins/utils/selection");
|
|
49
|
+
var _table = require("../../pm-plugins/utils/table");
|
|
49
50
|
var _types = require("../../types");
|
|
50
51
|
var _consts = require("../consts");
|
|
51
|
-
var
|
|
52
|
+
var _AddColRightIcon = require("../icons/AddColRightIcon");
|
|
53
|
+
var _AddRowBelowIcon = require("../icons/AddRowBelowIcon");
|
|
54
|
+
var _MergeCellsIcon = require("../icons/MergeCellsIcon");
|
|
55
|
+
var _SplitCellIcon = require("../icons/SplitCellIcon");
|
|
52
56
|
var _styles2 = require("./styles");
|
|
53
57
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
54
58
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -79,7 +83,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
79
83
|
});
|
|
80
84
|
(0, _defineProperty2.default)(_this, "dropdownMenuRef", /*#__PURE__*/_react.default.createRef());
|
|
81
85
|
(0, _defineProperty2.default)(_this, "handleSubMenuRef", function (ref) {
|
|
82
|
-
var parent = (0, _utils.closestElement)(
|
|
86
|
+
var parent = (0, _utils.closestElement)(
|
|
87
|
+
// Ignored via go/ees005
|
|
88
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
89
|
+
_this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
|
|
83
90
|
if (!(parent && ref)) {
|
|
84
91
|
return;
|
|
85
92
|
}
|
|
@@ -107,7 +114,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
107
114
|
var background = (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
|
|
108
115
|
var selectedRowIndex;
|
|
109
116
|
var selectedColumnIndex;
|
|
110
|
-
var selectedRowAndColumnFromPalette = (0, _uiColor.getSelectedRowAndColumnFromPalette)(_uiColor.cellBackgroundColorPalette,
|
|
117
|
+
var selectedRowAndColumnFromPalette = (0, _uiColor.getSelectedRowAndColumnFromPalette)(_uiColor.cellBackgroundColorPalette,
|
|
118
|
+
// Ignored via go/ees005
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
120
|
+
background, _consts.colorPalletteColumns);
|
|
111
121
|
selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
112
122
|
selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
113
123
|
return {
|
|
@@ -152,7 +162,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
152
162
|
}
|
|
153
163
|
}
|
|
154
164
|
},
|
|
155
|
-
isPopupPositioned: true
|
|
165
|
+
isPopupPositioned: true
|
|
166
|
+
// Ignored via go/ees005
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
168
|
+
,
|
|
156
169
|
isOpenedByKeyboard: isCellMenuOpenByKeyboard
|
|
157
170
|
}, (0, _react2.jsx)(_uiColor.ColorPalette, {
|
|
158
171
|
cols: 7,
|
|
@@ -182,14 +195,14 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
182
195
|
value: {
|
|
183
196
|
name: 'merge'
|
|
184
197
|
},
|
|
185
|
-
isDisabled: !(0,
|
|
198
|
+
isDisabled: !(0, _merge.canMergeCells)(state.tr),
|
|
186
199
|
elemBefore: isDragAndDropEnabled ? (0, _react2.jsx)(_primitives.Box, {
|
|
187
200
|
xcss: elementBeforeIconStyles
|
|
188
201
|
}, (0, _react2.jsx)(_tableCellMerge.default, {
|
|
189
202
|
color: "currentColor",
|
|
190
203
|
spacing: "spacious",
|
|
191
204
|
label: formatMessage(_messages.tableMessages.mergeCells),
|
|
192
|
-
LEGACY_fallbackIcon:
|
|
205
|
+
LEGACY_fallbackIcon: _MergeCellsIcon.MergeCellsIcon
|
|
193
206
|
})) : undefined
|
|
194
207
|
}, {
|
|
195
208
|
content: formatMessage(_messages.tableMessages.splitCell),
|
|
@@ -203,7 +216,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
203
216
|
color: "currentColor",
|
|
204
217
|
spacing: "spacious",
|
|
205
218
|
label: formatMessage(_messages.tableMessages.splitCell),
|
|
206
|
-
LEGACY_fallbackIcon:
|
|
219
|
+
LEGACY_fallbackIcon: _SplitCellIcon.SplitCellIcon
|
|
207
220
|
})) : undefined
|
|
208
221
|
}];
|
|
209
222
|
}
|
|
@@ -233,7 +246,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
233
246
|
color: "currentColor",
|
|
234
247
|
spacing: "spacious",
|
|
235
248
|
label: formatMessage(_messages.tableMessages.addColumnRight),
|
|
236
|
-
LEGACY_fallbackIcon:
|
|
249
|
+
LEGACY_fallbackIcon: _AddColRightIcon.AddColRightIcon
|
|
237
250
|
})) : undefined,
|
|
238
251
|
'aria-label': (0, _keymaps.tooltip)(_keymaps.addColumnAfter, String(content))
|
|
239
252
|
};
|
|
@@ -260,7 +273,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
260
273
|
color: "currentColor",
|
|
261
274
|
spacing: "spacious",
|
|
262
275
|
label: formatMessage(_messages.tableMessages.addRowBelow),
|
|
263
|
-
LEGACY_fallbackIcon:
|
|
276
|
+
LEGACY_fallbackIcon: _AddRowBelowIcon.AddRowBelowIcon
|
|
264
277
|
})) : undefined,
|
|
265
278
|
'aria-label': (0, _keymaps.tooltip)(_keymaps.addRowAfter, String(content))
|
|
266
279
|
};
|
|
@@ -399,7 +412,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
399
412
|
var _getPluginState10 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
400
413
|
isDragAndDropEnabled = _getPluginState10.isDragAndDropEnabled;
|
|
401
414
|
if (allowColumnSorting && !isDragAndDropEnabled) {
|
|
402
|
-
var hasMergedCellsInTable = (0,
|
|
415
|
+
var hasMergedCellsInTable = (0, _table.getMergedCellsPositions)(editorView.state.tr).length > 0;
|
|
403
416
|
var warning = hasMergedCellsInTable ? {
|
|
404
417
|
tooltipDescription: formatMessage(_messages.tableMessages.canNotSortTable),
|
|
405
418
|
isDisabled: true
|
|
@@ -609,6 +622,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
609
622
|
}
|
|
610
623
|
}
|
|
611
624
|
});
|
|
625
|
+
// Ignored via go/ees005
|
|
626
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
612
627
|
(0, _defineProperty2.default)(_this, "handleItemMouseEnter", function (_ref4) {
|
|
613
628
|
var item = _ref4.item;
|
|
614
629
|
var _this$props13 = _this.props,
|
|
@@ -624,15 +639,17 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
624
639
|
}
|
|
625
640
|
}
|
|
626
641
|
if (item.value.name === 'delete_column') {
|
|
627
|
-
(0, _commands.hoverColumns)((0,
|
|
642
|
+
(0, _commands.hoverColumns)((0, _selection.getSelectedColumnIndexes)(selectionRect), true)(state, dispatch);
|
|
628
643
|
}
|
|
629
644
|
if (item.value.name === 'delete_row') {
|
|
630
|
-
(0, _commands.hoverRows)((0,
|
|
645
|
+
(0, _commands.hoverRows)((0, _selection.getSelectedRowIndexes)(selectionRect), true)(state, dispatch);
|
|
631
646
|
}
|
|
632
|
-
if (['sort_column_asc', 'sort_column_desc'].indexOf(item.value.name) > -1 && (0,
|
|
647
|
+
if (['sort_column_asc', 'sort_column_desc'].indexOf(item.value.name) > -1 && (0, _table.getMergedCellsPositions)(state.tr).length !== 0) {
|
|
633
648
|
(0, _commands.hoverMergedCells)()(state, dispatch);
|
|
634
649
|
}
|
|
635
650
|
});
|
|
651
|
+
// Ignored via go/ees005
|
|
652
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
636
653
|
(0, _defineProperty2.default)(_this, "handleItemMouseLeave", function (_ref5) {
|
|
637
654
|
var item = _ref5.item;
|
|
638
655
|
var _this$props$editorVie = _this.props.editorView,
|
|
@@ -20,6 +20,9 @@ var _styles = require("./styles");
|
|
|
20
20
|
*/
|
|
21
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
22
|
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
25
|
+
|
|
23
26
|
var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
24
27
|
var mountPoint = _ref.mountPoint,
|
|
25
28
|
boundariesElement = _ref.boundariesElement,
|
|
@@ -41,7 +44,10 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
41
44
|
return null;
|
|
42
45
|
}
|
|
43
46
|
var selection = editorView.state.selection;
|
|
44
|
-
var selectionRect = (0, _utils2.isSelectionType)(selection, 'cell') ?
|
|
47
|
+
var selectionRect = (0, _utils2.isSelectionType)(selection, 'cell') ?
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
50
|
+
(0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
|
|
45
51
|
if (!selectionRect) {
|
|
46
52
|
return null;
|
|
47
53
|
}
|
|
@@ -53,7 +59,10 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
53
59
|
var parentSticky = targetCellRef.parentElement && targetCellRef.parentElement.className.indexOf('sticky') > -1;
|
|
54
60
|
return (0, _react.jsx)(_ui.Popup, {
|
|
55
61
|
alignX: "right",
|
|
56
|
-
alignY: "top"
|
|
62
|
+
alignY: "top"
|
|
63
|
+
// Ignored via go/ees005
|
|
64
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
65
|
+
,
|
|
57
66
|
target: targetCellRef,
|
|
58
67
|
mountTo: mountPoint,
|
|
59
68
|
boundariesElement: boundariesElement,
|
|
@@ -74,8 +83,14 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
74
83
|
offset: [_consts.contextualMenuTriggerSize / 2, -_consts.contextualMenuTriggerSize],
|
|
75
84
|
isOpen: isOpen,
|
|
76
85
|
targetCellPosition: targetCellPosition,
|
|
77
|
-
allowColumnSorting: pluginConfig && pluginConfig.allowColumnSorting
|
|
78
|
-
|
|
86
|
+
allowColumnSorting: pluginConfig && pluginConfig.allowColumnSorting
|
|
87
|
+
// Ignored via go/ees005
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
89
|
+
,
|
|
90
|
+
allowMergeCells: pluginConfig.allowMergeCells
|
|
91
|
+
// Ignored via go/ees005
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
93
|
+
,
|
|
79
94
|
allowBackgroundColor: pluginConfig.allowBackgroundColor,
|
|
80
95
|
selectionRect: selectionRect,
|
|
81
96
|
boundariesElement: boundariesElement,
|