@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
|
@@ -6,20 +6,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.contentWidth = contentWidth;
|
|
7
7
|
var _unitToNumber = require("./unit-to-number");
|
|
8
8
|
// calculates content width of a cell
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
9
11
|
function contentWidth(elem, container) {
|
|
10
12
|
var colWidths = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
11
13
|
var canvas = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document.createElement('canvas');
|
|
12
14
|
return calcContentWidth(elem, container || elem, canvas, colWidths);
|
|
13
15
|
}
|
|
16
|
+
|
|
17
|
+
// Ignored via go/ees005
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
14
19
|
function calcContentWidth(elem, container, canvas, colWidths) {
|
|
15
20
|
var flowWidths = [];
|
|
16
21
|
var curWidth = 0;
|
|
17
22
|
for (var i = 0; i < elem.childNodes.length; i++) {
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
18
25
|
var child = elem.childNodes[i];
|
|
19
26
|
if (child.nodeType === Node.COMMENT_NODE) {
|
|
20
27
|
continue;
|
|
21
28
|
}
|
|
22
29
|
if (child.nodeType === Node.TEXT_NODE) {
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
23
32
|
var parent = child.parentNode;
|
|
24
33
|
var parentStyle = getComputedStyle(parent);
|
|
25
34
|
var contentLength = 0;
|
|
@@ -76,11 +85,19 @@ function measureText(canvas, text, font) {
|
|
|
76
85
|
}
|
|
77
86
|
return Math.round(ctx.measureText(text || '').width);
|
|
78
87
|
}
|
|
88
|
+
|
|
89
|
+
// Ignored via go/ees005
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
79
91
|
function handlePreText(canvas, node, textContent, font) {
|
|
80
92
|
var parent = node;
|
|
81
93
|
if (node.nodeName === 'CODE') {
|
|
94
|
+
// Ignored via go/ees005
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @atlaskit/editor/no-as-casting
|
|
82
96
|
parent = node.parentNode;
|
|
83
97
|
}
|
|
98
|
+
|
|
99
|
+
// Ignored via go/ees005
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
84
101
|
var computedStyle = getComputedStyle(parent);
|
|
85
102
|
if (textContent && computedStyle.whiteSpace === 'pre') {
|
|
86
103
|
// If white space is pre grab the longest line in the block.
|
|
@@ -48,6 +48,8 @@ var isClickNear = exports.isClickNear = function isClickNear(event, click) {
|
|
|
48
48
|
return dx * dx + dy * dy < 100;
|
|
49
49
|
};
|
|
50
50
|
var getResizeCellPos = exports.getResizeCellPos = function getResizeCellPos(view, event) {
|
|
51
|
+
// Ignored via go/ees005
|
|
52
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
51
53
|
var target = event.target;
|
|
52
54
|
if (!(0, _utils.containsClassName)(target, _types.TableCssClassName.RESIZE_HANDLE_DECORATION)) {
|
|
53
55
|
return null;
|
|
@@ -88,6 +90,8 @@ var syncStickyRowToTable = exports.syncStickyRowToTable = function syncStickyRow
|
|
|
88
90
|
applyTableWidthToStickyRow(tableRef, headerRow);
|
|
89
91
|
};
|
|
90
92
|
var applyTableWidthToStickyRow = function applyTableWidthToStickyRow(tableRef, headerRow) {
|
|
93
|
+
// Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
91
95
|
var tbody = tableRef.querySelector('tbody');
|
|
92
96
|
var wrapper = tableRef.parentElement;
|
|
93
97
|
if (tbody && wrapper) {
|
|
@@ -42,6 +42,8 @@ function currentColWidth(view, cellPos, _ref) {
|
|
|
42
42
|
return width;
|
|
43
43
|
}
|
|
44
44
|
// Not fixed, read current width from DOM
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
45
47
|
var domWidth = view.domAtPos(cellPos + 1).node.offsetWidth;
|
|
46
48
|
var parts = colspan || 0;
|
|
47
49
|
if (colwidth) {
|
|
@@ -47,7 +47,10 @@ var resizeColumnAndTable = exports.resizeColumnAndTable = function resizeColumnA
|
|
|
47
47
|
if (willTableHitEditorEdge || willResizedTableStayInOverflow) {
|
|
48
48
|
var _tableRef$closest;
|
|
49
49
|
var tableContainerWidth = (_tableRef$closest = tableRef.closest('.pm-table-container')) === null || _tableRef$closest === void 0 ? void 0 : _tableRef$closest.clientWidth;
|
|
50
|
-
resizeAmount = amount < 0 ? amount :
|
|
50
|
+
resizeAmount = amount < 0 ? amount :
|
|
51
|
+
// Ignored via go/ees005
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
53
|
+
resizeAmount - (resizeState.maxSize + resizeAmount - tableContainerWidth) / 2;
|
|
51
54
|
} else {
|
|
52
55
|
var diff = -(resizeState.tableWidth - resizeState.maxSize);
|
|
53
56
|
var rest = amount - diff;
|
|
@@ -84,7 +87,11 @@ var updateTablePreview = function updateTablePreview(tableRef, newTableWidth, sh
|
|
|
84
87
|
var alignmentContainer = resizingContainer === null || resizingContainer === void 0 ? void 0 : resizingContainer.parentElement;
|
|
85
88
|
if (resizingItem) {
|
|
86
89
|
var newWidth = "".concat(newTableWidth, "px");
|
|
90
|
+
// Ignored via go/ees005
|
|
91
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
87
92
|
resizingContainer.style.width = newWidth;
|
|
93
|
+
// Ignored via go/ees005
|
|
94
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
88
95
|
resizingItem.style.width = newWidth;
|
|
89
96
|
if (shouldChangeAlignment && alignmentContainer) {
|
|
90
97
|
alignmentContainer.style.justifyContent = _alignment.ALIGN_CENTER;
|
|
@@ -14,7 +14,10 @@ var _columnState = require("./column-state");
|
|
|
14
14
|
var _resizeState = require("./resize-state");
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
|
-
var growColumn = exports.growColumn = function growColumn(state, colIndex, amount, selectedColumns
|
|
17
|
+
var growColumn = exports.growColumn = function growColumn(state, colIndex, amount, selectedColumns
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
20
|
+
) {
|
|
18
21
|
// can't grow if columns don't exist or it's the last column
|
|
19
22
|
if (!state.cols[colIndex] || !state.cols[colIndex + 1]) {
|
|
20
23
|
return state;
|
|
@@ -30,7 +33,10 @@ var growColumn = exports.growColumn = function growColumn(state, colIndex, amoun
|
|
|
30
33
|
}
|
|
31
34
|
return newState;
|
|
32
35
|
};
|
|
33
|
-
var shrinkColumn = exports.shrinkColumn = function shrinkColumn(state, colIndex, amount, selectedColumns
|
|
36
|
+
var shrinkColumn = exports.shrinkColumn = function shrinkColumn(state, colIndex, amount, selectedColumns
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
|
+
) {
|
|
34
40
|
// can't shrink if columns don't exist
|
|
35
41
|
if (!state.cols[colIndex]) {
|
|
36
42
|
return state;
|
|
@@ -103,6 +109,8 @@ var ColType = /*#__PURE__*/function (ColType) {
|
|
|
103
109
|
return ColType;
|
|
104
110
|
}(ColType || {}); // TODO: should handle when destIdx:
|
|
105
111
|
// - is beyond the range, and then not give it back
|
|
112
|
+
// Ignored via go/ees005
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
106
114
|
function moveSpaceFrom(state, srcIdx, destIdx, amount) {
|
|
107
115
|
var useFreeSpace = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
108
116
|
var srcCol = state.cols[srcIdx];
|
|
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
|
-
var
|
|
12
|
+
var _analytics = require("../../utils/analytics");
|
|
13
13
|
var _colgroup = require("./colgroup");
|
|
14
14
|
var _columnState = require("./column-state");
|
|
15
15
|
var _dom = require("./dom");
|
|
@@ -100,7 +100,10 @@ var getResizeState = exports.getResizeState = function getResizeState(_ref) {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
// updates Colgroup DOM node with new widths
|
|
103
|
-
var updateColgroup = exports.updateColgroup = function updateColgroup(state, tableRef, tableNode, isTableScalingEnabled, scalePercent
|
|
103
|
+
var updateColgroup = exports.updateColgroup = function updateColgroup(state, tableRef, tableNode, isTableScalingEnabled, scalePercent
|
|
104
|
+
// Ignored via go/ees005
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
106
|
+
) {
|
|
104
107
|
var cols = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelectorAll('col');
|
|
105
108
|
var columnsCount = cols === null || cols === void 0 ? void 0 : cols.length;
|
|
106
109
|
/**
|
|
@@ -310,7 +313,7 @@ var getNewResizeStateFromSelectedColumns = exports.getNewResizeStateFromSelected
|
|
|
310
313
|
if (numColumnsSelected <= 1) {
|
|
311
314
|
return;
|
|
312
315
|
}
|
|
313
|
-
var _getSelectedTableInfo = (0,
|
|
316
|
+
var _getSelectedTableInfo = (0, _analytics.getSelectedTableInfo)(state.selection),
|
|
314
317
|
totalRowCount = _getSelectedTableInfo.totalRowCount,
|
|
315
318
|
totalColumnCount = _getSelectedTableInfo.totalColumnCount,
|
|
316
319
|
table = _getSelectedTableInfo.table;
|
|
@@ -10,8 +10,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
11
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var _columnWidth = require("../../transforms/column-width");
|
|
14
|
+
var _nodes = require("../../utils/nodes");
|
|
15
15
|
var _misc = require("../utils/misc");
|
|
16
16
|
var _resizeLogic = require("../utils/resize-logic");
|
|
17
17
|
var _resizeState = require("../utils/resize-state");
|
|
@@ -33,7 +33,7 @@ var scale = function scale(tableRef, options, domAtPos) {
|
|
|
33
33
|
layoutChanged = options.layoutChanged,
|
|
34
34
|
isTableResizingEnabled = options.isTableResizingEnabled;
|
|
35
35
|
var maxSize = isTableResizingEnabled ? (0, _nodeWidth.getTableContainerWidth)(node) : (0, _misc.getLayoutSize)(node.attrs.layout, containerWidth, {});
|
|
36
|
-
var prevTableWidth = (0,
|
|
36
|
+
var prevTableWidth = (0, _nodes.getTableWidth)(prevNode);
|
|
37
37
|
var previousMaxSize = isTableResizingEnabled ? (0, _nodeWidth.getTableContainerWidth)(node) : (0, _misc.getLayoutSize)(prevNode.attrs.layout, previousContainerWidth, {});
|
|
38
38
|
var newWidth = maxSize;
|
|
39
39
|
|
|
@@ -176,7 +176,7 @@ var scaleTable = exports.scaleTable = function scaleTable(tableRef, options, dom
|
|
|
176
176
|
resizeState = scale(tableRef, options, domAtPos, isTableScalingEnabledOnCurrentTable, shouldUseIncreasedScalingPercent);
|
|
177
177
|
}
|
|
178
178
|
if (resizeState) {
|
|
179
|
-
tr = (0,
|
|
179
|
+
tr = (0, _columnWidth.updateColumnWidths)(resizeState, node, start, api)(tr);
|
|
180
180
|
if (tr.docChanged) {
|
|
181
181
|
tr.setMeta('scrollIntoView', false);
|
|
182
182
|
// TODO: ED-8995
|
|
@@ -12,11 +12,23 @@ function tableSelectionKeymapPlugin(pluginInjectionApi, getIntl) {
|
|
|
12
12
|
var list = {};
|
|
13
13
|
var editorSelectionAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.selection;
|
|
14
14
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
15
|
+
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
15
18
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveRight.common, (0, _selection.arrowRightFromTable)(editorSelectionAPI)(), list);
|
|
19
|
+
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
16
22
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, (0, _selection.arrowLeftFromTable)(editorSelectionAPI)(), list);
|
|
17
23
|
(0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectColumn, (0, _selection.selectColumns)(editorSelectionAPI, ariaNotifyPlugin, getIntl)(true), list);
|
|
18
24
|
(0, _keymaps.bindKeymapArrayWithCommand)(_keymaps.selectRow, (0, _selection.selectRows)(editorSelectionAPI, ariaNotifyPlugin, getIntl)(true), list);
|
|
25
|
+
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
28
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.shiftArrowUp.common, (0, _selection.shiftArrowUpFromTable)(editorSelectionAPI)(), list);
|
|
29
|
+
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
20
32
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.selectTable.common, (0, _selection.modASelectTable)(editorSelectionAPI)(), list);
|
|
21
33
|
return (0, _keymap.keymap)(list);
|
|
22
34
|
}
|
|
@@ -12,7 +12,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
13
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
|
-
var
|
|
15
|
+
var _consts = require("./table-resizing/utils/consts");
|
|
16
16
|
var _alignment = require("./utils/alignment");
|
|
17
17
|
var _excluded = ["width"];
|
|
18
18
|
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; }
|
|
@@ -22,7 +22,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
22
22
|
* Also holds resizing state to hide / show table controls
|
|
23
23
|
*/
|
|
24
24
|
var pluginKey = exports.pluginKey = new _state.PluginKey('tableWidthPlugin');
|
|
25
|
-
var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullWidthEnabled, isTableScalingEnabled, isTableAlignmentEnabled, isCommentEditor
|
|
25
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent, fullWidthEnabled, isTableScalingEnabled, isTableAlignmentEnabled, isCommentEditor
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
|
+
) {
|
|
26
29
|
return new _safePlugin.SafePlugin({
|
|
27
30
|
key: pluginKey,
|
|
28
31
|
state: {
|
|
@@ -119,11 +122,13 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
119
122
|
}
|
|
120
123
|
if (referentialityTr) {
|
|
121
124
|
referentialityTr.steps.forEach(function (step) {
|
|
125
|
+
// Ignored via go/ees005
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
122
127
|
step.getMap().forEach(function (_, __, newStart, newEnd) {
|
|
123
128
|
newState.doc.nodesBetween(newStart, newEnd, function (node, pos) {
|
|
124
129
|
if (node.type === table) {
|
|
125
|
-
if (shouldPatchTableWidth && node.attrs.width !==
|
|
126
|
-
tr.setNodeAttribute(pos, 'width',
|
|
130
|
+
if (shouldPatchTableWidth && node.attrs.width !== _consts.TABLE_MAX_WIDTH) {
|
|
131
|
+
tr.setNodeAttribute(pos, 'width', _consts.TABLE_MAX_WIDTH);
|
|
127
132
|
}
|
|
128
133
|
if (shouldPatchTableAlignment) {
|
|
129
134
|
tr.setNodeAttribute(pos, 'layout', _alignment.ALIGN_START);
|
|
@@ -10,8 +10,8 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
10
10
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
11
11
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
var _utils = require("../table-resizing/utils");
|
|
14
13
|
var _colgroup = require("../table-resizing/utils/colgroup");
|
|
14
|
+
var _misc = require("../table-resizing/utils/misc");
|
|
15
15
|
var _resizeState = require("../table-resizing/utils/resize-state");
|
|
16
16
|
var _scaleTable = require("../table-resizing/utils/scale-table");
|
|
17
17
|
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; }
|
|
@@ -23,7 +23,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
23
23
|
* @param start
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
|
-
var updateColumnWidths = exports.updateColumnWidths = function updateColumnWidths(resizeState, table, start, api
|
|
26
|
+
var updateColumnWidths = exports.updateColumnWidths = function updateColumnWidths(resizeState, table, start, api
|
|
27
|
+
// Ignored via go/ees005
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
29
|
+
) {
|
|
27
30
|
return function (tr) {
|
|
28
31
|
var map = _tableMap.TableMap.get(table);
|
|
29
32
|
var updatedCellsAttrs = {};
|
|
@@ -127,7 +130,7 @@ var rescaleColumns = exports.rescaleColumns = function rescaleColumns() {
|
|
|
127
130
|
if (!tableRef || !newTable) {
|
|
128
131
|
return tr;
|
|
129
132
|
}
|
|
130
|
-
var isResized = (0,
|
|
133
|
+
var isResized = (0, _colgroup.hasTableBeenResized)(table.node);
|
|
131
134
|
var previousTableInfo = {
|
|
132
135
|
width: 0,
|
|
133
136
|
possibleMaxWidth: 0,
|
|
@@ -140,8 +143,8 @@ var rescaleColumns = exports.rescaleColumns = function rescaleColumns() {
|
|
|
140
143
|
}
|
|
141
144
|
if (shouldScale) {
|
|
142
145
|
previousTableInfo = {
|
|
143
|
-
width: (0,
|
|
144
|
-
possibleMaxWidth: (0,
|
|
146
|
+
width: (0, _misc.getTableElementWidth)(table.node),
|
|
147
|
+
possibleMaxWidth: (0, _misc.getTableContainerElementWidth)(table.node),
|
|
145
148
|
isResized: isResized
|
|
146
149
|
};
|
|
147
150
|
} else {
|
|
@@ -36,6 +36,8 @@ var deleteColumnsCustomStep = function deleteColumnsCustomStep(rect) {
|
|
|
36
36
|
for (var i = rect.left; i < rect.right; i++) {
|
|
37
37
|
var step = _customSteps.AddColumnStep.create(originalDoc, table.pos, i, true);
|
|
38
38
|
deletedColumns.push(i);
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
39
41
|
tr.step(step.map(tr.mapping.slice(mapStart)));
|
|
40
42
|
}
|
|
41
43
|
var tablePosResult = tr.mapping.mapResult(table.pos);
|
|
@@ -8,7 +8,9 @@ exports.removeExtraneousColumnWidths = exports.fixTables = exports.fixAutoSizedT
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
-
var
|
|
11
|
+
var _columnState = require("../table-resizing/utils/column-state");
|
|
12
|
+
var _contentWidth = require("../table-resizing/utils/content-width");
|
|
13
|
+
var _misc = require("../table-resizing/utils/misc");
|
|
12
14
|
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; }
|
|
13
15
|
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; }
|
|
14
16
|
var validateTableCellNodeAttrs = function validateTableCellNodeAttrs(_ref, reportInvalidTableCellSpanAttrs) {
|
|
@@ -43,7 +45,10 @@ var validateTableCellNodeAttrs = function validateTableCellNodeAttrs(_ref, repor
|
|
|
43
45
|
//
|
|
44
46
|
// This row only spans two columns, yet it contains widths for 3.
|
|
45
47
|
// We remove the third width here, assumed duplicate content.
|
|
46
|
-
var removeExtraneousColumnWidths = exports.removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr, reportInvalidTableCellSpanAttrs
|
|
48
|
+
var removeExtraneousColumnWidths = exports.removeExtraneousColumnWidths = function removeExtraneousColumnWidths(node, basePos, tr, reportInvalidTableCellSpanAttrs
|
|
49
|
+
// Ignored via go/ees005
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
51
|
+
) {
|
|
47
52
|
var hasProblems = false;
|
|
48
53
|
tr = replaceCells(tr, node, basePos, function (cell) {
|
|
49
54
|
var _cell$attrs = cell.attrs,
|
|
@@ -94,7 +99,10 @@ var fixTables = exports.fixTables = function fixTables(tr, reportInvalidTableCel
|
|
|
94
99
|
//
|
|
95
100
|
// We use this when migrating TinyMCE tables for Confluence, for example:
|
|
96
101
|
// https://pug.jira-dev.com/wiki/spaces/AEC/pages/3362882215/How+do+we+map+TinyMCE+tables+to+Fabric+tables
|
|
97
|
-
var fixAutoSizedTable = exports.fixAutoSizedTable = function fixAutoSizedTable(view, tableNode, tableRef, tablePos, opts
|
|
102
|
+
var fixAutoSizedTable = exports.fixAutoSizedTable = function fixAutoSizedTable(view, tableNode, tableRef, tablePos, opts
|
|
103
|
+
// Ignored via go/ees005
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
105
|
+
) {
|
|
98
106
|
var tr = view.state.tr;
|
|
99
107
|
var domAtPos = view.domAtPos.bind(view);
|
|
100
108
|
var tableStart = tablePos + 1;
|
|
@@ -103,7 +111,7 @@ var fixAutoSizedTable = exports.fixAutoSizedTable = function fixAutoSizedTable(v
|
|
|
103
111
|
return acc + current;
|
|
104
112
|
}, 0);
|
|
105
113
|
var tableLayout = getLayoutBasedOnWidth(totalContentWidth);
|
|
106
|
-
var maxLayoutSize = (0,
|
|
114
|
+
var maxLayoutSize = (0, _misc.getLayoutSize)(tableLayout, opts.containerWidth, {});
|
|
107
115
|
|
|
108
116
|
// Content width will generally not meet the constraints of the layout
|
|
109
117
|
// whether it be below or above, so we scale our columns widths
|
|
@@ -137,6 +145,9 @@ var getLayoutBasedOnWidth = function getLayoutBasedOnWidth(totalWidth) {
|
|
|
137
145
|
return 'default';
|
|
138
146
|
}
|
|
139
147
|
};
|
|
148
|
+
|
|
149
|
+
// Ignored via go/ees005
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
140
151
|
function parseDOMColumnWidths(domAtPos, tableNode, tableStart, tableRef) {
|
|
141
152
|
var row = tableRef.querySelector('tr');
|
|
142
153
|
if (!row) {
|
|
@@ -148,9 +159,11 @@ function parseDOMColumnWidths(domAtPos, tableNode, tableStart, tableRef) {
|
|
|
148
159
|
var colspan = Number(currentCol.getAttribute('colspan') || 1);
|
|
149
160
|
for (var span = 0; span < colspan; span++) {
|
|
150
161
|
var colIdx = col + span;
|
|
151
|
-
var cells = (0,
|
|
152
|
-
var colWidth = (0,
|
|
153
|
-
|
|
162
|
+
var cells = (0, _columnState.getCellsRefsInColumn)(colIdx, tableNode, tableStart, domAtPos);
|
|
163
|
+
var colWidth = (0, _columnState.calculateColumnWidth)(cells, function (_, col) {
|
|
164
|
+
// Ignored via go/ees005
|
|
165
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
166
|
+
return (0, _contentWidth.contentWidth)(col, tableRef).width;
|
|
154
167
|
});
|
|
155
168
|
cols[colIdx] = Math.max(colWidth, _styles.tableCellMinWidth);
|
|
156
169
|
}
|
|
@@ -159,7 +172,10 @@ function parseDOMColumnWidths(domAtPos, tableNode, tableStart, tableRef) {
|
|
|
159
172
|
}
|
|
160
173
|
|
|
161
174
|
// TODO: move to prosemirror-utils
|
|
162
|
-
var replaceCells = function replaceCells(tr, table, tablePos, modifyCell
|
|
175
|
+
var replaceCells = function replaceCells(tr, table, tablePos, modifyCell
|
|
176
|
+
// Ignored via go/ees005
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
178
|
+
) {
|
|
163
179
|
var rows = [];
|
|
164
180
|
var modifiedCells = 0;
|
|
165
181
|
for (var rowIndex = 0; rowIndex < table.childCount; rowIndex++) {
|
|
@@ -21,7 +21,12 @@ function mergeCells(tr) {
|
|
|
21
21
|
if (!(selection instanceof _cellSelection.CellSelection) || !canMergeCells(tr)) {
|
|
22
22
|
return tr;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
24
27
|
var rect = (0, _utils.getSelectionRect)(selection);
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
25
30
|
var table = (0, _utils.findTable)(selection);
|
|
26
31
|
var map = _tableMap.TableMap.get(table.node);
|
|
27
32
|
var seen = [];
|
|
@@ -66,6 +71,8 @@ function mergeCells(tr) {
|
|
|
66
71
|
rowspan: rowspan
|
|
67
72
|
}), cell.attrs.colspan, rect.right - rect.left - cell.attrs.colspan);
|
|
68
73
|
var newCell = content === _model.Fragment.empty ? cell.type.createAndFill(attrs, content, cell.marks) : cell.type.createChecked(attrs, content, cell.marks);
|
|
74
|
+
// Ignored via go/ees005
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
69
76
|
rowCells.push(newCell);
|
|
70
77
|
} else if (selectedCells.indexOf(cellPos) === -1) {
|
|
71
78
|
// if its one of the selected cells, but not the merged cell, we get rid of it
|
|
@@ -8,15 +8,18 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
8
8
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
|
-
var
|
|
12
|
-
var replaceSelectedTable = exports.replaceSelectedTable = function replaceSelectedTable(state, content, inputMethod, editorAnalyticsAPI
|
|
11
|
+
var _analytics2 = require("../utils/analytics");
|
|
12
|
+
var replaceSelectedTable = exports.replaceSelectedTable = function replaceSelectedTable(state, content, inputMethod, editorAnalyticsAPI
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
15
|
+
) {
|
|
13
16
|
if ((0, _utils.isTableSelected)(state.selection)) {
|
|
14
17
|
var table = (0, _utils.findTable)(state.selection);
|
|
15
18
|
if (table) {
|
|
16
19
|
var slice = typeof content === 'string' ? new _model.Slice(_model.Fragment.from(state.schema.text(content)), 0, 0) : content;
|
|
17
20
|
var tr = state.tr.replace(table.pos, table.pos + table.node.nodeSize, slice);
|
|
18
21
|
tr.setSelection(_state.TextSelection.create(tr.doc, table.pos + slice.size + 1));
|
|
19
|
-
var _getSelectedTableInfo = (0,
|
|
22
|
+
var _getSelectedTableInfo = (0, _analytics2.getSelectedTableInfo)(state.selection),
|
|
20
23
|
totalRowCount = _getSelectedTableInfo.totalRowCount,
|
|
21
24
|
totalColumnCount = _getSelectedTableInfo.totalColumnCount;
|
|
22
25
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
@@ -16,6 +16,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
* @param columnStart - Start of the rect included (rect.left)
|
|
17
17
|
* @param columnEnd - End of the rect not included (rect.right)
|
|
18
18
|
*/
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
19
21
|
function splitCellsInColumns(tr, tablePos, columnStart, columnEnd) {
|
|
20
22
|
var mapStart = tr.mapping.maps.length;
|
|
21
23
|
var table = tr.doc.nodeAt(tablePos);
|
|
@@ -57,7 +59,10 @@ function splitCellsInColumns(tr, tablePos, columnStart, columnEnd) {
|
|
|
57
59
|
for (var i = 0; i < colspan; i++) {
|
|
58
60
|
var _mapping = tr.mapping.slice(mapStart);
|
|
59
61
|
var _cellPos = map.positionAt(cellRowIndex, column + i, table);
|
|
60
|
-
tr.insert(_mapping.map(_cellPos + tableStart),
|
|
62
|
+
tr.insert(_mapping.map(_cellPos + tableStart),
|
|
63
|
+
// Ignored via go/ees005
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
65
|
+
cellNode.type.createAndFill(_objectSpread(_objectSpread({}, baseAttrs), {}, {
|
|
61
66
|
colwidth: colwidth ? [colwidth[i]] : undefined
|
|
62
67
|
})));
|
|
63
68
|
}
|
|
@@ -19,6 +19,9 @@ var normaliseAlignment = exports.normaliseAlignment = function normaliseAlignmen
|
|
|
19
19
|
/**
|
|
20
20
|
* We don't want to switch alignment in Full-width editor
|
|
21
21
|
*/
|
|
22
|
-
var shouldChangeAlignmentToCenterResized = exports.shouldChangeAlignmentToCenterResized = function shouldChangeAlignmentToCenterResized(isTableAlignmentEnabled, tableNode, lineLength, updatedTableWidth
|
|
22
|
+
var shouldChangeAlignmentToCenterResized = exports.shouldChangeAlignmentToCenterResized = function shouldChangeAlignmentToCenterResized(isTableAlignmentEnabled, tableNode, lineLength, updatedTableWidth
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
25
|
+
) {
|
|
23
26
|
return Boolean(isTableAlignmentEnabled && tableNode && tableNode.attrs.layout === ALIGN_START && lineLength && updatedTableWidth > lineLength && lineLength < _consts.FULL_WIDTH_EDITOR_CONTENT_WIDTH);
|
|
24
27
|
};
|
|
@@ -11,8 +11,8 @@ var _react = require("react");
|
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
12
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
13
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var _colgroup = require("../table-resizing/utils/colgroup");
|
|
15
|
+
var _nodes = require("./nodes");
|
|
16
16
|
function getSelectedTableInfo(selection) {
|
|
17
17
|
var map;
|
|
18
18
|
var totalRowCount = 0;
|
|
@@ -84,7 +84,7 @@ var generateResizedPayload = exports.generateResizedPayload = function generateR
|
|
|
84
84
|
newWidth: props.resizedNode.attrs.width,
|
|
85
85
|
prevWidth: (_props$originalNode$a = props.originalNode.attrs.width) !== null && _props$originalNode$a !== void 0 ? _props$originalNode$a : null,
|
|
86
86
|
nodeSize: props.resizedNode.nodeSize,
|
|
87
|
-
totalTableWidth: (0,
|
|
87
|
+
totalTableWidth: (0, _colgroup.hasTableBeenResized)(props.resizedNode) ? (0, _nodes.getTableWidth)(props.resizedNode) : null,
|
|
88
88
|
totalRowCount: tableMap.height,
|
|
89
89
|
totalColumnCount: tableMap.width
|
|
90
90
|
}
|
|
@@ -25,8 +25,12 @@ var getColumnsWidths = exports.getColumnsWidths = function getColumnsWidths(view
|
|
|
25
25
|
});
|
|
26
26
|
for (var i = 0; i < map.width; i++) {
|
|
27
27
|
if (!map.isCellMergedTopLeft(0, i)) {
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
28
30
|
var node = table.node.nodeAt(map.map[i]);
|
|
29
31
|
var pos = map.map[i] + table.start;
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
30
34
|
var cellRef = (0, _utils2.findDomRefAtPos)(pos, domAtPos);
|
|
31
35
|
var rect = cellRef.getBoundingClientRect();
|
|
32
36
|
widths[i] = (rect ? rect.width : cellRef.offsetWidth) + 1;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.createTableWithWidth = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
10
|
-
var
|
|
10
|
+
var _consts = require("../table-resizing/utils/consts");
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
13
|
var NESTED_TABLE_DEFAULT_ROWS = 2;
|
|
@@ -28,7 +28,7 @@ var createTableWithWidth = exports.createTableWithWidth = function createTableWi
|
|
|
28
28
|
attrsOverrides.colsCount = createTableProps !== null && createTableProps !== void 0 && createTableProps.colsCount ? createTableProps === null || createTableProps === void 0 ? void 0 : createTableProps.colsCount : NESTED_TABLE_DEFAULT_COLS;
|
|
29
29
|
}
|
|
30
30
|
if (isTableScalingEnabled && isFullWidthModeEnabled && !isCommentEditor) {
|
|
31
|
-
attrsOverrides.tableWidth =
|
|
31
|
+
attrsOverrides.tableWidth = _consts.TABLE_MAX_WIDTH;
|
|
32
32
|
}
|
|
33
33
|
if (isTableAlignmentEnabled && (isFullWidthModeEnabled || isCommentEditor)) {
|
|
34
34
|
attrsOverrides.layout = 'align-start';
|
|
@@ -39,7 +39,10 @@ var createCellHoverDecoration = exports.createCellHoverDecoration = function cre
|
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
|
-
var createControlsHoverDecoration = exports.createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, isDragAndDropEnable, hoveredIndexes, danger, selected
|
|
42
|
+
var createControlsHoverDecoration = exports.createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, isDragAndDropEnable, hoveredIndexes, danger, selected
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
45
|
+
) {
|
|
43
46
|
var table = (0, _utils2.findTable)(tr.selection);
|
|
44
47
|
if (!table) {
|
|
45
48
|
return [];
|
|
@@ -111,7 +114,10 @@ var createControlsHoverDecoration = exports.createControlsHoverDecoration = func
|
|
|
111
114
|
key = _types.TableDecorations.TABLE_CONTROLS_HOVER;
|
|
112
115
|
break;
|
|
113
116
|
}
|
|
114
|
-
return _view.Decoration.node(pos,
|
|
117
|
+
return _view.Decoration.node(pos,
|
|
118
|
+
// Ignored via go/ees005
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
120
|
+
pos + cell.nodeSize, {
|
|
115
121
|
class: classes.join(' ')
|
|
116
122
|
}, {
|
|
117
123
|
key: key
|
|
@@ -130,7 +136,10 @@ var createColumnSelectedDecoration = exports.createColumnSelectedDecoration = fu
|
|
|
130
136
|
var cellPositions = map.cellsInRect(rect);
|
|
131
137
|
return cellPositions.map(function (pos, index) {
|
|
132
138
|
var cell = doc.nodeAt(pos + table.start);
|
|
133
|
-
return _view.Decoration.node(pos + table.start,
|
|
139
|
+
return _view.Decoration.node(pos + table.start,
|
|
140
|
+
// Ignored via go/ees005
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
142
|
+
pos + table.start + cell.nodeSize, {
|
|
134
143
|
class: _types.TableCssClassName.COLUMN_SELECTED
|
|
135
144
|
}, {
|
|
136
145
|
key: "".concat(_types.TableDecorations.COLUMN_SELECTED, "_").concat(index)
|
|
@@ -162,7 +171,10 @@ var createColumnControlsDecoration = exports.createColumnControlsDecoration = fu
|
|
|
162
171
|
});
|
|
163
172
|
});
|
|
164
173
|
};
|
|
165
|
-
var updateDecorations = exports.updateDecorations = function updateDecorations(node, decorationSet, decorations, key
|
|
174
|
+
var updateDecorations = exports.updateDecorations = function updateDecorations(node, decorationSet, decorations, key
|
|
175
|
+
// Ignored via go/ees005
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
177
|
+
) {
|
|
166
178
|
var filteredDecorations = filterDecorationByKey(key, decorationSet);
|
|
167
179
|
var decorationSetFiltered = decorationSet.remove(filteredDecorations);
|
|
168
180
|
return decorationSetFiltered.add(node, decorations);
|
|
@@ -253,7 +265,10 @@ var makeArray = function makeArray(n) {
|
|
|
253
265
|
var createResizeHandleDecoration = exports.createResizeHandleDecoration = function createResizeHandleDecoration(tr, rowIndexTarget, columnEndIndexTarget) {
|
|
254
266
|
var includeTooltip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
255
267
|
var getIntl = arguments.length > 4 ? arguments[4] : undefined;
|
|
256
|
-
var nodeViewPortalProviderAPI
|
|
268
|
+
var nodeViewPortalProviderAPI
|
|
269
|
+
// Ignored via go/ees005
|
|
270
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
271
|
+
= arguments.length > 5 ? arguments[5] : undefined;
|
|
257
272
|
var emptyResult = [[], []];
|
|
258
273
|
var table = (0, _utils2.findTable)(tr.selection);
|
|
259
274
|
if (!table || !table.node) {
|
|
@@ -263,7 +278,10 @@ var createResizeHandleDecoration = exports.createResizeHandleDecoration = functi
|
|
|
263
278
|
if (!map.width) {
|
|
264
279
|
return emptyResult;
|
|
265
280
|
}
|
|
266
|
-
var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode
|
|
281
|
+
var createResizerHandleDecoration = function createResizerHandleDecoration(cellColumnPositioning, columnIndex, rowIndex, cellPos, cellNode
|
|
282
|
+
// Ignored via go/ees005
|
|
283
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
284
|
+
) {
|
|
267
285
|
var decorationRenderKey = (0, _v.default)();
|
|
268
286
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
269
287
|
return _view.Decoration.widget(position, function () {
|
|
@@ -195,7 +195,11 @@ var findNearestCellIndexToPoint = exports.findNearestCellIndexToPoint = function
|
|
|
195
195
|
return undefined;
|
|
196
196
|
}
|
|
197
197
|
return {
|
|
198
|
+
// Ignored via go/ees005
|
|
199
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
198
200
|
row: row.rowIndex,
|
|
201
|
+
// Ignored via go/ees005
|
|
202
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
199
203
|
col: cell.cellIndex
|
|
200
204
|
};
|
|
201
205
|
};
|