@atlaskit/editor-plugin-table 8.4.12 → 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 +11 -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 +3 -3
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import { cloneColumn, cloneRow, moveColumn, moveRow } from '@atlaskit/editor-tables/utils';
|
|
3
3
|
import { TableDecorations } from '../../types';
|
|
4
|
-
import { createColumnInsertLine, createRowInsertLine, updateDecorations } from '../utils';
|
|
4
|
+
import { createColumnInsertLine, createRowInsertLine, updateDecorations } from '../utils/decoration';
|
|
5
5
|
import { DragAndDropActionType } from './actions';
|
|
6
6
|
import { DropTargetType } from './consts';
|
|
7
7
|
import { createCommand, getPluginState } from './plugin-factory';
|
|
@@ -14,7 +14,10 @@ var getDecorations = function getDecorations(state) {
|
|
|
14
14
|
var updatePluginStateDecorations = function updatePluginStateDecorations(state, decorations, key) {
|
|
15
15
|
return updateDecorations(state.doc, getDecorations(state), decorations, key);
|
|
16
16
|
};
|
|
17
|
-
export var setDropTarget = function setDropTarget(type, index, hasMergedCells, tr
|
|
17
|
+
export var setDropTarget = function setDropTarget(type, index, hasMergedCells, tr
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
|
+
) {
|
|
18
21
|
return createCommand(function (state) {
|
|
19
22
|
var _getPluginState = getPluginState(state),
|
|
20
23
|
dropTargetType = _getPluginState.dropTargetType,
|
|
@@ -58,7 +61,10 @@ export var clearDropTarget = function clearDropTarget(tr) {
|
|
|
58
61
|
return (tr || originalTr).setMeta('addToHistory', false);
|
|
59
62
|
});
|
|
60
63
|
};
|
|
61
|
-
export var moveSource = function moveSource(sourceType, sourceIndexes, targetIndex, tr
|
|
64
|
+
export var moveSource = function moveSource(sourceType, sourceIndexes, targetIndex, tr
|
|
65
|
+
// Ignored via go/ees005
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
67
|
+
) {
|
|
62
68
|
return createCommand(function (state) {
|
|
63
69
|
return {
|
|
64
70
|
type: DragAndDropActionType.CLEAR_DROP_TARGET,
|
|
@@ -113,7 +119,10 @@ export var toggleDragMenu = function toggleDragMenu(isDragMenuOpen, direction, i
|
|
|
113
119
|
return tr.setMeta('addToHistory', false);
|
|
114
120
|
});
|
|
115
121
|
};
|
|
116
|
-
export var cloneSource = function cloneSource(sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
122
|
+
export var cloneSource = function cloneSource(sourceType, sourceIndexes, targetIndex, targetDirection, tr
|
|
123
|
+
// Ignored via go/ees005
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
125
|
+
) {
|
|
117
126
|
return createCommand(function (state) {
|
|
118
127
|
return {
|
|
119
128
|
type: DragAndDropActionType.CLEAR_DROP_TARGET,
|
|
@@ -8,8 +8,9 @@ import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
|
8
8
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
9
9
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
10
10
|
import { pluginKey as tablePluginKey } from '../plugin-key';
|
|
11
|
-
import { insertColgroupFromNode } from '../table-resizing/utils';
|
|
12
|
-
import { findNearestCellIndexToPoint
|
|
11
|
+
import { insertColgroupFromNode } from '../table-resizing/utils/colgroup';
|
|
12
|
+
import { findNearestCellIndexToPoint } from '../utils/dom';
|
|
13
|
+
import { hasMergedCellsInBetween } from '../utils/merged-cells';
|
|
13
14
|
import { DragAndDropActionType } from './actions';
|
|
14
15
|
import { clearDropTarget, setDropTarget, toggleDragMenu } from './commands';
|
|
15
16
|
import { clearDropTargetWithAnalytics, cloneSourceWithAnalytics, moveSourceWithAnalytics } from './commands-with-analytics';
|
|
@@ -17,7 +18,10 @@ import { DropTargetType } from './consts';
|
|
|
17
18
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
18
19
|
import { pluginKey } from './plugin-key';
|
|
19
20
|
import { getDraggableDataFromEvent } from './utils/monitor';
|
|
20
|
-
var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor
|
|
21
|
+
var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
24
|
+
) {
|
|
21
25
|
var editorPageScrollContainer = document.querySelector('.fabric-editor-popup-scroll-parent');
|
|
22
26
|
var rowAutoScrollers = editorPageScrollContainer ? [monitorForElements({
|
|
23
27
|
canMonitor: function canMonitor(_ref) {
|
|
@@ -28,13 +32,19 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
28
32
|
},
|
|
29
33
|
onDragStart: function onDragStart() {
|
|
30
34
|
// auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
31
37
|
editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
|
|
32
38
|
},
|
|
33
39
|
onDrop: function onDrop() {
|
|
34
40
|
// 'null' will remove the inline style
|
|
41
|
+
// Ignored via go/ees005
|
|
42
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
35
43
|
editorPageScrollContainer.style.setProperty('scroll-behavior', null);
|
|
36
44
|
}
|
|
37
45
|
}), autoScrollForElements({
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
38
48
|
element: editorPageScrollContainer,
|
|
39
49
|
canScroll: function canScroll(_ref3) {
|
|
40
50
|
var source = _ref3.source;
|
|
@@ -273,7 +283,10 @@ export var createPlugin = function createPlugin(dispatch, editorAnalyticsAPI) {
|
|
|
273
283
|
return true;
|
|
274
284
|
}
|
|
275
285
|
}
|
|
276
|
-
var isDragHandleFocused = ['drag-handle-button-row', 'drag-handle-button-column'
|
|
286
|
+
var isDragHandleFocused = ['drag-handle-button-row', 'drag-handle-button-column'
|
|
287
|
+
// Ignored via go/ees005
|
|
288
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
289
|
+
].includes((_ref8 = event.target || null) === null || _ref8 === void 0 ? void 0 : _ref8.id);
|
|
277
290
|
var keysToTrap = ['Enter', ' '];
|
|
278
291
|
var _getPluginState3 = getPluginState(view.state),
|
|
279
292
|
_getPluginState3$isDr = _getPluginState3.isDragMenuOpen,
|
|
@@ -10,7 +10,7 @@ import { isTextInput } from '@atlaskit/editor-common/utils';
|
|
|
10
10
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
11
11
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
12
12
|
import { defaultTableSelection } from './default-table-selection';
|
|
13
|
-
import { pluginKey as tableResizingPluginKey } from './table-resizing';
|
|
13
|
+
import { pluginKey as tableResizingPluginKey } from './table-resizing/plugin-key';
|
|
14
14
|
import { isTableCollapsible } from './utils/collapse';
|
|
15
15
|
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled } from './utils/nodes';
|
|
16
16
|
var nextTableSorting = function nextTableSorting(tr, table) {
|
|
@@ -9,6 +9,9 @@ import { goToNextCell, moveCursorBackward, setFocusToCellMenu } from './commands
|
|
|
9
9
|
import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from './commands/column-resize';
|
|
10
10
|
import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from './commands/commands-with-analytics';
|
|
11
11
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable, insertTableWithNestingSupport } from './commands/insert';
|
|
12
|
+
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
12
15
|
export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
13
16
|
var _pluginInjectionApi$a;
|
|
14
17
|
var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
@@ -23,9 +26,18 @@ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProvide
|
|
|
23
26
|
var isTableResizingEnabled = arguments.length > 14 ? arguments[14] : undefined;
|
|
24
27
|
var list = {};
|
|
25
28
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
26
|
-
bindKeymapWithCommand(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
bindKeymapWithCommand(
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
32
|
+
nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
33
|
+
bindKeymapWithCommand(
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
36
|
+
previousCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
37
|
+
bindKeymapWithCommand(
|
|
38
|
+
// Ignored via go/ees005
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
40
|
+
toggleTable.common, fg('platform_editor_use_nested_table_pm_nodes') ? editorCommandToPMCommand(insertTableWithNestingSupport({
|
|
29
41
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
30
42
|
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
31
43
|
isFullWidthModeEnabled: !!isFullWidthEnabled,
|
|
@@ -41,18 +53,47 @@ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProvide
|
|
|
41
53
|
},
|
|
42
54
|
eventType: EVENT_TYPE.TRACK
|
|
43
55
|
})) : createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
|
|
44
|
-
bindKeymapWithCommand(
|
|
56
|
+
bindKeymapWithCommand(
|
|
57
|
+
// Ignored via go/ees005
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
59
|
+
backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
|
|
60
|
+
// Ignored via go/ees005
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
45
62
|
bindKeymapWithCommand(backspace.common, moveCursorBackward, list);
|
|
46
63
|
|
|
47
64
|
// Add row/column shortcuts
|
|
48
|
-
bindKeymapWithCommand(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
bindKeymapWithCommand(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
bindKeymapWithCommand(
|
|
66
|
+
// Ignored via go/ees005
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
68
|
+
addRowBefore.common, addRowAroundSelection(editorAnalyticsAPI)('TOP'), list);
|
|
69
|
+
bindKeymapWithCommand(
|
|
70
|
+
// Ignored via go/ees005
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
72
|
+
addRowAfter.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
|
|
73
|
+
bindKeymapWithCommand(
|
|
74
|
+
// Ignored via go/ees005
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
76
|
+
addColumnBefore.common, addColumnBeforeCommand(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
77
|
+
bindKeymapWithCommand(
|
|
78
|
+
// Ignored via go/ees005
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
80
|
+
addColumnAfter.common, addColumnAfterCommand(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
81
|
+
bindKeymapWithCommand(
|
|
82
|
+
// Ignored via go/ees005
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
84
|
+
addRowBeforeVO.common, addRowAroundSelection(editorAnalyticsAPI)('TOP'), list);
|
|
85
|
+
bindKeymapWithCommand(
|
|
86
|
+
// Ignored via go/ees005
|
|
87
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
88
|
+
addRowAfterVO.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
|
|
89
|
+
bindKeymapWithCommand(
|
|
90
|
+
// Ignored via go/ees005
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
92
|
+
addColumnBeforeVO.common, addColumnBeforeCommand(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
93
|
+
bindKeymapWithCommand(
|
|
94
|
+
// Ignored via go/ees005
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
96
|
+
addColumnAfterVO.common, addColumnAfterCommand(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
56
97
|
if (dragAndDropEnabled) {
|
|
57
98
|
// Move row/column shortcuts
|
|
58
99
|
/**
|
|
@@ -62,38 +103,77 @@ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProvide
|
|
|
62
103
|
* See ticket ED-22154 https://product-fabric.atlassian.net/browse/ED-22154
|
|
63
104
|
*/
|
|
64
105
|
|
|
65
|
-
bindKeymapWithCommand(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
106
|
+
bindKeymapWithCommand(
|
|
107
|
+
// Ignored via go/ees005
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
109
|
+
moveRowDown.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-row', 1), list);
|
|
110
|
+
bindKeymapWithCommand(
|
|
111
|
+
// Ignored via go/ees005
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
113
|
+
moveRowUp.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-row', -1), list);
|
|
114
|
+
bindKeymapWithCommand(
|
|
115
|
+
// Ignored via go/ees005
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
117
|
+
moveColumnLeft.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-column', -1), list);
|
|
118
|
+
bindKeymapWithCommand(
|
|
119
|
+
// Ignored via go/ees005
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
121
|
+
moveColumnRight.common, moveSourceWithAnalyticsViaShortcut(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)('table-column', 1), list);
|
|
69
122
|
|
|
70
123
|
// Delete row/column shortcuts
|
|
71
|
-
bindKeymapWithCommand(
|
|
72
|
-
|
|
124
|
+
bindKeymapWithCommand(
|
|
125
|
+
// Ignored via go/ees005
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
127
|
+
deleteColumn.common, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
128
|
+
bindKeymapWithCommand(
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
131
|
+
deleteRow.common, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
73
132
|
}
|
|
74
|
-
bindKeymapWithCommand(
|
|
133
|
+
bindKeymapWithCommand(
|
|
134
|
+
// Ignored via go/ees005
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
136
|
+
startColumnResizing.common, initiateKeyboardColumnResizing({
|
|
75
137
|
ariaNotify: ariaNotifyPlugin,
|
|
76
138
|
getIntl: getIntl,
|
|
77
139
|
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
78
140
|
}), list);
|
|
79
|
-
bindKeymapWithCommand(
|
|
141
|
+
bindKeymapWithCommand(
|
|
142
|
+
// Ignored via go/ees005
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
144
|
+
moveRight.common, activateNextResizeArea({
|
|
80
145
|
direction: 1,
|
|
81
146
|
ariaNotify: ariaNotifyPlugin,
|
|
82
147
|
getIntl: getIntl,
|
|
83
148
|
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
84
149
|
}), list);
|
|
85
|
-
bindKeymapWithCommand(
|
|
150
|
+
bindKeymapWithCommand(
|
|
151
|
+
// Ignored via go/ees005
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
153
|
+
moveLeft.common, activateNextResizeArea({
|
|
86
154
|
direction: -1,
|
|
87
155
|
ariaNotify: ariaNotifyPlugin,
|
|
88
156
|
getIntl: getIntl,
|
|
89
157
|
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
90
158
|
}), list);
|
|
91
|
-
bindKeymapWithCommand(
|
|
92
|
-
|
|
93
|
-
|
|
159
|
+
bindKeymapWithCommand(
|
|
160
|
+
// Ignored via go/ees005
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
162
|
+
decreaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api)(-10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
163
|
+
bindKeymapWithCommand(
|
|
164
|
+
// Ignored via go/ees005
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
166
|
+
increaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api)(10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
167
|
+
bindKeymapWithCommand(
|
|
168
|
+
// Ignored via go/ees005
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
170
|
+
escape.common, stopKeyboardColumnResizing({
|
|
94
171
|
ariaNotify: ariaNotifyPlugin,
|
|
95
172
|
getIntl: getIntl
|
|
96
173
|
}), list);
|
|
174
|
+
|
|
175
|
+
// Ignored via go/ees005
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
97
177
|
bindKeymapWithCommand(focusToContextMenuTrigger.common, setFocusToCellMenu(), list);
|
|
98
178
|
return keymap(list);
|
|
99
179
|
}
|
|
@@ -20,10 +20,14 @@ import { removeResizeHandleDecorations, transformSliceRemoveCellBackgroundColor,
|
|
|
20
20
|
import { defaultHoveredCell, defaultTableSelection } from './default-table-selection';
|
|
21
21
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
22
22
|
import { pluginKey } from './plugin-key';
|
|
23
|
-
import { fixTables
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
23
|
+
import { fixTables } from './transforms/fix-tables';
|
|
24
|
+
import { replaceSelectedTable } from './transforms/replace-table';
|
|
25
|
+
import { findControlsHoverDecoration } from './utils/decoration';
|
|
26
|
+
import { transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, transformSliceToRemoveOpenTable, transformSliceToRemoveNestedTables, isHeaderRowRequired, transformSliceTableLayoutDefaultToCenter } from './utils/paste';
|
|
27
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
30
|
+
) {
|
|
27
31
|
var _accessibilityUtils;
|
|
28
32
|
var state = createPluginState(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
29
33
|
pluginConfig: pluginConfig,
|
|
@@ -104,7 +108,10 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
104
108
|
if (pluginState.editorHasFocus) {
|
|
105
109
|
var parent = findParentDomRefOfType(state.schema.nodes.table, domAtPos)(selection);
|
|
106
110
|
if (parent) {
|
|
107
|
-
tableRef =
|
|
111
|
+
tableRef =
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
114
|
+
parent.querySelector('table') || undefined;
|
|
108
115
|
}
|
|
109
116
|
var tableNode = findTable(state.selection);
|
|
110
117
|
// when keyboard cursor leaves the table we need to stop column resizing
|
|
@@ -218,6 +225,8 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
218
225
|
// Returning true prevents that updateSelection() is getting called in the commit below:
|
|
219
226
|
// @see https://github.com/ProseMirror/prosemirror-view/commit/33fe4a8b01584f6b4103c279033dcd33e8047b95
|
|
220
227
|
if (browser.chrome && event.target) {
|
|
228
|
+
// Ignored via go/ees005
|
|
229
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
221
230
|
var targetClassList = event.target.classList;
|
|
222
231
|
if (targetClassList.contains(ClassName.CONTROLS_BUTTON) || targetClassList.contains(ClassName.CONTEXTUAL_MENU_BUTTON) || targetClassList.contains(ClassName.DRAG_HANDLE_BUTTON_CLICKABLE_ZONE)) {
|
|
223
232
|
return true;
|
|
@@ -233,6 +242,8 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
233
242
|
var maybeTr = closestElement(domRef, 'tr');
|
|
234
243
|
return maybeTr ? maybeTr.classList.contains('sticky') : false;
|
|
235
244
|
},
|
|
245
|
+
// Ignored via go/ees005
|
|
246
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
236
247
|
handleTextInput: function handleTextInput(view, _from, _to, text) {
|
|
237
248
|
var state = view.state,
|
|
238
249
|
dispatch = view.dispatch;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
3
3
|
import { META_KEYS } from '../table-analytics';
|
|
4
|
-
import { updateColumnWidths } from '../transforms';
|
|
4
|
+
import { updateColumnWidths } from '../transforms/column-width';
|
|
5
5
|
import { createCommand, getPluginState } from './plugin-factory';
|
|
6
|
-
import {
|
|
6
|
+
import { isClickNear } from './utils/dom';
|
|
7
|
+
import { evenAllColumnsWidths } from './utils/resize-state';
|
|
7
8
|
export var evenColumns = function evenColumns(_ref) {
|
|
8
9
|
var resizeState = _ref.resizeState,
|
|
9
10
|
table = _ref.table,
|
|
@@ -9,16 +9,21 @@ import { stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
|
9
9
|
import { updateResizeHandleDecorations } from '../commands/misc';
|
|
10
10
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
11
11
|
import { META_KEYS } from '../table-analytics';
|
|
12
|
-
import { updateColumnWidths } from '../transforms';
|
|
13
|
-
import { getSelectedColumnIndexes, isTableNested } from '../utils';
|
|
12
|
+
import { updateColumnWidths } from '../transforms/column-width';
|
|
14
13
|
import { ALIGN_CENTER, ALIGN_START, shouldChangeAlignmentToCenterResized } from '../utils/alignment';
|
|
14
|
+
import { isTableNested } from '../utils/nodes';
|
|
15
|
+
import { getSelectedColumnIndexes } from '../utils/selection';
|
|
15
16
|
import { evenColumns, setDragging, stopResizing } from './commands';
|
|
16
17
|
import { getPluginState } from './plugin-factory';
|
|
17
|
-
import { currentColWidth, getResizeState, getTableMaxWidth, pointsAtCell, resizeColumn, resizeColumnAndTable, updateControls } from './utils';
|
|
18
18
|
import { TABLE_OFFSET_IN_COMMENT_EDITOR } from './utils/consts';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
19
|
+
import { updateControls } from './utils/dom';
|
|
20
|
+
import { currentColWidth, getTableMaxWidth, pointsAtCell, getScalingPercentForTableWithoutWidth, getTableScalingPercent } from './utils/misc';
|
|
21
|
+
import { resizeColumn, resizeColumnAndTable, scaleResizeState } from './utils/resize-column';
|
|
22
|
+
import { getResizeState } from './utils/resize-state';
|
|
23
|
+
export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
26
|
+
) {
|
|
22
27
|
var _originalTable$attrs;
|
|
23
28
|
var state = view.state,
|
|
24
29
|
dispatch = view.dispatch;
|
|
@@ -95,6 +100,9 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
95
100
|
finish(event);
|
|
96
101
|
return true;
|
|
97
102
|
}
|
|
103
|
+
|
|
104
|
+
// Ignored via go/ees005
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
98
106
|
var width = currentColWidth(view, localResizeHandlePos, cell.attrs);
|
|
99
107
|
setDragging({
|
|
100
108
|
startX: event.clientX,
|
|
@@ -117,7 +125,11 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
117
125
|
});
|
|
118
126
|
}
|
|
119
127
|
function finish(event) {
|
|
128
|
+
// Ignored via go/ees005
|
|
129
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
120
130
|
window.removeEventListener('mouseup', finish);
|
|
131
|
+
// Ignored via go/ees005
|
|
132
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
121
133
|
window.removeEventListener('mousemove', move);
|
|
122
134
|
var clientX = event.clientX;
|
|
123
135
|
var state = view.state,
|
|
@@ -278,6 +290,8 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
278
290
|
// const tablePos = state.doc.resolve(start).start(-1);
|
|
279
291
|
var tableDepth = state.doc.resolve(tablePos).depth;
|
|
280
292
|
var map = TableMap.get(table);
|
|
293
|
+
// Ignored via go/ees005
|
|
294
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
281
295
|
var colIndex = map.colCount($cell.pos - $cell.start(-1)) + $cell.nodeAfter.attrs.colspan - 1;
|
|
282
296
|
var shouldScale = tableDepth === 0 && isTableScalingEnabled;
|
|
283
297
|
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || isTableScalingEnabled && isCommentEditor;
|
|
@@ -303,7 +317,12 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
303
317
|
}
|
|
304
318
|
updateControls()(state);
|
|
305
319
|
}
|
|
320
|
+
|
|
321
|
+
// Ignored via go/ees005
|
|
322
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
306
323
|
window.addEventListener('mouseup', finish);
|
|
324
|
+
// Ignored via go/ees005
|
|
325
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
307
326
|
window.addEventListener('mousemove', move);
|
|
308
327
|
return true;
|
|
309
328
|
};
|
|
@@ -7,7 +7,10 @@ import { setResizeHandlePos } from './commands';
|
|
|
7
7
|
import { handleMouseDown } from './event-handlers';
|
|
8
8
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
9
9
|
import { pluginKey } from './plugin-key';
|
|
10
|
-
import { getResizeCellPos } from './utils';
|
|
10
|
+
import { getResizeCellPos } from './utils/dom';
|
|
11
|
+
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
11
14
|
export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
12
15
|
var _ref$lastColumnResiza = _ref.lastColumnResizable,
|
|
13
16
|
lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
|
|
@@ -14,9 +14,15 @@ import { getScalingPercentForTableWithoutWidth, getTableScalingPercent } from '.
|
|
|
14
14
|
export var getColWidthFix = function getColWidthFix(colwidth, tableColumnCount) {
|
|
15
15
|
return colwidth - 1 / tableColumnCount;
|
|
16
16
|
};
|
|
17
|
-
export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
17
|
+
export var generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent, isCommentEditor
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
|
+
) {
|
|
18
21
|
var cols = [];
|
|
19
22
|
var map = TableMap.get(table);
|
|
23
|
+
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
26
|
table.content.firstChild.content.forEach(function (cell) {
|
|
21
27
|
var colspan = cell.attrs.colspan || 1;
|
|
22
28
|
if (Array.isArray(cell.attrs.colwidth)) {
|
|
@@ -66,6 +72,8 @@ export var insertColgroupFromNode = function insertColgroupFromNode(tableRef, ta
|
|
|
66
72
|
var shouldRemove = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
67
73
|
var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
68
74
|
var isCommentEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
75
|
+
// Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
69
77
|
var colgroup = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelector('colgroup');
|
|
70
78
|
if (colgroup && shouldRemove) {
|
|
71
79
|
tableRef === null || tableRef === void 0 || tableRef.removeChild(colgroup);
|
|
@@ -77,6 +85,8 @@ export var insertColgroupFromNode = function insertColgroupFromNode(tableRef, ta
|
|
|
77
85
|
return colgroup.children;
|
|
78
86
|
};
|
|
79
87
|
export var hasTableBeenResized = function hasTableBeenResized(table) {
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
80
90
|
return !!getFragmentBackingArray(table.content.firstChild.content).find(function (cell) {
|
|
81
91
|
return cell.attrs.colwidth;
|
|
82
92
|
});
|
|
@@ -90,14 +100,22 @@ export var hasTableColumnBeenResized = hasTableBeenResized;
|
|
|
90
100
|
* @returns true if all column width is equal to tableCellMinWidth or null, false otherwise
|
|
91
101
|
*/
|
|
92
102
|
export var isMinCellWidthTable = function isMinCellWidthTable(table) {
|
|
103
|
+
// Ignored via go/ees005
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
93
105
|
var cellArray = getFragmentBackingArray(table.content.firstChild.content);
|
|
94
106
|
var isTableMinCellWidth = cellArray.every(function (cell) {
|
|
95
107
|
return cell.attrs.colwidth && cell.attrs.colwidth[0] === tableCellMinWidth || cell.attrs.colwidth === null;
|
|
96
108
|
});
|
|
97
109
|
return isTableMinCellWidth;
|
|
98
110
|
};
|
|
111
|
+
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
99
114
|
function renderColgroupFromNode(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentEditor) {
|
|
100
115
|
var rendered = DOMSerializer.renderSpec(document, ['colgroup', {}].concat(_toConsumableArray(generateColgroup(table, maybeTableRef, shouldUseIncreasedScalingPercent, isCommentEditor))));
|
|
116
|
+
|
|
117
|
+
// Ignored via go/ees005
|
|
118
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
101
119
|
return rendered.dom;
|
|
102
120
|
}
|
|
103
121
|
export var getColgroupChildrenLength = function getColgroupChildrenLength(table) {
|
|
@@ -20,7 +20,10 @@ export var getFreeSpace = function getFreeSpace(state) {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
// Returns DOM refs of all cells in a column by `columnIndex`
|
|
23
|
-
export var getCellsRefsInColumn = function getCellsRefsInColumn(columnIndex, table, tableStart, domAtPos
|
|
23
|
+
export var getCellsRefsInColumn = function getCellsRefsInColumn(columnIndex, table, tableStart, domAtPos
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
26
|
+
) {
|
|
24
27
|
var map = TableMap.get(table);
|
|
25
28
|
var cellsPositions = map.cellsInRect({
|
|
26
29
|
left: columnIndex,
|
|
@@ -30,6 +33,8 @@ export var getCellsRefsInColumn = function getCellsRefsInColumn(columnIndex, tab
|
|
|
30
33
|
});
|
|
31
34
|
var cells = [];
|
|
32
35
|
cellsPositions.forEach(function (pos) {
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
33
38
|
var col = findDomRefAtPos(pos + tableStart, domAtPos);
|
|
34
39
|
if (col) {
|
|
35
40
|
cells.push(col);
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { unitToNumber } from './unit-to-number';
|
|
2
2
|
|
|
3
3
|
// calculates content width of a cell
|
|
4
|
+
// Ignored via go/ees005
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
4
6
|
export function contentWidth(elem, container) {
|
|
5
7
|
var colWidths = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
6
8
|
var canvas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document.createElement('canvas');
|
|
7
9
|
return calcContentWidth(elem, container || elem, canvas, colWidths);
|
|
8
10
|
}
|
|
11
|
+
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
9
14
|
function calcContentWidth(elem, container, canvas, colWidths) {
|
|
10
15
|
var flowWidths = [];
|
|
11
16
|
var curWidth = 0;
|
|
12
17
|
for (var i = 0; i < elem.childNodes.length; i++) {
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
13
20
|
var child = elem.childNodes[i];
|
|
14
21
|
if (child.nodeType === Node.COMMENT_NODE) {
|
|
15
22
|
continue;
|
|
16
23
|
}
|
|
17
24
|
if (child.nodeType === Node.TEXT_NODE) {
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
18
27
|
var parent = child.parentNode;
|
|
19
28
|
var parentStyle = getComputedStyle(parent);
|
|
20
29
|
var contentLength = 0;
|
|
@@ -71,11 +80,19 @@ function measureText(canvas, text, font) {
|
|
|
71
80
|
}
|
|
72
81
|
return Math.round(ctx.measureText(text || '').width);
|
|
73
82
|
}
|
|
83
|
+
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
74
86
|
function handlePreText(canvas, node, textContent, font) {
|
|
75
87
|
var parent = node;
|
|
76
88
|
if (node.nodeName === 'CODE') {
|
|
89
|
+
// Ignored via go/ees005
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @atlaskit/editor/no-as-casting
|
|
77
91
|
parent = node.parentNode;
|
|
78
92
|
}
|
|
93
|
+
|
|
94
|
+
// Ignored via go/ees005
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
79
96
|
var computedStyle = getComputedStyle(parent);
|
|
80
97
|
if (textContent && computedStyle.whiteSpace === 'pre') {
|
|
81
98
|
// If white space is pre grab the longest line in the block.
|
|
@@ -42,6 +42,8 @@ export var isClickNear = function isClickNear(event, click) {
|
|
|
42
42
|
return dx * dx + dy * dy < 100;
|
|
43
43
|
};
|
|
44
44
|
export var getResizeCellPos = function getResizeCellPos(view, event) {
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
45
47
|
var target = event.target;
|
|
46
48
|
if (!containsClassName(target, ClassName.RESIZE_HANDLE_DECORATION)) {
|
|
47
49
|
return null;
|
|
@@ -82,6 +84,8 @@ export var syncStickyRowToTable = function syncStickyRowToTable(tableRef) {
|
|
|
82
84
|
applyTableWidthToStickyRow(tableRef, headerRow);
|
|
83
85
|
};
|
|
84
86
|
var applyTableWidthToStickyRow = function applyTableWidthToStickyRow(tableRef, headerRow) {
|
|
87
|
+
// Ignored via go/ees005
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
85
89
|
var tbody = tableRef.querySelector('tbody');
|
|
86
90
|
var wrapper = tableRef.parentElement;
|
|
87
91
|
if (tbody && wrapper) {
|
|
@@ -34,6 +34,8 @@ export function currentColWidth(view, cellPos, _ref) {
|
|
|
34
34
|
return width;
|
|
35
35
|
}
|
|
36
36
|
// Not fixed, read current width from DOM
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
37
39
|
var domWidth = view.domAtPos(cellPos + 1).node.offsetWidth;
|
|
38
40
|
var parts = colspan || 0;
|
|
39
41
|
if (colwidth) {
|
|
@@ -41,7 +41,10 @@ export var resizeColumnAndTable = function resizeColumnAndTable(_ref) {
|
|
|
41
41
|
if (willTableHitEditorEdge || willResizedTableStayInOverflow) {
|
|
42
42
|
var _tableRef$closest;
|
|
43
43
|
var tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
|
|
44
|
-
resizeAmount = amount < 0 ? amount :
|
|
44
|
+
resizeAmount = amount < 0 ? amount :
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
47
|
+
resizeAmount - (resizeState.maxSize + resizeAmount - tableContainerWidth) / 2;
|
|
45
48
|
} else {
|
|
46
49
|
var diff = -(resizeState.tableWidth - resizeState.maxSize);
|
|
47
50
|
var rest = amount - diff;
|
|
@@ -78,7 +81,11 @@ var updateTablePreview = function updateTablePreview(tableRef, newTableWidth, sh
|
|
|
78
81
|
var alignmentContainer = resizingContainer === null || resizingContainer === void 0 ? void 0 : resizingContainer.parentElement;
|
|
79
82
|
if (resizingItem) {
|
|
80
83
|
var newWidth = "".concat(newTableWidth, "px");
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
81
86
|
resizingContainer.style.width = newWidth;
|
|
87
|
+
// Ignored via go/ees005
|
|
88
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
82
89
|
resizingItem.style.width = newWidth;
|
|
83
90
|
if (shouldChangeAlignment && alignmentContainer) {
|
|
84
91
|
alignmentContainer.style.justifyContent = ALIGN_CENTER;
|