@atlaskit/editor-plugin-table 38.0.4 → 38.0.6
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 +12 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -2
- package/dist/cjs/nodeviews/TableCell.js +5 -4
- package/dist/cjs/nodeviews/TableComponent.js +6 -6
- package/dist/cjs/nodeviews/TableComponentWithSharedState.js +2 -2
- package/dist/cjs/nodeviews/TableContainer.js +12 -11
- package/dist/cjs/nodeviews/TableResizer.js +27 -26
- package/dist/cjs/nodeviews/TableRow.js +4 -4
- package/dist/cjs/nodeviews/TableRowNativeStickyWithFallback.js +13 -12
- package/dist/cjs/nodeviews/TableSSRReactContextsProvider.js +2 -2
- package/dist/cjs/nodeviews/TableStickyScrollbar.js +2 -2
- package/dist/cjs/nodeviews/table.js +4 -4
- package/dist/cjs/nodeviews/toDOM.js +6 -6
- package/dist/cjs/pm-plugins/analytics/plugin-factory.js +2 -2
- package/dist/cjs/pm-plugins/analytics/plugin.js +5 -4
- package/dist/cjs/pm-plugins/commands/clear.js +5 -3
- package/dist/cjs/pm-plugins/commands/column-resize.js +18 -16
- package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +118 -116
- package/dist/cjs/pm-plugins/commands/go-to-next-cell.js +5 -4
- package/dist/cjs/pm-plugins/commands/hover.js +5 -3
- package/dist/cjs/pm-plugins/commands/insert.js +21 -17
- package/dist/cjs/pm-plugins/commands/misc.js +45 -34
- package/dist/cjs/pm-plugins/commands/referentiality.js +2 -2
- package/dist/cjs/pm-plugins/commands/selection.js +25 -22
- package/dist/cjs/pm-plugins/commands/sort.js +14 -11
- package/dist/cjs/pm-plugins/commands/split-cell.js +2 -1
- package/dist/cjs/pm-plugins/commands/toggle.js +6 -5
- package/dist/cjs/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +33 -31
- package/dist/cjs/pm-plugins/drag-and-drop/commands.js +6 -3
- package/dist/cjs/pm-plugins/drag-and-drop/plugin-factory.js +2 -2
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +16 -14
- package/dist/cjs/pm-plugins/handlers.js +10 -10
- package/dist/cjs/pm-plugins/keymap.js +11 -11
- package/dist/cjs/pm-plugins/main.js +24 -22
- package/dist/cjs/pm-plugins/plugin-factory.js +2 -2
- package/dist/cjs/pm-plugins/sticky-headers/plugin-state.js +2 -2
- package/dist/cjs/pm-plugins/table-analytics.js +6 -5
- package/dist/cjs/pm-plugins/table-anchor-names/plugin.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/commands.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +20 -19
- package/dist/cjs/pm-plugins/table-resizing/plugin-factory.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +17 -16
- package/dist/cjs/pm-plugins/table-resizing/utils/column-state.js +3 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/dom.js +5 -4
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +9 -9
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +8 -8
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +8 -8
- package/dist/cjs/pm-plugins/table-width-in-comment-fix.js +2 -2
- package/dist/cjs/pm-plugins/table-width.js +8 -8
- package/dist/cjs/pm-plugins/transforms/column-width.js +7 -7
- package/dist/cjs/pm-plugins/transforms/content-mode.js +4 -4
- package/dist/cjs/pm-plugins/transforms/delete-columns.js +4 -4
- package/dist/cjs/pm-plugins/transforms/fix-tables.js +5 -5
- package/dist/cjs/pm-plugins/transforms/merge.js +3 -2
- package/dist/cjs/pm-plugins/transforms/replace-table.js +7 -6
- package/dist/cjs/pm-plugins/utils/analytics.js +19 -17
- package/dist/cjs/pm-plugins/utils/column-controls.js +11 -10
- package/dist/cjs/pm-plugins/utils/create.js +2 -2
- package/dist/cjs/pm-plugins/utils/decoration.js +6 -4
- package/dist/cjs/pm-plugins/utils/dom.js +4 -3
- package/dist/cjs/pm-plugins/utils/drag-menu.js +12 -12
- package/dist/cjs/pm-plugins/utils/guidelines.js +3 -3
- package/dist/cjs/pm-plugins/utils/merged-cells.js +5 -4
- package/dist/cjs/pm-plugins/utils/nodes.js +8 -8
- package/dist/cjs/pm-plugins/utils/paste.js +10 -10
- package/dist/cjs/pm-plugins/utils/row-controls.js +2 -1
- package/dist/cjs/pm-plugins/utils/selection.js +4 -3
- package/dist/cjs/pm-plugins/utils/snapping.js +12 -12
- package/dist/cjs/pm-plugins/utils/table.js +5 -5
- package/dist/cjs/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.js +10 -9
- package/dist/cjs/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.js +5 -4
- package/dist/cjs/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.js +8 -8
- package/dist/cjs/pm-plugins/view-mode-sort/utils.js +2 -1
- package/dist/cjs/tablePlugin.js +27 -26
- package/dist/cjs/ui/ColumnResizeWidget/index.js +2 -2
- package/dist/cjs/ui/ContentComponent.js +9 -9
- package/dist/cjs/ui/DragHandle/index.js +5 -4
- package/dist/cjs/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +4 -3
- package/dist/cjs/ui/FloatingContextualButton/index.js +12 -12
- package/dist/cjs/ui/FloatingContextualMenu/CellMenuPopup.js +5 -4
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +69 -63
- package/dist/cjs/ui/FloatingContextualMenu/index.js +11 -9
- package/dist/cjs/ui/FloatingDeleteButton/index.js +17 -16
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +61 -54
- package/dist/cjs/ui/FloatingDragMenu/DropdownMenu.js +14 -10
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -4
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +9 -9
- package/dist/cjs/ui/FloatingInsertButton/getPopupOptions.js +2 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +17 -17
- package/dist/cjs/ui/FloatingTableMenu/index.js +8 -6
- package/dist/cjs/ui/FloatingToolbarLabel/FloatingToolbarLabel.js +2 -2
- package/dist/cjs/ui/SizeSelector/index.js +2 -2
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +18 -17
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +2 -2
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +13 -12
- package/dist/cjs/ui/TableFullWidthLabel/index.js +2 -2
- package/dist/cjs/ui/TableMenu/cell/getCellMenuComponents.js +15 -15
- package/dist/cjs/ui/TableMenu/cell/items/MergeCellsItem.js +8 -7
- package/dist/cjs/ui/TableMenu/cell/items/SplitCellItem.js +8 -7
- package/dist/cjs/ui/TableMenu/cell/items/VerticalAlignDropdownItem.js +4 -4
- package/dist/cjs/ui/TableMenu/cell/items/VerticalAlignNestedMenu.js +6 -5
- package/dist/cjs/ui/TableMenu/column/getColumnMenuComponents.js +7 -7
- package/dist/cjs/ui/TableMenu/column/items/AddColumnLeftItem.js +14 -12
- package/dist/cjs/ui/TableMenu/column/items/AddColumnRightItem.js +12 -10
- package/dist/cjs/ui/TableMenu/column/items/ColumnBackgroundSection.js +4 -4
- package/dist/cjs/ui/TableMenu/column/items/ColumnToggleSection.js +4 -4
- package/dist/cjs/ui/TableMenu/column/items/DeleteColumnItem.js +12 -10
- package/dist/cjs/ui/TableMenu/column/items/DistributeColumnsItem.js +10 -9
- package/dist/cjs/ui/TableMenu/column/items/HeaderColumnToggleItem.js +6 -6
- package/dist/cjs/ui/TableMenu/column/items/MoveColumnLeftItem.js +9 -9
- package/dist/cjs/ui/TableMenu/column/items/MoveColumnRightItem.js +9 -9
- package/dist/cjs/ui/TableMenu/column/items/SortDecreasingItem.js +17 -15
- package/dist/cjs/ui/TableMenu/column/items/SortIncreasingItem.js +17 -15
- package/dist/cjs/ui/TableMenu/row/getRowMenuComponents.js +9 -9
- package/dist/cjs/ui/TableMenu/row/items/AddRowAboveItem.js +12 -10
- package/dist/cjs/ui/TableMenu/row/items/AddRowBelowItem.js +10 -8
- package/dist/cjs/ui/TableMenu/row/items/DeleteRowItem.js +12 -10
- package/dist/cjs/ui/TableMenu/row/items/HeaderRowToggleItem.js +6 -6
- package/dist/cjs/ui/TableMenu/row/items/MoveRowDownItem.js +9 -9
- package/dist/cjs/ui/TableMenu/row/items/MoveRowUpItem.js +9 -9
- package/dist/cjs/ui/TableMenu/row/items/NumberedRowsToggleItem.js +6 -6
- package/dist/cjs/ui/TableMenu/shared/TableMenu.js +6 -6
- package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.js +20 -14
- package/dist/cjs/ui/TableMenu/shared/items/ClearCellsItem.js +10 -8
- package/dist/cjs/ui/TableMenu/shared/selection.js +4 -2
- package/dist/cjs/ui/common-styles.js +34 -30
- package/dist/cjs/ui/consts.js +8 -8
- package/dist/cjs/ui/event-handlers.js +47 -43
- package/dist/cjs/ui/global-styles.js +2 -2
- package/dist/cjs/ui/hooks/useInternalTablePluginStateSelector.js +1 -1
- package/dist/cjs/ui/icons/SortingIconWrapper.js +4 -4
- package/dist/cjs/ui/quick-insert/TableQuickInsertMenuItem.js +5 -5
- package/dist/cjs/ui/quick-insert/getTableQuickInsertComponents.js +3 -3
- package/dist/cjs/ui/quick-insert/insertTableFromQuickInsert.js +5 -5
- package/dist/cjs/ui/rounded-table-styles.js +8 -8
- package/dist/cjs/ui/toolbar.js +80 -72
- package/dist/cjs/ui/ui-styles.js +14 -14
- package/dist/es2019/nodeviews/ExternalDropTargets.js +1 -1
- package/dist/es2019/nodeviews/TableCell.js +2 -1
- package/dist/es2019/nodeviews/TableComponent.js +2 -2
- package/dist/es2019/nodeviews/TableComponentWithSharedState.js +1 -1
- package/dist/es2019/nodeviews/TableContainer.js +4 -3
- package/dist/es2019/nodeviews/TableResizer.js +10 -9
- package/dist/es2019/nodeviews/TableRow.js +1 -1
- package/dist/es2019/nodeviews/TableRowNativeStickyWithFallback.js +4 -3
- package/dist/es2019/nodeviews/TableSSRReactContextsProvider.js +1 -1
- package/dist/es2019/nodeviews/TableStickyScrollbar.js +1 -1
- package/dist/es2019/nodeviews/table.js +2 -2
- package/dist/es2019/nodeviews/toDOM.js +2 -2
- package/dist/es2019/pm-plugins/analytics/plugin-factory.js +1 -1
- package/dist/es2019/pm-plugins/analytics/plugin.js +2 -1
- package/dist/es2019/pm-plugins/commands/clear.js +3 -1
- package/dist/es2019/pm-plugins/commands/column-resize.js +6 -4
- package/dist/es2019/pm-plugins/commands/commands-with-analytics.js +5 -3
- package/dist/es2019/pm-plugins/commands/go-to-next-cell.js +3 -2
- package/dist/es2019/pm-plugins/commands/hover.js +3 -1
- package/dist/es2019/pm-plugins/commands/insert.js +7 -3
- package/dist/es2019/pm-plugins/commands/misc.js +13 -2
- package/dist/es2019/pm-plugins/commands/referentiality.js +1 -1
- package/dist/es2019/pm-plugins/commands/selection.js +6 -3
- package/dist/es2019/pm-plugins/commands/sort.js +6 -3
- package/dist/es2019/pm-plugins/commands/split-cell.js +2 -1
- package/dist/es2019/pm-plugins/commands/toggle.js +3 -2
- package/dist/es2019/pm-plugins/decorations/plugin.js +1 -1
- package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +5 -3
- package/dist/es2019/pm-plugins/drag-and-drop/commands.js +4 -1
- package/dist/es2019/pm-plugins/drag-and-drop/plugin-factory.js +1 -1
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +5 -3
- package/dist/es2019/pm-plugins/handlers.js +2 -2
- package/dist/es2019/pm-plugins/keymap.js +2 -2
- package/dist/es2019/pm-plugins/main.js +7 -5
- package/dist/es2019/pm-plugins/plugin-factory.js +1 -1
- package/dist/es2019/pm-plugins/sticky-headers/plugin-state.js +1 -1
- package/dist/es2019/pm-plugins/table-analytics.js +2 -1
- package/dist/es2019/pm-plugins/table-anchor-names/plugin.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +5 -4
- package/dist/es2019/pm-plugins/table-resizing/plugin-factory.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +4 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/dom.js +3 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +3 -3
- package/dist/es2019/pm-plugins/table-width-in-comment-fix.js +1 -1
- package/dist/es2019/pm-plugins/table-width.js +2 -2
- package/dist/es2019/pm-plugins/transforms/column-width.js +1 -1
- package/dist/es2019/pm-plugins/transforms/content-mode.js +2 -2
- package/dist/es2019/pm-plugins/transforms/delete-columns.js +2 -2
- package/dist/es2019/pm-plugins/transforms/fix-tables.js +2 -2
- package/dist/es2019/pm-plugins/transforms/merge.js +2 -1
- package/dist/es2019/pm-plugins/transforms/replace-table.js +2 -1
- package/dist/es2019/pm-plugins/utils/analytics.js +4 -2
- package/dist/es2019/pm-plugins/utils/column-controls.js +3 -2
- package/dist/es2019/pm-plugins/utils/create.js +1 -1
- package/dist/es2019/pm-plugins/utils/decoration.js +3 -1
- package/dist/es2019/pm-plugins/utils/dom.js +2 -1
- package/dist/es2019/pm-plugins/utils/drag-menu.js +2 -2
- package/dist/es2019/pm-plugins/utils/guidelines.js +1 -1
- package/dist/es2019/pm-plugins/utils/merged-cells.js +2 -1
- package/dist/es2019/pm-plugins/utils/nodes.js +1 -1
- package/dist/es2019/pm-plugins/utils/paste.js +2 -2
- package/dist/es2019/pm-plugins/utils/row-controls.js +2 -1
- package/dist/es2019/pm-plugins/utils/selection.js +2 -1
- package/dist/es2019/pm-plugins/utils/snapping.js +2 -2
- package/dist/es2019/pm-plugins/utils/table.js +1 -1
- package/dist/es2019/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.js +3 -2
- package/dist/es2019/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.js +2 -1
- package/dist/es2019/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.js +2 -2
- package/dist/es2019/pm-plugins/view-mode-sort/utils.js +2 -1
- package/dist/es2019/tablePlugin.js +6 -5
- package/dist/es2019/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/es2019/ui/ContentComponent.js +4 -4
- package/dist/es2019/ui/DragHandle/index.js +3 -2
- package/dist/es2019/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +2 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +6 -6
- package/dist/es2019/ui/FloatingContextualMenu/CellMenuPopup.js +4 -3
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +17 -11
- package/dist/es2019/ui/FloatingContextualMenu/index.js +6 -4
- package/dist/es2019/ui/FloatingDeleteButton/index.js +7 -6
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +17 -10
- package/dist/es2019/ui/FloatingDragMenu/DropdownMenu.js +8 -4
- package/dist/es2019/ui/FloatingDragMenu/index.js +2 -2
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +4 -4
- package/dist/es2019/ui/FloatingInsertButton/getPopupOptions.js +1 -1
- package/dist/es2019/ui/FloatingInsertButton/index.js +3 -3
- package/dist/es2019/ui/FloatingTableMenu/index.js +5 -4
- package/dist/es2019/ui/FloatingToolbarLabel/FloatingToolbarLabel.js +1 -1
- package/dist/es2019/ui/SizeSelector/index.js +1 -1
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +7 -6
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +5 -4
- package/dist/es2019/ui/TableFullWidthLabel/index.js +1 -1
- package/dist/es2019/ui/TableMenu/cell/getCellMenuComponents.js +2 -2
- package/dist/es2019/ui/TableMenu/cell/items/MergeCellsItem.js +4 -3
- package/dist/es2019/ui/TableMenu/cell/items/SplitCellItem.js +4 -3
- package/dist/es2019/ui/TableMenu/cell/items/VerticalAlignDropdownItem.js +2 -2
- package/dist/es2019/ui/TableMenu/cell/items/VerticalAlignNestedMenu.js +3 -2
- package/dist/es2019/ui/TableMenu/column/getColumnMenuComponents.js +1 -1
- package/dist/es2019/ui/TableMenu/column/items/AddColumnLeftItem.js +7 -5
- package/dist/es2019/ui/TableMenu/column/items/AddColumnRightItem.js +6 -4
- package/dist/es2019/ui/TableMenu/column/items/ColumnBackgroundSection.js +2 -2
- package/dist/es2019/ui/TableMenu/column/items/ColumnToggleSection.js +2 -2
- package/dist/es2019/ui/TableMenu/column/items/DeleteColumnItem.js +6 -4
- package/dist/es2019/ui/TableMenu/column/items/DistributeColumnsItem.js +5 -4
- package/dist/es2019/ui/TableMenu/column/items/HeaderColumnToggleItem.js +3 -3
- package/dist/es2019/ui/TableMenu/column/items/MoveColumnLeftItem.js +4 -4
- package/dist/es2019/ui/TableMenu/column/items/MoveColumnRightItem.js +4 -4
- package/dist/es2019/ui/TableMenu/column/items/SortDecreasingItem.js +7 -5
- package/dist/es2019/ui/TableMenu/column/items/SortIncreasingItem.js +7 -5
- package/dist/es2019/ui/TableMenu/row/getRowMenuComponents.js +1 -1
- package/dist/es2019/ui/TableMenu/row/items/AddRowAboveItem.js +6 -4
- package/dist/es2019/ui/TableMenu/row/items/AddRowBelowItem.js +5 -3
- package/dist/es2019/ui/TableMenu/row/items/DeleteRowItem.js +6 -4
- package/dist/es2019/ui/TableMenu/row/items/HeaderRowToggleItem.js +3 -3
- package/dist/es2019/ui/TableMenu/row/items/MoveRowDownItem.js +4 -4
- package/dist/es2019/ui/TableMenu/row/items/MoveRowUpItem.js +4 -4
- package/dist/es2019/ui/TableMenu/row/items/NumberedRowsToggleItem.js +3 -3
- package/dist/es2019/ui/TableMenu/shared/TableMenu.js +3 -3
- package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.js +10 -5
- package/dist/es2019/ui/TableMenu/shared/items/ClearCellsItem.js +5 -3
- package/dist/es2019/ui/TableMenu/shared/selection.js +3 -1
- package/dist/es2019/ui/common-styles.js +8 -4
- package/dist/es2019/ui/consts.js +2 -2
- package/dist/es2019/ui/event-handlers.js +7 -3
- package/dist/es2019/ui/global-styles.js +1 -1
- package/dist/es2019/ui/hooks/useInternalTablePluginStateSelector.js +1 -1
- package/dist/es2019/ui/icons/SortingIconWrapper.js +2 -2
- package/dist/es2019/ui/quick-insert/TableQuickInsertMenuItem.js +1 -1
- package/dist/es2019/ui/quick-insert/getTableQuickInsertComponents.js +1 -1
- package/dist/es2019/ui/quick-insert/insertTableFromQuickInsert.js +1 -1
- package/dist/es2019/ui/rounded-table-styles.js +2 -2
- package/dist/es2019/ui/toolbar.js +20 -10
- package/dist/es2019/ui/ui-styles.js +2 -2
- package/dist/esm/nodeviews/ExternalDropTargets.js +1 -1
- package/dist/esm/nodeviews/TableCell.js +2 -1
- package/dist/esm/nodeviews/TableComponent.js +2 -2
- package/dist/esm/nodeviews/TableComponentWithSharedState.js +1 -1
- package/dist/esm/nodeviews/TableContainer.js +4 -3
- package/dist/esm/nodeviews/TableResizer.js +10 -9
- package/dist/esm/nodeviews/TableRow.js +1 -1
- package/dist/esm/nodeviews/TableRowNativeStickyWithFallback.js +4 -3
- package/dist/esm/nodeviews/TableSSRReactContextsProvider.js +1 -1
- package/dist/esm/nodeviews/TableStickyScrollbar.js +1 -1
- package/dist/esm/nodeviews/table.js +2 -2
- package/dist/esm/nodeviews/toDOM.js +2 -2
- package/dist/esm/pm-plugins/analytics/plugin-factory.js +1 -1
- package/dist/esm/pm-plugins/analytics/plugin.js +2 -1
- package/dist/esm/pm-plugins/commands/clear.js +3 -1
- package/dist/esm/pm-plugins/commands/column-resize.js +6 -4
- package/dist/esm/pm-plugins/commands/commands-with-analytics.js +5 -3
- package/dist/esm/pm-plugins/commands/go-to-next-cell.js +3 -2
- package/dist/esm/pm-plugins/commands/hover.js +3 -1
- package/dist/esm/pm-plugins/commands/insert.js +7 -3
- package/dist/esm/pm-plugins/commands/misc.js +13 -2
- package/dist/esm/pm-plugins/commands/referentiality.js +1 -1
- package/dist/esm/pm-plugins/commands/selection.js +6 -3
- package/dist/esm/pm-plugins/commands/sort.js +6 -3
- package/dist/esm/pm-plugins/commands/split-cell.js +2 -1
- package/dist/esm/pm-plugins/commands/toggle.js +3 -2
- package/dist/esm/pm-plugins/decorations/plugin.js +1 -1
- package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +5 -3
- package/dist/esm/pm-plugins/drag-and-drop/commands.js +4 -1
- package/dist/esm/pm-plugins/drag-and-drop/plugin-factory.js +1 -1
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +5 -3
- package/dist/esm/pm-plugins/handlers.js +2 -2
- package/dist/esm/pm-plugins/keymap.js +2 -2
- package/dist/esm/pm-plugins/main.js +7 -5
- package/dist/esm/pm-plugins/plugin-factory.js +1 -1
- package/dist/esm/pm-plugins/sticky-headers/plugin-state.js +1 -1
- package/dist/esm/pm-plugins/table-analytics.js +2 -1
- package/dist/esm/pm-plugins/table-anchor-names/plugin.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +5 -4
- package/dist/esm/pm-plugins/table-resizing/plugin-factory.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +4 -3
- package/dist/esm/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/dom.js +3 -2
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +3 -3
- package/dist/esm/pm-plugins/table-width-in-comment-fix.js +1 -1
- package/dist/esm/pm-plugins/table-width.js +2 -2
- package/dist/esm/pm-plugins/transforms/column-width.js +1 -1
- package/dist/esm/pm-plugins/transforms/content-mode.js +2 -2
- package/dist/esm/pm-plugins/transforms/delete-columns.js +2 -2
- package/dist/esm/pm-plugins/transforms/fix-tables.js +2 -2
- package/dist/esm/pm-plugins/transforms/merge.js +2 -1
- package/dist/esm/pm-plugins/transforms/replace-table.js +2 -1
- package/dist/esm/pm-plugins/utils/analytics.js +4 -2
- package/dist/esm/pm-plugins/utils/column-controls.js +3 -2
- package/dist/esm/pm-plugins/utils/create.js +1 -1
- package/dist/esm/pm-plugins/utils/decoration.js +3 -1
- package/dist/esm/pm-plugins/utils/dom.js +2 -1
- package/dist/esm/pm-plugins/utils/drag-menu.js +2 -2
- package/dist/esm/pm-plugins/utils/guidelines.js +1 -1
- package/dist/esm/pm-plugins/utils/merged-cells.js +2 -1
- package/dist/esm/pm-plugins/utils/nodes.js +1 -1
- package/dist/esm/pm-plugins/utils/paste.js +2 -2
- package/dist/esm/pm-plugins/utils/row-controls.js +2 -1
- package/dist/esm/pm-plugins/utils/selection.js +2 -1
- package/dist/esm/pm-plugins/utils/snapping.js +2 -2
- package/dist/esm/pm-plugins/utils/table.js +1 -1
- package/dist/esm/pm-plugins/utils/tableMode/apply-measured-width-to-all-tables.js +3 -2
- package/dist/esm/pm-plugins/utils/tableMode/apply-measured-width-to-selected-table.js +2 -1
- package/dist/esm/pm-plugins/utils/tableMode/smart-adjust/distribute-column-widths.js +2 -2
- package/dist/esm/pm-plugins/view-mode-sort/utils.js +2 -1
- package/dist/esm/tablePlugin.js +6 -5
- package/dist/esm/ui/ColumnResizeWidget/index.js +1 -1
- package/dist/esm/ui/ContentComponent.js +4 -4
- package/dist/esm/ui/DragHandle/index.js +3 -2
- package/dist/esm/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.js +2 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +6 -6
- package/dist/esm/ui/FloatingContextualMenu/CellMenuPopup.js +4 -3
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +17 -11
- package/dist/esm/ui/FloatingContextualMenu/index.js +6 -4
- package/dist/esm/ui/FloatingDeleteButton/index.js +7 -6
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +17 -10
- package/dist/esm/ui/FloatingDragMenu/DropdownMenu.js +8 -4
- package/dist/esm/ui/FloatingDragMenu/index.js +2 -2
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +4 -4
- package/dist/esm/ui/FloatingInsertButton/getPopupOptions.js +1 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +3 -3
- package/dist/esm/ui/FloatingTableMenu/index.js +5 -4
- package/dist/esm/ui/FloatingToolbarLabel/FloatingToolbarLabel.js +1 -1
- package/dist/esm/ui/SizeSelector/index.js +1 -1
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +7 -6
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +5 -4
- package/dist/esm/ui/TableFullWidthLabel/index.js +1 -1
- package/dist/esm/ui/TableMenu/cell/getCellMenuComponents.js +2 -2
- package/dist/esm/ui/TableMenu/cell/items/MergeCellsItem.js +4 -3
- package/dist/esm/ui/TableMenu/cell/items/SplitCellItem.js +4 -3
- package/dist/esm/ui/TableMenu/cell/items/VerticalAlignDropdownItem.js +2 -2
- package/dist/esm/ui/TableMenu/cell/items/VerticalAlignNestedMenu.js +3 -2
- package/dist/esm/ui/TableMenu/column/getColumnMenuComponents.js +1 -1
- package/dist/esm/ui/TableMenu/column/items/AddColumnLeftItem.js +7 -5
- package/dist/esm/ui/TableMenu/column/items/AddColumnRightItem.js +6 -4
- package/dist/esm/ui/TableMenu/column/items/ColumnBackgroundSection.js +2 -2
- package/dist/esm/ui/TableMenu/column/items/ColumnToggleSection.js +2 -2
- package/dist/esm/ui/TableMenu/column/items/DeleteColumnItem.js +6 -4
- package/dist/esm/ui/TableMenu/column/items/DistributeColumnsItem.js +5 -4
- package/dist/esm/ui/TableMenu/column/items/HeaderColumnToggleItem.js +3 -3
- package/dist/esm/ui/TableMenu/column/items/MoveColumnLeftItem.js +4 -4
- package/dist/esm/ui/TableMenu/column/items/MoveColumnRightItem.js +4 -4
- package/dist/esm/ui/TableMenu/column/items/SortDecreasingItem.js +7 -5
- package/dist/esm/ui/TableMenu/column/items/SortIncreasingItem.js +7 -5
- package/dist/esm/ui/TableMenu/row/getRowMenuComponents.js +1 -1
- package/dist/esm/ui/TableMenu/row/items/AddRowAboveItem.js +6 -4
- package/dist/esm/ui/TableMenu/row/items/AddRowBelowItem.js +5 -3
- package/dist/esm/ui/TableMenu/row/items/DeleteRowItem.js +6 -4
- package/dist/esm/ui/TableMenu/row/items/HeaderRowToggleItem.js +3 -3
- package/dist/esm/ui/TableMenu/row/items/MoveRowDownItem.js +4 -4
- package/dist/esm/ui/TableMenu/row/items/MoveRowUpItem.js +4 -4
- package/dist/esm/ui/TableMenu/row/items/NumberedRowsToggleItem.js +3 -3
- package/dist/esm/ui/TableMenu/shared/TableMenu.js +3 -3
- package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.js +10 -5
- package/dist/esm/ui/TableMenu/shared/items/ClearCellsItem.js +5 -3
- package/dist/esm/ui/TableMenu/shared/selection.js +3 -1
- package/dist/esm/ui/common-styles.js +8 -4
- package/dist/esm/ui/consts.js +2 -2
- package/dist/esm/ui/event-handlers.js +7 -3
- package/dist/esm/ui/global-styles.js +1 -1
- package/dist/esm/ui/hooks/useInternalTablePluginStateSelector.js +1 -1
- package/dist/esm/ui/icons/SortingIconWrapper.js +2 -2
- package/dist/esm/ui/quick-insert/TableQuickInsertMenuItem.js +1 -1
- package/dist/esm/ui/quick-insert/getTableQuickInsertComponents.js +1 -1
- package/dist/esm/ui/quick-insert/insertTableFromQuickInsert.js +1 -1
- package/dist/esm/ui/rounded-table-styles.js +2 -2
- package/dist/esm/ui/toolbar.js +20 -10
- package/dist/esm/ui/ui-styles.js +2 -2
- package/dist/types/nodeviews/TableCell.d.ts +1 -1
- package/dist/types/nodeviews/TableComponent.d.ts +4 -3
- package/dist/types/nodeviews/TableComponentWithSharedState.d.ts +3 -2
- package/dist/types/nodeviews/TableContainer.d.ts +1 -1
- package/dist/types/nodeviews/TableResizer.d.ts +2 -2
- package/dist/types/nodeviews/table-node-views.d.ts +4 -3
- package/dist/types/nodeviews/table.d.ts +5 -3
- package/dist/types/nodeviews/toDOM.d.ts +1 -1
- package/dist/types/nodeviews/types.d.ts +4 -3
- package/dist/types/pm-plugins/analytics/commands.d.ts +1 -1
- package/dist/types/pm-plugins/analytics/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/analytics/plugin.d.ts +1 -1
- package/dist/types/pm-plugins/commands/active-table-menu.d.ts +1 -1
- package/dist/types/pm-plugins/commands/clear.d.ts +1 -1
- package/dist/types/pm-plugins/commands/collapse.d.ts +1 -1
- package/dist/types/pm-plugins/commands/column-resize.d.ts +4 -3
- package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +8 -5
- package/dist/types/pm-plugins/commands/delete.d.ts +2 -2
- package/dist/types/pm-plugins/commands/display-mode.d.ts +1 -1
- package/dist/types/pm-plugins/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types/pm-plugins/commands/hover.d.ts +1 -1
- package/dist/types/pm-plugins/commands/insert.d.ts +5 -3
- package/dist/types/pm-plugins/commands/misc.d.ts +3 -2
- package/dist/types/pm-plugins/commands/referentiality.d.ts +1 -1
- package/dist/types/pm-plugins/commands/selection.d.ts +3 -2
- package/dist/types/pm-plugins/commands/sort.d.ts +2 -2
- package/dist/types/pm-plugins/commands/split-cell.d.ts +1 -1
- package/dist/types/pm-plugins/commands/toggle.d.ts +1 -1
- package/dist/types/pm-plugins/decorations/utils/column-resizing.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +5 -4
- package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +2 -2
- package/dist/types/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/utils/getDragBehaviour.d.ts +1 -1
- package/dist/types/pm-plugins/keymap.d.ts +3 -3
- package/dist/types/pm-plugins/main.d.ts +5 -3
- package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/sticky-headers/commands.d.ts +1 -1
- package/dist/types/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
- package/dist/types/pm-plugins/table-analytics.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/commands.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +4 -3
- package/dist/types/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/plugin.d.ts +4 -3
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +2 -2
- package/dist/types/pm-plugins/table-width.d.ts +1 -1
- package/dist/types/pm-plugins/transforms/delete-columns.d.ts +1 -1
- package/dist/types/pm-plugins/transforms/delete-rows.d.ts +1 -1
- package/dist/types/pm-plugins/transforms/replace-table.d.ts +2 -1
- package/dist/types/pm-plugins/utils/analytics.d.ts +4 -2
- package/dist/types/pm-plugins/utils/decoration.d.ts +1 -1
- package/dist/types/pm-plugins/utils/drag-menu.d.ts +7 -4
- package/dist/types/pm-plugins/utils/guidelines.d.ts +1 -1
- package/dist/types/pm-plugins/utils/merged-cells.d.ts +1 -1
- package/dist/types/pm-plugins/utils/selection.d.ts +1 -1
- package/dist/types/pm-plugins/utils/snapping.d.ts +1 -1
- package/dist/types/pm-plugins/view-mode-sort/index.d.ts +2 -2
- package/dist/types/tablePluginType.d.ts +22 -17
- package/dist/types/types/index.d.ts +4 -4
- package/dist/types/ui/ContentComponent.d.ts +4 -2
- package/dist/types/ui/FloatingAlignmentButtons/FloatingAlignmentButtons.d.ts +2 -1
- package/dist/types/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +4 -3
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +3 -2
- package/dist/types/ui/FloatingDeleteButton/getPopUpOptions.d.ts +1 -1
- package/dist/types/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +4 -3
- package/dist/types/ui/FloatingDragMenu/DropdownMenu.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/index.d.ts +4 -3
- package/dist/types/ui/FloatingInsertButton/getPopupOptions.d.ts +1 -1
- package/dist/types/ui/FloatingInsertButton/index.d.ts +4 -2
- package/dist/types/ui/SizeSelector/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/index.d.ts +2 -2
- package/dist/types/ui/TableMenu/cell/getCellMenuComponents.d.ts +1 -1
- package/dist/types/ui/TableMenu/cell/keys.d.ts +1 -1
- package/dist/types/ui/TableMenu/column/getColumnMenuComponents.d.ts +1 -1
- package/dist/types/ui/TableMenu/column/keys.d.ts +1 -1
- package/dist/types/ui/TableMenu/row/getRowMenuComponents.d.ts +1 -1
- package/dist/types/ui/TableMenu/row/keys.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/TableMenu.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/TableMenuContext.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/getSharedItems.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/getTableMenuComponents.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/keys.d.ts +1 -1
- package/dist/types/ui/TableMenu/shared/selection.d.ts +1 -1
- package/dist/types/ui/common-styles.d.ts +1 -1
- package/dist/types/ui/event-handlers.d.ts +2 -2
- package/dist/types/ui/global-styles.d.ts +1 -1
- package/dist/types/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
- package/dist/types/ui/icons/SortingIconWrapper.d.ts +2 -2
- package/dist/types/ui/quick-insert/TableQuickInsertMenuItem.d.ts +1 -1
- package/dist/types/ui/quick-insert/getTableQuickInsertComponents.d.ts +1 -1
- package/dist/types/ui/quick-insert/insertTableFromQuickInsert.d.ts +3 -2
- package/dist/types/ui/toolbar.d.ts +5 -3
- package/package.json +3 -3
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createPlugin = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
8
|
+
var _tableEvents = require("@atlaskit/editor-common/analytics/types/table-events");
|
|
8
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
9
10
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
10
11
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
11
12
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
12
|
-
var
|
|
13
|
+
var _getCellsInRow = require("@atlaskit/editor-tables/utils/get-cells-in-row");
|
|
14
|
+
var _api = require("@atlaskit/insm/api");
|
|
13
15
|
var _element = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
|
|
14
16
|
var _elementAdapter = require("@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter");
|
|
15
17
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/utils/combine");
|
|
@@ -40,7 +42,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
40
42
|
},
|
|
41
43
|
onDragStart: function onDragStart() {
|
|
42
44
|
var _insm$session;
|
|
43
|
-
(_insm$session =
|
|
45
|
+
(_insm$session = _api.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
|
|
44
46
|
// auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
|
|
45
47
|
// Ignored via go/ees005
|
|
46
48
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -48,7 +50,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
48
50
|
},
|
|
49
51
|
onDrop: function onDrop() {
|
|
50
52
|
var _insm$session2;
|
|
51
|
-
(_insm$session2 =
|
|
53
|
+
(_insm$session2 = _api.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
|
|
52
54
|
// 'null' will remove the inline style
|
|
53
55
|
// Ignored via go/ees005
|
|
54
56
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -85,7 +87,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
85
87
|
},
|
|
86
88
|
onDragStart: function onDragStart() {
|
|
87
89
|
var _insm$session3;
|
|
88
|
-
(_insm$session3 =
|
|
90
|
+
(_insm$session3 = _api.insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
89
91
|
if ((0, _expValEquals.expValEquals)('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
90
92
|
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
|
91
93
|
var _api$userIntent;
|
|
@@ -157,10 +159,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
157
159
|
var _insm$session4, _event$source, _event$source2;
|
|
158
160
|
// If we're able to determine the source type of the dropped element then we should report to analytics that
|
|
159
161
|
// the drop event was cancelled. Otherwise we will cancel silently.
|
|
160
|
-
(_insm$session4 =
|
|
162
|
+
(_insm$session4 = _api.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
|
|
161
163
|
if ((event === null || event === void 0 || (_event$source = event.source) === null || _event$source === void 0 || (_event$source = _event$source.data) === null || _event$source === void 0 ? void 0 : _event$source.type) === 'table-row' || (event === null || event === void 0 || (_event$source2 = event.source) === null || _event$source2 === void 0 || (_event$source2 = _event$source2.data) === null || _event$source2 === void 0 ? void 0 : _event$source2.type) === 'table-column') {
|
|
162
164
|
var _event$source$data;
|
|
163
|
-
return (0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(
|
|
165
|
+
return (0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_enums.INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data = event.source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.indexes, _tableEvents.TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
|
|
164
166
|
}
|
|
165
167
|
return (0, _commands.clearDropTarget)(tr)(editorView.state, editorView.dispatch);
|
|
166
168
|
}
|
|
@@ -182,18 +184,18 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
182
184
|
// If the drop target index contains merged cells then we should not allow the drop to occur.
|
|
183
185
|
if ((0, _mergedCells.hasMergedCellsInBetween)([targetAdjustedIndex - 1, targetAdjustedIndex], sourceType === 'table-row' ? _consts.DropTargetType.ROW : _consts.DropTargetType.COLUMN)(editorView.state.selection)) {
|
|
184
186
|
var _insm$session5;
|
|
185
|
-
(0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(
|
|
187
|
+
(0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_enums.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
|
|
186
188
|
// This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
|
|
187
|
-
|
|
188
|
-
(_insm$session5 =
|
|
189
|
+
_tableEvents.TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
|
|
190
|
+
(_insm$session5 = _api.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
|
|
189
191
|
return;
|
|
190
192
|
}
|
|
191
193
|
requestAnimationFrame(function () {
|
|
192
194
|
var _insm$session6;
|
|
193
195
|
if (behaviour === 'clone') {
|
|
194
|
-
(0, _commandsWithAnalytics.cloneSourceWithAnalytics)(editorAnalyticsAPI)(
|
|
196
|
+
(0, _commandsWithAnalytics.cloneSourceWithAnalytics)(editorAnalyticsAPI)(_enums.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes, targetIndex, targetDirection, tr)(editorView.state, editorView.dispatch);
|
|
195
197
|
} else {
|
|
196
|
-
(0, _commandsWithAnalytics.moveSourceWithAnalytics)(editorAnalyticsAPI)(
|
|
198
|
+
(0, _commandsWithAnalytics.moveSourceWithAnalytics)(editorAnalyticsAPI)(_enums.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes, targetAdjustedIndex + (direction === 1 ? -1 : 0), tr)(editorView.state, editorView.dispatch);
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
// force a colgroup update here, otherwise dropped columns don't have
|
|
@@ -216,7 +218,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
216
218
|
}
|
|
217
219
|
}
|
|
218
220
|
editorView.focus();
|
|
219
|
-
(_insm$session6 =
|
|
221
|
+
(_insm$session6 = _api.insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
|
|
220
222
|
});
|
|
221
223
|
}
|
|
222
224
|
})]));
|
|
@@ -278,7 +280,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
278
280
|
}
|
|
279
281
|
};
|
|
280
282
|
if (newTargetCellPosition !== undefined) {
|
|
281
|
-
var cells = (0,
|
|
283
|
+
var cells = (0, _getCellsInRow.getCellsInRow)(dragMenuIndex)(tr.selection);
|
|
282
284
|
// TODO: ED-20673 - check if it is a cell selection,
|
|
283
285
|
// when true, a drag handle is clicked and isDragMenuOpen is true here
|
|
284
286
|
// should not close the drag menu.
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.handleDocOrSelectionChanged = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _sortColumn = require("@atlaskit/custom-steps/sort-column");
|
|
10
|
+
var _isTextInput = require("@atlaskit/editor-common/utils/is-text-input");
|
|
11
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
13
|
-
var
|
|
13
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
14
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
15
|
var _defaultTableSelection = require("./default-table-selection");
|
|
16
16
|
var _pluginKey = require("./table-resizing/plugin-key");
|
|
@@ -20,7 +20,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
20
20
|
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; } // #region Imports
|
|
21
21
|
var nextTableSorting = function nextTableSorting(tr, table) {
|
|
22
22
|
var tableSortStep = tr.steps.find(function (step) {
|
|
23
|
-
return step instanceof
|
|
23
|
+
return step instanceof _sortColumn.TableSortStep;
|
|
24
24
|
});
|
|
25
25
|
return tableSortStep && table && table.pos === tableSortStep.pos ? tableSortStep.next : undefined;
|
|
26
26
|
};
|
|
@@ -48,7 +48,7 @@ var updateTargetCellPosition = function updateTargetCellPosition(_ref2) {
|
|
|
48
48
|
var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
|
|
49
49
|
_tableCell = _tr$doc$type$schema$n.tableCell,
|
|
50
50
|
_tableHeader = _tr$doc$type$schema$n.tableHeader;
|
|
51
|
-
var _cell = (0,
|
|
51
|
+
var _cell = (0, _utils.findParentNodeOfType)([_tableCell, _tableHeader])(tr.selection);
|
|
52
52
|
_targetCellPosition = _cell ? _cell.pos : undefined;
|
|
53
53
|
}
|
|
54
54
|
var hasTargetCellChanged = pluginState.targetCellPosition !== _targetCellPosition;
|
|
@@ -78,7 +78,7 @@ var updateTargetCellPosition = function updateTargetCellPosition(_ref2) {
|
|
|
78
78
|
var _tr$doc$type$schema$n2 = tr.doc.type.schema.nodes,
|
|
79
79
|
tableCell = _tr$doc$type$schema$n2.tableCell,
|
|
80
80
|
tableHeader = _tr$doc$type$schema$n2.tableHeader;
|
|
81
|
-
var cell = (0,
|
|
81
|
+
var cell = (0, _utils.findParentNodeOfType)([tableCell, tableHeader])(tr.selection);
|
|
82
82
|
var targetCellPosition = cell ? cell.pos : undefined;
|
|
83
83
|
var targetCellPositionChanged = pluginState.targetCellPosition !== targetCellPosition;
|
|
84
84
|
var closeContextualMenu = shouldCloseLegacyContextualMenu({
|
|
@@ -104,7 +104,7 @@ var updateTableNodePluginState = function updateTableNodePluginState(_ref3) {
|
|
|
104
104
|
table = _ref3.table;
|
|
105
105
|
return function (pluginState) {
|
|
106
106
|
var tableNode = table && table.node;
|
|
107
|
-
if (!tableNode || (0,
|
|
107
|
+
if (!tableNode || (0, _isTextInput.isTextInput)(tr)) {
|
|
108
108
|
return pluginState;
|
|
109
109
|
}
|
|
110
110
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), _defaultTableSelection.defaultTableSelection), {}, {
|
|
@@ -135,7 +135,7 @@ var updateCollapseHandler = function updateCollapseHandler(_ref4) {
|
|
|
135
135
|
return pluginState;
|
|
136
136
|
}
|
|
137
137
|
var expandNodeType = schema.nodes.expand;
|
|
138
|
-
var isTableCollapsed = expandNodeType && !!(0,
|
|
138
|
+
var isTableCollapsed = expandNodeType && !!(0, _utils.findParentNodeOfType)(expandNodeType)(tr.selection);
|
|
139
139
|
var trCanBeCollapsed = (0, _collapse.isTableCollapsible)(tr).tableIsCollapsible;
|
|
140
140
|
|
|
141
141
|
// We're focused on a table + we're not inside an expand
|
|
@@ -181,6 +181,6 @@ var buildPluginState = function buildPluginState(builders) {
|
|
|
181
181
|
var handleDocOrSelectionChanged = exports.handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, pluginState) {
|
|
182
182
|
return buildPluginState([updateTargetCellPosition, updateTableNodePluginState, updateCollapseHandler])({
|
|
183
183
|
tr: tr,
|
|
184
|
-
table: (0,
|
|
184
|
+
table: (0, _utils2.findTable)(tr.selection)
|
|
185
185
|
})(pluginState);
|
|
186
186
|
};
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.keymapPlugin = keymapPlugin;
|
|
8
|
-
var
|
|
8
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
9
9
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
10
|
-
var
|
|
10
|
+
var _editorCommands = require("@atlaskit/editor-common/preset/editor-commands");
|
|
11
11
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
12
12
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
13
13
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -42,7 +42,7 @@ function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, e
|
|
|
42
42
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
43
43
|
// Ignored via go/ees005
|
|
44
44
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
45
|
-
_keymaps.toggleTable.common, (0,
|
|
45
|
+
_keymaps.toggleTable.common, (0, _editorCommands.editorCommandToPMCommand)((0, _insert.insertTableWithNestingSupport)({
|
|
46
46
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
47
47
|
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
48
48
|
isFullWidthModeEnabled: !!isFullWidthEnabled,
|
|
@@ -50,18 +50,18 @@ function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, e
|
|
|
50
50
|
isChromelessEditor: isChromelessEditor,
|
|
51
51
|
isTableResizingEnabled: isTableResizingEnabled
|
|
52
52
|
}, api, {
|
|
53
|
-
action:
|
|
54
|
-
actionSubject:
|
|
55
|
-
actionSubjectId:
|
|
53
|
+
action: _enums.ACTION.INSERTED,
|
|
54
|
+
actionSubject: _enums.ACTION_SUBJECT.DOCUMENT,
|
|
55
|
+
actionSubjectId: _enums.ACTION_SUBJECT_ID.TABLE,
|
|
56
56
|
attributes: {
|
|
57
|
-
inputMethod:
|
|
57
|
+
inputMethod: _enums.INPUT_METHOD.SHORTCUT
|
|
58
58
|
},
|
|
59
|
-
eventType:
|
|
59
|
+
eventType: _enums.EVENT_TYPE.TRACK
|
|
60
60
|
})), list);
|
|
61
61
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
62
62
|
// Ignored via go/ees005
|
|
63
63
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
64
|
-
_keymaps.backspace.common, (0, _commands.chainCommands)((0, _commandsWithAnalytics2.deleteTableIfSelectedWithAnalytics)(editorAnalyticsAPI)(
|
|
64
|
+
_keymaps.backspace.common, (0, _commands.chainCommands)((0, _commandsWithAnalytics2.deleteTableIfSelectedWithAnalytics)(editorAnalyticsAPI)(_enums.INPUT_METHOD.KEYBOARD), (0, _commandsWithAnalytics2.emptyMultipleCellsWithAnalytics)(editorAnalyticsAPI)(_enums.INPUT_METHOD.KEYBOARD)), list);
|
|
65
65
|
// Ignored via go/ees005
|
|
66
66
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
67
67
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.backspace.common, _commands2.moveCursorBackward, list);
|
|
@@ -177,11 +177,11 @@ function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, e
|
|
|
177
177
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
178
178
|
// Ignored via go/ees005
|
|
179
179
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
180
|
-
_keymaps.decreaseMediaSize.common, (0, _commandsWithAnalytics2.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI, api)(-10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor,
|
|
180
|
+
_keymaps.decreaseMediaSize.common, (0, _commandsWithAnalytics2.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI, api)(-10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, _enums.INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
181
181
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
182
182
|
// Ignored via go/ees005
|
|
183
183
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
184
|
-
_keymaps.increaseMediaSize.common, (0, _commandsWithAnalytics2.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI, api)(10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor,
|
|
184
|
+
_keymaps.increaseMediaSize.common, (0, _commandsWithAnalytics2.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI, api)(10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, _enums.INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
185
185
|
(0, _keymaps.bindKeymapWithCommand)(
|
|
186
186
|
// Ignored via go/ees005
|
|
187
187
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -7,16 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.createPlugin = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _bindEventListener = require("bind-event-listener");
|
|
10
|
-
var
|
|
10
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
11
11
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
12
|
-
var
|
|
12
|
+
var _inside = require("@atlaskit/editor-common/inside");
|
|
13
13
|
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
14
14
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
15
15
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
16
|
+
var _extension = require("@atlaskit/editor-common/transforms/extension");
|
|
17
|
+
var _layout = require("@atlaskit/editor-common/transforms/layout");
|
|
18
|
+
var _dom = require("@atlaskit/editor-common/utils/dom");
|
|
19
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
20
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
21
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
20
22
|
var _tableNodeViews = require("../nodeviews/table-node-views");
|
|
21
23
|
var _plugin = require("../pm-plugins/decorations/plugin");
|
|
22
24
|
var _types = require("../types");
|
|
@@ -112,9 +114,9 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
112
114
|
}
|
|
113
115
|
invalidTableIds.push(invalidNodeAttr.tableLocalId);
|
|
114
116
|
dispatchAnalyticsEvent({
|
|
115
|
-
action:
|
|
116
|
-
actionSubject:
|
|
117
|
-
eventType:
|
|
117
|
+
action: _enums.ACTION.INVALID_DOCUMENT_ENCOUNTERED,
|
|
118
|
+
actionSubject: _enums.ACTION_SUBJECT.EDITOR,
|
|
119
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL,
|
|
118
120
|
attributes: {
|
|
119
121
|
nodeType: invalidNodeAttr.nodeType,
|
|
120
122
|
reason: "".concat(invalidNodeAttr.attribute, ": ").concat(invalidNodeAttr.reason),
|
|
@@ -170,7 +172,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
170
172
|
var selection = state.selection;
|
|
171
173
|
var pluginState = (0, _pluginFactory.getPluginState)(state);
|
|
172
174
|
var tableRef;
|
|
173
|
-
var parent = (0,
|
|
175
|
+
var parent = (0, _utils.findParentDomRefOfType)(state.schema.nodes.table, domAtPos)(selection);
|
|
174
176
|
var shouldSetTableRef = parent && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) !== 'view' && (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.interaction) === null || _pluginInjectionApi$i === void 0 || (_pluginInjectionApi$i = _pluginInjectionApi$i.sharedState.currentState()) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.interactionState) !== 'hasNotHadInteraction';
|
|
175
177
|
if (shouldSetTableRef) {
|
|
176
178
|
tableRef =
|
|
@@ -179,15 +181,15 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
179
181
|
parent.querySelector('table') || undefined;
|
|
180
182
|
}
|
|
181
183
|
if (pluginState.editorHasFocus) {
|
|
182
|
-
var tableNode = (0,
|
|
184
|
+
var tableNode = (0, _utils2.findTable)(state.selection);
|
|
183
185
|
// when keyboard cursor leaves the table we need to stop column resizing
|
|
184
186
|
var pluginPrevState = (0, _pluginFactory.getPluginState)(prevState);
|
|
185
187
|
var isStopKeyboardColumResizing = pluginPrevState.isResizeHandleWidgetAdded && pluginPrevState.isKeyboardResize;
|
|
186
188
|
if (isStopKeyboardColumResizing) {
|
|
187
189
|
var isTableNodesDifferent = (pluginPrevState === null || pluginPrevState === void 0 ? void 0 : pluginPrevState.tableNode) !== (tableNode === null || tableNode === void 0 ? void 0 : tableNode.node);
|
|
188
190
|
if (pluginPrevState !== null && pluginPrevState !== void 0 && pluginPrevState.tableNode && tableNode && isTableNodesDifferent) {
|
|
189
|
-
var oldRowsNumber =
|
|
190
|
-
var newRowsNumber =
|
|
191
|
+
var oldRowsNumber = _tableMap.TableMap.get(pluginPrevState.tableNode).height;
|
|
192
|
+
var newRowsNumber = _tableMap.TableMap.get(tableNode.node).height;
|
|
191
193
|
if (oldRowsNumber !== newRowsNumber ||
|
|
192
194
|
// Add/delete row
|
|
193
195
|
tableNode.node.attrs.localId !== pluginPrevState.tableNode.attrs.localId) {
|
|
@@ -214,7 +216,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
214
216
|
$cursor = _ref.$cursor;
|
|
215
217
|
if ($cursor) {
|
|
216
218
|
// Only update bold when it's a cursor
|
|
217
|
-
var tableCellHeader = (0,
|
|
219
|
+
var tableCellHeader = (0, _utils.findParentNodeOfType)(state.schema.nodes.tableHeader)(state.selection);
|
|
218
220
|
if (tableCellHeader) {
|
|
219
221
|
(0, _commands.addBoldInEmptyHeaderCells)(tableCellHeader)(state, dispatch);
|
|
220
222
|
}
|
|
@@ -239,20 +241,20 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
239
241
|
// if we're pasting to outside a table or outside a table
|
|
240
242
|
// header, ensure that we apply any table headers to the first
|
|
241
243
|
// row of content we see, if required
|
|
242
|
-
if (!(0,
|
|
244
|
+
if (!(0, _inside.insideTable)(editorState) && (0, _paste.isHeaderRowRequired)(editorState)) {
|
|
243
245
|
slice = (0, _misc.transformSliceToAddTableHeaders)(slice, schema);
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
// This fixes pasting a table with default layout into comment editor
|
|
247
249
|
// table lose width and expand to full width
|
|
248
|
-
if (!(0,
|
|
250
|
+
if (!(0, _inside.insideTable)(editorState) && isCommentEditor && pluginConfig.allowTableAlignment && isTableScalingEnabled) {
|
|
249
251
|
slice = (0, _paste.transformSliceTableLayoutDefaultToCenter)(slice, schema);
|
|
250
252
|
}
|
|
251
253
|
slice = (0, _paste.transformSliceToFixHardBreakProblemOnCopyFromCell)(slice, schema);
|
|
252
254
|
|
|
253
255
|
// We do this separately, so it also applies to drag/drop events
|
|
254
256
|
// This needs to go before `transformSliceToRemoveOpenExpand`
|
|
255
|
-
slice = (0,
|
|
257
|
+
slice = (0, _layout.transformSliceToRemoveOpenLayoutNodes)(slice, schema);
|
|
256
258
|
|
|
257
259
|
// If a partial paste of expand, paste only the content
|
|
258
260
|
// This needs to go before `transformSliceToRemoveOpenTable`
|
|
@@ -261,13 +263,13 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
261
263
|
// transformSliceToRemoveOpenTable() transforms based on the depth of the root node, assuming that the tables will be at the root
|
|
262
264
|
// Bodied extensions will contribute to the depth of the table selection so we need to remove them first
|
|
263
265
|
/** If a partial paste of bodied extension, paste only text */
|
|
264
|
-
slice = (0,
|
|
266
|
+
slice = (0, _extension.transformSliceToRemoveOpenBodiedExtension)(slice, schema);
|
|
265
267
|
|
|
266
268
|
/** If a partial paste of table, paste only table's content */
|
|
267
269
|
slice = (0, _paste.transformSliceToRemoveOpenTable)(slice, schema);
|
|
268
270
|
|
|
269
271
|
/** If a partial paste of multi bodied extension, paste only children */
|
|
270
|
-
slice = (0,
|
|
272
|
+
slice = (0, _extension.transformSliceToRemoveOpenMultiBodiedExtension)(slice, schema);
|
|
271
273
|
slice = (0, _paste.transformSliceToCorrectEmptyTableCells)(slice, schema);
|
|
272
274
|
if (!pluginConfig.allowColumnResizing) {
|
|
273
275
|
slice = (0, _misc.transformSliceToRemoveColumnsWidths)(slice, schema);
|
|
@@ -312,8 +314,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
312
314
|
// when typing into a sticky header cell, we don't want to scroll
|
|
313
315
|
// back to the top of the table if the user has already scrolled down
|
|
314
316
|
var tableHeader = view.state.schema.nodes.tableHeader;
|
|
315
|
-
var domRef = (0,
|
|
316
|
-
var maybeTr = (0,
|
|
317
|
+
var domRef = (0, _utils.findParentDomRefOfType)(tableHeader, view.domAtPos.bind(view))(view.state.selection);
|
|
318
|
+
var maybeTr = (0, _dom.closestElement)(domRef, 'tr');
|
|
317
319
|
return maybeTr ? maybeTr.classList.contains('sticky') : false;
|
|
318
320
|
},
|
|
319
321
|
handleTextInput: function handleTextInput(view, _from, _to, text) {
|
|
@@ -328,7 +330,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
328
330
|
})(state, dispatch);
|
|
329
331
|
return false;
|
|
330
332
|
}
|
|
331
|
-
var tr = (0, _replaceTable.replaceSelectedTable)(state, text,
|
|
333
|
+
var tr = (0, _replaceTable.replaceSelectedTable)(state, text, _enums.INPUT_METHOD.KEYBOARD, editorAnalyticsAPI);
|
|
332
334
|
if (tr.selectionSet) {
|
|
333
335
|
dispatch(tr);
|
|
334
336
|
return true;
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getPluginState = exports.createPluginState = exports.createCommand = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _pluginStateFactory = require("@atlaskit/editor-common/utils/plugin-state-factory");
|
|
10
10
|
var _handlers = require("./handlers");
|
|
11
11
|
var _pluginKey = require("./plugin-key");
|
|
12
12
|
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
|
-
var dest = (0,
|
|
15
|
+
var dest = (0, _pluginStateFactory.pluginFactory)(_pluginKey.pluginKey, _reducer.default, {
|
|
16
16
|
mapping: function mapping(tr, pluginState) {
|
|
17
17
|
if (tr.docChanged) {
|
|
18
18
|
var updatedTargetCell = {};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createPluginState = exports.createCommand = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _pluginStateFactory = require("@atlaskit/editor-common/utils/plugin-state-factory");
|
|
10
10
|
var _pluginKey = require("./plugin-key");
|
|
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; }
|
|
@@ -32,7 +32,7 @@ var reducer = function reducer(pluginState, action) {
|
|
|
32
32
|
}
|
|
33
33
|
return pluginState;
|
|
34
34
|
};
|
|
35
|
-
var dest = (0,
|
|
35
|
+
var dest = (0, _pluginStateFactory.pluginFactory)(_pluginKey.pluginKey, reducer, {
|
|
36
36
|
mapping: function mapping(tr, pluginState) {
|
|
37
37
|
if (tr.docChanged) {
|
|
38
38
|
return pluginState.map(function (rowInfo) {
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createPlugin = exports.META_KEYS = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
10
|
+
var _tableEvents = require("@atlaskit/editor-common/analytics/types/table-events");
|
|
10
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
13
|
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; }
|
|
@@ -48,15 +49,15 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, dispat
|
|
|
48
49
|
// The only trigger we can't identify is viewport width change.
|
|
49
50
|
// However, since there is still a chance that there are other triggers we didn't think of,
|
|
50
51
|
// all these unknown triggers and viwport width change trigger are captured as EXTERNAL.
|
|
51
|
-
|
|
52
|
+
_tableEvents.TABLE_OVERFLOW_CHANGE_TRIGGER.EXTERNAL;
|
|
52
53
|
transactions.forEach(function (tr) {
|
|
53
54
|
var payload = tr.getMeta(META_KEYS.OVERFLOW_STATE_CHANGED);
|
|
54
55
|
if (payload) {
|
|
55
56
|
dispatchAnalyticsEvent({
|
|
56
|
-
action:
|
|
57
|
-
actionSubject:
|
|
57
|
+
action: _tableEvents.TABLE_ACTION.OVERFLOW_CHANGED,
|
|
58
|
+
actionSubject: _enums.ACTION_SUBJECT.TABLE,
|
|
58
59
|
actionSubjectId: null,
|
|
59
|
-
eventType:
|
|
60
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
60
61
|
attributes: {
|
|
61
62
|
editorWidth: payload.editorWidth,
|
|
62
63
|
parentWidth: payload.parentWidth,
|
|
@@ -10,7 +10,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _uuid = require("uuid");
|
|
12
12
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
13
|
-
var
|
|
13
|
+
var _nativeAnchor = require("@atlaskit/editor-common/styles/native-anchor");
|
|
14
14
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
15
15
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
16
16
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid
|
|
@@ -52,7 +52,7 @@ var createTableAnchorDecorations = function createTableAnchorDecorations(state)
|
|
|
52
52
|
// only apply to header cells and the first row of a table, for performance reasons
|
|
53
53
|
if (isFirstRow || shouldAddDecorationToHeader) {
|
|
54
54
|
var anchorName = getNodeAnchor(node);
|
|
55
|
-
var shouldAddAnchorNameInDecoration = !(0,
|
|
55
|
+
var shouldAddAnchorNameInDecoration = !(0, _nativeAnchor.isCSSAttrAnchorSupported)() && (0, _nativeAnchor.isCSSAnchorSupported)();
|
|
56
56
|
var attributes = {
|
|
57
57
|
'data-node-anchor': anchorName,
|
|
58
58
|
style: "anchor-name: ".concat(anchorName, ";")
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.stopResizing = exports.setResizeHandlePos = exports.setDragging = exports.evenColumns = exports.distributeColumnsWidths = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _tableEvents = require("@atlaskit/editor-common/analytics/types/table-events");
|
|
8
8
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
9
9
|
var _tableAnalytics = require("../table-analytics");
|
|
10
10
|
var _columnWidth = require("../transforms/column-width");
|
|
@@ -47,7 +47,7 @@ var distributeColumnsWidths = exports.distributeColumnsWidths = function distrib
|
|
|
47
47
|
if (dispatch) {
|
|
48
48
|
var tr = (0, _columnWidth.updateColumnWidths)(newResizeState, table.node, table.start, api)(state.tr);
|
|
49
49
|
tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
|
|
50
|
-
name:
|
|
50
|
+
name: _tableEvents.TABLE_OVERFLOW_CHANGE_TRIGGER.DISTRIBUTED_COLUMNS
|
|
51
51
|
});
|
|
52
52
|
stopResizing(tr)(state, dispatch);
|
|
53
53
|
}
|
|
@@ -4,11 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.handleMouseDown = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
8
|
+
var _tableEvents = require("@atlaskit/editor-common/analytics/types/table-events");
|
|
9
|
+
var _table = require("@atlaskit/editor-common/styles/table");
|
|
9
10
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
11
|
+
var _getSelectionRect = require("@atlaskit/editor-tables/utils/get-selection-rect");
|
|
12
|
+
var _api = require("@atlaskit/insm/api");
|
|
12
13
|
var _columnResize = require("../commands/column-resize");
|
|
13
14
|
var _misc = require("../commands/misc");
|
|
14
15
|
var _pluginFactory = require("../plugin-factory");
|
|
@@ -37,10 +38,10 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
37
38
|
var _getTablePluginState = (0, _pluginFactory.getPluginState)(state),
|
|
38
39
|
isKeyboardResize = _getTablePluginState.isKeyboardResize;
|
|
39
40
|
event.preventDefault();
|
|
40
|
-
(_insm$session =
|
|
41
|
+
(_insm$session = _api.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableColumnResize');
|
|
41
42
|
var tr = view.state.tr;
|
|
42
43
|
tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
|
|
43
|
-
name:
|
|
44
|
+
name: _tableEvents.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED_COLUMN
|
|
44
45
|
});
|
|
45
46
|
dispatch(tr);
|
|
46
47
|
var mouseDownTime = event.timeStamp;
|
|
@@ -80,7 +81,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
80
81
|
shouldUseIncreasedScalingPercent = true;
|
|
81
82
|
}
|
|
82
83
|
var resizeState = (0, _resizeState.getResizeState)({
|
|
83
|
-
minWidth:
|
|
84
|
+
minWidth: _table.tableCellMinWidth,
|
|
84
85
|
maxSize: maxSize,
|
|
85
86
|
table: originalTable,
|
|
86
87
|
tableRef: dom,
|
|
@@ -129,12 +130,12 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
129
130
|
isTableHovered = _getTablePluginState2.isTableHovered;
|
|
130
131
|
if (resizeHandlePos === null) {
|
|
131
132
|
var _insm$session2;
|
|
132
|
-
(_insm$session2 =
|
|
133
|
+
(_insm$session2 = _api.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableColumnResize');
|
|
133
134
|
return (0, _commands.stopResizing)()(state, dispatch);
|
|
134
135
|
}
|
|
135
136
|
if (!(0, _misc2.pointsAtCell)(state.doc.resolve(resizeHandlePos))) {
|
|
136
137
|
var _insm$session3;
|
|
137
|
-
(_insm$session3 =
|
|
138
|
+
(_insm$session3 = _api.insm.session) === null || _insm$session3 === void 0 || _insm$session3.endFeature('tableColumnResize');
|
|
138
139
|
return;
|
|
139
140
|
}
|
|
140
141
|
// resizeHandlePos could be remapped via a collab change.
|
|
@@ -148,7 +149,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
148
149
|
// If we let go in the same place we started, don't need to do anything.
|
|
149
150
|
if (dragging && clientX === dragging.startX) {
|
|
150
151
|
var _insm$session4;
|
|
151
|
-
(_insm$session4 =
|
|
152
|
+
(_insm$session4 = _api.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableColumnResize');
|
|
152
153
|
if (isKeyboardResize || !isTableHovered) {
|
|
153
154
|
/** if column resize had started via keyboard but continued by mouse
|
|
154
155
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -173,7 +174,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
173
174
|
var _table$attrs;
|
|
174
175
|
var map = _tableMap.TableMap.get(table);
|
|
175
176
|
var colIndex = map.colCount($cell.pos - start) + ($cell.nodeAfter ? $cell.nodeAfter.attrs.colspan : 1) - 1;
|
|
176
|
-
var selectionRect = (0,
|
|
177
|
+
var selectionRect = (0, _getSelectionRect.getSelectionRect)(state.selection);
|
|
177
178
|
var selectedColumns = selectionRect ? (0, _selection.getSelectedColumnIndexes)(selectionRect) : [];
|
|
178
179
|
// only selected (or selected - 1) columns should be distributed
|
|
179
180
|
var resizingSelectedColumns = selectedColumns.indexOf(colIndex) > -1 || selectedColumns.indexOf(colIndex + 1) > -1;
|
|
@@ -189,8 +190,8 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
189
190
|
if (colIndex === map.width - 1) {
|
|
190
191
|
var mouseUpTime = event.timeStamp;
|
|
191
192
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
192
|
-
action:
|
|
193
|
-
actionSubject:
|
|
193
|
+
action: _tableEvents.TABLE_ACTION.ATTEMPTED_TABLE_WIDTH_CHANGE,
|
|
194
|
+
actionSubject: _enums.ACTION_SUBJECT.TABLE,
|
|
194
195
|
actionSubjectId: null,
|
|
195
196
|
attributes: {
|
|
196
197
|
type: 'table-border',
|
|
@@ -198,25 +199,25 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
198
199
|
duration: mouseUpTime - mouseDownTime,
|
|
199
200
|
delta: Math.abs(resizedDelta)
|
|
200
201
|
},
|
|
201
|
-
eventType:
|
|
202
|
+
eventType: _enums.EVENT_TYPE.UI
|
|
202
203
|
})(tr);
|
|
203
204
|
}
|
|
204
205
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
205
|
-
action:
|
|
206
|
-
actionSubject:
|
|
207
|
-
eventType:
|
|
206
|
+
action: _tableEvents.TABLE_ACTION.COLUMN_RESIZED,
|
|
207
|
+
actionSubject: _enums.ACTION_SUBJECT.TABLE,
|
|
208
|
+
eventType: _enums.EVENT_TYPE.TRACK,
|
|
208
209
|
attributes: {
|
|
209
210
|
colIndex: colIndex,
|
|
210
211
|
resizedDelta: resizedDelta,
|
|
211
212
|
isLastColumn: colIndex === map.width - 1,
|
|
212
213
|
tableWidth: table.attrs.width,
|
|
213
|
-
inputMethod:
|
|
214
|
+
inputMethod: _enums.INPUT_METHOD.MOUSE,
|
|
214
215
|
totalRowCount: map.height,
|
|
215
216
|
totalColumnCount: map.width
|
|
216
217
|
}
|
|
217
218
|
})(tr);
|
|
218
219
|
}
|
|
219
|
-
(_insm$session5 =
|
|
220
|
+
(_insm$session5 = _api.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableColumnResize');
|
|
220
221
|
if (isKeyboardResize || !isTableHovered) {
|
|
221
222
|
/** if column resize had started via keyboard but continued by mouse
|
|
222
223
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.getPluginState = exports.createPluginState = exports.createCommand = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _pluginStateFactory = require("@atlaskit/editor-common/utils/plugin-state-factory");
|
|
10
10
|
var _pluginKey = require("./plugin-key");
|
|
11
11
|
var _reducer = _interopRequireDefault(require("./reducer"));
|
|
12
12
|
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; }
|
|
@@ -21,7 +21,7 @@ function mapping(tr, pluginState) {
|
|
|
21
21
|
}
|
|
22
22
|
return pluginState;
|
|
23
23
|
}
|
|
24
|
-
var factory = (0,
|
|
24
|
+
var factory = (0, _pluginStateFactory.pluginFactory)(_pluginKey.pluginKey, _reducer.default, {
|
|
25
25
|
mapping: mapping
|
|
26
26
|
});
|
|
27
27
|
var createCommand = exports.createCommand = factory.createCommand;
|