@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
|
@@ -26,13 +26,15 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
26
26
|
var _commandsWithAnalytics = require("../pm-plugins/commands/commands-with-analytics");
|
|
27
27
|
var _misc = require("../pm-plugins/commands/misc");
|
|
28
28
|
var _tableAnalytics = require("../pm-plugins/table-analytics");
|
|
29
|
-
var
|
|
29
|
+
var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
|
|
30
|
+
var _consts = require("../pm-plugins/table-resizing/utils/consts");
|
|
31
|
+
var _scaleTable = require("../pm-plugins/table-resizing/utils/scale-table");
|
|
30
32
|
var _tableWidth = require("../pm-plugins/table-width");
|
|
31
33
|
var _alignment = require("../pm-plugins/utils/alignment");
|
|
32
34
|
var _analytics2 = require("../pm-plugins/utils/analytics");
|
|
33
35
|
var _guidelines = require("../pm-plugins/utils/guidelines");
|
|
34
36
|
var _snapping = require("../pm-plugins/utils/snapping");
|
|
35
|
-
var
|
|
37
|
+
var _consts2 = require("../ui/consts");
|
|
36
38
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
37
39
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
38
40
|
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; }
|
|
@@ -68,8 +70,8 @@ var getResizerHandleHeight = function getResizerHandleHeight(tableRef) {
|
|
|
68
70
|
return 'small';
|
|
69
71
|
};
|
|
70
72
|
var getResizerMinWidth = function getResizerMinWidth(node) {
|
|
71
|
-
var currentColumnCount = (0,
|
|
72
|
-
var minColumnWidth = Math.min(3, currentColumnCount) *
|
|
73
|
+
var currentColumnCount = (0, _colgroup.getColgroupChildrenLength)(node);
|
|
74
|
+
var minColumnWidth = Math.min(3, currentColumnCount) * _consts.COLUMN_MIN_WIDTH;
|
|
73
75
|
// add an extra pixel as the scale table logic will scale columns to be tableContainerWidth - 1
|
|
74
76
|
// the table can't scale past its min-width, so instead restrict table container min width to avoid that situation
|
|
75
77
|
return minColumnWidth + 1;
|
|
@@ -84,8 +86,11 @@ var getResizerMinWidth = function getResizerMinWidth(node) {
|
|
|
84
86
|
* @param isTableScalingEnabled
|
|
85
87
|
* @param isFullWidthModeEnabled
|
|
86
88
|
*/
|
|
87
|
-
var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWidth, lineLength, isTableScalingEnabled, isFullWidthModeEnabled
|
|
88
|
-
|
|
89
|
+
var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWidth, lineLength, isTableScalingEnabled, isFullWidthModeEnabled
|
|
90
|
+
// Ignored via go/ees005
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
92
|
+
) {
|
|
93
|
+
var guidelineVisibleAdjustment = _consts2.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT;
|
|
89
94
|
if (isTableScalingEnabled) {
|
|
90
95
|
// Notes:
|
|
91
96
|
// Example: containerWidth = 1244, lineLength = 1180 (used for when editor full width mode is enabled)
|
|
@@ -186,7 +191,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
186
191
|
if (gap !== currentGap.current) {
|
|
187
192
|
currentGap.current = gap;
|
|
188
193
|
var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, isFullWidthModeEnabled ? lineLength + 2 * (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() : containerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, containerWidth, lineLength, Boolean(isTableScalingEnabled), Boolean(isFullWidthModeEnabled));
|
|
189
|
-
displayGuideline((0, _guideline.getGuidelinesWithHighlights)(gap,
|
|
194
|
+
displayGuideline((0, _guideline.getGuidelinesWithHighlights)(gap, _consts2.TABLE_SNAP_GAP, keys, visibleGuidelines));
|
|
190
195
|
}
|
|
191
196
|
}, [isTableScalingEnabled, excludeGuidelineConfig, containerWidth, displayGuideline, lineLength, isFullWidthModeEnabled]);
|
|
192
197
|
var guidelineSnaps = (0, _react.useMemo)(function () {
|
|
@@ -196,7 +201,10 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
196
201
|
isFullWidthModeEnabled ? lineLength + 2 * (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() : containerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths
|
|
197
202
|
} : undefined;
|
|
198
203
|
}, [snappingEnabled, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, lineLength, isFullWidthModeEnabled]);
|
|
199
|
-
var switchToCenterAlignment = (0, _react.useCallback)(function (pos, node, newWidth, state, dispatch
|
|
204
|
+
var switchToCenterAlignment = (0, _react.useCallback)(function (pos, node, newWidth, state, dispatch
|
|
205
|
+
// Ignored via go/ees005
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
207
|
+
) {
|
|
200
208
|
if ((0, _alignment.shouldChangeAlignmentToCenterResized)(isTableAlignmentEnabled, node, lineLength, newWidth) && isResizing.current) {
|
|
201
209
|
var _pluginInjectionApi$a;
|
|
202
210
|
var tableNodeWithPos = {
|
|
@@ -248,7 +256,10 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
248
256
|
onResizeStart();
|
|
249
257
|
}
|
|
250
258
|
}, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, lineLength, displayGuideline, onResizeStart, isFullWidthModeEnabled]);
|
|
251
|
-
var handleResize = (0, _react.useCallback)(
|
|
259
|
+
var handleResize = (0, _react.useCallback)(
|
|
260
|
+
// Ignored via go/ees005
|
|
261
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
262
|
+
function (originalState, delta) {
|
|
252
263
|
var _node$attrs$localId, _node$attrs;
|
|
253
264
|
countFrames();
|
|
254
265
|
var newWidth = originalState.width + delta.width;
|
|
@@ -262,7 +273,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
262
273
|
return;
|
|
263
274
|
}
|
|
264
275
|
var editorContainerWidth = isFullWidthModeEnabled ? lineLength + 2 * (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() : containerWidth;
|
|
265
|
-
var closestSnap = !isCommentEditor && (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(_snapping.PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines,
|
|
276
|
+
var closestSnap = !isCommentEditor && (0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(_snapping.PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, editorContainerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, _consts2.TABLE_HIGHLIGHT_GAP, _consts2.TABLE_HIGHLIGHT_TOLERANCE);
|
|
266
277
|
closestSnap && updateActiveGuidelines(closestSnap);
|
|
267
278
|
|
|
268
279
|
// When snapping to the full width guideline, resize the table to be 1800px
|
|
@@ -273,10 +284,10 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
273
284
|
return guideline.isFullWidth;
|
|
274
285
|
})[0];
|
|
275
286
|
var isFullWidthGuidelineActive = closestSnap && closestSnap.keys.includes(fullWidthGuideline.key);
|
|
276
|
-
var tableMaxWidth = isCommentEditor ? Math.floor(containerWidth -
|
|
287
|
+
var tableMaxWidth = isCommentEditor ? Math.floor(containerWidth - _consts.TABLE_OFFSET_IN_COMMENT_EDITOR) : _consts.TABLE_MAX_WIDTH;
|
|
277
288
|
var shouldUpdateWidthToWidest = isCommentEditor ? tableMaxWidth <= newWidth : !!isTableScalingEnabled && isFullWidthGuidelineActive;
|
|
278
289
|
var previewParentWidth = isCommentEditor && shouldUpdateWidthToWidest ? tableMaxWidth : newWidth;
|
|
279
|
-
(0,
|
|
290
|
+
(0, _scaleTable.previewScaleTable)(tableRef, {
|
|
280
291
|
node: node,
|
|
281
292
|
prevNode: node,
|
|
282
293
|
start: pos + 1,
|
|
@@ -301,7 +312,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
301
312
|
var pos = getPos();
|
|
302
313
|
var currentTableNodeLocalId = (_node$attrs$localId2 = node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) !== null && _node$attrs$localId2 !== void 0 ? _node$attrs$localId2 : '';
|
|
303
314
|
var tableMaxWidth = isCommentEditor ? undefined // Table's full-width in comment appearance inherit the width of the Editor/Renderer
|
|
304
|
-
:
|
|
315
|
+
: _consts.TABLE_MAX_WIDTH;
|
|
305
316
|
newWidth = widthToWidest && currentTableNodeLocalId && widthToWidest[currentTableNodeLocalId] ? tableMaxWidth : newWidth;
|
|
306
317
|
var tr = state.tr.setMeta(_tableWidth.pluginKey, {
|
|
307
318
|
resizing: false,
|
|
@@ -333,8 +344,11 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
333
344
|
width: newWidth
|
|
334
345
|
}));
|
|
335
346
|
}
|
|
347
|
+
|
|
348
|
+
// Ignored via go/ees005
|
|
349
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
336
350
|
var newNode = tr.doc.nodeAt(pos);
|
|
337
|
-
tr = (0,
|
|
351
|
+
tr = (0, _scaleTable.scaleTable)(tableRef, {
|
|
338
352
|
node: newNode,
|
|
339
353
|
prevNode: node,
|
|
340
354
|
start: pos + 1,
|
|
@@ -343,6 +357,9 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
343
357
|
// scaleTable function needs number value to work correctly.
|
|
344
358
|
parentWidth: isCommentEditor ? originalNewWidth : newWidth
|
|
345
359
|
}, editorView.domAtPos.bind(editorView), pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent || false, isCommentEditor)(tr);
|
|
360
|
+
|
|
361
|
+
// Ignored via go/ees005
|
|
362
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
346
363
|
var scaledNode = tr.doc.nodeAt(pos);
|
|
347
364
|
(_attachAnalyticsEvent2 = attachAnalyticsEvent((0, _analytics2.generateResizedPayload)({
|
|
348
365
|
originalNode: node,
|
|
@@ -435,12 +452,24 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
435
452
|
}
|
|
436
453
|
};
|
|
437
454
|
var editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
|
|
455
|
+
// Ignored via go/ees005
|
|
456
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
438
457
|
editorViewDom === null || editorViewDom === void 0 || editorViewDom.addEventListener('keydown', globalKeyDownHandler);
|
|
458
|
+
// Ignored via go/ees005
|
|
459
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
439
460
|
resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keydown', handleKeyDown);
|
|
461
|
+
// Ignored via go/ees005
|
|
462
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
440
463
|
resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.addEventListener('keyup', handleKeyUp);
|
|
441
464
|
return function () {
|
|
465
|
+
// Ignored via go/ees005
|
|
466
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
442
467
|
editorViewDom === null || editorViewDom === void 0 || editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
|
|
468
|
+
// Ignored via go/ees005
|
|
469
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
443
470
|
resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keydown', handleKeyDown);
|
|
471
|
+
// Ignored via go/ees005
|
|
472
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
444
473
|
resizeHandleThumbEl === null || resizeHandleThumbEl === void 0 || resizeHandleThumbEl.removeEventListener('keyup', handleKeyUp);
|
|
445
474
|
};
|
|
446
475
|
}, [resizerRef, editorView, handleResizeStop, isTableSelected, handleKeyDown, handleKeyUp]);
|
|
@@ -462,7 +491,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
462
491
|
resizeRatio: resizeRatio,
|
|
463
492
|
minWidth: resizerMinWidth,
|
|
464
493
|
maxWidth: maxWidth,
|
|
465
|
-
snapGap:
|
|
494
|
+
snapGap: _consts2.TABLE_SNAP_GAP,
|
|
466
495
|
snap: guidelineSnaps,
|
|
467
496
|
handlePositioning: "adjacent",
|
|
468
497
|
isHandleVisible: isTableSelected,
|
|
@@ -33,6 +33,8 @@ var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
|
|
|
33
33
|
// if too short it would trigger too many dom updates.
|
|
34
34
|
var HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT = 400;
|
|
35
35
|
var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
36
38
|
function TableRow(node, view, getPos, eventDispatcher) {
|
|
37
39
|
var _this;
|
|
38
40
|
(0, _classCallCheck2.default)(this, TableRow);
|
|
@@ -95,6 +97,8 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
95
97
|
/**
|
|
96
98
|
* Methods: Nodeview Lifecycle
|
|
97
99
|
*/
|
|
100
|
+
// Ignored via go/ees005
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
102
|
function update(node) {
|
|
99
103
|
// do nothing if nodes were identical
|
|
100
104
|
if (node === this.node) {
|
|
@@ -164,17 +168,27 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
164
168
|
}, {
|
|
165
169
|
key: "subscribe",
|
|
166
170
|
value: function subscribe() {
|
|
171
|
+
// Ignored via go/ees005
|
|
172
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
167
173
|
this.editorScrollableElement = (0, _ui.findOverflowScrollParent)(this.view.dom) || window;
|
|
168
174
|
if (this.editorScrollableElement) {
|
|
169
175
|
this.initObservers();
|
|
170
176
|
this.topPosEditorElement = (0, _dom2.getTop)(this.editorScrollableElement);
|
|
171
177
|
}
|
|
172
178
|
this.eventDispatcher.on('widthPlugin', this.updateStickyHeaderWidth.bind(this));
|
|
179
|
+
|
|
180
|
+
// Ignored via go/ees005
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
173
182
|
this.eventDispatcher.on(_pluginKey.pluginKey.key, this.onTablePluginState.bind(this));
|
|
174
183
|
this.listening = true;
|
|
184
|
+
|
|
185
|
+
// Ignored via go/ees005
|
|
186
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
175
187
|
this.dom.addEventListener('wheel', this.headerRowMouseScroll.bind(this), {
|
|
176
188
|
passive: true
|
|
177
189
|
});
|
|
190
|
+
// Ignored via go/ees005
|
|
191
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
178
192
|
this.dom.addEventListener('touchmove', this.headerRowMouseScroll.bind(this), {
|
|
179
193
|
passive: true
|
|
180
194
|
});
|
|
@@ -199,9 +213,16 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
199
213
|
this.resizeObserver.disconnect();
|
|
200
214
|
}
|
|
201
215
|
this.eventDispatcher.off('widthPlugin', this.updateStickyHeaderWidth);
|
|
216
|
+
// Ignored via go/ees005
|
|
217
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
202
218
|
this.eventDispatcher.off(_pluginKey.pluginKey.key, this.onTablePluginState);
|
|
203
219
|
this.listening = false;
|
|
220
|
+
|
|
221
|
+
// Ignored via go/ees005
|
|
222
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
204
223
|
this.dom.removeEventListener('wheel', this.headerRowMouseScroll);
|
|
224
|
+
// Ignored via go/ees005
|
|
225
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
205
226
|
this.dom.removeEventListener('touchmove', this.headerRowMouseScroll);
|
|
206
227
|
}
|
|
207
228
|
|
|
@@ -221,6 +242,8 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
221
242
|
}
|
|
222
243
|
this.resizeObserver.observe(this.dom);
|
|
223
244
|
if (this.editorScrollableElement) {
|
|
245
|
+
// Ignored via go/ees005
|
|
246
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
224
247
|
this.resizeObserver.observe(this.editorScrollableElement);
|
|
225
248
|
}
|
|
226
249
|
window.requestAnimationFrame(function () {
|
|
@@ -228,12 +251,18 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
228
251
|
// we expect tree to be defined after animation frame
|
|
229
252
|
var tableContainer = (_getTree = (0, _dom2.getTree)(_this2.dom)) === null || _getTree === void 0 ? void 0 : _getTree.wrapper.closest(".".concat(_types.TableCssClassName.NODEVIEW_WRAPPER));
|
|
230
253
|
if (tableContainer) {
|
|
254
|
+
// Ignored via go/ees005
|
|
255
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
231
256
|
_this2.sentinels.top = tableContainer.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP).item(0);
|
|
257
|
+
// Ignored via go/ees005
|
|
258
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
232
259
|
_this2.sentinels.bottom = tableContainer.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM).item(0);
|
|
233
260
|
[_this2.sentinels.top, _this2.sentinels.bottom].forEach(function (el) {
|
|
234
261
|
// skip if already observed for another row on this table
|
|
235
262
|
if (el && !el.dataset.isObserved) {
|
|
236
263
|
el.dataset.isObserved = 'true';
|
|
264
|
+
// Ignored via go/ees005
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
237
266
|
_this2.intersectionObserver.observe(el);
|
|
238
267
|
}
|
|
239
268
|
});
|
|
@@ -257,10 +286,15 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
257
286
|
var _this3$editorScrollab;
|
|
258
287
|
// On resize of the parent scroll element we need to adjust the width
|
|
259
288
|
// of the sticky header
|
|
289
|
+
// Ignored via go/ees005
|
|
290
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
260
291
|
if (entry.target.className === ((_this3$editorScrollab = _this3.editorScrollableElement) === null || _this3$editorScrollab === void 0 ? void 0 : _this3$editorScrollab.className)) {
|
|
261
292
|
_this3.updateStickyHeaderWidth();
|
|
262
293
|
} else {
|
|
263
|
-
var newHeight = entry.contentRect ? entry.contentRect.height :
|
|
294
|
+
var newHeight = entry.contentRect ? entry.contentRect.height :
|
|
295
|
+
// Ignored via go/ees005
|
|
296
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
297
|
+
entry.target.offsetHeight;
|
|
264
298
|
if (_this3.sentinels.bottom &&
|
|
265
299
|
// When the table header is sticky, it would be taller by a 1px (border-bottom),
|
|
266
300
|
// So we adding this check to allow a 1px difference.
|
|
@@ -409,11 +443,15 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
409
443
|
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
410
444
|
// move table a little out of the way
|
|
411
445
|
// to provide spacing for table controls
|
|
446
|
+
// Ignored via go/ees005
|
|
447
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
412
448
|
tableContentWrapper.style.paddingLeft = '11px';
|
|
413
449
|
}
|
|
414
450
|
} else {
|
|
415
451
|
this.colControlsOffset = 0;
|
|
416
452
|
if (layoutContainer && layoutContainer.getAttribute('data-layout-content')) {
|
|
453
|
+
// Ignored via go/ees005
|
|
454
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
417
455
|
tableContentWrapper.style.removeProperty('padding-left');
|
|
418
456
|
}
|
|
419
457
|
}
|
|
@@ -486,6 +524,8 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
486
524
|
* detaches from the table. This typically happens during a fast scroll by the user which causes
|
|
487
525
|
* the intersection observer logic to not fire as expected.
|
|
488
526
|
*/
|
|
527
|
+
// Ignored via go/ees005
|
|
528
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
489
529
|
(_this$editorScrollabl = this.editorScrollableElement) === null || _this$editorScrollabl === void 0 || _this$editorScrollabl.addEventListener('scrollend', this.refireIntersectionObservers, {
|
|
490
530
|
passive: true,
|
|
491
531
|
once: true
|
|
@@ -553,6 +593,8 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
553
593
|
}
|
|
554
594
|
this.top = top;
|
|
555
595
|
this.padding = padding;
|
|
596
|
+
// Ignored via go/ees005
|
|
597
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
556
598
|
var pos = this.getPos();
|
|
557
599
|
if (Number.isFinite(pos)) {
|
|
558
600
|
(0, _commands.updateStickyState)({
|
|
@@ -571,6 +613,8 @@ var TableRow = exports.default = /*#__PURE__*/function (_TableNodeView) {
|
|
|
571
613
|
}
|
|
572
614
|
this.top = 0;
|
|
573
615
|
this.padding = 0;
|
|
616
|
+
// Ignored via go/ees005
|
|
617
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
574
618
|
var pos = this.getPos();
|
|
575
619
|
if (!isEditorDestroyed && Number.isFinite(pos)) {
|
|
576
620
|
(0, _commands.updateStickyState)({
|
|
@@ -36,6 +36,8 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
36
36
|
key: "dispose",
|
|
37
37
|
value: function dispose() {
|
|
38
38
|
if (this.stickyScrollbarContainerElement) {
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
39
41
|
this.stickyScrollbarContainerElement.removeEventListener('scroll', this.handleScroll);
|
|
40
42
|
}
|
|
41
43
|
this.deleteIntersectionObserver();
|
|
@@ -56,6 +58,8 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
56
58
|
}
|
|
57
59
|
this.stickyScrollbarContainerElement = (_this$wrapper$parentE = this.wrapper.parentElement) === null || _this$wrapper$parentE === void 0 ? void 0 : _this$wrapper$parentE.querySelector(".".concat(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER));
|
|
58
60
|
if (this.stickyScrollbarContainerElement) {
|
|
61
|
+
// Ignored via go/ees005
|
|
62
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
59
63
|
this.stickyScrollbarContainerElement.addEventListener('scroll', this.handleScroll, {
|
|
60
64
|
passive: true
|
|
61
65
|
});
|
|
@@ -68,7 +72,10 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
68
72
|
var _this2 = this,
|
|
69
73
|
_this$wrapper,
|
|
70
74
|
_this$wrapper2;
|
|
71
|
-
this.editorScrollableElement =
|
|
75
|
+
this.editorScrollableElement =
|
|
76
|
+
// Ignored via go/ees005
|
|
77
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
78
|
+
(0, _ui.findOverflowScrollParent)(this.view.dom) || window.document;
|
|
72
79
|
if (!this.editorScrollableElement || !this.wrapper) {
|
|
73
80
|
return;
|
|
74
81
|
}
|
|
@@ -78,6 +85,8 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
78
85
|
}
|
|
79
86
|
entries.forEach(function (entry) {
|
|
80
87
|
var _entry$rootBounds;
|
|
88
|
+
// Ignored via go/ees005
|
|
89
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
81
90
|
var target = entry.target;
|
|
82
91
|
// if the rootBounds has 0 height, e.g. confluence preview mode, we do nothing.
|
|
83
92
|
if (((_entry$rootBounds = entry.rootBounds) === null || _entry$rootBounds === void 0 ? void 0 : _entry$rootBounds.height) === 0) {
|
|
@@ -93,10 +102,20 @@ var TableStickyScrollbar = exports.TableStickyScrollbar = /*#__PURE__*/function
|
|
|
93
102
|
}, {
|
|
94
103
|
root: this.editorScrollableElement
|
|
95
104
|
});
|
|
105
|
+
|
|
106
|
+
// Ignored via go/ees005
|
|
107
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
96
108
|
this.sentinels.bottom = (_this$wrapper = this.wrapper) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.parentElement) === null || _this$wrapper === void 0 || (_this$wrapper = _this$wrapper.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM)) === null || _this$wrapper === void 0 ? void 0 : _this$wrapper.item(0);
|
|
109
|
+
|
|
110
|
+
// Ignored via go/ees005
|
|
111
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
97
112
|
this.sentinels.top = (_this$wrapper2 = this.wrapper) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.parentElement) === null || _this$wrapper2 === void 0 || (_this$wrapper2 = _this$wrapper2.getElementsByClassName(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP)) === null || _this$wrapper2 === void 0 ? void 0 : _this$wrapper2.item(0);
|
|
98
113
|
[this.sentinels.bottom, this.sentinels.top].forEach(function (el) {
|
|
99
|
-
return
|
|
114
|
+
return (
|
|
115
|
+
// Ignored via go/ees005
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
117
|
+
_this2.intersectionObserver.observe(el)
|
|
118
|
+
);
|
|
100
119
|
});
|
|
101
120
|
}
|
|
102
121
|
}, {
|
|
@@ -25,7 +25,10 @@ var lazyTableView = exports.lazyTableView = function lazyTableView(options) {
|
|
|
25
25
|
'./table'));
|
|
26
26
|
}).then(function (_ref) {
|
|
27
27
|
var createTableView = _ref.createTableView;
|
|
28
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
28
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
31
|
+
) {
|
|
29
32
|
var _getNodeViewOptions = getNodeViewOptions(),
|
|
30
33
|
portalProviderAPI = _getNodeViewOptions.portalProviderAPI,
|
|
31
34
|
eventDispatcher = _getNodeViewOptions.eventDispatcher,
|
|
@@ -61,7 +64,10 @@ var lazyTableCellView = exports.lazyTableCellView = function lazyTableCellView(o
|
|
|
61
64
|
'./TableCell'));
|
|
62
65
|
}).then(function (_ref2) {
|
|
63
66
|
var TableCell = _ref2.default;
|
|
64
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
67
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
68
|
+
// Ignored via go/ees005
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
70
|
+
) {
|
|
65
71
|
var _pluginInjectionApi$a;
|
|
66
72
|
var _getNodeViewOptions2 = getNodeViewOptions(),
|
|
67
73
|
eventDispatcher = _getNodeViewOptions2.eventDispatcher,
|
|
@@ -92,7 +98,10 @@ var lazyTableHeaderView = exports.lazyTableHeaderView = function lazyTableHeader
|
|
|
92
98
|
'./TableCell'));
|
|
93
99
|
}).then(function (_ref3) {
|
|
94
100
|
var TableCell = _ref3.default;
|
|
95
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
101
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
102
|
+
// Ignored via go/ees005
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
104
|
+
) {
|
|
96
105
|
var _pluginInjectionApi$a2;
|
|
97
106
|
var _getNodeViewOptions3 = getNodeViewOptions(),
|
|
98
107
|
eventDispatcher = _getNodeViewOptions3.eventDispatcher,
|
|
@@ -122,7 +131,10 @@ var lazyTableRowView = exports.lazyTableRowView = function lazyTableRowView(opti
|
|
|
122
131
|
'./TableRow'));
|
|
123
132
|
}).then(function (_ref4) {
|
|
124
133
|
var TableRow = _ref4.default;
|
|
125
|
-
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
134
|
+
return function (node, view, getPos, decorations, getNodeViewOptions
|
|
135
|
+
// Ignored via go/ees005
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
137
|
+
) {
|
|
126
138
|
var _getNodeViewOptions4 = getNodeViewOptions(),
|
|
127
139
|
eventDispatcher = _getNodeViewOptions4.eventDispatcher;
|
|
128
140
|
return new TableRow(node, view, getPos, eventDispatcher);
|
|
@@ -24,13 +24,13 @@ var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
|
24
24
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
25
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
26
26
|
var _createPluginConfig = require("../pm-plugins/create-plugin-config");
|
|
27
|
-
var
|
|
27
|
+
var _pluginKey = require("../pm-plugins/drag-and-drop/plugin-key");
|
|
28
28
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
29
|
+
var _pluginKey2 = require("../pm-plugins/plugin-key");
|
|
30
|
+
var _pluginKey3 = require("../pm-plugins/table-resizing/plugin-key");
|
|
31
|
+
var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
|
|
32
32
|
var _tableWidth = require("../pm-plugins/table-width");
|
|
33
|
-
var
|
|
33
|
+
var _nodes = require("../pm-plugins/utils/nodes");
|
|
34
34
|
var _TableComponent = _interopRequireDefault(require("./TableComponent"));
|
|
35
35
|
var _TableComponentWithSharedState = require("./TableComponentWithSharedState");
|
|
36
36
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -46,7 +46,10 @@ var tableAttributes = function tableAttributes(node) {
|
|
|
46
46
|
'data-table-display-mode': node.attrs.displayMode
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
|
-
var getInlineWidth = function getInlineWidth(node, options, state, pos, allowTableResizing
|
|
49
|
+
var getInlineWidth = function getInlineWidth(node, options, state, pos, allowTableResizing
|
|
50
|
+
// Ignored via go/ees005
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
52
|
+
) {
|
|
50
53
|
if (!node.attrs.width && options !== null && options !== void 0 && options.isCommentEditor && allowTableResizing) {
|
|
51
54
|
return;
|
|
52
55
|
}
|
|
@@ -54,7 +57,7 @@ var getInlineWidth = function getInlineWidth(node, options, state, pos, allowTab
|
|
|
54
57
|
// provide a width for tables when custom table width is supported
|
|
55
58
|
// this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
|
|
56
59
|
// support screen size adjustments
|
|
57
|
-
var shouldHaveInlineWidth = allowTableResizing && !(0,
|
|
60
|
+
var shouldHaveInlineWidth = allowTableResizing && !(0, _nodes.isTableNested)(state, pos);
|
|
58
61
|
var widthValue = (0, _nodeWidth.getTableContainerWidth)(node);
|
|
59
62
|
if (node.attrs.isNumberColumnEnabled) {
|
|
60
63
|
widthValue -= _editorSharedStyles.akEditorTableNumberColumnWidth;
|
|
@@ -70,7 +73,7 @@ var handleInlineTableWidth = function handleInlineTableWidth(table, width) {
|
|
|
70
73
|
var toDOM = function toDOM(node, props) {
|
|
71
74
|
var colgroup = '';
|
|
72
75
|
if (props.allowColumnResizing) {
|
|
73
|
-
colgroup = ['colgroup', {}].concat((0, _toConsumableArray2.default)((0,
|
|
76
|
+
colgroup = ['colgroup', {}].concat((0, _toConsumableArray2.default)((0, _colgroup.generateColgroup)(node)));
|
|
74
77
|
}
|
|
75
78
|
return ['table', tableAttributes(node), colgroup, ['tbody', 0]];
|
|
76
79
|
};
|
|
@@ -118,6 +121,8 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
118
121
|
}
|
|
119
122
|
var attrs = tableAttributes(node);
|
|
120
123
|
Object.keys(attrs).forEach(function (attr) {
|
|
124
|
+
// Ignored via go/ees005
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
121
126
|
_this2.table.setAttribute(attr, attrs[attr]);
|
|
122
127
|
});
|
|
123
128
|
|
|
@@ -160,6 +165,8 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
160
165
|
var fakePluginKey = {
|
|
161
166
|
key: 'widthPlugin$',
|
|
162
167
|
getState: function getState(state) {
|
|
168
|
+
// Ignored via go/ees005
|
|
169
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
163
170
|
return state['widthPlugin$'];
|
|
164
171
|
}
|
|
165
172
|
};
|
|
@@ -170,17 +177,19 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
170
177
|
var fakeMediaPluginKey = {
|
|
171
178
|
key: 'mediaPlugin$',
|
|
172
179
|
getState: function getState(state) {
|
|
180
|
+
// Ignored via go/ees005
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
173
182
|
return state['mediaPlugin$'];
|
|
174
183
|
}
|
|
175
184
|
};
|
|
176
185
|
return /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
|
|
177
186
|
plugins: {
|
|
178
|
-
pluginState:
|
|
179
|
-
tableResizingPluginState:
|
|
187
|
+
pluginState: _pluginKey2.pluginKey,
|
|
188
|
+
tableResizingPluginState: _pluginKey3.pluginKey,
|
|
180
189
|
tableWidthPluginState: _tableWidth.pluginKey,
|
|
181
190
|
widthPlugin: fakePluginKey,
|
|
182
191
|
mediaState: fakeMediaPluginKey,
|
|
183
|
-
tableDragAndDropState:
|
|
192
|
+
tableDragAndDropState: _pluginKey.pluginKey
|
|
184
193
|
},
|
|
185
194
|
editorView: props.view,
|
|
186
195
|
render: function render(pluginStates) {
|
|
@@ -204,6 +213,9 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
204
213
|
} catch (e) {
|
|
205
214
|
tablePos = undefined;
|
|
206
215
|
}
|
|
216
|
+
|
|
217
|
+
// Ignored via go/ees005
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
207
219
|
var tableActive = tablePos === pluginState.tablePos && !isTableResizing;
|
|
208
220
|
return /*#__PURE__*/_react.default.createElement(_TableComponent.default, {
|
|
209
221
|
view: props.view,
|
|
@@ -211,19 +223,39 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
211
223
|
eventDispatcher: props.eventDispatcher,
|
|
212
224
|
getPos: props.getPos,
|
|
213
225
|
isMediaFullscreen: mediaState === null || mediaState === void 0 ? void 0 : mediaState.isFullscreen,
|
|
214
|
-
options: props.options
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
226
|
+
options: props.options
|
|
227
|
+
// Ignored via go/ees005
|
|
228
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
229
|
+
// Ignored via go/ees005
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
231
|
+
,
|
|
232
|
+
allowControls: pluginState.pluginConfig.allowControls
|
|
233
|
+
// Ignored via go/ees005
|
|
234
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
235
|
+
,
|
|
236
|
+
isHeaderRowEnabled: pluginState.isHeaderRowEnabled
|
|
237
|
+
// Ignored via go/ees005
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
239
|
+
,
|
|
240
|
+
isHeaderColumnEnabled: pluginState.isHeaderColumnEnabled
|
|
241
|
+
// Ignored via go/ees005
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
243
|
+
,
|
|
218
244
|
isDragAndDropEnabled: pluginState.isDragAndDropEnabled,
|
|
219
245
|
isTableScalingEnabled: (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.isTableScalingEnabled // this.options?.isTableScalingEnabled same as TableOptions.isTableScalingEnabled same as pluginState.isTableScalingEnabled
|
|
220
246
|
,
|
|
221
247
|
allowTableAlignment: props.allowTableAlignment,
|
|
222
248
|
allowTableResizing: props.allowTableResizing,
|
|
223
|
-
tableActive: tableActive
|
|
249
|
+
tableActive: tableActive
|
|
250
|
+
// Ignored via go/ees005
|
|
251
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
252
|
+
,
|
|
224
253
|
ordering: pluginState.ordering,
|
|
225
254
|
isResizing: isResizing,
|
|
226
|
-
getNode: _this3.getNode
|
|
255
|
+
getNode: _this3.getNode
|
|
256
|
+
// Ignored via go/ees005
|
|
257
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
258
|
+
,
|
|
227
259
|
containerWidth: containerWidth,
|
|
228
260
|
contentDOM: forwardRef,
|
|
229
261
|
getEditorFeatureFlags: props.getEditorFeatureFlags,
|
|
@@ -295,7 +327,10 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
295
327
|
}
|
|
296
328
|
}]);
|
|
297
329
|
}(_reactNodeView.default);
|
|
298
|
-
var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor
|
|
330
|
+
var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor
|
|
331
|
+
// Ignored via go/ees005
|
|
332
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
333
|
+
) {
|
|
299
334
|
var _pluginInjectionApi$t;
|
|
300
335
|
var _getPluginState2 = (0, _pluginFactory.getPluginState)(view.state),
|
|
301
336
|
pluginConfig = _getPluginState2.pluginConfig,
|
|
@@ -11,13 +11,19 @@ var clearMultipleCells = exports.clearMultipleCells = function clearMultipleCell
|
|
|
11
11
|
var cursorPos;
|
|
12
12
|
var tr = state.tr;
|
|
13
13
|
if ((0, _utils.isSelectionType)(tr.selection, 'cell')) {
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
16
|
var selection = tr.selection;
|
|
15
17
|
selection.forEachCell(function (_node, pos) {
|
|
16
18
|
var $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
17
21
|
tr = (0, _utils.emptyCell)((0, _utils.findCellClosestToPos)($pos), state.schema)(tr);
|
|
18
22
|
});
|
|
19
23
|
cursorPos = selection.$headCell.pos;
|
|
20
24
|
} else if (targetCellPosition) {
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
27
|
var cell = (0, _utils.findCellClosestToPos)(tr.doc.resolve(targetCellPosition + 1));
|
|
22
28
|
tr = (0, _utils.emptyCell)(cell, state.schema)(tr);
|
|
23
29
|
cursorPos = cell.pos;
|