@atlaskit/editor-plugin-table 2.3.1 → 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 +6 -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 +6 -9
- 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 +19 -15
- package/dist/es2019/plugins/table/nodeviews/TableContainer.js +7 -10
- 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 +37 -34
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +7 -10
- 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 +22 -25
- package/src/plugins/table/nodeviews/TableContainer.tsx +13 -24
- 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 +108 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import debounce from 'lodash/debounce';
|
|
2
|
+
import throttle from 'lodash/throttle';
|
|
1
3
|
import { Node as PmNode } from 'prosemirror-model';
|
|
2
4
|
import { EditorView, NodeView } from 'prosemirror-view';
|
|
3
5
|
|
|
4
|
-
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
5
|
-
|
|
6
6
|
import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
7
|
-
|
|
7
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
8
9
|
import { mapChildren } from '@atlaskit/editor-common/utils';
|
|
10
|
+
|
|
9
11
|
import {
|
|
10
12
|
TableCssClassName as ClassName,
|
|
11
13
|
TableCssClassName,
|
|
@@ -23,11 +25,8 @@ import {
|
|
|
23
25
|
updateStickyMargins as updateTableMargin,
|
|
24
26
|
} from '../../table-resizing/utils/dom';
|
|
25
27
|
import { updateStickyState } from '../commands';
|
|
26
|
-
import { getTop, getTree, TableDOMElements } from './dom';
|
|
27
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
28
28
|
|
|
29
|
-
import
|
|
30
|
-
import throttle from 'lodash/throttle';
|
|
29
|
+
import { getTop, getTree, TableDOMElements } from './dom';
|
|
31
30
|
|
|
32
31
|
// limit scroll event calls
|
|
33
32
|
const HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
|
|
4
1
|
import {
|
|
5
|
-
EventDispatcher,
|
|
6
2
|
Dispatch,
|
|
3
|
+
EventDispatcher,
|
|
7
4
|
} from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
7
|
|
|
9
8
|
import { TableRowNodeView } from './nodeviews/tableRow';
|
|
10
9
|
import { pluginKey } from './plugin-key';
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
* TODO: https://product-fabric.atlassian.net/browse/ED-12714
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
14
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
15
|
-
import { EditorState, PluginKey } from 'prosemirror-state';
|
|
16
13
|
import { Node as ProsemirrorNode } from 'prosemirror-model';
|
|
14
|
+
import { EditorState, PluginKey } from 'prosemirror-state';
|
|
17
15
|
import rafSchedule from 'raf-schd';
|
|
18
16
|
|
|
19
17
|
import { uuid } from '@atlaskit/adf-schema';
|
|
20
|
-
|
|
18
|
+
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
19
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
21
20
|
import { stepHasSlice } from '@atlaskit/editor-common/utils';
|
|
22
21
|
|
|
23
22
|
interface TableLocalIdPluginState {
|
|
@@ -2,12 +2,13 @@ import { Node as PMNode } from 'prosemirror-model';
|
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
3
|
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
4
4
|
|
|
5
|
-
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
6
5
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
|
|
8
|
+
import { updateColumnWidths } from '../../transforms';
|
|
7
9
|
|
|
8
10
|
import { createCommand, getPluginState } from './plugin-factory';
|
|
9
11
|
import { evenAllColumnsWidths, isClickNear, ResizeState } from './utils';
|
|
10
|
-
import { updateColumnWidths } from '../../transforms';
|
|
11
12
|
|
|
12
13
|
export const evenColumns =
|
|
13
14
|
({
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
2
|
-
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
3
1
|
import { EditorView } from 'prosemirror-view';
|
|
4
2
|
|
|
5
3
|
import { CellAttributes, TableLayout } from '@atlaskit/adf-schema';
|
|
4
|
+
import {
|
|
5
|
+
ACTION_SUBJECT,
|
|
6
|
+
EVENT_TYPE,
|
|
7
|
+
TABLE_ACTION,
|
|
8
|
+
} from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
10
|
+
import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
|
|
6
11
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
12
|
+
import type {
|
|
13
|
+
GetEditorContainerWidth,
|
|
14
|
+
GetEditorFeatureFlags,
|
|
15
|
+
} from '@atlaskit/editor-common/types';
|
|
7
16
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
17
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
18
|
+
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
8
19
|
|
|
9
|
-
import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
|
|
10
20
|
import { updateColumnWidths } from '../../transforms';
|
|
11
21
|
import { getSelectedColumnIndexes, updateResizeHandles } from '../../utils';
|
|
12
22
|
|
|
@@ -21,17 +31,6 @@ import {
|
|
|
21
31
|
updateControls,
|
|
22
32
|
} from './utils';
|
|
23
33
|
|
|
24
|
-
import {
|
|
25
|
-
ACTION_SUBJECT,
|
|
26
|
-
EVENT_TYPE,
|
|
27
|
-
TABLE_ACTION,
|
|
28
|
-
} from '@atlaskit/editor-common/analytics';
|
|
29
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
30
|
-
import type {
|
|
31
|
-
GetEditorContainerWidth,
|
|
32
|
-
GetEditorFeatureFlags,
|
|
33
|
-
} from '@atlaskit/editor-common/types';
|
|
34
|
-
|
|
35
34
|
export const handleMouseDown = (
|
|
36
35
|
view: EditorView,
|
|
37
36
|
event: MouseEvent,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import classnames from 'classnames';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
2
|
|
|
3
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import type {
|
|
7
|
+
GetEditorContainerWidth,
|
|
8
|
+
GetEditorFeatureFlags,
|
|
9
|
+
} from '@atlaskit/editor-common/types';
|
|
10
|
+
|
|
5
11
|
import {
|
|
6
12
|
TableCssClassName as ClassName,
|
|
7
13
|
ColumnResizingPluginState,
|
|
@@ -12,11 +18,6 @@ import { handleMouseDown } from './event-handlers';
|
|
|
12
18
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
13
19
|
import { pluginKey } from './plugin-key';
|
|
14
20
|
import { getResizeCellPos } from './utils';
|
|
15
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
16
|
-
import type {
|
|
17
|
-
GetEditorContainerWidth,
|
|
18
|
-
GetEditorFeatureFlags,
|
|
19
|
-
} from '@atlaskit/editor-common/types';
|
|
20
21
|
|
|
21
22
|
export function createPlugin(
|
|
22
23
|
dispatch: Dispatch<ColumnResizingPluginState>,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DOMSerializer, Node as PmNode } from 'prosemirror-model';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
4
|
+
import { getFragmentBackingArray } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
6
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
2
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
4
3
|
|
|
5
4
|
import { tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
5
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
|
|
7
7
|
import { contentWidth } from './content-width';
|
|
8
8
|
import { unitToNumber } from './unit-to-number';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
|
|
4
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
4
|
import {
|
|
6
5
|
tableCellBorderWidth,
|
|
7
6
|
tableMarginTop,
|
|
8
7
|
} from '@atlaskit/editor-common/styles';
|
|
9
|
-
|
|
8
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
10
9
|
import {
|
|
11
10
|
closestElement,
|
|
12
11
|
containsClassName,
|
|
13
12
|
parsePx,
|
|
14
13
|
} from '@atlaskit/editor-common/utils';
|
|
14
|
+
|
|
15
15
|
import { updateOverflowShadows } from '../../../nodeviews/update-overflow-shadows';
|
|
16
16
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
17
|
-
import { getRowHeights } from '../../../utils/row-controls';
|
|
18
17
|
import { colWidthsForRow } from '../../../utils/column-controls';
|
|
18
|
+
import { getRowHeights } from '../../../utils/row-controls';
|
|
19
19
|
import { getPluginState as getMainPluginState } from '../../plugin-factory';
|
|
20
20
|
|
|
21
21
|
export const updateControls =
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { NodeSpec, ResolvedPos } from 'prosemirror-model';
|
|
1
|
+
import { NodeSpec, Node as PMNode, ResolvedPos } from 'prosemirror-model';
|
|
2
|
+
import { EditorState } from 'prosemirror-state';
|
|
2
3
|
import { EditorView } from 'prosemirror-view';
|
|
3
4
|
|
|
4
5
|
import { CellAttributes, TableLayout } from '@atlaskit/adf-schema';
|
|
6
|
+
import {
|
|
7
|
+
getParentNodeWidth,
|
|
8
|
+
layoutToWidth,
|
|
9
|
+
} from '@atlaskit/editor-common/node-width';
|
|
5
10
|
import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
11
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
6
12
|
import {
|
|
7
13
|
getBreakpoint,
|
|
8
14
|
mapBreakpointToLayoutMaxWidth,
|
|
9
15
|
} from '@atlaskit/editor-common/ui';
|
|
16
|
+
import { containsClassName } from '@atlaskit/editor-common/utils';
|
|
10
17
|
import {
|
|
11
18
|
akEditorFullWidthLayoutWidth,
|
|
12
19
|
akEditorGutterPadding,
|
|
13
20
|
akEditorTableNumberColumnWidth,
|
|
14
21
|
} from '@atlaskit/editor-shared-styles';
|
|
15
22
|
|
|
16
|
-
import { containsClassName } from '@atlaskit/editor-common/utils';
|
|
17
23
|
import { TableOptions } from '../../../nodeviews/types';
|
|
18
|
-
import { Node as PMNode } from 'prosemirror-model';
|
|
19
|
-
import { EditorState } from 'prosemirror-state';
|
|
20
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
21
|
-
import {
|
|
22
|
-
getParentNodeWidth,
|
|
23
|
-
layoutToWidth,
|
|
24
|
-
} from '@atlaskit/editor-common/node-width';
|
|
25
24
|
|
|
26
25
|
// Translates named layouts in number values.
|
|
27
26
|
export function getLayoutSize(
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
|
+
import { EditorState } from 'prosemirror-state';
|
|
2
3
|
|
|
4
|
+
import { TableLayout } from '@atlaskit/adf-schema';
|
|
3
5
|
import {
|
|
4
6
|
tableCellMinWidth,
|
|
5
7
|
tableNewColumnMinWidth,
|
|
6
8
|
} from '@atlaskit/editor-common/styles';
|
|
9
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
7
10
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
8
11
|
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
9
|
-
|
|
12
|
+
|
|
13
|
+
import { getSelectedTableInfo } from '../../../utils';
|
|
14
|
+
|
|
10
15
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
11
16
|
import {
|
|
17
|
+
ColumnState,
|
|
12
18
|
getCellsRefsInColumn,
|
|
13
19
|
getColumnStateFromDOM,
|
|
14
|
-
ColumnState,
|
|
15
20
|
} from './column-state';
|
|
16
21
|
import { syncStickyRowToTable } from './dom';
|
|
17
|
-
import { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
18
22
|
import { getTableMaxWidth } from './misc';
|
|
19
|
-
import {
|
|
20
|
-
import { getSelectedTableInfo } from '../../../utils';
|
|
21
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
23
|
+
import { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
22
24
|
|
|
23
25
|
export const getResizeState = ({
|
|
24
26
|
minWidth,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
|
+
import type { DomAtPos } from 'prosemirror-utils';
|
|
3
4
|
|
|
4
5
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
5
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
|
|
8
|
+
import { updateColumnWidths } from '../../../transforms';
|
|
10
9
|
import { getTableWidth } from '../../../utils';
|
|
11
10
|
import { getLayoutSize } from '../utils/misc';
|
|
12
11
|
import { reduceSpace } from '../utils/resize-logic';
|
|
@@ -17,8 +16,8 @@ import {
|
|
|
17
16
|
updateColgroup,
|
|
18
17
|
} from '../utils/resize-state';
|
|
19
18
|
import { ResizeState } from '../utils/types';
|
|
19
|
+
|
|
20
20
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
21
|
-
import { updateColumnWidths } from '../../../transforms';
|
|
22
21
|
|
|
23
22
|
export interface ScaleOptions {
|
|
24
23
|
node: PMNode;
|
|
@@ -157,7 +156,7 @@ export const previewScaleTable = (
|
|
|
157
156
|
return;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
if (
|
|
159
|
+
if (parentWidth) {
|
|
161
160
|
tableRef.style.width = `${parentWidth}px`;
|
|
162
161
|
}
|
|
163
162
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { keymap } from 'prosemirror-keymap';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
4
2
|
|
|
5
3
|
import {
|
|
6
4
|
bindKeymapWithCommand,
|
|
7
|
-
moveRight,
|
|
8
5
|
moveLeft,
|
|
6
|
+
moveRight,
|
|
9
7
|
} from '@atlaskit/editor-common/keymaps';
|
|
8
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
10
|
+
|
|
10
11
|
import { arrowLeftFromTable, arrowRightFromTable } from '../commands/selection';
|
|
11
12
|
|
|
12
13
|
export function tableSelectionKeymapPlugin(
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
* Has login to scan the document, add width value to table's width attribute when necessary
|
|
4
4
|
* Also holds resizing state to hide / show table controls
|
|
5
5
|
*/
|
|
6
|
+
import { PluginKey } from 'prosemirror-state';
|
|
7
|
+
import { ReplaceStep } from 'prosemirror-transform';
|
|
8
|
+
|
|
9
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
10
|
+
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
6
11
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
12
|
import {
|
|
8
13
|
akEditorFullWidthLayoutWidth,
|
|
9
14
|
akEditorWideLayoutWidth,
|
|
10
15
|
} from '@atlaskit/editor-shared-styles';
|
|
11
|
-
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
12
|
-
import { ReplaceStep } from 'prosemirror-transform';
|
|
13
|
-
import { PluginKey } from 'prosemirror-state';
|
|
14
|
-
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
15
16
|
|
|
16
17
|
type __ReplaceStep = ReplaceStep & {
|
|
17
18
|
// Properties `to` and `from` are private attributes of ReplaceStep.
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
+
import { Node as PMNode } from 'prosemirror-model';
|
|
4
|
+
import { EditorState } from 'prosemirror-state';
|
|
5
|
+
import { findParentDomRefOfType } from 'prosemirror-utils';
|
|
6
|
+
import { EditorView } from 'prosemirror-view';
|
|
3
7
|
import { defineMessages } from 'react-intl-next';
|
|
4
8
|
|
|
5
|
-
import
|
|
9
|
+
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
10
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import {
|
|
13
|
+
addColumnAfter,
|
|
14
|
+
addRowAfter,
|
|
15
|
+
backspace,
|
|
16
|
+
tooltip,
|
|
17
|
+
} from '@atlaskit/editor-common/keymaps';
|
|
6
18
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
7
19
|
import type {
|
|
8
20
|
Command,
|
|
@@ -12,90 +24,75 @@ import type {
|
|
|
12
24
|
FloatingToolbarDropdown,
|
|
13
25
|
FloatingToolbarHandler,
|
|
14
26
|
FloatingToolbarItem,
|
|
27
|
+
GetEditorContainerWidth,
|
|
15
28
|
GetEditorFeatureFlags,
|
|
16
29
|
} from '@atlaskit/editor-common/types';
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
import {
|
|
31
|
+
cellBackgroundColorPalette,
|
|
32
|
+
DEFAULT_BORDER_COLOR,
|
|
33
|
+
} from '@atlaskit/editor-common/ui-color';
|
|
34
|
+
import {
|
|
35
|
+
closestElement,
|
|
36
|
+
getChildrenInfo,
|
|
37
|
+
getNodeName,
|
|
38
|
+
isReferencedSource,
|
|
39
|
+
} from '@atlaskit/editor-common/utils';
|
|
40
|
+
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
41
|
+
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
42
|
+
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
43
|
+
import {
|
|
44
|
+
findCellRectClosestToPos,
|
|
45
|
+
findTable,
|
|
46
|
+
getSelectionRect,
|
|
47
|
+
isSelectionType,
|
|
48
|
+
splitCell,
|
|
49
|
+
} from '@atlaskit/editor-tables/utils';
|
|
50
|
+
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
19
51
|
|
|
20
52
|
import {
|
|
21
53
|
clearHoverSelection,
|
|
22
|
-
hoverTable,
|
|
23
54
|
hoverColumns,
|
|
55
|
+
hoverMergedCells,
|
|
24
56
|
hoverRows,
|
|
57
|
+
hoverTable,
|
|
25
58
|
removeDescendantNodes,
|
|
26
|
-
hoverMergedCells,
|
|
27
59
|
} from './commands';
|
|
28
60
|
import {
|
|
61
|
+
deleteColumnsWithAnalytics,
|
|
62
|
+
deleteRowsWithAnalytics,
|
|
29
63
|
deleteTableWithAnalytics,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
64
|
+
distributeColumnsWidthsWithAnalytics,
|
|
65
|
+
emptyMultipleCellsWithAnalytics,
|
|
66
|
+
insertColumnWithAnalytics,
|
|
33
67
|
insertRowWithAnalytics,
|
|
34
|
-
deleteRowsWithAnalytics,
|
|
35
68
|
mergeCellsWithAnalytics,
|
|
69
|
+
setColorWithAnalytics,
|
|
70
|
+
sortColumnWithAnalytics,
|
|
36
71
|
splitCellWithAnalytics,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
72
|
+
toggleHeaderColumnWithAnalytics,
|
|
73
|
+
toggleHeaderRowWithAnalytics,
|
|
74
|
+
toggleNumberColumnWithAnalytics,
|
|
40
75
|
wrapTableInExpandWithAnalytics,
|
|
41
|
-
sortColumnWithAnalytics,
|
|
42
|
-
setColorWithAnalytics,
|
|
43
|
-
distributeColumnsWidthsWithAnalytics,
|
|
44
76
|
} from './commands-with-analytics';
|
|
45
77
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
46
78
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
79
|
+
import { getNewResizeStateFromSelectedColumns } from './pm-plugins/table-resizing/utils/resize-state';
|
|
47
80
|
import { pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
81
|
+
import { canMergeCells } from './transforms';
|
|
48
82
|
import {
|
|
49
|
-
ToolbarMenuConfig,
|
|
50
|
-
ToolbarMenuState,
|
|
51
|
-
ToolbarMenuContext,
|
|
52
83
|
PluginConfig,
|
|
53
84
|
TableCssClassName,
|
|
85
|
+
ToolbarMenuConfig,
|
|
86
|
+
ToolbarMenuContext,
|
|
87
|
+
ToolbarMenuState,
|
|
54
88
|
} from './types';
|
|
89
|
+
import { messages as ContextualMenuMessages } from './ui/FloatingContextualMenu/ContextualMenu';
|
|
90
|
+
import tableMessages from './ui/messages';
|
|
55
91
|
import {
|
|
56
92
|
getMergedCellsPositions,
|
|
57
93
|
getSelectedColumnIndexes,
|
|
58
94
|
getSelectedRowIndexes,
|
|
59
95
|
} from './utils';
|
|
60
|
-
import {
|
|
61
|
-
isReferencedSource,
|
|
62
|
-
getChildrenInfo,
|
|
63
|
-
getNodeName,
|
|
64
|
-
} from '@atlaskit/editor-common/utils';
|
|
65
|
-
|
|
66
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
67
|
-
import {
|
|
68
|
-
findCellRectClosestToPos,
|
|
69
|
-
findTable,
|
|
70
|
-
getSelectionRect,
|
|
71
|
-
isSelectionType,
|
|
72
|
-
} from '@atlaskit/editor-tables/utils';
|
|
73
|
-
import { EditorState } from 'prosemirror-state';
|
|
74
|
-
import { canMergeCells } from './transforms';
|
|
75
|
-
import { splitCell } from '@atlaskit/editor-tables/utils';
|
|
76
|
-
import tableMessages from './ui/messages';
|
|
77
|
-
import { messages as ContextualMenuMessages } from './ui/FloatingContextualMenu/ContextualMenu';
|
|
78
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
79
|
-
|
|
80
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
81
|
-
import { findParentDomRefOfType } from 'prosemirror-utils';
|
|
82
|
-
import { EditorView } from 'prosemirror-view';
|
|
83
|
-
import { Node as PMNode } from 'prosemirror-model';
|
|
84
|
-
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
85
|
-
import {
|
|
86
|
-
addColumnAfter,
|
|
87
|
-
addRowAfter,
|
|
88
|
-
tooltip,
|
|
89
|
-
backspace,
|
|
90
|
-
} from '@atlaskit/editor-common/keymaps';
|
|
91
|
-
import { getNewResizeStateFromSelectedColumns } from './pm-plugins/table-resizing/utils/resize-state';
|
|
92
|
-
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
93
|
-
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
94
|
-
import {
|
|
95
|
-
cellBackgroundColorPalette,
|
|
96
|
-
DEFAULT_BORDER_COLOR,
|
|
97
|
-
} from '@atlaskit/editor-common/ui-color';
|
|
98
|
-
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
99
96
|
|
|
100
97
|
export const messages = defineMessages({
|
|
101
98
|
tableOptions: {
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
+
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
4
|
+
import { EditorView } from 'prosemirror-view';
|
|
6
5
|
|
|
7
6
|
import { CellAttributes } from '@atlaskit/adf-schema';
|
|
7
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
8
|
+
import {
|
|
9
|
+
tableCellMinWidth,
|
|
10
|
+
tableNewColumnMinWidth,
|
|
11
|
+
} from '@atlaskit/editor-common/styles';
|
|
12
|
+
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
13
|
+
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
14
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
15
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
16
|
|
|
9
17
|
import {
|
|
10
18
|
hasTableBeenResized,
|
|
11
19
|
ResizeState,
|
|
12
20
|
} from '../pm-plugins/table-resizing/utils';
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import { EditorView } from 'prosemirror-view';
|
|
16
|
-
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
21
|
+
import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
22
|
+
import { getTableMaxWidth } from '../pm-plugins/table-resizing/utils/misc';
|
|
17
23
|
import {
|
|
18
24
|
getResizeState,
|
|
19
25
|
normaliseTableLayout,
|
|
20
26
|
} from '../pm-plugins/table-resizing/utils/resize-state';
|
|
21
|
-
import { getTableMaxWidth } from '../pm-plugins/table-resizing/utils/misc';
|
|
22
|
-
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
23
27
|
import { scaleTableTo } from '../pm-plugins/table-resizing/utils/scale-table';
|
|
24
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
25
|
-
import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
26
28
|
import { insertColumnButtonOffset } from '../ui/common-styles';
|
|
27
29
|
|
|
28
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
29
|
-
|
|
30
30
|
export const updateColumnWidths =
|
|
31
31
|
(resizeState: ResizeState, table: PMNode, start: number) =>
|
|
32
32
|
(tr: Transaction): Transaction => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { Selection, Transaction } from 'prosemirror-state';
|
|
3
|
-
import { TableMap, Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
3
|
|
|
6
4
|
import { CellAttributes } from '@atlaskit/adf-schema';
|
|
7
5
|
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
6
|
+
import { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
|
+
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
|
|
9
9
|
import { splitCellsInColumns } from './split';
|
|
10
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { Selection, Transaction } from 'prosemirror-state';
|
|
3
|
-
import { TableMap, Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
3
|
|
|
6
4
|
import { CellAttributes } from '@atlaskit/adf-schema';
|
|
5
|
+
import { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
7
7
|
|
|
8
8
|
import { mergeEmptyColumns } from './merge';
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Fragment, Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { Selection, Transaction } from 'prosemirror-state';
|
|
3
|
-
import { TableMap, Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
|
-
import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
6
3
|
|
|
7
4
|
import { CellAttributes } from '@atlaskit/adf-schema';
|
|
5
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
|
+
import { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
|
+
import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
|
|
9
9
|
// re-creates table node with merged cells
|
|
10
10
|
export function mergeCells(tr: Transaction): Transaction {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
1
|
+
import { Fragment, Slice } from 'prosemirror-model';
|
|
2
|
+
import { EditorState, TextSelection, Transaction } from 'prosemirror-state';
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
|
-
TABLE_ACTION,
|
|
7
5
|
ACTION_SUBJECT,
|
|
8
6
|
EVENT_TYPE,
|
|
9
7
|
INPUT_METHOD,
|
|
8
|
+
TABLE_ACTION,
|
|
10
9
|
} from '@atlaskit/editor-common/analytics';
|
|
11
|
-
import { getSelectedTableInfo } from '../utils';
|
|
12
10
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
12
|
+
|
|
13
|
+
import { getSelectedTableInfo } from '../utils';
|
|
13
14
|
|
|
14
15
|
export const replaceSelectedTable = (
|
|
15
16
|
state: EditorState,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
2
2
|
import { Transaction } from 'prosemirror-state';
|
|
3
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
3
|
|
|
5
4
|
import { CellAttributes } from '@atlaskit/adf-schema';
|
|
5
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Helper to split all the cells in a range of columns
|