@atlaskit/editor-plugin-table 2.3.1 → 2.5.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 +16 -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 +4 -3
- 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 +6 -5
- 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 +6 -5
- 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 +12 -4
- 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 +9 -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
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import memoizeOne from 'memoize-one';
|
|
5
5
|
import rafSchedule from 'raf-schd';
|
|
6
|
-
import {
|
|
6
|
+
import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
|
|
7
7
|
import { tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
8
8
|
import { browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
9
9
|
import { akEditorTableToolbarSize as tableToolbarSize } from '@atlaskit/editor-shared-styles';
|
|
10
|
-
import {
|
|
10
|
+
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
11
11
|
import { autoSizeTable, clearHoverSelection } from '../commands';
|
|
12
12
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
13
13
|
import { findStickyHeaderForTable, pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-headers';
|
|
@@ -15,12 +15,10 @@ import { getLayoutSize, insertColgroupFromNode as recreateResizeColsByNode, scal
|
|
|
15
15
|
import { updateControls } from '../pm-plugins/table-resizing/utils/dom';
|
|
16
16
|
import { TableCssClassName as ClassName, ShadowEvent } from '../types';
|
|
17
17
|
import TableFloatingControls from '../ui/TableFloatingControls';
|
|
18
|
-
import { containsHeaderRow, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns
|
|
19
|
-
import { updateOverflowShadows } from './update-overflow-shadows';
|
|
20
|
-
import memoizeOne from 'memoize-one';
|
|
18
|
+
import { containsHeaderRow, isTableNested, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns } from '../utils';
|
|
21
19
|
import { OverflowShadowsObserver } from './OverflowShadowsObserver';
|
|
22
20
|
import { TableContainer } from './TableContainer';
|
|
23
|
-
import {
|
|
21
|
+
import { updateOverflowShadows } from './update-overflow-shadows';
|
|
24
22
|
const isIE11 = browser.ie_version === 11;
|
|
25
23
|
const NOOP = () => undefined;
|
|
26
24
|
class TableComponent extends React.Component {
|
|
@@ -121,7 +119,7 @@ class TableComponent extends React.Component {
|
|
|
121
119
|
// This last check is also to cater for dynamic text sizing changing the 'default' layout width
|
|
122
120
|
// Usually happens on window resize.
|
|
123
121
|
layoutSize !== this.layoutSize || noOfColumnsChanged) {
|
|
124
|
-
const shouldScaleTable = (!
|
|
122
|
+
const shouldScaleTable = (!(options !== null && options !== void 0 && options.isTableResizingEnabled) || (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && isNested) && !hasNumberedColumnChanged && !noOfColumnsChanged;
|
|
125
123
|
|
|
126
124
|
// If column has been inserted/deleted avoid multi dispatch
|
|
127
125
|
if (shouldScaleTable) {
|
|
@@ -273,7 +271,8 @@ class TableComponent extends React.Component {
|
|
|
273
271
|
componentDidMount() {
|
|
274
272
|
const {
|
|
275
273
|
allowColumnResizing,
|
|
276
|
-
eventDispatcher
|
|
274
|
+
eventDispatcher,
|
|
275
|
+
options
|
|
277
276
|
} = this.props;
|
|
278
277
|
if (allowColumnResizing && this.wrapper && !isIE11) {
|
|
279
278
|
this.wrapper.addEventListener('scroll', this.handleScrollDebounced);
|
|
@@ -283,7 +282,7 @@ class TableComponent extends React.Component {
|
|
|
283
282
|
* We no longer use `containerWidth` as a variable to determine an update for table resizing (avoids unnecessary updates).
|
|
284
283
|
* Instead we use the resize event to only trigger updates when necessary.
|
|
285
284
|
*/
|
|
286
|
-
if (!
|
|
285
|
+
if (!(options !== null && options !== void 0 && options.isTableResizingEnabled)) {
|
|
287
286
|
window.addEventListener('resize', this.handleWindowResizeDebounced);
|
|
288
287
|
}
|
|
289
288
|
this.handleTableResizingDebounced();
|
|
@@ -295,6 +294,11 @@ class TableComponent extends React.Component {
|
|
|
295
294
|
eventDispatcher.on(stickyHeadersPluginKey.key, this.onStickyState);
|
|
296
295
|
}
|
|
297
296
|
componentWillUnmount() {
|
|
297
|
+
const {
|
|
298
|
+
allowColumnResizing,
|
|
299
|
+
eventDispatcher,
|
|
300
|
+
options
|
|
301
|
+
} = this.props;
|
|
298
302
|
if (this.wrapper && !isIE11) {
|
|
299
303
|
this.wrapper.removeEventListener('scroll', this.handleScrollDebounced);
|
|
300
304
|
}
|
|
@@ -302,16 +306,16 @@ class TableComponent extends React.Component {
|
|
|
302
306
|
this.scaleTableDebounced.cancel();
|
|
303
307
|
this.handleTableResizingDebounced.cancel();
|
|
304
308
|
this.handleAutoSizeDebounced.cancel();
|
|
305
|
-
if (!
|
|
309
|
+
if (!(options !== null && options !== void 0 && options.isTableResizingEnabled)) {
|
|
306
310
|
this.handleWindowResizeDebounced.cancel();
|
|
307
311
|
}
|
|
308
|
-
if (!
|
|
312
|
+
if (!(options !== null && options !== void 0 && options.isTableResizingEnabled) && allowColumnResizing) {
|
|
309
313
|
window.removeEventListener('resize', this.handleWindowResizeDebounced);
|
|
310
314
|
}
|
|
311
315
|
if (this.overflowShadowsObserver) {
|
|
312
316
|
this.overflowShadowsObserver.dispose();
|
|
313
317
|
}
|
|
314
|
-
|
|
318
|
+
eventDispatcher.off(stickyHeadersPluginKey.key, this.onStickyState);
|
|
315
319
|
}
|
|
316
320
|
componentDidUpdate() {
|
|
317
321
|
const {
|
|
@@ -449,10 +453,10 @@ class TableComponent extends React.Component {
|
|
|
449
453
|
node: node,
|
|
450
454
|
tableRef: tableRef,
|
|
451
455
|
containerWidth: containerWidth,
|
|
452
|
-
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.isFullWidthModeEnabled,
|
|
453
456
|
isBreakoutEnabled: options === null || options === void 0 ? void 0 : options.isBreakoutEnabled,
|
|
454
457
|
isNested: isNested,
|
|
455
|
-
pluginInjectionApi: pluginInjectionApi
|
|
458
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
459
|
+
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled
|
|
456
460
|
}, stickyHeadersOptimization && /*#__PURE__*/React.createElement("div", {
|
|
457
461
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
458
462
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import React, { useCallback, useRef
|
|
2
|
-
import
|
|
1
|
+
import React, { forwardRef, useCallback, useRef } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
3
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
4
4
|
import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
5
|
+
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils';
|
|
5
7
|
import { TableCssClassName as ClassName } from '../types';
|
|
6
8
|
import { TableResizer } from './TableResizer';
|
|
7
|
-
import { TABLE_MAX_WIDTH } from '../pm-plugins/table-resizing/utils';
|
|
8
|
-
import classNames from 'classnames';
|
|
9
|
-
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
10
9
|
const getMarginLeft = (lineLength, tableWidth) => {
|
|
11
10
|
let marginLeft;
|
|
12
11
|
if (tableWidth !== 'inherit' && lineLength) {
|
|
@@ -44,10 +43,9 @@ export const ResizableTableContainer = ({
|
|
|
44
43
|
pluginInjectionApi
|
|
45
44
|
}) => {
|
|
46
45
|
const containerRef = useRef(null);
|
|
47
|
-
const innerContainerRef = useRef(null);
|
|
48
46
|
const marginLeftRef = useRef(0);
|
|
49
47
|
const updateWidth = useCallback(width => {
|
|
50
|
-
if (!containerRef.current
|
|
48
|
+
if (!containerRef.current) {
|
|
51
49
|
return;
|
|
52
50
|
}
|
|
53
51
|
const marginLeft = getMarginLeft(lineLength, width);
|
|
@@ -88,7 +86,6 @@ export const ResizableTableContainer = ({
|
|
|
88
86
|
tableRef: tableRef,
|
|
89
87
|
displayGuideline: displayGuideline
|
|
90
88
|
}, /*#__PURE__*/React.createElement(InnerContainer, {
|
|
91
|
-
ref: innerContainerRef,
|
|
92
89
|
className: className,
|
|
93
90
|
node: node
|
|
94
91
|
}, children)));
|
|
@@ -101,7 +98,7 @@ export const TableContainer = ({
|
|
|
101
98
|
lineLength,
|
|
102
99
|
width: editorWidth
|
|
103
100
|
},
|
|
104
|
-
|
|
101
|
+
isTableResizingEnabled,
|
|
105
102
|
isBreakoutEnabled,
|
|
106
103
|
editorView,
|
|
107
104
|
getPos,
|
|
@@ -109,7 +106,7 @@ export const TableContainer = ({
|
|
|
109
106
|
isNested,
|
|
110
107
|
pluginInjectionApi
|
|
111
108
|
}) => {
|
|
112
|
-
if (
|
|
109
|
+
if (isTableResizingEnabled && !isNested) {
|
|
113
110
|
return /*#__PURE__*/React.createElement(ResizableTableContainer, {
|
|
114
111
|
className: className,
|
|
115
112
|
node: node,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
1
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import rafSchd from 'raf-schd';
|
|
3
|
-
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
4
3
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
5
|
-
import {
|
|
4
|
+
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
5
|
+
import { COLUMN_MIN_WIDTH, getColgroupChildrenLength, previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils';
|
|
6
6
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
7
|
+
import { TABLE_HIGHLIGHT_GAP, TABLE_SNAP_GAP } from '../ui/consts';
|
|
7
8
|
import { defaultGuidelines, defaultGuidelineWidths } from '../utils/guidelines';
|
|
8
9
|
import { findClosestSnap } from '../utils/snapping';
|
|
9
|
-
import { TABLE_SNAP_GAP, TABLE_HIGHLIGHT_GAP } from '../ui/consts';
|
|
10
10
|
const handles = {
|
|
11
11
|
right: true
|
|
12
12
|
};
|
|
@@ -124,6 +124,7 @@ export const TableResizer = ({
|
|
|
124
124
|
minWidth: minColumnWidth,
|
|
125
125
|
maxWidth: maxWidth,
|
|
126
126
|
snapGap: TABLE_SNAP_GAP,
|
|
127
|
-
snap: guidelineSnaps
|
|
127
|
+
snap: guidelineSnaps,
|
|
128
|
+
handlePositioning: "adjacent"
|
|
128
129
|
}, children);
|
|
129
130
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { DOMSerializer } from 'prosemirror-model';
|
|
4
|
+
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
4
5
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
5
6
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
7
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
8
|
import { pluginConfig as getPluginConfig } from '../create-plugin-config';
|
|
7
9
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
8
10
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
9
11
|
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
10
|
-
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
11
12
|
import { generateColgroup } from '../pm-plugins/table-resizing/utils';
|
|
12
|
-
import {
|
|
13
|
-
import TableComponent from './TableComponent';
|
|
14
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
|
-
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
13
|
+
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
16
14
|
import { isTableNested } from '../utils';
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
import TableComponent from './TableComponent';
|
|
16
|
+
const tableAttributes = (node, options, state, pos) => {
|
|
17
|
+
// provide a width for tables when custom table width is supported
|
|
18
|
+
// this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
|
|
19
|
+
// support screen size adjustments
|
|
20
|
+
const shouldHaveInlineWidth = (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && !isTableNested(state, pos);
|
|
19
21
|
let style = shouldHaveInlineWidth ? `width: ${getTableContainerWidth(node)}px` : undefined;
|
|
20
22
|
return {
|
|
21
23
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
@@ -31,7 +33,7 @@ const toDOM = (node, props) => {
|
|
|
31
33
|
if (props.allowColumnResizing) {
|
|
32
34
|
colgroup = ['colgroup', {}, ...generateColgroup(node)];
|
|
33
35
|
}
|
|
34
|
-
return ['table', tableAttributes(node, props.view.state, props.getPos()), colgroup, ['tbody', 0]];
|
|
36
|
+
return ['table', tableAttributes(node, props.options, props.view.state, props.getPos()), colgroup, ['tbody', 0]];
|
|
35
37
|
};
|
|
36
38
|
export default class TableView extends ReactNodeView {
|
|
37
39
|
constructor(props) {
|
|
@@ -55,7 +57,7 @@ export default class TableView extends ReactNodeView {
|
|
|
55
57
|
if (!this.table) {
|
|
56
58
|
return;
|
|
57
59
|
}
|
|
58
|
-
const attrs = tableAttributes(node, this.view.state, this.getPos());
|
|
60
|
+
const attrs = tableAttributes(node, this.reactComponentProps.options, this.view.state, this.getPos());
|
|
59
61
|
Object.keys(attrs).forEach(attr => {
|
|
60
62
|
this.table.setAttribute(attr, attrs[attr]);
|
|
61
63
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import uuid from 'uuid';
|
|
2
1
|
import { DOMSerializer } from 'prosemirror-model';
|
|
3
|
-
import
|
|
2
|
+
import uuid from 'uuid';
|
|
3
|
+
import { getCellAttrs, getCellDomAttrs } from '@atlaskit/adf-schema';
|
|
4
4
|
const DEFAULT_COL_SPAN = 1;
|
|
5
5
|
const DEFAULT_ROW_SPAN = 1;
|
|
6
6
|
export default class TableCellNodeView {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
1
|
import { PluginKey
|
|
3
|
-
|
|
4
2
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
5
3
|
} from 'prosemirror-state';
|
|
6
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
4
|
import { DecorationSet } from 'prosemirror-view';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
8
7
|
import { pluginKey as tablePluginKey } from '../plugin-key';
|
|
9
8
|
import { pluginKey as tableWidthPluginKey } from '../table-width';
|
|
10
9
|
import { buildColumnControlsDecorations, maybeUpdateColumnControlsSelectedDecoration } from './utils';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { keymap } from 'prosemirror-keymap';
|
|
2
1
|
import { chainCommands } from 'prosemirror-commands';
|
|
3
|
-
import
|
|
2
|
+
import { keymap } from 'prosemirror-keymap';
|
|
4
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import * as keymaps from '@atlaskit/editor-common/keymaps';
|
|
5
|
+
import { createTable, goToNextCell, moveCursorBackward, triggerUnlessTableHeader } from '../commands';
|
|
6
|
+
import { addRowAroundSelection, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
7
7
|
import { addColumnAfter, addColumnBefore } from '../commands/insert';
|
|
8
8
|
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
9
9
|
const createTableWithAnalytics = editorAnalyticsAPI => withEditorAnalyticsAPI({
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
1
|
import { findParentDomRefOfType, findParentNodeOfType } from 'prosemirror-utils';
|
|
2
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
4
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
+
import { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenLayoutNodes } from '@atlaskit/editor-common/transforms';
|
|
6
|
+
import { browser, closestElement } from '@atlaskit/editor-common/utils';
|
|
3
7
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
6
8
|
import { addBoldInEmptyHeaderCells, clearHoverSelection, setTableRef } from '../commands';
|
|
9
|
+
import { transformSliceRemoveCellBackgroundColor, transformSliceToAddTableHeaders, transformSliceToRemoveColumnsWidths } from '../commands/misc';
|
|
7
10
|
import { handleBlur, handleClick, handleCut, handleFocus, handleMouseDown, handleMouseLeave, handleMouseMove, handleMouseOut, handleMouseOver, handleTripleClick, whenTableInFocus } from '../event-handlers';
|
|
8
11
|
import { createTableView } from '../nodeviews/table';
|
|
12
|
+
import TableCellNodeView from '../nodeviews/tableCell';
|
|
9
13
|
import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
|
|
10
14
|
import { fixTables, replaceSelectedTable } from '../transforms';
|
|
11
15
|
import { TableCssClassName as ClassName } from '../types';
|
|
12
16
|
import { findControlsHoverDecoration, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, transformSliceToRemoveOpenTable, updateResizeHandles } from '../utils';
|
|
13
|
-
import {
|
|
17
|
+
import { isHeaderRowRequired } from '../utils/paste';
|
|
14
18
|
import { defaultTableSelection } from './default-table-selection';
|
|
15
19
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
16
20
|
import { pluginKey } from './plugin-key';
|
|
17
|
-
import TableCellNodeView from '../nodeviews/tableCell';
|
|
18
|
-
import { transformSliceRemoveCellBackgroundColor, transformSliceToRemoveColumnsWidths, transformSliceToAddTableHeaders } from '../commands/misc';
|
|
19
|
-
import { transformSliceToRemoveOpenLayoutNodes } from '@atlaskit/editor-common/transforms';
|
|
20
|
-
import { transformSliceToRemoveOpenExpand } from '@atlaskit/editor-common/transforms';
|
|
21
|
-
import { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
|
|
22
|
-
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
23
|
-
import { isHeaderRowRequired } from '../utils/paste';
|
|
24
21
|
let isBreakoutEnabled;
|
|
25
22
|
let isFullWidthModeEnabled;
|
|
26
23
|
let wasFullWidthModeEnabled;
|
|
27
|
-
|
|
24
|
+
let isTableResizingEnabled;
|
|
25
|
+
export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, breakoutEnabled, fullWidthModeEnabled, tableResizingEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi) => {
|
|
28
26
|
var _window;
|
|
29
27
|
isBreakoutEnabled = breakoutEnabled;
|
|
30
28
|
isFullWidthModeEnabled = fullWidthModeEnabled;
|
|
31
29
|
wasFullWidthModeEnabled = previousFullWidthModeEnabled;
|
|
30
|
+
isTableResizingEnabled = tableResizingEnabled;
|
|
32
31
|
const state = createPluginState(dispatch, {
|
|
33
32
|
pluginConfig,
|
|
34
33
|
insertColumnButtonIndex: undefined,
|
|
@@ -231,7 +230,8 @@ export const createPlugin = (dispatchAnalyticsEvent, dispatch, portalProviderAPI
|
|
|
231
230
|
table: (node, view, getPos) => createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
232
231
|
isBreakoutEnabled,
|
|
233
232
|
isFullWidthModeEnabled,
|
|
234
|
-
wasFullWidthModeEnabled
|
|
233
|
+
wasFullWidthModeEnabled,
|
|
234
|
+
isTableResizingEnabled
|
|
235
235
|
}, getEditorContainerWidth, getEditorFeatureFlags, pluginInjectionApi)
|
|
236
236
|
},
|
|
237
237
|
handleDOMEvents: {
|
package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* https://github.com/ProseMirror/prosemirror/issues/934
|
|
4
4
|
* We will remove this plugin when Webkit fix the problem itself.
|
|
5
5
|
*/
|
|
6
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
6
|
import { PluginKey } from 'prosemirror-state';
|
|
8
7
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
8
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
9
|
export const tableSafariDeleteCompositionTextIssueWorkaroundKey = new PluginKey('tableSafariDeleteCompositionTextIssueWorkaround');
|
|
10
10
|
export const createPlugin = () => {
|
|
11
11
|
return new SafePlugin({
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
3
|
+
import throttle from 'lodash/throttle';
|
|
2
4
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
3
5
|
import { mapChildren } from '@atlaskit/editor-common/utils';
|
|
4
6
|
import { TableCssClassName as ClassName, TableCssClassName } from '../../../types';
|
|
@@ -7,8 +9,6 @@ import { pluginKey as tablePluginKey } from '../../plugin-key';
|
|
|
7
9
|
import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../../table-resizing/utils/dom';
|
|
8
10
|
import { updateStickyState } from '../commands';
|
|
9
11
|
import { getTop, getTree } from './dom';
|
|
10
|
-
import debounce from 'lodash/debounce';
|
|
11
|
-
import throttle from 'lodash/throttle';
|
|
12
12
|
|
|
13
13
|
// limit scroll event calls
|
|
14
14
|
const HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
15
14
|
import { PluginKey } from 'prosemirror-state';
|
|
16
15
|
import rafSchedule from 'raf-schd';
|
|
17
16
|
import { uuid } from '@atlaskit/adf-schema';
|
|
17
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
18
18
|
import { stepHasSlice } from '@atlaskit/editor-common/utils';
|
|
19
19
|
const pluginKey = new PluginKey('tableLocalIdPlugin');
|
|
20
20
|
const getPluginState = state => state && pluginKey.getState(state);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
2
|
+
import { updateColumnWidths } from '../../transforms';
|
|
2
3
|
import { createCommand, getPluginState } from './plugin-factory';
|
|
3
4
|
import { evenAllColumnsWidths, isClickNear } from './utils';
|
|
4
|
-
import { updateColumnWidths } from '../../transforms';
|
|
5
5
|
export const evenColumns = ({
|
|
6
6
|
resizeState,
|
|
7
7
|
table,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
|
|
3
3
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import {
|
|
5
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
6
7
|
import { updateColumnWidths } from '../../transforms';
|
|
7
8
|
import { getSelectedColumnIndexes, updateResizeHandles } from '../../utils';
|
|
8
9
|
import { evenColumns, setDragging, stopResizing } from './commands';
|
|
9
10
|
import { getPluginState } from './plugin-factory';
|
|
10
11
|
import { currentColWidth, getLayoutSize, getResizeState, pointsAtCell, resizeColumn, updateControls } from './utils';
|
|
11
|
-
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
12
12
|
export const handleMouseDown = (view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI) => {
|
|
13
13
|
const {
|
|
14
14
|
state,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DOMSerializer } from 'prosemirror-model';
|
|
2
|
-
import { getFragmentBackingArray } from '@atlaskit/editor-common/utils';
|
|
3
2
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
|
+
import { getFragmentBackingArray } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
export const generateColgroup = table => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
2
1
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
3
2
|
import { tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
4
|
import { contentWidth } from './content-width';
|
|
5
5
|
import { unitToNumber } from './unit-to-number';
|
|
6
6
|
// Reads `width` and `minWidth` of each column from DOM and returns `ColumnState` containing those values
|
|
@@ -2,8 +2,8 @@ import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/st
|
|
|
2
2
|
import { closestElement, containsClassName, parsePx } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { updateOverflowShadows } from '../../../nodeviews/update-overflow-shadows';
|
|
4
4
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
5
|
-
import { getRowHeights } from '../../../utils/row-controls';
|
|
6
5
|
import { colWidthsForRow } from '../../../utils/column-controls';
|
|
6
|
+
import { getRowHeights } from '../../../utils/row-controls';
|
|
7
7
|
import { getPluginState as getMainPluginState } from '../../plugin-factory';
|
|
8
8
|
export const updateControls = getEditorFeatureFlags => state => {
|
|
9
9
|
const {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { getParentNodeWidth, layoutToWidth } from '@atlaskit/editor-common/node-width';
|
|
1
2
|
import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
2
3
|
import { getBreakpoint, mapBreakpointToLayoutMaxWidth } from '@atlaskit/editor-common/ui';
|
|
3
|
-
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { containsClassName } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
7
6
|
// Translates named layouts in number values.
|
|
8
7
|
export function getLayoutSize(tableLayout, containerWidth = 0, options) {
|
|
9
8
|
const {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { tableCellMinWidth, tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
2
2
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import { getSelectedTableInfo } from '../../../utils';
|
|
3
4
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
4
5
|
import { getCellsRefsInColumn, getColumnStateFromDOM } from './column-state';
|
|
5
6
|
import { syncStickyRowToTable } from './dom';
|
|
6
7
|
import { getTableMaxWidth } from './misc';
|
|
7
|
-
import { getSelectedTableInfo } from '../../../utils';
|
|
8
8
|
export const getResizeState = ({
|
|
9
9
|
minWidth,
|
|
10
10
|
maxSize,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
2
2
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import {
|
|
3
|
+
import { updateColumnWidths } from '../../../transforms';
|
|
4
4
|
import { getTableWidth } from '../../../utils';
|
|
5
5
|
import { getLayoutSize } from '../utils/misc';
|
|
6
6
|
import { reduceSpace } from '../utils/resize-logic';
|
|
7
7
|
import { adjustColumnsWidths, getResizeState, getTotalWidth, updateColgroup } from '../utils/resize-state';
|
|
8
8
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
9
|
-
import { updateColumnWidths } from '../../../transforms';
|
|
10
9
|
// Base function to trigger the actual scale on a table node.
|
|
11
10
|
// Will only resize/scale if a table has been previously resized.
|
|
12
11
|
export const scale = (tableRef, options, domAtPos) => {
|
|
@@ -110,7 +109,7 @@ export const previewScaleTable = (tableRef, options, domAtPos) => {
|
|
|
110
109
|
if (!tableRef) {
|
|
111
110
|
return;
|
|
112
111
|
}
|
|
113
|
-
if (
|
|
112
|
+
if (parentWidth) {
|
|
114
113
|
tableRef.style.width = `${parentWidth}px`;
|
|
115
114
|
}
|
|
116
115
|
if (!hasTableBeenResized(node)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keymap } from 'prosemirror-keymap';
|
|
2
|
-
import { bindKeymapWithCommand,
|
|
2
|
+
import { bindKeymapWithCommand, moveLeft, moveRight } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { arrowLeftFromTable, arrowRightFromTable } from '../commands/selection';
|
|
4
4
|
export function tableSelectionKeymapPlugin(editorSelectionAPI) {
|
|
5
5
|
const list = {};
|
|
@@ -3,11 +3,11 @@
|
|
|
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
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
6
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
10
|
import { akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
8
|
-
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
9
|
-
import { ReplaceStep } from 'prosemirror-transform';
|
|
10
|
-
import { PluginKey } from 'prosemirror-state';
|
|
11
11
|
export const pluginKey = new PluginKey('tableWidthPlugin');
|
|
12
12
|
const createPlugin = (dispatch, fullWidthEnabled) => new SafePlugin({
|
|
13
13
|
key: pluginKey,
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
+
import { findParentDomRefOfType } from 'prosemirror-utils';
|
|
3
4
|
import { defineMessages } from 'react-intl-next';
|
|
4
|
-
import
|
|
5
|
+
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
6
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
8
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
9
|
+
import { cellBackgroundColorPalette, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
10
|
+
import { closestElement, getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
11
|
+
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
12
|
+
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
13
|
+
import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType, splitCell } from '@atlaskit/editor-tables/utils';
|
|
14
|
+
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
15
|
+
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from './commands';
|
|
16
|
+
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from './commands-with-analytics';
|
|
8
17
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
9
18
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
19
|
+
import { getNewResizeStateFromSelectedColumns } from './pm-plugins/table-resizing/utils/resize-state';
|
|
10
20
|
import { pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
11
|
-
import { TableCssClassName } from './types';
|
|
12
|
-
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from './utils';
|
|
13
|
-
import { isReferencedSource, getChildrenInfo, getNodeName } from '@atlaskit/editor-common/utils';
|
|
14
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
15
|
-
import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
16
21
|
import { canMergeCells } from './transforms';
|
|
17
|
-
import {
|
|
18
|
-
import tableMessages from './ui/messages';
|
|
22
|
+
import { TableCssClassName } from './types';
|
|
19
23
|
import { messages as ContextualMenuMessages } from './ui/FloatingContextualMenu/ContextualMenu';
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import { addColumnAfter, addRowAfter, tooltip, backspace } from '@atlaskit/editor-common/keymaps';
|
|
23
|
-
import { getNewResizeStateFromSelectedColumns } from './pm-plugins/table-resizing/utils/resize-state';
|
|
24
|
-
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
25
|
-
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
26
|
-
import { cellBackgroundColorPalette, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
27
|
-
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
24
|
+
import tableMessages from './ui/messages';
|
|
25
|
+
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from './utils';
|
|
28
26
|
export const messages = defineMessages({
|
|
29
27
|
tableOptions: {
|
|
30
28
|
id: 'fabric.editor.tableOptions',
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
1
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
2
|
+
import { tableCellMinWidth, tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
6
|
import { hasTableBeenResized } from '../pm-plugins/table-resizing/utils';
|
|
5
|
-
import {
|
|
6
|
-
import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
7
|
+
import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
7
8
|
import { getTableMaxWidth } from '../pm-plugins/table-resizing/utils/misc';
|
|
8
|
-
import {
|
|
9
|
+
import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
9
10
|
import { scaleTableTo } from '../pm-plugins/table-resizing/utils/scale-table';
|
|
10
|
-
import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
11
11
|
import { insertColumnButtonOffset } from '../ui/common-styles';
|
|
12
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
export const updateColumnWidths = (resizeState, table, start) => tr => {
|
|
14
13
|
const map = TableMap.get(table);
|
|
15
14
|
const updatedCellsAttrs = {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Selection } from 'prosemirror-state';
|
|
2
|
+
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
2
3
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
5
5
|
import { splitCellsInColumns } from './split';
|
|
6
6
|
const deleteColumnsCustomStep = rect => tr => {
|
|
7
7
|
const table = findTable(tr.selection);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Fragment } from 'prosemirror-model';
|
|
2
2
|
import { Selection } from 'prosemirror-state';
|
|
3
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
5
|
import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
6
|
+
|
|
6
7
|
// re-creates table node with merged cells
|
|
7
8
|
export function mergeCells(tr) {
|
|
8
9
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Fragment, Slice } from 'prosemirror-model';
|
|
1
2
|
import { TextSelection } from 'prosemirror-state';
|
|
2
|
-
import {
|
|
3
|
+
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { TABLE_ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getSelectedTableInfo } from '../utils';
|
|
6
6
|
export const replaceSelectedTable = (state, content, inputMethod, editorAnalyticsAPI) => {
|
|
7
7
|
if (isTableSelected(state.selection)) {
|