@atlaskit/editor-plugin-table 2.6.4 → 2.6.5
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 +7 -0
- package/dist/cjs/plugins/table/commands/clear.js +3 -3
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +5 -5
- package/dist/cjs/plugins/table/commands/insert.js +19 -19
- package/dist/cjs/plugins/table/commands/misc.js +4 -4
- package/dist/cjs/plugins/table/commands/selection.js +5 -5
- package/dist/cjs/plugins/table/commands/sort.js +2 -2
- package/dist/cjs/plugins/table/event-handlers.js +4 -4
- package/dist/cjs/plugins/table/handlers.js +5 -5
- package/dist/cjs/plugins/table/nodeviews/table.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +5 -5
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +10 -10
- package/dist/cjs/plugins/table/pm-plugins/main.js +12 -12
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +7 -7
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin-key.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin-key.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +4 -4
- package/dist/cjs/plugins/table/toolbar.js +12 -12
- package/dist/cjs/plugins/table/transforms/delete-columns.js +4 -4
- package/dist/cjs/plugins/table/transforms/delete-rows.js +2 -2
- package/dist/cjs/plugins/table/transforms/merge.js +5 -5
- package/dist/cjs/plugins/table/transforms/replace-table.js +4 -4
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +4 -4
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +6 -6
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +2 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +3 -3
- package/dist/cjs/plugins/table/utils/collapse.js +4 -4
- package/dist/cjs/plugins/table/utils/column-controls.js +8 -8
- package/dist/cjs/plugins/table/utils/decoration.js +8 -8
- package/dist/cjs/plugins/table/utils/nodes.js +6 -6
- package/dist/cjs/plugins/table/utils/paste.js +7 -7
- package/dist/cjs/plugins/table/utils/row-controls.js +7 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/clear.js +2 -1
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +2 -1
- package/dist/es2019/plugins/table/commands/insert.js +2 -2
- package/dist/es2019/plugins/table/commands/misc.js +1 -1
- package/dist/es2019/plugins/table/commands/selection.js +1 -1
- package/dist/es2019/plugins/table/commands/sort.js +1 -1
- package/dist/es2019/plugins/table/event-handlers.js +1 -1
- package/dist/es2019/plugins/table/handlers.js +3 -3
- package/dist/es2019/plugins/table/nodeviews/table.js +1 -1
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +3 -3
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin-key.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin-key.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-width.js +3 -2
- package/dist/es2019/plugins/table/toolbar.js +1 -1
- package/dist/es2019/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/es2019/plugins/table/transforms/delete-rows.js +1 -1
- package/dist/es2019/plugins/table/transforms/merge.js +2 -2
- package/dist/es2019/plugins/table/transforms/replace-table.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/es2019/plugins/table/utils/collapse.js +2 -2
- package/dist/es2019/plugins/table/utils/column-controls.js +1 -1
- package/dist/es2019/plugins/table/utils/decoration.js +3 -2
- package/dist/es2019/plugins/table/utils/nodes.js +1 -1
- package/dist/es2019/plugins/table/utils/paste.js +2 -2
- package/dist/es2019/plugins/table/utils/row-controls.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/clear.js +2 -1
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +2 -1
- package/dist/esm/plugins/table/commands/insert.js +2 -2
- package/dist/esm/plugins/table/commands/misc.js +1 -1
- package/dist/esm/plugins/table/commands/selection.js +1 -1
- package/dist/esm/plugins/table/commands/sort.js +1 -1
- package/dist/esm/plugins/table/event-handlers.js +1 -1
- package/dist/esm/plugins/table/handlers.js +3 -3
- package/dist/esm/plugins/table/nodeviews/table.js +1 -1
- package/dist/esm/plugins/table/nodeviews/tableCell.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +3 -3
- package/dist/esm/plugins/table/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/plugin-key.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin-key.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin-factory.js +0 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin-key.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-width.js +3 -2
- package/dist/esm/plugins/table/toolbar.js +1 -1
- package/dist/esm/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/esm/plugins/table/transforms/delete-rows.js +1 -1
- package/dist/esm/plugins/table/transforms/merge.js +2 -2
- package/dist/esm/plugins/table/transforms/replace-table.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +1 -1
- package/dist/esm/plugins/table/utils/collapse.js +2 -2
- package/dist/esm/plugins/table/utils/column-controls.js +1 -1
- package/dist/esm/plugins/table/utils/decoration.js +3 -2
- package/dist/esm/plugins/table/utils/nodes.js +1 -1
- package/dist/esm/plugins/table/utils/paste.js +2 -2
- package/dist/esm/plugins/table/utils/row-controls.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands/insert.d.ts +2 -2
- package/dist/types/plugins/table/commands/misc.d.ts +4 -4
- package/dist/types/plugins/table/commands/referentiality.d.ts +1 -1
- package/dist/types/plugins/table/event-handlers.d.ts +2 -2
- package/dist/types/plugins/table/handlers.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +3 -3
- package/dist/types/plugins/table/nodeviews/table.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/types.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/decorations/utils/types.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/commands.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types/plugins/table/toolbar.d.ts +2 -2
- package/dist/types/plugins/table/transforms/column-width.d.ts +4 -4
- package/dist/types/plugins/table/transforms/delete-columns.d.ts +1 -1
- package/dist/types/plugins/table/transforms/delete-rows.d.ts +1 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -3
- package/dist/types/plugins/table/transforms/merge.d.ts +2 -2
- package/dist/types/plugins/table/transforms/replace-table.d.ts +2 -2
- package/dist/types/plugins/table/transforms/split.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +3 -3
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +2 -2
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +2 -2
- package/dist/types/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types/plugins/table/utils/column-controls.d.ts +2 -2
- package/dist/types/plugins/table/utils/decoration.d.ts +3 -3
- package/dist/types/plugins/table/utils/get-allow-add-column-custom-step.d.ts +1 -1
- package/dist/types/plugins/table/utils/nodes.d.ts +2 -2
- package/dist/types/plugins/table/utils/paste.d.ts +2 -2
- package/dist/types/plugins/table/utils/row-controls.d.ts +2 -2
- package/dist/types/plugins/table/utils/selection.d.ts +1 -1
- package/dist/types/plugins/table/utils/table.d.ts +1 -1
- package/dist/types/plugins/table/utils/update-plugin-state-decorations.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/table.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +2 -2
- package/package.json +3 -10
- package/src/__tests__/integration/resize.ts +1 -2
- package/src/__tests__/unit/commands/go-to-next-cell.ts +1 -2
- package/src/__tests__/unit/commands/insert.ts +1 -2
- package/src/__tests__/unit/commands/misc.ts +1 -2
- package/src/__tests__/unit/commands.ts +4 -5
- package/src/__tests__/unit/copy-paste.ts +15 -8
- package/src/__tests__/unit/event-handlers/index.ts +1 -2
- package/src/__tests__/unit/event-handlers.ts +1 -2
- package/src/__tests__/unit/get-toolbar-config.ts +1 -2
- package/src/__tests__/unit/handlers.ts +1 -2
- package/src/__tests__/unit/hover-selection.ts +2 -3
- package/src/__tests__/unit/index.ts +1 -2
- package/src/__tests__/unit/layout.ts +1 -2
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +1 -1
- package/src/__tests__/unit/nodeviews/table.ts +2 -3
- package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +1 -2
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +3 -4
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +2 -3
- package/src/__tests__/unit/pm-plugins/main.ts +8 -7
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +2 -2
- package/src/__tests__/unit/pm-plugins/table-local-id.ts +5 -2
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +2 -3
- package/src/__tests__/unit/sort-column.ts +1 -2
- package/src/__tests__/unit/transforms/delete-columns.ts +1 -2
- package/src/__tests__/unit/transforms/delete-rows.ts +1 -2
- package/src/__tests__/unit/transforms/merging.ts +1 -2
- package/src/__tests__/unit/ui/ContextualMenu.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +7 -5
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +7 -5
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +1 -1
- package/src/__tests__/unit/undo-redo.ts +2 -2
- package/src/__tests__/unit/utils.ts +1 -2
- package/src/plugins/table/commands/clear.ts +1 -2
- package/src/plugins/table/commands/go-to-next-cell.ts +1 -1
- package/src/plugins/table/commands/insert.ts +3 -4
- package/src/plugins/table/commands/misc.ts +8 -5
- package/src/plugins/table/commands/referentiality.ts +1 -2
- package/src/plugins/table/commands/selection.ts +5 -3
- package/src/plugins/table/commands/sort.ts +6 -3
- package/src/plugins/table/commands/toggle.ts +1 -1
- package/src/plugins/table/commands-with-analytics.ts +1 -2
- package/src/plugins/table/event-handlers.ts +8 -9
- package/src/plugins/table/handlers.ts +10 -5
- package/src/plugins/table/index.tsx +2 -3
- package/src/plugins/table/nodeviews/TableComponent.tsx +2 -2
- package/src/plugins/table/nodeviews/TableContainer.tsx +2 -2
- package/src/plugins/table/nodeviews/TableResizer.tsx +3 -3
- package/src/plugins/table/nodeviews/table.tsx +7 -8
- package/src/plugins/table/nodeviews/tableCell.tsx +2 -2
- package/src/plugins/table/nodeviews/types.ts +2 -3
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +3 -4
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +5 -3
- package/src/plugins/table/pm-plugins/decorations/utils/column-resizing.ts +1 -1
- package/src/plugins/table/pm-plugins/decorations/utils/compose-decorations.ts +1 -1
- package/src/plugins/table/pm-plugins/decorations/utils/types.ts +5 -2
- package/src/plugins/table/pm-plugins/keymap.ts +2 -3
- package/src/plugins/table/pm-plugins/main.ts +11 -8
- package/src/plugins/table/pm-plugins/plugin-key.ts +1 -1
- package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +6 -3
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +2 -2
- package/src/plugins/table/pm-plugins/sticky-headers/plugin-key.ts +1 -1
- package/src/plugins/table/pm-plugins/table-local-id.ts +2 -2
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +3 -4
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +1 -2
- package/src/plugins/table/pm-plugins/table-resizing/plugin-factory.ts +1 -2
- package/src/plugins/table/pm-plugins/table-resizing/plugin-key.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +4 -2
- package/src/plugins/table/pm-plugins/table-resizing/utils/column-state.ts +2 -3
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +2 -3
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +7 -4
- package/src/plugins/table/pm-plugins/table-resizing/utils/resize-state.ts +2 -3
- package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +3 -4
- package/src/plugins/table/pm-plugins/table-resizing/utils/types.ts +1 -1
- package/src/plugins/table/pm-plugins/table-selection-keymap.ts +1 -2
- package/src/plugins/table/pm-plugins/table-width.ts +2 -2
- package/src/plugins/table/toolbar.tsx +4 -4
- package/src/plugins/table/transforms/column-width.ts +4 -5
- package/src/plugins/table/transforms/delete-columns.ts +2 -3
- package/src/plugins/table/transforms/delete-rows.ts +2 -3
- package/src/plugins/table/transforms/fix-tables.ts +3 -4
- package/src/plugins/table/transforms/merge.ts +2 -3
- package/src/plugins/table/transforms/replace-table.ts +6 -3
- package/src/plugins/table/transforms/split.ts +2 -3
- package/src/plugins/table/types.ts +3 -3
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +3 -3
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +1 -1
- package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +2 -2
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +2 -2
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +3 -3
- package/src/plugins/table/ui/LayoutButton/index.tsx +2 -2
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +1 -1
- package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +2 -3
- package/src/plugins/table/ui/TableFloatingControls/RowControls/index.tsx +2 -1
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +2 -3
- package/src/plugins/table/utils/analytics.ts +1 -2
- package/src/plugins/table/utils/collapse.ts +6 -4
- package/src/plugins/table/utils/column-controls.ts +3 -4
- package/src/plugins/table/utils/decoration.ts +9 -6
- package/src/plugins/table/utils/get-allow-add-column-custom-step.ts +1 -1
- package/src/plugins/table/utils/nodes.ts +3 -4
- package/src/plugins/table/utils/paste.ts +8 -4
- package/src/plugins/table/utils/row-controls.ts +3 -4
- package/src/plugins/table/utils/selection.ts +1 -2
- package/src/plugins/table/utils/table.ts +1 -2
- package/src/plugins/table/utils/update-plugin-state-decorations.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 2.6.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 2.6.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.clearSelection = exports.clearMultipleCells = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
9
9
|
// #region Imports
|
|
10
10
|
|
|
@@ -29,7 +29,7 @@ var clearMultipleCells = function clearMultipleCells(targetCellPosition) {
|
|
|
29
29
|
}
|
|
30
30
|
if (tr.docChanged && cursorPos) {
|
|
31
31
|
var $pos = tr.doc.resolve(tr.mapping.map(cursorPos));
|
|
32
|
-
var textSelection =
|
|
32
|
+
var textSelection = _state.Selection.findFrom($pos, 1, true);
|
|
33
33
|
if (textSelection) {
|
|
34
34
|
tr.setSelection(textSelection);
|
|
35
35
|
}
|
|
@@ -44,7 +44,7 @@ var clearMultipleCells = function clearMultipleCells(targetCellPosition) {
|
|
|
44
44
|
exports.clearMultipleCells = clearMultipleCells;
|
|
45
45
|
var clearSelection = function clearSelection(state, dispatch) {
|
|
46
46
|
if (dispatch) {
|
|
47
|
-
dispatch(state.tr.setSelection(
|
|
47
|
+
dispatch(state.tr.setSelection(_state.Selection.near(state.selection.$from)).setMeta('addToHistory', false));
|
|
48
48
|
}
|
|
49
49
|
return true;
|
|
50
50
|
};
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.goToNextCell = void 0;
|
|
7
|
-
var _prosemirrorUtils = require("prosemirror-utils");
|
|
8
7
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
9
9
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
|
-
var
|
|
10
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
11
11
|
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
12
12
|
// #region Constants
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ var TAB_BACKWARD_DIRECTION = -1;
|
|
|
16
16
|
var goToNextCell = function goToNextCell(editorAnalyticsAPI) {
|
|
17
17
|
return function (direction) {
|
|
18
18
|
return function (state, dispatch) {
|
|
19
|
-
var table = (0,
|
|
19
|
+
var table = (0, _utils2.findTable)(state.selection);
|
|
20
20
|
if (!table) {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
@@ -24,7 +24,7 @@ var goToNextCell = function goToNextCell(editorAnalyticsAPI) {
|
|
|
24
24
|
var _state$schema$nodes = state.schema.nodes,
|
|
25
25
|
tableCell = _state$schema$nodes.tableCell,
|
|
26
26
|
tableHeader = _state$schema$nodes.tableHeader;
|
|
27
|
-
var cell = (0,
|
|
27
|
+
var cell = (0, _utils.findParentNodeOfType)([tableCell, tableHeader])(state.selection);
|
|
28
28
|
var firstCellPos = map.positionAt(0, 0, table.node) + table.start;
|
|
29
29
|
var lastCellPos = map.positionAt(map.height - 1, map.width - 1, table.node) + table.start;
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ var goToNextCell = function goToNextCell(editorAnalyticsAPI) {
|
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
48
|
if (dispatch) {
|
|
49
|
-
return (0,
|
|
49
|
+
return (0, _utils2.goToNextCell)(direction)(state, dispatch);
|
|
50
50
|
}
|
|
51
51
|
return true;
|
|
52
52
|
};
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.addColumnAfter = void 0;
|
|
7
7
|
exports.addColumnAt = addColumnAt;
|
|
8
8
|
exports.insertRow = exports.insertColumn = exports.createTable = exports.addColumnBefore = void 0;
|
|
9
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
10
|
-
var _prosemirrorUtils = require("prosemirror-utils");
|
|
11
9
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
10
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
|
-
var
|
|
13
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
14
14
|
var _columnWidth = require("../transforms/column-width");
|
|
15
|
-
var
|
|
15
|
+
var _utils3 = require("../utils");
|
|
16
16
|
var _getAllowAddColumnCustomStep = require("../utils/get-allow-add-column-custom-step");
|
|
17
17
|
// #region Imports
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ var _getAllowAddColumnCustomStep = require("../utils/get-allow-add-column-custom
|
|
|
20
20
|
|
|
21
21
|
function addColumnAtCustomStep(column) {
|
|
22
22
|
return function (tr) {
|
|
23
|
-
var table = (0,
|
|
23
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
24
24
|
if (table) {
|
|
25
25
|
return tr.step(_steps.AddColumnStep.create(tr.doc, table.pos, column));
|
|
26
26
|
}
|
|
@@ -36,9 +36,9 @@ function addColumnAt(getEditorContainerWidth) {
|
|
|
36
36
|
if (allowAddColumnCustomStep) {
|
|
37
37
|
updatedTr = addColumnAtCustomStep(column)(updatedTr);
|
|
38
38
|
} else {
|
|
39
|
-
updatedTr = (0,
|
|
39
|
+
updatedTr = (0, _utils2.addColumnAt)(column)(updatedTr);
|
|
40
40
|
}
|
|
41
|
-
var table = (0,
|
|
41
|
+
var table = (0, _utils2.findTable)(updatedTr.selection);
|
|
42
42
|
if (table) {
|
|
43
43
|
// [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
|
|
44
44
|
updatedTr = (0, _columnWidth.rescaleColumns)(getEditorContainerWidth)(table, view)(updatedTr);
|
|
@@ -52,12 +52,12 @@ function addColumnAt(getEditorContainerWidth) {
|
|
|
52
52
|
// Command to add a column before the column with the selection.
|
|
53
53
|
var addColumnBefore = function addColumnBefore(getEditorContainerWidth) {
|
|
54
54
|
return function (state, dispatch, view) {
|
|
55
|
-
var table = (0,
|
|
55
|
+
var table = (0, _utils2.findTable)(state.selection);
|
|
56
56
|
if (!table) {
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
59
|
if (dispatch) {
|
|
60
|
-
var rect = (0,
|
|
60
|
+
var rect = (0, _utils2.selectedRect)(state);
|
|
61
61
|
dispatch(addColumnAt(getEditorContainerWidth)(rect.left, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
62
62
|
}
|
|
63
63
|
return true;
|
|
@@ -69,12 +69,12 @@ var addColumnBefore = function addColumnBefore(getEditorContainerWidth) {
|
|
|
69
69
|
exports.addColumnBefore = addColumnBefore;
|
|
70
70
|
var addColumnAfter = function addColumnAfter(getEditorContainerWidth) {
|
|
71
71
|
return function (state, dispatch, view) {
|
|
72
|
-
var table = (0,
|
|
72
|
+
var table = (0, _utils2.findTable)(state.selection);
|
|
73
73
|
if (!table) {
|
|
74
74
|
return false;
|
|
75
75
|
}
|
|
76
76
|
if (dispatch) {
|
|
77
|
-
var rect = (0,
|
|
77
|
+
var rect = (0, _utils2.selectedRect)(state);
|
|
78
78
|
dispatch(addColumnAt(getEditorContainerWidth)(rect.right, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
79
79
|
}
|
|
80
80
|
return true;
|
|
@@ -87,14 +87,14 @@ var insertColumn = function insertColumn(getEditorContainerWidth) {
|
|
|
87
87
|
return function (column) {
|
|
88
88
|
return function (state, dispatch, view) {
|
|
89
89
|
var tr = addColumnAt(getEditorContainerWidth)(column, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr);
|
|
90
|
-
var table = (0,
|
|
90
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
91
91
|
if (!table) {
|
|
92
92
|
return false;
|
|
93
93
|
}
|
|
94
94
|
// move the cursor to the newly created column
|
|
95
95
|
var pos = _tableMap.TableMap.get(table.node).positionAt(0, column, table.node);
|
|
96
96
|
if (dispatch) {
|
|
97
|
-
dispatch(tr.setSelection(
|
|
97
|
+
dispatch(tr.setSelection(_state.Selection.near(tr.doc.resolve(table.start + pos))));
|
|
98
98
|
}
|
|
99
99
|
return true;
|
|
100
100
|
};
|
|
@@ -104,7 +104,7 @@ exports.insertColumn = insertColumn;
|
|
|
104
104
|
var insertRow = function insertRow(row, moveCursorToTheNewRow) {
|
|
105
105
|
return function (state, dispatch) {
|
|
106
106
|
// Don't clone the header row
|
|
107
|
-
var headerRowEnabled = (0,
|
|
107
|
+
var headerRowEnabled = (0, _utils3.checkIfHeaderRowEnabled)(state.selection);
|
|
108
108
|
var clonePreviousRow = headerRowEnabled && row > 1 || !headerRowEnabled && row > 0;
|
|
109
109
|
|
|
110
110
|
// When the table have header row
|
|
@@ -112,8 +112,8 @@ var insertRow = function insertRow(row, moveCursorToTheNewRow) {
|
|
|
112
112
|
if (row === 0 && headerRowEnabled) {
|
|
113
113
|
return false;
|
|
114
114
|
}
|
|
115
|
-
var tr = clonePreviousRow ? (0,
|
|
116
|
-
var table = (0,
|
|
115
|
+
var tr = clonePreviousRow ? (0, _utils3.copyPreviousRow)(state.schema)(row)(state.tr) : (0, _utils2.addRowAt)(row)(state.tr);
|
|
116
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
117
117
|
if (!table) {
|
|
118
118
|
return false;
|
|
119
119
|
}
|
|
@@ -122,7 +122,7 @@ var insertRow = function insertRow(row, moveCursorToTheNewRow) {
|
|
|
122
122
|
if (moveCursorToTheNewRow) {
|
|
123
123
|
// move the cursor to the newly created row
|
|
124
124
|
var pos = _tableMap.TableMap.get(table.node).positionAt(row, 0, table.node);
|
|
125
|
-
tr.setSelection(
|
|
125
|
+
tr.setSelection(_state.Selection.near(tr.doc.resolve(table.start + pos)));
|
|
126
126
|
} else {
|
|
127
127
|
tr.setSelection(selection.map(tr.doc, tr.mapping));
|
|
128
128
|
}
|
|
@@ -134,11 +134,11 @@ var insertRow = function insertRow(row, moveCursorToTheNewRow) {
|
|
|
134
134
|
exports.insertRow = insertRow;
|
|
135
135
|
var createTable = function createTable() {
|
|
136
136
|
return function (state, dispatch) {
|
|
137
|
-
var table = (0,
|
|
137
|
+
var table = (0, _utils2.createTable)({
|
|
138
138
|
schema: state.schema
|
|
139
139
|
});
|
|
140
140
|
if (dispatch) {
|
|
141
|
-
dispatch((0,
|
|
141
|
+
dispatch((0, _utils.safeInsert)(table)(state.tr).scrollIntoView());
|
|
142
142
|
}
|
|
143
143
|
return true;
|
|
144
144
|
};
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.triggerUnlessTableHeader = exports.transformSliceToRemoveColumnsWidths = exports.transformSliceToAddTableHeaders = exports.transformSliceRemoveCellBackgroundColor = exports.showInsertRowButton = exports.showInsertColumnButton = exports.setTableRef = exports.setMultipleCellAttrs = exports.setEditorFocus = exports.setCellAttr = exports.selectRow = exports.selectColumn = exports.moveCursorBackward = exports.hideInsertColumnOrRowButton = exports.deleteTableIfSelected = exports.deleteTable = exports.convertFirstRowToHeader = exports.autoSizeTable = exports.addResizeHandleDecorations = exports.addBoldInEmptyHeaderCells = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
10
9
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
12
12
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
13
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
@@ -101,7 +101,7 @@ var triggerUnlessTableHeader = function triggerUnlessTableHeader(command) {
|
|
|
101
101
|
return function (state, dispatch, view) {
|
|
102
102
|
var selection = state.selection,
|
|
103
103
|
tableHeader = state.schema.nodes.tableHeader;
|
|
104
|
-
if (selection instanceof
|
|
104
|
+
if (selection instanceof _state.TextSelection) {
|
|
105
105
|
var cell = (0, _utils2.findCellClosestToPos)(selection.$from);
|
|
106
106
|
if (cell && cell.node.type !== tableHeader) {
|
|
107
107
|
return command(state, dispatch, view);
|
|
@@ -234,7 +234,7 @@ var moveCursorBackward = function moveCursorBackward(state, dispatch) {
|
|
|
234
234
|
var tr = state.tr;
|
|
235
235
|
var lastCellPos = (cut || 0) - 4;
|
|
236
236
|
// need to move cursor inside the table to be able to calculate table's offset
|
|
237
|
-
tr.setSelection(new
|
|
237
|
+
tr.setSelection(new _state.TextSelection(state.doc.resolve(lastCellPos)));
|
|
238
238
|
var $from = tr.selection.$from;
|
|
239
239
|
var start = $from.start(-1);
|
|
240
240
|
var pos = start + $from.parent.nodeSize - 1;
|
|
@@ -242,7 +242,7 @@ var moveCursorBackward = function moveCursorBackward(state, dispatch) {
|
|
|
242
242
|
// move cursor to the last cell
|
|
243
243
|
// it doesn't join node before (last cell) with node after (content after the cursor)
|
|
244
244
|
// due to ridiculous amount of PM code that would have been required to overwrite
|
|
245
|
-
tr.setSelection(new
|
|
245
|
+
tr.setSelection(new _state.TextSelection(state.doc.resolve(pos)));
|
|
246
246
|
|
|
247
247
|
// if we are inside an empty paragraph not at the end of the doc we delete it
|
|
248
248
|
var cursorNode = $cursor.node();
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.arrowRightFromTable = exports.arrowLeftFromTable = exports.TableSelectionDirection = void 0;
|
|
7
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
8
7
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
8
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
10
10
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
11
11
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
@@ -23,7 +23,7 @@ var arrowLeftFromTable = function arrowLeftFromTable(editorSelectionAPI) {
|
|
|
23
23
|
return arrowLeftFromCellSelection(editorSelectionAPI)(selection)(state, dispatch);
|
|
24
24
|
} else if (selection instanceof _selection.GapCursorSelection) {
|
|
25
25
|
return arrowLeftFromGapCursor(editorSelectionAPI)(selection)(state, dispatch);
|
|
26
|
-
} else if (selection instanceof
|
|
26
|
+
} else if (selection instanceof _state.TextSelection) {
|
|
27
27
|
return arrowLeftFromText(editorSelectionAPI)(selection)(state, dispatch);
|
|
28
28
|
}
|
|
29
29
|
return false;
|
|
@@ -39,7 +39,7 @@ var arrowRightFromTable = function arrowRightFromTable(editorSelectionAPI) {
|
|
|
39
39
|
return arrowRightFromCellSelection(editorSelectionAPI)(selection)(state, dispatch);
|
|
40
40
|
} else if (selection instanceof _selection.GapCursorSelection) {
|
|
41
41
|
return arrowRightFromGapCursor(editorSelectionAPI)(selection)(state, dispatch);
|
|
42
|
-
} else if (selection instanceof
|
|
42
|
+
} else if (selection instanceof _state.TextSelection) {
|
|
43
43
|
return arrowRightFromText(editorSelectionAPI)(selection)(state, dispatch);
|
|
44
44
|
}
|
|
45
45
|
return false;
|
|
@@ -256,7 +256,7 @@ var setSelectionAtStartOfFirstCell = function setSelectionAtStartOfFirstCell(edi
|
|
|
256
256
|
var $firstPosInsideCell = state.doc.resolve($firstCell.pos + 1);
|
|
257
257
|
|
|
258
258
|
// check if first pos should have a gap cursor, otherwise find closest text selection
|
|
259
|
-
var selectionAtStartOfCell = _selection.GapCursorSelection.valid($firstPosInsideCell) ? new _selection.GapCursorSelection($firstPosInsideCell, _selection.Side.LEFT) :
|
|
259
|
+
var selectionAtStartOfCell = _selection.GapCursorSelection.valid($firstPosInsideCell) ? new _selection.GapCursorSelection($firstPosInsideCell, _selection.Side.LEFT) : _state.Selection.findFrom($firstPosInsideCell, 1);
|
|
260
260
|
if (editorSelectionAPI) {
|
|
261
261
|
var tr = editorSelectionAPI.setSelectionRelativeToNode({
|
|
262
262
|
selectionRelativeToNode: selectionRelativeToNode,
|
|
@@ -281,7 +281,7 @@ var setSelectionAtEndOfLastCell = function setSelectionAtEndOfLastCell(editorSel
|
|
|
281
281
|
var $lastPosInsideCell = state.doc.resolve(lastPosInsideCell);
|
|
282
282
|
|
|
283
283
|
// check if last pos should have a gap cursor, otherwise find closest text selection
|
|
284
|
-
var selectionAtEndOfCell = _selection.GapCursorSelection.valid($lastPosInsideCell) ? new _selection.GapCursorSelection($lastPosInsideCell, _selection.Side.RIGHT) :
|
|
284
|
+
var selectionAtEndOfCell = _selection.GapCursorSelection.valid($lastPosInsideCell) ? new _selection.GapCursorSelection($lastPosInsideCell, _selection.Side.RIGHT) : _state.Selection.findFrom($lastPosInsideCell, -1);
|
|
285
285
|
if (editorSelectionAPI) {
|
|
286
286
|
var tr = editorSelectionAPI.setSelectionRelativeToNode({
|
|
287
287
|
selectionRelativeToNode: selectionRelativeToNode,
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.sortByColumn = void 0;
|
|
7
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
8
7
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
9
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
11
11
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
12
12
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
@@ -65,7 +65,7 @@ var sortByColumn = function sortByColumn(columnIndex) {
|
|
|
65
65
|
order: order
|
|
66
66
|
};
|
|
67
67
|
tr.step(new _steps.TableSortStep(table.pos, prev, next));
|
|
68
|
-
return tr.setSelection(
|
|
68
|
+
return tr.setSelection(_state.Selection.near(tr.doc.resolve(table.start + pos)));
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
exports.sortByColumn = sortByColumn;
|
|
@@ -8,9 +8,9 @@ exports.handleMouseOver = exports.handleMouseOut = exports.handleMouseMove = exp
|
|
|
8
8
|
exports.handleTripleClick = handleTripleClick;
|
|
9
9
|
exports.whenTableInFocus = void 0;
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
12
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
+
var _state5 = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
15
15
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
16
16
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
@@ -262,10 +262,10 @@ function handleTripleClick(view, pos) {
|
|
|
262
262
|
}
|
|
263
263
|
var cell = state.doc.nodeAt($cellPos.pos);
|
|
264
264
|
if (cell) {
|
|
265
|
-
var selFrom =
|
|
266
|
-
var selTo =
|
|
265
|
+
var selFrom = _state5.Selection.findFrom($cellPos, 1, true);
|
|
266
|
+
var selTo = _state5.Selection.findFrom(state.doc.resolve($cellPos.pos + cell.nodeSize), -1, true);
|
|
267
267
|
if (selFrom && selTo) {
|
|
268
|
-
dispatch(state.tr.setSelection(new
|
|
268
|
+
dispatch(state.tr.setSelection(new _state5.TextSelection(selFrom.$from, selTo.$to)));
|
|
269
269
|
return true;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.handleDocOrSelectionChanged = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _prosemirrorUtils = require("prosemirror-utils");
|
|
10
9
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
11
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
|
-
var _utils2 = require("@atlaskit/editor-
|
|
11
|
+
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
12
|
+
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
13
13
|
var _defaultTableSelection = require("./pm-plugins/default-table-selection");
|
|
14
14
|
var _tableResizing = require("./pm-plugins/table-resizing");
|
|
15
15
|
var _collapse = require("./utils/collapse");
|
|
@@ -42,7 +42,7 @@ var updateTargetCellPosition = function updateTargetCellPosition(_ref) {
|
|
|
42
42
|
var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
|
|
43
43
|
tableCell = _tr$doc$type$schema$n.tableCell,
|
|
44
44
|
tableHeader = _tr$doc$type$schema$n.tableHeader;
|
|
45
|
-
var cell = (0,
|
|
45
|
+
var cell = (0, _utils2.findParentNodeOfType)([tableCell, tableHeader])(tr.selection);
|
|
46
46
|
var targetCellPosition = cell ? cell.pos : undefined;
|
|
47
47
|
if (pluginState.targetCellPosition === targetCellPosition) {
|
|
48
48
|
return pluginState;
|
|
@@ -88,7 +88,7 @@ var updateCollapseHandler = function updateCollapseHandler(_ref3) {
|
|
|
88
88
|
return pluginState;
|
|
89
89
|
}
|
|
90
90
|
var expandNodeType = schema.nodes.expand;
|
|
91
|
-
var isTableCollapsed = expandNodeType && !!(0,
|
|
91
|
+
var isTableCollapsed = expandNodeType && !!(0, _utils2.findParentNodeOfType)(expandNodeType)(tr.selection);
|
|
92
92
|
var trCanBeCollapsed = (0, _collapse.isTableCollapsible)(tr).tableIsCollapsible;
|
|
93
93
|
|
|
94
94
|
// We're focused on a table + we're not inside an expand
|
|
@@ -121,7 +121,7 @@ var buildPluginState = function buildPluginState(builders) {
|
|
|
121
121
|
var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, pluginState) {
|
|
122
122
|
return buildPluginState([updateTargetCellPosition, updateTableNodePluginState, updateCollapseHandler])({
|
|
123
123
|
tr: tr,
|
|
124
|
-
table: (0,
|
|
124
|
+
table: (0, _utils3.findTable)(tr.selection)
|
|
125
125
|
})(pluginState);
|
|
126
126
|
};
|
|
127
127
|
exports.handleDocOrSelectionChanged = handleDocOrSelectionChanged;
|
|
@@ -16,10 +16,10 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
-
var _prosemirrorModel = require("prosemirror-model");
|
|
20
19
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
21
20
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
22
21
|
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
22
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
23
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
24
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
25
25
|
var _createPluginConfig = require("../create-plugin-config");
|
|
@@ -73,7 +73,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
73
73
|
(0, _createClass2.default)(TableView, [{
|
|
74
74
|
key: "getContentDOM",
|
|
75
75
|
value: function getContentDOM() {
|
|
76
|
-
var rendered =
|
|
76
|
+
var rendered = _model.DOMSerializer.renderSpec(document, toDOM(this.node, this.reactComponentProps));
|
|
77
77
|
if (rendered.dom) {
|
|
78
78
|
this.table = rendered.dom;
|
|
79
79
|
}
|
|
@@ -8,9 +8,9 @@ exports.default = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _prosemirrorModel = require("prosemirror-model");
|
|
12
11
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
13
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
14
|
var DEFAULT_COL_SPAN = 1;
|
|
15
15
|
var DEFAULT_ROW_SPAN = 1;
|
|
16
16
|
var TableCellNodeView = /*#__PURE__*/function () {
|
|
@@ -18,7 +18,7 @@ var TableCellNodeView = /*#__PURE__*/function () {
|
|
|
18
18
|
(0, _classCallCheck2.default)(this, TableCellNodeView);
|
|
19
19
|
this.view = view;
|
|
20
20
|
this.node = node;
|
|
21
|
-
var _DOMSerializer$render =
|
|
21
|
+
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node)),
|
|
22
22
|
dom = _DOMSerializer$render.dom,
|
|
23
23
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
24
24
|
this.getPos = getPos;
|
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.pluginKey = exports.handleDocOrSelectionChanged = exports.getDecorations = exports.createPlugin = void 0;
|
|
7
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
8
|
-
var _prosemirrorView = require("prosemirror-view");
|
|
9
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
|
+
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
10
10
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
11
11
|
var _pluginKey = require("../plugin-key");
|
|
12
12
|
var _tableWidth = require("../table-width");
|
|
13
13
|
var _utils = require("./utils");
|
|
14
|
-
var pluginKey = new
|
|
14
|
+
var pluginKey = new _state.PluginKey('tableDecorationsPlugin');
|
|
15
15
|
exports.pluginKey = pluginKey;
|
|
16
16
|
var getDecorations = function getDecorations(state) {
|
|
17
17
|
return pluginKey.getState(state);
|
|
@@ -25,7 +25,7 @@ var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decor
|
|
|
25
25
|
|
|
26
26
|
// Remove column controls when resizing
|
|
27
27
|
if (isResizing) {
|
|
28
|
-
return
|
|
28
|
+
return _view.DecorationSet.empty;
|
|
29
29
|
} else if (tr.docChanged || tr.selection instanceof _cellSelection.CellSelection || changedResizing) {
|
|
30
30
|
return (0, _utils.buildColumnControlsDecorations)({
|
|
31
31
|
decorationSet: decorationSet,
|
|
@@ -47,7 +47,7 @@ var createPlugin = function createPlugin() {
|
|
|
47
47
|
return new _safePlugin.SafePlugin({
|
|
48
48
|
state: {
|
|
49
49
|
init: function init() {
|
|
50
|
-
return
|
|
50
|
+
return _view.DecorationSet.empty;
|
|
51
51
|
},
|
|
52
52
|
apply: function apply(tr, decorationSet, oldState, newState) {
|
|
53
53
|
var pluginState = decorationSet;
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
exports.keymapPlugin = keymapPlugin;
|
|
9
|
-
var _prosemirrorCommands = require("prosemirror-commands");
|
|
10
|
-
var _prosemirrorKeymap = require("prosemirror-keymap");
|
|
11
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
10
|
var keymaps = _interopRequireWildcard(require("@atlaskit/editor-common/keymaps"));
|
|
13
|
-
var _commands = require("
|
|
11
|
+
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
12
|
+
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
13
|
+
var _commands2 = require("../commands");
|
|
14
14
|
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
15
15
|
var _insert = require("../commands/insert");
|
|
16
16
|
var _analytics2 = require("../utils/analytics");
|
|
@@ -25,22 +25,22 @@ var createTableWithAnalytics = function createTableWithAnalytics(editorAnalytics
|
|
|
25
25
|
inputMethod: _analytics.INPUT_METHOD.SHORTCUT
|
|
26
26
|
},
|
|
27
27
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
28
|
-
})(editorAnalyticsAPI)((0,
|
|
28
|
+
})(editorAnalyticsAPI)((0, _commands2.createTable)());
|
|
29
29
|
};
|
|
30
30
|
function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI) {
|
|
31
31
|
var list = {};
|
|
32
|
-
keymaps.bindKeymapWithCommand(keymaps.nextCell.common, (0,
|
|
33
|
-
keymaps.bindKeymapWithCommand(keymaps.previousCell.common, (0,
|
|
32
|
+
keymaps.bindKeymapWithCommand(keymaps.nextCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI)(1), list);
|
|
33
|
+
keymaps.bindKeymapWithCommand(keymaps.previousCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI)(-1), list);
|
|
34
34
|
keymaps.bindKeymapWithCommand(keymaps.toggleTable.common, createTableWithAnalytics(editorAnalyticsAPI), list);
|
|
35
|
-
keymaps.bindKeymapWithCommand(keymaps.backspace.common, (0,
|
|
36
|
-
keymaps.bindKeymapWithCommand(keymaps.backspace.common,
|
|
35
|
+
keymaps.bindKeymapWithCommand(keymaps.backspace.common, (0, _commands.chainCommands)((0, _commandsWithAnalytics.deleteTableIfSelectedWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), (0, _commandsWithAnalytics.emptyMultipleCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)), list);
|
|
36
|
+
keymaps.bindKeymapWithCommand(keymaps.backspace.common, _commands2.moveCursorBackward, list);
|
|
37
37
|
|
|
38
38
|
// Add row/column shortcuts
|
|
39
39
|
keymaps.bindKeymapWithCommand(keymaps.addRowBefore.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('TOP'), list);
|
|
40
40
|
keymaps.bindKeymapWithCommand(keymaps.addRowAfter.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
41
|
-
keymaps.bindKeymapWithCommand(keymaps.addColumnBefore.common, (0,
|
|
41
|
+
keymaps.bindKeymapWithCommand(keymaps.addColumnBefore.common, (0, _commands2.triggerUnlessTableHeader)((0, _insert.addColumnBefore)(getEditorContainerWidth)), list);
|
|
42
42
|
keymaps.bindKeymapWithCommand(keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(getEditorContainerWidth), list);
|
|
43
|
-
return (0,
|
|
43
|
+
return (0, _keymap.keymap)(list);
|
|
44
44
|
}
|
|
45
45
|
var _default = keymapPlugin;
|
|
46
46
|
exports.default = _default;
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createPlugin = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _prosemirrorUtils = require("prosemirror-utils");
|
|
10
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
10
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
12
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
13
12
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
14
13
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
|
-
var _utils2 = require("@atlaskit/editor-
|
|
14
|
+
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
15
|
+
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
16
16
|
var _commands = require("../commands");
|
|
17
17
|
var _misc = require("../commands/misc");
|
|
18
18
|
var _eventHandlers = require("../event-handlers");
|
|
@@ -21,7 +21,7 @@ var _tableCell = _interopRequireDefault(require("../nodeviews/tableCell"));
|
|
|
21
21
|
var _plugin = require("../pm-plugins/decorations/plugin");
|
|
22
22
|
var _transforms2 = require("../transforms");
|
|
23
23
|
var _types = require("../types");
|
|
24
|
-
var
|
|
24
|
+
var _utils4 = require("../utils");
|
|
25
25
|
var _paste = require("../utils/paste");
|
|
26
26
|
var _defaultTableSelection = require("./default-table-selection");
|
|
27
27
|
var _pluginFactory = require("./plugin-factory");
|
|
@@ -123,24 +123,24 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
123
123
|
var tableRef;
|
|
124
124
|
var tableNode;
|
|
125
125
|
if (pluginState.editorHasFocus) {
|
|
126
|
-
var parent = (0,
|
|
126
|
+
var parent = (0, _utils2.findParentDomRefOfType)(state.schema.nodes.table, domAtPos)(selection);
|
|
127
127
|
if (parent) {
|
|
128
128
|
tableRef = parent.querySelector('table') || undefined;
|
|
129
129
|
}
|
|
130
|
-
tableNode = (0,
|
|
130
|
+
tableNode = (0, _utils3.findTable)(state.selection);
|
|
131
131
|
}
|
|
132
132
|
if (pluginState.tableRef !== tableRef) {
|
|
133
133
|
(0, _commands.setTableRef)(tableRef)(state, dispatch);
|
|
134
134
|
}
|
|
135
135
|
if (pluginState.tableNode !== tableNode) {
|
|
136
|
-
(0,
|
|
136
|
+
(0, _utils4.updateResizeHandles)(tableRef);
|
|
137
137
|
}
|
|
138
138
|
if (pluginState.editorHasFocus && pluginState.tableRef) {
|
|
139
139
|
var _ref = state.selection,
|
|
140
140
|
$cursor = _ref.$cursor;
|
|
141
141
|
if ($cursor) {
|
|
142
142
|
// Only update bold when it's a cursor
|
|
143
|
-
var tableCellHeader = (0,
|
|
143
|
+
var tableCellHeader = (0, _utils2.findParentNodeOfType)(state.schema.nodes.tableHeader)(state.selection);
|
|
144
144
|
if (tableCellHeader) {
|
|
145
145
|
(0, _commands.addBoldInEmptyHeaderCells)(tableCellHeader)(state, dispatch);
|
|
146
146
|
}
|
|
@@ -168,7 +168,7 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
168
168
|
if (!(0, _coreUtils.insideTable)(editorState) && (0, _paste.isHeaderRowRequired)(editorState)) {
|
|
169
169
|
slice = (0, _misc.transformSliceToAddTableHeaders)(slice, schema);
|
|
170
170
|
}
|
|
171
|
-
slice = (0,
|
|
171
|
+
slice = (0, _utils4.transformSliceToFixHardBreakProblemOnCopyFromCell)(slice, schema);
|
|
172
172
|
|
|
173
173
|
// We do this separately, so it also applies to drag/drop events
|
|
174
174
|
// This needs to go before `transformSliceToRemoveOpenExpand`
|
|
@@ -179,11 +179,11 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
179
179
|
slice = (0, _transforms.transformSliceToRemoveOpenExpand)(slice, schema);
|
|
180
180
|
|
|
181
181
|
/** If a partial paste of table, paste only table's content */
|
|
182
|
-
slice = (0,
|
|
182
|
+
slice = (0, _utils4.transformSliceToRemoveOpenTable)(slice, schema);
|
|
183
183
|
|
|
184
184
|
/** If a partial paste of bodied extension, paste only text */
|
|
185
185
|
slice = (0, _transforms.transformSliceToRemoveOpenBodiedExtension)(slice, schema);
|
|
186
|
-
slice = (0,
|
|
186
|
+
slice = (0, _utils4.transformSliceToCorrectEmptyTableCells)(slice, schema);
|
|
187
187
|
if (!pluginConfig.allowColumnResizing) {
|
|
188
188
|
slice = (0, _misc.transformSliceToRemoveColumnsWidths)(slice, schema);
|
|
189
189
|
}
|
|
@@ -199,7 +199,7 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
199
199
|
var state = _ref2.state,
|
|
200
200
|
dispatch = _ref2.dispatch;
|
|
201
201
|
var decorationSet = _plugin.pluginKey.getState(state);
|
|
202
|
-
if ((0,
|
|
202
|
+
if ((0, _utils4.findControlsHoverDecoration)(decorationSet).length) {
|
|
203
203
|
(0, _commands.clearHoverSelection)()(state, dispatch);
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -218,7 +218,7 @@ var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, porta
|
|
|
218
218
|
// when typing into a sticky header cell, we don't want to scroll
|
|
219
219
|
// back to the top of the table if the user has already scrolled down
|
|
220
220
|
var tableHeader = view.state.schema.nodes.tableHeader;
|
|
221
|
-
var domRef = (0,
|
|
221
|
+
var domRef = (0, _utils2.findParentDomRefOfType)(tableHeader, view.domAtPos.bind(view))(view.state.selection);
|
|
222
222
|
var maybeTr = (0, _utils.closestElement)(domRef, 'tr');
|
|
223
223
|
return maybeTr ? maybeTr.classList.contains('sticky') : false;
|
|
224
224
|
},
|
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.pluginKey = void 0;
|
|
7
|
-
var
|
|
8
|
-
var pluginKey = new
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
+
var pluginKey = new _state.PluginKey('tablePlugin');
|
|
9
9
|
exports.pluginKey = pluginKey;
|