@atlaskit/editor-plugin-table 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -0
- package/CHANGELOG.md +12 -0
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/cjs/plugins/table/commands/insert.js +3 -3
- package/dist/cjs/plugins/table/commands/misc.js +26 -26
- package/dist/cjs/plugins/table/commands/referentiality.js +1 -1
- package/dist/cjs/plugins/table/commands/selection.js +2 -2
- package/dist/cjs/plugins/table/commands/sort.js +8 -8
- package/dist/cjs/plugins/table/commands-with-analytics.js +3 -3
- package/dist/cjs/plugins/table/event-handlers.js +15 -15
- package/dist/cjs/plugins/table/handlers.js +6 -7
- package/dist/cjs/plugins/table/index.js +16 -16
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +44 -40
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +10 -8
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +11 -9
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +24 -21
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +26 -26
- package/dist/cjs/plugins/table/transforms/column-width.js +5 -5
- package/dist/cjs/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/cjs/plugins/table/transforms/merge.js +1 -1
- package/dist/cjs/plugins/table/transforms/replace-table.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +11 -11
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +10 -10
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +9 -9
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
- package/dist/cjs/plugins/table/ui/consts.js +2 -2
- package/dist/cjs/plugins/table/ui/ui-styles.js +2 -2
- package/dist/cjs/plugins/table/utils/column-controls.js +11 -11
- package/dist/cjs/plugins/table/utils/decoration.js +11 -11
- package/dist/cjs/plugins/table/utils/nodes.js +1 -1
- package/dist/cjs/plugins/table/utils/row-controls.js +9 -9
- package/dist/cjs/plugins/table/utils/selection.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/clear.js +3 -1
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/es2019/plugins/table/commands/insert.js +4 -3
- package/dist/es2019/plugins/table/commands/misc.js +4 -4
- package/dist/es2019/plugins/table/commands/referentiality.js +1 -1
- package/dist/es2019/plugins/table/commands/selection.js +3 -3
- package/dist/es2019/plugins/table/commands/sort.js +3 -4
- package/dist/es2019/plugins/table/commands/toggle.js +1 -2
- package/dist/es2019/plugins/table/commands-with-analytics.js +4 -4
- package/dist/es2019/plugins/table/event-handlers.js +3 -5
- package/dist/es2019/plugins/table/handlers.js +5 -5
- package/dist/es2019/plugins/table/index.js +16 -16
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +21 -18
- package/dist/es2019/plugins/table/nodeviews/TableContainer.js +10 -9
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +4 -4
- package/dist/es2019/plugins/table/nodeviews/table.js +11 -9
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/main.js +13 -13
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/es2019/plugins/table/toolbar.js +16 -18
- package/dist/es2019/plugins/table/transforms/column-width.js +6 -7
- package/dist/es2019/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/es2019/plugins/table/transforms/merge.js +2 -1
- package/dist/es2019/plugins/table/transforms/replace-table.js +2 -2
- package/dist/es2019/plugins/table/transforms/split.js +1 -0
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +7 -4
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +5 -5
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/ui-styles.js +3 -3
- package/dist/es2019/plugins/table/utils/column-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/decoration.js +2 -2
- package/dist/es2019/plugins/table/utils/guidelines.js +1 -1
- package/dist/es2019/plugins/table/utils/nodes.js +1 -1
- package/dist/es2019/plugins/table/utils/row-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/selection.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/clear.js +3 -1
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/esm/plugins/table/commands/insert.js +4 -3
- package/dist/esm/plugins/table/commands/misc.js +4 -4
- package/dist/esm/plugins/table/commands/referentiality.js +1 -1
- package/dist/esm/plugins/table/commands/selection.js +3 -3
- package/dist/esm/plugins/table/commands/sort.js +3 -4
- package/dist/esm/plugins/table/commands/toggle.js +1 -2
- package/dist/esm/plugins/table/commands-with-analytics.js +4 -4
- package/dist/esm/plugins/table/event-handlers.js +3 -5
- package/dist/esm/plugins/table/handlers.js +5 -5
- package/dist/esm/plugins/table/index.js +16 -16
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +39 -36
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +10 -9
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +4 -4
- package/dist/esm/plugins/table/nodeviews/table.js +11 -9
- package/dist/esm/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/main.js +13 -13
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/esm/plugins/table/toolbar.js +16 -18
- package/dist/esm/plugins/table/transforms/column-width.js +6 -7
- package/dist/esm/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/esm/plugins/table/transforms/merge.js +2 -1
- package/dist/esm/plugins/table/transforms/replace-table.js +2 -2
- package/dist/esm/plugins/table/transforms/split.js +1 -0
- package/dist/esm/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +5 -5
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/ui-styles.js +3 -3
- package/dist/esm/plugins/table/utils/column-controls.js +3 -3
- package/dist/esm/plugins/table/utils/decoration.js +2 -2
- package/dist/esm/plugins/table/utils/guidelines.js +1 -1
- package/dist/esm/plugins/table/utils/nodes.js +1 -1
- package/dist/esm/plugins/table/utils/row-controls.js +3 -3
- package/dist/esm/plugins/table/utils/selection.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/handlers.d.ts +1 -1
- package/dist/types/plugins/table/index.d.ts +4 -4
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types/plugins/table/toolbar.d.ts +4 -5
- package/dist/types/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/index.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +1 -1
- package/examples/99-testing.tsx +11 -10
- package/package.json +11 -3
- package/report.api.md +2 -0
- package/src/__tests__/integration/arrow-down-into-table.ts +3 -2
- package/src/__tests__/integration/auto-size.ts +8 -10
- package/src/__tests__/integration/cell-selection.ts +8 -7
- package/src/__tests__/integration/change-date-inside-table.ts +4 -5
- package/src/__tests__/integration/delete-columns.ts +6 -4
- package/src/__tests__/integration/delete-last-column-in-full-width.ts +4 -4
- package/src/__tests__/integration/delete-last-column-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-last-row-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-rows.ts +8 -6
- package/src/__tests__/integration/delete-table-when-selected.ts +10 -11
- package/src/__tests__/integration/deleting-empty-paragraph-under-table.ts +5 -4
- package/src/__tests__/integration/even-columns.ts +8 -8
- package/src/__tests__/integration/floating-toolbar.ts +3 -1
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +7 -8
- package/src/__tests__/integration/horizontal-scroll.ts +8 -7
- package/src/__tests__/integration/insert-cell-header-with-strong-mark.ts +3 -4
- package/src/__tests__/integration/insert-row-inside-layout.ts +8 -6
- package/src/__tests__/integration/layout.ts +8 -11
- package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +3 -2
- package/src/__tests__/integration/resize-handler.ts +2 -2
- package/src/__tests__/integration/resize.ts +15 -15
- package/src/__tests__/integration/scale.ts +8 -8
- package/src/__tests__/integration/sticky-header.ts +3 -2
- package/src/__tests__/unit/analytics.ts +21 -21
- package/src/__tests__/unit/collab.ts +16 -16
- package/src/__tests__/unit/commands/go-to-next-cell.ts +14 -13
- package/src/__tests__/unit/commands/insert.ts +12 -12
- package/src/__tests__/unit/commands/misc.ts +18 -16
- package/src/__tests__/unit/commands/sort.ts +9 -8
- package/src/__tests__/unit/commands.ts +13 -14
- package/src/__tests__/unit/copy-paste.ts +31 -25
- package/src/__tests__/unit/event-handlers/index.ts +15 -13
- package/src/__tests__/unit/event-handlers.ts +18 -18
- package/src/__tests__/unit/fix-tables.ts +9 -9
- package/src/__tests__/unit/get-toolbar-config.ts +21 -21
- package/src/__tests__/unit/handlers.ts +13 -12
- package/src/__tests__/unit/hover-selection.ts +14 -13
- package/src/__tests__/unit/index-with-fake-timers.ts +6 -5
- package/src/__tests__/unit/index.ts +30 -31
- package/src/__tests__/unit/layout.ts +16 -16
- package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +4 -2
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +21 -20
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +38 -105
- package/src/__tests__/unit/nodeviews/cell.ts +17 -16
- package/src/__tests__/unit/nodeviews/table.ts +15 -13
- package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +1 -1
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +7 -8
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +45 -57
- package/src/__tests__/unit/pm-plugins/main.ts +15 -14
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +7 -6
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +23 -21
- package/src/__tests__/unit/pm-plugins/table-local-id.ts +14 -15
- package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +3 -2
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +22 -21
- package/src/__tests__/unit/sort-column.ts +16 -14
- package/src/__tests__/unit/toolbar.ts +22 -21
- package/src/__tests__/unit/transforms/delete-columns.ts +16 -14
- package/src/__tests__/unit/transforms/delete-rows.ts +16 -14
- package/src/__tests__/unit/transforms/merging.ts +15 -13
- package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/CornerControls.tsx +11 -9
- package/src/__tests__/unit/ui/DeleteButton.tsx +3 -1
- package/src/__tests__/unit/ui/FixedButton.tsx +4 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +14 -11
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +12 -9
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +21 -19
- package/src/__tests__/unit/ui/RowControls.tsx +15 -12
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +16 -15
- package/src/__tests__/unit/undo-redo.ts +17 -15
- package/src/__tests__/unit/utils/collapse.ts +7 -8
- package/src/__tests__/unit/utils/nodes.ts +12 -11
- package/src/__tests__/unit/utils/row-controls.ts +12 -12
- package/src/__tests__/unit/utils/table.ts +5 -4
- package/src/__tests__/unit/utils.ts +18 -16
- package/src/__tests__/visual-regression/cell-options-menu.ts +2 -2
- package/src/__tests__/visual-regression/index.ts +8 -7
- package/src/__tests__/visual-regression/sticky-header.ts +6 -5
- package/src/plugins/table/commands/clear.ts +3 -2
- package/src/plugins/table/commands/collapse.ts +1 -0
- package/src/plugins/table/commands/go-to-next-cell.ts +8 -7
- package/src/plugins/table/commands/insert.ts +8 -7
- package/src/plugins/table/commands/misc.ts +15 -18
- package/src/plugins/table/commands/referentiality.ts +3 -1
- package/src/plugins/table/commands/selection.ts +11 -10
- package/src/plugins/table/commands/sort.ts +9 -9
- package/src/plugins/table/commands/split-cell.ts +1 -1
- package/src/plugins/table/commands/toggle.ts +2 -3
- package/src/plugins/table/commands-with-analytics.ts +15 -15
- package/src/plugins/table/event-handlers.ts +19 -20
- package/src/plugins/table/handlers.ts +6 -7
- package/src/plugins/table/index.tsx +51 -51
- package/src/plugins/table/nodeviews/OverflowShadowsObserver.ts +2 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +23 -30
- package/src/plugins/table/nodeviews/TableContainer.tsx +16 -23
- package/src/plugins/table/nodeviews/TableResizer.tsx +8 -7
- package/src/plugins/table/nodeviews/table.tsx +25 -18
- package/src/plugins/table/nodeviews/tableCell.tsx +9 -7
- package/src/plugins/table/nodeviews/types.ts +4 -2
- package/src/plugins/table/nodeviews/update-overflow-shadows.ts +3 -1
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +4 -3
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +2 -1
- package/src/plugins/table/pm-plugins/keymap.ts +8 -8
- package/src/plugins/table/pm-plugins/main.ts +38 -33
- package/src/plugins/table/pm-plugins/plugin-factory.ts +2 -0
- package/src/plugins/table/pm-plugins/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -1
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +6 -7
- package/src/plugins/table/pm-plugins/sticky-headers/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +3 -4
- package/src/plugins/table/pm-plugins/table-local-id.ts +3 -4
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +3 -2
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +13 -14
- package/src/plugins/table/pm-plugins/table-resizing/plugin-factory.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin.ts +7 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +2 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/column-state.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +3 -3
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +8 -9
- package/src/plugins/table/pm-plugins/table-resizing/utils/resize-state.ts +8 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +4 -5
- package/src/plugins/table/pm-plugins/table-resizing/utils/types.ts +2 -1
- package/src/plugins/table/pm-plugins/table-selection-keymap.ts +4 -3
- package/src/plugins/table/pm-plugins/table-width.ts +5 -4
- package/src/plugins/table/toolbar.tsx +54 -57
- package/src/plugins/table/transforms/column-width.ts +13 -13
- package/src/plugins/table/transforms/delete-columns.ts +2 -2
- package/src/plugins/table/transforms/delete-rows.ts +2 -2
- package/src/plugins/table/transforms/merge.ts +3 -3
- package/src/plugins/table/transforms/replace-table.ts +6 -5
- package/src/plugins/table/transforms/split.ts +1 -1
- package/src/plugins/table/types.ts +3 -3
- package/src/plugins/table/ui/FloatingContextualButton/FixedButton.tsx +4 -2
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +12 -11
- package/src/plugins/table/ui/FloatingContextualButton/styles.ts +5 -3
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +27 -28
- package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +10 -11
- package/src/plugins/table/ui/FloatingContextualMenu/styles.ts +8 -4
- package/src/plugins/table/ui/FloatingDeleteButton/DeleteButton.tsx +5 -2
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +9 -9
- package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +4 -5
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +16 -18
- package/src/plugins/table/ui/LayoutButton/index.tsx +6 -6
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +3 -2
- package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +2 -1
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +2 -3
- package/src/plugins/table/ui/common-styles.ts +33 -34
- package/src/plugins/table/ui/consts.ts +12 -13
- package/src/plugins/table/ui/ui-styles.ts +24 -22
- package/src/plugins/table/utils/analytics.ts +3 -2
- package/src/plugins/table/utils/collapse.ts +2 -2
- package/src/plugins/table/utils/column-controls.ts +5 -6
- package/src/plugins/table/utils/decoration.ts +6 -7
- package/src/plugins/table/utils/dom.ts +1 -0
- package/src/plugins/table/utils/guidelines.ts +2 -2
- package/src/plugins/table/utils/nodes.ts +2 -1
- package/src/plugins/table/utils/row-controls.ts +4 -3
- package/src/plugins/table/utils/selection.ts +2 -1
- package/src/plugins/table/utils/table.ts +2 -1
- package/tmp/api-report-tmp.d.ts +2 -0
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { table, tableCell, tableHeader, tableRow, tableWithCustomWidth } from '@atlaskit/adf-schema';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
5
|
+
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
6
|
+
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
7
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
2
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
9
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
|
+
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
4
11
|
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
5
12
|
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { table, tableCell, tableHeader, tableRow, tableWithCustomWidth } from '@atlaskit/adf-schema';
|
|
7
|
-
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
|
-
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
9
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
12
13
|
import { pluginConfig } from './create-plugin-config';
|
|
13
|
-
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
14
|
-
import { pluginKey as tableWidthPluginKey, createPlugin as createTableWidthPlugin } from './pm-plugins/table-width';
|
|
15
|
-
import { createPlugin as createTableSafariDeleteCompositionTextIssueWorkaroundPlugin } from './pm-plugins/safari-delete-composition-text-issue-workaround';
|
|
16
14
|
import { createPlugin as createDecorationsPlugin } from './pm-plugins/decorations/plugin';
|
|
17
15
|
import { keymapPlugin } from './pm-plugins/keymap';
|
|
18
|
-
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
19
16
|
import { createPlugin } from './pm-plugins/main';
|
|
20
17
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
18
|
+
import { createPlugin as createTableSafariDeleteCompositionTextIssueWorkaroundPlugin } from './pm-plugins/safari-delete-composition-text-issue-workaround';
|
|
21
19
|
import { createPlugin as createStickyHeadersPlugin, findStickyHeaderForTable, pluginKey as stickyHeadersPluginKey } from './pm-plugins/sticky-headers';
|
|
20
|
+
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
22
21
|
import { createPlugin as createFlexiResizingPlugin, pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
22
|
+
import { tableSelectionKeymapPlugin } from './pm-plugins/table-selection-keymap';
|
|
23
|
+
import { createPlugin as createTableWidthPlugin, pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
23
24
|
import { getToolbarConfig } from './toolbar';
|
|
24
25
|
import FloatingContextualButton from './ui/FloatingContextualButton';
|
|
25
26
|
import FloatingContextualMenu from './ui/FloatingContextualMenu';
|
|
@@ -27,8 +28,6 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
|
|
|
27
28
|
import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
28
29
|
import LayoutButton from './ui/LayoutButton';
|
|
29
30
|
import { isLayoutSupported } from './utils';
|
|
30
|
-
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
31
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
32
31
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
33
32
|
return {};
|
|
34
33
|
};
|
|
@@ -67,7 +66,7 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
67
66
|
}
|
|
68
67
|
},
|
|
69
68
|
nodes: function nodes() {
|
|
70
|
-
var tableNode =
|
|
69
|
+
var tableNode = options !== null && options !== void 0 && options.tableResizingEnabled ? tableWithCustomWidth : table;
|
|
71
70
|
return [{
|
|
72
71
|
name: 'table',
|
|
73
72
|
node: tableNode
|
|
@@ -93,10 +92,11 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
93
92
|
var _ref2 = options || {},
|
|
94
93
|
fullWidthEnabled = _ref2.fullWidthEnabled,
|
|
95
94
|
wasFullWidthEnabled = _ref2.wasFullWidthEnabled,
|
|
95
|
+
tableResizingEnabled = _ref2.tableResizingEnabled,
|
|
96
96
|
breakoutEnabled = _ref2.breakoutEnabled,
|
|
97
97
|
tableOptions = _ref2.tableOptions,
|
|
98
98
|
getEditorFeatureFlags = _ref2.getEditorFeatureFlags;
|
|
99
|
-
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api);
|
|
99
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, breakoutEnabled, fullWidthEnabled, tableResizingEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api);
|
|
100
100
|
}
|
|
101
101
|
}, {
|
|
102
102
|
name: 'tablePMColResizing',
|
|
@@ -169,7 +169,7 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
169
169
|
plugin: function plugin(_ref8) {
|
|
170
170
|
var _options$fullWidthEna;
|
|
171
171
|
var dispatch = _ref8.dispatch;
|
|
172
|
-
return
|
|
172
|
+
return options !== null && options !== void 0 && options.tableResizingEnabled ? createTableWidthPlugin(dispatch, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false) : undefined;
|
|
173
173
|
}
|
|
174
174
|
}, {
|
|
175
175
|
name: 'tableGetEditorViewReferencePlugin',
|
|
@@ -240,7 +240,7 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
240
240
|
tableWrapperTarget = _ref11.tableWrapperTarget;
|
|
241
241
|
var allowControls = pluginConfig.allowControls;
|
|
242
242
|
var stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
|
|
243
|
-
var LayoutContent =
|
|
243
|
+
var LayoutContent = options && !options.tableResizingEnabled && isLayoutSupported(state) && options.breakoutEnabled ? /*#__PURE__*/React.createElement(LayoutButton, {
|
|
244
244
|
editorView: editorView,
|
|
245
245
|
mountPoint: popupsMountPoint,
|
|
246
246
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import {
|
|
4
|
+
import { TableCssClassName as ClassName, ShadowEvent } from '../types';
|
|
5
5
|
import { tableInsertColumnButtonSize } from '../ui/consts';
|
|
6
6
|
import { updateShadowListForStickyStyles } from './update-overflow-shadows';
|
|
7
7
|
export var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
@@ -11,13 +11,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classnames from 'classnames';
|
|
14
|
-
import
|
|
14
|
+
import memoizeOne from 'memoize-one';
|
|
15
15
|
import rafSchedule from 'raf-schd';
|
|
16
|
-
import {
|
|
16
|
+
import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
|
|
17
17
|
import { tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
18
18
|
import { browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { akEditorTableToolbarSize as tableToolbarSize } from '@atlaskit/editor-shared-styles';
|
|
20
|
+
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
21
21
|
import { autoSizeTable, clearHoverSelection } from '../commands';
|
|
22
22
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
23
23
|
import { findStickyHeaderForTable, pluginKey as stickyHeadersPluginKey } from '../pm-plugins/sticky-headers';
|
|
@@ -25,12 +25,10 @@ import { getLayoutSize, insertColgroupFromNode as recreateResizeColsByNode, scal
|
|
|
25
25
|
import { updateControls } from '../pm-plugins/table-resizing/utils/dom';
|
|
26
26
|
import { TableCssClassName as ClassName, ShadowEvent } from '../types';
|
|
27
27
|
import TableFloatingControls from '../ui/TableFloatingControls';
|
|
28
|
-
import { containsHeaderRow, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns
|
|
29
|
-
import { updateOverflowShadows } from './update-overflow-shadows';
|
|
30
|
-
import memoizeOne from 'memoize-one';
|
|
28
|
+
import { containsHeaderRow, isTableNested, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns } from '../utils';
|
|
31
29
|
import { OverflowShadowsObserver } from './OverflowShadowsObserver';
|
|
32
30
|
import { TableContainer } from './TableContainer';
|
|
33
|
-
import {
|
|
31
|
+
import { updateOverflowShadows } from './update-overflow-shadows';
|
|
34
32
|
var isIE11 = browser.ie_version === 11;
|
|
35
33
|
var NOOP = function NOOP() {
|
|
36
34
|
return undefined;
|
|
@@ -129,7 +127,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
129
127
|
// This last check is also to cater for dynamic text sizing changing the 'default' layout width
|
|
130
128
|
// Usually happens on window resize.
|
|
131
129
|
layoutSize !== _this.layoutSize || noOfColumnsChanged) {
|
|
132
|
-
var shouldScaleTable = (!
|
|
130
|
+
var shouldScaleTable = (!(options !== null && options !== void 0 && options.isTableResizingEnabled) || (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && isNested) && !hasNumberedColumnChanged && !noOfColumnsChanged;
|
|
133
131
|
|
|
134
132
|
// If column has been inserted/deleted avoid multi dispatch
|
|
135
133
|
if (shouldScaleTable) {
|
|
@@ -271,7 +269,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
271
269
|
value: function componentDidMount() {
|
|
272
270
|
var _this$props6 = this.props,
|
|
273
271
|
allowColumnResizing = _this$props6.allowColumnResizing,
|
|
274
|
-
eventDispatcher = _this$props6.eventDispatcher
|
|
272
|
+
eventDispatcher = _this$props6.eventDispatcher,
|
|
273
|
+
options = _this$props6.options;
|
|
275
274
|
if (allowColumnResizing && this.wrapper && !isIE11) {
|
|
276
275
|
this.wrapper.addEventListener('scroll', this.handleScrollDebounced);
|
|
277
276
|
}
|
|
@@ -280,7 +279,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
280
279
|
* We no longer use `containerWidth` as a variable to determine an update for table resizing (avoids unnecessary updates).
|
|
281
280
|
* Instead we use the resize event to only trigger updates when necessary.
|
|
282
281
|
*/
|
|
283
|
-
if (!
|
|
282
|
+
if (!(options !== null && options !== void 0 && options.isTableResizingEnabled)) {
|
|
284
283
|
window.addEventListener('resize', this.handleWindowResizeDebounced);
|
|
285
284
|
}
|
|
286
285
|
this.handleTableResizingDebounced();
|
|
@@ -294,6 +293,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
294
293
|
}, {
|
|
295
294
|
key: "componentWillUnmount",
|
|
296
295
|
value: function componentWillUnmount() {
|
|
296
|
+
var _this$props7 = this.props,
|
|
297
|
+
allowColumnResizing = _this$props7.allowColumnResizing,
|
|
298
|
+
eventDispatcher = _this$props7.eventDispatcher,
|
|
299
|
+
options = _this$props7.options;
|
|
297
300
|
if (this.wrapper && !isIE11) {
|
|
298
301
|
this.wrapper.removeEventListener('scroll', this.handleScrollDebounced);
|
|
299
302
|
}
|
|
@@ -301,25 +304,25 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
301
304
|
this.scaleTableDebounced.cancel();
|
|
302
305
|
this.handleTableResizingDebounced.cancel();
|
|
303
306
|
this.handleAutoSizeDebounced.cancel();
|
|
304
|
-
if (!
|
|
307
|
+
if (!(options !== null && options !== void 0 && options.isTableResizingEnabled)) {
|
|
305
308
|
this.handleWindowResizeDebounced.cancel();
|
|
306
309
|
}
|
|
307
|
-
if (!
|
|
310
|
+
if (!(options !== null && options !== void 0 && options.isTableResizingEnabled) && allowColumnResizing) {
|
|
308
311
|
window.removeEventListener('resize', this.handleWindowResizeDebounced);
|
|
309
312
|
}
|
|
310
313
|
if (this.overflowShadowsObserver) {
|
|
311
314
|
this.overflowShadowsObserver.dispose();
|
|
312
315
|
}
|
|
313
|
-
|
|
316
|
+
eventDispatcher.off(stickyHeadersPluginKey.key, this.onStickyState);
|
|
314
317
|
}
|
|
315
318
|
}, {
|
|
316
319
|
key: "componentDidUpdate",
|
|
317
320
|
value: function componentDidUpdate() {
|
|
318
|
-
var _this$
|
|
319
|
-
view = _this$
|
|
320
|
-
getNode = _this$
|
|
321
|
-
isMediaFullscreen = _this$
|
|
322
|
-
allowColumnResizing = _this$
|
|
321
|
+
var _this$props8 = this.props,
|
|
322
|
+
view = _this$props8.view,
|
|
323
|
+
getNode = _this$props8.getNode,
|
|
324
|
+
isMediaFullscreen = _this$props8.isMediaFullscreen,
|
|
325
|
+
allowColumnResizing = _this$props8.allowColumnResizing;
|
|
323
326
|
var _getPluginState = getPluginState(view.state),
|
|
324
327
|
isInDanger = _getPluginState.isInDanger;
|
|
325
328
|
var table = findTable(view.state.selection);
|
|
@@ -375,20 +378,20 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
375
378
|
value: function render() {
|
|
376
379
|
var _classnames,
|
|
377
380
|
_this2 = this;
|
|
378
|
-
var _this$
|
|
379
|
-
view = _this$
|
|
380
|
-
getNode = _this$
|
|
381
|
-
isResizing = _this$
|
|
382
|
-
_this$
|
|
383
|
-
allowControls = _this$
|
|
384
|
-
isHeaderRowEnabled = _this$
|
|
385
|
-
ordering = _this$
|
|
386
|
-
isHeaderColumnEnabled = _this$
|
|
387
|
-
tableActive = _this$
|
|
388
|
-
containerWidth = _this$
|
|
389
|
-
options = _this$
|
|
390
|
-
getPos = _this$
|
|
391
|
-
pluginInjectionApi = _this$
|
|
381
|
+
var _this$props9 = this.props,
|
|
382
|
+
view = _this$props9.view,
|
|
383
|
+
getNode = _this$props9.getNode,
|
|
384
|
+
isResizing = _this$props9.isResizing,
|
|
385
|
+
_this$props9$allowCon = _this$props9.allowControls,
|
|
386
|
+
allowControls = _this$props9$allowCon === void 0 ? true : _this$props9$allowCon,
|
|
387
|
+
isHeaderRowEnabled = _this$props9.isHeaderRowEnabled,
|
|
388
|
+
ordering = _this$props9.ordering,
|
|
389
|
+
isHeaderColumnEnabled = _this$props9.isHeaderColumnEnabled,
|
|
390
|
+
tableActive = _this$props9.tableActive,
|
|
391
|
+
containerWidth = _this$props9.containerWidth,
|
|
392
|
+
options = _this$props9.options,
|
|
393
|
+
getPos = _this$props9.getPos,
|
|
394
|
+
pluginInjectionApi = _this$props9.pluginInjectionApi;
|
|
392
395
|
var _this$state = this.state,
|
|
393
396
|
isLoading = _this$state.isLoading,
|
|
394
397
|
showBeforeShadow = _this$state.showBeforeShadow,
|
|
@@ -439,16 +442,16 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
439
442
|
}) : NOOP;
|
|
440
443
|
var isNested = isTableNested(view.state, getPos());
|
|
441
444
|
return /*#__PURE__*/React.createElement(TableContainer, {
|
|
442
|
-
className: classnames(ClassName.TABLE_CONTAINER, (_classnames = {}, _defineProperty(_classnames, ClassName.WITH_CONTROLS, allowControls && tableActive), _defineProperty(_classnames, ClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), _defineProperty(_classnames, ClassName.HOVERED_DELETE_BUTTON, isInDanger), _defineProperty(_classnames, ClassName.TABLE_SELECTED, isTableSelected(view.state.selection)),
|
|
445
|
+
className: classnames(ClassName.TABLE_CONTAINER, (_classnames = {}, _defineProperty(_classnames, ClassName.WITH_CONTROLS, allowControls && tableActive), _defineProperty(_classnames, ClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), _defineProperty(_classnames, ClassName.HOVERED_DELETE_BUTTON, isInDanger), _defineProperty(_classnames, ClassName.TABLE_SELECTED, isTableSelected(view.state.selection)), _classnames)),
|
|
443
446
|
editorView: view,
|
|
444
447
|
getPos: getPos,
|
|
445
448
|
node: node,
|
|
446
449
|
tableRef: tableRef,
|
|
447
450
|
containerWidth: containerWidth,
|
|
448
|
-
isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.isFullWidthModeEnabled,
|
|
449
451
|
isBreakoutEnabled: options === null || options === void 0 ? void 0 : options.isBreakoutEnabled,
|
|
450
452
|
isNested: isNested,
|
|
451
|
-
pluginInjectionApi: pluginInjectionApi
|
|
453
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
454
|
+
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled
|
|
452
455
|
}, stickyHeadersOptimization && /*#__PURE__*/React.createElement("div", {
|
|
453
456
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
454
457
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -1,10 +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
9
|
var getMarginLeft = function getMarginLeft(lineLength, tableWidth) {
|
|
9
10
|
var marginLeft;
|
|
10
11
|
if (tableWidth !== 'inherit' && lineLength) {
|
|
@@ -40,10 +41,9 @@ export var ResizableTableContainer = function ResizableTableContainer(_ref2) {
|
|
|
40
41
|
tableRef = _ref2.tableRef,
|
|
41
42
|
pluginInjectionApi = _ref2.pluginInjectionApi;
|
|
42
43
|
var containerRef = useRef(null);
|
|
43
|
-
var innerContainerRef = useRef(null);
|
|
44
44
|
var marginLeftRef = useRef(0);
|
|
45
45
|
var updateWidth = useCallback(function (width) {
|
|
46
|
-
if (!containerRef.current
|
|
46
|
+
if (!containerRef.current) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
var marginLeft = getMarginLeft(lineLength, width);
|
|
@@ -84,7 +84,6 @@ export var ResizableTableContainer = function ResizableTableContainer(_ref2) {
|
|
|
84
84
|
tableRef: tableRef,
|
|
85
85
|
displayGuideline: displayGuideline
|
|
86
86
|
}, /*#__PURE__*/React.createElement(InnerContainer, {
|
|
87
|
-
ref: innerContainerRef,
|
|
88
87
|
className: className,
|
|
89
88
|
node: node
|
|
90
89
|
}, children)));
|
|
@@ -96,14 +95,14 @@ export var TableContainer = function TableContainer(_ref3) {
|
|
|
96
95
|
_ref3$containerWidth = _ref3.containerWidth,
|
|
97
96
|
lineLength = _ref3$containerWidth.lineLength,
|
|
98
97
|
editorWidth = _ref3$containerWidth.width,
|
|
99
|
-
|
|
98
|
+
isTableResizingEnabled = _ref3.isTableResizingEnabled,
|
|
100
99
|
isBreakoutEnabled = _ref3.isBreakoutEnabled,
|
|
101
100
|
editorView = _ref3.editorView,
|
|
102
101
|
getPos = _ref3.getPos,
|
|
103
102
|
tableRef = _ref3.tableRef,
|
|
104
103
|
isNested = _ref3.isNested,
|
|
105
104
|
pluginInjectionApi = _ref3.pluginInjectionApi;
|
|
106
|
-
if (
|
|
105
|
+
if (isTableResizingEnabled && !isNested) {
|
|
107
106
|
return /*#__PURE__*/React.createElement(ResizableTableContainer, {
|
|
108
107
|
className: className,
|
|
109
108
|
node: node,
|
|
@@ -118,7 +117,9 @@ export var TableContainer = function TableContainer(_ref3) {
|
|
|
118
117
|
var tableWidth = isBreakoutEnabled ? calcTableWidth(node.attrs.layout, editorWidth) : 'inherit';
|
|
119
118
|
return /*#__PURE__*/React.createElement(InnerContainer, {
|
|
120
119
|
node: node,
|
|
121
|
-
className: className,
|
|
120
|
+
className: classNames(className, {
|
|
121
|
+
'less-padding': editorWidth < akEditorMobileBreakoutPoint
|
|
122
|
+
}),
|
|
122
123
|
style: {
|
|
123
124
|
width: tableWidth,
|
|
124
125
|
marginLeft: getMarginLeft(lineLength, tableWidth)
|
|
@@ -2,15 +2,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
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; }
|
|
4
4
|
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) { _defineProperty(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; }
|
|
5
|
-
import React, { useCallback,
|
|
5
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import rafSchd from 'raf-schd';
|
|
7
|
-
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
8
7
|
import { getGuidelinesWithHighlights } from '@atlaskit/editor-common/guideline';
|
|
9
|
-
import {
|
|
8
|
+
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
9
|
+
import { COLUMN_MIN_WIDTH, getColgroupChildrenLength, previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils';
|
|
10
10
|
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
11
|
+
import { TABLE_HIGHLIGHT_GAP, TABLE_SNAP_GAP } from '../ui/consts';
|
|
11
12
|
import { defaultGuidelines, defaultGuidelineWidths } from '../utils/guidelines';
|
|
12
13
|
import { findClosestSnap } from '../utils/snapping';
|
|
13
|
-
import { TABLE_SNAP_GAP, TABLE_HIGHLIGHT_GAP } from '../ui/consts';
|
|
14
14
|
var handles = {
|
|
15
15
|
right: true
|
|
16
16
|
};
|
|
@@ -12,21 +12,23 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { DOMSerializer } from 'prosemirror-model';
|
|
15
|
+
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
15
16
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
16
17
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
18
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
17
19
|
import { pluginConfig as getPluginConfig } from '../create-plugin-config';
|
|
18
20
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
19
21
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
20
22
|
import { pluginKey as tableResizingPluginKey } from '../pm-plugins/table-resizing';
|
|
21
|
-
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
22
23
|
import { generateColgroup } from '../pm-plugins/table-resizing/utils';
|
|
23
|
-
import {
|
|
24
|
-
import TableComponent from './TableComponent';
|
|
25
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
26
|
-
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
24
|
+
import { pluginKey as tableWidthPluginKey } from '../pm-plugins/table-width';
|
|
27
25
|
import { isTableNested } from '../utils';
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
import TableComponent from './TableComponent';
|
|
27
|
+
var tableAttributes = function tableAttributes(node, options, state, pos) {
|
|
28
|
+
// provide a width for tables when custom table width is supported
|
|
29
|
+
// this is to ensure 'responsive' tables (colgroup widths are undefined) become fixed to
|
|
30
|
+
// support screen size adjustments
|
|
31
|
+
var shouldHaveInlineWidth = (options === null || options === void 0 ? void 0 : options.isTableResizingEnabled) && !isTableNested(state, pos);
|
|
30
32
|
var style = shouldHaveInlineWidth ? "width: ".concat(getTableContainerWidth(node), "px") : undefined;
|
|
31
33
|
return {
|
|
32
34
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
@@ -42,7 +44,7 @@ var toDOM = function toDOM(node, props) {
|
|
|
42
44
|
if (props.allowColumnResizing) {
|
|
43
45
|
colgroup = ['colgroup', {}].concat(_toConsumableArray(generateColgroup(node)));
|
|
44
46
|
}
|
|
45
|
-
return ['table', tableAttributes(node, props.view.state, props.getPos()), colgroup, ['tbody', 0]];
|
|
47
|
+
return ['table', tableAttributes(node, props.options, props.view.state, props.getPos()), colgroup, ['tbody', 0]];
|
|
46
48
|
};
|
|
47
49
|
var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
48
50
|
_inherits(TableView, _ReactNodeView);
|
|
@@ -76,7 +78,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
76
78
|
if (!this.table) {
|
|
77
79
|
return;
|
|
78
80
|
}
|
|
79
|
-
var attrs = tableAttributes(node, this.view.state, this.getPos());
|
|
81
|
+
var attrs = tableAttributes(node, this.reactComponentProps.options, this.view.state, this.getPos());
|
|
80
82
|
Object.keys(attrs).forEach(function (attr) {
|
|
81
83
|
_this2.table.setAttribute(attr, attrs[attr]);
|
|
82
84
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import uuid from 'uuid';
|
|
5
4
|
import { DOMSerializer } from 'prosemirror-model';
|
|
6
|
-
import
|
|
5
|
+
import uuid from 'uuid';
|
|
6
|
+
import { getCellAttrs, getCellDomAttrs } from '@atlaskit/adf-schema';
|
|
7
7
|
var DEFAULT_COL_SPAN = 1;
|
|
8
8
|
var DEFAULT_ROW_SPAN = 1;
|
|
9
9
|
var TableCellNodeView = /*#__PURE__*/function () {
|
|
@@ -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
|
var createTableWithAnalytics = function createTableWithAnalytics(editorAnalyticsAPI) {
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
4
|
import { findParentDomRefOfType, findParentNodeOfType } from 'prosemirror-utils';
|
|
5
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
7
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
|
+
import { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenLayoutNodes } from '@atlaskit/editor-common/transforms';
|
|
9
|
+
import { browser, closestElement } from '@atlaskit/editor-common/utils';
|
|
6
10
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
7
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
9
11
|
import { addBoldInEmptyHeaderCells, clearHoverSelection, setTableRef } from '../commands';
|
|
12
|
+
import { transformSliceRemoveCellBackgroundColor, transformSliceToAddTableHeaders, transformSliceToRemoveColumnsWidths } from '../commands/misc';
|
|
10
13
|
import { handleBlur, handleClick, handleCut, handleFocus, handleMouseDown, handleMouseLeave, handleMouseMove, handleMouseOut, handleMouseOver, handleTripleClick, whenTableInFocus } from '../event-handlers';
|
|
11
14
|
import { createTableView } from '../nodeviews/table';
|
|
15
|
+
import TableCellNodeView from '../nodeviews/tableCell';
|
|
12
16
|
import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plugin';
|
|
13
17
|
import { fixTables, replaceSelectedTable } from '../transforms';
|
|
14
18
|
import { TableCssClassName as ClassName } from '../types';
|
|
15
19
|
import { findControlsHoverDecoration, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, transformSliceToRemoveOpenTable, updateResizeHandles } from '../utils';
|
|
16
|
-
import {
|
|
20
|
+
import { isHeaderRowRequired } from '../utils/paste';
|
|
17
21
|
import { defaultTableSelection } from './default-table-selection';
|
|
18
22
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
19
23
|
import { pluginKey } from './plugin-key';
|
|
20
|
-
import TableCellNodeView from '../nodeviews/tableCell';
|
|
21
|
-
import { transformSliceRemoveCellBackgroundColor, transformSliceToRemoveColumnsWidths, transformSliceToAddTableHeaders } from '../commands/misc';
|
|
22
|
-
import { transformSliceToRemoveOpenLayoutNodes } from '@atlaskit/editor-common/transforms';
|
|
23
|
-
import { transformSliceToRemoveOpenExpand } from '@atlaskit/editor-common/transforms';
|
|
24
|
-
import { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
|
|
25
|
-
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
26
|
-
import { isHeaderRowRequired } from '../utils/paste';
|
|
27
24
|
var isBreakoutEnabled;
|
|
28
25
|
var isFullWidthModeEnabled;
|
|
29
26
|
var wasFullWidthModeEnabled;
|
|
30
|
-
|
|
27
|
+
var isTableResizingEnabled;
|
|
28
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, breakoutEnabled, fullWidthModeEnabled, tableResizingEnabled, previousFullWidthModeEnabled, editorAnalyticsAPI, pluginInjectionApi) {
|
|
31
29
|
var _window;
|
|
32
30
|
isBreakoutEnabled = breakoutEnabled;
|
|
33
31
|
isFullWidthModeEnabled = fullWidthModeEnabled;
|
|
34
32
|
wasFullWidthModeEnabled = previousFullWidthModeEnabled;
|
|
33
|
+
isTableResizingEnabled = tableResizingEnabled;
|
|
35
34
|
var state = createPluginState(dispatch, _objectSpread({
|
|
36
35
|
pluginConfig: pluginConfig,
|
|
37
36
|
insertColumnButtonIndex: undefined,
|
|
@@ -231,7 +230,8 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
231
230
|
return createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
232
231
|
isBreakoutEnabled: isBreakoutEnabled,
|
|
233
232
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
234
|
-
wasFullWidthModeEnabled: wasFullWidthModeEnabled
|
|
233
|
+
wasFullWidthModeEnabled: wasFullWidthModeEnabled,
|
|
234
|
+
isTableResizingEnabled: isTableResizingEnabled
|
|
235
235
|
}, getEditorContainerWidth, getEditorFeatureFlags, pluginInjectionApi);
|
|
236
236
|
}
|
|
237
237
|
}),
|
package/dist/esm/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 var tableSafariDeleteCompositionTextIssueWorkaroundKey = new PluginKey('tableSafariDeleteCompositionTextIssueWorkaround');
|
|
10
10
|
export var createPlugin = function createPlugin() {
|
|
11
11
|
return new SafePlugin({
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import debounce from 'lodash/debounce';
|
|
5
|
+
import throttle from 'lodash/throttle';
|
|
4
6
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
5
7
|
import { mapChildren } from '@atlaskit/editor-common/utils';
|
|
6
8
|
import { TableCssClassName as ClassName, TableCssClassName } from '../../../types';
|
|
@@ -9,8 +11,6 @@ import { pluginKey as tablePluginKey } from '../../plugin-key';
|
|
|
9
11
|
import { syncStickyRowToTable, updateStickyMargins as updateTableMargin } from '../../table-resizing/utils/dom';
|
|
10
12
|
import { updateStickyState } from '../commands';
|
|
11
13
|
import { getTop, getTree } from './dom';
|
|
12
|
-
import debounce from 'lodash/debounce';
|
|
13
|
-
import throttle from 'lodash/throttle';
|
|
14
14
|
|
|
15
15
|
// limit scroll event calls
|
|
16
16
|
var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
|
|
@@ -17,10 +17,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
21
20
|
import { PluginKey } from 'prosemirror-state';
|
|
22
21
|
import rafSchedule from 'raf-schd';
|
|
23
22
|
import { uuid } from '@atlaskit/adf-schema';
|
|
23
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
24
24
|
import { stepHasSlice } from '@atlaskit/editor-common/utils';
|
|
25
25
|
var pluginKey = new PluginKey('tableLocalIdPlugin');
|
|
26
26
|
var getPluginState = function getPluginState(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 var evenColumns = function evenColumns(_ref) {
|
|
6
6
|
var resizeState = _ref.resizeState,
|
|
7
7
|
table = _ref.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 var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI) {
|
|
13
13
|
var state = view.state,
|
|
14
14
|
dispatch = view.dispatch;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { DOMSerializer } from 'prosemirror-model';
|
|
3
|
-
import { getFragmentBackingArray } from '@atlaskit/editor-common/utils';
|
|
4
3
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
4
|
+
import { getFragmentBackingArray } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
export var generateColgroup = function 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 var updateControls = function updateControls(getEditorFeatureFlags) {
|
|
9
9
|
return function (state) {
|
|
@@ -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) {
|
|
9
8
|
var containerWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|