@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
package/.eslintrc.js
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 2.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`22a59977bb3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/22a59977bb3) - [ux] Updated ResizerNext to allow handle style overrides. Updated the table resizer to space and align the resizer handle according the the design specifications
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 2.4.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [`e7ed90bad7c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7ed90bad7c) - Remove platform feature flag calls to editor-core and pass through a new option instead for custom table widths project, allowing for simpler clean up and reference
|
|
18
|
+
|
|
3
19
|
## 2.3.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.goToNextCell = void 0;
|
|
7
|
-
var _utils = require("@atlaskit/editor-tables/utils");
|
|
8
|
-
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
9
7
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
10
8
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
9
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
|
+
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
11
|
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
12
12
|
// #region Constants
|
|
13
13
|
|
|
@@ -7,13 +7,13 @@ exports.addColumnAfter = void 0;
|
|
|
7
7
|
exports.addColumnAt = addColumnAt;
|
|
8
8
|
exports.insertRow = exports.insertColumn = exports.createTable = exports.addColumnBefore = void 0;
|
|
9
9
|
var _prosemirrorState = require("prosemirror-state");
|
|
10
|
-
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
11
|
-
var _utils = require("@atlaskit/editor-tables/utils");
|
|
12
10
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
13
11
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
12
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
|
+
var _utils = require("@atlaskit/editor-tables/utils");
|
|
14
|
+
var _columnWidth = require("../transforms/column-width");
|
|
14
15
|
var _utils2 = require("../utils");
|
|
15
16
|
var _getAllowAddColumnCustomStep = require("../utils/get-allow-add-column-custom-step");
|
|
16
|
-
var _columnWidth = require("../transforms/column-width");
|
|
17
17
|
// #region Imports
|
|
18
18
|
|
|
19
19
|
// #endregion
|
|
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.triggerUnlessTableHeader = exports.transformSliceToRemoveColumnsWidths = exports.transformSliceToAddTableHeaders = exports.transformSliceRemoveCellBackgroundColor = exports.showInsertRowButton = exports.showInsertColumnButton = exports.setTableRef = exports.setMultipleCellAttrs = exports.setEditorFocus = exports.setCellAttr = exports.selectRow = exports.selectColumn = exports.moveCursorBackward = exports.hideInsertColumnOrRowButton = exports.deleteTableIfSelected = exports.deleteTable = exports.convertFirstRowToHeader = exports.autoSizeTable = exports.addResizeHandleDecorations = exports.addBoldInEmptyHeaderCells = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _prosemirrorState = require("prosemirror-state");
|
|
10
|
-
var
|
|
10
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
11
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
12
|
-
var
|
|
13
|
-
var _utils2 = require("@atlaskit/editor-
|
|
12
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
14
14
|
var _plugin = require("../pm-plugins/decorations/plugin");
|
|
15
15
|
var _utils3 = require("../pm-plugins/decorations/utils");
|
|
16
16
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
@@ -38,10 +38,10 @@ exports.setEditorFocus = setEditorFocus;
|
|
|
38
38
|
var setTableRef = function setTableRef(ref) {
|
|
39
39
|
return (0, _pluginFactory.createCommand)(function (state) {
|
|
40
40
|
var tableRef = ref;
|
|
41
|
-
var foundTable = (0,
|
|
41
|
+
var foundTable = (0, _utils2.findTable)(state.selection);
|
|
42
42
|
var tableNode = ref && foundTable ? foundTable.node : undefined;
|
|
43
43
|
var tablePos = ref && foundTable ? foundTable.pos : undefined;
|
|
44
|
-
var tableWrapperTarget = (0,
|
|
44
|
+
var tableWrapperTarget = (0, _utils.closestElement)(tableRef, ".".concat(_types.TableCssClassName.TABLE_NODE_WRAPPER)) || undefined;
|
|
45
45
|
var layout = tableNode ? tableNode.attrs.layout : undefined;
|
|
46
46
|
var decorationSet = (0, _updatePluginStateDecorations.updatePluginStateDecorations)(state, (0, _decoration.createColumnControlsDecoration)(state.selection), _types.TableDecorations.COLUMN_CONTROLS_DECORATIONS);
|
|
47
47
|
return {
|
|
@@ -84,7 +84,7 @@ var setCellAttr = function setCellAttr(name, value) {
|
|
|
84
84
|
return true;
|
|
85
85
|
}
|
|
86
86
|
} else {
|
|
87
|
-
var cell = (0,
|
|
87
|
+
var cell = (0, _utils2.selectionCell)(state.selection);
|
|
88
88
|
if (cell) {
|
|
89
89
|
if (dispatch) {
|
|
90
90
|
var _cell$nodeAfter, _cell$nodeAfter2;
|
|
@@ -102,13 +102,13 @@ var triggerUnlessTableHeader = function triggerUnlessTableHeader(command) {
|
|
|
102
102
|
var selection = state.selection,
|
|
103
103
|
tableHeader = state.schema.nodes.tableHeader;
|
|
104
104
|
if (selection instanceof _prosemirrorState.TextSelection) {
|
|
105
|
-
var cell = (0,
|
|
105
|
+
var cell = (0, _utils2.findCellClosestToPos)(selection.$from);
|
|
106
106
|
if (cell && cell.node.type !== tableHeader) {
|
|
107
107
|
return command(state, dispatch, view);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
if (selection instanceof _cellSelection.CellSelection) {
|
|
111
|
-
var rect = (0,
|
|
111
|
+
var rect = (0, _utils2.getSelectionRect)(selection);
|
|
112
112
|
if (!(0, _nodes.checkIfHeaderRowEnabled)(selection) || rect && rect.top > 0) {
|
|
113
113
|
return command(state, dispatch, view);
|
|
114
114
|
}
|
|
@@ -121,7 +121,7 @@ var transformSliceRemoveCellBackgroundColor = function transformSliceRemoveCellB
|
|
|
121
121
|
var _schema$nodes = schema.nodes,
|
|
122
122
|
tableCell = _schema$nodes.tableCell,
|
|
123
123
|
tableHeader = _schema$nodes.tableHeader;
|
|
124
|
-
return (0,
|
|
124
|
+
return (0, _utils.mapSlice)(slice, function (maybeCell) {
|
|
125
125
|
if (maybeCell.type === tableCell || maybeCell.type === tableHeader) {
|
|
126
126
|
var cellAttrs = _objectSpread({}, maybeCell.attrs);
|
|
127
127
|
cellAttrs.background = undefined;
|
|
@@ -136,7 +136,7 @@ var transformSliceToAddTableHeaders = function transformSliceToAddTableHeaders(s
|
|
|
136
136
|
table = _schema$nodes2.table,
|
|
137
137
|
tableHeader = _schema$nodes2.tableHeader,
|
|
138
138
|
tableRow = _schema$nodes2.tableRow;
|
|
139
|
-
return (0,
|
|
139
|
+
return (0, _utils.mapSlice)(slice, function (maybeTable) {
|
|
140
140
|
if (maybeTable.type === table) {
|
|
141
141
|
var firstRow = maybeTable.firstChild;
|
|
142
142
|
if (firstRow) {
|
|
@@ -156,7 +156,7 @@ var transformSliceToRemoveColumnsWidths = function transformSliceToRemoveColumns
|
|
|
156
156
|
var _schema$nodes3 = schema.nodes,
|
|
157
157
|
tableHeader = _schema$nodes3.tableHeader,
|
|
158
158
|
tableCell = _schema$nodes3.tableCell;
|
|
159
|
-
return (0,
|
|
159
|
+
return (0, _utils.mapSlice)(slice, function (maybeCell) {
|
|
160
160
|
if (maybeCell.type === tableCell || maybeCell.type === tableHeader) {
|
|
161
161
|
if (!maybeCell.attrs.colwidth) {
|
|
162
162
|
return maybeCell;
|
|
@@ -171,13 +171,13 @@ var transformSliceToRemoveColumnsWidths = function transformSliceToRemoveColumns
|
|
|
171
171
|
exports.transformSliceToRemoveColumnsWidths = transformSliceToRemoveColumnsWidths;
|
|
172
172
|
var deleteTable = function deleteTable(state, dispatch) {
|
|
173
173
|
if (dispatch) {
|
|
174
|
-
dispatch((0,
|
|
174
|
+
dispatch((0, _utils2.removeTable)(state.tr));
|
|
175
175
|
}
|
|
176
176
|
return true;
|
|
177
177
|
};
|
|
178
178
|
exports.deleteTable = deleteTable;
|
|
179
179
|
var deleteTableIfSelected = function deleteTableIfSelected(state, dispatch) {
|
|
180
|
-
if ((0,
|
|
180
|
+
if ((0, _utils2.isTableSelected)(state.selection)) {
|
|
181
181
|
return deleteTable(state, dispatch);
|
|
182
182
|
}
|
|
183
183
|
return false;
|
|
@@ -185,7 +185,7 @@ var deleteTableIfSelected = function deleteTableIfSelected(state, dispatch) {
|
|
|
185
185
|
exports.deleteTableIfSelected = deleteTableIfSelected;
|
|
186
186
|
var convertFirstRowToHeader = function convertFirstRowToHeader(schema) {
|
|
187
187
|
return function (tr) {
|
|
188
|
-
var table = (0,
|
|
188
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
189
189
|
var map = _tableMap.TableMap.get(table.node);
|
|
190
190
|
for (var i = 0; i < map.width; i++) {
|
|
191
191
|
var cell = table.node.child(0).child(i);
|
|
@@ -262,16 +262,16 @@ var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, targetCellPositi
|
|
|
262
262
|
return function (state, dispatch) {
|
|
263
263
|
var cursorPos;
|
|
264
264
|
var tr = state.tr;
|
|
265
|
-
if ((0,
|
|
265
|
+
if ((0, _utils2.isSelectionType)(tr.selection, 'cell')) {
|
|
266
266
|
var selection = tr.selection;
|
|
267
267
|
selection.forEachCell(function (_cell, pos) {
|
|
268
268
|
var $pos = tr.doc.resolve(tr.mapping.map(pos + 1));
|
|
269
|
-
tr = (0,
|
|
269
|
+
tr = (0, _utils2.setCellAttrs)((0, _utils2.findCellClosestToPos)($pos), attrs)(tr);
|
|
270
270
|
});
|
|
271
271
|
cursorPos = selection.$headCell.pos;
|
|
272
272
|
} else if (targetCellPosition) {
|
|
273
|
-
var cell = (0,
|
|
274
|
-
tr = (0,
|
|
273
|
+
var cell = (0, _utils2.findCellClosestToPos)(tr.doc.resolve(targetCellPosition + 1));
|
|
274
|
+
tr = (0, _utils2.setCellAttrs)(cell, attrs)(tr);
|
|
275
275
|
cursorPos = cell.pos;
|
|
276
276
|
}
|
|
277
277
|
if (tr.docChanged && cursorPos !== undefined) {
|
|
@@ -286,11 +286,11 @@ var setMultipleCellAttrs = function setMultipleCellAttrs(attrs, targetCellPositi
|
|
|
286
286
|
exports.setMultipleCellAttrs = setMultipleCellAttrs;
|
|
287
287
|
var selectColumn = function selectColumn(column, expand) {
|
|
288
288
|
return (0, _pluginFactory.createCommand)(function (state) {
|
|
289
|
-
var cells = (0,
|
|
289
|
+
var cells = (0, _utils2.getCellsInColumn)(column)(state.tr.selection);
|
|
290
290
|
if (!cells || !cells.length || typeof cells[0].pos !== 'number') {
|
|
291
291
|
return false;
|
|
292
292
|
}
|
|
293
|
-
var decorations = (0, _decoration.createColumnSelectedDecoration)((0,
|
|
293
|
+
var decorations = (0, _decoration.createColumnSelectedDecoration)((0, _utils2.selectColumn)(column, expand)(state.tr));
|
|
294
294
|
var decorationSet = (0, _updatePluginStateDecorations.updatePluginStateDecorations)(state, decorations, _types.TableDecorations.COLUMN_SELECTED);
|
|
295
295
|
var targetCellPosition = cells[0].pos;
|
|
296
296
|
return {
|
|
@@ -301,14 +301,14 @@ var selectColumn = function selectColumn(column, expand) {
|
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
303
|
}, function (tr) {
|
|
304
|
-
return (0,
|
|
304
|
+
return (0, _utils2.selectColumn)(column, expand)(tr).setMeta('addToHistory', false);
|
|
305
305
|
});
|
|
306
306
|
};
|
|
307
307
|
exports.selectColumn = selectColumn;
|
|
308
308
|
var selectRow = function selectRow(row, expand) {
|
|
309
309
|
return (0, _pluginFactory.createCommand)(function (state) {
|
|
310
310
|
var targetCellPosition;
|
|
311
|
-
var cells = (0,
|
|
311
|
+
var cells = (0, _utils2.getCellsInRow)(row)(state.tr.selection);
|
|
312
312
|
if (cells && cells.length) {
|
|
313
313
|
targetCellPosition = cells[0].pos;
|
|
314
314
|
}
|
|
@@ -319,7 +319,7 @@ var selectRow = function selectRow(row, expand) {
|
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
321
|
}, function (tr) {
|
|
322
|
-
return (0,
|
|
322
|
+
return (0, _utils2.selectRow)(row, expand)(tr).setMeta('addToHistory', false);
|
|
323
323
|
});
|
|
324
324
|
};
|
|
325
325
|
exports.selectRow = selectRow;
|
|
@@ -359,7 +359,7 @@ var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton() {
|
|
|
359
359
|
exports.hideInsertColumnOrRowButton = hideInsertColumnOrRowButton;
|
|
360
360
|
var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex) {
|
|
361
361
|
return (0, _pluginFactory.createCommand)(function (state) {
|
|
362
|
-
var tableNode = (0,
|
|
362
|
+
var tableNode = (0, _utils2.findTable)(state.selection);
|
|
363
363
|
var _getPluginState = (0, _pluginFactory.getPluginState)(state),
|
|
364
364
|
allowColumnResizing = _getPluginState.pluginConfig.allowColumnResizing;
|
|
365
365
|
if (!tableNode || !allowColumnResizing) {
|
|
@@ -394,7 +394,7 @@ var addBoldInEmptyHeaderCells = function addBoldInEmptyHeaderCells(tableCellHead
|
|
|
394
394
|
var tr = state.tr;
|
|
395
395
|
if (
|
|
396
396
|
// Avoid infinite loop when the current selection is not a TextSelection
|
|
397
|
-
(0,
|
|
397
|
+
(0, _utils.isTextSelection)(tr.selection) && tr.selection.$cursor &&
|
|
398
398
|
// When storedMark is null that means this is the initial state
|
|
399
399
|
// if the user press to remove the mark storedMark will be an empty array
|
|
400
400
|
// and we shouldn't apply the strong mark
|
|
@@ -402,7 +402,7 @@ var addBoldInEmptyHeaderCells = function addBoldInEmptyHeaderCells(tableCellHead
|
|
|
402
402
|
// Check if the current node is a direct child from paragraph
|
|
403
403
|
tr.selection.$from.depth === tableCellHeader.depth + 1 &&
|
|
404
404
|
// this logic is applied only for empty paragraph
|
|
405
|
-
tableCellHeader.node.nodeSize === 4 && (0,
|
|
405
|
+
tableCellHeader.node.nodeSize === 4 && (0, _utils.isParagraph)(tableCellHeader.node.firstChild, state.schema)) {
|
|
406
406
|
var strong = state.schema.marks.strong;
|
|
407
407
|
tr.setStoredMarks([strong.create()]).setMeta('addToHistory', false);
|
|
408
408
|
if (dispatch) {
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.removeDescendantNodes = void 0;
|
|
7
|
-
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
8
7
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
|
+
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
9
9
|
var removeDescendantNodes = function removeDescendantNodes(sourceNode) {
|
|
10
10
|
return (0, _pluginFactory.createCommand)({
|
|
11
11
|
type: 'UPDATE_STATE',
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.arrowRightFromTable = exports.arrowLeftFromTable = exports.TableSelectionDirection = void 0;
|
|
7
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
8
|
-
var
|
|
8
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
9
9
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
10
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
11
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
|
-
var _selection = require("@atlaskit/editor-common/selection");
|
|
12
12
|
var TableSelectionDirection = /*#__PURE__*/function (TableSelectionDirection) {
|
|
13
13
|
TableSelectionDirection["TopToBottom"] = "TopToBottom";
|
|
14
14
|
TableSelectionDirection["BottomToTop"] = "BottomToTop";
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.sortByColumn = void 0;
|
|
7
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
8
|
+
var _steps = require("@atlaskit/adf-schema/steps");
|
|
9
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
8
10
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
9
|
-
var
|
|
10
|
-
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
11
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
11
12
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
12
|
-
var _steps = require("@atlaskit/adf-schema/steps");
|
|
13
13
|
var createGetInlineCardTextFromStore = function createGetInlineCardTextFromStore(attrs) {
|
|
14
14
|
var _ref = attrs,
|
|
15
15
|
data = _ref.data;
|
|
@@ -33,21 +33,21 @@ var sortByColumn = function sortByColumn(columnIndex) {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
}, function (tr, state) {
|
|
36
|
-
var table = (0,
|
|
36
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
37
37
|
if (!table || !table.node) {
|
|
38
38
|
return tr;
|
|
39
39
|
}
|
|
40
|
-
var selectionRect = (0,
|
|
40
|
+
var selectionRect = (0, _utils2.isSelectionType)(tr.selection, 'cell') ? (0, _utils2.getSelectionRect)(tr.selection) : (0, _utils2.findCellRectClosestToPos)(tr.selection.$from);
|
|
41
41
|
if (!selectionRect) {
|
|
42
42
|
return tr;
|
|
43
43
|
}
|
|
44
44
|
var tablePluginState = (0, _pluginFactory.getPluginState)(state);
|
|
45
|
-
var tableArray = (0,
|
|
45
|
+
var tableArray = (0, _utils2.convertTableNodeToArrayOfRows)(table.node);
|
|
46
46
|
var headerRow;
|
|
47
47
|
if (tablePluginState.isHeaderRowEnabled) {
|
|
48
48
|
headerRow = tableArray.shift();
|
|
49
49
|
}
|
|
50
|
-
var compareNodesInOrder = (0,
|
|
50
|
+
var compareNodesInOrder = (0, _utils.createCompareNodes)({
|
|
51
51
|
getInlineCardTextFromStore: createGetInlineCardTextFromStore
|
|
52
52
|
}, order);
|
|
53
53
|
var sortedTable = tableArray.sort(function (rowA, rowB) {
|
|
@@ -56,7 +56,7 @@ var sortByColumn = function sortByColumn(columnIndex) {
|
|
|
56
56
|
if (headerRow) {
|
|
57
57
|
sortedTable.unshift(headerRow);
|
|
58
58
|
}
|
|
59
|
-
var newTableNode = (0,
|
|
59
|
+
var newTableNode = (0, _utils2.convertArrayOfRowsToTableNode)(table.node, sortedTable);
|
|
60
60
|
tr.replaceWith(table.pos, table.pos + table.node.nodeSize, newTableNode);
|
|
61
61
|
var pos = _tableMap.TableMap.get(table.node).positionAt(selectionRect.top, columnIndex, table.node);
|
|
62
62
|
var prev = tablePluginState.ordering;
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.wrapTableInExpandWithAnalytics = exports.toggleTableLayoutWithAnalytics = exports.toggleNumberColumnWithAnalytics = exports.toggleHeaderRowWithAnalytics = exports.toggleHeaderColumnWithAnalytics = exports.splitCellWithAnalytics = exports.sortColumnWithAnalytics = exports.setColorWithAnalytics = exports.mergeCellsWithAnalytics = exports.insertRowWithAnalytics = exports.insertColumnWithAnalytics = exports.emptyMultipleCellsWithAnalytics = exports.distributeColumnsWidthsWithAnalytics = exports.deleteTableWithAnalytics = exports.deleteTableIfSelectedWithAnalytics = exports.deleteRowsWithAnalytics = exports.deleteColumnsWithAnalytics = exports.addRowAroundSelection = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
10
|
-
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
12
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
|
+
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
12
|
+
var _utils = require("@atlaskit/editor-tables/utils");
|
|
13
13
|
var _clear = require("./commands/clear");
|
|
14
14
|
var _collapse = require("./commands/collapse");
|
|
15
15
|
var _insert = require("./commands/insert");
|
|
@@ -17,8 +17,8 @@ var _misc = require("./commands/misc");
|
|
|
17
17
|
var _sort = require("./commands/sort");
|
|
18
18
|
var _splitCell = require("./commands/split-cell");
|
|
19
19
|
var _toggle = require("./commands/toggle");
|
|
20
|
-
var _commands = require("./pm-plugins/table-resizing/commands");
|
|
21
20
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
21
|
+
var _commands = require("./pm-plugins/table-resizing/commands");
|
|
22
22
|
var _transforms = require("./transforms");
|
|
23
23
|
var _utils2 = require("./utils");
|
|
24
24
|
var _analytics2 = require("./utils/analytics");
|
|
@@ -9,11 +9,11 @@ exports.handleTripleClick = handleTripleClick;
|
|
|
9
9
|
exports.whenTableInFocus = void 0;
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _prosemirrorState = require("prosemirror-state");
|
|
12
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
14
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
13
15
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
14
|
-
var
|
|
15
|
-
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
16
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
17
17
|
var _commands = require("./commands");
|
|
18
18
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
19
19
|
var _pluginFactory2 = require("./pm-plugins/table-resizing/plugin-factory");
|
|
@@ -35,7 +35,7 @@ var handleBlur = function handleBlur(view, event) {
|
|
|
35
35
|
dispatch = view.dispatch;
|
|
36
36
|
// IE version check for ED-4665
|
|
37
37
|
// Calendar focus check for ED-10466
|
|
38
|
-
if (
|
|
38
|
+
if (_utils.browser.ie_version !== 11 && !isFocusingCalendar(event) && !isFocusingModal(event) && !isFocusingFloatingToolbar(event)) {
|
|
39
39
|
(0, _commands.setEditorFocus)(false)(state, dispatch);
|
|
40
40
|
}
|
|
41
41
|
event.preventDefault();
|
|
@@ -55,7 +55,7 @@ var handleClick = function handleClick(view, event) {
|
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
57
57
|
var element = event.target;
|
|
58
|
-
var table = (0,
|
|
58
|
+
var table = (0, _utils2.findTable)(view.state.selection);
|
|
59
59
|
if (event instanceof MouseEvent && (0, _utils3.isColumnControlsDecorations)(element)) {
|
|
60
60
|
var _getColumnOrRowIndex = (0, _utils3.getColumnOrRowIndex)(element),
|
|
61
61
|
_getColumnOrRowIndex2 = (0, _slicedToArray2.default)(_getColumnOrRowIndex, 1),
|
|
@@ -67,15 +67,15 @@ var handleClick = function handleClick(view, event) {
|
|
|
67
67
|
var matchfn = element.matches ? element.matches : element.msMatchesSelector;
|
|
68
68
|
|
|
69
69
|
// check if the table cell with an image is clicked and its not the image itself
|
|
70
|
-
if (!table || !(0,
|
|
70
|
+
if (!table || !(0, _utils.isElementInTableCell)(element) || !matchfn || matchfn.call(element, 'table .image, table p, table .image div')) {
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
73
|
var map = _tableMap.TableMap.get(table.node);
|
|
74
74
|
|
|
75
75
|
/** Getting the offset of current item clicked */
|
|
76
|
-
var colElement = (0,
|
|
76
|
+
var colElement = (0, _utils.closestElement)(element, 'td') || (0, _utils.closestElement)(element, 'th');
|
|
77
77
|
var colIndex = colElement && colElement.cellIndex;
|
|
78
|
-
var rowElement = (0,
|
|
78
|
+
var rowElement = (0, _utils.closestElement)(element, 'tr');
|
|
79
79
|
var rowIndex = rowElement && rowElement.rowIndex;
|
|
80
80
|
var cellIndex = map.width * rowIndex + colIndex;
|
|
81
81
|
var dispatch = view.dispatch,
|
|
@@ -88,11 +88,11 @@ var handleClick = function handleClick(view, event) {
|
|
|
88
88
|
}
|
|
89
89
|
var editorElement = table.node.nodeAt(cellPos);
|
|
90
90
|
/** Only if the last item is media group, insert a paragraph */
|
|
91
|
-
if ((0,
|
|
91
|
+
if ((0, _utils.isLastItemMediaGroup)(editorElement)) {
|
|
92
92
|
var posInTable = map.map[cellIndex] + editorElement.nodeSize;
|
|
93
93
|
tr.insert(posInTable + table.pos, paragraph.create());
|
|
94
94
|
dispatch(tr);
|
|
95
|
-
(0,
|
|
95
|
+
(0, _utils.setNodeSelection)(view, posInTable + table.pos);
|
|
96
96
|
}
|
|
97
97
|
return true;
|
|
98
98
|
};
|
|
@@ -234,9 +234,9 @@ var handleMouseMove = function handleMouseMove(getEditorFeatureFlags) {
|
|
|
234
234
|
var _getPluginState5 = (0, _pluginFactory.getPluginState)(_state4),
|
|
235
235
|
resizeHandleColumnIndex = _getPluginState5.resizeHandleColumnIndex,
|
|
236
236
|
resizeHandleRowIndex = _getPluginState5.resizeHandleRowIndex;
|
|
237
|
-
var tableCell = (0,
|
|
237
|
+
var tableCell = (0, _utils.closestElement)(element, 'td, th');
|
|
238
238
|
var cellStartPosition = view.posAtDOM(tableCell, 0);
|
|
239
|
-
var rect = (0,
|
|
239
|
+
var rect = (0, _utils2.findCellRectClosestToPos)(_state4.doc.resolve(cellStartPosition));
|
|
240
240
|
if (rect) {
|
|
241
241
|
var columnEndIndexTarget = _positionColumn === 'left' ? rect.left : rect.right;
|
|
242
242
|
var rowIndexTarget = rect.top;
|
|
@@ -256,7 +256,7 @@ exports.handleMouseMove = handleMouseMove;
|
|
|
256
256
|
function handleTripleClick(view, pos) {
|
|
257
257
|
var state = view.state,
|
|
258
258
|
dispatch = view.dispatch;
|
|
259
|
-
var $cellPos = (0,
|
|
259
|
+
var $cellPos = (0, _utils2.cellAround)(state.doc.resolve(pos));
|
|
260
260
|
if (!$cellPos) {
|
|
261
261
|
return false;
|
|
262
262
|
}
|
|
@@ -280,7 +280,7 @@ var handleCut = function handleCut(oldTr, oldState, newState, editorAnalyticsAPI
|
|
|
280
280
|
var cellSelection = new _cellSelection.CellSelection($anchorCell, $headCell);
|
|
281
281
|
tr.setSelection(cellSelection);
|
|
282
282
|
if (tr.selection instanceof _cellSelection.CellSelection) {
|
|
283
|
-
var rect = (0,
|
|
283
|
+
var rect = (0, _utils2.getSelectionRect)(cellSelection);
|
|
284
284
|
if (rect) {
|
|
285
285
|
var _getSelectedCellInfo = (0, _utils3.getSelectedCellInfo)(tr.selection),
|
|
286
286
|
verticalCells = _getSelectedCellInfo.verticalCells,
|
|
@@ -308,7 +308,7 @@ var handleCut = function handleCut(oldTr, oldState, newState, editorAnalyticsAPI
|
|
|
308
308
|
if (tr.selection instanceof _cellSelection.CellSelection) {
|
|
309
309
|
var isTableSelected = tr.selection.isRowSelection() && tr.selection.isColSelection();
|
|
310
310
|
if (isTableSelected) {
|
|
311
|
-
tr = (0,
|
|
311
|
+
tr = (0, _utils2.removeTable)(tr);
|
|
312
312
|
} else if (tr.selection.isRowSelection()) {
|
|
313
313
|
var _getPluginState6 = (0, _pluginFactory.getPluginState)(newState),
|
|
314
314
|
isHeaderRowRequired = _getPluginState6.pluginConfig.isHeaderRowRequired;
|
|
@@ -7,17 +7,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.handleDocOrSelectionChanged = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
10
|
+
var _steps = require("@atlaskit/adf-schema/steps");
|
|
11
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
13
13
|
var _defaultTableSelection = require("./pm-plugins/default-table-selection");
|
|
14
14
|
var _tableResizing = require("./pm-plugins/table-resizing");
|
|
15
|
-
var
|
|
15
|
+
var _collapse = require("./utils/collapse");
|
|
16
16
|
var _nodes = require("./utils/nodes");
|
|
17
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } // #region Imports
|
|
19
19
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
20
|
-
// #endregion
|
|
21
20
|
var nextTableSorting = function nextTableSorting(tr, table) {
|
|
22
21
|
var tableSortStep = tr.steps.find(function (step) {
|
|
23
22
|
return step instanceof _steps.TableSortStep;
|
|
@@ -58,7 +57,7 @@ var updateTableNodePluginState = function updateTableNodePluginState(_ref2) {
|
|
|
58
57
|
table = _ref2.table;
|
|
59
58
|
return function (pluginState) {
|
|
60
59
|
var tableNode = table && table.node;
|
|
61
|
-
if (!tableNode || (0,
|
|
60
|
+
if (!tableNode || (0, _utils.isTextInput)(tr)) {
|
|
62
61
|
return pluginState;
|
|
63
62
|
}
|
|
64
63
|
return _objectSpread(_objectSpread(_objectSpread({}, pluginState), _defaultTableSelection.defaultTableSelection), {}, {
|
|
@@ -122,7 +121,7 @@ var buildPluginState = function buildPluginState(builders) {
|
|
|
122
121
|
var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, pluginState) {
|
|
123
122
|
return buildPluginState([updateTargetCellPosition, updateTableNodePluginState, updateCollapseHandler])({
|
|
124
123
|
tr: tr,
|
|
125
|
-
table: (0,
|
|
124
|
+
table: (0, _utils2.findTable)(tr.selection)
|
|
126
125
|
})(pluginState);
|
|
127
126
|
};
|
|
128
127
|
exports.handleDocOrSelectionChanged = handleDocOrSelectionChanged;
|
|
@@ -6,27 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
|
+
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
12
|
+
var _icons = require("@atlaskit/editor-common/icons");
|
|
13
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
14
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
9
15
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
16
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
|
+
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
11
18
|
var _pmPlugins = require("@atlaskit/editor-tables/pm-plugins");
|
|
12
19
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
13
|
-
var _adfSchema = require("@atlaskit/adf-schema");
|
|
14
|
-
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
15
|
-
var _withPluginState = require("@atlaskit/editor-common/with-plugin-state");
|
|
16
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
|
-
var _icons = require("@atlaskit/editor-common/icons");
|
|
19
20
|
var _createPluginConfig = require("./create-plugin-config");
|
|
20
|
-
var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
21
|
-
var _tableWidth = require("./pm-plugins/table-width");
|
|
22
|
-
var _safariDeleteCompositionTextIssueWorkaround = require("./pm-plugins/safari-delete-composition-text-issue-workaround");
|
|
23
21
|
var _plugin = require("./pm-plugins/decorations/plugin");
|
|
24
22
|
var _keymap = require("./pm-plugins/keymap");
|
|
25
|
-
var _tableSelectionKeymap = require("./pm-plugins/table-selection-keymap");
|
|
26
23
|
var _main = require("./pm-plugins/main");
|
|
27
24
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
25
|
+
var _safariDeleteCompositionTextIssueWorkaround = require("./pm-plugins/safari-delete-composition-text-issue-workaround");
|
|
28
26
|
var _stickyHeaders = require("./pm-plugins/sticky-headers");
|
|
27
|
+
var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
29
28
|
var _tableResizing = require("./pm-plugins/table-resizing");
|
|
29
|
+
var _tableSelectionKeymap = require("./pm-plugins/table-selection-keymap");
|
|
30
|
+
var _tableWidth = require("./pm-plugins/table-width");
|
|
30
31
|
var _toolbar = require("./toolbar");
|
|
31
32
|
var _FloatingContextualButton = _interopRequireDefault(require("./ui/FloatingContextualButton"));
|
|
32
33
|
var _FloatingContextualMenu = _interopRequireDefault(require("./ui/FloatingContextualMenu"));
|
|
@@ -34,8 +35,6 @@ var _FloatingDeleteButton = _interopRequireDefault(require("./ui/FloatingDeleteB
|
|
|
34
35
|
var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertButton"));
|
|
35
36
|
var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
|
|
36
37
|
var _utils3 = require("./utils");
|
|
37
|
-
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
38
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
39
38
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
40
39
|
return {};
|
|
41
40
|
};
|
|
@@ -74,7 +73,7 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
74
73
|
}
|
|
75
74
|
},
|
|
76
75
|
nodes: function nodes() {
|
|
77
|
-
var tableNode =
|
|
76
|
+
var tableNode = options !== null && options !== void 0 && options.tableResizingEnabled ? _adfSchema.tableWithCustomWidth : _adfSchema.table;
|
|
78
77
|
return [{
|
|
79
78
|
name: 'table',
|
|
80
79
|
node: tableNode
|
|
@@ -100,10 +99,11 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
100
99
|
var _ref2 = options || {},
|
|
101
100
|
fullWidthEnabled = _ref2.fullWidthEnabled,
|
|
102
101
|
wasFullWidthEnabled = _ref2.wasFullWidthEnabled,
|
|
102
|
+
tableResizingEnabled = _ref2.tableResizingEnabled,
|
|
103
103
|
breakoutEnabled = _ref2.breakoutEnabled,
|
|
104
104
|
tableOptions = _ref2.tableOptions,
|
|
105
105
|
getEditorFeatureFlags = _ref2.getEditorFeatureFlags;
|
|
106
|
-
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api);
|
|
106
|
+
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, breakoutEnabled, fullWidthEnabled, tableResizingEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api);
|
|
107
107
|
}
|
|
108
108
|
}, {
|
|
109
109
|
name: 'tablePMColResizing',
|
|
@@ -176,7 +176,7 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
176
176
|
plugin: function plugin(_ref8) {
|
|
177
177
|
var _options$fullWidthEna;
|
|
178
178
|
var dispatch = _ref8.dispatch;
|
|
179
|
-
return
|
|
179
|
+
return options !== null && options !== void 0 && options.tableResizingEnabled ? (0, _tableWidth.createPlugin)(dispatch, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false) : undefined;
|
|
180
180
|
}
|
|
181
181
|
}, {
|
|
182
182
|
name: 'tableGetEditorViewReferencePlugin',
|
|
@@ -247,7 +247,7 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
247
247
|
tableWrapperTarget = _ref11.tableWrapperTarget;
|
|
248
248
|
var allowControls = pluginConfig.allowControls;
|
|
249
249
|
var stickyHeader = stickyHeadersState ? (0, _stickyHeaders.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
250
|
-
var LayoutContent =
|
|
250
|
+
var LayoutContent = options && !options.tableResizingEnabled && (0, _utils3.isLayoutSupported)(state) && options.breakoutEnabled ? /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
|
|
251
251
|
editorView: editorView,
|
|
252
252
|
mountPoint: popupsMountPoint,
|
|
253
253
|
boundariesElement: popupsBoundariesElement,
|