@atlaskit/editor-plugin-table 2.3.0 → 2.4.0
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/.eslintrc.js +6 -0
- package/CHANGELOG.md +12 -0
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/cjs/plugins/table/commands/insert.js +3 -3
- package/dist/cjs/plugins/table/commands/misc.js +26 -26
- package/dist/cjs/plugins/table/commands/referentiality.js +1 -1
- package/dist/cjs/plugins/table/commands/selection.js +2 -2
- package/dist/cjs/plugins/table/commands/sort.js +8 -8
- package/dist/cjs/plugins/table/commands-with-analytics.js +3 -3
- package/dist/cjs/plugins/table/event-handlers.js +15 -15
- package/dist/cjs/plugins/table/handlers.js +6 -7
- package/dist/cjs/plugins/table/index.js +16 -16
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +44 -40
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +10 -8
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +11 -9
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +24 -21
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +26 -26
- package/dist/cjs/plugins/table/transforms/column-width.js +5 -5
- package/dist/cjs/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/cjs/plugins/table/transforms/merge.js +1 -1
- package/dist/cjs/plugins/table/transforms/replace-table.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +11 -11
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +10 -10
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +9 -9
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
- package/dist/cjs/plugins/table/ui/consts.js +2 -2
- package/dist/cjs/plugins/table/ui/ui-styles.js +2 -2
- package/dist/cjs/plugins/table/utils/column-controls.js +11 -11
- package/dist/cjs/plugins/table/utils/decoration.js +11 -11
- package/dist/cjs/plugins/table/utils/nodes.js +1 -1
- package/dist/cjs/plugins/table/utils/row-controls.js +9 -9
- package/dist/cjs/plugins/table/utils/selection.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/clear.js +3 -1
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/es2019/plugins/table/commands/insert.js +4 -3
- package/dist/es2019/plugins/table/commands/misc.js +4 -4
- package/dist/es2019/plugins/table/commands/referentiality.js +1 -1
- package/dist/es2019/plugins/table/commands/selection.js +3 -3
- package/dist/es2019/plugins/table/commands/sort.js +3 -4
- package/dist/es2019/plugins/table/commands/toggle.js +1 -2
- package/dist/es2019/plugins/table/commands-with-analytics.js +4 -4
- package/dist/es2019/plugins/table/event-handlers.js +3 -5
- package/dist/es2019/plugins/table/handlers.js +5 -5
- package/dist/es2019/plugins/table/index.js +16 -16
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +21 -18
- package/dist/es2019/plugins/table/nodeviews/TableContainer.js +10 -9
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +4 -4
- package/dist/es2019/plugins/table/nodeviews/table.js +11 -9
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/main.js +13 -13
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- 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-resizing/utils/dom.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/es2019/plugins/table/toolbar.js +16 -18
- package/dist/es2019/plugins/table/transforms/column-width.js +6 -7
- package/dist/es2019/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/es2019/plugins/table/transforms/merge.js +2 -1
- package/dist/es2019/plugins/table/transforms/replace-table.js +2 -2
- package/dist/es2019/plugins/table/transforms/split.js +1 -0
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +7 -4
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +5 -5
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/ui-styles.js +3 -3
- package/dist/es2019/plugins/table/utils/column-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/decoration.js +2 -2
- package/dist/es2019/plugins/table/utils/guidelines.js +1 -1
- package/dist/es2019/plugins/table/utils/nodes.js +1 -1
- package/dist/es2019/plugins/table/utils/row-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/selection.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/clear.js +3 -1
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/esm/plugins/table/commands/insert.js +4 -3
- package/dist/esm/plugins/table/commands/misc.js +4 -4
- package/dist/esm/plugins/table/commands/referentiality.js +1 -1
- package/dist/esm/plugins/table/commands/selection.js +3 -3
- package/dist/esm/plugins/table/commands/sort.js +3 -4
- package/dist/esm/plugins/table/commands/toggle.js +1 -2
- package/dist/esm/plugins/table/commands-with-analytics.js +4 -4
- package/dist/esm/plugins/table/event-handlers.js +3 -5
- package/dist/esm/plugins/table/handlers.js +5 -5
- package/dist/esm/plugins/table/index.js +16 -16
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +39 -36
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +10 -9
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +4 -4
- package/dist/esm/plugins/table/nodeviews/table.js +11 -9
- package/dist/esm/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/main.js +13 -13
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- 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-resizing/utils/dom.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/esm/plugins/table/toolbar.js +16 -18
- package/dist/esm/plugins/table/transforms/column-width.js +6 -7
- package/dist/esm/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/esm/plugins/table/transforms/merge.js +2 -1
- package/dist/esm/plugins/table/transforms/replace-table.js +2 -2
- package/dist/esm/plugins/table/transforms/split.js +1 -0
- package/dist/esm/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +5 -5
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/ui-styles.js +3 -3
- package/dist/esm/plugins/table/utils/column-controls.js +3 -3
- package/dist/esm/plugins/table/utils/decoration.js +2 -2
- package/dist/esm/plugins/table/utils/guidelines.js +1 -1
- package/dist/esm/plugins/table/utils/nodes.js +1 -1
- package/dist/esm/plugins/table/utils/row-controls.js +3 -3
- package/dist/esm/plugins/table/utils/selection.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/handlers.d.ts +1 -1
- package/dist/types/plugins/table/index.d.ts +4 -4
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.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 +4 -5
- package/dist/types/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- 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/index.d.ts +1 -1
- 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/decoration.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/index.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.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 +4 -5
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
- 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 +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- 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/index.d.ts +1 -1
- 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/decoration.d.ts +1 -1
- package/examples/99-testing.tsx +11 -10
- package/package.json +11 -3
- package/report.api.md +2 -0
- package/src/__tests__/integration/arrow-down-into-table.ts +3 -2
- package/src/__tests__/integration/auto-size.ts +8 -10
- package/src/__tests__/integration/cell-selection.ts +8 -7
- package/src/__tests__/integration/change-date-inside-table.ts +4 -5
- package/src/__tests__/integration/delete-columns.ts +6 -4
- package/src/__tests__/integration/delete-last-column-in-full-width.ts +4 -4
- package/src/__tests__/integration/delete-last-column-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-last-row-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-rows.ts +8 -6
- package/src/__tests__/integration/delete-table-when-selected.ts +10 -11
- package/src/__tests__/integration/deleting-empty-paragraph-under-table.ts +5 -4
- package/src/__tests__/integration/even-columns.ts +8 -8
- package/src/__tests__/integration/floating-toolbar.ts +3 -1
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +7 -8
- package/src/__tests__/integration/horizontal-scroll.ts +8 -7
- package/src/__tests__/integration/insert-cell-header-with-strong-mark.ts +3 -4
- package/src/__tests__/integration/insert-row-inside-layout.ts +8 -6
- package/src/__tests__/integration/layout.ts +8 -11
- package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +3 -2
- package/src/__tests__/integration/resize-handler.ts +2 -2
- package/src/__tests__/integration/resize.ts +15 -15
- package/src/__tests__/integration/scale.ts +8 -8
- package/src/__tests__/integration/sticky-header.ts +3 -2
- package/src/__tests__/unit/analytics.ts +21 -21
- package/src/__tests__/unit/collab.ts +16 -16
- package/src/__tests__/unit/commands/go-to-next-cell.ts +14 -13
- package/src/__tests__/unit/commands/insert.ts +12 -12
- package/src/__tests__/unit/commands/misc.ts +18 -16
- package/src/__tests__/unit/commands/sort.ts +9 -8
- package/src/__tests__/unit/commands.ts +13 -14
- package/src/__tests__/unit/copy-paste.ts +31 -25
- package/src/__tests__/unit/event-handlers/index.ts +15 -13
- package/src/__tests__/unit/event-handlers.ts +18 -18
- package/src/__tests__/unit/fix-tables.ts +9 -9
- package/src/__tests__/unit/get-toolbar-config.ts +21 -21
- package/src/__tests__/unit/handlers.ts +13 -12
- package/src/__tests__/unit/hover-selection.ts +14 -13
- package/src/__tests__/unit/index-with-fake-timers.ts +6 -5
- package/src/__tests__/unit/index.ts +30 -31
- package/src/__tests__/unit/layout.ts +16 -16
- package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +4 -2
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +21 -20
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +38 -105
- package/src/__tests__/unit/nodeviews/cell.ts +17 -16
- package/src/__tests__/unit/nodeviews/table.ts +15 -13
- package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +1 -1
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +7 -8
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +45 -57
- package/src/__tests__/unit/pm-plugins/main.ts +15 -14
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +7 -6
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +23 -21
- package/src/__tests__/unit/pm-plugins/table-local-id.ts +14 -15
- package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +3 -2
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +22 -21
- package/src/__tests__/unit/sort-column.ts +16 -14
- package/src/__tests__/unit/toolbar.ts +22 -21
- package/src/__tests__/unit/transforms/delete-columns.ts +16 -14
- package/src/__tests__/unit/transforms/delete-rows.ts +16 -14
- package/src/__tests__/unit/transforms/merging.ts +15 -13
- package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/CornerControls.tsx +11 -9
- package/src/__tests__/unit/ui/DeleteButton.tsx +3 -1
- package/src/__tests__/unit/ui/FixedButton.tsx +4 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +14 -11
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +12 -9
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +21 -19
- package/src/__tests__/unit/ui/RowControls.tsx +15 -12
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +16 -15
- package/src/__tests__/unit/undo-redo.ts +17 -15
- package/src/__tests__/unit/utils/collapse.ts +7 -8
- package/src/__tests__/unit/utils/nodes.ts +12 -11
- package/src/__tests__/unit/utils/row-controls.ts +12 -12
- package/src/__tests__/unit/utils/table.ts +5 -4
- package/src/__tests__/unit/utils.ts +18 -16
- package/src/__tests__/visual-regression/cell-options-menu.ts +2 -2
- package/src/__tests__/visual-regression/index.ts +8 -7
- package/src/__tests__/visual-regression/sticky-header.ts +6 -5
- package/src/plugins/table/commands/clear.ts +3 -2
- package/src/plugins/table/commands/collapse.ts +1 -0
- package/src/plugins/table/commands/go-to-next-cell.ts +8 -7
- package/src/plugins/table/commands/insert.ts +8 -7
- package/src/plugins/table/commands/misc.ts +15 -18
- package/src/plugins/table/commands/referentiality.ts +3 -1
- package/src/plugins/table/commands/selection.ts +11 -10
- package/src/plugins/table/commands/sort.ts +9 -9
- package/src/plugins/table/commands/split-cell.ts +1 -1
- package/src/plugins/table/commands/toggle.ts +2 -3
- package/src/plugins/table/commands-with-analytics.ts +15 -15
- package/src/plugins/table/event-handlers.ts +19 -20
- package/src/plugins/table/handlers.ts +6 -7
- package/src/plugins/table/index.tsx +51 -51
- package/src/plugins/table/nodeviews/OverflowShadowsObserver.ts +2 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +23 -30
- package/src/plugins/table/nodeviews/TableContainer.tsx +16 -23
- package/src/plugins/table/nodeviews/TableResizer.tsx +8 -7
- package/src/plugins/table/nodeviews/table.tsx +25 -18
- package/src/plugins/table/nodeviews/tableCell.tsx +9 -7
- package/src/plugins/table/nodeviews/types.ts +4 -2
- package/src/plugins/table/nodeviews/update-overflow-shadows.ts +3 -1
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +4 -3
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +2 -1
- package/src/plugins/table/pm-plugins/keymap.ts +8 -8
- package/src/plugins/table/pm-plugins/main.ts +38 -33
- package/src/plugins/table/pm-plugins/plugin-factory.ts +2 -0
- package/src/plugins/table/pm-plugins/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -1
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +6 -7
- package/src/plugins/table/pm-plugins/sticky-headers/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +3 -4
- package/src/plugins/table/pm-plugins/table-local-id.ts +3 -4
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +3 -2
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +13 -14
- package/src/plugins/table/pm-plugins/table-resizing/plugin-factory.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin.ts +7 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +2 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/column-state.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +3 -3
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +8 -9
- package/src/plugins/table/pm-plugins/table-resizing/utils/resize-state.ts +8 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +4 -5
- package/src/plugins/table/pm-plugins/table-resizing/utils/types.ts +2 -1
- package/src/plugins/table/pm-plugins/table-selection-keymap.ts +4 -3
- package/src/plugins/table/pm-plugins/table-width.ts +5 -4
- package/src/plugins/table/toolbar.tsx +54 -57
- package/src/plugins/table/transforms/column-width.ts +13 -13
- package/src/plugins/table/transforms/delete-columns.ts +2 -2
- package/src/plugins/table/transforms/delete-rows.ts +2 -2
- package/src/plugins/table/transforms/merge.ts +3 -3
- package/src/plugins/table/transforms/replace-table.ts +6 -5
- package/src/plugins/table/transforms/split.ts +1 -1
- package/src/plugins/table/types.ts +3 -3
- package/src/plugins/table/ui/FloatingContextualButton/FixedButton.tsx +4 -2
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +12 -11
- package/src/plugins/table/ui/FloatingContextualButton/styles.ts +5 -3
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +27 -28
- package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +10 -11
- package/src/plugins/table/ui/FloatingContextualMenu/styles.ts +8 -4
- package/src/plugins/table/ui/FloatingDeleteButton/DeleteButton.tsx +5 -2
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +9 -9
- package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +4 -5
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +16 -18
- package/src/plugins/table/ui/LayoutButton/index.tsx +6 -6
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +3 -2
- package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +2 -1
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +2 -3
- package/src/plugins/table/ui/common-styles.ts +33 -34
- package/src/plugins/table/ui/consts.ts +12 -13
- package/src/plugins/table/ui/ui-styles.ts +24 -22
- package/src/plugins/table/utils/analytics.ts +3 -2
- package/src/plugins/table/utils/collapse.ts +2 -2
- package/src/plugins/table/utils/column-controls.ts +5 -6
- package/src/plugins/table/utils/decoration.ts +6 -7
- package/src/plugins/table/utils/dom.ts +1 -0
- package/src/plugins/table/utils/guidelines.ts +2 -2
- package/src/plugins/table/utils/nodes.ts +2 -1
- package/src/plugins/table/utils/row-controls.ts +4 -3
- package/src/plugins/table/utils/selection.ts +2 -1
- package/src/plugins/table/utils/table.ts +2 -1
- package/tmp/api-report-tmp.d.ts +2 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { Selection, Transaction } from 'prosemirror-state';
|
|
3
|
+
import { safeInsert } from 'prosemirror-utils';
|
|
4
|
+
import { EditorView } from 'prosemirror-view';
|
|
5
|
+
|
|
6
|
+
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
7
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
8
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
3
9
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
10
|
import {
|
|
5
11
|
addColumnAt as addColumnAtPMUtils,
|
|
@@ -8,16 +14,11 @@ import {
|
|
|
8
14
|
findTable,
|
|
9
15
|
selectedRect,
|
|
10
16
|
} from '@atlaskit/editor-tables/utils';
|
|
11
|
-
import { safeInsert } from 'prosemirror-utils';
|
|
12
17
|
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
18
|
+
import { rescaleColumns } from '../transforms/column-width';
|
|
16
19
|
import { checkIfHeaderRowEnabled, copyPreviousRow } from '../utils';
|
|
17
20
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
18
|
-
|
|
19
|
-
import { EditorView } from 'prosemirror-view';
|
|
20
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
21
|
+
|
|
21
22
|
// #endregion
|
|
22
23
|
|
|
23
24
|
function addColumnAtCustomStep(column: number) {
|
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { Node as PMNode, Schema, Slice } from 'prosemirror-model';
|
|
3
3
|
import { TextSelection, Transaction } from 'prosemirror-state';
|
|
4
|
-
import {
|
|
4
|
+
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
5
|
+
import { EditorView } from 'prosemirror-view';
|
|
6
|
+
|
|
7
|
+
import { CellAttributes } from '@atlaskit/adf-schema';
|
|
8
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
9
|
+
import {
|
|
10
|
+
closestElement,
|
|
11
|
+
isParagraph,
|
|
12
|
+
isTextSelection,
|
|
13
|
+
mapSlice,
|
|
14
|
+
} from '@atlaskit/editor-common/utils';
|
|
5
15
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
16
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
17
|
import {
|
|
7
|
-
selectionCell,
|
|
8
18
|
findCellClosestToPos,
|
|
9
19
|
findTable,
|
|
10
20
|
getCellsInColumn,
|
|
11
21
|
getCellsInRow,
|
|
12
22
|
getSelectionRect,
|
|
13
23
|
isSelectionType,
|
|
24
|
+
isTableSelected,
|
|
14
25
|
removeTable,
|
|
15
26
|
selectColumn as selectColumnTransform,
|
|
27
|
+
selectionCell,
|
|
16
28
|
selectRow as selectRowTransform,
|
|
17
29
|
setCellAttrs,
|
|
18
|
-
isTableSelected,
|
|
19
30
|
} from '@atlaskit/editor-tables/utils';
|
|
20
|
-
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
21
|
-
|
|
22
|
-
import { EditorView } from 'prosemirror-view';
|
|
23
|
-
|
|
24
|
-
import { CellAttributes } from '@atlaskit/adf-schema';
|
|
25
|
-
|
|
26
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
27
|
-
|
|
28
|
-
import {
|
|
29
|
-
isParagraph,
|
|
30
|
-
isTextSelection,
|
|
31
|
-
closestElement,
|
|
32
|
-
mapSlice,
|
|
33
|
-
} from '@atlaskit/editor-common/utils';
|
|
34
31
|
|
|
35
32
|
import { getDecorations } from '../pm-plugins/decorations/plugin';
|
|
36
33
|
import { buildColumnResizingDecorations } from '../pm-plugins/decorations/utils';
|
|
@@ -42,9 +39,9 @@ import {
|
|
|
42
39
|
createColumnSelectedDecoration,
|
|
43
40
|
} from '../utils/decoration';
|
|
44
41
|
import {
|
|
45
|
-
checkIfNumberColumnEnabled,
|
|
46
42
|
checkIfHeaderColumnEnabled,
|
|
47
43
|
checkIfHeaderRowEnabled,
|
|
44
|
+
checkIfNumberColumnEnabled,
|
|
48
45
|
isIsolating,
|
|
49
46
|
} from '../utils/nodes';
|
|
50
47
|
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
2
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
|
+
|
|
3
3
|
import { removeConnectedNodes } from '@atlaskit/editor-common/utils';
|
|
4
4
|
|
|
5
|
+
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
6
|
+
|
|
5
7
|
export const removeDescendantNodes = (sourceNode: PMNode) =>
|
|
6
8
|
createCommand(
|
|
7
9
|
{
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import { ResolvedPos, Node as PmNode } from 'prosemirror-model';
|
|
6
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
1
|
+
import { Node as PmNode, ResolvedPos } from 'prosemirror-model';
|
|
2
|
+
import { Selection, TextSelection } from 'prosemirror-state';
|
|
3
|
+
|
|
7
4
|
import {
|
|
8
|
-
|
|
5
|
+
EditorSelectionAPI,
|
|
9
6
|
GapCursorSelection,
|
|
10
|
-
Side,
|
|
11
|
-
isSelectionAtStartOfNode,
|
|
12
7
|
isSelectionAtEndOfNode,
|
|
13
|
-
|
|
8
|
+
isSelectionAtStartOfNode,
|
|
9
|
+
RelativeSelectionPos,
|
|
10
|
+
Side,
|
|
14
11
|
} from '@atlaskit/editor-common/selection';
|
|
12
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
13
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
14
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
15
|
+
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
15
16
|
|
|
16
17
|
export enum TableSelectionDirection {
|
|
17
18
|
TopToBottom = 'TopToBottom',
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { EditorState, Selection, Transaction } from 'prosemirror-state';
|
|
3
|
+
|
|
4
|
+
import { CardAttributes, DataType, UrlType } from '@atlaskit/adf-schema';
|
|
5
|
+
import {
|
|
6
|
+
TableSortOrder as SortOrder,
|
|
7
|
+
TableSortStep,
|
|
8
|
+
} from '@atlaskit/adf-schema/steps';
|
|
9
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
10
|
+
import { createCompareNodes } from '@atlaskit/editor-common/utils';
|
|
3
11
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
import { findCellRectClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
5
12
|
import {
|
|
6
13
|
convertArrayOfRowsToTableNode,
|
|
7
14
|
convertTableNodeToArrayOfRows,
|
|
15
|
+
findCellRectClosestToPos,
|
|
8
16
|
findTable,
|
|
9
17
|
getSelectionRect,
|
|
10
18
|
isSelectionType,
|
|
11
19
|
} from '@atlaskit/editor-tables/utils';
|
|
12
20
|
|
|
13
|
-
import { CardAttributes, UrlType, DataType } from '@atlaskit/adf-schema';
|
|
14
|
-
import { createCompareNodes } from '@atlaskit/editor-common/utils';
|
|
15
|
-
|
|
16
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
17
21
|
import { createCommand, getPluginState } from '../pm-plugins/plugin-factory';
|
|
18
22
|
import { TablePluginState } from '../types';
|
|
19
|
-
import {
|
|
20
|
-
TableSortStep,
|
|
21
|
-
TableSortOrder as SortOrder,
|
|
22
|
-
} from '@atlaskit/adf-schema/steps';
|
|
23
23
|
|
|
24
24
|
const createGetInlineCardTextFromStore = (
|
|
25
25
|
attrs: CardAttributes,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
1
2
|
import { splitCellWithType } from '@atlaskit/editor-tables/utils';
|
|
2
3
|
|
|
3
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
5
5
|
import { TablePluginState } from '../types';
|
|
6
6
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
//#region Imports
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
|
-
import { toggleHeader } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
3
|
|
|
6
4
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
7
|
-
|
|
8
5
|
import { Command } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { findTable, toggleHeader } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
|
|
9
8
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
10
9
|
//#endregion
|
|
11
10
|
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
3
|
-
import {
|
|
4
|
-
findCellClosestToPos,
|
|
5
|
-
findCellRectClosestToPos,
|
|
6
|
-
getSelectionRect,
|
|
7
|
-
} from '@atlaskit/editor-tables/utils';
|
|
8
1
|
import { Selection } from 'prosemirror-state';
|
|
9
2
|
|
|
10
3
|
import { tableBackgroundColorPalette, TableLayout } from '@atlaskit/adf-schema';
|
|
11
|
-
|
|
12
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
13
5
|
import {
|
|
14
6
|
ACTION_SUBJECT,
|
|
15
7
|
EVENT_TYPE,
|
|
@@ -21,14 +13,25 @@ import type {
|
|
|
21
13
|
AnalyticsEventPayload,
|
|
22
14
|
EditorAnalyticsAPI,
|
|
23
15
|
} from '@atlaskit/editor-common/analytics';
|
|
16
|
+
import type {
|
|
17
|
+
Command,
|
|
18
|
+
GetEditorContainerWidth,
|
|
19
|
+
} from '@atlaskit/editor-common/types';
|
|
20
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
21
|
+
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
22
|
+
import {
|
|
23
|
+
findCellClosestToPos,
|
|
24
|
+
findCellRectClosestToPos,
|
|
25
|
+
getSelectionRect,
|
|
26
|
+
} from '@atlaskit/editor-tables/utils';
|
|
24
27
|
|
|
25
28
|
import { clearMultipleCells } from './commands/clear';
|
|
26
29
|
import { wrapTableInExpand } from './commands/collapse';
|
|
27
30
|
import { insertColumn, insertRow } from './commands/insert';
|
|
28
31
|
import {
|
|
29
32
|
deleteTable,
|
|
30
|
-
setMultipleCellAttrs,
|
|
31
33
|
deleteTableIfSelected,
|
|
34
|
+
setMultipleCellAttrs,
|
|
32
35
|
} from './commands/misc';
|
|
33
36
|
import { sortByColumn } from './commands/sort';
|
|
34
37
|
import { splitCell } from './commands/split-cell';
|
|
@@ -39,12 +42,11 @@ import {
|
|
|
39
42
|
toggleNumberColumn,
|
|
40
43
|
toggleTableLayout,
|
|
41
44
|
} from './commands/toggle';
|
|
42
|
-
import { distributeColumnsWidths } from './pm-plugins/table-resizing/commands';
|
|
43
45
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
46
|
+
import { distributeColumnsWidths } from './pm-plugins/table-resizing/commands';
|
|
47
|
+
import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
44
48
|
import { deleteColumns, deleteRows, mergeCells } from './transforms';
|
|
45
49
|
import { InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
|
|
46
|
-
|
|
47
|
-
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
48
50
|
import {
|
|
49
51
|
checkIfNumberColumnEnabled,
|
|
50
52
|
getSelectedCellInfo,
|
|
@@ -52,8 +54,6 @@ import {
|
|
|
52
54
|
} from './utils';
|
|
53
55
|
import { withEditorAnalyticsAPI } from './utils/analytics';
|
|
54
56
|
import { getAllowAddColumnCustomStep } from './utils/get-allow-add-column-custom-step';
|
|
55
|
-
import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
56
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
57
57
|
|
|
58
58
|
const TABLE_BREAKOUT_NAME_MAPPING = {
|
|
59
59
|
default: TABLE_BREAKOUT.NORMAL,
|
|
@@ -5,6 +5,22 @@ import {
|
|
|
5
5
|
TextSelection,
|
|
6
6
|
Transaction,
|
|
7
7
|
} from 'prosemirror-state';
|
|
8
|
+
import { EditorView } from 'prosemirror-view';
|
|
9
|
+
|
|
10
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import {
|
|
12
|
+
ACTION_SUBJECT,
|
|
13
|
+
EVENT_TYPE,
|
|
14
|
+
TABLE_ACTION,
|
|
15
|
+
} from '@atlaskit/editor-common/analytics';
|
|
16
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
17
|
+
import {
|
|
18
|
+
browser,
|
|
19
|
+
closestElement,
|
|
20
|
+
isElementInTableCell,
|
|
21
|
+
isLastItemMediaGroup,
|
|
22
|
+
setNodeSelection,
|
|
23
|
+
} from '@atlaskit/editor-common/utils';
|
|
8
24
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
9
25
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
10
26
|
import {
|
|
@@ -14,22 +30,6 @@ import {
|
|
|
14
30
|
getSelectionRect,
|
|
15
31
|
removeTable,
|
|
16
32
|
} from '@atlaskit/editor-tables/utils';
|
|
17
|
-
import { EditorView } from 'prosemirror-view';
|
|
18
|
-
|
|
19
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
isElementInTableCell,
|
|
23
|
-
isLastItemMediaGroup,
|
|
24
|
-
setNodeSelection,
|
|
25
|
-
} from '@atlaskit/editor-common/utils';
|
|
26
|
-
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
27
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
28
|
-
import {
|
|
29
|
-
ACTION_SUBJECT,
|
|
30
|
-
EVENT_TYPE,
|
|
31
|
-
TABLE_ACTION,
|
|
32
|
-
} from '@atlaskit/editor-common/analytics';
|
|
33
33
|
|
|
34
34
|
import {
|
|
35
35
|
addResizeHandleDecorations,
|
|
@@ -47,26 +47,25 @@ import { getPluginState } from './pm-plugins/plugin-factory';
|
|
|
47
47
|
import { getPluginState as getResizePluginState } from './pm-plugins/table-resizing/plugin-factory';
|
|
48
48
|
import { deleteColumns, deleteRows } from './transforms';
|
|
49
49
|
import {
|
|
50
|
-
RESIZE_HANDLE_AREA_DECORATION_GAP,
|
|
51
50
|
ElementContentRects,
|
|
51
|
+
RESIZE_HANDLE_AREA_DECORATION_GAP,
|
|
52
52
|
} from './types';
|
|
53
53
|
import {
|
|
54
54
|
getColumnOrRowIndex,
|
|
55
55
|
getMousePositionHorizontalRelativeByElement,
|
|
56
56
|
getMousePositionVerticalRelativeByElement,
|
|
57
57
|
getSelectedCellInfo,
|
|
58
|
+
hasResizeHandler,
|
|
58
59
|
isCell,
|
|
59
60
|
isColumnControlsDecorations,
|
|
60
61
|
isCornerButton,
|
|
61
62
|
isInsertRowButton,
|
|
62
63
|
isResizeHandleDecoration,
|
|
63
64
|
isRowControlsButton,
|
|
64
|
-
isTableControlsButton,
|
|
65
65
|
isTableContainerOrWrapper,
|
|
66
|
-
|
|
66
|
+
isTableControlsButton,
|
|
67
67
|
} from './utils';
|
|
68
68
|
import { getAllowAddColumnCustomStep } from './utils/get-allow-add-column-custom-step';
|
|
69
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
70
69
|
|
|
71
70
|
const isFocusingCalendar = (event: Event) =>
|
|
72
71
|
event instanceof FocusEvent &&
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
// #region Imports
|
|
2
|
+
import { NodeType } from 'prosemirror-model';
|
|
2
3
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
3
|
-
import {
|
|
4
|
+
import { ReadonlyTransaction, Transaction } from 'prosemirror-state';
|
|
4
5
|
import { ContentNodeWithPos, findParentNodeOfType } from 'prosemirror-utils';
|
|
5
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
6
6
|
|
|
7
|
+
import { TableColumnOrdering, TableSortStep } from '@atlaskit/adf-schema/steps';
|
|
7
8
|
import { isTextInput } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import {
|
|
9
|
+
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
9
10
|
|
|
10
11
|
import { defaultTableSelection } from './pm-plugins/default-table-selection';
|
|
11
12
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
12
13
|
import { TablePluginState } from './types';
|
|
13
|
-
import {
|
|
14
|
-
import { NodeType } from 'prosemirror-model';
|
|
15
|
-
// #endregion
|
|
14
|
+
import { isTableCollapsible } from './utils/collapse';
|
|
16
15
|
import {
|
|
17
|
-
checkIfNumberColumnEnabled,
|
|
18
16
|
checkIfHeaderColumnEnabled,
|
|
19
17
|
checkIfHeaderRowEnabled,
|
|
18
|
+
checkIfNumberColumnEnabled,
|
|
20
19
|
} from './utils/nodes';
|
|
21
20
|
|
|
22
21
|
const nextTableSorting = (
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
import { Transaction } from 'prosemirror-state';
|
|
3
4
|
import type { EditorView } from 'prosemirror-view';
|
|
4
5
|
|
|
5
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
8
|
-
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
9
|
-
|
|
10
6
|
import {
|
|
11
7
|
table,
|
|
12
8
|
tableCell,
|
|
@@ -14,11 +10,6 @@ import {
|
|
|
14
10
|
tableRow,
|
|
15
11
|
tableWithCustomWidth,
|
|
16
12
|
} from '@atlaskit/adf-schema';
|
|
17
|
-
|
|
18
|
-
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
19
|
-
|
|
20
|
-
import type { EditorPlugin, Command } from '@atlaskit/editor-common/types';
|
|
21
|
-
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
22
13
|
import {
|
|
23
14
|
ACTION,
|
|
24
15
|
ACTION_SUBJECT,
|
|
@@ -28,33 +19,49 @@ import {
|
|
|
28
19
|
INPUT_METHOD,
|
|
29
20
|
TABLE_ACTION,
|
|
30
21
|
} from '@atlaskit/editor-common/analytics';
|
|
31
|
-
import {
|
|
32
|
-
|
|
22
|
+
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
33
23
|
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
34
|
-
|
|
24
|
+
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
25
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
26
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
35
27
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
28
|
+
import type {
|
|
29
|
+
Command,
|
|
30
|
+
EditorPlugin,
|
|
31
|
+
GetEditorContainerWidth,
|
|
32
|
+
GetEditorFeatureFlags,
|
|
33
|
+
NextEditorPlugin,
|
|
34
|
+
} from '@atlaskit/editor-common/types';
|
|
35
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
36
|
+
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
37
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
38
|
+
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
39
|
+
import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
40
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
41
|
+
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
42
|
+
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
36
43
|
|
|
37
44
|
import { pluginConfig } from './create-plugin-config';
|
|
38
|
-
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
39
|
-
import {
|
|
40
|
-
pluginKey as tableWidthPluginKey,
|
|
41
|
-
createPlugin as createTableWidthPlugin,
|
|
42
|
-
} from './pm-plugins/table-width';
|
|
43
|
-
import { createPlugin as createTableSafariDeleteCompositionTextIssueWorkaroundPlugin } from './pm-plugins/safari-delete-composition-text-issue-workaround';
|
|
44
45
|
import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
|
|
45
46
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
46
|
-
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
47
47
|
import { createPlugin } from './pm-plugins/main';
|
|
48
48
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
49
|
+
import { createPlugin as createTableSafariDeleteCompositionTextIssueWorkaroundPlugin } from './pm-plugins/safari-delete-composition-text-issue-workaround';
|
|
49
50
|
import {
|
|
50
51
|
createPlugin as createStickyHeadersPlugin,
|
|
51
52
|
findStickyHeaderForTable,
|
|
52
53
|
pluginKey as stickyHeadersPluginKey,
|
|
53
54
|
} from './pm-plugins/sticky-headers';
|
|
55
|
+
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
54
56
|
import {
|
|
55
57
|
createPlugin as createFlexiResizingPlugin,
|
|
56
58
|
pluginKey as tableResizingPluginKey,
|
|
57
59
|
} from './pm-plugins/table-resizing';
|
|
60
|
+
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
61
|
+
import {
|
|
62
|
+
createPlugin as createTableWidthPlugin,
|
|
63
|
+
pluginKey as tableWidthPluginKey,
|
|
64
|
+
} from './pm-plugins/table-width';
|
|
58
65
|
import { getToolbarConfig } from './toolbar';
|
|
59
66
|
import { ColumnResizingPluginState, PluginConfig } from './types';
|
|
60
67
|
import FloatingContextualButton from './ui/FloatingContextualButton';
|
|
@@ -63,21 +70,12 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
|
63
70
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
64
71
|
import LayoutButton from './ui/LayoutButton';
|
|
65
72
|
import { isLayoutSupported } from './utils';
|
|
66
|
-
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
67
|
-
import type {
|
|
68
|
-
GetEditorContainerWidth,
|
|
69
|
-
GetEditorFeatureFlags,
|
|
70
|
-
NextEditorPlugin,
|
|
71
|
-
} from '@atlaskit/editor-common/types';
|
|
72
|
-
import { Transaction } from 'prosemirror-state';
|
|
73
|
-
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
74
|
-
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
75
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
76
|
-
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
77
|
-
import type { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
78
73
|
|
|
79
74
|
interface TablePluginOptions {
|
|
80
75
|
tableOptions: PluginConfig;
|
|
76
|
+
// experimental custom table resizing experience, set inside editor-core behind a feature flag
|
|
77
|
+
// will eventually replace breakoutEnabled
|
|
78
|
+
tableResizingEnabled?: boolean;
|
|
81
79
|
breakoutEnabled?: boolean;
|
|
82
80
|
allowContextualMenu?: boolean;
|
|
83
81
|
// TODO these two need to be rethought
|
|
@@ -142,7 +140,7 @@ const tablesPlugin: NextEditorPlugin<
|
|
|
142
140
|
},
|
|
143
141
|
|
|
144
142
|
nodes() {
|
|
145
|
-
const tableNode =
|
|
143
|
+
const tableNode = options?.tableResizingEnabled
|
|
146
144
|
? tableWithCustomWidth
|
|
147
145
|
: table;
|
|
148
146
|
|
|
@@ -167,6 +165,7 @@ const tablesPlugin: NextEditorPlugin<
|
|
|
167
165
|
const {
|
|
168
166
|
fullWidthEnabled,
|
|
169
167
|
wasFullWidthEnabled,
|
|
168
|
+
tableResizingEnabled,
|
|
170
169
|
breakoutEnabled,
|
|
171
170
|
tableOptions,
|
|
172
171
|
getEditorFeatureFlags,
|
|
@@ -181,6 +180,7 @@ const tablesPlugin: NextEditorPlugin<
|
|
|
181
180
|
getEditorFeatureFlags || defaultGetEditorFeatureFlags,
|
|
182
181
|
breakoutEnabled,
|
|
183
182
|
fullWidthEnabled,
|
|
183
|
+
tableResizingEnabled,
|
|
184
184
|
wasFullWidthEnabled,
|
|
185
185
|
editorAnalyticsAPI,
|
|
186
186
|
api,
|
|
@@ -262,7 +262,7 @@ const tablesPlugin: NextEditorPlugin<
|
|
|
262
262
|
{
|
|
263
263
|
name: 'tableWidth',
|
|
264
264
|
plugin: ({ dispatch }) =>
|
|
265
|
-
|
|
265
|
+
options?.tableResizingEnabled
|
|
266
266
|
? createTableWidthPlugin(
|
|
267
267
|
dispatch,
|
|
268
268
|
options?.fullWidthEnabled ?? false,
|
|
@@ -353,25 +353,25 @@ const tablesPlugin: NextEditorPlugin<
|
|
|
353
353
|
? findStickyHeaderForTable(stickyHeadersState, tablePos)
|
|
354
354
|
: undefined;
|
|
355
355
|
|
|
356
|
-
const LayoutContent =
|
|
357
|
-
'platform.editor.custom-table-width',
|
|
358
|
-
) ? null : isLayoutSupported(state) &&
|
|
356
|
+
const LayoutContent =
|
|
359
357
|
options &&
|
|
358
|
+
!options.tableResizingEnabled &&
|
|
359
|
+
isLayoutSupported(state) &&
|
|
360
360
|
options.breakoutEnabled ? (
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
361
|
+
<LayoutButton
|
|
362
|
+
editorView={editorView}
|
|
363
|
+
mountPoint={popupsMountPoint}
|
|
364
|
+
boundariesElement={popupsBoundariesElement}
|
|
365
|
+
scrollableElement={popupsScrollableElement}
|
|
366
|
+
targetRef={tableWrapperTarget!}
|
|
367
|
+
layout={layout}
|
|
368
|
+
isResizing={
|
|
369
|
+
!!resizingPluginState && !!resizingPluginState.dragging
|
|
370
|
+
}
|
|
371
|
+
stickyHeader={stickyHeader}
|
|
372
|
+
editorAnalyticsAPI={editorAnalyticsAPI}
|
|
373
|
+
/>
|
|
374
|
+
) : null;
|
|
375
375
|
|
|
376
376
|
return (
|
|
377
377
|
<>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TableCssClassName as ClassName, ShadowEvent } from '../types';
|
|
2
2
|
import { tableInsertColumnButtonSize } from '../ui/consts';
|
|
3
|
+
|
|
3
4
|
import { updateShadowListForStickyStyles } from './update-overflow-shadows';
|
|
4
5
|
|
|
5
6
|
export class OverflowShadowsObserver {
|